I want to write a bot, which would bring a message to the console, when someone comes into the network on my digit server.
But I can not get participants online.
Member.Status returns “offline” for those who are online and not online. In the docks Discord Py, I did not find a function that would return only online users
import discord
from discord.ext import commands
INTENTS = Discord.intens.Default ()
INTENTS.MEMBERS = TRUE.
Token = 'My Bot Token'
Client = Discord.client (Intens = Intens)
@ Client.Event.
ASYNC DEF ON_REDY ():
For Server In Client.Guilds:
Print (Server)
For Member in Server.members:
Print (Member, "-", Member.Status)
Client.Run (Token)
Answer 1, Authority 100%
Here is a list of users online, IDLE, OFFLINE, DND
mbr = ctx.guild.members
Online = Len (List (Lambda X: X.Status == discord.status.online, MBRS)))
Idle = Len (List (Lambda X: X.Status == Discord.Status.idle, MBRS)))
Offline = Len (List (Lambda X: X.Status == discord.status.offline, MBRS)))
DND = LEN (LIST (LAMBDA X: X.Status == discord.status.dnd, mbr)))