/// <summary> /// Sends a message via DM. /// </summary> /// <remarks> /// This method attempts to send a direct-message to the user. /// <note type="warning"> /// <para> /// Please note that this method <strong>will</strong> throw an <see cref="Discord.Net.HttpException"/> /// if the user cannot receive DMs due to privacy reasons or if the user has the sender blocked. /// </para> /// <para> /// You may want to consider catching for <see cref="Discord.Net.HttpException.DiscordCode"/> /// <c>50007</c> when using this method. /// </para> /// </note> /// </remarks> /// <param name="user">The user to send the DM to.</param> /// <param name="text">The message to be sent.</param> /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> /// <param name="options">The options to be used when sending the request.</param> /// <param name="allowedMentions"> /// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>. /// If <c>null</c>, all mentioned roles and users will be notified. /// </param> /// <param name="components">The message components to be included with this message. Used for interactions.</param> /// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param> /// <returns> /// A task that represents the asynchronous send operation. The task result contains the sent message. /// </returns> public static async Task <IUserMessage> SendMessageAsync(this IUser user, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed[] embeds = null) { return(await(await user.CreateDMChannelAsync().ConfigureAwait(false)).SendMessageAsync(text, isTTS, embed, options, allowedMentions, components: components, embeds: embeds).ConfigureAwait(false)); }
public Task <IUserMessage> SendFilesAsync(IEnumerable <FileAttachment> attachments, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null) => throw new NotImplementedException();
public Task <IUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null) { throw new NotImplementedException(); }
/// <summary> /// Sends an inline reply that references a message. /// </summary> /// <param name="msg">The message that is being replied on.</param> /// <param name="text">The message to be sent.</param> /// <param name="isTTS">Determines whether the message should be read aloud by Discord or not.</param> /// <param name="embed">The <see cref="Discord.EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> /// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param> /// <param name="allowedMentions"> /// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>. /// If <c>null</c>, all mentioned roles and users will be notified. /// </param> /// <param name="options">The options to be used when sending the request.</param> /// <param name="components">The message components to be included with this message. Used for interactions.</param> /// <param name="stickers">A collection of stickers to send with the message.</param> /// <returns> /// A task that represents an asynchronous send operation for delivering the message. The task result /// contains the sent message. /// </returns> public static async Task <IUserMessage> ReplyAsync(this IUserMessage msg, string text = null, bool isTTS = false, Embed embed = null, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null) { return(await msg.Channel.SendMessageAsync(text, isTTS, embed, options, allowedMentions, new MessageReference(messageId : msg.Id), components, stickers, embeds).ConfigureAwait(false)); }
public Task <IUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None) { throw new NotImplementedException(); }
public Task <IUserMessage> SendFileAsync(FileAttachment attachment, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None) => throw new NotImplementedException();