Closed Auth1337 closed 1 year ago
I recommend calling discord.Client
with the activity=
keyword as on_ready
may be called many times.
.
guys this is still not fixed
Unreproducible.
Unreproducible.
below is the code for adding the presence after making the bot online, and above you can see in the photo the presence is not added, this is only happening in the 2.0 version and the 1.9.2 works perfectly well with this code adding the presence after all the necessary activity information is provided.
import asyncio
import aiohttp
import random
import discord
import time
from discord.ext import commands
bot = commands.Bot(self_bot=True, command_prefix='!')
bot.remove_command('help')
@bot.event
async def on_ready():
print(f'{bot.user} logged in.')
activity = discord.Activity(name='thename', type=discord.ActivityType.playing, application_id=0000, timestamps={'start': time.time() * 1000})
await bot.change_presence(status=discord.Status.idle, activity=activity)
bot.run("token")
@dolfies this still hasn't been fixed
having the same issue, debug logs gave me this
When using discord.Activity()
:
[22/04/2023 53:04:23] [DEBUG] Sending "{"op":3,"d":{"activities":[{"flags":0,"type":0,"name":"hello world","buttons":[]}],"afk":false,"since":0,"status":"dnd"}}" to change presence.
[22/04/2023 53:04:23] [DEBUG] Dispatching event command_completion.
[22/04/2023 53:04:23] [DEBUG] Gateway event: {'t': 'SESSIONS_REPLACE', 's': 23, 'op': 0, 'd': [{'status': 'dnd', 'session_id': 'xxxxxxxxxxxxxxxxxxxxxxxx', 'client_info': {'version': 0, 'os': 'linux', 'client': 'web'}, 'activities': []}, {'status': 'dnd', 'session_id': 'xxxxxxxxxxxxxxxxxxxxxxxx', 'client_info': {'version': 0, 'os': 'windows', 'client': 'web'}, 'activities': []}]}.
When using discord.Game()
:
[22/05/2023 53:05:23] [DEBUG] Sending "{"op":3,"d":{"activities":[{"type":0,"name":"hello world","timestamps":{}}],"afk":false,"since":0,"status":"dnd"}}"
to change presence.
[22/05/2023 53:05:23] [DEBUG] Dispatching event command_completion.
[22/05/2023 53:05:23] [DEBUG] Gateway event: {'t': 'SESSIONS_REPLACE', 's': 27, 'op': 0, 'd': [{'status': 'dnd', 'session_id': 'all', 'client_info': {'version': 0, 'os': 'unknown', 'client': 'unknown'}, 'activities': [{'type': 0, 'timestamps': {}, 'name': 'hello world', 'id': 'xxxxxxxxxxxx'', 'created_at': 1703286377248}], 'active': True}, {'status': 'dnd', 'session_id': ''xxxxxxxxxxxxxxxxxxxxxxxx', 'client_info': {'version': 0, 'os': 'linux', 'client': 'web'}, 'activities': []}, {'status': 'dnd', 'session_id': ''xxxxxxxxxxxxxxxxxxxxxxxx'', 'client_info': {'version': 0, 'os': 'windows', 'client': 'web'}, 'activities': [{'type': 0, 'timestamps': {}, 'name': 'hello world', 'id': 'xxxxxxxxxxxx', 'created_at': 1703286377248}]}]}.
Summary
change_presence is broken doesn't work any activity
Reproduction Steps
change_presence is broken doesn't work any activity on it except discord.Game and they are working in discord.py-self 1.9.2 version.
Code
Expected Results
expected activity as watching but nothing happened no error and only status changed to idle
Actual Results
nothing no errors, only status changed to idle
System Information
Checklist
Additional Information
change_presence is broken doesn't work any activity on it except discord.Game and they are working in discord.py-self 1.9.2 version