doupsland: new plugin for kada

This commit is contained in:
dece 2022-08-29 14:05:33 +02:00 committed by Adrien Abraham
parent 0168089dd8
commit 6eaac2c8ea
2 changed files with 59 additions and 0 deletions

View file

@ -65,6 +65,9 @@
"sentences": ["you're breathtaking"], "sentences": ["you're breathtaking"],
"calm_rate": 100 "calm_rate": 100
}, },
"doupsland": {
"commands": ["doupsland"]
},
"horoscope": { "horoscope": {
"commands": ["horoscope"], "commands": ["horoscope"],
"meditation": "/me looks at the stars", "meditation": "/me looks at the stars",

View file

@ -0,0 +1,56 @@
import random
from edmond.plugin import Plugin
P_TIME = [
"ce matin", "hier soir", "aujourd'hui", "tout à l'heure", "",
]
P_ACTION = [
"j'ai aperçu", "j'ai caressé", "j'ai nadenade", "j'ai passé du temps avec",
"je me suis arrêté vers", "je me suis promené avec", "j'ai salué",
"j'ai approché",
]
P_SUBJ = [
"le chat", "des chats", "le chat calico", "le chat noir", "le chaton",
"le chat blanc", "le chat tigré", "le chat gris", "le chat avec le cœur",
]
P_PLACE = [
"en ville", "au port de pêche", "sur l'île", "sous l'arbre",
"au monument de pierre", "sur la plage", "sur le chemin", "dans l'herbe",
"devant l'école",
]
P_COORD = [
"et", "et donc", "et puis", "après quoi",
]
P_ACTION2 = [
"il a miaulé", "il s'est endormi", "il m'a remercié", "il est resté",
"il m'a suivi", "il m'a reclamé un nadenade",
]
def get_title():
return " ".join((
random.choice(P_TIME),
random.choice(P_ACTION),
random.choice(P_SUBJ),
random.choice(P_PLACE),
random.choice(P_COORD),
random.choice(P_ACTION2),
)).strip().capitalize()
class DoupslandPlugin(Plugin):
REQUIRED_CONFIGS = ["commands"]
def __init__(self, bot):
super().__init__(bot)
def on_pubmsg(self, event):
if not self.should_handle_command(event.arguments[0]):
return False
reply = get_title()
self.bot.say(event.target, reply)
return True