Message not being sent to Discord
Hi Slut

Im using this plugin in my Update Notice plugin for RUST. I want to discontinue my own build in discord messages and use your plugin.
The problem I have is that the API not working, i can use the /message command without a problem.
Is there any other resource I need to use with the API? I use the basic configuration with this code:
[PluginReference]
Plugin DiscordMessages;

private void SendToDiscord(string message)
{
DiscordMessages?.Call("API_SendTextMessage", "https://discordapp.com/api/webhooks/xxx", message);
​}

Is there somthing im missing?
Did you check to see if DiscordMessages is null? Also, when are you sending the call?

Yes i did check if it is null, and it is not null. see snipplets below:

private void OnServerInitialized()
{
    if (DiscordMessages == null)
    {
        PrintWarning(Lang("PluginNotFoundDiscordMessages"));
        _configuration.EnableDiscordNotify = false;
    }
}

I call the Discord plugin as soon as i detect new versions. basically with the SendToDiscord() procedure:

if (serverUpdated)
{
    _serverBuildId = updateInfo.server;
    Puts(Lang("ServerUpdated"));

    if (_configuration.EnableServer && _configuration.EnableDiscordNotify)
        SendToDiscord(Lang("ServerUpdated"));
}
private void SendToDiscord(string message)
{
    DiscordMessages?.Call("API_SendTextMessage", _configuration.DiscordWebhookURL, message);
}


Merged post

I cannot explain this but i have checked again and now the DiscordMessages is null. Any Idea why?

I'm not sure why it would be null, shouldn't be.
I'll just add my own webrequest procedure in the plugin again.