/// <summary> /// Sends a message to a channel /// </summary> /// <param name="channelId">ID of the channel</param> /// <param name="message">Contents of the message</param> /// <param name="tts">Whether the message should be TTS or not</param> /// <returns>The message</returns> public static DiscordMessage SendMessage(this DiscordClient client, ulong channelId, string message, bool tts = false, DiscordEmbed embed = null) { return(client.HttpClient.Post($"/channels/{channelId}/messages", new MessageProperties() { Content = message, Tts = tts, Embed = embed }) .Deserialize <DiscordMessage>().SetClient(client)); }
/// <summary> /// Sends a message to the channel /// </summary> /// <param name="message">Content of the message</param> /// <param name="tts">Whether the message should be TTS or not</param> /// <returns>The message</returns> public DiscordMessage SendMessage(string message, bool tts = false, DiscordEmbed embed = null) { return(Client.SendMessage(Id, message, tts, embed)); }
/// <summary> /// Sends a message to the channel /// </summary> /// <param name="message">Content of the message</param> /// <param name="tts">Whether the message should be TTS or not</param> /// <returns>The message</returns> public DiscordMessage SendMessage(string message, bool tts = false, DiscordEmbed embed = null) { return(SendMessageAsync(message, tts, embed).Result); }
public async Task <DiscordMessage> SendMessageAsync(string message, bool tts = false, DiscordEmbed embed = null) { return(await Client.SendMessageAsync(Id, message, tts, embed)); }
public EmbedMaker() { _embed = new DiscordEmbed(); }
/// <summary> /// Sends a message through the webhook /// </summary> /// <param name="content">The message to send</param> /// <param name="embed">Embed to include in the message</param> /// <param name="profile">Custom Username and Avatar url (both are optional)</param> public void SendMessage(string content, DiscordEmbed embed = null, DiscordWebhookProfile profile = null) { SendMessageAsync(content, embed, profile).GetAwaiter().GetResult(); }
public async Task SendMessageAsync(string content, DiscordEmbed embed = null, DiscordWebhookProfile profile = null) { await Client.SendWebhookMessageAsync(Id, Token, content, embed, profile); }
/// <summary> /// Sends a message to a channel /// </summary> /// <param name="channelId">ID of the channel</param> /// <param name="message">Contents of the message</param> /// <param name="tts">Whether the message should be TTS or not</param> /// <returns>The message</returns> public static DiscordMessage SendMessage(this DiscordClient client, ulong channelId, string message, bool tts = false, DiscordEmbed embed = null) { return(client.SendMessageAsync(channelId, message, tts, embed).GetAwaiter().GetResult()); }
public static async Task <DiscordMessage> SendMessageAsync(this DiscordClient client, ulong channelId, string message, bool tts = false, DiscordEmbed embed = null) { return(await client.SendMessageAsync(channelId, new MessageProperties() { Content = message, Tts = tts, Embed = embed })); }