tuxbot-bot/cogs/admin.py

27 lines
694 B
Python
Raw Normal View History

from discord.ext import commands
from bot import TuxBot
2018-12-03 01:26:23 +01:00
2019-05-30 00:59:20 +02:00
class Admin(commands.Cog):
def __init__(self, bot: TuxBot):
2019-05-30 00:59:20 +02:00
self.bot = bot
async def cog_check(self, ctx: commands.Context):
permissions = ctx.channel.permissions_for(ctx.author)
return permissions.administrator
2019-05-30 00:59:20 +02:00
"""---------------------------------------------------------------------"""
@commands.command(name='say', pass_context=True)
async def _say(self, ctx: commands.Context, *, to_say: str):
# try:
await ctx.message.delete()
await ctx.send(to_say)
# except:
# await ctx.send(to_say)
2019-05-30 00:59:20 +02:00
def setup(bot: TuxBot):
2019-05-30 00:59:20 +02:00
bot.add_cog(Admin(bot))