#development

1 messages · Page 1572 of 1

delicate zephyr
#

but yea

#

either or works

quartz kindle
#

dont you already have args in your index.js tho?

#

just pass the args to execute

quaint wasp
#

in there?

quartz kindle
#

if you have them in your index.js, yes

crimson vapor
#

make sure you do it client side or your dedi cpu will go brrrrr

quartz kindle
#

you showed this remeber?

crimson vapor
#

oh no

#

time to leave

quaint wasp
#

So do I just get rid of that?

mellow kelp
#

you already have a variable named "args"

quaint wasp
#

Yes. I know.

mellow kelp
#

yeah

#

that's the error

quaint wasp
#

When I dont I have onather error..

crimson vapor
#

@umbral zealot we are in need of the learnjs copy pasta please

quaint wasp
#

It cant define error.

#

and its not copy paste.

umbral zealot
#

Today's trick: use search and look for learnjs or jsfirst to find it 😉

umbral zealot
mellow kelp
#

learnjs™️

crimson vapor
#

fine

#

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we'd like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie's Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

quaint wasp
umbral zealot
#

your friend copy/pasted it

crimson vapor
#

im gonna be honest evie's js site is the best

quaint wasp
crimson vapor
#

you explain everything well

umbral zealot
#

From literally my guide Kek

quaint wasp
#

oh, nice. Alr.

#

so

#

Still, how do I deffine it?

#

The prefix?

#

I did..

umbral zealot
#

So anyways the point is : you need to learn javascript

quaint wasp
#

but then..

quartz kindle
mellow kelp
#

oh god

quartz kindle
#

means that you probably already had the line that defines args as well

#

meaning you dont need to create args again in the command file

umbral zealot
#

you're literally just shoveling code around, without knowing what it does, and without even the slightest of the basics. You need to take the time to learn javascript.

quaint wasp
#
const prefix = require('./config.json').prefix

module.exports = {
    name: 'kick',

    execute: async(client, message) => {

      const args = message.content.slice(prefix.length).trim().split(/ +/);
        if(!message.member.roles.cache.some(r=>["👻・Trail Moderator", "🧨・Moderator", "🛠️・Director Team", "👽・Director of Partners", "🛠️・Director of Staff", "🔰・Management Team", "🎓・Chief Operating Officer", "Administrator", "director", "👑・Chief Executive Officer", "🔰 Owner", "Moderator" || "founder" || "Founder" || "FOUNDER" || "owner" || "Owner" || "OWNER" || "M.S.T owner" || "-👑- Owner" || "ADMINISTRATORS" || "Administrators" || "administrators", "boss", "boss crew", "bosses", "bosss", "founders", "mod", "moderaters", "moderater", "Moderaters", "Moderater"].includes(r.name)))
          return message.reply("Sorry, you don't have permissions to use this! (is you do hava permissions, but this command still doesnt work, check if you have role named exacly **Administrator, or admin.**) If you have your own roles that you would like to add, so you didnt needed to have that role, or if you have your own role, just join our support server and message it in the help section.");
        let member = message.mentions.members.first() || message.guild.members.get(args[0]);
        if(!member)
          return message.reply("Please mention a valid member of this server");
        if(!member.kickable) 
          return message.reply("I cannot kick this user! Do they have a higher role? Do I have kick permissions?");
            let reason = args.slice(1).join(' ');
        if(!reason) reason = "No reason provided.";
            await member.kick(reason)
        return message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);
      
    }
}```
sudden geyser
#

oh god

quartz kindle
#

dont you have this const args = message.content.slice(prefix.length).trim().split(/ +/); in your index.js?

quaint wasp
quartz kindle
#

then use it

#

lol

#

put args in the function

#

and delete that line from kick.js

#

else you're doing the same work again

#

repeating something your code already did before

quaint wasp
#

Alright. It worked. 🙂

#

uhh

#

Can someone teach me how to make stuff like (prefix)prefix !

#

and then bots prefix would change..

#

the way person wants it to be.

misty sigil
#

use a database

#

but first

#

learn javascript

quaint wasp
#

I. Know. Basics.
stop thinking im a dum dum who just started coding please..

misty sigil
#

ok then, if you know the basics, how do i get 5 from [1, 2, 3, 4, 5]

quaint wasp
#

you delete everything else and just put 5.

#

or do 1+4

#

or 3+2

#

or 1+1+1+1+1

misty sigil
#

smartass

#

anyway

quaint wasp
misty sigil
#

thats a db

#

persistent storage

quaint wasp
#

I need to npm that?

misty sigil
crimson vapor
#

mongoose is poggers

mellow kelp
#

yes

quaint wasp
#

Ill use.... Which one is better?

misty sigil
#

quick.db is easier

mellow kelp
#

i guess you can use quick.db to start with?

#

yeah

misty sigil
#

mongoose is generally the best

mellow kelp
#

um

#

sad sql noises

quaint wasp
#

Alright ill use that quick.db

misty sigil
#

sql's good too

mellow kelp
#

yeah, but you gotta learn another language tho

misty sigil
#

but mongo is one of the better options for discord bots imo

mellow kelp
#

o

#

pog

misty sigil
#

i also like not having to faff about with tables

#

n shit

quaint wasp
#

alr. Me done.

misty sigil
#

npm i

quaint wasp
#

. . . .

#

alr ill use that.

#

wow lots of stuff happening..

misty sigil
#

yea

#

it needs to compile

hidden lynx
#

I hate onedrive

mellow kelp
#

mood

quaint wasp
#

My storage of 13,200 G is almost out... 😦

#

done.

#

Now I create something like quick.db file?

mellow kelp
#

i think quick.db makes it four you

hidden lynx
#

I once accidentally deleted my desktop on onedrive. had to reinstall windows after it remotely deleted my actual desktop folder

quaint wasp
#

OOF.

#

there is no new file..

opal plank
#

we talking 13GB 200MB or 13TB of space?

quaint wasp
opal plank
hidden lynx
#

probably 13 mb

quaint wasp
#

. . .

mellow kelp
#

dot dot dot™️

opal plank
#

triple dot post? bean

#

straight to jail

zenith terrace
#

ban

#

atMods pls ban

quaint wasp
#

bro

#

Is that like iligal?

hidden lynx
#

very much

quaint wasp
#

why?

amber thistle
#

( ͡° ͜ʖ ͡°)

quaint wasp
#

Is this a joke?

#

I was already banned i dont feel like getting banned again FOR EVER.

#

😐

#

😦

#

||(Banned for a year now comeing back and getting banned on the first day for sending 3 dots ...)||

summer torrent
#

banned from this server?

quaint wasp
#

no.

summer torrent
#

user id?

quaint wasp
#

Is it really iligal to send 3 dots?

quaint wasp
#

I was banned now unbanned.

summer torrent
#

oh ok

quaint wasp
#

But just if u need it for some reason and cant get it your self here: 717526789882380338

scenic kelp
#

hm

quaint wasp
#

Yep..

#

Got tricked into that by some dumbass on other servers.

scenic kelp
zenith terrace
#

wait why did you ban him?

summer torrent
#

parm

#

he was unbanned

zenith terrace
#

parm you twat

#

he appealed before

summer torrent
zenith terrace
#

if you read mod logs

scenic kelp
#

hecking

#

-ub 717526789882380338

gilded plankBOT
#

🔓 Unbanned SmugTheKiler#6034 (@quaint wasp)

ember atlas
zenith terrace
#

maybe actually read chat before moderating someone zoomeyes

summer torrent
#

lol

ember atlas
#

check modlogs next time kid

zenith terrace
#

smh parm

#

u know better

scenic kelp
#

i smell cowboypensive

quick ginkgo
#

wait why did you ban him again KEKW

quartz kindle
#

now someone dm him and tell him to come back

#

lmao

summer torrent
#

he did

zenith terrace
#

Cause parm didnt read chat correctly

summer torrent
#

@quaint wasp welcome KEKW

quaint wasp
quartz kindle
#

lmao jeez

quick ginkgo
#

welcome back!

#

how was your ban

quaint wasp
#

Uhh

zenith terrace
quaint wasp
#

pretty bad.

oak cliff
#

Lmao

quaint wasp
#

I was banned for almost a year

zenith terrace
#

hi Xiuh

quaint wasp
#

and told if I get banned again its forever

oak cliff
#

This sure looks like development lol

mellow kelp
#

yes

zenith terrace
#

ofc

quick ginkgo
#

like anyone ever codes their own stuff now days

zenith terrace
#

the development of parms brain xD

mellow kelp
#

pffft imagine actually coding

quartz kindle
#

hes trolling

mellow kelp
#

it was a joke

quaint wasp
#

Knew it.

misty sigil
#

PARM YOU TWAT

zenith terrace
#

nah we all use botghost

mellow kelp
#

ofc

quaint wasp
#

ofc like who doesnt?

zenith terrace
#

UnbelievaBoat, Dyno and MEE6 are all BotGhost as well

quaint wasp
#

yes. Really true.

misty sigil
#

some say... i am a botghost bot

quaint wasp
#

Will be*

quartz kindle
#

no mee6 uses bdfd

mellow kelp
#

whoa

quartz kindle
#

and rhythm uses dbm

quaint wasp
#

oh right..

misty sigil
#

i think groovy uses bot ghost though

quaint wasp
#

Samee

#

They just pay like $60 and then get milions from it. What a deal. I really now wish I thught of it first.

proper granite
quaint wasp
#

uhh

#

too much sapces?

quick ginkgo
proper granite
#

ammm

quick ginkgo
#

or define the function correctly

proper granite
#

stop traslate your message

#

ok?

quaint wasp
#

oh yeah.. did u do npm?

#

did you do npm i node

#

?

proper granite
#

whats message traslate?

zenith terrace
#

pretty sure readdirSync is meant to be used as whatever.readdirSync()

proper granite
pale vessel
proper granite
quaint wasp
#

WOW... servers on top? mine are on the side...

quick ginkgo
# proper granite is my library

your commands folder is not a library, you must either import the library that the function is defined in, or define the function yourself

pale vessel
#

const { readdirSync } = require("fs");

proper granite
quick ginkgo
misty sigil
#

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we'd like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie's Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

#

FUCK

#

ok

proper granite
#

:c

proper granite
quick ginkgo
# proper granite I modified it but it comes out the same in cmd
quaint wasp
misty sigil
#

its dirname not diraname

proper granite
#

I am stupid that nothing comes out :c

quaint wasp
#

to instal node.js

#

bro

proper granite
#

ahhhhh

quaint wasp
#

learn.

proper granite
#

oki

pale vessel
#

LMAO that //PUTA

proper granite
quaint wasp
#

lol

quaint wasp
#

lmao

proper granite
#

sorry, nothing else occurred to me in mind

quaint wasp
#

so did u type npm i node?

#

Did anything started downloading?

proper granite
#

que se PFP?

misty sigil
#

bruh

#

install nodejs

quaint wasp
#

oh

#

right

misty sigil
#

how are they getting the errors

#

they cant run the code without node

proper granite
quartz kindle
#

wtf

proper granite
#

It is the first time that I make a bot on pc, sorry if I take your time: c

quartz kindle
#

no

proper granite
#

¿?

quartz kindle
#

dont do npm i node lmao

quaint wasp
#

😐

#

I do that...

quartz kindle
#

that doesnt do anything, and its stupid to do

quaint wasp
#

oh

#

d.js?

quartz kindle
proper granite
#

They told me to do it ._.

quartz kindle
#

not __diraname

proper granite
#

ahhhhhh

quartz kindle
#

they dont know what they're talking about

proper granite
#

How stupid am I for God's sake

#

sorry if i take your time thanks i appreciate your help

#

UwU

zenith terrace
#

ur gonna need to change ur pfp as it is basically NSFW <_<

quaint wasp
#

lmao I guess shes right..

proper granite
#

ah sorry I am basically a fool

#

//PUTA```
#

¿?

thorny flume
zenith terrace
#

what..

proper granite
#

@quaint wasp

thorny flume
proper granite
#

sorry for mention

#

spanish

thorny flume
#

Kkkkk

quaint wasp
#

oh

#

I kinda dont know spanish

#

I know Russian tho.

#

but we cant speak it here so... its useless.

proper granite
#

pfp is this?

// PUTA

pale vessel
#

pfp is profile picture

proper granite
#

ah but I like it>: C

zenith terrace
#

its NSFW

quaint wasp
#

yes..

#

And thats against the rules.

earnest phoenix
#

yes change it

quaint wasp
#

oh, thats better.

pale vessel
#

I mean there's no nudity

quaint wasp
#

nvm

proper granite
#

but I don't like anime I don't like anything else I liked that photo and well

scenic kelp
#

it's definitely on the line

quaint wasp
#

Hey here!

pale vessel
#

Would you agree that it's hot though

proper granite
zenith terrace
fervent hornet
#

The NSFW line

earnest phoenix
proper granite
quaint wasp
earnest phoenix
earnest phoenix
proper granite
#

but I don't like water, I put it on because I liked the girl>: u

quaint wasp
#

...

#

U were in water

#

you drink water

#

you produce water..

fervent hornet
#

You produce water?

quaint wasp
#

you are made out of water..

earnest phoenix
#

bro i like my gf but i dont put her as my pfp because 1 its privcy invasion 2 its againt rules in every server.... well most of them

pale vessel
quaint wasp
stark abyss
#

does anyone know if videos can be embeded

mellow kelp
#

not sure

lyric mountain
stark abyss
#

what does that mean

mellow kelp
#

only in a website embed

#

with the meta tags

stark abyss
#

I meant discord embeds lol

lyric mountain
#

Og tags are well, og tags

lyric mountain
#

But possible with og embeds

#

Like YouTube

#

If you post a link it'll appear the video, right?

stark abyss
#

Yeah

lyric mountain
#

That's og tags

mellow kelp
#

i just remembered why i hated so much runtime errors while testing a minecraft plugin

#

oh god

lyric mountain
#

Basically data sent from an external site

stark abyss
#

i do remember having a embed link

#

i am gonna post it here

#

oh lol

lyric mountain
#

That's a gif

stark abyss
#

right

mellow kelp
#

wonderful choice of gif

lyric mountain
#

Here, og tag case

stark abyss
#

oh

#

okay well I get it now but how do I make og tag then

mellow kelp
#

<meta property="og:video" content="https://tryitands.ee/tias.mp4" />
<meta property="og:video:secure_url" content="https://tryitands.ee/tias.mp4">
<meta property="og:video:width" content="896" />
<meta property="og:video:height" content="504" />
<meta property="og:video:type" content="video/mp4" />

#

these are it

stark abyss
#

hm

lyric mountain
#

Those metadatas will be in the page's head

stark abyss
#

I appreciate you guys helping but I am not going to be able to follow along thx though

#

ill just have it post link

lyric mountain
#

Basically you need a website

#

Then put og tags in the website's head section

#

Then whenever someone post its link discord will catch the tags and build the embed

stark abyss
#

okay

lyric mountain
#

There's an issue tho, which is caching

#

They're normally cached by discord

mellow kelp
#

oh yeah, discord caching

#

big problem

stark abyss
thin turret
#

What would be the best way to handle a large X amount of server raiders using a discord bot

lyric mountain
#

Kick 'em

dusky sundial
#

Make an AI that detects when someone is raiding and kick them mmLol easy

hallow shell
#

so

#

which do you guys prefer: .env or config.json

mellow kelp
#

depends on what you're storing

#

for tokens and private stuff use .env

#

OR you can use config.json and .gitignore it

#

i use both KEKW

hallow shell
#

ah yes i see

earnest phoenix
#

Hey i need a help with a code.
I gave code like this

message.react(":thumbsup:")```

It is reacting to user commands.But its not reacting to itself
vocal sluice
#

i think you would have to do embed.react(":thumbsup:")

earnest phoenix
#

Oh

vocal sluice
#

because you have the message it sends as embed

earnest phoenix
#

Let me try

vocal sluice
#

and message is when someone does the command

earnest phoenix
#

If any user uses any command.The bot is reacting to user messages

earnest phoenix
vocal sluice
#

because when you do message.channel.send(embed) you have the message the bot sends defined as embed so to have it react you would use that instead

mellow kelp
#

embed doesn't have a react method

earnest phoenix
#

wdym

mellow kelp
#

you can't do embed.react

earnest phoenix
vocal sluice
#

im smart lol

mellow kelp
#

message.channel.send returns a message Promise

vocal sluice
#

use a .then i guess then?

hallow shell
#

message.channel.send(embed).then((message) => message.react("\👍"))

mellow kelp
#

yeah

#

either use .then or await it

earnest phoenix
#

Ok

mellow kelp
#

you'll have the message then

mellow kelp
#

yeah that works

earnest phoenix
#

Ok

earnest phoenix
#
message.guild.channel.create

undefined Why?

hallow shell
#

you can also
message.channel.send(embed).then((message) => {
message.react("👍");
message.react("👎");
});

earnest phoenix
#

.then should be in another line know

hallow shell
#

that's just personal preference

#

but yeah i guess

hallow shell
#

create should be a function

#

create(args go here)

#

also

#

it could be .channels

earnest phoenix
#

wait i will give you src

#
client.on('message', message => {
        if(message.content === prefix + 'vr') {
                 message.guild.channel.create (`Role Count: ${message.guild.roles.cache.size}`, {
                        type: 'voice'
                });
                const embed = new Discord.MessageEmbed()
                .setColor('BLUE')
                .setTitle('**Done create Voice Room With Server Roles Number **');
                message.channel.send(embed)
        }
});
hallow shell
#

message.guild.channels.create(name);

earnest phoenix
#

uhhh

vocal sluice
#

is it cuz u have a space?

hallow shell
#

well also channel isn't a property of guild

earnest phoenix
hallow shell
#

so channel should be channels

#

so therefore

                 message.guild.channels.create (`Role Count: ${message.guild.roles.cache.size}`, {
                        type: 'voice'
                });```
umbral skiff
#

Can help someone how to put random color in python?

earnest phoenix
umbral skiff
#

Yes

#

For bot

#

In embed

earnest phoenix
#

can i see src

umbral skiff
#

I didn't did

#

I making now all things

earnest phoenix
#

im not to good on py

#

but i think

#
  • rant = random.randint(1, 255)

  • color=rant

hallow shell
#

don't colors need 3 values tho

#

like white is 255,255,255

earnest phoenix
#

idk

#

what output you expect?

#

random.randint(0, 0xffffff) if you need it in int
[random.randint(0, 255) for _ in range(3)] for rgb ig

rose warren
#

Any ideas why a message collector could just stop working? A restart of my bot fixes it. The collector detects channel mentions after the command is run, but sometimes users run the command, mention their channel and there's no response from the bot and nothing in my error logs. I have all the catch handlers set up properly and I've tested this command to oblivion. The proof it works is when I restart the bot it works perfectly, just sometimes the message handler doesn't seem to work and without errors in the logs I don't know what the problem is.

#

It's not a channel perms problem

hallow shell
#

there's a limit on how many you can have at once

#

that could be it

rose warren
#

How many you can have in one channel? Or on a shard ?

hallow shell
#

hmm

#

idk

#

personally i just try and keep it under 2 but the limits prob like 30

earnest phoenix
rose warren
#

Well I'm not sure that's the issue because it doesn't get used really often. Also, the collector times out after 15s of inactivity in the channel if there's no channel mentioned.

earnest phoenix
#

idk why cpu so high

rose warren
hallow shell
#

so if i have a module that returns a function and dont want to set a variable for it, how would i do that?javascript const moduleExample = require("./module.js"); console.log( moduleExample() ); // so could i just turn that into this or something? console.log( require("./module.js")() );

#

or maybejavascript eval( require('./module.js') + '();');

pale vessel
#

moduleExample()

delicate zephyr
earnest phoenix
#

Anyone who knows anything about discord bots sharding/shards dm me please

solemn latch
#

just a heads up, most of the more experienced dev's here don't provide support in DM's. by asking for DM's you shut off your chance of response by a lot.

earnest phoenix
#

So what do you recommend

solemn latch
#

asking in here 👀

earnest phoenix
#

        if(message.content === prefix + 'vc') {
                message.guild.channels.create(`Channels Count: ${message.guild.channel.cache.size}`, {
                        type: 'voice'
                        channel.overwritePermissions([
        {
            id: message.guild.id,
            deny: ['CONNECT'],
        },
    ],
                });
                const embed = new Discord.MessageEmbed()
                .setColor('BLUE')
               .setTitle('**Done create Voice Room With Server Channels Number **');
                message.channel.send(embed)
        }
})
#

where is problem?

solemn latch
#

whats the error/issue?

glossy spoke
#

Really? He show us the code, ask what's wrong and then just leave ?

solemn latch
#

its a common thing 🤷‍♂️

glossy spoke
#

ya ikr

delicate zephyr
#

his code isn't exactly the easiest to read either

#

where is channel defined

#

like

solemn latch
#

thats what i was going to say the problem was lmao

delicate zephyr
#

im 99% sure his issue here is the way he's using the create function

earnest phoenix
#

.-.

glossy spoke
#

channel.overwritePermissions

#

Did you define channel??

delicate zephyr
#

thats not his issue

#

I mean it is

#

but its not the root problem

glossy spoke
#

At the bottom he's closing something that seems it's never opened

earnest phoenix
delicate zephyr
#

its not the full snippet

delicate zephyr
#

dude

glossy spoke
#

I wanna use an Sql db

delicate zephyr
#

@earnest phoenix ^^

glossy spoke
#

How can i navigate inside an sql db if it's file is in Repl.it?

delicate zephyr
#

@earnest phoenix like I showed in the screenshot of the example, you need to use the given example from the official documentation and it should work

glossy spoke
#

It's the unique hosting service that i have to keep my bot online 24/7

delicate zephyr
#

Like if you ever plan on getting big

#

you cant rely on free hosting

glossy spoke
#

I don't have money

delicate zephyr
#

no, free host isn't technically bad

earnest phoenix
glossy spoke
delicate zephyr
#

doesn't matter. Calling it instantly bad is wrong

#

its just not sustainable

#

its ok for small applications

earnest phoenix
glossy spoke
#

My PayPal isn't verified

#

Then they always refuse?

delicate zephyr
#

Nepp, it isn't that easy

glossy spoke
#

I'm minor

#

u

delicate zephyr
tepid leaf
#

thats not helping :/

glossy spoke
tepid leaf
#

10yrs a card??? O.o

delicate zephyr
glossy spoke
tepid leaf
#

welp

delicate zephyr
#

ah yea, it's fairly understandable why you rely on free hosting then

tepid leaf
#

im in France

delicate zephyr
#

yea, its not that easy for others

tepid leaf
#

it doesnt work ehere lmao

delicate zephyr
#

you're repeating already mentioned issues nepp

earnest phoenix
#

you can make ur project 24/7 with only one button

glossy spoke
#

My friend just gave me acces to a VPS that had 31gb of ram, 3 days later the vps host got discontinued

tepid leaf
#

31gb ram?

delicate zephyr
#

because it's a support channel. You should be professional. It's what support is supposed to be

glossy spoke
#

Ya

tepid leaf
#

are u sure 31gb ram?

#

thats hudge

earnest phoenix
#

31g bram

glossy spoke
#

i saw the settings of the vps and used a command of my bot to analyze the ram

delicate zephyr
#

30GB of ram is a lot for a VPS

tepid leaf
#

ye

#

i think so too

#

mine ad 9gb

delicate zephyr
#

I have 3 dedicated servers

#

lol

tepid leaf
#

and its kinda big

#

after depends

#

if you have music commands

#

you will need a lot of ram

glossy spoke
#

?

earnest phoenix
#

Go To : https://repl.it/claim

Type : techwithtim

Click Claim

glossy spoke
#

Omg

#

Thx!

earnest phoenix
glossy spoke
#

Also, it's already 24/7 online

#

UptimeRobot

compact scaffold
#

A fivem server dosent need that much

earnest phoenix
glossy spoke
#

Ok, now it's not necesary

tribal siren
#

yes

glossy spoke
#

Thx!

earnest phoenix
tribal siren
#

what does offline repls do?

solemn latch
#

they are offline 👀

tribal siren
#

makes sense

#

and i mean it doesn't

#

oh wait

#

ooooooh

#

now i understand

compact scaffold
#

Oh i don’t know about minecraft but fivem is not really that heavy loaded if you don’t have soo many scripts

slender thistle
#

Ideally, we want to be helpful and point issues out instead of outright telling them to do X

(Personal advice: if you want to be a BR, you'll have higher chance if you actually focus on the issue and don't condescend to people)

lament ruin
#

what people mean to say is that repl.it is not ideal, however if it's your only option, use it.

marble juniper
#

You should never use repl.it to host your bot
its not really ideal for that and also all repls are public by default and you can't make them private if you don't have the hacker plan

#

and if you use a config.json that will be shown then

#

unless you use a .env file

tribal siren
marble juniper
#

its still better to get a vps

tribal siren
#

but it's better that you can actually code and host your bot for free even though it won't be public

tribal siren
delicate zephyr
#

@marble juniper I did mention that its ok for small applications / private bots

tribal siren
#

than idk something else

marble juniper
delicate zephyr
#

but if you plan on going medium / large then generally you shouldnt rely on free hosting

marble juniper
#

yes

delicate zephyr
#

Its not a "You should never"

#

it's more a "Don't rely on"

marble juniper
#

its more of a "not recommended"

delicate zephyr
#

Ding ding ding

#

xD

marble juniper
#

kek

tired panther
#

lol

mild flower
#

hey i was wondering how to add defined permissions to roles that are created?
I tried this but it doesn't seem to work :

message.guild.roles.create({
            data: {
            name: 'Muted',
            color: 'BLACK',
            SEND_MESSAGES: false
          }
        })```
crystal wigeon
#

hey

#

so

#

i think the djs causes event block while sending an embed

#

i put some timers

#

the embed was created in 4ms

#

but it took 3 secs to send the embed

#

during this 3 saecs

#

i wasn't able to execute any other commands

mild flower
crystal wigeon
#

really weird

lost heath
mild flower
#

wait

#

how do i turn a perm false?

#

for example disabling writing perms?

lost heath
#

SEND_MESSAGES: false

mild flower
#

ah

#

thanks

lost heath
#

inside the []

#

yw

#

if im not mistaken that should work

mild flower
#

doesnt seem to work

lost heath
#

odd

#

go to the docs and see

mild flower
#

Unexpected token ':'

lost heath
#

uh

#

oh

mild flower
#

yeah but the false thins is not there in the docs

crystal wigeon
#

any idea?

lost heath
#

oh shoot. you cant set the permission to false for the role

#

that is done in the channels

mild flower
#

yeah

crystal wigeon
#

@umbral zealot

mild flower
#

ive seen mee6 do it for all channels

crystal wigeon
#

sorry for the pings

mild flower
#

how would i do that?

lost heath
#

so you oughta edit every channel every time it created the role

mild flower
#

hmmm

lost heath
mild flower
#

i found how to edit the channel perms

#

is there any way to select all channels when specifying the perms

lost heath
#

uh. im not entirely sure.

#

try checking the docs

mild flower
#

thanks for the help anyways

lost heath
#

yw

crystal wigeon
#

nobody knows?

pale vessel
#

check your code

earnest phoenix
#

you keep referring to event blocks but no such thing exists

#

you can block the event loop

gaunt ibex
#

hey can someone help me with the slash commands?

crystal wigeon
#

also yeah i put timers

#

when that embed is being sent

#

and i type ping

#

it doesnt work

#

until the embed is sent

#

other commands dont work

#

see waht im talking about?

#

you acn ignore the ping

#

but waht im tryna say is, until that embed was sent those pings didnt show up

#

by sent i mean literally

#

i put timers in my code

#

up until that embed gets created

drowsy epoch
#

ooof

crystal wigeon
#

Yeah it's kinda weird. Tested it 8-10 times to make sure

#

When the embed is about to be sent or edited it doesn't allow other commands to run

fierce ether
#

is there a way of fetching every role in array all at once?

pale vessel
#

Fetch a role? From?

fierce ether
#

arrray

#
  for(const role of roles)
           const fetchRole = await message.guild.roles.fetch(role)``` tried this but nothing
#
const roles = ['797070395777220620', '796881888836845589']```
quartz kindle
#

just fetch then filter

#
let roles = await guild.roles.fetch();
let filtered = roles.filter(role => array.includes(role.id))
slender wagon
#
 const lb = leaderboard.map(
      (e) =>
        `${e.position}. ${e.username}#${e.discriminator}\nLevel: ${e.level}\nXP: ${e.xp.toLocaleString()}`
    ); 
    const embed = new MessageEmbed()
    .setAuthor(`Leaderboard for ${message.guild.name}`)
    .setThumbnail(message.guild.iconURL())
    .setTitle(`Top 5`)
    .setColor(`BLUE`)
    .addField(`${lb.join("\n\n")}`)
    .setFooter(`Want to get here? Keep on chating!`)

here is the code

sand walrus
#

if i want claim auto role, what is the code for this

lusty quest
slender wagon
#

Oh right

#

Ty!

lusty quest
crystal wigeon
#

Lmao

sick sluice
#

hi, is it possible to host discord bot in more than 1 server? (discord.py)

earnest phoenix
#

uh well

#

what's the use case here

#

i mean it is

#

but if you handle commands on both servers on the same shard, you're going to have duplicated responses

crimson vapor
#

technically couldn't you start shard 0 somewhere and shard 1 somewhere else without any issues?

#

until commands

#

well no since different shards

crystal wigeon
#

quick question

#

when an embed is being sent, the other messages wont be sent in the message.channel.send?

#

because thats what im observing rn

#

i can see the command being registered, but when the embed is being sent the other messages dont get sent

#

also just wondering if i should be doing await message.channel.send() instead of message.channel.send()

crimson vapor
#

on the await part, it really only matters if you want code to run after the message is recieved

#

it is the same thing as doing .then(msg => { codeHere() })

crystal wigeon
#

gotcha

#

but why is it not letting other messages to be sent

fluid basin
#

wdym other messages?

#

do you have an example?

crystal wigeon
#

here's a sample screen shot, after the embed is ready its being sent in the message.channel.send() so when the ping is being called the command is actually executing but not being sent in the message.send() its seen after the embed shows up

#

yeah hango n

#

so the ping command will just return that message

#

you see the 2 pings that didnt get a respnse?

#

that response came after the embed showed up

#

but the commands were called before the embed

crystal wigeon
#

ping: ({ message, client }) => {
console.log("pinging-------")
message.channel.send(
:ping_pong: Ping: **\`${Date.now() - message.createdTimestamp}ms``** WS: ``${Math.round(client.ws.ping)}ms```
);
return;
},

The ping command

#

you get the point

analog imp
crystal wigeon
#

well i can see the logs being generated where that command exists

#

but message.send() isnt sending it

analog imp
#

is it throwing an error at all Think

crystal wigeon
#

in short words the message send are synchronous

#

no errors

#

its jsut that there's a huge delay

#

when 2 commands are invoked

#

especially embeds

#

the embed is taking a lot of time to get sent is what im saying

#

maybe the data is too large?

#

there are like 2 attachments

earnest phoenix
#

What do the missing access and missing permissions errors in the log mean? and how can I prevent them

crimson vapor
#

they mean you don't have access or permissions

#

you should always do permissions checks before attempting to create/delete/edit things

earnest phoenix
#

but my bot 3.600 server how can I understand this

crimson vapor
#

unless its just a message

#

bro wtf

analog imp
crimson vapor
#

3,600 servers and you don't know permissions

#

ah its turkish

vocal sluice
zenith terrace
earnest phoenix
#

I'm talking about permissions on servers

#

oh my god

#

tUrkİsH

vocal sluice
crimson vapor
#

yeah

#

do permissions checks

crystal wigeon
#

the message gets sent trust me but there's a delay

earnest phoenix
#

noob

crimson vapor
#

otherwise you will just get errors

#

and errors are no good

earnest phoenix
#

okay guys thanks let's not continue

fluid basin
crystal wigeon
#

dm

#

i'll send the file

analog imp
crystal wigeon
fluid basin
#

ok

crystal wigeon
analog imp
crystal wigeon
#

i dont get the timeout errors tho

#

both messages do get sent

analog imp
#

it won't error if it's guild/channel basis, instead it delays those messages

crystal wigeon
#

but im saying is, if message 1 is being sent (embed) and it takes 5secs, and message 2 is invoked which takes 1sec, message 2 shows up after message 1

#

well in that case

#

there's a 3 sec gap

#

when the commands are called

crimson vapor
#

there is a global cf cap

#

but its like 50/s

earnest phoenix
#

Push rejected, failed to compile Node.js app. ! Push failed
heroku error pls helppp

earnest phoenix
#

we can't help without any logs

pale vessel
earnest phoenix
crystal wigeon
#

lmao

earnest phoenix
#

lmao

#

I am from Turkey. I just started coding. and I want help. Your reaction made me sad. I hope we will not meet again. wtf

#

imagine going to a pharmacist and saying "Need medication."

#

the pharmacist doesn't know what medication, what quantity or anything

#

the same is applicable here

#

you need to provide context when asking your question

#

otherwise don't get mad when people don't understand you

#

nobody can read your mind

crimson vapor
#

also, don't try to guilt trick people into spoon-feeding

#

its bad practice and will only hurt you

tribal siren
#

ok what happened here

umbral skiff
#

hi guys wanted to inquire about vps specifications as follows:

tribal siren
#

what's that for

umbral skiff
#

my friend Try it but the Discord API latency about 100ms and reaches 130ms

umbral skiff
modest maple
#

thats about what you'd expect for a EU location

quartz kindle
#

contabo is european

modest maple
#

they do US now

tribal siren
#

oh i forgot to say for

quartz kindle
#

if you want low ping, you need the US location

modest maple
#

I pay $3 extra for US location so i get about 30ms

quartz kindle
#

you have to pay extra for US?

umbral skiff
modest maple
#

well tbh they're still cheaper than pretty much every other US location but yes

#

imagine because costs are higher than their normal system

umbral skiff
modest maple
#

but i dont really mind cuz still dirt cheap for a US location

modest maple
umbral skiff
#

oh nice

#

i was use rdp in frankfurt

#

give me 16ms

modest maple
#

pithink I dont think thats possible to get 16ms being in frankfut to the discord gateway

umbral skiff
#

Yes, I was amazed at it, but the person from who I bought it said it was in Frankfurt

modest maple
#

No i mean

#

its litterally impossible

#

you would have to be breaking the speed of light to achieve that even going as the crow flys

umbral skiff
#

I understand from you that to get low ping with Discord I have to buy one in America

modest maple
#

the ABSOLUTE MINIMUM you could possibly get assuming you ran a cable straight from NY to frankfut in a single straight line would be 20.6ms

umbral skiff
modest maple
#

again thats not possible without breaking the speed of light lol

earnest phoenix
#

maybe REST ping

#

but definitely not gateway

#

actually now that i think about it

modest maple
#

bruh

earnest phoenix
#

REST ping definitely can't be it

modest maple
#

cry ngl thats one of the dumbest things you've said here lmao

earnest phoenix
#

incorrect measurement maybe

#

yes

#

i'm sleep deprived

umbral skiff
#

xD

earnest phoenix
#
headers = {'Authorization': "Bot " + token}
idd = "123"
messagesend = requests.post(f"https://discord.com/api/v8/channels/{idd}/messages",json={'content': "Notification test"}, headers=headers)
print(messagesend.text)

{"message": "Unauthorized", "code": 40001}```

I normally have the token and id there, does anyone know why this won't work?

It's working for other actions, but messaging just won't work
#

who ghost pinged sad

livid sentinel
#

@earnest phoenix my bad, you need to connect to gateway

#

before that endpoint works

earnest phoenix
zenith terrace
#

cache.get

earnest phoenix
zenith terrace
#

@earnest phoenix

livid sentinel
#

@earnest phoenix yup

earnest phoenix
#

Yes, which line will I write when I do it?

cinder patio
livid sentinel
earnest phoenix
#

I have not, I'll look into it now. thanks for the help

livid sentinel
#

just read through this and make sure you have all steps done

earnest phoenix
cinder patio
#

You need to connect only once in order to use it

earnest phoenix
#

egemen

cinder patio
#

in total

zenith terrace
#

whereever you have the channels.get, put cache between

earnest phoenix
#

yeah i used that but just didnt read the docs

#

reis türksün sanırım

livid sentinel
#

@earnest phoenix just try opening the gateway with like discord.js, then you can use your own module

earnest phoenix
#

@earnest phoenix yav yardım et allahını sevim

#

Please speak english this channel

livid sentinel
zenith terrace
#

you dont need to speak english in here

umbral zealot
#

Actually yes, there is no exclusion for #development in the rules for english only

earnest phoenix
#

yes which command and which line should I write it on

zenith terrace
#

there have been many times people have spoken non english in this channel

earnest phoenix
umbral zealot
#

no

umbral zealot
earnest phoenix
#

I said that too

umbral zealot
#

If you've been following a tutorial or guide that showed you member.guild.channels.get() then that tutorial or guide is out of date and should no longer be followed.

ornate otter
#

@quartz kindle i was asked to ask you about this here

#
    at ReactionCollector.handleCollect (C:\Users\Outdated Cosplay\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
    at Client.emit (events.js:315:20)
    at MessageReactionAdd.handle (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\actions\MessageReactionAdd.js:49:17)
    at Object.module.exports [as MESSAGE_REACTION_ADD] (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_REACTION_ADD.js:4:37)
    at WebSocketManager.handlePacket (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22) 
    at WebSocketShard.onMessage (C:\Users\Outdated Cosplay\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)    at WebSocket.onMessage (C:\Users\Outdated Cosplay\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (C:\Users\Outdated Cosplay\node_modules\ws\lib\websocket.js:797:20)
(node:17804) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17804) [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.``` this is something to do about discord reaction collectors and stuff
#

im too tired for this

cinder patio
#

I think this is self explanatory...

ornate otter
#

then self explain it

umbral zealot
#

You're trying to use apply() on the Client which is an object and not a function

cinder patio
#

Show your collector

#

what you're passing as a filter is not a function

quartz kindle
#

^

mild flower
#

is there any way to fetch all channels in a server and store them as a variable?

umbral zealot
#

you mean like a cache of some sort? Kek

umbral zealot
#

ok well as Feud says, your filter is probably not a function. show us your collector code

mild flower
#

im trying to create a mute role and i want to change all the channel permissions of the muted role to send messages : false

ornate otter
#
       
          const collector = reqEmb.createReactionCollector(bot, reqEmb, filter, { time: 60000, max: 1 });
    ``` this isnt my code its my friends code they asked me to fix
mild flower
#

.js

ornate otter
#

so just appreciate the fact im too tired for this

umbral zealot
# mild flower .js

that's a language, not a library. what specific library are you using?

mild flower
#

oops

#

discord.js

umbral zealot
#

ok then you already have guild.channels.cache as a collection of all the channels in that guild

#

no need to fetch them, they're always cached

mild flower
#

should i use each() to apply the permissions overwrite?

umbral zealot
#

you can use .forEach , yes

umbral zealot
ornate otter
#

now im trying to convert it into discord.js

#

so itll take me a while

umbral zealot
#

Hopefully you pay more attention to the docs in the future then? 😛

#

It'll save you a lot of time

cinder patio
umbral zealot
#

yep, that's what the docs say

#

Discord.js is OOP, not Functional.

mild flower
#

@umbral zealot it doesnt seem to be updating the perms for any channels

#
message.guild.channels.cache.forEach(
          updateOverwrite(channel.guild.roles(mutedrole), { SEND_MESSAGES:false })
        )```
umbral zealot
#

forEach needs a function, that's not what you're providing

mild flower
#

ah

modest maple
quartz kindle
#

reject humanity, return to monke (djs)

warm marsh
#

ease

tired panther
#

Does anyone know a good ai service, without dialog flow?

ornate otter
#

I dont think so

#

in my opinion

#

hell no

#

but thats just opinion

lament rock
#

Eris, in some configurations, can have less of a memory footprint. However, discord.js can get very close in terms of memory usage if you modify it to cache only what you need. Such is the case with any lib, though. I'd say the best approach would be modular interfaces which don't provide too many abstraction layers. Working with raw Discord data is actually pretty easy and helps you understand what exactly you need.

#

Discord.js' biggest downfall is its abstraction layers.

quartz kindle
#

and then they do shit like channel.startTyping()

#

which goes completely against the what the discord api's version actually does

golden condor
#

no there isn't

#

they use the discord api server as their support

earnest phoenix
#

.addField(`Çekilişi Kazanan`, `<@${message.guild.members.cache.random().id}>`, true)
How can I block the bots of this code

opaque seal
#
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzNyIgdmlld0JveD0iMCAwIDMwIDM3Ij4KICAgIDxnIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTTIyLjAxIDcuODg2VjUuNDUyYy45Ny0uNTExIDEuNDc4LTEuNDYgMS40NzgtMi41MzFDMjMuNDg4IDEuMzE0IDIyLjE4IDAgMjAuNTgxIDBjLTEuNTk4IDAtMi45MDYgMS4zMTQtMi45MDYgMi45MiAwIDEuMDcxLjQ2IDEuOTk2IDEuNDI5IDIuNTA3djIuNDU5aC04LjcyVjUuNDI3YTIuOTI3IDIuOTI3IDAgMCAwIDEuNDMtMi41MDZDMTEuODEzIDEuMzE0IDEwLjUwNCAwIDguOTA2IDAgNy4zMDggMCA2IDEuMzE0IDYgMi45MmEyLjkgMi45IDAgMCAwIDEuNDc4IDIuNTMydjIuNDM0SDIyLjAxeiIvPgogICAgICAgIDxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTI2LjM4OSAxMGMxLjk0NCAwIDMuNTE4IDEuNTYzIDMuNjExIDMuNDAxVjM3bC0zLjYxMS0zLjg2SDMuNTE5QzEuNTc0IDMzLjE0IDAgMzEuNjY4IDAgMjkuNzM3VjEzLjQwMUMwIDExLjU2MyAxLjU3NCAxMCAzLjUxOSAxMGgyMi44N3pNMTEuNSAxOGgtM2MtLjgyNSAwLTEuNS42NzUtMS41IDEuNXYzYzAgLjgyNS42NzUgMS41IDEuNSAxLjVoM2MuODI1IDAgMS41LS42NzUgMS41LTEuNXYtM2MwLS44MjUtLjY3NS0xLjUtMS41LTEuNXptMTAgMGgtM2MtLjgyNSAwLTEuNS42NzUtMS41IDEuNXYzYzAgLjgyNS42NzUgMS41IDEuNSAxLjVoM2MuODI1IDAgMS41LS42NzUgMS41LTEuNXYtM2MwLS44MjUtLjY3NS0xLjUtMS41LTEuNXoiLz4KICAgIDwvZz4KPC9zdmc+Cg==" alt="Discord Bots" title="Discord Bots">

How can I convert this image data directly to an svg?

earnest phoenix
#
.addField(`Çekilişi Kazanan`, `<@${message.guild.users.cache.random().id}>`, true)
#

i dont know if have any differents

#

try with users too

pale vessel
opaque seal
#

Thanks

sick sluice
#

hi, is it possible to host discord bot in more than 1 physical machine?

lament rock
#

Through sharding, yes

earnest phoenix
#

i gave you an answer already

fervent hornet
#

You can use any language.

#

@west hazel

west hazel
#

php ?

fervent hornet
#

Let me get the docs

#

Check in the libraries section.

cosmic iris
#

members = ctx.guild.members <- why does this only get me the bot and nothing else?

fervent hornet
#

Intents?

#

Do you have the members intent enabled?

cosmic iris
#

Im not sure what that is sorry

fervent hornet
#

You need to have intents enabled.

#

So in your code, you're going to need to add intents.

earnest phoenix
#

for more information

fervent hornet
#

This is what I'd do:

intents = discord.Intents(members=True)

Then find your line where you define client/bot, and add the intents part.

client/bot = commands.Bot(command_prefix = "prefix",intents=intents)
cosmic iris
#

tysm

fervent hornet
#

No problem

frozen rock
#

guys

#

i need a coding help

#

can anyone help me pls?

fervent hornet
#

@frozen rock What's your question?

#

Don't ask to ask please.

dreamy gulch
#

Just post your problem and someone will surely help

frozen rock
#

its about my bots biography

#

i want it to show how many servers my bot in

#

hey? @fervent hornet

marble juniper
#

lol

frozen rock
#

help me pls :(

marble juniper
#

idk seems like a backend issue

#

yes

#

I have seen

#

seems like a server side issue

#

lol

pale vessel
marble juniper
#

oh

#

yeah

#

forgot

fervent hornet
pale vessel
#

They can't

#

Yet

#

I think they will mover that to your bot page

fervent hornet
#

That's the API docs.

pale vessel
#

Since the docs is now on GitHub

#

you can't get your tokens from there anymore

#

So wait ig

zenith terrace
#

you can find your bots api token you can find it by going to your bots page, clicking edit and going to webhooks

pale vessel
#

aha

#

they did that oh

#

that's so weird, on webhooks?

marble juniper
#

yeah

marble juniper
#

they should make it redirect to the new docs page lol

zenith terrace
marble juniper
zenith terrace
#

smh link

marble juniper
#

nothing

frozen rock
#

go away

marble juniper
#

bruh

frozen rock
#

ahah funny boy

zenith terrace
#

@marble juniper hows google for the past 3 hours

marble juniper
#

my pc just has discord open as well