예제 #1
0
        public static async Task Embed(string[] parameters)
        {
            SendableMsg msg = new SendableMsg("", false, new Embed()
            {
                Title       = "Embed title",
                Description = "Embed description",
                Fields      = new List <EmbedField>()
                {
                    new EmbedField()
                    {
                        Name     = "Param count",
                        Value    = parameters.Length.ToString(),
                        IsInline = true
                    },

                    new EmbedField()
                    {
                        Name     = "Other",
                        Value    = "More test stuff",
                        IsInline = true
                    },

                    new EmbedField()
                    {
                        Name     = "Other",
                        Value    = "New test stuff",
                        IsInline = true
                    }
                }
            });

            await Messages.Send(msg);
        }
예제 #2
0
 private Task SendModuleMessage(SendableMsg message)
 {
     if (context == null)
     {
         return(Task.CompletedTask);
     }
     return(ModularUtil.SendMessage(context, message));
 }
예제 #3
0
        public static async Task <IUserMessage> SendMessage(ICommandContext context, SendableMsg message)
        {
            if (message.Filepath != null)
            {
                return(await context.Channel.SendFileAsync(message.Filepath, message.Text, message.isTTS, Convert(message.MsgEmbed, context), null, message.Spoilered));
            }

            return(await context.Channel.SendMessageAsync(message.Text, message.isTTS, Convert(message.MsgEmbed, context)));
        }
예제 #4
0
파일: Messages.cs 프로젝트: xubiod/xubot
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
        public static async Task Send(SendableMsg message)
        {
            OnMessageSend?.Invoke(message);
            return;
        }