#development

1 messages Β· Page 1366 of 1

proper bolt
#

set it on client maybe

#

client.x

blissful coral
#

Ah a collection

cunning timber
#

@cunning timber maybe I can help
@lyric mountain I'm using gradle, java 11, jda4.2.0_209
I found a workaround, because the exception is just thrown sometimes. I do encounter it while downloading an attachment of a message.

young flame
#

my code has been

#

perfected

quartz kindle
#

lmao nice

boreal iron
#

Aw would recommend him to press it if I could... darn

young flame
#

lmao

sharp thicket
#

How can I set a constant for all my files through one file?
@blissful coral well ik everyone will hate me for saying this but global.<variable name> = 'something'

pale vessel
#

please don't do that

blissful coral
#

Bruh yeah not doing that

#

LMAO

#

I already know about that not going to use that bull

earnest phoenix
#

just ask what's bothering you

quick ridge
#

How can I get the photo posted on the channel

#

i remember something
MessageAttachment.first like this

#

help guys pls

grizzled raven
#

if you have subdocuments in a mongoose schema, will virtual getters and setters still work?

proper bolt
#

what is on line 255

#

ok so if you read the error

#

you would know that roleName is undefined

#

so go and see where you are getting it

#

ok so that is undefined

#

so try to fix it

#

sure

earnest phoenix
#

how is this related to development

#

My command system is malfunctioning, I will do !ping and it will not respond, if I do it again it will respond with pong twice and if I do it again its 3x and then 4x and so on and so on, I have pasted the code, please let me know if there's anything obvious you see πŸ˜…


bot.on('message', message =>{
    if(!message.content.startsWith(prefix) || message.author.bot) return;

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

    if(command === 'ping'){
        message.channel.send('pong!');
}
solemn latch
#

thats actually amazing

#

how

#

do you have a message event inside a message event

#

πŸ€”

#

or like creating a new instance somewhere

sudden geyser
#

@earnest phoenix can you share more of your source code.

#

Notice how you didn't include }) at the end, which would close the scope of the bot.on(...) emitter function.

blissful coral
#

the fuck is that guide

#

holy shit

#

Read the real guide @covert gale

#

Yeah you have a shitty guide

#

Yes.

#

That guide is shit

#

Just read the discord.js guide

solemn latch
#

wth is discordio anyway

#

heck its ancient

earnest phoenix
#

Notice how you didn't include }) at the end, which would close the scope of the bot.on(...) emitter function.
@sudden geyser It's there, I had a couple more commands setup so that's why there's no }) included,

const Discord = require('discord.js');
const random = require('random');
const fs = require('fs');
const jsonfile = require('jsonfile');
const bot = new Discord.Client();
const prefix = '!';



bot.on("ready", () => {
    console.log('Bot is online.')
})

bot.on('message', message =>{
    if(!message.content.startsWith(prefix) || message.author.bot) return;

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

    if(command === 'ping'){
        message.channel.send('pong!'); //ping command
   };
})
});

bot.login('SupersSecretCode')
sudden geyser
#

Why is it nested inside the ready event? It's unlikely that's the source of your error, but it's still something to question.

earnest phoenix
#

The ready event is just there I included everything but my XP system, some embeds, and a kick command.

blissful coral
#
const collector = await msg.createReactionCollector({ time: 60000})


 UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is a object and not a function
#

what

#

de

#

fuc

#

nvm

stuck lodge
#

fuck

solemn latch
#

in the directory you did the command in

#

whatever that current directory may be

#

any npm command you do will be the current directory

#

excluding global flags and whatnot

stuck lodge
#

const Discord = require('discord.js');
const random = require('random');
const fs = require('fs');
const jsonfile = require('jsonfile');
const bot = new Discord.Client();
const prefix = '!';

bot.on("ready", () => {
console.log('Bot is online.')
})

bot.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;

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

if(command === 'ping'){
    message.channel.send('pong!'); //ping command

};
})
});

bot.login('SupersSecretCode')

#

const Discord = require('discord.js');
const random = require('random');
const fs = require('fs');
const jsonfile = require('jsonfile');
const bot = new Discord.Client();
const prefix = '!';

bot.on("ready", () => {
console.log('Bot is online.')
})

bot.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;

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

if(command === 'ping'){
    message.channel.send('pong!'); //ping command

};
})
});

bot.login('SupersSecretCode')

faint prism
#

Login twice?

#

Oh double post

#

Is this the example code from d.js with some extra packages?

empty wind
#

What is a shard

quartz kindle
#

a shard is a connection to discord

#

"sharding" a bot means splitting a bot into multiple connections

#

discord requires sharding when you reach 2500 guilds

solemn latch
#

regen that token my man

#

its also in the screenshot

#

well, you require config but never use it

#

prefix is not defined

#

and your code isnt formatted the same as your linter is configured

#

what cant you understand

#

these are plain English things.

#

if you require something, use it rather than just requiring it and not using it

#

if you use something define it first.

#

replace prefix with nothing, define it

fathom nymph
#

Simple Meme Command

const { MessageEmbed } = require('discord.js')
const randomPuppy = require('random-puppy')

module.exports = {
  commands: ['meme', 'memes', 'dankmemes', 'comedy', 'comedyheaven'],
  description: 'Shows a meme',
  usage: null,
  minArgs: null,
  maxArgs: 0,
  permissions: [],
  requiredRoles: [],
  callback: async message => {
    const subReddits = ["dankmemes", "meme", "memes", "comedyheaven"]
    const random = subReddits[Math.floor(Math.random() * subReddits.length)]

    const image = await randomPuppy(random)

    const memeEmbed = new MessageEmbed()
      .setTitle(`Here's your meme!`)
      .setImage(image)
      .setColor('RANDOM')
      .setURL(`https://reddit.com/r/${random}`)
      .setFooter('Click on the title to visit the subreddit!')
      .addFields(
        { name: 'Meme From:', value: `${random}`, inline: true }
      )

    message.channel.send(memeEmbed)
  }
}```

**THIS IS MY CODe AND IF YOU ASK ME TO DEBUG I WILL NOT RESPOND DO NOT COMPLAIN TO ME THE COMMAND DOES NOT WORK**
**LANG: NODEJS**
blissful coral
#

Jesus christ

#

I am concerned

fathom nymph
#

what>

blissful coral
#

My eyes...

fathom nymph
#

what?

calm valley
#

q js

fathom nymph
#

DJS

calm valley
#

im glad I switched to dpy

blissful coral
#

Why in the world do you have a js minArgs: '', maxArgs: '', requiredRoles: [], //and nesting it in a callback

fathom nymph
#

BRUH

#

ITS WHAT I USE

#

NO COMPLAINING

quartz hawk
#

you copied it from somewhere else right

blissful coral
#

Was I complaining?

#

I was asking why

#

lol

fathom nymph
#

Simple Meme Command

const { MessageEmbed } = require('discord.js')
const randomPuppy = require('random-puppy')

module.exports = {
  commands: ['meme', 'memes', 'dankmemes', 'comedy', 'comedyheaven'],
  description: 'Shows a meme',
  usage: null,
  minArgs: null,
  maxArgs: 0,
  permissions: [],
  requiredRoles: [],
  callback: async message => {
    const subReddits = ["dankmemes", "meme", "memes", "comedyheaven"]
    const random = subReddits[Math.floor(Math.random() * subReddits.length)]

    const image = await randomPuppy(random)

    const memeEmbed = new MessageEmbed()
      .setTitle(`Here's your meme!`)
      .setImage(image)
      .setColor('RANDOM')
      .setURL(`https://reddit.com/r/${random}`)
      .setFooter('Click on the title to visit the subreddit!')
      .addFields(
        { name: 'Meme From:', value: `${random}`, inline: true }
      )

    message.channel.send(memeEmbed)
  }
}```

**THIS IS MY CODe AND IF YOU ASK ME TO DEBUG I WILL NOT RESPOND DO NOT COMPLAIN TO ME THE COMMAND DOES NOT WORK**
**LANG: NODEJS**
blissful coral
#

That command can be done in less then half the amount of lines

#

Nobody wants the command lol

fathom nymph
#

Kids Like it

blissful coral
#

Not how it works here

#

Not really

calm valley
#

im sad that no-one mentions py Sad_Blob

fathom nymph
#

THEY DO

blissful coral
#

They have to understand the code to use it in the slightest bit

#

and know the npm packages to have

fathom nymph
#

Bro

blissful coral
#

wait wtf a npm package for a dog?

fathom nymph
#

I Already Have it

blissful coral
#

why not just connect to reddit lol

fathom nymph
#

Random-Puppy

quartz hawk
#

im confused

blissful coral
#

Same

#

lol

fathom nymph
#

BRUH

quartz hawk
#

is random puppy a random subreddit picker?

fathom nymph
#

CONST SUBREDDIT

#

is random puppy a random subreddit picker?
@quartz hawk ITS A RANDOM GENERATOR BRUH

quartz hawk
#

oh

opal plank
#

CallMeGat, can we chill?

calm valley
#

is this a meme cmd or a "meme dog cmd"

fathom nymph
#

NO COMPLAINING

quartz hawk
#

ok thank you

blissful coral
#

Chill tf out dude

fathom nymph
#

CallMeGat, can we chill?
@opal plank IM CALL ME GRAY NOT GAY

sudden geyser
#

looks like aliases

blissful coral
#

???

quartz hawk
#

oh my god gray chill out

calm valley
opal plank
#

can we chill dude? you're asking for help and being rude at the same time

quartz hawk
#

it's literally text

blissful coral
#

Chill out

fathom nymph
#

NO COMPLAINING MY CODE DOESNT WORK

quartz hawk
#

we are not complaining about your code

blissful coral
#

@opal plank No he isn't, he is just sending his command we asked him why he had certain things

fathom nymph
#

npm i random-puppy

quartz hawk
#

you code the way you want

sudden geyser
#

Though what exactly are you asking for CallMeGray

blissful coral
sudden geyser
#

You're acting like the world owes you something.

fathom nymph
#

npm i random-puppt

blissful coral
#

Sent twice now, what are you getting at

sudden geyser
#

Can you explain what issue you're having

fathom nymph
#

will randomize subreddits and send the randomized meme

calm valley
#

is this true, if your bot dms it doesnt get into top.gg?

blissful coral
#

What?

calm valley
#

No idea

fathom nymph
#

Im leavin

#

Lol

blissful coral
#

It has to be able to allow you to opt out @calm valley

sudden geyser
#

Elaborate

calm valley
#

some friend of mine told me that

blissful coral
#

What?

#

I am confused

#

LMAO

calm valley
#

What if its like a help command and it dms you the cmds lol

quartz hawk
#

is this true, if your bot dms it doesnt get into top.gg?
@calm valley like dm advertises or just normal dms?

blissful coral
#

Should be fine, dhillon

opal plank
#

@calm valley the rules, basically are. No unsolicited DM's

quartz hawk
#

^

blissful coral
#

ye'

fathom nymph
#

Now

blissful coral
#

?

fathom nymph
#

I Will send my

calm valley
#

Ah i'll keep it safe and just do channel send.

fathom nymph
#

PETS COMMAND

quartz hawk
#

ok

blissful coral
#

Plz no

fathom nymph
#

Will send random pets

#

or Food

#

random foo

#

Food*

#

hmmmmmm

#

Yumm

opal plank
#

as long as there's no DM on somsones behalf, the bot doesnt dm without the user who USED the command want it, or if it mass DM's. Those are the rules, to put it very easily

blissful coral
#

Don't post your code in this channel if you don't want to get constructive criticism FYI

quartz hawk
#

Ah i'll keep it safe and just do channel send.
@calm valley your bot can dm people as long as its not something inappropriate like dm advertises, inappropriate images, etc

calm valley
#

ah okay.

opal plank
#

the key is unsolicited

#

if the user gave consent, its fine

#

if not, well, thats an issue

neon heart
#

can i use neko-love api ?

blissful coral
#

I suggest a --nodm feature at the end so if they do !help --nodm it sends in the channel

#

@neon heart Bad idea

#

It can show loli images

opal plank
#

i think neko-life is the only one thats blacklisted isnt it?

blissful coral
#

yeah

neon heart
#

bruh

sudden geyser
#

@fathom nymph why are you sharing your code in the first place? You share it without stating what it's for, then you write in bold for no one to criticize you. You must be leaning towards something but none of us get it.

neon heart
#

i know

quartz kindle
#

call him gay

opal plank
#

^^

blissful coral
#

huh

#

LOOL

opal plank
#

i have no idea why he even posted it tbh

#

dunno if it was flexing, sharing, or simply poorly asking for help while having a massive attitute

blissful coral
#

Whatever it was he was pissed off at the response he got

quartz kindle
#

play stupid games, win stupid prizes

opal plank
#

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

blissful coral
#

yessir

opal plank
#

speaking of stupid, time to do some more coding

#

brb

fathom nymph
#

Hey

blissful coral
#

You mean type shit up and not understand why it works?

#

Yep

#

Hey
@fathom nymph boo

slender thistle
#

play stupid games, win stupid prizes
@quartz kindle are you saying Python games are bad? /s

blissful coral
#

Correct.

#

LMAO

fathom nymph
#

Python Is goof

#

good*

#

You just dunno it yet

blissful coral
#

Never said it was bad

#

You obv don't notice we are all messing around

neon heart
#

i think neko-life is the only one thats blacklisted isnt it?
@opal plank it's different api, i want to use neko-love.xyz what about it?

opal plank
#

@slender thistle Come to the TS gang

fathom nymph
#

call Me GAY?!?!!?!?

quartz hawk
#

python seems like a good idea of language to learn fast but i am lazy to learn it honestly

blissful coral
#

Said games

fathom nymph
#

CALLMEGAY??!???!?!?!?!??

blissful coral
#

What are you talking about @fathom nymph

fathom nymph
#

call him gay
@quartz kindle

blissful coral
#

oh

#

lol

slender thistle
#

@opal plank nop BF gang

opal plank
#

@neon heart thats the thing, im not familiar with them, as far as im concerned, nekos-life is blacklisted, you'd prob wanna see with a mod or wait for someone thats more familiar with that than me

#

@slender thistle you gonna ditch me here? : (

fathom nymph
#

#TIMISNOTPOG

quartz kindle
#

lmfao

blissful coral
#

homie trying to start a hashtag?

fathom nymph
#

homie trying to start a hashtag?
@blissful coral ye

blissful coral
#

Tim is very pog

#

LMAO

quartz hawk
#

#TIMISPOG

fathom nymph
#

hate life

quartz hawk
#

whos tim again

neon heart
#

ok thankyou

slender thistle
#

nekos.life's neko, wallpaper, and some other SFW endpoint is not allowed. NSFW endpoints on top of that

quartz kindle
#

#callhimgay

fathom nymph
#

#callhimgay
@quartz kindle lol imagine they know who i am

slender thistle
#

@tame kestrel mind confirming my last message?

blissful coral
#

we know you?

fathom nymph
#

TWITTER

neon heart
#

nekos.life's neko, wallpaper, and some other SFW endpoint is not allowed. NSFW endpoints on top of that
@slender thistle different api

fathom nymph
#

#PythonIsNotPog

tame kestrel
#

si

fathom nymph
#

nvm i Hate PY

blissful coral
quartz kindle
#

are you famous on twitter?

fathom nymph
#

are you famous on twitter?
@quartz kindle no followers

#

so im dum

blissful coral
quartz kindle
#

i dont even have a twitter account

#

xD

blissful coral
#

A story in 2 pictures

fathom nymph
#

nvm i Hate PY
@fathom nymph

tame kestrel
#

no nekos life stuff unless it's like the hug, kiss enpoints I think

slender thistle
#

nekos-love is allowed as long as I'm aware

opal plank
#

im starting to assume gray is a troll, not even kidding

fathom nymph
#

#PythonIsNotPog

slender thistle
#

To be specific, it's just not prohibited

fathom nymph
#

what!>>!>!

opal plank
#

i mean common sense applies

quartz hawk
#

im starting to assume gray is a troll, not even kidding
@opal plank same

blissful coral
#

can you stop with your hashtags guy

quartz kindle
#

how old are you gaygray?

opal plank
#

pick what your bot does carefully and with common sense

fathom nymph
#

how old are you gaygray?
@quartz kindle 26

quartz hawk
#

there

blissful coral
#

That is the most bullshit I have ever heard

quartz kindle
#

hes 26 / 2?

quartz hawk
#

by the way be behaves and he say hes 26 hes lying

normal sage
#

I need feedback on a bot idea lol

#

does anyone here play jackbox

quartz hawk
#

no

blissful coral
#

Nah 12 years old @quartz kindle

fathom nymph
#

does anyone here play jackbox
@normal sage no one does

neon heart
#

To be specific, it's just not prohibited
@slender thistle ok

normal sage
#

@normal sage no one does
@fathom nymph bruh

#

ok then

opal plank
#

@calm valley Try fetching, like, 100-200 images from that api. manually see them to see if theres any provocative minors, anything on that regard with sexualizing lolis/nekos. If anything of the sort comes up, dont do it. Its a crude method, since you may not get anything out of luck while the api still gives bad stuff, but should be a decent way of checking

calm valley
#

No like I was trying to do a help cmd

blissful coral
#

Am I the only one who can forsee mods getting involved?

calm valley
#

so you would say (prefix)help and it would dm you the cmds

blissful coral
#

That is ok

#

lol

opal plank
#

but how is the api related to it then?

#

i thought you were USING the api

calm valley
#

I never said anything about api

#

lol

opal plank
#

wait what?

#

wrong person?

calm valley
#

yeah

opal plank
#

@neon heart read msg above, tagged wrong user

#

lmao my bad

blissful coral
#

LMAO

calm valley
#

its good idm

neon heart
#

whut?

opal plank
#

checkthis

#

but i tagged the wrong person, it was meant for you

neon heart
#

lmao

opal plank
#

what im suggesting is basically sampling

#

if you dont know if the api results in NSFW stuff, sample it

blissful coral
#

Erwin can you send me ptb link

#

for discord

#

Fuck canary

opal plank
#

grab a large sample of data and see if anything out of the ordinary comes

#

bet

blissful coral
#

thx

neon heart
#

yeah, I've done that a few times to punch and slap and it's safe

opal plank
#

then it SHOULD, keyword, SHOULD be fine

neon heart
#

ok thanks for your advice

opal plank
trim saddle
#

imagine being 26 in 2020

solemn latch
#

26 in 2020, why

ivory seal
#

Hii i have a embed named lbembed

    .setAuthor("Jet's Dream World",guild.iconURL())
    .setDescription(`Our top 20 most active members win nitro! \n \n Messages must be non-spam, or they won’t be counted. You must follow all rules.
    If you are seen trying to cheat, you will be disqualified. \n \n The most active user receives the @Most Active role! \n \n **Prizes**  \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0   **Prizes** \n **#1**:$10 Nitro \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **#11**: 5$ Nitro `)
    
     message.channel.send(lbembed);``` and then its supposed to delete itself but when i putin ```lbembed.delete()``` it says ```lbembed.delete is not a function```
#

please help

dusk wyvern
#

hold on lemme read

ivory seal
#

kk thanks

drifting wedge
#

How do I get data from wtforms flask into the python backend?

#

Ping with responses pls

dusk wyvern
#

couldnt tell ya, i dont code in py pandasad

#

@ivory seal whats with all the \xa0(s)

ivory seal
#

well i want my embed to be in like a particular format to make those space's i need those \xao 's :πŸ˜…

calm valley
#

lol

ivory seal
#

wat? no lol

#

its a autoupdating leaderboard

dusk wyvern
#

ah.

ivory seal
#

it pulls in data from my quick.db and with SetInterval it repeats every 10 secs

dusk wyvern
#

@ivory seal what exactly is the problem

ivory seal
#

well i want to delete my embed so i use lbembed.delete()

#

but

dusk wyvern
#

ah

ivory seal
dusk wyvern
#

i see the issue

ivory seal
#

i get this error

dusk wyvern
#

im pretty sure its because the embed isnt a function?

ivory seal
#

im not sure i quite understand?

dusk wyvern
#

the thing is it's trying to delete the message but the function doesnt exist

ivory seal
#
       lbembed.delete()

     },10000)```
#

this is my settimeout function

dusk wyvern
#

but the thing is, the lbembed is a constant

#

lbembed.delete is a function, javascript doesnt know what to do with it

ivory seal
#

ah ok so can u advise me what steps i should do to prevent this?

proper bolt
#

you need to await the message send

dusk wyvern
#

i dont code in js alot, so i really couldnt tell you

ivory seal
#

ah ok

proper bolt
#

const lmembed = await msg.channel.send(embed);

#

lmembed.delete()

ivory seal
#

thanks @dusk wyvern and @proper bolt

dusk wyvern
#

np

ivory seal
#
      antiSpam.message(message);
      if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if it contains an invite link
        message.delete() //delete the message
          .then(message.channel.send('Link Deleted:\n**Invite links are not permitted on this server**'))
      }
      if (message.content.includes('bruh'||'abs23')) { //if it contains an invite link
        message.delete() //delete the message
          .then(message.channel.send(`${message.author} **Do not swear!**`))
      }
      setInterval(() => {
        const all = db.all(); 
       let resp =all.filter(e => e.ID.startsWith('messages-'))
         resp.length=20;
         let finalOutput="**Leaderboard** \n \n";
        let winner1 =resp[0].ID.split("-");
        console.log(resp[0])
        let winner1id = winner1[1]
        let winner1userobj = client.users.cache.get(`${winner1id}`);
        let guild = message.guild;
        const lbembed = new MessageEmbed()
        .setAuthor("Jet's Dream World",guild.iconURL())
        .setDescription(`Our top 20 most active members win nitro! \n \n Messages must be non-spam, or they won’t be counted. You must follow all rules.
        If you are seen trying to cheat, you will be disqualified. \n \n The most active user receives the @Most Active role! \n \n **Prizes**  \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0   **Prizes** \n **#1**:$10 Nitro \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **#11**: 5$ Nitro `)
        
        await message.channel.send(lbembed);
         
    }, 10000);
     
     
    }); ```
#

another question

#

even though its async message

#

await gives me this

proper bolt
#

you need to do async for the setInterval

#

setInterval(async () =>

ivory seal
#

ohhh ok

#

thanks

proper bolt
#

np

ivory seal
#
const {MessageEmbed}=require('discord.js');
const ms = require('ms');
const mscon = require('milliseconds')
const db = require('quick.db');
exports.run = async (client, message, args) => {
  setInterval(async() => {
    const all = db.all(); 
   let resp =all.filter(e => e.ID.startsWith('messages-'))
     resp.length=20;
     let finalOutput="**Leaderboard** \n \n";
    let winner1 =resp[0].ID.split("-");
    console.log(resp[0])
    let winner1id = winner1[1]
    let winner1userobj = client.users.cache.get(`${winner1id}`);
    let guild = message.guild;
    const lbembed = new MessageEmbed()
    .setAuthor("Jet's Dream World",guild.iconURL())
    .setDescription(`Our top 20 most active members win nitro! \n \n Messages must be non-spam, or they won’t be counted. You must follow all rules.
    If you are seen trying to cheat, you will be disqualified. \n \n The most active user receives the @Most Active role! \n \n **Prizes**  \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0   **Prizes** \n **#1**:$10 Nitro \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **#11**: 5$ Nitro `)
    
    message.channel.send(lbembed);
    setTimeout(async function(){
      lbembed.delete();

    },10000);
     
}, 10000);``` it still returns the same error ![DN_pepe_sad](https://cdn.discordapp.com/emojis/760902382107230238.webp?size=128 "DN_pepe_sad")
sonic lodge
#

await the message.channel.send(lbembed);:

const message = await message.channel.send(lbembed);
ivory seal
#

ahh ok

#

thanks

sonic lodge
#

then you can call message.delete()

ivory seal
#

thank u soo much

rocky hearth
#

it seems like ur trying to delete the same msg, is 10sec

#

Here is the one line code

message.channel.send(lbembed).then(msg => msg.delete({timeout: 10000, reason: 'Just Like Thaat'}))
#

@ivory seal

ivory seal
#

yee i got it to work thanks a ton

dark steeple
#

how can i get a member of other shard using id?
i tryed client.shard.broadcastEval(this.users.cache.get(args[0]))
bur its not work

blissful coral
#

So...

#

This is gonna be a very dumb question...

#

But...

#

What is the best way to handle all errors that are unexpected that do not have a catch on them?

#

Any sort of event to do it?

rocky hearth
#

nope

#

but u can have one catch block for a chain of thenables

blissful coral
#

is using a try catch a better option

rocky hearth
#

it depends

#

i work with both of them, whichever suits the code

queen crane
#

You can set up a handler for all unhandled promise rejections for example

ancient thunder
slim umbra
#

circular dependencies

rocky hearth
#

bcoz its a circular reference loop

slim umbra
#

#BlameDjs

#

yea

rocky hearth
#

and its a very common practice in the world of programming

solemn latch
#

Very useful

#

Wherever you are, whatever you have you can get what you need with practically no effort

slim umbra
#

ehm well

#

not for memory

rocky hearth
#

no it doesn't take extra memory

faint prism
#
public object MyProperty
{
  get
  {
    return MyProperty
  }
}
rocky hearth
#

only message, guild, members is taking up space, rest is all referencing each other

solemn latch
#

^

ancient thunder
rocky hearth
#

how much time did it took?

solemn latch
#

Copy pasta

ancient thunder
#

like 2 seconds

#

to write

#

the message took 50ms

rocky hearth
ancient thunder
#

same

blissful coral
#

My eyes

#

Jay

#

I swear

ancient thunder
#

lol

clever vector
#

Hey guys

#

is this correcct?

amber sedge
#

I'm keep getting this
@rocky hearth umm we can't solve it without the code. If ur sharing it.. share it without the token

#

text
@clever vector????

#

Embed ?

#

Wait is it python ?

clever vector
#

JS

#

Its correct

#

Thx

amber sedge
#

K

#

I did nothing lol

trail orchid
#

hello

#

can someone explain to me what shards are

amber sedge
trail orchid
#

they directed me over here

amber sedge
#

Oh

faint prism
#

what

amber sedge
#

So idk what is shards

faint prism
#

this is developer

#

we answer those questions here

amber sedge
#

The top.gg team will come here so wait

trail orchid
#

yeah

faint prism
#

A shard is a thread with an instance of your bot that is assigned to manage a part of the guilds your bot is in

trail orchid
#

why does topgg display the number of shards on bot pages then?

rocky hearth
#

there approx 1shard = 1000 guilds managed by client

faint prism
#

swag, ig

rocky hearth
#

@rocky hearth umm we can't solve it without the code. If ur sharing it.. share it without the token
@amber sedge Any guesses, what might be wrong? Actually my project is very large

amber sedge
#

It says unknown message... My guess is u may made it like || message.channel.send(Hello) without " "

#

Send me the line 154 of the code

#

Not the whole

rocky hearth
#

Naa, I'm using ts. That can be caught in ide itself

amber sedge
#

Oof

#

Send the 154 line

rocky hearth
#

why, the file is in the node_modules

amber sedge
#

Oh

#

Ig module corruption ?? No idea

rocky hearth
#

last night, I updated discord.js

amber sedge
#

Oh

rocky hearth
#

So I think, something might got broke

amber sedge
#

Ya

#

V11 to v12 ?

#

And v12 is completely different from v11 so..

rocky hearth
#

nah, na... v12.2 to v12.4

amber sedge
#

Oh

#

No idea

ancient thunder
#

who else runs their bot on a ti84

faint prism
#

On my SmartFridge

rocky hearth
#

How do I force upgrade a package, to the latest version in yarn??

slim umbra
#

probs clear yarn cache and then yarn upgrade

rocky hearth
#

I'm trying --latest but no luck

#

clear cache??

#

yarn.lock file?

earnest phoenix
pure lion
#

@rocky hearth name-of-package@latest

#

Can anyone tell me why my music bots won't play any more? I'm not sure if they require more intents or what

rocky hearth
#

intent means??

harsh blade
#

1 sec grabbing another ss

#

Its supposed to post a embed in the suggestions channel

#

i can send the code line too

earnest phoenix
#

i think it'll help people helping you

harsh blade
crisp fable
#

use the channel id

#

to get the channel

harsh blade
#

Uh, where do i enter the id?

#

Im new to js

crisp fable
#
message.guild.channels.cache.get("channel_id")```
harsh blade
#

Thank you :)

crisp fable
#

np

earnest phoenix
#

shouldn't it be embed = new Discord.MessageEmbed()?

crisp fable
#

yeah that too

earnest phoenix
#

Discord.RichEmbed is the old one

crisp fable
#

@harsh blade do you use discord.js v12 or v11

harsh blade
#

v11

#

xD

crisp fable
#

oh

earnest phoenix
#

They're using v11, it's deprecated

#

You must update because it's not maintained

harsh blade
crisp fable
#

get rid of .cache

earnest phoenix
#

yeah you should update to v12

harsh blade
#

You must update because it's not maintained
@earnest phoenix Will my code break?

earnest phoenix
#

u'll need to fix some stuff, yeah

#

No, you will just have to update a few property names

#

i also have a question

#

my bot breaks every time i text him on dm's, how can i make it ignore dm?

#

With one line of code

#
if (<message>.channel.type === "dm") return;```
#

kk

#

but where am i suppose to put this line?

#

before my command list?

#

At the start of the message event

#

so like this right?

#

Yes

#

thanks

harsh blade
earnest phoenix
#

did you update js?

harsh blade
#

nope

crisp fable
#

then type js <client>.channels.get("id")

earnest phoenix
#

is there supposed to be guild?

#

guild is for discord servers, so i don't think you should put it in there

harsh blade
earnest phoenix
#

πŸ€¦β€β™‚οΈ

crisp fable
#

what did you name your bot variable?

#

like client, bot, ...

harsh blade
#

DynamicBot ?

crisp fable
#

use js client.channels.get("id")

#

and remove the code after that in the same line

harsh blade
crisp fable
#

use bot

#

instead of client

#

man you gotta know what you named your bot variable

earnest phoenix
harsh blade
#

man you gotta know what you named your bot variable
@crisp fable wdym

#

variable

crisp fable
#

show me the line where it says js new Discord.Client()

harsh blade
#

From suggest.js?

crisp fable
#

in your main file

#

not the command

earnest phoenix
#

Inb4 doesnt pass client to the comnand folder

crisp fable
harsh blade
#

cant find it

earnest phoenix
#

Lmao

crisp fable
#

ughh

neon heart
#

bruh, where your main file?

crisp fable
#

@harsh blade show me your module.exports.run line in suggest.js

harsh blade
neon heart
#

then use bot.channels.get

crisp fable
#

use js bot.channels.get("id") then

harsh blade
#

this happens when i react to the suggestion to make it "accepted" or "implemented"

crisp fable
#

show the code

harsh blade
crisp fable
#

there's nothing with 'roles'

#

that's in your main file

#

read the error

rocky hearth
#

@harsh blade you're doing it wrong with promisses

harsh blade
#

line 557 - 562

rocky hearth
#

wat??

#

not here

crisp fable
#
message.guild.roles.get("id")```
rocky hearth
#
message.guild.roles.get("id")```

@crisp fable roles.cache

crisp fable
#

discord.js v11

#

they don't use v12

rocky hearth
#

ohh, then I should stay away from here

harsh blade
#
message.guild.roles.get("id")```

@crisp fable Whose id?

crisp fable
#

role id

harsh blade
crisp fable
#

show how you get the member

harsh blade
crisp fable
#

Show how you defined the member variable

#

or else i can't help you

harsh blade
#

member variable where? main or the commands file

crisp fable
#

main

obtuse jolt
#

Why are you still using v11?

harsh blade
#

Idk

#

Show how you defined the member variable
@crisp fablewhat does the line start with so i could find it easier?

crisp fable
#

jesus

#

either
const member, let member or var member

harsh blade
crisp fable
#

what the heck

hybrid roost
#

Hello, there is strange thing happened with me... My bot is not starting

#

That's all

#

When I starting Development account (the same code, but only 1 server).. It is working

harsh blade
#

what the heck
@crisp fable ?

earnest phoenix
#
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)```
crisp fable
#

@harsh blade ```js
const member = message.guild.members.get(user.id)

grizzled raven
#

if you have subdocuments in a mongoose schema, will virtual getters and setters still work?

harsh blade
#

@harsh blade ```js
const member = message.guild.members.get(user.ud)

@crisp fable do i replace anythinbg in the user.id?

crisp fable
#

nope

harsh blade
#

catch block ?

crisp fable
harsh blade
#

i did

crisp fable
#

weird

#

try js const member = message.member

harsh blade
#

and after that nothing?

crisp fable
#

nope

#

if that doesn't work then idk anymore

#

i never used the raw event

harsh blade
#

:d

crisp fable
#

dunno what it is or how it works KEKW

harsh blade
#

Ok so now, when i react. nothing in console and no changes anywhere

#

i think it killed the code

crisp fable
#

gimme a sec

harsh blade
#


    let role = message.guild.roles.get("765885271861624843");
    if (member.roles.sort((a, b) => b.calculatedPosition - a.calculatedPosition).first().calculatedPosition < role.calculatedPosition) return;
    if (channel.name.toLowerCase() == config.Suggestions_Channel.toLowerCase()) {
      if (message.embeds.length > 0) {
        let oldEmbed = message.embeds[0];
        let embed = new Discord.RichEmbed()
          .setDescription(oldEmbed.description)
        if (emojiKey == ":lock:") {
          if (oldEmbed.title.endsWith(`**- DENIED**`)) return;
          message.reactions.get(":lock:").remove();
          let containsaccepted = `${oldEmbed.title} `
          let replace = `${containsaccepted.replace(" **- ACCEPTED**", "")} **- DENIED**`
          let finished = replace.replace(/\s+/g,' ').trim();
          embed.setColor("#e50220");
          embed.setTitle(finished)
          embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
          embed.setTimestamp()
          message.edit(embed);
        } else if (emojiKey == ":star:") {
          if (oldEmbed.title.endsWith(`**- ACCEPTED**`)) return;
          message.reactions.get(":star:").remove();
          let containsdenied = `${oldEmbed.title} `
          let replace = `${containsdenied.replace(" **- DENIED**", "")} **- ACCEPTED**`
          let finished = replace.replace(/\s+/g,' ').trim();
          embed.setTitle(finished);
          embed.setColor("#08d80f");
          embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
          embed.setTimestamp()
          message.edit(embed);
        }
      }
    }
#

thats the code for the reactions

crisp fable
#

i know why

#

please before you have the if (emojiKey == "πŸ”’") check, console.log the emojiKey

#

basically

#

add console.log(emojiKey) before that check

#

then try again and send the output

harsh blade
#

no ouitputs when reacting

crisp fable
#

show me where you put the console.log

harsh blade
crisp fable
#

it doesn't show anything in the console?

harsh blade
#

@crisp fable

crisp fable
#

show line 215

#

o wait nvm

harsh blade
crisp fable
#

that's somewhere else

harsh blade
#

Also, thank u sm for having time to help me :p
Usually i just get ignored :d

#

@crisp fable

crisp fable
#

try to change the emojiKey variable to emoji.name
and remove the ::'s in if (emojiKey == 'πŸ”’')

#

so basically only lock

harsh blade
#

so. if (emojikey ':lock:')

crisp fable
#

no

#

if (emojikey == 'lock')

harsh blade
#

Dosent work

#

no errors

#

I Think its with the line we changed

#

const members

#

stopped giving errors after that

hardy locust
#
@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith('!hello'):
        msg = 'Hello {0.author.mention}'.format(message)
        await message.channel.send(msg)
    if message.content.startswith('!howareyou'):
        msg = 'I am fine What about you? {0.author.mention}'.format(message)
        await message.channel.send(msg)
    if message.content.startswith('!amongus'):
        msg = 'Use appropriate channel @maiden inlet\nFor Among Us code: [#770936765392748563](/guild/264445053596991498/channel/770936765392748563/)\nFor Among Us Memes: [#773047085686849536](/guild/264445053596991498/channel/773047085686849536/)\nRequested by: {0.author.mention}'.format(message)
        await message.channel.send(msg)
@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run(TOKEN)```
#

Hey someone help me

crisp fable
#

because the error with the roles was fixed

#

after changing member

ionic dawn
#

unicode emojis are detected by discord, you dont need to provide any id/name

crisp fable
#

now the problem is that the if statement isn't getting triggered

ionic dawn
#

also, they share the same emoji ID

hardy locust
#

I am trying to get the user id mentioned while typed the command but i have no idea how do i get it?

ionic dawn
#

Whats the problem guys

#

im bored in class and mayb I can help you

harsh blade
#

and it does not log

#

in console

hardy locust
#

example !amongus @someone

crisp fable
#

means that nothing is stored in the emojiKey variable

hardy locust
#

The mentioned user is to displayed by the bot

ionic dawn
#

if console.log isnt shown is cuz isnt being triggered

pale vessel
#

you can check for mentions under message.mentions

ionic dawn
#

console.log gives output even when the argument is empty

earnest phoenix
#

I have problem (javascript)
I have code:

client.dbl.hasVoted(message.author.id).then(voted => {
            if(!voted) return message.reply('vote on top.gg')            
        });
// command

why command is running?
https://smth.is-inside.me/jepksCfT.png

pale vessel
#

it's a list of mentioned members

#

so you can check for message.mentions[0]

#

if it exists, the author mentioned a member

#

and that would be the first member (from the api)

hardy locust
#

Ok I will try

harsh blade
#

so, any ideas?

#

When i react to an suggestion with ⭐ It should edit the embed to "accepted"
But now when i react, nothing happens, no errors.

crisp fable
#

what happens when you react with πŸ”’ ?

harsh blade
#

Nothing

earnest phoenix
#

I have problem (javascript)
I have code:

client.dbl.hasVoted(message.author.id).then(voted => {
            if(!voted) return message.reply('vote on top.gg')            
        });
// command

why command is running?
https://smth.is-inside.me/jepksCfT.png

crisp fable
#

look at the code you send

#

and your screenshot

#

the response

earnest phoenix
#

yes it's example code

crisp fable
#

no idea why it is running

earnest phoenix
#
client.dbl.hasVoted(message.author.id).then(voted => {
            if(!voted && message.author.id !== client.config.ownerID) {
                return message.channel.send(`${client.config.emoji.error} This commands is for **voters only**. <https://antialt.xyz/vote>`);
            } 
        });
// command
crisp fable
#

try to put the command into an else statement after that check

harsh blade
#

hey wb my issue

earnest phoenix
#

try to put the command into an else statement after that check
@crisp fable i can't because I'm using await

crisp fable
#

async(voted) in .then

#

should fix that

harsh blade
#

what happens when you react with πŸ”’ ?
@crisp fable Nothing

rocky hearth
#

can I get the reaction, the user has last reacted to?

knotty basin
#

do you know how to make a shout bot?

#

like this

harsh blade
#

can I get the reaction, the user has last reacted to?
@rocky hearth ?

pale vessel
#

can I get the reaction, the user has last reacted to?
@rocky hearth ye

rocky hearth
#

how
the pic makes me blind

pale vessel
#

do you want to do it as the user react or after someone else reacts

rocky hearth
#

I have a <User>, I want the reaction, the user has reacted to if any??

pale vessel
#

to any message?

rocky hearth
#

yes

pale vessel
#

in the guild or globally?

knotty basin
#

@radiant dome

pale vessel
#

or in the channel

#

channel is the easiest

rocky hearth
#

but I have only <User>, not <Member>

pale vessel
#

user can be resolved to a member

#

do you want their latest message reaction of the guild? channel?

rocky hearth
#

any

pale vessel
#

globally?

#

hm

#

what is it for

rocky hearth
#

actually, in the guild... yes

pale vessel
#

ah, guild

radiant dome
#

@knotty basin

pale vessel
#

you can get all channels of the guild and map them by reactions by the member

knotty basin
#

hai

pale vessel
#

after that, get the last reaction

rocky hearth
#

@knotty basin The shout command you want to make, can be created easily.
They have used the MessageEmbed to create that type of fancy message

harsh blade
#

When i react to my suggestion nothing happens, it should mark it as accepted but nothing, no errors in console eighter

radiant dome
#

@rocky hearth Can you make it?

rocky hearth
#

ofcourse, I can go in more advance

radiant dome
#

Great

rocky hearth
#

after that, get the last reaction
Lemme try

radiant dome
#

@rocky hearth DMs.

tame badger
#

why my bot is offline?

earnest phoenix
#

why do i have those three errors?

quaint hornet
#

i have 2 bots in diferent hosts, the two run the same code, but one of then have more hardware than the other, how its possible the bot with more hardware lag and the bot with less hardware no lag?

earnest phoenix
#

Help!

#

@quaint hornet

quaint hornet
#

i think youre using something like this

#

var playingMessage = msg.channel.send("My message")

#

first verify if you typed right

#

if theres typed right then try move the react command for inside a then

#

so you code will be like this

#
msg.channel.send("My message").then(playingMessage => {
  playingMessage.react("Your emoji");
  //rest of your code
});
earnest phoenix
#

My Ms\essage

#

await playingMessage.react("πŸ”Š");

pale vessel
#

playingMessage isn't a message, maybe

quaint hornet
#

wait what

earnest phoenix
#
      var playingMessage = await new MessageEmbed()
      .setTitle(` [ Ω„ΫŒΩ†Ϊ© Ω…ΩˆΨ²ΫŒΪ© | Music Link ] ![play512](https://cdn.discordapp.com/emojis/773702799095627776.webp?size=128 "play512")`)
      .setURL(`${song.url}`)
      .setDescription('')
      .setColor("#fc0000")
      .setAuthor(`${song.title}`, 'https://cdn.discordapp.com/emojis/773176911706194001.gif?v=1')
      .setFooter('IR Music Player' , 'https://cdn.discordapp.com/attachments/773543050256318484/773678746044596224/IRANIMUSICS.png')
      message.channel.send(playingMessage);
      await playingMessage.react("![mediaskipforward512](https://cdn.discordapp.com/emojis/773702798176026625.webp?size=128 "mediaskipforward512")");
      await playingMessage.react("![pause512](https://cdn.discordapp.com/emojis/773702798403436564.webp?size=128 "pause512")");
      await playingMessage.react("![loop512](https://cdn.discordapp.com/emojis/773702798264762380.webp?size=128 "loop512")");
      await playingMessage.react("![stopicon14256](https://cdn.discordapp.com/emojis/773702797148684289.webp?size=128 "stopicon14256")");
      await playingMessage.react("πŸ”‡");
      await playingMessage.react("πŸ”‰");
      await playingMessage.react("πŸ”Š");
    } catch (error) {
      console.error(error);
    }
quaint hornet
#

a there its

#

you are sayng playing message is a embed

#

not a message

pale vessel
#

you don't await the MessageEmbed()

#

that's an embed

#

you await the message.channel.send()

#

assign it to a variable

quaint hornet
#
var embed = await new MessageEmbed()
      .setTitle(` [ Ω„ΫŒΩ†Ϊ© Ω…ΩˆΨ²ΫŒΪ© | Music Link ] :play512:`)
      .setURL(`${song.url}`)
      .setDescription('')
      .setColor("#fc0000")
      .setAuthor(`${song.title}`, 'https://cdn.discordapp.com/emojis/773176911706194001.gif?v=1')
      .setFooter('IR Music Player' , 'https://cdn.discordapp.com/attachments/773543050256318484/773678746044596224/IRANIMUSICS.png')
      var playingMessage = message.channel.send(embed);
      await playingMessage.react(":mediaskipforward512:");
      await playingMessage.react(":pause512:");
      await playingMessage.react(":loop512:");
      await playingMessage.react(":stopicon14256:");
      await playingMessage.react("πŸ”‡");
      await playingMessage.react("πŸ”‰");
      await playingMessage.react("πŸ”Š");
    } catch (error) {
      console.error(error);
    }
pale vessel
#

and then use <variable>.react()

#

why spoonfeed

quaint hornet
#

theres it

earnest phoenix
#

@quaint hornet @pale vessel
Thanks tiks Wiggly

void forge
#

`const Discord = require("discord.js");
const moment = require("moment");
require("moment-duration-format");

exports.run = (client, msg) => {
const duration = moment.duration(client.uptime).format(" D [gΓΌn], H [saat], m [dakika], s [saniye]");
msg.channel.sendCode("asciidoc", = πŸ“Š Δ°STATΔ°STΔ°KLER = β€’ πŸ–₯️ Bellek kullanΔ±mΔ± :: ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB β€’ πŸ‘· Γ‡alışma sΓΌresi :: ${duration} β€’ πŸ‘₯ KullanΔ±cΔ±lar :: ${3564} β€’ πŸ“‹ Sunucular :: ${102} β€’ πŸ“Ί Kanallar :: ${5897} β€’ πŸ“– Discord.JS sΓΌrΓΌm :: v${Discord.version} β€’ ⏲️ Ping :: ${client.ping});
};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['botbilgi'],
permLevel: 0
};

exports.help = {
name: 'botbilgi',
description: 'c',
usage: 'botbilgi'
};`

#

help

#

pls

crimson vapor
#

insteaf of "`" you should use "```" for code

earnest phoenix
crimson vapor
#

also, whats the error

earnest phoenix
#

Pls Help

#
var embed = await new MessageEmbed()
      .setTitle(` [ Ω„ΫŒΩ†Ϊ© Ω…ΩˆΨ²ΫŒΪ© | Music Link ] :play512:`)
      .setURL(`${song.url}`)
      .setDescription('')
      .setColor("#fc0000")
      .setAuthor(`${song.title}`, 'https://cdn.discordapp.com/emojis/773176911706194001.gif?v=1')
      .setFooter('IR Music Player' , 'https://cdn.discordapp.com/attachments/773543050256318484/773678746044596224/IRANIMUSICS.png')
      var playingMessage = message.channel.send(embed);
      await playingMessage.react(":mediaskipforward512:");
      await playingMessage.react(":pause512:");
      await playingMessage.react(":loop512:");
      await playingMessage.react(":stopicon14256:");
      await playingMessage.react("πŸ”‡");
      await playingMessage.react("πŸ”‰");
      await playingMessage.react("πŸ”Š");
    } catch (error) {
      console.error(error);
    }
crimson vapor
#

ik nothing about message collectors but it says that the function you used doesn't exist

earnest phoenix
#

pls wait

#
    const filter = (reaction, user) => user.id !== message.client.user.id;
    var collector = playingMessage.createReactionCollector(filter, {
      time: song.duration > 0 ? song.duration * 1000 : 600000
    });
crimson vapor
#

change var playingMessage = message.channel.send(embed); to var playingMessage = await message.channel.send(embed);

earnest phoenix
#

Thanks Wait iam Test

#

@crimson vapor Thanks

crimson vapor
#

message.channel.send() returns a promise so you need to use either await or .then @earnest phoenix

tame badger
#

why my bot is offline?

boreal iron
#

lmao

#

Because it’s process probably stopped

tame badger
#

what do u mean?

#

i have new bot but it is offline

quartz kindle
#

you never made a bot before? so you dont know how bots work?

tame badger
#

first time making but i am good at java script

#

i can show u if u want

quartz kindle
#

so you need to create a program and run the program

pale vessel
#

inb4 they show javascript instead

quartz kindle
#

the bot will only be online while your program is running

tame badger
#

what program shall i make?

quartz kindle
#

your program should connect to discord and login using your bot token

tame badger
#

people say use .bat files

#

what program do you use?

quartz kindle
#

i personally use javascript and the discord.js library

#

btw java and javascript are two completely different things

#

which one do you actually use?

tame badger
#

java script

quartz kindle
#

then you should always say "javascript" and never "java"

#

"java" is a very different language

tame badger
#

i know java is easier

quartz kindle
#

java is not easier

tame badger
#

thanks for the information

#

it is easier for me idk why

quartz kindle
#

have you actually used java?

#

java is more complex than javascript

tame badger
#

actually i am new for this that s why i don't know much

quartz kindle
#

yes, its very common for new people to be confused, thats why im explaining to you that javascript and java are VERY different

#

java is more similar to C languages, while javascript is actually not even its real name, javascript's real name is ECMAScript and has nothing to do with java

tame badger
#

i am a student but your information is so important for me actually i was learning Html but i planned to study java CSS and html. I was planning to make discord bots at first Your information helped me alot thank you very much

quartz kindle
#

javascript/ecmascript is a language for browsers, yes, its used together with html and css

#

java has no connection to browsers or the web, java does not use html and css

tame badger
#

my goal was html but i tried to learn different languages about it so glad that you helped me

quartz kindle
#

no problem, just dont say "java" again or people will likely misunderstand you

#

you can also use java do make a discord bot, but its a very different process, you would need to download java from oracle.com

#

minecraft is made with java for example

#

java is also used for banking

#

but in the internet, for websites and etc, you use ecmascript/javascript/js, not java

#

do make a bot with javascript, you need to download node.js from nodejs.org

tame badger
#

glad to talk with you yea i downloaded it thanks

crimson vapor
#

yeah java is more structured and has more rules to follow than js

tame badger
#

i see that's why it didn t run

willow mirage
#

@quartz kindle do you know how to register a js.org domain ?

#

cuz i don't understand it

quartz kindle
#

idk never made one

dark steeple
#

how can i get a member of other shard using id?
i tryed client.shard.broadcastEval(this.users.cache.get("${args[0]}"))
bur its not work

quartz kindle
#

you cant get the full user instance

#

what do you want to do with this user?

inner wharf
#

anyone know of a system for discord.py that can get a member's past usernames?

crimson vapor
#

im pretty sure you aren't allowed to do that

quartz kindle
#

the only way to do that is to track their changes and save them in a database

inner wharf
#

hmm alright. I've seen a different bot do it, but I won't mess around with it.

harsh blade
#

When i react to my suggestion nothing happens, it should mark it as accepted but nothing, no errors in console eighter

ancient nova
#

does anyone know how to avoid this error Error: Status code: 429

quartz kindle
#

429 = you're hitting the rate limits

harsh blade
#

When i react to my suggestion nothing happens, it should mark it as accepted but nothing, no errors in console eighter
please help its urgent :c

cinder patio
#

We can't help without code

pale vessel
#

420 = you're high btw

harsh blade
#
    
let role = message.guild.roles.get("765885271861624843");
    if (member.roles.sort((a, b) => b.calculatedPosition - a.calculatedPosition).first().calculatedPosition < role.calculatedPosition) return;
    if (channel.name.toLowerCase() == config.Suggestions_Channel.toLowerCase()) {
      if (message.embeds.length > 0) {
        let oldEmbed = message.embeds[0];
        let embed = new Discord.RichEmbed()
          .setDescription(oldEmbed.description)
          console.log(emojiKey)
        if (emojiKey == ':lock:') {
          if (oldEmbed.title.endsWith(`**- DENIED**`)) return;
          message.reactions.get(":lock:").remove();
          let containsaccepted = `${oldEmbed.title} `
          let replace = `${containsaccepted.replace(" **- ACCEPTED**", "")} **- DENIED**`
          let finished = replace.replace(/\s+/g,' ').trim();
          embed.setColor("#e50220");
          embed.setTitle(finished)
          embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
          embed.setTimestamp()
          message.edit(embed);
        } else if (emojiKey == ':star:') {
          if (oldEmbed.title.endsWith(`**- ACCEPTED**`)) return;
          message.reactions.get(":star:").remove();
          let containsdenied = `${oldEmbed.title} `
          let replace = `${containsdenied.replace(" **- DENIED**", "")} **- ACCEPTED**`
          let finished = replace.replace(/\s+/g,' ').trim();
          embed.setTitle(finished);
          embed.setColor("#08d80f");
          embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
          embed.setTimestamp()
          message.edit(embed);
#

I Think theres something wrong with this code

quartz kindle
#

theres nothing in there that is listening for reactions

harsh blade
#

Oh what

quartz kindle
#

unless there is code that you're not showing before that part

#

for example where you define emojiKey

harsh blade
#

Previous code before that one is for the role addition

#

Yeah thats the code

#

oh wait

ancient nova
#

@quartz kindle i there any way to avoid getting rate limited?

#

I can't have a music bot if it's gonna get rate limited every few minutes

earnest phoenix
#

I can't have a music bot if it's gonna get rate limited every few minutes
@ancient nova don't make a music bot just listen with your friend(s) on spookify

ancient nova
#

I wanna make the bot anyway

quartz kindle
#

where is the rate limit coming from?

#

youtube?

ancient nova
#

I think so

earnest phoenix
#

youtube doesn't like music bots

ancient nova
#

I'm not sure if it's ytdl, since I switched from ytdl-core to ytdl-core-discord and I still got the same error, I'm pretty sure it's youtube then

earnest phoenix
#

you're using data fetched from them without permission or even giving them their ad revenue

ancient nova
#

I mean I do have permission if they gave me the key themselves right?

#

I have the key so I can grab that data

crimson vapor
#

the key is so you can get yt video info, you need ytdl to download them

blazing ravine
#

some1 help me pls

crimson vapor
#

wdym

blazing ravine
#
client.on("guildMemberAdd", async (member) => {
 const channel = member.guild.channels.cache.find((x) => x.id === "0000")
  
  if(!channel) {
   return console.log(member.guild.name + " Please Create channel with name verify")
  }
  
  const vrole = member.guild.roles.cache.find((x) => x.name === "Member")
  
    if(!vrole) {
   return console.log(member.guild.name + " Please Create role with name 'Member'")
  }
  
  const verifycode = await channel.send(":inbox_tray:" + `${member.user} ` + ' **[VERIFY]** `React βœ”οΈ for Verify and access to other Channels` ')
    await verifycode.react(':heavy_check_mark:')
  
  client.on('messageReactionAdd', async (reaction, user) => {
    if (reaction.emoji.name === ":heavy_check_mark:") {
        const guildMember = reaction.message.guild.members.cache.get(user.id);
        if (!guildMember) throw 'Couldn\'t get guildMember!'

        const roleToAssign = reaction.message.guild.roles.cache.find(r => r.name === 'Member')
        if (!roleToAssign) throw 'Couldn\'t get roleToAssign!'

      let collector = channel.createMessageCollector(m => m.author.id === member.id)
  
      guildMember.roles.add(roleToAssign)
   // await reaction.message.delete();





       
    }
   
  })
    })```
#

when some1 join server not send message

#

look

earnest phoenix
#

I mean I do have permission if they gave me the key themselves right?
@ancient nova you don't have permission for playback of copyrighted music videos iirc

blazing ravine
#

whats wrong with the code

#

some1 help me

ancient nova
#

@earnest phoenix then how doesn't all the popular music bot's don't get rate limited?

earnest phoenix
#

simple. youtube hasn't caught them yet

#

and stuff like mee6 and rhythm actually take permission from song artists and youtube for playback of their songs

ancient nova
#

they count mine after playing few songs, but hasn't caught theirs where thousands of people play music at the same time

#

what is the logic in that

earnest phoenix
#

@ancient nova why do you think those bots don't get rate limited? simple. they have permission

ancient nova
#

then..? how do I get that permission?

earnest phoenix
#

then..? how do I get that permission?
@ancient nova shrug idk

ancient nova
#

but that doesn't make sense

#

how the hell am I supposed to me a bot otherwise

earnest phoenix
#

@ancient nova It's IPv6 rotation

#

This is how they avoid the ratelimits

#

πŸ—Ώ

ancient nova
#

how do I make something like that

earnest phoenix
#

yes but youtube hates moozic bots don't they

quartz kindle
#

technically streaming music from youtube without permission is illegal

rocky hearth
#

is it still, If we use googleapis youtube v3??

quartz kindle
#

the bots who do it most likely do it by using proxies and rotating IPs, so youtube doesnt know its all coming from the same place

#

does google api even allow streaming? afaik it only has access to metadata

earnest phoenix
#

technically streaming music from youtube without permission is illegal
@quartz kindle Music bots be like: Processing to search for fucks to give...

ancient nova
#

damn

#

isn't there anything else I can do

#

maybe a different package to stream music from

earnest phoenix
#

I mean, lavalink has that rotation to prevent from getting IP banned from youtube

#

But this is also coming to ytdl-core

#

just stop trying to make a music bot and listen directly on spookify

ancient nova
#

jesus

#

I can't just delete half of my bot

#

because I get rate lilimted onc]e

earnest phoenix
#

Spotify more like ad dungeon

#

or literally just go into a vc and sing like fuck

#

no need for spookify

#

we have vocal cords

ancient nova
#

better yet, I'll record me singing and put that in my bot instead

earnest phoenix
#

that's actually allowed

#

And then you hear the result

#

since you own the copyright to your own voice

ancient nova
#

does spotify have an npm package

#

I could use that

#

it doesn't have a reate limit I'm pretty sure

earnest phoenix
#

Spotify's ratelimit is heavier than YouTube

ancient nova
#

welp

#

I tried

earnest phoenix
#

does spotify have an npm package
@ancient nova ...why? *leaves chat* *door slams shut*

ancient nova
#

because I'm trying to fix my music bot

#

...

#

😒

earnest phoenix
#

What are you currently using?

#

ytdl-core iirc

ancient nova
#

I mean if error 21...whatever blocks my IP for few days then I'm

#

I use ytdl-core-discord

#

that's the same thing basically

earnest phoenix
#

but optimized for d.js bots amirite

ancient nova
#

yes

earnest phoenix
#

Not exactly the same thing because they use dependencies

#

And it's not always updated

ancient nova
#

well I just started using that few minutes ago to try

#

but yeah

#

I use that now

#

if it's needed I'll switch back

#

just help me

#

what do I have to do to get un-rate limited or avoid it next time, or switch IP's whatever

rocky hearth
#

@ancient nova I know package called, discord-player which doesn't ever require API_KEYs to play music form, youtube, spotify etc

earnest phoenix
#

Wasn't expecting that

ancient nova
#

wow

#

well anyways

earnest phoenix
#

It's author is the guy who made discord.js
@earnest phoenix are you fucking telling me the owner of d.js made smth that allows people to do smth that's technically illegal if done wrong

ancient nova
#

can anyone help me

earnest phoenix
#

You heard it correctly

rocky hearth
#

actually you *read it correctly

earnest phoenix
quartz kindle
#

he didnt make an illegal thing lol

ancient nova
#

how do I make that IP rotation

#

cmon

#

I gotta fix the bot

earnest phoenix
#

You don't, ytdl-core has a PR that will be fixing the issue and it'll be almost impossible to get banned

quartz kindle
#

ytdl-core-discord is just a wrapper around ytdl-core, which is made by someone else

earnest phoenix
#

But if fent merges the PRπŸ—Ώ

#

πŸ—Ώ

ancient nova
#

@earnest phoenix but I'm rate limited for few days I can't just have the bot stop working like that

#

people will start surely kicking it after a while

earnest phoenix
#

Well i can't help you at that point unless you wait it out, sorry

quartz kindle
#

@ancient nova the only thing you can do to lift your ban is to change vps lol

ancient nova
#

oh god

quartz kindle
#

or change your vps's ip address if they allow you to

ancient nova
#

are you kidding

quartz kindle
#

either that or wait

#

or use proxies

earnest phoenix
#

Yea, changing the IP address will most likely resolve it

quartz kindle
#

ytdl-core has examples for using proxies

ancient nova
#

how do I change that IP adress

quartz kindle
#

but you need to obtain your proxies yourself

#

there are no free and reliable proxies tho

earnest phoenix
#

Paying to avoid ratelimits KEKWLaugh

#

how to add images in Detailed description?

quartz kindle
#

upload them to an image hosting service or base64 them

ancient nova
#

@earnest phoenix I wanna die at this point

earnest phoenix
quartz kindle
#

do you not know what "image hosting" is?

earnest phoenix
#

@earnest phoenix I wanna die at this point
@ancient nova You may rest in pepperonis

#

No

#

😦

quartz kindle
#

do you know what "hosting" is?

ancient nova
#

wait ca't I just make another youtube key?

#

?????

earnest phoenix
#

The ban does not depend on the key

ancient nova
#

but................. with a vpn Cool

earnest phoenix
#

It depends on the IP

ancient nova
#

yeah

#

I'll make a new key

#

with a VPN on

#

won't that work?

earnest phoenix
#

You don't need a new key

#

I don't get why people spend this much effort trying to make a music bot when they can directly use the service they are fetching data from

ancient nova
#

because people are using it

quartz kindle
#

everyone and their grandmother want music bots

earnest phoenix
#

They just do this to fucking cut out ads they get while listening to them

rocky hearth
#

@earnest phoenix Why you Hate, music bots ?? There're cool, when finally gets work

earnest phoenix
#

Ads KEKWLaugh

cinder patio
#

music bots are overrated

ancient nova
#

imagine getting an error on a catch error event

earnest phoenix
#

Literally everything is overrated

#

@quartz kindle i got so now i have to past the link?

quartz kindle
#

yes, paste it in an html <img> tag

#

google how to use html img tags

earnest phoenix
#

ok

#

They just do this to fucking cut out ads they get while listening to them
@earnest phoenix they literally won't even pay the service themselves at least. I give out all my BAT tokens to sites like Wikipedia and Minecraft Wiki because I'm not like I want them to die for giving me shit ads and stuff for money. If you don't like ads just fucking stop using that service (not talking about you btw)

#

Tim if i show you 2 functions that does the same thing but with different codes, can you guess which is the fastest

quartz kindle
#

well i can try

earnest phoenix
#

yes, paste it in an html <img> tag
@quartz kindle or just do ![]() in markdown

quartz kindle
#

^ or that

rocky hearth
#

How do I know if a object is empty?

quartz kindle
#

Object.keys(myobj).length

slender wagon
#

is there a way to prevent sql injection attacks

quartz kindle
#

prepared statements

#

or sanitization if your library doesnt support prepared statements

slender wagon
#

oh okay

#

that will be applied to the db?