bot icon indicating copy to clipboard operation
bot copied to clipboard

Add community forward option

Open dolchi21 opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. I see many users publish the same offer in the community channel and the default channel.

Describe the solution you'd like Let the user publish the offer in the community channel and (optionally) make the bot forward that message to the default channel. To easily remove this forwarded message an expiration time could be configured on the default telegram channel.

Additional context Takers clicking the forwarded message would be redirected to the original message incentivising communities.

dolchi21 avatar Jun 20 '22 21:06 dolchi21

This idea is good, I've been thinking about it but there is some details in the implementation we need to talk.

We need a new command for the community admin to set forwarding orders, like /forwardorders yes/no.

  • User create an order in a community, the order is published in the community channel as well in the general channel
  • When the orders is published in the general channel we need to add a new line of information where it says that this is a community order and add the community group handle (@groupCommunity)
  • If a user take the order in the community channel the order needs to be deleted at that moment in the general channel
  • If a user take the order in the general channel the order needs to be deleted at that moment in the community channel
  • After a user takes an order everything should work normal, as it works so far

Before merge we need to test how the bot will behave if different users tap the same order in the community channel and in the general channel, only one user can get the proper response and the other one will get a message "this order is already taken" (or no message if this complicates the workflow)

grunch avatar Jun 21 '22 13:06 grunch

...if different users tap the same order in the community channel and in the general channel...

this could be handled as a separate issue. what happens now if tow users take the same order at the same time? example: multiple users could take an order between validateTakeBuyOrder and order.save() in takebuy because the update is not atomic. Could be solved replacing order.save() with findOneAndUpdate.

dolchi21 avatar Jun 21 '22 21:06 dolchi21

...if different users tap the same order in the community channel and in the general channel...

this could be handled as a separate issue. what happens now if tow users take the same order at the same time? example: multiple users could take an order between validateTakeBuyOrder and order.save() in takebuy because the update is not atomic. Could be solved replacing order.save() with findOneAndUpdate.

Yes, makes sense

grunch avatar Jun 22 '22 12:06 grunch