Closed sirugh closed 6 years ago
Hey @sirugh ! Thank you for the PR :) This one is tricky, there is actually more to do than just adding the response to personality.js
The responses in personality.js are triggered upon reading a private message, but the "I would walk 500 miles" is more like a conversion, in which it's triggered by searching through all new comments. It should be programmed more like the "totallynotrobots" special case in bot.js
.
I'm going to close this PR. But I can assign #65 to you, if you be interested in adding the special case to bot.js? We would be eternally grateful :D
Sure I can do that, thanks for the pointer!
@cannawen after looking into it, the case for totallynotrobots is a bit confusing. In fact, if you look here it looks like the bot actually determines the personality response based on the incoming comment (to match a regex). The totallynotrobots case occurs immediately below it, but it only checks for messages in that specific subreddit.
What I'm trying to say is that my changes from this PR should have worked as intended. An incoming message to the bot would have passed through the logic I linked, thus creating the intended response.
@sirugh You're correct, it's not exactly like totallynotrobots, sorry for being unclear!
We want to search new comments for "I would walk 500 miles" which is going to come from the network call network.getRedditComments("all")
(in postConversions
function), and not network.getUnreadMessages();
I think it would make sense to rename postConversions
to handleNewComments
(or similar) and then add the 500-mile code in there, before we check for what conversions exist. What do you think?
Also FYI, a PR was just merged into master that makes some heavy bot.js changes, so it would make sense to pull down the latest code
PR Checklist
closes #{issue number}
if appropriateAdds the desired response to the robot reply section of the personality module.
Relevant link(s):
closes #65