Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom activities #3352

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading