Пример #1
0
 /// <summary>
 /// Sends a message
 /// </summary>
 /// <param name="channel">Channel to send to.</param>
 /// <param name="content">Message content to send.</param>
 /// <param name="isTTS">Whether the message is to be read using TTS.</param>
 /// <param name="embed">Embed to attach to the message.</param>
 /// <param name="mentions">Allowed mentions in the message</param>
 /// <returns>The Discord Message that was sent.</returns>
 /// <exception cref="Exceptions.UnauthorizedException">Thrown when the client does not have the <see cref="Permissions.SendMessages"/> permission if <paramref name="isTTS"/> is false and <see cref="Permissions.SendTtsMessages"/> if <paramref name="isTTS"/> is true.</exception>
 /// <exception cref="Exceptions.NotFoundException">Thrown when the channel does not exist.</exception>
 /// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception>
 /// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception>
 public Task <DiscordMessage> SendMessageAsync(DiscordChannel channel, string content = null, bool isTTS = false, DiscordEmbed embed = null, IEnumerable <IMention> mentions = null)
 => this.ApiClient.CreateMessageAsync(channel.Id, content, isTTS, embed, mentions);
Пример #2
0
 /// <summary>
 /// Sends a message
 /// </summary>
 /// <param name="channel">Channel to send to.</param>
 /// <param name="content">Message content to send.</param>
 /// <param name="embed">Embed to attach to the message.</param>
 /// <returns>The Discord Message that was sent.</returns>
 /// <exception cref="Exceptions.UnauthorizedException">Thrown when the client does not have the <see cref="Permissions.SendMessages"/> permission.</exception>
 /// <exception cref="Exceptions.NotFoundException">Thrown when the channel does not exist.</exception>
 /// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception>
 /// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception>
 public Task <DiscordMessage> SendMessageAsync(DiscordChannel channel, string content = null, DiscordEmbed embed = null)
 => this.ApiClient.CreateMessageAsync(channel.Id, null, null, embed, null);
Пример #3
0
 public Task <DiscordMessage> UploadFilesAsync(ulong channel_id, Dictionary <string, Stream> files, string content, bool?tts, DiscordEmbed embed)
 => ApiClient.UploadFilesAsync(channel_id, files, content, tts, embed);
Пример #4
0
 public Task <DiscordMessage> UploadFileAsync(ulong channel_id, Stream file_data, string file_name, string content, bool?tts, DiscordEmbed embed)
 => ApiClient.UploadFileAsync(channel_id, file_data, file_name, content, tts, embed);
Пример #5
0
 public Task <DiscordMessage> CreateMessageAsync(ulong channel_id, string content, bool?tts, DiscordEmbed embed)
 => ApiClient.CreateMessageAsync(channel_id, content, tts, embed);
Пример #6
0
 /// <summary>
 /// Posts a message
 /// </summary>
 /// <param name="content"></param>
 /// <param name="tts"></param>
 /// <param name="embed"></param>
 /// <returns></returns>
 public async Task <DiscordMessage> SendMessage(string content, bool tts = false, DiscordEmbed embed = null) => await DiscordClient.InternalCreateMessage(ID, content, tts, embed);
Пример #7
0
 /// <summary>
 /// Edit the message
 /// </summary>
 /// <param name="content"></param>
 /// <returns></returns>
 public async Task <DiscordMessage> Edit(string content = null, DiscordEmbed embed = null) => await DiscordClient.InternalEditMessage(ChannelID, ID, content, embed);