Discord_Elixir_test/lib/events/ready.ex

18 lines
402 B
Elixir
Raw Permalink Normal View History

2024-10-12 17:06:08 +02:00
defmodule HahaYes.Events.ReadyConsumer do
2024-10-12 17:13:33 +02:00
@moduledoc """
Triggered when the bot is ready to responds.
Also give some stats.
"""
2024-10-12 17:06:08 +02:00
use Nostrum.Consumer
def handle_event({:READY, event, _ws_state}) do
IO.puts("""
#{event.user.username} (#{event.user.id}) is ready!
I am in #{length(event.guilds)} servers!
2024-10-12 21:11:34 +02:00
Prefix: #{Application.get_env(:nostrum, :prefix)}
2024-10-12 17:06:08 +02:00
""")
end
end