{"action":"opened","issue":{"url":"https://api.github.com/repos/gunthercox/ChatterBot/issues/94","labels_url":"https://api.github.com/repos/gunthercox/ChatterBot/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/gunthercox/ChatterBot/issues/94/comments","events_url":"https://api.github.com/repos/gunthercox/ChatterBot/issues/94/events","html_url":"https://github.com/gunthercox/ChatterBot/issues/94","id":120856439,"number":94,"title":"Train with dynamic responses using functions","user":{"login":"The-Penultimate-Defenestrator","id":10377391,"avatar_url":"https://avatars.githubusercontent.com/u/10377391?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Penultimate-Defenestrator","html_url":"https://github.com/The-Penultimate-Defenestrator","followers_url":"https://api.github.com/users/The-Penultimate-Defenestrator/followers","following_url":"https://api.github.com/users/The-Penultimate-Defenestrator/following{/other_user}","gists_url":"https://api.github.com/users/The-Penultimate-Defenestrator/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Penultimate-Defenestrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Penultimate-Defenestrator/subscriptions","organizations_url":"https://api.github.com/users/The-Penultimate-Defenestrator/orgs","repos_url":"https://api.github.com/users/The-Penultimate-Defenestrator/repos","events_url":"https://api.github.com/users/The-Penultimate-Defenestrator/events{/privacy}","received_events_url":"https://api.github.com/users/The-Penultimate-Defenestrator/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-07T20:07:38Z","updated_at":"2015-12-07T20:07:38Z","closed_at":null,"body":"It'd be great if you could use functions (which return strings) in trainining dialog. \r\n\r\nExample:\r\n```\r\nimport time\r\ndef time():\r\n    return time.strftime(\"%a, %d %b %Y %H:%M:%S\")\r\n\r\nchatbot.train([\"what time is it\",time])\r\n```\r\nChatterbot could recognize that `time` is a function, not a string, and then return the result of calling that function in response to the question of \"what time is it\". That way, I could get the real time and date back from asking what time is it. "}}