mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(telegram-bot): make labels readable
This commit is contained in:
@@ -8,14 +8,32 @@ export default {
|
||||
});
|
||||
|
||||
const options = [];
|
||||
|
||||
let arrI = 0;
|
||||
let i = 0;
|
||||
for (const { label } of global.config.responses) {
|
||||
options.push({
|
||||
text: label,
|
||||
callback_data: `label_${label.toLowerCase()}`
|
||||
});
|
||||
if (arrI === 0 && i === 0) {
|
||||
options.push([{
|
||||
text: label,
|
||||
callback_data: `label_${label.toLowerCase()}`
|
||||
}]);
|
||||
i++;
|
||||
} else if (i === 2) {
|
||||
options.push([{
|
||||
text: label,
|
||||
callback_data: `label_${label.toLowerCase()}`
|
||||
}]);
|
||||
i = 0;
|
||||
arrI++
|
||||
} else {
|
||||
options[arrI].push({
|
||||
text: label,
|
||||
callback_data: `label_${label.toLowerCase()}`
|
||||
});
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(options);
|
||||
const admins = await global.bot.getChatAdministrators(msg.chat.id);
|
||||
const isAdmin = admins.find((admin) => admin.user.id === msg.from.id);
|
||||
|
||||
@@ -31,7 +49,7 @@ export default {
|
||||
message_thread_id: msg.message_thread_id,
|
||||
reply_to_message_id: msg.reply_to_message.message_id,
|
||||
reply_markup: {
|
||||
inline_keyboard: [options]
|
||||
inline_keyboard: options
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user