Voltaire icon indicating copy to clipboard operation
Voltaire copied to clipboard

Add ability to send files

Open AntiGuide opened this issue 5 years ago • 3 comments

Would it be possible to add the ability to send files like pdf documents via the bot? How would you go about implementing this? Maybe the bot could wait for the document after the command as it can not be included in the command?

AntiGuide avatar May 13 '20 09:05 AntiGuide

I believe it would only be a matter of pulling the attachments off of messages and relaying them along with the message when sent: https://discord.foxbot.me/docs/api/Discord.Attachment.html

If you want to look into implementation, I would start with the send handlers here: https://github.com/nminchow/Voltaire/blob/master/Voltaire/Modules/Messages.cs#L30-L52

nminchow avatar May 13 '20 14:05 nminchow

I'll try to implement it. Can you give me a hint on how to carry on the Attachment from Program.HandleCommandAsync() without destroying your Architecture? ^^ I believe it is discarded here. Is integrating it in the ServiceCollection the right way?

AntiGuide avatar May 13 '20 16:05 AntiGuide

@AntiGuide - I'm sorry, I totally missed this question!

I would think we would pass it along to SendCommandAsync (both calls). I'd need to look into those signatures, tho.

nminchow avatar Dec 29 '20 15:12 nminchow