Пример #1
0
 /// <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));
 }
Пример #2
0
 /// <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));
 }
Пример #3
0
 /// <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);
 }
Пример #4
0
 public async Task <DiscordMessage> SendMessageAsync(string message, bool tts = false, DiscordEmbed embed = null)
 {
     return(await Client.SendMessageAsync(Id, message, tts, embed));
 }
Пример #5
0
 public EmbedMaker()
 {
     _embed = new DiscordEmbed();
 }
Пример #6
0
 /// <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();
 }
Пример #7
0
 public async Task SendMessageAsync(string content, DiscordEmbed embed = null, DiscordWebhookProfile profile = null)
 {
     await Client.SendWebhookMessageAsync(Id, Token, content, embed, profile);
 }
Пример #8
0
 /// <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());
 }
Пример #9
0
 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
     }));
 }