Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some quality of life changes #3

Merged
merged 5 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (documentation): Specify shell type for code block.

Adding 'sh' to the code block for Linux/BSD/MacOS/GitBash improves clarity.

Suggested change
```sh
```sh
export BOT_TOKEN=YourBotToken

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
Expand All @@ -192,7 +192,7 @@ cd <TheBotFolderName>

- 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
Expand Down
4 changes: 4 additions & 0 deletions StartMagicord
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
export BOT_TOKEN=PlaceYourTokenHere
npm run build
npm run start
16 changes: 0 additions & 16 deletions StartMagicord[BROKEN]

This file was deleted.

15 changes: 15 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider moving ASCII art to a separate file and optimize logging

While the ASCII art is creative, it might be better to move it to a separate configuration or constants file to keep the main file clean and focused on core functionality. Additionally, logging such a large string on every run could impact startup performance. Consider logging it only in debug mode or on first run to optimize the bot's startup time.

Suggested change
Always free, Always open source`);
import { IntentsBitField, ActivityType } from "discord.js";
import { Client } from "discordx";
import { asciiArt } from "./constants";
if (process.env.DEBUG_MODE === "true") {
console.log(asciiArt);
}


export const bot = new Client({
// To use only guild command
// botGuilds: [(client) => client.guilds.cache.map((guild) => guild.id)],
Expand Down
15 changes: 11 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
"discordx": "^11.12.0",
"fs": "^0.0.1-security",
"loader": "^2.1.1",
"os": "^0.1.2",
"reflect-metadata": "^0.2.2"
},
"devDependencies": {
"@types/node": "^20.14.4",
"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",
Expand Down