[RS] JesseUCAVedYou [EN]
[RS] JesseUCAVedYou [EN]
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by [RS] JesseUCAVedYou [EN] on 10/8/2024 in #djs-questions
Keeping A Channel Polls Only
Works wonderfully thanks to you. Will post my code here for future reference of others.
// The channel ID you want to monitor
const pollChannelId = '1292516925494267954';

client.on('messageCreate', async (message) => {
// Ignore messages from bots
if (message.author.bot) return;

// Only check messages from the specified channel
if (message.channel.id === pollChannelId) {
// If the message is a poll result (type 46), do nothing (allow it)
if (message.type === 46) {
return; // End the execution, don't delete the poll result message
}

// If the message is a poll
if (message.poll) {
// Check if the poll has more than 5 options
if (message.poll.answers && message.poll.answers.size > 5) {
try {
// Delete the message (poll)
await message.delete();
// Notify the user via DM
await message.author.send(`Your poll was deleted because it exceeded the limit of 5 answers.`);
} catch (error) {
console.error(`Error deleting poll or sending DM: ${error}`);
}
}
return; // End execution here if it's a valid poll
}

// If it's not a poll, delete the message and send a DM
try {
await message.delete();
await message.author.send(`Your message was deleted because ${message.channel} is for polls only.`);
} catch (error) {
console.error(`Error deleting message or sending DM: ${error}`);
}
}
});
// The channel ID you want to monitor
const pollChannelId = '1292516925494267954';

client.on('messageCreate', async (message) => {
// Ignore messages from bots
if (message.author.bot) return;

// Only check messages from the specified channel
if (message.channel.id === pollChannelId) {
// If the message is a poll result (type 46), do nothing (allow it)
if (message.type === 46) {
return; // End the execution, don't delete the poll result message
}

// If the message is a poll
if (message.poll) {
// Check if the poll has more than 5 options
if (message.poll.answers && message.poll.answers.size > 5) {
try {
// Delete the message (poll)
await message.delete();
// Notify the user via DM
await message.author.send(`Your poll was deleted because it exceeded the limit of 5 answers.`);
} catch (error) {
console.error(`Error deleting poll or sending DM: ${error}`);
}
}
return; // End execution here if it's a valid poll
}

// If it's not a poll, delete the message and send a DM
try {
await message.delete();
await message.author.send(`Your message was deleted because ${message.channel} is for polls only.`);
} catch (error) {
console.error(`Error deleting message or sending DM: ${error}`);
}
}
});
14 replies
DIAdiscord.js - Imagine an app
Created by [RS] JesseUCAVedYou [EN] on 10/8/2024 in #djs-questions
Keeping A Channel Polls Only
Will try. Thanks!
14 replies
DIAdiscord.js - Imagine an app
Created by [RS] JesseUCAVedYou [EN] on 10/8/2024 in #djs-questions
Keeping A Channel Polls Only
:PES_Happy:
14 replies
DIAdiscord.js - Imagine an app
Created by [RS] JesseUCAVedYou [EN] on 10/8/2024 in #djs-questions
Keeping A Channel Polls Only
So here I am looking like a fool lol
14 replies
DIAdiscord.js - Imagine an app
Created by [RS] JesseUCAVedYou [EN] on 10/8/2024 in #djs-questions
Keeping A Channel Polls Only
No description
14 replies
DIAdiscord.js - Imagine an app
Created by [RS] JesseUCAVedYou [EN] on 10/8/2024 in #djs-questions
Keeping A Channel Polls Only
-_- and my question/code gets removed. le sigh
14 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 8/7/2024 in #support-forum
7 Days to Die - Joining Trigger - Triggers Twice
Not sure if this can help any, but this is the console from when I requested to join my server, joined/spawned, and exited.
10 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 8/7/2024 in #support-forum
7 Days to Die - Joining Trigger - Triggers Twice
No description
10 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 8/7/2024 in #support-forum
7 Days to Die - Joining Trigger - Triggers Twice
Rate limit isn't a solution I noticed. Since the messages sent are join, leave, then join once the player spawns rate limiting will only show join then leave making it appear as though every player has left the server after joining.
10 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 8/7/2024 in #support-forum
7 Days to Die - Joining Trigger - Triggers Twice
True. Next time a friend joins I'll watch my console and see what happens just out of curiosity.
10 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 8/7/2024 in #support-forum
7 Days to Die - Joining Trigger - Triggers Twice
Oh I have. I just added that log channel to that particular trigger and hadn't set one yet, but it reminded me that, that does in fact occur. Like I said not a biggie. Just wasn't sure if a 7DTD update broke something for you guys in regards to it.
10 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 7/25/2024 in #support-forum
7 Days to Die Chats
Now working.
7 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 7/25/2024 in #support-forum
7 Days to Die Chats
No rush. Just figured it needed to be mentioned. Thanks fellas.:10outof10:
7 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 7/25/2024 in #support-forum
7 Days to Die Chats
Had a feeling. Figured a game update may have changed a variable or something that you weren't aware of causing an issue.
7 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 5/16/2024 in #support-forum
Few variables not working - Battlebit
No description
12 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 5/16/2024 in #support-forum
Few variables not working - Battlebit
They're populating correctly now 🙂
12 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 5/16/2024 in #support-forum
Few variables not working - Battlebit
Done
12 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 5/16/2024 in #support-forum
Few variables not working - Battlebit
So something like JesseUCAVedYou used the !lead command and became squad leader of squad A(or squad Alpha)
12 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 5/16/2024 in #support-forum
Few variables not working - Battlebit
I was trying to get this {{player.name}} used the !lead command and became squad leader of their squad. to say {{player.name}} used the !lead command and became squad leader of {{player.squadName}} (or whatever would result in an indication of a squad.
12 replies
BBattleMetrics
Created by [RS] JesseUCAVedYou [EN] on 5/16/2024 in #support-forum
Few variables not working - Battlebit
Theres a difference? Either way neither of them filled the info. Here is the share url if that helps: https://www.battlemetrics.com/rcon/triggers/add?trigger=%7B%22types%22%3A%5B%22playerMessage%22%5D%2C%22personal%22%3Afalse%2C%22condition%22%3A%7B%22or%22%3A%5B%7B%22operand%22%3A%22server.players%22%2C%22operator%22%3A%22gte%22%2C%22value%22%3A0%7D%5D%7D%2C%22rateLimits%22%3Anull%2C%22inputs%22%3A%5B%5D%2C%22logCondition%22%3Atrue%2C%22actions%22%3A%5B%7B%22id%22%3A%22gLld3oWzG%22%2C%22command%22%3A%22globalChat%22%2C%22gameId%22%3Anull%2C%22options%22%3A%7B%22message%22%3A%22%7B%7Bplayer.name%7D%7D+that+command+is+reserved+for+clan+members+only.+Apply+to+join+at+Discord.gg%2FRSClan.%22%7D%2C%22order%22%3A3%2C%22condition%22%3A%7B%22and%22%3A%5B%7B%22operand%22%3A%22msg.body%22%2C%22operator%22%3A%22regexp%22%2C%22value%22%3A%22%2F%21lead%2Fi%22%7D%2C%7B%22operand%22%3A%22player.flags%22%2C%22operator%22%3A%22lacks%22%2C%22value%22%3A%22b25f4aa0-cec6-11ee-8dfd-c9ee19d0e107%22%7D%5D%7D%2C%22showResult%22%3Afalse%7D%2C%7B%22id%22%3A%22fka1t-rVWR%22%2C%22command%22%3A%22battlebit%3APromoteSquadLeader%22%2C%22gameId%22%3A%22battlebit%22%2C%22options%22%3A%7B%7D%2C%22order%22%3A0%2C%22condition%22%3A%7B%22or%22%3A%5B%7B%22and%22%3A%5B%7B%22operand%22%3A%22player.flags%22%2C%22operator%22%3A%22has%22%2C%22value%22%3A%22b25f4aa0-cec6-11ee-8dfd-c9ee19d0e107%22%7D%2C%7B%22operand%22%3A%22msg.body%22%2C%22operator%22%3A%22regexp%22%2C%22value%22%3A%22%2F%21lead%2Fi%22%7D%5D%7D%5D%7D%2C%22showResult%22%3Afalse%7D%2C%7B%22id%22%3A%22QKV_1rCYKc%22%2C%22command%22%3A%22battlebit%3AKill%22%2C%22gameId%22%3A%22battlebit%22%2C%22options%22%3A%7B%7D%2C%22order%22%3A1%2C%22condition%22%3A%7B%22or%22%3A%5B%7B%22and%22%3A%5B%7B%22operand%22%3A%22player.flags%22%2C%22operator%22%3A%22has%22%2C%22value%22%3A%22b25f4aa0-cec6-11ee-8dfd-c9ee19d0e107%22%7D%2C%7B%22operand%22%3A%22msg.body%22%2C%22operator%22%3A%22regexp%22%2C%22value%22%3A%22%2F%21killme%2Fi%22%7D%5D%7D%5D%7D%2C%22showResult%22%3Afalse%7D%2C%7B%22id%22%3A%22FZA9GNThR6%22%2C%22command%22%3A%22globalChat%22%2C%22gameId%22%3Anull%2C%22options%22%3A%7B%22message%22%3A%22%7B%7Bplayer.name%7D%7D+used+the+%21lead+command+and+became+squad+leader+of+their+squad.%22%2C%22chatCommands%22%3A%7B%22battlebit%22%3A%22battlebit%3ASayToAllChat%22%7D%7D%2C%22order%22%3A2%2C%22condition%22%3A%7B%22and%22%3A%5B%7B%22operand%22%3A%22msg.body%22%2C%22operator%22%3A%22regexp%22%2C%22value%22%3A%22%2F%21lead%2Fi%22%7D%2C%7B%22operand%22%3A%22player.flags%22%2C%22operator%22%3A%22has%22%2C%22value%22%3A%22b25f4aa0-cec6-11ee-8dfd-c9ee19d0e107%22%7D%5D%7D%2C%22showResult%22%3Afalse%7D%5D%2C%22actionIds%22%3A%5B%22gLld3oWzG%22%2C%22fka1t-rVWR%22%2C%22QKV_1rCYKc%22%2C%22FZA9GNThR6%22%5D%7D
12 replies