|
|
|
@ -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() |
|
|
|
@ -437,10 +436,8 @@ def main(): |
|
|
|
|
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() |
|
|
|
|
|
|
|
|
|