Skip to content

Mudlet GMCP Discord Rich Presence functionality #374

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

Merged
merged 6 commits into from
May 21, 2025

Conversation

MorquinDevlar
Copy link
Contributor

@MorquinDevlar MorquinDevlar commented May 10, 2025

Description

This adds the ability for the game to send Rich Presence information to Discord.

Screenshot 2025-05-10 at 12 46 06

This will also add a better Discord integration directly in Mudlet:

Screenshot 2025-05-10 at 12 50 34

By default it sends the following information:

DiscordApplicationID: "1298377884154724412",           // Default GoMud Discord Server
DiscordInviteURL:     "https://discord.gg/FaauSYej3n", // Default GoMud Discord Server
DiscordDetails:       "Using GoMudEngine",
DiscordState:         "Exploring the world",
DiscordLargeImageKey: "server-icon",                   // GoMud Discord Icon
DiscordSmallImageKey: "character-icon",                // Hover icon (not used)

As well as player name, level, area, party information and connection time.

The game name used in Discord comes from the application id or if not sent, the game name in config.yaml

Added "discord" user command to enable or disable certain information:

  discord               - Shows current settings and available commands
  
  discord info on|off   - Enable/disable Discord application info
  discord status on|off - Enable/disable Discord status updates

  discord area on|off   - Show/hide current area in status
  discord party on|off  - Show/hide party information
  discord name on|off   - Show/hide character name
  discord level on|off  - Show/hide character level

Everything is saved on the player, and kept across sessions.

Added helpfile in the Integration category. Here we have potential for other integrations to be placed.

This gmcp information could potentially be used by the web-client as well, to send information to Discord if activated.

I snuck in some beautification and alignment on the other helpfiles for gmcp and Mudlet - that is why they are also in this PR.

- Added party information
- Added area description
- Fixed config file issues
- Added "help discord" under the Integration area
- Added"discord" user command to set the values to display in Discord
Rich Prescense
- Added player name and level as options to show
- Party now shows even if you are the only one in it
- Defaults to config file and/or code defaults if a player disables
certain values
@MorquinDevlar MorquinDevlar requested a review from Volte6 as a code owner May 10, 2025 10:53
@MorquinDevlar MorquinDevlar self-assigned this May 10, 2025
@MorquinDevlar MorquinDevlar added the enhancement New feature or request label May 10, 2025
Copy link
Member

@Volte6 Volte6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass done, some changes requested but overall looking good.

@Jasrags Jasrags requested a review from Copilot May 14, 2025 11:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances Mudlet’s GMCP support by adding Discord Rich Presence functionality and improving helpfile consistency.

  • Updated help templates for Mudlet UI, Map, and Client commands with standardized color formatting
  • Added a new helpfile for Discord integration and updated keywords
  • Replaced the legacy mudlet-config.yaml with an updated config.yaml that now includes Discord Rich Presence settings

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
modules/gmcp/files/datafiles/templates/help/mudletui.template Updated notes section formatting for consistency
modules/gmcp/files/datafiles/templates/help/mudletmap.template Updated notes section formatting for consistency
modules/gmcp/files/datafiles/templates/help/discord.template New helpfile added for Discord integration
modules/gmcp/files/datafiles/templates/help/client.template & checkclient.template Minor text formatting improvements
modules/gmcp/files/data-overlays/mudlet-config.yaml Removed legacy configuration file
modules/gmcp/files/data-overlays/keywords.yaml Added "integration: discord" keyword
modules/gmcp/files/data-overlays/config.yaml New configuration file including Discord Rich Presence settings

Fixed:
- We are now using the comma ok idiom everywhere
- No more default config values in code, just relying on the config
file.

Changed:
- Reworked how GMCP messages are sent out, to remove some redundant code
- Finished support for External.Discord.Get and External.Discord.Hello
messages from client and corresponding messages from the server
- Did a general cleanup and optimization of a few things
@MorquinDevlar MorquinDevlar requested a review from Volte6 May 20, 2025 08:33
Copy link
Member

@Volte6 Volte6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice addition!

@MorquinDevlar MorquinDevlar merged commit 2799c72 into GoMudEngine:master May 21, 2025
2 checks passed
@MorquinDevlar MorquinDevlar deleted the mudlet-discord-gmcp branch May 21, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants