Send new message for all bot users - javascript

I'm trying to understand telegram api (with node js) and now got this question. Is it really to create "form" and send custom message for all who using this bot? I.e. without restarting bot send message :)

The only way is:
You need to store all the users IDs somewhere. And after that you can sendMessage to all that IDs one by one.

Related

Stop dialogflow from sending a response

Is there a way to stop dialogflow from replying any of the responses added in the dialogflow console using the nodejs SDK?
I have created a few intents, which have each their own responses. Now I want to add a sort of handover functionality through a fulfillment webhook.
Basically it should work like this: when the user asks for a human to chat, the API stores the session and any new call should check if the session is marked as "waiting for human". If it is, then no reply should be send by dialogflow any longer. In this way, the human can chat without interruptions. If the session is not marked, then a the regular responses should be sent. So here's the question: how can I avoid dialogflow from sending any of the responses without moving the responses to the API?
Thank you in advance

Is there a way to receive telegram messages in node.js without bot?

I would like to have a very simple client in nodejs (an example) that can receive messages from specific channels and groups in telegram. I just searched in internet but I only get bot samples. I want to receive group messages in what I don't have access to give privileges to my bot so I would like to know if I can receive my own messages with no bot as intermediary.
Refer to the Getting Started section to learn more about your first steps.
In short:
Create your client application
Get your app_id
Establish user authorization
Learn more about channels
Use channel methods to work with channel messages

Dialogflow Send message without user intent

Looking to find a way to make dialogflow send a message to the user every x minutes,
without any intent or user action required.
is there a way to do this? maybe making a custom event?
If someoneone could explain if this is possible that be great.
im also using nodejs for my bot.
No, this isn't possible. Dialogflow is designed for conversational exchanges.
Dialogflow is a NLP engine, It's designed to respond to the user input(either a text input, or an event request).
One way to do resolve this issue is, from the Client side run a thread that will send event request asynchronously after every x minutes, and the bot will reply with a message.
Visit https://dialogflow.com/docs/events/custom-events for more information.
Please reply if you need any more information/example on this.
As #Prisoner said it isn't possible to do with dialogflow itself but you can look into assistant push notifications where you can get permission from user to send notifications and if user allow then you can send notification periodically. You can find more in docs.

Discord.js get user connections as bot

Hey I'm trying to make a bot that will check user's connected battle.net account and load game rank. I'm using discord.js library and trying to acccess UserProfile via bot, which isn't allowed since you can't .fetchProfile(). Based on discord.js I'm only allowed to check UserProfile and then connections this way.
My question is: is there any way for bot to load user's connected accounts ? I only need battle.net tag that user verified and connected to discord account.
User: https://discord.js.org/#/docs/main/stable/class/User
UserProfile: https://discord.js.org/#/docs/main/stable/class/UserProfile
Thanks a lot !
Unfortunately this is not possible when using a "real" bot account, however it is possible if you're using a user bot account.
I'd suggest a workaround of using OAuth2. You could have users authenticate your bot with OAuth2, and then fetch their connections this way. Some more information at https://discordapp.com/developers/docs/topics/oauth2
I think I might have a way to get close to that. It took me a while, but I think I've figured out how you can check if someone (in my case, just the bot itself) is playing a certain game. You could probably replace client.user with the user you want to check. Here's the code:
if (client.user.presence.game.name == "INSERT GAME TO LOOK FOR HERE") {
ACTION TO BE CARRIED OUT
}

RabbitMQ send messages to users on website

I am trying to use RabbitMQ to send messages to users on a website. While I know how to communicate between different scripts I can't find anything about how I can get a new user to recieve messages.
Let's take chapter 1 of the tutorial as example: https://www.rabbitmq.com/tutorials/tutorial-one-python.html
How would I be able to send "Hello World" to a user on my website and be displayed in the console? Would it even be possible using python?
Try using the RabbitMQ Web-STOMP plugin: https://www.rabbitmq.com/web-stomp.html
You wouldn't use RabbitMQ for that. It's for communication between different services in your back end, not for sending messages between arbitrary users on your front end.

Categories

Resources