Skip to content

Commit 812494a

Browse files
committed
trim 'in' from competing activity
1 parent 8b2bea4 commit 812494a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
77
however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319). If you're a plugin developer, note the "BREAKING" section.
88

9-
# v3.7.14-dev0
9+
# v3.7.14-dev1
1010

1111
### Added
1212

bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.7.14-dev0"
1+
__version__ = "3.7.14-dev1"
22

33

44
import asyncio

cogs/utility.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ""):
511511
When activity type is set to `listening`,
512512
it must be followed by a "to": "listening to..."
513513
514+
When activity type is set to `competing`,
515+
it must be followed by a "in": "competing in..."
516+
514517
When activity type is set to `streaming`, you can set
515518
the linked twitch page:
516519
- `{prefix}config set twitch_url https://www.twitch.tv/somechannel/`
@@ -545,6 +548,8 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ""):
545548
msg = f"Activity set to: {activity.type.name.capitalize()} "
546549
if activity.type == ActivityType.listening:
547550
msg += f"to {activity.name}."
551+
elif activity.type == ActivityType.competing:
552+
msg += f"in {activity.name}."
548553
else:
549554
msg += f"{activity.name}."
550555

@@ -609,6 +614,11 @@ async def set_presence(self, *, status=None, activity_type=None, activity_messag
609614
# The actual message is after listening to [...]
610615
# discord automatically add the "to"
611616
activity_message = activity_message[3:].strip()
617+
elif activity_type == ActivityType.competing:
618+
if activity_message.lower().startswith("in "):
619+
# The actual message is after listening to [...]
620+
# discord automatically add the "in"
621+
activity_message = activity_message[3:].strip()
612622
elif activity_type == ActivityType.streaming:
613623
url = self.bot.config["twitch_url"]
614624

0 commit comments

Comments
 (0)