Modules are now defined using on_{msg,channel_msg,join,part,kick}.
Additionally, commands can be defined using a convenient macro.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
32 lines
713 B
Elixir
32 lines
713 B
Elixir
defmodule Omnibot.Contrib.Fortune do
|
||
use Omnibot.Module
|
||
|
||
@fortunes [
|
||
"Reply hazy, try again",
|
||
"Excellent Luck",
|
||
"Good Luck",
|
||
"Average Luck",
|
||
"Bad Luck",
|
||
"Good news will come to you by mail",
|
||
"´_ゝ`",
|
||
"タ━━━━━━(゚∀゚)━━━━━━ !!!!",
|
||
"You will meet a dark handsome stranger",
|
||
"Better not tell you now",
|
||
"Outlook good",
|
||
"Very Bad Luck",
|
||
"Godly Luck",
|
||
]
|
||
|
||
command "!fortune", [to] do
|
||
fortune = Enum.random(@fortunes)
|
||
reply = "#{to}: #{fortune}"
|
||
Irc.send_to(channel, reply)
|
||
end
|
||
|
||
command "!fortune" do
|
||
fortune = Enum.random(@fortunes)
|
||
reply = "#{nick}: #{fortune}"
|
||
Irc.send_to(channel, reply)
|
||
end
|
||
end
|