Skip to content

Instantly share code, notes, and snippets.

@Hunter87ff
Last active May 13, 2023 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hunter87ff/9244a73ac6a3529d5a7e7845b284c4f5 to your computer and use it in GitHub Desktop.
Save Hunter87ff/9244a73ac6a3529d5a7e7845b284c4f5 to your computer and use it in GitHub Desktop.
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