#development
1 messages · Page 1787 of 1
remove the .then from fetchClientValues
better to use await fetchClientValues
dont mix await and .then
use one or the other
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()
...
would technically awai then only finish when all then's are done or run after the first promise returned?

i forgot
all thens
let e = await fetch('ulr').then(_ => _.json()).then(console.log)
console.log(e)```
so the first one would log first
then the second?

second would log undefined
hmm wait for testing
yes
and THEN continue to the console log below
lol tim
cuz i didnt return it
your are best
cause console.log returns undefined
yeah
do you know a command how to send announcement
to all servers
?
but the first one would log first, then the second, in that succession and regardless of how many thens]
dont
thats what announcement channels are for
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
if people want to get announcements, tell them to subscribe to your announcement channel
I mean a command that can send a important annoucements to all servers
I see a lot of big bot do this
await forEach is incorrect, forEach is not a promise
i dont remember any big bot doing this
people hate bots that do this
hmm so what should i replace
my bot stopped at 100 / 1404 servers ( ~~)
zero two =))) i think
they use it 3 times / year
you should REALLY not do that
like
REALLLY not
use announcements
unless you wanna piss a bunch of users for unwarranted dms
not a dms
"I want to do it so I will make up an excuse that big bots do it when in fact they don't so that it sounds more acceptable"
a message in a channel
Just use announcement channels 😔
this
Literally
If they care they'll do it
oke
If they don't care enough they won't
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
nah i change my idea
after yours suggestion
step 1. you need to get a channel from all guilds, using fetchClientValues or broadcastEval
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 =(((
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;
`)
speaking of eval, tim, answer my previous question
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
dont
?
that'll run on every command
this? yes
further up you mean
Why its not working?
well, first cuz you're patching ur client everytime that commands runs
and its likely a promise(though im not sure)
why would it?
why would it not have a reference for the workers it creates?
IPC spawns along with it
is there a reason NOT to?
it has workers, not guilds
guilds are inside the worker
you need ipc to get to them
the manager only sees the workers themselves
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
lel
pretty sure thats not how discord-buttons is supposed to work
but i dont know, i dont use it
Well I get that from docs
I to this day don't understand how that package fucking works
Or how it's supposed to
i added 2 lines that you wrote
its a retarded wrapper around a wrapper that modifies the client
what i need to do next ?
a bloated package wrapper(buttons) around a bloated discord wrapper(djs)
delete everything else
it basically emits a new event to client

lol
oke
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
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 ?
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))); } } });)
delete the forEach
and if you're gonna create the embed outside, you need to jsonify it
`.send({embed:${embed.toJSON()}})`
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 => {
lol...
hmmm
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
how dare you not spoonfeed me! do u think i pay you to be this much of a rebel?
oke
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 ?
How long is the lifetime of access tokens? @opal plank
no clue, but it has a thing there to tell you how many seconds till it expires
so i think it is fine
ehm my english is not that good i'm sorry
Oh well, wouldn't it be redundant if I renewed it in bringing it to the site?
stop using replit /hj
reload the font file/reload the page
idk if u can do that bth
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
I even did 😅
reload the IDE, replit sometimes just cannot comprehend itself
I make user sessions unlimited so that they don't have to log in all the time.
scale? whats that? is it edible?
correct term, dw
dunno why red replied like that
i don't understand what you mean
imagine if u have 400k users
you'll be doing 400k requests every hour or two?
sharding
Millions of requests?
Sharding
yes it makes sense
hey if i sharding my bot this code right ? please some one check it for me
I do user sessions with mongodb and cookies
The important thing is will discord accept 400k requests? 😅
what? why are you sending 400k requests
because big bot
thought they were talking about oauth requests
oh that comment is unrelated to what they said above ok
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 ❤
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
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
[here](url goes here)
ty lite
(node:19324) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of null
cant do much without code
yo
i have ```js
if (document.getElementById('blacklistedWord') !== '1') {
wordsInDiv = document.getElementById('blacklistedWord').value
}
like it doesnt run any code under this
nobody does that
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
still not understand
why this is error
why missing access (50% cases)
you cant do guild.members.fetch(guild.ownerID) if the guild is deleted
yep but why it is 50% success
because the owner is cached in some of them
yo tim, u know whats wrong with my code?
either fetch the user instead, or dont fetch
so you mean delete that line is better ?
no idea
f
but you cant really compare an element with a string?
How do I refresh the servers?
whatever you prefer
but can I try to fetch a user ?
yes
pretty sure they dont check all your servers
just the servers where mee6 is
if my bot is turnoffdata
hmm
i think if my bot is turnondata from discord
the problem will solve right ?
?
you dont need that to fetch a user
if turn on all it will automatic solve without fix right ?
hmmm
If there is a server without mee6 it shows as "install mee6"
I get this: TypeError: Cannot read property 'toLowerCase' of undefined
When I use this:
[ const command = args.shift().toLowerCase()
if(command === "accept"){} ]```
So .shift() returned nothing.
Yup.
Which means the array was empty
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
make an interval and setPresence again
if a owner is not fecthed
so other information is not effect ?
like only owner info is not worked but with the other ?
=))) please anwser
give code
you can edit that code
and paste here
sure, you have to pay first though
=)))) please anwser
you cannot access a guild you aren't in anymore
the only data you can use is whatever's left in your cache
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!
i already told you what to do
so not only the guild owner information or all ?
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();
};```
you. cancopy that code and you edit and paste here plz
no
you here =))) can you anwser my question
here =)))
i dont understand your question
then didint know
im not gonna do it for you
i told you what you need to do
now go learn how to do it
read the link i sent
^
Like if the guild is deleted , only Owner information can not display or all the information of the server
discord.js gives you the cached guild data
you have access to whatever was in the cache
before the guild was deleted
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 the owner was cached, it will be there, if not, it wont
and other information
and others information like guild name ? guild id ?
if they were in the cache, it will be there
If you cached it, it should be there
yeah but discord always catched for the bot that basic information right
that is my question
usually yes
ahh so i just need to delete the owner line right @quartz kindle ?
and will not worry
about other information
sometimes the guild us deleted
sometimes the bot is kicked (I guess)
that doesnt matter, discord handles both cases the same way
they give the same event
hmmm so with information is catched 100% by discord
look
whatever the event gives you
its there
whatever you need to fetch, has a chance of not being there
thats all
oke
understand
...
ownerID ?
when v13 release
is that removed too ?
in a month
so i can still do Client.users.fetch() and Client.users.get() if the user in in another common server
yes
my bot won't stop working then
thanks
client.users.fetch(...) this form work ?
yes
with my problem too ? the owner problem
yes
that's what I've been using since last year
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?
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 ?
&&
btw do not important anymore =))
DAMN I'm dumb! Thank you so much xddd
Now it works perfectly, sweet!
One message removed from a suspended account.
One message removed from a suspended account.
So its better dont type
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
ok
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
atus modus adus in chatus
seems accidental
it prob is
i cant spell 
forgot to add /s
askadential
axeadentist

bad, dont
first, 5 seconds?
bad code
wtf
tf
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

so, as i was mentioning, his intent was right to use an interval, but dont do that
setInterval(async () => {
await <client>.user.setPresence({
activity: {
}
});
}, 60000)
I didnt get any error
this would not run
You are free to cry 
literally this
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();
};```
put where
lmao
we arent allowed to spoonfeed users here
just dm

never gonna be a dev if you go around copy pasting code
broo u got destroyed his bot is online 😂 😂 get rekt bro you don't know anything about js
i know right
i think i should delete my foornite account after that public shaming
i cannot show my face online anymore
f teamrole
hi baka
sussy
pika pika
@woeful pike shall i make a js/ts playground fro him with his code or should i just let it go?

kinda lazy to tell him he's in denial

99% of the time free hosts suck, you pay in some way
Are you pinging your glitch project?
No
I am using uptimer
you do, just not directly with money
And this uptimer hosting with vds
i think glitch doesnt allow 3rd party stuff anymore?
So no need to pay money
vds?
yes
he is pinging his glitch project
Search for it
yes
free trial
lol just get a job and a proper vps
need code nightcore becuz im make bot music
if u have dm me
h3h3
pika
dude do not spoon feed developers
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
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
Tf is this?

what if we cant afford a vps
not even $0.01 is in our wallet
literally the contents of ur supposed "working code"
get a job lol, ive earned my first money when i where 12
what is replit free limit
enough to get a Cheap VPS
tahts illegal where u live/
no?
No
delivering newspaper is legal
Seems like bad 
makes more sense 
imagine
lol
but who wastes money on vps
he literally calling https://www.typescriptlang.org/ a sus domain
TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes before you even run your code.

its not wasted lol
lmao
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
And my code is working stop to crying
virgin typescript
chad clojure
the more you call it crying, the worse it looks to you as dev, cuz you're clearly on the wrong, yet you keep on pushing it
copy paste code moment
if u cant tell why thats wrong, you're not a dev
what if I cannot get a job
this
well, rip, and hope you wont regret it
there are cases of such free hosts selling code

Pro Tip: (this is how I got free hosting)
|| Beg your friend that has vps ||
also works, until your bot grows to large for the VPS
You happy now. ? 
By Tyrone#5693 copy paste dev moment
thats just mean
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
try pull stack developer
Bc this project in glitch dmbass I don't want others to take my codes
Yes thank you for helped me
And if i really care it i change it as my new nickname
Or put here my website not discord name
i would personally 50000 iq it instead
this is some massive brain shit
@woeful pike rate my setup ^^
6/9
perfect grade
f
I fell asleep once and when I got up in the morning it was like this 
nobody will ever know its there

lol
close enough
notepad is amazing
much more feature rich than VSC.
and the startup time of 0.001ms is pog
real pros code in MsPaint
its basically sharex + vsc together
LOL
imagine not respecting ratelimits

prob clogged thousands of requests
also, ratelimits are the absolute max rate you can do, there is almost never a good reason to be just below the ratelimit.
the minimum is 5/60s, their snippet is legit at 5 seconds
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.
You said atcivites is wrong
cuz it is, there wasnt an operator there
once again, your own code
notice how the IDE tells me its wrong

casually updates activity every 5 seconds
Then notepad better than your sht application
ratelimits go brr
im not even pointing the fact that you didnt include quotation marks in your first console.log
this feels like a slapping contest
even though ur activies has it

event listener has an arrow func
setInterval has an actual function passed in
love the consistency
ikr!
,
but dude it obviously isn't!!!! the code is licensed!! 🙄
LMAO
If it works like that why i need waste my time by clicking more Key?
You dmbass i said you i am using glitch
i said you i am
Ladies and gentlemen, if you look at the right side, you can see a wild djs copy paste dev in his natural habitat
lol
i think you should chill on those lines of coke a bit
Smd you pissed me off
Except a) it doesn't work; b) it's incorrect syntax
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 🤷♂️
It works like that and no error
you're in denial my dude
no error
theres 6 experienced js devs here telling u it doesnt work like that
No, it fucking doesn't. Try it in your browser console and tell me that again.
Does it output shit in your console?
Yes we saw when i type you all wanted
here's a little tid bit for you https://puu.sh/HQnr8/5762e85da3.avi
@slender thistle .
Do you see red btw
When i delete s it didnt work
i tried that approach already
What did you delete
,
There was typing avtivites
Ok let's break this down since you're one stubborn motherfucker who refuses to write proper code
^^
Itsnt about me
Its bc of program
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
ITS COPİED FROM DISCORD JS
I suggest giving this a thorough read
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
It works for me
No it doesn't lol
It very well fucking doesn't, brother
That's red text i see
which indicates ERRORS
meaning your CODE is NOT correct
im just gonna silently pretend i did not this and start yet another branch to this argument
the red underline means it's working extra fast!
definitely
its like the old ones said
The red underline literally tells you
red stripes makes thing go faster
"you dumbass this is incorrect"
Good fucking job, that's one issue solved
then explain why the other ones work
so just escape the backtick in your string lol
You missed an operator there buddy
Can you tell me which operator you missed there
ahh yes the cycle repeats
One message removed from a suspended account.
must be a number in it
what
P.S. no
One message removed from a suspended account.
Look bro i did what did you say
And it did not work
Show what you did
Maybe it shows red because for different thing
I have an assumption that you did something incorrectly
Or nwm use desktop mode
Can't you just rotate your screen

This time it should be correct
where did i say that?
So i did it activite.length
Do activities.length because that's your array
activites isn't the same as activities
I understand it now
plus you didn't have an operator there
and i sent you this too
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
See? You get shit done when you stop being stubborn. 😄
they really need to figure out how to make urls not 10 years long
lol
Just because you think your code works doesn't mean it does. Be sceptic as a developer.
agreed, its probably used a shitton tbh
If they first said that i could listen but they choose to moving to make fun
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
i'll just do this
I'm not aware of JS' scopes 
eeeeeeeeeeeee
he named the ORIGINAL one wrong
Its about my english
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
activitinitus eghm
👀
use activities instead of activites
Yes i did it
Neither of those words make sense to me anymore
im not even sure how to spell activities anymore.
One message removed from a suspended account.
AcTivITiTIeS
pog i got it right
One message removed from a suspended account.
One message removed from a suspended account.
shiv, ur time to shine
One message removed from a suspended account.
Fixed it too
One message removed from a suspended account.
Oh boy ephemeral messages
One message removed from a suspended account.
Is that possible without interactions?
Ah
good question
not sure u can
let me ask the nerds
brb
copy that code here
setInterval(YOUR_ARROW_FUNCTION_HERE)
ARROW_FUNCTION:
() => { FUNCTION BODY, DO SHIT HERE; }
also, that server count will never update
or u can mindfuck and confuse the heck out of em with
_ => ```
good eye
didnt think bout that
Its updating
It won't update later in life because it's only set at bot start
and once again he curls in the bubble
And check again
- Create string with
client.guilds.cache.sizeservers; - Create a loop;
- 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
Now fucking remove it from like 5 servers and tell me it works
Why i do it ?
Because you're not listening
be aware that its cached and d.js is a bit funky with it. -> possible that it wont update properly
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?
It won't UPDATE it
How tf it update then?
it will SET it the first time the array is created
it will only update if the process restarts
it will not UPDATE
Thxx
wrap it in the function itself probably
Some people were never told "no" in their lives, I swear to fucking God
Okay ill just listen you
You can create the array in your function
I will not oppose
there is a way to update it, but it requires some brain power
which we lack in this case
Idk what is meaning
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I'd rather let people get used to being judged for shit code they write, which they then think is the proper way
One message removed from a suspended account.
lies, my fire hose can definitively kill more flies
full pressure
have you not seen like 3 guys telling the dude what to do to fix his shit
One message removed from a suspended account.
All it took was me to drop the sugarcoating and give shit to him as-is
The code errors were about your code
but it would clearly get more flies tho
^^
in which case it's still not code judging your English
,
Yes but they said code is wrong
why the small Hose?
which it was
But my spell was wrong
so stop arguing about that and move on
you can call it AcTivITiTIeS if u want
just gotta make sure to use that everywhere
more penetration power. smaller noose = more pressure
Python's calendar module literally has an HTMLCalendar class, which allows me to retrieve days in a month in HTML. Quite nice
Whats the best framework for caching mongodb documents?
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
One message removed from a suspended account.
One message removed from a suspended account.

i used Redis
o
this is a very development conversation
I'd rather be called baka than have stubborn people here try and prove me wrong when their shit isn't correct
locally on the instance, not outside....
there is a small package for it, sure its last updated 3 years ago or so, but works fine
map it
Woohoo time to write JS manually
you could probably get some framework, but im not sure if they will help you this much
I have to keep them uptodate too, cache gets corrupt.....
How can you write js manually?
just make sure to either write throu or backwrite
There's the JS that's already done for you
aka my framework
and then there's my custom JS
oh
which I will write myself
Not sure which word would fit more, so ig custom JS it is
I use mongoose, but I want to change, it uses a lot of ram and gets often corrupt....
i used redis as cache for mongodb, and it just worked, chances are higher that you corrupt MongoDB than redis
redis needs an external node
...
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
I have some hashed tokens 🤣
does redis auto update?
you have to handle the caching yourself
like i said there is a npm package for it
https://www.npmjs.com/package/mongoose-redis (i know last updated 2 years ago, but the code the lib uses is so simple it just works)
read my other comment
i think its best we go for an unofficial approach
and then you dont have to worry about lint rules
.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
the error ?
one sec
and if the user doesn't, send a message then after one minute add unverified
the problem is
it adds all the roles, sends a message and adds unverified
how do i fix this?
wait
are you getting the correct roles ?
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
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
why me ping
no
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
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)
it looks cooler
It looks dumber
cooler
that's your issue @tribal siren
i swear there was a reason for why i did that
but i don't remember
thanks, i will inform if there will be a problem
Also, roles.add() supports arrays in discord.js
so no need to do a forEach to assign the roles
yes, there is still the same problem
Send the code again
.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
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
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)
It should work with that
Do you know if the member.roles.cache includes the @everyone role?
I don't think so, for discord.js
no, but without cache, it works
It might
yea
Then @tribal siren you can simply do if(member.roles.cache.size === 0)
it's supposed to work
Try to eval member.roles.cache and check if everyone is in there
hm alright
try that before
I just checked my old source, it does include everyone role
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
hm alright thanks



