🔥 Discord autoreply bot using DialogFlow
🔥 Discord autoreply bot using DialogFlow and discordrb
bundle install
to install the dependencies (or gem install discordrb
and gem install api-ai-ruby
)BOT_TOKEN
to the bot's tokenBOT_GAME
to the game you want the bot to be "playing"ActualChannelIdHere_CLIENT_TOKEN
to the DialogFlow Client Access Token to be used for each channel you want the bot to respond in (replace ActualChannelIdHere with the actual channel ID).ruby phoenix.rb
DialogFlow is an API that is very similar in functionality to Siri, Alexa, Cortana, Google Assistant, etc. For this project, we're using the text-based, machine-learning portion to detect topics and when to produce replies. Conveniently, a DialogFlow agent can be edited collaboratively and updates immediately, so multiple people can provide topics and responses for the bot without having to restart the bot nor have access to the bot's hosting.
Probably not. I might take requests from people that frequently interact with my servers, but generally you should just host your own copy.
First of all, you can use the same DialogFlow token multiple times if you wish; just set multiple CHANNELID-ClientToken environment variables to the same token. Secondly, this bot is meant for more in-depth replies; if you want more-basic autoreply functionality I'm sure there are other bots out there that already do this.
Less work for more gain. DialogFlow is (generally) going to produce more-accurate results than simple keyword detection, and has the added benefit of already having an easy-to-use, collaborative interface.
I felt like trying something new; I'd never written/run Ruby before, so why not?