Coder Social home page Coder Social logo

voicy's Introduction

Voicybot

@voicybot main repository

This repository contains the code for one of the most popular bots I've ever built for Telegram — @voicybot. It automatically converts all the audio messages to text when added to a group chat. Please, feel free to fork, add features and create pull requests so that everybody (over 12 000 000 people) can experience the features you've built.

You can also help by translating the bot to other languages or fixing some texts in existing languages by modifying the locales folder or at localize.borodutch.com.

List of repositories

Installation and local launch

  1. Clone this repo: git clone https://github.com/backmeupplz/voicy
  2. Launch a mongo database locally
  3. Create .env file with the environment variables listed below
  4. Install ffmpeg on your machine
  5. Run yarn in the root folder
  6. Run yarn start

Environment variables in .env file

Variable Description
MONGO URI for the mongo database used
TOKEN Telegram bot token
SALT Random salt to generate various encrypted stuff
ADMIN_ID Chat id of the person who shall receive valuable logs
WIT_LANGUAGES A map of language names to Wit.ai tokens
ENVIRONMENT App environment, can be development, defaults to production

See examples in .env.sample file.

Continuous integration

Any commit pushed to main gets deployed to @voicybot via CI Ninja.

License

MIT — use for any purpose. Would be great if you could leave a note about the original developers. Thanks!

As seen on

Habrahabr Spark Reddit Bot Store Product Hunt

voicy's People

Contributors

abdoo9 avatar abusarimhindi avatar ali-demirtas avatar ardent-purple avatar backmeupplz avatar dependabot[bot] avatar evaleries avatar heysreelal avatar knorpelsenf avatar moldoteck avatar tsubus avatar usithadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voicy's Issues

Voice recognition works for personal chat but not in groups

I've provided German and English in the WIT_LANGUAGES env variable.
When I start a chat with the bot directly, the voice recognition works fine.

If I invite my bot into a (my) group, voicy prints a message, let me choose the language. I choose it, the engine and voice language but the voice recognition does not work. No response from the bot, nothing in the logs, even when I set to ENVIRONMENT=development

inline mode

режим инлайна доступен? можно как нить прикрутить для использования в режиме ответа в личных чатах?

send message when text is ready for better integration with watch and bands

hi. i want to suggest a config feature.

Something like a config for chat where you can set if the message will be send normally or the moment when the trascription is ready.

for example normally the message is something like "voice recognition has started" and then replaced with the actual text,
the problem i have with this is that when the notification arrives on the watch or band i can read only the placeholder since it can't read the canged notification.

what i was thinking is more something like the message will be send the moment it finished the transcription.

Thanks if this idea will be taken in consideration.

option to prefix messages by the name+@ of whoever posted the audio

If someone posts audio,and then deletes the audio post, or Voicy is lagged and more than one user posts audio, other chat members can't see clearly who spoke which words, when Voicy reposts as text.

Can there be an option added to the bot that prefixes any speech-to-text with the speakers name and @:

Jane Doe [@jane123]:
[Actual text]

Worker started, but bot not answering

Hi,

First of all, thanks for your work. I'm trying to self hosting it, so I clone the repo, created .env, launch yarn to download packages and then launch yarn start as you say in the docs gives me an error.

I explore the package json so I ended launching yarn develop to generate folders, the dist folder is generated and the app.js is launched. It says "Worker XXX started" but the bot dosn't answer to any messages, neither start nor help.

I've tried to add custom console.log on app.js, and I saw that code dosn't reach function runApp() {}, stops before.

I'm on CentOS 7 environment.

Any ideas? Thanks a lot.

Yarn Start not found

Hallo, I am trying to run this wonderful bot on my srever.
I installed everything, but "yarn start" seems to be missing.
I tried "yarn distribute" and this hasppens:

yarn run v1.22.19
$ node dist/app.js
Worker 47722 started
Done in 11.07s.

Can you help me?

TIA

Should warn for ffmpeg installation

The documentation should specify ffmpeg as a dependency of the project. Or at least it should not fail silently if no ffmpeg installation is present.

Anyway, thanks for this amazing bot!

Remove 'putin and his cronies...' text from captions

Expressing yourself against the violence committed by the Russian Federation is a very noble thing to do, specially in a platform full of Putin supporters such as Telegram.

However, adding "Putin and his cronies kill civilians in the war in Ukraine #stopputin" to the end of messages is very confusing and unprofessional. It gives the impression that the audio says that, when in fact it does not. One may say it is literally "shoving words onto your mouth", I guess.

Telegram offers a variety of places for the developer to express their opinions, such as the "About the bot" section, descriptions, /start command, etc. It may not have as much of an impact as adding links to the messages, but it would get the message sent across the platform without having to affect the main functionality of the bot, which is to caption audio messages. Politics should not affect applications, specially those who are important to accessibility (such as Voicy). It's simply unfair.

Feature request: Shortcuts for convenient language switching

Hi!
Current workflow for switching language if far from optimal, and I switch a lot between languages.

I have feature request to make switching between few most often used languages more comfortable.

Here are some ideas , but this ticket is not limited to them, it's about making it more ergonomic, so here I go:

  • /l en - to switch to english
  • '/l`
  • when I press [/] icon , to get not only /help but also /language
  • to make /language (and /l) to display on a top as first positions "top 5 most used languages" and later alphabetic list of all the rest.
  • feature of auto detection (maybe based on most used languages) which language it was and display to user buttons if it was bad selection to manually select other guesses.
  • more voicy bots! One per language! So I have @voicyenbot @voicydebot @voicyplbot dedicated for languages and no need to switch ! :)

Just few ideas that come to my mind. I would love to see it more ergonomic to switch between languages. Thank you!

TypeError: Cannot read property 'send' of undefined

Hallo, I cloned this repo on my arm64 Debian server.
The problem is that now I have this error:
TypeError: Cannot read property 'send' of undefined
at /root/voicy/dist/helpers/urlToText.js:57:16
at new Promise ()
at urlToText (/root/voicy/dist/helpers/urlToText.js:47:12)
at /root/voicy/dist/handlers/handleAudio.js:74:83
at Generator.next ()
at fulfilled (/root/voicy/dist/handlers/handleAudio.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {

Any idea?

Thanks

Luca

Google Speech Enhanced models

У Google Speech есть enhanced models, которые в теории должны работать лучше дефолтных. Есть ли возможность использовать их? Как я понимаю для этого нужно только пару доп. ключей в запрос прокинуть, сам на TS не пишу, попытался в коде найти где формируется запрос и не понял где нужно подправить :с

Grammar Nazi

In russian version bot reports "Распознавание речи инициированно..." I think it is not perfectly correct because "инициировано" should be written like this.
image

Transcribe audios only when requested

Hi! Congratulations, I really like this bot.

I have a functionality suggestion. It would be nice to add a new mode for transcribing audios only when a group member cites the audio message with a command like \transcribe, for instance. In this way, the bot would only be activated when requested.

Thanks for your work!

How can I debug my own copy of voicy?

Dear all

I've set up my own copy of voicy but all I get as response to a voice message is 👮 I couldn't recognize that.

❓ How can I debug my installation and configuration?

Wit.ai logs doesn't show any requests, so I think it has something to do with the installation or the wit.ai keymap.

wit.ai languages?

How exactly I need to specify wit.ai in .env file ?
I've forked bot, but my forked version has only English for wit.ai engine.
For Google - everything is ok, a huge list of languages.

Not showing full message

My russian voice message is 30 seconds..but voicy is only able to convert just a beginning of a new words. Using default engine

Not responding to bot's voice messages in group chats

How to reproduce:

Create a group chat, add Vociy and another bot into the group. This another bot sometimes sends voice messages to the group. (I have this bot forwarding messages from elsewhere for me) However, Voicy does not act at all regarding the bot's voice messages.

I suppose Voicy's configured to response to non-bot group users' messages only, by default. I'd like to dive into the code and file a PR to enable it (and make it optional) by myself, if it takes time of yours.
In that case, some ballpark ideas of what-to-do in the code base would be very much appreciated. (New to TG bots and JS here)

Thanks. :)

THIS IS NOT AN ISSUE

Hi
First of all, I'm sorry that I'm taking your time.
This is not really an issue with this bot, it's a question I had.
The thing is, this bot supports Persian STT but the problem is when I try wit.ai as an API for my project, this is the response I get:

{
"error" : "Speech recognition is not supported for language: Persian",
"code" : "bad-request"
}

I'm using POST method for speech using the following command in terminal:

curl -XPOST 'https://api.wit.ai/speech?v=20170307' -i -L -H "Authorization: Bearer $MYTOKEN" -H "Content-Type: audio/mpeg3" --data-binary "@sample.mp3"

I just replace $MYTOKEN with my real token that I got in the app.
so my question is, how did you do that?

forwarded voice messages

If I forward a voice message to another chat, voicy should add the name of the person, which had made the message, at the beginning of the transcription.

не конвертирует

отправляю ему файл и через телефон (TelegramX) и через web. Не хочет и все. Не ошибок не чего не пишет, просто не отвечает, хоть чем ругнулся бы.

Файл: mp3
размер: 5.48МБ
продолжительность: 2 мин 23 сек

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.