phasebot v0.8.2
Phasebot
Phasebot provides an array of utilities for building and running bots with discord.js.
It handles the boilerplate code for you, and provides a useful CLI tool for speedily running and compiling your code using the full power of the bun runtime and bundler.
Note: Since the CLI heavily relies on bun to work, only the bun runtime is supported at the moment. I plan to add support for other runtimes like Node.js and Deno in the future.
Getting Started
First, install both the phasebot
and discord.js
packages:
bun install phasebot discord.js
Then create a phase.config.{ts,js,cjs,mjs}
file in your project root, and copy in the following code:
import { ActivityType, Partials } from "discord.js"
import { setConfig } from "phasebot"
export default setConfig({
intents: [
// Add your intents here ...
],
partials: [
// Add your partials here ...
],
presence: {
activities: [
{
name: "🟢 I'm online!",
type: ActivityType.Custom,
},
],
status: "online",
},
})
After that, make a .env
file in your project root, and add the following:
DISCORD_TOKEN="your-bot-token"
Then finally, start the bot in your terminal with the following command:
bun run phase dev
And that's it! Your bot is now running and ready to go.
More documentation coming soon!