parrainc / experiment-pedro-bot Goto Github PK
View Code? Open in Web Editor NEWThis is the repo for telegram's pedro bot server
License: The Unlicense
This is the repo for telegram's pedro bot server
License: The Unlicense
Currently, the only way to interact with Pedro is by saying his name at the beginning of the message. It would be great if Pedro can respond to any message that contains his name, instead of just looking for messages that starts with his name.
Pedro does not respond to any message that contains his name.
i.e.
Say something pedro
bot won't respond anything to that message.
Pedro should respond no matter if the keyword 'pedro' is at the beginning, middle or the end of the message.
When Pedro is replying to an instruction and the user who instructed Pedro to respond something, doesn't have a username defined, Pedro bot should mentioned its name instead of saying @ undefined.
Pedro respond with @ undefined when no username is set for the user who talked to him.
Pedro should respond with UserFirstName if no username defined.
possible fix: Change line 117, and passed a variable with the text to respond. That variable must be set depending on the request payload (if user has username or not.
app is verifying if message is undefined or not (in this line), but doesn't validate if the .text property is set or not before even accessing it. Getting error when trying to .toLowerCase() on null value here.
payload when sticker/gif is sent:
{
"updated_id": 123...,
"from": ... ,
"chat": ... ,
"sticker": {
"emoji": ":)",
"file_id": "my-sticker-file-id"
},
"animation": { ... }
}
payload when no sticker/gif is sent:
{
"updated_id": 123...,
"from": ... ,
"chat": ... ,
"text": "this is my custom text :P"
}
response with error code 500 (server error).
message should be processed properly by pedro.
possible fix: Read .text property when text is present, and/or read sticker object to avoid error 500.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.