I would l like to set what the bot is playing via rustcord to the player count, any advice for this
Set the bot presence via Rustcord?
I'll look into this.
Thanks!
Thanks!
So, I pulled the repo for the Discord extension and scoured the source code for things I thought would be related to the ability to set status and there's only a couple things I found:
in DiscordClient.CS:
and in DiscordObjects/Presence.cs
What I'm not finding though are REST posts to actually do anything after that, like in the case of CreateMessage in the channel. I'm a SUPER noob at this stuff, but I'll fuck with it until one of us gets somewhere =D
in DiscordClient.CS:
public void UpdateStatus(Presence presence)
{
var opcode = new SPayload()
{
OP = OpCodes.StatusUpdate,
Payload = presence
};
var payload = JsonConvert.SerializeObject(opcode);
_webSocket.Send(payload);
}and in DiscordObjects/Presence.cs
namespace Oxide.Ext.Discord.DiscordObjects
{
using Newtonsoft.Json;
public class Presence
{
[JsonProperty("status")]
public string Status { get; set; }
[JsonProperty("game")]
public Game Game { get; set; }
[JsonProperty("since")]
public int Since { get; set; }
[JsonProperty("afk")]
public bool AFK { get; set; }
}
}
What I'm not finding though are REST posts to actually do anything after that, like in the case of CreateMessage in the channel. I'm a SUPER noob at this stuff, but I'll fuck with it until one of us gets somewhere =D