These are chat archives for dcsan/gitterbot

26th
Aug 2015
dc
@dcsan
Aug 26 2015 01:11
@dcsan so I'm not in favour of hardcoding anything. APIs change over time. So you never know when this kinda data structure might come in handy in future. @abhisekp
for other ppl to contribue most easily the code has to be really readable
they are gonna want to just add their list of rooms to join to a text file
  • FreeCodeCamp/mainHelp
  • dcsan/gitterbot
  • someotherGroup/admins
having a simpel list liek that maybe "hard coded" but its really easy to see whats going on.
the current solution:
// @TODO Refactor into a room generator function
var camperBotRooms = [
    camperBotChatRooms,
    fccChatRooms.officialChatRooms,
    fccChatRooms.cityChatRooms,
    fccChatRooms.casualChatRooms,
    otherChatRooms
].reduce(function (rooms, currRooms) {
    return rooms.concat(currRooms);
}).map(function (room) {
    return {
        name: room
    };
});
is like WTF is that doing?
additionally its not easy to mix domain + room
  • FreeCodeCamp/mainHelp
  • dcsan/gitterbot
for open source easy to use is more important than multiple layers of abstraction (that don't really add any practical benefit)
Abhisek Pattnaik
@abhisekp
Aug 26 2015 04:28
@dcsan ok. ok. I understand. I'll refactor the code and "HARD CODE" the rooms. :)
Abhisek Pattnaik
@abhisekp
Aug 26 2015 05:25

@dcsan

I've written the chat rooms as follows

var camperBotChatRooms = [
    "camperbot/HelpZiplines",
    "camperbot/devteam",
    "camperbot/testing"
];

But I could just keep the following so that others can add their rooms in here

/* ADD YOUR CHAT ROOMS HERE */
var otherChatRooms = [
    "dcsan/botzy",
    "dcsan/gitterbot"
];

and keep the following as it is so that there will be a separation of chat rooms so that later if required, you can just disable a variable in here rather than go on a disable spree of elements of a flattened array with lots of chat room names. (That will even look like a mess, anyway)

// @TODO Refactor into a room generator function
var camperBotRooms = [
    camperBotChatRooms,
    fccOfficialChatRooms,
    fccCityChatRooms,
    fccCasualChatRooms,
    otherChatRooms
].reduce(function (rooms, currRooms) {
    return rooms.concat(currRooms);
}).map(function (room) {
    return {
        name: room
    };
});
dc
@dcsan
Aug 26 2015 05:44
i dont see the value of the bottom part "just in case". its really simple and obvious to just comment out / delete some lines in a flat array.
less likely to introduce bugs as well
Abhisek Pattnaik
@abhisekp
Aug 26 2015 05:45
wat!! Really? Isn't commenting this better instead of a whole bunch of flattened array?
// @TODO Refactor into a room generator function
var camperBotRooms = [
    camperBotChatRooms,
    fccOfficialChatRooms,
//    fccCityChatRooms,               <--- commented out
//    fccCasualChatRooms,
//    otherChatRooms
].reduce(function (rooms, currRooms) {
    return rooms.concat(currRooms);
}).map(function (room) {
    return {
        name: room
    };
});
@dcsan we should ask for a vote :+1: :-1:
Abhisek Pattnaik
@abhisekp
Aug 26 2015 05:51
@dcsan ask @QuincyLarson and other guys to vote.
DTing
@dting
Aug 26 2015 05:55
@abhisekp @dcsan why use reduce there? can you just call [].concat.apply
Abhisek Pattnaik
@abhisekp
Aug 26 2015 05:57
@dting sure!
@dting but the real controversy is something else.. would you mind to give your own vote/Opinion?
DTing
@dting
Aug 26 2015 05:58
let me scroll up
haven't read everything yet. just got in
Abhisek Pattnaik
@abhisekp
Aug 26 2015 05:58
@dting start reading from here :point_up: August 26, 2015 6:41 AM
DTing
@dting
Aug 26 2015 05:58
thx
CamperBot
@camperbot
Aug 26 2015 05:58
if you want to thank someone, put an @ before their name!
DTing
@dting
Aug 26 2015 06:06
I'm not really sure how useful the abstraction is. The abstraction should probably put these rooms into json files and load them based on an env variable? is there a use case for commenting out half the rooms?
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:09
@dting it should load them from json files. Yes.
But currently they're not and separating the room based on category might help in debugging camperbot later.
@dting, @dcsan suggests to "HARD CODE" everything in a flattened array. :(
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:26

Testing 400+ Room Joining

Apologies for Inconvenience
dc
@dcsan
Aug 26 2015 06:41
yeh a json/yaml file is probalby the way to go (or even a text file with one room per line then we dont have to deal wtih all the json noise)
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:49
@dcsan where is this code written?
dc
@dcsan
Aug 26 2015 06:50
GBot. joinRoom ?
those rooms don't exist right.
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:50
why????? separate it from roomdata?
@dcsan they only exists for camperbot
dc
@dcsan
Aug 26 2015 06:51
so whats your question?
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:51
but it's automagically appending my bot
dc
@dcsan
Aug 26 2015 06:51
yes
read the code
thats what the whole discuss above is about
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:51
:(
Abhisek Pattnaik
@abhisekp
Aug 26 2015 06:58
@dcsan separating this has created a mess.
    joinBonfireRooms: function() {
        var that = this;
        Bonfires.allDashedNames().map(function(name) {
            var roomUrl = AppConfig.getBotName() + "/" + name; // change to --> 'camperbot' + "/" + name
            that.delayedJoin(roomUrl);
        });
    },
@dcsan is bonfire room any different from roomdata rooms?
@dcsan why separate it?
@dcsan we'll get into JSON eventually but for now, let it be hard coded. right :)
dc
@dcsan
Aug 26 2015 07:04
if you spent as much time writing code as chatting, you might have finished something by now?
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:04
@dcsan :(
DTing
@dting
Aug 26 2015 07:09
haha
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:10
@dting now I need to refactor another file. :(
nap/lib/bot/GBot.js
evaristoc
@evaristoc
Aug 26 2015 07:19
hehehe!
Poor @abhisekp!
Everyone is against him...
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:21
:(
dc
@dcsan
Aug 26 2015 07:22
i find you have to just close Gitter if you actually want to get stuff done
multitasking with chat doesn't work for writing code
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:23
@dcsan k. thanks for the advice.
CamperBot
@camperbot
Aug 26 2015 07:23
abhisekp sends brownie points to @dcsan :sparkles: :thumbsup: :sparkles:
:star: 97 | @dcsan | http://www.freecodecamp.com/dcsan
dc
@dcsan
Aug 26 2015 07:24
which is a real problem when you're working on a gitter app...
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:28
lolz :D
dc
@dcsan
Aug 26 2015 07:37
@abhisekp you took your bot out of the other rooms right?
i saw it echoing everything in there for awhile
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:37
@dcsan yep!

@dcsan I commented out this code in GBot.js init()

//        this.joinBonfireRooms();

It's not required. The RoomData.js already contains code for joining the bonfire rooms of camperbot

Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:43

@dcsan i'm running the bot in https://gitter.im/GitterBotX/playground
you can test the latest code. :)

NOT PUSHED to the REPO

CamperBot
@camperbot
Aug 26 2015 07:43
you called?
Abhisek Pattnaik
@abhisekp
Aug 26 2015 07:47
thanks @GitterBotX
CamperBot
@camperbot
Aug 26 2015 07:47
abhisekp sends brownie points to @gitterbotx :sparkles: :thumbsup: :sparkles:
:star: 2 | @gitterbotx | http://www.freecodecamp.com/gitterbotx
GitterBotX
@GitterBotX
Aug 26 2015 07:47
abhisekp sends brownie points to @gitterbotx :sparkles: :thumbsup: :sparkles:
CamperBot
@camperbot
Aug 26 2015 07:47
you called?
GitterBotX
@GitterBotX
Aug 26 2015 07:47
:warning: abhisekp already gave gitterbotx points
CamperBot
@camperbot
Aug 26 2015 07:47
you called?
Abhisek Pattnaik
@abhisekp
Aug 26 2015 08:55
thanks @GitterBotX
CamperBot
@camperbot
Aug 26 2015 08:55
abhisekp sends brownie points to @gitterbotx :sparkles: :thumbsup: :sparkles:
:star: 3 | @gitterbotx | http://www.freecodecamp.com/gitterbotx
GitterBotX
@GitterBotX
Aug 26 2015 08:55
abhisekp sends brownie points to @gitterbotx :sparkles: :thumbsup: :sparkles:
CamperBot
@camperbot
Aug 26 2015 08:55
you called?
GitterBotX
@GitterBotX
Aug 26 2015 08:55
:warning: abhisekp already gave gitterbotx points
CamperBot
@camperbot
Aug 26 2015 08:55
you called?