Skip to content

Commit 641efbc

Browse files
committed
Incremented version, add fix for when activity is set to streaming
1 parent 5724218 commit 641efbc

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ 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

77

8+
# v2.3.1
9+
10+
### Added
11+
- Added the `activity` command for setting the activity
12+
- [PR #131](https://github.com/kyb3r/modmail/pull/131#issue-244686818)
13+
14+
### Removed
15+
- Removed the deprecated `status` command.
16+
817
# v2.3.0
918

1019
### Added

bot.py

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

25-
__version__ = '2.3.0'
25+
__version__ = '2.3.1'
2626

2727
import asyncio
2828
import textwrap
@@ -33,6 +33,7 @@
3333

3434
import discord
3535
import aiohttp
36+
from discord.enums import ActivityType
3637
from discord.ext import commands
3738
from discord.ext.commands.view import StringView
3839
from motor.motor_asyncio import AsyncIOMotorClient
@@ -179,7 +180,9 @@ async def on_connect(self):
179180
activity_type = self.config.get('activity_type')
180181
message = self.config.get('activity_message')
181182
if activity_type and message:
182-
activity = discord.Activity(type=activity_type, name=message)
183+
url = 'https://www.twitch.tv/discord-modmail/' if activity_type == ActivityType.streaming else None
184+
activity = discord.Activity(type=activity_type, name=message,
185+
url=url)
183186
await self.change_presence(activity=activity)
184187

185188
async def on_ready(self):

cogs/utility.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ async def activity(self, ctx, activity_type: str, *, message: str = ''):
308308
)
309309
return await ctx.send(embed=em)
310310

311-
activity = discord.Activity(type=activity_type, name=message)
311+
url = 'https://www.twitch.tv/discord-modmail/' if activity_type == ActivityType.streaming else None
312+
activity = discord.Activity(type=activity_type, name=message, url=url)
312313
await self.bot.change_presence(activity=activity)
313314
self.bot.config['activity_type'] = activity_type
314315
self.bot.config['activity_message'] = message

0 commit comments

Comments
 (0)