diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 529d549..c7616a7 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,6 +3,7 @@
+
@@ -18,28 +19,28 @@
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
@@ -53,9 +54,9 @@
@@ -269,12 +270,12 @@
1492353576138
-
+
-
+
@@ -334,26 +335,26 @@
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/Janitor.rb b/Janitor.rb
index b7f9eaa..1f8f53c 100644
--- a/Janitor.rb
+++ b/Janitor.rb
@@ -1,10 +1,10 @@
require 'teamspeak-ruby'
class Janitor
- debug_mode = true
def initialize
@ts = login()
+ @global = false
end
def login()
@@ -19,16 +19,16 @@ class Janitor
end
def gsay(msg)
- if debug_mode == true
+ if @global == true
@ts.command('sendtextmessage', {targetmode: 3, target: 1, msg: msg})
else
- @ts.command('sendtextmessage', {targetmode: 1, target: 13, msg: msg})
+ @ts.command('sendtextmessage', {targetmode: 2, target: whoami['client_channel_id'], msg: msg})
end
end
- def listen(global)
- if global == true
+ def listen()
+ if @global == true
return @ts.command('servernotifyregister', event: 'textserver')[0]
else
return @ts.command('servernotifyregister', event: 'textchannel', id: 218 )[0]
diff --git a/core.rb b/core.rb
index d192ce7..c7e57d5 100644
--- a/core.rb
+++ b/core.rb
@@ -37,7 +37,7 @@ OptionParser.new do |parser|
end
parser.on("--listen") do
- puts jan.listen(false)
+ puts jan.listen()
end
end.parse!
diff --git a/notification.rb b/notification.rb
index f0af998..3155250 100644
--- a/notification.rb
+++ b/notification.rb
@@ -9,7 +9,7 @@
while (i > 0)
begin
- return_report = jan.listen(false)
+ return_report = jan.listen()
invokerid = return_report['invokerid']
cmd = return_report['msg']