|
@@ -1,7 +1,97 @@
|
|
|
-from command_system import wrap_simple_no_db, as_plugin
|
|
|
+from command_system import as_plugin, RollbotResponse
|
|
|
|
|
|
|
|
|
-@as_plugin
|
|
|
-@wrap_simple_no_db
|
|
|
-def echo(raw_args):
|
|
|
- return raw_args
|
|
|
+HELP_MSG = """
|
|
|
+Hello!
|
|
|
+I am Rollbot 2.0 - a reimplementation of the previous Rollbot.
|
|
|
+I am a simple chatbot built in Python.
|
|
|
+I am licensed as open source under the MIT license.
|
|
|
+I can perform some basic operations, by using one of the following commands.
|
|
|
+I also have "secret" functionality as well - feel free to try other commands!
|
|
|
+
|
|
|
+!info - print this message.
|
|
|
+
|
|
|
+!echo <text> - echo back the provided text.
|
|
|
+
|
|
|
+!greet - print a simple greeting.
|
|
|
+
|
|
|
+!thanks - tell me thanks!
|
|
|
+
|
|
|
+!roll <expr> - roll a set of dice, or solve a simple math problem.
|
|
|
+This uses the Python dice library.
|
|
|
+
|
|
|
+!teamspeak - see who is in TeamSpeak currently. Not guaranteed to work!
|
|
|
+Telnet is complicated!
|
|
|
+
|
|
|
+!session <action> {<arg>} - manage the next DnD session
|
|
|
+ next (<date>|<day>) [<time>] - set the next session's date and time
|
|
|
+ view - view the date and time of the next session
|
|
|
+ late - determine how late you are for the next session
|
|
|
+ cancel [<blame>] - cancel the next session, and optionally blame someone
|
|
|
+ worst - see who is causing the most last-minute cancellations
|
|
|
+"""
|
|
|
+
|
|
|
+
|
|
|
+def lift(fn):
|
|
|
+ def wrapper(db, message):
|
|
|
+ return RollbotResponse(message, txt=fn(message.raw_args))
|
|
|
+ wrapper.__name__ = fn.__name__
|
|
|
+ return as_plugin(wrapper)
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def info(message):
|
|
|
+ return HELP_MSG
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def isadmin(message):
|
|
|
+ return str(message.from_admin())
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def debug(message):
|
|
|
+ return str(message)
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def echo(message):
|
|
|
+ return "'%s' - %s" % (message.raw_args, message.name)
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def thanks(message):
|
|
|
+ return "You're welcome!"
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def guess(message):
|
|
|
+ return "Rollbot's back - tell a friend!"
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def meme(message):
|
|
|
+ return "fuck off"
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def unmeme(message):
|
|
|
+ return "get a job"
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def greet(message):
|
|
|
+ return random.choice(("Hi!", "Hello!", "안녕하세요", "こんにちは", "你好", "👋"))
|
|
|
+
|
|
|
+
|
|
|
+@lift
|
|
|
+def console(message):
|
|
|
+ argstr = message.raw_args
|
|
|
+ opts = [
|
|
|
+ "NEVER GIVE UP",
|
|
|
+ "I believe in you!",
|
|
|
+ "You're doing your best, it's okay!"
|
|
|
+ ]
|
|
|
+ if argstr is not None:
|
|
|
+ opts.append("It'll be okay, {}! Keep trying!".format(argstr))
|
|
|
+ return random.choice(opts)
|