Skip to content

Commit 1f22f6f

Browse files
authored
Merge pull request CloudBotIRC#289 from linuxdaemon/gonzobot+fix-source-link
Make source url configurable for system info
2 parents a75ede9 + c509a36 commit 1f22f6f

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

config.default.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"config_reloading": true,
122122
"plugin_reloading": false
123123
},
124+
"repo_link": "https://github.com/snoonetIRC/CloudBot/",
124125
"logging": {
125126
"console_debug": false,
126127
"file_debug": false,

plugins/system.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@
1313
import cloudbot
1414

1515

16+
def _get_repo_link(bot):
17+
return bot.config.get(
18+
'repo_link', 'https://github.com/snoonetIRC/CloudBot/'
19+
)
20+
21+
1622
@hook.command(autohelp=False)
17-
def about(text, conn):
23+
def about(text, conn, bot):
1824
"""- Gives information about CloudBot. Use .about license for licensing information"""
1925
if text.lower() in ("license", "gpl", "source"):
2026
return "CloudBot Refresh is released under the GPL v3 license, get the source code " \
21-
"at https://github.com/CloudBotIRC/CloudBot/"
27+
"at {}".format(_get_repo_link(bot))
2228

23-
return "{} is powered by CloudBot Refresh! ({}) - " \
24-
"https://github.com/CloudBotIRC/CloudBot/".format(conn.nick, cloudbot.__version__)
29+
return "{} is powered by CloudBot Refresh! ({}) - {}".format(
30+
conn.nick, cloudbot.__version__, _get_repo_link(bot)
31+
)
2532

2633

2734
@hook.command(autohelp=False)
@@ -70,8 +77,8 @@ def system(reply, message):
7077

7178

7279
@hook.command("sauce", "source", autohelp=False)
73-
def sauce():
80+
def sauce(bot):
7481
"""- Returns a link to the source"""
7582
return "Check out my source code! I am a fork of cloudbot: " \
7683
"https://github.com/CloudBotIRC/CloudBot/ and my source is here: " \
77-
"https://github.com/edwardslabs/CloudBot"
84+
"{}".format(_get_repo_link(bot))

0 commit comments

Comments
 (0)