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 song history

Pre-requisites

  • Node.js 16.6.0 or higher, with Additional Tools for Node.js
  • A Discord bot account
    • Create a Discord bot application here (Instructions here)
  • YouTube Cookies

Usage

  • Clone the repository, or download the zip file here
  • Install the dependencies with pnpm install
  • Create a file called .env, and add these values
  • Compile the code with npm run build
  • Setup play-dl by running npm run setup-play-dl, and follow the shown instructions
  • Run the bot with npm run start

.env contents

BOT_TOKEN

The token of the bot. Available in the Discord developer portal.

BOT_CLIENT_ID

The client ID of the bot. Only required to delete the slash command registry

OWNER_USER_IDS

The user id of the owner(s).

Separate multiple owners with a comma.

It should look like this: 689607114011705439,123456789012345678

Adding spaces before and after the comma should work too.

To get someones user id, enable developer mode in your Discord settings, and right click on the user. You should see an option called Copy ID.

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.

To use this, set the value to true. Any other value will not create the HTTP server.

Your .env file should look like this:

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

# Optional
CREATE_HTTP_SERVER = true