Skip to content

Commit

Permalink
Add support for custom activities (#3352)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkuip authored Oct 27, 2024
1 parent 041c4fd commit 26d73f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cogs/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ""):
- `listening`
- `watching`
- `competing`
- `custom`
When activity type is set to `listening`,
it must be followed by a "to": "listening to..."
Expand All @@ -510,6 +511,9 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ""):
the linked twitch page:
- `{prefix}config set twitch_url https://www.twitch.tv/somechannel/`
When activity type is set to `custom`, you can set
any custom text as the activity message.
To remove the current activity status:
- `{prefix}activity clear`
"""
Expand Down Expand Up @@ -609,7 +613,9 @@ async def set_presence(self, *, status=None, activity_type=None, activity_messag
elif activity_type == ActivityType.streaming:
url = self.bot.config["twitch_url"]

if activity_type is not None:
if activity_type == ActivityType.custom:
activity = discord.CustomActivity(name=activity_message)
elif activity_type is not None:
activity = discord.Activity(type=activity_type, name=activity_message, url=url)
else:
activity = None
Expand Down

0 comments on commit 26d73f5

Please sign in to comment.