示例#1
0
        public async Task ManualMangoAppearance()
        {
            var admin = Context.Guild.Roles.FirstOrDefault(x => x.Name.ToLower().StartsWith("controller"));

            if (!((SocketGuildUser)Context.User).Roles.Contains(admin))
            {
                await Context.Channel.SendMessageAsync("You aren't an admin, you don't have permission to do this command!");

                return;
            }
            MT.AddMangoAppearance();
            var embed = new EmbedBuilder
            {
                Title       = "Mango Time!",
                Color       = Color.Teal,
                Url         = "https://github.com/rwobig93/MangoTime",
                ImageUrl    = "https://media.giphy.com/media/IbaWetIO1PA9LKN5mj/giphy.gif",
                Description = MT.CalculateMangoTime()
            };
            await Context.Channel.SendMessageAsync(embed : embed.Build());
        }