#development

1 messages ยท Page 966 of 1

lyric mountain
#

not print the object itself

knotty steeple
#

i use node.js and code

agile oyster
#

what version are you using

knotty steeple
#

lts

agile oyster
#

what

lyric mountain
#

LTS

agile oyster
#

k

knotty steeple
agile oyster
#

well how do you write code in the software, im having problems right now

lyric mountain
#

[REDACTED]
@knotty steeple so?

knotty steeple
#

seems like u dont know programming

#

dont start with a bot

agile oyster
#

i do, i used to use node.js

lyric mountain
#

json isnt exactly an object because of the N (notation)

knotty steeple
#

but u dont know to get a text editor

lyric mountain
#

but it's still a js object

#

just not 100%

knotty steeple
#

read the stackoverflow answer please

lyric mountain
#

which one?

#

because that question is about json formatting and syntax, not the diff between JSO and JSON

knotty steeple
#

ok u didnt even look at it

lyric mountain
#

I did

#

as I said

#

JSON is a string version of a JSO

mossy vine
#

exactly

#

a string

#

not an object

#

a string

lyric mountain
#

...dude

knotty steeple
#

thank u cyber

pale vessel
#

which is why you have to parse it

lyric mountain
#

it's a serialized object

#

is IS an object

#

just not a unserialized one

mossy vine
#

ok

#

so

#
"{\"a\": 1}"```
#

you are saying this is an object

lyric mountain
#

a serialized one

mossy vine
#

it is not an object

#

it is a string

lyric mountain
#

it's a serialized object

#

all serialized objects become strings

mossy vine
#

serialized into a string

knotty steeple
mossy vine
#

therefore it is no longer an object

lyric mountain
#

dude

#

I'll just stop arguing, it's useless to talk with rocks

#

json is a jso but serialized

mossy vine
#

...json is a js object
i mean this doesnt even make sense

lyric mountain
#

period

mossy vine
#

json is a notation

#

its in the name

lyric mountain
#

holy fckin shit, I know that

indigo flax
#

hi

#

everybody thank you for helping others

#

heres a gift

#

did somebody claim it?

#

here

knotty steeple
#

funny

#

can u stop

sudden geyser
#

aw thought it was nitro

knotty steeple
#

selfbots claim every gift

torn ravine
#

if I use process.exit to stop the bot. how would i start it again

knotty steeple
#

@torn ravine process managers

#

pm2/forever

torn ravine
#

process manager?

indigo flax
knotty steeple
#

or somehow make a hook urself that never exits

#

are u actually dumb

#

austin

torn ravine
#

bruh'

earnest phoenix
#

what is wrong with this
client.on('message', message => {
if (message.content === '!Embed') {
channel.send(Embed);
};
});

torn ravine
#

do you name your embeds

earnest phoenix
#

wdym

torn ravine
#

do you define your embeds as something other than e,beds

#

like

earnest phoenix
#

if i have multiple

torn ravine
#

const coolman = new Discord.MessageEmbed

#

id so it would be

earnest phoenix
#

ok

torn ravine
#

message.channel.send(coolman)

#

idek if I should use process.exit

hardy vector
#

so im trying to make a lavalink music bot with discord.js commando and this is my ready.js file it should log new node connected and on the jar file should say new connection or soemthing but it just says ready and wont say new node connected this is my code for the ready.js file

let {Client} = require("discord.js-commando");
const client = new Client()
const {ErelaClient} = require('erela.js')
module.exports = function() {

console.log(`Logged in as ${client.user.tag}!`); //log when the bot is ready to be used
console.log('ready')
    client.music = new ErelaClient(client, [
        {
            host: "localhost",
            port: 7500,
            password: "anotherday"
        }
    ])
    client.musicPlayers = new Map();
    console.log('Ready!');
    client.music.on("nodeConnect", node => console.log("new node connected"));
    client.music.on("nodeError", (node, error) => console.log(`Node error: ${error.message}`));
    client.music.on("trackStart", (player, track) => player.textChannel.send(`Now playing: ${track.title}`));
    client.music.on("queueEnd", player => {
        player.textChannel.send("Queue has ended.")
        client.music.players.destroy(player.guild.id);
    });
};```
earnest phoenix
#

how do i copy the text someone wrote after a prefix

sudden geyser
#

You slice off the message content by the prefix length.

earnest phoenix
#

how?

sudden geyser
#

what language are you using

earnest phoenix
#

java

honest perch
#

i was waiting to hear english

golden condor
#

Lmao

earnest phoenix
#

lmao

sudden geyser
#

You can use <String>.substring

earnest phoenix
#

what's the string

sudden geyser
#

the message content

earnest phoenix
#

oh

#

ok

digital ibex
#

yello

#

i have a button, how can i do stuff with that button? so like when the button is clicked, i want to respond with a message saying smething like u click button

#

in js

honest perch
#

webhook?

hushed jungle
#

Why can't Discord play videos I put in my embed.

#

It tries to load the video but fails miserably ๐Ÿ˜ฆ

honest perch
#

you cant put videos in embeds iirc

hushed jungle
#

Thought it was a bug

sudden geyser
#

I think you can

hushed jungle
#

Guess I need to find a workaround of some type

honest perch
#

dont send it in an embed?

digital ibex
#

~~no laugh at my shitty design pls ~~

hushed jungle
#

Well, the most elegant solution I can think of is posting the link, which generates a seperate embed

#

But posting it in the first embed looks much better

digital ibex
#

@honest perch does that make more sense or

next remnant
#

Use alert(), toasts (look up how to toast in whatever framework you're using), etc
Depends on how you wanna show
@digital ibex

digital ibex
#

but u can't style alert and that doesn't show apart of the browser

#

i mean like

next remnant
#

Show a dialog box

#

Or a toast

#

If you're going for material design, snackbar also exists

digital ibex
#

but how would i even know when someone clicks it?

next remnant
#

On click event

#

Idk what framework/library you're using so can't link to any docs about the exact details

digital ibex
#

oki, thanks

#

ye, vanilla js

#

wait, ejs is vanilla js with html anyways

#

๐Ÿ—ฟ

#

lol

#

i looked at that before but im confused

#

wait nvm

#

how would i like

#

make another text appear now? i got ```js
button.addEventListener('click', (event) => {
// what do i do here?
});

honest perch
#

@earnest phoenix <client>.guilds.cache.size

#

for d.js

warm maple
#
let {Client} = require("discord.js-commando");
const { ErelaClient }  = require('erela.js')
const client = new Client()

module.exports = function() {

console.log(`Logged in as ${client.user.tag}!`); //log when the bot is ready to be used
console.log('ready')
    client.music = new ErelaClient(client, [
        {
            host: "localhost",
            port: 7500,
            password: "anotherday"
        }
    ])
    client.musicPlayers = new Map();
    console.log('Ready!');
    client.music.on("nodeConnect", node => console.log("new node connected"));
    client.music.on("nodeError", (node, error) => console.log(`Node error: ${error.message}`));
    client.music.on("trackStart", (player, track) => player.textChannel.send(`Now playing: ${track.title}`));
    client.music.on("queueEnd", player => {
        player.textChannel.send("Queue has ended.")
        client.music.players.destroy(player.guild.id);
    });
};```
 what have i done wrong? it never says "new node connected"
thats my ready.js
digital ibex
#

what debugging have you done?

#

does anything log at all?

earnest phoenix
#

how do i make a command that reacts to your message

sudden geyser
#

NikM is client the actual client you're using, and not just some duplicate? What file is this?

digital ibex
warm maple
#

NikM is client the actual client you're using, and not just some duplicate? What file is this?
@sudden geyser it's ready.js

#

does anything log at all?
@digital ibex it logs that the bot has been turned on

#

But nothing else

sudden geyser
#

If this is your ready file, are you sure client points to your client instance. Would it not come from another file?

digital ibex
#

i don't know what where it logs when the bot has turned on

warm maple
#

It logs it in the console

digital ibex
#

yes

#

but where r u doing that in ur code

hardy vector
#

im a dev for NikM's bot as well

sudden geyser
#

okay.

digital ibex
#

good for u

hardy vector
#

i was going to say my question after but i misclicked

#

oops

#

ok but it wont log new node connected

#

so

warm maple
#

console.log(`logged in as ${client.user.tag}!

#

This is the log

digital ibex
#

ok, does it log ready which is underneath?

warm maple
#

Nope

#

It does not

digital ibex
#

u've got a few messages where it says ready, which one doesn't log?

warm maple
#

Only thing it logs is "logged in as Nik's Utilities#2932"

#

Nothing else

digital ibex
#

what does ur message event look like?

#

near the top

hardy vector
#

what message event isnt an on ready event that triggers it?

digital ibex
#

yes, but it could be breaking there

#

you're not doing anything, why is it suddenly breaking

#

its most likely ur message event

hardy vector
#

ok

torn ravine
#

how would I get an id using command

#

im trying to implement bot-banning which basically disallows the use of a bot from a member

#

going to be using a db to store times and ID's

#

it'll look something like

midnight blaze
#

xd

#

depends how you save your database information

torn ravine
#
ID: <ID>
Time Initiated: <Time>
Reason: <Reason>
}
midnight blaze
#

what exactly are you trying to do, I am not quite understanding you

torn ravine
#

Bot banning

midnight blaze
#

ok..

torn ravine
#

not allowing users to execute commands

midnight blaze
#

so a simple command to ban with a bot

torn ravine
#

no

warm maple
#

He's making a blacklist cmd

#

To blacklist users from the bot

#

I think

midnight blaze
#

aha

#

that makes more sense, I wasnt sure what he was trying to do

torn ravine
#

yea NikM gets it

#

I'll use time initiated to determine how much time in the blacklist

halcyon ember
#

I have this thing thats getting the user's balance from a mysql using but the balance is retuning as undefined

#
    let coin
    coin = args[0]
    const embed = new Discord.MessageEmbed()
      .setColor(color)
      .setTitle(message.author.username+"'s "+pairs[coin].name+" Balance")
      .addField(pairs[coin].emote+" "+pairs[coin].name, balance)
    message.channel.send(embed)```
torn ravine
#

example if I was banned at 12 AM and the current time is 4 am I was banned for 5 hours

earnest phoenix
#
async def whois(ctx, *, user: discord.Member = None):
    if user is None:
        user = ctx.author      
    date_format = "%a, %d %b %Y, %I:%M %p"
    embed = discord.Embed(color=000000)
    embed.set_author(name=str(user), icon_url=user.avatar_url)
    embed.add_field(name="Joined", value=user.joined_at.strftime(date_format), inline=True)
    embed.add_field(name='โ €', value='โ €')
    embed.add_field(name="Registered", value=user.created_at.strftime(date_format), inline=True)
    if len(user.roles) > 0:
        embed.add_field(name="Roles [0]", value='None', inline=False)
    else:
        role_string = ' '.join([r.mention for r in user.roles][1:])
        embed.add_field(name="Roles [{}]".format(len(user.roles)-1), value=role_string, inline=False)       
    embed.set_footer(text=f'ID: {user.id}')
    return await ctx.send(embed=embed)```
#

why does it keep saying Roles [0] even tho i have a role

digital ibex
#

use setTimeout @torn ravine

torn ravine
#

I wanna make it server specific

digital ibex
#
// ur blacklist stuff here
setTimeout(() => {
// unblacklist stuff here
}, /* time in milliseconds */);
#

blacklist servers?

torn ravine
#

kinda. blacklist certain members in certain servers

digital ibex
#

so in one server they can blacklisted and the other they're not?

#

or?

torn ravine
#

ya

#

basically

digital ibex
#

how r u storing ur blacklisted users?

#

in an array?

#

or

gritty bolt
#

I want to preform a function for each document stored in my mongodb database. I'm using mongoose and discordjs and this is what I have so far, but I'm not sure where to go next. Can anyone help?

db.once('open', function() {
    var serverDocument = Server({ name: 'serverDocuments'});
    var filter = {};
    var serverArray = serverDocument.find({filter}).lean().exec(function (err, docs) {
        docs.forEach()
    });
});```
#
db.once('open', function() {
        var serverSchema = new mongoose.Schema({
            name: guildID,
            channel: channelID,
            zones: null
        });
        var serverModel = mongoose.model('serverDocuments', serverSchema);
        var serverDocument = Server({ name: 'serverDocuments'});
        console.log(serverDocument.name);
        serverDocument.save(function (err) {
            if(err) return console.error(err);
        });```
dusty onyx
#

heyo, how can i send a gif on discord.py? i used the code with `open('fd to gif') as f:
picture = discord.File(f)

        await message.channel.send(picture)` but my bot returned <discord.file.File object at 0x04A800C8> instead of the gif :(
earnest phoenix
#
async def whois(ctx, *, member : discord.Member = None):
    if member is None:
        member = ctx.author     
    date_format = "%a, %d %b %Y, %I:%M %p"
    embed = discord.Embed(color=000000)
    embed.set_author(name=str(member), icon_url=member.avatar_url)
    embed.add_field(name="Joined", value=member.joined_at.strftime(date_format), inline=True)
    embed.add_field(name='โ €', value='โ €')
    embed.add_field(name="Registered", value=member.created_at.strftime(date_format), inline=True)
    if len(member.roles) < 1:
        embed.add_field(name='Roles [0]', value='None', inline=False)
    else:
        role_string = ' '.join([r.mention for r in member.roles][1:])
        embed.add_field(name="Roles [{}]".format(len(member.roles)-1), value=role_string, inline=False)      
    embed.set_footer(text=f'ID: {member.id}')
    await ctx.send(embed=embed)```
#

In embed.fields.3.value: This field is required < error

#

maybe you need to convert it into a string

#

the 3rd embed.add_field is the problem

#

i tried that

#

theres nothing wrong

#

just value=str(<membercreatedat>)

#

if i have a role it works

#

if i dont it doesnt

#

tf

#

right

#

its pissing me off

#

the code is right

#

i cannot see 1 single error

#

@slender thistle

#

what do you think about this

#

@earnest phoenix wanna hear what the fucking problem was

#

i legit just switched the if and else around and made < 1 to > 1 and it worked

solar quarry
#

Discord isn't generating me a new token for my bot that is valid. Because I go to the website generate a token copy it put it in my config for my bot and then the console says invalid token.

#

Is the a way to fix this or would I need to contact discord

earnest phoenix
#

are you sure it's the token and not the secret

solar quarry
#

Yes it is the token

earnest phoenix
#

then you're not reading your config correctly

summer torrent
#

can be a stupid answer, but are you sure you saved the file?

solar quarry
#

Yes I am because it was working before then it just stopped I didn't change the code and then I go to start it again it says invalid token I get a new token from discord invalid token again

clever garnet
#

im using discord.js

        member.kick('Test')
    }```
it doesnt work but no error
solar quarry
#

And I know the config file is working properly because it checks for the file when I start it

clever garnet
#

someone help me

summer torrent
#

@clever garnet use !== instead of !member.id

clever garnet
#

wdym

summer torrent
clever garnet
#

ok im tryng it

solar quarry
#

Does anyone know why my tokens just stopped working

brittle mica
#

try

#

regening it

torn ravine
#

forgot what i was told

#

but I use process.exit to stop my bot but how do I restart

stark compass
#

can i pay someone to make a bot for me?

#

just @me and ill get back to you i guess

gaunt blade
#

I use ```js
client.dbl = new DBL('my token here yes', { webhookPort: 5000, webhookAuth: 'password' }, client);
client.dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
client.dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});

#

and votes does not work

#

any help?

#

my token is corrct, I am not stupid either, i double checked

#

let me try the more examples part

ocean socket
#

Uhm, I have a question, so my bot showed some errors. For some reason, it couldn't find the .guild attribute of a message object. The only way this made sense to me, was that someone must have DMd my bot. Is that right? Or do you guys maybe know a different reason?

earnest phoenix
#

most likely, yes

ocean socket
#

well now I need a way to handle dms..... Oh god

earnest phoenix
#

Hey, what would be the best node.js text editor for the Raspberry Pi?
@earnest phoenix google is your friend

queen needle
#
if (message.content.startsWith(prefix + "ss")) {
        const puppeteer = require("puppeteer");

       
          const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
          const page = await browser.newPage();
          await page.goto("https://example.com");
         let fishq = await page.screenshot({ path: "example.png" });
 message.channel.send(
          new Discord.MessageEmbed()
            .setDescription("welcome background set to")
            .setImage("example.png")
        );
          await browser.close();
       
      }```
i keep getting the error invalid form body
digital ibex
#

whats the error stack

queen needle
#

wdym?

digital ibex
#

the full error

queen needle
#
DiscordAPIError: Invalid Form Body
embed.image.url: Not a well formed URL.```
digital ibex
#

theres ur answer

#

the image for the embed needs to be a url

queen needle
#

yeah but how would i form the url well

#

how would i get the url when it creates the path example.png

digital ibex
#

example.png is not a url first of all

queen needle
#

yeah its the image file name

digital ibex
queen needle
#

ill try it

#

it sent the embed just there wasnt a image

digital ibex
#

because the image doesn't exist

queen needle
#

oh

#

how could i make the image exist>

digital ibex
#

it doesn't work like that

queen needle
#

nvm

#

yeah

celest basin
#

hi

#

What is the best database?

steel drum
#

all of them

pale vessel
#

not json

#

(it's not even a db)

steel drum
#

json isnt a database

#

yea

celest basin
#

@pale vessel I'm sure not JSON

steel drum
#

its a format

celest basin
#

yp

pale vessel
#

notation*

#

mongo and postgres are good

steel drum
#

@celest basin i personally use mariadb but its fine to use mysql or mongo

#

or postgres

pale vessel
#

i use mysql. planning to move to postgres one day

summer torrent
#

i am satisfied with mongo

brittle mica
#

i dont have a dbl

celest basin
#

@steel drum Thanks for ur sug

steel drum
#

np

#

and @pale vessel

#

json is both a format and notation

pale vessel
#

cool

dapper basin
#

Is it fine to use SQLite??

#

Lmao

summer torrent
#

ยฏ_(ใƒ„)_/ยฏ

pale vessel
#

sqlite is not bad

dapper basin
#

Yeah

#

I haven't had any issues with it so far

#

Don't know what would happen if the bot was added to a thousand servers, though

steel drum
#

id say start off with mysql or smth similar from the start if you can, so you don't have to handle that later on

quartz kindle
#

sqlite is more than enough for 99% of bots out there

#

the only reason to go from sqlite into a database server is when your bot needs to scale across multiple machines

dapper basin
#

oh yeah

#

like shards

quartz kindle
#

or if your bot heavily relies on writing to the database

#

instead of reading

digital ibex
#

is sqlite better than mongodb for bots?

dapper basin
#

sqlite is a tiny DB based on files

summer torrent
#

mongo is noSQL

dapper basin
#

to put it into perspective, Discord (the platform) was based on Mongo in the beginning

digital ibex
#

ye, but which one is better for bots tho?

summer torrent
#

Discord using Scylla (nosql)

amber fractal
#

sqlite and mongo arent even comparable

quartz kindle
#

isnt discord using cassandra?

amber fractal
#

not even the same type of db

dapper basin
#

they migrated it in like 2016

summer torrent
#

they switched to scylla @quartz kindle

quartz kindle
#

when?

dapper basin
#

oh

amber fractal
#

mongo is scalable

#

idk if sqlite is good at scaling, mainly because I dont use sql

quartz kindle
#

sqlite scaling is linked to how your process scales

#

since its built into your process

#

the only downfall of sqlite is that it cannot do concurrent writes to the same database

#

but it can do concurrent reads

dapper basin
#

lol

quartz kindle
#

thanks

dapper basin
#

with the amount of messages sent per day

quartz kindle
summer torrent
digital ibex
#

hi, with bulma, how can i split these into half the page, like instead of it showing on 3 lines, show it on 2

#

basically instead of hello world \n hello world \n hello world do hello world | hello world \n hello world

pale vessel
digital ibex
#

im using components/message

pale vessel
#

should work the same no?

#

they're just columns

digital ibex
#

oh

#

okie

queen needle
#
  let role = db.fetch(`role_${member.guild.id}`);
  if (!role) return;
  let ffff = member.guild.roles.cache.get(role);
  member.addRole(ffff);```
#

im trying to add role on join by role id and i keep getting the error member.addRole is not a function

quartz kindle
#

member.roles.add()

queen needle
#

thank you

digital ibex
#

how would i add a picture onto it? liek uhh

#

oh wait, they have that

#

nvm

zenith terrace
#

@quartz kindle tim tim

quartz kindle
#

@_@

zenith terrace
#

hi

digital ibex
#

with bulma or something else idk

pale vessel
#

use css

#

if you're using bulma, you should be able to use a little css

digital ibex
#

yeah, but how would the css look like?

#

im confused

#

ah ha!

#

i got it, nvm

#

i used height

zenith terrace
#

oof

pale vessel
#

quite literally yes

#

but it won't detect it in code without some additions

torn ravine
#

I need to know how to start my bot back when I use process.exit to start it

amber fractal
#

You cant execute any code after process.exit() unless you're listening for exit/beforeExit.

#

Easiest thing honestly would be to use a process manager that auto resarts on stop

torn ravine
#

heroku does automatically restart but its rate limited

#

I can only do it so many times before it stops automatically restarting

lyric mountain
#

It tries 3 times iirc

#

But as long as it successfully boots up before 4th attempt it'll restart automatically

digital ibex
#

how can i disable intents in eris?

#

i see nothing in the clients options

coarse topaz
#

Hello, I've tried many ways of doing this command but I can't get it... Could someone please help me to solve it?
if (message.content === `mm!dm`) { if (message.member && message.member.roles.cache.has(roles[0]) || message.member.roles.cache.has(roles[1])) { let args1 = message.content.split(" "); let id = args1[1]; let content = args1.slice(2).join(" "); bot.users.cache.get(id).send(content); } }

lyric mountain
#

What's the issue

coarse topaz
#

It just doesn't send the content :/

#

There aren't errors being showed in logs

#

It just doesn't send it, so I don't know what's wrong

digital ibex
#

ur chekcing if the message is mm!dm nothing more, u need to check if it starts with mm!dm

earnest phoenix
#

or just make a proper command handler

digital ibex
#

thats not going to change anything

earnest phoenix
#

it will fix issues regarding making wrong code that will not run when user input is provided

digital ibex
#

unless u tell it to, in his case he isn't, it won't

earnest phoenix
#

generally when I see message.content.startsWith("<prefix><command>") or message.content == "<prefix><command>" I gag

#

ngl

digital ibex
#

when i see people use d.js i gag

earnest phoenix
#

eris is life

digital ibex
#

troo

coarse topaz
#

ur chekcing if the message is mm!dm nothing more, u need to check if it starts with mm!dm
@digital ibex Man, thank you, I was too blind x)
It's solved now, really thank you GWjiangLoveHeart

earnest phoenix
digital ibex
#

๐Ÿ‘

calm lantern
forest mirage
#

you spelled deleted wrong

calm lantern
#

OH

#

sdsjkds

#

okay it wasn't that

#

at lest it evicted more errors

earnest phoenix
#

yall

#

debug

topaz fjord
#

no u

#

ah yes

#

ty discord

earnest phoenix
#

lol

topaz fjord
#

"yesterday at 11:06 PM"

#

windows decided to fuck with date again

earnest phoenix
#

we can't evaluate and run your code for you with the same factors, debug your code, it's meant to be done when you get errors and it's meant to test your code

#

it's such a huge asset and people choose not to do it and instead go "thiS Not WORK HELP"

#

literally why

outer niche
#
    async def hhelp(self, ctx):
        author = ctx.message.author
        with open ('prefixes.json') as f:
            prefixes = json.load(f)

        em = discord.Embed(title="Tickets Help", description="", color=0xC110B1)
        em.add_field(name="`{prefixes[str(ctx.guild.id)]}music`", value="Music commands")
        em.add_field(name="`!admin`", value="Admin commands")
        em.add_field(name="`!fun`", value="Fun commands")
        em.add_field(name="`!picture`", value="List of pictures")
        em.add_field(name="`!utility`", value="List of utility commands")
        em.add_field(name="`!botutility`", value="List of bot utility commands")
        em.set_footer(text="Echo discord bot | Tipe !help_(command) for help or usage on a command")
        await ctx.send(embed=em)``` So on the one line where it says `{prefixes[str(ctx.guild.id)]}` I am trying to have the prefix returned from the JSON file right there that cannot seem to figure it out
slender thistle
#

You're not formatting it

torn ravine
#

I'll add my bot back when everything's settled and I get some sweet-looking gfx for it

outer niche
#

How would I format that

slender thistle
#

f-strings or .format

outer niche
#

Can you use F strings in embeds though

slender thistle
#

Why not

outer niche
#

I didn't know you could that makes life 10 times easier

slender thistle
#

You're literally formatting a string and then send it

outer niche
#

Oof

#

You right

slender thistle
#

There's no difference

outer niche
#

Yeah for some reason my brain said you should not do that because it's inside of a embed

earnest phoenix
#

Is it possible so send a user a DM directly from the shard file? I am using eris sharder. Trying to implement an auto vote rewards feature.

silent berry
#

How do I identify memory leaks within my code?

#

Pls ping me

coarse topaz
#

Hey, I've gotten another problem x)

  let args1 = message.content.split(" ");
  let id = args1[1];
  const user = args1[1];
  let content = args1.slice(2).join(" ");
  bot.users.cache.get(id).send(content);
    message.channel.send(`Message to ${user} Successfully Sent! โœ…`);
  }``` How can I get `${user}`'s username + tag? I'm only getting the ID right now :/
earnest phoenix
#

do ${user.tag}

#

and thats it

coarse topaz
#

No, it says "undefined"

#

x)

earnest phoenix
#

what library?

#

oh nvm ik now

coarse topaz
#

Discord.js

topaz fjord
#

well uh that makes sense

earnest phoenix
#

user is not even an user object

topaz fjord
#

^

coarse topaz
#

Exactly, I'm aware of it hehe

#

But how could I fix it then?

earnest phoenix
#

maybe turn it into one by using client.users.get(args[0])?

#

i mean args[1]

#

like ```js
let user = client.users.get(args[1]);

coarse topaz
#

Ok..

#

Let me try, thanks

earnest phoenix
#

๐Ÿ‘ you're welcome

earnest phoenix
#

Is it possible to fetch a user directly from the ClusterManager of eris-sharder? The documentation is confusing.

#

Hey! Is heroku a bad hosting?

halcyon ember
#

Im using discordjs v12 how can I check if the bot has the proper permission to send embeds in a channel

dawn trout
#

Hello guys

#

why my

#

c words error

#

can anyone help check

fiery stream
#

A!userinfo

torn ravine
#

@fiery stream wrong channel

fiery stream
#

sorry

#

i forgot

torn ravine
#

@dawn trout explain

halcyon ember
#

I have this

#
        getBal()
    } catch (error) {
    message.channel.send(message.author.username+"'s "+pairs[coin].name+" Balance\n**"+balance[0][coin]+'**')
    message.channel.send("I don't have the permission to send an embed in this channel. Please notify the server administrator to toggle the 'Embed Links' permission for me")
}```
#

theres the discordapi error no permissions

#

but it isnt catching

sudden geyser
#

is getBal asynchronous?

halcyon ember
#

yep

torn ravine
#

use return

sudden geyser
#

then await it

halcyon ember
#

await catch (error)?

sudden geyser
#

No, await the function call.

halcyon ember
#

await getBal()?

sudden geyser
#

yeah

halcyon ember
#

kk

#

thanks

#

wait

#

it says await is only in async function

sudden geyser
#

The error is self-explanatory. You need to mark the function as async (aka the function where you have that try {...} catch (...) {...} statement).

halcyon ember
#

async try?

dawn trout
sudden geyser
#

Did you try hovering over the squiggly red line? You're missing a comma.

dawn trout
#

can you mention where the comma

#

Ohh

#

Thanks

#

for helping

fiery stream
#

ayy

#

how do i check who is in what hypersquad

#

py thx

#
AttributeError: 'Member' object has no attribute 'hypesquad_houses'``` can anybody tell me how to fetch hypesquad house
#

thx very much

#

its quite annoying

earnest phoenix
#

stop making up your own properties lol

#

check the docs

dawn trout
#

Can anyone make me a help command

#

i will appreciate

#

it

earnest phoenix
#

for a price

#

is rethink deprecated?

earnest phoenix
#

can someone help me

slender thistle
#

-ask2ask

gilded plankBOT
#

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

earnest phoenix
#

ok my question is

#

i got a rps command

#

and the bots runs up

#

but does nothing

#

command doesnt work

#

here is the script

#

    if (message.author.bot) return;
    if (message.content.indexOf(prefix) !== 0) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();

    if (command === `${prefix}rps`) {
        let replies = ['rock', 'paper', 'scissors'];
        let result = Math.floor((Math.random() * replies.length));

        let uReply = args[0];
        if (!uReply) return message.channel.send(`Please play with one of these responses: \`${replies.join(', ')}\``);
        if (!replies.includes(uReply)) return message.channel.send(`Only these responses are accepted: \`${replies.join(', ')}\``);

        if (replies[result] === uReply) {
            console.log(replies[result]);
            return message.channel.send('It\'s a tie! We had the same choice.');
        } else if (uReply === 'rock') {
            console.log(replies[result]);
            if (replies[result] === 'paper') return message.channel.send('I won!');
            else return message.channel.send('You won!');
        } else if (uReply === 'scissors') {
            console.log(replies[result]);
            if (replies[result] === 'rock') return message.channel.send('I won!');
            else return message.channel.send('You won!');
        } else if (uReply === 'paper') {
            console.log(replies[result]);
            if (replies[result] === 'scissors') return message.channel.send('I won!');
            else return message.channel.send('You won!');
        }
    }
});```
balmy knoll
#

In my serverinfo command, I can see the list of server roles via this guild.roles.cache.map(r => r).join(', '). The only problem is that they are not shown in an orderly way, how can I order them?

austere gale
#

hello

earnest phoenix
#

hello

austere gale
#

`module.exports = (client,message,args) =>{
const voiceChannel = message.member.voice;

    voiceChannel.join()
    .then(connection => {
        connection.voice.setSelfDeaf(true);
    }).catch(console.error);

}`

#

.

#

its causing an error in server.js

#

and idk what to do to fix that

#

smh my internet is so shit rn

turbid bough
#

it is your bad code

#

you might be missing some more }'s

earnest phoenix
#

more }

turbid bough
#

but send the whole js file if you can to us

#

instead of a few lines

#

cause the one you sent us is valid

earnest phoenix
balmy knoll
#

In my serverinfo command, I can see the list of server roles via this guild.roles.cache.map(r => r).join(', '). The only problem is that they are not shown in an orderly way, how can I order them?

turbid bough
#

never used code block in a description

#

not sure if it works

#

but

#

```language
code
```

slender thistle
#

It works

pale vessel
#

lol

turbid bough
#

ok, that is good to know

#

???

flint mulch
#

Didn't you asked how to order the roles?

turbid bough
#

is that a question of yours?

#

no?

slender thistle
#

Refer to Simo's message

flint mulch
#

oh lol

#

im dumb haha

#

@balmy knoll Discord.Util.discordSort(guild.roles.cache) will order the roles like shown in the server settings :D

wanton nova
#

ok so really stupid question, I have an API that returns a 0x color in a string, and I need to get the raw 0x of that. Is there any way in JS to do this? I tried String.raw but it still seemed to be a string...

#

(also i said 0x because im not sure what they are called)

balmy knoll
#

How can i remove the everyone role from the guild.roles.cache collection?

slender thistle
#

In .map, put a condition

spice smelt
#

~~Hi. I'm trying to get an image from a private API of a service that I use. The URL looks like that: ```
//doc1.ecoledirecte.com/PhotoEleves/01234567890123456789_123456789.jpg

By placing `https:` before the text, I've been able to see the image 1 time. But then, it disappeared and left a 404 Not Found code. I haven't found any token required. Do you have any idea why this acts that weird?~~
#

Since it acts pretty randomly, I guess it's just a very big ratelimit.

turbid bough
#

404 shouldnt be a ratelimit response

#

the image does not show at all for me

restive furnace
#

^

spice smelt
#

404 shouldnt be a ratelimit response
@turbid bough yes, it seems you're right, but it still doesn't explain why I've been able to see it. Moreover, on the website of the service I was talking about, the URL remains the same, and the image appears.

turbid bough
#

it might be cache

#

and then it got removed at the same time the cache was still active

#

hmm.

spice smelt
#

yea thats weird

#

what does the // without the protocol mean in the beginning of the url? haven't found anything on internet

#

is that relative to another url?

turbid bough
#

http:// ?

#

protocol://

restive furnace
#

wss:// like on websocketa

turbid bough
#

ftp://

spice smelt
#

it's none of these

turbid bough
#

??

#

you are using the https:// protocol

restive furnace
#

https:// = http-secure

spice smelt
#

then? wdym

#

i also tried http://

restive furnace
#

404 = non-existent file/thing

turbid bough
spice smelt
#

Thanks, I already knew that. I also know what is a protocol, thanks for your help anyway.

EDIT: the access to the image was restricted by cookies.

ancient sand
#

node . problem with VSC

#

can't start host for test bot

#

Like a module host not found

#

anybody fixes that

ornate isle
#

Can I know who invited my bot?

spice smelt
#

regarding my previous question, I would have liked to know if it's possible (through a library or anything else) to store cookies like if the client was a browser.

wanton nova
#

@ornate isle guildCreate event
@ancient sand what is your main file named? if it isnt index.js, then try doing npm init, accept everything, go to the new file it created (package.json), and change the main file to whatever your main file is

restive furnace
#

actually just do npm init -y

wanton nova
#

wait

#

what does -y do?

restive furnace
#

u dont need to answer yes to everything

#

it just makes package.json with default values

wanton nova
#

ah

ancient sand
#

@restive furnace thanks bro โค๏ธ

#

i do just npm init

mossy vine
#

showing the error might be helpful

cinder patio
#

you managed to show everything but the error message

stuck scaffold
#

oh

earnest phoenix
#

(node:8168) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

const { MessageEmbed } = require("discord.js");

module.exports = async (oldMessage, newMessage) => {


    const db = require("quick.db");

    let chx = db.get(`LogChannel_${oldMessage.guild.id}`);
    let logchannel = oldMessage.guild.channels.cache.get(chx);

    if (!logchannel || !chx) return;

    if (chx === null) {
        return;
    }

    const p = new MessageEmbed()
        .setColor("#ff9900")
        .setTitle("Message Delete")
        .setDescription(`๐Ÿ› ๏ธ **${oldMessage.author} has edited a message in <#${oldMessage.channel.id}> `)
        .setFooter("Logging System || Made by Sabin")
        .addField("Old Message", oldMessage.content, true)
        .addField("New Message", newMessage.content, true);

    logchannel.send(p);

}
#

help ?

cinder patio
#

there isn't a guild property on the message if it was edited in DMs

#

make sure to ignore messages edited in DMs

earnest phoenix
#

@cinder patio it wasn't it was edited in guild, but i want to say one more thing, after i edited the message, the bot still sent the message on the channel i set

#

so why i got the error if everything works ?

dawn trout
#

Help me

#

i got a problem

#

Anyone?

cinder patio
#

just ask

lofty lagoon
#
(Use `node --trace-warnings ...` to show where the warning was created)```
how I can fix that warning?
cinder patio
#

no. ask here

#

@dawn trout

bitter sundial
#

@lofty lagoon do not create a new listener per command

pale vessel
#

b-but Luca!

lofty lagoon
#

but how I create a command if I dont create a new listener

bitter sundial
#

you use one listener to handle all commands

lofty lagoon
#

GWchadMEGATHINK :

bitter sundial
#

you have an if statement inside each listener, right?

#

you can keep that chain going with else if statements

lofty lagoon
#

yes

bitter sundial
#
if (a == 1) {

} else if (a == 2) {

}
lofty lagoon
#

oh use that

#

ok

#

why it's say



SyntaxError: Unexpected end of input
    at Object.compileFunction (vm.js:344:18)
    at wrapSafe (internal/modules/cjs/loader.js:1106:15)
    at Module._compile (internal/modules/cjs/loader.js:1140:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
#

wait

earnest phoenix
#

How can I make sure someone has put a prefix and then a second argument after that prefix?

dawn trout
#

@cinder patio There are a lot

#

idk

#

how to fix

#

i just look youtube

quartz kindle
#

@lofty lagoon that means your brackets are wrong, either missing a } or a ) or having an extra ) or a } somewhere

flint axle
#

hey
are there any ways to counter command spamm through the discord.py api like a special func or class? or i have to right my own spam filters

quartz kindle
#

pretty sure you have to write your own

modest maple
#

there is a cooldown deco but yeah pretty much

flint axle
#

yea i found it

#

thanks

earnest phoenix
#

How do you set off a command if a message starts with something and doesn't matter what else is in the message

quartz kindle
#

assuming you're using js

earnest phoenix
#

yes

#

how do i delete a prefix from a message

pure lion
#

Meaning?

#

As in get the message contents and remove the prefix?

earnest phoenix
#

yes

pure lion
#

message.content.slice(prefix.length)

#

Or something like that

earnest phoenix
#

what is wrong with this? client.on('message', message => {
if (message.content.startsWith('-poll')) {
return message.content.slice(poll_p.length);
};
});

pale vessel
#

what are you doing

#

it doesn't do anything

earnest phoenix
#

i want to make it so if you put -poll and then something it deletes -poll at the start

dusky crater
#

Unable to change my bot name from developer portal !!

#

Tried like 5 times but name doesn't changed while I can change name of my other bots

opaque seal
#

Is there a big difference between creating an discord embed object as a client property and creating a new discord embed every time I need one? Performance wise

mossy vine
#

@dusky crater are you sure you are changing the bot name and not the application name? also restart the bot to see name change

dusky crater
#

@mossy vine let me try

#

@mossy vine hey man the bot name in discord is not getting changed whereas the application name in developer portal is already changed !

#

Oh yeah lol , am dumb

#

Thanks for help guys

quartz kindle
#

@opaque seal you mean like doing client.embed = new MessageEmbed()?

#

and then using client.embed every time?

slender thistle
#

Wouldn't the embed need to be reset each time it's supposed to be used then?

quartz kindle
#

well if he always sets the same fields every time, it should be fine

#

but yeah, doing it like that will always mean your embed is not clean

plucky harness
#

any way to add alternative to command name like !example and !ex do same thing

glacial thicket
slender thistle
#

if cmd == 'example' || cmd == 'ex'

stuck scaffold
quartz kindle
#

failed to connect to server

plucky harness
#

what if its in a cog

slender thistle
plucky harness
#

ye

slender thistle
#

commands extension?

plucky harness
#

yes

opaque seal
#

@opaque seal you mean like doing client.embed = new MessageEmbed()?
@quartz kindle yes

slender thistle
#

aliases kwarg in command decorator

stuck scaffold
#

failed to connect to server
yes ๐Ÿค”

opaque seal
#

Cause I have a set of embeds that gets sent many times @quartz kindle

modest maple
#

command() has a aliases kwarg @plucky harness

plucky harness
#

it uses function names as command name

modest maple
#

and also a name kwarg

plucky harness
#

oh

#

alright

modest maple
quartz kindle
#

@opaque seal if you always make sure there is no leftover dirt remaining in the embed from older iterations, then sure why not

#

there will be some minimal performance gains

plucky harness
#

i see ty ๐Ÿ™‚

stuck scaffold
#

failed to connect to server
@quartz kindle how can i fix ๐Ÿค”

opaque seal
#

@opaque seal if you always make sure there is no leftover dirt remaining in the embed from older iterations, then sure why not
what do you mean by that?

quartz kindle
#

the embed will never reset

opaque seal
#

oh right

quartz kindle
#

it will always remember its fields and values

opaque seal
#

yeah not a huge deal seen that I need same title and footer averytime, and I just change it's description

quartz kindle
#

sure

opaque seal
#

thx

stuck scaffold
earnest phoenix
#

check your url

quartz kindle
#

you're trying to open too many connections

modest maple
#

oof

earnest phoenix
#

lol

restive furnace
#

whats best way to pass variables to other file? i have these const { Users, CurrencyShop } = require('./dbObjects'); const { Op } = require('sequelize'); and i would need them in other file too? i thinked just client.variable, but i am not sure is it the best way?

summer torrent
#

client.variable is a good idea

quartz kindle
#

as long as you dont accidentally replace some existing client namespace lmao

restive furnace
#

okay thanks :D

stuck scaffold
#

I use mongoose.connect on each models

earnest phoenix
#

How do u use the bot

#

guys

#
const Discord = require("discord.js");
const a = require("../ayarlar.json")

module.exports.run = async (client, message, args) => {
    try {
        await message.channel.send(`Komutlar: \n${client.commands.map(props => `\`!${props.help.name}\``).join(" | ")}`);
    } catch (e) { 
        throw e;
    }
}

module.exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ["commands","yardฤฑm","help"],
  permLevel: 0
};

module.exports.help = {
  name: 'komutlar',
  description: 'Botta bulunan tรผm komutlarฤฑ gรถsterir',
  usage: 'komutlar'
};//Dcs Ekibi
   
#

this is what help command im using now

stuck scaffold
#

I use mongoose.connect on each models
because of that? @quartz kindle

earnest phoenix
#
const Discord = require("discord.js");
const a = require("../ayarlar.json")

module.exports.run = async (client, message, args) => {
    try {
        await message.channel.send(`Komutlar: \n${client.commands.map(props => `\`!${props.help.name}\``).join(" | ")}`);
    } catch (e) { 
        throw e;
    }
}

module.exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ["commands","yardฤฑm","help"],
  permLevel: 0
};

module.exports.help = {
  name: 'komutlar',
  description: 'Botta bulunan tรผm komutlarฤฑ gรถsterir',
  usage: 'komutlar'
};//Dcs Ekibi
   
summer torrent
#

?????

earnest phoenix
#

how can i make it embedded?

summer torrent
dusk cape
#

s

plucky harness
#

@commands.command(name ="challenge" or "ch") is this supposed to work as challenge alternative

#

py

earnest phoenix
#

@summer torrent aga biliyorum

#

embed yapmayida

summer torrent
#

english only

earnest phoenix
#

@summer torrent dude i know how to make an embed

#

but

slender thistle
#

@plucky harness No, use the aliases argument

summer torrent
#

so

slender thistle
#

Make it a list of command aliases

earnest phoenix
#

like i want it to use all of komutlar

#

@slender thistle English only in here?

opaque seal
#

yes

slender thistle
#

Yes

earnest phoenix
#

folder

plucky harness
#

oh

quartz kindle
#

@stuck scaffold i dont use mongoose so idk, but from reading their docs, it seems you're only supposed to connect once in your main file. all your models will inherit this default connection

opaque seal
#

I have this cooldown system:

// Cooldowns
    let cooldowns = client.cooldowns;
    if (!cooldowns.has(command.name)) cooldowns.set(command.name, new Discord.Collection());
    const now = Date.now();
    const timestamps = cooldowns.get(command.name);
    const cooldownAmount = (command.cooldown || 3) * 1000;
    if (timestamps.has(message.author.id)) {
        const expirationTime = timestamps.get(message.author.id) + cooldownAmount;

        if (now < expirationTime) {
            const timeLeft = (expirationTime - now) / 1000;
        }
    }
    timestamps.set(message.author.id, now);
    setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);```
And I need to reset to 3 seconds the cooldown of a command at a certain point of the code, and I tried it like that, but it's not doing it:
```js
const removeCooldown = () => {
            // Remove cooldown
            if(command.cooldown) {
                const cooldownAmount = command.cooldown * 1000;
                let time = now -cooldownAmount + 3000;
                timestamps.set(message.author.id, time);
            }
        }```
earnest phoenix
#

we know

slender thistle
#
@command.command(name="MY_COOL_COMMAND", aliases=["THE_COOLEST_COMMAND_EEE"])
async def yee(self, ctx):
    DO_SOMETHING_COOL()```
modest maple
#

pep8 ree

earnest phoenix
#

english only
@summer torrent i want it caluclate my commands and send it in a embed with

#

/n

slender thistle
#

tf is not complying with pep8 there, var names? :^)

modest maple
#

a function being a contant ๐Ÿค”

slender thistle
#

a what

quartz kindle
#

@earnest phoenix make it read your commands folder and get all file names

summer torrent
#

wdym by "calculate my commands"

earnest phoenix
#

how do i make it

#

im begginer in discord.js and even in javascript

summer torrent
#

did you actually code this thinkw

earnest phoenix
#

yes

#
module.exports.run = async (client, message, args) => {
    try {
        await message.channel.send(`Komutlar: \n${client.commands.map(props => `\`!${props.help.name}\``).join(" | ")}`);
    } catch (e) { //Dcs Ekibi
        throw e;
    }
}
summer torrent
#

if you are a beginner, you can use guides

plucky harness
#

thanks shivaweco. it worked

earnest phoenix
#

if i use the module.exports

#

will it work with embed?

summer torrent
#

I don't understand you

quartz kindle
#

you already have a list of commands in client.commands

#

just put that in an embed

earnest phoenix
#

oh

opaque seal
#

Tim wouldn't it have problems if users type a command that sends an embed to both and it has to modify the embed for each of them at the same time?

#

About my embed thing.

yeah not a huge deal seen that I need same title and footer averytime, and I just change it's description

quartz kindle
#

like you want to send 2 embeds to two different people?

opaque seal
#

yes

#

At the same time

#

And it's the same client.embed

quartz kindle
#

shouldnt be a problem

opaque seal
#

how though?

quartz kindle
#

as long as there are no async functions in between

slender thistle
#

In C#, does SomeArray.Max() raise an exception if SomeArray doesn't contain any elements?

opaque seal
#

as long as there are no async functions in between
What do you mean? My message event file is an async function

quartz kindle
#

js is single threaded and synchronous by default, it cannot ever process multiple things at once

#

if you set the embed description, then send it, there is no way it can do that as the same time for someone else. once you pass it to the send function, it gets serialized and dispatched. only then will javascript be able to process the next chunk of code

opaque seal
#

Right

#

What about the async then?

earnest phoenix
#

@quartz kindle

#
const helpembed = new Discord.RichEmbed()
.setAuthor(message.author.tag, message.author.avatarURL)
.setDescription "Help Commands."
.addField(`${client.commands.map(props => `)
.setColor('RANDOM')
message.channel.send(helpembed)
#

like this?

quartz kindle
#

but if you set the embed description, and then use an async function, and then send, the embed can change in between

opaque seal
#

what about if the embed is IN an async fun?

quartz kindle
#

doesnt matter

opaque seal
#

Ok

earnest phoenix
#

tim like that?

quartz kindle
#

as long as the code itself is sync, it will always be executed sequentially

opaque seal
#

right

#

Thank you for this

#

^^

#

tim like that?
that won't work

earnest phoenix
#

why

quartz kindle
#

@earnest phoenix you map function is broken

opaque seal
#

you need to make a for loop and put each command in a embed field

quartz kindle
#

and fields require a field title

opaque seal
#

remember that there is a max num of fields

#

for embeds

#

I wouldn't do that personally

#

if you have many commands

earnest phoenix
#

i have 18 commands

quartz kindle
#

max fields are 25

earnest phoenix
#

will it work?

quartz kindle
#

it will, but it might not look like what you'd expect

#

also, you need to define a field title

#

you have to do it like this

earnest phoenix
#

i want like that

#

tim can you help me in my server cause i have to try bot

honest perch
#

ToS

earnest phoenix
#

in every command

quartz kindle
#

for that you need to use command categories

#

do you have categories?

earnest phoenix
#

o

opaque seal
#

You can get banned for using 3rd party themes

earnest phoenix
#

no

opaque seal
#

don't post these here

earnest phoenix
#

it is in my own client

#

it dont giving any problem to no one i think

honest perch
#

its still modified

opaque seal
#

It's against discord ToS

quartz kindle
#

no need to witch hunt tho

earnest phoenix
quartz kindle
#

they're doing so at their own risk

earnest phoenix
#

@quartz kindle my commands is like this

opaque seal
#

I'm just telling them, 'cause a mod of this server could ban them from here too

slender thistle
#

We don't ban for that

quartz kindle
#

@earnest phoenix as you can see, in the example you showed, that bot divides commands into categories

earnest phoenix
#

@slender thistle can u look my bot?

#

just saying

opaque seal
#

Follow the Discord Terms of Service
Doesn't this include it?

slender thistle
#

-upto

gilded plankBOT
#

The FAQ clearly states that it will take UP TO 1 week or more.
This does not mean it will take a week and does not mean it will take less than a week.
There is no set time for how long bot approval will take.
There is a queue and you're not first, nor are you last.

earnest phoenix
#

@quartz kindle its in my

quartz kindle
#

you can do so manually or you can define a category in your command files

earnest phoenix
#

komutlar/commands name

#

can i drag in glitch

slender thistle
#

@opaque seal We do not ban for client mods in this server

opaque seal
#

mb then, did not know it

earnest phoenix
#

@quartz kindle then ill download project and categoryze it

#

sorry if my english\ bad.

quartz kindle
#

add categories to your command files

earnest phoenix
#

sure

#

@quartz kindle

#

like this?

quartz kindle
#

that wasnt what i meant, but it works too lol

#

but if you do it that way you need to change your command loader

earnest phoenix
#

oh my friend made the command handler

quartz kindle
#

show your command loader

earnest phoenix
#

whats it name?

quartz kindle
#

should be in your main file

earnest phoenix
#

dm

quartz kindle
#

a block of code that starts with fs.readdir

earnest phoenix
#
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir("./komutlar/", (err, files) => {
  if (err) console.error(err);
  log(`${files.length} komut yรผklenecek.`);
  files.forEach(f => {
    let props = require(`./komutlar/${f}`);
    log(`Yรผklenen komut: ${props.help.name}.`);
    client.commands.set(props.help.name, props);
    props.conf.aliases.forEach(alias => {
      client.aliases.set(alias, props.help.name);
    });
  });
});

quartz kindle
#

yes, this code reads all files in the komutlar folder and adds them as commands

#

but doesnt have anything to process folders inside folders

#

so it will not be able to find your commands now

earnest phoenix
#

how do i fix

quartz kindle
#

either move your commands back to how they were before or change the code to process sub-folders as well

earnest phoenix
#

i'd want to change code

grizzled raven
#

personally categories commands in folders arent cool ๐Ÿ˜ค

quartz kindle
#

fs.readdir("./komutlar", (err,files) => ) this line is reading the contents of the komutlar folders. files is an array of contents

#

so you need to use it again on each result

#

for example

grizzled raven
#

you'd then need to readdir again to get the files of each folder

quartz kindle
#
fs.readdir("./komutlar", (err,results) => {
  results.forEach(result => {
    fs.readdir(`./komutlar/${result}`, (err, files) => {
      files.forEach(file => {
        let props = require(`./komutlar/${result}/${file}`)
      })
    })
  })
})```
#

that would be a very basic example of reading files from subfolders

earnest phoenix
#

where do i put it

quartz kindle
#

look at the code you have and compare it to what i wrote

#

find the differences

earnest phoenix
#

oops error

#

im so retarded

#

๐Ÿคค

opaque seal
earnest phoenix
#

@summer torrent

storm bluff
summer torrent
#

?

earnest phoenix
#

can you look thru dm

storm bluff
#

me??

sinful pier
#

https://sourceb.in/8c35359f44 whats happening here is that when i play a song then play anither it is supposed to add it to the queue but instead it plays it and then after that song is finished it replays it

#

can someone help

quartz kindle
#

first of all, an array length can never be smaller than 0

clever tree
#

I need help xd.
message.author.roles.filter(r => r.name !== '#everyone').map(role => role.name).join(', ')
Discord.js v11.6.4
What is wrong ?

quartz kindle
#

message.author is a User object

#

Users dont have roles

#

you want message.member

clever tree
#

Ah. thx ;)
I will try it out

loud horizon
#

hello

#

can someone tell me

#

how to make your bot repeat a string of messages

#

with certain time intervals

#

like how pokecord worked

#

or slotbot

summer torrent
#

awaiting messages?

clever tree
#

Could someone help me pls ?
var user2 = message.guild.members.get(args[1])
How could i get the member of args[1] to see his roles?

earnest phoenix
#

whatttttTtTtTtTtT?

honest perch
#

capital letter

earnest phoenix
#

wtF.

#

still not solvedf

honest perch
#

error?

earnest phoenix
#

same

honest perch
#

show the file that requires it?

earnest phoenix
devout wagon
#

This is a different error

honest perch
#

./name.json

#

try that

#

or /name.json

earnest phoenix
#

what

#

okay but in what

honest perch
#

the line

earnest phoenix
#

its my settings

honest perch
#

const name = require('./name.json')

earnest phoenix
#

ITS MY SETTINGS

pale vessel
#

it should be /

#

not ./

honest perch
#

/ then

earnest phoenix
#

bro

#

it is my settings

#

ayarlar.json is my settings

honest perch
#

yes

#

i know

#

ffs

earnest phoenix
#

if i remove the command wont work dude

honest perch
#

const ayarlar = require("ayarlar.json")

#

read what we type

earnest phoenix
#

same error

honest perch
#

@pale vessel wouldnt ../../ exit 2 folders

earnest phoenix
#

its

#

subfolder

pale vessel
#

yeah

earnest phoenix
#

folder inside of of a folder

#

like

honest perch
#

const ayarlar = require("../../ayarlar.json")

pale vessel
#

since it's on the root, might as well use /

honest perch
#

try that

earnest phoenix
#

app/komutlar/destek.js

#

now this

honest perch
#

also you should private your project

#

if you are not storing secrets in .env

turbid bough
#

damn how much problems do you have

earnest phoenix
#

cause i did

#

it

#

subfolder

soft oyster
#

Tรผrk var mฤฑ

earnest phoenix
#

english only here

slender thistle
#

-notr

gilded plankBOT
#

ฤฐngilizceden baลŸka dillerde konuลŸmak iรงin #memes-and-media kanalฤฑnฤฑ, top.gg hakkฤฑnda destek almak iรงin #support kanalฤฑnฤฑ kullanฤฑn.

clever tree
#

how could i map all roles except of @.everyone?

earnest phoenix
#
    member.roles.array().filter(a => a.name != "@everyone").forEach(role => {
slender thistle
#

with a condition- spoonfeed

earnest phoenix
#

sorry spoonfeed

#

@quartz kindle

clever tree
#

i have this message.member.roles.map(role => role.name).join(', ')

earnest phoenix
#

help

#

@clever tree no spoonfeed i sent an example

clever tree
#

What is spoonfeed ?

#

xd

earnest phoenix
#

giving sources ready.

#

you have to learn.

turbid bough
#

you are highlighting the wrong code

honest perch
#

@earnest phoenix also private the glitch project ๐Ÿคฆโ€โ™‚๏ธ

earnest phoenix
#

its just a test

#

not my real bot

#

doesnt matter

#

im higlighting true code

turbid bough
#

what is err?

#

console.log(err);

earnest phoenix
#

dont u see the error

turbid bough
#

๐Ÿ˜

earnest phoenix
#

bruj

turbid bough
#

u don't understand

pale vessel
#

private it right NOW

earnest phoenix
#

dude

#

what if i private

#

it is a test

#

and i have backups

pale vessel
#

it doesn't matter

slender thistle
#

And you are leaking credentials for your bot

pale vessel
#

you have to

slender thistle
#

which could be abused

earnest phoenix
#

there

#

files.forEach(file => {
^
TypeError: Cannot read property 'forEach' of undefined
at fs.readdir (/app/bot.js:42:13)
at FSReqWrap.oncomplete (fs.js:135:15)

#

whats this error

turbid bough
#

console.log(err);

#

right before files.forEach

#

cause files is undefined

#

which means something is returning an error

earnest phoenix
turbid bough
#

nonono

#

thats stupid

earnest phoenix
turbid bough
#

๐Ÿ‘

earnest phoenix