using System.Threading.Tasks; using Discord; namespace PluginManager.Others; /// /// A class that handles the sending of messages to the user. /// public static class ChannelManagement { /// /// Get the text channel by name from server /// /// The server /// The channel name /// /// /// public static IGuildChannel GetTextChannel(this IGuild server, string name) { return server.GetTextChannel(name); } /// /// Get the voice channel by name from server /// /// The server /// The channel name /// /// /// public static IGuildChannel GetVoiceChannel(this IGuild server, string name) { return server.GetVoiceChannel(name); } /// /// Get the DM channel between and /// /// /// /// /// public static async Task GetDMChannel(IGuildUser user) { return await user.CreateDMChannelAsync(); } /// /// Get the channel where the message was sent /// /// The message /// /// /// public static IChannel GetChannel(IMessage message) { return message.Channel; } }