From a45bc95365bb31e106c0c14017932c5f9a2a8091 Mon Sep 17 00:00:00 2001 From: bikoil Date: Wed, 31 Jul 2024 02:55:05 +0300 Subject: [PATCH 1/5] installed packages --- package-lock.json | 15 +++++++++++---- package.json | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29a585b..5901ae2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "discordx": "^11.12.0", "fs": "^0.0.1-security", "loader": "^2.1.1", + "os": "^0.1.2", "reflect-metadata": "^0.2.2" }, "devDependencies": { @@ -21,7 +22,7 @@ "nodemon": "^3.1.3", "prettier": "^3.3.2", "ts-node": "^10.9.2", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": ">=16.0.0", @@ -931,6 +932,12 @@ "node": ">=0.10.0" } }, + "node_modules/os": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz", + "integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ==", + "license": "MIT" + }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", @@ -1289,9 +1296,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index d40b04e..8539b66 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "discordx": "^11.12.0", "fs": "^0.0.1-security", "loader": "^2.1.1", + "os": "^0.1.2", "reflect-metadata": "^0.2.2" }, "devDependencies": { @@ -24,7 +25,7 @@ "nodemon": "^3.1.3", "prettier": "^3.3.2", "ts-node": "^10.9.2", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": ">=16.0.0", From b9bed65241d1a3fdd54973fca640d4af924233ab Mon Sep 17 00:00:00 2001 From: bikoil Date: Thu, 1 Aug 2024 00:20:12 +0300 Subject: [PATCH 2/5] Added a more fancy start for magicord and better start script --- StartMagicord[BROKEN] | 20 ++++---------------- main.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/StartMagicord[BROKEN] b/StartMagicord[BROKEN] index b933cf3..8349a49 100755 --- a/StartMagicord[BROKEN] +++ b/StartMagicord[BROKEN] @@ -1,16 +1,4 @@ -#!/bin/bash -# Start Minikube (if not already running) -minikube start - -# Set Docker environment to Minikube -eval $(minikube docker-env) - - -# Apply Kubernetes deployment and service (replace with your actual YAML file names) -kubectl apply -f deploy-commands-job.yaml -kubectl apply -f deployment.yaml -kubectl apply -f service.yaml - - -# Get logs to monitor bot (optional) -kubectl logs -f $(kubectl get pods --selector=app=discord-bot -o jsonpath='{.items[0].metadata.name}') \ No newline at end of file +#!/bin/sh +export BOT_TOKEN=PlaceYourTokenHere +npm run build +npm run start \ No newline at end of file diff --git a/main.ts b/main.ts index b014348..44a872f 100644 --- a/main.ts +++ b/main.ts @@ -3,6 +3,21 @@ import type { Interaction, Message } from "discord.js"; import { IntentsBitField, ActivityType } from "discord.js"; // Import ActivityType import { Client } from "discordx"; +console.log(`$$\\ $$\\ $$\\ $$\\ +$$$\\ $$$ | \\__| $$ | +$$$$\\ $$$$ | $$$$$\\\\ $$$$$\\\\ $$\\ $$$$$$$\\ $$$$$\\\\ $$$$$\\\\ $$$$$$$ | +$$\\$$\\$$ $$ | \\____$$\\ $$ __$$\\ $$ |$$ _____|$$ __$$\\ $$ __$$\\ $$ __$$ | +$$ \\$$$ $$ | $$$$$$$ |$$ / $$ |$$ |$$ / $$ / $$ |$$ | \\__|$$ / $$ | +$$ |\\$ /$$ |$$ __$$ |$$ | $$ |$$ |$$ | $$ | $$ |$$ | $$ | $$ | +$$ | \\_/ $$ |\\$$$$$$$ |\\$$$$$$$ |$$ |\\$$$$$$$\\ \\$$$$$$ |$$ | \\$$$$$$$ | +\\__| \\__| \\_______| \\____$$ |\\__| \\_______| \\______/ \\__| \\_______| + $$\\ $$ | + \\$$$$$$ | + \\______/ + + + Always free, Always open source`); + export const bot = new Client({ // To use only guild command // botGuilds: [(client) => client.guilds.cache.map((guild) => guild.id)], From 5c227d23364054e684ee76c03fa6ecb73d3b11aa Mon Sep 17 00:00:00 2001 From: bikoil Date: Thu, 1 Aug 2024 00:20:55 +0300 Subject: [PATCH 3/5] Changed mode of start script and name --- StartMagicord[BROKEN] => StartMagicord | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename StartMagicord[BROKEN] => StartMagicord (100%) diff --git a/StartMagicord[BROKEN] b/StartMagicord similarity index 100% rename from StartMagicord[BROKEN] rename to StartMagicord From 86a98ad4eaaed13a0a1bf40ec95f144e1e7e6d30 Mon Sep 17 00:00:00 2001 From: bikoil Date: Thu, 1 Aug 2024 00:26:29 +0300 Subject: [PATCH 4/5] Fixed some issues in documentation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48e3e54..d0c5356 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ __NOTE THAT MOST OF THESE FEATURES HAVE NOT BEEN IMPLEMENTED YET__ # How to setup the bot > [!IMPORTANT] -> Before setting up the bot, you must have at least some javascript skill or are familliar with the language, do not open issues on learning javascript/typescript or "where do i begin from", please look at [Discord.js guide](https://discordjs.guide) and [Discordx guide](https://discordx.js.org/docs/discordx/getting-started/) for more information about discord typescript, you may also learn javascript at the [JavaScript website](https://www.javascript.com/) and typescript at [Typescript website](https://www.typescriptlang.org/docs/), Also, you may need to have some knowledge about the terminal and how to use it including bash and other shells. +> Before setting up the bot, you must have at least some javascript skill or are familiar with the language, do not open issues on learning javascript/typescript or "where do i begin from", please look at [Discord.js guide](https://discordjs.guide) and [Discordx guide](https://discordx.js.org/docs/discordx/getting-started/) for more information about discord typescript, you may also learn javascript at the [JavaScript website](https://www.javascript.com/) and typescript at [Typescript website](https://www.typescriptlang.org/docs/), Also, you may need to have some knowledge about the terminal and how to use it including bash and other shells. > Please also Keep in mind this bot is not complete at all, and is still being worked on. @@ -175,11 +175,11 @@ Then run the following // For cmd set BOT_TOKEN=YourBotToken // For powershell -$ENV:BOT_TOKEN="REPLACE_THIS_WITH_YOUR_BOT_TOKEN" +$env:BOT_TOKEN="YourBotToken" ``` - **Linux/BSD/MacOS/GitBash** -``` +```sh export BOT_TOKEN=YourBotToken ``` After this, you are all set! you just need to do the following to run the ot and make it online @@ -192,7 +192,7 @@ cd - You will need to install all the dependencies ```bash -npm install discors.js discordx os fs typescript +npm install discord.js discordx os fs typescript ``` - Then run From ce8572650aff8cacaeeca4a4dfb74459ae87637c Mon Sep 17 00:00:00 2001 From: bikoil Date: Thu, 1 Aug 2024 00:39:52 +0300 Subject: [PATCH 5/5] Small documentation changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0c5356..9fe8540 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ __NOTE THAT MOST OF THESE FEATURES HAVE NOT BEEN IMPLEMENTED YET__ # How to setup the bot > [!IMPORTANT] -> Before setting up the bot, you must have at least some javascript skill or are familiar with the language, do not open issues on learning javascript/typescript or "where do i begin from", please look at [Discord.js guide](https://discordjs.guide) and [Discordx guide](https://discordx.js.org/docs/discordx/getting-started/) for more information about discord typescript, you may also learn javascript at the [JavaScript website](https://www.javascript.com/) and typescript at [Typescript website](https://www.typescriptlang.org/docs/), Also, you may need to have some knowledge about the terminal and how to use it including bash and other shells. +> Before setting up the bot, you must have at least some JavaScript skill or are familiar with the language, do not open issues on learning JavaScript/TypeScript or "where do I begin from", please look at [Discord.js guide](https://discordjs.guide) and [Discordx guide](https://discordx.js.org/docs/discordx/getting-started/) for more information about Discord TypeScript, you may also learn JavaScript at the [JavaScript website](https://www.javascript.com/) and TypeScript at [TypeScript website](https://www.typescriptlang.org/docs/), Also, you may need to have some knowledge about the terminal and how to use it including bash and other shells. > Please also Keep in mind this bot is not complete at all, and is still being worked on.