Skip to content

Conversation

@cotton105
Copy link
Contributor

Adds a new argument to the /config gamification command: "message," which allows the command user to customise the message sent to users who level up.

The custom message supports emojis, markdown & variable tokens. The supported tokens are as follows:

  • %level%
  • %username%
  • %date% (UTC)
  • %time% (UTC)

I based the token format on that used by the locale system: surrounded by percent signs (%).

Usage

Configuring a custom message
Screenshot_20250112_223602

Result of leveling up
Screenshot_20250112_223535

References

Fixes: #1081

Checklist

  • Documentation is changed or added (if applicable)
  • Commit message follows the commit guidelines

Allows admin to use `/config gamification` to set a custom level-up
message for users. It supports some predefined tokens: %%level%%,
%%date%% and %%time%%.

Fixes: TheBastionBot#1081
This fixes formatting issues when the current time/date is a single
digit.
To further increase message customisability, a token for the user's name
has been added
Double % signs are quite unwieldy, and single ones do the job just as
well.
@atlanna
Copy link

atlanna bot commented Jan 12, 2025

Thank you for opening this pull request.
A maintainer will get by as soon as practical to review the changes.

Also changed year, month, day, etc. to be const variables instead of
arrow functions, because it seems kind of pointless and harder to read
them as functions.
The description for the "/config gamification" command has had the
supported tokens removed, because of an apparent 100 character limit for
command option descriptions.

Supported tokens will have to be documented elsewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IDEA]: Custom Level-Up Messages

1 participant