I made this bot to get more experience using Carbon! It has some things i say often just as slash commands. Feel free to add it here. Idk why you would but just in case you want to.
If you want to add your own customized messages to the main bot:
const YOUR_DISCORD_NAME = "YOUR_DISCORD_ID"
- From here you have 2 different options:
-
Go to line 69 of the ask-vc.ts file and add an
else if
statement. -
It should look something like this:
else if (userId === YOUR_DISCORD_NAME) { await interaction.reply({ content: "YOUR_MESSAGE_HERE"}); }
-
Copy src/random-messages/example folder (replace example with your name)
-
Replace the example messages with anything you want, it should look like this.
module.exports = [
"Hello, want to vc?",
"Hey can you vc?",
"Hey bro, can you vc?",
]
- After adding your file, go down to line 12 of the ask-vc.ts file and add the following (replace example with your name):
import exampleRandom from "../random-messages/example/example"
- Then you can go to line 46 of the ask-vc.ts file and add the following (replace example with your name):
const askExampleMessage = getRandom(exampleRandom);
- Go to line 69 of the ask-vc.ts file and add the following (replace example with your name):
else if (userId === YOUR_DISCORD_NAME) { await interaction.reply({ content: askExampleMessage}); }
To host your own version of the bot:
- First you must clone the bots repo, do so by running these commands:
git clone https://github.com/Xanderxx46/Xan-Utils
cd Xan-Utils
- Then, you need to install the dependencies:
npm install
- Then, add all the varibles:
npx wrangler secret put CLIENT_ID
npx wrangler secret put PUBLIC_KEY
npx wrangler secret put DISCORD_TOKEN
- Then you can run the bot using:
npm run build
-
Once given the bots worker url, go to
https://xan-utils.{YOUR_CLOUDFLARE_NAME}.workers.dev/deploy
to deploy the commands. -
Dont forget to go to the Discord Dev Portal and add
https://xan-utils.{YOUR_CLOUDFLARE_NAME}.workers.dev/interaction
as your interaction URL.
To host the bot any other way, please use the Carbon Docs to convert the index.ts file to use any thing else.
You can use the Carbon Docs to make more commands.