예제 #1
0
        public async Task SetEmote(IEmote emote)
        {
            if (emote == null)
            {
                await Context.Interaction.ModifyOriginalResponseAsync(properties =>
                {
                    properties.AllowedMentions = AllowedMentions.None;
                    properties.Embed           = new EmbedBuilder()
                                                 .WithTitle("Remember emote not changed")
                                                 .WithDescription("That's not an emote!")
                                                 .WithColor(Color.Red)
                                                 .WithCurrentTimestamp()
                                                 .Build();
                });

                return;
            }

            var guild = ((IGuildChannel)Context.Channel).Guild;
            await _guildSettingsService.SetSaveReaction(guild.Id, emote);

            await Context.Interaction.ModifyOriginalResponseAsync(properties =>
            {
                properties.AllowedMentions = AllowedMentions.None;
                properties.Embed           = new EmbedBuilder()
                                             .WithTitle("Remember emote changed")
                                             .WithDescription($"Got it! {emote} is your new remember-reaction")
                                             .WithColor(Color.Blue)
                                             .WithCurrentTimestamp()
                                             .Build();
            });
        }
        public async Task Consume(ConsumeContext <SetSaveReactionRequest> context)
        {
            var request = context.Message;
            await _guildSettingsService.SetSaveReaction(request.GuildId, request.Emote);

            await context.RespondAsync(new HandlerResponse(HandlerResponseCode.Success));
        }