Discord Rich Text Prescence?

yeah, still working on this. I have been able to get Game using a custom Discord server. Invite URL: in the debug log. Then when I check the gmcp log it show:
{
External = {
Discord = {
Info = {
applicationid = "**bot-id**",
inviteurl = "**discordinvite**"
},
Status = {
details = "Playing a Game",
game = "Dragonball Redemption",
smallimagekey = "small1-icon",
smallimagetext = "some small text",
state = "Grinding"
}
}
}
}
{
External = {
Discord = {
Info = {
applicationid = "**bot-id**",
inviteurl = "**discordinvite**"
},
Status = {
details = "Playing a Game",
game = "Dragonball Redemption",
smallimagekey = "small1-icon",
smallimagetext = "some small text",
state = "Grinding"
}
}
}
}
but nothing happens. I have tried to follow https://wiki.mudlet.org/w/Manual:Scripting#Discord_Rich_Presence and https://wiki.mudlet.org/w/Standards:Discord_GMCP#External.Discord.Status, which I think is sending the correct items, but how do I make the client do anything? In the extra notes it says to ensure to enable gmcp Core.Supports.Add ["External.Discord 1"] this is client side I assume?
78 Replies
Braska/Xinefus
Braska/XinefusOP3y ago
Anyone willing to help would be appreciated. @karahd any chance you could help? Have you got rich text presence working?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Braska/Xinefus
Braska/XinefusOP3y ago
hence why i msg'd you 😉 Thanks, I will see wtf I gone done wrong. 😐 seems it's pushing the same as you, least the json looks the same.
Vadi
Vadi3y ago
what are the game connection details?
Braska/Xinefus
Braska/XinefusOP3y ago
I don't have it enabled for all players yet. I just have an admin function that runs the external.discord.status
Vadi
Vadi3y ago
does discord even work for you and it doesnt say this?
Braska/Xinefus
Braska/XinefusOP3y ago
it works. 🙂 but yeah, not sure why it doesn't do anytyhing.
Braska/Xinefus
Braska/XinefusOP3y ago
Braska/Xinefus
Braska/XinefusOP3y ago
lua display(gmcp) shows:
{
External = {
Discord = {
Info = {
applicationid = "ID",
inviteurl = "URL"
},
Status = {
details = "Get Some!",
game = "Dragonball Redemption"
}
}
}
}
{
External = {
Discord = {
Info = {
applicationid = "ID",
inviteurl = "URL"
},
Status = {
details = "Get Some!",
game = "Dragonball Redemption"
}
}
}
}
but i'm not sure how the bot-id interacts with things. What permissions perhaps?
Vadi
Vadi3y ago
bot id?
Vadi
Vadi3y ago
Mudlet
File:Mudlet Discord ApplicationID.png
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
Braska/Xinefus
Braska/XinefusOP3y ago
app id. hmm, maybe there is where I am going wrong. nope, that's the ID i'm using. 😦 so... is it a linux thing? Will it not recognize because I'm playing on a linux box? like.. it's just me personally? 😛
Vadi
Vadi3y ago
it was developed on linux - works fine in fact I see it for you now
Braska/Xinefus
Braska/XinefusOP3y ago
well, i had to manually add that.. I was looking to make sure it was enabled on settings.. then just selected the mudlet appimage.. so I cheated does it have something to do with the client-id and OAuth2 permissions? I have a bot tied to this... does the bot need special permissions? my bot does mud-discord chat, which still works. so I'm a bit unsure if there is something missing.
Vadi
Vadi3y ago
I don't think it would be permission related
Braska/Xinefus
Braska/XinefusOP3y ago
k. I'm not sure then. 😦
Vadi
Vadi3y ago
not sure either - there's only so much we can guess. I suggest giving your client id and a way to connect to the game to test
Braska/Xinefus
Braska/XinefusOP3y ago
I will enable it game wide. and share details for login. I feel like it could just be me, lol.
SlySven ☕
SlySven ☕3y ago
All we need to test is, I think, your Discord "Application" ID (it is typically an 18 digit number) which is needed to get the first line in the RP message to say "Playing <Application>" and to access the icons for YOUR game...
Braska/Xinefus
Braska/XinefusOP3y ago
mud.dbredemption.com 7000. I haven't added an image. i mean I have a cover image in the app. but I haven't done any image updates through gmcp. AppID: 779015653599215616
SlySven ☕
SlySven ☕3y ago
Our/Discords recommendation is a 1024x1024 .PNG and we recommend you upload/call it server-icon...
Braska/Xinefus
Braska/XinefusOP3y ago
Braska/Xinefus
Braska/XinefusOP3y ago
It's there.
SlySven ☕
SlySven ☕3y ago
Ok, gimme a couple of minutes to spin up Qt Creator and build the current development code...
Braska/Xinefus
Braska/XinefusOP3y ago
lol.
SlySven ☕
SlySven ☕3y ago
Well the Application ID works - not sure about the Application's NAME though...
Braska/Xinefus
Braska/XinefusOP3y ago
ok, it needs a specific name?
SlySven ☕
SlySven ☕3y ago
And the switching between Games (MUDs) still works... 😌
Braska/Xinefus
Braska/XinefusOP3y ago
does the name need to be something specific?
SlySven ☕
SlySven ☕3y ago
Nope - and I noticed you just changed it...! 😀
Braska/Xinefus
Braska/XinefusOP3y ago
yeah, simplified. how is it working for you and not me 😦
SlySven ☕
SlySven ☕3y ago
It just makes sense to be something that can be put after "Playing " ...
Braska/Xinefus
Braska/XinefusOP3y ago
it's like it's not updating my status..
SlySven ☕
SlySven ☕3y ago
I'm entering the Application ID into the profile on the command line with - in your case - lua setDiscordApplicationID("779015653599215616")
Braska/Xinefus
Braska/XinefusOP3y ago
I get ture true
SlySven ☕
SlySven ☕3y ago
Yeah that means the lua command worked...
Braska/Xinefus
Braska/XinefusOP3y ago
so my mudlet isn't talking to my discord?
SlySven ☕
SlySven ☕3y ago
Lets check your settings...
Braska/Xinefus
Braska/XinefusOP3y ago
but I can click on all the fancy icons and get to my server and this server.
Braska/Xinefus
Braska/XinefusOP3y ago
This I mean.
SlySven ☕
SlySven ☕3y ago
That's totally separate...
Braska/Xinefus
Braska/XinefusOP3y ago
ok.
SlySven ☕
SlySven ☕3y ago
What OS are you using?
Braska/Xinefus
Braska/XinefusOP3y ago
I'm all ready to listen,.
Braska/Xinefus
Braska/XinefusOP3y ago
SlySven ☕
SlySven ☕3y ago
And you are using a Release version of Mudlet you installed?
Braska/Xinefus
Braska/XinefusOP3y ago
Braska/Xinefus
Braska/XinefusOP3y ago
I think that would be more accurate, the about mudlet. I'm running from an appimage I downloaded. lol your statuses make me laugh
SlySven ☕
SlySven ☕3y ago
Right, the options in the "Chat" tab for your Discord profile are left at the defaults I take it:
Braska/Xinefus
Braska/XinefusOP3y ago
yep
Braska/Xinefus
Braska/XinefusOP3y ago
I'm going to have to grab my kid from his birthday party. I really appreciate the quick support. I should be back a bit later. sorry to run out.
SlySven ☕
SlySven ☕3y ago
And the Discord option is set in the profile's options:
SlySven ☕
SlySven ☕3y ago
Okay...
Braska/Xinefus
Braska/XinefusOP3y ago
yes it's set.
SlySven ☕
SlySven ☕3y ago
🤔 Well, we'll have to dive deeper later on then... 👋
Braska/Xinefus
Braska/XinefusOP3y ago
Yes ticked.
SlySven ☕
SlySven ☕3y ago
Ah, so do you get the (default) "Playing Mudlet" Rich Presence showing on Discord when you start Mudlet...?
Braska/Xinefus
Braska/XinefusOP3y ago
I do not. :( And I think that is my problem. I may try compiling and installing Mudlet to see if that will do anything.
SlySven ☕
SlySven ☕3y ago
If you can get the AppImage to run from the command line one of the first lines of the debug output that Mudlet emits onto the command line is something about whether the RPC library was loaded - as I highlight here when I am running my recently complied code within Qt Creator:
Braska/Xinefus
Braska/XinefusOP3y ago
I will look soon. I have successfully run it from terminal, but I don't think I've seen that line.
SlySven ☕
SlySven ☕3y ago
Ah, yeah - you can do that easily enough, once you have untarred the file we make available at: https://www.mudlet.org/download/ you can run it directly from the command line:
stephen@Ripley:~/src/mudlet-dev/Mudlet/mudlet$ ~/Downloads/Mudlet.AppImage
Discord integration loaded. Using functions from: "libdiscord-rpc.so"
mudlet::readEarlySettings(...) INFO - Using language code "en_GB" to switch to "English (United Kingdom)" locale.
mudlet::scanForMudletTranslations(":/lang") INFO - Seeking Mudlet translation files:
found a Mudlet translation for locale code: "de_DE".
found a Mudlet translation for locale code: "el_GR".
found a Mudlet translation for locale code: "en_GB".
found a Mudlet translation for locale code: "en_US".
found a Mudlet translation for locale code: "es_ES".
found a Mudlet translation for locale code: "fi_FI".
found a Mudlet translation for locale code: "fr_FR".
found a Mudlet translation for locale code: "it_IT".
found a Mudlet translation for locale code: "nl_NL".
found a Mudlet translation for locale code: "pl_PL".
found a Mudlet translation for locale code: "pt_BR".
found a Mudlet translation for locale code: "pt_PT".
found a Mudlet translation for locale code: "ru_RU".
found a Mudlet translation for locale code: "tr_TR".
found a Mudlet translation for locale code: "zh_CN".
found a Mudlet translation for locale code: "zh_TW".
mudlet::scanForQtTranslations("/tmp/.mount_MudletbL121Y/translations") INFO - Seeking Qt translation files:
found a Qt translation for locale code: "de_DE"
no Qt translation found for locale code: "el_GR"
found a Qt translation for locale code: "en_GB"
found a Qt translation for locale code: "en_US"
found a Qt translation for locale code: "es_ES"
found a Qt translation for locale code: "fi_FI"
stephen@Ripley:~/src/mudlet-dev/Mudlet/mudlet$ ~/Downloads/Mudlet.AppImage
Discord integration loaded. Using functions from: "libdiscord-rpc.so"
mudlet::readEarlySettings(...) INFO - Using language code "en_GB" to switch to "English (United Kingdom)" locale.
mudlet::scanForMudletTranslations(":/lang") INFO - Seeking Mudlet translation files:
found a Mudlet translation for locale code: "de_DE".
found a Mudlet translation for locale code: "el_GR".
found a Mudlet translation for locale code: "en_GB".
found a Mudlet translation for locale code: "en_US".
found a Mudlet translation for locale code: "es_ES".
found a Mudlet translation for locale code: "fi_FI".
found a Mudlet translation for locale code: "fr_FR".
found a Mudlet translation for locale code: "it_IT".
found a Mudlet translation for locale code: "nl_NL".
found a Mudlet translation for locale code: "pl_PL".
found a Mudlet translation for locale code: "pt_BR".
found a Mudlet translation for locale code: "pt_PT".
found a Mudlet translation for locale code: "ru_RU".
found a Mudlet translation for locale code: "tr_TR".
found a Mudlet translation for locale code: "zh_CN".
found a Mudlet translation for locale code: "zh_TW".
mudlet::scanForQtTranslations("/tmp/.mount_MudletbL121Y/translations") INFO - Seeking Qt translation files:
found a Qt translation for locale code: "de_DE"
no Qt translation found for locale code: "el_GR"
found a Qt translation for locale code: "en_GB"
found a Qt translation for locale code: "en_US"
found a Qt translation for locale code: "es_ES"
found a Qt translation for locale code: "fi_FI"
Mudlet
Download Mudlet | Mudlet
Play on Windows, macOS, and Linux. It's free and opensource :)
Braska/Xinefus
Braska/XinefusOP3y ago
coming in and out between kids and dinner. 😛
Braska/Xinefus
Braska/XinefusOP3y ago
Braska/Xinefus
Braska/XinefusOP3y ago
doesn't look like it. oh wait, first line.
SlySven ☕
SlySven ☕3y ago
Oh, poo! Right, next question... Are you running more than one Discord application at the same time, I mean are you running more than one of these at the same time! * "Discord" (the main version, the "Release" one, the oldest of the three) * "Discord-PTB" (the "Public Test Beta" one, likely has some features/bugs/bugfixes than the main one but is newer) * "Discord-Canary" (the bleeding edge "Alpha" one, very probable has more features/bugs/bugfixes than the main one but is the bleeding edge one) Most people do NOT do this, but there have been some exceptional situations where it is useful to run more than one!
Braska/Xinefus
Braska/XinefusOP3y ago
Nope.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Braska/Xinefus
Braska/XinefusOP3y ago
I just have the one instance.
SlySven ☕
SlySven ☕3y ago
Okay. I'm not sure what else could be going wrong. Are you in a position to build a copy of Mudlet yourself? If so there is a #DEFINE that is normally commented out in the ./src/discord.cpp file that can be un-commented (line 32 in the file) to generate debug messages that make tracking what is happening easier...
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#include "discord.h"
#include "mudlet.h"

#include "pre_guard.h"
#include <QtDebug>
#include <QHash>
#include <string.h>
#include "post_guard.h"

// Uncomment this to provide some additional qDebug() output:
// #define DEBUG_DISCORD 1

QString Discord::smUserName;
QString Discord::smUserId;
QString Discord::smDiscriminator;
QString Discord::smAvatar;
const QString Discord::mMudletApplicationId = qsl("450571881909583884");

Discord::Discord(QObject* parent)
: QObject(parent)
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#include "discord.h"
#include "mudlet.h"

#include "pre_guard.h"
#include <QtDebug>
#include <QHash>
#include <string.h>
#include "post_guard.h"

// Uncomment this to provide some additional qDebug() output:
// #define DEBUG_DISCORD 1

QString Discord::smUserName;
QString Discord::smUserId;
QString Discord::smDiscriminator;
QString Discord::smAvatar;
const QString Discord::mMudletApplicationId = qsl("450571881909583884");

Discord::Discord(QObject* parent)
: QObject(parent)
Braska/Xinefus
Braska/XinefusOP3y ago
I'll give it a try tomorrow. I really appreciate this help.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Braska/Xinefus
Braska/XinefusOP3y ago
Thanks! I'm still learning Mudlet. Heheh I don't have time to dig into this today unfortunately, however I did try to login to ThresholdRPG and it did not show up either. However, I opened up Lutris to see if that did anything and it automatically changed my status... but if I have mudlet running it doesn't seem to do anything. 😦 so is it something to do with how mudlet is talking to my pc? I'll have to dig into doing a fresh install of mudlet and discord and go from there. Happy Sunday.
SlySven ☕
SlySven ☕3y ago
TBH it sounds like the Mudlet + the Discord RPC library code (archived - so unchanging - at https://github.com/discord/discord-rpc) is not connecting to the Discord application... Oh, it has been un-archived - and it seems there is a small change to the "Party" details. https://github.com/discord/discord-rpc/commit/963aa9f3e5ce81a4682c6ca3d136cddda614db33 I guess @Vadi we might want to look to pull in that change to our copy of the library?
GitHub
[Maintenance PR for Legacy Gamedevs] Add party privacy enum (#306) ...
* Add party privacy enum * Add party privacy enum * Possible unreal working * Cast to int
Vadi
Vadi3y ago
Let's see if someone asks for it first I haven't yet seen anyone implement parties yet..
SlySven ☕
SlySven ☕3y ago
You haven't been checking my RP - I've been mis-using it for a while now...
SlySven ☕
SlySven ☕3y ago
atari2600tim
atari2600tim3y ago
I think Mudlet lets you say that you are in a party with 3 of 5 slots taken, but does not have the clickable thing to where you can join in. https://discord.com/rich-presence shows some examples where there are options to join, ask to join, spectate. Mudlet has some stub functions that print a debug message when someone clicks to Join or Spectate or whatever, but probably nothing for creating them. https://github.com/Mudlet/Mudlet/blob/development/src/discord.cpp#L301
SlySven ☕
SlySven ☕3y ago
Those stubs were/are purely for debugging - the normal usage of those buttons are to invite the other party to start up their copy of the application (think something like a FPS e.g. Doom™️) and to join in or watch the same game as the originator is playing. Mudlet cannot - I think - do exactly that because not only would the button clicker's copy of Mudlet have to start up, it would also have to connect up to the same MUD as the originator is playing. If that is a MUD that does provide a Discord Application ID to Mudlet - so that Mudlet can cause the RP to show THAT MUD (like the IRE ones do) then it might be possible to fire up a connection, but not otherwise (when the RP just reports "Playing Mudlet")...
Want results from more Discord servers?
Add your server