public UserLeftHandler(DiscordSocketClient client, Logger logger, InternalStatistics internalStatistics, IServiceProvider provider) { Client = client; Logger = logger; InternalStatistics = internalStatistics; Provider = provider; }
public UserJoinedHandler(DiscordSocketClient client, IOptions <Configuration> config, Logger logger, InternalStatistics internalStatistics) { Client = client; Logger = logger; InternalStatistics = internalStatistics; Config = config.Value; }
private async Task OnReactionAddedAsync(Cacheable <IUserMessage, ulong> message, ISocketMessageChannel channel, SocketReaction reaction) { InternalStatistics.IncrementEvent("ReactionAdded"); using var scope = Provider.CreateScope(); await scope.ServiceProvider.GetService <EmoteStats>().IncrementFromReactionAsync(reaction); if (reaction.User.IsSpecified && reaction.User.Value.IsUser()) { await PaginationService.HandleReactionAsync(reaction); await scope.ServiceProvider.GetService <UserReactionsService>().IncrementReactionStatsAsync(reaction); await scope.ServiceProvider.GetService <ReminderService>().HandleRemindCopyAsync(reaction); if (channel is SocketTextChannel textChannel) { await scope.ServiceProvider.GetService <PointsService>().IncrementPointsAsync(textChannel.Guild, reaction); } if (message.HasValue) { await scope.ServiceProvider.GetService <ReminderService>().PostponeReminderAsync(message.Value, reaction); } } }
private async Task OnMessageDeletedAsync(Cacheable <IMessage, ulong> message, ISocketMessageChannel channel) { InternalStatistics.IncrementEvent("MessageDeleted"); if (channel is IPrivateChannel || (message.HasValue && !message.Value.Author.IsUser())) { return; } SocketGuildUser user = null; if (message.HasValue && message.Value.Author is SocketGuildUser guildUser) { user = guildUser; } else if (MessageCache.Exists(message.Id)) { var author = MessageCache.Get(message.Id).Author; user = author is SocketGuildUser socketGuildUser ? socketGuildUser : null; } using var scope = Provider.CreateScope(); if (user != null) { await scope.ServiceProvider.GetService <UserMessagesService>().DecrementMessageStats(user.Guild, user, channel); } await Logger.OnMessageDelete(message, channel).ConfigureAwait(false); PaginationService.DeleteEmbed(message.Id); }
public UserJoinedHandler(DiscordSocketClient client, InternalStatistics internalStatistics, IServiceProvider services) { Client = client; InternalStatistics = internalStatistics; Services = services; }
public ReactionRemovedHandler(DiscordSocketClient client, EmoteStats emoteStats, InternalStatistics internalStatistics, UserService userService) { Client = client; EmoteStats = emoteStats; InternalStatistics = internalStatistics; UserService = userService; }
private async Task OnClientReadyAsync() { InternalStatistics.IncrementEvent("Ready"); await InitService.InitAsync(); await SetActivityAsync(); }
public ReactionAddedHandler(DiscordSocketClient client, InternalStatistics internalStatistics, PaginationService paginationService, IServiceProvider provider) { Client = client; InternalStatistics = internalStatistics; PaginationService = paginationService; Provider = provider; }
public GuildMemberUpdatedHandler(DiscordSocketClient client, Logger logger, InternalStatistics internalStatistics) { Logger = logger; Client = client; InternalStatistics = internalStatistics; Client.GuildMemberUpdated += OnGuildMemberUpdatedAsync; }
public GuildMemberUpdatedHandler(DiscordSocketClient client, InternalStatistics internalStatistics, IServiceProvider provider) { Client = client; InternalStatistics = internalStatistics; Provider = provider; Client.GuildMemberUpdated += OnGuildMemberUpdatedAsync; }
private async Task OnUserLeftAsync(SocketGuildUser user) { InternalStatistics.IncrementEvent("UserLeft"); await Logger.OnUserLeft(user).ConfigureAwait(false); using var scope = Provider.CreateScope(); await scope.ServiceProvider.GetService <UnverifyService>().OnUserLeftGuildAsync(user); }
public CommandExecutedHandler(CommandService commandService, IServiceProvider services, ILogger <CommandExecutedHandler> logger, InternalStatistics internalStatistics) { CommandService = commandService; Services = services; Logger = logger; InternalStatistics = internalStatistics; }
public MessageDeletedHandler(DiscordSocketClient client, InternalStatistics internalStatistics, PaginationService paginationService, IMessageCache messageCache, IServiceProvider provider) { Client = client; InternalStatistics = internalStatistics; PaginationService = paginationService; MessageCache = messageCache; Provider = provider; }
private async Task OnUserUnbannedAsync(SocketUser user, SocketGuild guild) { InternalStatistics.IncrementEvent("UserUnbanned"); using var scope = ServiceProvider.CreateScope(); var auditService = scope.ServiceProvider.GetService <AuditService>(); await auditService.RunTaskAsync(ActionType.Unban, guild); }
public ReportsController(BotStatusService statusService, InternalStatistics internalStatistics, ApiStatistics apiStatistics, DiscordSocketClient discordClient, IHostApplicationLifetime applicationLifetime) { StatusService = statusService; InternalStatistics = internalStatistics; ApiStatistics = apiStatistics; DiscordClient = discordClient; ApplicationLifetime = applicationLifetime; }
public AdminController(BotStatusService service, InternalStatistics internalStatistics, ConfigRepository configRepository, DiscordSocketClient discordSocket, TeamSearchService teamSearchService) { StatusService = service; InternalStatistics = internalStatistics; ConfigRepository = configRepository; DiscordClient = discordSocket; TeamSearchService = teamSearchService; }
private async Task OnReactionAddedAsync(Cacheable <IUserMessage, ulong> message, ISocketMessageChannel channel, SocketReaction reaction) { InternalStatistics.IncrementEvent("ReactionAdded"); EmoteStats.IncrementFromReaction(reaction); await PaginationService.HandleReactionAsync(reaction); UserService.IncrementReaction(reaction); }
public ReactionAddedHandler(DiscordSocketClient client, EmoteStats emoteStats, InternalStatistics internalStatistics, PaginationService paginationService, UserService userService) { Client = client; EmoteStats = emoteStats; InternalStatistics = internalStatistics; PaginationService = paginationService; UserService = userService; }
private async Task OnUserJoinedOnServerAsync(SocketGuildUser user) { InternalStatistics.IncrementEvent("UserJoined"); using var scope = Services.CreateScope(); await scope.ServiceProvider.GetService <AuditService>().LogUserJoinAsync(user); await scope.ServiceProvider.GetService <InviteTrackerService>().OnUserJoinedAsync(user); }
private async Task OnReactionRemovedAsync(Cacheable <IUserMessage, ulong> message, ISocketMessageChannel channel, SocketReaction reaction) { InternalStatistics.IncrementEvent("ReactionRemoved"); using var scope = Provider.CreateScope(); await scope.ServiceProvider.GetService <EmoteStats>().DecrementFromReactionAsync(reaction); await scope.ServiceProvider.GetService <UserReactionsService>().DecrementReactionStatsAsync(reaction); }
private async Task OnUserJoinedOnServerAsync(SocketGuildUser user) { InternalStatistics.IncrementEvent("UserJoined"); await Logger.OnUserJoined(user).ConfigureAwait(false); using var scope = Services.CreateScope(); var inviteTracker = scope.ServiceProvider.GetService <InviteTrackerService>(); await inviteTracker.OnUserJoinedAsync(user); }
public MessageDeletedHandler(DiscordSocketClient client, Logger logger, InternalStatistics internalStatistics, PaginationService paginationService, IMessageCache messageCache, UserService userService) { Client = client; Logger = logger; InternalStatistics = internalStatistics; PaginationService = paginationService; MessageCache = messageCache; UserService = userService; }
public ReportsController(BotStatusService statusService, InternalStatistics internalStatistics, DiscordSocketClient discordClient, BackgroundTaskQueue backgroundTaskQueue, AuditService auditService, UserService userService) { StatusService = statusService; InternalStatistics = internalStatistics; DiscordClient = discordClient; BackgroundTaskQueue = backgroundTaskQueue; AuditService = auditService; UserService = userService; }
public MessageReceivedHandler(DiscordSocketClient client, CommandService commands, IServiceProvider services, EmoteChain emoteChain, InternalStatistics internalStatistics, ConfigurationService configurationService, BotState botState) { Client = client; Commands = commands; Services = services; EmoteChain = emoteChain; InternalStatistics = internalStatistics; ConfigurationService = configurationService; BotState = botState; }
public ReportsController(BotStatusService statusService, InternalStatistics internalStatistics, ApiStatistics apiStatistics, DiscordSocketClient discordClient, IHostApplicationLifetime applicationLifetime, BackgroundTaskQueue backgroundTaskQueue, AuditService auditService, UserService userService) { StatusService = statusService; InternalStatistics = internalStatistics; ApiStatistics = apiStatistics; DiscordClient = discordClient; ApplicationLifetime = applicationLifetime; BackgroundTaskQueue = backgroundTaskQueue; AuditService = auditService; UserService = userService; }
public MessageReceivedHandler(DiscordSocketClient client, CommandService commands, IOptions <Configuration> config, IServiceProvider services, AutoReplyService autoReply, EmoteChain emoteChain, InternalStatistics internalStatistics, EmoteStats emoteStats, UserService userService) { Client = client; Commands = commands; Services = services; AutoReply = autoReply; EmoteChain = emoteChain; InternalStatistics = internalStatistics; EmoteStats = emoteStats; Config = config.Value; UserService = userService; }
public GrillBotService(IServiceProvider services, DiscordSocketClient client, CommandService commands, IOptions <Configuration> config, InternalStatistics internalStatistics, InitService initService, ILogger <GrillBotService> logger) { Services = services; Client = client; Commands = commands; Config = config.Value; InternalStatistics = internalStatistics; InitService = initService; Logger = logger; Client.Ready += OnClientReadyAsync; }
public GrillBotService(IServiceProvider services, DiscordSocketClient client, CommandService commands, InternalStatistics internalStatistics, InitService initService, BotState botState, ConfigurationService configurationService) { Services = services; Client = client; Commands = commands; InternalStatistics = internalStatistics; InitService = initService; BotState = botState; ConfigurationService = configurationService; Client.Ready += OnClientReadyAsync; }
private async Task OnGuildMemberUpdatedAsync(SocketGuildUser guildUserBefore, SocketGuildUser guildUserAfter) { if (LastEventAt != DateTime.MinValue && (DateTime.UtcNow - LastEventAt).TotalSeconds < 1.0D) { return; } InternalStatistics.IncrementEvent("GuildMemberUpdated"); using var scope = Provider.CreateScope(); await scope.ServiceProvider.GetService <AuditService>().ProcessBoostChangeAsync(guildUserBefore, guildUserAfter); LastEventAt = DateTime.UtcNow; }
private async Task OnMessageUpdatedAsync(Cacheable <IMessage, ulong> messageBefore, SocketMessage messageAfter, ISocketMessageChannel channel) { InternalStatistics.IncrementEvent("MessageUpdated"); if (!messageAfter.Author.IsUser() || channel is IPrivateChannel) { return; } if (channel is SocketGuildChannel guildChannel) { using var scope = Provider.CreateScope(); await scope.ServiceProvider.GetService <AuditService>().LogMessageEditedAsync(messageBefore, messageAfter, channel, guildChannel.Guild); } }