Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide RTM start args to SlackClient #226

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ slackbot_test_settings.py
/*.egg-info
.cache
/.vscode/
.idea
8 changes: 5 additions & 3 deletions slackbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def __init__(self):
bot_icon=settings.BOT_ICON if hasattr(settings,
'BOT_ICON') else None,
bot_emoji=settings.BOT_EMOJI if hasattr(settings,
'BOT_EMOJI') else None
'BOT_EMOJI') else None,
rtm_start_args=settings.RTM_START_ARGS if hasattr(settings,
'RTM_START_ARGS') else None
)
self._plugins = PluginsManager()
self._dispatcher = MessageDispatcher(self._client, self._plugins,
Expand All @@ -33,9 +35,9 @@ def __init__(self):
def run(self):
self._plugins.init_plugins()
self._dispatcher.start()
if not self._client.connected:
if not self._client.connected:
self._client.rtm_connect()

_thread.start_new_thread(self._keepactive, tuple())
logger.info('connected to slack RTM api')
self._dispatcher.loop()
Expand Down
7 changes: 7 additions & 0 deletions slackbot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
# BOT_ICON = 'http://lorempixel.com/64/64/abstract/7/'
# BOT_EMOJI = ':godmode:'


'''
When starting an RTM session, Slack allows you to provide arguments. More details here:
https://api.slack.com/methods/rtm.start
'''
# RTM_START_ARGS = None

'''Specify a different reply when the bot is messaged with no matching cmd'''
DEFAULT_REPLY = None

Expand Down