secre
secre
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by bunningtonfoot on 7/3/2024 in #djs-questions
Randomly Started Happening
I was betting on that with doubt, like why you will update smth that break other thing, lmao. But I guess thats why coding is fun, ty for help!
25 replies
DIAdiscord.js - Imagine an app
Created by bunningtonfoot on 7/3/2024 in #djs-questions
Randomly Started Happening
I have like 6 bots running, and they all have same error, maybe discord broke something?... Anyway i'll check if something in my end broken
25 replies
DIAdiscord.js - Imagine an app
Created by bunningtonfoot on 7/3/2024 in #djs-questions
Randomly Started Happening
Same error for me. The thing is bot state doesn't changed for 2 month and everything was okay. Started happening literally 30 minutes ago
25 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
I guess we all had problems like this xd
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
What a newbie mistake goddammit :Deadge: Thanks, will fix
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
Oh wait :Deadge:
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
weird thing
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
No description
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
Just embed description where everything breaks
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
I logging IDS and ITS all the way correct :KEKL:
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
export function getRandomResponse() {
return RESPONSES[Math.floor(Math.random() * RESPONSES.length)]
}
export function getRandomResponse() {
return RESPONSES[Math.floor(Math.random() * RESPONSES.length)]
}
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
{
"description": `%link%, __Ваша__ валентинка получена, топаем к пункту распределения! ${process.env.RESPONSE_EMOJI}`,
"footer": { "text": "Отделение Yume №3 → Проверка → Валентинки." },
"thumbnail": { "url": "https://i.imgur.com/xntg0cd.png" },
},
{
"description": `%link%, __Ваша__ валентинка получена, топаем к пункту распределения! ${process.env.RESPONSE_EMOJI}`,
"footer": { "text": "Отделение Yume №3 → Проверка → Валентинки." },
"thumbnail": { "url": "https://i.imgur.com/xntg0cd.png" },
},
that's one of them. simple object of embed with %link% to put mention in the future
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
But how it can be a problem? I will test your example fs but I can't understand why :yM_kekw: Let me show you example of those "embeds"
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
No description
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
Testing code with buttonInteraction that we receive in collector, and it putting different user anyway, lol
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
I sent you code where I already changed initialInteraction to interaction, edited it to be more correct with info I provided
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
Damn my I should upload it to pastebin or something? It's a bit large in here :DEAD:
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
async function handleSelectedConvertType(
interaction: ButtonInteraction,
initialInteraction: ChatInputCommandInteraction
) {
await interaction.deferReply({ ephemeral: true })

const moderationChannel = await interaction.guild?.channels.fetch(
process.env.APPROV_CHANNEL_ID!
)

if (!moderationChannel || moderationChannel.type !== ChannelType.GuildText) {
return interaction.editReply({
content: "Ой.. произошла ошибка во время выполнения команды...",
})
}

const valentineText = initialInteraction.options.getString("текст", true)
const attachment = initialInteraction.options.getAttachment("картинка")
const user = initialInteraction.options.getUser("юзер", true)

const randomSelectedEmbed = getRandomResponse()

randomSelectedEmbed.description = randomSelectedEmbed.description.replace(
"%link%",
initialInteraction.user.toString()
)

const buildedEmbed = new EmbedBuilder(randomSelectedEmbed).setColor("#2b2d31")

const moderationEmbed = new EmbedBuilder()
.setDescription(valentineText)
.setFooter({
text: `${getConvertType(interaction.customId)} ${initialInteraction.user.id} ${
user.id
}`,
})
.setColor("#2b2d31")
.setAuthor({
name: initialInteraction.user.username,
iconURL: initialInteraction.user.displayAvatarURL(),
})

if (attachment) {
moderationEmbed.setImage(attachment.url)
}

interaction.editReply({ embeds: [buildedEmbed] }).catch((err) => {
console.log("Ошибка во время попытки ответить на выбор конверта", err)
})

moderationChannel
.send({
embeds: [moderationEmbed],
components: [createModerationRow()],
})
.catch((err) => {
console.log(`Ошибка во время отправки валентинки на модерацию`, err)
})
}
async function handleSelectedConvertType(
interaction: ButtonInteraction,
initialInteraction: ChatInputCommandInteraction
) {
await interaction.deferReply({ ephemeral: true })

const moderationChannel = await interaction.guild?.channels.fetch(
process.env.APPROV_CHANNEL_ID!
)

if (!moderationChannel || moderationChannel.type !== ChannelType.GuildText) {
return interaction.editReply({
content: "Ой.. произошла ошибка во время выполнения команды...",
})
}

const valentineText = initialInteraction.options.getString("текст", true)
const attachment = initialInteraction.options.getAttachment("картинка")
const user = initialInteraction.options.getUser("юзер", true)

const randomSelectedEmbed = getRandomResponse()

randomSelectedEmbed.description = randomSelectedEmbed.description.replace(
"%link%",
initialInteraction.user.toString()
)

const buildedEmbed = new EmbedBuilder(randomSelectedEmbed).setColor("#2b2d31")

const moderationEmbed = new EmbedBuilder()
.setDescription(valentineText)
.setFooter({
text: `${getConvertType(interaction.customId)} ${initialInteraction.user.id} ${
user.id
}`,
})
.setColor("#2b2d31")
.setAuthor({
name: initialInteraction.user.username,
iconURL: initialInteraction.user.displayAvatarURL(),
})

if (attachment) {
moderationEmbed.setImage(attachment.url)
}

interaction.editReply({ embeds: [buildedEmbed] }).catch((err) => {
console.log("Ошибка во время попытки ответить на выбор конверта", err)
})

moderationChannel
.send({
embeds: [moderationEmbed],
components: [createModerationRow()],
})
.catch((err) => {
console.log(`Ошибка во время отправки валентинки на модерацию`, err)
})
}
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
the message:
const message = await interaction.deferReply({
ephemeral: true,
fetchReply: true,
})
const message = await interaction.deferReply({
ephemeral: true,
fetchReply: true,
})
51 replies
DIAdiscord.js - Imagine an app
Created by secre on 2/14/2024 in #djs-questions
Interactions overlapping? (I don't know what even happening anymore)
const componentCollector = message.createMessageComponentCollector({
filter: (int) => int.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60_000,
max: 1,
})
const componentCollector = message.createMessageComponentCollector({
filter: (int) => int.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60_000,
max: 1,
})
51 replies