purge command added for owner
This commit is contained in:
1 parent
2fc735d148
commit
21d9fd0ec6
2 files changed
+24
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
|
from aiohttp import client_exceptions
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import os
|
import os
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@@ -57,6 +58,13 @@ class General(commands.Cog):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
await ctx.reply(f'weather fetch failed: {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):
|
async def setup(bot):
|
||||||
await bot.add_cog(General(bot))
|
await bot.add_cog(General(bot))
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
Reference in new issue
Block a user