I was doing a code in the app "Atom" and when I tried to run this code
require 'telegram_bot'
token = 'MY_TOKEN'
bot = TelegramBot.new(token: token)
bot.get_updates(fail_silently: true) do |message|
puts "@#{message.from.username}: #{message.text}"
command = message.get_command_for(bot)
message.reply do |reply|
case command
when / start /i
reply.text = 'Ciao, questo è un bot creato da @JustDavide per gli strike. Usami con /strike (Username) (motivo) (numero strike)'
end
puts "sending #{reply.text.inspect} to @#{message.from.username}"
reply.send_with(bot)
end
end
Obviously I made another file "Gemfile" putting
source 'https://rubygems.org'
gem 'telegram_bot'
And when I use "Atom Runner" this error comes:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- telegram_bot (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/davidelao/telegram-bot/bot.rb:1:in `<main>'
I started Ruby like 3 weeks ago, so I am not an expert
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…