Exemplo n.º 1
0
        public async Task speak(Message message)
        {
            var commandRegex = @"!([^\s]+)(.*)";
            var groups       = Regex.Match(message.Content, commandRegex).Groups;
            var arguments    = groups[2].ToString().Trim();


            await http.CreateMessage(message, Outbound_Message.Build(arguments, tts : true).Serialize());
        }
Exemplo n.º 2
0
        public async Task CommandList(Message message)
        {
            EmbedField[] commands = this.GetType().GetMethods()
                                    .Where(m => m.GetCustomAttributes(true).Length != 0)
                                    .Select(m => (
                                                ((CommandAttr)m.GetCustomAttributes(true).Single(a => a is CommandAttr))))
                                    .Where(a => !(a.Names.Contains(CommandInterface.UnknownCommandKey)))
                                    .Select(a => EmbedField.Build((a.Names.Length > 1) ? $"__**{a.Names[0]}**__ ({String.Join(",", a.Names.Skip(1))})" : $"__**{a.Names[0]}**__", a.Info))
                                    .ToArray();

            Embed temp = Embed.Build(title: "__***List of Commands***__", fields: commands);
            await http.CreateMessage(message, Outbound_Message.Build(embed : temp).Serialize());
        }