summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorThéophile Choutri <theophile@choutri.eu>2018-01-18 11:02:25 +0100
committerGitHub <noreply@github.com>2018-01-18 11:02:25 +0100
commit4562ee549c7213567585f33e75b8598940b55b86 (patch)
tree848766537cfb21cfde5b200dcbf4c27ceae8337b /examples
parentMerge pull request #74 from tchoutri/add-whois (diff)
Fix namespaces and improve internal consistency
Diffstat (limited to 'examples')
-rw-r--r--examples/bot/config/config.exs2
-rw-r--r--examples/bot/lib/bot.ex10
-rw-r--r--examples/ohai/connection_handler.ex6
-rw-r--r--examples/ohai/login_handler.ex4
-rw-r--r--examples/ohai/ohai_handler.ex6
-rw-r--r--examples/ohai/ohai_irc.ex2
6 files changed, 15 insertions, 15 deletions
diff --git a/examples/bot/config/config.exs b/examples/bot/config/config.exs
index e0d35fe..50f23ee 100644
--- a/examples/bot/config/config.exs
+++ b/examples/bot/config/config.exs
@@ -4,7 +4,7 @@ use Mix.Config
config :exirc_example, bots: [
%{:server => "chat.freenode.net", :port => 6667,
- :nick => "exirc-example", :user => "exirc-example", :name => "ExIrc Example Bot",
+ :nick => "exirc-example", :user => "exirc-example", :name => "ExIRC Example Bot",
:channel => "##exirc-test"}
]
diff --git a/examples/bot/lib/bot.ex b/examples/bot/lib/bot.ex
index 12aab5d..453b9e8 100644
--- a/examples/bot/lib/bot.ex
+++ b/examples/bot/lib/bot.ex
@@ -22,8 +22,8 @@ defmodule Example.Bot do
end
end
- alias ExIrc.Client
- alias ExIrc.SenderInfo
+ alias ExIRC.Client
+ alias ExIRC.SenderInfo
def start_link(%{:nick => nick} = params) when is_map(params) do
config = Config.from_params(params)
@@ -31,10 +31,10 @@ defmodule Example.Bot do
end
def init([config]) do
- # Start the client and handler processes, the ExIrc supervisor is automatically started when your app runs
- {:ok, client} = ExIrc.start_link!()
+ # Start the client and handler processes, the ExIRC supervisor is automatically started when your app runs
+ {:ok, client} = ExIRC.start_link!()
- # Register the event handler with ExIrc
+ # Register the event handler with ExIRC
Client.add_handler client, self()
# Connect and logon to a server, join a channel and send a simple message
diff --git a/examples/ohai/connection_handler.ex b/examples/ohai/connection_handler.ex
index 2ba5aad..6d0de47 100644
--- a/examples/ohai/connection_handler.ex
+++ b/examples/ohai/connection_handler.ex
@@ -14,14 +14,14 @@ defmodule ConnectionHandler do
end
def init([state]) do
- ExIrc.Client.add_handler state.client, self
- ExIrc.Client.connect! state.client, state.host, state.port
+ ExIRC.Client.add_handler state.client, self
+ ExIRC.Client.connect! state.client, state.host, state.port
{:ok, state}
end
def handle_info({:connected, server, port}, state) do
debug "Connected to #{server}:#{port}"
- ExIrc.Client.logon state.client, state.pass, state.nick, state.user, state.name
+ ExIRC.Client.logon state.client, state.pass, state.nick, state.user, state.name
{:noreply, state}
end
diff --git a/examples/ohai/login_handler.ex b/examples/ohai/login_handler.ex
index 159e191..f7f7d1f 100644
--- a/examples/ohai/login_handler.ex
+++ b/examples/ohai/login_handler.ex
@@ -11,13 +11,13 @@ defmodule LoginHandler do
end
def init([client, channels]) do
- ExIrc.Client.add_handler client, self
+ ExIRC.Client.add_handler client, self
{:ok, {client, channels}}
end
def handle_info(:logged_in, state = {client, channels}) do
debug "Logged in to server"
- channels |> Enum.map(&ExIrc.Client.join client, &1)
+ channels |> Enum.map(&ExIRC.Client.join client, &1)
{:noreply, state}
end
diff --git a/examples/ohai/ohai_handler.ex b/examples/ohai/ohai_handler.ex
index 3d411f0..fe066b3 100644
--- a/examples/ohai/ohai_handler.ex
+++ b/examples/ohai/ohai_handler.ex
@@ -7,7 +7,7 @@ defmodule OhaiHandler do
end
def init([client]) do
- ExIrc.Client.add_handler client, self
+ ExIRC.Client.add_handler client, self
{:ok, client}
end
@@ -17,12 +17,12 @@ defmodule OhaiHandler do
end
def handle_info({:joined, channel, user}, client) do
- # ExIrc currently has a bug that doesn't remove the \r\n from the end
+ # ExIRC currently has a bug that doesn't remove the \r\n from the end
# of the channel name with it sends along this kind of message
# so we ensure any trailing or leading whitespace is explicitly removed
channel = String.strip(channel)
debug "#{user} joined #{channel}"
- ExIrc.Client.msg(client, :privmsg, channel, "ohai #{user}")
+ ExIRC.Client.msg(client, :privmsg, channel, "ohai #{user}")
{:noreply, client}
end
diff --git a/examples/ohai/ohai_irc.ex b/examples/ohai/ohai_irc.ex
index 27c05a2..83d5d56 100644
--- a/examples/ohai/ohai_irc.ex
+++ b/examples/ohai/ohai_irc.ex
@@ -6,7 +6,7 @@ defmodule OhaiIrc do
def start(_type, _args) do
import Supervisor.Spec, warn: false
- {:ok, client} = ExIrc.start_client!
+ {:ok, client} = ExIRC.start_client!
children = [
# Define workers and child supervisors to be supervised