#development

1 messages · Page 1787 of 1

crystal furnace
#

right ?

#

ah

#

forgot to put async

quartz kindle
#

remove the .then from fetchClientValues

#

better to use await fetchClientValues

#

dont mix await and .then

#

use one or the other

crystal furnace
quartz kindle
#

you already have async in guild

#

you dont need another async block

#
  await guild.members.fetch(guild.ownerID)
  let results = await client.shard.fetchClientValues('guilds.cache.size')
  const create = new Discord.MessageEmbed()
  ...
crystal furnace
#

channel.send is not a function

#

replace with

#

i forget

opal plank
#

i forgot

opal plank
#
let e = await fetch('ulr').then(_ => _.json()).then(console.log)
console.log(e)```
#

so the first one would log first

#

then the second?

quartz kindle
#

second would log undefined

crystal furnace
#

hmm wait for testing

opal plank
#

thats what i meant tho

#

shouldnt the await only finish when the last .then's finish?

quartz kindle
#

yes

opal plank
#

and THEN continue to the console log below

quartz kindle
#

yes

#

but e is undefined

opal plank
#

oh

#

right

crystal furnace
#

lol tim

opal plank
#

cuz i didnt return it

crystal furnace
#

your are best

quartz kindle
#

cause console.log returns undefined

opal plank
#

yeah

crystal furnace
#

to all servers

#

?

opal plank
#

but the first one would log first, then the second, in that succession and regardless of how many thens]

quartz kindle
#

thats what announcement channels are for

crystal furnace
#
let [{ MessageEmbed }, { help, discordserver }] = [require(`discord.js`), require(`../config.json`)]

module.exports.run = async (bot, message, args) => {
  if (message.author.id !== `523877466486472714`) return message.reply(`\`📛\` You don't have permissions to execute that command.`)
  
  try {
    await bot.guilds.cache.forEach(guild => {
     
      let embed = new MessageEmbed()
        .setColor(`0xC3824C`)
        .setThumbnail(message.guild.iconURL({ format: `png`, dynamic: true, size: 2048 }))
        .setAuthor(`Service Announcement`, bot.user.displayAvatarURL({ dynamic: true }))
        .setDescription(args.join(` `))
        .addField(`Need support? Let's join Shiro server yeahh`, `${discordserver}`)
        .setImage(help)
        .setFooter(`Service Announcement sent by ${message.author.tag}`)
        .setTimestamp()


     // guild.channels.cache.filter(c => c.type === `text` && message.guild.me.permissionsIn(channels).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
      guild.channels.cache.filter(c => c.type === `text` & message.guild.me.permissionsIn(c).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
      //  guild.channels.cache.filter(c => c.type === `text` & message.guild.me.permissionsIn(guild.me).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
     // await guild.channels.cache.filter(c => c.type === `text` && message.guild.me.hasPermission([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)

    //await Member.permissionsIn(guild.channels.cache.filter).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
    })

    message.delete({ timeout: 1000 })
    message.channel.send(`Message sent successfully to ${bot.guilds.cache.size} guilds`)


  } 
  catch (e)  {
    console.log(e)
    message.reply(`I cannot send the broadcast.`)
  }
}
#

my sister wrotr this

#

*wrote

quartz kindle
#

if people want to get announcements, tell them to subscribe to your announcement channel

crystal furnace
#

I mean a command that can send a important annoucements to all servers

#

I see a lot of big bot do this

quartz kindle
#

await forEach is incorrect, forEach is not a promise

quartz kindle
#

people hate bots that do this

crystal furnace
#

my bot stopped at 100 / 1404 servers ( ~~)

crystal furnace
#

they use it 3 times / year

opal plank
#

you should REALLY not do that

#

like

#

REALLLY not

#

use announcements

#

unless you wanna piss a bunch of users for unwarranted dms

crystal furnace
slender thistle
crystal furnace
#

a message in a channel

slender thistle
#

Just use announcement channels 😔

crystal furnace
#

in each server

#

not serious like dm all users of the bot

opal plank
slender thistle
#

Literally

crystal furnace
#

hmmm 0.0000001% of my users join my server

#

lol =)))

slender thistle
#

If they care they'll do it

crystal furnace
#

oke

slender thistle
#

If they don't care enough they won't

crystal furnace
#

but i still want to discover

#

how that code write

quartz kindle
#

my bot has a changelog section in its help command

#

when people use the help command they will see the latest update there

#

if you really want to send messages

#

then

crystal furnace
#

after yours suggestion

quartz kindle
#

step 1. you need to get a channel from all guilds, using fetchClientValues or broadcastEval

crystal furnace
#

i should not to do this but i want to discover

#

it's better if someone write the code in send in DM

#

sorry for a big requirement =(((

quartz kindle
#
channels = await client.shard.broadcastEval(`
  client.guilds.cache.map(guild => guild.channels.cache.find(c => c.type === "text" && guild.me.permissionsIn(c).has(["SEND_MESSAGES", "EMBED_LINKS", "VIEW_CHANNEL"])).id;
`)
opal plank
flat copper
#
module.exports = {
	name: 'calc',
	description: 'Calculator ',
	execute: async (client, message, args) => {
const disbut = require('discord-buttons')(client);
let button = new disbut.MessageButton()
  .setStyle('red')
  .setLabel('My First Button!') 
  .setID('click_to_function') 
  .setDisabled();

message.channel.send('Hey, i am powered by https://npmjs.com/discord-buttons', button);
	}
};

Error cannot read property 'MessageButton' of undefined

flat copper
#

?

opal plank
#

that'll run on every command

opal plank
#

,

quartz kindle
#

further up you mean

flat copper
opal plank
#

and its likely a promise(though im not sure)

quartz kindle
#

why would it?

opal plank
#

IPC spawns along with it

#

is there a reason NOT to?

quartz kindle
#

it has workers, not guilds

#

guilds are inside the worker

#

you need ipc to get to them

#

the manager only sees the workers themselves

opal plank
#

oh, right

#

i see what u mean

#

yeah my bad, i see my mistake now

#

it almost sounds like i did wreck twitch with ipc and shit

#

im dum dum

#

should've remembered how IPC works

quartz kindle
#

lel

quartz kindle
#

but i dont know, i dont use it

opal plank
#

me either

#

i use detritusjs, not trash

#

who got the pun?

#

nobody?

#

wew

#

k

#

bye

flat copper
quartz kindle
#

also

slender thistle
#

I to this day don't understand how that package fucking works

#

Or how it's supposed to

crystal furnace
#

@quartz kindle

quartz kindle
crystal furnace
#

i added 2 lines that you wrote

opal plank
crystal furnace
#

what i need to do next ?

opal plank
#

a bloated package wrapper(buttons) around a bloated discord wrapper(djs)

quartz kindle
opal plank
#

it basically emits a new event to client

opal plank
slender thistle
#

lol

crystal furnace
quartz kindle
#

now you'd either need to fetch all channels in the current shard

#

or send the message itself via broadcastEval

#

the second option is more efficient

#

and for that you need to either create the embed inside the broadcastEval, or jsonifiy it

crystal furnace
#

one more condition

#

if meet the server not give any permission

#

should pass =))

quartz kindle
#

plus the code you put there is wrong

#

see the edited one

crystal furnace
#
let [{ MessageEmbed }, { help, discordserver }] = [require(`discord.js`), require(`../config.json`)]

module.exports.run = async (bot, message, args) => {
  if (message.author.id !== `523877466486472714`) return message.reply(`\`📛\` You don't have permissions to execute that command.`)
  channels = await client.shard.broadcastEval(`
  client.guilds.cache.map(guild => guild.channels.cache.filter(c => c.type === "text" && message.guild.me.permissionsIn(c).has(["SEND_MESSAGES", "EMBED_LINKS", "VIEW_CHANNEL"])).first().id;`)
  try {
    await bot.guilds.cache.forEach(guild => {
     
      let embed = new MessageEmbed()
        .setColor(`0xC3824C`)
        .setThumbnail(message.guild.iconURL({ format: `png`, dynamic: true, size: 2048 }))
        .setAuthor(`Service Announcement`, bot.user.displayAvatarURL({ dynamic: true }))
        .setDescription(args.join(` `))
        .addField(`Need support? Let's join Shiro server yeahh`, `${discordserver}`)
        .setImage(help)
        .setFooter(`Service Announcement sent by ${message.author.tag}`)
        .setTimestamp()


     // guild.channels.cache.filter(c => c.type === `text` && message.guild.me.permissionsIn(channels).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
      guild.channels.cache.filter(c => c.type === `text` & message.guild.me.permissionsIn(c).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
     

    //await Member.permissionsIn(guild.channels.cache.filter).has([`SEND_MESSAGES`, `EMBED_LINKS`, `VIEW_CHANNEL`,])).first().send(embed)
    })

    message.delete({ timeout: 1000 })
    message.channel.send(`Message sent successfully to ${bot.guilds.cache.size} guilds`)


  } 
  catch (e)  {
    console.log(e)
    message.reply(`I cannot send the broadcast.`)
  }
}```
#

hmmm

#

i think i put the wrong arguement and line

#

.first().id; you mean .first().send(....)

#

right ?

quartz kindle
#

actually, you could just do something like this ```js
client.shard.broadcastEval( (async () => { for(let guild of client.guilds.cache.values()) { let channel = guild.channels.cache.find(c => c.type === "text" && guild.me.permissionsIn(c).has(["SEND_MESSAGES", "EMBED_LINKS", "VIEW_CHANNEL"])); if(channel) { await channel.send(EMBEDHERE).then(() => new Promise(x => setTimeout(x, 1000))); } } });)

crystal furnace
#

this

quartz kindle
#

delete the forEach

#

and if you're gonna create the embed outside, you need to jsonify it

#
`.send({embed:${embed.toJSON()}})`
crystal furnace
#
let [{ MessageEmbed }, { help, discordserver }] = [require(`discord.js`), require(`../config.json`)]

module.exports.run = async (bot, message, args) => {
  if (message.author.id !== `523877466486472714`) return message.reply(`\`📛\` You don't have permissions to execute that command.`)
  try {
    await bot.guilds.cache(guild => {
     
      let embed = new MessageEmbed()
        .setColor(`0xC3824C`)
        .setThumbnail(message.guild.iconURL({ format: `png`, dynamic: true, size: 2048 }))
        .setAuthor(`Service Announcement`, bot.user.displayAvatarURL({ dynamic: true }))
        .setDescription(args.join(` `))
        .addField(`Need support? Let's join Shiro server yeahh`, `${discordserver}`)
        .setImage(help)
        .setFooter(`Service Announcement sent by ${message.author.tag}`)
        .setTimestamp()


        client.shard.broadcastEval(`
        (async () => {
          for(let guild of client.guilds.cache.values()) {
            let channel = guild.channels.cache.find(c => c.type === "text" && guild.me.permissionsIn(c).has(["SEND_MESSAGES", "EMBED_LINKS", "VIEW_CHANNEL"]));
            if(channel) {
              await channel.send(embed).then(() => new Promise(x => setTimeout(x, 1000)));
            }
          }
        });
      `)

      `.send({embed:${embed.toJSON()}})````
#

await bot.guilds.cache(guild => {

quartz kindle
#

lol...

crystal furnace
#

hmmm

quartz kindle
#

delete the entire forEach block

#

including the entire line

#

and the closing brackets

#

and wtf is that send

#

im showing you how to do it, not doing it for you

#

im not giving you things to copy paste randomly

#

think a little

opal plank
crystal furnace
#
const Discord = require("discord.js");
const config  = require(`../config.json`);
module.exports.run = async (bot, message, args) => {
    
    const m = await message.channel.send("You ask loli girl about her ping ?");

    let msgping1 = new Date();

    let botping = new Date() - message.createdAt;

    let msgping2 = new Date() - msgping1;

    let pingembed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .addField('API Ping : ', Math.floor(bot.ws.ping) + 'ms')
        .addField('Bot Ping : ', `${m.createdTimestamp - message.createdTimestamp}ms`)
        .addField('Message Ping : ', '~' + Math.round(msgping2) + 'ms')
        .addField('Shiro loli girl Ping :','Impossible to count , always in your heart :heart:')
        .setTimestamp(new Date())
        .setFooter(`Requested by ${message.author.tag}`)
        

        
    return message.channel.send(pingembed);
        

};

module.exports.help = {
    name: "pingcheck"
};```
#

@quartz kindle do this code effect if i sharding

#

I think .addField('Bot Ping : ', ${m.createdTimestamp - message.createdTimestamp}ms) should change to ShardPing

#

right ?

opal plank
#

addFields

crystal furnace
#

so i use it

opal plank
#

and rtfm

eternal elbow
#

How long is the lifetime of access tokens? @opal plank

opal plank
eternal elbow
#

ehm my english is not that good i'm sorry

eternal elbow
earnest phoenix
#

stop using replit /hj

reload the font file/reload the page

opal plank
#

it'd be odd if you could infinitely refresh user tokens

#

that'd grant access forever

#

so i assume if you refresh them, it just voids the old one and makes a new

#

but the expiry date is the same

eternal elbow
earnest phoenix
#

reload the IDE, replit sometimes just cannot comprehend itself

eternal elbow
#

I make user sessions unlimited so that they don't have to log in all the time.

opal plank
#

scale? whats that? is it edible?

earnest phoenix
eternal elbow
opal plank
#

you'll be doing 400k requests every hour or two?

eternal elbow
#

oh really true

#

How does mee6 do this?

earnest phoenix
#

sharding

eternal elbow
#

Millions of requests?

earnest phoenix
#

Sharding

eternal elbow
#

yes it makes sense

crystal furnace
eternal elbow
#

I do user sessions with mongodb and cookies

#

The important thing is will discord accept 400k requests? 😅

woeful pike
#

what? why are you sending 400k requests

earnest phoenix
woeful pike
#

thought they were talking about oauth requests

#

oh that comment is unrelated to what they said above ok

polar adder
#

Someone please tell me how to use svg in react. I am confused how to give path and all.. And yes if uh have a good site where i can get good insights of this please share it.. Thank you ❤

crystal furnace
#
client.on(`guildDelete`, async (guild , message) => {
  if (guild.id === `538361750651797504`) {
  return;
  }
  await guild.members.fetch(guild.ownerID)
  let results = await client.shard.fetchClientValues('guilds.cache.size')
  const serverDelete  = new Discord.MessageEmbed()
    .setColor("#d10000")
    .setTitle(`They kick cute loli bot!`)
    .addField(`Current guild now`, `${results.reduce((acc, guildCount) => acc + guildCount, 0)}`, false)
    .addField(`Guild Name`, guild.name, false)
    .addField(`Guild ID`, guild.id, false)
    .addField(`Member Count`, guild.memberCount, true)
    .addField("Humans", `${guild.members.cache.filter(member => !member.user.bot).size} `, true)
    .addField("Bots", `${guild.members.cache.filter(member => member.user.bot).size}`, true)
    .addField(`Owner`, guild.owner.user.tag + `[` + guild.owner.id + `]`, false);
  let channel = await client.channels.fetch(`688393107821428766`)
  //channel.send(`There is a guild that kicked the loli bot (so sad). The bot still alive in ${results.reduce((acc, guildCount) => acc + guildCount, 0)} servers. (This line always appear in case the embed of the server kicked bot can't send)`)
  
  channel.send(`There is a guild that kicked the loli bot (so sad). The bot still alive in ${results.reduce((acc, guildCount) => acc + guildCount, 0)} servers. (This line always appear in case the embed of the server kicked bot can't send)`)
  channel.send(serverDelete)```
#

sometime cause missing access

sudden geyser
#

await guild.members.fetch(guild.ownerID)

#

The guild was "deleted".

#

Yet you're still trying to fetch from that guild.

#

If you want information about the owner, you should consider fetching them as a user instead of a guild member

#

e.g. client.users.fetch(...) and save it to a variable to use it

crystal furnace
#

ok

#

so replace with that ?

earnest phoenix
#

how to make link to Here

#

help us

sudden geyser
#

[here](url goes here)

earnest phoenix
crystal furnace
tulip ledge
#

cant do much without code

digital ibex
#

yo

#

i have ```js
if (document.getElementById('blacklistedWord') !== '1') {
wordsInDiv = document.getElementById('blacklistedWord').value
}

#

like it doesnt run any code under this

quartz kindle
#

user logs in, use access token to get user id, use user id to do things. only the user id is saved

#

not the access token

#

next time the user comes, it remembers them because their id is saved in the browser

crystal furnace
#

why this is error

#

why missing access (50% cases)

quartz kindle
crystal furnace
quartz kindle
#

because the owner is cached in some of them

crystal furnace
#

how to fix this

digital ibex
#

yo tim, u know whats wrong with my code?

quartz kindle
#

either fetch the user instead, or dont fetch

crystal furnace
quartz kindle
digital ibex
#

f

quartz kindle
#

but you cant really compare an element with a string?

digital ibex
#

🤦‍♂️

#

ty

eternal elbow
quartz kindle
crystal furnace
quartz kindle
#

yes

quartz kindle
#

just the servers where mee6 is

crystal furnace
#

hmm

#

i think if my bot is turnondata from discord

#

the problem will solve right ?

quartz kindle
#

?

crystal furnace
#

here

#

discord turn off it =(((

quartz kindle
#

you dont need that to fetch a user

crystal furnace
#

if turn on all it will automatic solve without fix right ?

crystal furnace
eternal elbow
quartz kindle
#

and you're sure the user never needs to login again?

#

not even automatically?

earnest phoenix
#

I get this: TypeError: Cannot read property 'toLowerCase' of undefined
When I use this:

[ const command = args.shift().toLowerCase() 
          
             if(command === "accept"){} ]```
sudden geyser
#

So .shift() returned nothing.

earnest phoenix
#

Yup.

sudden geyser
#

Which means the array was empty

earnest phoenix
#

Nvm fixed, need to be at the top of the file.
No that is not why.

#

how to make status 2 and changing 10 sec

#

i like auto status

#
  client.Ready = true, 
  client.user.setPresence({
    status: "online",  // You can show online, idle, and dnd
    activity: {
        name: "My Prefix Is g?",  // The message shown
        type: "LISTENING", // PLAYING, WATCHING, LISTENING, STREAMING,
    }
});
    client.Manager.init(client.user.id);
    client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
client.RegisterSlashCommands();
};```
#

plz help

quartz kindle
#

make an interval and setPresence again

crystal furnace
#

so other information is not effect ?

crystal furnace
crystal furnace
earnest phoenix
#

you can edit that code

#

and paste here

vivid fulcrum
#

sure, you have to pay first though

crystal furnace
vivid fulcrum
#

you cannot access a guild you aren't in anymore

#

the only data you can use is whatever's left in your cache

abstract coyote
#

Hi there! I'm using Discord.js, and I'm trying to see if a category in a specific guild already exists. I know you can do something like

message.guild.channels.cache.find(channel => channel.name === "channel-name");

that for channels, but how would you go about finding a category?

Thank you in advance!

earnest phoenix
#

plz help me

#

how to make status 2 and changing 10 sec

quartz kindle
#

i already told you what to do

crystal furnace
earnest phoenix
#
  client.Ready = true, 
  client.user.setPresence({
    status: "online",  // You can show online, idle, and dnd
    activity: {
        name: "My Prefix Is g?",  // The message shown
        type: "LISTENING", // PLAYING, WATCHING, LISTENING, STREAMING,
    }
});
    client.Manager.init(client.user.id);
    client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
client.RegisterSlashCommands();
};```
earnest phoenix
#

where

earnest phoenix
#

you. cancopy that code and you edit and paste here plz

quartz kindle
#

no

crystal furnace
quartz kindle
#

i dont understand your question

earnest phoenix
quartz kindle
#

i told you what you need to do

#

now go learn how to do it

#

read the link i sent

abstract coyote
#

^

crystal furnace
quartz kindle
#

discord.js gives you the cached guild data

#

you have access to whatever was in the cache

#

before the guild was deleted

crystal furnace
#
client.on(`guildDelete`, async (guild , message) => {
  if (guild.id === `538361750651797504`) {
  return;
  }
  await guild.members.fetch(guild.ownerID)
  let results = await client.shard.fetchClientValues('guilds.cache.size')
  const serverDelete  = new Discord.MessageEmbed()
    .setColor("#d10000")
    .setTitle(`They kick cute loli bot!`)
    .addField(`Current guild now`, `${results.reduce((acc, guildCount) => acc + guildCount, 0)}`, false)
    .addField(`Guild Name`, guild.name, false)
    .addField(`Guild ID`, guild.id, false)
    .addField(`Member Count`, guild.memberCount, true)
    .addField("Humans", `${guild.members.cache.filter(member => !member.user.bot).size} `, true)
    .addField("Bots", `${guild.members.cache.filter(member => member.user.bot).size}`, true)
    .addField(`Owner`, guild.owner.user.tag + `[` + guild.owner.id + `]`, false);
  let channel = await client.channels.fetch(`688393107821428766`)
  //channel.send(`There is a guild that kicked the loli bot (so sad). The bot still alive in ${results.reduce((acc, guildCount) => acc + guildCount, 0)} servers. (This line always appear in case the embed of the server kicked bot can't send)`)
  
  channel.send(`There is a guild that kicked the loli bot (so sad). The bot still alive in ${results.reduce((acc, guildCount) => acc + guildCount, 0)} servers. (This line always appear in case the embed of the server kicked bot can't send)`)
  channel.send(serverDelete)```
crystal furnace
#

my question

quartz kindle
#

if the owner was cached, it will be there, if not, it wont

crystal furnace
#

and other information

crystal furnace
quartz kindle
#

if they were in the cache, it will be there

abstract coyote
#

If you cached it, it should be there

crystal furnace
#

that is my question

quartz kindle
#

usually yes

crystal furnace
#

ahh so i just need to delete the owner line right @quartz kindle ?

#

and will not worry

#

about other information

near stratus
quartz kindle
#

that doesnt matter, discord handles both cases the same way

near stratus
#

they give the same event

crystal furnace
quartz kindle
#

look

#

whatever the event gives you

#

its there

#

whatever you need to fetch, has a chance of not being there

#

thats all

crystal furnace
#

understand

quartz kindle
#

eitherway, discord.js v13 removed guild.owner

#

to avoid this kind of confusion

near stratus
crystal furnace
near stratus
#

is that removed too ?

near stratus
crystal furnace
#

idk

quartz kindle
#

ownerID is there

#

just owner was removed

near stratus
quartz kindle
#

yes

near stratus
#

my bot won't stop working then
thanks

quartz kindle
#

not because of this no

#

you need to check all the other changes

crystal furnace
#

client.users.fetch(...) this form work ?

quartz kindle
#

yes

crystal furnace
quartz kindle
#

yes

near stratus
abstract coyote
#

How could I use caching to check two values in the same call of the .cache.find expression?

I'm currently stuck at:

member.guild.channels.cache.find(channel => channel.type === "category")

I'd also like to check the name of the channel (so instead of channel.type === "category", I'd use channel.name === "channel-name").. How could I check both of these values in the same expression of .cache.find?

crystal furnace
#
client.on(`guildDelete`, async (guild , message) => {
  if (guild.id === `538361750651797504`) {
  return;
  }
  //await guild.members.fetch(guild.ownerID)
  let results = await client.shard.fetchClientValues('guilds.cache.size')
  const serverDelete  = new Discord.MessageEmbed()
    .setColor("#d10000")
    .setTitle(`They kick cute loli bot!`)
    .addField(`Current guild now`, `${results.reduce((acc, guildCount) => acc + guildCount, 0)}`, false)
    .addField(`Guild Name`, guild.name, false)
    .addField(`Guild ID`, guild.id, false)
    .addField(`Member Count`, guild.memberCount, true)
    .addField("Humans", `${guild.members.cache.filter(member => !member.user.bot).size} `, true)
    .addField("Bots", `${guild.members.cache.filter(member => member.user.bot).size}`, true)
    .addField(`Owner`, guild.owner.user.tag + `[` + guild.owner.id + `]`, false);
  let channel = await client.channels.fetch(`688393107821428766`);
  //channel.send(`There is a guild that kicked the loli bot (so sad). The bot still alive in ${results.reduce((acc, guildCount) => acc + guildCount, 0)} servers. (This line always appear in case the embed of the server kicked bot can't send)`)
  
  //channel.send(`There is a guild that kicked the loli bot (so sad). The bot still alive in ${results.reduce((acc, guildCount) => acc + guildCount, 0)} servers. (This line always appear in case the embed of the server kicked bot can't send)`)
  channel.send(serverDelete)```
#

if i not fetch can my code work ?

crystal furnace
abstract coyote
#

Now it works perfectly, sweet!

earnest phoenix
#

Can we add a text like that

#

I mean it creates any problem?

sage bobcat
#

One message removed from a suspended account.

sage bobcat
earnest phoenix
#

how to make status 2 and changing 10 sec status

#
  client.Ready = true, 
  client.user.setPresence({
    status: "online",  // You can show online, idle, and dnd
    activity: {
        name: "My Prefix Is g?",  // The message shown
        type: "LISTENING", // PLAYING, WATCHING, LISTENING, STREAMING,
    }
});
    client.Manager.init(client.user.id);
    client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
client.RegisterSlashCommands();
};```
#

code

crystal furnace
#

dm me

earnest phoenix
#

ok

crystal furnace
#

i will help you =))

#

at least i am not noob at this

earnest phoenix
#
client.on("ready", () => {
  // By Tyrone#5693
  console.log(Logged in as ${client.user.tag}!); // By Tyrone#5693
    const activites = [
      "help",
      "discord.gg/tyrone",
      `24/7 Online on ${client.guilds.cache.size} Servers!`
    ]
   setInterval(function () {
       let activite = activites[Math.floor(Math.random()activites.length)]
       client.user.setActivity(activite)
   }, 5000);
});
#

@earnest phoenix

opal plank
#

atus modus adus in chatus

solemn latch
#

seems accidental

opal plank
#

it prob is

solemn latch
#

i cant spell angeryBOYE

opal plank
#

forgot to add /s

opal plank
#

nailed it

solemn latch
#

askadential

opal plank
#

axeadentist

solemn latch
#

feels dentist man

#

no wait

opal plank
earnest phoenix
#

bad code

opal plank
#

wtf

earnest phoenix
#

tf

opal plank
#

not only that

#

5 seconds will def get u ratelimited

#

12 seconds is bare minimum, and its not recommended to use it less than a minute of delay

#

also they use anon functions on the first even, but then function on the second?

#

what

#

this totally smells like copied code from somewhere

#

also wtf

opal plank
#
setInterval(async () => {
  await <client>.user.setPresence({
    activity: {
    }
  });
}, 60000)
earnest phoenix
opal plank
#

bad code !== errors

#

and that would work

earnest phoenix
#

So this is not bad

opal plank
#

sure this would run

earnest phoenix
#

Yes

#

lol

opal plank
#

this would not run

earnest phoenix
opal plank
#

and if u cant tell it

#

you should not be coding

earnest phoenix
#

lmao

opal plank
#

fam, thats not how js works

#

this is invalid syntax

earnest phoenix
#

You are free to cry Troodon_Hehe_Boi

opal plank
#

it just dont

#

Bout to google "How to tell someone they are in denial"

earnest phoenix
#

do not spoon feed

earnest phoenix
#
  client.Ready = true, 
  client.user.setPresence({
    status: "online",  // You can show online, idle, and dnd
    activity: {
        name: "My Prefix Is g?",  // The message shown
        type: "LISTENING", // PLAYING, WATCHING, LISTENING, STREAMING,
    }
});
    client.Manager.init(client.user.id);
    client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
client.RegisterSlashCommands();
};```
opal plank
#

you dont PUT it anywhere, you learn from it

#

thats an example

earnest phoenix
opal plank
#

we arent allowed to spoonfeed users here

earnest phoenix
#

just dm

opal plank
#

no thanks

#

thats bad habit

earnest phoenix
opal plank
#

never gonna be a dev if you go around copy pasting code

woeful pike
earnest phoenix
#

@opal plank if i dont use s it will be good code Ç

#

?

#

lmao

opal plank
#

i think i should delete my foornite account after that public shaming

#

i cannot show my face online anymore

earnest phoenix
#

hi baka

#

sussy

#

pika pika

earnest phoenix
#

No error

opal plank
#

@woeful pike shall i make a js/ts playground fro him with his code or should i just let it go?

earnest phoenix
#

Replit?

#

glitch Thonk

opal plank
#

kinda lazy to tell him he's in denial

earnest phoenix
opal plank
lusty quest
#

99% of the time free hosts suck, you pay in some way

earnest phoenix
#

Are you pinging your glitch project?

earnest phoenix
#

I am using uptimer

earnest phoenix
#

uptimer

#

fuck

lusty quest
#

you do, just not directly with money

earnest phoenix
#

And this uptimer hosting with vds

median rain
earnest phoenix
#

So no need to pay money

lusty quest
#

vds?

earnest phoenix
#

he is pinging his glitch project

#

Search for it

median rain
#

just get replit free hosting

#

for 6 months

earnest phoenix
median rain
#

free trial

earnest phoenix
#

if you have vps you can hosting for 30 days

#

in replit

#

just buy a vps

lusty quest
#

lol just get a job and a proper vps

earnest phoenix
#

lool

#

buy vps

#

pr0

median rain
#

lel

earnest phoenix
#

need code nightcore becuz im make bot music

#

if u have dm me

#

h3h3

#

pika

#

dude do not spoon feed developers

lusty quest
#

most free hosts can do these things:
Cancle your service if you use a certain amount of resources
Block you from using certain packages (iirc glitch blocks most ways to make music bots)
Track packages your service sends and recives
Sell your data

opal plank
#

click it

#

its a ts playground

median rain
#

not even $0.01 is in our wallet

opal plank
lusty quest
#

get a job lol, ive earned my first money when i where 12

crystal furnace
lusty quest
#

enough to get a Cheap VPS

median rain
lusty quest
#

no?

earnest phoenix
lusty quest
#

delivering newspaper is legal

earnest phoenix
#

Seems like bad What_have_u_done

median rain
opal plank
#

imagine

earnest phoenix
median rain
#

but who wastes money on vps

opal plank
lusty quest
#

its not wasted lol

earnest phoenix
#

lmao

lusty quest
#

if you grow your bot to a certain point "Free" hosts will just block your project after a few days bcs it uses to much resources

#

its common practise

earnest phoenix
sudden geyser
#

virgin typescript
chad clojure

opal plank
earnest phoenix
opal plank
#

if u cant tell why thats wrong, you're not a dev

median rain
opal plank
median rain
#

because Im in China apparently

lusty quest
#

there are cases of such free hosts selling code

earnest phoenix
median rain
earnest phoenix
lusty quest
earnest phoenix
#

You happy now. ? umm

opal plank
#

so you finally realised u were wrong?

earnest phoenix
#

By Tyrone#5693 copy paste dev moment

lusty quest
#

thats just mean

opal plank
#

literally had to go out of my way to create a TS playground for him to spot what was wrong with the code he sent

lusty quest
#

try pull stack developer

earnest phoenix
earnest phoenix
earnest phoenix
#

Or put here my website not discord name

opal plank
#

i would personally 50000 iq it instead

#

this is some massive brain shit

#

@woeful pike rate my setup ^^

woeful pike
#

6/9

opal plank
#

perfect grade

earnest phoenix
earnest phoenix
#

baka

earnest phoenix
# opal plank

I fell asleep once and when I got up in the morning it was like this KEKW

earnest phoenix
earnest phoenix
opal plank
#

this kid, i swear

#

bet he codes in notepad

vivid fulcrum
#

close enough

solemn latch
#

notepad is amazing

#

much more feature rich than VSC.

#

and the startup time of 0.001ms is pog

opal plank
#

real pros code in MsPaint

earnest phoenix
#

At least not saying i know best and this thing doesnt work

opal plank
#

its basically sharex + vsc together

solemn latch
opal plank
#

imagine not respecting ratelimits

#

prob clogged thousands of requests

solemn latch
#

also, ratelimits are the absolute max rate you can do, there is almost never a good reason to be just below the ratelimit.

opal plank
#

the minimum is 5/60s, their snippet is legit at 5 seconds

solemn latch
#

how often do people look at your bots status for 12+ seconds to see it change?
so having it at 60+ or even 500+ seconds is much more proper.

opal plank
#

which is about 12/60

#

he's basically double over the minimum ratelimit

earnest phoenix
opal plank
#

cuz it is, there wasnt an operator there

#

once again, your own code

#

notice how the IDE tells me its wrong

sudden geyser
#

casually updates activity every 5 seconds

earnest phoenix
#

Then notepad better than your sht application

opal plank
opal plank
sudden geyser
#

this feels like a slapping contest

opal plank
#

even though ur activies has it

vivid fulcrum
#

event listener has an arrow func
setInterval has an actual function passed in

#

love the consistency

opal plank
#

ikr!

vivid fulcrum
#

but dude it obviously isn't!!!! the code is licensed!! 🙄

earnest phoenix
#

LMAO

earnest phoenix
earnest phoenix
vivid fulcrum
#

i said you i am

opal plank
#

Ladies and gentlemen, if you look at the right side, you can see a wild djs copy paste dev in his natural habitat

earnest phoenix
#

lol

vivid fulcrum
#

i think you should chill on those lines of coke a bit

earnest phoenix
#

Smd you pissed me off

slender thistle
#

As much as you're not willing to put some effort into tapping a few more keys to ensure your code actually works, you still have to. Syntax doesn't like slackers 🤷‍♂️

earnest phoenix
#

It works like that and no error

opal plank
#

you're in denial my dude

vivid fulcrum
#

no error

opal plank
#

theres 6 experienced js devs here telling u it doesnt work like that

vivid fulcrum
slender thistle
#

No, it fucking doesn't. Try it in your browser console and tell me that again.

vivid fulcrum
earnest phoenix
slender thistle
#

Does it output shit in your console?

earnest phoenix
#

Yes we saw when i type you all wanted

opal plank
earnest phoenix
slender thistle
earnest phoenix
#

@slender thistle .

slender thistle
#

Do you see red btw

earnest phoenix
#

When i delete s it didnt work

opal plank
slender thistle
#

What did you delete

earnest phoenix
#

There was typing avtivites

slender thistle
earnest phoenix
#

And i did it without s

#

And it didnt work

slender thistle
#

Ok let's break this down since you're one stubborn motherfucker who refuses to write proper code

vivid fulcrum
#

lost cause

#

don't bother

#

let them live in their own bubble lol

opal plank
#

^^

earnest phoenix
#

Its bc of program

slender thistle
#

It very well applies to you

#

No it's not lol

#

Let's see here

#

How is this correct

#

Tell me please what makes you think this is correct

earnest phoenix
#

ITS COPİED FROM DISCORD JS

slender thistle
#

I suggest giving this a thorough read

earnest phoenix
#

I am using discord js not js

slender thistle
#

See the `

#

the fucking BACKTICK CHARACTER?

#

That's what you use for TEMPLATE LITERALS

#

which... oh look, I linked just above

#

🙃

#

open your eyes or zoom in on your screen

#

whichever works for you

earnest phoenix
#

It works for me

slender thistle
#

No it doesn't lol

slender thistle
#

That's red text i see

#

which indicates ERRORS

#

meaning your CODE is NOT correct

opal plank
slender thistle
#

which leads us to thinking

#

it does NOT work

vivid fulcrum
#

the red underline means it's working extra fast!

stable eagle
#

definitely

opal plank
#

its like the old ones said

slender thistle
#

The red underline literally tells you

opal plank
#

red stripes makes thing go faster

slender thistle
#

"you dumbass this is incorrect"

opal plank
#

you dug your own grave there pal

#

the more you mocked, the worst it looks for you now

earnest phoenix
#

Alr it was like that

slender thistle
#

Good fucking job, that's one issue solved

earnest phoenix
#

But when you type discord something in ``

#

something

opal plank
#

then explain why the other ones work

vivid fulcrum
#

so just escape the backtick in your string lol

opal plank
#

and the *

#

in activities

#

whats the excuse for that one

slender thistle
#

You missed an operator there buddy

#

Can you tell me which operator you missed there

lusty quest
#

ahh yes the cycle repeats

stable eagle
#

hint: the operator is white

#

Lol

slender thistle
#

If you're not gonna be helping please kindly go away

#

ty

opal plank
sage bobcat
#

One message removed from a suspended account.

queen hemlock
opal plank
#

what

slender thistle
#

P.S. no

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

And it did not work

slender thistle
#

Show what you did

earnest phoenix
#

Maybe it shows red because for different thing

slender thistle
#

I have an assumption that you did something incorrectly

earnest phoenix
#

Or nwm use desktop mode

slender thistle
#

Can't you just rotate your screen

earnest phoenix
#

@slender thistle

#

And erwin said me activites .length is wrong

opal plank
slender thistle
#

This time it should be correct

opal plank
#

where did i say that?

earnest phoenix
#

So i did it activite.length

slender thistle
#

Do activities.length because that's your array

opal plank
#

the ide shows the POSITION of the error

earnest phoenix
#

Oh

slender thistle
#

activites isn't the same as activities

earnest phoenix
#

I understand it now

slender thistle
#

plus you didn't have an operator there

slender thistle
#

See? You get shit done when you stop being stubborn. 😄

opal plank
solemn latch
#

lol

slender thistle
#

Just because you think your code works doesn't mean it does. Be sceptic as a developer.

opal plank
earnest phoenix
opal plank
#

and "it doesnt error" isnt an excuse for having bad code

#

specially for ur ratelimits

#

if it wasnt for the library, you'd be ratelimited

#

and the library probably has ALL those requests backed up

#

so you are basically backlogging your requests

#

for every 5 requests you send, 1 is being sent

earnest phoenix
slender thistle
#

Well Erwin

#

your time to shine

opal plank
slender thistle
#

I'm not aware of JS' scopes KEKW

opal plank
#

its not about scope

#

he literally misspelled activities

earnest phoenix
#

@slender thistle this is bc i I defined it activites

#

Const activites

slender thistle
#

eeeeeeeeeeeee

opal plank
#

he named the ORIGINAL one wrong

earnest phoenix
#

Its about my english

opal plank
#

and now he's using the wrong one everywhere

#

as long as the name is the same, it oesnt matter

#

you can call it AcTivITiTIeS if u want

#

just gotta make sure to use that everywhere

#

the name you assign a variable doesnt matter

slender thistle
#

activitinitus eghm

solemn latch
#

👀

earnest phoenix
opal plank
#

remove the function

#

make it an arrow function

slender thistle
#

use activities instead of activites

earnest phoenix
slender thistle
#

Neither of those words make sense to me anymore

solemn latch
#

im not even sure how to spell activities anymore.

slender thistle
#

Spellcheck is the only thing that's keeping me from mistyping it

earnest phoenix
sage bobcat
opal plank
solemn latch
scenic cape
#

How can I send a private message? Only he can see. Discordpy

#

Not dm

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
#

shiv, ur time to shine

sage bobcat
#

One message removed from a suspended account.

opal plank
#

he either means ephemeral message

#

or dms

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

slender thistle
#

Oh boy ephemeral messages

sage bobcat
slender thistle
#

Is that possible without interactions?

sudden geyser
#

Ah

opal plank
#

not sure u can

#

let me ask the nerds

#

brb

earnest phoenix
#

@opal plank its ok right now?

opal plank
#

copy that code here

slender thistle
#

setInterval(YOUR_ARROW_FUNCTION_HERE)

#

ARROW_FUNCTION:
() => { FUNCTION BODY, DO SHIT HERE; }

quartz kindle
#

also, that server count will never update

opal plank
#

or u can mindfuck and confuse the heck out of em with

_ => ```
opal plank
#

didnt think bout that

earnest phoenix
slender thistle
#

It won't update later in life because it's only set at bot start

earnest phoenix
#

Lemme add it on another server

opal plank
#

and once again he curls in the bubble

earnest phoenix
#

And check again

slender thistle
#
  1. Create string with client.guilds.cache.size servers;
  2. Create a loop;
  3. Re-use the string from step 1
#

If you were to RE-CREATE the string later before setting the activity, that'd be one thing

#

However, you are NOT doing that

earnest phoenix
slender thistle
#

Now fucking remove it from like 5 servers and tell me it works

earnest phoenix
#

Why i do it ?

slender thistle
#

Because you're not listening

lusty quest
#

be aware that its cached and d.js is a bit funky with it. -> possible that it wont update properly

earnest phoenix
#

I could not understand what you all saying

#

But this guy said it wont never update server count

#

And it updated

#

Is there any other problem?

slender thistle
#

It won't UPDATE it

earnest phoenix
#

How tf it update then?

slender thistle
#

it will SET it the first time the array is created

lusty quest
#

it will only update if the process restarts

slender thistle
#

it will not UPDATE

scenic cape
slender thistle
#

wrap it in the function itself probably

earnest phoenix
#

Okay it wont update

#

Then how i would add server count activite ?

slender thistle
#

Some people were never told "no" in their lives, I swear to fucking God

earnest phoenix
#

Okay ill just listen you

slender thistle
#

You can create the array in your function

earnest phoenix
#

I will not oppose

lusty quest
#

there is a way to update it, but it requires some brain power

slender thistle
#

which we lack in this case

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

Wait I heard Brain Power 👀

#

Faith

#

being too nice does more harm than good

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

I'd rather let people get used to being judged for shit code they write, which they then think is the proper way

sage bobcat
#

One message removed from a suspended account.

opal plank
#

full pressure

slender thistle
#

have you not seen like 3 guys telling the dude what to do to fix his shit

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

All it took was me to drop the sugarcoating and give shit to him as-is

earnest phoenix
#

The error wasnt about my code

#

Error was about my english

slender thistle
#

The code errors were about your code

opal plank
slender thistle
#

Code doesn't judge your English

#

Unless you have spellcheck

opal plank
#

^^

slender thistle
#

in which case it's still not code judging your English

earnest phoenix
#

Yes but they said code is wrong

lusty quest
slender thistle
#

which it was

earnest phoenix
#

But my spell was wrong

slender thistle
#

so stop arguing about that and move on

opal plank
#

you can call it AcTivITiTIeS if u want
just gotta make sure to use that everywhere

opal plank
earnest phoenix
#

Its aktivite on my language

#

So i typed it activites

slender thistle
#

Python's calendar module literally has an HTMLCalendar class, which allows me to retrieve days in a month in HTML. Quite nice

tired panther
#

Whats the best framework for caching mongodb documents?

lusty quest
#

idk how the american standarts are but here you can get at max 400 L / min out of them, we also have a standart that supports up to 10000 L/ Min

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lusty quest
earnest phoenix
#

o

solemn latch
slender thistle
#

I'd rather be called baka than have stubborn people here try and prove me wrong when their shit isn't correct

tired panther
lusty quest
#

there is a small package for it, sure its last updated 3 years ago or so, but works fine

earnest phoenix
#

what you doing

#

guys

lusty quest
slender thistle
#

Woohoo time to write JS manually

lusty quest
#

you could probably get some framework, but im not sure if they will help you this much

tired panther
tired panther
lusty quest
#

just make sure to either write throu or backwrite

slender thistle
#

There's the JS that's already done for you

#

aka my framework

#

and then there's my custom JS

tired panther
#

oh

slender thistle
#

which I will write myself

#

Not sure which word would fit more, so ig custom JS it is

tired panther
lusty quest
#

how?

#

i havent had it corrupted once

opal plank
#

never had keydb nor redis ever corrupt on me

#

even on sudden system shutdowns

lusty quest
#

i used redis as cache for mongodb, and it just worked, chances are higher that you corrupt MongoDB than redis

tired panther
#

...

lusty quest
#

there are free aviable redis nodes?

#

for just caching they are fine

#

just dont push critical data there

#

if you want it local, use maps, you just have to manage the write throu to the cache and database yourself

tired panther
lusty quest
#

you have to handle the caching yourself

#

like i said there is a npm package for it

marble juniper
#

@slim heart I can not get these eslint rules you linked me to to work

#

at all

slim heart
#

i think its best we go for an unofficial approach

#

and then you dont have to worry about lint rules

tribal siren
#
.on('guildMemberAdd', async member => {
        if(member.user.bot) return;

        const roles = db.get(`roles_${member.id}`);
        if(roles){
            roles.forEach(r => member.roles.add(r));
            db.delete(`roles_${member.id}`);
        }

        const welcomer = new canvacord.Welcomer()
            .setUsername(member.user.username)
            .setDiscriminator(member.user.discriminator)
            .setMemberCount(member.guild.memberCount)
            .setGuildName(member.guild)
            .setAvatar(member.user.displayAvatarURL({ format: 'jpg', dynamic: false }))
            .setColor('message-box', '#2ecc71')
            .setColor('title', '#2ecc71')
            .setColor('avatar', '#2ecc71')
            .setBackground('https://mk0assentisne1rsvd1v.kinstacdn.com/wp-content/uploads/2020/05/Welcome_Background.jpg');
        welcomer.build().then(data => {
            const attachment = new Discord.MessageAttachment(data, 'welcome.jpg');
            bot.channels.cache.get('775388460248858665').send(`Welcome to **BraceDash**, ${member}!\nДобро пожаловать в **BraceDash**, ${member}!`, attachment);
        });

        if(member.guild.members.cache.get(member.user.id).roles.cache.map(r => r.id).join("") !== member.guild.roles.everyone.id){
            console.log(`${member.user.tag} joined ${member.guild.name}!`)
        }
        else{
            member.send(`**English:**\nHello, **${member.user.tag}**! Welcome to BraceDash. For the next 1 minute you will not be able to speak, so read the [#775388462488354816](/guild/264445053596991498/channel/775388462488354816/) to understand what you can do in the server and what you can't. Happy talking!\n\n**Русский:**\nПривет, **${member.user.tag}**! Добро пожаловать в BraceDash. Следующую минуту ты не сможешь разговаривать, поэтому почитай [#775388462488354816](/guild/264445053596991498/channel/775388462488354816/) чтобы понимать что можно делать на сервере а что нельзя. Приятного общения!`)
            setTimeout(() => {
                member.roles.add('775581337976963133');
                member.send('You can now proceed to verification!\nТеперь вы можете приступить к верификации!\n#gateway')
            }, 60000)
        }
    })```
#

i want this to check if a user had roles before (when he left) and add the roles

tribal siren
tribal siren
#

the problem is

#

it adds all the roles, sends a message and adds unverified

#

how do i fix this?

near stratus
#

wait
are you getting the correct roles ?

tribal siren
#

yes

#

so what it does is

#

when a user leaves it saves the array of that user's roles

#

and when he comes back adds the roles

#

but i want it to check so if a user doesn't have the roles it sends a message then in a minute adds unverified

near stratus
#

so the problem is it gives All roles not the ones he had ?

#

?

ebon girder
#

Good afternoon, I was wondering if the bot The isle manager, have the Sandbox and Slot inside of it to be used. And if there is any kind of tutorial explaining how to use it, cause we had invited to our sever and tried to use it and nothing happened. Sorry if i didn't saw nothing about explaining how to use. @tribal siren

tribal siren
#

why me ping

tribal siren
#

it's like

#

i want it to look up the db

#

if there are roles for that user in the db, add them and that's it.

#

if there are no roles in the db, dm a message then in a minute add another role

#

the problem is, it does both things

#

for some reason

opaque seal
#

Tf is that member.guild.members.cache.get(member.user.id)

#

why are you getting the member from the guild if you already have the member

#

Here you take all the roles of the member, join them and check if they equal the @everyone role

if(member.guild.members.cache.get(member.user.id).roles.cache.map(r => r.id).join("") !== member.guild.roles.everyone.id)
sudden geyser
#

it looks cooler

opaque seal
#

It looks dumber

sudden geyser
#

cooler

opaque seal
tribal siren
#

but i don't remember

#

thanks, i will inform if there will be a problem

opaque seal
#

Also, roles.add() supports arrays in discord.js

#

so no need to do a forEach to assign the roles

tribal siren
#

oh it does?

#

bruh

#

thanks

opaque seal
tribal siren
#

yes, there is still the same problem

opaque seal
#

Send the code again

tribal siren
#
.on('guildMemberAdd', async member => {
        if(member.user.bot) return;

        const roles = db.get(`roles_${member.id}`);
        if(roles){
            member.roles.add(roles);
            db.delete(`roles_${member.id}`);
        }

        const welcomer = new canvacord.Welcomer()
            .setUsername(member.user.username)
            .setDiscriminator(member.user.discriminator)
            .setMemberCount(member.guild.memberCount)
            .setGuildName(member.guild)
            .setAvatar(member.user.displayAvatarURL({ format: 'jpg', dynamic: false }))
            .setColor('message-box', '#2ecc71')
            .setColor('title', '#2ecc71')
            .setColor('avatar', '#2ecc71')
            .setBackground('https://mk0assentisne1rsvd1v.kinstacdn.com/wp-content/uploads/2020/05/Welcome_Background.jpg');
        welcomer.build().then(data => {
            const attachment = new Discord.MessageAttachment(data, 'welcome.jpg');
            bot.channels.cache.get('775388460248858665').send(`Welcome to **BraceDash**, ${member}!\nДобро пожаловать в **BraceDash**, ${member}!`, attachment);
        });

        if(member.roles.cache.map(r => r.id).join("") !== member.guild.roles.everyone.id){
            console.log(`${member.user.tag} joined ${member.guild.name}!`)
        }
        else{
            member.send(`**English:**\nHello, **${member.user.tag}**! Welcome to BraceDash. For the next 1 minute you will not be able to speak, so read the [#775388462488354816](/guild/264445053596991498/channel/775388462488354816/) to understand what you can do in the server and what you can't. Happy talking!\n\n**Русский:**\nПривет, **${member.user.tag}**! Добро пожаловать в BraceDash. Следующую минуту ты не сможешь разговаривать, поэтому почитай [#775388462488354816](/guild/264445053596991498/channel/775388462488354816/) чтобы понимать что можно делать на сервере а что нельзя. Приятного общения!`)
            setTimeout(() => {
                member.roles.add('775581337976963133');
                member.send('You can now proceed to verification!\nТеперь вы можете приступить к верификации!\n[#776338979883581470](/guild/264445053596991498/channel/776338979883581470/)')
            }, 60000)
        }
    })```
#

it added the roles i had before but then dmed me and added unverified

#

i want it to add my roles only, and only dm and add unverified if i didn't have my roles in the db

opaque seal
#

You need to await this first of all member.roles.add(roles);

#

Also, member.guild.roles.everyone.id this doesn't exist: roles..everyone is not a thing

tribal siren
opaque seal
#

The @everyone role ID is always the same as the guild ID, so just replace it with member.guild.id

#

They added that recently then (not needed)

opaque seal
opaque seal
pale vessel
#

I don't think so, for discord.js

tribal siren
pale vessel
#

It might

tribal siren
opaque seal
#

Then @tribal siren you can simply do if(member.roles.cache.size === 0)

tribal siren
#

it's supposed to work

opaque seal
#

Try to eval member.roles.cache and check if everyone is in there

pale vessel
#

I just checked my old source, it does include everyone role

opaque seal
#

Okay then nevermind

#

An```js
if(member.roles.cache.some(r => r.id !== member.guild.id)) {}

looks better in my opinion
#

Anyway just by adding the await when you add the roles it should work

tribal siren
#

hm alright thanks

proven lantern
#

when i load my homepage the css is messed up, but when i navigate to another page and come back it is fixed

#

why do computers do such tricky things