SuperPEKKA336
SuperPEKKA336
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
yeah . . . . i realized
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
i know Java and C++
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
i never learned js too well
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
honestly
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
but someone told me not to and to remove it
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
i mapped here
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
cache doesnt give an array
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
but how would i get an array of roles?
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
trying to make the select menu remove all roles that the menu offers from the user, then add the roles they selected
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
ok
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
this didnt work either
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
else if(interaction.isStringSelectMenu()) // String Select Menu Interactions
{
try
{
const value = interaction.values;
const COUNTERSTRIKE = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_COUNTERSTRIKE);
const FORTNITE = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_FORTNITE);
const LEAGUEOFLEGENDS = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_LEAGUEOFLEGENDS);
const MINECRAFT = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_MINECRAFT);
const OVERWATCH = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_OVERWATCH);
const RAINBOWSIX = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_RAINBOWSIX);
const ROBLOX = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_ROBLOX);
const ROCKETLEAGUE = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_ROCKETLEAGUE);
const VALORANT = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_VALORANT);

let roles = interaction.member.roles.cache
.filter(COUNTERSTRIKE => COUNTERSTRIKE.id)
.filter(FORTNITE => FORTNITE.id)
.filter(LEAGUEOFLEGENDS => LEAGUEOFLEGENDS.id)
.filter(MINECRAFT => MINECRAFT.id)
.filter(OVERWATCH => OVERWATCH.id)
.filter(RAINBOWSIX => RAINBOWSIX.id)
.filter(ROBLOX => ROBLOX.id)
.filter(ROCKETLEAGUE => ROCKETLEAGUE.id)
.filter(VALORANT => VALORANT.id)

let isCounterstrike = false;
let isFortnite = false;
let isLeagueoflegends = false;
let isMinecraft = false;
let isOverwatch = false;
let isRainbowsix = false;
let isRoblox = false;
let isRocketleague = false;
let isValorant = false;

for(let i = 0; i < value.length; i++)
{
if(value[i] == 'games_counterstrike')
isCounterstrike = true;
else if(value[i] == 'games_fortnite')
isFortnite = true;
else if(value[i] == 'games_leagueoflegends')
isLeagueoflegends = true;
else if(value[i] == 'games_minecraft')
isMinecraft = true;
else if(value[i] == 'games_overwatch')
isOverwatch = true;
else if(value[i] == 'games_rainbowsix')
isRainbowsix = true;
else if(value[i] == 'games_roblox')
isRoblox = true;
else if(value[i] == 'games_rocketleague')
isRocketleague = true;
else if(value[i] == 'games_valorant')
isValorant = true;
}

if(!isCounterstrike)
roles.delete(ROLE_IDS.GAMES_COUNTERSTRIKE);
if(!isFortnite)
roles.delete(ROLE_IDS.GAMES_FORTNITE);
if(!isLeagueoflegends)
roles.delete(ROLE_IDS.GAMES_LEAGUEOFLEGENDS);
if(!isMinecraft)
roles.delete(ROLE_IDS.GAMES_MINECRAFT);
if(!isOverwatch)
roles.delete(ROLE_IDS.GAMES_OVERWATCH);
if(!isRainbowsix)
roles.delete(ROLE_IDS.GAMES_RAINBOWSIX);
if(!isRoblox)
roles.delete(ROLE_IDS.GAMES_ROBLOX);
if(!isRocketleague)
roles.delete(ROLE_IDS.GAMES_ROCKETLEAGUE);
if(!isValorant)
roles.delete(ROLE_IDS.GAMES_VALORANT);

return interaction.member.roles.set(roles)
.then((member) =>
interaction.reply(
{
embeds: [EMBEDS.ROLE_CHANGED],
ephemeral: true,
}))
}catch(err)
{
return interaction.reply(
{
embeds: [EMBEDS.ERROR],
ephemeral: true,
});
}
}
else if(interaction.isStringSelectMenu()) // String Select Menu Interactions
{
try
{
const value = interaction.values;
const COUNTERSTRIKE = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_COUNTERSTRIKE);
const FORTNITE = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_FORTNITE);
const LEAGUEOFLEGENDS = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_LEAGUEOFLEGENDS);
const MINECRAFT = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_MINECRAFT);
const OVERWATCH = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_OVERWATCH);
const RAINBOWSIX = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_RAINBOWSIX);
const ROBLOX = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_ROBLOX);
const ROCKETLEAGUE = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_ROCKETLEAGUE);
const VALORANT = interaction.guild.roles.cache.get(ROLE_IDS.GAMES_VALORANT);

let roles = interaction.member.roles.cache
.filter(COUNTERSTRIKE => COUNTERSTRIKE.id)
.filter(FORTNITE => FORTNITE.id)
.filter(LEAGUEOFLEGENDS => LEAGUEOFLEGENDS.id)
.filter(MINECRAFT => MINECRAFT.id)
.filter(OVERWATCH => OVERWATCH.id)
.filter(RAINBOWSIX => RAINBOWSIX.id)
.filter(ROBLOX => ROBLOX.id)
.filter(ROCKETLEAGUE => ROCKETLEAGUE.id)
.filter(VALORANT => VALORANT.id)

let isCounterstrike = false;
let isFortnite = false;
let isLeagueoflegends = false;
let isMinecraft = false;
let isOverwatch = false;
let isRainbowsix = false;
let isRoblox = false;
let isRocketleague = false;
let isValorant = false;

for(let i = 0; i < value.length; i++)
{
if(value[i] == 'games_counterstrike')
isCounterstrike = true;
else if(value[i] == 'games_fortnite')
isFortnite = true;
else if(value[i] == 'games_leagueoflegends')
isLeagueoflegends = true;
else if(value[i] == 'games_minecraft')
isMinecraft = true;
else if(value[i] == 'games_overwatch')
isOverwatch = true;
else if(value[i] == 'games_rainbowsix')
isRainbowsix = true;
else if(value[i] == 'games_roblox')
isRoblox = true;
else if(value[i] == 'games_rocketleague')
isRocketleague = true;
else if(value[i] == 'games_valorant')
isValorant = true;
}

if(!isCounterstrike)
roles.delete(ROLE_IDS.GAMES_COUNTERSTRIKE);
if(!isFortnite)
roles.delete(ROLE_IDS.GAMES_FORTNITE);
if(!isLeagueoflegends)
roles.delete(ROLE_IDS.GAMES_LEAGUEOFLEGENDS);
if(!isMinecraft)
roles.delete(ROLE_IDS.GAMES_MINECRAFT);
if(!isOverwatch)
roles.delete(ROLE_IDS.GAMES_OVERWATCH);
if(!isRainbowsix)
roles.delete(ROLE_IDS.GAMES_RAINBOWSIX);
if(!isRoblox)
roles.delete(ROLE_IDS.GAMES_ROBLOX);
if(!isRocketleague)
roles.delete(ROLE_IDS.GAMES_ROCKETLEAGUE);
if(!isValorant)
roles.delete(ROLE_IDS.GAMES_VALORANT);

return interaction.member.roles.set(roles)
.then((member) =>
interaction.reply(
{
embeds: [EMBEDS.ROLE_CHANGED],
ephemeral: true,
}))
}catch(err)
{
return interaction.reply(
{
embeds: [EMBEDS.ERROR],
ephemeral: true,
});
}
}
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
k
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
though no roles are actually changed
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/30/2023 in #djs-questions
Roles not being changed
currently it just shows my "ROLE_CHANGED" embed
29 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/29/2023 in #djs-questions
roles not being added
ok thanks
79 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/29/2023 in #djs-questions
roles not being added
cache.map
79 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/29/2023 in #djs-questions
roles not being added
roles is the cache
79 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/29/2023 in #djs-questions
roles not being added
so roles.(game => game.id);
79 replies
DIAdiscord.js - Imagine an app
Created by SuperPEKKA336 on 11/29/2023 in #djs-questions
roles not being added
whats r
79 replies