Skip to content

ywssp/bot.wssp

Repository files navigation

bot.wssp

Codacy grade License

A Discord bot that only uses slash commands.

  • Written in TypeScript
  • Has music commands with a queue/history system
  • Supports YouTube, SoundCloud, Spotify, and LISTEN.moe

Pre-requisites

  • Node.js 22 or higher, with Additional Tools
  • A Discord bot account (Guide)
  • YouTube Cookies (Guide)
  • A Spotify Application (Guide)

Setup

  • Clone the repository, or download the zip file here
  • Install the dependencies by running npm install in the terminal
  • Create a file named .env, and add these values
  • Compile the source code with npm run build
  • Setup play-dl by running npm run setup-play-dl, and add the YouTube cookies and Spotify application details.

Running the bot

  • Run the bot with npm run start

Updating

  • Pull the latest changes from the repository, or re-download the zip file
  • Update dependencies with npm update
  • Recompile the source code with npm run build

Required ENV fields

Example .env file

BOT_TOKEN = NzIwNjA1ODE4MzgyMzE5Njk4.XuIadw.kjtUXvBOzzTxepM_R3y5eW7mBnc
BOT_CLIENT_ID = 720605818382319698
OWNER_USER_IDS = 689607114011705439

BOT_TOKEN

The token of the bot. Required to login to Discord.

Available in the Discord developer portal.

BOT_CLIENT_ID

The client ID of the bot. Used to modify the slash commands of the bot.

Also available in the Discord developer portal.

OWNER_USER_IDS

The user id of the bot owner(s). Multiple user ids should be separated by a ,.

To get a Discord user's id, enable Developer Mode (Settings > Advanced) in your Discord settings, and right click on the user. You should see an option called Copy ID.

The field should look like 689607114011705439,123456789012345678

Optional ENV fields

These values are optional, and can be added to the .env file.

CREATE_HTTP_SERVER = true
DEBUG = true

CREATE_HTTP_SERVER

Useful if you are hosting the bot on an online service that automatically stops the bot after a short period of time, like Replit.

Set the field to true to enable.

DEBUG

Logs debug information to the console. Set the field to true to enable.