- help
- normal
- search
- tic tac toe
- it should perform the same function
- command name is right after the prefix:
!command_name
or 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
message
id
page
embed
message_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
message
command_name
args
message
:message
id
:search(command_name, return_one, args)
page
:0
embed
:create_embed(STUFF GOES HERE)
message_data
:{}
button.message
button.custom_id
args
let embed = message.embeds[0]
embed.fields = []
message
:message
id
:embed.title.match(/(?<=\[)\d+/g)?.[0]
page
:embed.title.match(/(?<=\()\d+/g)?.[0]
embed
:embed
message_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_file
to see where the command is from (a command or a button function file) - get
is_command_file
value from a map - maybe i could try a try catch k
- um
- um
- um
- um
activities
bricks
bricks_or_items
enemies
items
kits
lti_names
mission_locations
missions
npcs
objects
preconditions
skills
packages