Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change discord.py bot activity

it may hard to me, but i believe on stackoverflow power,

I want to change the bot status from playing to watching. I try this but it still playing status.

code:

import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio

PREFIX = ("$")
bot = commands.Bot(command_prefix=PREFIX, description='Hi')

@bot.event
async def on_ready():
    activity = discord.Game(name="Netflix", type=3)
    await bot.change_presence(status=discord.Status.idle, activity=activity)
    print("Bot is ready!")

bot.run('TOKEN')
like image 788
Squv Avatar asked Dec 01 '19 13:12

Squv


People also ask

Is discord.py getting discontinued?

Discord py is getting discontinued because Discord implemented more and more restrictions for Bot Developers, promised easy verification steps but is behind verification processes by months. Yet introducing more restrictions and now requiring even ID copies.

Does discord.py support slash commands?

discord.py does not support slash commands and will never add support for slash commands (as it has shut down) thus I recommend disnake (a popular fork).

How do I change my status on Discord?

Launch the Discord app and at the bottom-right, tap on your user profile to open the User Settings menu. Select Set Status. To update your status, tap on one of the options, and your status will update straightaway.


1 Answers

You can use this Ezz!

# Setting `Playing ` status
await bot.change_presence(activity=discord.Game(name="a game"))

# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))

# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
like image 88
Squv Avatar answered Sep 20 '22 01:09

Squv