#development

1 messages · Page 1526 of 1

slim void
#

they think it's real

long marsh
#

imagine

slim void
#

Does anyone know any open-source music bot

solemn latch
#

theres a ton on github.

slim void
#

Woo how hard are they to setup @solemn latch

solemn latch
#

many are just download, set the token and run.

slim void
#

Can u link me one that's like that

solemn latch
#

some require nodejs and stuff installed.

#

i dont do music bots, so ive never done it, but github search is really good for finding them

limber flume
#

*damn does not work huh?*

earnest phoenix
#

YO WAT DA HECK AM I ACTUALLY INSTALLING 37000 PACKAGES FOR npx create-react-app?¿?¿

lusty quest
#

well react install a lot of dependencies

earnest phoenix
#

But who uses 37000 dependencies

limber flume
earnest phoenix
limber flume
lusty quest
#

well you also install an interpreter for jsx, a way to render jsx to html and more stuff

solemn latch
#

dependency package

#

has all the dependencies.

earnest phoenix
#

nice

delicate shore
#

bro

earnest phoenix
#

sis

slim void
#

How do I make my bot kick accounts that aren't old enough

#

in py

lusty quest
#

get the Member object and check the account age vs todays date, use this value to determine for how old a account has to be to be accepted. if someone fails call the ban function on the member object

slim void
#

hm

#

temp banz?

lusty quest
#

since discord doesnt support it directly you have to store the ban somewhere, i suggest to use Redis since you can set a TTL and if the TTL runs out it emits an event that you can listen to to unban the user

mellow kelp
#

*sike*

slim void
#

ok

austere zealot
#

Any good hosts you guys would suggest for my bot?

lusty quest
#

check the pins,
personnaly:
Digitalocean
AWS
Google Cloud
Vultr
Linode

near stratus
solemn latch
#

Galaxy gate is my personal suggestion

near stratus
#

Some Use Heroku but when your bot is gonna grow it's gonna cost hell lot

solemn latch
#

But everyone recommends what they personally experienced as good so 🤷‍♂️

austere zealot
#

Yeah lel

#

I c

#

Tq guys

lusty quest
#

i do not recomend OVH tho, sure they are relatively large but ive tested various products they offer and all of them had theyre issues

sonic radish
#

Hello! I'm getting this error ```js
Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag

CODE: 
```js
Client.on('message', async message => {
    const data = await prefix.findOne({
        GuildID: message.guild.id
    });
    if (data) {
        const prefix = data.Prefix;
lusty quest
#

use a try/catch block around the db call

earnest phoenix
#

hmmm, i'm using discord.js, and i would to implement shards, the problem is, when shard 0 starts, all is good, but when shard 1 starts, now port for dashboard is in use (by shard 0). How i can repair that?

#

in my index.js i'm require("dashboard.js")

solemn latch
#

Put your dashboard in the sharding manager instead of the bots.

earnest phoenix
#

hmm

#

@solemn latch but when i'm doing require("dashboard.js")(client) i'll do require("dashboard.js")(shards)

#

?

#
const { ShardingManager } = require("discord.js-light");
const config = require("./assets/JSON/tokens.json")
const moment = require("moment");

const shards = new ShardingManager('./index.js', {
    token: config.betaMafinka,
    totalShards: 3
})

shards.on("shardCreate", shard => console.log(`[${moment().format("YYYY-MM-DD HH:mm:ss")}]: Launched shard #${shard.id}`))
shards.spawn(shards.totalShards, 10000)
#

my sharding manager

swift cloak
#

help
so
im doing
localhost:3000/api/eeel
doesnt work

const router = require('express').Router()

router.get('/eeel', (req, res) => {
    res.send(400)
})

module.exports = router;```
```js
app.use('/api', routes);```
help
lusty quest
#

does the express server start?

swift cloak
lusty quest
#

also maybe use res.sendStatus(400) if you just set the status not every software will pick it up

swift cloak
#

also

#

i did

send({ msg: 'lol' })```
#

but no work

lusty quest
#

so the endpoint doesnt work

#

did you import routes correctly?

swift cloak
#

yes

lusty quest
#

if you use a router.get("/") it fires?

swift cloak
#

it says

**Cannot GET **

pure lion
pure lion
swift cloak
#

wait

young flame
#

i made a 300 line eval command

earnest phoenix
#

more lines doesnt make your code better

#

I can write 500 lines of code that does nothing

lusty quest
swift cloak
swift cloak
#

ping me when ur here

young flame
#

it has 300 lines because its interactive af

lusty quest
#

its even cleaner

#

also the express docs doesnt say anything about it being deprecated

swift cloak
young flame
#

again

#

its interactive af KEK

#

i like overcomplicating things

swift cloak
#

yes

young flame
#

no

#

krabby

#

why

swift cloak
young flame
#

lol

drowsy grail
young flame
#

i would record it hold on

drowsy grail
#

is it open source 👀

young flame
#

uh the bot?

#

yea

#

but i have to push all the changes

drowsy grail
#

@young flame if you end up recording it give me a ping, I'll see it in the morning. sounds cool!

young flame
drowsy grail
#

lmaoooo thats neat!!!

young flame
#

my cursor is pog

#

i told parm it was bongo cat and he didn't belive me

drowsy grail
#

is that a cat

young flame
drowsy grail
#

oh my god it is

#

bongo cat

young flame
drowsy grail
#

what people think devs do: hack into the cia
what devs really do: spend 2 hours finding a custom cursor

young flame
#

welp back to coding

drowsy grail
#

have fun

drowsy grail
#

lmao hey seems worth

earnest phoenix
#

Help, guys

lusty quest
#

why first getting the user from the message to then get the member from the cache?

#

use message.mentions.members.first() instead

#

aalso the way you get the member is invalid i guess

earnest phoenix
#

Oh

#

Ok

young flame
#

^^

#

how would you make like

earnest phoenix
#

Thanks

young flame
#

case numbers

#

actually

lusty quest
#

case numbers?

#

like you want to generate a ID?

sacred trout
#

guys does anyone know html?

zenith terrace
#

yea

cobalt spruce
#

hello does anyone use slappey here?

earnest phoenix
#

Lol

#

What’s that?

zenith terrace
#

wtf is that

lusty quest
#

its a bot

cobalt spruce
lusty quest
#

no i dont use the bot but i know who wrote it

cobalt spruce
#

no

#

is not a fully ready bot

#

u code the commands

#

and other things

#

but he skips for u command handlers and events and util

earnest phoenix
#

Ohhh, never heard of it

#

Same as js, python?

cobalt spruce
#

so u dont have to write anything

#

just create command

#

and it use cmd

cobalt spruce
lusty quest
#

i dont use the Bot and cant help you, ask the guy who made the template he got a discord server

cobalt spruce
#

invite me to it

#

pleas

#

please

bright crag
#

he has one

earnest phoenix
#

is someone able to help me setup a python discord bot on cpanel

lusty quest
#

i dont send the url in here

cobalt spruce
#

dm

lusty quest
#

your dms are closed

cobalt spruce
#

they arnt

earnest phoenix
#

I m

#

Bot

#

Is noob

pale vessel
#

okay?

cobalt spruce
#

lol

young flame
#

mod log numbers

lusty quest
#

so you want unique IDs?

young flame
#

case number #{number}

lusty quest
#

if you are on js use crypto

young flame
#

hm

#

crypto?

lusty quest
#

crypto.randomBytes(8).toString("hex"); generates an ID with 8 letters

young flame
#

oh

lusty quest
#

crypto is an npm module

young flame
#

is it a npm-

#

lol ok

lusty quest
#

wait nvm its now build in into node

young flame
#

oo

young flame
#

like a

#

on!history command

lusty quest
#

?

young flame
#

where it gets the history of that key

#

or id in this case

lusty quest
#

i cant look into your brain idk what you plan to do

young flame
#

lol

#

ok so

#

i need mod log numbers for the action logginG

#

like how lucas reason command has the

#

#{number}

lusty quest
#

who is lucas?

slender thistle
#

Luca

young flame
#

H

lusty quest
#

so you want to keep track of such stuff?

slender thistle
#

case number = 1

on mod action, case number += 1

lusty quest
#

^ is easyer

#

crypto is more if you want unique ids

young flame
lusty quest
#

store it to a db

slender thistle
#

Save last incremented number in a database

young flame
#

that is a option

slender thistle
#

But have it cached too so that you don't pull from database every time

timber fractal
cobalt spruce
#

does anyone here use slappey?

near stratus
pale vessel
quartz kindle
#

and cpuStats returns this

timber fractal
#

so?

quartz kindle
#

you cant send that directly

timber fractal
#

how to fix that?

quartz kindle
#

think

#

how to convert bytes to megabytes

#

how to use data from objects

timber fractal
#

im not really good whit this if i knew this i wouldn't ask help

timber fractal
misty sigil
#

bro

#

this is basic JavaScript

quartz kindle
#

ok lets start with the memory thing first

#

do you know what is a byte and what is a megabyte?

timber fractal
#

nvm i fixed it

quartz kindle
#

lmao

misty sigil
#

lol

slender thistle
#

Oh this is fun

#

Example app listening on port 8080!
And repl.co doesn't want to load my page

#

oh wait

#

I forgot to send a response on my main route

misty sigil
#

shiv you fucking twat.

slender thistle
#

no u twat

timber fractal
#

hey small question how can i make my bot say like "prefix: > say >help for help"if he got pinged

lusty quest
#

?

#

you want to have a mention as prefix?

timber fractal
#

no

#

just you say @ bot

#

and than it says prefix: >

lusty quest
#

why then not make the mention the prefix? additional to the prefix?

#

so you can run the help command and list in there the prefix as example

timber fractal
#

because i already know how to do that but how can i do it like you only mention him and than it says prefix: >

lusty quest
#

listen for mentions if it matches the bot ones send the message

timber fractal
#

ok

earnest phoenix
#

Cannot read property toLocaleString() of null
what is this error?

#

Show your code

#

Lol

misty sigil
#

oh no!

#

anyway

earnest phoenix
#

no bot is added
the bot is leaving the server

timber fractal
#

nvm fixed

earnest phoenix
#

@earnest phoenix yeah

#

it shows me like that too

#

Hey guys so I have this unban command and it’s doing thus

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

module.exports = {
  name: 'unban',
  run: (message, args) => {
    if (!args[0]) return message.channel.send('Please specify a user ID.');

    message.guild.members.unban(args[0])
       .then(() => {
         const embed = new MessageEmbed()
           .setTitle('The ban hammer has spoken!')
           .setDescription(`<@${message.author.id}> unbanned <@${target.id}>`)
           .setTimestamp(new Date())
         message.channel.send(embed);
      })
     .catch(err => message.channel.send(`I can't find a banned user with this ID: ${args[0]}`));
  }
}
#

But it does unban the user but just says that

lusty quest
#

maybe log the error that you not properly handle

earnest phoenix
#

There’s no errors

#

Or you want me to do console.log?

eternal osprey
#

hey guys

#
let scheduledMessage = new cron.CronJob('00 30 10 * * *', () => {
  const args = message.content.slice(Config.prefix.length).split(/ +/);
  console.log(args[1] + args[2] + args[4] + args [3])
  let channel = client.channels.get(args[3]);
  channel.send(args[4]);
});



   if (message.content.startsWith("!auto")) {
  scheduledMessage.start()


  
   }
#

why is my command not logging anything to the console?

inland pulsar
#

wtf why a cronjob

#

who tf named me idiot

eternal osprey
#

i want it to post every 1 day

#

at 10:30

inland pulsar
#

run it at an interval and check time

#

cron job prob didnt run if it didnt log

#
  • less dependencies if you dont use that
eternal osprey
inland pulsar
#

just do interval of a minute or something and check time

earnest phoenix
#

Why is this unban command doing this

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

module.exports = {
  name: 'unban',
  run: (message, args) => {
    if (!args[0]) return message.channel.send('Please specify a user ID.');

    message.guild.members.unban(args[0])
       .then(() => {
         const embed = new MessageEmbed()
           .setTitle('The ban hammer has spoken!')
           .setDescription(`<@${message.author.id}> unbanned <@${target.id}>`)
           .setTimestamp(new Date())
         message.channel.send(embed);
      })
     .catch(err => message.channel.send(`I can't find a banned user with this ID: ${args[0]}`));
  }
}
#

^^ btw no errors

#

It unbans but just says that

cinder patio
#

something is wrong in the then callback then

sacred aurora
#

in the catch func add console.error or log

#

so the error will show up

#

u just send that message currently

cinder patio
#

You don't define target anywhere

sacred aurora
#

oof yea tho

cinder patio
#

just do args[0]

earnest phoenix
#

It’s already args[0]

#

@cinder patio

cinder patio
#

It's not

#

.setDescription(`<@${message.author.id}> unbanned <@${target.id}>`)

earnest phoenix
#

Huh

cinder patio
#

Where do you define target

earnest phoenix
#

No where...

cinder patio
#

then why are you using it in your code

#

if you don't define it anywhere

earnest phoenix
#

My bad

rocky hearth
#

Which is faster and more efficient?

if(true) { }    // 1

if(1 == 1) { }  // 2
cinder patio
#

the difference is so small that you won't notice a difference, but probably the first one, because in the second one you create two number literals

earnest phoenix
#

@cinder patio ```js
const { MessageEmbed } = require('discord.js');

module.exports = {
name: 'unban',
run: (message, args) => {
if (!args[0]) return message.channel.send('Please specify a user ID.');

message.guild.members.unban(args[0])
   .then(user => {
     const embed = new MessageEmbed()
       .setTitle('The unban hammer has spoken!')
       .setDescription(`<@${message.author.id}> unbanned <@${user.id}>`)
       .setTimestamp(new Date())
     message.channel.send(embed);
  })
 .catch(err => message.channel.send(`I can't find a banned user with this ID: ${args[0]}`));

}
}

#

Better?

cinder patio
#

the javascript engine probably optimizes it

cinder patio
#

I don't see anything wrong

earnest phoenix
#

Good to hear ima try

#

Worked

earnest phoenix
#
Cannot destructure property 'type' of 'undefined' as it is undefined.

Cannot destructure property 'type' of 'undefined' as it is undefined.

Cannot destructure property 'type' of 'undefined' as it is undefined.

Why does this randomly keep happening in my React Components

#

The error is from the render method of a Component

#

It's here:

render ({ type }) {
  // ...
}
#

I'm using the Component in my app here:

<SourceInput type="x" />
#

@quartz kindle timmy plz halp

marble juniper
#

use vue instead of react

#

ez fix

earnest phoenix
#

no

#

ew are you using class components

#

yes?

#

im just starting out

#

im pretty sure you can't pass props like that with class components

#

you should use react hooks altogether instead

earnest phoenix
#

I've been using it like that for so long

lyric mountain
#

render has no args iirc

earnest phoenix
lyric mountain
#

use props instead

earnest phoenix
#

the snippet you provided is mixing hooks and class components

#

whered you get that

#

🤔

lyric mountain
#

this.props contains all the properties u pass to the component tag

#

so in ur case it'd be this.props.type

earnest phoenix
#

@lyric mountain thanks

earnest phoenix
eternal osprey
#

hey guys

#

why does my bt send me cannot send an empty message? ```js
if (message.content.startsWith("!auto")) {

const args =

message.content
  .slice(Config.prefix.length)
  .replace(/^auto/, "")
  .replace(/<#\d+>/, '')

  .trim();

fs.writeFileSync("./first.txt", args);
let data = fs.readFileSync("./first.txt");;
let channel = message.mentions.channels.first();
channel.send(data);

}```

#

the txt file does have the lines i input

cinder patio
#

console.log data, make sure the encoding is utf8

earnest phoenix
lyric mountain
#

idk, never tested

earnest phoenix
#

@eternal osprey please for fucks sake use a normal database

lyric mountain
#
constructor(props) {
  super(props);
}
#

just put this in the beginning of the class

#

try seeing if it does work without it tho

earnest phoenix
#

@lyric mountain it does work

#

nice

lyric mountain
#

cool

earnest phoenix
#

@eternal osprey hey yo

#

@eternal osprey hey yo I got a surprise for you

#

My bad for 2 Pings lol

#

Huh?

#

BOT HAVE LAG AND BUG

#

We can’t never help without the code..l

#

@earnest phoenix

#

Bruh

#

Bruh, just show the code

#

Is that tHe full code?

#

And what’s the error

#

@earnest phoenix well it has happened with me, nan it’s just 0 but you can fix it but I’m not that pro so yea...

#

Ping woo, evie, code, Googefeud if you want professionals

#

@cinder patio maybe you can help him

eternal osprey
#

if (message.content.startsWith("!auto")) {

let rawdata = fs.readFileSync("./channel.json");
let sent = JSON.parse(rawdata);
let data = fs.readFileSync("./append.json");
let args1 = JSON.parse(data);
 
message.sent.send(args1);

}```so the data i want to send and the channel id are in the 2 json files i declared
#

but why do i get this error:

#

Cannot read property 'send' of undefined

earnest phoenix
#

stop storing data in json

tribal siren
#

hey cry

#

so uhh

earnest phoenix
#

i dont think so

#

you can't control how it displays to the end user

#

you can maybe try adding 3 inline fields but i doubt that's going to work

#

you're at the mercy of discord's css

eternal osprey
lusty quest
#

are you still using a json db?

eternal osprey
#

i am saving 1 static channel id

#

how bad can it be

lusty quest
#

you save everything in json lol?

eternal osprey
#

no this is some other project i work on

lusty quest
#

ok

#

but still its bad practise to use json as a "database"

eternal osprey
#

if (message.content.startsWith("!auto")) {
  
let rawdata = fs.readFileSync("./channel.json");
let test = JSON.parse(rawdata);
let data = fs.readFileSync("./append.json");
let args1 = JSON.parse(data);
test.send(args1);
}```do you know why this gives me: test.send is not a function
lusty quest
#

for configs fine

eternal osprey
lusty quest
#

but if you have to write its bad

#

also i love winscp. its so super slow when downloading a lot of small files

earnest phoenix
#

i still can't find a quality ftp client for windows

#

everything is garbage

lusty quest
#

i know

lusty quest
#

but atleast the new Server is worth the money

#

did a small test and where the old one ended up with 75% Utilisation the new one doesnt even notice it

eternal osprey
earnest phoenix
#

What’s the problem?

#

What’s the error

quartz kindle
eternal osprey
#

but my question is, how to fix it and why is it not a function.

cinder patio
#

I highly doubt JSON parses functions

#

functions aren't serializable

eternal osprey
#

(node:15924) UnhandledPromiseRejectionWarning: TypeError: test.send is not a function

quartz kindle
#

because it isnt

#

what is test?

#

console.log it

#

or whatever

#

show channel.json

earnest phoenix
#

They're using a json db

eternal osprey
quartz kindle
#

thats not even json lol

earnest phoenix
#

JSONs are objects bruh

delicate shore
#
s!eval let i = null
for(i = 0 ; i < blacklisted.length ;  i++) {
let lol = client.users.cache.get(blacklisted[i])
lol.send("You have been Blacklisted from using bot for one week! We are really sorry but you know what you did. If you want to be removed from "The Black List" earlier , then join our support server -  and appeal in `#support` channel!")

msg.author.send("You have been Blacklisted from using bot for one week! We are really sorry but you know what you did. If you want to be removed from "The Black List" earlier , then join our support server -  and appeal in `#support` channel!")
}
#

oh wait

eternal osprey
#

hey i had a little question

#

how do i let a certain command run every 24hours?

#

setinterval right?

nova inlet
#

Hi there
I need some advice warning discord bot owners (not only server admins) about an ongoing token leak I discovered.
I'm running a discordjs loop that loads all retrieved tokens in order to send a warning from the bot.
I'm currently sending PMs to guild owners via client.guilds.cache, and I was expecting bot owners to be in there too, but someone told me he didn't receive any PM from his bot.
I guess permissions and PM policy come into play (cache, maybe ?).
Any idea to achieve this ?

delicate shore
#
 let i = null

let blacklisted = ["583002121872474122","295216225636581377","521383016325709825","566193564502196235", "526942791419428885" ,"495965902345469955", "594972758778314752" ,"699543638765731892", "558861606063308822"]

for(i = 0 ; i < blacklisted.length ;  i++) {

let lol = client.users.cache.get(blacklisted[i])
lol.send("You have been Blacklisted from using bot for one week! We are really sorry but you know what you did. If you want to be removed from The Black List earlier , then join our support server - LINK and appeal in #support channel!")

}

My Code

#
TypeError: Cannot read property 'send' of undefined
earnest phoenix
zenith terrace
#

how many times u gonna change it?

delicate shore
#

Ohhhhhh

#

so i need to fetch

earnest phoenix
#

YO ARE YOU RUNNING A FOR LOOP TO DM ALL BLACKLISTED MEMBERS

#

Use Promise.all() to fetch them all

#

Just do it once

#

When they get blacklisted

#

No need to constantly trouble them

delicate shore
#

Yea but I just made that array

fair axle
sudden geyser
#

Can you upload the full stacktrace to a site like hastebin.com

earnest phoenix
#

What’s that?

sudden geyser
#

As it stands, all that screenshot shows us is what command was run and it failed

#

What's what, hastebin?

earnest phoenix
sudden geyser
#

They're trying to install sqlite.

quartz kindle
#

its a build error

earnest phoenix
#

Ohh lol

earnest phoenix
#

Oh yeah I can do -bits

#

Bots*

fair axle
#

What is stacktrace?

lusty quest
#

@quartz kindle you are smarter than me, did you know an way with how to profile the memory usage of a node process. got a Bot that used d.js-light that got after 30 minutes already 800mb Ram used (reported by pm2)Most caching is disabled and currently only 1 guild is used by the bot

earnest phoenix
#

Lol

cinder patio
#

that's insane

#

pm2 aint lying

lusty quest
#

i keep now htop open and see if i get there something

cinder patio
#

what does the bot do?

#

probably a pretty big memory leak

lusty quest
#

not much, listen for messages and then use tensorflow to determine if the message is toxic or contains harmful text

earnest phoenix
#

Huh, why is this showing error?

lusty quest
#

on my old server it where around 150mb on the new one that got way more ram it skyrockets

earnest phoenix
#

It’s telling me I’m missing a (

lusty quest
#

find the missing (

earnest phoenix
#

}});)?

#

LOL

lusty quest
#

2 things. you got 1 { opening the object but 2 } closing it. and Discord.js will parse a user or member object to a mention when you call it inside a string like you do it.

earnest phoenix
earnest phoenix
earnest phoenix
lusty quest
#

wired installing the optional packages discord.js recomends helped, also got now jemalloc running

lusty quest
earnest phoenix
lusty quest
#

my server got 64GB so

earnest phoenix
#

30GB RAM?

#

WTW*SHSBS

#

NOOBS
THAT'S LESS THAN CHROMIUM

earnest phoenix
lusty quest
#

Chrome gets unstable at around 1.2TB ram used

zenith terrace
#

@earnest phoenix did you find the missing (

earnest phoenix
#

stable company's unstable browser

#

I’m looking through it @zenith terrace

lusty quest
earnest phoenix
#

Line 24

sacred aurora
#

@earnest phoenix i think u missed the {embed:

earnest phoenix
#

But, I don’t want embed tbh

sacred aurora
#

wut

#

then what was that

#

{description: .....}

zenith terrace
#

remove one of the }

earnest phoenix
#

Alrighty

lusty quest
earnest phoenix
earnest phoenix
zenith terrace
#

if what

#

if you dont want it as an embed?

earnest phoenix
#

Mhm

sacred aurora
#

just send a string then

zenith terrace
#

message.channel.send(`message`)

earnest phoenix
#

Alr

zenith terrace
#

did you remove the } ?

lusty quest
#

you maybe could listen to the vouceStateUpdate

bright flame
#

Hey why i am not able to import cv2 when it is installed in my machine

earnest phoenix
#

im pretty sure you should be checking for null @earnest phoenix

#

oh

bright flame
#

any fix?

#

or something in another device code is working

earnest phoenix
#

are you using intents? if so you're going to need to add another one to get that event

#

Because it's <VoiceState>.channel

#

The voiceStateUpdate event returns instances of VoiceStates, not GuildMembers

quartz kindle
#

voiceChannel is not a thing anymore anyway

#

not since v12

#

voiceState.channel like voltrex said

#

voiceStateUpdate gives you voice states not guild members

earnest phoenix
#

Username of the member who got it's voice state updated?

#

<VoiceState>.member.user.username

rustic nova
#

your application icon

#

not your bot profile icon

frigid flame
#

@rustic nova thank you so much you are great 😀

rustic nova
#

Caching maybe?

#

the guilds are not cached i would suggest

zenith terrace
#

both of them?

rustic nova
#

Did you enable them on your developer portal aswell?

zenith terrace
#

no the intents in dev portal

earnest phoenix
#

Huh guys

zenith terrace
#

@earnest phoenix did u fix what I told u to do

zenith terrace
#

is ur command working now?

earnest phoenix
#

Mhm!

#

Lol

earnest phoenix
zenith terrace
#

ok good

earnest phoenix
#

Should I add GitHub link for command list or a designed picture with the commands?

zenith terrace
#

a picture would be nice

earnest phoenix
#

Yea same I was also thinking that and it would also be unique don’t you think?

zenith terrace
#

could yea

#

different than anyone else

errant hornet
#

How would I get the url of a Discord.js MessageAttachment that I create?

earnest phoenix
errant hornet
#

I used discord.js to create a message attachment, how would I get the url for that attachment

earnest phoenix
sudden geyser
#

No source repository 😔

#

Could've gone a bit further

rocky hearth
#

I've two child classes of a parent class. I want to run a method of child-1 in child-2

abstract class Parent {
  abstract sayHello(): void;
  abstract getGreet(): string;
}

class Child1 extends Parent {
  sayHello() {
    console.log(this.getGreet());
  }
  getGreet() {
    return 'Hello there!';
  }
}
class Child2 extends Parent {
  sayHello() {
    // I tried this, but it is calling the getGreet method from this class method
    Child1.prototype.sayHello.call(this);
  }

  getGreet() {
    return "I don't want to run this.";
  }
}
earnest phoenix
#

Why i can't use music commands? new update in ytdl-core?

mellow kelp
#

meaning you can't call methods in a context separate from the one you called the main method on

rocky hearth
#

hmmmm, actually I just want the this in Child2 to behave like as if it is of Child1

rustic nova
#

fml

rocky hearth
#

Haha, its ts

rustic nova
#

yeah just realized Kek

mellow kelp
#

classes be lookin fresh tho

rocky hearth
#

I tried using call(), but the getGreet method is being called from Child2

cinder patio
#

Curious, why would you want to do this? I think this goes against the principles of OOP

mellow kelp
cinder patio
#

afaik, the only way to do this is by getting an instance of Child1

distant light
#

Part of my code:

        client.commands.get('help-user').execute(message, args);```

error I get: ```/Users/norbert/discord-nikola/index.js:73
        client.commands.get('help-user').execute(message, args);
                                        ^

TypeError: Cannot read property 'execute' of undefined
    at Client.<anonymous> (/Users/norbert/discord-nikola/index.js:73:41)
    at Client.emit (node:events:327:20)
    at MessageCreateAction.handle (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/Users/norbert/discord-nikola/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:327:20)
    at Receiver.receiverOnMessage (/Users/norbert/discord-nikola/node_modules/ws/lib/websocket.js:825:20)```

Could you help me please?
mellow kelp
#

the command 'help-user' doesn't exist

cinder patio
#

super would use the parent's method, no?

#

not Child1

earnest phoenix
#

thats what they want no?

cinder patio
#

nope

earnest phoenix
#

nvm

#

im dumb

#

you need an instance of child1 yes

#

those two are not correlated

rocky hearth
#

hmm, so its not possible.
anyway thanks guyz

pale vessel
#

setColor

cinder patio
#

capital C in color

pale vessel
opal plank
#

you painting code?

#

Bold

sudden olive
#

Tell how to Get whitelist ip from mongodb

mellow kelp
#

idk what you're using

sudden olive
#

i using

#

For my bot

#

Database

mellow kelp
#

then i don't know

#

you should probably figure it out by yourself

sudden olive
#

See again

mellow kelp
#

yeah because you haven't done anything yet

sudden olive
#

Bro

mellow kelp
#

search how to whitelist ips on repl.it or something

sudden olive
#

No

#

For coding

mellow kelp
#

um ok

#

so where is your actual database

sudden olive
#

Mongodb

#

Dor database

mellow kelp
#

mongodb atlas?

sudden olive
#

Yes

#

How to whitelist

#

Tell me plz

mellow kelp
#

network access tab

sudden olive
#

Wait

#

Here

#

i open

mellow kelp
#

idfk

sudden olive
#

Next

sand walrus
#

hi, what is the site to learn discord bot commands?

mellow kelp
#

add "0.0.0.0/0" to allow access from anywhere

sudden olive
#

Yes next

mellow kelp
#

that's it

tardy hornet
#
message.channel.send(`${bot.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)}`)

its returning NaN

mellow kelp
rustic nova
#

owner is null

tardy hornet
mellow kelp
#

sometimes that shit happens

rustic nova
#

full code if possible

#

then i may be able to tell you why

tardy hornet
mellow kelp
#

o

tardy hornet
#

returning NaN

mellow kelp
#

setColor with capital C

tardy hornet
#

@mellow kelp i did it even in eval,

#

still NaN

rustic nova
#

owner is already a guildmember

mellow kelp
#

you're using setcolor, it should be setColor

rustic nova
#

oh nvm

#

wait

tardy hornet
#

please help

rustic nova
#

wait where's the msg.guild.owner.user.tag the error is referring to?

#

this

#

or where is the user

pale vessel
rustic nova
#

no clue then sad

pale vessel
#

properties and methods are case sensitive

#

displayAvatarURL()

zenith terrace
#

client.user.displayAvatarURL()

rustic nova
#

according to the docs, you're doing it the right way

#

no clue why it is erroring though

pale vessel
#

Guild#owner, fetch it to make sure that it's cached (Guild#members#fetch(Guild#ownerID))

zenith terrace
rustic nova
#

glad that i'm coding in the more stinky language called Java FedoraLUL

zenith terrace
#

so thats why u also stinky?

rustic nova
#

maybe

zenith terrace
#

s m h

#

are you doing URL and not url

quartz kindle
#

programming is case sensitive

zenith terrace
#

hi tim ❤️

quartz kindle
quartz kindle
zenith terrace
#

does your bot have the correct permissions?

#

does. YOUR BOT, have the correct permissions

#

not the user running the command

sudden olive
#

Pls help

solemn latch
#

Got a question or just in general need help?

zenith terrace
sudden olive
#

No

#

My bot facing errors so Pls help me

rustic nova
#

what errors

#

is the question now

sudden olive
umbral zealot
#

you will need nodejs 12.x or higher to use discord.js v12

solemn latch
#

Looks like an error to me

mellow kelp
#

yes

umbral zealot
#

And you shouldn't host bots on repl.it

solemn latch
#

Oh thought you said it wasn't facing errors KEKW

umbral zealot
#

No idea, but it's irrelevant, glitch is not an appropriate place to host bots.

sudden olive
#

From install pakage

umbral zealot
#

They ban anyone that uses pinging services to keep their bot alive, so it won't be 24/7. You should find an alternate hosting service.

sudden olive
#

@umbral zealot.

#

How can i install higher version of node.js

zenith terrace
#

ma'am*

umbral zealot
#

I have no idea how to do that on repl.it and again, don't host your bots there.

small mason
#

where can I know how many server are my bot currently in?

umbral zealot
#

replace sir with . and everything makes sense.

umbral zealot
small mason
#

python

sudden olive
#

i am also from india:sweat_smile:

umbral zealot
# sudden olive i am also from india:sweat_smile:

Yes, that's what I'm saying. As a rule of thumb, stop using sir everywhere, that's not how people use english normally. And there's also a thing called women in the world, gendering every single one of your sentences is bad practice.

shrewd creek
#

Lol

sudden olive
#

👍 😇 Ok

#

Done edited

sacred aurora
#

can i get the owner tag on guild join?

shrewd creek
#

All of us are a community ........so we are like buddies

sacred aurora
#

i've just try it and i got DiscordAPIError: Missing Access

umbral zealot
#

what did you try exactly?

sacred aurora
#

guild.members.fetch

#
guild.members.fetch(guild.ownerID)
#

that's where the error come from

umbral zealot
#

That's interesting. "Missing Access", really? I haven't seen that error before, that I can remember.

sacred aurora
#

oh wait

#

thats error happen when the bot leave the server

#

i think i got it

#

hopefully

umbral zealot
sacred aurora
#

yup its working now

sterile lantern
#

is this the correct way to find emojis;

#
        if (!emoji) return msg.channel.send('Could not find that emoji, returning.')```
#

cuz its not working

#

and yes its probably wrong, i never used a find function on emojis

#

ah nvm i added : on both sides

umbral zealot
#

I'm assuming emojiInput is a discord collection that has messages in it?

sterile lantern
#

it collects emoji names

#

not the actual emoji

#

brain fart right there

#
        for (var i = 0; i < array.length; i++) {
            m.react(array2[i].id)
        }```
#

cannot read proeprty id of undefined

#

for m.react(array2) part

earnest phoenix
#

raccoon api

#

plez

rustic nova
#

1st - Google images
2nd - image collection
3rd - profit

distant cobalt
#

how do you make an anchor in djs?

#

like a link

#

but it hides the https part

#

and replaces with words

zenith terrace
#

what

distant cobalt
#

masked links

mellow kelp
#

you can use markdown for that [Link](https://example.com)

#

but only in embed descriptions and field values

distant cobalt
#

k

sterile lantern
#

interaction.member.user.tag

#

how come this doesnt work

#

or interaction.member.tag

zenith terrace
#

ahem

#

code?

zenith terrace
sterile lantern
#

its an in embed

#

ill try user.tag

#

node:1607) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tag' of undefined

#

interaction.member.user.username works

#

interaction.member.user.tag doesn;t

#

strange

earnest phoenix
#

What happens when you do interaction.member.user instanceof require('discord.js').User

pale vessel
#

the raw event always send a raw object

#

there's no structure behind them

earnest phoenix
#

Does react have a way of validating user input before putting it in DOM?

mellow kelp
#

you can use controlled forms

#

with component state

earnest phoenix
#

extra hardwork

mellow kelp
#

nah its really easy

earnest phoenix
#

react already has a way to do that but i forgot how

shut spear
#

is there any place we can learn the reason of being rate limited and the remaining time (client.ratelimit is emitted only when hitting the limit and does not support these kinda info)?

pale vessel
#

you'd have to look for the raw headers sent by discord

earnest phoenix
#

found it

misty sigil
#

headas sent by discord

earnest phoenix
#

it literally does it automatically

#

oh hi greenname twat

lyric mountain
#

I summon the JS gods

#

this method (setPixelColor) demands a callback function as the last argument, but for some reason it errors when I pass an arrow/normal function

#

any ideas why or what should I put there?

#

ah, nvm, that is an optional ain't it?

sudden geyser
#

The ? means optional, but I don't understand JS/TS typings. There's ?cb: T, cb?: T, cb: ?T and cb: T? unless one of them are syntax sugar for the other.

jovial nexus
#

how can i do that when i start a command like ;something #test #test2 #test3 or ;something 272764566411149314 385837258768515083 385837258768515083 i can take the ID of all the channels mentioned?

sudden geyser
#

You could read the message content

#

Since it'll look like ;something [#123](/guild/264445053596991498/channel/123/) [#456](/guild/264445053596991498/channel/456/) [#789](/guild/264445053596991498/channel/789/)

earnest phoenix
#

split by space, remove the first element (cause it's your command name) and attempt to parse every item in the array

mellow kelp
#

use message.mentions.channels

earnest phoenix
#

there's probably a better way with your library

mellow kelp
#

or yeah parse them manually if you need to

#

oh

lyric mountain
#

still getting that error, just updated node

jovial nexus
#

i have this const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first(); but only detects the 1st mention

earnest phoenix
#

well guess why

jovial nexus
#

a

sudden geyser
#

hint: look at the end

jovial nexus
#

just saw it

#

pog

blazing portal
lyric mountain
sudden geyser
#

Can you jump to the definition of ImageCallback

earnest phoenix
#

Maybe the callback is drunk i guess? May you show us what the code of the function looks like? setPixelColor.toString()

lyric mountain
#

what exactly u need to see?

#

nvm, gonna use hastebin to share the whole ImageCallback

#

...which is not working

earnest phoenix
lyric mountain
#

already used hatebin

earnest phoenix
#

whatNOyoucantdothis Is that what came out when you did toString() on it or

lyric mountain
#

nope, that's ImageCallback definition

#

gonna get toString result

#

returned this:

function setPixelColor(hex, x, y, cb) {
      if (typeof hex !== 'number' || typeof x !== 'number' || typeof y !== 'number') return _utils.throwError.call(this, 'hex, x and y must be numbers', cb); // round input

      x = Math.round(x);
      y = Math.round(y);
      var idx = this.getPixelIndex(x, y);
      this.bitmap.data.writeUInt32BE(hex, idx);

      if ((0, _utils.isNodePattern)(cb)) {
        cb.call(this, null, this);
      }

      return this;
distant light
#

Part of my code:

        client.commands.get('help-user').execute(message, args);```

error I get: ```/Users/norbert/discord-nikola/index.js:73
        client.commands.get('help-user').execute(message, args);
                                        ^

TypeError: Cannot read property 'execute' of undefined
    at Client.<anonymous> (/Users/norbert/discord-nikola/index.js:73:41)
    at Client.emit (node:events:327:20)
    at MessageCreateAction.handle (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/Users/norbert/discord-nikola/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/Users/norbert/discord-nikola/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:327:20)
    at Receiver.receiverOnMessage (/Users/norbert/discord-nikola/node_modules/ws/lib/websocket.js:825:20)```

Could you help me please?
mellow kelp
#

i told you like 3 hours ago or something

#

the command 'help-user' doesn't exist

distant light
mellow kelp
#

check first if the command exists, then execute it

distant light
#

yes, I missed it. Sorry😕

earnest phoenix
lyric mountain
#

when the code reaches that part, it simply yells "cb must be a function"

#

if I pass null value, the error changes a bit:

sudden geyser
#

So it's coming from (0, _utils.isNodePattern)(cb)

earnest phoenix
#

Oh it's from isNodePattern

lyric mountain
#

I swear I hate debugging js

distant light
# mellow kelp the command 'help-user' doesn't exist

I have help-user.js file in my commands folder and other commands work.

Part:

        client.commands.get('info').execute(message, args);
    } else if(command === 'user'){
        client.commands.get('user').execute(message, args);
    } else if(command === 'help-user'){
        client.commands.get('help-user').execute(message, args);```

From the commands sent above only help-user doesn't work.
mellow kelp
#

oh no

#

oh no

#

have you thought about using dynamic command handling?

distant light
#

What is it? And why only this command doesn’t work?

mellow kelp
#

i got no idea how you register commands

#

dynamic command handling lets you find and run commands without the need for a giant if/else chain

solemn latch
#

do you have a command named help-user?

earnest phoenix
#

Has a command handler
Uses if..else chains to identify commands
What's the purpose of the command handler if you're doing that then

distant light
#
    if(!message.content.startsWith(prefix) || message.author.bot) return;
 
    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();
 
    if(command === 'help'){
        client.commands.get('help').execute(message, args);
    } else if(command === 'join'){
       message.author.send(`test join info`)
    } else if(command === 'warn'){
        if (message.author.flags.has.MANAGE_MESSAGES) return;
        const user = message.mentions.users.first();``
        if (user) {
          const member = message.guild.member(user);
        let q = args.slice(0).join(' ');
        member
          .send(`**You have been warned for** ${q}!`)
        }
    } else if(command === 'announce'){
      if (message.author.flags.has.MANAGE_MESSAGES) return;
        client.commands.get('announce').execute(message, args);
    } else if(command === 'embed'){
      if (message.author.flags.has.MANAGE_MESSAGES) return;
        client.commands.get('embed').execute(message, args);
    } else if(command === 'info'){
        client.commands.get('info').execute(message, args);
    } else if(command === 'user'){
        client.commands.get('user').execute(message, args);
    } else if(command === 'help-user'){
        client.commands.get('help-user').execute(message, args);```

This a part of my index.js
earnest phoenix
buoyant aspen
#

How can I get a message in a different channel by ID and edit it in discord.js v12? I've tried:

client.channels.cache.get('1234567890123456789').messages.fetch('1234567890123456789').edit('New Message');
```but I get an error saying that edit is not a function...
mellow kelp
#

messages.fetch returns a promise

earnest phoenix
#

<TextChannel>.messages.fetch() returns a promise

mellow kelp
#

you have to await it or use .then()

#

yeah

buoyant aspen
earnest phoenix
#

Bro

#

You didn't resolve it

mellow kelp
#

you can't require images

buoyant aspen
#

Yeah, I used .then and it didn't change anything

mellow kelp
#

use a MessageAttachment

earnest phoenix
#

It doesn't straight up put in the image, you first attach it, then set it

mellow kelp
#

use attachFiles([attachment]) to attach it and set the image to attachment://your-attachment-name.gif

buoyant aspen
#

@earnest phoenix

client.channels.cache.get('1234567890123456789').messages.fetch('1234567890123456789').then(msg => { msg.edit('New Message'); });
```has the same issue
lapis meteor
#

guys sorry but who can sand me invite in brawl box bot pls?

earnest phoenix
mellow kelp
buoyant aspen
earnest phoenix
#

But

queen needle
#

or the message isnt cached

earnest phoenix
#

What's the issue

buoyant aspen
#

edit() is not a function

buoyant aspen
earnest phoenix
#

Log what msg returns

buoyant aspen
#

undefined

#

which is weird

earnest phoenix
#

It's not undefined

buoyant aspen
#

that's what it logs

#

¯_(ツ)_/¯

earnest phoenix
#

It would say can't read property 'edit' of undefined if it was actually undefined

buoyant aspen
#

🤔

#

you're right

mellow kelp
#

again, you can't require images

buoyant aspen
#

wait yeah 🤦 that is what it says, was looking at the wrong log

mellow kelp
#

the first argument is the source

queen needle
#

if its undefined then it doesnt exist or isnt cached by your bot (someone correct me if im wrong)

mellow kelp
buoyant aspen
#

Is there a way to force-cache it? I thought d.js auto-caches stuff if it can't find it

earnest phoenix
buoyant aspen
#

lol

mellow kelp
#

no

earnest phoenix
#

attachFile is not a method

#

attachFiles()

#

And it takes an object

mellow kelp
#

isn't it an array

earnest phoenix
#
{
attachment: <BufferResolvable>,
name: <attachment name>
}```
#

It takes both

mellow kelp
#

o

#

<BufferResolvable> can also be the path to the file

#

pretty sure the image path is not relative to the file

distant light
#

@mellow kelp so how can I fix it?

mellow kelp
earnest phoenix
#

name is supposed to be a string

#

So

#

Did it work?

mellow kelp
#

well check your syntax

lyric mountain
#

I tottally, absolutely hate JS debugging

#

turns out the error was in a totally different place

earnest phoenix
#

Pain

mellow kelp
#

welcome to another episode of "debugging javascript"

buoyant aspen
#

@mellow kelp think I might have found it... It seems to be retrieving every message in the channel, even though I only asked for one. Any idea how to fix?

mellow kelp
#

make sure you're passing an id to the fetch() function

buoyant aspen
#

99% sure I am, can double-check tho

earnest phoenix
#

It should return a single message if you're passing an ID

buoyant aspen
#

🤦 I'm not lmao

#

my bad

#

It was a totally different part of the code

#

the message wasn't storing in the DB

earnest phoenix
#

.attachFiles()

#

That method belongs to the MessageEmbed class

#

Not a global function

#

Of course

mellow kelp
#

thats what i was telling you before

#

the file path you have to set is not relative to the current file

#

it's relative to the folder where you run the bot

#

is your gif in the root directory of your project?

#

just do file.gif

earnest phoenix
#

I'm pretty sure you gotta add ./ at start, but not too sure

#

Can you show your new code

mellow kelp
#

i think it's because attachFiles takes an array

#

not sure, but try that

earnest phoenix
#

Nah

mellow kelp
#

i mean it wouldn't let me do that in typescript

earnest phoenix
#

Weird, i always pass an actual object to it

mellow kelp
#

panik

earnest phoenix
#

you need the extension in the attachment protocol

solemn latch
#

i havent used either in awhile, but isnt there attachFile and attachFiles

earnest phoenix
#

Nope

solemn latch
#

ah

earnest phoenix
#

🤔

#

I believe attachFile was removed in v12

#

oh i thought you were saying no to me

#

lmfao

#

Ex dee

#

it's not weird

#

You need an extension

#

^

earnest phoenix
#

discord doesn't assume the extension

#

attachment://attachmentName.extension

#

since you can upload extensionless files

#

🤦

#

KEKW Bruh

mellow kelp
earnest phoenix
#

your extension is .gif

#

not .extension

#

What's your new code now

#

set the name to matze.gif

#

That file doesn't seem to be a gif tho

#

they're renaming it so it doesn't have an extension

#

can't you read your own code 🙄

#

Yea set the name

#

if it doesn't work after that

#

it isn't a valid gif image

#

Wait

#

Is that a custom background

#

glasscord

#

Isn't that like a client mod?

#

technically yes

#

But client mods are against ToS tho

#

like they would care

#

invites are channel bound, not guild bound

#

you need a channel

#

I thought actual Oliy was typing

#

<GuildChannel>.createInvite()

solemn latch
#

oliy was typing KEKW

rose warren
#

After how many shards should I consider clustering?

solemn latch
#

you should cluster when your systems cant handle so many shards.

earnest phoenix
#

Yes

buoyant aspen
#

what's the ratelimit to set a channel's slowmode?

rose warren
earnest phoenix
#

it's a promise, resolve it with promise then pattern or async/await

solemn latch
solemn latch
quartz kindle
#

depends what you mean by "clustering"

#

as that word is used for many things

#

often wrongly

rose warren
#

Ok. Mine's in close to 6k right now. I guess I'm ok for the moment

quartz kindle
#

if you mean spreading your bot into multiple machines, you probably wont need that anytime in the future
if you mean packing more shards in less processes, thats always a good thing to do

solemn latch
#

pretty sure there are bots with over a million servers without clustering right?

#

(spreading over multiple machines)

quartz kindle
#

most definitely

rose warren
#

Ok. Thanks for info. I'm on 5 shards right now and my VPS is handling it fine.

#

Just saw some bots were clustering and was wondering what that meant

quartz kindle
#

most likely they mean the second option i mentioned

rose warren
#

👍

#

How many shards/process is a good idea?

quartz kindle
#

as many processes as you have cpu cores

solemn elk
#
    badge = req[f"{req_id}"]["Request"]
KeyError: "{'Request': 'Actual Scopes :Scopes:', 'User ID': '510736807999307786'}"

I get this error when i use a command which should read the "request" in the "req_id"

My code :

# WHERE I SAVE THE REQUEST AND USER ID UNDER THE "REQ_ID"
    @commands.command()
    async def badge(self, ctx, *, arg):
        channel = self.client.get_channel(798957437398548500)

        with open('requests.json', 'r') as f:
            req = json.load(f)

        num = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
        Id = (''.join(random.sample(num, 6)))
        req_id = Id

        req[str(req_id)] = {}
        req[str(req_id)]['Request'] = f"{arg}"
        req[str(req_id)]['User ID'] = f"{ctx.author.id}"

        with open('requests.json', 'w') as f:
            json.dump(req, f, indent=4)

# THE COMMAND I USE TO ACCEPT THEIR BADGE REQUEST
    @commands.command()
    @commands.has_role('a role')
    async def acceptbadge(self, ctx, req_id):
        with open('prof.json', 'r') as f:
            acc = json.load(f)

        with open('requests.json', 'r') as f:
            req = json.load(f)

        member_id = req[f"{req_id}"]["User ID"]

        member = self.client.get_user(member_id)

        req_id = req[f"{req_id}"]

        badge = req[f"{req_id}"]["Request"] # THE ERROR IS ON THIS LINE

        current = acc[f"{member.id}"]["Badges"]

        if current == 'None :NoVerify:':
            acc[f"{member.id}"]["Badges"] = f"{badge}"

        else:
            acc[f"{member.id}"]["Badges"] = f"{current}\n{badge}"

        req.pop(f"{req_id}")

        with open('prof.json', 'w') as f:
            json.dump(acc, f, indent=4)

        with open('requests.json', 'w') as f:
            json.dump(req, f, indent=4)
solemn latch
#

hastebin plox

quartz kindle
#

nice wall of text lmao

solemn elk
#

lmao alr hastebin

rose warren
quartz kindle
#

thats one option i guess

#

but its not hard to make it yourself

solemn elk
proven lantern
#

are all discord ids 17-18 digits long? /\d{17,18}/

rose warren
#

Ok. I'll start looking into it. Bot is joining about 1k new servers / month I just don't want it to get out of hand and wake up too late 😂

quartz kindle
#

i think they're up to 19 digits now

earnest phoenix
#

realistically, 20

quartz kindle
#

the number of digits increases as time passes, because of the timestamp component

proven lantern
earnest phoenix
#

20 would be the max

quartz kindle
#

20 should be good for what? a few decades?

earnest phoenix
#

yup

#

up until like 21xx

quartz kindle
#

nice

solemn latch
#

someones planning to have their bot up a long time pogey

quartz kindle
#

assuming discord will ever last that long

#

:^)

sudden geyser
#

like take discord's epoch, see when the max ID could come out and boom

proven lantern
sudden geyser
#

censoring IDs 🤔