- help
- normal
- search
- tic tac toe
- it should perform the same function
- command name is right after the prefix:
!command_nameor the buttonscustom_id - except on button edits the message and on message sends the message
let id = button.message.embeds[0].title.match(/(?<=\[)\d+/g)?.[0]gets id from “some name [123]”
let page = button.message.embeds[0].title.match(/(?<=\()\d+/g)?.[0]gets page from “some name [123] (1)”
- if the buttons and commands work the same, they can use the same command file
- i will have 2 handlers, button and message
- they will both send the following parameters to the command file
messageidpageembedmessage_data
- the command file should return
[text, embed, components] - each handler will be doing the sending or editing
- message handler will create a blank embed, with no fields
- button handler will send the previous embed, but remove all fields
messagecommand_nameargs
message:messageid:search(command_name, return_one, args)page:0embed:create_embed(STUFF GOES HERE)message_data:{}
button.messagebutton.custom_idargs
let embed = message.embeds[0]
embed.fields = []message:messageid:embed.title.match(/(?<=\[)\d+/g)?.[0]page:embed.title.match(/(?<=\()\d+/g)?.[0]embed:embedmessage_data:message_data[message.id]
takes all fields and divides them into groups based on given number of fields allowed in a group, this group size is determined in config.json
takes a 2D array of buttons and turn its it to a component by adding each initial index as a new action row
- if i create button data/message data for tic tac toe, delete button data after someone wins or ties
- message data would be created in message handler
- except i have to send the message first, i could create an empty object
{}and pass it as message data - then after i send message, do
message_data['sent_message'] = {...temp_message_data} - this would mean
- message data would be modified in each command handler
- what do i do if i want a command file that only exists on a button being pressed
- check
is_command_fileto see where the command is from (a command or a button function file) - get
is_command_filevalue from a map - maybe i could try a try catch k
- um
- um
- um
- um
activitiesbricksbricks_or_itemsenemiesitemskitslti_namesmission_locationsmissionsnpcsobjectspreconditionsskillspackages