From a261bbdb9b518425177511d7374a56f921d64163 Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Fri, 20 Jun 2025 19:03:51 +0200 Subject: [PATCH] refactor: rename stores to memory --- deno.lock | 33 +++++++++++++++++++-------- src/commands/utils/selectChannel.ts | 4 ++-- src/events/utils/interactionCreate.ts | 2 +- src/main.ts | 3 +-- src/{stores.ts => memory.ts} | 2 +- src/utils.ts | 0 6 files changed, 28 insertions(+), 16 deletions(-) rename src/{stores.ts => memory.ts} (93%) delete mode 100644 src/utils.ts diff --git a/deno.lock b/deno.lock index b432c97..0abdb3a 100644 --- a/deno.lock +++ b/deno.lock @@ -4,6 +4,7 @@ "jsr:@std/fs@*": "1.0.18", "jsr:@std/path@*": "1.1.0", "jsr:@std/path@^1.1.0": "1.1.0", + "npm:@discordjs/voice@*": "0.18.0", "npm:@types/node@*": "22.12.0", "npm:cainode@latest": "1.2.2", "npm:discord.js@*": "14.20.0" @@ -29,7 +30,7 @@ "@discordjs/formatters", "@discordjs/util", "@sapphire/shapeshift", - "discord-api-types", + "discord-api-types@0.38.12", "fast-deep-equal", "ts-mixer", "tslib" @@ -44,7 +45,7 @@ "@discordjs/formatters@0.6.1": { "integrity": "sha512-5cnX+tASiPCqCWtFcFslxBVUaCetB0thvM/JyavhbXInP1HJIEU+Qv/zMrnuwSsX3yWH2lVXNJZeDK3EiP4HHg==", "dependencies": [ - "discord-api-types" + "discord-api-types@0.38.12" ] }, "@discordjs/rest@2.5.1": { @@ -55,7 +56,7 @@ "@sapphire/async-queue", "@sapphire/snowflake", "@vladfrangu/async_event_emitter", - "discord-api-types", + "discord-api-types@0.38.12", "magic-bytes.js", "tslib", "undici" @@ -64,6 +65,16 @@ "@discordjs/util@1.1.1": { "integrity": "sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g==" }, + "@discordjs/voice@0.18.0": { + "integrity": "sha512-BvX6+VJE5/vhD9azV9vrZEt9hL1G+GlOdsQaVl5iv9n87fkXjf3cSwllhR3GdaUC8m6dqT8umXIWtn3yCu4afg==", + "dependencies": [ + "@types/ws", + "discord-api-types@0.37.120", + "prism-media", + "tslib", + "ws" + ] + }, "@discordjs/ws@1.2.3": { "integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==", "dependencies": [ @@ -73,7 +84,7 @@ "@sapphire/async-queue", "@types/ws", "@vladfrangu/async_event_emitter", - "discord-api-types", + "discord-api-types@0.38.12", "tslib", "ws" ] @@ -160,6 +171,9 @@ ], "scripts": true }, + "discord-api-types@0.37.120": { + "integrity": "sha512-7xpNK0EiWjjDFp2nAhHXezE4OUWm7s1zhc/UXXN6hnFFU8dfoPHgV0Hx0RPiCa3ILRpdeh152icc68DGCyXYIw==" + }, "discord-api-types@0.38.12": { "integrity": "sha512-vqkRM50N5Zc6OVckAqtSslbUEoXmpN4bd9xq2jkoK9fgO3KNRIOyMMQ7ipqjwjKuAgzWvU6G8bRIcYWaUe1sCA==" }, @@ -173,7 +187,7 @@ "@discordjs/util", "@discordjs/ws", "@sapphire/snowflake", - "discord-api-types", + "discord-api-types@0.38.12", "fast-deep-equal", "lodash.snakecase", "magic-bytes.js", @@ -193,6 +207,9 @@ "magic-bytes.js@1.12.1": { "integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA==" }, + "prism-media@1.3.5": { + "integrity": "sha512-IQdl0Q01m4LrkN1EGIE9lphov5Hy7WWlH6ulf5QdGePLlPas9p2mhgddTEHrlaXYjjFToM1/rWuwF37VF4taaA==" + }, "ts-mixer@6.0.4": { "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==" }, @@ -206,11 +223,7 @@ "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==" }, "ws@8.18.2": { - "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==", - "optionalPeers": [ - "bufferutil@^4.0.1", - "utf-8-validate@>=5.0.2" - ] + "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==" } } } diff --git a/src/commands/utils/selectChannel.ts b/src/commands/utils/selectChannel.ts index 08a4655..90ba255 100644 --- a/src/commands/utils/selectChannel.ts +++ b/src/commands/utils/selectChannel.ts @@ -5,7 +5,7 @@ import { SlashCommandBuilder, } from "npm:discord.js"; import { Command } from "../../types.ts"; -import { settings } from "../../stores.ts"; +import { memory } from "../../memory.ts"; export default { data: new SlashCommandBuilder() @@ -13,7 +13,7 @@ export default { .setDescription("Select the channel for futures chats.") .setContexts(InteractionContextType.Guild), async execute(interaction: ChatInputCommandInteraction) { - settings.textChannelId = interaction.channelId; + memory.textChannelId = interaction.channelId; await interaction.reply(`Futures chats will be started in this channel.`); }, } as Command; diff --git a/src/events/utils/interactionCreate.ts b/src/events/utils/interactionCreate.ts index b25979b..d4bc55d 100644 --- a/src/events/utils/interactionCreate.ts +++ b/src/events/utils/interactionCreate.ts @@ -1,6 +1,6 @@ import { Events, CacheType, ChatInputCommandInteraction, MessageFlags } from "npm:discord.js"; import { Event } from "../../types.ts"; -import { commands } from "../../stores.ts"; +import { commands } from "../../memory.ts"; export default { name: Events.InteractionCreate, diff --git a/src/main.ts b/src/main.ts index 53ac6d1..1429a2e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,8 +3,7 @@ import { Command, Event } from "./types.ts"; import { gatherPaths } from "./gatherer.ts"; import { exists } from "jsr:@std/fs/exists"; import cai from "./cai.ts"; -import { commands } from "./stores.ts"; -import { client } from "./stores.ts"; +import { commands, client } from "./memory.ts"; async function registerCommand(path: string) { const { default: command }: { default: Command } = await import(path); diff --git a/src/stores.ts b/src/memory.ts similarity index 93% rename from src/stores.ts rename to src/memory.ts index 3f4fc0b..a98915b 100644 --- a/src/stores.ts +++ b/src/memory.ts @@ -40,4 +40,4 @@ export const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent], }); export const commands: {[index:string]:Command} = {} -export const settings = {textChannelId: "", voiceChannelId: "", characterId: ""} \ No newline at end of file +export const memory = {textChannelId: "", voiceChannelId: "", characterId: ""} \ No newline at end of file diff --git a/src/utils.ts b/src/utils.ts deleted file mode 100644 index e69de29..0000000