mdodell / SurvivorCircleDiscordBot

A Discord Bot for the Survivor Circle: Discord server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord server NPM version NPM downloads Build status paypal

Create a discord bot with TypeScript and Decorators!

Installation

  • git clone https://github.com/oceanroleplay/discord.ts-example

  • cd discord.ts-example

  • npm install

  • npm run build

  • set BOT_TOKEN=<your bot token>

    if you don't have token yet than create one at discord developer portal

  • npm run start

you are done, you will see your bot up and running. For detailed installation guide, please see this

Use global command only

This repository uses guild commands instead of global commands by default. This is because global command needs approximately 15 minutes to update itself every time.

1. How do I use global command only?

2. How do I make specific guild command?

Use CommonJS

This repo is targed to use ECMAScript modules by default. Follow these steps to use CommonJS.

Update package.json

{
  // ...
  "type": "commonjs",
  // ...
  "scripts": {
    "build": "tsc",
    "dev": "ts-node src/main.ts",
    "start": "nodemon --exec ts-node src/main.ts",
    "serve": "node build/main.js"
  }
  // ...
}

Update tsconfig.json

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "CommonJS"
    // ...
  }
}

Update main.ts

async function run() {
  // with cjs
  await importx(__dirname + "/{events,commands}/**/*.{ts,js}");
  // with ems
  // await importx(dirname(import.meta.url) + "/{events,commands}/**/*.{ts,js}");
  client.login(process.env.BOT_TOKEN ?? ""); // provide your bot token
}

☎️ Need help?

Ask in discord server or open a issue

Thank you

Show your support for discordx by giving us a star on github.

About

A Discord Bot for the Survivor Circle: Discord server.


Languages

Language:TypeScript 100.0%