diff --git a/fouras.py b/fouras.py index a3bcc1b..75899e3 100644 --- a/fouras.py +++ b/fouras.py @@ -24,12 +24,6 @@ API_URL = "".join( AUTHOR_ID = 151626081458192384 MAINTAINER_ID = os.getenv("MAINTAINER_ID", AUTHOR_ID) -ABOUT = """ -Ce bot a été développé par {user} -Code Source : https://git.epicsparrow.com/Anselme/perefouras -Ajouter ce bot à votre serveur : {url} -""" - BUG_REPORT = """ BUG REPORT from {user} (`{user_id}`) in channel {channel} (`{channel_id}`) : > {message} @@ -259,11 +253,11 @@ async def handle_bug_report(message, client: discord.Client) -> bool: async def handle_message(message, client: discord.Client) -> bool: database.ensure_db() - if await handle_debug_commands(message, client): - return True + # if await handle_debug_commands(message, client): + # return True - if await handle_bug_report(message, client): - return True + # if await handle_bug_report(message, client): + # return True if await handle_riddle_solving(message, client): return True @@ -352,17 +346,6 @@ def setup_commands(client: discord.Client, tree) -> None: ) - # @tree.command( - # name="about", - # description="Qui est le Père Fouras ?" - # ) - # async def about( - # interaction: discord.Interaction, - # ): - # author_user = await client.fetch_user(AUTHOR_ID) - # await interaction.response.send_message(ABOUT.format(user=author_user.mention, url=API_URL), ephemeral=True) - - @tree.command( name="indice", description="Demander un indice pour l'énigme en cours" diff --git a/resources/rhymes.json b/resources/rhymes.json index 6f9cd16..bf97fd7 100644 --- a/resources/rhymes.json +++ b/resources/rhymes.json @@ -350,11 +350,12 @@ }, { "sound": "IS", - "blacklist": ["pénis", "penis", "jolis"], + "blacklist": ["pénis", "penis", "jolis", "ice", "nice"], "keys": [ "is", "isse", - "iss" + "iss", + "ice" ], "rhymes": [ "Poil au pénis." diff --git a/rhymes.py b/rhymes.py index 68ead61..ced8ec7 100644 --- a/rhymes.py +++ b/rhymes.py @@ -1,11 +1,11 @@ # rhymes.py import json import random -from datetime import datetime, timedelta +from datetime import datetime from pathlib import Path -from typing import Any, Dict, Tuple +from typing import Tuple import discord -from discord import Interaction, app_commands +from discord import app_commands import database @@ -76,7 +76,7 @@ async def handle_rhyme_logic(message, client) -> bool: message_content = message.content.lower() last_word = get_last_word(message_content) - if message.author != client.user and message.guild and last_word: + if not message.author.bot and message.author.id != client.user.id and message.guild and last_word: rhyme = find_rhyme(last_word) guild_id = str(message.guild.id) @@ -103,7 +103,7 @@ async def handle_rhyme_logic(message, client) -> bool: return False -async def handle_message(message, client) -> bool: +async def handle_message(message, client: discord.Client) -> bool: database.ensure_db() ensure_log_file()