diff --git a/.env.example b/.env.example index 42d4a0c..1d6e4c1 100644 --- a/.env.example +++ b/.env.example @@ -62,6 +62,21 @@ DB_NAME=your_db_name_here # wondering where the data went. DATABASE_URL= +# ─── GitHub Sponsors role (features.sponsor in config.jsonc) ──────────────── +# +# Two secrets shared with the shop that checks the sponsorships. Each must be at +# least 32 characters and EXACTLY the same as on the shop's side. Generate one +# with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" +# +# SPONSOR_LINK_SECRET signs the personal link a member gets from the verify +# button. SPONSOR_SYNC_SECRET is sent as a bearer token when the bot fetches the +# shop's list of current sponsors. Use two different values. +# +# Leave both empty unless you switch the feature on. If one is missing or too +# short, the feature stays off and says so at startup. +SPONSOR_LINK_SECRET= +SPONSOR_SYNC_SECRET= + # ─── Web dashboard ─────────────────────────────────────────────────────────── # # Started with `npm run dashboard`, which runs the bot as a CHILD process and diff --git a/README.md b/README.md index eaabc99..3147a05 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,8 @@ DB_NAME=es_extended | `/send_message` | Sends a custom message to any channel via modal | ✅ Manager / Founder | | `/send_embed` | Sends a fully customizable embed to any channel | ✅ Manager / Founder | | `/backup_database` | Creates a MySQL database backup and uploads it to the log channel | ✅ Founder | +| `/sponsor post` | Posts the GitHub Sponsors panel with the verify button | ✅ Manager / Founder | +| `/sponsor sync [force]` | Runs the sponsor role sync now; `force` overrides the removal brake once | ✅ Manager / Founder | | `/ping` | Shows bot latency and API response time | — | | `/userinfo` | Shows info and minigame points for a user | — | | `/clear` | Bulk-deletes up to 100 messages | ✅ Team | @@ -200,6 +202,20 @@ DB_NAME=es_extended - `🎁 Giveaway Notify` — toggles the Giveaway notification role - `⏰ Garage / Handcuffs / Storage / Vehicle Keys` — toggles script update notification roles +**GitHub Sponsors role** (off by default, `features.sponsor` in `config/config.jsonc`): +a shop links a member's GitHub account, checks the sponsorship and grants the +role. The panel's `Verify` button gives the member a personal link into the +shop, signed with `SPONSOR_LINK_SECRET` and valid for 15 minutes. Once a minute +after startup and then daily at `syncHour` (server time), the bot fetches the +shop's sponsor list with `SPONSOR_SYNC_SECRET` and adds or removes the role to +match. If the list cannot be fetched or read, no role is changed. If it would +take the role from more than half of the current holders and at least three +members, the removals are held back (additions still happen) until somebody runs +`/sponsor sync force:true`. Settings: +`enabled`, `role` (default `sponsor` from the `roles` block), `shopBaseUrl` +(https), `sponsorsUrl` (the panel's link button), `syncHour`. Both secrets go in +`.env`, at least 32 characters each and identical to the shop's. + ### Events Bot **Guild logging** — All events are posted as colored embeds to the configured log channel: @@ -308,6 +324,7 @@ discord_multibot/ ├── core/ │ ├── config.js ← Environment config │ ├── utils.js ← Shared helpers (makeEmbed, readJson, …) +│ ├── sponsor.js ← GitHub Sponsors: link token, sponsor list, daily role sync │ └── pointsManager.js ← Points read/write + reward notifications ├── data/ │ ├── points.json ← Persistent user points (auto-created) @@ -319,6 +336,7 @@ discord_multibot/ │ └── commands/ │ ├── community.js ← /information, /rules, /roles │ ├── admin.js ← /backup_database, /send_message, /send_embed + │ ├── sponsor.js ← /sponsor post, /sponsor sync │ ├── support.js ← /script_guides │ ├── orders.js ← /donation, /order_terms, /order_price │ ├── utility.js ← /ping, /userinfo, /clear diff --git a/README_DE.md b/README_DE.md index 65223aa..74227b5 100644 --- a/README_DE.md +++ b/README_DE.md @@ -188,6 +188,8 @@ DB_NAME=es_extended | `/send_message` | Sendet eine benutzerdefinierte Nachricht per Modal | ✅ Manager / Founder | | `/send_embed` | Sendet ein vollständig anpassbares Embed per Modal | ✅ Manager / Founder | | `/backup_database` | Erstellt ein MySQL-Datenbank-Backup und lädt es in den Log-Channel hoch | ✅ Founder | +| `/sponsor post` | Sendet das GitHub-Sponsors-Panel mit dem Verifizieren-Button | ✅ Manager / Founder | +| `/sponsor sync [force]` | Gleicht die Sponsor-Rolle sofort ab; `force` setzt die Bremse für diesen Lauf außer Kraft | ✅ Manager / Founder | | `/ping` | Zeigt Bot-Latenz und API-Antwortzeit | — | | `/userinfo` | Zeigt Infos und Minigame-Punkte eines Benutzers | — | | `/clear` | Löscht bis zu 100 Nachrichten auf einmal | ✅ Team | @@ -201,6 +203,21 @@ DB_NAME=es_extended - `🎁 Giveaway Notify` — schaltet die Giveaway-Benachrichtigungsrolle um - `⏰ Garage / Handcuffs / Storage / Vehicle Keys` — schaltet Script-Update-Rollen um +**GitHub-Sponsors-Rolle** (standardmäßig aus, `features.sponsor` in `config/config.jsonc`): +Ein Shop verknüpft den GitHub-Account eines Mitglieds, prüft das Sponsoring und +vergibt die Rolle. Der Button `Verifizieren` im Panel gibt dem Mitglied einen +persönlichen Link in den Shop, signiert mit `SPONSOR_LINK_SECRET` und 15 Minuten +gültig. Eine Minute nach dem Start und danach täglich zur Stunde `syncHour` +(Serverzeit) holt der Bot mit `SPONSOR_SYNC_SECRET` die Sponsorenliste des Shops +und vergibt oder entzieht die Rolle passend dazu. Lässt sich die Liste nicht +abrufen oder lesen, wird keine Rolle geändert. Würde sie mehr als der Hälfte +der aktuellen Inhaber und mindestens drei Mitgliedern die Rolle entziehen, hält +der Bot das Entfernen zurück (Hinzufügen läuft weiter), bis jemand +`/sponsor sync force:true` ausführt. Einstellungen: `enabled`, `role` +(Standard `sponsor` aus dem Block `roles`), `shopBaseUrl` (https), `sponsorsUrl` +(der Link-Button im Panel), `syncHour`. Beide Secrets stehen in der `.env`, je +mindestens 32 Zeichen lang und gleich wie im Shop. + ### Events Bot **Guild-Logging** — Alle Events werden als farbige Embeds in den konfigurierten Log-Channel gepostet: @@ -311,6 +328,7 @@ discord_multibot/ ├── core/ │ ├── config.js ← Umgebungskonfiguration │ ├── utils.js ← Gemeinsame Helfer (makeEmbed, readJson, …) +│ ├── sponsor.js ← GitHub Sponsors: Link-Token, Sponsorenliste, täglicher Rollenabgleich │ └── pointsManager.js ← Punkte lesen/schreiben + Reward-Benachrichtigungen ├── data/ │ ├── points.json ← Persistente Benutzerpunkte (wird automatisch erstellt) @@ -322,6 +340,7 @@ discord_multibot/ │ └── commands/ │ ├── community.js ← /information, /rules, /roles │ ├── admin.js ← /backup_database, /send_message, /send_embed + │ ├── sponsor.js ← /sponsor post, /sponsor sync │ ├── support.js ← /script_guides │ ├── orders.js ← /donation, /order_terms, /order_price │ ├── utility.js ← /ping, /userinfo, /clear diff --git a/bots/commands/bot.js b/bots/commands/bot.js index 8a3968f..0b6188a 100644 --- a/bots/commands/bot.js +++ b/bots/commands/bot.js @@ -7,6 +7,7 @@ const { join } = require('path'); const { enabled } = require('../../core/commandKit'); const { t } = require('../../core/i18n'); const config = require('../../core/config'); +const sponsor = require('../../core/sponsor'); const intents = [ GatewayIntentBits.Guilds, @@ -45,6 +46,9 @@ function attach(client, registry) { client.once(Events.ClientReady, () => { console.log(`[Commands Bot] Ready as ${client.user.tag} - ${commands.size} commands loaded` + (skipped.length ? `, ${skipped.length} off (${skipped.join(', ')})` : '') + '.'); + // The daily GitHub Sponsors role sync. Does nothing while the feature is + // off, and warns once when it is on but not configured. + sponsor.startSponsorSync(client); }); client.on(Events.InteractionCreate, async interaction => { @@ -109,6 +113,9 @@ async function handlePersistentButton(interaction) { // and never takes it away. if (customId === 'rules_verification') return handleVerification(interaction); + // The GitHub Sponsors panel: a personal, signed link into the shop. + if (customId === sponsor.VERIFY_BUTTON_ID) return handleSponsorVerify(interaction); + const id = buttonIdFromCustomId(customId); if (!id) return; @@ -139,6 +146,36 @@ async function handleVerification(interaction) { setTimeout(() => interaction.deleteReply().catch(() => {}), 5000); } +/** + * The sponsor panel's button. Answers with a link that only works for the + * member who clicked, for 15 minutes; the shop does the rest. The link is + * built per click and never posted publicly, which is why it is ephemeral. + */ +async function handleSponsorVerify(interaction) { + // A panel posted while the feature was on keeps its button after it is + // switched off. Say so rather than answer with a link that cannot work. + if (!config.featureEnabled('sponsor')) { + return interaction.reply({ content: t('common.featureDisabled'), flags: MessageFlags.Ephemeral }); + } + + const url = sponsor.linkFor(interaction.user.id, interaction.guild.id); + if (!url) { + console.error(`[Sponsor] cannot build a link: ${sponsor.settings().missing.join(', ') || 'unknown reason'}`); + return interaction.reply({ content: t('sponsor.verify.unavailable'), flags: MessageFlags.Ephemeral }); + } + + const row = new ActionRowBuilder().addComponents(new ButtonBuilder() + .setStyle(ButtonStyle.Link) + .setURL(url) + .setLabel(t('sponsor.verify.linkButton'))); + + await interaction.reply({ + content: t('sponsor.verify.text', { minutes: Math.round(sponsor.LINK_TTL_SECONDS / 60) }), + components: [row], + flags: MessageFlags.Ephemeral, + }); +} + async function toggleRole(interaction, roleId) { const { member, guild } = interaction; const role = guild.roles.cache.get(String(roleId)); diff --git a/bots/commands/commands/sponsor.js b/bots/commands/commands/sponsor.js new file mode 100644 index 0000000..dd4e7cd --- /dev/null +++ b/bots/commands/commands/sponsor.js @@ -0,0 +1,96 @@ +const { + SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, MessageFlags, +} = require('discord.js'); +const { makeEmbed } = require('../../../core/utils'); +const { applyMeta, optionText, guard } = require('../../../core/commandKit'); +const { t } = require('../../../core/i18n'); +const config = require('../../../core/config'); +const sponsor = require('../../../core/sponsor'); + +/** + * /sponsor post posts the GitHub Sponsors panel into the current channel. + * /sponsor sync runs the daily role sync now. + * + * ONE COMMAND WITH TWO SUBCOMMANDS rather than two commands: both belong to the + * same feature and the same people, so one entry in the command table and one + * role gate cover both. The panel's button is `sponsor_verify` and is answered + * in bots/commands/bot.js, like every other persistent button. + */ + +function panel(interaction) { + const s = sponsor.settings(); + const embed = makeEmbed({ + title: t('sponsor.panel.title'), + description: t('sponsor.panel.description', { + brand: config.brandName() || interaction.guild.name, + minutes: Math.round(sponsor.LINK_TTL_SECONDS / 60), + }), + guildName: interaction.guild.name, + }); + + const row = new ActionRowBuilder(); + // Left out without a URL: a link button needs one, and a panel that refuses + // to post over an optional button is worse than a panel without it. + if (s.sponsorsUrl) { + row.addComponents(new ButtonBuilder() + .setStyle(ButtonStyle.Link) + .setURL(s.sponsorsUrl) + .setLabel(t('sponsor.panel.sponsorButton'))); + } + row.addComponents(new ButtonBuilder() + .setCustomId(sponsor.VERIFY_BUTTON_ID) + .setStyle(ButtonStyle.Success) + .setLabel(t('sponsor.panel.verifyButton'))); + + return { embeds: [embed], components: [row] }; +} + +async function post(interaction) { + const s = sponsor.settings(); + if (!s.ready) { + console.warn(`[Sponsor] /sponsor post refused, not configured: ${s.missing.join(', ')}`); + return interaction.reply({ content: t('sponsor.notConfigured'), flags: MessageFlags.Ephemeral }); + } + await interaction.channel.send(panel(interaction)); + await interaction.reply({ content: t('sponsor.posted'), flags: MessageFlags.Ephemeral }); +} + +async function sync(interaction) { + const s = sponsor.settings(); + if (!s.ready) { + console.warn(`[Sponsor] /sponsor sync refused, not configured: ${s.missing.join(', ')}`); + return interaction.reply({ content: t('sponsor.notConfigured'), flags: MessageFlags.Ephemeral }); + } + + await interaction.deferReply({ flags: MessageFlags.Ephemeral }); + console.log(`[Sponsor] manual sync requested by ${interaction.user.id}.`); + // force bypasses the removal brake for this one run only. The daily run + // never sets it: a mass removal always needs a human to look first. + const force = interaction.options.getBoolean('force') === true; + const result = await sponsor.runSync(interaction.client, { force }); + + let content; + if (result.ok) { + content = t('sponsor.sync.done', { added: result.added, removed: result.removed, failed: result.failed, listed: result.listed }); + if (result.braked) content += '\n' + t('sponsor.sync.braked', { count: result.heldBack }); + } + else if (result.reason === 'busy') content = t('sponsor.sync.busy'); + else content = t('sponsor.sync.failed'); + await interaction.editReply({ content }); +} + +module.exports = { + key: 'sponsor', + feature: 'sponsor', + data: applyMeta(new SlashCommandBuilder(), 'sponsor') + .addSubcommand(sub => sub.setName('post').setDescription(optionText('sponsor', 'post'))) + .addSubcommand(sub => sub.setName('sync').setDescription(optionText('sponsor', 'sync')) + .addBooleanOption(o => o.setName('force').setDescription(optionText('sponsor', 'force')).setRequired(false))), + + async execute(interaction) { + if (!await guard(interaction, 'sponsor')) return; + const sub = interaction.options.getSubcommand(false); + if (sub === 'sync') return sync(interaction); + return post(interaction); + }, +}; diff --git a/config/config.example.jsonc b/config/config.example.jsonc index 58aeb8d..36aea04 100644 --- a/config/config.example.jsonc +++ b/config/config.example.jsonc @@ -93,7 +93,8 @@ "manager": "", "developer": "", "team": "", - "giveawayNotify": "" + "giveawayNotify": "", + "sponsor": "" // kept in line with the shop's sponsor list, see features.sponsor }, // ─── Channels ────────────────────────────────────────────────────────────── @@ -429,6 +430,25 @@ "deleteLocalFile": true }, + // ── GitHub Sponsors role (/sponsor) ───────────────────────────────────── + // + // A shop links a member's GitHub account, checks the sponsorship and hands + // out the role. The bot posts the panel (/sponsor post), gives each member + // a signed, 15-minute link into the shop (the panel's button) and once a + // day adds and removes the role to match the shop's list (/sponsor sync + // runs it by hand). + // + // Needs SPONSOR_LINK_SECRET and SPONSOR_SYNC_SECRET in .env, each at least + // 32 characters and identical to the shop's. Without them the sync stays + // off. If the shop's list cannot be fetched or read, no role is changed. + "sponsor": { + "enabled": false, + "role": "sponsor", // a key from "roles" above, or a raw role id + "shopBaseUrl": "", // e.g. https://shop.example.com, https only + "sponsorsUrl": "", // e.g. https://github.com/sponsors/, the panel's link button + "syncHour": 4 // 0-23, the server's local time + }, + // ── Message context menus ─────────────────────────────────────────────── // // Right-click a message → Apps. `name` is what Discord shows; renaming one @@ -467,6 +487,7 @@ "backup_database": { "enabled": true, "name": "backup_database", "description": "", "roles": ["founder"] }, "send_message": { "enabled": true, "name": "send_message", "description": "", "roles": ["founder", "manager"] }, "send_embed": { "enabled": true, "name": "send_embed", "description": "", "roles": ["founder", "manager"] }, + "sponsor": { "enabled": true, "name": "sponsor", "description": "", "roles": ["founder", "manager"] }, "random": { "enabled": true, "name": "random", "description": "", "roles": ["team"] }, "rg": { "enabled": true, "name": "rg", "description": "", "roles": [] }, diff --git a/core/config.js b/core/config.js index a73ec94..a30a2b1 100644 --- a/core/config.js +++ b/core/config.js @@ -100,6 +100,15 @@ const database = { NAME: _env('DB_NAME', 'es_extended'), }; +/** + * The two secrets shared with the shop for the GitHub Sponsors role. Read on + * every call rather than once, so the harness can take one away. + */ +const sponsorSecrets = () => ({ + link: _env('SPONSOR_LINK_SECRET'), + sync: _env('SPONSOR_SYNC_SECRET'), +}); + // ─── ids ───────────────────────────────────────────────────────────────────── const SNOWFLAKE = /^\d{17,20}$/; @@ -279,6 +288,19 @@ function report() { if (featureEnabled('backupDatabase') && !database.USER) missing.push('DB_USER (.env)'); + // Without these the sync stays off and the verify button answers with an + // apology. Checked here too so it shows up in the one list read at boot. + if (featureEnabled('sponsor')) { + if (!roleId(get('features.sponsor.role', ''))) missing.push('features.sponsor.role'); + // https only, plain http just for a shop on this machine: the sync sends a + // bearer secret there. core/sponsor.js applies the same rule. + const shop = String(get('features.sponsor.shopBaseUrl', '') ?? '').trim(); + if (!/^(https:\/\/|http:\/\/(localhost|127\.0\.0\.1|\[::1\])([:/]|$))/i.test(shop)) missing.push('features.sponsor.shopBaseUrl'); + const secrets = sponsorSecrets(); + if (secrets.link.length < 32) missing.push('SPONSOR_LINK_SECRET (.env, at least 32 characters)'); + if (secrets.sync.length < 32) missing.push('SPONSOR_SYNC_SECRET (.env, at least 32 characters)'); + } + // A bonus role that does not resolve matches nobody, so the multiplier is // simply never applied and the player sees the ordinary payout. There is // nothing to notice, which is why it has to be said out loud. Shipped empty, @@ -324,7 +346,7 @@ module.exports = { get, raw: () => merged, reload, load, hasUserConfig, - tokens, database, + tokens, database, sponsorSecrets, guildId, roleId, roleIds, channelId, brandName, thumbnailUrl, embedColor, brandLinks, parseColor, command, commandKeys, contextMenu, diff --git a/core/sponsor.js b/core/sponsor.js new file mode 100644 index 0000000..d5c7ddb --- /dev/null +++ b/core/sponsor.js @@ -0,0 +1,342 @@ +/** + * GitHub Sponsors -> a Discord role. + * + * THE SHOP DECIDES, THE BOT FOLLOWS. Linking a GitHub account, checking the + * sponsorship and the first role grant all happen in the shop. The bot only + * does three things: hand a member a signed link into the shop, post the panel + * that offers that link, and once a day bring the role in line with the shop's + * list of current sponsors. + * + * THE TOKEN AND THE LIST ARE A CONTRACT WITH THE SHOP. Both sides implement the + * same format independently, so the field names, their ORDER in the JSON and + * the "sponsor-link." prefix of the signed data are not details to tidy up. + * The harness pins the token against a fixed vector computed outside this code. + * + * A LIST THAT DID NOT ARRIVE CHANGES NOTHING. Any non-200, an `ok` that is not + * true, a timeout or a body that does not look exactly like the contract aborts + * the whole sync, adds included. The alternative reading of "no list" is "no + * sponsors", and that strips the role from every paying member because the shop + * had a bad minute. + */ + +const { createHmac, randomBytes } = require('crypto'); +const config = require('./config'); +const { t } = require('./i18n'); + +/** How long a link is valid, in seconds. The shop checks `exp` against its own clock. */ +const LINK_TTL_SECONDS = 900; + +/** Shorter secrets are refused: they are an HMAC key and a bearer token. */ +const MIN_SECRET_LENGTH = 32; + +const FETCH_TIMEOUT_MS = 15_000; +const FIRST_RUN_DELAY_MS = 60_000; + +const SNOWFLAKE = /^\d{17,20}$/; + +/** The custom id of the panel's button. Posted panels keep it for ever: never rename it. */ +const VERIFY_BUTTON_ID = 'sponsor_verify'; + +// ─── the link token ────────────────────────────────────────────────────────── + +/** + * The signed token for one member's link into the shop. + * + * payload = {"v":1,"d":,"g":,"exp":,"n":} + * token = base64url(payload) "." base64url(HMAC-SHA256(secret, "sponsor-link." + b64)) + * + * `now` and `nonce` are parameters so the harness can pin the output. + */ +function buildLinkToken({ secret, discordId, guildId, now = Date.now(), nonce = randomBytes(16).toString('hex') }) { + if (!secret) throw new Error('buildLinkToken: no secret'); + const payload = { + v: 1, + d: String(discordId), + g: String(guildId), + exp: Math.floor(now / 1000) + LINK_TTL_SECONDS, + n: String(nonce), + }; + const b64 = Buffer.from(JSON.stringify(payload), 'utf8').toString('base64url'); + const sig = createHmac('sha256', secret).update(`sponsor-link.${b64}`).digest('base64url'); + return `${b64}.${sig}`; +} + +/** The shop's base URL without a trailing slash, or '' when it is unusable. */ +function normalizeBaseUrl(raw) { + const value = String(raw ?? '').trim().replace(/\/+$/, ''); + if (!value) return ''; + let url; + try { url = new URL(value); } catch { return ''; } + // The sync sends a bearer secret to this address. Plain http is accepted for + // a shop on the same machine and nowhere else. + const local = ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname); + if (url.protocol !== 'https:' && !(url.protocol === 'http:' && local)) return ''; + return value; +} + +function startUrl(baseUrl, token) { + return `${baseUrl}/api/sponsor/start?t=${encodeURIComponent(token)}`; +} + +// ─── settings ──────────────────────────────────────────────────────────────── + +/** + * Everything the feature needs, and what is missing. + * + * The secrets are read at call time rather than at require time, so the harness + * can take one away and watch the feature turn itself off. + */ +function settings() { + const cfg = config.get('features.sponsor', {}) ?? {}; + const secrets = config.sponsorSecrets(); + const hour = Number(cfg.syncHour); + + const s = { + enabled: cfg.enabled === true, + roleId: config.roleId(cfg.role ?? ''), + baseUrl: normalizeBaseUrl(cfg.shopBaseUrl), + sponsorsUrl: /^https:\/\//i.test(String(cfg.sponsorsUrl ?? '').trim()) ? String(cfg.sponsorsUrl).trim() : '', + syncHour: Number.isInteger(hour) && hour >= 0 && hour <= 23 ? hour : 4, + linkSecret: secrets.link, + syncSecret: secrets.sync, + }; + + const missing = []; + if (!s.roleId) missing.push('features.sponsor.role'); + if (!s.baseUrl) missing.push('features.sponsor.shopBaseUrl'); + if (s.linkSecret.length < MIN_SECRET_LENGTH) missing.push(`SPONSOR_LINK_SECRET (.env, at least ${MIN_SECRET_LENGTH} characters)`); + if (s.syncSecret.length < MIN_SECRET_LENGTH) missing.push(`SPONSOR_SYNC_SECRET (.env, at least ${MIN_SECRET_LENGTH} characters)`); + s.missing = missing; + s.ready = s.enabled && missing.length === 0; + return s; +} + +/** The personal link for a member, or null when the feature cannot sign one. */ +function linkFor(discordId, guildId) { + const s = settings(); + if (!s.enabled || !s.baseUrl || s.linkSecret.length < MIN_SECRET_LENGTH) return null; + return startUrl(s.baseUrl, buildLinkToken({ secret: s.linkSecret, discordId, guildId })); +} + +// ─── the members list ──────────────────────────────────────────────────────── + +/** + * Fetch the shop's list of current sponsors. + * + * @returns {Promise<{ok: true, ids: Set, count: number} | {ok: false, reason: string}>} + */ +async function fetchMembers({ baseUrl, secret, fetchImpl = globalThis.fetch, timeoutMs = FETCH_TIMEOUT_MS }) { + let res; + try { + res = await fetchImpl(`${baseUrl}/api/sponsor/members`, { + method: 'GET', + headers: { Authorization: `Bearer ${secret}`, Accept: 'application/json' }, + signal: AbortSignal.timeout(timeoutMs), + }); + } catch (err) { + return { ok: false, reason: `request failed: ${err?.name === 'TimeoutError' ? `timeout after ${timeoutMs} ms` : err?.message ?? err}` }; + } + + if (res.status !== 200) return { ok: false, reason: `HTTP ${res.status}` }; + + let body; + try { body = await res.json(); } catch { return { ok: false, reason: 'the body is not JSON' }; } + + if (!body || typeof body !== 'object' || body.ok !== true) return { ok: false, reason: '"ok" is not true' }; + if (!Array.isArray(body.members)) return { ok: false, reason: '"members" is not a list' }; + + // One malformed row makes the whole list suspect. A list that cannot be read + // is treated like a list that did not arrive. + const ids = new Set(); + for (const [n, m] of body.members.entries()) { + const id = String(m?.discordId ?? '').trim(); + if (!SNOWFLAKE.test(id)) return { ok: false, reason: `members[${n}].discordId is not a Discord id` }; + ids.add(id); + } + return { ok: true, ids, count: body.members.length }; +} + +// ─── the diff ──────────────────────────────────────────────────────────────── + +/** + * Who gets the role and who loses it. Pure, so the harness can pin it. + * + * @param {Iterable<{id: string, bot: boolean, hasRole: boolean}>} members everyone in the guild + * @param {Iterable} listedIds the shop's current sponsors + * @returns {{toAdd: string[], toRemove: string[], notInGuild: number}} + */ +function diffSponsorRoles(members, listedIds) { + const listed = new Set(listedIds); + const toAdd = []; + const toRemove = []; + const present = new Set(); + + for (const m of members) { + present.add(m.id); + // A bot is never a sponsor and never loses a role it was given by hand. + if (m.bot) continue; + if (listed.has(m.id) && !m.hasRole) toAdd.push(m.id); + else if (!listed.has(m.id) && m.hasRole) toRemove.push(m.id); + } + + let notInGuild = 0; + for (const id of listed) if (!present.has(id)) notInGuild++; + return { toAdd, toRemove, notInGuild }; +} + +/** + * Would this sync take the role from so many holders that it is more likely a + * fault in the shop than a wave of cancellations? More than half of the + * current holders AND at least BRAKE_MIN_REMOVALS members. The floor keeps a + * small server, where one cancellation is already half, from being stuck. + */ +const BRAKE_MIN_REMOVALS = 3; + +function removalBrake(holderCount, removalCount) { + return removalCount >= BRAKE_MIN_REMOVALS && removalCount > holderCount / 2; +} + +// ─── the sync ──────────────────────────────────────────────────────────────── + +let running = false; + +/** + * Bring the role in line with the shop's list. + * + * `force` bypasses the removal brake for this one run. Only `/sponsor sync + * force:true` sets it; the daily run never does. + * + * @returns {Promise<{ok: boolean, reason?: string, added?: number, removed?: number, failed?: number, + * listed?: number, notInGuild?: number, braked?: boolean, heldBack?: number}>} + */ +async function runSync(client, { fetchImpl, force = false } = {}) { + if (running) return { ok: false, reason: 'busy' }; + running = true; + try { + const s = settings(); + if (!s.ready) { + return { ok: false, reason: s.enabled ? `not configured: ${s.missing.join(', ')}` : 'switched off' }; + } + + const list = await fetchMembers({ baseUrl: s.baseUrl, secret: s.syncSecret, fetchImpl }); + if (!list.ok) { + console.error(`[Sponsor] sync aborted, no roles changed: the members list could not be used (${list.reason}).`); + return { ok: false, reason: list.reason }; + } + + const guildId = config.guildId(); + const guild = client.guilds.cache.get(guildId) ?? await client.guilds.fetch(guildId).catch(() => null); + if (!guild) { + console.error('[Sponsor] sync aborted: the configured guild is not available to this bot.'); + return { ok: false, reason: 'guild not found' }; + } + + const role = guild.roles.cache.get(s.roleId) ?? await guild.roles.fetch(s.roleId).catch(() => null); + if (!role) { + console.error('[Sponsor] sync aborted: the sponsor role does not exist in the guild.'); + return { ok: false, reason: 'role not found' }; + } + if (role.editable === false) { + console.error('[Sponsor] sync aborted: the sponsor role sits above the bot\'s highest role, so the bot cannot assign it.'); + return { ok: false, reason: 'role not editable' }; + } + + const all = await guild.members.fetch(); + const byId = new Map(); + const view = []; + for (const member of all.values()) { + byId.set(member.id, member); + view.push({ id: member.id, bot: member.user?.bot === true, hasRole: member.roles.cache.has(s.roleId) }); + } + + const { toAdd, toRemove: wanted, notInGuild } = diffSponsorRoles(view, list.ids); + let added = 0, removed = 0, failed = 0; + + // The list arrived and parsed, and still says most sponsors are gone. That + // is more likely the shop than the sponsors, so the removals wait for a + // human; the additions are safe either way and still go ahead. + const holders = view.filter(m => !m.bot && m.hasRole).length; + const braked = !force && removalBrake(holders, wanted.length); + const toRemove = braked ? [] : wanted; + if (braked) { + console.warn(`[Sponsor] removal brake: the list would take the role from ${wanted.length} of ${holders} holders. ` + + 'No role removed this run; check the shop, then run /sponsor sync force:true if it is right.'); + } else if (force && removalBrake(holders, wanted.length)) { + console.warn(`[Sponsor] removal brake bypassed by force: removing the role from ${wanted.length} of ${holders} holders.`); + } + + for (const id of toAdd) { + try { await byId.get(id).roles.add(role, t('sponsor.audit.added')); added++; } + catch (err) { failed++; console.error(`[Sponsor] could not add the role to ${id}: ${err?.message ?? err}`); } + } + for (const id of toRemove) { + try { await byId.get(id).roles.remove(role, t('sponsor.audit.removed')); removed++; } + catch (err) { failed++; console.error(`[Sponsor] could not remove the role from ${id}: ${err?.message ?? err}`); } + } + + const heldBack = braked ? wanted.length : 0; + const summary = { ok: true, added, removed, failed, listed: list.ids.size, notInGuild, braked, heldBack }; + console.log(`[Sponsor] sync done: ${added} added, ${removed} removed, ${failed} failed` + + (braked ? `, ${heldBack} removals held back by the brake` : '') + + ` (${list.ids.size} listed, ${notInGuild} not in the guild).`); + return summary; + } catch (err) { + console.error(`[Sponsor] sync failed: ${err?.message ?? err}`); + return { ok: false, reason: String(err?.message ?? err) }; + } finally { + running = false; + } +} + +// ─── the schedule ──────────────────────────────────────────────────────────── + +/** Milliseconds from `now` until the next `hour`:00 in the machine's local time. */ +function msUntilHour(now, hour) { + const next = new Date(now); + next.setHours(hour, 0, 0, 0); + if (next.getTime() <= now.getTime()) next.setDate(next.getDate() + 1); + return next.getTime() - now.getTime(); +} + +const timers = { first: null, daily: null }; + +/** + * Called on ClientReady of the commands bot: once a minute after the start, + * then every day at `syncHour`. A setTimeout chain rather than a cron + * dependency; recomputing the delay each day keeps it on the hour across DST. + */ +function startSponsorSync(client) { + const s = settings(); + if (!s.enabled) return false; + if (!s.ready) { + console.warn(`[Sponsor] switched on but not configured, the sync stays off. Missing: ${s.missing.join(', ')}`); + return false; + } + + stopSponsorSync(); + const run = () => runSync(client).catch(() => {}); + const scheduleDaily = () => { + timers.daily = setTimeout(() => { run(); scheduleDaily(); }, msUntilHour(new Date(), settings().syncHour)); + timers.daily.unref?.(); + }; + + timers.first = setTimeout(run, FIRST_RUN_DELAY_MS); + timers.first.unref?.(); + scheduleDaily(); + + console.log(`[Sponsor] sync scheduled: first run in ${FIRST_RUN_DELAY_MS / 1000} s, then daily at ${String(s.syncHour).padStart(2, '0')}:00.`); + return true; +} + +function stopSponsorSync() { + clearTimeout(timers.first); + clearTimeout(timers.daily); + timers.first = timers.daily = null; +} + +module.exports = { + LINK_TTL_SECONDS, MIN_SECRET_LENGTH, VERIFY_BUTTON_ID, + buildLinkToken, normalizeBaseUrl, startUrl, linkFor, + settings, fetchMembers, diffSponsorRoles, removalBrake, BRAKE_MIN_REMOVALS, runSync, msUntilHour, + startSponsorSync, stopSponsorSync, +}; diff --git a/graphify-out/GRAPH_REPORT.md b/graphify-out/GRAPH_REPORT.md index b1e3505..db55bfc 100644 --- a/graphify-out/GRAPH_REPORT.md +++ b/graphify-out/GRAPH_REPORT.md @@ -1,361 +1,358 @@ -# Graph Report - discord_multibot (2026-09-02) - -## Corpus Check -- 102 files · ~102,384 words -- Verdict: corpus is large enough that graph structure adds value. - -## Summary -- 1043 nodes · 1964 edges · 86 communities (70 shown, 16 thin omitted) -- Extraction: 90% EXTRACTED · 10% INFERRED · 0% AMBIGUOUS · INFERRED: 201 edges (avg confidence: 0.85) -- Token cost: 0 input · 0 output - -## Graph Freshness -- Built from commit: `19eabbba` -- Run `git rev-parse HEAD` and compare to check if the graph is stale. -- Run `graphify update .` after code changes (no API cost). - -## Community Hubs (Navigation) -- hangman.js -- connect4.js -- logging.js -- pointsManager.js -- index.js -- harness.js -- configFile.js -- blackjack.js -- package.json -- commands/bot.js -- Discord Multi-Bot README (DE) -- core/config.js -- community.js -- trivia.js -- minigames/bot.js -- Auto Release Workflow -- support.js -- CI Workflow -- schema.js -- migrate-config.js -- server.js -- test/dashboard.js -- contextMenus.js -- tictactoe.js -- BotSupervisor -- security.js -- inputs.jsx -- dashboard/settings.js -- dashboard/discord.js -- ui.jsx -- minigames.js -- i18n.jsx -- routes.js -- dependencies -- App.jsx -- wordle.js -- admin.js -- Settings.jsx -- t -- devDependencies -- dashboard/config.js -- utility.js -- core/utils.js -- web/package.json -- BotControl.jsx -- useI18n -- commandKit.js -- api.js -- alert.jsx -- badge.jsx -- button.jsx -- i18n.js -- @fontsource/syne -- @radix-ui/react-dialog -- @radix-ui/react-dropdown-menu -- @radix-ui/react-label -- @radix-ui/react-scroll-area -- @radix-ui/react-select -- @radix-ui/react-separator -- @radix-ui/react-switch -- @radix-ui/react-tabs -- react -- react-dom -- envFile.js -- @fontsource/dm-sans -- getPath -- messageComposer.js -- Announce.jsx - -## God Nodes (most connected - your core abstractions) -1. `t()` - 80 edges -2. `useI18n()` - 25 edges -3. `gameColor()` - 24 edges -4. `embed()` - 23 edges -5. `applyMeta()` - 21 edges -6. `gameFooter()` - 21 edges -7. `pointsFor()` - 21 edges -8. `notifyRewards()` - 21 edges -9. `addPoints()` - 20 edges -10. `f()` - 19 edges - -## Surprising Connections (you probably didn't know these) -- `Discord Multi-Bot` --references--> `MSK Scripts Logo` [INFERRED] - README.md → assets/msk_logo.png -- `handleInteraction()` --calls--> `t()` [EXTRACTED] - bots/events/handlers/contextMenus.js → core/i18n.js -- `attach()` --calls--> `t()` [EXTRACTED] - bots/commands/bot.js → core/i18n.js -- `handleVerification()` --calls--> `t()` [EXTRACTED] - bots/commands/bot.js → core/i18n.js -- `toggleRole()` --calls--> `t()` [EXTRACTED] - bots/commands/bot.js → core/i18n.js - -## Import Cycles -- None detected. - -## Hyperedges (group relationships) -- **Tag-Driven Release Automation Pipeline** — _github_workflows_release_auto_release_workflow, _github_workflows_release_tag_resolution, _github_workflows_release_release_body_generation, _github_workflows_release_concurrency_guard [EXTRACTED 1.00] -- **Project Governance and Compliance Documents** — code_of_conduct_contributor_covenant, license_agpl_v3, security_vulnerability_reporting_policy, _github_dependabot_dependabot_config [INFERRED 0.85] - -## Communities (86 total, 16 thin omitted) - -### Community 0 - "hangman.js" -Cohesion: 0.10 -Nodes (27): { addPoints, pointsFor, notifyRewards }, { applyMeta }, execute(), { gameFooter }, { makeEmbed }, { SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder }, { t }, { addPoints, pointsFor, notifyRewards } (+19 more) - -### Community 1 - "connect4.js" -Cohesion: 0.21 -Nodes (16): { addPoints, pointsFor, notifyRewards }, { applyMeta }, botMove(), buildComponents(), buildEmbed(), checkWin(), COL_NUMS, drop() (+8 more) - -### Community 2 - "logging.js" -Cohesion: 0.21 -Nodes (35): actorText(), CHANNEL_TYPE_KEYS, channelTypeName(), color(), config, { dateStr }, embed(), { EmbedBuilder, AuditLogEvent, ChannelType } (+27 more) - -### Community 3 - "pointsManager.js" -Cohesion: 0.10 -Nodes (23): { applyMeta }, config, { gameColor }, { getPoints, rewards, multiplierFor }, { SlashCommandBuilder, EmbedBuilder }, { t }, config, FALLBACK (+15 more) - -### Community 4 - "index.js" -Cohesion: 0.09 -Nodes (29): DATA_DIR, addBalance(), connect(), deleteAccessRow(), deleteTemplate(), DRIVERS, getAccessRows(), getBalance() (+21 more) - -### Community 5 - "harness.js" -Cohesion: 0.07 -Nodes (17): assert, client, commands, config, { EventEmitter }, { execSync }, failures, FIXTURE (+9 more) - -### Community 6 - "configFile.js" -Cohesion: 0.18 -Nodes (18): applyConfigPatch(), applyTextsPatch(), config, deletePath(), fs, i18n, isPlain(), { parseJsonc, deepMerge, getPath } (+10 more) - -### Community 7 - "blackjack.js" -Cohesion: 0.17 -Nodes (17): { addPoints, pointsFor, notifyRewards }, { applyMeta }, buildButtons(), execute(), { gameFooter, gameColor }, handStr(), handValue(), isBlackjack() (+9 more) - -### Community 8 - "package.json" -Cohesion: 0.07 -Nodes (28): better-sqlite3, dotenv, express, helmet, mysql2, dependencies, better-sqlite3, discord.js (+20 more) - -### Community 9 - "commands/bot.js" -Cohesion: 0.16 -Nodes (16): attach(), buttonIdFromCustomId(), { - Collection, GatewayIntentBits, Events, - ButtonStyle, ButtonBuilder, ActionRowBuilder, MessageFlags, -}, config, { enabled }, findRoleButton(), handlePersistentButton(), handleVerification() (+8 more) - -### Community 10 - "Discord Multi-Bot README (DE)" -Cohesion: 0.18 -Nodes (11): Dependabot npm Update Config, Grouped Weekly Dependency Updates, MSK Scripts Logo, Contributor Covenant Code of Conduct v2.0, Community Impact Enforcement Ladder, GNU Affero General Public License v3, Network-Use Copyleft (AGPL Section 13), Discord Multi-Bot README (DE) (+3 more) - -### Community 11 - "core/config.js" -Cohesion: 0.10 -Nodes (33): ASSETS_DIR, BASE_DIR, brandLinks(), brandName(), channelId(), command(), commandKeys(), CONFIG_DIR (+25 more) - -### Community 12 - "community.js" -Cohesion: 0.24 -Nodes (15): { applyMeta, guard }, config, execute(), informationEmbed(), { makeEmbed, linkRow, buttonStyle }, postPanel(), roleMenuButtons(), roleMenuComponents() (+7 more) - -### Community 13 - "trivia.js" -Cohesion: 0.20 -Nodes (10): { addPoints, pointsFor, notifyRewards }, { applyMeta }, b64(), config, cooldowns, fetchQuestion(), { gameFooter, gameColor }, LABELS (+2 more) - -### Community 14 - "minigames/bot.js" -Cohesion: 0.09 -Nodes (25): attach(), config, { GatewayIntentBits, Partials, Events }, intents, memberCountInterval(), partials, { presenceOptions }, scheduleMemberCountUpdate() (+17 more) - -### Community 15 - "Auto Release Workflow" -Cohesion: 0.67 -Nodes (4): Auto Release Workflow, Release Concurrency Guard, Release Body Generation from Git History, Tag Resolution and Optional Tag Creation - -### Community 16 - "support.js" -Cohesion: 0.27 -Nodes (9): { applyMeta, optionText, guard }, buildData(), config, execute(), guides(), { makeEmbed, linkRow }, { SlashCommandBuilder, MessageFlags }, { t } (+1 more) - -### Community 18 - "schema.js" -Cohesion: 0.23 -Nodes (6): { SCHEMA, templateValues }, { SCHEMA, templateValues }, { SCHEMA, templateValues }, SCHEMA, TEMPLATE_COLUMNS, templateValues() - -### Community 19 - "migrate-config.js" -Cohesion: 0.21 -Nodes (11): BASE_DIR, buildConfig(), CONFIG_PATH, dryRun, env(), { existsSync, readFileSync, writeFileSync, copyFileSync }, force, { join } (+3 more) - -### Community 21 - "server.js" -Cohesion: 0.10 -Nodes (29): buildAuthorizeUrl(), exchangeCode(), fetchOAuthUser(), { redirectUri }, redirectUri(), canUseDashboard(), hasPermission(), { buildAuthorizeUrl, exchangeCode, fetchOAuthUser } (+21 more) - -### Community 22 - "test/dashboard.js" -Cohesion: 0.06 -Nodes (20): assert, CONFIG_PATH, crypto, db, discord, failures, fs, { loadDashboardConfig } (+12 more) - -### Community 23 - "contextMenus.js" -Cohesion: 0.17 -Nodes (17): answerMessage(), cloneEmbed(), commentFeedback(), config, { - ContextMenuCommandBuilder, ApplicationCommandType, EmbedBuilder, ModalBuilder, - TextInputBuilder, TextInputStyle, ActionRowBuilder, MessageFlags, -}, editEmbed(), editMessage(), { guardMenu } (+9 more) - -### Community 24 - "tictactoe.js" -Cohesion: 0.22 -Nodes (17): { addPoints, pointsFor, notifyRewards }, aiEasy(), aiHard(), aiMedium(), { applyMeta }, available(), buildBoard(), CELL_EMOJIS (+9 more) - -### Community 25 - "BotSupervisor" -Cohesion: 0.17 -Nodes (8): BOT_ENTRY, BotSupervisor, config, ENV_PATH, EventEmitter, { fork, spawn }, fs, path - -### Community 26 - "security.js" -Cohesion: 0.15 -Nodes (14): b64url(), buckets, createOAuthState(), createSession(), createToken(), crypto, getSecret(), safeEqual() (+6 more) - -### Community 27 - "inputs.jsx" -Cohesion: 0.15 -Nodes (15): ACTIVITY_TYPES, BUTTON_STYLES, ColorInput(), CommandTable(), ContextMenus(), IdListPicker(), IdPicker(), ItemCard() (+7 more) - -### Community 28 - "dashboard/settings.js" -Cohesion: 0.20 -Nodes (17): clearFavicon(), config, DATA_DIR, detectFaviconType(), ensureDataDir(), FAVICON_BASE, FAVICON_TYPES, fs (+9 more) - -### Community 29 - "dashboard/discord.js" -Cohesion: 0.22 -Nodes (16): avatarUrl(), botToken(), cacheUser(), config, DiscordApiError, getGuild(), getGuildChannels(), getGuildLookups() (+8 more) - -### Community 30 - "ui.jsx" -Cohesion: 0.19 -Nodes (14): api, getLocale(), Banner(), BANNER_VARIANT, Empty(), FeatureState(), fmtDate(), SectionTitle() (+6 more) - -### Community 31 - "minigames.js" -Cohesion: 0.16 -Nodes (15): { applyMeta, optionText, guard }, config, execute(), { join }, JOKES_FILE, { makeEmbed, readJson, writeJson }, newRound(), { randomInt } (+7 more) - -### Community 32 - "i18n.jsx" -Cohesion: 0.28 -Nodes (11): BUNDLES, interpolate(), lookup(), resolve(), detectLanguage(), I18nContext, I18nProvider(), LANGUAGES (+3 more) - -### Community 33 - "routes.js" -Cohesion: 0.10 -Nodes (27): ENV_PATH, checkSelfEdit(), isPermission(), isSubjectType(), parsePermissions(), PERMISSION_LABELS, PERMISSIONS, resolvePermissions() (+19 more) - -### Community 34 - "dependencies" -Cohesion: 0.13 -Nodes (15): class-variance-authority, clsx, @fontsource/space-mono, lucide-react, @radix-ui/react-slot, @radix-ui/react-tooltip, tailwind-merge, dependencies (+7 more) - -### Community 35 - "App.jsx" -Cohesion: 0.29 -Nodes (10): allowed(), App(), NAV, NavContent(), DETAIL_VIEWS, parseRoute(), SEGMENT_TO_VIEW, useRouter() (+2 more) - -### Community 36 - "wordle.js" -Cohesion: 0.15 -Nodes (14): { applyMeta, optionText }, CATEGORIES, { gameColor }, { SlashCommandBuilder, EmbedBuilder, MessageFlags }, { t, tList }, { addPoints, pointsFor, notifyRewards }, { applyMeta }, evaluate() (+6 more) - -### Community 37 - "admin.js" -Cohesion: 0.18 -Nodes (12): { applyMeta, guard }, { buildMessage }, config, { execFile }, execute(), { join }, { mkdirSync, writeFileSync, unlinkSync }, { nowStr } (+4 more) - -### Community 38 - "Settings.jsx" -Cohesion: 0.35 -Nodes (8): ACCENT_VARS, applyAccent(), applyDashboardSettings(), applyFavicon(), hexToRgb(), loadAndApplyDashboardSettings(), readableForeground(), Settings() - -### Community 39 - "t" -Cohesion: 0.17 -Nodes (23): buildEmbed(), execute(), execute(), buildEmbed(), execute(), { addPoints, pointsFor, notifyRewards }, { applyMeta }, buildEmbed() (+15 more) - -### Community 40 - "devDependencies" -Cohesion: 0.18 -Nodes (11): tailwindcss, @tailwindcss/vite, tw-animate-css, vite, @vitejs/plugin-react, devDependencies, tailwindcss, @tailwindcss/vite (+3 more) - -### Community 43 - "dashboard/config.js" -Cohesion: 0.20 -Nodes (14): config, crypto, ensureSessionSecret(), fs, isLoopback(), loadDashboardConfig(), path, { setEnvValue } (+6 more) - -### Community 44 - "utility.js" -Cohesion: 0.24 -Nodes (9): { applyMeta, optionText, guard }, config, execute(), { getPoints }, { makeEmbed, dateTimeStr }, { SlashCommandBuilder, MessageFlags }, { t }, getPoints() (+1 more) - -### Community 45 - "core/utils.js" -Cohesion: 0.20 -Nodes (10): guard(), ACTIVITY_TYPES, allowedByRoles(), BUTTON_STYLES, config, { dirname }, { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, ActivityType }, hasAnyRole() (+2 more) - -### Community 46 - "web/package.json" -Cohesion: 0.20 -Nodes (9): description, name, private, scripts, build, dev, preview, type (+1 more) - -### Community 47 - "BotControl.jsx" -Cohesion: 0.31 -Nodes (6): COLORS, parseAnsi(), fmtDuration(), BotControl(), DOT, LogLine() - -### Community 49 - "useI18n" -Cohesion: 0.24 -Nodes (10): Brand(), LanguagePicker(), Field(), useI18n(), Config(), FeatureDetail(), getPath(), ICONS (+2 more) - -### Community 52 - "commandKit.js" -Cohesion: 0.18 -Nodes (12): { applyMeta, optionText }, { gameColor }, SIDES, { SlashCommandBuilder, EmbedBuilder }, { t }, { allowedByRoles }, applyMeta(), config (+4 more) - -### Community 54 - "api.js" -Cohesion: 0.53 -Nodes (4): ApiError, logout(), readCookie(), request() - -### Community 61 - "i18n.js" -Cohesion: 0.15 -Nodes (19): allKeys(), baseCatalogue, catalogue, config, { existsSync, readFileSync, readdirSync }, interpolate(), { join }, languages() (+11 more) - -### Community 81 - "envFile.js" -Cohesion: 0.52 -Nodes (6): detectEol(), parseEnvFile(), quote(), setEnvValue(), splitLines(), unquote() - -### Community 83 - "getPath" -Cohesion: 0.20 -Nodes (11): localQuestion(), channelResolves(), describe(), FEATURES, { getPath }, resolves(), statusOf(), defaultOf() (+3 more) - -### Community 84 - "messageComposer.js" -Cohesion: 0.31 -Nodes (8): buildMessage(), config, defaultFooter(), LIMITS, mentionFor(), MODES, nowStr(), PINGS - -### Community 85 - "Announce.jsx" -Cohesion: 0.43 -Nodes (6): Announce(), barColor(), LIMITS, POSTABLE, readStored(), store() - -## Knowledge Gaps -- **390 isolated node(s):** `{ - Collection, GatewayIntentBits, Events, - ButtonStyle, ButtonBuilder, ActionRowBuilder, MessageFlags, -}`, `{ readdirSync }`, `{ join }`, `{ enabled }`, `{ t }` (+385 more) - These have ≤1 connection - possible missing edges or undocumented components. -- **16 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes. - -## Suggested Questions -_Questions this graph is uniquely positioned to answer:_ - -- **Why does `t()` connect `t` to `hangman.js`, `connect4.js`, `logging.js`, `pointsManager.js`, `blackjack.js`, `commands/bot.js`, `community.js`, `trivia.js`, `minigames/bot.js`, `support.js`, `contextMenus.js`, `tictactoe.js`, `minigames.js`, `wordle.js`, `admin.js`, `utility.js`, `core/utils.js`, `commandKit.js`, `i18n.js`, `getPath`?** - _High betweenness centrality (0.065) - this node is a cross-community bridge._ -- **Why does `getPath()` connect `getPath` to `wordle.js`, `configFile.js`, `t`, `core/config.js`, `contextMenus.js`, `i18n.js`?** - _High betweenness centrality (0.010) - this node is a cross-community bridge._ -- **Why does `BotSupervisor` connect `BotSupervisor` to `dashboard/config.js`?** - _High betweenness centrality (0.008) - this node is a cross-community bridge._ -- **Are the 2 inferred relationships involving `embed()` (e.g. with `execute()` and `execute()`) actually correct?** - _`embed()` has 2 INFERRED edges - model-reasoned connections that need verification._ -- **What connects `{ - Collection, GatewayIntentBits, Events, - ButtonStyle, ButtonBuilder, ActionRowBuilder, MessageFlags, -}`, `{ readdirSync }`, `{ join }` to the rest of the system?** - _390 weakly-connected nodes found - possible documentation gaps or missing edges._ -- **Should `hangman.js` be split into smaller, more focused modules?** - _Cohesion score 0.10114942528735632 - nodes in this community are weakly interconnected._ -- **Should `pointsManager.js` be split into smaller, more focused modules?** - _Cohesion score 0.09846153846153846 - nodes in this community are weakly interconnected._ \ No newline at end of file +# Graph Report - discord_multibot (2026-11-05) + +## Corpus Check +- 104 files · ~107,145 words +- Verdict: corpus is large enough that graph structure adds value. + +## Summary +- 1073 nodes · 2030 edges · 85 communities (51 shown, 16 thin omitted) +- Extraction: 90% EXTRACTED · 10% INFERRED · 0% AMBIGUOUS · INFERRED: 213 edges (avg confidence: 0.85) +- Token cost: 0 input · 0 output + +## Graph Freshness +- Built from commit: `24ca834a` +- Run `git rev-parse HEAD` and compare to check if the graph is stale. +- Run `graphify update .` after code changes (no API cost). + +## Community Hubs (Navigation) +- notifyRewards +- connect4.js +- logging.js +- pointsManager.js +- index.js +- harness.js +- i18n.js +- blackjack.js +- package.json +- commands/bot.js +- Discord Multi-Bot README (DE) +- core/config.js +- community.js +- trivia.js +- contextMenus.js +- Auto Release Workflow +- support.js +- CI Workflow +- schema.js +- migrate-config.js +- server.js +- test/dashboard.js +- commands/sponsor.js +- tictactoe.js +- dashboard/config.js +- security.js +- inputs.jsx +- dashboard/settings.js +- dashboard/discord.js +- ui.jsx +- minigames.js +- i18n.jsx +- routes.js +- dependencies +- App.jsx +- hangman.js +- admin.js +- Settings.jsx +- t +- devDependencies +- gameKit.js +- messageHandler.js +- core/utils.js +- web/package.json +- BotControl.jsx +- useI18n +- commandKit.js +- api.js +- alert.jsx +- badge.jsx +- button.jsx +- resolvePermissions +- @fontsource/syne +- @radix-ui/react-dialog +- @radix-ui/react-dropdown-menu +- @radix-ui/react-label +- @radix-ui/react-scroll-area +- @radix-ui/react-select +- @radix-ui/react-separator +- @radix-ui/react-switch +- @radix-ui/react-tabs +- react +- react-dom +- envFile.js +- @fontsource/dm-sans +- messageComposer.js +- Announce.jsx + +## God Nodes (most connected - your core abstractions) +1. `t()` - 87 edges +2. `useI18n()` - 25 edges +3. `gameColor()` - 24 edges +4. `embed()` - 23 edges +5. `applyMeta()` - 22 edges +6. `gameFooter()` - 21 edges +7. `pointsFor()` - 21 edges +8. `notifyRewards()` - 21 edges +9. `addPoints()` - 20 edges +10. `f()` - 19 edges + +## Surprising Connections (you probably didn't know these) +- `Discord Multi-Bot` --references--> `MSK Scripts Logo` [INFERRED] + README.md → assets/msk_logo.png +- `handleInteraction()` --calls--> `t()` [EXTRACTED] + bots/events/handlers/contextMenus.js → core/i18n.js +- `attach()` --calls--> `t()` [EXTRACTED] + bots/commands/bot.js → core/i18n.js +- `handleVerification()` --calls--> `t()` [EXTRACTED] + bots/commands/bot.js → core/i18n.js +- `handleSponsorVerify()` --calls--> `t()` [EXTRACTED] + bots/commands/bot.js → core/i18n.js + +## Import Cycles +- None detected. + +## Hyperedges (group relationships) +- **Tag-Driven Release Automation Pipeline** — _github_workflows_release_auto_release_workflow, _github_workflows_release_tag_resolution, _github_workflows_release_release_body_generation, _github_workflows_release_concurrency_guard [EXTRACTED 1.00] +- **Project Governance and Compliance Documents** — code_of_conduct_contributor_covenant, license_agpl_v3, security_vulnerability_reporting_policy, _github_dependabot_dependabot_config [INFERRED 0.85] + +## Communities (85 total, 16 thin omitted) + +### Community 0 - "notifyRewards" +Cohesion: 0.15 +Nodes (20): { addPoints, pointsFor, notifyRewards }, { applyMeta }, execute(), { gameFooter }, { makeEmbed }, { SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder }, { t }, execute() (+12 more) + +### Community 1 - "connect4.js" +Cohesion: 0.21 +Nodes (15): { addPoints, pointsFor, notifyRewards }, { applyMeta }, botMove(), buildComponents(), checkWin(), COL_NUMS, drop(), execute() (+7 more) + +### Community 2 - "logging.js" +Cohesion: 0.21 +Nodes (35): actorText(), CHANNEL_TYPE_KEYS, channelTypeName(), color(), config, { dateStr }, embed(), { EmbedBuilder, AuditLogEvent, ChannelType } (+27 more) + +### Community 3 - "pointsManager.js" +Cohesion: 0.11 +Nodes (23): { applyMeta }, config, { gameColor }, { getPoints, rewards, multiplierFor }, { SlashCommandBuilder, EmbedBuilder }, { t }, applyMultiplier(), config (+15 more) + +### Community 4 - "index.js" +Cohesion: 0.09 +Nodes (29): DATA_DIR, addBalance(), connect(), deleteAccessRow(), deleteTemplate(), DRIVERS, getAccessRows(), getBalance() (+21 more) + +### Community 5 - "harness.js" +Cohesion: 0.07 +Nodes (17): assert, client, commands, config, { EventEmitter }, { execSync }, failures, FIXTURE (+9 more) + +### Community 6 - "i18n.js" +Cohesion: 0.07 +Nodes (46): applyConfigPatch(), applyTextsPatch(), config, deletePath(), fs, i18n, isPlain(), { parseJsonc, deepMerge, getPath } (+38 more) + +### Community 7 - "blackjack.js" +Cohesion: 0.17 +Nodes (17): { addPoints, pointsFor, notifyRewards }, { applyMeta }, buildButtons(), execute(), { gameFooter, gameColor }, handStr(), handValue(), isBlackjack() (+9 more) + +### Community 8 - "package.json" +Cohesion: 0.07 +Nodes (28): better-sqlite3, dotenv, express, helmet, mysql2, dependencies, better-sqlite3, discord.js (+20 more) + +### Community 9 - "commands/bot.js" +Cohesion: 0.09 +Nodes (33): attach(), buttonIdFromCustomId(), { + Collection, GatewayIntentBits, Events, + ButtonStyle, ButtonBuilder, ActionRowBuilder, MessageFlags, +}, config, { enabled }, findRoleButton(), handlePersistentButton(), handleSponsorVerify() (+25 more) + +### Community 10 - "Discord Multi-Bot README (DE)" +Cohesion: 0.18 +Nodes (11): Dependabot npm Update Config, Grouped Weekly Dependency Updates, MSK Scripts Logo, Contributor Covenant Code of Conduct v2.0, Community Impact Enforcement Ladder, GNU Affero General Public License v3, Network-Use Copyleft (AGPL Section 13), Discord Multi-Bot README (DE) (+3 more) + +### Community 11 - "core/config.js" +Cohesion: 0.10 +Nodes (34): ASSETS_DIR, BASE_DIR, brandLinks(), brandName(), channelId(), command(), commandKeys(), CONFIG_DIR (+26 more) + +### Community 12 - "community.js" +Cohesion: 0.24 +Nodes (15): { applyMeta, guard }, config, execute(), informationEmbed(), { makeEmbed, linkRow, buttonStyle }, postPanel(), roleMenuButtons(), roleMenuComponents() (+7 more) + +### Community 13 - "trivia.js" +Cohesion: 0.19 +Nodes (12): { addPoints, pointsFor, notifyRewards }, { applyMeta }, b64(), config, cooldowns, fetchQuestion(), { gameFooter, gameColor }, LABELS (+4 more) + +### Community 14 - "contextMenus.js" +Cohesion: 0.07 +Nodes (36): attach(), config, { GatewayIntentBits, Partials, Events }, intents, memberCountInterval(), partials, { presenceOptions }, scheduleMemberCountUpdate() (+28 more) + +### Community 15 - "Auto Release Workflow" +Cohesion: 0.67 +Nodes (4): Auto Release Workflow, Release Concurrency Guard, Release Body Generation from Git History, Tag Resolution and Optional Tag Creation + +### Community 16 - "support.js" +Cohesion: 0.27 +Nodes (9): { applyMeta, optionText, guard }, buildData(), config, execute(), guides(), { makeEmbed, linkRow }, { SlashCommandBuilder, MessageFlags }, { t } (+1 more) + +### Community 18 - "schema.js" +Cohesion: 0.23 +Nodes (6): { SCHEMA, templateValues }, { SCHEMA, templateValues }, { SCHEMA, templateValues }, SCHEMA, TEMPLATE_COLUMNS, templateValues() + +### Community 19 - "migrate-config.js" +Cohesion: 0.21 +Nodes (11): BASE_DIR, buildConfig(), CONFIG_PATH, dryRun, env(), { existsSync, readFileSync, writeFileSync, copyFileSync }, force, { join } (+3 more) + +### Community 21 - "server.js" +Cohesion: 0.10 +Nodes (28): buildAuthorizeUrl(), exchangeCode(), fetchOAuthUser(), { redirectUri }, redirectUri(), canUseDashboard(), hasPermission(), { buildAuthorizeUrl, exchangeCode, fetchOAuthUser } (+20 more) + +### Community 22 - "test/dashboard.js" +Cohesion: 0.06 +Nodes (20): assert, CONFIG_PATH, crypto, db, discord, failures, fs, { loadDashboardConfig } (+12 more) + +### Community 23 - "commands/sponsor.js" +Cohesion: 0.24 +Nodes (10): { applyMeta, optionText, guard }, config, execute(), { makeEmbed }, panel(), post(), { + SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, MessageFlags, +}, sponsor (+2 more) + +### Community 24 - "tictactoe.js" +Cohesion: 0.21 +Nodes (19): { addPoints, pointsFor, notifyRewards }, aiEasy(), aiHard(), aiMedium(), { applyMeta }, available(), buildBoard(), buildEmbed() (+11 more) + +### Community 25 - "dashboard/config.js" +Cohesion: 0.09 +Nodes (23): config, crypto, ensureSessionSecret(), ENV_PATH, fs, isLoopback(), loadDashboardConfig(), path (+15 more) + +### Community 26 - "security.js" +Cohesion: 0.15 +Nodes (14): b64url(), buckets, createOAuthState(), createSession(), createToken(), crypto, getSecret(), safeEqual() (+6 more) + +### Community 27 - "inputs.jsx" +Cohesion: 0.15 +Nodes (15): ACTIVITY_TYPES, BUTTON_STYLES, ColorInput(), CommandTable(), ContextMenus(), IdListPicker(), IdPicker(), ItemCard() (+7 more) + +### Community 28 - "dashboard/settings.js" +Cohesion: 0.20 +Nodes (17): clearFavicon(), config, DATA_DIR, detectFaviconType(), ensureDataDir(), FAVICON_BASE, FAVICON_TYPES, fs (+9 more) + +### Community 29 - "dashboard/discord.js" +Cohesion: 0.22 +Nodes (16): avatarUrl(), botToken(), cacheUser(), config, DiscordApiError, getGuild(), getGuildChannels(), getGuildLookups() (+8 more) + +### Community 30 - "ui.jsx" +Cohesion: 0.19 +Nodes (14): api, getLocale(), Banner(), BANNER_VARIANT, Empty(), FeatureState(), fmtDate(), SectionTitle() (+6 more) + +### Community 31 - "minigames.js" +Cohesion: 0.19 +Nodes (12): { applyMeta, optionText, guard }, config, execute(), { join }, JOKES_FILE, { makeEmbed, readJson, writeJson }, newRound(), { randomInt } (+4 more) + +### Community 32 - "i18n.jsx" +Cohesion: 0.28 +Nodes (11): BUNDLES, interpolate(), lookup(), resolve(), detectLanguage(), I18nContext, I18nProvider(), LANGUAGES (+3 more) + +### Community 33 - "routes.js" +Cohesion: 0.11 +Nodes (24): checkSelfEdit(), isPermission(), isSubjectType(), parsePermissions(), PERMISSION_LABELS, PERMISSIONS, SUBJECT_TYPES, { buildMessage } (+16 more) + +### Community 34 - "dependencies" +Cohesion: 0.13 +Nodes (15): class-variance-authority, clsx, @fontsource/space-mono, lucide-react, @radix-ui/react-slot, @radix-ui/react-tooltip, tailwind-merge, dependencies (+7 more) + +### Community 35 - "App.jsx" +Cohesion: 0.29 +Nodes (10): allowed(), App(), NAV, NavContent(), DETAIL_VIEWS, parseRoute(), SEGMENT_TO_VIEW, useRouter() (+2 more) + +### Community 36 - "hangman.js" +Cohesion: 0.14 +Nodes (16): { addPoints, pointsFor, notifyRewards }, { applyMeta }, { gameFooter, gameColor }, pickWord(), { + SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder, + ModalBuilder, TextInputBuilder, TextInputStyle, MessageFlags, +}, STAGES, { t, tList }, { addPoints, pointsFor, notifyRewards } (+8 more) + +### Community 37 - "admin.js" +Cohesion: 0.18 +Nodes (12): { applyMeta, guard }, { buildMessage }, config, { execFile }, execute(), { join }, { mkdirSync, writeFileSync, unlinkSync }, { nowStr } (+4 more) + +### Community 38 - "Settings.jsx" +Cohesion: 0.35 +Nodes (8): ACCENT_VARS, applyAccent(), applyDashboardSettings(), applyFavicon(), hexToRgb(), loadAndApplyDashboardSettings(), readableForeground(), Settings() + +### Community 39 - "t" +Cohesion: 0.17 +Nodes (22): buildEmbed(), buildEmbed(), execute(), execute(), buildEmbed(), execute(), { addPoints, pointsFor, notifyRewards }, { applyMeta } (+14 more) + +### Community 40 - "devDependencies" +Cohesion: 0.18 +Nodes (11): tailwindcss, @tailwindcss/vite, tw-animate-css, vite, @vitejs/plugin-react, devDependencies, tailwindcss, @tailwindcss/vite (+3 more) + +### Community 43 - "gameKit.js" +Cohesion: 0.18 +Nodes (9): { applyMeta, optionText }, CATEGORIES, { gameColor }, { SlashCommandBuilder, EmbedBuilder, MessageFlags }, { t, tList }, config, FALLBACK, { pointsFooter } (+1 more) + +### Community 44 - "messageHandler.js" +Cohesion: 0.38 +Nodes (6): autoReply(), config, feedbackToEmbed(), { makeEmbed }, onMessage(), { t } + +### Community 45 - "core/utils.js" +Cohesion: 0.13 +Nodes (18): { applyMeta, optionText, guard }, config, execute(), { getPoints }, { makeEmbed, dateTimeStr }, { SlashCommandBuilder, MessageFlags }, { t }, guard() (+10 more) + +### Community 46 - "web/package.json" +Cohesion: 0.20 +Nodes (9): description, name, private, scripts, build, dev, preview, type (+1 more) + +### Community 47 - "BotControl.jsx" +Cohesion: 0.31 +Nodes (6): COLORS, parseAnsi(), fmtDuration(), BotControl(), DOT, LogLine() + +### Community 49 - "useI18n" +Cohesion: 0.24 +Nodes (10): Brand(), LanguagePicker(), Field(), useI18n(), Config(), FeatureDetail(), getPath(), ICONS (+2 more) + +### Community 52 - "commandKit.js" +Cohesion: 0.18 +Nodes (12): { applyMeta, optionText }, { gameColor }, SIDES, { SlashCommandBuilder, EmbedBuilder }, { t }, { allowedByRoles }, applyMeta(), config (+4 more) + +### Community 54 - "api.js" +Cohesion: 0.53 +Nodes (4): ApiError, logout(), readCookie(), request() + +### Community 61 - "resolvePermissions" +Cohesion: 0.67 +Nodes (3): resolvePermissions(), selectAccessRows(), loadPermissions() + +### Community 81 - "envFile.js" +Cohesion: 0.52 +Nodes (6): detectEol(), parseEnvFile(), quote(), setEnvValue(), splitLines(), unquote() + +### Community 84 - "messageComposer.js" +Cohesion: 0.31 +Nodes (8): buildMessage(), config, defaultFooter(), LIMITS, mentionFor(), MODES, nowStr(), PINGS + +### Community 85 - "Announce.jsx" +Cohesion: 0.43 +Nodes (6): Announce(), barColor(), LIMITS, POSTABLE, readStored(), store() + +## Knowledge Gaps +- **401 isolated node(s):** `{ + Collection, GatewayIntentBits, Events, + ButtonStyle, ButtonBuilder, ActionRowBuilder, MessageFlags, +}`, `{ readdirSync }`, `{ join }`, `{ enabled }`, `{ t }` (+396 more) + These have ≤1 connection - possible missing edges or undocumented components. (Counts symbols only; 532 node(s) total have ≤1 connection when file, concept and rationale nodes are included.) +- **16 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes. + +## Suggested Questions +_Questions this graph is uniquely positioned to answer:_ + +- **Why does `t()` connect `t` to `notifyRewards`, `connect4.js`, `logging.js`, `pointsManager.js`, `i18n.js`, `blackjack.js`, `commands/bot.js`, `community.js`, `trivia.js`, `contextMenus.js`, `support.js`, `commands/sponsor.js`, `tictactoe.js`, `minigames.js`, `hangman.js`, `admin.js`, `gameKit.js`, `messageHandler.js`, `core/utils.js`, `commandKit.js`?** + _High betweenness centrality (0.062) - this node is a cross-community bridge._ +- **Are the 2 inferred relationships involving `embed()` (e.g. with `execute()` and `execute()`) actually correct?** + _`embed()` has 2 INFERRED edges - model-reasoned connections that need verification._ +- **What connects `{ + Collection, GatewayIntentBits, Events, + ButtonStyle, ButtonBuilder, ActionRowBuilder, MessageFlags, +}`, `{ readdirSync }`, `{ join }` to the rest of the system?** + _401 weakly-connected nodes found - possible documentation gaps or missing edges._ +- **Should `notifyRewards` be split into smaller, more focused modules?** + _Cohesion score 0.1471861471861472 - nodes in this community are weakly interconnected._ +- **Should `pointsManager.js` be split into smaller, more focused modules?** + _Cohesion score 0.11 - nodes in this community are weakly interconnected._ +- **Should `index.js` be split into smaller, more focused modules?** + _Cohesion score 0.0873440285204991 - nodes in this community are weakly interconnected._ +- **Should `harness.js` be split into smaller, more focused modules?** + _Cohesion score 0.06666666666666667 - nodes in this community are weakly interconnected._ \ No newline at end of file diff --git a/graphify-out/graph.json b/graphify-out/graph.json index 09c7276..7e6d4c2 100644 --- a/graphify-out/graph.json +++ b/graphify-out/graph.json @@ -41,7 +41,7 @@ "_callable_class": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "botsupervisor", "source_file": "core/dashboard/supervisor.js", @@ -79,7 +79,7 @@ "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "execute()", "source_file": "bots/minigames/commands/flipcoin.js", @@ -91,31 +91,19 @@ "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "execute()", "source_file": "bots/minigames/commands/hangman.js", "source_location": "L81" }, - { - "id": "bots_minigames_commands_hangman_pickword", - "label": "pickWord()", - "_callable": true, - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "pickword()", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L31" - }, { "id": "bots_minigames_commands_rps_execute", "label": "execute()", "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "execute()", "source_file": "bots/minigames/commands/rps.js", @@ -127,35 +115,35 @@ "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "outcomeof()", "source_file": "bots/minigames/commands/rps.js", "source_location": "L15" }, { - "id": "core_pointsmanager_addpoints", - "label": "addPoints()", + "id": "bots_minigames_commands_trivia_execute", + "label": "execute()", "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", - "norm_label": "addpoints()", - "source_file": "core/pointsManager.js", - "source_location": "L198" + "norm_label": "execute()", + "source_file": "bots/minigames/commands/trivia.js", + "source_location": "L86" }, { - "id": "core_pointsmanager_getpts", - "label": "getPts()", + "id": "core_pointsmanager_addpoints", + "label": "addPoints()", "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", - "norm_label": "getpts()", + "norm_label": "addpoints()", "source_file": "core/pointsManager.js", - "source_location": "L47" + "source_location": "L198" }, { "id": "core_pointsmanager_notifyrewards", @@ -163,7 +151,7 @@ "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "notifyrewards()", "source_file": "core/pointsManager.js", @@ -175,7 +163,7 @@ "_callable": true, "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "pointsfor()", "source_file": "core/pointsManager.js", @@ -205,18 +193,6 @@ "source_file": "bots/minigames/commands/connect4.js", "source_location": "L65" }, - { - "id": "bots_minigames_commands_connect4_buildembed", - "label": "buildEmbed()", - "_callable": true, - "_origin": "ast", - "community": 1, - "community_name": "connect4.js", - "file_type": "code", - "norm_label": "buildembed()", - "source_file": "bots/minigames/commands/connect4.js", - "source_location": "L85" - }, { "id": "bots_minigames_commands_connect4_checkwin", "label": "checkWin()", @@ -311,7 +287,7 @@ "file_type": "code", "norm_label": "brandlinks()", "source_file": "core/config.js", - "source_location": "L197" + "source_location": "L206" }, { "id": "core_config_brandname", @@ -323,7 +299,7 @@ "file_type": "code", "norm_label": "brandname()", "source_file": "core/config.js", - "source_location": "L187" + "source_location": "L196" }, { "id": "core_config_channelid", @@ -335,7 +311,7 @@ "file_type": "code", "norm_label": "channelid()", "source_file": "core/config.js", - "source_location": "L161" + "source_location": "L170" }, { "id": "core_config_command", @@ -347,7 +323,7 @@ "file_type": "code", "norm_label": "command()", "source_file": "core/config.js", - "source_location": "L213" + "source_location": "L222" }, { "id": "core_config_commandkeys", @@ -359,7 +335,7 @@ "file_type": "code", "norm_label": "commandkeys()", "source_file": "core/config.js", - "source_location": "L227" + "source_location": "L236" }, { "id": "core_config_contextmenu", @@ -371,7 +347,7 @@ "file_type": "code", "norm_label": "contextmenu()", "source_file": "core/config.js", - "source_location": "L230" + "source_location": "L239" }, { "id": "core_config_embedcolor", @@ -383,7 +359,7 @@ "file_type": "code", "norm_label": "embedcolor()", "source_file": "core/config.js", - "source_location": "L189" + "source_location": "L198" }, { "id": "core_config_env", @@ -407,7 +383,7 @@ "file_type": "code", "norm_label": "featureenabled()", "source_file": "core/config.js", - "source_location": "L244" + "source_location": "L253" }, { "id": "core_config_gameenabled", @@ -419,7 +395,7 @@ "file_type": "code", "norm_label": "gameenabled()", "source_file": "core/config.js", - "source_location": "L247" + "source_location": "L256" }, { "id": "core_config_get", @@ -443,7 +419,7 @@ "file_type": "code", "norm_label": "guildid()", "source_file": "core/config.js", - "source_location": "L116" + "source_location": "L125" }, { "id": "core_config_hasuserconfig", @@ -479,7 +455,7 @@ "file_type": "code", "norm_label": "parsecolor()", "source_file": "core/config.js", - "source_location": "L178" + "source_location": "L187" }, { "id": "core_config_readjsoncfile", @@ -503,7 +479,7 @@ "file_type": "code", "norm_label": "reload()", "source_file": "core/config.js", - "source_location": "L317" + "source_location": "L339" }, { "id": "core_config_report", @@ -515,7 +491,7 @@ "file_type": "code", "norm_label": "report()", "source_file": "core/config.js", - "source_location": "L261" + "source_location": "L270" }, { "id": "core_config_roleid", @@ -527,7 +503,7 @@ "file_type": "code", "norm_label": "roleid()", "source_file": "core/config.js", - "source_location": "L141" + "source_location": "L150" }, { "id": "core_config_roleids", @@ -539,7 +515,19 @@ "file_type": "code", "norm_label": "roleids()", "source_file": "core/config.js", - "source_location": "L150" + "source_location": "L159" + }, + { + "id": "core_config_sponsorsecrets", + "label": "sponsorSecrets()", + "_callable": true, + "_origin": "ast", + "community": 11, + "community_name": "core/config.js", + "file_type": "code", + "norm_label": "sponsorsecrets()", + "source_file": "core/config.js", + "source_location": "L107" }, { "id": "core_config_thumbnailurl", @@ -551,7 +539,7 @@ "file_type": "code", "norm_label": "thumbnailurl()", "source_file": "core/config.js", - "source_location": "L188" + "source_location": "L197" }, { "id": "bots_commands_commands_community_execute", @@ -697,13 +685,37 @@ "source_file": "bots/minigames/commands/trivia.js", "source_location": "L42" }, + { + "id": "bots_minigames_commands_trivia_localquestion", + "label": "localQuestion()", + "_callable": true, + "_origin": "ast", + "community": 13, + "community_name": "trivia.js", + "file_type": "code", + "norm_label": "localquestion()", + "source_file": "bots/minigames/commands/trivia.js", + "source_location": "L21" + }, + { + "id": "core_i18n_tdata", + "label": "tData()", + "_callable": true, + "_origin": "ast", + "community": 13, + "community_name": "trivia.js", + "file_type": "code", + "norm_label": "tdata()", + "source_file": "core/i18n.js", + "source_location": "L130" + }, { "id": "bots_events_bot_attach", "label": "attach()", "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "attach()", "source_file": "bots/events/bot.js", @@ -715,7 +727,7 @@ "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "membercountinterval()", "source_file": "bots/events/bot.js", @@ -727,7 +739,7 @@ "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "schedulemembercountupdate()", "source_file": "bots/events/bot.js", @@ -739,47 +751,107 @@ "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "updatemembercount()", "source_file": "bots/events/bot.js", "source_location": "L112" }, { - "id": "bots_events_handlers_messagehandler_autoreply", - "label": "autoReply()", + "id": "bots_events_handlers_contextmenus_answermessage", + "label": "answerMessage()", "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", - "norm_label": "autoreply()", - "source_file": "bots/events/handlers/messageHandler.js", - "source_location": "L29" + "norm_label": "answermessage()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L135" }, { - "id": "bots_events_handlers_messagehandler_feedbacktoembed", - "label": "feedbackToEmbed()", + "id": "bots_events_handlers_contextmenus_cloneembed", + "label": "cloneEmbed()", "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", - "norm_label": "feedbacktoembed()", - "source_file": "bots/events/handlers/messageHandler.js", - "source_location": "L57" + "norm_label": "cloneembed()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L31" }, { - "id": "bots_events_handlers_messagehandler_onmessage", - "label": "onMessage()", + "id": "bots_events_handlers_contextmenus_commentfeedback", + "label": "commentFeedback()", "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", - "norm_label": "onmessage()", - "source_file": "bots/events/handlers/messageHandler.js", - "source_location": "L22" + "norm_label": "commentfeedback()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L79" + }, + { + "id": "bots_events_handlers_contextmenus_editembed", + "label": "editEmbed()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "editembed()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L173" + }, + { + "id": "bots_events_handlers_contextmenus_editmessage", + "label": "editMessage()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "editmessage()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L153" + }, + { + "id": "bots_events_handlers_contextmenus_getcommands", + "label": "getCommands()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "getcommands()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L60" + }, + { + "id": "bots_events_handlers_contextmenus_handleinteraction", + "label": "handleInteraction()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "handleinteraction()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L227" + }, + { + "id": "bots_events_handlers_contextmenus_showmodal", + "label": "showModal()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "showmodal()", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L24" }, { "id": "bots_minigames_bot_attach", @@ -787,19 +859,43 @@ "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "attach()", "source_file": "bots/minigames/bot.js", "source_location": "L17" }, + { + "id": "core_commandkit_guardmenu", + "label": "guardMenu()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "guardmenu()", + "source_file": "core/commandKit.js", + "source_location": "L86" + }, + { + "id": "core_i18n_raw", + "label": "raw()", + "_callable": true, + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "raw()", + "source_file": "core/i18n.js", + "source_location": "L148" + }, { "id": "core_utils_presenceoptions", "label": "presenceOptions()", "_callable": true, "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "presenceoptions()", "source_file": "core/utils.js", @@ -1417,18 +1513,6 @@ "source_file": "core/dashboard/server.js", "source_location": "L79" }, - { - "id": "core_dashboard_server_startserver_loadpermissions", - "label": "loadPermissions()", - "_callable": true, - "_origin": "ast", - "community": 21, - "community_name": "server.js", - "file_type": "code", - "norm_label": "loadpermissions()", - "source_file": "core/dashboard/server.js", - "source_location": "L146" - }, { "id": "core_dashboard_server_startserver_requireauth", "label": "requireAuth()", @@ -1598,124 +1682,52 @@ "source_location": "L103" }, { - "id": "bots_events_handlers_contextmenus_answermessage", - "label": "answerMessage()", - "_callable": true, - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "answermessage()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L135" - }, - { - "id": "bots_events_handlers_contextmenus_cloneembed", - "label": "cloneEmbed()", - "_callable": true, - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "cloneembed()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L31" - }, - { - "id": "bots_events_handlers_contextmenus_commentfeedback", - "label": "commentFeedback()", - "_callable": true, - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "commentfeedback()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L79" - }, - { - "id": "bots_events_handlers_contextmenus_editembed", - "label": "editEmbed()", - "_callable": true, - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "editembed()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L173" - }, - { - "id": "bots_events_handlers_contextmenus_editmessage", - "label": "editMessage()", - "_callable": true, - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "editmessage()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L153" - }, - { - "id": "bots_events_handlers_contextmenus_getcommands", - "label": "getCommands()", + "id": "bots_commands_commands_sponsor_execute", + "label": "execute()", "_callable": true, "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "getcommands()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L60" + "norm_label": "execute()", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L83" }, { - "id": "bots_events_handlers_contextmenus_handleinteraction", - "label": "handleInteraction()", + "id": "bots_commands_commands_sponsor_panel", + "label": "panel()", "_callable": true, "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "handleinteraction()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L227" - }, - { - "id": "bots_events_handlers_contextmenus_showmodal", - "label": "showModal()", - "_callable": true, - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "showmodal()", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L24" + "norm_label": "panel()", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L20" }, { - "id": "core_commandkit_guardmenu", - "label": "guardMenu()", + "id": "bots_commands_commands_sponsor_post", + "label": "post()", "_callable": true, "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "guardmenu()", - "source_file": "core/commandKit.js", - "source_location": "L86" + "norm_label": "post()", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L48" }, { - "id": "core_i18n_raw", - "label": "raw()", + "id": "bots_commands_commands_sponsor_sync", + "label": "sync()", "_callable": true, "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "raw()", - "source_file": "core/i18n.js", - "source_location": "L148" + "norm_label": "sync()", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L58" }, { "id": "bots_minigames_commands_tictactoe_aieasy", @@ -1777,6 +1789,18 @@ "source_file": "bots/minigames/commands/tictactoe.js", "source_location": "L91" }, + { + "id": "bots_minigames_commands_tictactoe_buildembed", + "label": "buildEmbed()", + "_callable": true, + "_origin": "ast", + "community": 24, + "community_name": "tictactoe.js", + "file_type": "code", + "norm_label": "buildembed()", + "source_file": "bots/minigames/commands/tictactoe.js", + "source_location": "L114" + }, { "id": "bots_minigames_commands_tictactoe_checkwinner", "label": "checkWinner()", @@ -1789,6 +1813,18 @@ "source_file": "bots/minigames/commands/tictactoe.js", "source_location": "L23" }, + { + "id": "bots_minigames_commands_tictactoe_difflabel", + "label": "diffLabel()", + "_callable": true, + "_origin": "ast", + "community": 24, + "community_name": "tictactoe.js", + "file_type": "code", + "norm_label": "difflabel()", + "source_file": "bots/minigames/commands/tictactoe.js", + "source_location": "L21" + }, { "id": "bots_minigames_commands_tictactoe_execute", "label": "execute()", @@ -1837,13 +1873,73 @@ "source_file": "bots/minigames/commands/tictactoe.js", "source_location": "L35" }, + { + "id": "core_dashboard_config_ensuresessionsecret", + "label": "ensureSessionSecret()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "ensuresessionsecret()", + "source_file": "core/dashboard/config.js", + "source_location": "L117" + }, + { + "id": "core_dashboard_config_isloopback", + "label": "isLoopback()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "isloopback()", + "source_file": "core/dashboard/config.js", + "source_location": "L34" + }, + { + "id": "core_dashboard_config_loaddashboardconfig", + "label": "loadDashboardConfig()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "loaddashboardconfig()", + "source_file": "core/dashboard/config.js", + "source_location": "L39" + }, + { + "id": "core_dashboard_config_truthy", + "label": "truthy()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "truthy()", + "source_file": "core/dashboard/config.js", + "source_location": "L31" + }, + { + "id": "core_dashboard_config_validatedashboardconfig", + "label": "validateDashboardConfig()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "validatedashboardconfig()", + "source_file": "core/dashboard/config.js", + "source_location": "L71" + }, { "id": "core_dashboard_supervisor_botsupervisor_cancelscheduledrestart", "label": ".cancelScheduledRestart()", "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".cancelscheduledrestart()", "source_file": "core/dashboard/supervisor.js", @@ -1855,7 +1951,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".constructor()", "source_file": "core/dashboard/supervisor.js", @@ -1867,7 +1963,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".getlogs()", "source_file": "core/dashboard/supervisor.js", @@ -1879,7 +1975,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".getstate()", "source_file": "core/dashboard/supervisor.js", @@ -1891,7 +1987,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".pushlog()", "source_file": "core/dashboard/supervisor.js", @@ -1903,7 +1999,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".restart()", "source_file": "core/dashboard/supervisor.js", @@ -1915,7 +2011,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".run()", "source_file": "core/dashboard/supervisor.js", @@ -1927,7 +2023,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".schedulerestart()", "source_file": "core/dashboard/supervisor.js", @@ -1939,7 +2035,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".setstatus()", "source_file": "core/dashboard/supervisor.js", @@ -1951,7 +2047,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".start()", "source_file": "core/dashboard/supervisor.js", @@ -1963,7 +2059,7 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".stop()", "source_file": "core/dashboard/supervisor.js", @@ -1975,12 +2071,36 @@ "_callable": true, "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": ".update()", "source_file": "core/dashboard/supervisor.js", "source_location": "L226" }, + { + "id": "dashboard_installshutdownhandlers", + "label": "installShutdownHandlers()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "installshutdownhandlers()", + "source_file": "dashboard.js", + "source_location": "L32" + }, + { + "id": "dashboard_main", + "label": "main()", + "_callable": true, + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "main()", + "source_file": "dashboard.js", + "source_location": "L45" + }, { "id": "core_dashboard_security_b64url", "label": "b64url()", @@ -2689,6 +2809,42 @@ "source_file": "core/pointsManager.js", "source_location": "L210" }, + { + "id": "core_pointsmanager_getpoints", + "label": "getPoints()", + "_callable": true, + "_origin": "ast", + "community": 3, + "community_name": "pointsManager.js", + "file_type": "code", + "norm_label": "getpoints()", + "source_file": "core/pointsManager.js", + "source_location": "L190" + }, + { + "id": "core_pointsmanager_getpts", + "label": "getPts()", + "_callable": true, + "_origin": "ast", + "community": 3, + "community_name": "pointsManager.js", + "file_type": "code", + "norm_label": "getpts()", + "source_file": "core/pointsManager.js", + "source_location": "L47" + }, + { + "id": "core_pointsmanager_init", + "label": "init()", + "_callable": true, + "_origin": "ast", + "community": 3, + "community_name": "pointsManager.js", + "file_type": "code", + "norm_label": "init()", + "source_file": "core/pointsManager.js", + "source_location": "L150" + }, { "id": "core_pointsmanager_multiplierfor", "label": "multiplierFor()", @@ -2714,28 +2870,40 @@ "source_location": "L64" }, { - "id": "core_pointsmanager_pointsfooter", - "label": "pointsFooter()", + "id": "core_pointsmanager_rewards", + "label": "rewards()", "_callable": true, "_origin": "ast", "community": 3, "community_name": "pointsManager.js", "file_type": "code", - "norm_label": "pointsfooter()", + "norm_label": "rewards()", "source_file": "core/pointsManager.js", - "source_location": "L241" + "source_location": "L121" }, { - "id": "core_pointsmanager_rewards", - "label": "rewards()", + "id": "core_pointsmanager_toppoints", + "label": "topPoints()", "_callable": true, "_origin": "ast", "community": 3, "community_name": "pointsManager.js", "file_type": "code", - "norm_label": "rewards()", + "norm_label": "toppoints()", "source_file": "core/pointsManager.js", - "source_location": "L121" + "source_location": "L203" + }, + { + "id": "core_utils_readjson", + "label": "readJson()", + "_callable": true, + "_origin": "ast", + "community": 3, + "community_name": "pointsManager.js", + "file_type": "code", + "norm_label": "readjson()", + "source_file": "core/utils.js", + "source_location": "L136" }, { "id": "web_src_i18n_getlocale", @@ -2905,42 +3073,6 @@ "source_file": "bots/commands/commands/minigames.js", "source_location": "L25" }, - { - "id": "core_pointsmanager_init", - "label": "init()", - "_callable": true, - "_origin": "ast", - "community": 31, - "community_name": "minigames.js", - "file_type": "code", - "norm_label": "init()", - "source_file": "core/pointsManager.js", - "source_location": "L150" - }, - { - "id": "core_pointsmanager_toppoints", - "label": "topPoints()", - "_callable": true, - "_origin": "ast", - "community": 31, - "community_name": "minigames.js", - "file_type": "code", - "norm_label": "toppoints()", - "source_file": "core/pointsManager.js", - "source_location": "L203" - }, - { - "id": "core_utils_readjson", - "label": "readJson()", - "_callable": true, - "_origin": "ast", - "community": 31, - "community_name": "minigames.js", - "file_type": "code", - "norm_label": "readjson()", - "source_file": "core/utils.js", - "source_location": "L136" - }, { "id": "core_utils_writejson", "label": "writeJson()", @@ -3085,30 +3217,6 @@ "source_file": "core/dashboard/permissions.js", "source_location": "L54" }, - { - "id": "core_dashboard_permissions_resolvepermissions", - "label": "resolvePermissions()", - "_callable": true, - "_origin": "ast", - "community": 33, - "community_name": "routes.js", - "file_type": "code", - "norm_label": "resolvepermissions()", - "source_file": "core/dashboard/permissions.js", - "source_location": "L78" - }, - { - "id": "core_dashboard_permissions_selectaccessrows", - "label": "selectAccessRows()", - "_callable": true, - "_origin": "ast", - "community": 33, - "community_name": "routes.js", - "file_type": "code", - "norm_label": "selectaccessrows()", - "source_file": "core/dashboard/permissions.js", - "source_location": "L64" - }, { "id": "core_dashboard_routes_getoverride", "label": "getOverride()", @@ -3205,13 +3313,25 @@ "source_file": "web/src/router.js", "source_location": "L46" }, + { + "id": "bots_minigames_commands_hangman_pickword", + "label": "pickWord()", + "_callable": true, + "_origin": "ast", + "community": 36, + "community_name": "hangman.js", + "file_type": "code", + "norm_label": "pickword()", + "source_file": "bots/minigames/commands/hangman.js", + "source_location": "L31" + }, { "id": "bots_minigames_commands_wordle_evaluate", "label": "evaluate()", "_callable": true, "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "evaluate()", "source_file": "bots/minigames/commands/wordle.js", @@ -3223,7 +3343,7 @@ "_callable": true, "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "execute()", "source_file": "bots/minigames/commands/wordle.js", @@ -3235,7 +3355,7 @@ "_callable": true, "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "words()", "source_file": "bots/minigames/commands/wordle.js", @@ -3247,7 +3367,7 @@ "_callable": true, "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "tlist()", "source_file": "core/i18n.js", @@ -3397,6 +3517,18 @@ "source_file": "bots/minigames/commands/blackjack.js", "source_location": "L65" }, + { + "id": "bots_minigames_commands_connect4_buildembed", + "label": "buildEmbed()", + "_callable": true, + "_origin": "ast", + "community": 39, + "community_name": "t", + "file_type": "code", + "norm_label": "buildembed()", + "source_file": "bots/minigames/commands/connect4.js", + "source_location": "L85" + }, { "id": "bots_minigames_commands_dice_execute", "label": "execute()", @@ -3493,30 +3625,6 @@ "source_file": "bots/minigames/commands/slots.js", "source_location": "L19" }, - { - "id": "bots_minigames_commands_tictactoe_buildembed", - "label": "buildEmbed()", - "_callable": true, - "_origin": "ast", - "community": 39, - "community_name": "t", - "file_type": "code", - "norm_label": "buildembed()", - "source_file": "bots/minigames/commands/tictactoe.js", - "source_location": "L114" - }, - { - "id": "bots_minigames_commands_tictactoe_difflabel", - "label": "diffLabel()", - "_callable": true, - "_origin": "ast", - "community": 39, - "community_name": "t", - "file_type": "code", - "norm_label": "difflabel()", - "source_file": "bots/minigames/commands/tictactoe.js", - "source_location": "L21" - }, { "id": "bots_minigames_commands_trivia_buildembed", "label": "buildEmbed()", @@ -3529,18 +3637,6 @@ "source_file": "bots/minigames/commands/trivia.js", "source_location": "L62" }, - { - "id": "bots_minigames_commands_trivia_execute", - "label": "execute()", - "_callable": true, - "_origin": "ast", - "community": 39, - "community_name": "t", - "file_type": "code", - "norm_label": "execute()", - "source_file": "bots/minigames/commands/trivia.js", - "source_location": "L86" - }, { "id": "bots_minigames_commands_wordle_buildembed", "label": "buildEmbed()", @@ -3589,6 +3685,18 @@ "source_file": "core/i18n.js", "source_location": "L101" }, + { + "id": "core_pointsmanager_pointsfooter", + "label": "pointsFooter()", + "_callable": true, + "_origin": "ast", + "community": 39, + "community_name": "t", + "file_type": "code", + "norm_label": "pointsfooter()", + "source_file": "core/pointsManager.js", + "source_location": "L241" + }, { "id": "core_db_index_addbalance", "label": "addBalance()", @@ -4058,125 +4166,53 @@ "source_location": "L13" }, { - "id": "core_dashboard_config_ensuresessionsecret", - "label": "ensureSessionSecret()", - "_callable": true, - "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", - "file_type": "code", - "norm_label": "ensuresessionsecret()", - "source_file": "core/dashboard/config.js", - "source_location": "L117" - }, - { - "id": "core_dashboard_config_isloopback", - "label": "isLoopback()", - "_callable": true, - "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", - "file_type": "code", - "norm_label": "isloopback()", - "source_file": "core/dashboard/config.js", - "source_location": "L34" - }, - { - "id": "core_dashboard_config_loaddashboardconfig", - "label": "loadDashboardConfig()", - "_callable": true, - "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", - "file_type": "code", - "norm_label": "loaddashboardconfig()", - "source_file": "core/dashboard/config.js", - "source_location": "L39" - }, - { - "id": "core_dashboard_config_truthy", - "label": "truthy()", - "_callable": true, - "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", - "file_type": "code", - "norm_label": "truthy()", - "source_file": "core/dashboard/config.js", - "source_location": "L31" - }, - { - "id": "core_dashboard_config_validatedashboardconfig", - "label": "validateDashboardConfig()", + "id": "bots_events_handlers_messagehandler_autoreply", + "label": "autoReply()", "_callable": true, "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", + "community": 44, + "community_name": "messageHandler.js", "file_type": "code", - "norm_label": "validatedashboardconfig()", - "source_file": "core/dashboard/config.js", - "source_location": "L71" + "norm_label": "autoreply()", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L29" }, { - "id": "dashboard_installshutdownhandlers", - "label": "installShutdownHandlers()", + "id": "bots_events_handlers_messagehandler_feedbacktoembed", + "label": "feedbackToEmbed()", "_callable": true, "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", + "community": 44, + "community_name": "messageHandler.js", "file_type": "code", - "norm_label": "installshutdownhandlers()", - "source_file": "dashboard.js", - "source_location": "L32" + "norm_label": "feedbacktoembed()", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L57" }, { - "id": "dashboard_main", - "label": "main()", + "id": "bots_events_handlers_messagehandler_onmessage", + "label": "onMessage()", "_callable": true, "_origin": "ast", - "community": 43, - "community_name": "dashboard/config.js", + "community": 44, + "community_name": "messageHandler.js", "file_type": "code", - "norm_label": "main()", - "source_file": "dashboard.js", - "source_location": "L45" + "norm_label": "onmessage()", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L22" }, { "id": "bots_commands_commands_utility_execute", "label": "execute()", "_callable": true, "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "execute()", "source_file": "bots/commands/commands/utility.js", "source_location": "L13" }, - { - "id": "core_pointsmanager_getpoints", - "label": "getPoints()", - "_callable": true, - "_origin": "ast", - "community": 44, - "community_name": "utility.js", - "file_type": "code", - "norm_label": "getpoints()", - "source_file": "core/pointsManager.js", - "source_location": "L190" - }, - { - "id": "core_utils_datetimestr", - "label": "dateTimeStr()", - "_callable": true, - "_origin": "ast", - "community": 44, - "community_name": "utility.js", - "file_type": "code", - "norm_label": "datetimestr()", - "source_file": "core/utils.js", - "source_location": "L25" - }, { "id": "core_commandkit_guard", "label": "guard()", @@ -4201,6 +4237,18 @@ "source_file": "core/utils.js", "source_location": "L169" }, + { + "id": "core_utils_datetimestr", + "label": "dateTimeStr()", + "_callable": true, + "_origin": "ast", + "community": 45, + "community_name": "core/utils.js", + "file_type": "code", + "norm_label": "datetimestr()", + "source_file": "core/utils.js", + "source_location": "L25" + }, { "id": "core_utils_hasanyrole", "label": "hasAnyRole()", @@ -4499,7 +4547,7 @@ "file_type": "code", "norm_label": "acheck()", "source_file": "test/harness.js", - "source_location": "L98" + "source_location": "L110" }, { "id": "test_harness_check", @@ -4511,7 +4559,7 @@ "file_type": "code", "norm_label": "check()", "source_file": "test/harness.js", - "source_location": "L94" + "source_location": "L106" }, { "id": "test_harness_dispatch", @@ -4523,7 +4571,7 @@ "file_type": "code", "norm_label": "dispatch()", "source_file": "test/harness.js", - "source_location": "L318" + "source_location": "L331" }, { "id": "test_harness_fake", @@ -4547,7 +4595,7 @@ "file_type": "code", "norm_label": "lasttext()", "source_file": "test/harness.js", - "source_location": "L308" + "source_location": "L321" }, { "id": "test_harness_mockinteraction", @@ -4559,7 +4607,7 @@ "file_type": "code", "norm_label": "mockinteraction()", "source_file": "test/harness.js", - "source_location": "L255" + "source_location": "L267" }, { "id": "test_harness_nameof", @@ -4571,7 +4619,7 @@ "file_type": "code", "norm_label": "nameof()", "source_file": "test/harness.js", - "source_location": "L324" + "source_location": "L337" }, { "id": "test_harness_req", @@ -4583,7 +4631,7 @@ "file_type": "code", "norm_label": "req()", "source_file": "test/harness.js", - "source_location": "L90" + "source_location": "L102" }, { "id": "test_harness_section", @@ -4595,7 +4643,7 @@ "file_type": "code", "norm_label": "section()", "source_file": "test/harness.js", - "source_location": "L102" + "source_location": "L114" }, { "id": "test_harness_stripcomments", @@ -4607,7 +4655,7 @@ "file_type": "code", "norm_label": "stripcomments()", "source_file": "test/harness.js", - "source_location": "L125" + "source_location": "L137" }, { "id": "test_harness_trackedsources", @@ -4619,7 +4667,7 @@ "file_type": "code", "norm_label": "trackedsources()", "source_file": "test/harness.js", - "source_location": "L113" + "source_location": "L125" }, { "id": "test_harness_v", @@ -4631,7 +4679,7 @@ "file_type": "code", "norm_label": "v()", "source_file": "test/harness.js", - "source_location": "L131" + "source_location": "L143" }, { "id": "web_src_components_ui_card_card", @@ -5119,7 +5167,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "applyconfigpatch()", "source_file": "core/dashboard/configFile.js", @@ -5131,7 +5179,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "applytextspatch()", "source_file": "core/dashboard/configFile.js", @@ -5143,7 +5191,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "deletepath()", "source_file": "core/dashboard/configFile.js", @@ -5155,7 +5203,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "isplain()", "source_file": "core/dashboard/configFile.js", @@ -5167,7 +5215,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "readconfig()", "source_file": "core/dashboard/configFile.js", @@ -5179,7 +5227,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "readexampleraw()", "source_file": "core/dashboard/configFile.js", @@ -5191,7 +5239,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "readjsoncfile()", "source_file": "core/dashboard/configFile.js", @@ -5203,7 +5251,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "readtexts()", "source_file": "core/dashboard/configFile.js", @@ -5215,7 +5263,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "readtextsexampleraw()", "source_file": "core/dashboard/configFile.js", @@ -5227,7 +5275,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "sameasdefault()", "source_file": "core/dashboard/configFile.js", @@ -5239,7 +5287,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "setpath()", "source_file": "core/dashboard/configFile.js", @@ -5251,7 +5299,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "writeconfigraw()", "source_file": "core/dashboard/configFile.js", @@ -5263,7 +5311,7 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "writefilesafely()", "source_file": "core/dashboard/configFile.js", @@ -5275,54 +5323,126 @@ "_callable": true, "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "writetextsraw()", "source_file": "core/dashboard/configFile.js", "source_location": "L204" }, { - "id": "web_src_components_ui_scroll_area_scrollarea", - "label": "ScrollArea()", + "id": "core_dashboard_features_channelresolves", + "label": "channelResolves()", "_callable": true, "_origin": "ast", - "community": 60, - "community_name": "scroll-area.jsx", + "community": 6, + "community_name": "i18n.js", "file_type": "code", - "norm_label": "scrollarea()", - "source_file": "web/src/components/ui/scroll-area.jsx", - "source_location": "L4" + "norm_label": "channelresolves()", + "source_file": "core/dashboard/features.js", + "source_location": "L36" }, { - "id": "web_src_components_ui_scroll_area_scrollbar", - "label": "ScrollBar()", + "id": "core_dashboard_features_describe", + "label": "describe()", "_callable": true, "_origin": "ast", - "community": 60, - "community_name": "scroll-area.jsx", + "community": 6, + "community_name": "i18n.js", "file_type": "code", - "norm_label": "scrollbar()", - "source_file": "web/src/components/ui/scroll-area.jsx", - "source_location": "L19" + "norm_label": "describe()", + "source_file": "core/dashboard/features.js", + "source_location": "L361" + }, + { + "id": "core_dashboard_features_f", + "label": "F()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "f()", + "source_file": "core/dashboard/features.js", + "source_location": "L40" + }, + { + "id": "core_dashboard_features_filled", + "label": "filled()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "filled()", + "source_file": "core/dashboard/features.js", + "source_location": "L21" + }, + { + "id": "core_dashboard_features_resolves", + "label": "resolves()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "resolves()", + "source_file": "core/dashboard/features.js", + "source_location": "L29" + }, + { + "id": "core_dashboard_features_statusof", + "label": "statusOf()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "statusof()", + "source_file": "core/dashboard/features.js", + "source_location": "L352" }, { "id": "core_i18n_allkeys", "label": "allKeys()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "allkeys()", "source_file": "core/i18n.js", "source_location": "L172" }, + { + "id": "core_i18n_defaultof", + "label": "defaultOf()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "defaultof()", + "source_file": "core/i18n.js", + "source_location": "L175" + }, + { + "id": "core_i18n_has", + "label": "has()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "has()", + "source_file": "core/i18n.js", + "source_location": "L137" + }, { "id": "core_i18n_interpolate", "label": "interpolate()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "interpolate()", @@ -5334,7 +5454,7 @@ "label": "languages()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "languages()", @@ -5346,7 +5466,7 @@ "label": "load()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "load()", @@ -5358,7 +5478,7 @@ "label": "readCatalogueFile()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "readcataloguefile()", @@ -5370,7 +5490,7 @@ "label": "reload()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "reload()", @@ -5382,7 +5502,7 @@ "label": "deepMerge()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "deepmerge()", @@ -5394,19 +5514,31 @@ "label": "describeParseError()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "describeparseerror()", "source_file": "core/jsonc.js", "source_location": "L92" }, + { + "id": "core_jsonc_getpath", + "label": "getPath()", + "_callable": true, + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "getpath()", + "source_file": "core/jsonc.js", + "source_location": "L167" + }, { "id": "core_jsonc_leafpaths", "label": "leafPaths()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "leafpaths()", @@ -5418,7 +5550,7 @@ "label": "parseJsonc()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "parsejsonc()", @@ -5430,13 +5562,73 @@ "label": "stripJsonComments()", "_callable": true, "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "stripjsoncomments()", "source_file": "core/jsonc.js", "source_location": "L23" }, + { + "id": "web_src_components_ui_scroll_area_scrollarea", + "label": "ScrollArea()", + "_callable": true, + "_origin": "ast", + "community": 60, + "community_name": "scroll-area.jsx", + "file_type": "code", + "norm_label": "scrollarea()", + "source_file": "web/src/components/ui/scroll-area.jsx", + "source_location": "L4" + }, + { + "id": "web_src_components_ui_scroll_area_scrollbar", + "label": "ScrollBar()", + "_callable": true, + "_origin": "ast", + "community": 60, + "community_name": "scroll-area.jsx", + "file_type": "code", + "norm_label": "scrollbar()", + "source_file": "web/src/components/ui/scroll-area.jsx", + "source_location": "L19" + }, + { + "id": "core_dashboard_permissions_resolvepermissions", + "label": "resolvePermissions()", + "_callable": true, + "_origin": "ast", + "community": 61, + "community_name": "resolvePermissions", + "file_type": "code", + "norm_label": "resolvepermissions()", + "source_file": "core/dashboard/permissions.js", + "source_location": "L78" + }, + { + "id": "core_dashboard_permissions_selectaccessrows", + "label": "selectAccessRows()", + "_callable": true, + "_origin": "ast", + "community": 61, + "community_name": "resolvePermissions", + "file_type": "code", + "norm_label": "selectaccessrows()", + "source_file": "core/dashboard/permissions.js", + "source_location": "L64" + }, + { + "id": "core_dashboard_server_startserver_loadpermissions", + "label": "loadPermissions()", + "_callable": true, + "_origin": "ast", + "community": 61, + "community_name": "resolvePermissions", + "file_type": "code", + "norm_label": "loadpermissions()", + "source_file": "core/dashboard/server.js", + "source_location": "L146" + }, { "id": "bots_minigames_commands_blackjack_buildbuttons", "label": "buildButtons()", @@ -5689,138 +5881,6 @@ "source_file": "core/dashboard/envFile.js", "source_location": "L22" }, - { - "id": "bots_minigames_commands_trivia_localquestion", - "label": "localQuestion()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "localquestion()", - "source_file": "bots/minigames/commands/trivia.js", - "source_location": "L21" - }, - { - "id": "core_dashboard_features_channelresolves", - "label": "channelResolves()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "channelresolves()", - "source_file": "core/dashboard/features.js", - "source_location": "L36" - }, - { - "id": "core_dashboard_features_describe", - "label": "describe()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "describe()", - "source_file": "core/dashboard/features.js", - "source_location": "L361" - }, - { - "id": "core_dashboard_features_f", - "label": "F()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "f()", - "source_file": "core/dashboard/features.js", - "source_location": "L40" - }, - { - "id": "core_dashboard_features_filled", - "label": "filled()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "filled()", - "source_file": "core/dashboard/features.js", - "source_location": "L21" - }, - { - "id": "core_dashboard_features_resolves", - "label": "resolves()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "resolves()", - "source_file": "core/dashboard/features.js", - "source_location": "L29" - }, - { - "id": "core_dashboard_features_statusof", - "label": "statusOf()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "statusof()", - "source_file": "core/dashboard/features.js", - "source_location": "L352" - }, - { - "id": "core_i18n_defaultof", - "label": "defaultOf()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "defaultof()", - "source_file": "core/i18n.js", - "source_location": "L175" - }, - { - "id": "core_i18n_has", - "label": "has()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "has()", - "source_file": "core/i18n.js", - "source_location": "L137" - }, - { - "id": "core_i18n_tdata", - "label": "tData()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "tdata()", - "source_file": "core/i18n.js", - "source_location": "L130" - }, - { - "id": "core_jsonc_getpath", - "label": "getPath()", - "_callable": true, - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "getpath()", - "source_file": "core/jsonc.js", - "source_location": "L167" - }, { "id": "core_messagecomposer_buildmessage", "label": "buildMessage()", @@ -5927,7 +5987,7 @@ "file_type": "code", "norm_label": "attach()", "source_file": "bots/commands/bot.js", - "source_location": "L20" + "source_location": "L21" }, { "id": "bots_commands_bot_buttonidfromcustomid", @@ -5939,7 +5999,7 @@ "file_type": "code", "norm_label": "buttonidfromcustomid()", "source_file": "bots/commands/bot.js", - "source_location": "L89" + "source_location": "L93" }, { "id": "bots_commands_bot_findrolebutton", @@ -5951,7 +6011,7 @@ "file_type": "code", "norm_label": "findrolebutton()", "source_file": "bots/commands/bot.js", - "source_location": "L97" + "source_location": "L101" }, { "id": "bots_commands_bot_handlepersistentbutton", @@ -5963,7 +6023,19 @@ "file_type": "code", "norm_label": "handlepersistentbutton()", "source_file": "bots/commands/bot.js", - "source_location": "L105" + "source_location": "L109" + }, + { + "id": "bots_commands_bot_handlesponsorverify", + "label": "handleSponsorVerify()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "handlesponsorverify()", + "source_file": "bots/commands/bot.js", + "source_location": "L154" }, { "id": "bots_commands_bot_handleverification", @@ -5975,7 +6047,7 @@ "file_type": "code", "norm_label": "handleverification()", "source_file": "bots/commands/bot.js", - "source_location": "L121" + "source_location": "L128" }, { "id": "bots_commands_bot_togglerole", @@ -5987,7 +6059,7 @@ "file_type": "code", "norm_label": "togglerole()", "source_file": "bots/commands/bot.js", - "source_location": "L142" + "source_location": "L179" }, { "id": "core_commandkit_enabled", @@ -6001,12 +6073,144 @@ "source_file": "core/commandKit.js", "source_location": "L99" }, + { + "id": "core_sponsor_buildlinktoken", + "label": "buildLinkToken()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "buildlinktoken()", + "source_file": "core/sponsor.js", + "source_location": "L50" + }, + { + "id": "core_sponsor_diffsponsorroles", + "label": "diffSponsorRoles()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "diffsponsorroles()", + "source_file": "core/sponsor.js", + "source_location": "L168" + }, + { + "id": "core_sponsor_fetchmembers", + "label": "fetchMembers()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "fetchmembers()", + "source_file": "core/sponsor.js", + "source_location": "L128" + }, + { + "id": "core_sponsor_linkfor", + "label": "linkFor()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "linkfor()", + "source_file": "core/sponsor.js", + "source_location": "L115" + }, + { + "id": "core_sponsor_msuntilhour", + "label": "msUntilHour()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "msuntilhour()", + "source_file": "core/sponsor.js", + "source_location": "L263" + }, + { + "id": "core_sponsor_normalizebaseurl", + "label": "normalizeBaseUrl()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "normalizebaseurl()", + "source_file": "core/sponsor.js", + "source_location": "L65" + }, + { + "id": "core_sponsor_runsync", + "label": "runSync()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "runsync()", + "source_file": "core/sponsor.js", + "source_location": "L196" + }, + { + "id": "core_sponsor_settings", + "label": "settings()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "settings()", + "source_file": "core/sponsor.js", + "source_location": "L89" + }, + { + "id": "core_sponsor_startsponsorsync", + "label": "startSponsorSync()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "startsponsorsync()", + "source_file": "core/sponsor.js", + "source_location": "L277" + }, + { + "id": "core_sponsor_starturl", + "label": "startUrl()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "starturl()", + "source_file": "core/sponsor.js", + "source_location": "L77" + }, + { + "id": "core_sponsor_stopsponsorsync", + "label": "stopSponsorSync()", + "_callable": true, + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "stopsponsorsync()", + "source_file": "core/sponsor.js", + "source_location": "L300" + }, { "id": "bots_minigames_commands_flipcoin", "label": "flipcoin.js", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "flipcoin.js", "source_file": "bots/minigames/commands/flipcoin.js", @@ -6017,7 +6221,7 @@ "label": "{ addPoints, pointsFor, notifyRewards }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ addpoints, pointsfor, notifyrewards }", "source_file": "bots/minigames/commands/flipcoin.js", @@ -6028,7 +6232,7 @@ "label": "{ applyMeta }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ applymeta }", "source_file": "bots/minigames/commands/flipcoin.js", @@ -6039,7 +6243,7 @@ "label": "{ gameFooter }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ gamefooter }", "source_file": "bots/minigames/commands/flipcoin.js", @@ -6050,7 +6254,7 @@ "label": "{ makeEmbed }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ makeembed }", "source_file": "bots/minigames/commands/flipcoin.js", @@ -6061,7 +6265,7 @@ "label": "{ SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ slashcommandbuilder, buttonbuilder, buttonstyle, actionrowbuilder }", "source_file": "bots/minigames/commands/flipcoin.js", @@ -6072,95 +6276,18 @@ "label": "{ t }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ t }", "source_file": "bots/minigames/commands/flipcoin.js", "source_location": "L6" }, - { - "id": "bots_minigames_commands_hangman", - "label": "hangman.js", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "hangman.js", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L1" - }, - { - "id": "bots_minigames_commands_hangman_addpoints_pointsfor_notifyrewards", - "label": "{ addPoints, pointsFor, notifyRewards }", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "{ addpoints, pointsfor, notifyrewards }", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L7" - }, - { - "id": "bots_minigames_commands_hangman_applymeta", - "label": "{ applyMeta }", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "{ applymeta }", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L5" - }, - { - "id": "bots_minigames_commands_hangman_gamefooter_gamecolor", - "label": "{ gameFooter, gameColor }", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "{ gamefooter, gamecolor }", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L6" - }, - { - "id": "bots_minigames_commands_hangman_slashcommandbuilder_buttonbuilder_buttonstyle_actionrowbuilder_embedbuilder_modalbuilder_textinputbuilder_textinputstyle_messageflags", - "label": "{\n SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder,\n ModalBuilder, TextInputBuilder, TextInputStyle, MessageFlags,\n}", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "{\n slashcommandbuilder, buttonbuilder, buttonstyle, actionrowbuilder, embedbuilder,\n modalbuilder, textinputbuilder, textinputstyle, messageflags,\n}", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L1" - }, - { - "id": "bots_minigames_commands_hangman_stages", - "label": "STAGES", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "stages", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L12" - }, - { - "id": "bots_minigames_commands_hangman_t_tlist", - "label": "{ t, tList }", - "_origin": "ast", - "community": 0, - "community_name": "hangman.js", - "file_type": "code", - "norm_label": "{ t, tlist }", - "source_file": "bots/minigames/commands/hangman.js", - "source_location": "L8" - }, { "id": "bots_minigames_commands_rps", "label": "rps.js", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "rps.js", "source_file": "bots/minigames/commands/rps.js", @@ -6171,7 +6298,7 @@ "label": "{ addPoints, pointsFor, notifyRewards }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ addpoints, pointsfor, notifyrewards }", "source_file": "bots/minigames/commands/rps.js", @@ -6182,7 +6309,7 @@ "label": "{ applyMeta }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ applymeta }", "source_file": "bots/minigames/commands/rps.js", @@ -6193,7 +6320,7 @@ "label": "CHOICES", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "choices", "source_file": "bots/minigames/commands/rps.js", @@ -6204,7 +6331,7 @@ "label": "{ gameFooter, gameColor }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ gamefooter, gamecolor }", "source_file": "bots/minigames/commands/rps.js", @@ -6215,7 +6342,7 @@ "label": "{ SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ slashcommandbuilder, buttonbuilder, buttonstyle, actionrowbuilder, embedbuilder }", "source_file": "bots/minigames/commands/rps.js", @@ -6226,7 +6353,7 @@ "label": "{ t }", "_origin": "ast", "community": 0, - "community_name": "hangman.js", + "community_name": "notifyRewards", "file_type": "code", "norm_label": "{ t }", "source_file": "bots/minigames/commands/rps.js", @@ -6622,7 +6749,7 @@ "label": "events/bot.js", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "events/bot.js", "source_file": "bots/events/bot.js", @@ -6633,7 +6760,7 @@ "label": "config", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "config", "source_file": "bots/events/bot.js", @@ -6644,7 +6771,7 @@ "label": "{ GatewayIntentBits, Partials, Events }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ gatewayintentbits, partials, events }", "source_file": "bots/events/bot.js", @@ -6655,7 +6782,7 @@ "label": "intents", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "intents", "source_file": "bots/events/bot.js", @@ -6666,7 +6793,7 @@ "label": "partials", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "partials", "source_file": "bots/events/bot.js", @@ -6677,62 +6804,117 @@ "label": "{ presenceOptions }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ presenceoptions }", "source_file": "bots/events/bot.js", "source_location": "L2" }, { - "id": "bots_events_handlers_messagehandler", - "label": "messageHandler.js", + "id": "bots_events_handlers_contextmenus", + "label": "contextMenus.js", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", - "norm_label": "messagehandler.js", - "source_file": "bots/events/handlers/messageHandler.js", + "norm_label": "contextmenus.js", + "source_file": "bots/events/handlers/contextMenus.js", "source_location": "L1" }, { - "id": "bots_events_handlers_messagehandler_config", + "id": "bots_events_handlers_contextmenus_config", "label": "config", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "config", - "source_file": "bots/events/handlers/messageHandler.js", - "source_location": "L3" + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L8" }, { - "id": "bots_events_handlers_messagehandler_makeembed", - "label": "{ makeEmbed }", + "id": "bots_events_handlers_contextmenus_contextmenucommandbuilder_applicationcommandtype_embedbuilder_modalbuilder_textinputbuilder_textinputstyle_actionrowbuilder_messageflags", + "label": "{\r\n ContextMenuCommandBuilder, ApplicationCommandType, EmbedBuilder, ModalBuilder,\r\n TextInputBuilder, TextInputStyle, ActionRowBuilder, MessageFlags,\r\n}", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", - "norm_label": "{ makeembed }", - "source_file": "bots/events/handlers/messageHandler.js", + "norm_label": "{\r\n contextmenucommandbuilder, applicationcommandtype, embedbuilder, modalbuilder,\r\n textinputbuilder, textinputstyle, actionrowbuilder, messageflags,\r\n}", + "source_file": "bots/events/handlers/contextMenus.js", "source_location": "L1" }, { - "id": "bots_events_handlers_messagehandler_t", - "label": "{ t }", + "id": "bots_events_handlers_contextmenus_guardmenu", + "label": "{ guardMenu }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", - "norm_label": "{ t }", - "source_file": "bots/events/handlers/messageHandler.js", - "source_location": "L2" + "norm_label": "{ guardmenu }", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L6" + }, + { + "id": "bots_events_handlers_contextmenus_handlers", + "label": "HANDLERS", + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "handlers", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L223" + }, + { + "id": "bots_events_handlers_contextmenus_menus", + "label": "MENUS", + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "menus", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L19" + }, + { + "id": "bots_events_handlers_contextmenus_names", + "label": "NAMES", + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "names", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L22" + }, + { + "id": "bots_events_handlers_contextmenus_nowstr", + "label": "{ nowStr }", + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "{ nowstr }", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L5" + }, + { + "id": "bots_events_handlers_contextmenus_t_raw", + "label": "{ t, raw }", + "_origin": "ast", + "community": 14, + "community_name": "contextMenus.js", + "file_type": "code", + "norm_label": "{ t, raw }", + "source_file": "bots/events/handlers/contextMenus.js", + "source_location": "L7" }, { "id": "bots_minigames_bot", "label": "minigames/bot.js", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "minigames/bot.js", "source_file": "bots/minigames/bot.js", @@ -6743,7 +6925,7 @@ "label": "{ Collection, GatewayIntentBits, Events, MessageFlags }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ collection, gatewayintentbits, events, messageflags }", "source_file": "bots/minigames/bot.js", @@ -6754,7 +6936,7 @@ "label": "config", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "config", "source_file": "bots/minigames/bot.js", @@ -6765,7 +6947,7 @@ "label": "intents", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "intents", "source_file": "bots/minigames/bot.js", @@ -6776,7 +6958,7 @@ "label": "{ join }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ join }", "source_file": "bots/minigames/bot.js", @@ -6787,7 +6969,7 @@ "label": "partials", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "partials", "source_file": "bots/minigames/bot.js", @@ -6798,7 +6980,7 @@ "label": "{ presenceOptions }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ presenceoptions }", "source_file": "bots/minigames/bot.js", @@ -6809,7 +6991,7 @@ "label": "{ readdirSync }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ readdirsync }", "source_file": "bots/minigames/bot.js", @@ -6820,7 +7002,7 @@ "label": "{ t }", "_origin": "ast", "community": 14, - "community_name": "minigames/bot.js", + "community_name": "contextMenus.js", "file_type": "code", "norm_label": "{ t }", "source_file": "bots/minigames/bot.js", @@ -7597,103 +7779,81 @@ "source_location": "L22" }, { - "id": "bots_events_handlers_contextmenus", - "label": "contextMenus.js", + "id": "bots_commands_commands_sponsor", + "label": "commands/sponsor.js", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "contextmenus.js", - "source_file": "bots/events/handlers/contextMenus.js", + "norm_label": "commands/sponsor.js", + "source_file": "bots/commands/commands/sponsor.js", "source_location": "L1" }, { - "id": "bots_events_handlers_contextmenus_config", - "label": "config", - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "config", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L8" - }, - { - "id": "bots_events_handlers_contextmenus_contextmenucommandbuilder_applicationcommandtype_embedbuilder_modalbuilder_textinputbuilder_textinputstyle_actionrowbuilder_messageflags", - "label": "{\r\n ContextMenuCommandBuilder, ApplicationCommandType, EmbedBuilder, ModalBuilder,\r\n TextInputBuilder, TextInputStyle, ActionRowBuilder, MessageFlags,\r\n}", - "_origin": "ast", - "community": 23, - "community_name": "contextMenus.js", - "file_type": "code", - "norm_label": "{\r\n contextmenucommandbuilder, applicationcommandtype, embedbuilder, modalbuilder,\r\n textinputbuilder, textinputstyle, actionrowbuilder, messageflags,\r\n}", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L1" - }, - { - "id": "bots_events_handlers_contextmenus_guardmenu", - "label": "{ guardMenu }", + "id": "bots_commands_commands_sponsor_applymeta_optiontext_guard", + "label": "{ applyMeta, optionText, guard }", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "{ guardmenu }", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L6" + "norm_label": "{ applymeta, optiontext, guard }", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L5" }, { - "id": "bots_events_handlers_contextmenus_handlers", - "label": "HANDLERS", + "id": "bots_commands_commands_sponsor_config", + "label": "config", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "handlers", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L223" + "norm_label": "config", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L7" }, { - "id": "bots_events_handlers_contextmenus_menus", - "label": "MENUS", + "id": "bots_commands_commands_sponsor_makeembed", + "label": "{ makeEmbed }", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "menus", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L19" + "norm_label": "{ makeembed }", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L4" }, { - "id": "bots_events_handlers_contextmenus_names", - "label": "NAMES", + "id": "bots_commands_commands_sponsor_slashcommandbuilder_buttonbuilder_buttonstyle_actionrowbuilder_messageflags", + "label": "{\n SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, MessageFlags,\n}", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "names", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L22" + "norm_label": "{\n slashcommandbuilder, buttonbuilder, buttonstyle, actionrowbuilder, messageflags,\n}", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L1" }, { - "id": "bots_events_handlers_contextmenus_nowstr", - "label": "{ nowStr }", + "id": "bots_commands_commands_sponsor_sponsor", + "label": "sponsor", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "{ nowstr }", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L5" + "norm_label": "sponsor", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L8" }, { - "id": "bots_events_handlers_contextmenus_t_raw", - "label": "{ t, raw }", + "id": "bots_commands_commands_sponsor_t", + "label": "{ t }", "_origin": "ast", "community": 23, - "community_name": "contextMenus.js", + "community_name": "commands/sponsor.js", "file_type": "code", - "norm_label": "{ t, raw }", - "source_file": "bots/events/handlers/contextMenus.js", - "source_location": "L7" + "norm_label": "{ t }", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L6" }, { "id": "bots_minigames_commands_tictactoe", @@ -7783,12 +7943,89 @@ "source_file": "bots/minigames/commands/tictactoe.js", "source_location": "L11" }, + { + "id": "core_dashboard_config", + "label": "dashboard/config.js", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "dashboard/config.js", + "source_file": "core/dashboard/config.js", + "source_location": "L1" + }, + { + "id": "core_dashboard_config_config", + "label": "config", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "config", + "source_file": "core/dashboard/config.js", + "source_location": "L26" + }, + { + "id": "core_dashboard_config_crypto", + "label": "crypto", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "crypto", + "source_file": "core/dashboard/config.js", + "source_location": "L24" + }, + { + "id": "core_dashboard_config_env_path", + "label": "ENV_PATH", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "env_path", + "source_file": "core/dashboard/config.js", + "source_location": "L29" + }, + { + "id": "core_dashboard_config_fs", + "label": "fs", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "fs", + "source_file": "core/dashboard/config.js", + "source_location": "L22" + }, + { + "id": "core_dashboard_config_path", + "label": "path", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "path", + "source_file": "core/dashboard/config.js", + "source_location": "L23" + }, + { + "id": "core_dashboard_config_setenvvalue", + "label": "{ setEnvValue }", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "{ setenvvalue }", + "source_file": "core/dashboard/config.js", + "source_location": "L27" + }, { "id": "core_dashboard_supervisor", "label": "supervisor.js", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "supervisor.js", "source_file": "core/dashboard/supervisor.js", @@ -7799,7 +8036,7 @@ "label": "BOT_ENTRY", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "bot_entry", "source_file": "core/dashboard/supervisor.js", @@ -7810,7 +8047,7 @@ "label": "config", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "config", "source_file": "core/dashboard/supervisor.js", @@ -7821,7 +8058,7 @@ "label": "ENV_PATH", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "env_path", "source_file": "core/dashboard/supervisor.js", @@ -7832,7 +8069,7 @@ "label": "EventEmitter", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "eventemitter", "source_file": "core/dashboard/supervisor.js", @@ -7843,7 +8080,7 @@ "label": "{ fork, spawn }", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "{ fork, spawn }", "source_file": "core/dashboard/supervisor.js", @@ -7854,7 +8091,7 @@ "label": "fs", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "fs", "source_file": "core/dashboard/supervisor.js", @@ -7865,12 +8102,45 @@ "label": "path", "_origin": "ast", "community": 25, - "community_name": "BotSupervisor", + "community_name": "dashboard/config.js", "file_type": "code", "norm_label": "path", "source_file": "core/dashboard/supervisor.js", "source_location": "L15" }, + { + "id": "dashboard", + "label": "dashboard.js", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "dashboard.js", + "source_file": "dashboard.js", + "source_location": "L1" + }, + { + "id": "dashboard_botsupervisor", + "label": "{ BotSupervisor }", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "{ botsupervisor }", + "source_file": "dashboard.js", + "source_location": "L16" + }, + { + "id": "dashboard_loaddashboardconfig_validatedashboardconfig_ensuresessionsecret", + "label": "{ loadDashboardConfig, validateDashboardConfig, ensureSessionSecret }", + "_origin": "ast", + "community": 25, + "community_name": "dashboard/config.js", + "file_type": "code", + "norm_label": "{ loaddashboardconfig, validatedashboardconfig, ensuresessionsecret }", + "source_file": "dashboard.js", + "source_location": "L15" + }, { "id": "core_dashboard_security", "label": "security.js", @@ -8157,61 +8427,6 @@ "source_file": "bots/minigames/commands/points.js", "source_location": "L5" }, - { - "id": "core_gamekit", - "label": "gameKit.js", - "_origin": "ast", - "community": 3, - "community_name": "pointsManager.js", - "file_type": "code", - "norm_label": "gamekit.js", - "source_file": "core/gameKit.js", - "source_location": "L1" - }, - { - "id": "core_gamekit_config", - "label": "config", - "_origin": "ast", - "community": 3, - "community_name": "pointsManager.js", - "file_type": "code", - "norm_label": "config", - "source_file": "core/gameKit.js", - "source_location": "L12" - }, - { - "id": "core_gamekit_fallback", - "label": "FALLBACK", - "_origin": "ast", - "community": 3, - "community_name": "pointsManager.js", - "file_type": "code", - "norm_label": "fallback", - "source_file": "core/gameKit.js", - "source_location": "L34" - }, - { - "id": "core_gamekit_pointsfooter", - "label": "{ pointsFooter }", - "_origin": "ast", - "community": 3, - "community_name": "pointsManager.js", - "file_type": "code", - "norm_label": "{ pointsfooter }", - "source_file": "core/gameKit.js", - "source_location": "L13" - }, - { - "id": "core_gamekit_t", - "label": "{ t }", - "_origin": "ast", - "community": 3, - "community_name": "pointsManager.js", - "file_type": "code", - "norm_label": "{ t }", - "source_file": "core/gameKit.js", - "source_location": "L11" - }, { "id": "core_pointsmanager", "label": "pointsManager.js", @@ -8553,17 +8768,6 @@ "source_file": "web/src/i18n.jsx", "source_location": "L23" }, - { - "id": "core_dashboard_config_env_path", - "label": "ENV_PATH", - "_origin": "ast", - "community": 33, - "community_name": "routes.js", - "file_type": "code", - "norm_label": "env_path", - "source_file": "core/dashboard/config.js", - "source_location": "L29" - }, { "id": "core_dashboard_permissions", "label": "permissions.js", @@ -9016,77 +9220,88 @@ "source_location": "L17" }, { - "id": "bots_minigames_commands_eightball", - "label": "eightball.js", + "id": "bots_minigames_commands_hangman", + "label": "hangman.js", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", - "norm_label": "eightball.js", - "source_file": "bots/minigames/commands/eightball.js", + "norm_label": "hangman.js", + "source_file": "bots/minigames/commands/hangman.js", "source_location": "L1" }, { - "id": "bots_minigames_commands_eightball_applymeta_optiontext", - "label": "{ applyMeta, optionText }", + "id": "bots_minigames_commands_hangman_addpoints_pointsfor_notifyrewards", + "label": "{ addPoints, pointsFor, notifyRewards }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", - "norm_label": "{ applymeta, optiontext }", - "source_file": "bots/minigames/commands/eightball.js", - "source_location": "L2" + "norm_label": "{ addpoints, pointsfor, notifyrewards }", + "source_file": "bots/minigames/commands/hangman.js", + "source_location": "L7" }, { - "id": "bots_minigames_commands_eightball_categories", - "label": "CATEGORIES", + "id": "bots_minigames_commands_hangman_applymeta", + "label": "{ applyMeta }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", - "norm_label": "categories", - "source_file": "bots/minigames/commands/eightball.js", - "source_location": "L11" + "norm_label": "{ applymeta }", + "source_file": "bots/minigames/commands/hangman.js", + "source_location": "L5" }, { - "id": "bots_minigames_commands_eightball_gamecolor", - "label": "{ gameColor }", + "id": "bots_minigames_commands_hangman_gamefooter_gamecolor", + "label": "{ gameFooter, gameColor }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", - "norm_label": "{ gamecolor }", - "source_file": "bots/minigames/commands/eightball.js", - "source_location": "L3" + "norm_label": "{ gamefooter, gamecolor }", + "source_file": "bots/minigames/commands/hangman.js", + "source_location": "L6" }, { - "id": "bots_minigames_commands_eightball_slashcommandbuilder_embedbuilder_messageflags", - "label": "{ SlashCommandBuilder, EmbedBuilder, MessageFlags }", + "id": "bots_minigames_commands_hangman_slashcommandbuilder_buttonbuilder_buttonstyle_actionrowbuilder_embedbuilder_modalbuilder_textinputbuilder_textinputstyle_messageflags", + "label": "{\n SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder,\n ModalBuilder, TextInputBuilder, TextInputStyle, MessageFlags,\n}", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", - "norm_label": "{ slashcommandbuilder, embedbuilder, messageflags }", - "source_file": "bots/minigames/commands/eightball.js", + "norm_label": "{\n slashcommandbuilder, buttonbuilder, buttonstyle, actionrowbuilder, embedbuilder,\n modalbuilder, textinputbuilder, textinputstyle, messageflags,\n}", + "source_file": "bots/minigames/commands/hangman.js", "source_location": "L1" }, { - "id": "bots_minigames_commands_eightball_t_tlist", + "id": "bots_minigames_commands_hangman_stages", + "label": "STAGES", + "_origin": "ast", + "community": 36, + "community_name": "hangman.js", + "file_type": "code", + "norm_label": "stages", + "source_file": "bots/minigames/commands/hangman.js", + "source_location": "L12" + }, + { + "id": "bots_minigames_commands_hangman_t_tlist", "label": "{ t, tList }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "{ t, tlist }", - "source_file": "bots/minigames/commands/eightball.js", - "source_location": "L4" + "source_file": "bots/minigames/commands/hangman.js", + "source_location": "L8" }, { "id": "bots_minigames_commands_wordle", "label": "wordle.js", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "wordle.js", "source_file": "bots/minigames/commands/wordle.js", @@ -9097,7 +9312,7 @@ "label": "{ addPoints, pointsFor, notifyRewards }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "{ addpoints, pointsfor, notifyrewards }", "source_file": "bots/minigames/commands/wordle.js", @@ -9108,7 +9323,7 @@ "label": "{ applyMeta }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "{ applymeta }", "source_file": "bots/minigames/commands/wordle.js", @@ -9119,7 +9334,7 @@ "label": "{ gameFooter, gameColor }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "{ gamefooter, gamecolor }", "source_file": "bots/minigames/commands/wordle.js", @@ -9130,7 +9345,7 @@ "label": "{\n SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder,\n ModalBuilder, TextInputBuilder, TextInputStyle, MessageFlags,\n}", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "{\n slashcommandbuilder, buttonbuilder, buttonstyle, actionrowbuilder, embedbuilder,\n modalbuilder, textinputbuilder, textinputstyle, messageflags,\n}", "source_file": "bots/minigames/commands/wordle.js", @@ -9141,7 +9356,7 @@ "label": "{ t, tList }", "_origin": "ast", "community": 36, - "community_name": "wordle.js", + "community_name": "hangman.js", "file_type": "code", "norm_label": "{ t, tlist }", "source_file": "bots/minigames/commands/wordle.js", @@ -9687,110 +9902,176 @@ "source_location": "L1" }, { - "id": "core_dashboard_config", - "label": "dashboard/config.js", + "id": "bots_minigames_commands_eightball", + "label": "eightball.js", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "dashboard/config.js", - "source_file": "core/dashboard/config.js", + "norm_label": "eightball.js", + "source_file": "bots/minigames/commands/eightball.js", "source_location": "L1" }, { - "id": "core_dashboard_config_config", - "label": "config", + "id": "bots_minigames_commands_eightball_applymeta_optiontext", + "label": "{ applyMeta, optionText }", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "config", - "source_file": "core/dashboard/config.js", - "source_location": "L26" + "norm_label": "{ applymeta, optiontext }", + "source_file": "bots/minigames/commands/eightball.js", + "source_location": "L2" }, { - "id": "core_dashboard_config_crypto", - "label": "crypto", + "id": "bots_minigames_commands_eightball_categories", + "label": "CATEGORIES", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "crypto", - "source_file": "core/dashboard/config.js", - "source_location": "L24" + "norm_label": "categories", + "source_file": "bots/minigames/commands/eightball.js", + "source_location": "L11" }, { - "id": "core_dashboard_config_fs", - "label": "fs", + "id": "bots_minigames_commands_eightball_gamecolor", + "label": "{ gameColor }", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "fs", - "source_file": "core/dashboard/config.js", - "source_location": "L22" + "norm_label": "{ gamecolor }", + "source_file": "bots/minigames/commands/eightball.js", + "source_location": "L3" }, { - "id": "core_dashboard_config_path", - "label": "path", + "id": "bots_minigames_commands_eightball_slashcommandbuilder_embedbuilder_messageflags", + "label": "{ SlashCommandBuilder, EmbedBuilder, MessageFlags }", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "path", - "source_file": "core/dashboard/config.js", - "source_location": "L23" + "norm_label": "{ slashcommandbuilder, embedbuilder, messageflags }", + "source_file": "bots/minigames/commands/eightball.js", + "source_location": "L1" }, { - "id": "core_dashboard_config_setenvvalue", - "label": "{ setEnvValue }", + "id": "bots_minigames_commands_eightball_t_tlist", + "label": "{ t, tList }", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "{ setenvvalue }", - "source_file": "core/dashboard/config.js", - "source_location": "L27" + "norm_label": "{ t, tlist }", + "source_file": "bots/minigames/commands/eightball.js", + "source_location": "L4" }, { - "id": "dashboard", - "label": "dashboard.js", + "id": "core_gamekit", + "label": "gameKit.js", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "dashboard.js", - "source_file": "dashboard.js", + "norm_label": "gamekit.js", + "source_file": "core/gameKit.js", "source_location": "L1" }, { - "id": "dashboard_botsupervisor", - "label": "{ BotSupervisor }", + "id": "core_gamekit_config", + "label": "config", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "{ botsupervisor }", - "source_file": "dashboard.js", - "source_location": "L16" + "norm_label": "config", + "source_file": "core/gameKit.js", + "source_location": "L12" }, { - "id": "dashboard_loaddashboardconfig_validatedashboardconfig_ensuresessionsecret", - "label": "{ loadDashboardConfig, validateDashboardConfig, ensureSessionSecret }", + "id": "core_gamekit_fallback", + "label": "FALLBACK", "_origin": "ast", "community": 43, - "community_name": "dashboard/config.js", + "community_name": "gameKit.js", "file_type": "code", - "norm_label": "{ loaddashboardconfig, validatedashboardconfig, ensuresessionsecret }", - "source_file": "dashboard.js", - "source_location": "L15" + "norm_label": "fallback", + "source_file": "core/gameKit.js", + "source_location": "L34" + }, + { + "id": "core_gamekit_pointsfooter", + "label": "{ pointsFooter }", + "_origin": "ast", + "community": 43, + "community_name": "gameKit.js", + "file_type": "code", + "norm_label": "{ pointsfooter }", + "source_file": "core/gameKit.js", + "source_location": "L13" + }, + { + "id": "core_gamekit_t", + "label": "{ t }", + "_origin": "ast", + "community": 43, + "community_name": "gameKit.js", + "file_type": "code", + "norm_label": "{ t }", + "source_file": "core/gameKit.js", + "source_location": "L11" + }, + { + "id": "bots_events_handlers_messagehandler", + "label": "messageHandler.js", + "_origin": "ast", + "community": 44, + "community_name": "messageHandler.js", + "file_type": "code", + "norm_label": "messagehandler.js", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L1" + }, + { + "id": "bots_events_handlers_messagehandler_config", + "label": "config", + "_origin": "ast", + "community": 44, + "community_name": "messageHandler.js", + "file_type": "code", + "norm_label": "config", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L3" + }, + { + "id": "bots_events_handlers_messagehandler_makeembed", + "label": "{ makeEmbed }", + "_origin": "ast", + "community": 44, + "community_name": "messageHandler.js", + "file_type": "code", + "norm_label": "{ makeembed }", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L1" + }, + { + "id": "bots_events_handlers_messagehandler_t", + "label": "{ t }", + "_origin": "ast", + "community": 44, + "community_name": "messageHandler.js", + "file_type": "code", + "norm_label": "{ t }", + "source_file": "bots/events/handlers/messageHandler.js", + "source_location": "L2" }, { "id": "bots_commands_commands_utility", "label": "utility.js", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "utility.js", "source_file": "bots/commands/commands/utility.js", @@ -9800,8 +10081,8 @@ "id": "bots_commands_commands_utility_applymeta_optiontext_guard", "label": "{ applyMeta, optionText, guard }", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "{ applymeta, optiontext, guard }", "source_file": "bots/commands/commands/utility.js", @@ -9811,8 +10092,8 @@ "id": "bots_commands_commands_utility_config", "label": "config", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "config", "source_file": "bots/commands/commands/utility.js", @@ -9822,8 +10103,8 @@ "id": "bots_commands_commands_utility_getpoints", "label": "{ getPoints }", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "{ getpoints }", "source_file": "bots/commands/commands/utility.js", @@ -9833,8 +10114,8 @@ "id": "bots_commands_commands_utility_makeembed_datetimestr", "label": "{ makeEmbed, dateTimeStr }", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "{ makeembed, datetimestr }", "source_file": "bots/commands/commands/utility.js", @@ -9844,8 +10125,8 @@ "id": "bots_commands_commands_utility_slashcommandbuilder_messageflags", "label": "{ SlashCommandBuilder, MessageFlags }", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "{ slashcommandbuilder, messageflags }", "source_file": "bots/commands/commands/utility.js", @@ -9855,8 +10136,8 @@ "id": "bots_commands_commands_utility_t", "label": "{ t }", "_origin": "ast", - "community": 44, - "community_name": "utility.js", + "community": 45, + "community_name": "core/utils.js", "file_type": "code", "norm_label": "{ t }", "source_file": "bots/commands/commands/utility.js", @@ -10179,7 +10460,7 @@ "file_type": "code", "norm_label": "client", "source_file": "test/harness.js", - "source_location": "L201" + "source_location": "L213" }, { "id": "test_harness_commands", @@ -10190,7 +10471,7 @@ "file_type": "code", "norm_label": "commands", "source_file": "test/harness.js", - "source_location": "L208" + "source_location": "L220" }, { "id": "test_harness_config", @@ -10201,7 +10482,7 @@ "file_type": "code", "norm_label": "config", "source_file": "test/harness.js", - "source_location": "L174" + "source_location": "L186" }, { "id": "test_harness_eventemitter", @@ -10234,7 +10515,7 @@ "file_type": "code", "norm_label": "failures", "source_file": "test/harness.js", - "source_location": "L93" + "source_location": "L105" }, { "id": "test_harness_fixture", @@ -10256,7 +10537,7 @@ "file_type": "code", "norm_label": "fixture_path", "source_file": "test/harness.js", - "source_location": "L81" + "source_location": "L86" }, { "id": "test_harness_fs", @@ -10278,7 +10559,7 @@ "file_type": "code", "norm_label": "generated", "source_file": "test/harness.js", - "source_location": "L112" + "source_location": "L124" }, { "id": "test_harness_i18n", @@ -10289,7 +10570,7 @@ "file_type": "code", "norm_label": "i18n", "source_file": "test/harness.js", - "source_location": "L175" + "source_location": "L187" }, { "id": "test_harness_intentset", @@ -10300,7 +10581,7 @@ "file_type": "code", "norm_label": "intentset", "source_file": "test/harness.js", - "source_location": "L184" + "source_location": "L196" }, { "id": "test_harness_os", @@ -10322,7 +10603,7 @@ "file_type": "code", "norm_label": "partialset", "source_file": "test/harness.js", - "source_location": "L184" + "source_location": "L196" }, { "id": "test_harness_path", @@ -10344,7 +10625,7 @@ "file_type": "code", "norm_label": "registry", "source_file": "test/harness.js", - "source_location": "L209" + "source_location": "L221" }, { "id": "web_src_components_ui_card", @@ -10604,7 +10885,7 @@ "label": "configFile.js", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "configfile.js", "source_file": "core/dashboard/configFile.js", @@ -10615,7 +10896,7 @@ "label": "config", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "config", "source_file": "core/dashboard/configFile.js", @@ -10626,7 +10907,7 @@ "label": "fs", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "fs", "source_file": "core/dashboard/configFile.js", @@ -10637,7 +10918,7 @@ "label": "i18n", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "i18n", "source_file": "core/dashboard/configFile.js", @@ -10648,7 +10929,7 @@ "label": "{ parseJsonc, deepMerge, getPath }", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "{ parsejsonc, deepmerge, getpath }", "source_file": "core/dashboard/configFile.js", @@ -10659,7 +10940,7 @@ "label": "path", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "path", "source_file": "core/dashboard/configFile.js", @@ -10670,28 +10951,50 @@ "label": "TEXTS_EXAMPLE_PATH", "_origin": "ast", "community": 6, - "community_name": "configFile.js", + "community_name": "i18n.js", "file_type": "code", "norm_label": "texts_example_path", "source_file": "core/dashboard/configFile.js", "source_location": "L29" }, { - "id": "web_src_components_ui_scroll_area", - "label": "scroll-area.jsx", + "id": "core_dashboard_features", + "label": "features.js", "_origin": "ast", - "community": 60, - "community_name": "scroll-area.jsx", + "community": 6, + "community_name": "i18n.js", "file_type": "code", - "norm_label": "scroll-area.jsx", - "source_file": "web/src/components/ui/scroll-area.jsx", + "norm_label": "features.js", + "source_file": "core/dashboard/features.js", "source_location": "L1" }, + { + "id": "core_dashboard_features_features", + "label": "FEATURES", + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "features", + "source_file": "core/dashboard/features.js", + "source_location": "L48" + }, + { + "id": "core_dashboard_features_getpath", + "label": "{ getPath }", + "_origin": "ast", + "community": 6, + "community_name": "i18n.js", + "file_type": "code", + "norm_label": "{ getpath }", + "source_file": "core/dashboard/features.js", + "source_location": "L16" + }, { "id": "core_i18n", "label": "i18n.js", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "i18n.js", @@ -10702,7 +11005,7 @@ "id": "core_i18n_basecatalogue", "label": "baseCatalogue", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "basecatalogue", @@ -10713,7 +11016,7 @@ "id": "core_i18n_catalogue", "label": "catalogue", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "catalogue", @@ -10724,7 +11027,7 @@ "id": "core_i18n_config", "label": "config", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "config", @@ -10735,7 +11038,7 @@ "id": "core_i18n_existssync_readfilesync_readdirsync", "label": "{ existsSync, readFileSync, readdirSync }", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "{ existssync, readfilesync, readdirsync }", @@ -10746,7 +11049,7 @@ "id": "core_i18n_join", "label": "{ join }", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "{ join }", @@ -10757,7 +11060,7 @@ "id": "core_i18n_missingkeys", "label": "missingKeys", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "missingkeys", @@ -10768,7 +11071,7 @@ "id": "core_i18n_parsejsonc_deepmerge_getpath_leafpaths", "label": "{ parseJsonc, deepMerge, getPath, leafPaths }", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "{ parsejsonc, deepmerge, getpath, leafpaths }", @@ -10779,7 +11082,7 @@ "id": "core_i18n_problems", "label": "problems", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "problems", @@ -10790,13 +11093,24 @@ "id": "core_jsonc", "label": "jsonc.js", "_origin": "ast", - "community": 61, + "community": 6, "community_name": "i18n.js", "file_type": "code", "norm_label": "jsonc.js", "source_file": "core/jsonc.js", "source_location": "L1" }, + { + "id": "web_src_components_ui_scroll_area", + "label": "scroll-area.jsx", + "_origin": "ast", + "community": 60, + "community_name": "scroll-area.jsx", + "file_type": "code", + "norm_label": "scroll-area.jsx", + "source_file": "web/src/components/ui/scroll-area.jsx", + "source_location": "L1" + }, { "id": "web_package_dependencies_fontsource_syne", "label": "@fontsource/syne", @@ -11589,39 +11903,6 @@ "source_file": "web/package.json", "source_location": "L13" }, - { - "id": "core_dashboard_features", - "label": "features.js", - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "features.js", - "source_file": "core/dashboard/features.js", - "source_location": "L1" - }, - { - "id": "core_dashboard_features_features", - "label": "FEATURES", - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "features", - "source_file": "core/dashboard/features.js", - "source_location": "L48" - }, - { - "id": "core_dashboard_features_getpath", - "label": "{ getPath }", - "_origin": "ast", - "community": 83, - "community_name": "getPath", - "file_type": "code", - "norm_label": "{ getpath }", - "source_file": "core/dashboard/features.js", - "source_location": "L16" - }, { "id": "core_messagecomposer", "label": "messageComposer.js", @@ -11763,7 +12044,7 @@ "file_type": "code", "norm_label": "intents", "source_file": "bots/commands/bot.js", - "source_location": "L11" + "source_location": "L12" }, { "id": "bots_commands_bot_join", @@ -11785,7 +12066,7 @@ "file_type": "code", "norm_label": "legacy_prefixes", "source_file": "bots/commands/bot.js", - "source_location": "L87" + "source_location": "L91" }, { "id": "bots_commands_bot_partials", @@ -11796,7 +12077,7 @@ "file_type": "code", "norm_label": "partials", "source_file": "bots/commands/bot.js", - "source_location": "L18" + "source_location": "L19" }, { "id": "bots_commands_bot_readdirsync", @@ -11809,6 +12090,17 @@ "source_file": "bots/commands/bot.js", "source_location": "L5" }, + { + "id": "bots_commands_bot_sponsor", + "label": "sponsor", + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "sponsor", + "source_file": "bots/commands/bot.js", + "source_location": "L10" + }, { "id": "bots_commands_bot_t", "label": "{ t }", @@ -11820,6 +12112,61 @@ "source_file": "bots/commands/bot.js", "source_location": "L8" }, + { + "id": "core_sponsor", + "label": "core/sponsor.js", + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "core/sponsor.js", + "source_file": "core/sponsor.js", + "source_location": "L1" + }, + { + "id": "core_sponsor_config", + "label": "config", + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "config", + "source_file": "core/sponsor.js", + "source_location": "L23" + }, + { + "id": "core_sponsor_createhmac_randombytes", + "label": "{ createHmac, randomBytes }", + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "{ createhmac, randombytes }", + "source_file": "core/sponsor.js", + "source_location": "L22" + }, + { + "id": "core_sponsor_t", + "label": "{ t }", + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "{ t }", + "source_file": "core/sponsor.js", + "source_location": "L24" + }, + { + "id": "core_sponsor_timers", + "label": "timers", + "_origin": "ast", + "community": 9, + "community_name": "commands/bot.js", + "file_type": "code", + "norm_label": "timers", + "source_file": "core/sponsor.js", + "source_location": "L270" + }, { "id": "code_of_conduct_enforcement_ladder", "label": "Community Impact Enforcement Ladder", @@ -12070,7 +12417,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L36", + "source_location": "L37", "weight": 1.0 }, { @@ -12082,7 +12429,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L59", + "source_location": "L63", "weight": 1.0 }, { @@ -12094,7 +12441,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L68", + "source_location": "L72", "weight": 1.0 }, { @@ -12106,7 +12453,19 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L110", + "source_location": "L114", + "weight": 1.0 + }, + { + "source": "bots_commands_bot_handlepersistentbutton", + "target": "bots_commands_bot_handlesponsorverify", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/bot.js", + "source_location": "L117", "weight": 1.0 }, { @@ -12118,7 +12477,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L112", + "source_location": "L119", "weight": 1.0 }, { @@ -12130,7 +12489,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L115", + "source_location": "L122", "weight": 1.0 }, { @@ -12142,7 +12501,19 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L118", + "source_location": "L125", + "weight": 1.0 + }, + { + "source": "bots_commands_bot_handlesponsorverify", + "target": "core_i18n_t", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/bot.js", + "source_location": "L158", "weight": 1.0 }, { @@ -12154,7 +12525,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L127", + "source_location": "L134", "weight": 1.0 }, { @@ -12166,7 +12537,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "bots/commands/bot.js", - "source_location": "L147", + "source_location": "L184", "weight": 1.0 }, { @@ -12529,6 +12900,102 @@ "source_location": "L63", "weight": 1.0 }, + { + "source": "bots_commands_commands_sponsor_execute", + "target": "core_commandkit_guard", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L84", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_execute", + "target": "bots_commands_commands_sponsor_sync", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L86", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_execute", + "target": "bots_commands_commands_sponsor_post", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L87", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_panel", + "target": "core_utils_makeembed", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L22", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_panel", + "target": "core_i18n_t", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L23", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_post", + "target": "core_i18n_t", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L52", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_post", + "target": "bots_commands_commands_sponsor_panel", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L54", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor_sync", + "target": "core_i18n_t", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L62", + "weight": 1.0 + }, { "source": "bots_commands_commands_support_builddata", "target": "bots_commands_commands_support_guides", @@ -15958,7 +16425,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L198", + "source_location": "L207", "weight": 1.0 }, { @@ -15970,7 +16437,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L187", + "source_location": "L196", "weight": 1.0 }, { @@ -15982,7 +16449,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L165", + "source_location": "L174", "weight": 1.0 }, { @@ -15994,7 +16461,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L214", + "source_location": "L223", "weight": 1.0 }, { @@ -16006,7 +16473,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L227", + "source_location": "L236", "weight": 1.0 }, { @@ -16018,7 +16485,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L231", + "source_location": "L240", "weight": 1.0 }, { @@ -16030,7 +16497,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L189", + "source_location": "L198", "weight": 1.0 }, { @@ -16042,7 +16509,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L189", + "source_location": "L198", "weight": 1.0 }, { @@ -16054,7 +16521,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L244", + "source_location": "L253", "weight": 1.0 }, { @@ -16066,7 +16533,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L248", + "source_location": "L257", "weight": 1.0 }, { @@ -16090,7 +16557,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L117", + "source_location": "L126", "weight": 1.0 }, { @@ -16102,7 +16569,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L119", + "source_location": "L128", "weight": 1.0 }, { @@ -16150,7 +16617,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L318", + "source_location": "L340", "weight": 1.0 }, { @@ -16162,7 +16629,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L265", + "source_location": "L274", "weight": 1.0 }, { @@ -16174,7 +16641,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L265", + "source_location": "L274", "weight": 1.0 }, { @@ -16186,7 +16653,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L265", + "source_location": "L274", "weight": 1.0 }, { @@ -16198,12 +16665,12 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L271", + "source_location": "L280", "weight": 1.0 }, { "source": "core_config_report", - "target": "core_config_guildid", + "target": "core_config_sponsorsecrets", "relation": "calls", "_origin": "ast", "confidence": "EXTRACTED", @@ -16213,6 +16680,18 @@ "source_location": "L299", "weight": 1.0 }, + { + "source": "core_config_report", + "target": "core_config_guildid", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/config.js", + "source_location": "L321", + "weight": 1.0 + }, { "source": "core_config_report", "target": "core_config_hasuserconfig", @@ -16222,7 +16701,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L305", + "source_location": "L327", "weight": 1.0 }, { @@ -16234,7 +16713,19 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L145", + "source_location": "L154", + "weight": 1.0 + }, + { + "source": "core_config_sponsorsecrets", + "target": "core_config_env", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/config.js", + "source_location": "L108", "weight": 1.0 }, { @@ -16246,7 +16737,7 @@ "confidence_score": 1.0, "context": "call", "source_file": "core/config.js", - "source_location": "L188", + "source_location": "L197", "weight": 1.0 }, { @@ -18181,6 +18672,150 @@ "source_location": "L204", "weight": 1.0 }, + { + "source": "core_sponsor_linkfor", + "target": "core_sponsor_settings", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L116", + "weight": 1.0 + }, + { + "source": "core_sponsor_linkfor", + "target": "core_sponsor_buildlinktoken", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L118", + "weight": 1.0 + }, + { + "source": "core_sponsor_linkfor", + "target": "core_sponsor_starturl", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L118", + "weight": 1.0 + }, + { + "source": "core_sponsor_runsync", + "target": "core_sponsor_settings", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L200", + "weight": 1.0 + }, + { + "source": "core_sponsor_runsync", + "target": "core_sponsor_fetchmembers", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L205", + "weight": 1.0 + }, + { + "source": "core_sponsor_runsync", + "target": "core_sponsor_diffsponsorroles", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L236", + "weight": 1.0 + }, + { + "source": "core_sponsor_runsync", + "target": "core_i18n_t", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L240", + "weight": 1.0 + }, + { + "source": "core_sponsor_settings", + "target": "core_sponsor_normalizebaseurl", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L97", + "weight": 1.0 + }, + { + "source": "core_sponsor_startsponsorsync", + "target": "core_sponsor_settings", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L278", + "weight": 1.0 + }, + { + "source": "core_sponsor_startsponsorsync", + "target": "core_sponsor_stopsponsorsync", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L285", + "weight": 1.0 + }, + { + "source": "core_sponsor_startsponsorsync", + "target": "core_sponsor_runsync", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L286", + "weight": 1.0 + }, + { + "source": "core_sponsor_startsponsorsync", + "target": "core_sponsor_msuntilhour", + "relation": "calls", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "call", + "source_file": "core/sponsor.js", + "source_location": "L288", + "weight": 1.0 + }, { "source": "core_utils_allowedbyroles", "target": "core_utils_hasanyrole", @@ -19345,6 +19980,66 @@ "source_location": "L6", "weight": 1.0 }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_utils_makeembed", + "relation": "imports", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L4", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_commandkit_applymeta", + "relation": "imports", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L5", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_commandkit_guard", + "relation": "imports", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L5", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_commandkit_optiontext", + "relation": "imports", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L5", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_i18n_t", + "relation": "imports", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L6", + "weight": 1.0 + }, { "source": "bots_commands_commands_support", "target": "core_utils_linkrow", @@ -21145,6 +21840,18 @@ "source_location": "L28", "weight": 1.0 }, + { + "source": "core_sponsor", + "target": "core_i18n_t", + "relation": "imports", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "core/sponsor.js", + "source_location": "L24", + "weight": 1.0 + }, { "source": "dashboard", "target": "core_dashboard_config_ensuresessionsecret", @@ -22309,6 +23016,18 @@ "source_location": "L5", "weight": 1.0 }, + { + "source": "bots_commands_bot", + "target": "core_sponsor", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/bot.js", + "source_location": "L10", + "weight": 1.0 + }, { "source": "bots_commands_bot", "target": "core_commandkit", @@ -22501,6 +23220,66 @@ "source_location": "L7", "weight": 1.0 }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_utils", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L4", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_commandkit", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L5", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_i18n", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L6", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_config", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L7", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "core_sponsor", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L8", + "weight": 1.0 + }, { "source": "bots_commands_commands_support", "target": "core_utils", @@ -23977,6 +24756,30 @@ "source_location": "L29", "weight": 1.0 }, + { + "source": "core_sponsor", + "target": "core_config", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "core/sponsor.js", + "source_location": "L23", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_i18n", + "relation": "imports_from", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "context": "import", + "source_file": "core/sponsor.js", + "source_location": "L24", + "weight": 1.0 + }, { "source": "core_utils", "target": "core_config", @@ -24564,6 +25367,28 @@ "source_location": "L1", "weight": 1.0 }, + { + "source": "bots_commands_bot", + "target": "bots_commands_bot_sponsor", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/bot.js", + "source_location": "L10", + "weight": 1.0 + }, + { + "source": "bots_commands_bot", + "target": "bots_commands_bot_findrolebutton", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/bot.js", + "source_location": "L101", + "weight": 1.0 + }, { "source": "bots_commands_bot", "target": "bots_commands_bot_handlepersistentbutton", @@ -24572,7 +25397,7 @@ "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L105", + "source_location": "L109", "weight": 1.0 }, { @@ -24583,7 +25408,7 @@ "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L11", + "source_location": "L12", "weight": 1.0 }, { @@ -24594,7 +25419,18 @@ "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L121", + "source_location": "L128", + "weight": 1.0 + }, + { + "source": "bots_commands_bot", + "target": "bots_commands_bot_handlesponsorverify", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/bot.js", + "source_location": "L154", "weight": 1.0 }, { @@ -24605,7 +25441,7 @@ "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L142", + "source_location": "L179", "weight": 1.0 }, { @@ -24616,7 +25452,7 @@ "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L18", + "source_location": "L19", "weight": 1.0 }, { @@ -24665,46 +25501,35 @@ }, { "source": "bots_commands_bot", - "target": "bots_commands_bot_legacy_prefixes", - "relation": "contains", - "_origin": "ast", - "confidence": "EXTRACTED", - "confidence_score": 1.0, - "source_file": "bots/commands/bot.js", - "source_location": "L87", - "weight": 1.0 - }, - { - "source": "bots_commands_bot", - "target": "bots_commands_bot_buttonidfromcustomid", + "target": "bots_commands_bot_config", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L89", + "source_location": "L9", "weight": 1.0 }, { "source": "bots_commands_bot", - "target": "bots_commands_bot_config", + "target": "bots_commands_bot_legacy_prefixes", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L9", + "source_location": "L91", "weight": 1.0 }, { "source": "bots_commands_bot", - "target": "bots_commands_bot_findrolebutton", + "target": "bots_commands_bot_buttonidfromcustomid", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "bots/commands/bot.js", - "source_location": "L97", + "source_location": "L93", "weight": 1.0 }, { @@ -25081,6 +25906,116 @@ "source_location": "L9", "weight": 1.0 }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_slashcommandbuilder_buttonbuilder_buttonstyle_actionrowbuilder_messageflags", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L1", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_panel", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L20", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_makeembed", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L4", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_post", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L48", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_applymeta_optiontext_guard", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L5", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_sync", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L58", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_t", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L6", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_config", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L7", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_sponsor", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L8", + "weight": 1.0 + }, + { + "source": "bots_commands_commands_sponsor", + "target": "bots_commands_commands_sponsor_execute", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "bots/commands/commands/sponsor.js", + "source_location": "L83", + "weight": 1.0 + }, { "source": "bots_commands_commands_support", "target": "bots_commands_commands_support_slashcommandbuilder_messageflags", @@ -28744,6 +29679,50 @@ "source_location": "L31", "weight": 1.0 }, + { + "source": "core_sponsor", + "target": "core_sponsor_createhmac_randombytes", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "core/sponsor.js", + "source_location": "L22", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_config", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "core/sponsor.js", + "source_location": "L23", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_t", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "core/sponsor.js", + "source_location": "L24", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_timers", + "relation": "contains", + "_origin": "ast", + "confidence": "EXTRACTED", + "confidence_score": 1.0, + "source_file": "core/sponsor.js", + "source_location": "L270", + "weight": 1.0 + }, { "source": "core_utils", "target": "core_utils_embedbuilder_buttonbuilder_buttonstyle_actionrowbuilder_activitytype", @@ -29670,7 +30649,7 @@ }, { "source": "test_harness", - "target": "test_harness_section", + "target": "test_harness_req", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", @@ -29681,310 +30660,310 @@ }, { "source": "test_harness", - "target": "test_harness_generated", + "target": "test_harness_failures", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L112", + "source_location": "L105", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_trackedsources", + "target": "test_harness_check", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L113", + "source_location": "L106", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_stripcomments", + "target": "test_harness_acheck", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L125", + "source_location": "L110", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_v", + "target": "test_harness_section", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L131", + "source_location": "L114", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_config", + "target": "test_harness_generated", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L174", + "source_location": "L124", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_i18n", + "target": "test_harness_trackedsources", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L175", + "source_location": "L125", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_intentset", + "target": "test_harness_stripcomments", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L184", + "source_location": "L137", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_partialset", + "target": "test_harness_v", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L184", + "source_location": "L143", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_client", + "target": "test_harness_config", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L201", + "source_location": "L186", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_commands", + "target": "test_harness_i18n", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L208", + "source_location": "L187", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_registry", + "target": "test_harness_intentset", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L209", + "source_location": "L196", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_mockinteraction", + "target": "test_harness_partialset", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L255", + "source_location": "L196", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_eventemitter", + "target": "test_harness_client", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L27", + "source_location": "L213", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_execsync", + "target": "test_harness_commands", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L28", + "source_location": "L220", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_assert", + "target": "test_harness_registry", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L29", + "source_location": "L221", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_path", + "target": "test_harness_mockinteraction", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L30", + "source_location": "L267", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_lasttext", + "target": "test_harness_eventemitter", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L308", + "source_location": "L27", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_fs", + "target": "test_harness_execsync", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L31", + "source_location": "L28", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_dispatch", + "target": "test_harness_assert", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L318", + "source_location": "L29", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_os", + "target": "test_harness_path", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L32", + "source_location": "L30", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_nameof", + "target": "test_harness_fs", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L324", + "source_location": "L31", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_fake", + "target": "test_harness_os", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L47", + "source_location": "L32", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_fixture", + "target": "test_harness_lasttext", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L49", + "source_location": "L321", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_fixture_path", + "target": "test_harness_dispatch", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L81", + "source_location": "L331", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_req", + "target": "test_harness_nameof", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L90", + "source_location": "L337", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_failures", + "target": "test_harness_fake", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L93", + "source_location": "L47", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_check", + "target": "test_harness_fixture", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L94", + "source_location": "L49", "weight": 1.0 }, { "source": "test_harness", - "target": "test_harness_acheck", + "target": "test_harness_fixture_path", "relation": "contains", "_origin": "ast", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "test/harness.js", - "source_location": "L98", + "source_location": "L86", "weight": 1.0 }, { @@ -32370,7 +33349,7 @@ "confidence_score": 0.85, "context": "argument", "source_file": "core/config.js", - "source_location": "L152", + "source_location": "L161", "weight": 1.0 }, { @@ -32454,7 +33433,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "bots/commands/bot.js", - "source_location": "L187", + "source_location": "L224", "weight": 1.0 }, { @@ -32886,7 +33865,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L325", + "source_location": "L347", "weight": 1.0 }, { @@ -32898,7 +33877,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L325", + "source_location": "L347", "weight": 1.0 }, { @@ -32910,7 +33889,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L325", + "source_location": "L347", "weight": 1.0 }, { @@ -32922,7 +33901,19 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L325", + "source_location": "L347", + "weight": 1.0 + }, + { + "source": "core_config", + "target": "core_config_sponsorsecrets", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/config.js", + "source_location": "L349", "weight": 1.0 }, { @@ -32934,7 +33925,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L328", + "source_location": "L350", "weight": 1.0 }, { @@ -32946,7 +33937,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L328", + "source_location": "L350", "weight": 1.0 }, { @@ -32958,7 +33949,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L328", + "source_location": "L350", "weight": 1.0 }, { @@ -32970,7 +33961,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L328", + "source_location": "L350", "weight": 1.0 }, { @@ -32982,7 +33973,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L329", + "source_location": "L351", "weight": 1.0 }, { @@ -32994,7 +33985,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L329", + "source_location": "L351", "weight": 1.0 }, { @@ -33006,7 +33997,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L329", + "source_location": "L351", "weight": 1.0 }, { @@ -33018,7 +34009,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L329", + "source_location": "L351", "weight": 1.0 }, { @@ -33030,7 +34021,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L329", + "source_location": "L351", "weight": 1.0 }, { @@ -33042,7 +34033,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L330", + "source_location": "L352", "weight": 1.0 }, { @@ -33054,7 +34045,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L330", + "source_location": "L352", "weight": 1.0 }, { @@ -33066,7 +34057,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L330", + "source_location": "L352", "weight": 1.0 }, { @@ -33078,7 +34069,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L331", + "source_location": "L353", "weight": 1.0 }, { @@ -33090,7 +34081,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L331", + "source_location": "L353", "weight": 1.0 }, { @@ -33102,7 +34093,7 @@ "confidence_score": 0.85, "context": "collection", "source_file": "core/config.js", - "source_location": "L335", + "source_location": "L357", "weight": 1.0 }, { @@ -34605,6 +35596,138 @@ "source_location": "L250", "weight": 1.0 }, + { + "source": "core_sponsor", + "target": "core_sponsor_buildlinktoken", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L308", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_linkfor", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L308", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_normalizebaseurl", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L308", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_starturl", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L308", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_diffsponsorroles", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L309", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_fetchmembers", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L309", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_msuntilhour", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L309", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_runsync", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L309", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_settings", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L309", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_startsponsorsync", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L310", + "weight": 1.0 + }, + { + "source": "core_sponsor", + "target": "core_sponsor_stopsponsorsync", + "relation": "indirect_call", + "_origin": "ast", + "confidence": "INFERRED", + "confidence_score": 0.85, + "context": "collection", + "source_file": "core/sponsor.js", + "source_location": "L310", + "weight": 1.0 + }, { "source": "core_utils", "target": "core_utils_datestr", @@ -34929,5 +36052,5 @@ "source_file": "SECURITY.md" } ], - "built_at_commit": "19eabbba0b575652d219d8b9c5c933780f98242d" + "built_at_commit": "24ca834a5f2b5be6bdc25279477b31e3fd746500" } \ No newline at end of file diff --git a/locales/de.json b/locales/de.json index 3d2d37d..179e65e 100644 --- a/locales/de.json +++ b/locales/de.json @@ -31,6 +31,10 @@ "backup_database": { "description": "Ein Datenbank-Backup erstellen" }, "send_message": { "description": "Eine einfache Nachricht als Bot senden" }, "send_embed": { "description": "Ein Embed als Bot senden" }, + "sponsor": { "description": "Das GitHub-Sponsors-Panel posten oder die Sponsor-Rolle abgleichen", + "options": { "post": "Das GitHub-Sponsors-Panel in diesem Kanal posten", + "sync": "Die Sponsor-Rolle jetzt mit dem Shop abgleichen", + "force": "Die Rolle auch entziehen, wenn die Bremse das Entfernen zurückhalten würde" } }, "random": { "description": "Eine neue Runde Zahlenraten starten", "options": { "number1": "Untere Grenze", "number2": "Obere Grenze" } }, "rg": { "description": "Rate die Zahl", @@ -79,6 +83,32 @@ } }, + "sponsor": { + "panel": { + "title": "💖 GitHub Sponsors", + "description": "Wer {brand} auf GitHub sponsert, bekommt hier auf Discord Ticket-Support.\n\n**So verifizierst du dich**\n1. Sponsere uns auf GitHub, monatlich oder einmalig.\n2. Klick unten auf **Verifizieren**. Du bekommst einen persönlichen Link, der {minutes} Minuten gültig ist.\n3. Melde dich auf der Seite, die sich öffnet, mit GitHub an. Deine Sponsor-Rolle bekommst du sofort.\n\nDie Rolle wird einmal am Tag geprüft und bleibt, solange dein Sponsoring läuft.", + "sponsorButton": "Auf GitHub sponsern", + "verifyButton": "Verifizieren" + }, + "posted": "✅ Das Sponsor-Panel wurde in diesen Kanal gesendet.", + "notConfigured": "❌ Die Sponsor-Funktion ist noch nicht fertig eingerichtet. Was fehlt, steht im Log des Bots.", + "verify": { + "text": "🔗 Hier ist dein persönlicher Link. Er ist {minutes} Minuten gültig und funktioniert nur für dich, also gib ihn bitte nicht weiter.", + "linkButton": "GitHub-Account verknüpfen", + "unavailable": "❌ Die Verifizierung ist gerade nicht verfügbar. Versuch es bitte später noch einmal oder wende dich an das Team." + }, + "sync": { + "done": "✅ Sponsor-Abgleich fertig: {added} hinzugefügt, {removed} entfernt, {failed} fehlgeschlagen ({listed} Sponsoren gelistet).", + "braked": "⚠️ {count} Entfernungen wurden zurückgehalten: Die Liste des Shops würde mehr als der Hälfte der aktuellen Sponsoren die Rolle entziehen. Prüf den Shop und starte den Abgleich mit force, wenn die Liste stimmt.", + "busy": "⏳ Ein Abgleich läuft gerade schon. Versuch es bitte gleich noch einmal.", + "failed": "❌ Der Abgleich wurde abgebrochen, keine Rolle wurde geändert. Den Grund findest du im Log des Bots." + }, + "audit": { + "added": "GitHub-Sponsor (Sponsor-Abgleich)", + "removed": "Kein GitHub-Sponsor mehr (Sponsor-Abgleich)" + } + }, + "utility": { "ping": "🏓 Pong!\nLatenz: `{latency}ms`", "userinfo": { diff --git a/locales/en.json b/locales/en.json index e5cf31a..8c7f5ad 100644 --- a/locales/en.json +++ b/locales/en.json @@ -31,6 +31,10 @@ "backup_database": { "description": "Create a database backup" }, "send_message": { "description": "Send a plain message as the bot" }, "send_embed": { "description": "Send an embed as the bot" }, + "sponsor": { "description": "Post the GitHub Sponsors panel or sync the sponsor role", + "options": { "post": "Post the GitHub Sponsors panel in this channel", + "sync": "Sync the sponsor role with the shop now", + "force": "Also remove the role when the brake would hold the removals back" } }, "random": { "description": "Start a new round of Guess the Number", "options": { "number1": "Lower bound", "number2": "Upper bound" } }, "rg": { "description": "Guess the number", @@ -79,6 +83,32 @@ } }, + "sponsor": { + "panel": { + "title": "💖 GitHub Sponsors", + "description": "Sponsors of {brand} on GitHub get ticket support here on Discord.\n\n**How to verify**\n1. Sponsor us on GitHub, monthly or once.\n2. Click **Verify** below. You get a personal link, valid for {minutes} minutes.\n3. Sign in with GitHub on the page that opens. Your sponsor role is assigned right away.\n\nThe role is checked once a day and stays for as long as your sponsorship is active.", + "sponsorButton": "Sponsor on GitHub", + "verifyButton": "Verify" + }, + "posted": "✅ The sponsor panel was posted in this channel.", + "notConfigured": "❌ The sponsor feature is not fully set up yet. The bot's log says what is missing.", + "verify": { + "text": "🔗 Here is your personal link. It is valid for {minutes} minutes and only works for you, so please don't share it.", + "linkButton": "Link my GitHub account", + "unavailable": "❌ Verification is not available right now. Please try again later or contact the team." + }, + "sync": { + "done": "✅ Sponsor sync done: {added} added, {removed} removed, {failed} failed ({listed} sponsors listed).", + "braked": "⚠️ {count} removals were held back: the shop's list would take the role from more than half of the current sponsors. Check the shop, then run the sync with force if the list is right.", + "busy": "⏳ A sync is already running. Please try again in a moment.", + "failed": "❌ The sync was aborted and no roles were changed. The bot's log has the reason." + }, + "audit": { + "added": "GitHub sponsor (sponsor sync)", + "removed": "No longer a GitHub sponsor (sponsor sync)" + } + }, + "utility": { "ping": "🏓 Pong!\nLatency: `{latency}ms`", "userinfo": { diff --git a/package-lock.json b/package-lock.json index c5ee66b..0274e21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,7 @@ "dependencies": { "better-sqlite3": "^13.0.3", "discord.js": "^14.27.0", - "dotenv": "^17.4.2", - "express": "^5.1.0", - "helmet": "^8.1.0" + "dotenv": "^17.4.2" }, "engines": { "node": ">=24.0.0" @@ -252,19 +250,19 @@ } }, "node_modules/body-parser": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", - "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz", + "integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==", "license": "MIT", "optional": true, "dependencies": { "bytes": "^3.1.2", - "content-type": "^2.0.0", + "content-type": "^2.1.0", "debug": "^4.4.3", "http-errors": "^2.0.1", - "iconv-lite": "^0.7.2", + "iconv-lite": "^0.7.3", "on-finished": "^2.4.1", - "qs": "^6.15.2", + "qs": "^6.16.1", "raw-body": "^3.0.2", "type-is": "^2.1.0" }, @@ -1189,9 +1187,9 @@ } }, "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", "license": "MIT", "optional": true, "dependencies": { @@ -1200,12 +1198,16 @@ }, "engines": { "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/qs": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz", - "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==", + "version": "6.17.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.1.tgz", + "integrity": "sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==", "license": "BSD-3-Clause", "optional": true, "dependencies": { @@ -1495,9 +1497,9 @@ } }, "node_modules/undici": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", - "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", + "version": "6.29.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz", + "integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/test/harness.js b/test/harness.js index 7f82678..3ada83d 100644 --- a/test/harness.js +++ b/test/harness.js @@ -51,7 +51,7 @@ const FIXTURE = { language: 'en', roles: { member: FAKE(1), founder: FAKE(2), manager: FAKE(3), - developer: FAKE(4), team: FAKE(5), giveawayNotify: FAKE(6), + developer: FAKE(4), team: FAKE(5), giveawayNotify: FAKE(6), sponsor: FAKE(7), }, channels: { log: FAKE(10), memberCount: FAKE(11), feedback: FAKE(12) }, features: { @@ -67,6 +67,11 @@ const FIXTURE = { inviteUrl: 'https://example.com/invite', }, backupDatabase: { enabled: true }, + sponsor: { + enabled: true, role: 'sponsor', syncHour: 4, + shopBaseUrl: 'https://shop.example.com/', + sponsorsUrl: 'https://github.com/sponsors/example', + }, minigames: { multipliers: [ { role: 'founder', factor: 3 }, @@ -87,6 +92,13 @@ process.env.MULTIBOT_CONFIG = FIXTURE_PATH; // the real installation. process.env.DATABASE_URL = 'sqlite::memory:'; +// Made-up secrets for the sponsor feature, set before dotenv runs so a real +// .env on the developer's machine can never be what the tests sign with. +const SPONSOR_LINK_SECRET = 'harness-link-secret-0123456789abcdef'; +const SPONSOR_SYNC_SECRET = 'harness-sync-secret-0123456789abcdef'; +process.env.SPONSOR_LINK_SECRET = SPONSOR_LINK_SECRET; +process.env.SPONSOR_SYNC_SECRET = SPONSOR_SYNC_SECRET; + const req = p => require(path.join(REPO, p)); let pass = 0, fail = 0; @@ -283,6 +295,7 @@ function mockInteraction({ name, opts = {}, roles = [], userId = 'test-user-1', getMember: n => opts[n] ?? null, getBoolean: n => opts[n] ?? null, getChannel: n => opts[n] ?? null, + getSubcommand: () => opts.subcommand ?? null, }, isChatInputCommand: () => type === 'chat', isButton: () => type === 'button', @@ -478,6 +491,87 @@ const nameOf = key => config.command(key).name; assert.ok(lastText(i).includes(roleId), 'the legacy custom id was ignored: ' + lastText(i)); }); + /** Decode a sponsor link token's payload, after checking its signature. */ + const readSponsorToken = (url) => { + const token = decodeURIComponent(new URL(url).searchParams.get('t')); + const [b64, sig] = token.split('.'); + const expected = require('crypto').createHmac('sha256', SPONSOR_LINK_SECRET) + .update('sponsor-link.' + b64).digest('base64url'); + assert.strictEqual(sig, expected, 'the signature does not verify with the link secret'); + return JSON.parse(Buffer.from(b64, 'base64url').toString('utf8')); + }; + + await acheck('/sponsor post is gated by the configured roles', async () => { + const i = await dispatch(mockInteraction({ name: nameOf('sponsor'), opts: { subcommand: 'post' } })); + assert.strictEqual(lastText(i), i18n.t('common.noPermission')); + }); + + await acheck('/sponsor post posts the panel with the link and the verify button', async () => { + const i = mockInteraction({ name: nameOf('sponsor'), opts: { subcommand: 'post' }, roles: [config.roleId('founder')] }); + const sent = []; + i.channel.send = async m => { sent.push(m); return m; }; + await dispatch(i); + assert.strictEqual(lastText(i), i18n.t('sponsor.posted'), lastText(i)); + assert.strictEqual(sent.length, 1, 'nothing was posted'); + const buttons = sent[0].components[0].toJSON().components; + assert.ok(buttons.some(b => b.url === 'https://github.com/sponsors/example'), 'no sponsors link button'); + assert.ok(buttons.some(b => b.custom_id === 'sponsor_verify'), 'no verify button'); + }); + + await acheck('the sponsor_verify button answers with a signed, personal shop link', async () => { + const i = mockInteraction({ name: '', type: 'button', userId: '900000000000077777' }); + i.customId = 'sponsor_verify'; + const before = Math.floor(Date.now() / 1000); + await dispatch(i); + const reply = i._out.replies.at(-1); + assert.strictEqual(reply.flags, djs.MessageFlags.Ephemeral, 'the personal link was not ephemeral'); + const url = reply.components[0].toJSON().components[0].url; + assert.ok(url.startsWith('https://shop.example.com/api/sponsor/start?t='), url); + const payload = readSponsorToken(url); + assert.deepStrictEqual(Object.keys(payload), ['v', 'd', 'g', 'exp', 'n']); + assert.strictEqual(payload.v, 1); + assert.strictEqual(payload.d, '900000000000077777'); + assert.strictEqual(payload.g, config.guildId()); + assert.ok(payload.exp >= before + 900 && payload.exp <= before + 902, 'exp is not now + 900: ' + payload.exp); + assert.match(payload.n, /^[0-9a-f]{32}$/); + }); + + await acheck('without the link secret the button apologises instead of linking', async () => { + const saved = process.env.SPONSOR_LINK_SECRET; + const realError = console.error; + process.env.SPONSOR_LINK_SECRET = 'too-short'; + console.error = () => {}; + try { + const i = mockInteraction({ name: '', type: 'button' }); + i.customId = 'sponsor_verify'; + await dispatch(i); + assert.strictEqual(lastText(i), i18n.t('sponsor.verify.unavailable')); + assert.ok(!i._out.replies.at(-1).components, 'a link was handed out with a short secret'); + } finally { + process.env.SPONSOR_LINK_SECRET = saved; + console.error = realError; + } + }); + + await acheck('/sponsor sync reports an aborted sync and changes nothing', async () => { + const realFetch = globalThis.fetch; + const realError = console.error; + const realLog = console.log; + globalThis.fetch = async () => ({ status: 503, json: async () => ({}) }); + console.error = () => {}; + console.log = () => {}; + try { + const i = await dispatch(mockInteraction({ + name: nameOf('sponsor'), opts: { subcommand: 'sync' }, roles: [config.roleId('manager')], + })); + assert.strictEqual(i._out.edits.at(-1)?.content, i18n.t('sponsor.sync.failed')); + } finally { + globalThis.fetch = realFetch; + console.error = realError; + console.log = realLog; + } + }); + // ------------------------------------------------------------ config paths section('F0) every config path the code reads exists in config.example.jsonc'); { @@ -661,7 +755,7 @@ const nameOf = key => config.command(key).name; // will disagree. The DASHBOARD_* group is the deliberate exception: a bind // address and a port describe the machine, not the Discord server, and the // dashboard reads them before it has any reason to look at a guild. - const ALLOWED = /^(COMMANDS_BOT_TOKEN|EVENTS_BOT_TOKEN|MINIGAMES_BOT_TOKEN|DB_HOST|DB_USER|DB_PASS|DB_NAME|DATABASE_URL|DASHBOARD_[A-Z_]+|CLIENT_ID|CLIENT_SECRET|SESSION_SECRET)$/; + const ALLOWED = /^(COMMANDS_BOT_TOKEN|EVENTS_BOT_TOKEN|MINIGAMES_BOT_TOKEN|DB_HOST|DB_USER|DB_PASS|DB_NAME|DATABASE_URL|DASHBOARD_[A-Z_]+|CLIENT_ID|CLIENT_SECRET|SESSION_SECRET|SPONSOR_LINK_SECRET|SPONSOR_SYNC_SECRET)$/; const declared = [...template.matchAll(/^([A-Z][A-Z0-9_]*)=/gm)].map(m => m[1]); assert.ok(declared.length >= 5, 'the template scan found almost nothing'); const strays = declared.filter(n => !ALLOWED.test(n)); @@ -1421,6 +1515,276 @@ const nameOf = key => config.command(key).name; } } + // ------------------------------------------------------------ sponsors + section('S) GitHub Sponsors role: link token, members list, role diff'); + { + const sponsor = req('core/sponsor'); + const quiet = async (fn) => { + const real = { log: console.log, error: console.error, warn: console.warn }; + console.log = console.error = console.warn = () => {}; + try { return await fn(); } finally { Object.assign(console, real); } + }; + + check('the link token matches the fixed vector shared with the shop', () => { + // Computed OUTSIDE this code base (Python hmac/base64), so a change that + // breaks the contract cannot also move the expectation. The shop's tests + // can use the same vector. + const token = sponsor.buildLinkToken({ + secret: 'harness-link-secret-0123456789abcdef', + discordId: '900000000000010001', + guildId: '900000000000010000', + now: Date.UTC(2026, 0, 1), + nonce: '00112233445566778899aabbccddeeff', + }); + assert.strictEqual(token, + 'eyJ2IjoxLCJkIjoiOTAwMDAwMDAwMDAwMDEwMDAxIiwiZyI6IjkwMDAwMDAwMDAwMDAxMDAwMCIsImV4cCI6MTc2NzIyNjUwMCwibiI6IjAwMTEyMjMzNDQ1NTY2Nzc4ODk5YWFiYmNjZGRlZWZmIn0' + + '.qYKp1z9QMAlavZwm5GzzTM3Q3qnOVN2jDmrMi0mKYGw'); + }); + + check('a token signed with another secret does not match', () => { + const args = { discordId: '1', guildId: '2', now: 0, nonce: 'aa' }; + const a = sponsor.buildLinkToken({ ...args, secret: 'a'.repeat(32) }); + const b = sponsor.buildLinkToken({ ...args, secret: 'b'.repeat(32) }); + assert.strictEqual(a.split('.')[0], b.split('.')[0]); + assert.notStrictEqual(a.split('.')[1], b.split('.')[1]); + }); + + check('the shop URL must be https, plain http only on this machine', () => { + assert.strictEqual(sponsor.normalizeBaseUrl('https://shop.example.com/'), 'https://shop.example.com'); + assert.strictEqual(sponsor.normalizeBaseUrl('http://shop.example.com'), ''); + assert.strictEqual(sponsor.normalizeBaseUrl('http://localhost:3000'), 'http://localhost:3000'); + assert.strictEqual(sponsor.normalizeBaseUrl('not a url'), ''); + }); + + check('a missing or short secret switches the feature off and says which', () => { + const saved = process.env.SPONSOR_SYNC_SECRET; + process.env.SPONSOR_SYNC_SECRET = 'x'.repeat(31); + try { + const s = sponsor.settings(); + assert.strictEqual(s.ready, false); + assert.ok(s.missing.some(m => m.startsWith('SPONSOR_SYNC_SECRET')), s.missing.join(', ')); + assert.ok(config.report().missing.some(m => m.startsWith('SPONSOR_SYNC_SECRET')), 'not reported at boot'); + assert.strictEqual(sponsor.startSponsorSync(client), false, 'the sync started without its secret'); + } finally { process.env.SPONSOR_SYNC_SECRET = saved; } + assert.strictEqual(sponsor.settings().ready, true, 'the fixture is not a ready configuration'); + }); + + check('the role diff adds listed members, removes unlisted holders, never touches bots', () => { + const members = [ + { id: 'keep', bot: false, hasRole: true }, // listed, has it + { id: 'gain', bot: false, hasRole: false }, // listed, lacks it + { id: 'lose', bot: false, hasRole: true }, // not listed, has it + { id: 'stranger', bot: false, hasRole: false }, // not listed, lacks it + { id: 'botHolder', bot: true, hasRole: true }, // a bot holding it: left alone + { id: 'botListed', bot: true, hasRole: false }, // a bot on the list: left alone + ]; + const diff = sponsor.diffSponsorRoles(members, ['keep', 'gain', 'botListed', 'gone']); + assert.deepStrictEqual(diff.toAdd, ['gain']); + assert.deepStrictEqual(diff.toRemove, ['lose']); + assert.strictEqual(diff.notInGuild, 1, 'a listed id outside the guild was not counted'); + }); + + check('an empty list removes every human holder and adds nobody', () => { + const diff = sponsor.diffSponsorRoles([{ id: 'a', bot: false, hasRole: true }], []); + assert.deepStrictEqual(diff, { toAdd: [], toRemove: ['a'], notInGuild: 0 }); + }); + + const listResponse = (status, body) => async () => ({ + status, json: async () => { if (body instanceof Error) throw body; return body; }, + }); + + await acheck('the members list is fetched with the bearer secret and read', async () => { + let seen = null; + const fetchImpl = async (url, init) => { + seen = { url, init }; + return listResponse(200, { + ok: true, generatedAt: '2026-11-05T00:00:00Z', + members: [ + { discordId: '900000000000010001', githubLogin: 'a', kind: 'monthly', validUntil: null }, + { discordId: '900000000000010002', githubLogin: 'b', kind: 'one_time', validUntil: '2026-12-05T00:00:00Z' }, + ], + })(); + }; + const r = await sponsor.fetchMembers({ baseUrl: 'https://shop.example.com', secret: 'S'.repeat(32), fetchImpl }); + assert.strictEqual(seen.url, 'https://shop.example.com/api/sponsor/members'); + assert.strictEqual(seen.init.headers.Authorization, 'Bearer ' + 'S'.repeat(32)); + assert.ok(seen.init.signal instanceof AbortSignal, 'no timeout signal'); + assert.strictEqual(r.ok, true); + assert.deepStrictEqual([...r.ids], ['900000000000010001', '900000000000010002']); + }); + + for (const [label, fetchImpl] of [ + ['a non-200 answer', listResponse(500, { ok: true, members: [] })], + ['a 401', listResponse(401, { ok: false })], + ['ok !== true', listResponse(200, { ok: 'yes', members: [] })], + ['members that are not a list', listResponse(200, { ok: true, members: {} })], + ['a row without a Discord id', listResponse(200, { ok: true, members: [{ discordId: 'nope' }] })], + ['a body that is not JSON', listResponse(200, new SyntaxError('Unexpected token'))], + ['a timeout', async () => { throw Object.assign(new Error('aborted'), { name: 'TimeoutError' }); }], + ]) { + await acheck(`the members list is refused on ${label}`, async () => { + const r = await sponsor.fetchMembers({ baseUrl: 'https://shop.example.com', secret: 'S'.repeat(32), fetchImpl }); + assert.strictEqual(r.ok, false, 'accepted'); + assert.ok(r.reason, 'no reason given'); + }); + } + + /** A guild with a sponsor role, members that record every role change, and a client. */ + const sponsorGuild = () => { + const roleId = config.roleId('sponsor'); + const calls = []; + const role = { id: roleId, editable: true }; + const member = (id, { bot = false, has = false } = {}) => { + const cache = new Set(has ? [roleId] : []); + return { + id, user: { id, bot }, + roles: { + cache, + add: async (r, reason) => { calls.push(['add', id, r.id, reason]); cache.add(r.id); }, + remove: async (r, reason) => { calls.push(['remove', id, r.id, reason]); cache.delete(r.id); }, + }, + }; + }; + const members = new Map([ + ['900000000000020001', member('900000000000020001', { has: true })], // listed, keeps it + ['900000000000020002', member('900000000000020002')], // listed, gets it + ['900000000000020003', member('900000000000020003', { has: true })], // unlisted, loses it + ['900000000000020004', member('900000000000020004', { bot: true, has: true })], + ]); + const guild = { id: config.guildId(), roles: { cache: new Map([[roleId, role]]) }, members: { fetch: async () => members } }; + const fakeClient = { guilds: { cache: new Map([[guild.id, guild]]) } }; + return { calls, fakeClient }; + }; + const listed = ['900000000000020001', '900000000000020002', '900000000000020004'] + .map(discordId => ({ discordId, githubLogin: 'x', kind: 'monthly', validUntil: null })); + + await acheck('the sync adds and removes exactly the diff, with an audit-log reason', async () => { + const { calls, fakeClient } = sponsorGuild(); + const r = await quiet(() => sponsor.runSync(fakeClient, { fetchImpl: listResponse(200, { ok: true, members: listed }) })); + assert.strictEqual(r.ok, true, r.reason); + assert.deepStrictEqual(calls.map(c => c.slice(0, 2)), + [['add', '900000000000020002'], ['remove', '900000000000020003']]); + assert.ok(calls.every(c => c[2] === config.roleId('sponsor')), 'a different role was touched'); + assert.strictEqual(calls[0][3], i18n.t('sponsor.audit.added')); + assert.strictEqual(calls[1][3], i18n.t('sponsor.audit.removed')); + assert.deepStrictEqual([r.added, r.removed, r.failed], [1, 1, 0]); + }); + + /** A guild where `holders` humans hold the role, plus one human listed without it. */ + const holderGuild = (holders) => { + const roleId = config.roleId('sponsor'); + const calls = []; + const members = new Map(); + const add = (id, has) => { + const cache = new Set(has ? [roleId] : []); + members.set(id, { + id, user: { id, bot: false }, + roles: { + cache, + add: async (r) => { calls.push(['add', id]); cache.add(r.id); }, + remove: async (r) => { calls.push(['remove', id]); cache.delete(r.id); }, + }, + }); + }; + for (let n = 0; n < holders; n++) add(`9000000000000300${String(n).padStart(2, '0')}`, true); + add('900000000000039999', false); + const guild = { + id: config.guildId(), + roles: { cache: new Map([[roleId, { id: roleId, editable: true }]]) }, + members: { fetch: async () => members }, + }; + return { calls, fakeClient: { guilds: { cache: new Map([[guild.id, guild]]) } } }; + }; + const onlyNewcomer = listResponse(200, { ok: true, members: [ + { discordId: '900000000000039999', githubLogin: 'n', kind: 'one_time', validUntil: null }, + ] }); + + check('the removal brake: more than half of the holders AND at least 3', () => { + assert.strictEqual(sponsor.removalBrake(4, 4), true); + assert.strictEqual(sponsor.removalBrake(5, 3), true); + assert.strictEqual(sponsor.removalBrake(6, 3), false, 'exactly half must not brake'); + assert.strictEqual(sponsor.removalBrake(2, 2), false, 'below 3 removals must not brake'); + assert.strictEqual(sponsor.removalBrake(0, 0), false); + }); + + await acheck('the brake holds back the removals of a mass loss, additions still happen', async () => { + const { calls, fakeClient } = holderGuild(4); + const r = await quiet(() => sponsor.runSync(fakeClient, { fetchImpl: onlyNewcomer })); + assert.strictEqual(r.ok, true, r.reason); + assert.deepStrictEqual(calls.filter(c => c[0] === 'remove'), [], 'roles were removed through the brake'); + assert.deepStrictEqual(calls, [['add', '900000000000039999']], 'the addition did not happen'); + assert.strictEqual(r.braked, true); + assert.strictEqual(r.heldBack, 4); + }); + + await acheck('below 3 removals the brake stays out of the way', async () => { + const { calls, fakeClient } = holderGuild(2); + const r = await quiet(() => sponsor.runSync(fakeClient, { fetchImpl: listResponse(200, { ok: true, members: [] }) })); + assert.strictEqual(r.braked, false); + assert.deepStrictEqual(calls.map(c => c[0]), ['remove', 'remove']); + }); + + await acheck('force bypasses the brake for that run', async () => { + const { calls, fakeClient } = holderGuild(4); + const r = await quiet(() => sponsor.runSync(fakeClient, { fetchImpl: onlyNewcomer, force: true })); + assert.strictEqual(r.braked, false); + assert.strictEqual(calls.filter(c => c[0] === 'remove').length, 4); + }); + + check('only /sponsor sync can force, the daily run never does', () => { + const src = stripComments(fs.readFileSync(path.join(REPO, 'core/sponsor.js'), 'utf8')); + const daily = src.match(/const run = \(\) => runSync\(([^)]*)\)/); + assert.ok(daily, 'the scheduled call was not found'); + assert.strictEqual(daily[1].trim(), 'client', 'the scheduled run passes options: ' + daily[1]); + }); + + await acheck('/sponsor sync force:true reaches the sync', async () => { + // Through the real dispatch: the option must arrive as `force`, not be + // dropped on the way from the command to runSync. + const realFetch = globalThis.fetch; + globalThis.fetch = async () => ({ status: 503, json: async () => ({}) }); + const realRun = sponsor.runSync; + let seen = null; + sponsor.runSync = async (_c, opts) => { seen = opts; return { ok: false, reason: 'stub' }; }; + try { + await dispatch(mockInteraction({ + name: nameOf('sponsor'), opts: { subcommand: 'sync', force: true }, roles: [config.roleId('founder')], + })); + } finally { sponsor.runSync = realRun; globalThis.fetch = realFetch; } + assert.deepStrictEqual(seen, { force: true }); + }); + + for (const [label, fetchImpl] of [ + ['an HTTP error', listResponse(502, { ok: true, members: [] })], + ['ok: false', listResponse(200, { ok: false, members: [] })], + ['a timeout', async () => { throw Object.assign(new Error('aborted'), { name: 'TimeoutError' }); }], + ]) { + await acheck(`a failed list fetch (${label}) changes no role at all`, async () => { + const { calls, fakeClient } = sponsorGuild(); + const r = await quiet(() => sponsor.runSync(fakeClient, { fetchImpl })); + assert.strictEqual(r.ok, false); + assert.deepStrictEqual(calls, [], 'roles were changed after a failed fetch'); + }); + } + + check('the daily run is scheduled for the next sync hour, local time', () => { + const at = (h, m = 0) => new Date(2026, 5, 10, h, m, 0, 0); + assert.strictEqual(sponsor.msUntilHour(at(3, 30), 4), 30 * 60_000); + assert.strictEqual(sponsor.msUntilHour(at(4, 0), 4), 24 * 3_600_000, 'the same minute must mean tomorrow'); + assert.strictEqual(sponsor.msUntilHour(at(5, 0), 4), 23 * 3_600_000); + }); + + check('the sync schedules itself when configured and can be stopped', () => { + const started = (() => { + const real = console.log; + console.log = () => {}; + try { return sponsor.startSponsorSync(client); } finally { console.log = real; } + })(); + sponsor.stopSponsorSync(); + assert.strictEqual(started, true); + }); + } + // ------------------------------------------------------------ client section('H) real discord.js Client and a live REST round trip'); let realClient = null;