Created
July 18, 2016 05:03
-
-
Save SkyLeite/8d49196a4cf734e824f5f55082beedd0 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