consumes attachments for ID

This commit is contained in:
Owen
2025-01-10 19:56:37 +01:00
committed by Owen Rees
parent 529630b85d
commit e6103df1ae
3 changed files with 151 additions and 1 deletions
+8
View File
@@ -26,4 +26,12 @@ defmodule PlantIdDiscordBot.Consumer do
"id" -> Cog.PlantNet.id(interaction)
end
end
def handle_event({:MESSAGE_CREATE, %{attachments: attachments} = message, _ws_state}) do
if length(attachments) > 0 do
# deprecated -> Nostrum.Api.Channel.start_typing/1 in v1.0
Api.start_typing!(message.channel_id)
Cog.PlantNetMessage.id(message)
end
end
end