mostly working idfk

This commit is contained in:
WhatDidYouExpect 2025-07-23 15:47:29 +02:00
parent b0ba03f97d
commit 4e111b410d
12 changed files with 822 additions and 291 deletions

View file

@ -37,29 +37,27 @@ def is_positive(sentence):
return sentiment_score > 0.6 # had to raise the bar because it kept saying "death to jews" was fine and it kept reacting to them
async def send_message(ctx, message=None, embed=None, file=None, edit=False, message_reference=None):
if edit and message_reference:
try:
try:
if edit and message_reference:
await message_reference.edit(content=message, embed=embed)
except Exception as e:
await ctx.send(f"{RED}{(_('edit_fail'))} {e}{RESET}")
else:
return message_reference
send_kwargs = {}
if message:
send_kwargs['content'] = message
if embed:
send_kwargs['embed'] = embed
if file:
send_kwargs['file'] = file
if hasattr(ctx, "respond"):
sent_message = None
if embed:
sent_message = await ctx.respond(embed=embed, ephemeral=False)
elif message:
sent_message = await ctx.respond(message, ephemeral=False)
if file:
sent_message = await ctx.respond(file=file, ephemeral=False)
return await ctx.respond(**send_kwargs, ephemeral=False)
else:
sent_message = None
if embed:
sent_message = await ctx.send(embed=embed)
elif message:
sent_message = await ctx.send(message)
if file:
sent_message = await ctx.send(file=file)
return sent_message
return await ctx.send(**send_kwargs)
except Exception as e:
await ctx.send(f"{RED}{(_('edit_fail'))} {e}{RESET}")
def preprocess_message(message):
message = message