chore: initial commit

This commit is contained in:
2024-12-30 03:01:21 -05:00
commit 47955cdfd5
15 changed files with 1322 additions and 0 deletions

23
commands/tools.py Normal file
View File

@@ -0,0 +1,23 @@
import re
import commands
async def clear(message):
tokens = commands.tokenize(message.content)[1:]
if len(tokens) < 2:
await message.reply("no count and/or regex supplied!", mention_author=False)
return
message_count = len(
await message.channel.purge(
limit=int(tokens[0]), check=lambda m: re.match(tokens[1], m.content)
)
)
try:
await message.reply(
f"successfully purged **{message_count} {'message' if message_count == 1 else 'messages'}**",
mention_author=False,
)
except:
pass