ChaoticNebula
ChaoticNebula

Reputation: 263

Is there anyway to change discord.py bot's status from streaming to playing?

I am making a discord bot and have made a changing status for my bot. Is there anyway that I can change the bot's streaming activity to playing? Here is the code :-

@client.event
async def on_ready():
  client.loop.create_task(status_task())
  print("Bot is Ready!)

async def status_task():
    while True:
        await client.change_presence(activity=discord.Streaming(name="stream", url='https://www.twitch.tv/discord'))

        await asyncio.sleep(30) 
        await client.change_presence(activity=discord.Streaming(name="!help", url='https://www.twitch.tv/discord'))
        await asyncio.sleep(30)
        await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="a game"))
        await asyncio.sleep(30)

Upvotes: 0

Views: 196

Answers (1)

Ceres
Ceres

Reputation: 2658

You can use discord.Game

await client.change_presence(activity=discord.Game(name='a game')

References:

Upvotes: 1

Related Questions