1
0
mirror of https://gitlab.com/ddorn/tfjm-discord-bot.git synced 2025-07-05 03:04:03 +02:00

:refactor: + change joke format, use psutil for uptime

This commit is contained in:
ddorn
2020-04-30 11:44:17 +02:00
parent 34fc5e3c60
commit 3bfad6e0a9
6 changed files with 57 additions and 46 deletions

View File

@ -48,7 +48,7 @@ class MiscCog(Cog, name="Divers"):
async def joke_cmd(self, ctx):
await ctx.message.delete()
with open(File.JOKES) as f:
jokes = f.read().split("\n\n\n")
jokes = f.read().split("---")
msg = random.choice(jokes)
message: discord.Message = await ctx.send(msg)

View File

@ -12,7 +12,6 @@ __all__ = [
"DIEGO",
"TOURNOIS",
"EMBED_COLOR",
"START_TIME",
"File",
"Emoji",
]
@ -29,7 +28,6 @@ if TOKEN is None:
print()
quit(1)
START_TIME = time()
GUILD = "690934836696973404"
DIEGO = "Diego" # Mon display name
TEAMS_CHANNEL_CATEGORY = "Channels d'équipes"

View File

@ -1,3 +1,4 @@
import psutil
from discord import Message
from discord.ext.commands import Context, Bot
@ -16,5 +17,9 @@ async def send_and_bin(bot: Bot, ctx: Context, msg=None, *, embed=None):
await msg
def start_time():
return psutil.Process().create_time()
def setup(bot):
bot.send_and_bin = send_and_bin