Closed n4m3less closed 8 years ago
@rafalars Hi Rafael! Welcome to Ruby and Telegram bot!
A simple solution to your problem would be command.to_s.split(" ")
The line that causes the problem is: https://github.com/eljojo/telegram_bot/blob/master/lib/telegram_bot/message.rb#L21
I don't really know why sometimes the command is nil
. Maybe there's a bug?
If you could show me more code in how you're using the gem then maybe I could help. But maybe there's just a bug in the code :)
Feel free to dive into the source code of the gem, it's somewhat simple :)
THANK YOU!!!!!!! Solved my problem. I am gonna record a video of my bot when its done and send to you. I implemented google web & image search options(for dork), and gonna put some more things!
Really man, thank you. Coding bot is **cking amazing!!!!!!!!!!!!!!!!
@rafalars I'm glad it solved the problem. I hope there was no bug in the system. This solution is really just a patch :)
Have fun!
@rafalars btw looking forward to the video!
hey @eljojo the video: https://www.youtube.com/watch?v=w9uPiCzTNvo
@rafalars this is pretty neat, thanks for sharing!
i am spliting command( command.split(" ") ) and some times i get this error and the script stops:
block (2 levels) in <main>': undefined method
split' for nil:NilClass (NoMethodError)I am new at ruby and telegram bot... There is a way to make the bot wait for a command and dont stop the script?
thank 4 the help :D