cela peut être difficile pour moi, mais je crois à la puissance de stackoverflow,
Je veux changer le statut du bot de lecture à regarder. J'essaye ceci mais il joue toujours le statut.
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')
4 Réponses :
Selon ce problème , l'argument de mot-clé de jeu dans Client.change_presence a été renommé activité afin que votre code ressemble à
activity = discord.Game(name="Just") await client.change_presence(status=discord.Status.idle, activity=activity)
Le bot peut toujours Playing X
ou à Streaming Y
, mais PAS un statut personnalisé
# 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"))
import discord from discord.ext import commands import datetime from urllib import parse, request import re bot = commands.Bot(command_prefix='prefix here', description="desc here") @bot.event async def on_ready(): await bot.change_presence(activity=discord.Streaming(name="to keep it a secret", url="http://www.twitch.tv/dheeran2010")) print('Im Ready') bot.run('Token here')
veuillez corriger le formatage et expliquer comment cela répond à la question