I am looking to send a facebook message from my application server without
the need to prompt the user for input each time.
I have been looking over the facebook chat API but it only works with facebook UI
which means that the user must be prompted every time I want to use the chat.
Is there a workaround or am I missing something?
I am using JAVA on my server.
Related
I develop a telegram bot in Java. One of the wanted function in my bot I want to see is the opportunity to invite users by other ones. I tried to make it works next way: the user sends forwarded message from the user he wants to invite to bot, program extract chat id of invited user by:
update.getMessage().getForwardFrom().getId();
and then send a message for invited user. But Telegram doesn't allow to start a conversation with a user before he tapped to "/start" button, and after user has done this, described function stops having any sense.
So what I'm looking is some way to send message to user from regular(not bot) account by using, for example, json request such as we can use in bot api. Is there some way to do it?
Yes, there is the MTProto Protocol which allows you to build a custom Telegram application, There are several libraries that implemented it.
It basically lets you program a user-bot, which gets triggered by particular commands/events and responds correspondingly.
A java library I found is telegram-s/telegram-mt but it doesn't seem to be active at all.
I suggest you implement it easily in Python with libraries such as Pyrogram.
I created chat bot and wrote a simple java application to send https request to
https://api.telegram.org/bot(botcredentials)/sendMessage?chat_id={chatid}&text="+telegramMessage
and it works for my telegram account, I tried to connect some more users to this bot and they can't see any updates (I mean I receive message for myself, but no one else could see them).
Perhaps I should make my bot ?public?
Or every user has its own chat_id with my bot?
Every chat with your bot has its own id. You can get the chat id of your bot with another user as soon as someone interacts with your bot through the Update object received either through getUpdates method or a Webhook.
I want to make on Android application in which i can create one user which acts like chatbot. On chat window when user type any thing and send then instead of other user reply to that question my custom function on open-fire reply static message. I am new to openfire. Not sure how to achieve this. So far i have installed XMPP server and openfire server on my system and i am able to do one to one chat using Pigdin and Spark.
To achieve what i need should i make android application in which i write some custom function or do i have to make custom plugin for openfire. I was doing some RND on this got below some reference :-
https://community.igniterealtime.org/docs/DOC-1130
But reading this i am still confuse what to do and how to do. Can any one please help me out here, and thanks in advance.
One possibility can be:
User A is using your android application, User B is logged-in on Openfire using any server side XMPP library (for example: smack).
Now whenever User A sends message to User B, it will be routed to User B and there you can respond to it from code.
Or
Instead of implementing User B part, you can write an Openfire plugin which will be checking every message packet, if recipient is User B, you can respond to that message from there.
Regarding your posted link of Botz, first of all it's too old. Secondly it seems like it does almost same thing which i wrote above when writing a plugin.
I am writing a chat application on app engine using xmpp. My idea is to allow users to chat to one another. I can get messages to send to a google talk account, by taking the logged in user and removing the #gmail.com part of the address and replacing it with #appid.appspotchat.com )so for example if the logged in user is bob#gmail.com, the jid used to send from will be bob#appid.appspotchat.com). You can then send messages to an google talk account, e.g. jeff#gmail.com.
My problem is in receiving the messages back again. The developer pages show how the app itself can receive messages to the appid#appspot.com jid, but how do you get it to receive messages to the appid.appspot.com jid, and then present these messages tp the logged in user? The overall idea is when a user logs in, I will retrieve thri contact list, get the presence of their contacts (replacing gmail.com with appid.appspotchat.com) then present the available contacts to the user.
If this is not possible, is there a way to let the logged in user chat to other users in a different way? Ive briefly looked at the channel api but i don't think this is suitable?
You could use the Channel API to send a message down to a client when your server gets a message intended for that user. There's no facility to direct a XMPP message directly to a user on your own page; the XMPP API is used to send messages to users signed in to XMPP clients (such as Gmail, Pidgin, etc).
You can't use anything#your_app_id.appspot.com. Instead you must use anything#your_app_id.appspotchat.com as described in XMPP Addresses.
I am familiar in using xmpp library,for android i'm using asmack library.In Google chat also asmack is used.i can write an application to send/receive messages using xmpp.But now i want to track google chat messages in my application.what ever the user do in google chat the same sholud be happening in my application.Suppose that user logged in google chat,in my appication also he is logged in.Sent messages /Incomming messages also should be in sync.i m able to do every thing except synchronizing outgoing sms.How to capture the packet when user is send a message from google chat into my application. ?
You should not be able to do that (unless rooted) as it would be security issue - anyone could sniff your any network activity that way. If your app sign in to the google talk server (as any other client) then you should receive copies of all the conversations, but that's it.