Exemplo n.º 1
0
        public void CommandList(IInvocationContext context, IMessage message)
        {
            ISendable target = context.Raiser;

            if (context.User.Permissions != UserPermission.BotOwner)
            {
                target = context.User;
            }
            StringBuilder sb = new StringBuilder();

            foreach (
                var cmd in
                _commandRegistry.CommandAttributes.OrderBy(x => x.Name)
                .Where(x => x.MinimumPermissionLevel <= context.User.Permissions))
            {
                string args = string.Empty;
                if (!string.IsNullOrEmpty(cmd.Arguments))
                {
                    args = string.Join(" ", cmd.Arguments.Split('|').Select(x => $"[{x.Trim()}]"));
                }
                sb.AppendLine($"{"." + cmd.Name + " " + args}");
            }

            target.Send(context.OriginClient.Features.HasFlag(ClientFeature.Markdown)
                ? Message.Create($"```css\n{sb.ToString()}\n```")
                : Message.Create(sb.ToString()));
        }
 public void Greet(string message)
 {
     greetTool.Send(message);
 }
Exemplo n.º 3
0
 void Send(ISendable sendable)
 {
     LastOutOpcode      = sendable.Command;
     _lastOutOpcodeTime = DateTime.Now;
     sendable.Send(stream);
 }
 public async void Consume(EmailMessage message)
 {
     await _service.Send(message);
 }
Exemplo n.º 5
0
 void Send(ISendable sendable)
 {
     LastOutOpcode = sendable.Command;
     sendable.Send(stream);
 }
Exemplo n.º 6
0
 void Send(ISendable sendable)
 {
     LastOutOpcode = sendable.Command;
     sendable.Send(stream);
 }
Exemplo n.º 7
0
 public Types.Message Commit(ISendable sendableObject)
 {
     return(sendableObject.Send(_token));
 }
 public void SendMessage()
 {
     sendable.Send();
 }
Exemplo n.º 9
0
 public void Greet(string message)
 {
     _sendTool.Send(message);
 }
Exemplo n.º 10
0
 private void Provide(string xml)
 {
     sender.Send(encryptable.Encrypt(xml));
 }