mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-23 04:26:57 +00:00
separation of commands
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
defmodule PlantIdDiscordBot.Consumer.Commands do
|
||||||
|
def global_application_commands() do
|
||||||
|
[
|
||||||
|
{"source", "Link to the source code for this bot", []},
|
||||||
|
{"invite", "Invite link for this bot", []},
|
||||||
|
{"help", "Help information for this bot", []},
|
||||||
|
{"info", "Information about this bot", []},
|
||||||
|
{"stats", "Statistics about this bot", []},
|
||||||
|
{"status", "API Status", []},
|
||||||
|
{"servers", "All servers that this bot belongs to", []},
|
||||||
|
{"id", "ID a plant from up to 5 images",
|
||||||
|
[
|
||||||
|
%{
|
||||||
|
type: 11,
|
||||||
|
name: "image1",
|
||||||
|
description: "The image to identify",
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
type: 11,
|
||||||
|
name: "image2",
|
||||||
|
description: "The image to identify",
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
type: 11,
|
||||||
|
name: "image3",
|
||||||
|
description: "The image to identify",
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
type: 11,
|
||||||
|
name: "image4",
|
||||||
|
description: "The image to identify",
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
type: 11,
|
||||||
|
name: "image5",
|
||||||
|
description: "The image to identify",
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -5,17 +5,10 @@ defmodule PlantIdDiscordBot.Consumer do
|
|||||||
use Nostrum.Consumer
|
use Nostrum.Consumer
|
||||||
alias Nostrum.Api
|
alias Nostrum.Api
|
||||||
alias PlantIdDiscordBot.Cog
|
alias PlantIdDiscordBot.Cog
|
||||||
|
alias PlantIdDiscordBot.Consumer.Commands
|
||||||
|
|
||||||
|
@global_application_commands Commands.global_application_commands()
|
||||||
|
|
||||||
@global_application_commands [
|
|
||||||
{"source", "Link to the source code for this bot, []"},
|
|
||||||
{"invite", "Invite link for this bot, []"},
|
|
||||||
{"help", "Help information for this bot, []"},
|
|
||||||
{"info", "Information about this bot, []"},
|
|
||||||
{"stats", "Statistics about this bot, []"},
|
|
||||||
{"status", "API Status, []"},
|
|
||||||
{"servers", "All servers that this bot belongs to, []"},
|
|
||||||
{"id", "ID a plant from up to 5 images, []"}
|
|
||||||
]
|
|
||||||
def handle_event({:READY}) do
|
def handle_event({:READY}) do
|
||||||
# mock function depending on the environment
|
# mock function depending on the environment
|
||||||
# Api.create_global_application_command(@global_application_commands)
|
# Api.create_global_application_command(@global_application_commands)
|
||||||
|
|||||||
Reference in New Issue
Block a user