mirror of
https://github.com/myned/watcher.git
synced 2024-11-01 12:22:38 +00:00
Fix error on webhook events
This commit is contained in:
parent
0ffc546d34
commit
17cdd3e7b9
1 changed files with 11 additions and 5 deletions
|
@ -44,8 +44,8 @@ async def on_ready(event):
|
|||
|
||||
# Check activity and update timestamp
|
||||
async def update_activity(event, member):
|
||||
# Exclude bots and other guilds
|
||||
if member.is_bot or event.guild_id != c.config["guild"]:
|
||||
# Exclude other guilds
|
||||
if event.guild_id != c.config["guild"]:
|
||||
return
|
||||
|
||||
# Exclude and remove activity roles from excluded role
|
||||
|
@ -69,18 +69,24 @@ async def update_activity(event, member):
|
|||
# Listener for guild messages
|
||||
@plugin.listener(hikari.GuildMessageCreateEvent)
|
||||
async def on_message(event):
|
||||
# Exclude bots and webhooks
|
||||
if event.is_human:
|
||||
await update_activity(event, event.member)
|
||||
|
||||
|
||||
# Listener for guild typing
|
||||
@plugin.listener(hikari.GuildTypingEvent)
|
||||
async def on_typing(event):
|
||||
# Exclude bots
|
||||
if not event.member.is_bot:
|
||||
await update_activity(event, event.member)
|
||||
|
||||
|
||||
# Listener for voice state
|
||||
@plugin.listener(hikari.VoiceStateUpdateEvent)
|
||||
async def on_voice(event):
|
||||
# Exclude bots
|
||||
if not event.state.member.is_bot:
|
||||
await update_activity(event, event.state.member)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue