Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- token = 'токен'
- saved_chat_ids = [] #список чатов для отправки сообщений
- saved_chat_ids.push(отрицательное число - chat_id группы)
- bot = TelegramBot.new(token: token)
- saved_chat_ids.each do |saved_chat_id|
- channel = TelegramBot::Channel.new(id: saved_chat_id)
- message = TelegramBot::OutMessage.new
- message.chat = channel
- message.text = "test"
- message.send_with(bot)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement