From f65954aa00e5fdf55fff6d0c585a43f041da5353 Mon Sep 17 00:00:00 2001 From: Sebastian Kuipers Date: Wed, 16 Oct 2024 12:31:15 +0200 Subject: [PATCH] Add support for custom activities --- cogs/utility.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cogs/utility.py b/cogs/utility.py index b892ffc01b..31cb065a28 100644 --- a/cogs/utility.py +++ b/cogs/utility.py @@ -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..." @@ -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` """ @@ -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