Exemple #1
0
        public static Embed CreateReactionRoleRuleEmbed(ReactionRoleModel model)
        {
            var builder = new EmbedBuilder()
                          .WithTitle($"Reaction Role: {model.Name}")
                          .AddField("Channel", MentionUtils.MentionChannel(model.ChannelId))
                          .WithColor(116, 223, 207)
                          .WithCurrentTimestamp();

            if (model.Rule is ReactionRuleModel rule)
            {
                foreach (var(emote, roles) in rule.Reactions)
                {
                    builder.AddRule(emote, roles);
                }
            }
            else
            {
                builder.AddField("Reaction", (model.Rule as ReverseRuleModel).Emote);
            }

            return(builder.Build());
        }