Ejemplo n.º 1
0
        public static Task Respond(this IMessageChannel channel, string response)
        {
            if (!channel.AllowCommands())
            {
                return(Task.CompletedTask);
            }
            const string fileName = "results.txt";

            if (response.Length > DiscordConfig.MaxMessageSize)
            {
                return(channel.SendMemoryFile(fileName, response));
            }
            if (response.Length > 0)
            {
                return(channel.SendMessageAsync(response));
            }
            return(Task.CompletedTask);
        }