#development

1 messages ยท Page 1828 of 1

quartz kindle
#

member = await guild.members.fetch(id)
await member.roles.remove()

cinder patio
#

Don't you need the members intent to fetch members

#

or

quartz kindle
#

not to fetch one

cinder patio
#

oh ok

quartz kindle
#

you can fetch up to 100 members without the intent

#

either by ids, or by query name

cinder patio
#

๐Ÿ‘Œ

jovial nexus
rocky hearth
#

help me with this plz?

rocky hearth
quartz kindle
jovial nexus
quartz kindle
#

just do .cache.get()

jovial nexus
#

like:

                        let guild = client.guilds.cache.get(a.guildID)
                        
                        let member = await guild.members.fetch(a.userID)

                        member.roles.remove(roleID).catch(console.error)
quartz kindle
#

and you dont need await for that

jovial nexus
quartz kindle
#

you dont need await for .get()

#

.cache.get()
.fetch()

quartz kindle
#
function generate2DArray<T = null>(row: number, col: number, fillWith: T) {
  return Array.from(Array(row), () => Array<T>(col).fill(T))
}
quartz kindle
jovial nexus
#

thank you

lethal trout
#
setTimeout(() => {....}, 10000) message.channel.send('time up')``` 

When i do this, it directly sends time up before 10s can get over
boreal iron
#

Put your msg.send method inside the timeout or await the timeout.

#

The script will always continue if you don't await a function

signal estuary
#

How can I detect spam from a user? Thats a short question but I cant find sth in the internet for this

wooden kindle
#

to get a image on .setAuthor is it .setAuthor("AUTHOR NAME", Link To Image")

#

or am i wrong

boreal iron
summer torrent
#

x messages in x seconds

boreal iron
#

That's a very basic method, yeah

summer torrent
wooden kindle
#

thanks

signal estuary
#

How can I detect spam from a user?
Like for example:"
s
s
s
s
s
s"
Here you are sending much messages behind each other in a short time span. And I want to detect that when you are sending messages too much

summer torrent
split hazel
#

you just said exactly what he said

#

not too helpful

signal estuary
#

I want to check the time between the last message from the user to the next message from the user

split hazel
limber mica
#

Let is the best JS variable type. Prove me wrong

summer torrent
#

there is no such thing as "best"

limber mica
#

Check if the message contents are equal to the prompt.

earnest phoenix
earnest phoenix
#

Ight imma make it better

limber mica
grim sundial
#

like, uh. what would happen for this event to be dispatched

#

i think thats worded better

limber mica
#

What lib are you using

copper cradle
#

None

grim sundial
#

i mean, uh. how would i make this event get dispatched

#

im so bad with words

earnest phoenix
#

It would be dispatched when you disconnect from discord and then reconnect your websocket with the last s key you received

grim sundial
#

none

copper cradle
#

Those are the situations where it'd get dispatched

earnest phoenix
grim sundial
#

im trying to ask, how would i do this

knotty zodiac
#

just to clarify, when i mention a role in an embed, they wont see a ping on the channel will they?

grim sundial
#

like

earnest phoenix
#

No they wont

knotty zodiac
#

ok good

earnest phoenix
#

Unless you put it anywhere outside the embed, pings wont trigger anything

#

Anything meaning notifications and users

grim sundial
# copper cradle
  1. how would i not initialise a session
  2. how can i make the gateway not resume previous session
  3. how would i invalidate an active session

?

#

is my question

copper cradle
#

I have no idea tbh

#

That's something on their side I believe

grim sundial
#

oh? i must've got this event mixed with another then

earnest phoenix
#

Umm
The s key which you receive on every event must be sent back to reconnect

#

Otherwise discord wont be able to know which events you missed

grim sundial
#

wut

#

"every event must be sent back to reconnect" "discord wont be able to know which events you missed" ?

quartz kindle
#

discord will send you the reconnect event at least once every 4 hours

#

it can be much faster tho, for example within 15 minutes

#

it depends on when their servers need load balancing

grim sundial
#

this is a wild guess now

#

thats why eris sometimes disconnects you, because the data they r sending is wrong or something like that?

copper cradle
#

Let your computer running for 7 hours, you should get the event at least 2 times

quartz kindle
#

wdym the data is wrong?

grim sundial
#

im not sure, maybe the opcode or d is wrong

#

well, that seems too simple of a mistake to make for a library with that many people using it to make, but maybe something like this?

quartz kindle
#

i doubt they have something wrong in their websocket code

grim sundial
#

yeah. ๐Ÿคท

quartz kindle
#

could you explain what you mean better? im not sure i understand exactly what your question is

grim sundial
#

oh its fine, its already been answered

quartz kindle
#

alright then

grim sundial
#

idk whats goin on with my english today tbh

quartz kindle
#

xD

rose warren
#

Tim do you know why connected shards will sometimes randomly time out and reconnect using discord.js for no apparent reason?

terse finch
#

not sure if anyone has any experience with discord.js-commando module for node js but im having the following issue.
Code with issue

hasPermission(message) {
        roleList.find({Guild_id: message.guild.id}).then(roles => {
            console.log(roles[0].Roles) //first line output
            const b = (message.member.roles.cache.some(role => roles[0].Roles.includes(role.name)))
            console.log("Has permission?", b) //second line output
            return b
        })
}

OUTPUT

["canban","bot"]
Has permission? true

yet when i run the command i get:

You do not have permission to use the <command> command.

my roles that i have for testing are "canban" so it should be allowed, the code thats running has worked previously.

any suggestions

quartz kindle
#

reconnect resume is normal

rose warren
#

Like that

quartz kindle
#

ah

#

that happens if your shard takes too long to start

#

you can increase the timeout in the manager

#

to wait longer

rose warren
#

Yeah but they're already started

spark flint
#

discord.ext.commands.errors.ExtensionNotFound: Extension 'TopGG' could not be loaded.

quartz kindle
#

is there any mass disconnection event?

#

like bot restart?

rose warren
#

Yeah just one shard, randomly. I get the error for one shard, 30s later it reconnects and all clear.

quartz kindle
#

are you using child process or worker thread?

#

regular sharding manager or something like kurasuta?

rose warren
#

Regular sharding with sharding manager

quartz kindle
#

so it looks like something is causing the shard process to die

#

and then its respawned by the manager

#

and for some reason it takes too long to respawn

rose warren
#

I have timeout set to -1

quartz kindle
#

where? in the manager?

rose warren
#

Yeah

#
manager.spawn(this.totalShards, 5500, -1)```
quartz kindle
#

djs v12 or v13?

feral aspen
#

Tim.

#

Have you experienced this bug before.

earnest phoenix
feral aspen
#

I console logged an unknown variable.. it's not erroring in VSC.

rose warren
#

v12

earnest phoenix
rose warren
earnest phoenix
feral aspen
quartz kindle
#

its only used for the initial spawns

rose warren
#

Ah

quartz kindle
#

so its a respawn that is timing out

#

are multiple shards respawning at the same time?

rose warren
#

It's weird though. It times out once and reconnects on the second try

quartz kindle
#

do you have anything that runs process.exit() on broadcastEval or something?

rose warren
#

Nope

#

Only the restart command but only I can run it

quartz kindle
#

does the restart command do that?

#

process.exit() on broadcastEval?

rose warren
#

It does process.exit() but not on broadcastEval

#

So it would only restart one shard

quartz kindle
#

so nothing that restarts multiple shards at once?

rose warren
#

Nope

#

But in this scenario, it's only one shard that shows that timeout error, then reconnects immediately

#

Just randomly for no reason in the middle of the day / night

#

No other shards affected

quartz kindle
#

yes, the reason im asking is that when respawning, the shards are not aware of other shards. so if two respawn at once, one will fail, then wait 5 seconds before it retries

rose warren
#

For example

cinder patio
rose warren
#

Or this... No errors.

copper cradle
#

If you try to access a member on that variable it will error

quartz kindle
feral aspen
rose warren
#

That would really flood my logs ๐Ÿ˜…

quartz kindle
copper cradle
#

Why don't you show us what's actually happening instead of just telling us random things?

rose warren
#

It rarely happens too so I'd be sitting around all day waiting for it to happen, but I guess it's the only way to start looking

quartz kindle
#

you can also silently collect them, then log the last 10-20 of them with process.on("exit")

#

another thing you can do

#

if all you want is hide the problem

#

is override shard._handleError

#

and add -1 to the timeout there too

#

xD

rose warren
#

๐Ÿคฃ

#

I'll try the debug first. Thanks for the suggestions!

feral aspen
#

Hello. ๐Ÿ‘‹

#
message.channel.send(meow);
#

I didn't define meow but it's not erroring.

#

In summary.. my VSC isn't showing any errors no matter what I did.

copper cradle
#

Why don't you show us what's actually happening instead of just telling us random things?

feral aspen
#

I stated my issue.. but you're asking for more.

wooden kindle
#

any1 know any open source stuff for select commands i want to see because i dont really understand them

quartz kindle
quartz kindle
#

do you have eslint?

#

vsc by default doesnt do that kind of checks

#

it does some, but many things are missing

feral aspen
#

It's supposed to say in log meow is not defined

#

Right?

quartz kindle
#

which log?

feral aspen
#

The terminal.

quartz kindle
#

when it runs?

feral aspen
#

Yes.

quartz kindle
#

then its not vsc's fault lol

feral aspen
#

If I run this...

message.channel.send(meow);
#

It is supposed to say in terminal "meow" is not defined, since I didn't define it.

quartz kindle
#

depending on the context, it can simply turn into undefined

#

it will error if you use strict context

feral aspen
#

The VSC itself won't show errors.

#

I'm not able to fix it.

quartz kindle
#

try adding "use strict" to the top of your file

feral aspen
#

Doesn't work..

#

Give me a code that makes an error.

#

A line of code.

quartz kindle
#

if you want to cause an error, just use throw

#

throw "lol"

feral aspen
#

Doesn't work. ๐Ÿ˜‚

quartz kindle
#

wut

#

wdym doesnt work

feral aspen
#

THATS MY ISSUE. ๐Ÿ˜‚

#

It's not showing the error.

quartz kindle
#

then your code is not even running

feral aspen
quartz kindle
#

how do you know?

feral aspen
#

I added console.log('test') to make sure.. it did log.

#

.. but not erroring? ๐Ÿค”

quartz kindle
#
console.log("test");
throw "lol";
#

no error?

#

do you have a try / catch?

feral aspen
#

Nope.

#

It didn't work.

copper cradle
#

They want an undefined variable to throw an error

feral aspen
#

I want to legit make an error.

#

It's not working.

copper cradle
#

Without them actually doing anything

#

Like

feral aspen
#

It's not my command handler problem.

#

It started yesterday.. and I didn't touch VSC for 2 days.

quartz kindle
#

do you use child process? sharding manager?

feral aspen
#

No.

quartz kindle
#

i'd need to see your code then

feral aspen
#

I'm legit searching for the solution..

feral aspen
feral aspen
cinder patio
#

Are you sure you're not catching the error somewhere

quartz kindle
#

and you just run node thatfile.js?

cinder patio
#

so you're not sure?

feral aspen
#
const { MessageEmbed } = require("discord.js");
const { black } = require("../../other/texts/colors.json");

module.exports = {
    config: {
        name: "customcommand",
        aliases: [],
        usage: "!customcommand",
        category: "owner",
        description: "Custom command by the Founder of the bot!",
        noalias: "No Aliases",
        accessableby: "Developers"
    },
    run: async (bot, message, args) => {

        if (!message.channel.permissionsFor(message.guild.me).has(['VIEW_CHANNEL', 'SEND_MESSAGES', 'EMBED_LINKS'])) return;

        if (message.author.id != "528256079101034506") return;

        console.log("test");
        throw "lol";
    },
};
#

.. errors? NOPE.

#

Idk why. ๐Ÿ˜ญ

quartz kindle
#

show where you run command.run()

feral aspen
#

It's not the command handler.

quartz kindle
#

just show it

feral aspen
#

It's the same for other projects outside Discord.

#

For python

#

.. and other stuff.

#

It's my VSC.

cinder patio
#

What if you use the terminal instead of the VSC one

feral aspen
#

I'm 100% positive it's my VSC.

feral aspen
#

It's not showing.

cinder patio
#

then it's not VSC?

quartz kindle
#

if running it in cmd does the same thing, then its not vsc

feral aspen
#

I'm trying to find the setting.

#

Can't seem to do so.

quartz kindle
#

i mean

#

dont use vsc

#

use the windows cmd

#

or powrshell

#

or whatever

feral aspen
#

I'll just do that now.

quartz kindle
#

and run there

wheat mesa
#

I prefer to develop my bots entirely within windows powershell of course

feral aspen
#

The logs.

#

It logged test.

quartz kindle
#

ok

feral aspen
#

.. but no error.

quartz kindle
#

now can you show the command handler?

cinder patio
#

then it's your code

quartz kindle
#

where you use command.run()?

#

just to confirm

feral aspen
#
const { MessageEmbed } = require("discord.js");
const { red } = require("../../other/texts/colors.json");
module.exports = async (bot, message) => {
    if (message.author.bot || message.channel.type === "dm") return;

    if (!message.content.startsWith(prefix)) return;

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

    let commandfile = bot.commands.get(cmd) || bot.commands.get(bot.aliases.get(cmd));
    if (commandfile) try {
        await commandfile.run(bot, message, args);
    } catch (error) {
        return;
        // console.log(err);
    };
};
quartz kindle
#

lol

#

you literally

#

have a try catch

#

there

#

...

cinder patio
#

๐Ÿ˜ฉ

vivid fulcrum
#

that indentation

#

yikes

quartz kindle
#

its not bad

#

you've seen plenty that are actually bad

cinder patio
#

I think it's discord formatting it like this

vivid fulcrum
#

python

#

for legal reasons, this is a joke

quartz kindle
vivid fulcrum
#

mobile seems to have gotten syntax highlighting for most languages now

feral aspen
#

.. what should I put instead.

vivid fulcrum
#

at least on android

feral aspen
#

if (commandfile) await commandfile.run(bot, message, args);

#

??

cinder patio
#

you should understand what try-catch does

quartz kindle
wheat mesa
# vivid fulcrum that indentation
const {MessageEmbed} = require("discord.js");const {red} = require("../../other/texts/colors.json");module.exports = async (bot, message) => {if(message.author.bot || message.channel.type === "dm") return;if(!message.content.startsWith(prefix)) return;let args =message.content.slice(prefix.length).trim().split(/ +/g);let cmd =args.shift().toLowerCase();let commandfile =bot.commands.get(cmd) || bot.commands.get(bot.aliases.get(cmd));if(commandfile)try{await commandfile.run(bot, message, args);}catch(error){return;;};};
feral aspen
wheat mesa
quartz kindle
feral aspen
wheat mesa
#

best readability on the planet

quartz kindle
#

catch() {} gives you the error

#

then yuo have to do something with it

#

you put a return there and nothing else

#

so it does nothing

feral aspen
#

It used to show the error a long time ago.

quartz kindle
#

you have a console.log there, but you commented it out

#

and put return in front of it

wheat mesa
#

Anything below that return won't be run

quartz kindle
#

neither stuff in comments

feral aspen
#

I've never been more confused.. but this is fixed.

wheat mesa
#

What are you confused about?

#

try {
  // Code
} catch(e) {
  // do stuff with e (your error) here
}
feral aspen
#

.. why not now.

quartz kindle
#

no?

#

you probably had it console.log before

feral aspen
#

.. not it errors.

feral aspen
#

I haven't touched this file for 5 months. ๐Ÿ˜‚

quartz kindle
#

and you removed the console.log at some point

cinder patio
#

sigh

feral aspen
#

.. and between those 5 months were legit errors showing..

cinder patio
#

what kind of errors

quartz kindle
#

there are other ways errors can happen

cinder patio
#

give an example

quartz kindle
#

that try catch wont catch all errors

#

for example unhandled rejections

feral aspen
#

Previous errors were like 14 lines while this is 3.

quartz kindle
#

they were probably unhandled rejections

#

and unhandled rejection wont be caught by that try catch

feral aspen
#

Hm.

quartz kindle
#

unhandled rejection happens when you dont await a promise, and also dont put .catch() on it

copper cradle
#

Gotta love how this person here is asking for help but denying every solution they're given

earnest phoenix
#

How to delete a message by using id

feral aspen
#
Discord.Boats, successfully posted your server count.
(node:10824) UnhandledPromiseRejectionWarning: TypeError: this.clean is not a function
    at Object.run (C:\Users\hajji\Desktop\Attitude Database\src\commands\owner\eval.js:61:66)
    at module.exports (C:\Users\hajji\Desktop\Attitude Database\src\events\guild\message.js:35:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:10824) UnhandledPromiseRejectionWarning: 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 `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

Previous errors be like.

cinder patio
#

um, doesn't try-catch catch unhandled rejections? At least when the method is awaited

quartz kindle
#

yes, unhandled promise rejection

cinder patio
#

they await it

quartz kindle
#

they're talking about other errors they had before

#

that were not being caught

feral aspen
quartz kindle
#

yes

#

a promise rejection is converted to an actual error when you await it

#

then you can catch the real error

#

promise rejection is basically an "unknown error"

last tapir
#

wait

quartz kindle
#

so when you await the promise, you have access to the real error

last tapir
#

what is better, to show the unhandledrejection error or the referenceerror?

quartz kindle
#

the reference error

feral aspen
#

Ohhh...

#

.. wait, so from the unhandled rejection error is where you can get the reference error?

quartz kindle
#
async function something() { throw "lol"; }

throw "lol" // error and will crash the process
try {
  throw "lol"; // normal error
  await something() // normal error
  something().catch(console.log) // normal error caught in the catch() instead of the try/catch
  something() // unhandled rejection, we dont know where, what, when this error came from. can crash the process.
} catch(e) {
  console.log(e) // no crash because the errors are caught
}
feral aspen
#

I need to put this in my notes.. this is so helpful. ๐Ÿ‘

terse finch
#

So new question for whoevers got a sec. is there anything special i need to to with the discord.js-commando module to capture and do something with the client.on('guildMemberAdd') event?

quartz kindle
#

you can try asking in the discord.js server

terse finch
terse finch
quartz kindle
#

most people make their own command handlers

terse finch
#

makes sense

quartz kindle
#

since its not a hard thing to do

terse finch
#

no

#

its not

#

and i had one but i was following along with a tutorial and it said "Scrap the perfectly fine command handler we used to have and try out this module".

#

and its been nothing but headaches :(

quartz kindle
#

lel

terse finch
#

๐Ÿฅฒ

quartz kindle
#

rip

terse finch
#

good thing ive can go back through my git commits and recover the old one

quartz kindle
#

good thing you are prepared xd

terse finch
#

yeah well i do it compulsively for work using git for everything. so its just kinda a habit

quartz kindle
#

i coded for years without github, just uploading backups to google drive

#

xd

terse finch
#

using proper git commits, staging, etc. helps out in the long run

terse finch
#

and they were all copies of what i was working on so i could go back and see what changed

quartz kindle
#

lmao

feral aspen
#

Tim quick question.

feral aspen
#

Both those in the try {} will be handled by the catch, right?

quartz kindle
#

if something is sync, yes

#

if something is async, then only if its awaited

#

if you're asking about the order/number or errors, only the first error is caught

#

if you have multiple errors, only the first error is shown

#

if... my messages start with too many ifs

feral aspen
#

.. so the lines that are handled with catch(e) are.. ?

quartz kindle
#

throw lol and await something

feral aspen
#

Sweet.

quartz kindle
#

the third one is handled by the .catch()

feral aspen
#

Yup.

quartz kindle
#

the fourth is not handled by anything

feral aspen
#

.. but doesn't it get handled by catch(e)?

#

.. or since it's a function that creates an error?

quartz kindle
#

the fourth is async

#

if async is not awaited, its not caught

copper cradle
#

It's called unhandled for a reason

feral aspen
#

OH.. yes. ๐Ÿคฆโ€โ™‚๏ธ

#

Yup yup.. makes sense.

#

Async functions must be awaited to be handled, or else, we won't know where it came from.

quartz kindle
#

yes

feral aspen
#

Yes.. makes sense.. thank you. ๐Ÿ‘

quartz kindle
#

if they are not awaited, they can still be handled with a .catch()

#

but if they have neither one nor the other, then its an unhandled rejection

#

basically

#

async functions are something that happen "later"

#

not right now

#

so if you await, you tell the code to wait until it finishes, so it can handle the result here and now

#

if you dont await, then the code will deal with it later

#

.catch() handles it later

#

if its not awaited, then it checks later, and if later it doesnt see a .catch() it has nowhere to go and explodes

robust fern
#

how do i make this into a circle using canvas in discord.js javascirpeijgnls trs gjngstr jn

#

๐Ÿ‘

#
const avatar = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
    context.drawImage(avatar, 25, 25, 200, 200);```
#

imgage

#

its not circling

feral aspen
feral aspen
eternal osprey
#

should the port be speccified in the redirects oauth2 tab?

quartz kindle
feral aspen
#

Sweet.

quartz kindle
#

so its transparent background with a black circle, with the discord logo in the center?

quartz kindle
#

if no port is specified, port 80 will be used for http, and port 443 will be used for https

#

so if your backend is running on port 80, you dont need to specify

robust fern
#

the white discord logo thing, its the persons avatar but its square

#

how do i make it into a circle

obtuse stone
#

im trying to make a discord login method for my site but whenever i login it takes me back to the login page again

#

its something to do here, it thinks im not authenticated

#

can anyone help me?

quartz kindle
#

what is isAuthenticated?

obtuse stone
#

its ok i fixed it

shadow frigate
#

Why does discord show embeds like this on iPhone?

quartz kindle
#

how else would it show?

shadow frigate
#

but it's all indented

#

and awful lookin'

quartz kindle
#

how does it show on desktop?

shadow frigate
#

does it for all embeds like this

#

showing my help commands

#

kinda off putting when most of my users are mobile users

quartz kindle
#

looks like the emoji its fucking it up

#

try removing the emoji

shadow frigate
#

I don't think it is lmao

quartz kindle
#

try it

shadow frigate
#

I can show u my other embed messages, they do the same

quartz kindle
#

sure

shadow frigate
#

Uh

#

I canโ€™t post the image

#

My phone being stupid

#

One sec

#

Here

quartz kindle
#

can you show the code for the embed?

shadow frigate
#

Yuh

#
if(["economy", "eco"].includes(args[0].toLowerCase())) {
    var embed = new Discord.MessageEmbed()
    .setTitle("HentaiCord ใƒป Command List [Economy]")
    .setDescription(`
      Each command you use will earn you a random amount of cash from $1 to $5 (or $5 to $10 if you're [premium](${settings.links.premium})).
      You can use this cash to purchase items from our store, or save up and become the richest user in the world.

      \`balance\` - Check the balance of a user on the server
      \`withdraw\` - Withdraw cash from your bank account
      \`deposit\` - Deposit cash into your bank account
      \`inventory\` - View your owned inventory items
      \`shop\` - View inventory items you can purchase
      \`buy-premium\` - Buy premium for one million hentaibux
    `)
    .addField("Fun", `
      \`rob\` - Attempt to rob a user on the server
      \`bankrob\` - Become an accomplice of a bank robbery
      \`slots\` - Try your luck on the slot machines
      \`coinflip\` - Flip a coin and win easy cash
    `)
    .setColor(settings.bot.embed_color)
    .setImage(`http://${settings.server.host}:${settings.server.port}/assets/hentaicord-banner.jpg`)
    return message.channel.send(embed).catch(console.error);
  }
#

kinda weird cos it's discord

#

i can pastebin it?

#

or just zoom out :P

#

it's not an issue with code, it's a bug with discord lmao

#

it's always done it for iphone

#

well for me at least

quartz kindle
#

try this

#
    .setDescription(`
Each command you use will earn you a random amount of cash from $1 to $5 (or $5 to $10 if you're [premium](${settings.links.premium})).
You can use this cash to purchase items from our store, or save up and become the richest user in the world.

\`balance\` - Check the balance of a user on the server
\`withdraw\` - Withdraw cash from your bank account
\`deposit\` - Deposit cash into your bank account
\`inventory\` - View your owned inventory items
\`shop\` - View inventory items you can purchase
\`buy-premium\` - Buy premium for one million hentaibux
    `)
#

remove the indentation from the text itself

shadow frigate
#

๐Ÿคž

#

OH MY GOD

#

I ACTUALLY THINK THATS IT

#

BRO IM SO STUPID

#

i think anyway

#

lol

quartz kindle
#

xD

shadow frigate
#

worked, your an actual legend

#

i really didn't think that it would matter for those indentations.

#

clearly it does lmao

quartz kindle
#

ye

#

multiline strings include everything inside them

shadow frigate
#

damn

quartz kindle
#

discord is supposed to ignore those, but for some reason it doesnt on iphone

lucid prawn
#
  if(message.author.bot) return;
   const args = message.content.slice(prefix.length).split(/ +/);
  const packmode = db.fetch(`pack_${message.guild.id}`)
    const packmode2 = db.fetch(`pack_${message.guild.id}`)
  const responses = ["test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3", "test", "test3"]
  if(packmode2 == false) return console.log("Packmode off")
if (packmode == true && message.mentions.has(client.user.id))
  var response =  responses[Math.floor(Math.random() *  responses.length)];
   message.channel.send(response)

it spam when someone say smth in chat

quartz kindle
#

are you checking for prefix?

#

that code is not checking if the message starts with the prefix

errant flax
#

lel comrninuty

rocky hearth
bright thorn
#

when i selected one menu its not woring

#

like infrastructure failed

#

?

wheat mesa
#

post the full error

lethal trout
limber mica
#

Use a .then statement with a delay

#

And then return afterwards

rocky hearth
limber mica
#

A settimeout function should work

lethal trout
lament isle
#

anyone know how to make links/titles appear blue?

#

all my links are White

limber mica
lament isle
lethal trout
earnest phoenix
# lament isle anyone know how to make links/titles appear blue?

[Hyperlink text](Hyperlink URL), although you can't make field names appear as a hyperlink as they don't accept markdown, you can however make the embed title appear as one, and the one you showed on the screenshot uses them in the description of the embed

limber mica
wheat mesa
#
collector.on('end', collected => {
    // Do stuff with collected messages after it ends
});
#

You can specify time when creating the collector, ex:

const collector = message.channel.createMessageCollector(filter, { time: 15000 });
long crow
#

Not sure if this changes going more readable or burn someone eyes seeing it

rocky hearth
#

for selectmenu, how many max options can I make?

long crow
#

25

#

Here some documentation on it

earnest phoenix
#

@lyric mountain hit my dms when u are online I need to ask something ๐Ÿ˜ณ

wicked pivot
#

hello, I ask myself a question a bot can edit a message anytime? even in a year if I have to as long as I have the message id ??

long crow
#

No idea really

wooden dust
#

I think so

#

As long as the message is still in the channel you should be able to edit it Thonk

bold coyote
#

hello!
i have a doubt...
How to add the guild_count attribute in an event in my dpy bot?

This is my code for main.py

import os
import discord
from discord.ext import commands

intents = discord.Intents.all()

bot = commands.Bot(command_prefix='?', 
                   help_command=None, 
                   activity=discord.Game("?help"),
                   intents = intents)

#HANDLING COGS
#Loading all cogs at the start
for i in os.listdir('./cogs'):
    if i.endswith('.py'):
        bot.load_extension(f"cogs.{i[:-3]}")

#RUN
TOKEN = os.getenv('DISCORD_MYBOT_TOKEN')
bot.run(TOKEN)
#

what do i have to import, what do i have to add?

round cove
#

There's no way to limit who can run slash commands right? lol

#

I guess I could do stupid shit like fetching the member object and checking with that but so much work >:(((

long crow
round cove
#

Jeez.

#

"Just make each command a guild command"

earnest phoenix
#
 const brainy = client.guilds.cache.get('838360776212611103')
 var category = brainy.channels.cache.get("838360776694562836");
 brainy.channels.create(message.author.id, { parent_id: category })
#

it creates the channel but not in the parent category

errant flax
#

itll look like its a field dog_kek

earnest phoenix
errant flax
#

thats what i do with titles and fields dog_kek dog_kek

errant flax
#

do parent instead

earnest phoenix
#

wait did they change it?

errant flax
#

isn't it always like that?

earnest phoenix
#

m touching djs after like 4 months

errant flax
#

either way just replace parent_id with parent

earnest phoenix
#

thx worked

errant flax
#

np

#

making a logging system is pain dog_kek

pale vessel
#

Yeah I just realized what you meant. Same here.

#

How can this be an issue ๐Ÿ˜ฉ

#

It's hard to spam $wa with Mudae now ๐Ÿ˜”

#

Have to press enter like 5 times

earnest phoenix
#
message.channel.parentID ==="838360776694562836"
#

when i pull this to a if statement, it doesnt works

#

but if i eval same it works

#

also parentid is returning null

#

but in eval it works fine

errant flax
#

what version u using?

earnest phoenix
#

12.5.3

rigid maple
#

no matter what i do i can't increase the size of the text
(I print the variable with fillText, make it an image, add it to the main canvas and adjust its size, but it doesn't change at all) Please don't ask fontStyle to increase the size of the font, I want to enlarge it according to the data I have (x, y, scaleX, scaleY, width, height)

wheat mesa
#

Ugh why do slash commands take so long to load

earnest phoenix
#

scam

#

@round cove

#

lmao everyone ping

rigid maple
#

lmao

earnest phoenix
#

Guild commands update instantly tho

rigid maple
#

Hey! I apologize for the tag, but when we print a text on canvas and upload it as an image on another canvas, we can't adjust its size.

gloomy fulcrum
#

Hi, I'm currently developing a bot and beta testing it with a DO droplet. The bot itself is deployed using docker-compose. Dev image has OK-ish latency, however Prod image has about 3-4x latency compared to Dev image, even though dev machine has much worse network and Prod image is much smaller.

How should I diagnose the latency problem?

mild agate
#

is it possible to get the ip of an ngrok host?
I got a phishing sms and I wanted to track the ip.... it is using ngrok

rigid maple
#

it keeps giving me a 36px bold calibri text

#

While I was wondering if I had the problem elsewhere, I did this

        var canvas = Canvas.createCanvas(1020, 306);
        var ctx = canvas.getContext('2d');
#

The 2 values โ€‹โ€‹at the end of the drawImage give no response

#

What can I do ?

earnest phoenix
#

Is this Wrong;

    message.channel.send(` ${message.guild.iconURL( dynamic:true )}`)```
?
#

Maybe I am out of date lol, haven't coded a bot in a month...

#

yea

#

idk about the dynamic parameter but you can do ```js
message.channel.send(message.guild.iconURL({ dynamic: true}));

#

I knew I needed another {} somewhere LOL

#

Ty

rigid maple
earnest phoenix
#

How can I fetch the entire member list (including offline people) and execute a command on them like add a certain role to everyone?

        await message.guild.members.fetch()

This is what I have right now but I can't figure out how to make it give people roles.

feral aspen
feral aspen
rigid maple
near stratus
#

You're gonna get ratelimited if you try giving role to each member of a big server

#

Like 20k requests in a minute
that's api abuse

rigid maple
#

use Interval

earnest phoenix
#

The server isn't big and I can space them out

near stratus
feral aspen
rigid maple
#

I think 5 second interval is enough. (I'm not sure exactly)

near stratus
rigid maple
#

Akio Do you know canvas?

near stratus
#

Nah I'm scared of it to be exact

earnest phoenix
#

For it to like cool down

near stratus
earnest phoenix
#

By "to get back to normal" you mean the bot will be very limited on sending requests?

near stratus
near stratus
earnest phoenix
#

Oh

#

Will it be api abuse if I create a "throwaway" bot to do this

solemn latch
#

Yes

earnest phoenix
#

Guess I'll have to go for interval then

feral aspen
#

How to get the size of announcement channels in a guild? Below is channels in total.

#
const amount = message.guild.channels.cache;
vale garden
#

hi

#

so i wanted to add dropdowns to my bot

#

i found a package which does it something like this

await ctx.send(
        "This message has a select menu!",
        components=[
            SelectMenu(
                custom_id="test",
                placeholder="Choose up to 2 options",
                max_values=2,
                options=[
                    SelectOption("Option 1", "value 1"),
                    SelectOption("Option 2", "value 2"),
                    SelectOption("Option 3", "value 3")
                ]
            )
        ]
    )
#

but on using it i got this error
TypeError: send() got an unexpected keyword argument 'components'

pale vessel
feral aspen
#

Where did you get the type list, from?

feral aspen
#

Sweet.

last tapir
#

hey

#

is there a way to get the url of a server icon

#

wait.. sec

earnest phoenix
feral aspen
#
<guild>.iconURL({ dynamic: true, size: 4096, format: 'png' })
last tapir
last tapir
feral aspen
last tapir
#

๐Ÿ‘ ๐Ÿ‘

earnest phoenix
#

How to use iframes in my long description?

pale vessel
#

By using HTML

earnest phoenix
#

ok

#

I want to display my website in the description btw

pale vessel
#

Yeah

#

The description supports HTML

earnest phoenix
#

Is it like

<iframe src="link"></iframe>```
pale vessel
#

TIAS

vivid fulcrum
#

i was gonna ask if anyone tried iframing a WASM site

#

but then i remember you need js to load the WASM in the first place

earnest phoenix
slender thistle
#

Which then does everything

vivid fulcrum
#

yes but that's again, js

#

you can't run any js at all in the desc

#

even from an iframe

slender thistle
#

Lame

#

Well, yes and no

umbral lake
#
      const userInfoEmbed = new Discord.MessageEmbed()
        .setColor(color)
        .setTitle('Voici tes informations !')
        .addFields(
          { name: 'Pseudo', value: `${message.author.tag}` },
          { name: 'ID', value: `${message.author.id}` },
          { name: 'Crรฉation du compte', value: `${moment(message.author.createdTimestamp).format('LT')} ${moment(message.author.createdTimestamp).format('LL')} (${moment(message.author.createdTimestamp).fromNow()})` },
          { name: 'Badges de Synapse', value: `${dataperso}` },
          { name: 'Nombre de commandes exรฉcutรฉes', value: db.get(`commandenombre_${message.author.id}`) },
          { name: 'Arrivรฉe sur le serveur', value: `${moment(message.member.joinedTimestamp).format('LT')} ${moment(message.member.joinedTimestamp).format('LL')} (${moment(message.member.joinedTimestamp).fromNow()})` },
          { name: 'Rรดles', value: `${roles}` }
        )
        .setThumbnail(message.author.displayAvatarURL({ dynamic: true }))
        .setTimestamp();
         axios.get(`https://discord.com/api/users/${message.author.id}`, {
          headers: {
              Authorization: `Bot ${message.client.token}`,
          },
      }).then((res) => {
          console.log(res.data)
          const { banner } = res.data;
          console.log(banner)
          if (banner) {
              const url = `https://cdn.discordapp.com/banners/${message.author.id}/${banner}`;
              userInfoEmbed.setImage(url)
          }
      })
      message.channel.send(userInfoEmbed);

When I have a banner, the bot needs to add the image to the embed, but not works without errors

pale vessel
#

Discord doesn't expose about me/banners in the bot's user endpoint

#

Ah

#

They do now

#

Only banner

#

Add the extension e.g. .png

#

Embeds require it even though you don't actually need it Nah it works even without the extension so something else is wrong

umbral lake
#

@pale vessel not works oof and no error

#

the embed is here but not the image

pale vessel
#

Try logging the URL

delicate shore
#

Guys please guide me

#

what should I use for Machine learning in NodeJS

#

I tried BrainJS and it didnt work

#

Tensorflow too difficult for me

obsidian flint
#

tensorflow.js

delicate shore
#

bruh

#

anything except these 2?

obsidian flint
opaque seal
#

In my bot website I want to open a window for users to login and then once they do get them back on the main window. What is the usual way of doing this?

opaque seal
#

?

obsidian flint
delicate shore
obsidian flint
#

or url (but idk for sure lemme check)

opaque seal
#

/ tab

obsidian flint
#

the same website

#

you go to the place, requesting for login/sign up

#

you get to the site

boreal iron
#

Just donโ€™t open a separate window aka. as popup.

opaque seal
#

k

crystal furnace
#

Do top.gg auto post shard stat ?

boreal iron
#

Create a neat login form and redirect the client to whatever site he should go after a successful login.

crystal furnace
obsidian flint
#

prob no I think

crystal furnace
boreal iron
quaint wasp
#

soo.. uhh, I got this:

const serverLog = client.channels.cache.get(modLog);

By the way mod log is defined as an id (string too btw)
and when I use it like serverLog.send() it.... does not recognize the property.

#

(Exact error: Cannot read property 'send' of undefined)

opaque seal
#

Channel is not in the cache ig

marsh bluff
#

maybe the channel is not cached

#

or the channel was deleted

quaint wasp
#

it is not.. I litilery copy paste the id few minutes ago

#

and I can talk in it rn too

marsh bluff
#

try fetching it first and then send a message

quaint wasp
#

fetch?

#

client.channels.fetch() ?

opaque seal
#

are you sharding?

quaint wasp
#

no

opaque seal
#

okay

#

then it should already work like that weird

quaint wasp
#

56 guilds

quartz kindle
#
ctx.drawImage(image, sourceX, sourceY, sourceWidth, sourceHeight, destinationX, destinationY, destionationWidth, desttinationHeight);
#

if the text is 50x50 and you want to resize to 100x100, then it should be image, 0, 0, 50, 50, 0, 0, 100, 100

quaint wasp
rigid maple
opaque seal
quaint wasp
#

copy/download it and then put it in some kind image editor maybe, or photoshop, they usally tell teh sie @rigid maple

quartz kindle
rocky hearth
#

how tf ik whr it is coming from?

long crow
#

The command you initiate

pale vessel
#

Log command uses ๐Ÿ’ช

worthy ivy
earnest phoenix
#

Use console.trace instead of console.log

rocky hearth
#

but I hvnt logged anything

worthy ivy
#

also youre using slash commands?

rocky hearth
#

yes

worthy ivy
#

capital letters arnt allowed

#

probably check for that

earnest phoenix
worthy ivy
rocky hearth
#

I hv, name gameName as one of my option

long crow
#

Nope it not allowed

worthy ivy
#

make it non capital

earnest phoenix
#

use kebab-case instead of camelCase

rocky hearth
#

ok

#

r underscores allowed?

rocky hearth
#

thx

earnest phoenix
#

try checking the docs

pale vessel
opaque seal
#

If someone has any idea about why that's happening I'm glad to hear it

pale vessel
#

^[\w-]{1,32}$

#

A I read it wrong

#

Option

rigid maple
earnest phoenix
#

Option and command names use the same regex for validation

pale vessel
#

Ah

#

So we good?

earnest phoenix
#

I suppose so

#

also i thought characters inside [] get escaped automatically?

#

so how does \w work

quartz kindle
#

you can also use ctx.measureText

rigid maple
#

aaaaaa ok thx

opaque seal
#

Backend

  // this is inside the /auth/id/code route
  println(userData.id) // prints my correct ID: 256851887502917633
  // Send the user ID to frontend to use to retrieve the needed data
  call.respond(userData.id) // note: userData.id is of type String

Frontend

this.$astroAPI.get(`/auth/id/${this.$route.query.code}`)
      .then(res => {
        console.log(res.data) // prints my ID but with an incorrect number at the end: 256851887502917630
        localStorage.setItem('userID', res.data)
        this.$router.push(sessionStorage.getItem('callback')) // not important
      })
      .catch(console.error)

Why is js changing my string?

cinder patio
#

Maybe the respond method parses it to a number?

opaque seal
#

it shouldn't

#

let me check the type

cinder patio
#

What library are you using?

opaque seal
#

ktor

#

res.data is of type number

#

so ktor is doing weird stuff under the hood

cinder patio
#

try sending JSON maybe?

#

that may avoid the parsing

opaque seal
#

it isn't really needed tho

#

but if it's my only option ig

cinder patio
#

just to see

opaque seal
#

nvm

#

respondText(userData.id)

#

is what I needed

rigid maple
quartz kindle
#

dataCTX = dataCanvas.getContext()

earnest phoenix
#

hello

rigid maple
#

hello

quaint wasp
#

hello

earnest phoenix
#

What is it and how do like this
the box

rigid maple
quartz kindle
#

magic

quaint wasp
#

discord dropdowns

earnest phoenix
#

thx

#

to all

rigid maple
#
            ctx.drawImage(dataCanvas, 0, 0, 18, 18, 0, 0, 100, 100);
```There is no problem with this code, right?
clever agate
quartz kindle
rigid maple
#

yes but it doesn't send, only the background remains

quartz kindle
#

do you have anything written in the first 18x18?

#

thats pretty small

rigid maple
quartz kindle
#

you are writing text to datas.x and datas.y

#

so change 0 0 to datas.x datas.y

rigid maple
#

I think it's small because it's a single digit.

#

oh again nothing has changed

#

Could it be because of the size of the dataCanvas?

quartz kindle
#

add ctx.textBaseline = "top";

#

to all your texts

rigid maple
#

ooh one has no top

#

this is top

#

:D

#

yes i solved

#

As you said 18px seems too little.

#

I guess I can't do that :/

errant flax
#

whats the best way to test ur bot without multiple people e_nervous

#

also without needing an alt bonk

errant flax
#

wdym?

summer torrent
#

why

#

just use alt

errant flax
#

eh i kinda lose my favorite emojis and i have to re-fav them again misosface

#

now i said it its kinda a dumb reason misosface

cinder patio
#

you could emulate messages

quartz kindle
# rigid maple

i got the best results with these values:
ctx.drawImage(dataCanvas, DATA X, DATA Y, ctx.measureText(TEXT).width, FONT SIZE, DATA X, DATA Y, NEW SIZE X, NEW SIZE Y);

errant flax
#

wdym emulate?

cinder patio
#

nothing's stopping you from client.emit("message", { content: "Hi" });

#

except, you know, if your command needs message.author then you're gonna get an error so you have to make sure to pass the data the command needs

errant flax
#

hmmm ok ill try that thx

errant flax
#

ill probably just build a message with the message class

quartz kindle
#

dataCTX.measureText

rigid maple
#

ow :/

#

my fault

long crow
rigid maple
#

didn't happen again

cinder patio
#

I don't think so

quartz kindle
rigid maple
#

wow it was

#

thank you so much

quartz kindle
#

๐Ÿ‘

rigid maple
#

sorry i bothered you too

cinder patio
#

@round cove

earnest phoenix
#

Is it allowed to make ads bot like when ppl use !ads command bot will send this server's invite link to another server with much ppl

latent heron
#

@small plume

small plume
#

tyty

latent heron
#

no problem overtime man

shadow frigate
#

I'm making a bot that creates a whole server for one of my fiverr clients.
I'm having issues with getting the roles in the correct order.

So the server is built from a pre-existing template server (don't ask why my client won't just use discord templates, idk.).
I'm using a forEach method to go through the roles and add them to the new server one by one, however, they don't seem to be being placed in the correct order.

Any reason for this?

#

discord.js btw

cinder patio
#

What's in for us?

shadow frigate
#

eh?

#

lmao

#

dunno

#

you are talking to me, yes? @cinder patio

cinder patio
#

mhm

shadow frigate
#

fuck all ๐Ÿ˜‚

#

you feel good for helping someone in need of assistance ๐Ÿ™‚

boreal iron
#

_no cash no help _ KEKW

shadow frigate
#

F

#

looks like i ain't getting help ๐Ÿ˜‚

boreal iron
#

You may wanna provide the code to order the roles.

#

Not anyone has a magical glass ball, you know.

shadow frigate
#

aight chill yer beans lad

#
module.exports = (Discord, client, settings, guild, template_server) => {

  template_server.roles.cache.forEach((template_role, i) => {

    setTimeout(function() {

      guild.roles.create({
        data: {
          name: template_role.name,
          color: template_role.color,
          hoist: template_role.hoist,
          position: template_role.position,
          permissions: template_role.permissions,
          mentionable: template_role.mentionable
        }
      })
      .then(created => { console.log(`[Role] Created '${template_role.name}' role in the server.`) })
      .catch(error => { console.error(`[Role] '${template_role.name}': ${JSON.stringify(error, null, 2)}`) });

    }, i * 5000)

  })

}

#

I'm using setTimeout to stop rate limits

cinder patio
#

The issue is obvious, also you do know that you can just provide an array of roles when you're creating the guilds right?

shadow frigate
#

wait fr?

#

it automatically puts them in the position too?

cinder patio
#

mhm

shadow frigate
#

BET

#

ty

cinder patio
#

If I were your client I would've given you 2 stars

boreal iron
shadow frigate
#

lol

#

same

#

no need to be rood dooooooooooooooooooooooooooooooooooooo

#

gonna stop asking for help in here if ppl continue being like this lmao

#

anyways

#

ranting aside

boreal iron
#

truth can be devastating jokingโ€ฆ

#

You need to know thereโ€™s always a touch of sarcasm in the air in this channel.

shadow frigate
#

I can tell

limber mica
brave nova
#

meh not bad as a server i joined where ppl just wanting copy pasting and gets spoonfeed Proto_LMAO

boreal iron
#

Heโ€™s just passing the arguments when calling the functionโ€ฆ

shadow frigate
#

he is a fiverr creator and people buy servers off of him. He doesn't want to use templates, rather a bot to join the server and create the server for him.

#

Pretty stupid I know, but I get paid so idrc ๐Ÿ˜›

brave nova
#

wait wait wait, created new or edit existing one

shadow frigate
#

No, It joins a server and starts to build the server.

limber mica
shadow frigate
brave nova
#

nice

shadow frigate
#

Yes but the server won't have anything to start with

#

They create a new server, the bot joins, sets up the server, then leaves

limber mica
brave nova
#

yea ik what u meant by tht

shadow frigate
#

It be like dat

#

but issues are discord rate limits

#

give me rate limit errors in console but still create the roles anyway

#

just not in the right order

#

which is the issue

limber mica
limber mica
shadow frigate
#

Nah, GoogleFued said you can specify an array of the roles to create them all at once

shadow frigate
#

ty

limber mica
brave nova
shadow frigate
#

lol

shadow frigate
#

trying to turn the roles.cache into an array

solemn latch
#

Look at the docs, its in there

limber mica
#

โ€ฆ

boreal iron
#

cough .array

shadow frigate
#

not .toArray() ?

earnest phoenix
#

hi mate

brave nova
#

do anyone know how to make 2 prefix for bot Prim_Confused
ive tried using array and or statement

brave nova
earnest phoenix
#

idk

shadow frigate
#

damn

earnest phoenix
#

we are in igp's server

brave nova
#

bunch paster

split hazel
#

but if you're turning the roles into an array just to iterate over it I'd advise to use .values() instead because its much more efficient@shadow frigate

brave nova
sudden geyser
brave nova
#

lemme try usin tht

split hazel
#

you all have similar contrast profiles and it's confusing me

sudden geyser
#

mine looks the best

brave nova
#

im fursona is white so yea

shadow frigate
#
guild.roles.create(template_server.roles.cache.array())
  .then(() => { console.log("created") })
  .catch(err => { console.error(err) });

Only creates one role called "new role"

#

lmao

limber mica
brave nova
limber mica
#

Im on mobile and my internet is trash so i cant see the emojis XD

sudden geyser
#

it looked bad anyway

sudden geyser
shadow frigate
#

Yes

sudden geyser
#

You can't do that efficiently.

#

.roles.create will create 1 role.

#

So if a server has 50 roles, get to work

shadow frigate
#

I believe someone said you can specify an array of roles to create them all at once

sudden geyser
#

I don't think that's possible.

cinder patio
#

I was talking about when creating a guild you can specify an array of roles

shadow frigate
#

Oh well the bot doesn't create a guild, it joins it, then sets it up

#

I think forEach would probably be the best bet, but it's still creating them too fast

#

giving me rate limit errors

split hazel
#

rate limit errors? discord js should back off automatically

shadow frigate
#

It successfully creates all of the roles, but just doesn't put them in the right order

split hazel
#

you shouldn't be getting any rate limit errors

shadow frigate
#

wanna see the logs?

#

when it creates the roles?

split hazel
#

sure

#

but if it doesn't automatically do it you should add a delay between role additions yourself

solemn latch
#

You also can just create them in any order and sort them after.

split hazel
#

imagine wasting an api call

solemn latch
#

Its only being done once

#

Is there a Promise method for this actually? Promise.all but it waits for one to resolve to go to the next

split hazel
#

I thought promise all runs everything concurrently

errant flax
#
function lockLoop(channel,members,i) {
  setTimeout(()=>{
    console.log(i)
    if (i<=members.length) {
      channel.permissionOverwrites.edit(members[i-1],{
        "SEND_MESSAGES": false
      })
      lockLoop(channel,members,i++)
    }
  },1000*2)
}

i doesn't increase?

cinder patio
#

i++ increments the number and returns the previous value

errant flax
#

oh dog_kek

cinder patio
#

++i increments the number and returns the new value

errant flax
#

ull do i+1 then

cinder patio
#

or use ++i

split hazel
#

or I'll import a math library and then do math.add(i, 1)

cinder patio
#

though in this particular case doing i + 1 is the best option

sudden geyser
#

either one doesn't make a difference

cinder patio
#

++i increments the i variable

solemn latch
#

i++++--++--
Is my preferred choice here.

Ok I'll go ๐Ÿ‘€

cinder patio
#

i + 1 doesn't

sudden geyser
#

the mutation won't make a difference

cinder patio
#

it's unnecessary

sudden geyser
#

who says?

cinder patio
#

me

thorny arch
#

ive been busting head trying to figure this out so can somebody help me with this

#

the result is supposed to be a 1 or 0

#

this is how the table is supposed to be

shadow frigate
#

Here's the logs from earlier, went AFK, sorry about that

Timeout duration was set to 1.
(node:11132) TimeoutOverflowWarning: 4.348615221335307e+21 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(node:11132) TimeoutOverflowWarning: 4.348615221607896e+21 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(node:11132) TimeoutOverflowWarning: 4.348615221335307e+21 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(node:11132) TimeoutOverflowWarning: 4.348615221419049e+21 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
[Role] Created '@everyone' role in the server.
[Role] Created 'โœจโ•นCyan' role in the server.
[Role] 'Level 25': {
  "name": "DiscordAPIError",
  "message": "Missing Permissions",
  "method": "patch",
  "path": "/guilds/869704137946857472/roles",
  "code": 50013,
  "httpStatus": 400
}
[Role] '๐ŸŽฎ Game 02': {
  "name": "DiscordAPIError",
  "message": "Missing Permissions",
  "method": "patch",
  "path": "/guilds/869704137946857472/roles",
  "code": 50013,
  "httpStatus": 400
}
[Role] 'โ”€โ”€โ”€โ”€ Colors โ”€โ”€โ”€โ”€': {
  "name": "DiscordAPIError",
  "message": "Missing Permissions",
  "method": "patch",
  "path": "/guilds/869704137946857472/roles",
  "code": 50013,
  "httpStatus": 400
}