From cae3404ca9aeb397983023c13eb585e0b242fa6e Mon Sep 17 00:00:00 2001 From: Tristan Gosselin-Hane Date: Wed, 7 Nov 2018 18:15:48 -0500 Subject: [PATCH] Some PEP-8 styling improvements --- webhook-bridge.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/webhook-bridge.py b/webhook-bridge.py index 4060c50..4999d1b 100755 --- a/webhook-bridge.py +++ b/webhook-bridge.py @@ -193,7 +193,7 @@ def main(): config.mc_server, config.mc_port, auth_token=auth_token, handle_exception=minecraft_handle_exception) - #Initialize the discord part + # Initialize the discord part discord_bot = discord.Client() def register_handlers(connection): @@ -276,7 +276,6 @@ def main(): async def on_ready(): logging.info("Discord bot logged in as {} ({})".format(discord_bot.user.name, discord_bot.user.id)) - @discord_bot.event async def on_message(message): # We do not want the bot to reply to itself @@ -382,7 +381,7 @@ def main(): return elif message.content.startswith("mc!"): - # Chatch-all + # Catch-all send_channel = message.channel if isinstance(message.channel, discord.abc.GuildChannel): await message.delete() @@ -436,11 +435,9 @@ def main(): send_channel = message.author.dm_channel msg = "Unable to send chat message: there is no Minecraft account linked to this discord account, please run `mc!register`." await send_channel.send(msg) - discord_bot.run(config.discord_token) - + if __name__ == "__main__": - main() - + main() \ No newline at end of file