#development

1 messages · Page 723 of 1

mossy vine
#

noone will help you with that

fallow spire
#

Just wan't to know in what kind of servers my Bot is in

mossy vine
#

thats not a backdoor, and there are simpler ways to list it as well

modest maple
#

That will get ur bot banned from DBL for breaking DOS if you want a backdoor

#

TOS*

fallow spire
#

Ok good to know. Ty

sage bobcat
#

One message removed from a suspended account.

west raptor
#

@fallow spire that's a good way to get banned from not only here but also discord

fallow spire
#

Good to know

mossy vine
#

@west raptor just simply listing guild names isnt against tos, right?

wooden lance
#

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

mossy vine
#

yeah i know, its private

lavish shuttle
#

@fallow spire names are unreliable

#

You could have two guilds with the same name

glacial mango
#

Anyone knows how to fix this error?
Error: Error: Connection not established within 15 seconds.

#

My bot doesn't join vc

wooden lance
#

anyone remember how to get the client's user ID? (JS)

earnest phoenix
wooden lance
#

thanks

earnest phoenix
#

np xd

valid frigate
#

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

amber fractal
#

Well what does the app do, that could just be normal

mild escarp
#

how to make commands work in dm in discord.js?

grim aspen
#

have it dm the user

warm marsh
#

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.

earnest phoenix
#

My bot not responding here

summer island
#

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?

patent path
#

How long does it usually take for a bot to be approved?

#

@summer island Is auth.json your config file?

loud salmon
#

-faq 2 @patent path

gilded plankBOT
patent path
#

cool thanks

summer island
#

@patent path No, I created a separate config.json file

wide nest
#

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?

valid frigate
#

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

wide nest
#

Understood, I'll change that now. Thank you for the advice.

valid frigate
#

np

patent path
#

@summer island You only need your token in one file

distant plank
#

Hi

patent prism
#

👋

modest maple
#

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

patent prism
#

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

earnest phoenix
#

py is hard mmLol

modest maple
#

ooh ill try it, 80,000 users and i just realised the Moderation commands do not require admin to use

patent prism
#

Not really

modest maple
#

slightly massive issue

patent prism
modest maple
#

and PY is ez

patent prism
#

How did that get into production

modest maple
#

idek

#

just kinda forgot

patent path
#

Yikes

modest maple
#

but its a background bot really

#

so as a regular user youre not gonna rlly know its there or what it does

quartz kindle
#

80k users, from which 79k are from this server

#

Huehuehue

earnest phoenix
#

huehuehue

rustic pier
#

Anyone know if I can remove the "playing" in the status of my bot? 🤔

mossy vine
#

you cant

sudden geyser
#

M8te what library

mossy vine
#

doesnt matter, you cant

#

custom statuses arent supported for bots yet afaik

earnest phoenix
#

correct

#

discord has plans for it but god knows when it will be implemented

sudden geyser
#

But they said "Anyone know if I can remove the "playing" in the status" unless they said something before

mossy vine
#

doesnt mean you can

sudden geyser
#

what

quartz kindle
#

I cant look at "a quote "like" this" without feeling its so wrong

mossy vine
#

brains cant parse that

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

"Anyone know if I can remove the \"playing\" in the status"

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

that was a joke

slender thistle
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

it's a function

slender thistle
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

Tried what exactly

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

What's the difference between a property and a method/function

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

sigh

sudden geyser
#

bruh

earnest phoenix
#

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

west raptor
#

@sage bobcat User#avatarURL is a method

#

Not a property

#

So you have to call avatarURL

rugged pond
#

Yo. Someone have a good server hoster (for VPS) that doesn't cost a lot ?

earnest phoenix
#

digitalocean, galaxygate, scaleway

rugged pond
#

Too expensive 😕
i'm student so i don't have a lot of money (~20$/m)

quartz kindle
#

You can spend 20/m on a vps or you get 20/m in general for everhthing like food n shit?

rugged pond
#

No 😂

#

20/m on a VPS

quartz kindle
#

Thats a lot

#

I pay 3/m

rugged pond
#

For how many Gb of ram ?

quartz kindle
#

1gb

rugged pond
#

Ok. I need a least 4 x)

quartz kindle
#

Why is that? Minecraft server?

rugged pond
#

Why minecraft server first ? 😂

quartz kindle
#

Because minecraft eats ram for breakfast

rugged pond
#

lol

#

It's for school project

quartz kindle
#

Well, 4gb isnt that much

#

You can find that for less than 10/m

rugged pond
#

i know i can find something for less than 10/m but i don't find something that work fine

quartz kindle
#

Why wouldnt it work fine?

rugged pond
#

Idk. Lots of hoster that i found have many issues...

quartz kindle
#

What kind of issues?

rugged pond
#

Bad connection

#

Using OpenVz for the virtualization

#

Or something else that is bad

quartz kindle
#

Hmm, what kind of connection you need? Most offer 100/100 or 500/500

rugged pond
#

Something that don't lag

#

100/100 is great, but i found some with that but idk why, the was lagging some times

quartz kindle
#

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

rugged pond
#

That is not really the distance with the target location

#

It's the rooting behing the VPS

quartz kindle
#

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

topaz kite
#

U guys talk like developers developing smthn noice

quartz kindle
#

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

ruby talon
#

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

valid frigate
#

you need something called "meta tags"

#

specifically, discord uses open graph protocol along with twitter/facebook etc to display rich embeds

ruby talon
#

K thanks.
^^

valid frigate
#

np

median skiff
#

hey i need help

#

my bot is crashing for no reason

valid frigate
#

context?

median skiff
#

CPU

0%
Memory

17%
86MB / 512MB
Disk

2%
4MB / 194MB

#

he is the usage

valid frigate
#

lol thats not what context means

#

do you have a stack trace

median skiff
#

no

valid frigate
#

what

#

so your bot just dies

#

are you calling process.exit anywhere

median skiff
#

only on command reboot

valid frigate
#

lmao what

#

what are you doing specifically that causes it to crash

#

you need to elaborate

earnest phoenix
#

@rugged pond ZoomEyes

median skiff
#
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!`);
};
earnest phoenix
#

the amount of allocation with that

#

What the problem @median skiff

#

just format it once save it in a variable and use that

median skiff
#

my bot is crashing for no reason

earnest phoenix
#

There's always a reason

#

Your console didn't say anything ?

median skiff
#

nope

#

when i type c!help does not send anything and when i type my other commands nothing happen

earnest phoenix
#

Hum, surely your command handler who has a problem

median skiff
#

ok i just fixed it

#

there was something i deleted in the command index.js

summer island
#

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?

earnest phoenix
#

what version of djs are you on

summer island
#

11.5.1

earnest phoenix
#

then it is a property

summer island
#

On an earlier line it runs message.author.displayAvatarURL() and that's a function. WHy not user.displayAvatarURL()

#

Functions are denoted by ()

sudden geyser
#

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.

slim heart
#

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

summer island
#

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

earnest phoenix
#

what?

summer island
#

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

earnest phoenix
#

and what's wrong with it?

summer island
#

Running the bot returns this error >TypeError: user.displayAvatarURL is not a function

earnest phoenix
#

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

sage bobcat
#

One message removed from a suspended account.

sudden geyser
#

How are you using it

#

and that returns the hash

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

you wanna do that?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

client.user.displayAvatarURL

sage bobcat
#

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.

earnest phoenix
#

really? tf

#

for me it displays the bot

sage bobcat
#

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.

vernal willow
#

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

sage bobcat
#

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.

vernal willow
#

You replace it with what you’ve defined it as, it’s an example and it isn’t always client. PES4_Facepalm

west spoke
modern kraken
#

привет! есть русские разрабы? хочу из телеги с помощью ifttt репостить записи с чужой группы, очень близок к финалу, но сообщение отображается не корректно, напишите в лс кто может уделить несколько минут

slender thistle
#

В каком плане некорректно?

modern kraken
#

ну я для теста отправил несколько сообщений в телегу из которой трансляция идет и вот если в сообщении есть смайлы, текста в дискорде не видно
если отправить без них, то сообщение отобразится

loud salmon
#

@slender thistle is this banum time or just confused ruski

#

ah confused ruski

#

carry on

slender thistle
#

IFTTT возможно является самой причиной

modern kraken
#

я тоже так подумал...

#

нет идей как еще можно вытащить? у чувачка вот таким образом вытягивает http://prntscr.com/pt163q вот только что, не знаю

Lightshot

Captured with Lightshot

#

бота в телеге нашел что бы он сообщения перехватывал и ко мне на приватный канал скидывал, а уж потом планировал от туда

#

но не вышло 😦

modern kraken
#

столько людей и ни кто не знает что тут сделать можно)

raven torrent
#

Confusing

earnest phoenix
mossy vine
#

@earnest phoenix you cant use js in your long desc unless your bot is certified

earnest phoenix
#

That bot is certified.

#

And not my bot either.

mossy vine
#

its probably not in script tags then

#

or some weird bug

earnest phoenix
#

Can't sadly ping its owners.

#

Whatsoever uh

raven torrent
#

@earnest phoenix The problem is on your side

#

So pinging the owner(s) of the bot will be useless

covert tartan
#

thats a bug in discordbots i think? @opaque bison

#

i remember asking him about that

#

a long while ago

amber fractal
#

Dbl isn't mobile friendly

#

Well

#

Pages*

earnest phoenix
#

@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.

west raptor
#

It's an iframe on mobile

#

What do you expect

earnest phoenix
#

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

raven torrent
#

@earnest phoenix Pixel 3

#

That's why they search a dev who can remake the entire website @earnest phoenix

mossy vine
#

nah they are going for a full rebranding and expansion

fallow spire
#

@earnest phoenix well remake the site

earnest phoenix
#

gladly if i get paid for it xx

fallow spire
#

lmao

humble iris
#

What are good ideas for bots? Just DM or "@" me. Your help is greatly appreciated.

fallow spire
#

@humble iris Unique Commandw

humble iris
#

@fallow spire Any examples? I'm very new to coding.

loud salmon
#

-help_i_dont_have_ideas @humble iris

gilded plankBOT
#

@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...

earnest phoenix
#

@humble iris give your bot your own economy maybe, or use canvas for image manipulating

#

""bot hosts"" are bs

loud salmon
#

@surreal sage rule 4 GWnekomakiAngeryBOYE

earnest phoenix
#

literally a 3 dollar vps will do

surreal sage
#

oh sorry

grim aspen
#

@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

earnest phoenix
#

^

#

Try out Javascript or your language

#

And learn the Discord API

#

and use databases afterwards

fallow spire
humble iris
#

Thank you all. Why was my name switched? Did it have something to do with my galactic language name?

earnest phoenix
#

yes

#

it's unmentionable and annoying

surreal sage
#

Anyone know a good site to sell stuff?

fallow spire
#

@humble iris its unmentionable

surreal sage
#

Not fiverr or something

fallow spire
#

Ebay xD

twilit rapids
#

Amazon

grim aspen
#

ebay,

surreal sage
#

for discord

earnest phoenix
#

go to random markets to sell your services

humble iris
#

@surreal sage Craigslist, Ebay, Let Go.

earnest phoenix
#

ogusers / mcm

#

// other markets

humble iris
#

Something good to do is go to flea markets, yard sales, stuff like that. You can sell stuff with more value for less.

fickle anvil
#

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 ?

earnest phoenix
#

@humble iris alibaba

humble iris
#

The what?

sage bobcat
#

One message removed from a suspended account.

fickle anvil
#

@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

sage bobcat
#

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.

earnest phoenix
#
    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` ![GWczeAngryCry](https://cdn.discordapp.com/emojis/402867151465086981.webp?size=128 "GWczeAngryCry")
#

Can anyone help me out GWnekomakiNotLikeBOYE im still learning

sage bobcat
#

One message removed from a suspended account.

fickle anvil
#

try: var editedmessage = message.content.split(" ")[1];

earnest phoenix
fickle anvil
#

if it is the third array entry you want to show try [2]

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

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

frozen cedar
#

Any good hosts accept bitcoin?

sage bobcat
#

One message removed from a suspended account.

frozen cedar
#

sigh Bitcoin is oppressed

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

frozen cedar
#

because I have a ton because I do shady stuff

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

frozen cedar
#

Ye I can

#

I'll just do dat

fallow spire
#

Can i show an Users Last Message?

earnest phoenix
#

yes and no

fallow spire
#

Wym

earnest phoenix
#

it's possible

fallow spire
#

with saving them

#

?

earnest phoenix
#

but if a user hadn't talked in a while

#

you would have to spam the api

#

to search for the last message

fallow spire
#

Oh

earnest phoenix
#

(which is not allowed)

fallow spire
#

Can't i just filter Messages?

#

Like from Date

earnest phoenix
#

no

#

the search endpoint isn't available to bots

fallow spire
#

Oh

#

What if i would save the messages on a Db?

earnest phoenix
#

you would still have to spam the api to get to the message first

fallow spire
#

Aw

amber fractal
#

This wont be per channel though

fallow spire
#

Uh if i do bot.users.size it outputs me only Online Users

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

Anyone using jvm know how to improve memory usage? Im hovering around 500mb on 30 guilds with some pretty basic code

#

on jvm*

earnest phoenix
#

Uh if i do bot.users.size it outputs me only Online Users
it outputs cached users

#

if you want all users you have to request a download on every guild

sage bobcat
#

One message removed from a suspended account.

valid frigate
#

What

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

what's with the string interpolation after sh =>

#

It's a property lmao, why put it in a string

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

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

sage bobcat
#

One message removed from a suspended account.

valid frigate
#

If this is djs then maybe try shard.status or smth

#

(i don't know about that)

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

wait rly lmao

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

oh

#

Well

#

Your ternary operator is correct

#

So it would display a red emote for a disconnected sharf

surreal sage
#
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);
        }```
valid frigate
#

Context pleade

#

Please

surreal sage
#

i dont have a dm script in here to say that user is warned

sage bobcat
#

One message removed from a suspended account.

valid frigate
#

Ah well did you want to know if it works

sage bobcat
#

One message removed from a suspended account.

valid frigate
#

Try it and see mate

earnest phoenix
#

all you have to do is browse the docs

#

i literally found what you're looking for within 30 seconds

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

yes

surreal sage
#

:/

#
await channel.send(dmEmbed).catch(O_o => console.log({O_o}));``` I got this in my other scripts but i just saw the other
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

O_o?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

if you can do it yourself, do it yourself

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

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?

surreal sage
#
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?
earnest phoenix
#

dm script?

#

send user to warn messsge?

surreal sage
#

no

earnest phoenix
#

what?

surreal sage
#

to send the user that hes warned

earnest phoenix
#

I didnt understeand your problem

surreal sage
#

it just reports the warn into the mod log, but it does not tell the user that he/she got warned

#

with reason

earnest phoenix
#

hmm

warm marsh
#

You need to add rUser.send

#

or something like that in-order for it to dm the user.

surreal sage
#

im not gonna

warm marsh
#

No-one is going to do it for you.

vapid knoll
#
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);
  }
});```
earnest phoenix
#

ow

vapid knoll
#

I'm also a developper

earnest phoenix
#

Ok.

#

Why you shared this command here?

vapid knoll
#

Idk

earnest phoenix
#

whats problem?

#

ha ok.

#

stop 👏 using 👏 json 👏 files 👏 as 👏 a 👏 database 👏

#

it was never meant to be used as a database

#

"//"

vapid knoll
#

there is no broblems in my code

earnest phoenix
#

it's like using a toilet bowl as your cereal bowl

#

"//const warns = JSON.parse(fs.readFileSync('./warns.json'))"

vapid knoll
#

oh shit

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

yup

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

iT's nOT me WHo Is WrOng It's EvErYbODy ELsE MoM

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

doesn't matter but event subscriptions should be before logging in

grim aspen
#

yes

inner sapphire
#

[ 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

sinful lotus
#

9:25

#

of test.js

#

something before .filter is undefined

loud salmon
#

well obviously whatever you are calling.filter on is undefined

inner sapphire
#
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);
        })
    })
}```
loud salmon
sinful lotus
#

files is undefined

vital lark
#

files is undefined lol

loud salmon
#

good lord I hate js

inner sapphire
#

lmao

#

erm

#

how do i define files

vital lark
#

You can't

#

I think it's undefined because there is no files in that directory

inner sapphire
#

um

loud salmon
inner sapphire
#

-_-

#

kinda, yeah but then changed things

#

since i got sick of it not working

#

and its still fucking broken

sinful lotus
#

check how you put the location of file

summer torrent
sinful lotus
#

I think thats relative to your working dir, not that file's dir

vital lark
#

@inner sapphire show the directory of it

sinful lotus
#

src/Commands probably idk.

#

idk what is yiur workspace

inner sapphire
#

of the command?

vital lark
#

no of the path that u set

#

aka ../Commands

inner sapphire
vital lark
#

That's why

inner sapphire
#

wot

vital lark
#

You don't have files in the directory

#

u have to get the folder name and read the directory with the folder name

inner sapphire
#

wdym

sinful lotus
#

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

vital lark
sinful lotus
#

it starts at where the index.js or whatever

inner sapphire
#

im legit, dumb asf what you mean

sinful lotus
#

what iis the starting poiint of your bot?

inner sapphire
#

bubblebot.js

frozen cedar
#

Bruh

sinful lotus
#

how would you requre a folder on bubblebot.js ?

#

what is the path

inner sapphire
#

oh im stupid

#

C:\Users\benta\Desktop\PC\Development\Discord\Bots\Discord.js\Current Projects\BubbleBOT

that?

sinful lotus
#

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

inner sapphire
#

sorry if im like annoying lol

#

let me try that

#

now thats what i get when putting './Commands'

sinful lotus
#

try using dirent

#

add options

#

and you get fs.Dirent

#

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

inner sapphire
#
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

sinful lotus
#

but do your events have folders on it like how your commands have it

inner sapphire
#

and my command-reloader event dosnt work

#

no

#

my commands are sorted

#

in categorizes

sinful lotus
#

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

inner sapphire
#

erm

#

i have test the command

#

no response but let me check something

sinful lotus
#

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

inner sapphire
#

i would put that in my command re-loader correct.. and sorry im half asleep

sinful lotus
#

I appended the docs there so

#

go read it if you want to see the class

inner sapphire
#

k

fallow steppe
#

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 )

earnest phoenix
#

what

#

??

glacial mango
#

Anyone knows how to get the 2:31 on the left/time the song has been played?

#

I use ytdl-core

earnest phoenix
#

what do you use for streaming though

#

ffmpeg?

glacial mango
#

Yes

dusky marsh
#

yick

surreal sage
#

i need a animator, i pay 2$ each

#

each gif°

south swallow
#

how long do i usually have to wait for my bot to get verified?

sage bobcat
#

One message removed from a suspended account.

south swallow
#

?

#

i already uploaded it to the site and all, im just wondering how long does it take

sage bobcat
#

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.

tulip wave
#

-faq 2 @south swallow

gilded plankBOT
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

tulip wave
#

no you didnt

#

i didnt see luca embed with faq

south swallow
#

oh the whole text channel wont load for me

#

hol up

tulip wave
#

give it a bit

#

discord likes to be slow

south swallow
#

no im using a 3rd party launcher

#

i was wondering it only loaded like the first message

#

thanks tho

tulip wave
#

dont use 3rd party launchers

south swallow
#

why not

tulip wave
#

its a violation of discord TOS

sage bobcat
#

One message removed from a suspended account.

south swallow
#

rly?

tulip wave
#

yes

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tulip wave
#

its a modification to the client

south swallow
#

thats really dumb

sage bobcat
#

One message removed from a suspended account.

tulip wave
#

people can get access to your account like that

south swallow
#

bruh im as far from their client as possible

sage bobcat
#

One message removed from a suspended account.

tulip wave
#

its a huge security risk

sage bobcat
#

One message removed from a suspended account.

south swallow
#

its a smoll irc like thingy i made

#

looks so cool tho

#

living on the edge

#

i guess

loud salmon
#

@south swallow all we can do is scare you away from using the client we dont actually ban you for that

tulip wave
#

yeah

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tulip wave
#

but discord can ban you

loud salmon
#

@sage bobcat thats not needed. it just has the potential to start conflict.

south swallow
#

well i've been using 3rd party since i started discord

sage bobcat
#

One message removed from a suspended account.

south swallow
#

so for about a year and a half

loud salmon
#

yea but

#

you dont need to say it

#

publically

south swallow
#

i didn't know

#

i mean, i only use the browser bc i like being safe 🙂

loud salmon
#

ye, thats good

south swallow
#

now im covered

quartz kindle
#

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

grizzled linden
#

k!avatar

quartz kindle
surreal sage
#
console.log("${message.author.tag}" + "Used PING" + "${msg.createdTimestamp - message.createdTimestamp}ms");
 ``` Does not response right in console, Anyone fixed script?
stray wasp
#

Lul

surreal sage
#

ik some probs

stray wasp
#

Use `

surreal sage
#

thanks

#

i thought

stray wasp
#

Not "

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

ok

sage bobcat
#

One message removed from a suspended account.

surreal sage
#
console.log(`${message.author.tag}` + "Used PING" + `${msg.createdTimestamp - message.createdTimestamp}ms`);```?
#

good?

stray wasp
#

Nope

sage bobcat
#

One message removed from a suspended account.

stray wasp
#

You don't need to concatenate the strings like that

surreal sage
#

can you just send the fixed script or something?

sage bobcat
#

One message removed from a suspended account.

stray wasp
#

Nope

surreal sage
#

sighh

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

But whats the problem here?

#

im here to Learn

stray wasp
#

I'm on my phone and it's not rocket science

sage bobcat
#

One message removed from a suspended account.

stray wasp
#

And I'm not here to spoonfeed

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

surreal sage
#

learning is allowed

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

so whats the problem and how can i fix

stray wasp
#

I told you

surreal sage
#

I fix

stray wasp
#

I say

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

surreal sage
#

sigh...

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

surreal sage
#

${message.author.tag}

#

it does come out of the console like this.

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

${message.author.tag} + "Used PING" + ${msg.createdTimestamp - message.createdTimestamp}ms

#

up

#

nvm that

#

Its probably the thing before $ and after }

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

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

stray wasp
sage bobcat
#

One message removed from a suspended account.

surreal sage
#

got it

#

it works

#

now

#

output: CDeveloper#0001 Used PING 6711ms

#

thanks

#

updating bot

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

im hosting more bots

#

and

stray wasp
#

Six second response time wdym that's the best reponse time

surreal sage
#

i had the same bots open

sage bobcat
#

One message removed from a suspended account.

stray wasp
#

True that

surreal sage
#

first response is main and late one is the testing one

#

if u do #!ping in testing it works

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

like 1

#

and faster ~1000

surreal sage
#

Is there a script to send a email? Like python or something

west spoke
#

Yes

#

Though you need to use a pre-made email and a api

near ether
#

How much of a benefit do shards grant?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

smoky spire
#

it's more of, discord requires you to have them at 2500 servers

sage bobcat
#

One message removed from a suspended account.

west raptor
#

Not crashing rather stopping discord from it being online

near ether
#

Ah ok

#

Does it also allow for better performance too?

quartz kindle
#

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

valid frigate
#

you can also take it up a notch by clustering

quartz kindle
#

thats basically the same thing as far as results are concerned

near ether
#

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

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

@sage bobcat that's because each shard is a separate process lol

#

use broadcastEval

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

you moved to master right @sage bobcat ?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

you could do internal sharding

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

its sharding

#

on one process

#

so no broadcast eval

#

stuff

sage bobcat
#

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.

earnest phoenix
#

you sohuld already have that line just add shardcount auto

near ether
#

What’s the advantage of this? It seems soooooo much simpler that regular sharding

earnest phoenix
#

its all on one process, no broadcasting stuff etc

#

the dis-advantage is that its all on one process

spare goblet
#

advantage is simpler
disadvantage is it doesn't actually split it in separate processes

earnest phoenix
#

so load balancing

#

for bigger bots

#

its null

spare goblet
near ether
#

So the bot’s performance would be sluggish?

spare goblet
#

at some point you'd have to shard properly

earnest phoenix
#

not really

near ether
#

Does this depend on how good my VPS is?

earnest phoenix
#

it would just mean bigger server load one 1 core

#

instead of distributed on many cores

sage bobcat
#

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.

earnest phoenix
#

oh internals sharding you cant like

#

do shard stuff like normal

#

like getting individual shard info is diffrent

near ether
#

Gotcha

#

If you don’t mind, will you take a look at my question from earlier? I can repost it if you like

ruby talon
#

Tensorflow is sick lol.

earnest phoenix
#

its good for new bots that you want to have sharding support on but like once you pass like 10k guilds etc @near ether

near ether
#

The one about fighting

earnest phoenix
#

you might want to start looking into proper sharding

near ether
#

Ah gotcha

earnest phoenix
#

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

near ether
#

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

earnest phoenix
#

you wouldnt to with internal

#

with external ou would

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

@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

near ether
#

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

spare goblet
#

uhuh

sage bobcat
#

One message removed from a suspended account.

near ether
#

When a user is in a server with shard 1, and a server with shard 2, what happens to the cooldown stored in memory?

earnest phoenix
#

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

sick cloud
#

shards don't take care of servers in order though

#

they're random on startup and get changed sometimes

spare goblet
#

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

quartz kindle
#

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)

earnest phoenix
#

#MakeAnAPI 😎

quartz kindle
#

if its internal sharding, then its one user store for all shards in that process

#

like normal

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

@sage bobcat broadcasteval is basically something that allows you to run something on each shard

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

near ether
#

Oh ok, so why doesn’t everyone just use internal sharding?

quartz kindle
#

because at some point, having everything run inside a single process wont cut it anymore

spare goblet
#

because internal sharding isn't great when your bot is huge and huge

quartz kindle
#

if you have a machine with 4 CPUs, your bot will get stuck using only 1 cpu

spare goblet
#

so you could probably last in internal sharding for like idk 10ish shards lul

earnest phoenix
#

for small bots though its yum

spare goblet
#

mhm

near ether
#

What if you’re using a hosting service?

earnest phoenix
#

but you know thw whole saying, program for expandability andsuch

spare goblet
#

we all use hosting services kellyhmm ?

quartz kindle
#

hosting services tell you how many CPUs you're getting for the price

spare goblet
#

@sage bobcat run broadcasteval in your sharding manager

near ether
#

I see

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

client.shard.broadcastEval()

earnest phoenix
#

Which is better, RESTFUL like api or ipc for seperating core functionality

spare goblet
#

what is 12

quartz kindle
#

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

spare goblet
#

oh

grim aspen
#

1 or 2

spare goblet
#

realisation

#

i thought 12 lmao

near ether
#

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?

quartz kindle
#

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

spare goblet
#

broadcast eval is handy for grabbing some info but i personally wouldnt use it to mess around with cache

quartz kindle
#

and things can get desync

earnest phoenix
#

it appears restful api is the goto

quartz kindle
#

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

hushed berry
#

or just a rest api 🤔

earnest phoenix
#

rest api's op

quartz kindle
#

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

earnest phoenix
#

@hushed berry have you seen our new structure

#

we are using

#

😩

hushed berry
#

for what

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

a project im weary to mention in the event i get muted for ads

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

huh

near ether
#

How can I access the master process?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

why did you tag me

sick cloud
#

hey the djs guide has an icon now

sage bobcat
#

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.

earnest phoenix
#

@hushed berry essentially i got 6 devs together to all work on one big project

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

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

sage bobcat
#

One message removed from a suspended account.

sick cloud
#

i could do an example

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

:VeryCool:

#

:(

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

@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")

mossy vine
#

what if i do "(_ => { /*code*/})()"

sage bobcat
#

One message removed from a suspended account.

sick cloud
#
..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
});
mossy vine
#

@sage bobcat no im asking a question

spare goblet
#

tony types faster than me sad

earnest phoenix
sick cloud
#

@spare goblet hey sorry

#

also usually i get beaten

#

my internet takes too long to send

spare goblet
#
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

near ether
#

Omg thank you guys so much

mossy vine
#

@spare goblet wouldnt fetchClientValues work better for this? (idk im just asking)

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

oh i mean

#

yeah that works

#

tomay-to tomah-to imo

quartz kindle
#

that only works for internal sharding

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

i just told you

sick cloud
#

fetchClientValues is over glorified

#

its just a helper class

#

usually should avoid helper classes incase they're removed

spare goblet
#
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

gusty mantle
#

hm

sick cloud
#

fun fact, with internal sharding getting shard ids is tougher

gusty mantle
sage bobcat
#

One message removed from a suspended account.

spare goblet
#

@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

mossy vine
#

why are you evaluating 0

spare goblet
#

same question

sick cloud
#

not going to get any results

gusty mantle
#

yoh

#

baban

sage bobcat
#

One message removed from a suspended account.

sick cloud
#

client.etc.. will get that active shard only

spare goblet
#

and also why would you call back a but not reference a

#

@gusty mantle last warning, stop doing that, move to off-topic

gusty mantle
#

ben ingilizce bilmiyom

sage bobcat
#

One message removed from a suspended account.

abstract crow
sick cloud
#

mute time

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

-notr @gusty mantle

gilded plankBOT
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

@sage bobcat did you even look at my code at all

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

that's an arrow function

#

a bit like your
module.exports = (client, message, args) => {
}

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

thing

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

it's literally the same thing it's just an arrow function

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

spare goblet
#

what

mossy vine
#

do you know how callbacks work

spare goblet
#

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()

mossy vine
#

function(a){} mmLol

spare goblet
#

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...

})
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

iara has been telling you that for the past while showing you most of the code you need

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

huh

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

do you get it now

sage bobcat
#

One message removed from a suspended account.

spare goblet
#

i dont use master sorry

#
client.shard.broadcastEval('this.ws.ping').then(function(a){
//a is the...

})```
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

jesus christ

spare goblet
#

lmfao

quartz kindle
#

you literally replace the client.ws.shard.forEach

#

with that he said

spare goblet
#

mmLol ^

sage bobcat
#

One message removed from a suspended account.

bitter sundial
#

dv, sorry, but are you even trying

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

then dont do 20 things at once

bitter sundial
#

do you always code with 20 other things at once

sage bobcat
#

One message removed from a suspended account.

bitter sundial
#

well come back when you're more focused and willing to work on your bot instead of asking to be spoonfed constantly

quartz kindle
#

if i cant concentrate on my code, i dont code altogether

#

i go play games or something instead

sage bobcat
#

One message removed from a suspended account.

solar wraith
#

what am i doing wrong....
my bot is communicating but not fricking executing

sage bobcat
#

One message removed from a suspended account.

solar wraith
#

<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

loud salmon
#

AttributeError: 'CommandNotFound' object has no attribute 'message'

#

thats the error

#

you are calling a nonexistent attribute

solar wraith
#

uhm

#

?

#

yeah i bought the bot

#

so i went in feet first

#

hehehe