test
This commit is contained in:
parent
f157a2caf3
commit
4cd60119d5
11
index.js
11
index.js
@ -52,15 +52,13 @@ client.once('clientReady', async () => {
|
||||
|
||||
deploy(process.env.DISCORD_TOKEN);
|
||||
clean(client);
|
||||
await update(client);
|
||||
await update(client);
|
||||
});
|
||||
|
||||
client.on(Events.InteractionCreate, async interaction => {
|
||||
if (interaction.isStringSelectMenu() || interaction.isButton()) {
|
||||
const handled = await handlePinboardSelection(interaction);
|
||||
if (handled) {
|
||||
return;
|
||||
}
|
||||
if (interaction.isStringSelectMenu()) {
|
||||
await handlePinboardSelection(interaction);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
@ -97,5 +95,4 @@ client.on(Events.InteractionCreate, async interaction => {
|
||||
});
|
||||
|
||||
client.login(process.env.DISCORD_TOKEN);
|
||||
|
||||
setInterval(() => { update(client); }, 120000);
|
||||
@ -6,8 +6,6 @@ const PINBOARD_SELECT_CUSTOM_ID = 'pinboard-image-select';
|
||||
const PINBOARD_PREV_CUSTOM_ID = 'pinboard-image-prev';
|
||||
const PINBOARD_NEXT_CUSTOM_ID = 'pinboard-image-next';
|
||||
const PINBOARD_INDEX_CUSTOM_ID = 'pinboard-image-index';
|
||||
const PINBOARD_SPACER_LEFT_CUSTOM_ID = 'pinboard-image-spacer-left';
|
||||
const PINBOARD_SPACER_RIGHT_CUSTOM_ID = 'pinboard-image-spacer-right';
|
||||
const selectedImageIndexByMessage = new Map();
|
||||
const preloadedImagesByUrl = new Map();
|
||||
const warmedMessageIds = new Set();
|
||||
@ -241,7 +239,7 @@ const buildImageSelectorRow = (items, selectedIndex) => {
|
||||
|
||||
const selectMenu = new StringSelectMenuBuilder()
|
||||
.setCustomId(PINBOARD_SELECT_CUSTOM_ID)
|
||||
.setPlaceholder('Image')
|
||||
.setPlaceholder('Choisis une image')
|
||||
.addOptions(options);
|
||||
|
||||
return new ActionRowBuilder().addComponents(selectMenu);
|
||||
@ -253,7 +251,7 @@ const buildImageNavigationRow = (items, selectedIndex) => {
|
||||
|
||||
const previousButton = new ButtonBuilder()
|
||||
.setCustomId(PINBOARD_PREV_CUSTOM_ID)
|
||||
.setLabel('<<')
|
||||
.setLabel(' << ')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setDisabled(!hasItems);
|
||||
|
||||
@ -265,23 +263,11 @@ const buildImageNavigationRow = (items, selectedIndex) => {
|
||||
|
||||
const nextButton = new ButtonBuilder()
|
||||
.setCustomId(PINBOARD_NEXT_CUSTOM_ID)
|
||||
.setLabel('>>')
|
||||
.setLabel(' >> ')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setDisabled(!hasItems);
|
||||
|
||||
const leftSpacer = new ButtonBuilder()
|
||||
.setCustomId(PINBOARD_SPACER_LEFT_CUSTOM_ID)
|
||||
.setLabel('-')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true);
|
||||
|
||||
const rightSpacer = new ButtonBuilder()
|
||||
.setCustomId(PINBOARD_SPACER_RIGHT_CUSTOM_ID)
|
||||
.setLabel('-')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true);
|
||||
|
||||
return new ActionRowBuilder().addComponents(leftSpacer, previousButton, indexButton, nextButton, rightSpacer);
|
||||
return new ActionRowBuilder().addComponents(previousButton, indexButton, nextButton);
|
||||
};
|
||||
|
||||
const getMinecraftStatus = async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user