I want to add a telegram bot to my application. I am trying to get the chat id of all bot users. But there was an error in the function def get_chat_ids(token). Error: no implicit conversion of String into Integer My controller:
require 'telegram/bot'
class BotsController < ApplicationController
def client
head :ok
@bot_token=''
chat_ids=get_chat_ids(@bot_token)
bot=Telegram::Bot::Api.new(@bot_token)
end
def get_chat_ids(token)
bot = Telegram::Bot::Api.new(token)
updates = bot.get_updates
chat_ids = updates['result'].map { |update| update['message']['chat']['id']}
chat_ids
end
end`