telegram bots, how to request input from user? - command

I know how to use telegram commands, and know how to read what command has been executed. What I would like to do is something like this:
User: /send_address
Bot: Hello, please type your address..
User: my address...
so far, i can read the /send_address command and reply with "hello,...." and obviously I can also read the answer of the user, just like I have read the /send_address command. Question is, how do i know if the answer he sends is in response to my "hello, please type your address.." request, or if he sent it just because? I could have 100 users chatting with the bot, would i have to store a variable for each user remembering that he sent the /send_address cmd?

As I known, telegram has no way to save state for user. I use a table in database for saving comands of user.
How it works:
User say /command
Store /command for User.
User say "something" we try to get data from database for this user. If we find out that previos message is command /command than do some action and save nowly added data (if you have multiple steps for some command)

Related

How to determine the Log-In Count and Last Log-on date of users account in Windows XP while using the autopsy tool?

I'm doing some activity in my class in digital forensics I was able to find the last user who login on the computer (found it on WINDOWS/SYSTEM32/CONFIG/SOFTWARE/MICROSOFT/WINDOWS NT/CURRENT VERSION/WINLOGON/DEFAULT USER NAME). There are 5 user accounts on the computer and I need to find the log-in count per user and last log-in date per user, in what folder should I find it? I'm using the Autopsy software.
This explanation should help, but this will be a generic answer, as the problem is not reproducible.
Normally the "C:\Windows\System32\winevt\Logs" folder is containing the event logs on Windows systems, tracing login events. You should look for the Security.evtx file(there will be plenty of logs in there, and you are looking for 4624 logs in it). If your Autopsy version is parsing this, you should try to find interactive logins(~= normal keyboard logons, or logon type 2 see the explanation. This is an assumption).
You can either count them or it's an old Autopsy version which doesn't support parsing, export the Security.evtx file instead, and open it in Event viewer on your forensic analysis host locally, and filter(open up Security.evtx with Event Viewer, Actions/Filter Current Log/Includes Event IDs: 4624, Keywords: Audit Success, User: Xyz(and change it to the next one once examined)

FB Chatbot how to get the previous message

Is it possible to receive the previous message that the user have send to the chatbot (without using quick replies or postback buttons). Example:
User: "Can you call a friend?"
Bot: "Who should I call?"
User: "Tim"
In the API I now have just the information "Tim", without knowing if I should call him or text him or make him a sandwich or whatever. So I basically I want to add some Postbackdata or metadata additionally to the text "Can you call a friend" (intent: 'CALL'), so the message "Tim" will come with that data.
Is there a way without storing the data into a database? AWS Lambda with ClaudiaJs.
I found the metadata field in the FB API which turns out to be the wrong field for that since it is only for communicating between several apps?!
What you are looking for a called a "slot-based bot", or slot-filling, basically meaning that you have a "slot", or blank that needs to be filled in before your bot can perform an action. In your example you have two slots: action and person
Actions could be: call, text, message
Person: name of a person, friend, etc.
I don't think any of the message frameworks (Slack, Facebook, etc) will provide you with the information you need. You will need to build this logic out yourself.
You can look at using wit.ai stories to achieve this.
Look to this similar Stack Overflow question and answer.
You can reverse order of conversation, and at beginning user writes some text or send you something else. After receiving, you should send to user buttonsTemplate, where postbacks will be like "CallTo&Tim" where instead of Tim you can put every text you need to pass to next executor(and you also can store previous user message here). Than just make substring of postback, check it`s type and do whatever you want.

In IBM Connections can you retrieve another users activity feed?

In IBM Connections 4.0 is there any way to get another users activity stream. I can get my steam with #me but if I try my connections id or another users id I get the following error:
This works:
/opensocial/basic/rest/activitystreams/#me/#following/#all?rollup=true
This returns an error - my id:
/opensocial/basic/rest/activitystreams/7AF0B251-9F97-CA6D-8525-61370072A674/#following/#all?rollup=true
Error 400: The user ID(s) [7AF0B251-9F97-CA6D-8525-61370072A674] is/are not recognized by the system.
And I know this is my ID....
<userid>7AF0B251-9F97-CA6D-8525-61370072A674</userid>
Any suggestions...the manual says the following which doesn't sound good but doesn't totally close the door either:
As per the OpenSocial standard, a given users Activity Stream is retrievable by:
1. Specifying that user (#me in the URLs below, IBM Connections does not generally allow retrieval of other users streams).
Any help would be appreciated....
This should do it: https://connections.ibm.com/common/opensocial/basic/rest/activitystreams/urn:lsid:lconn.ibm.com:profiles.person:91ae7240-8f0a-1028-8400-db07163b51b2/#involved/#all?rollup=true&shortStrings=true&format=atom (plug in the right user id)

Detecting when a user leaves or enters a channel with hubot

I am trying to make Hubot detect when a user enters or leaves a channel, but so far I have been unable to actually find ANY information pertaining to this.
Does anyone have any ideas of how to do this? :)
Thanks in advance!
Hubot's Robot class has functions enter and leave that will fire a callback you give when any user enters or leaves the room. That callback takes a Response, which has a property message of type Message, which in turn has a property user of type User.
module.exports = (robot) ->
robot.enter (response) ->
# at this point you can get the user's name with:
# response.message.user.name
# works the same for robot.leave
However, it appears that the IRC adapter for hubot doesn't currently fire the messages needed to get those functions to work.

Configurating JOOMLA's e-mail notification for new account

I'm using Joomla 1.5 to create a local site for my office. The site will be accessed locally via intranet, and my PC will be the localhost for the site.
I'm using a Login pluggin, so that anyone who wanted to enter the site should create an account.
In JOOMLA, all user who created their account for the first time will receive a notification e-mail like :
"Hello pras,
You have been added as a User to Information Center by an
Administrator.
This e-mail contains your username and password to log in to
http://localhost/yaddayadda/
Username: hadisuryo.prasetio Password: xxxx
Please do not respond to this message as it is automatically generated
and is for information purposes only."
but if the user click the URL in the mail, which is, "localhost/yaddayadda/" they will not be directed to my site, but to their own PC's localhost....
My question is : How can I Modified the e-mail or the site configuration so that the URL will not be "localhost/yaddayadda/" anymore, but will be "(My-IP address)/yaddayadda"
I'm not going to host my site to a web hosting service, just using my PC as a host.
I've been trying to trace on each config and .ini files...it seems that i have to do something with the "JURI" function or the "$mosConfig_live_site" on the backlink.php file
$mosConfig_absolute_path = JPATH_SITE;
$mosConfig_live_site = JURI :: base();
$url_array = explode('/', $_SERVER['REQUEST_URI']);
Can anyone give me assistance ?
actually what the joomla does it takes the value as $_SERVER for the host so what you have to do u just append "/yaddayadda" at the email template of the joomla
You could edit:
%SITE_ROOT%/administrator/language/en-GB.com_users.ini at around LINE 28, which reads
NEW_USER_MESSAGE=Hello %s,\n\n\nYou have been added as a User to %s by an Administrator.\n\nThis e-mail contains your username and password to log in to %s\n\nUsername: %s\nPassword: %s\n\n\nPlease do not respond to this message as it is automatically generated and is for information purposes only.
Be careful with the '%s' variable as it appears to insert different values in each instance. First instance renders their NAME, second SITE NAME, third one is the USER NAME, etc, etc.
-Dennis
You can find those values in root/components/com_users/models/registration.php on line 88. It appears it pulls it out of the array that is being created their.