aboutsummaryrefslogtreecommitdiff
path: root/bitbotctl
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-17 16:53:48 +0100
committerGravatar jesopo2019-10-17 16:53:48 +0100
commitaa2511baaa7f28314b8720191b8f3e4d7778de68 (patch)
tree76262c951fc379b4eb591a2b2b49819c9fe2d54a /bitbotctl
parentmove bot.conf.example to docs/ (diff)
signature
add IRCBot.stop() - use it for !shutdown and './bitbotctl stop'
Diffstat (limited to 'bitbotctl')
-rwxr-xr-xbitbotctl9
1 files changed, 4 insertions, 5 deletions
diff --git a/bitbotctl b/bitbotctl
index a66ddd73..2753d92d 100755
--- a/bitbotctl
+++ b/bitbotctl
@@ -20,10 +20,11 @@ def _die(s):
sys.stderr.write("%s\n" % s)
sys.exit(1)
+SIMPLE = ["rehash", "reload", "stop"]
if args.command == "log":
arg_parser.add_argument("--level", "-l", help="Log level",
default="INFO")
-elif args.command in ["rehash", "reload"]:
+elif args.command in SIMPLE:
pass
else:
_die("Unknown command '%s'" % args.command)
@@ -52,10 +53,8 @@ _send("0 version 0")
if args.command == "log":
_send("1 log %s" % args.level)
-elif args.command == "rehash":
- _send("1 rehash")
-elif args.command == "reload":
- _send("1 reload")
+elif args.command in SIMPLE:
+ _send("1 %s" % args.command)
read_buffer = b""