I am not that experienced so I am using chatgpt to help me with buttons and stuff.
...
# Define button callbacks
async def left_callback(interaction: nextcord.Interaction):
nonlocal current_video_index, current_video_path
...
async def right_callback(interaction: nextcord.Interaction):
nonlocal current_video_index, current_video_path
...
async def cross_callback(interaction: nextcord.Interaction):
nonlocal current_video_path
os.remove(current_video_path)
await interaction.message.delete()
# Add buttons to the embed
left_button = nextcord.ui.Button(label="<", custom_id="left_button")
right_button = nextcord.ui.Button(label=">", custom_id="right_button")
cross_button = nextcord.ui.Button(label="X", custom_id="cross_button", style=nextcord.ButtonStyle.red)
left_button.callback = left_callback
right_button.callback = right_callback
cross_button.callback = cross_callback
buttons_row = nextcord.components.ActionRow(left_button, right_button, cross_button)
await message.edit(components=[buttons_row])
await message.edit(components=message_component)
This is the code that chatgpt come up with but I cant find a way to make it work. Any help would be appreciated