Skip to content

Cleaning bot provides a useful deletion command, note this bot was created for some communities and the purpose was to ONLY clean messages.

License

Notifications You must be signed in to change notification settings

caiodomingues/cleaning-bot

Repository files navigation

Cleaning Bot

🤖 This bot is designed to clean up the chat with some predefined rules.

Rules

Defining a specific channel

Add SPECIFIC_CHANNEL to your .env file, where the value is the ID of the channel you want to clean.

  • The bot will only clean up the channel you specify.
  • If you don't specify a channel, the bot will clean up the current channel.

Defining a specific user (any user/bot)

Add SPECIFIC_USER to your .env file, where the value is the ID of the user you want to clean.

  • The bot will only clean up the user you specify.
  • If you don't specify a user, the bot will clean up ANY user.

Installation

Clone project

git clone [email protected]:caiodomingues/cleaning-bot.git your-app-name
cd your-app-name

Install dependencies

# yarn
yarn install # or just yarn

# npm
npm install # or npm i

Create environment variable files .env based on .env.example on project root folder

# linux / macOS
cp .env.example .env
# windows
copy .env.example .env

Running on development environment

⚠ Remember to follow the Installation steps before proceeding

Running the bot

# yarn
yarn dev # or cross-env NODE_ENV=development env-cmd -f .env tsnd --transpile-only --respawn --no-notify --ignore-watch node_modules ./src/index.ts

# npm
npm run dev

⚠ Note that the loaded environment variables file is .env

Running on production environment

With Docker

⚠ Remember to follow the Installation steps before proceeding

docker build -t your-app-name .
docker run -it --rm -e DISCORD_TOKEN="YOUR TOKEN HERE" --name your-app-name your-app-name

With Docker Compose

⚠ Remember to follow the Installation steps before proceeding

docker compose up -d

⚠ Note that the loaded environment variables file is .env

Without Docker Compose

⚠ Remember to follow the Installation steps before proceeding

Directly

# yarn
yarn deploy

# npm
npm run deploy

⚠ Note that the loaded environment variables file is .env

Manually

# yarn
yarn build

# npm
npm run build

Startup bot

# yarn
yarn start # or cross-env NODE_ENV=production env-cmd -f .env node ./dist/index.js

# npm
npm run start

⚠ Note that the loaded environment variables file is .env

About

Cleaning bot provides a useful deletion command, note this bot was created for some communities and the purpose was to ONLY clean messages.

Topics

Resources

License

Security policy

Stars

Watchers

Forks