/// <summary> /// Sends a message to a specified channel. /// </summary> /// <param name="_Content">String to send</param> /// <param name="ChannelID">Channel ID to send message to.</param> public static void SendMessage(string _Content, string ChannelID) { RemcordRest rc = new RemcordRest(); RemcordAuthentication a = new RemcordAuthentication(); a.Token = tokenx.GetToken(); MessagePayload p = new MessagePayload(); p.Content = _Content; rc.SendPostRequest(EndpointRoutes.POST_SendMessage(ChannelID), p, a); }
public static async Task SendMessageAsync(string _Content, string ChannelID) { RemcordRest client = new RemcordRest(); RemcordAuthentication authx = new RemcordAuthentication(); authx.Token = tokenx.GetToken(); MessagePayload payload = new MessagePayload(); payload.Content = _Content; await Task.Run(() => { client.SendPostRequest(EndpointRoutes.POST_SendMessage(ChannelID), payload, authx); }); }