示例#1
0
 public Builder(EmbedResponseTemplate template)
 {
     response = EmbedResponseTemplateFactory.CreateFromTemplate(template);
     if (response.messages == null)
     {
         this.messages = new List <Message>();
     }
     else
     {
         this.messages = new List <Message>(response.messages);
     }
 }
        internal static EmbedResponse CreateFromTemplate(EmbedResponseTemplate template)
        {
            EmbedResponse embedResponse = new EmbedResponse();

            if ((int)template >= TEMPLATE_SYSTEM_MESSAGE_START && (int)template <= TEMPLATE_SYSTEM_MESSAGE_END)
            {
                embedResponse.Author = TamaChan.Instance.botSettings.botName;
                if (TamaChan.Instance.GetSelf() == null)
                {
                    embedResponse.IconUrl = "%SELF%";
                }
                else
                {
                    embedResponse.IconUrl = TamaChan.Instance.GetSelf().GetAvatarUrl(Discord.ImageFormat.Auto, 64);
                }
            }
            embedResponse.Title = GetTemplateTitle(template);
            embedResponse.Color = GetTemplateColor(template);
            return(embedResponse);
        }
示例#3
0
 public QuestionResponse(OpenQuestion openQuestion, MessageContext messageContext, EmbedResponse baseEmbed) : base(openQuestion, messageContext, baseEmbed)
 {
 }
示例#4
0
 public MenuResponse(Menu menu, MessageContext context, EmbedResponse baseEmbed) : base(menu, context, baseEmbed)
 {
     AddOptions(menu);
 }
示例#5
0
 public BaseMenuResponse(IMenuHandlerObject menuHandlerObject, MessageContext context, EmbedResponse baseEmbed)
 {
     this.Author                  = baseEmbed.Author;
     this.Color                   = baseEmbed.Color;
     this.Description             = baseEmbed.Description;
     this.Footer                  = baseEmbed.Footer;
     this.IconUrl                 = baseEmbed.IconUrl;
     this.ImageAttachmentFilePath = baseEmbed.ImageAttachmentFilePath;
     this.ImageUrl                = baseEmbed.ImageUrl;
     this.ThumbnailURL            = baseEmbed.ThumbnailURL;
     this.Title                   = baseEmbed.Title;
     this.URL      = baseEmbed.URL;
     this.messages = baseEmbed.messages;
 }