#development

1 messages · Page 1138 of 1

earnest phoenix
#

on

#

"."

#

of

haughty igloo
#

1 min

#

i delete code

#

i need swearing block

earnest phoenix
#

Swearing

#

Wtf

#

Just link me youe glitch

haughty igloo
#

Bro

#

client.on("message", msg => { db.fetch(`kufur_${msg.channel.id}`).then(i => { if (i == 'acik') { const kufur = ["oç", "amk", "ananı sikiyim", "ananıskm", "piç", "amk", "amsk", "sikim", "sikiyim", "orospu çocuğu", "piç kurusu", "kahpe", "orospu", "mal", "sik", "yarrak", "am", "amcık", "amık", "yarram", "sikimi ye", "mk", "mq", "aq", "ak", "amq",]; if (kufur.some(word => msg.content.includes(word))) { try { if (!msg.member.hasPermission("BAN_MEMBERS")) { msg.delete(); return msg.reply('Küfür etme lan').then(msg => msg.delete(3000)); } } catch(err) { console.log(err); } } } else if (i == 'kapali') { } if (!i) return; }) });

#

Where is have

#

Bug

earnest phoenix
#

db.fetch?

#

And no key

haughty igloo
#

Wdym

earnest phoenix
#

Kufur is the name

haughty igloo
#

Yes

earnest phoenix
#

But there is no key to store

haughty igloo
#

What do I need?

earnest phoenix
#

Stuff

haughty igloo
#

küfür = swearing

misty sigil
#
client.on("message", msg => {
    db.fetch(`kufur_${msg.channel.id}`).then(i => {
        if (i == 'acik') {
            const kufur = ["oç", "amk", "ananı sikiyim", "ananıskm", "piç", "amk", "amsk", "sikim", "sikiyim", "orospu çocuğu", "piç kurusu", "kahpe", "orospu", "mal", "sik", "yarrak", "am", "amcık", "amık", "yarram", "sikimi ye", "mk", "mq", "aq", "ak", "amq", ];
            if (kufur.some(word => msg.content.includes(word))) {
                try {
                    if (!msg.member.hasPermission("BAN_MEMBERS")) {
                        msg.delete();
                        return msg.reply('Küfür etme lan').then(msg => msg.delete(3000));
                    }
                } catch (err) {
                    console.log(err);
                }
            }
        } else if (i == 'kapali') {}
        if (!i) return;
    })
});``` heres the actual, non obfuscated code
earnest phoenix
#

db.fetch("name.key");

#

That's how you use it

#

The key is where you store stuff

#

The database is where the key stays

#

Example:

#
db.set("name",2); //wont work no key

db.set("name.key",452588); //will work
haughty igloo
#

I still do not understand how to fix it

earnest phoenix
#

Bruh

#

A key is where you store a value and a database is where you store the keys

#

I think you use quick.db

haughty igloo
#

` ` Should I use them instead of ""?

earnest phoenix
#

Bruh

#

Not the problem

#

The problem is there is no key

#

A database name and a key is separated by a . in quick.db

#

db.get("name.key"); //returns the key value

#

So if there is no key then it will throw the TypeError No key specified

#

If you still need help then enter plexidev in the join server button

haughty igloo
#

?

earnest phoenix
#

No

haughty igloo
#

"kufur"

#

?

earnest phoenix
#

Also you're using " use `

#

Because ${} only works in `

haughty igloo
#

Pls write code

earnest phoenix
#

Wtf

#

That's spoonfeeding

haughty igloo
#

Can you write down what I should do?

earnest phoenix
#

Ok

#

But i won't just give you the stuff and you cooy paste

haughty igloo
#

Oke

#

Send i copy paste

earnest phoenix
#

Wtf

#

But i won't just give you the stuff and you cooy paste

wont just give you the stuff and you copy oaste
wont

haughty igloo
#

Bro

#

İ dont understand

misty sigil
#

rule 7 spoonfeed

earnest phoenix
#

Do i need to explain English now

#

Man

#

bruh

#

I linked a discordjs server

#

just click the plus icon, select join sercer and type pkexidev

#

does anyone know how to make discord bots ???

#

music bot or normal bot

#

dm me

#

for info and payment

slender thistle
#

-needdev @earnest phoenix

gilded plankBOT
#

@earnest phoenix

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

earnest phoenix
#

srry

#

just needed in urgent

#

then

#

Don't ask here

#

@earnest phoenix ik a guy who can

#

dm me

#

kk

umbral pollen
#
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)```
#

pls help me with this error

pale vessel
#

that doesn't help at all

#

heroku must have purged the rest

umbral pollen
#

@pale vessel what do you mean ??

#

hmmmm thanks man

pale vessel
#

can you show earlier logs?

earnest phoenix
#
var user = bot.users.cache.fetch("247741991310327810");
if (user.isQt == false) {
  console.log("HOW THE FUCK IS SHIVACO NOT A QT THAT IS HIS ID GETTING FETCHED");
} else {
  console.log("toldya shivaco is a qt");
}
pale vessel
#

if not, none of us can't help, try looking in the shard.js file for errors

#

cache.get();

umbral pollen
#

@pale vessel so what if i dont want tot put it in the heroku , can i still fix it

grave smelt
#

var StaffEmbed =
.setTitle('Staff')
.addField('Developer', admin);

at the point of ".setTitle" says "Expression Expected"

pale vessel
#

please read docs

earnest phoenix
#

Where's message embed

pale vessel
#
misty sigil
#

Wheres the embed?

grave smelt
#

please read docs
@pale vessel i?

pale vessel
#

yes

#

kimi

earnest phoenix
#

You never selected the contructor

misty sigil
earnest phoenix
misty sigil
#

You need new Discord.MessageEmbed().stuffHere

earnest phoenix
#

Usemy link

odd lichen
#

Eyo. I forgot what link brackets look like. Anyone got an example ?

misty sigil
#

hyperlink?

slender thistle
odd lichen
#

alright ty

grave smelt
honest perch
#

so weird shit

#

for each works fine on linux

#

but not windows

#

and confusion level for me is 1000

faint prism
#

I could see a dependency not working across OSes, but in general the language should behave the same

honest perch
#

yeah, i uninstalled some dependencies due to them asking for weird things like python but they werent actually required to run the bot

#

so im super confused haha

left nacelle
#

csn anyone help me

#

its keep ssying module not found

honest perch
#

install the module

left nacelle
#

theres already a module

faint prism
#

Sounds like your module is missing, bud

misty sigil
#

install it

#

npm?

left nacelle
#

what

#

i dont understand

misty sigil
#

what language

#

is bot in

faint prism
#

and don't say English

left nacelle
#

idk what u mean

#

im new to this

misty sigil
#

what language

faint prism
#

Also, Did you try googling the issue first?

left nacelle
#

i did

misty sigil
#

google would have the fix

#

ok so @left nacelle

left nacelle
#

but nothing

misty sigil
#

tell me. what language is your bot in

faint prism
#

The error makes me think JS

left nacelle
#

im just gonna give up lmao

#

idk how to do this

#

way too hard and confusing

pale vessel
#

feelsbadman

left nacelle
#

and i even did it from a tutorial

#

did the exact same thing

midnight blaze
#

at the start of the tutorial it says: U need javascript knowlegde :

#

:>

earnest phoenix
#

Who can send me a tutorial in french for use visual studio code pls Thanks pandasad dblspin disco blobdance

surreal sage
#

how to check if a piece of code is completed succesfully?

valid pumice
#

e

surreal sage
#

ex: ```
client.user.send('b')

midnight blaze
#

there is no tutorial alone for visual studio, you mean, you need a tutorial in a programming language, with visual studio as their ide

grave smelt
#

case 'help':
const HelpEmbed = new MessageEmbed()
.setTitle('Commands')
.addField('mc!help', '- Show this list.')
.addField('mc!server %ip%', '- Show information about that server.')
.addField('mc!changelog', ' - Show the update/fix of version.')
channel.send(HelpEmbed)
break

the bot does not send any of this and does not give errors in the console
where am i wrong?

solemn latch
#

.send is a promise.
.then() will only run if it resolved correctly

surreal sage
#

ok thanks

midnight blaze
#

@grave smelt channel.send is wrong

grave smelt
#

message.channel.send(HelpEmbed) ?

midnight blaze
#

that would make more sense

earnest phoenix
#

I search how I install visual studio and how use this

grave smelt
#

nothing changes

misty sigil
#

by learning a programming language

midnight blaze
#

@grave smelt is your command under a message event listener?

#

you have to give more information

grave smelt
#

@grave smelt is your command under a message event listener?
@midnight blaze yes

midnight blaze
#

then it should work, then you have somewhere else a problem

#

message.channel.send() is good for now

#

what about the case, how do you make sure that "help" is the right case. how do you detect it? With a collector?

#

or with args?

grave smelt
#

args

midnight blaze
#

console.log your args, maybe it is not "help", maybe you include something else

#

otherwise it should work now

grave smelt
#

how can i do?

midnight blaze
#

?

#

you dont know how to console.log your args?

grave smelt
#

yes

honest perch
#

..

#

please

#

learn basics

#

of

#

js

#

and come back once you do that

midnight blaze
#

console.log is so basic, I cant even

grave smelt
#

console.log(args[0])

#

i was confused

earnest phoenix
#

How can i host multiple sites in one VPS? i have one site hosted right now (on port 80) and in GoDaddy i have A record pointing to the ip address of the vps, so how i can host another one if i cant set multiple sites on one port?

solemn latch
#

Nginx or apache let's you create virtual hosts
It will choose which site to go to depending on the url used.

earnest phoenix
#

You have any video to guide me? from youtube or idk

solemn latch
#

Depends on what you specifically are doing.
Nginx and apache have diffrent feature sets.

earnest phoenix
#

I have 2.bots who have dashboard

#

right now im hosting one bot and its work

#

i want to host another one with dashboard

#

but i cant point the other one to port 80 since he is in use

solemn latch
#

Then, probably nginx would be easiest

#
DigitalOcean

When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks

earnest phoenix
#

Thanks

#

Its says i need sudo

#

and i have Windows @solemn latch

slim forum
honest perch
#

bruh

#

you need to define Discord

cinder patio
#

You haven't defined Discord

solemn latch
#

Nginx and apache really don't like windows.
I mean, they run, but they really are not fans of it iirc

earnest phoenix
#

umm

solemn latch
earnest phoenix
#

ok thanks

slim forum
#

how to define Discord

honest perch
#

learn js

solemn latch
#

Looks like a typo to me
Discord and discord are not the same

#

Capitalization matters

honest perch
#

it is a typo 😉

earnest phoenix
honest perch
#

no

pale vessel
#

no

honest perch
#

no

earnest phoenix
#

if anyone needs thissoftware dm me

pale vessel
#

no

honest perch
#

no

#

its shit

#

i bought it as a joke

#

and its actually bad

pale vessel
#

nitro is better than that thing

earnest phoenix
#

kk

misty sigil
#

lmao wtf is that

zenith terrace
faint prism
#

if anyone needs thissoftware dm me
@earnest phoenix But it costs. What are you implying?

earnest phoenix
#

if someone makes me a bot using that then i am happy to give it to them for free

misty sigil
#

lmfao

#

its easy enough to make your own bot with that

earnest phoenix
#

its not duh

rustic nova
misty sigil
#

dude

#

no

#

its easier than developing

#

and nobodys gonna make you a bot with that

earnest phoenix
#

so can you make it

#

?

rustic nova
#

it's yucky to use discord bot maker

misty sigil
#

yes i could

#

but no

rustic nova
#

i sent you resources ilhan

#

read these

misty sigil
#

it'll ruin my pride lmao

faint prism
earnest phoenix
#

nah i bought it

misty sigil
#

make the bot using it yourself

#

it cant be that hard lmao

#

its a bot builder

earnest phoenix
#

let me try

rustic nova
#

Funny thing is, why would you want to pirate bot maker when you can literally do the same thing with code GWnatesnowSmart

misty sigil
#

for free lmao

rustic nova
#

exactly

earnest phoenix
#

i didnt pirate it

misty sigil
#

Funny thing is, why would you want to pirate bot maker when you can literally do the same thing with code :GWnatesnowSmart:
@rustic nova buy makes more sense

faint prism
#

Distributing software for "free" is pirating

delicate zephyr
#

@earnest phoenix just because you bought it. Does not mean you can distribute it

earnest phoenix
#

i am not distributing

misty sigil
#

but you

earnest phoenix
#

i am giving the person who will make a bot for me

misty sigil
faint prism
#

give it to them for free

honest perch
#

thats

rustic nova
#

unless you're talking about gifting it them through steam

#

but i reckon nobody wants this sacred piece of software on your library

misty sigil
#

no

#

i dont

#

make the bot yourself

#

it cant be that hard lmfao

earnest phoenix
#

it is

rustic nova
misty sigil
#

it cant be that hard its literally a bot builder but it might be

#

i'll look into it

rustic nova
#

nah the bot maker is easy

pure lion
#

i am giving the person who will make a bot for me
gimme money

misty sigil
#

bruh

#

its easy as fuck

#

theres even yt tutorials

pure lion
#

no its totally hard

misty sigil
#

no no

#

not you

#

i dont understand cpp at all

pure lion
#

its haAAAAAARD

#

lmao

#

i mean making bots are definitely hard

misty sigil
#

the dude who's wanting us to make a bot in dbm for him

#

discord bot maker

pure lion
#

if you want a bot pay me and then make a bot

misty sigil
#

i want a bot but im not paying you

earnest phoenix
#

do you accept robux

faint prism
#

lel

pure lion
#

dafuc

#

i accept ropounds idiot

misty sigil
#

i only accept ksp credits sorry

#

i'd take science tho

faint prism
#

Rubles?

pure lion
#

gimme help with cpp

earnest phoenix
#

but there is no URL

#

so how to download it

solemn latch
#

Not sure, probably will have to Google it.

#

Like I said, nginx isn't really made for windows. So I've never done it

pure lion
earnest phoenix
#

oh ok

delicate shore
#

umm

#

i am a tester

#

nice

#

so glitch is having issues

#

my bot is crashing due to it

#

every other day it says module discord.js not found

earnest phoenix
#

do pnpm-enable

#

in console

delicate shore
#

okie

earnest phoenix
#

and use pnpm instead of npm

delicate shore
#

oook

earnest phoenix
#

idk what is pnpm

#

it seem to be glitch think

#

also

#

glitch suck

delicate shore
#

yeh

#

i know

#

i am shifting to a

#

VPS

#

bruh

#

@earnest phoenix it said not found

#

command not

earnest phoenix
#

whaty

#

what

#

woops

#

enable-pnpm

#

@delicate shore

delicate shore
#

:bruh:

fringe axle
rustic nova
#

canvas.getContext is literally not a function

fringe axle
#

Yea

cinder patio
#

Are you sure canvas is an instance of the Canvas class?

delicate zephyr
#

@fringe axle can you console.log(canvas)

lusty quest
#

@solemn latch did you want to run Nginx on windows?

solemn latch
#

Nah someone else did

lusty quest
#

anyways use docker. takes 30 seconds to setup and if you know how to mount volumes you can easy make changes

solemn latch
#

Docker for nginx?

#

Nginx is already pretty drag and drop isnt it?

modest maple
#

not really

#

basic config sure

fringe axle
#

How can I send a message to a specific channel ID?

solemn latch
#

I have 4 websites, I always have just drag and dropped stuff

#

The whole config folder

#

🤷 guess I've been nginxing wrong

earnest phoenix
#

now i need to wait

solemn latch
#

Youd have to get the channel by id

#

Which depends on the lib

fringe axle
#

You mean me?

solemn latch
#

Yeah

lusty quest
#

i mean for running Nginx on Windows. you just launch a Container with Linux in it. you dont need to fickle around with inoffical guides

solemn latch
#

Ohh

fringe axle
#

Like message.channel.send(272764566411149314)

#

That the message will send in here

solemn latch
#

Yeah for windows absolutely

#

That would send those numbers to message.channel

fringe axle
#

And how can I do it that it will send the message in this channel?

#

Like I do !sendMessage 272764566411149314 Hi in #commands and he will send "Hi" here

lusty quest
#

your code will send the message into the channel where the command was used

left nacelle
#

gonna try again to make a bot, how do i add a module

fringe axle
#

But how can I do it like I said.

lusty quest
#

to use different channels define a variable containing the channel object

solemn latch
#

Client.channels.cache.get(id)
Iirc

lusty quest
#

^

fringe axle
#

And then he will send the message in here?

#

(It's for custom welcome/leave channel by the way.)

lusty quest
#

but this requires that the channel is cached. if not cached uses client.channels.fetch(id)

left nacelle
#

how do i mske my bot online and add a module?

lusty quest
left nacelle
#

cuz i thoufht i had a module already in

lusty quest
#

@fringe axle define a variable that contains the channel object or chain them

solemn latch
#

Add a module to what

fringe axle
#

@fringe axle define a variable that contains the channel object or chain them
@lusty quest I'm new to discord.js v12

left nacelle
#

to my bot

fringe axle
#

But I use quick.db

lusty quest
#

Client.channels.cache.get(id).send(text)

fringe axle
#

Okay

#

Thanks!

#

Very helpful.

lusty quest
#

this as example will send a message into the channel

left nacelle
lusty quest
#

if you want to use the channel for more stuff in your code define a variable that holds the channel object. then you can do channelvar.send(text)

fringe axle
#
client.on('guildMemberAdd', member => {
  let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
    const channel = db.get(`wchannel_${message.guild.id}`)

  Client.channels.cache.get(channel).send(text)
  
  let text = message.channel.send(`Welcome ${member} to ${message.guild.name}!`)
});
#

Will work?

lusty quest
#

try it and see

fringe axle
#

tRy OuT aNd SeE

#

I knew it xD

lusty quest
#

but looks good

fringe axle
#

Nice!

lusty quest
#

(if your db holds the correct id)

fringe axle
#

I only need a command to set the channel ID

lusty quest
#

wait

#

you have an error

#

Client.channels.cache.get(channel).send(text)
-> send should contain your message

#

not just text text was a placeholder

#

also why 2 DB querys?

left nacelle
#

i did all my stuff from tjis guy

#

but my bot doesnt work even after following everything

modest maple
#

👀

left nacelle
#

everyrhing is correct

lusty quest
#

he uses Discord.js V11 you probably installed V12

left nacelle
#

what

solemn latch
#

Youtube tutorials are often out of date

lusty quest
#

Discord.js is the module you use as a wrapper for the Discord API

left nacelle
#

can someone send me some stuff i can copy amd paste

lusty quest
#

read rule 7A again

solemn latch
#

Copy and pasting code is bad

left nacelle
#

7a?

lusty quest
#

read it

earnest phoenix
#

@earnest phoenix I did as it says but when I type the commands from discord the bot doesn't say anything, there are no errors in the console either
@grave smelt what code did you type?

grave smelt
#

@grave smelt what code did you type?
@earnest phoenix I fix it, I don't remember how now though

earnest phoenix
#

because

#

you used your brain

#

good boy

#

thanks for following rule 7a

modest maple
#

i doubt

earnest phoenix
#

but can i see your code?

#

I have welcome and goodbye with custom channel in quick db but wanna make in mongo db

faint prism
#

MongoDB is nice

grave smelt
#
        const StaffEmbed = new MessageEmbed()
        .setTitle('Staff')
        .addField('Developer', admin)
        message.channel.send(StaffEmbed)
    break   ```
> but can i see your code?
@earnest phoenix
earnest phoenix
#

just

faint prism
#

@grave smelt
```

earnest phoenix
#

put it in ```

fringe axle
#

@lusty quest hm, hes set's the channel but not sending any message in it.

#

Oh

#

Error

earnest phoenix
#

you're AGAIN remaking the embed everytime

#

@grave smelt

#

What about me?

#

idk how to do mongo

faint prism
grave smelt
#

how?

@grave smelt
```
@faint prism

earnest phoenix
#

but i'm sure it is
███████╗███████╗
██╔════╝╚════██║
█████╗░░░░███╔═╝
██╔══╝░░██╔══╝░░
███████╗███████╗
╚══════╝╚══════╝

#

you literally type ```

#

then the text

#

then another ```

lusty quest
#

I like Mongo. used Mysql Before but mongo does some stuff better

earnest phoenix
#

@lusty quest can you help me then?

lusty quest
#

what is your issue?

grave smelt
#

you're AGAIN remaking the embed everytime
@earnest phoenix no problem

faint prism
#

I use a mongodb lib and read the docs to use?

earnest phoenix
#

bruh

#

I have welcome and goodbye with custom channel in quick db but wanna make in mongo db

#

that is a problem

lusty quest
#

js?

earnest phoenix
#

Yeah

grave smelt
#

that is a problem
@earnest phoenix why?

earnest phoenix
#

umm

#

is there a way to check if only the position of a channel changed in the channelUpdate event

#
  • how you got this star badge?
lusty quest
#

either install mongodb (offical) or Mongoose (easyer for beginners)

earnest phoenix
#

you're making the same thing again every time which is just wasting resources

#

either install mongodb (offical) or Mongoose (easyer for beginners)
@lusty quest did

#

I used mongoose

fringe axle
earnest phoenix
#

Cause I am new

lusty quest
#

good

earnest phoenix
#

But how to change in mongo

fringe axle
#
client.on('guildMemberAdd', async member => {
  let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
    const channel = db.get(`wchannel_${message.guild.id}`)

  Client.channels.cache.get(wchannel).send(text)
  
  let text = `Welcome ${member} to ${message.guild.name}`
});
earnest phoenix
#

I have command in quick db

solemn latch
#

Your using text before defining it

lusty quest
#

you need to pass your client @fringe axle

fringe axle
#

Means?

lusty quest
#

also your text is beneath the send function

#

doesnt work this way

earnest phoenix
#

Vale your quick.db db.fetch has a missing required argument

fringe axle
#

No

earnest phoenix
#

yes

grave smelt
#

you're making the same thing again every time which is just wasting resources
@earnest phoenix I don't know how else to do. one way or another I always have to rewrite the content of the embed. in my opinion this is the best idea to also maintain an "order".

earnest phoenix
#

there is no key

#

BRO

lusty quest
#

@earnest phoenix did you tryed to read the mongoose docs?

earnest phoenix
#

No

#

just put it outside your command handler

#

No one told me

fringe axle
#

It's my index.js

earnest phoenix
#

😅

lusty quest
#

its usually the first thing you do

earnest phoenix
#

Lemme try that

#

Ok

#

How you got that star badge? @lusty quest

left nacelle
#

google isnt even helping

earnest phoenix
#

@fringe axle your bot will crash every single time someone sends a message because there is no key specified in db.fetch

lusty quest
#
client.on('guildMemberAdd', async member => {
  let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
    const channel = db.get(`wchannel_${message.guild.id}`)
let text = `Welcome ${member} to ${message.guild.name}`
  Client.channels.cache.get(wchannel).send(text)
 
});
fringe axle
#

Means?

earnest phoenix
#

allow me to explain

fringe axle
solemn latch
#

Means exactly what he said

earnest phoenix
#

bruh

lusty quest
#

@earnest phoenix boost a Server with Nitro

grave smelt
#

just put it outside your command handler
@earnest phoenix but each command has a different embed, what's the difference between putting the staffEmbed outside?

earnest phoenix
#

that is with expressjs or smth

#

@earnest phoenix but each command has a different embed, what's the difference between putting the staffEmbed outside?
@grave smelt that you don't define it again everytime and waste resources

#

Ohk

#

Not with Nitro boost?

#

@fringe axle rn your bot is crashing because of some other problem

#

not one with quick.db

fringe axle
#

How can I fix this error?

left nacelle
earnest phoenix
#

show the listener thingy code

lusty quest
#

@earnest phoenix it is a Nitro Boost

left nacelle
#

are all of these the ones needed?

earnest phoenix
#

???

fringe axle
#

show the listener thingy code
@earnest phoenix there is none...

earnest phoenix
#

It doesn't looks like Nitro boost one

grave smelt
#

@grave smelt that you don't define it again everytime and waste resources
@earnest phoenix but each command had a different embed so every time I have to do another one

earnest phoenix
#

wtf

fringe axle
#

All worked before

earnest phoenix
#

That's different

lusty quest
#

also Possible its bcs im a Early Adopter of Nitro Boosts

earnest phoenix
#

Ohk

#

Nice

#

@earnest phoenix but each command had a different embed so every time I have to do another one
@grave smelt of course.... why the hell won't you need to make a new embed every time you want to send a different embed for a different command

#

i sort my file like this:

fringe axle
#

;__;

earnest phoenix
#

is there a way to check if only the position of a channel changed in the channelUpdate event

#

@fringe axle That's a simple JS error, you simple dont define message

lusty quest
#

@fringe axle Show your index.js line 89

fringe axle
#

let wchannel = await db.fetch(`wchannel_${message.guild.id}`);

earnest phoenix
#

ok message isnt defined

lusty quest
#

did you somewhere defined message?

fringe axle
#

Good question, no.

left nacelle
#

how do i get discord. js

lusty quest
#

npm i discord.js

grave smelt
#

code913 is typing...

earnest phoenix
#

@grave smelt You should sort your files similar to mine

main
|_index.js
  |_setup stuff
  |_functions
  |_expressjs stuff
  |_embeds
  |_random number generators yes i need em
  |_command handler
|_assets
  |_images
  |_oggs
|_website
  |_index.html
  |_redirect.html
left nacelle
#

done

earnest phoenix
#

@fringe axle you need to specify a key

fringe axle
#

@lusty quest what I have to do? :O

left nacelle
#

should it work now

lusty quest
#

define message

earnest phoenix
#

I can help em

fringe axle
#

How?

lusty quest
#

or use a different way to get the id

pure lion
#

Is anyone cpp

lusty quest
#

did you know basic js?

pure lion
#

Or no

fringe axle
#

I know

#

But it worked for other commands too.

lusty quest
#

did you got a message handler?

fringe axle
#

No

lusty quest
#

did you use the on Message event?

earnest phoenix
#

I read that

fringe axle
#
client.on('guildMemberAdd', async member => {
  let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
    const channel = db.get(`wchannel_${message.guild.id}`)
let text = `Welcome ${member} to ${message.guild.name}`
  Client.channels.cache.get(wchannel).send(text)
 
});
earnest phoenix
#

Btw I have mongo db set up

#

@fringe axle

db.fetch(`databaseName.keyName`); //returns the value of keyName from the databaseName
db.fetch(`databaseName`); //throws error because there is no key
fringe axle
#

Still this.

earnest phoenix
#

bro

#

i said so many times

#

there is no key in db.fetch

grave smelt
#

@grave smelt You should sort your files similar to
mh I take a cue

earnest phoenix
#

so it will throw nan error

fringe axle
#

That's still not the problem.

earnest phoenix
#

@lusty quest my mongo db's setup is done

fringe axle
#

Working in other code.

earnest phoenix
#

but itwill cayse errors

#

bro

#

Now I think I need to make a folder named models right?

#

why the fuck are you sending the command handler if it is a problem with the listener thingy

#

and there IS a problem inside the command handler too

fringe axle
#

Listener error is fixed

earnest phoenix
#

now try sending a single message

#

the bot will crash

fringe axle
earnest phoenix
#

because there is no key in db.fetch

fringe axle
#

This is the error

lusty quest
#

@earnest phoenix cool. yes is best practise

#

@earnest phoenix no he dont defined message

fringe axle
earnest phoenix
#

@fringe axle you defined member instead of messaeg KEKW

#

I need to make right?

fringe axle
#

@fringe axle you defined member instead of messaeg KEKW
@earnest phoenix I need member too :O

earnest phoenix
#

@lusty quest I need to make folder right ?

lusty quest
#

@earnest phoenix you dont need to but it looks cleaner

earnest phoenix
#

Hm so can I make?

#

@fringe axle replace member with message before the => thingy

#

Cause I want everything arranged

fringe axle
#

Okay

earnest phoenix
#

you'll define member INSIDE the {}

#

What to make in models file @lusty quest

#

because member is a property of message and you literally named message as member KEKW

lusty quest
#

did you read the pages of the docs in how to define a model?

earnest phoenix
#

Hm

lusty quest
#

its simple you make your folder for the models and put in there your schema files

#

and in the files where you want to do a query you require the schema file you want to query

fringe axle
#

No error and no response in the channel that I set as welcome channel.

#

Oh

#

Now member is not defined @earnest phoenix

earnest phoenix
#

Rip

fringe axle
earnest phoenix
#

Define member then

lusty quest
#
client.on('guildMemberAdd', async member => {
  let wchannel = await db.fetch(`wchannel_${member.guild.id}`);
```this is how it looks like right?
fringe axle
#
client.on('guildMemberAdd', async message => {
  let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
    const channel = db.get(`wchannel_${message.guild.id}`)
let text = `Welcome ${member} to ${message.guild.name}`
  Client.channels.cache.get(wchannel).send(text)
 
});
#

Like this

lusty quest
#

did you see the difference?

fringe axle
#

Yea

#

But I need message too.

lusty quest
#

why?

#

you need the guild id

fringe axle
#

No

lusty quest
#

and the member object also includes the guild

fringe axle
#

Because if message is not defined then the error message is not defined is coming

lusty quest
#

i bet with you for 1 Month Nitro you dont need Message

fringe axle
#

And what I need then?

lusty quest
#

change message to member

fringe axle
#

Okay, bet.

#

1 Month Nitro

lusty quest
#
client.on('guildMemberAdd', async member => {
  let wchannel = await db.fetch(`wchannel_${member.guild.id}`);
    const channel = db.get(`wchannel_${member.guild.id}`)
let text = `Welcome ${member} to ${member.guild.name}`
  Client.channels.cache.get(wchannel).send(text)
 
});
#

like this

earnest phoenix
#

why would you need a message object

#

mongoose.model('ModelName', mySchema),

#

lol

#

Just need to edit right?

lusty quest
#

ez 1 Month Nitro

#

(i dont even need)

earnest phoenix
#

I need xD

#

Gimme that

lusty quest
#

@earnest phoenix this is the last line in your code

earnest phoenix
#

Ok

#

Well I need to make new model?

lusty quest
#
const mongoose = require('mongoose');

const guildSchema = mongoose.Schema({
    _id: mongoose.Schema.Types.ObjectId,
    guildID: {type: String,unique: true,index: true},
    premium: {type: Number, default: 0},
    prefix: String
});

module.exports = mongoose.model('Guild', guildSchema);
```this is my model for a bot i use (guild config)
earnest phoenix
#

Oh

#

Wait a min

fringe axle
#

@lusty quest 1 month nitro please

lusty quest
#

error?

earnest phoenix
#

bro

#

i give up

fringe axle
#

He just spams "Ready" KEKW

lusty quest
#

not my error

fringe axle
earnest phoenix
#

that's a fluke in your code elsewhere

fringe axle
#

Now it is yours

lusty quest
#

not my error

fringe axle
#

It is

earnest phoenix
#

because you're too dumb to understand what i was screaming 2020 times

fringe axle
#

not my error
@lusty quest it's in line 92

lusty quest
#

did you use Client or client?

earnest phoenix
#

you copypasted superbrain's code and you didn't adjust the variables accordingly

#

stop being a toxic dumbass

#

yep

fringe axle
#

did you use Client or client?
@lusty quest wait

earnest phoenix
#

not gonna help anymore

fringe axle
#

stop being a toxic dumbass
@earnest phoenix you mean me?

earnest phoenix
#

yes

fringe axle
#

I wrote this code.

#

He made it right.

earnest phoenix
#

hey

#

lol

#

which is better? quick.db or mongodb

lusty quest
#

Mongo

earnest phoenix
#

why

lusty quest
#

quick is nice but mongo offers you better scaling

earnest phoenix
#
const db = require("quick.db");
const Discord = require("discord.js");
module.exports = async (client, member) => {
  let chx = db.get(`welchannel_${member.guild.id}`);

  if (chx === null) {
    return;
  }

  let embed = new Discord.MessageEmbed()
    .setTitle("WELCOME")
    .setDescription(
      `Welcome to our server ${member.user.tag}. Hope you enjoy here an don't forget to read rules`
    )
    .setColor("#FF2D00")
    .setTimestamp()
    .setImage(member.user.displayAvatarURL({ dynamic: true }));

  client.channels.cache.get(chx).send(embed);
};```
#

do research on sqlite vs mongo performances

#

since quick.db is just a wrapper around sqlite

#

this is in my guild member add event

#

sorry

lusty quest
#

ok

modest maple
#

sqlite will seem faster

lusty quest
#

and you want to get the channel from the DB

earnest phoenix
#

seem

modest maple
#

well

#

it will be faster

earnest phoenix
lusty quest
#

its probably faster bcs it runs local

modest maple
#

but its a direct db

earnest phoenix
#

goodboi

#

I wanna replace quick db here

modest maple
#

its not a server type db

lusty quest
#

but its annoying AF to scale across mutiple machines

modest maple
#

you litterally cant

earnest phoenix
#

that's exactly what i want

#

sqlite is not scalable yeah

modest maple
#

not well

earnest phoenix
#

look into postgresql

lusty quest
#

you probably can with some stupid workarounds

earnest phoenix
#

a database on my own machine

#

a powerful sql server

#

if you want scalability

#

what about me xD

lusty quest
#

did you got your schema defined?

earnest phoenix
#

what I should do

#

im checking your code mate

#

checking your stuff

#

Actually I gave you code of my guild member add event

#

wait you wanna update from quick.db to mongodb?

#

yeah

#

welp i cant help witht hat

lusty quest
#
 const data = await <Schema>.findOne({ <key>:<value> });
earnest phoenix
#

ask the qts here

lusty quest
#

this is how you can query for stuff

faint prism
#

Quality Testers

fringe axle
#

@lusty quest still not working.

#

With big C and small c

lusty quest
#

errro?

fringe axle
#

None

#

Just don't send it

earnest phoenix
#

AUger the guy whose pfp is the reason i can't sleep

lusty quest
#

then you got somewhere else a error

earnest phoenix
#

please

#

read the docs

#

send the full code

#

and stop demanding

#

what to do with this code const data = await <Schema>.findOne({ <key>:<value> });

#

or debug your code, you said you wrote it, you can surely debug it, Vale

#

yup

#

🧠

lusty quest
#

data will contain the stuff your MongoDB returns

fringe axle
#

Error

earnest phoenix
#

ohk

lusty quest
#

replace <schema> and the key stuff with your stuff

earnest phoenix
#

ok

fringe axle
#

Nitro please KEKW

lusty quest
#

@fringe axle is your channel cached?

earnest phoenix
#

what about value

fringe axle
#

It is

earnest phoenix
#

@fringe axle : sends only 1% of the full code
Also @fringe axle : asks us to help

#

literally debug OH MY GOD

#

please

#

inspect your variables

#

log them

lusty quest
#

then remove .send and pack it into a console.log

earnest phoenix
#

check if they're defined

#

me ?

inspect your variables
@earnest phoenix

lusty quest
#

then send the log in here

earnest phoenix
#

nope, Vale

#

hm

fringe axle
#

Nah, I'll try to fix it myself. Superbrain is nice but cry and code...

earnest phoenix
#

dude

lusty quest
#

@earnest phoenix how did you define your key? i would use guildid:yourguildid

earnest phoenix
#

imma just ignore vale

#

we're pushing you to do it yourself because you're capable of doing it, you just don't want to do it

#

yep

#

and because you didn't listen to the quick.db error i said 2020 times

#

which gives an error

lusty quest
#

i would suggest the DB doesnt return anything bcs it has no key defined -> cant find the channel to send a message

misty sigil
#

no dont

earnest phoenix
#

jk

#

@lusty quest I just have a setup

#

now name of file in models?

lusty quest
#

?

#

you need to create the Document in your database first

#

i would use the guild Create event to create a config file for every guild the bot joins

earnest phoenix
#

@fringe axle

#

is your problem solved vale

fringe axle
#

No

lusty quest
#

@earnest phoenix just let him do his thing no need to ping him a million times

fringe axle
#

But I'm trying it

earnest phoenix
#

read it

#

I want the command to welcome user

fringe axle
#

And it's getting better

earnest phoenix
#

cool

#

🎉

fringe axle
#

It's not a quick.db error.

misty sigil
#

guildMemberAdd @earnest phoenix

lusty quest
#

@earnest phoenix yea you need to define a document in the database first

earnest phoenix
#

ok

#

It WILL give an error afterwards

#

imma just delete my messages

lusty quest
#

otherwise you wont have data to fetch

earnest phoenix
fringe axle
#

It's working for an other code.

earnest phoenix
#

this is what it looks like

fringe axle
#

And I don't set a Key

earnest phoenix
#

then

sweet garden
#

we how the all delete roles
v12

misty sigil
#

api abuse

#

afaik

earnest phoenix
#

what I do now?

lusty quest
#

@earnest phoenix did you know how to save a document?

earnest phoenix
#

And I don't set a Key
woah i guess keys dont exist no need to listen to my explanations with all due respect just block me

#

in?

lusty quest
#

your db?

#

(in Mongoose Documents are your DB entries)

earnest phoenix
#

mongo db?

#

actually I am new 😅

#

so I want a guider + teacher

lusty quest
#

ok

earnest phoenix
#

lol

#

I am 13 years old so yea need to attend school to I got time now

lusty quest
#
const newGuild = {
        guildID: guild.id,
        prefix: "!"
    };
``` define your Model (fill in data)
earnest phoenix
#

add it in?

misty sigil
#

gah

#

i still need to fix my mongodb errors

lusty quest
#

then ```

const gld = await new Guild(newGuild);

#

then just add schema.save()

earnest phoenix
#

ok

#

what to add in website

#

anything?

lusty quest
#

this is inside your bot

earnest phoenix
#

ok

#

in models file right?

lusty quest
#

i still suggest adding it inside the guild Create event

#

no not models

#

this is a Query

earnest phoenix
#

I have a file named guild member add

#

can I add in that?

lusty quest
#

if a guild adds the bot -> new Document for the Guild is created

#

if you define the fields in your Schema and the Model yes

earnest phoenix
#

ok so I would prefer guild member add

#

now plz guide me

#

a min

#

I am back

#

first I need to import mongoose right ? @lusty quest

lusty quest
#

require it

earnest phoenix
#

yeah

lusty quest
#

also require your schema

earnest phoenix
#

ok

tight plinth
#

so im using quick.db and i have an array, and i want to delete a specific element of the array. how can i do that? i tried js let db = client.db.get('reminders') delete db[r] where r is the array content, but it doesnt work. any idea what can i do?

earnest phoenix
#

const mongoose = require('mongoose');

#

how to require schema?

lusty quest
#

did you know how to require files?

cinder patio
#

I believe splice is the only way without cloning the array, Lumap

tight plinth
#

hm

earnest phoenix
#

const Schema = mongoose.Schema;

lusty quest
#

did you know how to require files?

earnest phoenix
#

?

cinder patio
#

Also, if you want to use delete, you'll have to do db[IndexOfItemYouWantToDelete], and also it won't resize the array, the item at that index will be undefined I believe

lusty quest
#

const {Guild} = require('/path/to/your/model')

earnest phoenix
#

so I need to do that right?

lusty quest
#

yes

earnest phoenix
#
  • I need to link it to which file
lusty quest
#

you do it this way

tight plinth
#

Also, if you want to use delete, you'll have to do db[IndexOfItemYouWantToDelete], and also it won't resize the array, the item at that index will be undefined I believe
@cinder patio hmmmmmmmmmmmmmmmmmmm

pale vessel
earnest phoenix
#

I mean which file is should write in brackets

lusty quest
#

like /models/guild.js as example

earnest phoenix
#

oh

#

I didnt made any file in models folder

#

I am adding code now in events/guildMemberAdd.js

lusty quest
#

where did you saved the schema then?

jolly wave
#

how should i define the bot i wanna send his avatar in an embed

lusty quest
#

its a bad idea to work on features that require a working Database before the database is even working

earnest phoenix
#

my schema is in mongoose.js

#

const mongoose = require('mongoose')

const schema = new mongoose.Schema({
gid: String,
gName: String,
prefix: String,
ownerID: String,
ownerTag: String,
memberCount: String,
mid: String,
warns: String
})

module.exports = mongoose.model('villain', schema)

lusty quest
#

this was supposed to land in the models folder inside a file

jolly wave
#

how should i define the bot in my embed i wanna send his avatar

pale vessel
#

please just store IDs, names and tags are changed frequently. resolve IDs to names using your bot

earnest phoenix
#

ok

#

so I will delete this file and paste this models folder?

lusty quest
#

where did you defined your mongoDB connection?

earnest phoenix
#

readys.js

#

in events file

lusty quest
#

will work

#

then you can do what you wanted to do

jolly wave
#

;-;

lusty quest
#

paste the model into your models folder and require this file than in your Events file

ionic dawn
#

@jolly wave client.user.displayAvatarURL

jolly wave
#

thx

earnest phoenix
#
const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    gid: String,
    gName: String,
    prefix: String,
    ownerID: String,
    ownerTag: String,
    memberCount: String,
    mid: String,
    warns: String
})

module.exports = mongoose.model('villain', schema)
#

this is models folder

#

but what should be name of file

lusty quest
#

this is a file inside the folder right?

jolly wave
#

idk anything on mongoose

#

wait

#

i'll ask later why my xp system don't work

lusty quest
#

depends on what you want. i usually name it the same way the Model is named

earnest phoenix
#

ok

#

model.js

#

k?

lusty quest
#

?

#

villian in your case

pale vessel
#

it might check for a collection named "villains"

#

you have to specify it explicitly as a third parameter

earnest phoenix
pale vessel
#

ah okay

#

you're gucci

earnest phoenix
#

listen

#

I have schema in file named mongoose.js

#

connection in events/ready.js

#

and a file named guildmember add which had my welcome code of quick db

lusty quest
#

you need to learn to walk before you can run

earnest phoenix
#

😅

solemn latch
#

I cant even run still KEKW

lusty quest
#

first get your Database working before you make some more stuff that requires the DB to work

earnest phoenix
#

isnt it working fine?

lusty quest
#

idk does your Bot creates a new Config if it gets into a new Guild?

#

(you dont need this if the bot will stay in one guild)

#

but its just to make sure the files you depend on in the future exist

earnest phoenix
#

I have a database

#

and 1 collection in it

lusty quest
#

you probably saved it manually right?

earnest phoenix
#

nah

#

whenver someone uses a command

#

it send everything

lusty quest
#

?

earnest phoenix
lusty quest
#

why did you make a new Document every time?

earnest phoenix
#

I dont make

lusty quest
#

so you check every time someone in a guild runs a command that the config exist if not create one?

earnest phoenix
#

I dont make in manually

lusty quest
#

i talk about your code

earnest phoenix
#

it is already set up

#

hm

lusty quest
#

i just want to make sure you wont do something stupid

solemn latch
#

You dont really need to make a config until a non default setting is set.

lusty quest
#

bcs this could break your neck if you have like 10k guilds and every second 6k users use a command

earnest phoenix
#

there is a big cofusion

#

my code for connecting to db

#

my mongoose.js

lusty quest
#

it just creates a Config every time your bot starts and a guild dont have a config works but can cause issues

modest maple
#

swapnilyt:swapnilyt@main.b8qz9.azure.mongodb.net

#

now

#

i havent looked at my mongo system for a while

#

but

#

Last time a checked

#

swapnilyt:swapnilyt is your user name and password no?

earnest phoenix
#

no

lusty quest
#

did you want to connect to local host?

earnest phoenix
#

I am dumb af

modest maple
#

so

lusty quest
#

ohh this guy

modest maple
#

you fucking moron

lusty quest
#

@earnest phoenix yes

modest maple
earnest phoenix
#

you fucking moron
@modest maple who?

modest maple
#

you

lusty quest
#

did you defined it?

earnest phoenix
#

why

#

wtf

lusty quest
#

@earnest phoenix regenerate your password and use a new user

modest maple
#

your fucking database is openly available to connect

solemn latch
#

lool

modest maple
#

I litterally just connected to your db

lusty quest
#

also only allow connections from your PC and your server

modest maple
#

🤦‍♂️

solemn latch
#

seen a guy get ransomwared for doing that

#

his database, with private user data had no password

earnest phoenix
#

how

#

dont plz

solemn latch
#

^ thousands of people visited his site daily

earnest phoenix
#

😭

solemn latch
#

had like 20k users in the db

modest maple
#

👏 change 👏 your 👏 fucking 👏 db 👏 creds 👏 now 👏

solemn latch
#

actually scary stuff

earnest phoenix
#

removed that ip

cinder patio
#

Wrong password or username Lo4rd

earnest phoenix
#
  • changed password
lusty quest
#

@earnest phoenix go to network Access and add the IP of your Server

stiff stream
#

i deleted my bot status thing. any one remember what is it?

solemn latch
#

how would we remember

faint prism
#
  • changed password
    @earnest phoenix Dude was your login creds in that connection string actually what it was...?
solemn latch
#

use git plox

modest maple
#

GJ try not to leak it next time

lusty quest
#

if you want to run the bot on your pc add the IP from your PC (make it temporary)

stiff stream
#

i deleted my bot status thing. any one remember what is it?

#

the code

cinder patio
#

What do you think "authentication failed" means?

solemn latch
#

ron, we wont remember your code

earnest phoenix
#

lol

solemn latch
#

use git if you want something to remember your code history

earnest phoenix
#

this channel makes me lose more faith in humanity with every day that passes

misty sigil
#

@earnest phoenix its not a localhost is it

#

its an atlas cluser

coral trellis
#

@earnest phoenix We're here to help people not shit on them because they are new, let's keep this channel more positive and keen on helping people understand rather than saying that you're losing brain cells

modest maple
#

😔 People need to learn to actually read about their db before jumping into it

solemn latch
#

^ if your new to databases, do a few hours of research

modest maple
#

Like actually taking precautions to not just leak your uncensored db url

slender thistle
#

What prevents you from actually helping them get used to databases

modest maple
#

we cant help them censored their passwords

earnest phoenix
#

@earnest phoenix We're here to help people not shit on them because they are new, let's keep this channel more positive and keen on helping people understand rather than saying that you're losing brain cells
@coral trellis
being new is not an excuse for not wanting to use your cognitive skills to resolve a logic problem, it's something you do on a daily basis but ok lol

faint prism
#

I liked the idea someone suggested for two development channels for beginner help and advanced help

modest maple
#

what would be the point

solemn latch
#

the problem is, a lot of new developers consider themselves experinced

faint prism
#

No way

modest maple
#

99% of this channel are people that have no decent programming experience

earnest phoenix
#

i doubt that the "lesser smart ones" would acknowledge the difference between the two channels

slender thistle
#

Unless there's an obvious definition of "advanced", people will come to the advanced help channel expecting help for basic stuff like invalid syntax.

earnest phoenix
#

^

solemn latch
#

^

faint prism
#

Hm

slender thistle
#

It's just a pointless separation.

coral trellis
#

This channel is too help people

fallow steppe
#

Question, how do I trigger the bot joining / leaving a guild?

coral trellis
#

If you can't be keen to help people and wanna shit on them

#

Don't talk

solemn latch
#

like the event @fallow steppe ?

pure lion
#

Where can I learn assembly?

misty sigil
#

guildCreate / guildRemove in d.js @fallow steppe

modest maple
#

@pure lion in hell

summer torrent
#

@fallow steppe which lang/lib

fallow steppe
#

d.js

modest maple
#

fr tho if you wanna learn it books

pure lion
#

@modest maple I want to learn it in this plane of reality

summer torrent
#

<Client>.emit("event name", parameters)

pure lion
#

Ok got it

faint prism
#

Where can I learn assembly?
@pure lion Syscalls, instruction pointers, stack push and pop

pure lion
#

@pure lion Syscalls, instruction pointers, stack push and pop
@faint prism tanQ