Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
Forked from emad-elsaid/irc-bot.rb
Created March 3, 2014 04:31
Show Gist options
  • Select an option

  • Save MohamedAlaa/9318397 to your computer and use it in GitHub Desktop.

Select an option

Save MohamedAlaa/9318397 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'cinch' # gem install cinch --no-ri --no-rdoc
require 'askwiki' # gem install askwiki --no-ri --no-rdoc
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.freenode.org"
c.nick = "Ask_wikipedia"
c.channels = ["#cinch-bots"]
end
on :message do |m|
if m.message.start_with? 'askwiki'
query = m.message.gsub('askwiki','').strip
m.reply Askwiki.ask(query), true
end
end
end
bot.start
@AdaVConnor

Copy link
Copy Markdown

To fix the error, you can completely handle ping/pong carefully – avoid bots being disconnected continuously. Do not hard‑code passwords using environment variables for security.
Edit by solitaired a day ago

@7kabalee

7kabalee commented Dec 2, 2025

Copy link
Copy Markdown

@geometrydas12

Copy link
Copy Markdown

Hey, I’ve been messing around with IRC bots for a while now and found your script on GitHub super useful! I love how it handles connectivity. By the way, have you ever thought about integrating features from games like drift boss to engage users more? It could make chat interactions even more fun! What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment