I'm looking for help setting bot presence via plugin (where it shows what the bot is "Playing")
Set/update bot presence?
Hello,
As i just created a plugin for discord i wanted to update the presence of the bot.
As i just created a plugin for discord i wanted to update the presence of the bot.
void UpdatePresence()
{
foreach (var user in Client.DiscordServer.members)
{
if(user.user.bot != true)
continue;
if(user.user.id != "466178884774395904")
continue;
Presence discordPresence = new Presence();
discordPresence.Status = "Playing";
Client.UpdateStatus(discordPresence);
}
}
void CheckVerifiedUserCount()
{
Client.UpdateStatus(new Presence
{
Game = new Ext.Discord.DiscordObjects.Game
{
Name = $"{storedData.Players.Count} verified players"
}
});
}
i had try both function and it just don't seem to work, did i miss something PsychoTea ?
Did you ever make any progress on this
Well to be honest the extension here is not uptodate and don't work for presence, so i just decided to change my plugin and don't use extension anymore, i am now using mysql to get members verified.
Cool. I did it this way https://oxidemod.org/threads/host-your-own-discord-bot-that-showing-online-players.30710/
var discordPresence = new Presence {Status = "Playing", AFK = false, Game = new Ext.Discord.DiscordObjects.Game() {Name = "Game_Name_Here"}}; var discordPresence = new Presence { Status = "Playing", AFK = false, Game = new Ext.Discord.DiscordObjects.Game() { Name = BasePlayer.activePlayerList.Count + "/" + ConVar.Server.maxplayers + " on " + ConVar.Server.hostname} };
Client.UpdateStatus(discordPresence);
// this worked for me