🎨 - Massive code cleaning

This commit is contained in:
Florian Sylvain
2021-04-01 23:15:43 +02:00
parent 37115cb362
commit 53ccad4f1e
9 changed files with 102 additions and 100 deletions
+6 -9
View File
@@ -1,9 +1,8 @@
from discord.ext import commands
from datetime import datetime
from __main__ import startup_date
import os, sys
import os
import sys
import discord
import asyncio
from discord.ext import commands
from __main__ import startup_date
class OwnerCmds(commands.Cog, name='Owner commands'):
@@ -16,7 +15,6 @@ class OwnerCmds(commands.Cog, name='Owner commands'):
self.bot.load_extension('ext.' + extension)
await ctx.send("Extension loaded.")
@commands.command(hidden=True, ignore_extra=False)
@commands.is_owner()
async def unloadext(self, ctx, extension):
@@ -29,14 +27,13 @@ class OwnerCmds(commands.Cog, name='Owner commands'):
result = str(os.popen('git pull').read())
await ctx.send('``' + result + '``')
if 'Already up to date' not in result:
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
@commands.command(hidden=True)
@commands.is_owner()
async def getlogs(self, ctx):
await ctx.send('Logs since ' + startup_date.strftime("``[%d-%m-%y | %H:%M:%S]``"),
file=discord.File('logs.txt'))
file=discord.File('logs.txt'))
def setup(bot):