See our Writing a Production Bot tutorial for more information. Have the bot join a channel and send it a ping.Ī typical production Slack bot is a combination of a vanilla web server and a websocket application that talks to the Slack Real Time Messaging API. runĪfter registering the bot, run with SLACK_API_TOKEN=. Require 'slack-ruby-bot' class PongBot < SlackRubyBot:: Bot command 'ping' do | client, data, match|Ĭlient.
See CHANGELOG for a history of changes and UPGRADING for how to upgrade to more recent versions. Please see the documentation for the last stable release, v0.16.1 unless you're integrating with HEAD. You're reading the documentation for the next release of slack-ruby-bot. Otherwise, this piece of the puzzle will help you create a single bot instance for one team.
Hooks registration on a SlackRubyBot::Server instance.Hooks registration on SlackRubyBot::Server initialization.Implementing and registering a Hook Handler.Providing description for your bot and commands.If you are not familiar with Slack bots or Slack API concepts, you might want to watch this video. It also attempts to introduce the bare minimum number of requirements or any sorts of limitations. This library does all the heavy lifting, such as message parsing, so you can focus on implementing slack bot commands. The slack-ruby-bot library is a generic Slack bot framework written in Ruby on top of slack-ruby-client. For a rudimentary bot you can even start with slack-ruby-bot-server-events-app-mentions. You should not be building a new bot with it and use slack-ruby-bot-server-events instead. This library implements legacy, real-time support for classic apps. On NovemSlack will start delisting apps that have not migrated to use granular permissions. Warning: As of December 4th, 2020 Slack no longer accept resubmissions from apps that are not using granular permissions, or so-called "classic apps".