purge command added for owner

This commit is contained in:
esef committed 2026-06-23 18:37:26 +03:00
1 parent 2fc735d148
commit 21d9fd0ec6
2 files changed
+26 -2

No files matched your search

+8
View File
@@ -1,3 +1,4 @@
from aiohttp import client_exceptions
from discord.ext import commands
import os
import aiohttp
@@ -56,6 +57,13 @@ class General(commands.Cog):
await ctx.reply(f'could not fetch weather for {city}')
except Exception as e:
await ctx.reply(f'weather fetch failed: {e}')
@commands.command()
async def purge(self, ctx, amount: int):
if ctx.author.id != int(os.getenv('OWNER_ID')):
return
await ctx.channel.purge(limit=amount + 1)
async def setup(bot):
await bot.add_cog(General(bot))
+18 -2
View File
@@ -1,3 +1,19 @@
#this is where scary stuff where you put your credentials keys etc goes
#this is where scary stuff where you put your credentials keys etc goes
DISCORD_TOKEN="yo token here"
DISCORD_TOKEN="yo token here"
#telegram things
TELEGRAM_BOT_TOKEN="yo token here"
DISCORD_CHANNEL_ID="yo channel id for forwarding here"
DISCORD_WEBHOOK_URL="yo channel webhook here"
TELEGRAM_GROUP_ID="yo telegram group id here"
#twitter things
TWITTER_RSS_URL="yo nitter id here"
TWITTER_DISCORD_WEBHOOK="yo discord twitter channel here"
#strinova stats voice channel
STRINOVA_STAT_CHANNEL_ID="yo strinova stat channel here"
#me (for purging and other owner only things)
OWNER_ID="your discord servers owner id here"