viewing paste Unknown #29291 | Python

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
@client.event
async def on_message(message):
    if message.content.startswith('!lasteq'):
        await showLastEQ(client, message)
 
    elif message.content.startswith == ('!discord'):
        await client.send_message(message.channel, '`The Herd:` https://discord.gg/xPVkjNn')
 
    elif message.content.startswith('!servers'):
        servers = []
 
        for item in client.servers:
            servers.append('%s(%d)' % (item.name, item.member_count))
 
        string = ', '.join(servers)
        await client.send_message(message.channel, 'Servers: %s' % string)
 
    elif message.content.startswith('!game'):
        if message.author.id == ownerid:
            gamename = message.content.split(' ', 1)[1]
 
            game = discord.Game(name=gamename)
            await client.change_status(game, idle=False)
        else:
            await client.send_message(message.channel, 'Your ID:%s \nOwner ID:%s' % (message.author.id, ownerid))
 
 
    elif message.content.startswith('!eq'):
        admin = 'False'
 
        if message.content == '!eq enable':
            for item in message.author.roles:
                if item.name == "Broadcaster":
                    await addEQChannel(message, client)
                    admin = 'True'
            if admin == 'False':
                await client.send_message(message.channel, "You need the 'Broadcaster' role to do that.")
 
 
        elif message.content == '!eq disable':
            for item in message.author.roles:
                if item.name == "Broadcaster":
                    await removeEQChannel(message.channel.id)
                    await client.send_message(message.channel, 'EQ Alerts successfully disabled on this channel.')
                    admin = 'True'
            if admin == 'False':
                await client.send_message(message.channel, "You need the 'Broadcaster' role to do that.")
 
        else:
            await client.send_message(message.channel,
                                      "Welcome to Minuette's Emergency Quest Alert! To get started, please type !eq enable on the channel you want EQs to appear. Please keep in mind you need the 'Broadcaster' role to do that.")
 
 
Viewed 432 times, submitted by unknown.