From 7c5d7630ea3ed86f9c8d06dda01efd3b6e73559f Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Wed, 7 Dec 2016 21:43:00 +0800 Subject: [PATCH] Make superuser qq as a environment var --- command.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command.py b/command.py index cd1bc4ff..bf855e38 100644 --- a/command.py +++ b/command.py @@ -1,5 +1,6 @@ import functools import re +import os from apiclient import client as api from little_shit import SkipException, get_command_name_separators @@ -155,7 +156,7 @@ class CommandRegistry: try: if func.superuser_only: - check(str(ctx_msg.get('sender_qq')) == '1002647525') + check(str(ctx_msg.get('sender_qq')) == os.environ.get('SUPER_USER_QQ')) if ctx_msg.get('type') == 'group_message': allowed_roles = {'owner', 'admin', 'member'} if func.group_admin_only: @@ -178,7 +179,7 @@ class CommandRegistry: # This is strange, not likely happens raise SkipException except SkipException: - if not str(ctx_msg.get('sender_qq')) == '1002647525': + if not str(ctx_msg.get('sender_qq')) == os.environ.get('SUPER_USER_QQ'): # Not allowed return False