Skip to content

Commit 058f986

Browse files
authored
Merge pull request #12 from dgw/help-prefix
Use help_prefix in example commands sent to channel
2 parents 467a25c + fdf93e7 commit 058f986

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sopel_modules/github/github.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def configure_repo_messages(bot, trigger):
344344
repo_name = trigger.group(3).lower()
345345

346346
if not '/' in repo_name or 'http://' in repo_name or 'https://' in repo_name:
347-
return bot.say('Invalid repo formatting, see ".help gh-hook" for an example')
347+
return bot.say('Invalid repo formatting, see "{}help gh-hook" for an example'.format(bot.config.core.help_prefix))
348348

349349
enabled = True if not trigger.group(4) or trigger.group(4).lower() == 'enable' else False
350350

@@ -363,13 +363,13 @@ def configure_repo_messages(bot, trigger):
363363
c.execute('''INSERT INTO gh_hooks (channel, repo_name, enabled) VALUES (?, ?, ?)''', (channel, repo_name, enabled))
364364
bot.say("Successfully enabled listening for {repo}'s events in {chan}.".format(chan=channel, repo=repo_name))
365365
bot.say('Great! Please allow me to create my webhook by authorizing via this link: ' + shorten_url(auth_url))
366-
bot.say('Once that webhook is successfully created, I\'ll post a message in here. Give me about a minute or so to set it up after you authorize. You can configure the colors that I use to display webhooks with .gh-hook-color')
366+
bot.say('Once that webhook is successfully created, I\'ll post a message in here. Give me about a minute or so to set it up after you authorize. You can configure the colors that I use to display webhooks with {}gh-hook-color'.format(bot.config.core.help_prefix))
367367
else:
368368
c.execute('''UPDATE gh_hooks SET enabled = ? WHERE channel = ? AND repo_name = ?''', (enabled, channel, repo_name))
369369
bot.say("Successfully {state} the subscription to {repo}'s events".format(state='enabled' if enabled else 'disabled', repo=repo_name))
370370
if enabled:
371371
bot.say('Great! Please allow me to create my webhook by authorizing via this link: ' + shorten_url(auth_url))
372-
bot.say('Once that webhook is successfully created, I\'ll post a message in here. Give me about a minute or so to set it up after you authorize. You can configure the colors that I use to display webhooks with .gh-hook-color')
372+
bot.say('Once that webhook is successfully created, I\'ll post a message in here. Give me about a minute or so to set it up after you authorize. You can configure the colors that I use to display webhooks with {}gh-hook-color'.format(bot.config.core.help_prefix))
373373
conn.commit()
374374
conn.close()
375375

@@ -394,18 +394,18 @@ def configure_repo_colors(bot, trigger):
394394
try:
395395
colors = [int(c) % 16 for c in trigger.group(2).replace(trigger.group(3), '', 1).split()]
396396
except:
397-
return bot.say('You must provide exactly 6 colors that are integers and are space separated. See ".help gh-hook-color" for more information.')
397+
return bot.say('You must provide exactly 6 colors that are integers and are space separated. See "{}help gh-hook-color" for more information.'.format(bot.config.core.help_prefix))
398398

399399
if len(colors) != 6:
400-
return bot.say('You must provide exactly 6 colors! See ".help gh-hook-color" for more information.')
400+
return bot.say('You must provide exactly 6 colors! See "{}help gh-hook-color" for more information.'.format(bot.config.core.help_prefix))
401401

402402
conn = bot.db.connect()
403403
c = conn.cursor()
404404

405405
c.execute('SELECT * FROM gh_hooks WHERE channel = ? AND repo_name = ?', (channel, repo_name))
406406
result = c.fetchone()
407407
if not result:
408-
return bot.say('Please use ".gh-hook {} enable" before attempting to configure colors!'.format(repo_name))
408+
return bot.say('Please use "{}gh-hook {} enable" before attempting to configure colors!'.format(bot.config.core.help_prefix, repo_name))
409409
else:
410410
combined = colors
411411
combined.append(channel)

0 commit comments

Comments
 (0)