aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/tweets/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/tweets/__init__.py b/modules/tweets/__init__.py
index 688c2b06..edc4fcd2 100644
--- a/modules/tweets/__init__.py
+++ b/modules/tweets/__init__.py
@@ -5,7 +5,7 @@
#--require-config twitter-access-token
#--require-config twitter-access-secret
-import json, re
+import json, re, threading
from src import ModuleManager, utils
from . import format
import tweepy
@@ -45,6 +45,8 @@ class BitBotStreamListener(tweepy.StreamListener):
class Module(ModuleManager.BaseModule):
_stream = None
def on_load(self):
+ self._thread = None
+
global _bot
global _events
global _exports
@@ -94,7 +96,10 @@ class Module(ModuleManager.BaseModule):
self._stream = tweepy.Stream(auth=auth, listener=BitBotStreamListener())
- self._stream.filter(follow=user_ids, is_async=True)
+ self._thread = threading.Thread(
+ target=lambda: self._stream.filter(follow=user_ids))
+ self._thread.daemon = True
+ self._thread.start()
return True
@utils.hook("received.command.tfollow", min_args=2, channel_only=True)