Skip to content

Commit 26d73f5

Browse files
authored
Add support for custom activities (#3352)
1 parent 041c4fd commit 26d73f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cogs/utility.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ""):
499499
- `listening`
500500
- `watching`
501501
- `competing`
502+
- `custom`
502503
503504
When activity type is set to `listening`,
504505
it must be followed by a "to": "listening to..."
@@ -510,6 +511,9 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ""):
510511
the linked twitch page:
511512
- `{prefix}config set twitch_url https://www.twitch.tv/somechannel/`
512513
514+
When activity type is set to `custom`, you can set
515+
any custom text as the activity message.
516+
513517
To remove the current activity status:
514518
- `{prefix}activity clear`
515519
"""
@@ -609,7 +613,9 @@ async def set_presence(self, *, status=None, activity_type=None, activity_messag
609613
elif activity_type == ActivityType.streaming:
610614
url = self.bot.config["twitch_url"]
611615

612-
if activity_type is not None:
616+
if activity_type == ActivityType.custom:
617+
activity = discord.CustomActivity(name=activity_message)
618+
elif activity_type is not None:
613619
activity = discord.Activity(type=activity_type, name=activity_message, url=url)
614620
else:
615621
activity = None

0 commit comments

Comments
 (0)