telegram-bot-ruby:Telegram的Bot API的Ruby包装器

时间:2021-02-02 03:48:22
【文件属性】:
文件名称:telegram-bot-ruby:Telegram的Bot API的Ruby包装器
文件大小:55KB
文件格式:ZIP
更新时间:2021-02-02 03:48:22
ruby telegram telegram-bot RubyRuby 电报机器人Ruby Ruby包装器。 安装 将以下行添加到您的Gemfile中: gem 'telegram-bot-ruby' 然后执行: $ bundle 或在系统范围内安装: $ gem install telegram-bot-ruby 用法 首先,您需要为机器人。 然后像这样创建您的Telegram机器人: require 'telegram/bot' token = 'YOUR_TELEGRAM_BOT_API_TOKEN' Telegram :: Bot :: Client . run ( token ) do | bot | bot . listen do | message | case message . text when '/start' bot . api . send_message ( chat_id : message . chat . id , text : "Hello, #{ message . from . first_name } " ) when '/stop' bot . ap

网友评论