Browse Source

Merge branch 'feature/watchlist' of kirkleon/rollbot3 into master

kirkleon 5 năm trước cách đây
mục cha
commit
05d5784422
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      src/plugins/watchlist.py

+ 7 - 3
src/plugins/watchlist.py

@@ -63,7 +63,7 @@ HELP_MSG="""
 This command lets you track a list of things to watch
 Useful subcommands are:
     !watchlist !help - show this message
-    !watchlist !add OR !wl - to add new things to the list, delimited by ;'s.
+    !watchlist !add OR !wla - to add new things to the list, delimited by ;'s.
     !watchlist !view OR !wlv - to view the current list.
     !watchlist !pick OR !wlp - to pick something random from the list.
     !watchlist !remove OR !wlr - to remove something from the list by number.
@@ -85,8 +85,7 @@ def watchlist(msg, data: Watchlist):
         subc = subc[1:].lower()
         subc_fn = subcommands.get(subc, lambda *_: f"Sorry, subcommand must be one of {', '.join(subcommands)}, you used: {subc}")
         return subc_fn(args, data)
-    return add(msg.raw_args, data) # default to adding something new
-
+    return subcommands["help"]() # default to help message
 
 # some quick aliases for convenience, !wl is aliased in the config file instead
 
@@ -103,3 +102,8 @@ def wlv(msg, data: Watchlist):
 @as_plugin
 def wlr(msg, data: Watchlist):
     return remove(msg.raw_args, data)
+
+
+@as_plugin
+def wla(msg, data: Watchlist):
+    return add(msg.raw_args, data)