Class: Cinch::BotTemplate::Templates::Hello

Inherits:
Object
  • Object
show all
Defined in:
lib/cinch/bot_template/templates/hello.rb

Instance Method Summary collapse

Instance Method Details

#generate(nick:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cinch/bot_template/templates/hello.rb', line 6

def generate(nick:)


  hello = <<~HELLO
  require 'cinch'

  bot = Cinch::Bot.new do
    configure do |c|
      c.server = "irc.electrocode.net"
      c.channels = ["#bots"]
      c.nick = '#{nick}'
    end

    on :message, "hello" do |m|
      m.reply "Hello, \#{m.user.nick}"
    end
  end

  bot.start
  HELLO

  hello
end