add support for op 2
This commit is contained in:
parent
d40b8dfcaa
commit
d725403509
4 changed files with 58 additions and 5 deletions
|
@ -82,7 +82,6 @@ class Admin(Cog):
|
|||
m = ctx.send(f':ok_hand: Reloaded `{ext}`')
|
||||
self.bot.loop.create_task(m)
|
||||
|
||||
|
||||
@commands.command(typing=True)
|
||||
async def sql(self, ctx, *, statement: no_codeblock):
|
||||
"""Execute SQL."""
|
||||
|
|
30
bot/ext/rsudo.py
Normal file
30
bot/ext/rsudo.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import logging
|
||||
|
||||
import discord
|
||||
|
||||
from .common import Cog
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Rsudo(Cog):
|
||||
def __init__(self, bot):
|
||||
super().__init__(bot)
|
||||
|
||||
async def create_request(self, message):
|
||||
# parse it, follows format command,uid
|
||||
uid = message.split(',')[-1]
|
||||
command = ','.join(message.split(',')[:-1])
|
||||
|
||||
log.info(f'[rsudo] {uid!r} {command!r}')
|
||||
|
||||
if not self.command_channel:
|
||||
return
|
||||
|
||||
e = discord.Embed(title=f'rsudo from uid {uid}')
|
||||
e.add_field(name='command', value=f'`{command}`')
|
||||
await self.command_channel.send(embed=e)
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Rsudo(bot))
|
Loading…
Add table
Add a link
Reference in a new issue