Compare commits

...

5 commits

Author SHA1 Message Date
dece 7e5ebcaf04 doupsland: more items 2022-08-30 18:50:45 +02:00
dece 8467c25beb capture: add debug log because of issues 2022-08-30 18:50:28 +02:00
dece a2b70887de REB doups 2022-08-29 15:03:08 +02:00
dece f13f3b4754 doupsland: new plugin for kada 2022-08-29 14:08:20 +02:00
dece 0168089dd8 random: rename to random_choice to avoid conflict 2022-08-29 14:08:20 +02:00
4 changed files with 73 additions and 3 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",
@ -144,7 +147,7 @@
"positive": ["I like it."], "positive": ["I like it."],
"negative": ["I don't like it."] "negative": ["I don't like it."]
}, },
"random": { "randomchoice": {
"commands": ["choose"], "commands": ["choose"],
"separator": "or", "separator": "or",
"not_enough": "Not enough choices!" "not_enough": "Not enough choices!"

View file

@ -26,9 +26,12 @@ class CapturePlugin(Plugin):
return False return False
if self.current_thing is not None: if self.current_thing is not None:
message = event.arguments[0] message = event.arguments[0]
if message == self.config["capture_sentence"]: capture_sentence = self.config["capture_sentence"]
if message == capture_sentence:
self.capture(event.source.nick, event.target) self.capture(event.source.nick, event.target)
return True return True
else:
self.bot.log_d(f"Capture: “{message}” != “{capture_sentence}")
return False return False
if proc(self.config["rate"]): if proc(self.config["rate"]):

View file

@ -0,0 +1,64 @@
import random
from edmond.plugin import Plugin
P_TIME = [
"ce matin", "hier soir", "aujourd'hui", "tout à l'heure", "au réveil", "",
]
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é", "j'ai suivi", "je me suis assis devant", "j'ai regardé",
"j'ai parlé avec",
]
P_SUBJ = [
"le chat", "le chat calico", "le chat noir", "le chaton",
"le chat blanc", "le chat tigré", "le chat gris", "le chat avec le cœur",
"le chat errant", "le vieux chat", "le gros chat", "le petit chat",
"le chat doux", "le beau chat",
]
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", "dans la petite cour",
"qui miaulait", "qui dormait", "qui était devant la boutique",
"qui voulait manger", "qui demandait le nadenade",
"sur le quai",
]
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é avec moi",
"il m'a suivi", "il a reclamé un nadenade", "il est monté sur le toît",
"il s'est roulé en boule",
]
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

View file

@ -3,7 +3,7 @@ import random
from edmond.plugin import Plugin from edmond.plugin import Plugin
class RandomPlugin(Plugin): class RandomChoicePlugin(Plugin):
REQUIRED_CONFIGS = ["commands", "separator", "not_enough"] REQUIRED_CONFIGS = ["commands", "separator", "not_enough"]