https://github.com/jacoblincool/pure-cat
A Modular Discord Bot (Framework).
https://github.com/jacoblincool/pure-cat
discord-bot
Last synced: about 1 year ago
JSON representation
A Modular Discord Bot (Framework).
- Host: GitHub
- URL: https://github.com/jacoblincool/pure-cat
- Owner: JacobLinCool
- License: mit
- Created: 2022-08-14T18:55:34.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:53:18.000Z (over 2 years ago)
- Last Synced: 2025-05-06T11:46:56.209Z (about 1 year ago)
- Topics: discord-bot
- Language: TypeScript
- Homepage: https://jacoblincool.github.io/pure-cat
- Size: 485 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pure Cat
A Modular Discord Bot (Framework).
## Features
- Write slash commands declaration and implementation in one place.
- Modular usage.
For example, we have three files: `bot.ts`, `register.ts`, `run.ts`:
```ts
// bot.ts - Define what the bot should look like.
import { Bot } from "pure-cat";
import { DNS } from "pure-cat-module-dns";
import { EventLog } from "pure-cat-module-event-log";
import { Marquee } from "pure-cat-module-marquee";
import { Welcome } from "pure-cat-module-welcome";
import { LoggerControl } from "pure-cat-module-logger-control";
import { Click } from "pure-cat-module-click";
import { BOT_ID, STORAGE } from "./config";
export const bot = new Bot(BOT_ID, STORAGE)
.use(new EventLog())
.use(new Marquee(["I am a cool bot!", "Beep boop!"]))
.use(new DNS())
.use(new LoggerControl())
.use(new Click())
.use(new Welcome({ messages: ["Hi <@${id}>!"] }));
```
```ts
// register.ts - Register slash commands.
import { bot } from "./bot";
import { BOT_TOKEN } from "./config";
bot.register(BOT_TOKEN);
```
```ts
// run.ts - Run the bot.
import { bot } from "./bot";
import { BOT_TOKEN } from "./config";
bot.login(BOT_TOKEN);
```
## Docker
First, create an `.env` file with the following contents:
```ts
BOT_ID=
BOT_TOKEN=
```
Then, run:
```sh
docker compose up -d
```
Every thing should just work.