teleirc icon indicating copy to clipboard operation
teleirc copied to clipboard

Add support for audio file uploading

Open Tjzabel opened this issue 5 years ago • 5 comments

Currently, we only support some types of files. If a user wishes to upload an audio file for example, we get [TG Debug] Ignoring non-text message.

We should look into other file types and try to support the uploading of these.

Tjzabel avatar Apr 13 '19 21:04 Tjzabel

I will work on this

nlMeminger avatar May 29 '19 01:05 nlMeminger

@Tjzabel @nlMeminger I think this needs some planning first. The issue we had previously for the Telegram API is that it exposes the bot API key. So I am guessing we need to use a third-party service to upload audio files like we do with Imgur for images.

Alternatively, we could also build in support for using local file storage for hosting, but that goes beyond the scope of audio files alone since we need to configure a mechanism to store images and also make them available publicly on the Internet.

My preference for this is to either find a third-party service we can use for hosting audio files or close this as a wontfix. Thoughts?

jwflory avatar May 31 '19 15:05 jwflory

My thought was that we would treat audio files like normal documents, and model the audioHandler after the documentHandler. Do you have any thoughts on this approach? I think this would be simpler instead of looking for a third party to host the files like imgur

nlMeminger avatar May 31 '19 16:05 nlMeminger

I see. I assumed Telegram treated any file other than images as a document. If the TgDocumentHandler does not catch audio files, we can create a new TgAudioHandler class. It comes with the same caveat as documents that if you want to send audio files over the bridge, it will expose the Telegram API token in the IRC channel. But at least this way we can handle audio files so IRC users have context when an audio file is sent.

If we discover a third-party service in the future or some other way to host files, we can always update the class then. :+1:

jwflory avatar May 31 '19 16:05 jwflory

@jwflory Yep, this issue is covering audio files, and needs a TgAudioHandler to be created in order to handle this.

Documents, in terms of Telegram, only consist of general files. The other file types that are available include are:

  • Audio
  • Animation
  • Game
  • Video
  • Voice

This still brings into question the API key aspect, but we had a question or two about audio files specifically in our Telegram chat, so I figured we may as well include that as another supported file type.

Tjzabel avatar May 31 '19 17:05 Tjzabel