These are chat archives for dcsan/gitterbot

10th
Aug 2015
dc
@dcsan
Aug 10 2015 16:15
hi @dting
M Used
@mildused
Aug 10 2015 16:16
@dting sorry
DTing
@dting
Aug 10 2015 16:16
@dcsan hey whats up.
dc
@dcsan
Aug 10 2015 16:18
hey
just added a comment
but cool! it works :)
congrats on your first gitterbot PR :shipit:
blob
btw looks like some github settings are not correct ^ @dting
DTing
@dting
Aug 10 2015 16:22
@dcsan yay. hmm thanks. I'll look into that
dc
@dcsan
Aug 10 2015 16:23
are you using node btw? or iojs?
which timezone are you in btw?
DTing
@dting
Aug 10 2015 16:24
i used iojs because i couldnt get it to work with node. pst
dc
@dcsan
Aug 10 2015 16:25
ok great, so you were able to get iojs installed then, i recommend sticking with that
i did some work to try and get node compatability, i think its ok now
but i'd prefer to use some new ES6 features going forward...
DTing
@dting
Aug 10 2015 16:28
Ya i wasn't able to get it to work right away using node. Took me a while to figure out I should be using iojs.
dc
@dcsan
Aug 10 2015 16:29
yeh, that was my bad. i thought it was workign with node, but turns out i was still using io
are you on mac/pc?
DTing
@dting
Aug 10 2015 16:29
I on a mac but I have it running in a ubuntu vagrant box.
dc
@dcsan
Aug 10 2015 16:30
about @dting
CamperBot
@camperbot
Aug 10 2015 16:30
:star: 5 | @dting | http://www.freecodecamp.com/dting
dc
@dcsan
Aug 10 2015 16:30
you can run on the mac just fine ...
i'm on a mac
DTing
@dting
Aug 10 2015 16:31
I just like keeping the dev env clean so i spun up a new box. I ran it on bare metal too.
Bill
@kirah1314
Aug 10 2015 16:32
Thanks @dcsan , morning. I was wondering how come ''' doesn't work in the help chatroom?
CamperBot
@camperbot
Aug 10 2015 16:32
kirah1314 sends brownie points to @dcsan :sparkles: :thumbsup: :sparkles:
:star: 47 | @dcsan | http://www.freecodecamp.com/dcsan
dc
@dcsan
Aug 10 2015 16:33
i need to do a new release
in fact i'll do that right now
Bill
@kirah1314
Aug 10 2015 16:34
ah ok
oh yeah, can I still take up your offer of pairing haha? I want to get involve in more gitterbot issues if possible
dc
@dcsan
Aug 10 2015 16:38
sure
botstatus
CamperBot
@camperbot
Aug 10 2015 16:38
All bot systems are go!
botVersion: 0.0.7
env: prod
botname: camperbot
dc
@dcsan
Aug 10 2015 16:38
test ''' ticks
CamperBot
@camperbot
Aug 10 2015 16:38
:bulb: to format code use backticks! ``` more info
dc
@dcsan
Aug 10 2015 16:38
ok so ticks working now
Bill
@kirah1314
Aug 10 2015 16:38
ok any time you're available then today or some time this week
dc
@dcsan
Aug 10 2015 16:39
we could do this afternoon sometime, around 1pm PST?
Bill
@kirah1314
Aug 10 2015 16:40
ok sounds good, I'll ping you. Thanks in advance!
DTing
@dting
Aug 10 2015 16:40
hey dcsan. Is there a style guide for the project? looked like a .eslintrcisnt being used.
dc
@dcsan
Aug 10 2015 16:40
there is an .eslint in /nap/ dir
.eslintrc - for es6
botstatus
@dting do you have time to work on another issue today?
I was going to suggest:
dcsan/gitterbot#36
DTing
@dting
Aug 10 2015 16:45
@dcsan ahh i see it thanks. sure, I can give it a look.
dc
@dcsan
Aug 10 2015 16:47
have a quick look and we can discuss
if you like we can do a call on screenhero
and i can show you around some of the other code?
DTing
@dting
Aug 10 2015 16:50
I actually don't have screen hero. I'm taking a look now.
dc
@dcsan
Aug 10 2015 16:51
i can send you an invite if you like
but text chat here is fine too
DTing
@dting
Aug 10 2015 16:52
So i'm looking to change something in the GBot.js.parseInput() function it looks like.
dc
@dcsan
Aug 10 2015 16:53
yes
so, we'd need some concept of state
the quick way would be that when you write out a find result
store those links in the GBots state
when someone then enters a single number, look it up in that state list
and show that entry
so that would get us a long way to what we need
BUT it's a bit of a hack, as when we have big scale, we'll get clashes if two people are searching at the same time in different rooms
DTing
@dting
Aug 10 2015 16:54
we would need a map of user to bot's last user?
err bot's last output for user?
dc
@dcsan
Aug 10 2015 16:55
yeah, bots last user or bots by room.
saving state by room would be a good way to do it as later we'll have Room based conversations perhaps more than user based
eg if you and i are chatting to the same bot, in same room, we should be able to continue the conv, rather than have two convs... i think
that's a bit off in the future tho when i add conversation features
DTing
@dting
Aug 10 2015 16:56
but if two people are looking at different bf's for example, the later one would squash the earlier.
dc
@dcsan
Aug 10 2015 16:56
yes, that's true.
i guess in the currrent usecase, overlapping BFs is a more likely scenario
DTing
@dting
Aug 10 2015 16:57
hmm also need some sort of timeout to cleanup that state.
dc
@dcsan
Aug 10 2015 16:57
yes
but if its tied to user, its not too big a deal
so i'd suggest to go in steps, and get the functionality working
then go back and add things like splitting per user / room
since that's a bit complex working with the current GitterHelper API
or maybe not.
i think i added a room id to the input param that every botcommand gets
DTing
@dting
Aug 10 2015 17:00
okay i'll give it a shot. Haven't looked too deeply at the code yet but this should give me an chance to make myself more familiar.
dc
@dcsan
Aug 10 2015 17:00
yep
so you'd setup the state at the end of the find command, that part should be easy
but responding to individual/single characters
probably have to add a new type to the inputParser
eg check if input.text is a single number
then what you could do is create a new command called "menuItem" and give it the params of whatever the text was, then call that command
DTing
@dting
Aug 10 2015 17:05
@dcsan sounds good. I'll give that a go.
Bill
@kirah1314
Aug 10 2015 17:06
@dcsan ''' works in help chatroom but doesn't work in LetsPair chatroom. I wanted to edit it but noticed the chatrooms are gone from the RoomMessages.js
CamperBot
@camperbot
Aug 10 2015 17:06
:bulb: to format code use backticks! ``` more info
dc
@dcsan
Aug 10 2015 17:24
yes it should be in all related chatrooms
but maybe i need to add that room to RoomData.js
@kirah1314
can you add it?
Bill
@kirah1314
Aug 10 2015 17:24
i tried it at Letspair chatroom and it didn't work
dc
@dcsan
Aug 10 2015 17:24
and any other important rooms
Bill
@kirah1314
Aug 10 2015 17:24
sure, which folder is that js in?
dc
@dcsan
Aug 10 2015 17:24
data
add under camperbot section
Bill
@kirah1314
Aug 10 2015 17:25
ok got it
DTing
@dting
Aug 10 2015 17:32
find
find pair
Omar
@oab00
Aug 10 2015 17:32
what happens if 2 bots join the same room ?
dc
@dcsan
Aug 10 2015 17:33
various things from one getting banned to rate limits
Omar
@oab00
Aug 10 2015 17:34
woah :sweat_smile:
DTing
@dting
Aug 10 2015 17:34
i think i crashed the bot by issuing a find without a parameter
dc
@dcsan
Aug 10 2015 17:39
yep, i fixed it
git pull from master
so btw you have your own bot workign in the demobot/test room?
DTing
@dting
Aug 10 2015 17:40
@dcsan oh looks like oab00 finished the change list that we were discussing
dc
@dcsan
Aug 10 2015 17:40
@oab00 are you working on the bot stuff?
regarding your question above - having a few bots in the same room should be OK
and that is what will happen when people start developing
Omar
@oab00
Aug 10 2015 17:40
I implemented a menu system but it needs a bit of work I think
yeah :smile:
dc
@dcsan
Aug 10 2015 17:40
unless they get their own keys
oh cool!
did you send a PR or how did you know DTing?
Omar
@oab00
Aug 10 2015 17:42
currently it only works with wiki no bonfires
dc
@dcsan
Aug 10 2015 17:42
wiki bonfire
CamperBot
@camperbot
Aug 10 2015 17:42

:point_right: bonfire factorialize a number [wiki]

You should make sure to try hard to solve the Bonfire yourself before reading this!

:link: Original Bonfire :point_right:

:pencil: read more about bonfire factorialize a number on the FCC Wiki

dc
@dcsan
Aug 10 2015 17:42
find bonfire
dc
@dcsan
Aug 10 2015 17:42
it should work with that though?
Bill
@kirah1314
Aug 10 2015 17:42
^ 17 is a lot
Omar
@oab00
Aug 10 2015 17:43
I'm doing a bit of a hack gets list from find but then uses wiki as input.params
dc
@dcsan
Aug 10 2015 17:43
is it running somewhere?
Omar
@oab00
Aug 10 2015 17:43
didn't know there are two separate searches .. wiki and bonfire -.-
yeah at room demobot/test
DTing
@dting
Aug 10 2015 17:43
i saw it in the demobot/test room haha
dc
@dcsan
Aug 10 2015 17:43
@kirah1314 there's a ticket to limit number of replies on a find. gitter will also cut us off if we send too many links
cool
the links are getting converted to full paths it seems ...
:six: c:\projects\gitterbot\nap\data\wiki\js indexof
:seven: c:\projects\gitterbot\nap\data\wiki\js loops
were you able to get the wiki to checkout properly using submodules?
not sure how well that works on windows
i guess the stuff i did for file names is not "windows safe"
Omar
@oab00
Aug 10 2015 17:48
yeah :/
dc
@dcsan
Aug 10 2015 17:48
i made an issue pointing out where it is
so we discussed that feature here, and I made some comments on the ticket
@oab00 do you want to try and refine your implementation?
@dting maybe work on something else?
Omar
@oab00
Aug 10 2015 17:49
hmm dunno how I'm gonna go about that
dc
@dcsan
Aug 10 2015 17:50
ok ..
do you want to send a PR for what you have and i can suggest?
PR=pull request
Omar
@oab00
Aug 10 2015 17:50
yes I'm gonna do that!
Bill
@kirah1314
Aug 10 2015 17:53
'''
CamperBot
@camperbot
Aug 10 2015 17:53
:bulb: to format code use backticks! ``` more info
dc
@dcsan
Aug 10 2015 17:58
@dting how about dcsan/gitterbot#73
its a bit simpler thing to do
you could also setup an apikey for yourself at the same time
DTing
@dting
Aug 10 2015 18:00
@dcsan sure.
dc
@dcsan
Aug 10 2015 18:01
after that, this one is a little bit more meaty:
dcsan/gitterbot#77
can you read that issue and see if it makes sense?
Bill
@kirah1314
Aug 10 2015 18:02
@dcsan I think I added camperbot to LetsPair chatroom. The chatroom wasn't listed in RoomData/camperbot
do we have to add each and every chatroom in order for campberbot to work?
dc
@dcsan
Aug 10 2015 18:07
yep
@oab00 can you walk me through this a bit?
so
oab00/gitterbot@c114aa6
you save a list of options
how do you intercept when the user presses just a number?
find js
Omar
@oab00
Aug 10 2015 18:10
makeListOptions takes this last string ^
takes out each list item and puts it in a global array
this.listReplyOptions
dc
@dcsan
Aug 10 2015 18:11
yep
i got that far
but if the user now types 3
how do you intercept that?
oh + var listReplyOptionsAvailable = this.findListOption(input);
Omar
@oab00
Aug 10 2015 18:12
findListOption method takes the input 3
dc
@dcsan
Aug 10 2015 18:12
is input a number? or maybe you're using '3' as the hash map
you got lucky :)
Omar
@oab00
Aug 10 2015 18:12
no it is an index for the this.listReplyOptions array ^^
so yeah just a number
wait lol
oh yeah silly me xD
dc
@dcsan
Aug 10 2015 18:14
input.cleanText isn't using parseInt i dont think
it works. as long as they're both strings, but its a bit unexpected
ok well i see how it works
it seems to be a good first take
what were your concerns?
that it doesnt work with bonfires ?
Omar
@oab00
Aug 10 2015 18:15
when you type wiki css and bonfire css I think it's different isn't it
I thought they were one and the same
also when you reply to the bot with a .1 or 2) for example it works for some reason..
input.cleanText.match(/^[0-9]+$/i) === null this doesn't return true..
dc
@dcsan
Aug 10 2015 18:17
yes they're different
bonfire just looks in the list of bonfires
CamperBot
@camperbot
Aug 10 2015 18:17
Sorry, can't find a bonfire called just looks in the list of bonfires. [ Check the map? ]
dc
@dcsan
Aug 10 2015 18:19
sry i have another pair session now and will check back in later
Omar
@oab00
Aug 10 2015 18:19
alright
dc
@dcsan
Aug 10 2015 18:19
but great progress, i'm really happy to see this commit!
are you up for doing some more issues?
Omar
@oab00
Aug 10 2015 18:20
yea of course :)
dc
@dcsan
Aug 10 2015 18:20
ok let me get back in an hour or so
thanks!
Omar
@oab00
Aug 10 2015 18:20
and thank you I'm quite fascinated by the amount of work put in this bot
dc
@dcsan
Aug 10 2015 18:20
haha, yeah too much!
its quite addicting
Omar
@oab00
Aug 10 2015 18:20
haha indeed
I'll be off for dinner see you later then
DTing
@dting
Aug 10 2015 19:07
@dcsan I'm looking at the issue. Is the dot.env GITTER_USER_TOKEN the apikey? That's already loaded to AppConfig.token.
dc
@dcsan
Aug 10 2015 19:29
yes
@dting
var AppConfig = {
clientId: process.env.GITTER_APP_KEY,
token: process.env.GITTER_USER_TOKEN,
i dont think we're actually using clientID now
that's mostly used for oAuth requests when you need to post as the user
eg if i wanted to retrieve the list of rooms that you're in
in this case we mostly want to just post as the bot
dc
@dcsan
Aug 10 2015 19:34
the USER_TOKEN is kind of like a super user key
i was discussing this a bit in
with the gitter guys
DTing
@dting
Aug 10 2015 19:35
@dcsan hmm i'm a bit confused about the httpwrap
dc
@dcsan
Aug 10 2015 19:35
sure
DTing
@dting
Aug 10 2015 19:35
@dcsan that looks like its trying to make calls the beta.freecodecamp.com/api ...
dc
@dcsan
Aug 10 2015 19:35
its meant to be a lib to abstract calls to FCC API
yes
DTing
@dting
Aug 10 2015 19:36
where do i get an api key for that?
dc
@dcsan
Aug 10 2015 19:36
we dont have one right now
so you can just push EXAMPLE
in your dotenv
currently calls there don't require an API key
when we go live in production, we'll start asking for that
this is #73 right
DTing
@dting
Aug 10 2015 19:38
ya
dc
@dcsan
Aug 10 2015 19:38

add a line called 'apikey' to the dot.env file eg

apikey=TESTAPIKEY

DTing
@dting
Aug 10 2015 19:39
okay gotcha. I think I over thought this.
dc
@dcsan
Aug 10 2015 19:39
ie it doesn't matter what for now. i'll agree a final API key with FCC later
yeah, its not super automated. i'm just going to PM berkeley and agree a secret key to use!
dc
@dcsan
Aug 10 2015 19:45
erm, why so?
the API there is expecting JSON to be posted
DTing
@dting
Aug 10 2015 19:45
isnt that always undefined?
dc
@dcsan
Aug 10 2015 19:46
oh yeah, looks like body param doesn't exist
hmm
thats weird it still works >.<
DTing
@dting
Aug 10 2015 19:47
looks like the 2 places that use the callApi function don't use post
oh nm
the "thanks" uses post but doesn't need a body. uses the params for receiver and giver.
Bill
@kirah1314
Aug 10 2015 20:01
@dcsan do you want to use screenhero?
dc
@dcsan
Aug 10 2015 20:01
sure
5 mins
Bill
@kirah1314
Aug 10 2015 20:01
ok
dc
@dcsan
Aug 10 2015 20:04
wahts your SH email?
dc
@dcsan
Aug 10 2015 20:04
says you're offline?
calling you
or do you want to call me?
Bill
@kirah1314
Aug 10 2015 20:05
let me try, my SH contacts suddenly disappeared
dc
@dcsan
Aug 10 2015 20:05
yeh its a bit buggy
Bill
@kirah1314
Aug 10 2015 20:06
yeah, 1 sec
dc
@dcsan
Aug 10 2015 21:33
hey was there anyone else who wanted help or to pair on gitterbot stuff @dting @oab00 ?
DTing
@dting
Aug 10 2015 21:39
i prob wont be available to work on stuff till this evening. I haven't had a chance to look at #77 yet but will take a look when I have the chance.
dc
@dcsan
Aug 10 2015 21:39
sure thing
just ping me here when you're around
(i have so many channels in GH its better to keep it here!)
Omar
@oab00
Aug 10 2015 23:16
you're fast I forgot to put the parseInt in -.-
dc
@dcsan
Aug 10 2015 23:17
ah..
i just saw the PR come in and pulled it
Omar
@oab00
Aug 10 2015 23:17
hehe
on it now
dc
@dcsan
Aug 10 2015 23:17
btw the menu doesn't seem to be working for me - did you see that?
Omar
@oab00
Aug 10 2015 23:17
yeah it used to work because I was checking for a specific path cause windows...
should be working now :)
dc
@dcsan
Aug 10 2015 23:18
ah, cos windows. yeah it was running on your machine when we played with it b4
bingo, its working!
very cool
Omar
@oab00
Aug 10 2015 23:19
still needs that risky parseInt fix xD
dc
@dcsan
Aug 10 2015 23:19
ah...
dc
@dcsan
Aug 10 2015 23:47
@oab00 @irinatag please git pull from your branches
i merged the work you're both doing and pushed back
its working in a close by area, and quite gnarly so would be better if you can pull so as not to get into a conflict later
master or branch 28-thanks-parser
both are up to date