concierge / Concierge

Modular chat bot. (Karma + Sassy + Hubot) * (Discord + Facebook + Messenger + Slack + Skype + Telegram + Hipchat + ...) = Concierge
MIT License
128 stars 36 forks source link

How exactly can I interact with Kassy? #77

Closed parasdsingh closed 8 years ago

parasdsingh commented 8 years ago

This might sound like a stupid question but I'm quite the newbie and the Readme.md is very general and short.

I've set-up and got Kassy integrated with facebook. Now it just outputs "info Got answer in " I can't get it to message people or respond to their messages on Facebook, nor can I call in any commands via the CLI (which is obvious) but I'd really appreciate any help on how to get it to respond.

I'll be using Kassy to play Chess on Messenger via the @fbchess bot on Facebook using the SharpChess AI

Thanks

drkno commented 8 years ago

Not a stupid question at all, it hasn't been extensively documented how to interact with it because it is different on every platform you use it with. I'll go over the entire setup and interaction from the beginning in case it helps someone else at some other point:

  1. Clone the repository and run npm install:

    git clone https://github.com/concierge/Concierge.git
    cd Concierge
    npm install
  2. The next step to setting up Cocierge with facebook is to create a config.json file in the root of the project (in the folder that contains main.js). The specific format of that file can be found here. Some things to note about this file:
    • commandPrefix: is optional and will default to the '/' character. This is the string that Concierge will suggest to modules that they should prefix their commands with (note that this is optional for modules to obey this suggestion). It is also used as a prefix for commands like 'help', 'ping' and 'uptime'.
    • You can have multiple integrations in this file (skype + facebook for example).
    • After Concierge has started, this file will be overwritten so any changes after startup will be lost.
  3. Next Concierge should be started. For facebook this is done by running the following command:

    node main.js facebook
  4. Interaction (what this ticket is actually about): On Facebook, the user that Concierge has been logged in as must be added to the chat you want the bot to be a part of. Commands are sent by sending normal messages in a chat. Some commands you could run to test if Concierge is working might be (assuming the commandPrefix has been set to '/'):
    • /ping
    • /uptime
    • /help

Note: due to potential feedback loops, on Facebook it is not possible for the user Concierge is logged in as to send commands to the bot. Eg. If Concierge is logged in as 'John' and you are also logged in as 'John' then you will not be able to send commands to the bot. Other people in your chats will be able to send commands however. Additionally given how much Facebook likes to find and destroy bots you probably don't want to run this on your normal account anyway.

parasdsingh commented 8 years ago

That has resolved my issue. Thanks for the detailed answer :)

kotAPI commented 8 years ago

I've got til the last step, I get log info like

"info Got answer in 9226 info Got answer in 1094 info Got answer in 813 info Got answer in 38541 info Got answer in 949 info Got answer in 3947"

I tried the commands "/ping /uptime /help" but I dont get any response in the console or the chat window. Any idea what I've been missing?

parasdsingh commented 8 years ago

@kotAPI make sure the bot is running on a different account. If the bot account is open elsewhere as well (or being used by another user), it will not respond because all new message notifications are being read by the other user. Don't expect to see any direct command response in the console as well. All responses are sent directly to the chat window

kotAPI commented 8 years ago

I'll check it out on a different account. I also tried running the node main.js test command. I don't get any kind of response back, are the responses logged in console itself in test mode?

drkno commented 8 years ago

@kotAPI In test mode, after it says it has started up, you type your commands directly into the console and responses will be printed there (if appropriate).

anuragmishra1 commented 8 years ago

@mrkno In test mode I am able to get response. But when i test facebook or slack it logins successfully but commands are not responding. Please let me know if I am doing anything wroing, I have gone through entire docs and almost each issues on github for finding this

kotAPI commented 8 years ago

@anuragmishra1 , as @ParasDPain said, you need to make sure you are not logged in via browser on the account you are running Kassy on. Try running the commands from a different account. kassy must run and be open only on your node. I had the same problem when I started out with Kassy, communicating from a different account solved it. It's probably how it's built.

drkno commented 8 years ago

@anuragmishra1 the reasoning behind @kotAPI said about being logged in on the same account as you are using it from is detailed at the end of https://github.com/mrkno/Kassy/issues/77#issuecomment-181676118

If we allowed the account that was sending the messages to also reply to them it would be possible to end up in an infinite loop. For example the command /runbot console.log("/runbot " + arguments.callee.toString()) would run forever without this limitation.

I've added something to the end of the Facebook and Skype documentation to make this a bit clearer.


On a side note: a bug upstream in facebook-chat-api won't be helping if you are testing there. This issue here gives more details and how to work around for now until the NPM module is updated.