Telegram support #341
No reviewers
Labels
No labels
blocked
breaking
bug
dependencies
duplicate
enhancement
good first issue
help wanted
question
tech debt
testing
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
scion/arbitrader!341
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "telegram-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before merging we need to create this entry in the wiki page: https://github.com/agonyforge/arbitrader/pull/341/files#diff-9ed7902517cecde48e205a8428a5e450aa6485ba19e23a6779edf26a2febefc7R187
Just a couple of small tweaks. Looks good overall.
@ -51,6 +51,14 @@ notifications:from: x@x.xShould mention the 'g' thing in this comment here, and include a link to the wiki even though nobody reads it. :P
@ -125,0 +100,4 @@public void sendExitTradeNotification(Spread spread, BigDecimal longVolume, BigDecimal longLimitPrice, BigDecimal shortVolume,BigDecimal shortLimitPrice, BigDecimal entryBalance, BigDecimal updatedBalance, BigDecimal exitTarget,boolean isForceExitPosition, boolean isActivePositionExpired) {I like that this is getting more generic. Nice job. 👍
@ -147,12 +127,83 @@ public class NotificationServiceImpl implements NotificationService {So if you copy
12345678then below we have to send-12345678right? But if you miss this instruction and copyg12345678it isn't going to work. Could we just accept eitherg12345678or12345678and make it a little more user friendly? We could just take the 'g' off in the getter in the configuration class if it's there, or in the setter if you prefer.This is interesting. We have Slack and Discord and we push all log messages to those platforms, but here we're treating Telegram more like email and only pushing entry/exit notifications. Is there a technical reason not to just ship all logs to Telegram like Discord and Slack? Is it a "channel" vs. "direct message" thing?
Along the same lines (not in this PR though)... it seems like we should expand on this
sendInstantMessage()idea to add DMs via Slack and Discord just for entry/exit notifications? We can make new tickets for that, but it seems like a natural thing to expand the notification system and make it more powerful.I think you guys have access to edit the wiki now. If not, let me know and I can do it.
The main reasons why I set Telegram like email notifications are:
With this in mind I thought that Telegram could be a good candidate for only important notifications.
It is possible to send DM on Telegram but the setup is more cumbersome. It evolves the bot having to be able to read incoming messages from the user because (AFAIK) for DM the user has to first send a message to the bot. The bot reads the message and retrieves a
messageIdand replies back to the user with a value formessageId = messageId + 1and we must keep track of this messageId for future DM.In my opinion, using the group way to enable the bot to send messages to the user is more user friendly and much more practical from the code point of view.
@ -51,6 +51,14 @@ notifications:from: x@x.xI will add it. I thought of only adding the wiki entry when we are about to merge this branch otherwise I am afraid someone may see it in the wiki and try to configure it before this branch is merged. Even though I think very few people check the wiki page 😅
@ -125,0 +100,4 @@public void sendExitTradeNotification(Spread spread, BigDecimal longVolume, BigDecimal longLimitPrice, BigDecimal shortVolume,BigDecimal shortLimitPrice, BigDecimal entryBalance, BigDecimal updatedBalance, BigDecimal exitTarget,boolean isForceExitPosition, boolean isActivePositionExpired) {Yeah, looks much better now :)
@ -147,12 +127,83 @@ public class NotificationServiceImpl implements NotificationService {I implemented it. Replacing the 'g' by a '-'
I also thought in the long term to be able to send commands to the bot via Telegram. Commands like: