Last active
May 13, 2023 06:58
-
-
Save Hunter87ff/9244a73ac6a3529d5a7e7845b284c4f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afks = [] | |
bot = "" | |
async def afk_filter(message): | |
now = message.created_at | |
for i in afks: | |
if message.author.id == i["id"]: | |
time = str(now-i['time']).split(".")[0] | |
afks.remove(i) | |
return await message.reply(f"Your Afk Is Disabled After {time} ") | |
if message.author.id != i["id"] and f'<@{i["id"]}>' in message.content: | |
time = str(now-i['time']).split(".")[0] | |
return await message.reply(f"he is for {time}") | |
@bot.command() | |
async def afk(ctx, *, message=None): | |
now = ctx.message.created_at | |
for i in afks: | |
if i["id"] == ctx.author.id: | |
time = str(now-i['time']).split(".")[0] | |
await ctx.send(f"Your Afk Is Disabled After {time} ") | |
afks.remove(i) | |
if not message: | |
message = "Is Afk" | |
data = { | |
"id" : ctx.author.id, | |
"msg" : message, | |
"time" : ctx.message.created_at | |
} | |
afks.append(data) | |
return await ctx.send(f"{ctx.author} is Afk") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment