Skip to content

Unable to start client according to examples #331

@kyryloliinyk

Description

@kyryloliinyk

I can not start the client with examples in the README.
Below is my simple code and two examples that I have tried.
Please explain the correct way to start the client in polling mode.
Thatnk your in advance!

My code

class ChatBot
def initialize(token:)
@token = token
end

def start
Telegram::Bot::Client.run(token) do |client|
client.listen do |message|
# code
end
end
end

private

attr_reader :token
end

Error: _undefined method 'listen' for an instance of Telegram::Bot::Client (NoMethodError)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions