removed debug commands, fixed self-responding, added 'ice' rhyme
This commit is contained in:
parent
7408e26803
commit
d955a7a801
25
fouras.py
25
fouras.py
@ -24,12 +24,6 @@ API_URL = "".join(
|
|||||||
AUTHOR_ID = 151626081458192384
|
AUTHOR_ID = 151626081458192384
|
||||||
MAINTAINER_ID = os.getenv("MAINTAINER_ID", AUTHOR_ID)
|
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 = """
|
||||||
BUG REPORT from {user} (`{user_id}`) in channel {channel} (`{channel_id}`) :
|
BUG REPORT from {user} (`{user_id}`) in channel {channel} (`{channel_id}`) :
|
||||||
> {message}
|
> {message}
|
||||||
@ -259,11 +253,11 @@ async def handle_bug_report(message, client: discord.Client) -> bool:
|
|||||||
async def handle_message(message, client: discord.Client) -> bool:
|
async def handle_message(message, client: discord.Client) -> bool:
|
||||||
database.ensure_db()
|
database.ensure_db()
|
||||||
|
|
||||||
if await handle_debug_commands(message, client):
|
# if await handle_debug_commands(message, client):
|
||||||
return True
|
# return True
|
||||||
|
|
||||||
if await handle_bug_report(message, client):
|
# if await handle_bug_report(message, client):
|
||||||
return True
|
# return True
|
||||||
|
|
||||||
if await handle_riddle_solving(message, client):
|
if await handle_riddle_solving(message, client):
|
||||||
return True
|
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(
|
@tree.command(
|
||||||
name="indice",
|
name="indice",
|
||||||
description="Demander un indice pour l'énigme en cours"
|
description="Demander un indice pour l'énigme en cours"
|
||||||
|
|||||||
@ -350,11 +350,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sound": "IS",
|
"sound": "IS",
|
||||||
"blacklist": ["pénis", "penis", "jolis"],
|
"blacklist": ["pénis", "penis", "jolis", "ice", "nice"],
|
||||||
"keys": [
|
"keys": [
|
||||||
"is",
|
"is",
|
||||||
"isse",
|
"isse",
|
||||||
"iss"
|
"iss",
|
||||||
|
"ice"
|
||||||
],
|
],
|
||||||
"rhymes": [
|
"rhymes": [
|
||||||
"Poil au pénis."
|
"Poil au pénis."
|
||||||
|
|||||||
10
rhymes.py
10
rhymes.py
@ -1,11 +1,11 @@
|
|||||||
# rhymes.py
|
# rhymes.py
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, Tuple
|
from typing import Tuple
|
||||||
import discord
|
import discord
|
||||||
from discord import Interaction, app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import database
|
import database
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ async def handle_rhyme_logic(message, client) -> bool:
|
|||||||
message_content = message.content.lower()
|
message_content = message.content.lower()
|
||||||
last_word = get_last_word(message_content)
|
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)
|
rhyme = find_rhyme(last_word)
|
||||||
guild_id = str(message.guild.id)
|
guild_id = str(message.guild.id)
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ async def handle_rhyme_logic(message, client) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
async def handle_message(message, client) -> bool:
|
async def handle_message(message, client: discord.Client) -> bool:
|
||||||
database.ensure_db()
|
database.ensure_db()
|
||||||
ensure_log_file()
|
ensure_log_file()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user