private async Task UserLeft(SocketGuildUser user, DiscordSocketClient client, CancellationToken token) { logger.LogInformation("User left: {0}", user); var goodbye = $"User {user} left the server!"; await client.GetChannelByName("goodbyes").SendMessageAsync(goodbye, options: token.ToRequestOptions()); }
private async Task ClientMessageDeleted(ulong messageId, ISocketMessageChannel channel, DiscordSocketClient client, CancellationToken token) { logger.LogInformation("Message deleted: {0}", messageId); const string deletionsChannel = "deletions"; if (!channel.IsPublicChannel() && channel.Name != deletionsChannel) { return; } var message = _publicMessageHistory.Single(x => x.Id == messageId); await client.GetChannelByName(deletionsChannel).SendMessageAsync("Deleted:", false, message.QuoteMessage(), token.ToRequestOptions()); }