Changing messages on Slack - slack-api

So I'm attempting to change a message in slack through my slackbot at the end of a chain of events. I'm able to change it for the first few instances, but I'm not able to do the very last one. I'm 99% sure that it is because I have reached the 5 interactions limit since I am indeed going through 5 interactions with the user prior to my final message. If this is the case, is there a way to change a message without server responses? I ask because the last message is simply a thank you message to the user for participating. It doesn't actually require any input from data on the server to accomplish. I feel like I read about doing it somewhere, but for the life of me I cannot find it again. Any help or links would be greatly appreciated!
EDIT: The user is interacting with buttons through interactive messages to respond to some questions. The current method of updating messages are with chat.update and setting "response_type": "ephemeral" within the json params that I am sending.

An alternative method to using chat.update is to simply reply with the message to the request from Slack. This will replace the existing message by default. It has no limit that I am aware of, so it solves your problem.
This works great with slash commands and interactive messages.
See here for more details.

Related

Anylogic How to queue and process received messages by agents

--This post has been edited as #Benjamin has suggested in his answer
I am trying to model peer influence for churn situations. Agents will send messages to their peers depending on different conditions. I have also created a List called MessagesReceived to store received messages.(The number of these messages may be >1).
I have tried processing (i.e. adding the message to a list of received messages) these messages in Connections>OnMessageReceived but although I can access message and sender objects, I don't know how to access the receiving agent there.
what would you suggest in this case?
P.S: variable names and types may be a little different in screenshots but the problem I described here does not come from that.
Please always only ask one question per issue, else it gets too confusing.
So let me answer your first question:
although I can access message and sender objects, I don't know how to access the receiving agent there
You can simply type this. in the code box below and you have access to "yourself". In fact, you do not even need that, simply access the fields from "yourself" here. If you are in an agent with variable myVar, you simply use that.
For the other questions, please open separate issues, see this.

Any way to setup Alerts for Twilio SMS messages by excluding a group of errors, rather than by including each error specifically?

I am working on a project that encounters a series of errors everyday such as user unsubscribed, etc. (About 4 or 5 different error codes everyday)
These errors are inconsequential to the management and can be ignored.
Any way to configure the alerts on Twilio to email me when any error occurs which DOES NOT belong to the error group that is deemed inconsequential?
Doesn't have to be email, new to this and open to any savvy ways of keeping myself informed of new errors in an automated way.
As far as I can tell, I can only perform the opposite action(Setup 1 alert for each error code) on the Twilio code. This has the disadvantage of having to know the error code in advance before configuring the alert.
Open to any way of doing this, not just through the console(via a Python API etc.)
Thank you.
Twilio developer evangelist here.
Can I suggest that you set up the event webhook as shown here:
It will send a webhook event to a server of yours for every error or warning that is triggered. You could then build a small service that receives those errors and discards the ones you don't care about and alerts you of ones that do matter.
On top of that, you can change the threshold of the error emails. If you always get 4-5 errors a day, making the alert threshold 6 errors may alert you if something is wrong that you don't expect.
Finally, the errors may be inconsequential, but you might find it easier to try to drive those errors to 0 every day anyway. If they are due to unsubscribed phone numbers, ensure to disable sending messages to those numbers once you detect that they are unsubscribed.

XMPP, sending one message to thousands of jabberIDs - jabber ends up sending it to only a random part of selected group of JIDs

We've got one 'superuser' account that we use to send messages to selected JIDs. Lets say we've selected ones we want to send a message to, and we got ourselves a huge array of user JIDs (20k at this point). We've got a deamon running in the background sending one message at a time to each user, stopping for a minute after sending 2000 of messages (2500/minute limit). We are using xmpp4r as a client that handles sending messages. Every user has same #xmpp.address. <body> is the same in every message.
Our tigase logs (because thats what we're using), show that the messages did actually hit the jabber server and were sent to appropriate users, one at a time.
The issue we're experiencing is that although everything seemed fine, only a part of users actually got the message. (for example, at one point, considering 100 first messages sent - 1..20 and 91..100 got delivered, the middle 70 did not get delivered at all), we improved couple of things in the meantime but this still might be a clue.
We tried creating an array of 10000 duplicated JIDS (jids of couple of users were duplicated thousands of times), and every single message got delivered (and in the right order).
We already spent a couple of days trying different scenarios and are starting to run out of ideas what might be going wrong.
Got any idea's what we might have missed?
I am form Tigase team. First thing, I recommend to use our online forums as this is where we normally respond to questions. We may not see questions posted here.
Anyway...
There are some details not included in your post.
What do you connect and how? Over standard XMPP connection, over Bosh, something else?
What do you mean by "duplicated JIDs"? How did you duplicate JIDs?
Are all the users for which a message is sent online during the test?
If you can see message in Tigase logs, you should also see what happens to it. Was it submitted to network socket for delivery to a client?
What kind of HW did you use? Is there a chance that the server was overloaded and simply dropped some messages? Seems unlikely if you talk about 100 messages and 70 of them not delivered.
How do you actually know that a message was not delivered and are you sure the client/user was connected at the time?

Matching replies using sms on twillio

I want to have a flow where I text a user, and that user can text back to trigger an event. I could have multiple outstanding messages to a user at any one time - is there anyway on receiving a text message I can figure out which message it is in reply to, without including an id number in the text message body?
Twilio evangelist here.
So, just to be clear about the problem, it sounds like you have multiple steps in your workflow that might happen in parallel, or at least before the user can response, rather than in a specific linear message/response workflow. Your app might send out 5 messages, and you want to match up each of 5 replies to a specific message.
If thats the case, then unfortunately there really isn't a direct way built into Twilio to let you match up a message reply without including some kind of ID or command in the response message.
Hope that helps.

is it possible to send a directed flash message in rails?

this is kind of a dumb question, but is it possible to send a
flash[:success]
directed to a certain user other than the current user on the screen? in one of my controllers i have
if #article.up_votes.count > 10
flash[:success ] = 'something'
end
is it possible to send that flash to the owner of the article? as opposed to my own screen? or is there another way to do this?
i tried looking through
http://api.rubyonrails.org/classes/ActionDispatch/Flash/FlashHash.html#method-i-notice
but couldn't find any method that would help. maybe i am reading it wrong? is there a way to achieve the same effect then?
thank you...
Not using flash, you'd have to try something else, there are lots of ways to go about it, but flash isn't one of them. Well, you could still use flash, but it wouldn't be to send from one user to another, you could cause a flash message to appear for the user being notified.
First thing to figure out is how do you notify the other user, when would he get that notification, do you want him to get notified anytime he using your site? Or only if he does something specific on your site?
For what I know the best way to go, maybe the only way actually is push notifications. There are many ways to achieve this but I think faye should be the easiest.
See this screencast to understand it and later. You want to have a channel for each user so it will be the one to get that message. Further search for private pub so nobody's can listen to others channel
http://railscasts.com/episodes/260-messaging-with-faye
http://railscasts.com/episodes/316-private-pub
As ismaelga mentioned I also think push notifications is the way to go (WebSockets).
In addition to Faye you can use a hosted solution called Pusher (pusher.com).
Here is a really short description about how Pusher can help you. Bassically all users using your application listens for messages on a WebSocket-server (through JavaScript). In this case Pusher. You can then send messages to Pusher via your Rails application. When you send a message to Pusher, all users will instantly be notified about the new message via JavaScript (through the WebSocket). To only notify a specific user you can use Pusher's "private channels"-feature.
Pusher have some really good documentation on how to use their service: http://pusher.com/docs/javascript_quick_start
This picture (taken from Nettuts+) might also give you a better understanding of how Pusher works: http://d2o0t5hpnwv4c1.cloudfront.net/1059_pusher/pusher_websocket.png
Hope this helps a bit.

Resources