Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jayxtq/cat-bot
Discord bot dedicated to cats
https://github.com/jayxtq/cat-bot
Last synced: 25 days ago
JSON representation
Discord bot dedicated to cats
- Host: GitHub
- URL: https://github.com/jayxtq/cat-bot
- Owner: JayXTQ
- Created: 2024-03-09T15:15:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-23T10:12:55.000Z (6 months ago)
- Last Synced: 2024-05-23T10:28:41.616Z (6 months ago)
- Language: TypeScript
- Homepage: https://discord.com/oauth2/authorize?client_id=1215749607657836606&permissions=51200&scope=bot+applications.commands
- Size: 75.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# cat-bot
The public repository for the "Cat" bot on Discord, made by [Jay](https://jayxtq.xyz).
I am already hosting this bot for public use if you don't want to host it yourself, this repository only exists just to show the code and allow others to contribute to the bot if they wish to do so.
Here is the invite link: https://discord.com/oauth2/authorize?client_id=1215749607657836606&permissions=51200&scope=bot+applications.commands
## Features
Daily cat images and facts, as well as a few other commands to give you information on your favourite feline friends :3
## Dependencies
- discord.js
- axios
- drizzle
- cron
- pg (postgres)
- typescript## Setup
1. Clone the repository
2. Run `npm install`
3. Rename `.env.example` to `.env` and fill in the required fields, you will reqiure a postgres database which works with the `pg` package if you wish to contribute towards the database side of things, to get more info, check the [database](#database) section below.
4. Run `npm run dev` to start the bot in development mode, or `npm run dev:watch` to start the bot in development mode with file watching
5. Enjoy!## Database
For databases, I am using heroku, the database stuff on there is free and works with the `pg` package. To get a database from Heroku you will need to setup an app on Heroku, then install the [Heroku Postgres](https://elements.heroku.com/addons/heroku-postgresql) add-on, then you can get the database URL from the settings tab of the add-on and use that as the `DATABASE_URL` in the `.env` file.
Once you have the database URL in the `.env` file, you can run `npm run db:generate` to generate some SQL commands you will need to run inside your database to setup the tables and columns required for the bot to work, these commands will generate inside of a file located in the `drizzle` folder just created, you should see a file looking somewhat like `x_y_z.sql` (x, y and z are all to be replaced with whatever, x should be 4 numbers and y and z should be words, doesn't matter), Heroku sadly does not have an SQL executor if you are using them, so what I recommend is installing [Beekeeper Studio](https://github.com/beekeeper-studio/beekeeper-studio) to run the SQL commands, Beekeeper is also quite useful at just looking at the database anyway.
You should be able to run the bot now.