use ws_state (but not really)
This commit is contained in:
parent
08c6505530
commit
c9bcf00216
3 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ defmodule HahaYes.Commands.Download do
|
|||
|
||||
Bot: <video file>
|
||||
"""
|
||||
def execute(msg) do
|
||||
def execute(msg, _ws_state) do
|
||||
{:ok, loading} = Api.create_message(msg.channel_id, "Downloading...")
|
||||
|
||||
arg = String.replace(msg.content, "h3h3 download ", "")
|
||||
|
|
|
@ -15,7 +15,7 @@ defmodule HahaYes.Commands.Ping do
|
|||
Bot: Pong!
|
||||
"""
|
||||
|
||||
def execute(msg) do
|
||||
def execute(msg, _ws_state) do
|
||||
Api.create_message(msg.channel_id, "Pong!")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ defmodule HahaYes.Events.MessagesConsumer do
|
|||
|
||||
use Nostrum.Consumer
|
||||
|
||||
def handle_event({:MESSAGE_CREATE, msg, _ws_state}) when msg.author.bot != true do
|
||||
def handle_event({:MESSAGE_CREATE, msg, ws_state}) when msg.author.bot != true do
|
||||
if String.starts_with?(msg.content, "h3h3 ") do
|
||||
msg.content
|
||||
|> String.replace("h3h3 ", "")
|
||||
|
@ -13,7 +13,7 @@ defmodule HahaYes.Events.MessagesConsumer do
|
|||
|> Enum.at(0)
|
||||
|> String.downcase()
|
||||
|> String.capitalize()
|
||||
|> then(& apply(String.to_atom("#{HahaYes.Commands}.#{&1}"), :execute, [msg]))
|
||||
|> then(& apply(String.to_atom("#{HahaYes.Commands}.#{&1}"), :execute, [msg, ws_state]))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue