Dismiss Notice
How Does This Work?

You create a free account and set a Gmail filter to forward your Ingress email damage reports.

The damage reports are processed in realtime into the Outgress analytics and alerting engine.

That's the short version.

Is This Allowed?

We believe so, but you decide.

But My Secret Data!

No one on the opposing faction cares who on their team is attacking you. Do you care who on your team is attacking opposing portals?

Implemented Hangouts or Telegram destinations

Discussion in 'Feature Requests' started by KevinC, May 12, 2016.

  1. KevinC

    KevinC New Member Explorer Enlightened L16

    Slack doesn't provide custom notification sounds per channel like other services do.
    I'd much rather get attack notifications via a Hangouts bot or Telegram bot.
     
  2. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    Google Hangouts doesn't have an API that supports writing to (or reading for that matter) a Hangout. You can sort of hack it to do it by tricking it into thinking someone is using it via a browser but it's gonna require the user's Google account login and password (which I definitely don't want). Having a Google Hangout bot is along the same lines of scraping Ingress comms. They change something and it all breaks. Not going to try to support an alert destination that doesn't have a real API to do so.

    That being said, there is certainly nothing stopping someone from using the callback destination to trigger whatever they want on their end (like a Google Hangout bot).

    Telegram does look like it has an API, so I'll go digging on that and see if it would be possible (if they support OAuth and all that so people's credentials don't need to be disclosed).
     
    PaTChBuZ006+outgress likes this.
  3. Caldoche

    Caldoche New Member Explorer Enlightened L16

    Hi,
    Telegram does provide an API, and I would really much like a custom outgress bot to publish Alerts and so on :)
    Looking forward to it !

    Good work !
     
  4. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    I started messing around a bit with Telegram. It seems to be somewhat working (still haven't set up the stuff to allow them to be an alert destination, but working on it). It seems Telegram isn't quite as flexible with inline images compared to Slack (doesn't seem like Telegram has a similar concept of "attachments" within a message). So probably not going to be quite as fancy with portal images, but the underlying data is there.

    For example, looking up an agent in Slack yields this:

    upload_2016-5-24_17-46-34.png

    In Telegram, it's like so:

    upload_2016-5-24_17-47-4.png
     
  5. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    If anyone wants to play around with the Telegram bot, you can add "OutgressBot" user to a Telegram group (or just message it direct for a private channel). The slash commands should both be working...

    /portal [keywords]
    /agent [agent name]

    Still working on being able to use it as an alert destination... there's some user flow stuff I need to work through in order to cross reference what Outgress user account is the one that is trying to use it for destinations. But the slash commands should work now.
     
    KevinC likes this.
  6. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    Telegram is now supported for slash commands (/agent and /portal) as well as a destination for attack alerts.
     
  7. KevinC

    KevinC New Member Explorer Enlightened L16

    Cool! Giving it a try now.

    It does seem like the setup is a little glitchy, at least when multiple bots are in the group. It took me 2 tokens and 5 tries before I saw it appear in my destinations list, though I suppose some of that could be lag.

    Also sometimes got 2 responses to 1 message (this is the first time I used the 2nd token, so I know it couldn't be a lagged response to an earlier command)

    upload_2016-5-26_11-28-12.png
     
  8. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    Hmmmm... Any chance you could try it again just to see if whatever happen is consistent?

    From the looks of that screenshot it looks like Telegram may have sent the same message to us twice. I'll do some digging in the logs to see if that might be the case. Will also read up a bit on Tekegram and see if maybe they don't guarantee a message is sent once and we need to track on our end.
     
  9. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    After poking around, I realized that screenshot would be normal (the 2 messages) if an invalid/expired token was used. I forgot it send the welcome message with any "start" and a different message if the token was invalid/expired. I suppose it would make more sense to consolidate into a single message. :)
     
  10. KevinC

    KevinC New Member Explorer Enlightened L16

    Should a new destination appear essentially instantly if I shift reload the destinations page after the bot replies?

    The issue is definitely reproducible.

    Repro steps:
    1. Create new TG group with OutgressBot and another bot.
    2. Click to create new telegram destination
    3. Paste start command edited to say /start@OutgressBot
    4. Get double message, welcome and token expired
    5. Reload destinations page, no new destinations show.
    6. Paste start command unedited, so it says /start
    7. Get single welcome message.
    8. Reload destinations page, new destionation is listed.
    Originally I was recreating the token before step 6, but it looks like that is unnecessary. It is sending it once with @OutgressBot to get its attention that is necessary. I have not tried a non-start command @OutgressBot to see if that is sufficient.

    Also, copying the command as is does not appear to work in a group with 2 bots, only the other bot is seeing the /start command. I have not tested if this issue occurs in groups with a single bot, or supergroups.

    P.S. Noticed while testing that if I remove the bot from the group or delete the TG group, it still shows as a destination in Outgress. Seems like at least one of those should make it dissapear.
     
  11. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    Okay... I'm new to Telegram... so I wasn't aware the /slash commands had to be addressed specifically to a bot if there was more than one bot in the channel. That's fixed now. I consolidated the error message if a token doesn't match into the normal start message. I added a message about a link successfully happening. The /start@OutgressBot commands weren't linking because I'm new to Telegram (like I said... haha), and Telegram sends the @OutgressBot as part of the command... so that should be working now as well.

    If you want to test it again, give it a go...

    The only thing I'm not so sure about is automatically deleting the Outgress destination. It can be done... but let's say you had 10 users in a group that were all using the same channel as the destination. 1 user removes the bot and those 10 destinations are removed from 10 different Outgress user's accounts. Someone re-adds the bot to the channel and those 10 destinations are still not in Outgress anymore. It basically would allow someone to potentially remove destinations from other people's Outgress accounts maliciously or on accident if someone removed the bot and re-added it.

    I had the idea to at least remove destinations if they were private chats with OutgressBot, but apparently Telegram doesn't send a notice when a chat is deleted... so it seems it's *impossible* to clean up private chat ones, and probably a bad idea to clean up group chat removal.
     
  12. KevinC

    KevinC New Member Explorer Enlightened L16

    I'm fairly new to Telegram myself, it certainly has a number of quirks to learn. Works much better now, thanks!

    That's a good point about one user removing the bot when other users have destinations. Guess removal shall always be a two step process.
     
  13. bafplus

    bafplus New Member Resistance L9

  14. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    Ya, there is a Hangouts API, but it doesn't support sending messages. The API is more for managing participants.
     
  15. bafplus

    bafplus New Member Resistance L9

    Ah cool. So why not start a hangoutsbot? Or a plugin so users can set it up themselves using the webhook?
     
  16. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    There is a REST callback option so a user can already do whatever they want. Personally, I'm not going to support anything without an official API, too much work and would require user's passwords most likely which I don't want.
     
  17. bafplus

    bafplus New Member Resistance L9

    I agree on that point. I'm testing the REST atm, still waiting for first alert (or can you trigger a dummy one for me?). There is a hangoutsbot API also. If its ok by you i can always look into making it a plugin for hangoutsbot.
     
  18. bafplus

    bafplus New Member Resistance L9

    btw....do you know how youre REST handles ssl? I use a self signed crt, does ik ignore those ssl warnings?
     
    Jokerrr83 likes this.
  19. digitalpoint

    digitalpoint Administrator Staff Member Illuminator Enlightened L16

    It was verifying peer and host, so a self-signed certificate would have failed. I just changed it to allow self-selfed certificates.

    If you want something to test it against, make an "any activity" perimeter alert with a 10km radius centered on an area of high activity (like Tokyo), you will get alerts real quick.