skip to Main Content

I’ve loaded a package in ruby but when I try to execute it, I get an error.
Please help!

Code:

require 'telegram/bot'

token = "REPLACE_WITH_ACTUAL_TOKEN"

Telegram::Bot::Client.run(token) do |bot|

end

Result:

undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)

2

Answers


  1. Issue here is not that your package is not loaded. But that class method run does not exist. You may want to check whether you have installed the latest version, not something old.

    Other than that, I can hardly imagine what could be going on.

    Login or Signup to reply.
  2. The error message is pretty self-explanatory:

    undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)
    

    The error message is telling you that the method Telegram::Bot::Client::run does not exist, and both the documentation, the README, and the source code seem to agree that there is, indeed, no such method.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search