Code Monkey home page Code Monkey logo

Comments (15)

arcturial avatar arcturial commented on August 16, 2024

Is there a particular command that is causing a problem? For example, the "ship it" command works for me without mentioning the bot name. However, "pug me" requires that I mention the bot name.

from hubot-telegram.

rubybrowncoat avatar rubybrowncoat commented on August 16, 2024

All commands should work in private without mention. Ship it works because it works without mention everywhere (robot.hear).

All commands that require mention (robot.respond) in public chatrooms shouldn't require it in private.

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

I see what you mean, it seems like the Slack adapter automatically adds the bot name when you are chatting one on one. This is a nifty feature, I will see if it's possible to determine if a chat is one on one with the Telegram API and then add it to the adapter.

from hubot-telegram.

lukefx avatar lukefx commented on August 16, 2024

a922453#diff-4912156bdc31f7d9e3344142d6609d2aR48

The bot does it, but in the merge of the two projects we lost that feature. User id are always positive, rooms are negative.

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

I am in the process of restoring it, will make it a bit more robust so you don't end up with a scenario like hubot hubot pug me

from hubot-telegram.

lukefx avatar lukefx commented on August 16, 2024

👍

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

Please review https://github.com/lukefx/hubot-telegram/tree/fix-bot-private, this should take care of the private chat scenario.

from hubot-telegram.

lukefx avatar lukefx commented on August 16, 2024

Hey, perfect... :shipit:

from hubot-telegram.

rubybrowncoat avatar rubybrowncoat commented on August 16, 2024

Let's use the example from the other issue: bin/hubot -a telegram -n CoolNameBot -l CoolBotName.

The bot now answers correctly on:
command (name omitted)
CoolNameBot command (name)

It however fails on fringe cases like:
@CoolNameBot command (mention with @)
coolnamebot command (case-insensitive name)
@coolnamebot command (case-insensitive mention with @)
CoolBotName command (alias)
coolbotname command (case-insensitive alias)

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

Cool, I will have a look at those ones later today. You are welcome to submit a PR if you manage to fix it in the meanwhile. I would suggest adding the logic for pre-pending the name into a private function, then I will set up some mocha tests so we can get some tests going for the project.

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

Please have a look at the branch https://github.com/lukefx/hubot-telegram/tree/feature-issue-5, I included the scenarios you mentioned along with tests for each of them.

You can run the tests with npm test.

@lukefx can you perhaps configure a http://travis-ci.org build for us? I don't seem to have access to this repository from my travis account.

from hubot-telegram.

rubybrowncoat avatar rubybrowncoat commented on August 16, 2024

I'm testing now and while tests are working correctly, the bot now answers only on:
command (name omitted)

All other cases are non-responsive.

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

It is a work in progress, having a look at the response issues.

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

Hey, the problem should be fixed now. My regex pattern was wrong, I included the trailing and leading slashes as part of a new RegExp object.

from hubot-telegram.

arcturial avatar arcturial commented on August 16, 2024

Merged the branch with master and removed it, the scenarios provided above works for me now.

from hubot-telegram.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.