Advertisement
Guest User

Ruby Bot Telegram Risposta personalizzata

a guest
Feb 5th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.31 KB | None | 0 0
  1. if (m.message.text=="ciao") then
  2.   # fai qualcosa, per esempio:
  3.   # variabile che contiene o il nome, oppure, se non esiste, "Sconosciuto"
  4.   nome = m.chat.first_name || "Sconosciuto"
  5.   # Invio risposta personalizzata
  6.   api.sendMessage(m.message.chat.id, "Ciao "+nome+"!")
  7. else
  8.   # altrimenti fai qualcos'altro
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement