GithubHelp home page GithubHelp logo

clawcastle / sound-boart Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 982 KB

Discord bot for playing user-uploaded sounds via text commands.

License: GNU General Public License v3.0

Dockerfile 0.54% TypeScript 99.46%
discord-bot typescript

sound-boart's Introduction

Sound-boart

Sound-boart is a discord bot that allows you to upload short sound clips and playing them in your Discord channel. It also contains features such as listing and categorising these sounds, and setting a sound that will play whenever you join a voice channel.

All sounds uploaded only exist in the context of the Discord server you upload them within. This means that you cannot play a sound that is only uploaded on Server1 when in a voice channel belonging to Server2.

If you want to add sound-boart to your Discord server, use the following link: https://discord.com/api/oauth2/authorize?client_id=682259204790157375&permissions=36711680&scope=bot

How to use the bot

Below is a list explaining the different commands available.

Play sound

Plays a sound by the name specified if it exists. Use like this: $<sound-name>. Can also be used to play multiple sound consecutively (at most 3), like this: $<sound_name1> <sound_name2> <sound_name3>

Upload sound

Uploads a sound to the server. The sound can then be referenced and played by the name you specify in this command (not the name of the file you upload). The file should be sent as an attachment to the message you send with the upload command. The current size limit is 5MB. Mind that only .mp3 files are valid. Use like this: $up <sound-name>

Rename sound

Renames a sound. Use like this: $rename <sound-name> <new-sound-name>

Delete sound

Deletes a sound. Use like this: $delete <sound-name>

List sounds

Lists all sounds available for the server. Use like this: $list

Search for sounds

Searches for sounds containing the given query string. Use like this: $find <query_string>

Set greeting sound

Sets the sound to be played when you join a voice channel. Use like this: $set-greet <sound-name>

Remove greeting sound

Clears your greeting sound if you have specified one (does not delete the sound itself). Use this this: $remove-greet

Tag sound

Tags a sound with a name. Can be used for categorizing sounds so they can easily be found. Use like this: $tag <sound-name> <tag-name>

Rename tag

Renames a tag. Use like this: $rename-tag <tag-name> <new-tag-name>

Delete tag

Deletes a tag (not the sounds within the tag). Use like this: $delete <tag-name>

List tags

Lists all tags. Use like this: $tags

List sounds with specific tag

Lists all sounds tagged with a specific tag. Use like this: $tagged <tag-name>

Running the bot yourself

Running the bot yourself is pretty simple. First, clone the repo by writing git clone [email protected]:sunero4/sound-boart.git in a terminal or using your git client of choice.

Then, rename the sampleConfig.ts file to config.ts and replace the relevant values for your Discord bot token and the directories to store data.

After this, assuming you have installed node.js on your machine, it should be as simple as running the following commands:

  • npm install.
  • npm run build to run the Typescript compiler.
  • node ./dist/app.js (or npm start assuming you have nodemon installed) and the bot should be up and running.

Alternatively, if you have Docker and docker-compose installed, you can simply run docker-compose up. Make sure to specify the sounds and settings directories to match the path used for the volume in the docker-compose.yml file (at least if you wish to persist the data).

sound-boart's People

Contributors

clawcastle avatar dependabot[bot] avatar

Stargazers

X5 Engine avatar Euan Caskie avatar bobi avatar

Watchers

James Cloos avatar  avatar

sound-boart's Issues

Searching for sounds

Make a simple search function that allows for searching for sounds that contain a certain string in their name. Could be used somewhat like this:

$find query_string

Memoize getCommandParts function

Right now, the getCommandParts function is probably the one that is called the most often in the entire application, as it is invoked multiple times for each command. It could easily be memoized to greatly reduce the amount of string arrays allocated.

Migrate metadata from files to database

Use a proper database (either Postgres or Sqlite) for storing metadata like usage metrics and other configuration, rather than having to read an entire json file into memory every time.

Update ReadMe

The ReadMe should be updated with the following:

  • Information about how to use the bot. Basically the same content as the "help" command.
  • Link to add the bot to ones server

Disconnect client when process exits

Right now there is some pretty strange behavior whenever the bot is deployed, where multiple instances seem to be running even though the container gets killed. I think this is because the Discord client isn't properly disposed when the process exits.

Log to file

Write logs to a file instead of just using console.log, since they disappear every time the app is deployed.

Update help command

The help command isn't up to date as it doesn't contain information about all commands. It also doesn't take custom prefix into account.

Implement logging + tracing

Add logging and tracing to event handling. Honeycomb for tracing and Sentry for exception logging seem like solid candidates and both have free tiers.

  • Add tracing with Honeycomb
  • Add error logging with Sentry

Remove dependency to Azure Blob Storage

Right now the only option for storing the sounds is Azure Blob Storage. The files should just be placed in a configurable location on disk, which could then potentially be a volume mount.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.