Git Product home page Git Product logo

discord-sound-bot's Introduction

Discord Soundboard Bot

This is a Python Discord bot that plays sound files in voice channels.

Installation

  1. Install Python 3.8 or later
  2. Install the discord.py library with python3 -m pip install -U discord.py[voice]
  3. Clone the repository or download the source code
  4. Create a file called token.txt in the root directory and paste your bot token inside it
  5. Create a directory called sounds in the root directory and add your sound files in .mp3 format

Usage

  1. Start the bot by running the bot.py file using python bot.py
  2. Invite the bot to your server using the invite link provided in the console
  3. In any text channel, use one of the available commands to play a sound in your voice channel

Available Commands

  • /list: Lists all available sound files
  • /ping: Mentions the user who called the command
  • /input [arg]: Repeats the argument passed by the user
  • /join: Joins the user's current voice channel
  • /leave: Leaves the current voice channel
  • /play [query] [volume]: Plays the sound file with the given name in the current voice channel. The optional volume parameter is a number between 0 and 100.

Contributing

If you find any bugs or issues with the bot, feel free to open an issue or submit a pull request.

discord-sound-bot's People

Contributors

jd-raymaker avatar

Watchers

 avatar

discord-sound-bot's Issues

Issue if command "listsounds" returns more than 2000 in length

Discord limit on 2000 characters.
Need to split up the response depending on the body length

Traceback (most recent call last):
    return await self._callback(interaction, **params)  # type: ignore
  File "/home/apprunner/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 842, in _do_call
  File "/app/bot.py", line 74, in listsounds
    await interaction.response.send_message(f'```{list_}```')
  File "/home/apprunner/.local/lib/python3.10/site-packages/discord/interactions.py", line 778, in send_message
The above exception was the direct cause of the following exception:
    raise HTTPException(response, data)
    await adapter.create_interaction_response(
  File "/home/apprunner/.local/lib/python3.10/site-packages/discord/webhook/async_.py", line 221, in request
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.content: Must be 2000 or fewer in length.
  File "/home/apprunner/.local/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/apprunner/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 867, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/home/apprunner/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 860, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'listsounds' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.content: Must be 2000 or fewer in length.

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.