cooking
This commit is contained in:
parent
514d68adbf
commit
788633c014
12 changed files with 89 additions and 14 deletions
|
|
@ -7,6 +7,9 @@ extends RefCounted
|
|||
# pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var printer_name = options[0].value
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, opt
|
|||
pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var printer_name = options[0].value
|
||||
var printer_exists : bool = false
|
||||
|
|
@ -73,16 +76,24 @@ func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Ar
|
|||
pass
|
||||
|
||||
func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
||||
|
||||
|
||||
if not interaction.is_button():
|
||||
return
|
||||
|
||||
print(interaction.data.custom_id)
|
||||
|
||||
if(interaction.data.custom_id == "delete-printer"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
#print("deleting: " + endangered_printer)
|
||||
for printer in Library.save.printers:
|
||||
if printer.name == endangered_printer:
|
||||
|
||||
for spool : Spool in printer.spools:
|
||||
Library.save.spools.append(spool)
|
||||
#dont need to erase, the whole printers about to get obilierated
|
||||
|
||||
Library.save.printers.erase(printer)
|
||||
Library.save_data()
|
||||
var embed = Embed.new().set_description(endangered_printer + " has been deleted")
|
||||
|
|
@ -94,6 +105,8 @@ func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
|||
})
|
||||
|
||||
elif(interaction.data.custom_id == "keep-printer"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
endangered_printer = ""
|
||||
var embed = Embed.new().set_description("cancelled deletion")
|
||||
var new_embeds = interaction.message.embeds + [embed]
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, opt
|
|||
pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var printer_name = options[0].value
|
||||
var printer_exists : bool = false
|
||||
|
|
@ -114,6 +117,9 @@ func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
|||
print(interaction.data.custom_id)
|
||||
|
||||
if(interaction.data.custom_id == "delete-oldspool"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
#print("deleting: " + endangered_printer)
|
||||
for spool in Library.save.spools:
|
||||
if spool == endangered_spool:
|
||||
|
|
@ -129,6 +135,9 @@ func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
|||
})
|
||||
|
||||
elif(interaction.data.custom_id == "keep-oldspool"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
endangered_spool = null
|
||||
var embed = Embed.new().set_description("cancelled removal")
|
||||
var new_embeds = interaction.message.embeds + [embed]
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, opt
|
|||
pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var printer_name = options[0].value
|
||||
var new_nozzle = options[1].value
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, opt
|
|||
pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var printer_name = options[0].value
|
||||
var new_slots : int = options[1].value
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, opt
|
|||
pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var printer_name = options[0].value
|
||||
var printer_exists : bool = false
|
||||
|
|
@ -86,18 +89,22 @@ func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
|||
if not interaction.is_select_menu():
|
||||
return
|
||||
|
||||
print(interaction.data.values[0])
|
||||
var spool_unloading : String = interaction.data.values[0]
|
||||
for spool : Spool in printer_edit.spools:
|
||||
if spool.name == spool_unloading:
|
||||
Library.save.spools.append(spool)
|
||||
printer_edit.spools.erase(spool)
|
||||
Library.save_data()
|
||||
interaction.update({
|
||||
"content" : "returned `" + spool.name + "` to the library" ,
|
||||
"components" : [],
|
||||
})
|
||||
break
|
||||
if(interaction.data.custom_id == "spool-select"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(interaction.data.values[0])
|
||||
var spool_unloading : String = interaction.data.values[0]
|
||||
for spool : Spool in printer_edit.spools:
|
||||
if spool.name == spool_unloading:
|
||||
Library.save.spools.append(spool)
|
||||
printer_edit.spools.erase(spool)
|
||||
Library.save_data()
|
||||
interaction.update({
|
||||
"content" : "returned `" + spool.name + "` to the library" ,
|
||||
"components" : [],
|
||||
})
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ extends RefCounted
|
|||
# pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var spool_name : String = options[0].value
|
||||
var spool_link : String
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, opt
|
|||
pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
|
||||
print(options)
|
||||
var spool_name = options[0].value
|
||||
var spool_exists : bool = false
|
||||
|
|
@ -73,12 +76,16 @@ func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Ar
|
|||
pass
|
||||
|
||||
func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
||||
|
||||
|
||||
if not interaction.is_button():
|
||||
return
|
||||
|
||||
print(interaction.data.custom_id)
|
||||
|
||||
if(interaction.data.custom_id == "delete-spool"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
#print("deleting: " + endangered_printer)
|
||||
for spool in Library.save.spools:
|
||||
if spool.name == endangered_spool:
|
||||
|
|
@ -94,6 +101,8 @@ func on_interaction_create(bot: DiscordBot, interaction : DiscordInteraction):
|
|||
})
|
||||
|
||||
elif(interaction.data.custom_id == "keep-spool"):
|
||||
if not Tools.check_perms(interaction):
|
||||
return
|
||||
endangered_spool = ""
|
||||
var embed = Embed.new().set_description("cancelled deletion")
|
||||
var new_embeds = interaction.message.embeds + [embed]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue