Gitter interaction
I did a short spike on this locally trying to use Gitter's IRC bridge and the cinch gem and it was really simple to get started. However, I ran into this issue (https://github.com/gitterHQ/irc-bridge/pull/54), and until that's in, I couldn't get the bot to actually reply. So, this is a placeholder for myself once I get back to it.
Launching it is as simple as putting it in the Procfile.
#!/usr/bin/env ruby
require 'cinch'
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.gitter.im"
c.ssl.use = true
c.nick = "miq-bot"
c.password = '' #REDACTED
c.channels = [
"#manageiq/manageiq",
"#manageiq/miq_bot"
]
end
on :message, "hello" do |m|
m.reply "Hello, #{m.user.nick}"
end
end
bot.start
Once we have IRC interaction, some possible follow up RFEs would be
- Allowing some of the commands we use in the GithubNotificationMonitor to be reused in Gitter (requires separation of GithubNotificationMonitor's reaction/reply half)
- New commands for chat only
@miq-bot statuscould be queue statistics or something@miq-bot gif <keywords>and it will search @chrisarcand's gif list ;) 😜
- Watching
#manageiqon IRC, then pinging the Gitter channel that there is activity over there - Watching
#manageiqon IRC, then pinging IRC that chat no longer occurs there and instructions to go to Gitter if they choose
@miq-bot gif
and it will search @chrisarcand's gif list ;)
Ho boy. Fair warning ⚠️ NSFW gifs are not flagged. 😄
I've been meaning to make an elixir project out of making my collection do such things.
gitterHQ/irc-bridge#54 is fixed so now this can move forward
@bdunne I realize I never shared my working prototype, so:
#!/usr/bin/env ruby
require 'cinch'
PREFIX = /^@miq-bot\s+/
HELP_MESSAGE = <<-EOF.tr("\n", "\r").chomp.freeze
My commands are:
- `hello` - Reply with hello
- `help` - Get this help message
EOF
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.gitter.im"
c.ssl.use = true
c.nick = "miq-bot"
c.user = "miq-bot"
c.realname = "ManageIQ Bot"
c.password = "<token>"
c.channels = [
# "#manageiq/manageiq",
# "#manageiq/miq_bot",
"#Fryguy/test"
]
end
on :message, /#{PREFIX}hello$/i do |m|
m.reply "#{m.message.split(PREFIX, 2).last}, @#{m.user.nick}"
end
on :message, /#{PREFIX}help$/i do |m|
m.user.send HELP_MESSAGE
end
on :private, "help" do |m|
m.reply HELP_MESSAGE
end
end
bot.start
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.