mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2025-07-03 04:21:27 +00:00
Update and rename Miscellaneous.py to miscellaneous.py
This commit is contained in:
parent
91356aa012
commit
d8313a1a73
1 changed files with 3 additions and 2 deletions
35
commands/miscellaneous.py
Normal file
35
commands/miscellaneous.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
import discord
|
||||
import asyncio
|
||||
|
||||
from discord.ext import commands
|
||||
from checks import *
|
||||
|
||||
class Miscellaneous(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@is_dev()
|
||||
@commands.command(pass_context=True)
|
||||
async def killbot(self, ctx):
|
||||
em = discord.Embed()
|
||||
em.description = 'Bot offline.'
|
||||
await ctx.send(embed=em)
|
||||
await self.bot.logout()
|
||||
return
|
||||
|
||||
@is_dev()
|
||||
@commands.command(name='debug')
|
||||
async def debug(self, ctx, *, cmd):
|
||||
'Executes a line of code'
|
||||
try:
|
||||
result = eval(cmd)
|
||||
if asyncio.iscoroutine(result):
|
||||
result = await result
|
||||
await ctx.send(f'''```py
|
||||
{result}```''')
|
||||
except Exception as e:
|
||||
await ctx.send(f'''```py
|
||||
{type(e).__name__}: {e}```''')
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Miscellaneous(bot))
|
Loading…
Add table
Add a link
Reference in a new issue