Skip to content

Commit 893e7c2

Browse files
authored
Merge pull request #114 from PyBotDevs/afk-alert-event
Trigger AFK Alert on AFK user mention
2 parents 01e476c + 91da307 commit 893e7c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ async def on_message(ctx):
113113
if z in str(ctx.author.id): pass
114114
else: items[str(ctx.author.id)][str(z)] = 0
115115
save()
116+
uList = list()
117+
for x in user_presence[str(ctx.guild.id)].keys(): uList.append(x)
118+
for i in uList:
119+
if i in ctx.content and not ctx.author.bot:
120+
fetch_user = client.get_user(id(i))
121+
await ctx.channel.send(f"{fetch_user.display_name} went AFK <t:{math.floor(user_presence[str(ctx.guild.id)][str(i)]['time'])}:R>: {user_presence[str(ctx.guild.id)][str(i)]['response']}")
116122
if str(ctx.author.id) in user_presence[str(ctx.guild.id)]:
117123
del user_presence[str(ctx.guild.id)][str(ctx.author.id)]
118124
save()

0 commit comments

Comments
 (0)