From 2233f40cbbba44248f745dafd7f57421cd339adb Mon Sep 17 00:00:00 2001 From: RogueException Date: Sun, 4 Oct 2015 22:14:28 -0300 Subject: [PATCH] Use better SendMessage overloads --- src/Discord.Net/DiscordClient.API.cs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Discord.Net/DiscordClient.API.cs b/src/Discord.Net/DiscordClient.API.cs index aae55df63..f51ea91bc 100644 --- a/src/Discord.Net/DiscordClient.API.cs +++ b/src/Discord.Net/DiscordClient.API.cs @@ -238,19 +238,25 @@ namespace Discord } //Messages - /// Sends a message to the provided channel. - public Task SendMessage(Channel channel, string text) - => SendMessage(channel?.Id, text, new string[0]); - /// Sends a message to the provided channel. - public Task SendMessage(string channelId, string text) - => SendMessage(channelId, text, new string[0]); - /// Sends a message to the provided channel, mentioning certain users. + /// Sends a message to the provided channel, optionally mentioning certain users. /// While not required, it is recommended to include a mention reference in the text (see User.Mention). - public Task SendMessage(string channelId, string text, string[] mentions) - => SendMessage(_channels[channelId], text, mentions); - /// Sends a message to the provided channel, mentioning certain users. + public Task SendMessage(Channel channel, string text, params string[] mentions) + => SendMessage(channel, text, mentions, false); + /// Sends a message to the provided channel, optionally mentioning certain users. /// While not required, it is recommended to include a mention reference in the text (see User.Mention). - public async Task SendMessage(Channel channel, string text, string[] mentions, bool isTextToSpeech = false) + public Task SendMessage(string channelId, string text, params string[] mentions) + => SendMessage(_channels[channelId], text, mentions, false); + /// Sends a message to the provided channel, optionally mentioning certain users. + /// While not required, it is recommended to include a mention reference in the text (see User.Mention). + public Task SendTTSMessage(Channel channel, string text, params string[] mentions) + => SendMessage(channel, text, mentions, true); + /// Sends a message to the provided channel, optionally mentioning certain users. + /// While not required, it is recommended to include a mention reference in the text (see User.Mention). + public Task SendTTSMessage(string channelId, string text, params string[] mentions) + => SendMessage(_channels[channelId], text, mentions, true); + /// Sends a message to the provided channel, optionally mentioning certain users. + /// While not required, it is recommended to include a mention reference in the text (see User.Mention). + private async Task SendMessage(Channel channel, string text, string[] mentions, bool isTextToSpeech) { CheckReady(); if (channel == null) throw new ArgumentNullException(nameof(channel));