private async Task GetEmoteStats(CommandContext ctx, TempEmote emote, string interval) { var guild = ctx.Guild; var isValidEmote = IsValidMessageEmote(emote.Id, guild); if (!isValidEmote) { await ctx.RespondAsync("Invalid emote"); return; } var parsed = TryGetDateFromInterval(IntervalValue.Parse(interval), out var fromDate); if (!parsed) { await ctx.RespondAsync("Invalid interval"); return; } var request = new GetEmoteStatsRequest(ctx) { Emote = emote, FromDate = fromDate }; _commandQueue.Enqueue(request); }
private async Task GetRankedEmotes(CommandContext ctx, SortDirection direction, int page, string interval, IReadOnlyDictionary <ulong, DiscordEmoji> guildEmotes) { var parsed = TryGetDateFromInterval(IntervalValue.Parse(interval), out var fromDate); if (!parsed) { await ctx.RespondAsync("Invalid interval"); return; } var request = new GetGuildEmoteStatsRequest(ctx) { SortDirection = direction, Page = page, FromDate = fromDate, GuildEmojis = guildEmotes }; _commandQueue.Enqueue(request); }
private async Task GetBestEmotesUser(CommandContext ctx, ulong userId, string mention, int page, string interval) { var parsed = TryGetDateFromInterval(IntervalValue.Parse(interval), out var fromDate); if (!parsed) { await ctx.RespondAsync("Invalid interval"); return; } var request = new GetUserEmoteStatsRequest(ctx) { UserId = userId, Mention = mention, Page = page, FromDate = fromDate, }; _commandQueue.Enqueue(request); }