Skip to content

Commit 2b9f2de

Browse files
committed
Added ability to set your own twitch url for streaming status
1 parent e468ee6 commit 2b9f2de

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# v2.4.2
8+
9+
### Added ability to set your own twitch url for streaming status.
10+
711
# v2.4.1
812

913
### Fixed

bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SOFTWARE.
2323
"""
2424

25-
__version__ = '2.4.1'
25+
__version__ = '2.4.2'
2626

2727
import asyncio
2828
import textwrap
@@ -180,7 +180,7 @@ async def on_connect(self):
180180
activity_type = self.config.get('activity_type')
181181
message = self.config.get('activity_message')
182182
if activity_type and message:
183-
url = 'https://www.twitch.tv/discord-modmail/' if activity_type == ActivityType.streaming else None
183+
url = self.config.get('twitch_url', 'https://www.twitch.tv/discord-modmail/') if activity_type == ActivityType.streaming else None
184184
activity = discord.Activity(type=activity_type, name=message,
185185
url=url)
186186
await self.change_presence(activity=activity)

cogs/utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ async def activity(self, ctx, activity_type: str, *, message: str = ''):
298298
except KeyError:
299299
raise commands.UserInputError
300300

301-
url = 'https://www.twitch.tv/discord-modmail/' if activity_type == ActivityType.streaming else None
301+
url = self.bot.config.get('twitch_url', 'https://www.twitch.tv/discord-modmail/') if activity_type == ActivityType.streaming else None
302302
activity = discord.Activity(type=activity_type, name=message, url=url)
303303
await self.bot.change_presence(activity=activity)
304304
self.bot.config['activity_type'] = activity_type

core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ConfigManager:
88

99
allowed_to_change_in_command = {
1010
'activity_message', 'activity_type', 'log_channel_id', 'mention', 'disable_autoupdates', 'prefix',
11-
'main_category_id', 'sent_emoji', 'blocked_emoji', 'thread_creation_response'
11+
'main_category_id', 'sent_emoji', 'blocked_emoji', 'thread_creation_response', 'twitch_url'
1212
}
1313

1414
internal_keys = {

0 commit comments

Comments
 (0)