Git Product home page Git Product logo

discord_bot's Introduction

Discord Text-to-Speech Bot

This repository contains the source code for a Discord bot that uses Google's Text-to-Speech (gTTS) service to convert text messages into speech.

Features:

  • Converts text messages into speech using Google's Text-to-Speech (gTTS) service.
  • Listens to all messages in the server due to the enabled Privileged Message Content intent.
  • Can perform voice channel operations due to the enabled voice_states intent.

Setup

  • Clone this repository to your local machine.
  • Install the required dependencies by running 'pip install -r requirements.txt'. Set up a bot on the Discord developer portal, and get your bot token. (https://discord.com/developers/applications)
  • Replace 'YOUR_BOT_TOKEN' in discord_tts.py with your actual bot token.
  • Run the bot by executing 'python discord_tts.py'.

Usage

The bot listens private message using !r <message> in the server and converts them into speech.

NOTE: The script will create temp.mp3 and time.mp3 in order to stream it. you can enhance to delete files upon every stream.

Dependencies

discord asyncio ffmpeg (https://www.gyan.dev/ffmpeg/builds/) gtts

To Install ffmpeg

  • Download the FFmpeg build from the official website (https://ffmpeg.org/download.html).
  • Extract the downloaded zip file.
  • Add the bin folder from the extracted file to your system's PATH.

For the last step, you can follow these instructions:

  • Press Win + X and choose System.
  • Click on "Advanced system settings".
  • In the System Properties window that opens, click on the "Environment Variables" button.
  • In the Environment Variables window, under "System variables", find and select the "Path" variable, then click on "Edit".
  • In the Edit Environment Variable window, click on "New", then "Browse".
  • Navigate to the bin folder in the extracted FFmpeg folder, select it, and click on "OK" in all windows.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

discord_bot's People

Contributors

amenefus avatar

Watchers

 avatar

discord_bot's Issues

event upon status of member

followed by request of feature:
when user enters the channel, need to move him, play a sound and exit the channel

current known bug: it re-occurs when the user is re-enters the channel.

Timeprint

Need to add timeprints using tts.
1 - local IL
2 - US (Austin, Texas)

restart upon crash

need to create restart command upon error while parsing many ctx requests

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.