diff --git a/.vscode/settings.json b/.vscode/settings.json index 32e896e..75c05a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,8 @@ "ollama", "RCON", "srcds" - ] + ], + "files.readonlyInclude": { + "{**/.c4z/.extsrcs/*.PROTSYM.cbl,**/.c4z/.extsrcs/*.PROTSYM.listing}": true + } } \ No newline at end of file diff --git a/assets/img/logo.png b/assets/img/logo.png new file mode 100644 index 0000000..03d37a3 Binary files /dev/null and b/assets/img/logo.png differ diff --git a/assets/img/patriknorris.png b/assets/img/patriknorris.png deleted file mode 100644 index 5032142..0000000 Binary files a/assets/img/patriknorris.png and /dev/null differ diff --git a/package.json b/package.json index 4109b5d..1779442 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "assets": "./assets", "scripts": { "uglify": "node ./gulp/main.js", - "watch": "npm run build && tsc -w", + "watch": "npm run clean && npm run build && tsc -w", "clean": "rm -rf dist node_modules package-lock.json", "build": "npm i && tsc && npm run copyExtraFiles", "start": "npm run clean && npm run build && npm run nodeDist", "nodeDist": "node ./dist/src/index.js", - "copyExtraFiles": "cp -rf ./api/certs -t ./dist/api && npm run sentry:ci", + "copyExtraFiles": "cp -rf ./api/certs -t ./dist/api && cp -rf ./assets -t ./dist", "clear-branches": "git branch | xargs git branch -D", "sentry:ci": "sentry-cli sourcemaps inject --org rvdprojects --project what-the-chuck ./dist && sentry-cli sourcemaps upload --org rvdprojects --project what-the-chuck ./dist" }, @@ -55,4 +55,4 @@ "typescript": "^5.4.5", "uglify-js": "^3.17.4" } -} +} \ No newline at end of file diff --git a/src/class/appClient.ts b/src/class/appClient.ts index 6d3972e..cbbc77f 100644 --- a/src/class/appClient.ts +++ b/src/class/appClient.ts @@ -52,9 +52,7 @@ export class AppClient extends Client { async start() { await this.registerModules(); await this.registerBaseListener(); - await this.login(process.env.botToken); - this.emit("warn", "\n\n|--------Bot is online!--------|\n\n"); await ytFetch.getVideos(); setInterval(async () => await ytFetch.getVideos(), 3600000); @@ -73,7 +71,7 @@ export class AppClient extends Client { const publics = [...coreCommands?.publics, ...pluginsCommands?.publics]; const privates = [...coreCommands?.privates, ...pluginsCommands?.privates]; - this.on("ready", async () => { + this.on("shardReady", async () => { try { await this.registerCommands({ commands: publics }); const guildIds = process.env.guildIds.split(','); @@ -85,8 +83,10 @@ export class AppClient extends Client { }); } } catch (error) { - console.error("On ready error:", error) + console.error("On Shard-Ready error:", error) } + + console.info("|--------Bot is online!--------|\n\n"); }); } @@ -99,7 +99,7 @@ export class AppClient extends Client { const pluginsDirectories = await getDirectories(pluginBasePath); if (!pluginsDirectories?.length) { - console.warn("No plugins found:", pluginBasePath); + console.error("No plugins found:", pluginBasePath); return { publics, privates }; } @@ -149,33 +149,21 @@ export class AppClient extends Client { if (guildId) { try { - this.guilds.cache.get(guildId)?.commands.set(commands); - console.info(`\nRegistered ${commands.length} commands to ${guildId}`); + await this.application?.commands.set(commands, guildId); + console.info(`Registered ${commands.length} commands to ${guildId}`); } catch { } return; } - this.application?.commands.set(commands); - console.info(`Registered ${commands.length} global commands\n`); + await this.application?.commands.set(commands); + console.info(`Registered ${commands.length} global commands`); } addClientLogger(id: string) { if (!this.clientsLoggers?.has(id)) { this.clientsLoggers.set(id, new AppLogger('client', id, 'info')); - this.emit('debug', `Your Client-logger: is online!`); - this.emit('warn', `Client-logger ${id}: is online!`); - } - else { - this.emit('warn', "Logger " + id + " already in the collection..."); - this.emit('debug', "This logger already have a stream..."); - } - } - - logToClient(id: string, message: string) { - if (this.clientsLoggers?.has(id)) { - this.emit('debug', `Login to client ${id}: ` + message) - this.clientsLoggers.get(id).logger.info(message); + console.info(`Client-logger ${id}: is online!`); } } @@ -189,7 +177,7 @@ export class AppClient extends Client { commandFiles = await getFiles(dirPath); if (!commandFiles?.length) { - console.warn("No commands found:", dirPath); + console.error("No commands found:", dirPath); return { publics, privates }; } @@ -208,7 +196,7 @@ export class AppClient extends Client { const command: CommandType = await importFile(filePath); if (!command?.name) { - console.error("Error a command import:"); + console.error("Error at command import:", filePath); console.error(command); continue; }; diff --git a/src/commands/banner.ts b/src/commands/banner.ts index c61ca10..0793dcb 100644 --- a/src/commands/banner.ts +++ b/src/commands/banner.ts @@ -34,7 +34,7 @@ export default new Command({ const type = args.getInteger("type", false) ? "goodbye" : "welcome"; const channel = args.getChannel('channel', false, [ChannelType.GuildText]) ?? guild.systemChannel; - + interaction?.channel?.sendTyping(); await sendBanner(member, type, channel); interaction.reply({ content: "Done!", ephemeral: true }); @@ -52,8 +52,6 @@ export async function sendBanner( interaction?: any) { if (!member || member.user.bot) return; - - debugger const defConfigs = getGuildConfigsById("default"); const guildConfigs = getGuildConfigsById(member.guild.id) ?? defConfigs; @@ -73,7 +71,6 @@ export async function sendBanner( : member.guild.systemChannel; channel = channelOverride ? channelOverride : channel; - debugger const card = await newCard.render(member, cardData.getTitle(), cardData.getMsg({ member })); return await DiscordManager.guildSend(channel, { content: getContent({ member }),