Comments (15)
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.
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.
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.
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.
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.
👍
from hubot-telegram.
Please review https://github.com/lukefx/hubot-telegram/tree/fix-bot-private, this should take care of the private chat scenario.
from hubot-telegram.
Hey, perfect...
from hubot-telegram.
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.
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.
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.
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.
It is a work in progress, having a look at the response issues.
from hubot-telegram.
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.
Merged the branch with master and removed it, the scenarios provided above works for me now.
from hubot-telegram.
Related Issues (20)
- Receiving double messages when polling
- ERROR Error: HTTP status 504 returned. HOT 2
- ERROR TypeError: Cannot read property 'message_id' of undefined HOT 11
- bot no receiving messages from supergroup HOT 5
- API fields have been renamed HOT 2
- Remove bot name when using /command@bot_name HOT 1
- Maximum call stack size exceeded HOT 6
- Slow connectivity causes duplicate messages HOT 2
- Newbie request
- error on help command (and workaround) HOT 11
- Expose reply_to_message from message
- Add `hubot-adapter` topic HOT 1
- / commands in supergroups not working HOT 2
- Proxy issues HOT 1
- CoffeeScript 2.x support HOT 2
- Read the response text of a message HOT 1
- Group Chat Slash Command With Mention HOT 1
- Interval Issue HOT 1
- Markdown with Bad Entities
- Error seeking help HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubot-telegram.