Added an option to turn receipts on and off per dropbox, and receipt tells the sender if Skybot was able to deliver their message or not and a copy of the message. which covers what was requested in issue #102.
The command dropbox set_receipt <source_channel> <receipt_setting> is for setting receipts on or off. It needs the id of the channel the dropbox is listening in and if receipts should be on or off for this dropbox. Result of calling this is that receipts are set on/off as specified. The dropbox command will also show the new setting per dropbox.
The message delivered into dropbox reports if receipts succeeded. An extra field is added that just says sent/failed, and only shows up on messages delivered when receipts were on.
Design:
The handling of a new message in source channels is broken into three sections: deliver, delete and dm. Operations are separated out in this order to make the process clearer and to get the message out of the channel as quickly as possible. Sending receipts wasn't important to do before removing message. Message content needed for receipt is saved in bot memory as pages before deleting, and only the names of attachments are saved for receipt. Since the messages are delivered first before receipts sent, the update on receipt status on the delivered message needs to be edited in.
Works better with issue #107 resolved. If not resolved, then receipts for dropbox messages with just an image will look a bit weird. The message will not have content and pagination returns one page that is empty. Receipt will try to put that in a code block but since content ins empty, it shows up as six backticks.
New things:
dropbox set_receipt <source_channel> <receipt_setting>
is for setting receipts on or off. It needs the id of the channel the dropbox is listening in and if receipts should be on or off for this dropbox. Result of calling this is that receipts are set on/off as specified. Thedropbox
command will also show the new setting per dropbox.Design: The handling of a new message in source channels is broken into three sections: deliver, delete and dm. Operations are separated out in this order to make the process clearer and to get the message out of the channel as quickly as possible. Sending receipts wasn't important to do before removing message. Message content needed for receipt is saved in bot memory as pages before deleting, and only the names of attachments are saved for receipt. Since the messages are delivered first before receipts sent, the update on receipt status on the delivered message needs to be edited in.
Works better with issue #107 resolved. If not resolved, then receipts for dropbox messages with just an image will look a bit weird. The message will not have content and pagination returns one page that is empty. Receipt will try to put that in a code block but since content ins empty, it shows up as six backticks.