SonG0D
SonG0D

Reputation: 35

Discord.py: How do I put a status on a discord bot?

What I have so far, where the #s are are where I might want to place them. of course, in your answer please pick a different location.

The top is cut off:

@client.event
async def on_ready():
    print('Bot is open {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return

   #status thing here?
    if message.content.startswith('gf!ami'):
        await message.channel.send('Hello!')
    if message.content.startswith('gf!help'):
        await message.channel.send(h)
    if message.content.startswith('gf!SEhelp'):
        await message.channel.send(sh)
    if message.content.startswith('gf!music'):
        await message.channel.send
        ("https://open.spotify.com/playlist/49ddWzhNmWxyMuYlvu8L5Z?si=jYlh6zK9RryKSeMlvKZ3yA")
    if message.content.startswith('gf!d6'):
        await message.channel.send(d6())
    if message.content.startswith('gf!cl'):
        await message.channel.send(cl)
    #Status thing here?
client.run('bot token')

Upvotes: 0

Views: 239

Answers (1)

Mixno
Mixno

Reputation: 412

Check out documentation for presence updating https://discordpy.readthedocs.io/en/v0.16.12/api.html#discord.Client.change_presence

For example, you should make something like that:

await client.change_presence(game=discord.Game(type=1, url="https://www.twitch.tv/tomori_bot", name="Follow me on twitch ^_^"))

You can see full example there: https://github.com/TomoriBot/Tomori/blob/master/tomori.py at statuses() function

Upvotes: 1

Related Questions