Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dongle-the-gadget/myfirsttsbot
A Discord bot written in TypeScript that may or may not have a reason to exist ¯\_(ツ)_/¯
https://github.com/dongle-the-gadget/myfirsttsbot
discord discord-bot discord-js discord-js-bot discord-ts discord-ts-bot discordx docker javascript node node-js nodejs ts typescript
Last synced: 10 days ago
JSON representation
A Discord bot written in TypeScript that may or may not have a reason to exist ¯\_(ツ)_/¯
- Host: GitHub
- URL: https://github.com/dongle-the-gadget/myfirsttsbot
- Owner: dongle-the-gadget
- License: mit
- Archived: true
- Created: 2021-11-03T09:54:55.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-12T05:30:23.000Z (about 2 years ago)
- Last Synced: 2024-09-29T09:20:29.156Z (4 months ago)
- Topics: discord, discord-bot, discord-js, discord-js-bot, discord-ts, discord-ts-bot, discordx, docker, javascript, node, node-js, nodejs, ts, typescript
- Language: TypeScript
- Homepage:
- Size: 161 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MyFirstTSBot
A Discord bot written in TypeScript that may or may not have a reason to exist ¯\\\_(ツ)_/¯## Hosting
### Quickstart
1. Install Docker Engine and Docker Compose.
- For macOS and Windows, install [Docker Desktop](https://www.docker.com/get-started). This includes both Docker Engine and Docker Compose.
- For Linux, follow these instructions:
- [Install Docker Engine](https://docs.docker.com/engine/install/).
- [Install Docker Compose](https://docs.docker.com/compose/install/).
2. Download the [docker-compose.yml](/docker-compose.yml) file from this repo.
3. On the folder containing the `docker-compose.yml` file, create a `.env.production` file using the `KEY=VALUE` structure
| Key | Value | Required? |
|-----------|-----------------------------------------------------|----------------------------------------------------------------------|
| BOT_TOKEN | Your Discord bot token. | Required. |
| PET_API | https://thecatapi.com or https://thedogapi.com key. | Required for `/pictures cat` or `/pictures dog`, otherwise optional. |
| GUILD_ID | Server ID. | Optional for production, required for development. |
4. On a command prompt/terminal window, `cd` to the folder containing the `docker-compose.yml` file.
5. Type `docker-compose up -d` and press Enter, Docker Compose will download the required files and run the bot for you.**Note:** The `docker-compose.yml` file also includes the watchtower container for auto-updating. If you wish to manually update the bot, you can run `docker-compose pull` then `docker-compose up -d`.
### Standalone production
1. Install [Node.js](https://nodejs.org/en/).**Note:** You also need the `npm` (Node Package Manager).
2. Clone this repository.
3. Create a `.env.production` file on the folder containing the cloned repository. See step 3 of [quickstart](#quickstart).
4. Open a command prompt/terminal window, `cd` to the folder containing the cloned repository, and execute `npm i`.
5. Once `npm i` is finished, run `npm start`. The bot will now run.### Development version
1. Follow step 1 and 2 of [standalone production](#standalone-production).
2. Create a `.env.development` file on the folder containing the clone repository. See step 3 of [quickstart](#quickstart).
3. Open a command prompt/terminal window, `cd` to the folder containing the cloned repository, and execute `npm i`.
4. Once `npm i` is finished, run `npm run dev`. The bot will now run.**Note:** With `npm run dev`, `nodemon` will track file changes and restart the bot once a file is changed.