using Discord; using System.Threading.Tasks; 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) => 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) => server.GetVoiceChannel(name); /// /// Get the DM channel between and /// /// /// public static async Task GetDMChannel(IGuildUser user) => await user.CreateDMChannelAsync(); /// /// Get the channel where the message was sent /// /// The message /// public static IChannel GetChannel(IMessage message) => message.Channel; } }