Answer the question
In order to leave comments, you need to log in
Why is activity tracking not working in the Discord.py card?
Constantly writes that he is not online, although the user is just online
@bot.command()
async def info(ctx,member:discord.Member = None, guild: discord.Guild = None):
await ctx.message.delete()
if member == None:
emb = discord.Embed(title="Информация о пользователе", color=ctx.message.author.color)
emb.add_field(name="Имя:", value=ctx.message.author.display_name,inline=False)
emb.add_field(name="Айди пользователя:", value=ctx.message.author.id,inline=False)
t = ctx.message.author.status
if t == discord.Status.online:
d = " В сети"
t = ctx.message.author.status
if t == discord.Status.offline:
d = "⚪ Не в сети"
t = ctx.message.author.status
if t == discord.Status.idle:
d = " Не активен"
t = ctx.message.author.status
if t == discord.Status.dnd:
d = " Не беспокоить"
Answer the question
In order to leave comments, you need to log in
Try like this:
t = ctx.message.author.status
if str(t) == 'online':
d = "✅В сети"
if member.is_on_mobile():
d = "✅В сети\nС телефона"
elif str(t) == 'offline':
d = " Не в сети"
elif str(t) == 'idle':
d = "Неактивен"
elif str(t) == 'dnd':
d = "Не беспокоить"
On the developers page, in the Bot tab, enable:
Next, where you bot = commands.Bot(
replace with this:
bot = commands.Bot(command_prefix="Your Prefix", intents=discord.Intents.all())
I had a similar issue . See my code and explanations in the comments.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question