Created
July 18, 2016 05:04
-
-
Save SkyLeite/9317efa5c3b494ca9bb76bef1fe5c66d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for item in eq_channels['channels']: #reads every channel on eq_channels.json | |
| if client.get_channel(item): #checks if the channel exists | |
| channel = client.get_channel(item) | |
| await client.send_message(discord.Object(item), message) #sends message to channel if it does | |
| if client.get_channel(test_channel): #checks if test_channel exists (logging channel) | |
| await client.send_message(discord.Object(test_channel), 'EQ Alert sent to: ``%s`` (%s)' % ( | |
| channel.server.name, channel.server.id)) #sends 'EQ Alert sent to: (servername)' to logging channel | |
| else: #if eq channel doesn't exist, removes it | |
| msg = ':mega: **Alert!**\n Channel %s does not exist. Removing...' % item | |
| if client.get_channel(test_channel): | |
| await client.send_message(discord.Object(test_channel), msg) | |
| await removeEQChannel(item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment