Advertisement
Guest User

Untitled

a guest
Oct 19th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.44 KB | None | 0 0
  1. token = 'токен'
  2. saved_chat_ids = [] #список чатов для отправки сообщений
  3. saved_chat_ids.push(отрицательное число - chat_id группы)
  4. bot = TelegramBot.new(token: token)
  5.  
  6. saved_chat_ids.each do |saved_chat_id|
  7.   channel = TelegramBot::Channel.new(id: saved_chat_id)
  8.   message = TelegramBot::OutMessage.new
  9.   message.chat = channel
  10.   message.text = "test"
  11.   message.send_with(bot)
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement