#development
1 messages · Page 723 of 1
Just wan't to know in what kind of servers my Bot is in
thats not a backdoor, and there are simpler ways to list it as well
Ok good to know. Ty
One message removed from a suspended account.
@fallow spire that's a good way to get banned from not only here but also discord
Good to know
@west raptor just simply listing guild names isnt against tos, right?
I think as long as it isn't a public command, it should be fine.
only saying this because i know of bots that were denied for the reason of having a public "list guilds" command
yeah i know, its private
Anyone knows how to fix this error?
Error: Error: Connection not established within 15 seconds.
My bot doesn't join vc
anyone remember how to get the client's user ID? (JS)
thanks
np xd
For any lib beyond djs, get the client user's object first
Also does anyone know the best way to search for memory leaks on a jvm based language? I've set the max memory size on one of my apps to 1G and it's already at 400mb
Well what does the app do, that could just be normal
how to make commands work in dm in discord.js?
have it dm the user
Same way they do when done in a text channel. If you have a line of code like if (message.channel.type === "dm") return it will stop the bot from doing anything with message sent into its direct messages.
Hi there, super new. If your config file holds the token to your bot, do you need the auth.json file with the token in it for the bot to work?
How long does it usually take for a bot to be approved?
@summer island Is auth.json your config file?
-faq 2 @patent path
@patent path
cool thanks
@patent path No, I created a separate config.json file
I was looking through #logs and saw that a bot was declined for sending a DM on join..
My bot DMs the guild owner if a channel named 'general' or 'lobby' is not found when it joins..
The DM is nothing malicious, Just a thank you message with a description of what the bot is about..
Should I change this?
generally it is good practice to not send unsolicited dms
especially in this case since there is a chance that 1) general or lobby doesn't exist as you said before or 2) you can't dm the guild owner
most people will immediately know what prefixes to start using if they add it from dbl since it's on the bot page
Understood, I'll change that now. Thank you for the advice.
np
@summer island You only need your token in one file
Hi
👋
himm
hmmm
so
question
still cant work out how to check if use has admin perms (Discord.py)
and its kinda a massive massive issue rn
If you are using the commands ext, the decorator @commands.has_permissions() exists
You can passadministrator=True to it
and it will stop the command from running
If on_message, then if member.guild_permissions.administrator will work fine
@modest maple
py is hard 
ooh ill try it, 80,000 users and i just realised the Moderation commands do not require admin to use
Not really
slightly massive issue

and PY is ez
How did that get into production
Yikes
but its a background bot really
so as a regular user youre not gonna rlly know its there or what it does
huehuehue
Anyone know if I can remove the "playing" in the status of my bot? 🤔
you cant
M8te what library
But they said "Anyone know if I can remove the "playing" in the status" unless they said something before
doesnt mean you can
what
I cant look at "a quote "like" this" without feeling its so wrong
brains cant parse that
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
"Anyone know if I can remove the \"playing\" in the status"
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
that was a joke
One message removed from a suspended account.
One message removed from a suspended account.
it's a function
One message removed from a suspended account.
One message removed from a suspended account.
Tried what exactly
One message removed from a suspended account.
One message removed from a suspended account.
What's the difference between a property and a method/function
One message removed from a suspended account.
One message removed from a suspended account.
sigh
bruh
What's the difference between a property and a method/function
methods do something, they can take input, while a property is, well, a property, a member of an object that can't really do anything else but return the value it has been set to
@sage bobcat User#avatarURL is a method
Not a property
So you have to call avatarURL
Yo. Someone have a good server hoster (for VPS) that doesn't cost a lot ?
digitalocean, galaxygate, scaleway
Too expensive 😕
i'm student so i don't have a lot of money (~20$/m)
You can spend 20/m on a vps or you get 20/m in general for everhthing like food n shit?
For how many Gb of ram ?
1gb
Ok. I need a least 4 x)
Why is that? Minecraft server?
Why minecraft server first ? 😂
Because minecraft eats ram for breakfast
i know i can find something for less than 10/m but i don't find something that work fine
Why wouldnt it work fine?
Idk. Lots of hoster that i found have many issues...
What kind of issues?
Hmm, what kind of connection you need? Most offer 100/100 or 500/500
Something that don't lag
100/100 is great, but i found some with that but idk why, the was lagging some times
Lag depends on many factors
Such as where is the connection coming from
If latency is a priority, get one as close as possible to the target location
That is not really the distance with the target location
It's the rooting behing the VPS
If youre sure about that, usually opening a ticket or speaking with customer support solves that kind of issues
Othdr than that, your only optipn is to try other companies
Its not something that can be known beforehand
U guys talk like developers developing smthn noice
Lul
Anyways, check this channel's pins for some hosting providers users here typically use and are satisfied with
Im using galaxygate and im pretty satisfied with it
Heyo, anyone know how to do the embed thingie for your site/url?
Like when you send a link it pops up an embed like for example:
https://top.gg
That thing above this text ^^ xD
you need something called "meta tags"
specifically, discord uses open graph protocol along with twitter/facebook etc to display rich embeds
K thanks.
^^
np
context?
no
only on command reboot
lmao what
what are you doing specifically that causes it to crash
you need to elaborate
@rugged pond 
const moment = require('moment');
const Discord = require('discord.js');
const settings = require('../settings.json');
var prefix = settings.prefix;
module.exports = client => {
var game = [
"c!help [commands]",
"c!help",
"Made by shawn hamby"
];
setInterval(function() {
var random = Math.floor(Math.random()*(game.length-0+1)+0);
client.user.setActivity(game[random], "Shawn Hamby" );
}, 2 * 60000);
console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] BOT: Active, Commands loaded!`);
console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] BOT: ${client.user.username} Login with the name!`);
client.user.setStatus("online");
client.user.setActivity(`${prefix}help + ${client.guilds.size} Server + ${client.users.size} user`);
console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] BOT: Game name set!`);
console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] BOT: Now with ` + client.channels.size + ` channels, ` + client.guilds.size + ` servers and ` + client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString() + ` Users!`);
};
the amount of allocation with that
What the problem @median skiff
just format it once save it in a variable and use that
my bot is crashing for no reason
nope
when i type c!help does not send anything and when i type my other commands nothing happen
Hum, surely your command handler who has a problem
So, I've been going through the documentation guide and the avatar command returns TypeError: user.displayAvatarURL is not a function, when it's a function on the template they used in the example
What's up with that?
what version of djs are you on
11.5.1
then it is a property
On an earlier line it runs message.author.displayAvatarURL() and that's a function. WHy not user.displayAvatarURL()
Functions are denoted by ()
Discord.js v11 has displayAvatarURL set as a property. If an earlier line has it, it's possibly not called or not in the way you're describing.
whats the best way of like forwarding a port locally? like say i have something hosted on port 80 and i want it locally to be recognized as port 1234, and since its not an http server something like nginx would work afaik
return message.channel.send(Your avatar: <${message.author.displayAvatarURL()}>); works
return ${user.username}'s avatar: <${user.displayAvatarURL()}>; does not
User is only defined as user => {*that second line of code that doesn't work in the const defined as avatarList
what?
const avatarList = message.mentions.users.map(user => {
return ${user.username}'s avatar: <${user.displayAvatarURL}>;
});
This is the only ime user is defined
And this is coming off the tutorial >.> Sorry if I'm a super scrub
and what's wrong with it?
Running the bot returns this error >TypeError: user.displayAvatarURL is not a function
because your on stable, and on stable it is a property. i thought we established this
even looking at your code, it can't produce that error
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you wanna do that?
One message removed from a suspended account.
client.user.displayAvatarURL
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
To do that on an embed you need to set the author, it should look something like this:
.setAuthor(<Client>.user.tag, <Client>.user.displayAvatarURL)
^^^^^^^^^^^^^^
This is in js
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
You replace it with what you’ve defined it as, it’s an example and it isn’t always client. 

привет! есть русские разрабы? хочу из телеги с помощью ifttt репостить записи с чужой группы, очень близок к финалу, но сообщение отображается не корректно, напишите в лс кто может уделить несколько минут
В каком плане некорректно?
ну я для теста отправил несколько сообщений в телегу из которой трансляция идет и вот если в сообщении есть смайлы, текста в дискорде не видно
если отправить без них, то сообщение отобразится
вот это отвечает за текст я так понимаю
http://prntscr.com/pt15kp
@slender thistle is this banum time or just confused ruski
ah confused ruski
carry on
IFTTT возможно является самой причиной
я тоже так подумал...
нет идей как еще можно вытащить? у чувачка вот таким образом вытягивает http://prntscr.com/pt163q вот только что, не знаю
бота в телеге нашел что бы он сообщения перехватывал и ко мне на приватный канал скидывал, а уж потом планировал от туда
но не вышло 😦
столько людей и ни кто не знает что тут сделать можно)
Confusing
Should this happen?
@earnest phoenix you cant use js in your long desc unless your bot is certified
@earnest phoenix The problem is on your side
So pinging the owner(s) of the bot will be useless
thats a bug in discordbots i think? @opaque bison
i remember asking him about that
a long while ago
@raven torrent Which device are you even
Also that embed is still somehow fucked up on your screen.
I'm sure that's not meant to be displayed like that either.
Dbl isn't mobile friendly
dbl's website is designed really badly in general
they ripped off css from a few sites
which is why the styling sometimes looks good but sometimes so bad
@earnest phoenix Pixel 3
That's why they search a dev who can remake the entire website @earnest phoenix
nah they are going for a full rebranding and expansion
@earnest phoenix well remake the site
gladly if i get paid for it xx
lmao
What are good ideas for bots? Just DM or "@" me. Your help is greatly appreciated.
@humble iris Unique Commandw
@fallow spire Any examples? I'm very new to coding.
-help_i_dont_have_ideas @humble iris
@humble iris
Find something that you would like in a bot, and has also not been done before. Try and come up with a list of things you are interested in, and think up ways you could make the task easier with a discord bot. Eg. I like fishing -> I'm in a fishing discord group -> I'll make a bot that has fishing data and gives fishing advice. or I like a certain cartoon/anime/tv show. -> Why not make a bot that reminds me when new episodes are released and their watch dates? Once you have a fair amount of concepts down, try and look for those bots on bot listing sites like this one. If you cant find a bot that does what you laid out before as a bot concept, then feel free to write it! Who knows? Maybe a lot of people would like what you create...
@humble iris give your bot your own economy maybe, or use canvas for image manipulating
""bot hosts"" are bs
@surreal sage rule 4 
literally a 3 dollar vps will do
oh sorry
@humble iris i suggest starting out with simple commands, then increasing difficulty of commands once you feel like you had the hang of it. maybe you can make a binary or morsecode translator
^
Try out Javascript or your language
And learn the Discord API
and use databases afterwards
does Canvas Work on glitch.com?
Thank you all. Why was my name switched? Did it have something to do with my galactic language name?
Anyone know a good site to sell stuff?
@humble iris its unmentionable
Not fiverr or something
Ebay xD
Amazon
ebay,
for discord
go to random markets to sell your services
@surreal sage Craigslist, Ebay, Let Go.
Something good to do is go to flea markets, yard sales, stuff like that. You can sell stuff with more value for less.
Noob question for discord.js
I am getting https://api.poe.watch/get?league=Blight&category=currency and can read the array. But how can I just ask for the entry that contains for example Mirror of Kalandra in the name field? Does something like array[name].contains==="Mirror of Kalandra" work or something ?
@humble iris alibaba
The what?
One message removed from a suspended account.
@sage bobcat I would not only deduct the credits when the game is over, this way you could go negative. Take the money when they start the game and just give the winner his winnings afterwards
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
message.content.slice("m!edit".length);
var editedmessage = message.content.split(" ")[0];
var messageID = message.content.split(" ")[1];
message.channel.fetchMessage(messageID)
.then(message => {
message.edit(editedmessage);
});
}```
This thing work, but when I did `m!edit 641640150065086494 owo` it edit the message to `m!edit` not `owo` 
Can anyone help me out
im still learning
One message removed from a suspended account.
try: var editedmessage = message.content.split(" ")[1];
Akuma no Tsubasa
#0001 it work, but instead when i run m!edit 641636302868971521 owo it did this
if it is the third array entry you want to show try [2]
One message removed from a suspended account.
Thank you!! @fickle anvil it work!
I finally understand how var messageID = message.content.split(" ")[1]; var editedmessage = message.content.split(" ")[2]; work
here my command
{
var messageID = message.content.split(" ")[1];
var editedmessage = message.content.split(" ")[2];
message.channel.fetchMessage(messageID)
.then(message => {
message.edit(editedmessage);
});
}```
thankiess
💞 i can finally sleep
Any good hosts accept bitcoin?
One message removed from a suspended account.
sigh Bitcoin is oppressed
One message removed from a suspended account.
One message removed from a suspended account.
because I have a ton because I do shady stuff
One message removed from a suspended account.
One message removed from a suspended account.
Can i show an Users Last Message?
yes and no
Wym
it's possible
but if a user hadn't talked in a while
you would have to spam the api
to search for the last message
Oh
(which is not allowed)
you would still have to spam the api to get to the message first
Aw
lastMessageID is saved regardless if there is one sent isnt it? (On d.js) https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=lastMessageID
This wont be per channel though
Uh if i do bot.users.size it outputs me only Online Users
One message removed from a suspended account.
One message removed from a suspended account.
Anyone using jvm know how to improve memory usage? Im hovering around 500mb on 30 guilds with some pretty basic code
on jvm*
Uh if i do
bot.users.sizeit outputs me only Online Users
it outputs cached users
if you want all users you have to request a download on every guild
One message removed from a suspended account.
What
One message removed from a suspended account.
One message removed from a suspended account.
what's with the string interpolation after sh =>
It's a property lmao, why put it in a string
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Also shards have some kind of property on them mostly telling their status, so you can't call the shard object itself and expect it to be 1
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
wait rly lmao
One message removed from a suspended account.
One message removed from a suspended account.
oh
Well
Your ternary operator is correct
So it would display a red emote for a disconnected sharf
if (command === "warn" && botConfigs.plugins[15].activated == true) {
if (!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You don't have permission!");
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if (!rUser) return message.channel.send("Provide a valid Ping or user id");
let repCH = message;
let reason = args.join(" ").slice(22);
let reportEmbed = new Discord.RichEmbed()
.setTitle("Warnings")
.setColor("#15f153")
.addField("Warned User", `${rUser} with ID: ${rUser.id}`)
.addField("Warned By", `${message.author} with ID: ${message.author.id}`)
.addField("In channel", repCH.channel)
.addField("Time", repCH.createdAt)
.addField("Reason", reason)
let channel = message.guild.channels.find(ch => ch.name === 'logs');
if (!channel) {
message.channel.send("Can't find a 'logs' channel.");
return;
}
message.delete().catch(O_o => { });
channel.send(reportEmbed);
}```
i dont have a dm script in here to say that user is warned
One message removed from a suspended account.
Ah well did you want to know if it works
One message removed from a suspended account.
Try it and see mate
all you have to do is browse the docs
i literally found what you're looking for within 30 seconds
One message removed from a suspended account.
yes
:/
await channel.send(dmEmbed).catch(O_o => console.log({O_o}));``` I got this in my other scripts but i just saw the other
One message removed from a suspended account.
One message removed from a suspended account.
if you can do it yourself, do it yourself
One message removed from a suspended account.
where was i hostile
i'm just being brutally honest
i never attacked or insulted you
you however, did self insult
How can i learn shard's pings?
if (command === "warn" && botConfigs.plugins[15].activated == true) {
if (!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You don't have permission!");
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if (!rUser) return message.channel.send("Provide a valid Ping or user id");
let repCH = message;
let reason = args.join(" ").slice(22);
let reportEmbed = new Discord.RichEmbed()
.setTitle("Warnings")
.setColor("#15f153")
.addField("Warned User", `${rUser} with ID: ${rUser.id}`)
.addField("Warned By", `${message.author} with ID: ${message.author.id}`)
.addField("In channel", repCH.channel)
.addField("Time", repCH.createdAt)
.addField("Reason", reason)
let channel = message.guild.channels.find(ch => ch.name === 'logs');
if (!channel) {
message.channel.send("Can't find a 'logs' channel.");
return;
}
message.delete().catch(O_o => { });
channel.send(reportEmbed);
}``` Can someone add a dm script to this?
no
what?
to send the user that hes warned
I didnt understeand your problem
it just reports the warn into the mod log, but it does not tell the user that he/she got warned
with reason
hmm
No-one is going to do it for you.
const client = new Discord.Client();
let prefix = "?";
const congig = require("./config.json");
//const warns = JSON.parse(fs.readFileSync('./warns.json'))
//const fs = require('fs')
client.login(config.token);
client.on("ready", () => {
console.log("Connecté !");
client.user.setStatus("online");
client.user.setActivity("Modérer | ?help", { type: "PLAYING" });
});
client.on("message", message => {
if (!message.guild) return;
let args = message.content.trim().split(/ +/g);
let botSize = message.guild.members.filter(b => b.user.bot).size;
let userSize = message.guild.members.size;
let userSizenobot = userSize - botSize;
//
if (args[0].toLowerCase() === prefix + ""){
}
//CLEAR
if (args[0].toLowerCase() === prefix + "clear") {
if (!message.member.hasPermission("MANAGE_MESSAGES"))
return message.channel.send(
"Vous n'avez pas la permission d'utiliser cette commande"
);
let count = args[1];
if (!count)
return message.channel.send(
"Veuillez indiquer un nombre de messages à supprimer"
);
if (isNaN(count))
return message.channel.send("Veuillez indiquer un nombre valide");
if (count < 1 || count > 1000)
return message.channel.send(
"Veuillez indiquer un nombre entre 1 et 1000"
);
message.channel.bulkDelete(parseInt(count) + 1);
}
});```
ow
I'm also a developper
Idk
whats problem?
ha ok.
stop 👏 using 👏 json 👏 files 👏 as 👏 a 👏 database 👏
it was never meant to be used as a database
"//"
there is no broblems in my code
it's like using a toilet bowl as your cereal bowl
"//const warns = JSON.parse(fs.readFileSync('./warns.json'))"
oh shit
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
yup
One message removed from a suspended account.
iT's nOT me WHo Is WrOng It's EvErYbODy ELsE MoM
One message removed from a suspended account.
doesn't matter but event subscriptions should be before logging in
yes
[ CRITICAL ] [UNCAUGHT EXCEPTION] TypeError: Cannot read property 'filter' of undefined
at C:\Users\benta\Desktop\PC\Development\Discord\Bots\Discord.js\Current Projects\BubbleBOT\Commands\General\test.js:9:25
when trying my command
well obviously whatever you are calling.filter on is undefined
const fs = require('fs');
module.exports = (client, message) => {
fs.readdir('../Commands/', (error, files) => {
if (error) console.error(error);
var jsfiles = files.filter(f => f.split('.').pop() === 'js');
if(jsfiles.length <= 0) { return message.channel.send('No Commands Found')}
else { console.log(jsfiles.length + 'Commands found')}
jsfiles.forEach((f, i) => {
delete require.cache[require.resolve(`../Commands/${f}`)];
var commands = require(`../Commands/${f}`);
console.log(`Command ${f} Loading..`);
client.commands.set(commands.config.command, commands);
})
})
}```

files is undefined
files is undefined lol
good lord I hate js
um
did you copy from a tutorial 
-_-
kinda, yeah but then changed things
since i got sick of it not working
and its still fucking broken
check how you put the location of file

I think thats relative to your working dir, not that file's dir
@inner sapphire show the directory of it
of the command?
That's why
wot
You don't have files in the directory
u have to get the folder name and read the directory with the folder name
wdym
as far as Im aware
readdir dont work like how require works
async loadCommands() {
const index = await readdir('./src/commands', { withFileTypes: true });
console.log(`Loading ${index.length} Commands`);
for (const command of index) {
if (command.isDirectory()) continue;
if (!command.name.endsWith('.js')) continue;
try {
const Command = require(`../commands/${command.name}`);
this.client.commands.set(command.name.split('.')[0], Command);
} catch (error) {
this.client.cannons.fire(error);
}
}
console.log(`Loaded ${this.client.commands.size} commands, Failed to load ${index.length - this.client.commands.size} command(s)`);
}
probably use that as an example

it starts at where the index.js or whatever
im legit, dumb asf what you mean
what iis the starting poiint of your bot?
bubblebot.js
Bruh
oh im stupid
C:\Users\benta\Desktop\PC\Development\Discord\Bots\Discord.js\Current Projects\BubbleBOT
that?
or simply as './Commands'
it starts at where the index.js or whatever
and your index.js iis bubblebot.js since its your starting point
sorry if im like annoying lol
let me try that
now thats what i get when putting './Commands'
try using dirent
add options
and you get fs.Dirent
https://nodejs.org/api/fs.html#fs_class_fs_dirent fs dirent contaiins this
if its a directory, use another readdir to read that directory
then do your loading thiing
on options just append the file types thing
like how I did iit on my code snippet
const { basename } = require("path");
const Logger = require("./console-monitor.js");
const fs = require("fs");
module.exports = (client) => {
const event = fs.readdirSync("./Events");
event.forEach(e => {
chokidar.watch(`./Events/${e}`, { awaitWriteFinish: true }).on("change", (file) => {
const mainevent = basename(file, ".js")
// if (!file.endsWith(".js")) return;
Logger(`Event ${mainevent}`, "eventupdating");
const load = require(`../Events/${mainevent}`);
let eventName = file.split(".")[0];
client.on(eventName, load.bind(null, client));
delete require.cache[require.resolve(`../Events/${mainevent}`)];
Logger(`Event ${mainevent}`, "eventupdated");
});
});
};```
thats my event loader
which works fine
but do your events have folders on it like how your commands have it
and my command-reloader event dosnt work
no
my commands are sorted
in categorizes
then ofc 100% that will not work
you need to read the folders on that commands folder
and Im telling you to use dirent
with dirent you can know if its a directory
iif its a directory get the name, then do another readdiir
and now you have the files, all you need to do is to load iit
it will not work if you didnt do dirent
how can you know the contents of the folder
how will you load the commands if you didnt load the js fiiles from the folder
const directories = fs.readdirSync('./Commands', { withFileTypes: true });
for (const directory of directories) {
// siince I appended WithFileTypes iit returns DIRENT class, as per node,js docs https://nodejs.org/api/fs.html#fs_fs_readdirsync_path_options
// https://nodejs.org/api/fs.html#fs_class_fs_dirent now this is FS dirent
if (!directory.isDirectory()) continue;
const commands = fs.readdirSync(`./Commands/${directory.name}`);
for (const command of commands) { // Load the commands }
}
if you analyzed what I said earlier
thats basically what Im tellng you to do

i would put that in my command re-loader correct.. and sorry im half asleep
k
I'm not asking to be spoon fed cause I asked this before. What's the command module that creates a role in .js? ( I'm still learning .js so I guess someone here can help out )
Anyone knows how to get the 2:31 on the left/time the song has been played?
I use ytdl-core
Yes
yick
how long do i usually have to wait for my bot to get verified?
One message removed from a suspended account.
?
i already uploaded it to the site and all, im just wondering how long does it take
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
-faq 2 @south swallow
@south swallow
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
no im using a 3rd party launcher
i was wondering it only loaded like the first message
thanks tho
dont use 3rd party launchers
why not
its a violation of discord TOS
One message removed from a suspended account.
rly?
yes
One message removed from a suspended account.
One message removed from a suspended account.
its a modification to the client
thats really dumb
One message removed from a suspended account.
people can get access to your account like that
bruh im as far from their client as possible
One message removed from a suspended account.
its a huge security risk
One message removed from a suspended account.
its a smoll irc like thingy i made
looks so cool tho
living on the edge
i guess
@south swallow all we can do is scare you away from using the client we dont actually ban you for that
yeah
One message removed from a suspended account.
One message removed from a suspended account.
but discord can ban you
@sage bobcat thats not needed. it just has the potential to start conflict.
well i've been using 3rd party since i started discord
One message removed from a suspended account.
so for about a year and a half
ye, thats good
now im covered
if you report people for using 3rd party stuff, you're not being a good guy or doing the right thing, you're basically being an asshole lol
k!avatar
console.log("${message.author.tag}" + "Used PING" + "${msg.createdTimestamp - message.createdTimestamp}ms");
``` Does not response right in console, Anyone fixed script?
Lul
ik some probs
Use `
Not "
One message removed from a suspended account.
ok
One message removed from a suspended account.
console.log(`${message.author.tag}` + "Used PING" + `${msg.createdTimestamp - message.createdTimestamp}ms`);```?
good?
Nope
One message removed from a suspended account.
You don't need to concatenate the strings like that
can you just send the fixed script or something?
One message removed from a suspended account.
Nope
sighh
One message removed from a suspended account.
I'm on my phone and it's not rocket science
One message removed from a suspended account.
And I'm not here to spoonfeed
One message removed from a suspended account.
One message removed from a suspended account.
learning is allowed
One message removed from a suspended account.
so whats the problem and how can i fix
I told you
I fix
I say
One message removed from a suspended account.
One message removed from a suspended account.
sigh...
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
${message.author.tag} + "Used PING" + ${msg.createdTimestamp - message.createdTimestamp}ms
up
nvm that
Its probably the thing before $ and after }
One message removed from a suspended account.
and the + thingies work
i see
wait no
do i?
wait
console.log(`${message.author.tag} Used PING (Ping: ${msg.createdTimestamp - message.createdTimestamp}MS`);```
is this wright?
idk if i spelled that right
oop
lol
wright = right
@sage bobcat
One message removed from a suspended account.
got it
it works
now
output: CDeveloper#0001 Used PING 6711ms
thanks
updating bot
One message removed from a suspended account.
Six second response time wdym that's the best reponse time
i had the same bots open
One message removed from a suspended account.
True that
first response is main and late one is the testing one
if u do #!ping in testing it works
One message removed from a suspended account.
Is there a script to send a email? Like python or something
How much of a benefit do shards grant?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
it's more of, discord requires you to have them at 2500 servers
One message removed from a suspended account.
Not crashing rather stopping discord from it being online
depends
sharding = splitting your bot into multiple connections
at 2500 guilds it is required by discord
sharding can be done by having one process manage multiple connections (internal sharding in most libs) or by having a separate process handling each connection (traditional sharding)
the latter offers better performance if your machine has multiple CPUs
the former uses less resources compared to the latter
ideally you should have has many processes as you have CPUs, and have each of those use internal sharding if required
you can also take it up a notch by clustering
thats basically the same thing as far as results are concerned
Okay I see what u mean, thanks!
Actually one last (specific) question
I have a ;fight @ user command on my bot.
Users in the middle of a fight have their id stored in a list. If A and B are fighting, and A tries to fight C, my program checks if A.id is in the list, and if so, tells A that they can’t fight C until they finish their fight with B.
Knowing this, how is this information stored across multiple shards? Are the shards considered new instances of the bot? Would that mean that Shard 1 would have A.id and B.id stored in their list, but Shard 2 or 3 don’t?
Not sure how shards work when you’re storing values in local variables/memory
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you moved to master right @sage bobcat ?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you could do internal sharding
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
just put this line https://conquestsim.io/upload/holistic-fuel-3542.png
you sohuld already have that line just add shardcount auto
What’s the advantage of this? It seems soooooo much simpler that regular sharding
its all on one process, no broadcasting stuff etc
the dis-advantage is that its all on one process
advantage is simpler
disadvantage is it doesn't actually split it in separate processes

So the bot’s performance would be sluggish?
at some point you'd have to shard properly
not really
Does this depend on how good my VPS is?
it would just mean bigger server load one 1 core
instead of distributed on many cores
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
oh internals sharding you cant like
do shard stuff like normal
like getting individual shard info is diffrent
Gotcha
If you don’t mind, will you take a look at my question from earlier? I can repost it if you like
Tensorflow is sick lol.
its good for new bots that you want to have sharding support on but like once you pass like 10k guilds etc @near ether
The one about fighting
you might want to start looking into proper sharding
Ah gotcha
but yea its so simple that i just do it on all my bots defaultly to start with
since its litterally just 1 line of code
lol
Lmao that’s why I wanna do it
Although I’m kinda worried I have to Redesign the cooldown management for my bot with shards because the cooldowns are all stored in memory
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@near ether suppose you're sharding traditionally
shard 1 is in guild A, B and C
shard 2 is in guilds D, E and F
shard 2 shouldn't be able to directly grab guild A
not exactly sure what your question itself is tbh
Sorry I should have specified;
What if user A is in guild 1, and guild 2000? So shard 1 takes care of guilds 1-1000, shard 2 takes care of guilds 1001-2000
uhuh
One message removed from a suspended account.
When a user is in a server with shard 1, and a server with shard 2, what happens to the cooldown stored in memory?
if you have 2 shards of the same file and you dont specify cooldown to only be on 1 of them
it will duplicate
you could specify cooldown to be on 1 shard, then call that shard for info
shards don't take care of servers in order though
they're random on startup and get changed sometimes
if you're storing it in the user cache, it won't show up in another shard's cache if that's what you're talking about
cuz they're like separate processes in traditional sharding
if its the same user in multiple guilds, both shards will have a copy of it
what you save in one shard wont be available in another shard
(traditional sharding)
#MakeAnAPI 😎
if its internal sharding, then its one user store for all shards in that process
like normal
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat broadcasteval is basically something that allows you to run something on each shard
One message removed from a suspended account.
One message removed from a suspended account.
Oh ok, so why doesn’t everyone just use internal sharding?
because at some point, having everything run inside a single process wont cut it anymore
because internal sharding isn't great when your bot is huge and huge
if you have a machine with 4 CPUs, your bot will get stuck using only 1 cpu
so you could probably last in internal sharding for like idk 10ish shards lul
for small bots though its yum
mhm
What if you’re using a hosting service?
but you know thw whole saying, program for expandability andsuch
we all use hosting services
?
hosting services tell you how many CPUs you're getting for the price
@sage bobcat run broadcasteval in your sharding manager
I see
One message removed from a suspended account.
client.shard.broadcastEval()
Which is better, RESTFUL like api or ipc for seperating core functionality
what is 12
if you want some statistics, my host is 1 cpu, 1gb ram, bot is at ~1600 guilds. 15% cpu with default d.js, 5% cpu with zlib-sync installed, 1% cpu with guild subscriptions disabled
oh
1 or 2
Gotcha
So if I’m going to store the user’s cooldown in memory, should I broadcast it across all the shards?
That way there will never be a point where one shard has the user on cooldown while another doesn’t?
if you need to control states across multiple processes, its better that you store it on an external process
else you will have multiple copies of all users's information
broadcast eval is handy for grabbing some info but i personally wouldnt use it to mess around with cache
and things can get desync
it appears restful api is the goto
if you're going to run multiple processes, you will probably want a database server or a cache like redis, and probably some sort of IPC or message broker
or just a rest api 🤔
rest api's op
by default, discord.js runs a master process that spawns shards, and it includes IPC as well, so you could store info in the master process for example
for what
One message removed from a suspended account.
One message removed from a suspended account.
a project im weary to mention in the event i get muted for ads
One message removed from a suspended account.
huh
How can I access the master process?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
why did you tag me
hey the djs guide has an icon now
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
i told you
broadcasteval is basically eval but you can't directly put an arrow function in, you're putting a string; and also it's running on all the shards
One message removed from a suspended account.
i could do an example
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@near ether shards are basically an instance of node's child_process, so you can send messages to the parent by using process.send()
and the master can receive using shard.on("message")
what if i do "(_ => { /*code*/})()"
One message removed from a suspended account.
..broadcastEval(`this.servers.size`).then(results => {
// results = [14, 12, 12]
// an array of the eval results
// in broadcastEval, `this` is equal to `client` or whatever
});
@sage bobcat no im asking a question
tony types faster than me 
https://conquestsim.io/upload/puzzling-flight-2906.png @near ether if you want to be cool you can do what we do and seperate core functionality to a rest api, automations to a process seperate of that and just make calls to it
@spare goblet hey sorry
also usually i get beaten
my internet takes too long to send
client.shard.broadcastEval('this.shard.id').then(a=>{
// a is an array of the ids of the shardsums
})```
it's sad cuz mine was only this length

Omg thank you guys so much
@spare goblet wouldnt fetchClientValues work better for this? (idk im just asking)
One message removed from a suspended account.
that only works for internal sharding
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
fetchClientValues is over glorified
its just a helper class
usually should avoid helper classes incase they're removed
client.shard.broadcastEval('this.shard.id').then(a=>{
// a is an array of the ids of the shardsums
})
literally the same for all of the values tbh except instead of id it would be status / ping etc
hm
fun fact, with internal sharding getting shard ids is tougher

One message removed from a suspended account.
@gusty mantle don't send random emojis / random msgs without any context / correlation to the topic in #development ty, if you wanna chat or talk about off topic things there's a channel for that
why are you evaluating 0
same question
not going to get any results
One message removed from a suspended account.
client.etc.. will get that active shard only
and also why would you call back a but not reference a
@gusty mantle last warning, stop doing that, move to off-topic
ben ingilizce bilmiyom
One message removed from a suspended account.
#memes-and-media pls
mute time
One message removed from a suspended account.
-notr @gusty mantle
@gusty mantle
İngilizceden başka diller için #memes-and-media kullanın.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat did you even look at my code at all
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
that's an arrow function

a bit like your
module.exports = (client, message, args) => {
}
One message removed from a suspended account.
thing
One message removed from a suspended account.
it's literally the same thing it's just an arrow function
One message removed from a suspended account.
One message removed from a suspended account.
what
do you know how callbacks work
because if you don't have an arrow function then how are you gonna resolve the promise
i mean
you could do const a = await something()
function(a){} 
instead

if you don't understand an arrow function you could do what cyber said instead i guess
client.shard.broadcastEval('this.shard.id').then(function(a){
//a is the...
})
One message removed from a suspended account.
One message removed from a suspended account.
iara has been telling you that for the past while showing you most of the code you need
One message removed from a suspended account.
One message removed from a suspended account.
huh
One message removed from a suspended account.
One message removed from a suspended account.
oh it might be this.ws
i dont use master sorry
client.shard.broadcastEval('this.ws.ping').then(function(a){
//a is the...
})```
One message removed from a suspended account.
One message removed from a suspended account.
jesus christ
lmfao
^
One message removed from a suspended account.
dv, sorry, but are you even trying
One message removed from a suspended account.
then dont do 20 things at once
do you always code with 20 other things at once
One message removed from a suspended account.
well come back when you're more focused and willing to work on your bot instead of asking to be spoonfed constantly
if i cant concentrate on my code, i dont code altogether
i go play games or something instead
One message removed from a suspended account.
what am i doing wrong....
my bot is communicating but not fricking executing
One message removed from a suspended account.
<discord.ext.commands.context.Context object at 0x000001E576B45808>
<discord.ext.commands.context.Context object at 0x000001E576B45808>
Ignoring exception in on_command_error
Traceback (most recent call last):
File "D:\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\discord\client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "D:\tanki online\Tanki Online Bot\run.py", line 212, in on_command_error
channel = ctx.message.channel
AttributeError: 'CommandNotFound' object has no attribute 'message'
that
:c
its receiving the command but then it gets a mental break down

