I've been searching in a couple of topics here about this matter but I can't seem to get it right for Java.
QUESTION:
How can I send a message from my bot without the enduser having to start any conversation or have any kind of interaction?
If you use C#, you Can use telegram.api and below code:
bot.sendMessage.send(bot.chat_id,"Your Message").ToString();
Related
Imagine there is chatting software. A java microservice listens to agents chatting with customers. The microservice dumps some pertinent data items in an SQS queue. A java bot reads from the queue, formats some things into the appropriate json and fires this off to a RESTful endpoint outside the network. Alternatively, in simulation of that bot, I can post manually properly formatted json into postman. At the last line of appcode before it is sent off in an httpRequestEntity to get a synchronous response before asynchronous processing it can be seen that the json message is properly formed. This is seen in logging and traffic sniffing. The same is true if using the postman test harness method. Some seconds later the package that got sent out of the network arrives at where it was sent.
WITH AN EXTRA JSON ELEMENT!
That reads as if it is metadata from the chatting software!
But remember this happens if the message originates in the chatting software or if I am using the fake cut in line method of mocking the message starting at a later point in the sequence.
I am so stumped. Every step of the way in every way I know to monitor data along its way the package looks right. Then at some point it doesn't. I don't want to bring this up with the people at the other end, receiving the message. Because it sounds like something that couldn't possible happen.
Please any comments even long shots would be much appreciated. I will watch this thread and respond to any questions it generates. Thank you so much.
A friend and I (well a friend w/ me looking over the code to find any logical inconsistencies) are trying to write an IRC bot in Java mostly from scratch (that is, not using egg drop or other popular starting points). It's rather easy to detect a successful server join (socket.isConnected()), but I'm trying to figure out a way to detect a successful channel join. Basically, instead of just assuming that the join was successful, I want to be able to read from the server if the nick is moderated or banned or something else which prevents channel joining. Thanks!
Basically I want to be able to print out "Channel __ joined" if successful or "Channel ___ join failed" if the join wasn't successful. Is there anyway to do this? Thanks!
Edit: Upon further research, I'm now interested in learning how to decipher server message codes, specifically the format in which they're sent back to the client. Thanks!
Try reading through the RFC, particularly the JOIN command and the numeric replies. The Messages section explains the basics of sending messages back and forth. You should probably try to understand a protocol before you try to implement it though ;)
I'm fiddling around with the Java Pircbot 1.5.0 library and have successfully connected to the twitch chat irc and can send and respond to messages such as !time returning the current time. My bot's twitch account is a moderator on my channel and can do everything you would normally expect that I have tested for (ops, bans etc...)
What I'm now trying to do is replace existing messages so that I can build a simple profanity filter/ banned words filter.
effectively turning this (banned word is frogs):
queekusme: I like frogs
into:
queekusme: I like *****
however I can't find anything that would allow me to replace the existing message so that the word is removed.
I know this is possible as bots i have used in the past have been able to do this it's just that I can't find out how to do it on this thing called google.
I found twitch has in built filters however I found what I was looking for, I need to send a timeout command, this then does the in chat
PRIVMSG #[channel] :.timeout [UserToTimeOut] [TimeToTimeOut]
for reference
I am developing a real time chatting application in which i use QuickBlox demo. When user one and user tow both r on-line it works fine but when one user is of-line and some one sending a message to this user(of-line) user he doesn't get any message or notification when he come back on-line.
Can any one suggests me how to sent push notification in quickblox.
I think you should learn this carefully it defiantly work.
http://quickblox.com/developers/SimpleSample-messages_users-android
If you're not interested in helping a beginner in email parsing, don't read further.
I have been programming for a while so I know the gist of things. But, I'm really interested in creating a dummy email address and then set up a parsing program inside of it (if thats even how you do it)
Scenario:
I have an email account which receives certain emails which need parsing. I want to be able to forward those emails to a "dummy" email address which is basically just a program which parses the email for sender, subject, and message. I would prefer to write a runnable jar program or something on windows but I'm willing to do web programming if need be. Android programming is also an option for me.
What would I do to get started? I'm not asking for anyone to write out everything, I just need a starting point for all of this.
Thanks!
What you describe can be solved like this:
1/ Create a catch-all address *#yourdomain.com which will receive all incoming e-mails except those who match an existing email address (e.g. contact#yourdomain.col)
2/ Pipe all incoming e-mails to a script with Procmail
:0
| `/home/foouser/scripts/footool/footool.sh`
3/ Let the script process the e-mail (read headers, save in db, ...)
Another, probably much more easy solution would be to use a web service like cloudmailin.com for this. If the structure of the e-mail is always the same, an email parsing solution like mailparser.io could help you as well.