woojiahao / Taiga

Discord administration bot
https://woojiahao.github.io/Taiga
MIT License
20 stars 12 forks source link

Add the position of the selected item from a interactive embed #24

Closed woojiahao closed 5 years ago

woojiahao commented 5 years ago

The position of the selected item should be given to each interactive embed:

Formula:

[(page # - 1) * 10] + (selected index (number displayed) + 1)

Example: The user has selected 5 on the 2nd page, they have effectively selected the 16th item in the data array.

[(2 - 1) * 10] + (5 + 1) = 16

Note: The 16th selected item will be index 15 of the array. So you can remove the +1 when passing it through the lambda.

woojiahao commented 5 years ago

Good idea. Done