#on_raw_member_update(member) with timeout?

1 messages · Page 1 of 1 (latest)

wild rapids
#

Hello i was wondering if when manually timeouting or removing timeout on people can be on non cached members. Any idea?

wild rapids
# willow bay I'm not sure what the issue is

for example lets say i give user timeout. could it be that the user is not cached? so i can only retrieve his update via on_raw_member_update? im working on logging module and it would be good to know if i can use the on_memeber_update rather than the on_raw

willow bay
#

Did you try reading the docs?

#

They're quite clear on when both of those events fire

wild rapids
# willow bay Did you try reading the docs?

okay so there can be uncached user that can get timeout, simple as that seemsGood
I read the docs just wasnt sure if it also implies to timeout, how can you timeout someone you most likely dont see on server because he is not cached

willow bay
#

Dude what?

strong sail
grave quarry
#

-d disnake.Guild.timeout

night nestBOT
#

await timeout(user, *, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Times out the member from the guild; until then, the member will not be able to interact with the guild.

Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.

The user must meet the [`abc.Snowflake`](https://docs.disnake.dev/en/latest/api/abc.html#disnake.abc.Snowflake "disnake.abc.Snowflake") abc.

You must have the [`moderate_members`](https://docs.disnake.dev/en/latest/api/permissions.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.

New in version 2.3.
grave quarry
#

so yes your Bot can receive an event regarding a user who is not cached

wild rapids
willow bay
#

What does that have to do with bot cache?

grave quarry
willow bay
#

In the over 24 hours since you posted you could have created a second discord user, invited them to your server, and timed them out and checked for yourself .

wild rapids
#

I guess its better if I explain what im trying to do,
My aim is to create a logging module where if moderator times out someone i can log the creation of timeout, duration, but from raw update i dont think its possible

grave quarry
willow bay
#

Well yeah.. that's the entire point of raw events

wild rapids
willow bay
#

There is only one point of view. It either works or don't work. Raw events are always fired, cache or no cache

grave quarry
wild rapids
strong sail
#

I did same think, it's possible 100%

grave quarry
#

-d disnake.Guild.audit_logs

night nestBOT
#

async for ... in audit_logs(*, limit=100, before=None, after=None, user=None, action=None, oldest_first=False)```
Returns an [`AsyncIterator`](https://docs.disnake.dev/en/latest/api/misc.html#disnake.AsyncIterator "disnake.AsyncIterator") that enables receiving the guild’s audit logs.

You must have [`view_audit_log`](https://docs.disnake.dev/en/latest/api/permissions.html#disnake.Permissions.view_audit_log "disnake.Permissions.view_audit_log") permission to use this.

Entries are returned in order from newest to oldest by default; pass `oldest_first=True` to reverse the iteration order.

Examples

Getting the first 100 entries...
grave quarry
#

then

#

-d disnake.AuditLogAction.member_update

night nestBOT
#

A member has updated. This triggers in the following situations:

• A nickname was changed

• They were server muted or deafened (or it was undone)

• They were timed out

When this is the action, the type of target is the Member or User who got updated. If the user is not found then it is a Object with the user’s ID...

grave quarry
#

for the duration you do the audit log created at minus timeout

wild rapids
#

yes, thanks, I just couldn't describe properly my situation and made dlchamp mad rtzW

strong sail