Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lon9/discord-generalized-sound-bot

Generalized sound bot on Discord
https://github.com/lon9/discord-generalized-sound-bot

bot discord discord-bot docker golang nuxt sound vue

Last synced: 5 days ago
JSON representation

Generalized sound bot on Discord

Awesome Lists containing this project

README

        

# Discord Generalized Sound Bot

Discord Generalized Sound Bot is a bot that can play sounds on your Discord server.

[![Build Status](https://travis-ci.org/lon9/discord-generalized-sound-bot.svg?branch=master)](https://travis-ci.org/lon9/discord-generalized-sound-bot)

## Features

* Playing a sound on your Discord server.
* You can add sounds with web interface.
* You can search sounds on the web.
* No limit of the number of sounds.

## Usage

1. Create config files

`.env`

```shell
BACKEND_URL=http://localhost:3000
BACKEND_VIRTUAL_HOST=backend.example.com
BACKEND_LETSENCRYPT_HOST=backend.example.com
BACKEND_LETSENCRYPT_EMAIL=example.com
ADMIN_VIRTUAL_HOST=admin.example.com
ADMIN_LETSENCRYPT_HOST=admin.example.com
ADMIN_LETSENCRYPT_EMAIL=example.com
WEB_VIRTUAL_HOST=example.com
WEB_LETSENCRYPT_HOST=example.com
WEB_LETSENCRYPT_EMAIL=example.com
ADMIN_TITLE=Admin title here
WEB_TITLE=Web title here
WEB_DESCRIPTION=Description
WEB_OG_DESCRIPTION=Og description
WEB_OG_URL=Og url
WEB_OG_IMAGE=Og image
WEB_TWITTER_CARD=summary_large_image
```

`backend/config/environment/production.yaml`

```yaml
db:
url: "data/production/sounds.db"
server:
port: "3000"
cors:
- "http://example.com"
- "http://admin.example.com"
data:
path: "data/production"
prefix: "sounds_dca"
auth:
secret: "secret"
username: "admin"
password: "Hashed password"
```

You can make password using genpass

```shell
docker build -t genpass genpass/
docker run --rm -it genpass genpass
```

`bot/config.yml`

```yaml
botToken: abcde [Discord bot token]
dbUrl: /sounds_dca/sounds.db [Where the sounds.db is]
botPrefix: $ [Bot command prefix]
botHelp: Help message [Bot help message]
botPlaying: Playing something [Bot status]
botNotFound: Sound not found [The message when sound not found]
soundDir: /
name: ExampleBot [Bot name]
applicationId: 1234567 [Discord application id]
soundCacheSize: 100 [The number of cached sounds]
maxQueueSize: 6 [The size of queue per guild]
env: development [Environment]
logChannelId: 1234567 [Channel ID you want to send log on the channel]
```

1. `docker-compose up -d`

### addsound module

You can use `addsound` module to initialize database from a directory structure.

Check out addsound [directory](https://github.com/lon9/discord-generalized-sound-bot/tree/master/addsound)

## Development

I'm maintaining backend with test.

```shell
docker-compose -f docker-compose-test.yml run --rm backend-test
```

### Dependencies

backend depends on FFmpeg with opus and libvorbis

### TODO

- [x] Making a bot.
- [x] Making a web site to search sound name.
- [x] Making a admin site to add sounds.
- [x] Add Docker things.
- [x] Implement session sharding.
- [x] Implement a command to search sounds.