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); }
void Send(ISendable sendable) { LastOutOpcode = sendable.Command; _lastOutOpcodeTime = DateTime.Now; sendable.Send(stream); }
public async void Consume(EmailMessage message) { await _service.Send(message); }
void Send(ISendable sendable) { LastOutOpcode = sendable.Command; sendable.Send(stream); }
void Send(ISendable sendable) { LastOutOpcode = sendable.Command; sendable.Send(stream); }
public Types.Message Commit(ISendable sendableObject) { return(sendableObject.Send(_token)); }
public void SendMessage() { sendable.Send(); }
public void Greet(string message) { _sendTool.Send(message); }
private void Provide(string xml) { sender.Send(encryptable.Encrypt(xml)); }