Git Product home page Git Product logo

experiment-pedro-bot's People

Contributors

parrainc avatar

Watchers

 avatar

experiment-pedro-bot's Issues

Modify Pedro in order to be able to respond to any message that mentioned his name (no matter the order)

Description

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.

Actual Behavior

Pedro does not respond to any message that contains his name.
i.e.

Say something pedro

bot won't respond anything to that message.

Expected Behavior

Pedro should respond no matter if the keyword 'pedro' is at the beginning, middle or the end of the message.

When user does not have username defined, bot should write the first name

Description

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.

Actual Behavior

Pedro respond with @ undefined when no username is set for the user who talked to him.

Expected Behavior

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.

When request payload does not contain text but a sticker/gif, got response with code 500

issue description

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"
}

Actual Behavior

response with error code 500 (server error).

Expected Behavior

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.

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.