mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
feat(music): persist music analytics to MySQL with 24h/year timeframes and personal recap
This commit is contained in:
1 parent
da477ebf03
commit
c9332a15af
15 files changed
+274
-166
No files matched your search
@@ -7,7 +7,7 @@ import { CommandBuilder } from "../src/commands/index.mjs";
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { GuildStats } from "../src/music/GuildStats.mjs";
|
||||
import { cleanId, Utils } from "../src/utils/Utils.mjs";
|
||||
import { getGlobalColor } from "../src/ui/index.mjs";
|
||||
import { getGlobalColor, getMessageGuildId } from "../src/ui/index.mjs";
|
||||
|
||||
/** @type {CommandBuilder} */
|
||||
export const command = new CommandBuilder()
|
||||
@@ -29,11 +29,11 @@ export const command = new CommandBuilder()
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function run(message, data) {
|
||||
const guildId = cleanId(message.message?.guildId ?? message.channel?.guildId);
|
||||
const guildId = cleanId(getMessageGuildId(message));
|
||||
const prefix = this.handler.getPrefix(guildId) || "%";
|
||||
|
||||
const rawAuthor = message.message?.author ?? message.author;
|
||||
const authorId = cleanId(rawAuthor?.id);
|
||||
const authorId = cleanId(rawAuthor?.id ?? message.authorId ?? message.message?.authorId ?? "");
|
||||
|
||||
const rawArg = (
|
||||
data?.get?.("target")?.value ??
|
||||
@@ -73,6 +73,8 @@ export async function run(message, data) {
|
||||
if (stats) {
|
||||
isGlobalFallback = true;
|
||||
}
|
||||
} else if (stats.isGlobalFallback) {
|
||||
isGlobalFallback = true;
|
||||
}
|
||||
|
||||
if (!stats || stats.totalTracks === 0) {
|
||||
|
||||
Reference in new issue
Block a user