#development

1 messages · Page 1548 of 1

pale vessel
#

@lethal trout Log data

sage bobcat
#

One message removed from a suspended account.

pale vessel
#

Well, what does it look like?

crimson vapor
#

on a dedicated pc or just your main?

sage bobcat
#

One message removed from a suspended account.

mellow kelp
#

pog

lethal trout
sage bobcat
#

One message removed from a suspended account.

pale vessel
crimson vapor
#

pog

sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

nothing

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

it doesn't make sense for me as I need to turn off my pc

mellow kelp
crimson vapor
#

and xfinity doesn't like hosting servers

#

but yea

sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

good reason

mellow kelp
#

is it ever gonna explode

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

ah

#

linux or windows?

sage bobcat
#

One message removed from a suspended account.

lethal trout
#

.......

lyric mountain
#

linux doesn't shutdown for updates lul

sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

LOL

pale vessel
lethal trout
sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

ik ik

pale vessel
#

I'm trying to

#

What is data?

#

is what I asked

lethal trout
pale vessel
#

Yes and what does it look like?

#

I was about to ask you to log it but you already did

lethal trout
# pale vessel Yes and what does it look like?
const mongoose = require('mongoose')

const reqString = {
    type: String,
    required: true,
}

const thanksSchema = mongoose.Schema({
    userId: reqString,
    guildId: reqString,
    received: {
        type: Number,
        default: 0,
    },
    lastGave: Date,
})

module.exports = mongoose.model('thank', thanksSchema);```
pale vessel
#

That's the model

lethal trout
lethal trout
pale vessel
#

You messed up your filter for find()

#

It's guildId not guildID

crimson vapor
#

which is why its an empty array

lethal trout
pale vessel
#

Yes

#

I'm thankful that you provided the model, even though I didn't really ask for it

lethal trout
#

k

earnest phoenix
#

Someone can help me with html?

#

I'm so stupid

pale vessel
#

Yeah?

earnest phoenix
#

doesn't *

pale vessel
#

Check the console

earnest phoenix
#

Oh lol

#

And this cab affect <a>?

#

can*

#

@pale vessel

#

I removed it

#

<a> still don't redirect me to /

pale vessel
earnest phoenix
#

Hm

pale vessel
#

Try using <a href="url"><p>Text</p></a>

lethal trout
earnest phoenix
#

still don't work

pale vessel
earnest phoenix
#

any ways use redirect with onclick?

#

i tried it

#

ALSO DON'T WORK

pale vessel
#

Why do you need that?

earnest phoenix
#

this is links

#

-_-

pale vessel
#

Why not just <a href="url">...</a>

#

Instead of all those onmouseover() junk

earnest phoenix
#

inside <p>?

pale vessel
#

Doesn't matter

earnest phoenix
#

try use page up and page down keys

#

u will se

#

why i need it

pale vessel
#

Ah I see

earnest phoenix
#

🤔

cinder patio
#

You have two <a> tags, one of them actually redirects you to /, but it doesn't have any text inside of it, so it's invisible. The second one has the text inside but it doesn't redirect to anything

earnest phoenix
#

if i do href at <a> tag inside <p>

#

it also don't work

#

1 second

pale vessel
earnest phoenix
cinder patio
#

why though

pale vessel
#

At least tried to

earnest phoenix
#

still don't work

#

interesting

#

🤔🤔🤔🤔

#

i wanna try remove onmouseover

#

IT'S WORKS NOW

#

WHY

#

oh lol

#

@pale vessel

#

i moved it to first <a> tag

#

now it's work

#

thanks

lethal trout
mellow kelp
#

one of your embed fields doesn't have a value

lyric mountain
#

there's a third value afaik

#

it's a boolean, for whether the field should be inline or not

#

embed.fields[3] is referring to the 4th embed field

#

do you have more fields?

earnest phoenix
#

I am getting an error is joinLeaveChannel.send is not function

mellow kelp
#

joinLeaveChannel is just a string

#

you need to get the actual channel object

lyric mountain
#

dw

#

it happens

lyric mountain
#

it is a String constant

#

you gotta fetch the channel object

quartz kindle
#

imagine if discord.js did this

lyric mountain
#

we call that "cúmulo da preguiça" here

quartz kindle
#
String.prototype.send = function(...args) {
  if(this.match(/some snowflake regex/)) {
    client.channels.cache.get(this).send(...args)
  }
}
mellow kelp
lyric mountain
#

what?

quartz kindle
#

array.join("\n") ?

quartz kindle
#

yo you guys are good with regex right?

#

gib a regex for this

#
message.argument = args.join(" ").replace(/\n/g, " ").replace(/⠀/g, " ").replace(/––/g, "--").replace(/–/g, "--").replace(/——/g, "--").replace(/—/g, "--").replace(/――/g, "--").replace(/―/g, "--").replace(/‒‒/g, "--").replace(/‒/g, "--");
#

dont ask

#

lmao

summer torrent
cinder patio
#

no spoonfeeding !!!

summer torrent
#

im using lexure for this

quartz kindle
#

lmao

summer torrent
lyric mountain
summer torrent
lyric mountain
#

X-Files theme plays in the background

cinder patio
#

hmm.. let's say I have some regex in a string, how can I match it with regex?

summer torrent
#

match regex with regex?

quartz kindle
#

\/\/\/\/

pale vessel
mellow kelp
#

big brain time

summer torrent
#

/\/.*?\// 🤔

quartz kindle
#

fine, im gonna try making my own regex

lyric mountain
#
\/\/\/\/\/
 \/\/\/\/
  \/\/\/
   \/\/
    \/
summer torrent
#

v

quartz kindle
#

with blackjack and hookers

#

this works i guess

#

.replace(/\n|⠀/g," ").replace(/––|–|——|—|――|―|‒‒|‒/g,"--")

summer torrent
#

is | means or

quartz kindle
#

ye

lyric mountain
#

regexr eh?

quartz kindle
#

ye

misty sigil
#

poggers!

summer torrent
#

yea

sage bobcat
#

One message removed from a suspended account.

misty sigil
#

i suppose it might

#

tae be honest

summer torrent
#

pm2 and dotnet 🤔

mellow kelp
#

pretty sure pm2 runs anything

quartz kindle
#

^

summer torrent
misty sigil
#

you can launch quite a lot o' stuff through pm2

quartz kindle
#

pm2 is basically a glorified command line launcher

mellow kelp
#

all hail pm2

misty sigil
#

feck, i think ye can even launch mongo through it

quartz kindle
#

nice

#

does it report correct statistics tho?

summer torrent
#

in pm2's website
ADVANCED, PRODUCTION PROCESS MANAGER FOR NODE.JS

quartz kindle
#

cpu and ram usage?

cinder patio
#

yes

#

it has a dashboard

misty sigil
#

it can do more than nodejs

#

tho

#

i launched a jar with it

quartz kindle
#

you know an app is good when you can use it for much more than it was designed to

mellow kelp
#

yeah

misty sigil
#

discord

summer torrent
#

anyone here using datadog

misty sigil
#

not afaik

quartz kindle
#

i tried using it once

#

but found too complicated to setup so i uninstalled

cinder patio
#

Why does datadog have a stock price

summer torrent
#

i tried too but my "variables" didn't show on dashboard

#

pm2 has such thing iirc 🤔

quartz kindle
#

same with netdata

#

i couldnt figure out how to display node process stats

cinder patio
#

I think you have to pay though

drifting wedge
#

with aiohttp aiohttp.client_exceptions.ClientOSError: [Errno 32] Broken pipe this happens?

summer torrent
quartz kindle
#

ended up removing it because doesnt serve much purpose if you dont have a paid account

#

because no data retention

drifting wedge
#

@quartz kindle you can log data urself

#

u can do pm2 jlist

quartz kindle
#

but still, it was the easiest to setup metrics system

drifting wedge
#

and save the data as json

#

then u can get whatever data u want

quartz kindle
#

yes thats what prometheus does

#

calls pm2 jlist on an interval

drifting wedge
#

wait wot

#

wdym?

quartz kindle
#

but the pm2/io package is nice because you can get user-specific data from inside the process

drifting wedge
#

i mean u do u

#

idk what u wanna do so whatever

quartz kindle
#

i dont wanna do anything?

#

im just answering the questions

drifting wedge
#

oh

#

lmfoa

#

alr

#

lol

quartz kindle
#

the questions were "anyone used xyz" and "did you try xyz"

summer torrent
#

what is jlist

summer torrent
quartz kindle
#

lmao

quartz kindle
#

if you use the pm2/io package, you can set anything to appear in the pm2 dashboard

summer torrent
#

cool

cinder patio
#

hmmm

quartz kindle
#

i used to have that for guilds

cinder patio
#

I tried using pm2/io once but the things I set didn't appear in the dashboard

quartz kindle
#

idk, for me it worked straight away

cobalt spruce
quartz kindle
#

lol ty

rocky hearth
quartz kindle
#

only one way to find out :^)

drowsy grail
#

does guild.members.fetch('id') require privileged intents? I didn't think so

pale vessel
#

No

drowsy grail
#

okie

quartz kindle
#

so node.js 15.6.0 added process.memoryUsage.rss() for some reason

#

they say its the same as process.memoryUsage().rss but faster

restive furnace
#

lol

#

well it might be since it does not return a new object

#

but if ur going to use all those values anyways, i don't see point of using it then ¯\_(ツ)_/¯

earnest phoenix
#
const Keyv = require('keyv');

module.exports = {
  
  name: 'clear',
  description: 'Bulk deletes a certain amount of messages.',
  usage: 'clear `amount`',
  async run(message, args) {
    if (!message.guild.me.hasPermission('MANAGE_MESSAGES')) {
      let msg = await message.channel.send('I require the `Manage Messages` permission in order to perform this action!');
      msg.delete({ timeout: 2000 });
      return;
    }

    const amount = parseInt(args[0]) + 1;

    if (isNaN(amount) || amount < 2 || amount > 100) {
      let msg = await message.channel.send(`You must enter a number higher than 0 and less than 100.`);
      msg.delete({ timeout: 2000 });
      return;
    }

    message.channel.bulkDelete(amount, true).catch(async (err) => {
      console.error(err);
      let msg = await message.channel.send(`Can't delete messages older than 2 weeks.`);
      msg.delete({ timeout: 2000 });
      return;
    });

    const clearEmbed = new Discord.MessageEmbed()
      .setColor('#00ffbb')
      .setTitle(" succesufully purged the messages")
      .setTimestamp(new Date());

    message.channel.reply(clearEmbed);
  }
}```
#

For some reason it isn’t replying

#

It’s working, but not replying

solemn latch
#

i dont think channel.reply exists

earnest phoenix
#

I’ve tried message.channel.send

solemn latch
#

if you want to use reply its message.reply()

earnest phoenix
#

Oh mb...

stark abyss
#

my bot was verified today RapSmiles

solemn latch
#

gz

stark abyss
#

ty

earnest phoenix
#

you can see where the code is copypasted and where their own starts 🙈

stark abyss
#

thanks RapSmiles

earnest phoenix
#

It worked

#

But, sometimes in other servers specially something weird started happening..

#

I had no choice, so I just copied one sadly...

stark abyss
#

don't you just do message.reply instead of message.channel.reply? thinkingLol unsure

earnest phoenix
#

Ye, it’s message repl dumb me lol @stark abyss

stark abyss
earnest phoenix
#

Lol

#

.setTimeout(5)

#

Would this work?

#

Oh mb, lol dumb me again

#
const Keyv = require('keyv');

module.exports = {
  
  name: 'purge',
  description: 'Bulk deletes a certain amount of messages.',
  usage: 'clear `amount`',
  async run(message, args) {
    if (!message.guild.me.hasPermission('MANAGE_MESSAGES')) {
      let msg = await message.channel.send('I require the `Manage Messages` permission in order to perform this action!');
      msg.delete({ timeout: 2000 });
      return;
    }

    const amount = parseInt(args[0]) + 1;

    if (isNaN(amount) || amount < 2 || amount > 100) {
      let msg = await message.channel.send(`You must enter a number higher than 0 and less than 100.`);
      msg.delete({ timeout: 2000 });
      return;
    }

    message.channel.bulkDelete(amount, true).catch(async (err) => {
      console.error(err);
      let msg = await message.channel.send(`Can't delete messages older than 2 weeks.`);
      msg.delete({ timeout: 2000 });
      return;
    });

    const clearEmbed = new Discord.MessageEmbed()
      .setColor('#00ffbb')
      .setTitle("purge")
      .setDiscription("succesfully purged the messages")
      .setTimestamp(new Date());

    
message.reply(purgeembed).then(m => m.delete({timeout: 2000}))
  }
}```
#

Dosent reply again lol

solemn latch
#

i dont see where you define purgeembed

earnest phoenix
#

Ohh bruh, dum me again...

solemn latch
#

the error in the console helps a ton.

#

both these issues should have given errors in the console which explained the issue.

stark abyss
#

if the error are so imitating you perhaps use try and catch and console log error if that's helpful

outer zenith
#

how do u manually call an event

mellow kelp
#

<EventEmitter>.emit('eventName', ...args)

outer zenith
#

(in python)

mellow kelp
#

o

#

ima head out

outer zenith
#

anyone?

earnest phoenix
#

anyone have any good Discord Dashboard tuts?

#

I am getting such an error my code is if (!msg.member.hasPermission("BAN_MEMBERS")) {
is this and i am using djs v12

#
Error: 401 Unauthorized at IncomingMessage.<anonymous> (/home/../../node_modules/dblapi.js/src/index.js:118:25)
solemn latch
earnest phoenix
#

me?

solemn latch
#

obvs

earnest phoenix
#

Ok

earnest phoenix
#

hi

silver lintel
#

so I use glitch premium to host my bot and I use the editor for the coding. But the editor is rly crap well not the crap but I mainly use vsc and copy the code into glitch PeepoPain PeepoPain PeepoPain. So is there a way I can host from vsc? Ore maybe put it on github and host from there?

solemn latch
#

why not host on a vps?

misty sigil
#

glitch premium kekw

marble juniper
#

how to play audio files from a directory (not bot related)

mellow kelp
#

play audio files where?

marble juniper
#

from the file system

earnest phoenix
#
const { client } = require('../index');

app.get('/api/bot/stats', function(req, res) {
    res.json(
        { 
            "guilds": client.guilds.cache.size,
            "channels": "PLACEHOLDER",
            "users": "PLACEHOLDER"
        }
    )
});

idk what to do :c

marble juniper
#

on my pc

#

lol

#

I want to play the audio file on my pc

#

at least I found a solution now by myself

#

ffplay

#

the others I tried just didn't work

mellow kelp
#

o

#

poggers

marble juniper
#

everytime I do a left click it will play a sound effect now

#

a very satisfying click sound effect

mellow kelp
#

thats pretty epic

#

ffmpeg?

marble juniper
#

yes

#

it uses ffplay

#

which uses ffmpeg

#

I think

mellow kelp
#

yea probably

#

ima try it out

earnest phoenix
#

how do I import my bot file (index.js), so I can get the bots server count, and stuff like that. To put on my dashboard

#
const { client } = require('../index');

dont work

mellow kelp
#

i would recommend passing the client with a function

#

but the way you're doing it requires exporting the client in your index.js

#

make sure you're using module.exports

earnest phoenix
#

oh

#

okay xd

#

The bot dosent respond sadly..

mellow kelp
#

mentions might also be in the format <@![id]>

earnest phoenix
#

Note: I’ve tried <@!

mellow kelp
#

o

earnest phoenix
#

Lol

#

@mellow kelp can I change it to client.user.tag?

mellow kelp
#

that doesn't work

earnest phoenix
#

Hmm, that dosent work neither..

#

What could the problem be?

proven lantern
#

<@&

mellow kelp
#

that's for roles

earnest phoenix
#

You use &?

#

Lol

#

What might the problem be?

proven lantern
#

not a user id

mellow kelp
#

it is a user id

zenith terrace
earnest phoenix
#

Yes, it’s made to ping the bot

#

So why dosent it reply?

mellow kelp
#

maybe you have too many listeners

#

log the message content to see exactly what you receive

earnest phoenix
#

Alr let’s see

#

Nope didn’t log anything

#

@mellow kelp

mellow kelp
#

you added the console.log before checking the message right?

proven lantern
#

is the message.content @botID or is it @botId blah blah blah

#

might need to do message.content.indexOf("<@!bot id>") === 0

quartz kindle
#

or startsWith

earnest phoenix
#

Why in the world Every time I say +

#

It says I can’t find a channel called verify

#

Wtf

#

that captcha doesn't do shit btw

#

userbots can just read the content of the embed and parse the code

quartz kindle
#

well do you have a channel called verify?

earnest phoenix
#

Mhm

#

It just says it randomly every time I say +

#

Like, why when I do + @quartz kindle

earnest phoenix
quartz kindle
#

show your command handler

earnest phoenix
#

I don’t think somethings wrong with command handler but sure

#

Damn, I can’t remember where it was and how it looks...

#

But I think this is it

quartz kindle
#

your prefix code is wrong

#

you basically accept anything as prefix, as long as its the same length

earnest phoenix
#

Huh why?

quartz kindle
#

actually nvm

earnest phoenix
#

Lol

quartz kindle
#

but you're slicing the length of the default prefix

#

not the prefix

earnest phoenix
#

Ohh, so what should I change?

quartz kindle
#

probably slice prefix, not default_prefix

earnest phoenix
#

So

#

slice_prefix

quartz kindle
#

no?

#

Lol

earnest phoenix
#

Lol

#

Uhhh, can you try to explain a bit

#

@quartz kindle

quartz kindle
#

you check if message starts with prefix

earnest phoenix
#

Ohhh, so

quartz kindle
#

and you cut of the default prefix size from it

#

so if someone uses a prefix that is of different size than the default

#

you're gonna have issues

earnest phoenix
#

Damn..

quartz kindle
#

also

#

the issue for your command running with +

solemn latch
#

woah, someone made a script that randomly generates 5 chars and puts it in an imgur url, its surprising how often you find actual images.

quartz kindle
#

its because you have "" as an alias, so if you type +, which happens to be the same length as your default prefix, you code slices it off, meaning you're left with "", aka an empty string, and this empty string will match the alias for the verify command

earnest phoenix
#

you'll find personal information, documents, text messages...

#

insane

quartz kindle
#

Lol

zenith terrace
#

time to find tims personal info

opal plank
#

or some furry pron

#

so, yeah, have bleach ready

#

pour abundantly in your eyes in case of cursed images

solemn latch
#

ah, i didnt think about that.

quartz kindle
zenith terrace
#

wow

earnest phoenix
#

lol

zenith terrace
#

@quartz kindle thats clearly edited

#

100%

#

not real at all

crimson vapor
#

yo @quartz kindle how much more memory efficient is a raw object over an instance of a class?

quartz kindle
#

lmao, i just edited the url a bit and i got a pic of dms talking about bitcoin

quartz kindle
#

the content matters more

crimson vapor
#

for like message and channel

#

you could do functions like client.sendMessage() or you could do message.channel.send

quartz kindle
#

let me do a small test

crimson vapor
#

pog ty

quartz kindle
#

makes basically 0 diff

#

10 million instances of class { constructor() { this.id = "1234567890" } } vs 10 million instances of { id:"1234567890" }

#

both take about 550mb heap

#

lets wait a bit for the gc to run

#

after a few minutes on idle both drop to 450mb

#

so yeah, which one you use is pretty irrelevant, the contents are much more important

crimson vapor
#

ty tim

quartz kindle
#

its a pitty js doesnt support native long ints

crimson vapor
#

agreed

quartz kindle
#

bigints are not worth it

#

they're just slow and clunky

earnest phoenix
#

for browsers i get it

#

but node can implement it natively

#

i mean they probably won't

quartz kindle
#

i guess they could, but they have to respect js rfc and shit

earnest phoenix
#

yeah

quartz kindle
#

the difference it makes is absurd

#

for example, ints vs floats

#

even though js treats all numbers as doubles, under the hood the engine choses which type to give it

#

js ints are stored as 32bit ints when possible and are about twice as fast and twice as small as js floats which are stored as 64bit doubles

earnest phoenix
#

help please
This Error: var embed = new Discord.RichEmbed()
^

TypeError: Discord.RichEmbed is not a constructor
This Code:
let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
if (!message.channel.guild) return;
if (message.author.bot) return;
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
prefix: process.env.PREFIX,
};
var prefix = prefixes[message.guild.id].prefix;
var setp = prefixes[message.guild.id];
if (message.content.startsWith(prefix + 'setp')) {
if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(**:x: Error: You do not have the required permissions: Manage Server.**);

    let args = message.content.split(" ").slice(1);

    if (!args.join(" ")) return message.reply(`**:x: Error: sdaSay The Prefix Please.**`);
      var embed = new Discord.RichEmbed()

   .setColor("BLACK")

.setTitle("Prefix Set!")
.setDescription(**Set to ${args[0]}**);
message.channel.send(embed);
setp.prefix = args.join();

}

fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
    if (err) console.error(err);
});

});

pale vessel
#

Try using Discord.MessageEmbed() instead

earnest phoenix
#

okay

misty sigil
#

is that json db i smell

#

stink

crimson vapor
#

ex:
```js
console.log('a');
```

console.log('a');
quartz kindle
#

well this is a new one

#

i think i broke node

crimson vapor
quartz kindle
#

so i just tested a Map with 1 million entries

earnest phoenix
#

guys can i get a source code for custom prefix

#

i try all my best

crimson vapor
#

no

earnest phoenix
#

but didnt work

quartz kindle
#

both key and value are bigints -> 1.3gb
both key and value are strings -> 1.1gb
both key and value are numbers with decimals -> 1gb
both key and value are numbers without decimals -> 710mb

misty sigil
#

damn

glacial pagoda
#

Everytime I Do The Command "-help fun", It Sends Both Help embed And Fun Embed. How Do i Make It Send 1 Only The Fun Embed?
Code -> https://pastebin.com/bqFuRFYL

mellow kelp
#

only send the help embed if there are no args

glacial pagoda
#

So How Should I Do It In the Code

mellow kelp
#

check args.length

glacial pagoda
#

What

mellow kelp
#

make an if statement to check args.length

glacial pagoda
#

ok

#

Then What

mellow kelp
#

just send the help embed if args.length is 0

#

else, do the other stuff

glacial pagoda
#

oh ok

#

?

mellow kelp
#

add a !

glacial pagoda
#

ok

#

So Just Substitute?

mellow kelp
#

that's it

glacial pagoda
#

Ok!

#

Ill try

#

it still sends 2

#

Ill Send Full New Code In Paste bin

#

@mellow kelp

mellow kelp
#

you have to properly chain it with the other if/elses

#

for now gtg

rustic nova
#

args.length returns a number

#

the length of your args

distant cobalt
rustic nova
#

that's just a warning, increase your maxlisteners through the method mentioned

glacial pagoda
rustic nova
#

please

#

this is basic js

distant cobalt
rustic nova
#

No clue

#

Can't help you with that unfortunately

distant cobalt
#

ok

glacial pagoda
mellow kelp
#

returns false for 0, and i find it shorter

#

but yea it might confuse beginners

glossy spoke
#

if (!args.length)

#

uh

pale vessel
#

yea ! turns it to a boolean and negates it

#

and 0 would mean false

shy yew
#

that what I did

pale vessel
#

@crimson vapor only add the listener if it's not existing already

distant cobalt
#

k

pale vessel
#

how did I ping million

mellow kelp
pale vessel
#

I think it's because your name is all upper cased so I just assumed you're MILLION

#

sorry I just woke up

distant cobalt
#

how do i make this variable global?

const commandName = args.join(' ')
const commandAction = args.slice(1).join(' ')```
pale vessel
#

why

shy yew
#

need full code

pale vessel
#

where do you want to access it?

distant cobalt
#

cuz it says commandName is undefined

#

i have the variables on create-command.js

#

and want to access it on main.js

pale vessel
#

provide them to the function

distant cobalt
distant cobalt
pale vessel
#

Can you show your main.js?

distant cobalt
#

okay

#

the part where i want to access it

else if(command === db.get(`${message.guild.id}.${commandName}.${commandAction}`)){
        message.channel.send(db.get(`${message.guild.id}.${commandName}.${commandAction}.commandAction`))
    }```
sage bobcat
#

One message removed from a suspended account.

pale vessel
#

lmao

#

oh well, breakfast

distant cobalt
#

no, i'm making a make command thing

#

so guilds and make their own commands

sage bobcat
#

One message removed from a suspended account.

distant cobalt
#

mhm

sage bobcat
#

One message removed from a suspended account.

distant cobalt
#

wait i gtg

#

DM me the solution if possible lol

pale vessel
#

it is

#

you just have to have a good structure

crimson vapor
#

who did you mean to ping?

earnest phoenix
#

is that good for custom change prefix

pale vessel
earnest phoenix
#

let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
if (!message.channel.guild) return;
if (message.author.bot) return;
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
prefix: process.env.PREFIX,
};
var prefix = prefixes[message.guild.id].prefix;
var setp = prefixes[message.guild.id];
if (message.content.startsWith(prefix + 'setp')) {
if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(❌ Error: You do not have the required permissions: Manage Server.);

    let args = message.content.split(" ").slice(1);

    if (!args.join(" ")) return message.reply(**❌ Error: sdaSay The Prefix Please.**);
      var embed = new Discord.RichEmbed()

   .setColor("BLACK")

.setTitle("Prefix Set!")
.setDescription(Set to ${args[0]});
message.channel.send(embed);
setp.prefix = args.join();

}

fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
    if (err) console.error(err);
});

});

crimson vapor
#

I told you to use code blocks

#

```js
// code here
```

earnest phoenix
#

let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
    if (!message.channel.guild) return;
    if (message.author.bot) return;
    if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
        prefix: process.env.PREFIX,
    };
    var prefix = prefixes[message.guild.id].prefix;
    var setp = prefixes[message.guild.id];
    if (message.content.startsWith(prefix + 'setp')) {
        if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(**:x: Error: You do not have the required permissions: Manage Server.**);
 
        let args = message.content.split(" ").slice(1);
 
        if (!args.join(" ")) return message.reply(**:x: Error: sdaSay The Prefix Please.**);
          var embed = new Discord.RichEmbed()
 
       .setColor("BLACK")
  .setTitle("Prefix Set!")
  .setDescription(**Set to ${args[0]}**);
    message.channel.send(embed);
        setp.prefix = args.join();
 
    }
 
    fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
        if (err) console.error(err);
    });
});
mellow kelp
earnest phoenix
pale vessel
#

need js

#

add js

#

```js
code```

#

edit your message

crimson vapor
#

erwin got mad at me for it

pale vessel
#

memes bro

crimson vapor
#

yea but

shy yew
#

i think using JSON as a database is a bad idea

crimson vapor
#

it is

#

always

#

unless you big brain

#

and even then

shy yew
#

i forgot why

pale vessel
crimson vapor
#

flaze

mellow kelp
#

yea it is a bad idea

crimson vapor
#

ima make a express server that runs jason.db

#

and

pale vessel
#

queues?

crimson vapor
#

a request based db

pale vessel
#

but that's...

crimson vapor
#

http

pale vessel
#

JOSH

crimson vapor
#

josh.db

pale vessel
#

evie made josh

crimson vapor
#

oh

#

its a real thing

#

tf

shy yew
#

how do I loop audio in the background of a website (it's for my bot)

earnest phoenix
#

flaze can you gave my src of custom prefix if you want ples I try my best to make one but didnt work

pale vessel
#

still WIP

#

but basically you use HTTP

#

with methods like PUT, DELETE, etc.

mellow kelp
shy yew
#

cool thx

mellow kelp
#

np

earnest phoenix
#

flaze?

rustic nova
#

@earnest phoenix you need to make it yourself, we don't spoonfeed

earnest phoenix
# rustic nova <@456226577798135808> you need to make it yourself, we don't spoonfeed

iknow but i make this code but didnt work

let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
    if (!message.channel.guild) return;
    if (message.author.bot) return;
    if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
        prefix: process.env.PREFIX,
    };
    var prefix = prefixes[message.guild.id].prefix;
    var setp = prefixes[message.guild.id];
    if (message.content.startsWith(prefix + 'setp')) {
        if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(**:x: Error: You do not have the required permissions: Manage Server.**);
 
        let args = message.content.split(" ").slice(1);
 
        if (!args.join(" ")) return message.reply(**:x: Error: sdaSay The Prefix Please.**);
          var embed = new Discord.RichEmbed()
 
       .setColor("BLACK")
  .setTitle("Prefix Set!")
  .setDescription(**Set to ${args[0]}**);
    message.channel.send(embed);
        setp.prefix = args.join();
 
    }
 
    fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
        if (err) console.error(err);
    });
});

rustic nova
#

(**:x: Error: You do not have the required permissions: Manage Server.**);
I'm pretty sure you're missing something on these

#

how do you know it doesn't work? check your logs etc

earnest phoenix
sudden geyser
zenith terrace
#

@earnest phoenix you are missing the ' ' between the MANAGE_GUILD

if (!message.member.hasPermission('MANAGE_GUILD')) return message.reply```
earnest phoenix
mellow kelp
#

bruh

rustic nova
#

channeloui is undefined

#

dm nitro sure

earnest phoenix
mellow kelp
#

line 5

#

bot.rolemenu doesn't exist

#

or might be channeloui

earnest phoenix
#

I have create it

#

bot.rolemenu = new db.table('Rolemenu');

#

wtf is that code

mellow kelp
#

no idea

earnest phoenix
#

this is such a mess

mellow kelp
#

async/await along with .then()

#

oh god

earnest phoenix
#

not even that

mellow kelp
#

.catch(async () => { ...

short oyster
#

whats the best way to clean and sanitize sql queries of prefix commands

earnest phoenix
#

but constantly mixing between fetching and getting

mellow kelp
earnest phoenix
#

your lib should have a built in way to sanitize

short oyster
short oyster
#

im using postgresql

#

with js

earnest phoenix
#

yes but which library

#

pg?

short oyster
#

yes

earnest phoenix
#

scroll further down untill you see parameterized query

short oyster
#

this is my first time using sql on my own is there any working open source implementation of it that I could find somewhere?

earnest phoenix
#

🤷‍♂️

#

search on github

short oyster
#

okay thanks

distant cobalt
#
else if(command === db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`)}.commandName`)){
        message.channel.send(db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`)}.commandAction`))
    }``` why doen't the messgae send?
rustic nova
#

because the condition is wrong maybe

#

debug lines

distant cobalt
#

? wdym

queen needle
#

log command and log the db thing are the same? Debug lines

distant cobalt
#

nothing

tribal siren
#

did you define db?

distant cobalt
#

yeah

#
var db =  require('quick.db')```
tribal siren
#

what are you trying to do

distant cobalt
#

Make custom commadns

tribal siren
#

db.get(`${message.guild.id}.${db.get(${message.guild.id}.commands)}`)

#

well

#

what's the console error?

#

did you try reading console

distant cobalt
tribal siren
#

uhm

#

then it's supposed to send

distant cobalt
#

but it didn't

tribal siren
#

do you think there is a db.get(`${message.guild.id}.commands`)

distant cobalt
earnest phoenix
#

did you log the result of get

distant cobalt
earnest phoenix
#

... exactly what i said

tribal siren
#

try logging the result of get

#

yes

distant cobalt
#

it didn't log tho

earnest phoenix
#

i

tribal siren
#

then try logging it-

earnest phoenix
#

🚶 🦽

tribal siren
#

console.log(db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`))

pale vessel
#

what

tribal siren
#

if this doesn't work then your console is bad

pale vessel
#

what's js ${db.get(`${message.guild.id}.commands`)

#

what am I looking at

earnest phoenix
#

also that is

tribal siren
earnest phoenix
#

so many unnecessary db calls

tribal siren
#

am not sure if there is one

#

but idk

#

i actually saw this guy's bot

#

idk it's pretty nice and reviews are pretty nice

#

i feel like i wanna check what it can do

distant cobalt
tribal siren
#

what did it log

distant cobalt
tribal siren
#

no

#

i asked

#

what did it log

pale vessel
#

what the fuck even is that code

earnest phoenix
#

syntax error

pale vessel
#

that's not even valid syntax

tribal siren
#

are you serious

distant cobalt
#

UHHh, syntax

#

Error

#

EEEEE

tribal siren
#

ok

pale vessel
#

you can't just paste that thinking it would work?

earnest phoenix
#

code that's not a dumpster fire is such a rarity in this channel

tribal siren
#

did you set the db

#

do you have like

#

db.set(`${message.guild.id}.${db.get(`${message.guild.id}.commands`, something)

#

?

pale vessel
#

what?

#

take a look at that code

tribal siren
#

oh

pale vessel
#

tell me there's nothing wrong with it

distant cobalt
#

so i logged it...

tribal siren
distant cobalt
#
else if(command === 'testasdf'){
        console.log(db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`)}.commandName`))
    }```
pale vessel
#

i-

tribal siren
#

u-

slender thistle
tribal siren
#

he opens the bracket 3 times and closes it 2 times

distant cobalt
#

....

tribal siren
#

ok that's better

#

what did it log

distant cobalt
#

uhm

#

i gtg

earnest phoenix
distant cobalt
#

cya

earnest phoenix
#

"bot.rolemenu = new db.table('Rolemenu');" in the index

tribal siren
#

channelid is not a channel id

#

it is not a snowflake

#

let channeloui = message.guild.channels.cache.get(channelid)

#

you really think that's gonna work?

earnest phoenix
#

Yesokay

tribal siren
#

uhm

earnest phoenix
#
                    message.guild.channels.cache.find((r) => r.id == collected.first().content) ||
                    collected.first().mentions.channels.first()
                     if(!channelrole) return message.reply(`${bot.emoji.error} Channel Invalid`)
                    await bot.rolemenu.set(`Rolemenu : ${message.guild.id}`, {channel: channelrole.id})```
#

channelid is a channel id

#

let channelid = await bot.rolemenu.fetch(`Rolemenu : ${message.guild.id}`, {target: '.channel'})

tribal siren
#

what is the command supposed to do

earnest phoenix
#

React a message with a reaction

tribal siren
#

message.react('')

earnest phoenix
#

let messagerole = await channeloui.fetch(message.id === messageid).then( messagerole.react(emojirole) )

tribal siren
#

yes..

#

what's wrong here

earnest phoenix
#

It's working

#

But

#

When I react ✅

tribal siren
#

Cannot read property 'fetch' of undefined

earnest phoenix
#

Yes

tribal siren
#

at line 110 letter 56

#

collected is not defined

earnest phoenix
#

Ah

#
                let question = await message.channel.send("Veuillez entrer l'ID du message")
                const filter = m => message.author.id === m.author.id;
                message.channel.awaitMessages(filter, {
                    max: 1,
                    time: 60000,
                    errors: ['time']
                }).then(async (collected) => {
                    collected.first().delete()
                    question.delete()
                    let messageoui = await bot.rolemenu.fetch(`Rolemenu : ${message.guild.id}`, {target: '.channel'})
                    let channeloui = message.guild.channels.cache.get(messageoui)
                    let messagerole = await channeloui.fetch(message.id === collected.first().content)
                   if(!messagerole){
                       let mes = await message.channel.send("Invalid ID")
                       mes.delete({timeout: 2000})
                   }
                    await bot.rolemenu.set(`Rolemenu : ${message.guild.id}`, {message: messagerole.id})
                    embedbase.fields.find(m => m.name === "**Message**").value = `${collected.first().content}`
                    msgg.edit(embedbase)
                    }).catch(async (err) => {
                        console.log(err)
                        collected.first().delete()
                        message.channel.send("Je n'ai pas pu modifier le message").then((mm) => mm.delete({
                            timeout: 5000
                    }));
                })
            }```
#

(async (collected) => {

#

collected not defined it is for line 120

#

For react \🆔

    at c:\Users\denis\OneDrive\Bureau\Amnesia Bot\database\commands\Administration\rolemenu.js:110:56
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {stack: 'TypeError: Cannot read property 'fetch' of un…ctions (internal/process/task_queues.js:93:5)', message: 'Cannot read property 'fetch' of undefined'}```
#

For react \🆔

   …denis\OneDrive\Bureau\Amnesia Bot\database…} reason:  ReferenceError: collected is not defined
    at c:\Users\denis\OneDrive\Bureau\Amnesia Bot\database\commands\Administration\rolemenu.js:120:25
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)```
#

For react \✅

    at c:\Users\denis\OneDrive\Bureau\Amnesia Bot\database\commands\Administration\rolemenu.js:186:56
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {stack: 'TypeError: Cannot read property 'fetch' of un…ctions (internal/process/task_queues.js:93:5)', message: 'Cannot read property 'fetch' of undefined'}```
pale vessel
#

Wow thanks!

#

It's not even fetch

#

It's the property before fetch

shy turret
#

wait im stupid you were answering the question not asking

earnest phoenix
#

What

#

Can you help me to correct my script

#

Thanks sad1

sacred trout
#
    @commands.command(name='asciify', aliases=["ascii"])
    async def asciify(self, ctx, *, message=None):
        if message is not None:
            if len(message) <= 50:
                if message[0] == '<' and (message[1] == '#'):
                    await ctx.send('im not doing that 😂')
                elif message[0] == '<' and message[1] == '@':
                    await ctx.send('im not doing that 😂')
                elif ctx.author.is_on_mobile and len(message) > 8:
                    await ctx.send('The output might look a bit weird on your phone! 😅\n Landscape mode might make it look Better')
                    msg = pyfiglet.figlet_format(message)
                    await ctx.send(f'\n{msg}\n')
                else:
                    msg = pyfiglet.figlet_format(message)
                    await ctx.send(f'\n{msg}\n')
            else:
                await ctx.send(f"Your character length ({len(message)}) has exceeded a normal of 50.")
        else:
            await ctx.send('Whats it you to asciify?')```
#

please help

earnest phoenix
#

hey does anyone know if all guild IDs are the same length

solemn latch
#

they are not

earnest phoenix
#

huh are you sure, from my small sample size of 5 they all seem to be length 18?

solemn latch
#

older servers have 17

#

in the next few years there will be ids that are 19 long iirc

earnest phoenix
#

i see

#

10^18 is probably more discord servers that will ever exist though 🤔

solemn latch
#

the id system isnt incremental

#

ids contain timestamp, originating server info, number of other ids generated in that second, etc

#

most id systems these days are non incremental

earnest phoenix
#

yes i know that, but they could theoretically normalize/hash the ID to be an available number from 10^18 to 10^19-1

#

ah well

solemn latch
#

most numbers are skipped in the discord id system

earnest phoenix
#

str(guild.id) + str(channel.id) should still be essentially unique right

#

unless there is an amazing coincidence

solemn latch
#

guild id would be unique either way, so guildid+channelid will always be unique.

sacred trout
#
    @commands.command(name='asciify', aliases=["ascii"])
    async def asciify(self, ctx, *, message=None):
        if message is not None:
            if len(message) <= 50:
                if message[0] == '<' and (message[1] == '#'):
                    await ctx.send('im not doing that 😂')
                elif message[0] == '<' and message[1] == '@':
                    await ctx.send('im not doing that 😂')
                elif ctx.author.is_on_mobile and len(message) > 8:
                    await ctx.send('The output might look a bit weird on your phone! 😅\n Landscape mode might make it look Better')
                    msg = pyfiglet.figlet_format(message)
                    await ctx.send(f'\n{msg}\n')
                else:
                    msg = pyfiglet.figlet_format(message)
                    await ctx.send(f'\n{msg}\n')
            else:
                await ctx.send(f"Your character length ({len(message)}) has exceeded a normal of 50.")
        else:
            await ctx.send('Whats it you to asciify?')```
#

please hel

#

p

upbeat cape
#

is this node.js

solemn latch
#

python

upbeat cape
#

lol i dont know how to do python

#

ik java

earnest phoenix
#

@solemn latch well, the thing is if there are 17 and 19 digit guild and channel ids, you could theoretically have a collision. if your magic number was "1234" it could be guild.id=123 and channel.id=4 OR guild.id=12 and channel.id=34

#

for example

solemn latch
#

that also is impossible for a handful of reasons, a simple one is the id's have a timestamp built in.

earnest phoenix
#

thats what i thought

#

cool

#

though, it doesn't mean the message doesn't contain mentions at all, consider using if ctx.message.mentions or ctx.message.channel_mentions instead

#

and you now what, is_on_mobile is a method which you need to call it, otherwise it's always True since it's not falsy

#

and as for the problem, use codeblock.

hearty remnant
#

Is anyone experienced with the eris.js framework here

solemn latch
#

not a lot of people here use it.

hearty remnant
#

Darn

rocky hearth
#

what is the default setTimeout delay??

sage bobcat
#

One message removed from a suspended account.

rocky hearth
#

so using it without any delay, will cause the callback to be called at the end of the wrapper function right?

#
function fun() {
  setTimeout(() => console.log('1'));
}
fun();
console.log('2');
// '2'
// '1'
earnest phoenix
#

try it and see

#

it should log 1 first

#

as the default value is 0

rocky hearth
#

I just tried.
And it logged, '2' first

earnest phoenix
#

huh interesting, i guess it's adding overhead and putting it to the next event cycle

#

ill check the docs

rocky hearth
#

hmm, that is what I guessed too. So was wondering, what would be the default delay is set to?

earnest phoenix
#

the default value of the delay is 0

#

however since js is single threaded, it depends on event cycles

#

that's why it lags behind

rocky hearth
#

that means we can write some instructions in the middle of a function A and get it executed after A has finished executing

river panther
#

hello people, i am trying to add a nitro emoji send function in my bot, but it is showing an error, if you could help it will be helpful

error
(node:4884) UnhandledPromiseRejectionWarning: TypeError: message.split is not a function

code block:

        if(emoji && !message.split().find(x => x === emoji.toString()) && !message.content === (`<a${replace}${emoji.id}>`)) message = message.replace(rexreplace, emoji.toString())```
earnest phoenix
#

you can't split an object

#

you can split a string though

#

you're probably looking for the content property

river panther
#

nah, i have tried message.content it says message.content is not a function

earnest phoenix
#

because it isn't

#

it's a getter, returns a string

kindred python
#

sorry

#

sorry

river panther
#

mhm
so what will be the fixed code?

earnest phoenix
#

take a guess

river panther
river panther
kindred python
#

yes

#

yes

river panther
#

can you send me the details of your build and stuff in dm?

earnest phoenix
#

i want you to guess because it's a really logical solution and it makes you think instead

kindred python
#

Hi. How do I authenticate?

#

I am using a translator now.

earnest phoenix
#

split is available on a string

#

message is an object

#

the content property of the message returns a string

river panther
#

oh

#

wait

#

so

#

ergh

#

what will be the correct code if you may...?

slender thistle
#

How do you use a property?

river panther
#

isn't property like, eh, like, read only thingy?

#

i mean, how do i explain

#

nvm, i will start the code again from start

slender thistle
#

Just look more into OOP

earnest phoenix
#

Why does Discord API allow us to lock emojis to certain roles but we can't do it on our end?

#

Why do we need bots to do it

cinder patio
#
                const arr = [];
                for (let i=0; i < size; i++) {
                    arr.push(this.stack.pop());
                }
                arr.reverse();
                const arr = new Array(size);
                for (--size; size >= 0; size--) {
                    arr[size] = this.stack.pop();
                }
const arr = stack.splice(size + 1, stack.length);

Which one of these three do you think is the fastest?

earnest phoenix
#

I'm pretty sure the third one should be faster

cinder patio
#

let's see

#

yeah it's splice

pale vessel
#

Array.splice() is slow though so I'm not sure

cinder patio
#

hm.. yeah splice is the slowest of the three, am I doing this correctly?

#

splicing once... 31 ms

#

But if I do the test with an array of 100 elements, then splice is the fastest, so it's the size of the array that matters

tribal siren
#

Hello, I need some help.

#

Basically, my Presence Intent is Declined once again because Userinfo and Serverinfo functionality is not enough for it to work.

#

Can you please give some valid reasons to use Presence Intent?

rustic nova
#

If you're asking for valid reasons for the intent, you shouldn't request it in the first place

tribal siren
#

I want to add something that has to require presence intent to unlock that stuff higher

cinder patio
#

or you can just remove those commands

tribal siren
#

that's the problem

#

those are one of the commands i put the effort in the most

hasty mulch
#

Any tips for doing a whois command in Python?

tribal siren
#

you're welcome

pale vessel
#

that's not helping

tribal siren
#

oh

#

i thought that's what i sent

hasty mulch
#

@pale vessel @tribal siren That’s what it is? Just a customized version of all the Member properties?

pale vessel
#

what do you mean

tribal siren
#

wdym

pale vessel
#

you mean whois command as in user info, right?

#

you can get those info using ctx.author (it will be a member inside guilds)

#

or fetch the member, whatever

hasty mulch
#

And use all the things listed in there?

pale vessel
#

yeah

hasty mulch
#

Huh, alright

#

The list of roles, would that be just roles?

pale vessel
#

member.roles, yeah

raven needle
#

Hey, I have a question,
how can i display the member count in my bot profil on top.gg

#

wait

#

oh yes servers

#

ok ty

#

where can i see my dbl token

blissful kestrel
#

How can I deafen discord bot in nodejs?

dusky sundial
raven needle
#

ty ❤️

blissful kestrel
#

I want to do server defend

lusty quest
#

?

quartz kindle
#

server defend, new tower defense strategy game

lusty quest
#

i would guess he wants some sort of Raid protection, but if you have to ask in how to make one i guess you wont understand how to do it either

dusky sundial
#

It's better to try and get started by yourself, and then ask about any issues you run into, rather than asking how to make the entire thing. People are very unlikely to help you create an entire feature.

lusty quest
#

could be the X / Y Issue

quartz kindle
#

No he wants to deafen lmao

dusky sundial
#

The most powerful of server defenses

queen nova
#

I have a code it is expire can anybody help me in updating that

lusty quest
#

?

queen nova
#

Langauge is discord.js

dusky sundial
#

Wdym by expired? Like it doesn't work with new versions of the discord library?

lusty quest
#

so you run D.js V11?

earnest phoenix
#

code has an expiry date? 😰

dusky sundial
#

I guess technically, yeah xd

queen nova
#

😃

dusky sundial
#

It would probably help if you also sent the code that is expired

lusty quest
#

lol tell this the chinese Train companies, who went offline for 16 hours bcs they relied on Flash

dusky sundial
#

Flash? lmao

#

But why

earnest phoenix
#

some banks still rely on BASIC

lusty quest
#

Flash got shutdown on the 31s December last year

#

and theyre Ticket system relied on it

dusky sundial
#

Yeah, that I know but like-

#

huh

earnest phoenix
#

it costs money to update systems, companies avoid it as much as possible

dusky sundial
#

interesting

carmine summit
#

How do I get the array of an array. I want to get the array that ends in R without knowing the first two items.

Table:

[[0,0,W],[0,0,O],[0,0,R],[0,0,D]]
earnest phoenix
#

two for loops

dusky sundial
#

You would probably need to loop through them, arrays can't be directly accessed

earnest phoenix
#

there's probably a single line solution depending on your language

carmine summit
#

js

earnest phoenix
#

flatMap

pale vessel
#

like array.find(x => x[x.length - 1] === "R")?

carmine summit
#

ah yes

earnest phoenix
#

that too ig

#

im way too tired to breathe

#

let alone think 👁️👄👁️

fluid basin
#

bruh this looks like a nuker

queen nova
fluid basin
#

not gonna help break ToS

queen nova
#

Oh

#

But my friend said it this is for getting server in maintenance mode

slender thistle
#

What did they define as "maintenance mode" exactly?

#

And how does deleting all possible roles and channels fall under "maintenance"?

dusky sundial
#

Why would you ever need a feature to wipe an entire guild's channels, if it isn't for destroying it?

slender thistle
fluid basin
#

smh what

slender thistle
#

new in what sense

dusky sundial
#

Resetting it? thinkstache

carmine summit
#

now I want to get the array but only using the first two items in the array.

#

@earnest phoenix

fluid basin
dusky sundial
#

That's an interesting interpretation of the word maintenance

rustic nova
#

maintenance: destroy it and fix it to make sure it works now KEKW

cinder patio
#

So I'm using acorn with typescript, but I don't have access to any specific node types, only the generic Node

#

how do I get em

fluid basin
#

check if your definitions are loaded correctly

cinder patio
#

they are, I looked at acorn's index.ds.ts and they don't create interfaces for the different types of nodes, so I guess I have to do it myself

fluid basin
#

oh welp

#

go make an issue for that or something

#

unless theres already one

#

might help

cinder patio
#

thank

#

How can I access the types inside @types/estree, though?

cinder patio
#

this is hell

opal plank
#

but since this is basic, i assume this is not what you were looking for

summer torrent
#

you can import it from estree iirc

opal plank
#

literally what i sent above ur message

summer torrent
#

yes

opal plank
#

then why repeat it?

summer torrent
#

i read your message after you told me about this

cinder patio
#

but it's still hell

carmine summit
#

can I use a function inside a function?

rocky hearth
#

for react class component, why should I not use componentWillMount()?

carmine summit
#

check() => {
check()
}

cinder patio
#

yes

rocky hearth
rocky hearth
#

yeah, Im on the same page. But what to use instead of it?

cinder patio
#

componentDidMount

rocky hearth
#

contructor()?

#

I want to call a method before, render

cinder patio
#

yeah, use componentDidMount

rocky hearth
#

but, it is called just after, render.

cinder patio
#

read this

rocky hearth
#

But I dont want that.

cinder patio
#
You may call setState() immediately in componentDidMount(). It will trigger an extra rendering, but it will happen before the browser updates the screen. This guarantees that even though the render() will be called twice in this case, the user won’t see the intermediate state. Use this pattern with caution because it often causes performance issues. In most cases, you should be able to assign the initial state in the constructor() instead.