Browse Source

Merge branch 'master' of iramo94/ivan into master

kirkleon 5 years ago
parent
commit
dd51b48db3
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/plugins/teamspeak.py

+ 8 - 2
src/plugins/teamspeak.py

@@ -1,7 +1,7 @@
 import logging
 
 import requests
-from command_system import RollbotResponse, RollbotPlugin
+from command_system import RollbotResponse, RollbotPlugin, as_plugin
 from config import get_secret
 
 TS3_QUERY = get_secret("teamspeak.query")
@@ -24,7 +24,7 @@ class speamteek(teamspeak):
     def __init__(self, bot, logger=logging.getLogger(__name__)):
         RollbotPlugin.__init__(self, "speamteek", bot, logger=logger)
 
-    def on_command(self, db, message):
+    def on_command(self, db, message): 
         r = super().on_command(db, message)
         if r.is_success:
             r.txt = r.txt[::-1]
@@ -40,3 +40,9 @@ class teamscream(teamspeak):
         if r.is_success:
             r.txt = r.txt.upper()
         return r
+
+@as_plugin
+def ts(message):
+    nicks = requests.get(TS3_QUERY).json()["users"]
+    initials = [nick[0] for nick in nicks]
+    return RollbotResponse(message, txt="i c : "+", ".join(initials))