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:
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user