Add Omnibot.Module
Modules can easily be defined with `use Omnibot.Module`. Omnibot.Contrib.Fortune has been updated to use this. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -22,12 +22,16 @@ defmodule Omnibot.Irc do
|
||||
|
||||
def send_msg(irc, command, param), do: send_msg(irc, command, [param])
|
||||
|
||||
def send_to(channel, text), do: send_to(__MODULE__, channel, text)
|
||||
def send_to(irc, channel, text), do: send_msg(irc, "PRIVMSG", [channel, text])
|
||||
|
||||
def join(channel), do: join(__MODULE__, channel)
|
||||
def join(irc, channel), do: send_msg(irc, "JOIN", channel)
|
||||
|
||||
def part(channel), do: part(__MODULE__, channel)
|
||||
def part(irc, channel), do: send_msg(irc, "PART", channel)
|
||||
|
||||
def sync_channels(), do: sync_channels(__MODULE__)
|
||||
def sync_channels(irc), do: GenServer.cast(irc, :sync_channels)
|
||||
|
||||
## Server callbacks
|
||||
|
||||
Reference in New Issue
Block a user