its awesome
This commit is contained in:
parent
66c5cab5d3
commit
44607786cb
5 changed files with 35 additions and 7 deletions
|
|
@ -622,6 +622,7 @@ func _generate_timer_nodes() -> void:
|
||||||
func _connection_closed(code: int, reason: String) -> void:
|
func _connection_closed(code: int, reason: String) -> void:
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print('WSS connection closed with code=%s, reason=%s' % [code, reason])
|
print('WSS connection closed with code=%s, reason=%s' % [code, reason])
|
||||||
|
get_tree().quit() #force reset
|
||||||
|
|
||||||
|
|
||||||
func _data_received(msg: String) -> void:
|
func _data_received(msg: String) -> void:
|
||||||
|
|
@ -679,8 +680,9 @@ func _send_heartbeat() -> void: # Send heartbeat OP code 1
|
||||||
if _client.get_ready_state() == WebSocketPeer.State.STATE_OPEN:
|
if _client.get_ready_state() == WebSocketPeer.State.STATE_OPEN:
|
||||||
_send_dict_wss(response_payload)
|
_send_dict_wss(response_payload)
|
||||||
else:
|
else:
|
||||||
print("Websocket not open, skipping send")
|
print("Websocket not open, resseting self")
|
||||||
login()
|
get_tree().quit()
|
||||||
|
#login()
|
||||||
_heartbeat_ack_received = false
|
_heartbeat_ack_received = false
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print('Heartbeat sent!')
|
print('Heartbeat sent!')
|
||||||
|
|
|
||||||
24
application_cmds/force-crash.gd
Normal file
24
application_cmds/force-crash.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
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:
|
||||||
|
if not Tools.check_perms(interaction):
|
||||||
|
return
|
||||||
|
|
||||||
|
print("uhoh?")
|
||||||
|
interaction.reply(
|
||||||
|
{
|
||||||
|
"content" : "mrowww..."
|
||||||
|
}
|
||||||
|
)
|
||||||
|
print("ohhuh")
|
||||||
|
bot.get_tree().quit()
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
var data = ApplicationCommand.new().set_name("force_crash").set_description("cause the program to quit for test purposes")
|
||||||
1
application_cmds/force-crash.gd.uid
Normal file
1
application_cmds/force-crash.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://hnxkary6qbar
|
||||||
|
|
@ -43,7 +43,7 @@ func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Ar
|
||||||
Library.save_data()
|
Library.save_data()
|
||||||
var response : String = "returned `" + spool_name + "` to the library, would you like to keep it there or delete it"
|
var response : String = "returned `" + spool_name + "` to the library, would you like to keep it there or delete it"
|
||||||
#var response : String = "Loaded `"+ spool_editing.name + "` into `" + printer_editing.name + "` and unloaded `" + endangered_spool.name + "` would you like to keep or delete the old spool: `" + endangered_spool.name + "` ?"
|
#var response : String = "Loaded `"+ spool_editing.name + "` into `" + printer_editing.name + "` and unloaded `" + endangered_spool.name + "` would you like to keep or delete the old spool: `" + endangered_spool.name + "` ?"
|
||||||
#var embed = Embed.new().set_description(Library.list_printers())
|
var embed = Embed.new().set_description(Library.list_printers())
|
||||||
var row = MessageActionRow.new()
|
var row = MessageActionRow.new()
|
||||||
var delete_button = MessageButton.new().set_style(MessageButton.STYLES.DANGER)
|
var delete_button = MessageButton.new().set_style(MessageButton.STYLES.DANGER)
|
||||||
delete_button.set_custom_id('delete-unloadspool')
|
delete_button.set_custom_id('delete-unloadspool')
|
||||||
|
|
@ -56,7 +56,7 @@ func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Ar
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
"content": response,
|
"content": response,
|
||||||
#"embeds":[embed],
|
"embeds":[embed],
|
||||||
"components":[row],
|
"components":[row],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -68,9 +68,10 @@ func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Ar
|
||||||
for spool : Spool in printer.spools:
|
for spool : Spool in printer.spools:
|
||||||
menu.add_option(spool.name, spool.name)
|
menu.add_option(spool.name, spool.name)
|
||||||
var row = MessageActionRow.new().add_component(menu)
|
var row = MessageActionRow.new().add_component(menu)
|
||||||
|
var embed = Embed.new().set_description(Library.list_printers())
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
"content": response,
|
"content": response,
|
||||||
#"embeds":[embed],
|
"embeds":[embed],
|
||||||
"components":[row],
|
"components":[row],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
4
main.gd
4
main.gd
|
|
@ -55,11 +55,11 @@ func _on_bot_ready(bot: DiscordBot):
|
||||||
|
|
||||||
# -----Single server (updates instantly)
|
# -----Single server (updates instantly)
|
||||||
#_register_application_commands(bot, "guild_id_here")
|
#_register_application_commands(bot, "guild_id_here")
|
||||||
#_register_application_commands(bot, "679917161195765822") # personal server
|
_register_application_commands(bot, "679917161195765822") # personal server
|
||||||
#_register_application_commands(bot, "1038007666032787476") # fabsoc
|
#_register_application_commands(bot, "1038007666032787476") # fabsoc
|
||||||
|
|
||||||
# -----Global (may take upto 1hr to update)
|
# -----Global (may take upto 1hr to update)
|
||||||
_register_application_commands(bot)
|
#_register_application_commands(bot)
|
||||||
|
|
||||||
|
|
||||||
#func _on_message_create(bot: DiscordBot, message: Message, channel: Dictionary) -> void:
|
#func _on_message_create(bot: DiscordBot, message: Message, channel: Dictionary) -> void:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue