#development

1 messages · Page 1256 of 1

vernal rivet
#

I mean you can look on YouTube for an explaination shrug

solemn leaf
#

Buffer.from(array)

#

you want me to do that

opal plank
#

not saying a word

#

¯_(ツ)_/¯

#

i told you, last 8%

#

not even the last 10%

worldly oriole
#

Hello?

vernal rivet
#

Hell

solemn leaf
#

stop

opal plank
#

ive even narrowed down the methods you'll need to use

solemn leaf
#

fucking

vernal rivet
#

Hello

solemn leaf
#

saying hello

worldly oriole
#

Ok

vernal rivet
worldly oriole
#

Hi

solemn leaf
vernal rivet
#

LOL

#

I like this person

solemn leaf
#

NO MORE GREETING WORDS

worldly oriole
#

Ok

vernal rivet
#

Ok ok ok, on topic mode

worldly oriole
#

Hello

opal plank
#

read the faq mac

vernal rivet
#

Ahhhhh wrong place, but is the right place to ask shrug idk how this works, I am just here to eat the bamboo that grows here.

junior sun
#

Hey, somebody have a bot to delete messange?

vernal rivet
#

?????????????? Why?

solemn leaf
#

len = this.buf.write(err);

junior sun
#

I need delete a conversation with a girl

solemn leaf
#

closer

opal plank
junior sun
#

Is my ex

#

💔

solemn leaf
#

no?

vernal rivet
opal plank
#

right click message and delete @junior sun

vernal rivet
#

Can’t help you fix that mess

opal plank
junior sun
#

Yes i know

#

But i want delete all

opal plank
#

bots cant access Direct messages either

solemn leaf
#

@junior sun

vernal rivet
#

^^^^

junior sun
#

Damm

solemn leaf
#

delete the dm

junior sun
#

😦

opal plank
#

delete 1 by 1

solemn leaf
#

its an X

opal plank
#

thats all u can do

#

¯_(ツ)_/¯

solemn leaf
#

and its gone until you open it again

junior sun
#

Shit, okay

vernal rivet
#

You can only delete your messages

junior sun
#

Thanks guys

vernal rivet
#

Np

opal plank
solemn leaf
#

erwinnnn

opal plank
#

no

solemn leaf
#

un confusedd

opal plank
#

NO

#

last 8%

#

do it

junior sun
#

What?

solemn leaf
#

how

opal plank
solemn leaf
#

len = this.buf.write(err);

#

this stoped the old error

#

¯_(ツ)_/¯

opal plank
#

stop copying code

#

you dont even know what this does

junior sun
#

JAJAJA

solemn leaf
#

it imports

vernal rivet
#

Erwin is drunk, its best to do what he says, or someone is asking for an angry cat with a gun to come to your house

opal plank
#

it doent

restive pebble
#

lmao imagine this as import

vernal rivet
#

Erwin throw mdn at the man

solemn leaf
#

len = buf.write(err, 0, 'ascii')

#

?

restive pebble
opal plank
#

i threw them the node, which is way more complicated than mdn

#

i threw aki at the lions and laughed at it

vernal rivet
#

dogekek I like your thinking

opal plank
#

thats literally the last bit he hwas to figure out

vernal rivet
#

Yes

solemn leaf
#

len = buf.write(err, 0, 6000, 'ascii')

#

yes no?

opal plank
#

not saying a word

#

figure out

vernal rivet
junior sun
#

see u guys

opal plank
#

o/

vernal rivet
#

Bye

#

Wait you see us?

junior sun
#

it was a pleasure

willow yoke
#

I have come to this channel again. What if client.guilds is empty? The bot belongs to two servers

vernal rivet
#

??? That should never be the case

#

Are you using the cache property?

willow yoke
#

client.guilds.cache.forEath(guild=>{})

solemn leaf
#
 return this.utf8Write(string, 0, this.length);
                ^
TypeError: argument must be a string
    at Buffer.write (buffer.js:1038:17)
    at process.<anonymous> (C:\\\\\index.js:52:15)
    at process.emit (events.js:321:20)
    at process._fatalException (internal/process/execution.js:165:25) {
}
PS C:\Users\Owner\Desktop\discordjs2> node .
C:\Users\Owner\Desktop\discordjs2\index.js:52
    len = this.buf.write(err);
                   ^
TypeError: Cannot read property 'write' of undefined
    at process.<anonymous> (C:\\\\\index.js:52:20)
    at process.emit (events.js:321:20)
    at process._fatalException (internal/process/execution.js:165:25)
PS C:\\r\\discordjs2> node .
      throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
      ^
RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 2. Received 6000
vernal rivet
#

Foreath?

slender thistle
#

Your cache might be fucked if your bot is in two servers but you get none in cache

vernal rivet
#

Oh for each

opal plank
#

or they disabled caching

sick fable
#

Aah. I have a Problem

vernal rivet
#

If you print out the guilds object, will it display the object object bs or not?

opal plank
#

we all do

#

but go ahead

sick fable
#

So I basically want bot the permissions that only those members who have permission to ban and kick members Can use it.

solemn leaf
#

ok

vernal rivet
#

But?

solemn leaf
#

imma quit

#

after the error was this

#

buffer.js:638
^

opal plank
#

bad dev

sick fable
#

Bruh

opal plank
#

if you quit at every reoadblock you wont get anywhere

sick fable
#

I really don't know js

willow yoke
#

client.guilds.cache.array() //=>[]

opal plank
sick fable
#

Except this following code
console.log("Hello world");

opal plank
#

read this, at LEAST

vernal rivet
#

what Erwin said, or YouTube’s

sick fable
#

@opal plank I am talking about py

opal plank
#

hmmmm then idk

sick fable
#

JavaScript fucks my brain up

vernal rivet
#

O<o

sick fable
#

😦

opal plank
#

i swear if you recommend youtube one more time......

#

@vernal rivet

vernal rivet
#

Why didn’t you start with that?

sick fable
#

Why didn’t you start with that?
@vernal rivet I find Py easy

vernal rivet
#

Nah, I was going to throw the disgusting discord.py docs at them

solemn leaf
#

var buf = new Buffer(10)
length = buf.length(0, 1000)
len = buf.write(err, 'ascii')

opal plank
#

stop using var

solemn leaf
#

ok

vernal rivet
#

Var is not needed here

solemn leaf
#

const

opal plank
#

neither

vernal rivet
#

Only use it if you want to piss Erwin off

#

But use let

opal plank
#

yes, piss off the only person helping

#

sounds smart

vernal rivet
sick fable
#

Nah, I was going to throw the disgusting discord.py docs at them
@vernal rivet lmao

solemn leaf
#

erwinn removed

vernal rivet
#

||I was trying to save my butt from Erwin||

solemn leaf
#

Am I any closer

sick fable
#

var buf = new Buffer(10)
length = buf.length(0, 1000)
len = buf.write(err, 'ascii')
@solemn leaf bro I can't understand this thing 🥺

opal plank
#

¯_(ツ)_/¯

solemn leaf
#

why

vernal rivet
opal plank
#

8%

solemn leaf
#

the fuck

sick fable
#

I only know python 😦

solemn leaf
#

did you have to ping

vernal rivet
#

You should learn more languages its fun to do

solemn leaf
#

man I was about to remove the thing I did 🥺

opal plank
#

last 8% dude, figure it out, we already gave you all the rest of the code

#

try and error

solemn leaf
#

DUDE

opal plank
#

ive even narrowed down the methods you should be looking at with that link

solemn leaf
#

I DONT FUCKING UNDERSTAND THE DAM ERROR

opal plank
#

THERES NO ERROR

#

U COPYING SHIT

vernal rivet
sick fable
#

You should learn more languages its fun to do
@vernal rivet I am fucking my brain up with python 😂😂. Then I will go on to the next languages

opal plank
#

your error is that your copying shit that you dont know what it does

#

READ

#

THE

vernal rivet
#

Lol

opal plank
#

EXPLANATION

#

see what it does

#

check the snippets it provides

#

READ FFS

vernal rivet
#

I started with cpp, so idk what its like to take the easy way out

solemn leaf
#

THTA ISNT HELPING

opal plank
#

WELCOME TO DEVELOPMENT

vernal rivet
willow yoke
#

After all, what should I do?

solemn leaf
#

okay

#

listen

#

I cant legit

vernal rivet
#

Ok ok ok, what Erwin is trying to say, is that there is something that you have to do on your own, this is one of those things. We gave you everything to do this, all you need to do is read, and try and understand it. Try testing things and see what it does, that’s what we did.

solemn leaf
#

the only thing here

#

is about fucking attacks

vernal rivet
#

You can do it. Programming isn’t a skill, its the understanding of the language. So I shouldn’t be hearing you say you can’t do it

opal plank
#

wdym attacks? i provided you with 90% of the code you needed, the events, the cache, the way to attach the buffer onto the message attachments, the ONLY thing you need to do is convert the error to a buffer. and even on that ive given you a link with the only 7 methods listed in it. Simply read them. If i go any further i'll be spoonfeeding you the whole code. In development you gotta break your own legs dude, you wont always have someone to babysit you everytime you get stuck, its part of the challenge

#

those are the 7 methods listed

#

is it THAT hard to click each one and see what they do until you find the one that does what you looking for?

vernal rivet
#

And now we stay calm, and hope for success

opal plank
#

im calm, just drunk

vernal rivet
#

Best excuse ever

opal plank
#

what i get angry about is that even after ive linked them the docs they went onto stack overflow to get that this. . they clearly didnt even bother reading it

vernal rivet
#

Calm your drunken side

opal plank
vernal rivet
#

milk_think unless that’s your not drunken side then I should run

valid frigate
fathom topaz
#

what are

#

shards

solemn leaf
#

im hella tired

#

im gignna figure this out mr

sick fable
#

Can someone please explain what's the meaning of Inline and where it is used?

#

If No, then ima head off to google

slender thistle
#

Inline:
field1 field2

Not inline:
field1
field2

sick fable
#

I need explanation

#

Like what happens with it. Not the exanples

#

Examples**

honest perch
#

Inline

#

A B

#

Not inline

slender thistle
#

In-one-line fields

honest perch
#

A
B

sick fable
#

In-one-line fields
@slender thistle oh thanks bro

#

@honest perch thanks bro

blazing ravine
#

sup

#

how to fetch all channel ids ?

#

bot.channels.get

gusty quest
#

I have error while instaling quick.db

earnest phoenix
#

@gusty quest Ok

#

What does the error said?

gusty quest
#

im gonna send u in dm pastebin link

#

is that ojk?

earnest phoenix
#

Yeah

blazing ravine
#
    if (!channel) return console.error('Invalid ID or missing channel.');

#

how to fetch channel id when bot start

gusty quest
#

I sended it to u.

earnest phoenix
#

@blazing ravine client.channels.fetch

#

The syntax chnaged

blazing ravine
#

thank you

#

im making something like this ;d

earnest phoenix
#

@pale vessel maybe use the fourth parameter maxWidth in ctx.fillText() so the whole text is filled in the smol box

#

im making something like this ;d
@blazing ravine what the hell is that emoticon
also are you using GLITCH!? notlikenoot

misty sigil
opal plank
#

glitch

shut trellis
#

heyyy!

#

can anyone tell me how to do bot online?

#

const Discord = require('discord.js');
const bot = new Discord.Client();

const token = 'discord token';

bot.on('ready', () =>{)
console.log('This bot is online!');
})

bot.login(token);

opal plank
#

thats it

#

thats a basic bot

shut trellis
#

i put this code but it dosent work

opal plank
#

well you gotta put ur token

#

and RUN the code

shut trellis
#

awwwwww okay

#

i'll try

opal plank
#

in the bottom

shut trellis
#

in which place i have to put my bot token

misty sigil
#

In the client.login()

#

I’m just assuming djs

opal plank
#

thats the guide on how to make ur bot

misty sigil
#

it needs to be in a string

honest perch
#

Make it an object uwu

fathom topaz
#

eat

#

uwu

astral yoke
#

i got a question

earnest phoenix
#

ask it

astral yoke
#

im trying to make a help command

#

and im trying to use fs readdirSync

earnest phoenix
#

yeah?

astral yoke
#

so lets say

#

help command is in utility folder

#

and everythings in a command folder

#

how would i get the economy folder

earnest phoenix
#

...

#

fs.readdirSync("path/to/economy/folder");

#

r/ProgrammerHumor

astral yoke
#

it just says its not be able to found

#

if it was found i wouldnt be asking

earnest phoenix
#

did you put the path corrrectly?

astral yoke
#

like

#

this works const require = require('../economy')

earnest phoenix
#

send the code

astral yoke
#

but then const commands = readdirSync(`../economy`) dosent

earnest phoenix
#

you can just... loop through all of the subfolders of the commands folder

#

smh

#

instead of hardcoding it all

tight flame
#

Anyone knows why when someone is entering it doesnt display?

#

} else if (message.type === 'GUILD_MEMBER_JOIN') {
message.channel
.send(MESSAGE_PREFIX + "Send '!verify' to access other channels")
.catch(reason => console.log(reason))
}

next flax
#

hey

astral yoke
#

if someone joins the guild theres no message.channel defined

earnest phoenix
#

@tight flame message.type is not a thing

tight flame
next flax
#

how can i make my bot that it autojoins the voice channel

misty sigil
#

@astral yoke use the guildMemberAdd event

astral yoke
#

just do channel = ... then channel.send

next flax
#

that i seted through quick.db

tight flame
#

if (message.channel.id === CONFIG.WELCOME_CHANNEL_ID) {
if (message.content === '!verify') {
message.author
.createDM()
.then(dmchannel =>
dmchannel.send('Reply with your email for verification').catch(reason => console.log(reason))
)
.catch(reason => console.log(reason))
} else if (message.type === 'GUILD_MEMBER_JOIN') {
message.channel
.send(MESSAGE_PREFIX + "Send '!verify' to access other channels")
.catch(reason => console.log(reason))
}

earnest phoenix
#
let getChannel = await <quick.db>.fetch(<query>);

<client>.channels.cache.get(getChannel).join();``` @next flax
misty sigil
#

With

#

with your email

next flax
#

ok

misty sigil
#

what just use OAuth

tight flame
#

i dont know how

misty sigil
#

first programming project?

tight flame
#

yep

#

on discord.js

earnest phoenix
#

tfw you copy paste from 4 different sources and wonder why it doesnt work

#

If you want to collect messages, create a message collector

#

that's the raw event and the message event handling glued together

shut trellis
#

it doesnt work again

#

wtf

#

const Discord = require('discord.js');
const bot = new Discord.Client();

const token = 'discord token';

bot.on('ready', () =>{)
console.log('This bot is online!');
})

bot.login(token);

#

where i have to put my token

#

plzzz help me

earnest phoenix
#

did you run it

misty sigil
#

In that string

#

the const token = '' one

#

also that code is so copy pasted I swear I’ve seen it around 100 times now

next flax
#

DSL bot got verifeid

#

verified*

shut trellis
#

i put the bot token on the const token but still it is not going to online

earnest phoenix
#

@shut trellis do you know actually how to program stuff

misty sigil
#

did you copy paste that code

earnest phoenix
#

some mod pin this messsage:
LEARN ACTUAL FREAKING PROGRAMMING BEFORE TRYING TO MAKE A DISCORD BOT

astral yoke
#

s m h

misty sigil
#

ok I’m gonna give you a quiz

  1. What is an array
  2. What number does an array start at
  3. What is an object
#

@shut trellis

shut trellis
#

i m new i m learning

astral yoke
#

alright ill teach you.

misty sigil
#

go and learn base JS please

astral yoke
#

this is how to make a full bot exactly like mee6.

misty sigil
#

base JS will make almost everything

earnest phoenix
toxic briar
#

aRrayS stArt aT 1

astral yoke
#

do console.log('this is a bot!!!');

misty sigil
#

like 100% easier

astral yoke
#

do that and it works.

#

that makes a bot.

#

console.log('MEE6');

#

makes you a mee6 bot.

misty sigil
#

no it doesn’t

earnest phoenix
#

stop trolling

misty sigil
#

yes

earnest phoenix
#

literally just cluttering the chat

misty sigil
#

and feeding useless information to a beginner who’ll believe it

next flax
#

unexected token let

earnest phoenix
#

@shut trellis please learn actual programming before trying to make a discord bot
https://grasshopper.app
https://developer.mozilla.org
https://w3schools.com

shut trellis
#

okay

next flax
misty sigil
#

Why is there a bracket before setPresence

earnest phoenix
#

bin your code instead of taking your screenshot

and yes the error is correct, that isn't valid js syntax

misty sigil
#

and one after it

unique patio
#

Curious I pulled file offset/game offset but not sure what to do now. When I try to readbyte it is blank for file-offset?

earnest phoenix
#

an arrow function with only one line

#

with a guild parameter

misty sigil
#

omg that too

low shard
earnest phoenix
#

:KEK:
@misty sigil GIB SERVER INVITE GIB SERVER INVITE GIB SERVER INVITE

unique patio
#

shouldn't that be receivedMessage?

misty sigil
#

ok

unique patio
#

looks really wrong D:

earnest phoenix
#

@next flax god do you seriously know anything about programming

unique patio
#

So any idea with the offset questions, rather new and learning ish

#

lol

earnest phoenix
#

give context to your question

next flax
#

hm

unique patio
#

Did a search for a string, found in the heap an offset, compared with the parser by noexe

#

and got a gameoffset a nd file offset but nothing showing up when I call them

#

don't think they're pointers either, static search both times,different strings.

earnest phoenix
#

thonk

#

x64 or x86

next flax
#

x64

#

Why is there a bracket before setPresence
@misty sigil why

earnest phoenix
#

there shouldn't be any stupid behavior then

#

i don't know what it is

next flax
#

and yes the error is correct, that isn't valid js syntax
@earnest phoenixso how should i make it ok

#

as its wrong

earnest phoenix
#

so how should i make it ok
as its wrong
learn javascript =============== error fixed

#

just

next flax
#

;-;

earnest phoenix
#

WHY DO PEOPLE THINK THEY CAN MAKE THE BEST BOT IN THE WHOLE WORLD BY SPAMMING THE KEYBOARD AND CALLING IT A DAY

next flax
#

pls help boi

earnest phoenix
#

@earnest phoenix PESgn_Stop

#

Ignore them if they wont learn js

#

ok

next flax
#

how can i remove that syntax error

earnest phoenix
next flax
#

@earnest phoenix hey Voltrex help boi

earnest phoenix
#

What's the issue

next flax
#

i m trying to learn bot dev

#

i m new

earnest phoenix
#

You code has way too many syntax errors, you may brush up your javascript knowledge with the resources provided around internet

#

I spotted like 5 syntax errors in that single image

next flax
#

so please help to fix them

earnest phoenix
#

this is not the place to learn basics

#

hire a tutor or follow a course for that

#

this channel is rather for assistance with logic problems

next flax
#

@next flax

eternal osprey
#

hey guys

#

how do i input these returns into an embed:

#
            
            endGame(user);
            return `\`Dealer stands with\` ${newTotal}\`; **It's a tie**.\``;```
#

this is one of the 10 returns i have

#

i have tried to create an embed

#

but it didn't work

silver lintel
#
let mootRole = await message.guild.roles.create({
          data: {
            name: "Muted",
            color: "#FF0000"
          }
        });
``` how do i loop through all channels in a server and overide permissions  so anyone with this role cant type?
next flax
#

Yes

#

^^)

eternal osprey
#

anyone that can pplease tell me

#

how to return option above asan embed

silver lintel
#

what doesnt work in the embed?

eternal osprey
#

it is giving me user is notd efined

#

and later on message is not defined

earnest phoenix
carmine summit
#

let test = toTimeUntil((await axios('https://url.private.com')).estimate)axios is an unexpected identifier

#

nvm

#

forgot async

#

lol

misty sigil
#

axios?

carmine summit
#

no no

#

forgot async

misty sigil
#

oh nice

#

oh nice

eternal osprey
#

anyone that could please

#

help

#

because i am losing my mind right now

#
if (roll1 == 1 && roll2 == 1) {
              amount = amount * 2;
              ls.set(message.author.id + "profile", Number(ls.get(message.author.id + "profile")) + amount);
              return "\`You rolled snake eyes (1 and 1) and gained **2 times your original bet!**\`";  
          }
          else if (roll1 == roll2) {
            amount = amount * 3;
            ls.set(message.author.id + "profile", Number(ls.get(message.author.id + "profile")) + amount);
            return "\`It's a match,\` " + message.author.username + "\`! You rolled double \`" + roll1 + "\`s and gained **3 times your original bet!**\`";
          }
          else {
            ls.set(message.author.id + "profile", Number(ls.get(message.author.id + "profile")) - amount);
            return "\`Unlucky\` " + message.author.username + "\`, you lost $\`" + amount + "\`.\`";``` how do i return these return messages as embed???????
carmine summit
eternal osprey
#

i know how to make an embed you twat

carmine summit
#

define it to a variable

#

then return embed

#

let embed = <your embed>

eternal osprey
#

so, var returns = return?

#

owh

#

i have done that

#

but it was giving me user and message not defined error

#

as my code looks like this:

carmine summit
#
const exampleEmbed = new Discord.MessageEmbed()
    .setColor('#0099ff')
    .setTitle('Some title')
    .setURL('https://discord.js.org/')
    .setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
    .setDescription('Some description here')
    .setThumbnail('https://i.imgur.com/wSTFkRM.png')
    .addFields(
        { name: 'Regular field title', value: 'Some value here' },
        { name: '\u200B', value: '\u200B' },
        { name: 'Inline field title', value: 'Some value here', inline: true },
        { name: 'Inline field title', value: 'Some value here', inline: true },
    )
    .addField('Inline field title', 'Some value here', true)
    .setImage('https://i.imgur.com/wSTFkRM.png')
    .setTimestamp()
    .setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
return exampleEmbed
eternal osprey
carmine summit
#

try this

eternal osprey
#

look

#

i have like a lot of files inside my folder

#

all gambling files.

#

this is one of them

carmine summit
#

roll:

#

why

shut trellis
#

heyy yoo my bot is now online

#

hurrahhhhhhhhhhhhhhhhhhhhhhhhhh

eternal osprey
#

congratz

shut trellis
#

now i wanna learn that how to add commands in my bot

eternal osprey
#

but cwick you see what i am doing?

eternal osprey
#

i will send you the errors

#

hol up

carmine summit
#

message.channel.send(await dice(param))

#

i think

earnest phoenix
#
Promise {
  User {
    id: '545490362568015873',
    username: '4ce',
    bot: false,
    discriminator: '6485',
    avatar: '3c630dfa02a6fbc742972d93462521e5',
    flags: UserFlags { bitfield: 64 },
    lastMessageID: '757179554279194674',
    lastMessageChannelID: '707523130423509013'
  }
}
(node:10622) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'username' of undefined
    at Object.execute (/home/thinh/Programming/judger-djs/commands/tags/tagInfo.js:22:79)
.addField("Author",`${client.users.fetch(tag.userId).user.username}`, true)

Bruh why

#

you need to put await infront of promise

silver lintel
#
    let filter = m => m.author.id === message.author.id;            
    
    message.channel.send(firstEmbed);  
    
    message.channel.awaitMessages(filter, { max: 1, time: 15000, errors: ["time"] })
    .then(async collected => {
      let userInput = collected.first().content;    
      let perms = message.channel.permissionsFor(message.member);
      const channelExists = message.guild.channels.cache.has(userInput.replace(/<#([0-9]{2,})>/mi, "$1"));
      
      if (channelExists) {
        //channel exists
        let checkPerms = userInput.permissionsFor(message.member).has("SEND_MESSAGES", false);
        userInput.permissionsFor(message.member).serialize(false)
      } else {
        return message.channel.send(invalidEmbed);
      }
      
    }).catch(collected => {
        return message.channel.send("time out");
    });
``` it just sends time out, whats wrong here?
silk chasm
#

i want to ask that all the bots that are being made using javascript are made on node.js?

earnest phoenix
#

yes

split hazel
#

well there are other nodejs clones like deno but we don't talk about those bootleg clones

#

pure nodejs is king and always will be 😎

silk chasm
#

and node.js syntax is exactly same as of js editors?

silver lintel
#

.setThumbnail(message.guild.iconURL())

#

ive got this but its not working

silk chasm
#

and node.js syntax is exactly same as of js editors?
@silk chasm @earnest phoenix @split hazel

split hazel
#

did you have to tag all three of us

#

Well 2

#

should be yes

silver lintel
#

.setThumbnail(message.guild.iconURL())
ive got this but its not working

earnest phoenix
#

node is just a runtime

#

it's all the same language

umbral pollen
earnest phoenix
#

and this is related to development how

near drift
misty sigil
#

well

#

there is no /app/views/index.html

#

it just doesnt exist

silver lintel
#

It literally says that

near drift
#

I have to create a file called index.html?

misty sigil
#

in /views/ yes

near drift
#

Ok

pure lion
#

MATT

#

what was my message

#

i need to format it

misty sigil
#

???!?!?!?!?!???!?!??????????????????!!!!

near drift
earnest phoenix
#

have you tried reading the error

near drift
#

???

silver lintel
#

I've got an array
var array = [{"a": "🇦, "b": "🇧" and so on, how do I like loop through a message and replace every letter with that?

quartz kindle
#

why an array tho

silver lintel
#

I have no idea, how should I approach this command?

quartz kindle
#

you have an object: {a:A,b:B,c:C} etc

#

adding an array around it doesnt help with anything

#

just use the object directly

#

you can loop over the object using Object.keys() or Object.entries()

silver lintel
#

Okay I'll try

misty sigil
#

what

#

why not just toUpperCase

near drift
#

Says me the same error ._.
.

earnest phoenix
leaden rover
#
    @commands.command(name="unban")
    @commands.has_guild_permissions(ban_members=True)
    @commands.bot_has_guild_permissions(ban_members=True)
    @commands.cooldown(1, 3, commands.BucketType.user)
    async def unban(self, ctx, member: discord.Member, reason):
        """
        Unbans a user
        """
        banned_users = await ctx.guild.bans()
        member_name, member_discriminator = member.split('#')
        for ban_entry in banned_users:
            member = ban_entry.member
  
        if (member_name, member_discriminator) == (member_name, member_discriminator):
            await member.unban()
            embed = discord.Embed(title=f"{member} was unbanned; {reason}")
            await ctx.send(embed=embed)
            channel = await member.create_dm()
            await channel.send(f'You were unbanned in {ctx.guild.name} for {reason}.')
        elif member == None:
            embed = discord.Embed(title=":x: You need to sepcify a user!")
            await ctx.send(embed=embed) ```
How do I make it so this command is able to unban a user if the author uses an ID?
untold plover
#

idk

fringe axle
#

Someone knows how to get the number of commands in a group (discord.js-commando)

near drift
magic jasper
umbral zealot
#

maybe click on something else than assets

#

you're trying to look at the assets folder and you have none. this isn't an error.

#

oh you mean at the complete right, sorry

near drift
#

But what do i have to do?

umbral zealot
#

you need to make /app/views/index.html

magic jasper
#

Cool gars

near drift
umbral zealot
#

try without the beginning / then.

#

app/views/index.html

near drift
#

Ok

earnest phoenix
#

a

near drift
umbral zealot
#

yes precisely

near drift
umbral zealot
#

¯_(ツ)_/¯

near drift
#

ok ¯_(ツ)_/¯

cerulean salmon
#

for long time like 24 hours which timing function u use , setInterval ?

umbral zealot
#

setTimeout and setInterval are based on "milliseconds". So, 1000 is 1 second. 60000 is 60 seconds.

#

I'm sure you've learned a long time ago how time works, you can do simple multiplication math can you?

cerulean salmon
#

yes

umbral zealot
#

oh sorry that wasn't your question.

#

either I misread or you edited that for clarity

#

setTimeout and setInterval still can be used in long periods, however, they'll reset if the bot shuts down. You'll need to use a database that stores time, as well as something like node-schedule or cron, to keep those things alive.

cerulean salmon
#

ohhh yeah

#

i got my answer

#

as i use heroku free subs

umbral zealot
#

yeah but it can still be reset, if it has an error or if you update the code

cerulean salmon
#

so not sure my bot will 24/7

#

i must need to use a database

#

and how u guys handle multiple servers schedule ?

umbral zealot
#

timestamps stored in database ^_^

cerulean salmon
#

guild id + channel id + timestamps ?

umbral zealot
#

something like that, yeah

cerulean salmon
#

👍 thanks

earnest phoenix
#

huh

#

what the heck

#

How can i get the bot deaf it self? (discord.js)

#

deaf = ?

umbral zealot
#

uhhhh just... don't listen to audio?

#

¯_(ツ)_/¯

earnest phoenix
#

hm k

cerulean salmon
#

btw ,which Database service u guys use ?

earnest phoenix
#

MongoDB

#

is tha best

#

it isn't

#

you choose a database based on what you need

#

every database has its pros and cons

#

well MongoDB is the most easiest

#

MySQL is for such of big data

#

and anothers idk

silver lintel
#

.addField("Roles:", member.roles.map(roles => ${roles}).join(', '), true)
console: member.roles.map is not a function

earnest phoenix
#

mysql is completely trash

#

should've left it in the 2010s

#

yes

#

but big company still use it

#

cuz their data

#

.addField("Roles:", member.roles.map(roles => ${roles}).join(', '), true)
console: member.roles.map is not a function
@silver lintel see what type the roles prop is

#

. . .

#
.addField("Roles:", `${member.roles.cache.map(roles => roles.name).join(', ')}`, true)

@silver lintel

#

:))

silver lintel
#

Tyy

slender wagon
#

is there a way i can connect my google analytics for my website with my discord bot? like a api or something

misty sigil
#

MySQL is bad

carmine summit
#

uh

#
if (command == 'eval') {
      if (message.author.id != 487511010886942720) return message.channel.send('You don\'t have permission to run this command')
      let code = args.slice(0).join(' ')
      message.channel.send(await eval(code))
    }
```Doesn't seem to work
#

plz help

earnest phoenix
#

ids are not numbers

#

well, they are, just not in djs because snowflakes are too big for js numbers

umbral zealot
#

yeah just treat them as strings.

carmine summit
#

ok

umbral zealot
carmine summit
#

now help me with eval

#

doesn't work

restive furnace
#

if you wanna use MySQL, use MariaDB.

earnest phoenix
#

what doesn't work

carmine summit
#

Cannot send an empty message

#

API error:

restive furnace
#

and big companies uses nowdays uses MariaDB, Cassandra, PostgreSQL or MongoDB. (those are most used)

earnest phoenix
#

also eval isn't async, why are you awaiting it

carmine summit
#

I just thought it wont work as

#

discord tryna send it

#

but it hasnt been processed

earnest phoenix
#

rtfd

carmine summit
#

Bruh

earnest phoenix
main trench
#

Await is waiting for a specified thing to happen before that line of code can be executed

umbral zealot
main trench
#

Since you don't have anything specified to happen that's why your getting the error

umbral zealot
#

Actually no, that's not true, using await on a normal value works perfectly fine.

main trench
#

Oh?

umbral zealot
#

yeah. I use it for values that might be promises. all the time.

main trench
#

Ah makes sense

umbral zealot
#

in my eval, actually.

earnest phoenix
#

js will act as if it isn't there if the return value isn't a promise

umbral zealot
#

no, that's false.

earnest phoenix
#

oh?

umbral zealot
#

const thing = await 'This is a string'; will make thing equal to that string.

main trench
#

Ooh ok

earnest phoenix
#

so, it acts as if it isn't there?

umbral zealot
#

well it acts as if it's a promise but it's resolved instantaneously.

earnest phoenix
#

yeah just hit up the docs

sudden geyser
#

I think JS actually does try to wait until 'This is a string' to "resolve" as last time I tested it (which is almost instant) but it was interesting. It didn't feel like JS was just excluding the keyword.

umbral zealot
#

it's slightly less performant because it needs to create a promise and resolve it.

#

but when you're doing an eval and you don't know what the return is... it's useful.

sudden geyser
#

They're probably keeping the await there in case one of the return values does end up being a Promise. However, they could also just save the eval result to a variable then check if it's an instance of a promise.

umbral zealot
#

the instanceof condition would probably similarly be slow anyway ¯_(ツ)_/¯

#

at the level of an eval run only by the bot owner, the performance is insignificant.

earnest phoenix
#

the operator would do that behind the scenes anyways, no?

umbral zealot
#

You guys are thinking this is an issue but it really isn't. evals are run once and they're run manually, so the nanoseconds it takes aren't affecting anything

#

If this was a loop of 100k maybe it would matter but not here

sudden geyser
#

I don't think it's an issue. I just think it's interesting how JS would be wrapping it in a promise // other ways of doing it.

pure lion
#

im getting 404 discordapierror when attempting oauth2, but its not giving me any info. it worked when i had it in my index.js, but now im getting this error when its in a seperate route file

umbral zealot
#

it's probably less code that way

#

Well, 404 can only mean you're hitting an endpoint that doesn't exist

#

maybe you have a wrong ID?

pure lion
#

edited for more detail my apologies mmulu

carmine summit
#

why is eval dangerous???

umbral zealot
#

Cwickks, it says why on the page 😉

#

literally 3 paragraphs of explanation

silk chasm
#

A BOT CAN'T BE ADD In MORE THAN 100 SERVERS

pure lion
#

its not 7th oct yet

umbral zealot
#

indeed.

pure lion
#

calm your titties

umbral zealot
#

no need to scream it at us, we're aware.

carmine summit
#

uh

silk chasm
#

its not 7th oct yet
@pure lion exactly i want to know about this that what will happen on 7th of oct?

earnest phoenix
#

akschually

#

it can

#

you just won't be able to use privileged intents without getting verified

pure lion
#

cry can you help me?

earnest phoenix
#

with

carmine summit
#

what i mean is

pure lion
#

auth fucc

#

im getting 404 discordapierror when attempting oauth2, but its not giving me any info. it worked when i had it in my index.js, but now im getting this error when its in a seperate route file

carmine summit
#

im running on a VPS

earnest phoenix
#

what's the full stacktrace

#

and what is it throwing on

pure lion
#
(node:15084) UnhandledPromiseRejectionWarning: DiscordAPIError: 404: Not Found
    at RequestHandler.execute (/root/LJDCnWil/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:15084) DiscordAPIError: 404: Not Found
    at RequestHandler.execute (/root/LJDCnWil/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15084) [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.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
#

here is the full stack

earnest phoenix
#

thonk, does it not point to where you called the method

#

i'm guessing it's because you're using promise pattern with then()

silk chasm
#

what it meant by this:
Therefore, we are making verification a requirement for bots in 100 or more servers. Until your bot is verified, you will not be able to grow past 100 servers. If your bot is already in more than 100 servers, it will not be able to join any more.
TELL ME MORTALS I DIDN'T GET IT

umbral zealot
#

uhhh do you want us to explain it in, like, simpler english?

earnest phoenix
#

oh they changed it

#

it used to be that you won't be able to use privileged intents

#

now it's that your bot can't grow at all

umbral zealot
#

that's been like that for quite a while. months even

silk chasm
#

means we have to make our bot added in 75+ servers to get a check mark and privileges

earnest phoenix
#

making a bot just to get a badge doesn't work anymore

umbral zealot
#

it means, when your bot reaches 76 guilds, you need to start the verification process. the verification process means that once it's verified, it is able to go past 100 guilds.

earnest phoenix
#

discord does not give badges to verified bot devs anymore

umbral zealot
#

if you don't verify it, it cannot be added to more than 100 guilds (after october 7th. until then the limit isn't applied yet) .

earnest phoenix
#

Hey, how do I start with bot developing? (ik Python, JS, Java)

silk chasm
#

and what if our bots didn't get in 76 server before that time..?

umbral zealot
#

There's no point in trying to grow the bot just to get a checkmark.

earnest phoenix
#

find a library for your desired language and follow the lib docs

umbral zealot
#

If you bot doesn't reach 76 servers, why would the verification matter?

#

it's not 100+ so it's safe.

earnest phoenix
#

ok let's say, Discord.js

#

and is that it?

umbral zealot
#

@earnest phoenix step 1) learn the programming language you intend to use. Step 2) THEN and only then should you attempt to make a bot

earnest phoenix
#

they said they already know a few languages

#

and yes, that's it

#

I'm programming for about 2 years now

silk chasm
#

@umbral zealot and if our bot reaches in 76 server that date then can we verify it?

earnest phoenix
#

djs has their docs, simply follow that

pure lion
#

i'm guessing it's because you're using promise pattern with then()
am using async

umbral zealot
#

@silk chasm yes. you get a notification about doing the verification process at exactly 76 guilds.

earnest phoenix
#

ik Adv. Python and quite well in JS, so I think I should start with Discord.js

#

and is there a lib. for Python?

umbral zealot
earnest phoenix
#

a few, popular being ^

umbral zealot
#

most devs aren't... like... very original with their library names.

silk chasm
#

and if our bot reaches in 76 server afterthat date then can we verify it?

umbral zealot
#

ignore the date

#

76 guilds => you need to verify

pure lion
#

fixed it nvm

umbral zealot
#

100 guilds => if you're not verified, that's the limit of guilds.

silk chasm
#

but why dicord is telling to get it before that date

umbral zealot
#

they need a buffer period for everyone with large bots to verify them

silk chasm
#

did they will stop verifying it

earnest phoenix
#

the change still isn't in place yet

#

it will happen on that date

umbral zealot
#

No, they will not stop verification in the future ,they will continue verification, they started early before limits are in place so that people wouldn't riot and burn them down because bots can't be added anymore

earnest phoenix
#

they're suggesting you do it before the date because after it, it'll get restricted

umbral zealot
#

pretty simple concept really

#

always give a grace period when adding new laws and rules that affect people.

silk chasm
#

ok

earnest phoenix
silk chasm
#

and why the hell is maker of triviabot @green kestrel here as a mod... lol

umbral zealot
#

why wouldn't they be

silk chasm
#

ahh means if ur bot goes succesful why be a mod then ...lol.. he would be a mod before and forgot that he

#

is a mod

#

loooooooooooooooooooooooooooooooooooooooooooool

sudden geyser
#

because they wanted to be one?

umbral zealot
#

... I don't know why they couldn't be both a mod and a bot owner? waitWhatSpin

slender thistle
#

It's possible to both moderate a server/website and own a rather big bot 🤔

silk chasm
#

does it look good to be a king of one place and being a simple minister at other...

earnest phoenix
#

what

umbral zealot
#

Yeah, it actually looks very good to be able to manage multiple things in your life. It's a sign of a very organized mind thumbs

slender thistle
#

^ this tbh 😂

silk chasm
#

oh wait why isn't my profile is showing that i am using vs code rn?

umbral zealot
#

probs because you don't have the discord presence plugin 😉

silk chasm
#

@umbral zealot = BIG BRAIN

umbral zealot
#

Also also you're offline so...

silk chasm
#

I AM NOT

#

LOOOOOOOOOOOOOOOOOOL

umbral zealot
#

discord says you were a minute ago but ok

silk chasm
#

"discord says"?

umbral zealot
#

nvm

silk chasm
#

probs because you don't have the discord presence plugin 😉
@umbral zealot oh wait to use it we have to install discord?

umbral zealot
#

yes, you need the discord app, and the discord presence plugin

silk chasm
#

can it work on browser discord?

umbral zealot
#

nope

silk chasm
#

idk for what reason my discord doesn't launch...

earnest phoenix
#

xD

carmine summit
#

Promise { <pending> }
How do I remove this BS?

umbral zealot
#

by resolving the promise.

thin turret
#

Resolve the promise

carmine summit
#

how

umbral zealot
carmine summit
#

just did ?eval message.channel.send('some text here')

umbral zealot
#

well, send() returns a promise

carmine summit
#

why does it not pop up when run on code

#

not in eval

umbral zealot
#

because your eval sends the result of your evaluated code to the channel

#

your normal code does not

solemn leaf
#

@opal plank

#
    me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
       ^

TypeError: Cannot read property 'send' of undefined
#

new error

pale vessel
#

me is undefined

solemn leaf
#
let me = bot.users.cache.get("485987127809671168")
    let buf = new Buffer(10)
    len = buf.write("hi")

    me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
#

flaze?

pale vessel
#

you can just use Buffer(string) or Buffer.from(string)

quartz kindle
#

the user may not be cached

#

you have to fetch it

solemn leaf
#

so

quartz kindle
#

let me = await bot.users.fetch("id here")

solemn leaf
#

ok

grand path
#

no one is responding to me on this 😦

solemn leaf
#

bcs

#

you have to wait

quartz kindle
#

@grand path thats not enough code

#

what is handleUserInput?

grand path
#

it's an async function which replies to the message

quartz kindle
#

what does it do?

solemn leaf
#

timmm

#

I cant use await

grand path
#

async function handleUserInput(msg) {
try {
const content = msg.content;
if(content.includes(myBotId)){
return;
}
const inputArgs = content.split(" ");
if(inputArgs.length > 0) {
const command = inputArgs[0].toLowerCase();

        console.log(`Content: ${JSON.stringify(msg.content)}`);

        if (command === COMMAND.PING.command && inputArgs.length === 1) {
            msg.reply('pong');
            return;
        }
pale vessel
#

why not

grand path
#

first few lines look like this

solemn leaf
#

SyntaxError: await is only valid in async function

grand path
#

but there are commands which are slow and takes 1 minute to run

pale vessel
#

make the parent function async

quartz kindle
#

and during those commands, no other command works?

#

show those commands

grand path
#

yes no other command works

pale vessel
#

@solemn leaf where is that code? what event?

grand path
#

other commands just wait

solemn leaf
#

its in my index

grand path
#

this console doesn't get print until previous command is processed
console.log(Content: ${JSON.stringify(msg.content)});

quartz kindle
#

show the command

grand path
pale vessel
#

@solemn leaf can you show me your index code?

solemn leaf
#
bot.login(config.token);

process.on('uncaughtException', (err) => {
    let me = bot.users.fetch("485987127809671168")
    let buf = new Buffer.from("hi")


    me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).on('unhandledRejection', (err) => {
    let me = bot.users.fetch("485987127809671168")
    let buf = new Buffer.from("hi")

    me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).catch(console.log);
pale vessel
quartz kindle
#

@grand path the command that gets stuck is wittytodo?

pale vessel
#

async (err)

grand path
#

yes

solemn leaf
#

ok

pale vessel
#

add async to make the function async

grand path
#

it runs for 2 mins appx

#

I do lot of future computations

quartz kindle
#

what does it do?

grand path
#

I am running DP algorithms

#

😄

quartz kindle
#

are those computations synchronous?

grand path
#

yes

quartz kindle
#

then that is the problem

grand path
#

it's a class

#

it's an async function

#

I call an async function only

quartz kindle
#

the computations themselves are synchronous, making it async doesnt do anything

solemn leaf
#

now my bot wont start

#

(node:200) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any time

quartz kindle
#

for example, lets say you have this: ```js
function sync() {
for(let i = 0; i < 9999999; i++) {
// do something
}
console.log("a")
}

async function notsync() {
for(let i = 0; i < 9999999; i++) {
// do something
}
console.log("a")
}

solemn leaf
#

it loaded when I removed it

quartz kindle
#
console.log(1)
sync()
console.log(2)
//  1 a 2

console.log(1)
notsync()
console.log(2)
// 1 a 2
solemn leaf
#

now I errored a command

#

and it didnt send me it

quartz kindle
#

in both sync and async cases, the function makes the code get stuck, and console.log(2) only works after the function completes

#

making a function async by itself doesnt make your code async, but it "allows" you do design async code

#

for example, you could do something like this

solemn leaf
#

it did it

quartz kindle
#
async function actuallyasync() {
  for(let i = 0; i < 9999999; i++) {
    // do something
    if(i % 1000 === 0) {
      await new Promise(r => setImmediate(r));
    }
  }
  console.log("a")
}
solemn leaf
#

who you talking to

quartz kindle
#

then you will have ```js
console.log(1)
actuallyasync()
console.log(2)
// 1 2 a

solemn leaf
#

.

#

tim

#

what you fuk you on>?

quartz kindle
#

using async functions allows you to design async code and break it down yourself, but it doesnt magically do it for you

#

im talking to @grand path

solemn leaf
#

oh goood

#

okay so it sent me hi

#

but if I switch the hi for err it doesnt send

#
process.on('uncaughtException', async (err) => {
    let me = await bot.users.fetch("485987127809671168")
    let buf = new Buffer.from(err)

    me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).on('unhandledRejection', async (err) => {
    let me = await bot.users.fetch("485987127809671168")
    let buf = new Buffer.from(err)

    me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
})
grand path
#

@quartz kindle weird

quartz kindle
#

if you are executing many heavy computations, you have to break them down by inserting some waiting time

#

this is what setImmediate is designed to do in node.js

#

to break up sync code into pieces and enable the main thread to be given control back in between these pieces

grand path
#

oh

#

so I can just insert setImmediate at random places

#

and it should take parallel inputs?

quartz kindle
#

yes

#

setImmediate says "ok, now stop and go back to the main thread, and continue in the next loop"

grand path
#

ty

#

I'll try that now

green kestrel
#

and why the hell is maker of triviabot @green kestrel here as a mod... lol
@silk chasm I was a mod here before I ported triviabot to discord Crab_Rave FrogTonguePFF

solemn leaf
#

off-topic^

faint prism
#

maybe, unless he enlightens us

worldly oriole
#

If the bot that I posted on top.gg got accepted how can I know that it is accepted?

fickle sapphire
#

You get tagged in this discord

worldly oriole
#

Does it dm me?

grand path
#

still stuck @quartz kindle

quartz kindle
#

how did you add it? and where?

earnest phoenix
#

How do i get my bot able to let people choose the prefix?

charred geyser
#

you need a database

earnest phoenix
#

I know, but from there what do i do

grand path
charred geyser
#

what sort of database do you use?

grand path
#

whatToDo is the function that runs too much time

earnest phoenix
#

There are different databases? im supposed to be new and this is destroying my brain

charred geyser
#

uh

#

yeah

#

what database do you use?

earnest phoenix
#

Well how do i know what database i use

charred geyser
#

it should be pretty obvious

earnest phoenix
#

Just tell me ;-;

quartz kindle
#

@grand path you made it only work if experience is a multiple of 1000

solemn leaf
#

@earnest phoenix if your using the thing I gave you

#

its db

charred geyser
#

since usually when you are using a database you either download it or use an online service

earnest phoenix
#

@earnest phoenix if your using the thing I gave you
@solemn leaf npm i quick.db

charred geyser
#

usually*

solemn leaf
#

yes

#

that

grand path
charred geyser
#

quickdb

quartz kindle
#

what is the heaviest part of your code? is it the triple for loop in what to do?

grand path
#

that last ping command never executed

#

because it's waiting for previous command

#

@quartz kindle it's the recursion

quartz kindle
#

the recursion in minDays?

grand path
#

yes

earnest phoenix
#

@charred geyser there "npm i quick.db"

quartz kindle
#

remove the if

grand path
#

okay trying..

charred geyser
#

@earnest phoenix you are using discord js?

earnest phoenix
#

Yes

charred geyser
#

uh

#

okay

#

im not really sure how quickdb works

#

gimme a sec

solemn leaf
#

I do

#

and I gave him code yesterday for it

silk chasm
#

@silk chasm I was a mod here before I ported triviabot to discord :Crab_Rave: :FrogTonguePFF:
@green kestrel ik u were a mod here and then forget about it... Lel by the way nice creation but one day my bot will defeat triviabot...

charred geyser
#

so you wanna create a guild object for each guild the bot is in

#

and then store the prefix in that object

faint prism
#

im not really sure how quickdb works
@charred geyser do you know any other dbms?

#

I'd imagine the concepts are the same

charred geyser
#

ive only used mongo

#

yeah

silk chasm
#

and then store the prefix in that object
@charred geyser u mean variable, right?

charred geyser
#

so id assume you wanna like

grand path
#

memory leak and wrong answer now @quartz kindle

lusty lintel
#

hello

charred geyser
#

db.set('guild', { guildId: 'message.guild.id'})

#

or something?

solemn leaf
#

@charred geyser

#

no

#

no

#

no

#

n

charred geyser
#

no?

solemn leaf
#

@earnest phoenix db.set(`prefix_${message.guild.id}`, args[0])
prefix = await db.get(`prefix_${message.guild.id}`)

#

the first would be in the command where you would set the prefix

#

and the prefix part would be in the index where you set the prefix

charred geyser
#

would you not wanna create storage per guild

#

so you can have more than just prefix

quartz kindle
#

@grand path then you will need to refactor your code

charred geyser
#

sorry i am used to schemas

#

i have a schema like this:

quartz kindle
#

because asynchronous programming is very similar to multithreaded programming, you have to think about possible overlapping code, increasing queues, etc...

charred geyser
#
const { Schema, model } = require("mongoose");

const guildSettingSchema = new Schema({
  guildName: { type: String },
  guildID: { type: String },
  prefix: { type: String, default: "%" },
  autoRole: { type: String },
  joinMessage: { type: String },
  leaveMessage: { type: String },
  color: { type: String, default: "#00ff77" },
});
module.exports = model("guild_settings", guildSettingSchema);
quartz kindle
#

you have to be sure 2 calculations at the same time are not interfering with each other accidentally, or you will get wrong results

grand path
#

that won't interfere coz I create new objects every time

#

for Player class

quartz kindle
#

and if your calculations are really that heavy you need to have rate limits to prevent starting more than you can finish

lusty lintel
#

GUYS

#

you see my statu

shy turret
#

that's against discord tos

lusty lintel
#

oh oops i forgot what a foggot

shy turret
#

also you might be banned from this server for doing that

lusty lintel
#

nvm i do nto fo

shy turret
#

check community guidelines

#

selling ur acc is against tos

charred geyser
#

lol

lusty lintel
#

ghewo

#

I forgot ok and i dlete it oke @shy turret ?

unkempt ocean
#

Hey, can someone help me please, I can't apply my css to description section. I'm trying to show my website with iframe

quartz kindle
#

show code

unkempt ocean
#
<link rel="stylesheet" href="http://mydomain/main.css">
<iframe src="http://mydomain/" class="frame"></iframe>
#

I tried with localhost and it worked but in top.gg css not works

shy turret
#

you need to use <style> i think

earnest phoenix
#

the first would be in the command where you would set the prefix
@solemn leaf %prefix [new prefix]
right?

shy turret
#

I've been playing with sharding with express and ejs but i keep getting {} and console errors. All guilds is not defined

        <center>
            <% for (var i = 0, len = guilds.length; i < len; i++) { %>
                <% let guild = manager.broadcastEval(`
                (async () => {
                    let guild = this.guilds.cache.get(guilds[${i}].id);
                    if (guild) {
                        console.log(guild)
                        let member = guild.members.cache.get(userinfo.id);
                            if (member) {
                                if (member.hasPermission("ADMINISTRATOR")) {
                                    return guild;
                                }
                            }
                        }
                        return false;
                    })();
                `); %>
                <% if (guild) { %>
                    <p><%= JSON.stringify(guild) %></p>
                <% } %>
            <% } %>
        </center>
earnest phoenix
#

so confused after some stuff

#

@shy turret Pastebin that shit

shy turret
#

expires in 10 min

earnest phoenix
#

Nice

shy turret
#

wait

#

i just realized im dumb

earnest phoenix
#

;-;

shy turret
#

nvm im not dumb im blind

#

funny im getting SyntaxError: Unexpected identifier now

fickle sapphire
#

message.guild?

shy turret
#
(node:6652) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [ChildProcess]. Use emitter.setMaxListeners() to increase limit

i hate this 🙂

split zinc
#

How to get a free badge for Android??

earnest phoenix
#

what

shy turret
#

everything is undefined wow

#

@split zinc what

split zinc
#

@shy turret how to fet free badge

earnest phoenix
#

??

shy turret
#

you cant get fre discord badges

woven gale
#

+help

shy turret
#

wrong channel

pale vessel
#

you cant get fre discord badges
@shy turret you have one lol

shy turret
#

you cant get a free badge

#

even the hypesquad teams badge takes time

pale vessel
#

it doesn't

umbral zealot
#

I mean, you can get the Nitro badge and the Server Boost badge pretty easily 😉

shy turret
#

except u need to get money (which is pretty hard)

#

(not rly)

#

(it's really easy if u r the age)

pale vessel
#

you can just answer the hypesquad quiz and get the badge but only on desktop. isn't that what you did?

#

it used to be harder to get though

#

discord cucked themselves

indigo flax
#

guys

#

OMG

#

HI TWO

#

@shy turret

shy turret
#

omg bye

#

help me im out

indigo flax
#

wait

#

either ur dms are off

#

guys did two block u

split zinc
#

@umbral zealot > I mean, you can get the Nitro badge and the Server Boost badge pretty easily 😉
@umbral zealot how pls dm mr

umbral zealot
#

... literally, buy nitro

#

and then boost a server

split zinc
#

Oh ok ok

unkempt ocean
#

I can't even use css to change style things in iframe

#

I can change iframe properties only

umbral zealot
#

yes. that's how iframes work.

unkempt ocean
#

how can I change it or how can I apply css file in it

umbral zealot
#

why would you change the css in an iframe