printer nozzle edits, spool creation
This commit is contained in:
parent
319e30e3d4
commit
492990f073
9 changed files with 137 additions and 3 deletions
37
application_cmds/spool-create.gd
Normal file
37
application_cmds/spool-create.gd
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
extends RefCounted
|
||||
|
||||
#func on_ready(main, bot: DiscordBot) -> void:
|
||||
# pass
|
||||
#
|
||||
#func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
# pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
print(options)
|
||||
var spool_name : String = options[0].value
|
||||
var spool_link : String
|
||||
if options.size() > 1:
|
||||
spool_link = options[1].value
|
||||
|
||||
var new_spool : Spool = Spool.new()
|
||||
new_spool.name = spool_name
|
||||
if spool_link:
|
||||
new_spool.link = spool_link
|
||||
Library.save.spools.append(new_spool)
|
||||
Library.save_data()
|
||||
|
||||
var response : String = "Created new spool: `" + spool_name + "`\n"
|
||||
var embed = Embed.new().set_description(Library.list_spools())
|
||||
|
||||
interaction.reply({
|
||||
"content": response,
|
||||
"embeds":[embed]
|
||||
})
|
||||
pass
|
||||
|
||||
var data = ApplicationCommand.new()\
|
||||
.set_name("spool-create")\
|
||||
.set_description("create a new spool")\
|
||||
.add_option(ApplicationCommand.string_option("name", "the printers name",{"required":true}))\
|
||||
.add_option(ApplicationCommand.string_option("link", "optional link to the fillaments page", {"required" : false}))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue