Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/isida/vi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiSabler <dissy@ya.ru>2017-03-27 12:46:29 +0300
committerdiSabler <dissy@ya.ru>2017-03-27 12:46:29 +0300
commit79dcdbfea34d6a5925f31fcc1454202c5d9df1fe (patch)
tree2ed03738cc5ab980b7fc47b6495f8529a7f27f5d /plugins
parent27ba417e761e4c2fd228c624ca0020815f9898b1 (diff)
add: white/black lists for commands
Diffstat (limited to 'plugins')
-rw-r--r--plugins/test.py2
-rw-r--r--plugins/whoami.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/plugins/test.py b/plugins/test.py
index 6924fbc..82f4e1a 100644
--- a/plugins/test.py
+++ b/plugins/test.py
@@ -26,6 +26,6 @@ def cmd_test(raw_in):
msg = random.choice(answer)
send_msg(raw_in, msg)
-commands = [['test', cmd_test, False, 'raw', 'Check bot\'s activity.']]
+commands = [['test', cmd_test, False, 'raw', 'Check bot\'s activity.', {'black': [-1001069052151]}]]
# The end is near!
diff --git a/plugins/whoami.py b/plugins/whoami.py
index b85cde3..2b250c6 100644
--- a/plugins/whoami.py
+++ b/plugins/whoami.py
@@ -25,10 +25,16 @@ def cmd_whoami(raw_in):
msg = 'šŸ—ƒ Username: <b>%s</b>' % raw_in['message']['from'].get('username', '')
msg += '\nšŸ“° Name: <b>%s</b>' % raw_in['message']['from'].get('first_name', '')
msg += ' <b>%s</b>' % raw_in['message']['from'].get('last_name', '')
+ ID = raw_in['message']['from'].get('id', 0)
msg += '\nšŸ—‚ ID: <b>%s</b>' % raw_in['message']['from'].get('id', '')
IS_OWNER_TXT = ['No', 'Yes'][raw_in['message']['from'].get('id', '') == OWNER_ID]
msg += '\nšŸ¤– Bot\'s owner: <b>%s</b>' % IS_OWNER_TXT
-
+ try:
+ CHAT_ID = raw_in['message']['chat'].get('id', 0)
+ except:
+ CHAT_ID = 0
+ if ID != CHAT_ID:
+ msg += '\nšŸ—‚ ChatID: <b>%s</b>' % CHAT_ID
send_msg(raw_in, msg)
# name, proc, is_owner, data_type