Use new yaboli help system and improve help message

This commit is contained in:
Joscha 2017-09-08 15:49:12 +00:00
parent cc6bb01600
commit 0ed6cdf663

View file

@ -38,7 +38,7 @@ class PointDB(yaboli.Database):
else: else:
return 0 return 0
class YourBot(yaboli.Bot): class PlusOne(yaboli.Bot):
""" """
Count +1s awarded to users by other users. Count +1s awarded to users by other users.
""" """
@ -53,12 +53,14 @@ class YourBot(yaboli.Bot):
self.help_general = "/me counts :+1:s." self.help_general = "/me counts :+1:s."
self.help_specific = ( self.help_specific = (
"Counts +1/:+1:/:bronze:s: Simply reply to someone's message to award them a point.\n" "Counts +1/:+1:/:bronze:s: Simply reply \"+1\" to someone's message to award them a point.\n"
"Alternatively, specify a person with: \"+1 [to|for] @person\"\n"
"!points - show your own points\n" "!points - show your own points\n"
"!points <person1> [<person2> ...] - list other people's points\n\n" "!points <person1> [<person2> ...] - list other people's points\n\n"
"Github: https://github.com/Garmelon/plusone (complies with botrulez, including !kill and !restart)\n" "Created by @Garmy using yaboli.\n"
"Created by @Garmy using yaboli (https://github.com/Garmelon/yaboli)" "For additional info, try \"!help @{nick} <topic>\". Topics:\n"
) )
self.help_specific += self.list_help_topics()
self.ping_message = ":bronze!?:" self.ping_message = ":bronze!?:"
self.register_command("points", self.command_points, specific=False) self.register_command("points", self.command_points, specific=False)
@ -109,7 +111,7 @@ class YourBot(yaboli.Bot):
def main(): def main():
if len(sys.argv) == 3: if len(sys.argv) == 3:
db = PointDB(sys.argv[2]) db = PointDB(sys.argv[2])
run_bot(YourBot, sys.argv[1], db) run_bot(PlusOne, sys.argv[1], db)
else: else:
print("USAGE:") print("USAGE:")
print(f" {sys.argv[0]} <room> <pointsdb>") print(f" {sys.argv[0]} <room> <pointsdb>")