Updated readme

This commit is contained in:
Myx
2023-10-18 01:58:28 +02:00
parent 0ea4cb7bdd
commit 49189adfb9

View File

@@ -1,30 +1,59 @@
![randommemer discord bot logotype](/client/web/logo.svg)
# get started
# What is this!?
this is a discord bot that joins a random voice channel in a random guild and plays a random sound file (mp3). it uses the `@discordjs/voice` library for voice connections and the `node-schedule` library for scheduling the next join. the bot also starts a web server using the `startserver` function from the `webserver` module.
install ffmpeg
* linux: ``sudo apt install ffmpeg``
* general install (all OS): [Link to download](https://ffmpeg.org/download.html)
## Get started
run ``npm i`` then ``npm run create`` insert your token in the .env file in root folder. Then run ``npm start``
to use this project, you'll need to install FFmpeg:
- For Linux, run the command `sudo apt install ffmpeg` in your terminal.
- For other operating systems, download FFmpeg from [the official website](https://ffmpeg.org/download.html) and install it.
once you have FFmpeg installed, follow these steps to get the project up and running:
1. Run `npm i` in your terminal to install all dependencies.
2. Run `npm run create` to create the `.env` file in the root folder.
3. Open the `.env` file and insert your Discord bot token.
4. Run `npm start` to start the project.
[OPTIONAL]
on server i run this using [pm2](https://pm2.keymetrics.io/) to manage it.
## what is this!?
bot randomly picks mp3 files from folder and plays them randomly in joined server.
## Configuration
if the command `npm run create` doesnt work, create a .env file with the following contents in same folder as bot.ts:
it only joins voice channels that arent empty and it plays a sound with a interval of 10 min to 12 hours.
this might be effected by how many servers it has joined.
```
TOKEN=<your Discord bot token>
INTERVALMIN_MINUTES=<minimum interval in minutes>
INTERVALMAX_HOURS=<maximum interval in hours>
VOICECHANNELRETRIES=<number of retries to find a voice channel with members in it>
```
replace `<your Discord bot token>` with your actual Discord bot token. replace `<minimum interval in minutes>`, `<maximum interval in hours>`, and `<number of retries to find a voice channel with members in it>` with your desired values.
### How to get discord token
Helpful links for creating your discord application and finding the token:
[Getting token](https://discordgsm.com/guide/how-to-get-a-discord-bot-token) | [Discord Developer Portal](https://discord.com/developers/docs/getting-started)
### How do I get it into my Discord server?
once the bot start successfully youll get the full invitation link in the terminal.
## ...
## Libraries Used
this is rushed like crazy, did this in 30-40min but should work, for now until discord updates their api and stuff
this bot uses the following libraries:
- `@discordjs/voice`: For voice connections.
- `discord.js`: For interacting with the Discord API.
- `dotenv`: For loading environment variables from a `.env` file.
- `fs`: For reading files from the file system.
- `node-schedule`: For scheduling the next join.
- `express`: For starting a web server.
## misc
inv link: https://discord.com/oauth2/authorize?client_id=[REPLACE_THIS_WITH_YOUR_APPLICATIONID]&scope=bot&permissions=2184391704 when you place your token in the .env file, once the bot start youll get the full inv link in the terminal.
## Contributing
if you'd like to contribute to this project, please fork the repository and create a pull request with your changes.
### Other
[![HitCount](https://hits.dwyl.com/myxelium/RandomMemerBot.svg?style=flat&show=unique)](http://hits.dwyl.com/myxelium/RandomMemerBot)