Compare commits
5 commits
02ffd07d72
...
7e5ebcaf04
Author | SHA1 | Date | |
---|---|---|---|
dece | 7e5ebcaf04 | ||
dece | 8467c25beb | ||
dece | a2b70887de | ||
dece | f13f3b4754 | ||
dece | 0168089dd8 |
|
@ -65,6 +65,9 @@
|
|||
"sentences": ["you're breathtaking"],
|
||||
"calm_rate": 100
|
||||
},
|
||||
"doupsland": {
|
||||
"commands": ["doupsland"]
|
||||
},
|
||||
"horoscope": {
|
||||
"commands": ["horoscope"],
|
||||
"meditation": "/me looks at the stars",
|
||||
|
@ -144,7 +147,7 @@
|
|||
"positive": ["I like it."],
|
||||
"negative": ["I don't like it."]
|
||||
},
|
||||
"random": {
|
||||
"randomchoice": {
|
||||
"commands": ["choose"],
|
||||
"separator": "or",
|
||||
"not_enough": "Not enough choices!"
|
||||
|
|
|
@ -26,9 +26,12 @@ class CapturePlugin(Plugin):
|
|||
return False
|
||||
if self.current_thing is not None:
|
||||
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)
|
||||
return True
|
||||
else:
|
||||
self.bot.log_d(f"Capture: “{message}” != “{capture_sentence}”")
|
||||
return False
|
||||
|
||||
if proc(self.config["rate"]):
|
||||
|
|
64
edmond/plugins/doupsland.py
Normal file
64
edmond/plugins/doupsland.py
Normal 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
|
|
@ -3,7 +3,7 @@ import random
|
|||
from edmond.plugin import Plugin
|
||||
|
||||
|
||||
class RandomPlugin(Plugin):
|
||||
class RandomChoicePlugin(Plugin):
|
||||
|
||||
REQUIRED_CONFIGS = ["commands", "separator", "not_enough"]
|
||||
|
Loading…
Reference in a new issue