How can I send scheduled messages to multiple Telegram groups? - telegram-bot

I've added the Telegram Bot to multiple groups as an admin, I registered the Bot in IntelliJ using Java like it is described here, so I can receive and send messages. What I need to do now is send a message like:
"TODAY IS <DAY_OF_THE_WEEK>, THE BEST DAY OF THE WEEK!"
plus some animation (a different one for each day of the week) to all of the groups every day at a certain time. I am new to all this and would really appreciate the help. I'm not even sure whether I should use Java or another language to do that. I picked Java only because it was used in the tutorial and I wanted to follow the instruction directly without having to change anything in the process.

Related

Assigning webhooks to Firebase Messaging "subscribe to topic" event

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

Setting up AWS CloudWatch Alarms to alert via SNS if in INSUFFICIENT_DATA state

I've been completely unable to get a clear, straight answer about undertaking this, and am at a point where there doesn't seem to be one doc page or forum post to refer to.
Currently, I've got CloudWatch alarms set in place to monitor a variety of variables to alert on breach for, through SNS to Slack. One thing that I'm looking to do after the fact, is to make sure that any alarms in the INSUFFICIENT_DATA status get their own alerts sent to Slack, as well. I assumed setting up composite alarms would lead me down the right path, but it doesn't actually look like this method enables me to send out alerts on that status. Getting the cloudwatch agents out to the instances, along with the configs, was done via chef recipe.
My infrastructure is on the larger side, and there are at least five metrics that are being monitored, which leaves me with 1370+ alarms. Getting these alarms to alert on INSUFFICIENT_DATA statuses needs to (or ideally) be done in one large swathe, or in large, individual batches. I'm not finding a single, rational way to do this, either. Scripting this out could be the answer, sure, but I'm unsure how to tailor the script to grab each and every alarm name and add this specific type of alert variable to them.
If anyone has any idea about how to proceed, I'd be immensely grateful. This is big task blocker right now, so I'm willing to work out a solution one phase at a time. Thanks very much!!

API Whatsapp to send messages from an external application

I want to implement Whatsapp
to send information from an external application. The idea is to use this
external application to send information throughout Whatsapp.
If you can help me about the terms and
conditions and if this query is possible to develop.
There is a way through which you can send WhatsApp message from your self created application. Use this link Chat API.
But it only provides 3 days trail period and after that you have to purchase it.
The process in that is, you have to register with your google account, then scan the QR code provided(which changes after every 45 seconds). and you are set to go, they will provide you the API for : PHP, Node.JS, Jquery, CURL.
One thing more you always have to keep your phone connected with the internet everytime.
Also I found a drawback in that, i.e. they also provide API to read messages, but it is too slow, as in my condition I can see my messages of yesterday but not of today.

Play framework, limit an action to be done once

I have a button follow on my website, you can toggle it on or off as much as you want.
Each time it sends a notification mail to the followed people. I don't want him to be spammed.
So I want Play Framework not to send this mail twice (twice in a day, for example)
Is there any built-in mechanism or any library of play framework to do it?
Thanks !
EDIT :
Preferably an external service, like Mailjet or mailchimp.
Just save notification to DB instead of sending it immediately - so user can decide how often he want's to get it.
Next use Akka scheduler for sending many notifications in single emails from time to time.

How to get notification subscriptions in Worklight

I want to trigger VERY basic push notifications, but, don't see any way to iterate through all the subscribed users, without rolling my own tool to read the db notification_user table. Surely, with such an extensive (and expensive) product such as Worklight there is an API to do this?
The only way I see is within my adapter to call another HTTP adapter (go get the user subscriptions). And, I've tried using the HTTP interface to retrieve the subscribed users via:
http://<server:port>/<context>/console/api/push/get?adapterName=PushAdapter&eventSource=EventSource
and many variations, but, nothing seems to work through browser testing (the doc indicates all are GET requests). There are NO examples of how the "Push, Event Sources" (?) format for the api is (should the "API Context" value be "Push", or "EventSources", what?). The chart given in the Worklight 6.0 Information Center is pretty bare minimum (how difficult would it have been to include an example of each?)
Basically, I want to iterate through a specific adapter/event source in a WL adapter, grab the "options" that were passed in when the user subscribed to perform some business logic on whether to send out a notification. Would think this would be a very common pattern, but, don't see any examples of this type of model.
Anyone have suggestions for similar processing with WL 6?
Thanks.
You're not wrong. Worklight has 3 methods to send out notifications to subscribed users/devices
See
WL.Server.notifyAllDevices
WL.Server.notifyDevice
WL.Server.notifyDeviceSubscription