#development

1 messages · Page 1219 of 1

earnest phoenix
#

and it's much more complicated than you think

#

like i told you before

charred geyser
#

bruh i have already set it up

#

noob

ebon kelp
#

He asked for a template not a whole website

charred geyser
#

yeah

#

i already have a dashboard

#

i just need to make it look bootiful

earnest phoenix
#

most likely not a secure one

#

lol

charred geyser
#

probably not

#

but

#

its ok for now

ebon kelp
#

What?

charred geyser
#

since my bot isn't even published

misty sigil
#

no it isnt

charred geyser
#

bruh

ebon kelp
#

Injection? ppLaugh

charred geyser
#

ok how should i secure it

honest perch
#

You will want to make a server in something like express and use passport

charred geyser
#

i already have

#

i have that

#

brruh.

honest perch
#

Do a 3 hour security course

#

Ez

charred geyser
#

lol

#

boostrap templates are expensive bruh

ebon kelp
#

never return a password to front-end is the most important one

earnest phoenix
#

SSL certs, state parameter in oauth, don't expose anything sensitive to the frontend

charred geyser
#

state parameter in oauth what is that

#

what

honest perch
charred geyser
#

:(

earnest phoenix
#

you need to be actively aware of popular web vulns

#

also make sure to follow-up your requests with XSRF tokens (if you're not doing SSR)

charred geyser
#

okay

#

thank you

#

i also do need to make it bootiful

fast trench
#

is this not set up correctly to look for either a role OR if the message author is also the guild owner?
} else if (message.member.roles.cache.find(r => r.id === moderation) || message.author.id === owner) {

earnest phoenix
#

OR if the message author is also the guild owner
are you sure you're comparing the ids?

marble geode
#

why ${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()} is showing NaN Users?

fast trench
#

are you sure you're comparing the ids?
@earnest phoenix Yes I am sure...the 2 parts work correctly by themselves but putting them together makes it not work

stark pasture
#

Can someone give me ideas of commands to add into my bot? I'm really out of ideas

#

My bot is mainly focused on entertainmment

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: module 'discord.ext.commands' has no attribute 'guilds'

#

geting this issue from a cog

#

using py

charred geyser
#

Can someone give me ideas of commands to add into my bot? I'm really out of ideas
@stark pasture commands that return random pictures of dogs or animals or memes or something?

stark pasture
#

I already have one of these but it's with cats

#

thanks for the idea

#

I will make another

#

Any other idea? AkariDance

drifting wedge
#

umm i need ideas

#

so hmu too

charred geyser
#

i need a website 😭

pure lion
#

@charred geyser dm

fast trench
marble geode
#

${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()} why the result is NaN

#

??

misty sigil
#

a.memberCount

charred geyser
#

should i:

#

a) make a better website

#

b) add more commands and cleanup code in my bot

#

hmmm

quartz kindle
#

c) both

#

d) neither

charred geyser
#

😮

quartz kindle
#

e) come back tomorrow

charred geyser
#

tim are you pround?

#

proud

fast trench
ebon kelp
#

I know the guy who developed it >,<

quartz kindle
#

@fast trench you're doing !a === b

#

instead of a !== b

charred geyser
#

i have a working dashboard

#

that you can view all of your servers on

sweet kestrel
#

@grim needle moderator

#

...

charred geyser
#

and you can edit their preix on

#

prfix

sweet kestrel
charred geyser
#

bruh

sweet kestrel
#

@grim needle moderato

#

moderator

#

so does that count as like level up?

#

Is not spam

sinful belfry
#

yeah

sweet kestrel
#

but

sinful belfry
#

it will just be muted in this server

sweet kestrel
#

is that against the rule?

sinful belfry
#

not related to development tho

sweet kestrel
#

oh

#

ok

#

but is it against the rule?

sinful belfry
#

it will just be muted in this server

sweet kestrel
#

oh... when will it be unmuted?

sinful belfry
#

when you've disabled it for this server

quartz kindle
#

any automatic command will make your bot be muted until you either remove it or disable it

sweet kestrel
#

it actually sent message when a new users joins, not like

sinful belfry
#

but please redirect any further questions on this to #support

sweet kestrel
#

not like old members i thin

#

ok

#

kk

charred geyser
quartz kindle
#

yes

#

now add some css to it

charred geyser
#

yes

#

i really need to

ebon kelp
#

you dropped the t

#

socializaion

charred geyser
#

its someone else's server

#

its just an example of editing a servers settings using my bot

#

it displays all servers a user has perms in

#

and i think it is fairly secure

fast trench
#

@fast trench you're doing !a === b
@quartz kindle didn't work lol

quartz kindle
#

@fast trench did you fix it tho?

fast trench
#

nope 😅 and I've been told 50 different things in 2 other servers so idk what I've tried at this point

quartz kindle
#

no i mean

#

i told you that !a === b is wrong

#

it should be a !== b

#

did you fix that?

fast trench
#

I know you said that...It doesn't work how you said

quartz kindle
#

ok but did you change it? or put it back to how it was before?

#

change it then show the changed code

fast trench
#

that's how you said to do it

quartz kindle
#

what do the console.logs show?

charred geyser
#

<input type="text" name="prefix" value="<%= settings.prefix %>" placeholder="Your prefix."><br><br>

Cannot read property 'prefix' of null

drifting wedge
#

how do i add embed description

#

py

charred geyser
#

not sure idk py

quartz kindle
#

@fast trench also, it should be an && instead of an || in this if

fast trench
#

for your console logs...it logs the id's correctly...and I'll try that

charred geyser
#

how would i reference a model in ejs

#

like: value="<%= settings.prefix %>"

#

i want that the = the prefix in my Schema

fast trench
#

That worked @quartz kindle idk why I didn't realize that lol

charred geyser
#

nobody?

#

bruh

sweet kestrel
#

I have a question 😦

#

so i used heroku to host my bot for me, but my music command is not working somehow

#

it is buid succeed, and other command are working perfectly

#

language:python

earnest phoenix
#

heroku is too weak to handle music

weary marsh
#

heroku is good for begining.

thick gull
drifting wedge
#

heroku is too weak to handle music
@earnest phoenix no its not

#

i run it perfectly fine

#

50+ servers

#

can play music with no lag whatsoever on like 10 servers at once

earnest phoenix
#

because your bot is tiny and nobody uses it lol

drifting wedge
#

?

earnest phoenix
#

put it under stress and you'll see how much it begins to choke

unique nimbus
#

also this is python they are talking about

#

it uses more ram than nodejs

drifting wedge
#

no need to be mean tho

unique nimbus
#

because python caches all it wants

drifting wedge
#

for me it works well

earnest phoenix
#

how was i being rude

#

chile

#

lol

drifting wedge
#

because your bot is tiny and nobody uses it lol
@earnest phoenix

earnest phoenix
#

...that isn't being rude, is it? i stated that the bot is tiny

#

and that nobody uses it so there's no stress

unique nimbus
#

well when a bot is small it is used less/none daily

#

excluding yourself

drifting wedge
#

well on 10+ servers at once it runs music

unique nimbus
#

we don't count ourselves in how active the bot is

#

also it depends on how big the other servers are

drifting wedge
#

does ffmpeg work on streams?

earnest phoenix
#

ffmpeg works with pretty much any format you can think of

unique nimbus
#

thats from the wiki

#

I just googled ffmpeg streaming

drifting wedge
#

I just googled ffmpeg streaming
@unique nimbus like yt live streams

obtuse jolt
#

What’s the equivalent of client.guilds.size in v12 that isn’t client.guilds.cache.size

#

same question for client.users.size

blazing portal
#

Why can't it be client.guilds.cache.size? That is the equivalent^^

obtuse jolt
#

Because it’s only cached guilds and cached users what about the uncached users and guilds

errant perch
#

message.channel.send(${args[1]} is not a valid symbol.);

#

how do i add a highlight inside of ``

#

like this

blazing portal
#

escape the ` symbol

errant perch
#

how

blazing portal
#

\

errant perch
#

ok

obtuse jolt
#

My bot is in 4 bot lists with 75k+ users so about 300k-400k+ and it’s saying the bot has 100k overall users using client.users.cache.size

rare crow
#

How can I put my bot to the test

blazing portal
#

I calculate the members by adding up the memberCount property of the guilds

#

What test ?

rare crow
#

How can I add my bot to the site

blazing portal
#

@obtuse jolt client.guilds.cache holds all guilds

#

@rare crow You go to the homepage, and follow the steps in Add Bot

rare crow
#

Okay thank

earnest phoenix
#

why the npm youtube-search dont work?

thick gull
#

My bot is in 4 bot lists with 75k+ users so about 300k-400k+ and it’s saying the bot has 100k overall users using client.users.cache.size
@obtuse jolt cache is for online mmebers in large servers

#

it’ll go up and down

#

iirc

split hazel
#

why the npm youtube-search dont work?
As much as you may believe so, we don't have the technology yet to read your mind and see what you mean by "doesn't work" so for now could you explain what you mean by "doesn't work"?

earnest phoenix
#
const opts = {
   maxResults: 1,
   key: process.env.YOUTUBEKEY,
   type: "video"
 };

 await search('space is cool', opts, function (err, results) {
   console.log(results)
 });```
obtuse jolt
#

well... did you try see if err is defined...

earnest phoenix
#

wait

#

is .env.APIKEY

obtuse jolt
#
const opts = {
   maxResults: 1,
   key: process.env.YOUTUBEKEY,
   type: "video"
 };

 await search('space is cool', opts, function (err, results) {
   if(err) {return console.log(err)}
   console.log(results)
 });```
earnest phoenix
#

no .env.YOUTUBEKEY

#

xd

analog rampart
#

how can i setup webhook

stark pasture
#

Can i get some ideas for commands for my bot pls? CBHearts

errant perch
#

how do i complete a process when i catch a error

ember lodge
errant perch
#

the whole site has been like that

#

something to do with cloudflare

#

nothing you did its server side

stark pasture
#

Can i get some ideas for commands for my bot pls? CBHearts

marble geode
#

hey man why ${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}
the result is NaN?

pale vessel
marble geode
#

hmmm

#

whats wrong?

sudden geyser
#

a is also an instance of Guild

#

So you need to use .memberCount on it as well.

#

@marble geode

pale vessel
#

a is the memberCount accumulated

#

shouldn't that have worked?

earnest phoenix
#

help

#

how do i use github

#

helphelphelp

#

i'm a noob i'm so sorry but i need to upload my python code on github for my code to run 24/7

sudden geyser
#

heck I didn't know that

pale vessel
#

it worked for me

earnest phoenix
#

i'm halfway across the world from people using my bot

sudden geyser
#

Using git will probably be your solution, but it takes some time to learn it.

earnest phoenix
#

ooh okay

ember lodge
#

how do i update npm packages?

#

i use ubuntu

pale vessel
#

use npm i or npm i <package name>

#

use sudo if you need to

ember lodge
#

thxs

#

still nothing

sudden geyser
#

Try npm install discord.js@12.3.1 if you want v12

thick gull
#

wait you dont upload code to github for free hosting

#

am i missing something

#

or

sudden geyser
#

GitHub hosts your code by making it accessible remotely, but doesn't actually run it in most scenarios. Think of GitHub like your closet for storing stuff.

#

Since its remote, you're able to download it then run it locally.

urban olive
#

i need some help with embeds

pale vessel
#

sure

urban olive
#

^ this is my code for a embed

pale vessel
#

what's the problem?

#

avatarURL() needs to be a method/function

urban olive
#

whenever i run my bot with it it says "client" is not defined

#

and i do have it defined

pale vessel
#

what did you define your client as?

urban olive
#

"bot"

pale vessel
#

client?

#

use bot

urban olive
#

i am

pale vessel
#

whenever i run my bot with it it says "client" is not defined

#

client is not defined because you defined it as bot

#

change client to bot

urban olive
#

i need to define it as client?

#

ah ok

pale vessel
#

doesn't matter but i recommend you rename everything to client because that's what discord.js use internally

#

in your embed, avatarURL() is a method so you need to add ()

#

you should use displayAvatarURL() so that it supports users with no avatars

urban olive
#

now i get ReferenceError: Cannot access 'Client' before initialization

#

is it case sensitive

#

still regardless if it is or not i still get the same error

#

up top i have


const bot = new Client();```
sand condor
#

Discord.Client()

#

(also on the front page of the djs website)

#

and yes javascript is case sensitive

clear wraith
#

Yeah, It needs to be

const Discord = require("discord.js");

const bot = new Discord.Client();
pallid igloo
#
function ExpCount(exp, level) {
 let e1 = 1 - (1.15^level);
 let e2 = 1 - (1.15);
 let e3 = e1/e2;
 let e4 = e3*exp;
 return e4;
}
ExpCount(5, 90)

Why is this function not giving me the same result as this :

earnest phoenix
#

jesus christ

pallid igloo
#

Btw, Output = 3000.000000000002

earnest phoenix
#

the ^ operator is xor, you are searching for **

pallid igloo
#

Oh right, Oops. thnx

#

yeah, Works now.

carmine summit
#
map = 'MIRAA'
            if (!map == 'MIRA' || !map == 'SKELD' || !map == 'POLUS') {
                console.log('fix')
                message.channel.send('Map must be `SKELD`, `MIRA`, or `POLUS`')
                return
            } else {
              console.log('no fix')
            }
            //returns 'no fix'
#

why it returns no fix?

#

ah nvm

nimble kiln
#

! negates Fingerguns

carmine summit
#

i found the issue

#

must be !=

earnest phoenix
#

yes

nimble kiln
#

why not just remove the ! in front of your "map"'s?

#

actually

#

ignore what I said 👌

carmine summit
#

btw must it be != or !==

earnest phoenix
#

the latter is type sensitive

#

you should probably use that instead

carmine summit
#

i got it to .toUpperCase()

earnest phoenix
#

you're thinking of case sensitive

#

im saying type sensitive

carmine summit
#

whats that?

earnest phoenix
thick gull
#

Since its remote, you're able to download it then run it locally.
@sudden geyser that’s what I thought it’s just the context made me think they were hosting it in github, like host host

crystal depot
#

lol still waiting for my bot to get verified

carmine summit
#

i havent still solved my problem

#

how it is returning no fix

#

i tired !=

#

and !==

#

and !==
i dont even know if this is a thing

thick gull
#

Your checking MIRA against MIRAA

carmine summit
#

yes?

#

what with it

thick gull
#

so it will not return true and do the else

#

which is no fix

#
map = 'MIRAA'
            if (!map == 'MIRA' || !map == 'SKELD' || !map == 'POLUS') {
                console.log('fix')
                message.channel.send('Map must be `SKELD`, `MIRA`, or `POLUS`')
                return
            } else {
              console.log('no fix')
            }
            //returns 'no fix'

@carmine summit

carmine summit
#

it is negetated

thick gull
#

MIRAA ≠ MIRA therefore it’ll go to the else(?)

carmine summit
#

What I mean is, if map is not equal to map it will log fix

#

if it is equal, it must log no fix

thick gull
#

if (!map === “MIRAA”) return console.log(“no fix”)

console.log(“no fix”)

#

(?)

carmine summit
#

no

cinder patio
#

The ! operator turns map to a boolean value

carmine summit
#

i updated it to != and still doesnt work

cinder patio
#

Can you post your updated code

carmine summit
#
map = 'MIRA'
            if (map != 'MIRA' || map != 'SKELD' || map != 'POLUS') {
                console.log('fix')
                message.channel.send(`Error: \`${map}\` is not a valid response. Map must be \`SKELD\`, \`MIRA\`, or \`POLUS\``)
                return
            } else {
              console.log('no fix')
            } 

//returns 'fix'```
#

returns fix always

#

even if it is 'MIRA' or 'MIRAA'

#

it returns 'fix'

fluid basin
#

bruh you're using OR

#

think about it

cinder patio
#

Try replacing the OR operator with the AND operator

fluid basin
#

IF
map is not MIRA (false)
OR
map is not SKELD (true)
OR
map is not POLUS (true)
= true

#

AND is for all conditions needs to be true

carmine summit
#

uh

fluid basin
#

OR is for any condition that can be true

carmine summit
#

it works

#

but im confused

#

nvm

#

im an idiot

#

lol

#

BTW how do I make a hyperlink to a specific channel?

#

bot takes it as a text

cinder patio
#

<#channelId>

sick cloud
#

how do you use promise.all to wait for a set of promise actions to finish

#

like is this right

            const actions = items.map((x) => this.delete(x._id));
            const results = await Promise.all(actions);
fluid basin
#

yeah it accepts an array

sick cloud
#

but would that be correct

#

this.delete resolves with true/false

fluid basin
#

yeah results would be an array

#

of [true, true, false, true, etc...]

sick cloud
#

then i could do like
results.filter((x) => x === true).length
to only get the amount that worked right

fluid basin
#

though if any promise gets rejected, the entire promise.all will be rejected regardless of whether other promises are resolved

sick cloud
#

yeah that's fine i've got a try catch to just pass it through

fluid basin
#

aight

sick cloud
#

it's a sweep func to delete all items from my db that match a filter so

fluid basin
#

then i could do like
results.filter((x) => x === true).length
to only get the amount that worked right
yeah that works

sick cloud
#

just making an array of deletes and awaiting them all

fluid basin
#

actually

#

if you're using async await

#

the entire function return is a promise

#

so I don't think you need to manually resolve or reject it

#

iirc in async if the rejection is not handled, it will automatically reject

crystal depot
#

vsc?

#

or pycharm?

pale vessel
#

sublime

fringe seal
#

is it possible to put 🇨 and 🇩 next to eachother without it turning into 🇨🇩

golden condor
#

yes

#

Put an empty space

#

iirc it's \u200b

pale vessel
#

yeet

golden condor
#

Do C \u200b D

pale vessel
#

you don't need to do that

fringe seal
#

ok

golden condor
#

It's a way of getting around it

pale vessel
#

🇨🇩eez nuts

#

oh shit

#

welp

golden condor
#

Lol

fringe seal
#

😔

pale vessel
#

i stand corrected

sick cloud
#

@fluid basin yeah but i did mine just to be sure

#

a bit extra code doesn't hurt

fathom topaz
#

howda why

robust arrow
#

;

fluid basin
#

you probably have one or two unclosed brackets above

fathom topaz
#

ok

low phoenix
fringe axle
#

Unknown stream type

low phoenix
#

Yeah but why? How can i fix it?

sick cloud
#

so i somehow made a json db that takes up over 700 lines

#

good dev right here

pure lion
#

........

misty sigil
#

so i somehow made a json db that takes up over 700 lines
@sick cloud why

pure lion
#

Why do I bother

#

If this isn't a joke....

sick cloud
#

@misty sigil boredom

#

it's actually good though thank you

pure lion
#

So... You're buffering and shit?

misty sigil
#

AAAAAA that is cursed

pure lion
#

OKAY MISTER BOOLEAN MAN

#

ok this is about as good as it gets

let boolean = {values:{true:true,false:false},true:function(){return true;},false:function(){return false;},random:function(){return!!Math.round(Math.random())},boolean:function(arg){if(isNaN(arg))throw "Provide a number to boolean";if(arg < 0.5)return false;if(arg>=0.5)return true;}}

@misty sigil >:(

misty sigil
#

fine ur right

pure lion
#

Lmfao

#

You didn't add my message link :cccc

misty sigil
sick cloud
#

@pure lion yea actions are queued and it also does back ups

misty sigil
#

why

sick cloud
#

again

#

boredom

misty sigil
#

ok fair enough

sick cloud
#

wouldn't use it in prod of course

balmy knoll
#

My bot has been having very high pings for a week. Initially I thought it was the database, but changing host of the MongoDB database hasn't changed anything. I then already asked in this chat and they told me that the problem was the host, or Heroku Free. I then switched hosts to a Linux VPS, but the pings still remained high. As I was advised last night on this channel, I tried to use the same host for a bot with only the ping command and the pings are all normal. So I ask you, is there anyone who really wants to help me?

feral aspen
#

Hello

#
                let bioStatus = args.slice(2).join(" ");
                if(bioStatus.length > 80) {
                    const lengthEmbed = new Discord.MessageEmbed()
                    .setDescription("Your bio contains more than 80 characters.")
                    .setColor(colors.cyan)

                return message.channel.send(bioStatus)
                }```
#

I am making a command

#

!profile bio set <message>

#

When the message length is more than 80, it doesn't return

#

I even putted return message.channel.send(lengthEmbed)

earnest phoenix
#

Okay this should in no way be seen as offensive

#

but

#

are you braindead

#

@feral aspen can you see

#

do your eyeballs work

feral aspen
#

Why are you being mean?

earnest phoenix
#

you can SEE that you defined an condition where, if the message is over 80 characters long, nothing happens

#

that is basic logic

#

if you cant do that, how do you even live

feral aspen
#

Yeaa.

#

Keep being rude and mean.

earnest phoenix
#

if(bioStatus.length > 80) {

#

this says "if bioStatus is above 80, skip everything inside the brackets"

#

the brackets: ```
{
const lengthEmbed = new Discord.MessageEmbed()
.setDescription("Your bio contains more than 80 characters.")
.setColor(colors.cyan)

            return message.channel.send(bioStatus)
            }
#

surprised pikachu face

feral aspen
#

What can I do to make it return

earnest phoenix
#

define a else {} condition

#

or no nvm

#

you just made the > the wrong side

#

replace the > in your if() statement with <

marble juniper
#

bruh

feral aspen
#

huh

#

If more than 80, then return, cause too long

earnest phoenix
#

wait nonononono

pale vessel
#

oh no no no pepelaugh

earnest phoenix
#

did you actually test it with a description over 80 chars long

twilit rapids
#

@feral aspen looks like you're sending bioStatus rather than the lengthEmbed

earnest phoenix
#

that can be an issue too

feral aspen
#

I know

#

I changed it

#

it still errors.

earnest phoenix
#

you slice the arguments at 2

#

means

twilit rapids
#

What's the error

earnest phoenix
#

[arg0, arg1, arg2, arg3] becomes arg2 arg3

#

so you need to do like !something something else actual description

feral aspen
#

I have a system like !profile bio set <message> if message is more than 80 characters, it return

#

but it doesnt return

earnest phoenix
#

then the message isnt over 80 chars long

twilit rapids
#

Did you try console logging bioStatus to see if you've got the right thing?

feral aspen
#

Yes it is right

#

But it doesnt return if more than 80 characters

#

It just continues.

twilit rapids
#

Did you try console logging bioStatus.length as well?

feral aspen
#

Yes

#

It shows the <message>

#

Why doesn't it not return

#
                let bioStatus = args.slice(2).join(" ");
                if(bioStatus.length > 80) {
                    const lengthEmbed = new Discord.MessageEmbed()
                    .setDescription("Your bio contains more than 80 characters.")
                    .setColor(colors.cyan)

                return message.channel.send(lengthEmbed)
                }```
twilit rapids
#

It shows the <message>
Do you mean it shows the lenght of the message or the message itself?

limpid spoke
#

HAHA! @obtuse dove

feral aspen
#

the message it self

limpid spoke
#

👍

misty sigil
#

@feral aspen what do you mean by that

twilit rapids
#

Please read back before you start to answer or ask questions

feral aspen
#

I am trying to make a code where, people do !profile bio set <message> if message's length exceeds than 80 characters, it returns saying you cannot put a message more than 80 characters

twilit rapids
#

If bioStatus.length console logs the entire message then you've done something wrong kzThinkinghmmm

feral aspen
#

Now I made a message and it exceeds, but it doesnt return for some reason

misty sigil
#

log bioStatus for us

twilit rapids
#

Please read before you ask questions

#

I've already asked them that...

misty sigil
#

they said "yes it is right"

#

i want to know the output

twilit rapids
#

Also, @earnest phoenix you were a real dick when you tried to "help", please don't do that again...

earnest phoenix
#

i also just realized i was completely fucking wrong

#

im sorry, i woke up like 40 mins ago and my bad was really god damn bad until now, my nerves are kind of gone

#

wont happen again

feral aspen
#

it doesnt log

misty sigil
#

wdym

feral aspen
#

Sorry

#

I meant it log

#

It logs the <message>

misty sigil
#

so bioStatus is a string?

feral aspen
#

Yes

#

let bioStatus = args.slice(2).join(" ");

misty sigil
#

huh

feral aspen
#

if more than 80 characters I make it return, but it doesnt return.

#

                const lengthEmbed = new Discord.MessageEmbed()
                .setDescription("Your bio contains more than 80 characters.")
                .setColor(colors.cyan)

                if(bioStatus.length > 80) return message.channel.send(lengthEmbed)
                
                    bio[user.id] = {
                        name: bot.users.cache.get(user.id).tag,
                        bio: bioStatus
                    }
                    fs.writeFile("./bio.json", JSON.stringify(bio), (err) => {
                        if(err) console.log(err);
                    });
                console.log(bioStatus)

                let newBio = new Discord.MessageEmbed()
                .setTitle('Profile Bio')
                .setDescription(`Successfully set your bio to **${bioStatus}**`)
                .setColor(colors.cyan)
                .setFooter(`Created by HamoodiHajjiri!`, bot.user.displayAvatarURL())
                .setTimestamp();

                message.channel.send(newBio)```
misty sigil
#

ok so first thing i notice

#

is that json being used as a database

feral aspen
#

bro

#

leave the database

#

and try helping me with what I said

misty sigil
#

ok

feral aspen
#

Why it doesn't return?

misty sigil
#

i dont see anything wrong with that

#

you say bioStatus.length returns the string right?

feral aspen
#

no

#

if the biostatus string exceeds 80 characters, it returns

#

returns an embed saying you cannot exceed

misty sigil
#

Did you try console logging bioStatus.length as well?

It shows the <message>
?

feral aspen
#

Wait

#

It worked

misty sigil
#

oh

#

cool

feral aspen
#

Idk what I did, but thank u!

sharp swift
#

How can I put a text in the middle of my bot description on top.gg

earnest phoenix
#

css

#

:))

#

On discord py how you would check for a message after a command

small zenith
#

Can i get a pic of Api options section of ur top.gg bot? ( with everything blurred except the URL )

#

Idk what url to put there :/

earnest phoenix
#

!p انا دمي فلسطيني $$ محمد عساف Mohammed Assaf

small zenith
#

https://discordapp.com/api/webhooks/id/auth

#

this?

#

Then which webhook url

earnest phoenix
#

sude

#

API is only for DBL

#

do u know anything about dblapi.js ?

#

!p I' m my Palestinian blood

#

!p I'm my Palestinian blood

#

!p I'm my Palestinian blood

viral spade
#

Please can someone help me, i think im getting ddosed / bruteforced.

suddenly only like 10% of ssh connection tries (via putty) actually connect.
This is my resources graph, that went up last night, wthout changing anything to the code the past couple of days.

#

anyone knows what could be going on?

earnest phoenix
#

was meinst du ?

#

wdym ?

viral spade
#

me?

earnest phoenix
#

yes

viral spade
#

what i wrote above

"suddenly only like 10% of ssh connection tries (via putty) actually connect.
This is my resources graph, that went up last night, wthout changing anything to the code "

earnest phoenix
#

10% is succesful

viral spade
#

yes

earnest phoenix
#

hmmm

viral spade
#

sounds like ddos

#

to me

earnest phoenix
#

idk but u still can connect normaly right ?

viral spade
#

yes 10% of the time

twilit rapids
#

Put it behind cloudflare sip

earnest phoenix
#

: /

#

yes

viral spade
#

but like, i can only put the domain behind cloudfare right? not the ip?

twilit rapids
#

You can't do much about it unless you know who's doing it and can slap them in the face for it, set up ufw if you haven't already but that's about it

#

And keep your IP a secret I guess

viral spade
#

okay but i think i disabled root ssh access and using ssh key to connect to the only other account, ufw is also set up... so if the attacker doesnt bruteforce my ssh it should be good?

(i done really care about the increased resources, because the website is basically static and still works fine)

twilit rapids
#

I guess

viral spade
#

okay, still it really frightening^^

#

is this kind of attack known? maybe it is not targeted at my bot, but a crawler type thing and will go on to the next when it doesnt succeed for some time?

twilit rapids
#

No clue

eternal osprey
#

guys

open rune
#

is it possible to create restriction command using collection instead of database?

small zenith
#

do u know anything about dblapi.js ?
@earnest phoenix No

earnest phoenix
#

huh

small zenith
#

Im not used these things

earnest phoenix
#

How can i do in discord js v 11.5.6 to change the name of a group

summer torrent
#

group?

open rune
#

what does "group" mean?

#

roles?

earnest phoenix
#

dm group channel

small zenith
#

u cant?

#

i dont think bot can join dm groups

open rune
#

however they have a GroupDMChannel class

#

according to stackoverflow

summer torrent
#

bots cannot join to dm groups

#

I think it is for selfbots

open rune
#

probably

#

is it possible to create restriction command using collection instead of database?
@open rune guys, please... xd

summer torrent
#

restriction?

#

discordjs/collection is temporary database

sullen frost
#

does somone have a welcome api?

open rune
#

So, I am thinking to make restriction command, thus if you use this command, you can restrict the use of intended command for only few roles, but it seems I can only restrict the command only for a role.

#

and I am currently using collector

blissful tinsel
#

im beginner and i need help before my script worked now i have this error C:\Users\artur\DiscordBot>node .
C:\Users\artur\DiscordBot\Main.js:6
client.once('ready', => {
^^

SyntaxError: Unexpected token '=>'
 at wrapSafe (internal/modules/cjs/loader.js:1053:16)
 at Module._compile (internal/modules/cjs/loader.js:1101:27)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
 at Module.load (internal/modules/cjs/loader.js:985:32)
 at Function.Module._load (internal/modules/cjs/loader.js:878:14)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 at internal/main/run_main_module.js:17:47

#

here code

#

// JavaScript source code

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

client.once('ready', => {
console.log('DarkTardis Status - Online')
});

client.login

#

what should i do with it?

open rune
#

client.once('ready', () => {

}
try this maybe

blissful tinsel
#

ok

small zenith
#
client.on("ready', () => {  //once or on both will work
    console.log('DarkTardis Status - Online')
})```
blissful tinsel
#

next error C:\Users\artur\DiscordBot>node .
C:\Users\artur\DiscordBot\Main.js:4
const client = new Discord.Client();
^

ReferenceError: Discord is not defined
at Object.<anonymous> (C:\Users\artur\DiscordBot\Main.js:4:16)
 at Module._compile (internal/modules/cjs/loader.js:1137:30)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
 at Module.load (internal/modules/cjs/loader.js:985:32)
 at Function.Module._load (internal/modules/cjs/loader.js:878:14)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 at internal/main/run_main_module.js:17:47

small zenith
#
const Discord = require("discord.js")```
blissful tinsel
#

@small zenith error too C:\Users\artur\DiscordBot>node .
C:\Users\artur\DiscordBot\Main.js:6
client.on("ready', () => { //once or on both will work
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Invalid or unexpected token
 at wrapSafe (internal/modules/cjs/loader.js:1053:16)
 at Module._compile (internal/modules/cjs/loader.js:1101:27)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
 at Module.load (internal/modules/cjs/loader.js:985:32)
 at Function.Module._load (internal/modules/cjs/loader.js:878:14)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 at internal/main/run_main_module.js:17:47

#

@open rune i have this

small zenith
#

show code

open rune
#

ok ok, calm down.

blissful tinsel
#

// JavaScript source code

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

client.on("ready', () => { //once or on both will work
console.log('DarkTardis Status - Online')
})

client.login

#

ik im calm

orchid pasture
#

client.login(token)

small zenith
#

u have client.login or client.login("ur bot token")

blissful tinsel
#

i have token in

sullen frost
#

does somone have a welcome api?

small zenith
#

ok

blissful tinsel
#

but i dont show it

orchid pasture
#

ok take e look to the quote

open rune
#

did you have installed discord.js library already?

blissful tinsel
#

i have discord.js

#

it worked yesterday

small zenith
#
("ready',``` use both `"` or `'`
blissful tinsel
#

ok

small zenith
#

or `

orchid pasture
#

lel

blissful tinsel
#

IT works thx!

small zenith
#

thx tomoka

open rune
#

Good

small zenith
#

my eye sight weak =w=

open rune
#

say Arigatou for her xddd

small zenith
#

Arigatou Tomoka

open rune
#

Arigatou, omaewa mo shindeiru

small zenith
#

when will pros come online :/
I want someone to help me with that fkin webhook thing

eternal osprey
#

hey can someone help me

#

with the referenceerror: mesagge is not defined

#
const Discord = require("discord.js");

const client = new Discord.Client();

client.on("ready", () => {
  console.log("Ready!");
});

const embedz =
  new Discord.MessageEmbed()

    .setColor("#FF0000")
    .setTitle("**Leave/Join traffic**")
    .addField("```The bot has joined your voice channel!```") +
  "<@" +
  message.author.id +
  ">"
    .setImage("https://media.giphy.com/media/Dw2M6GsuAWR68/giphy.gif")
    .setfooter("Command hosted for Cameronbra!");

const exampleEmbed =
  new Discord.MessageEmbed()

    .setColor("#FF0000")
    .setTitle("**Leave/Join traffic**")
    .addField("```The bot has left your voice channel!```") +
  "<@" +
  message.author.id +
  ">"
    .setImage("https://media.giphy.com/media/sFuUyrIqP0mpG/giphy.gif")
    .setfooter("Command hosted for Cameronbra!");

client.on("message", async (message) => {
  if (message.content == "!join") {
    if (message.member.voice.channel) {
      const connection = await message.member.voice.channel.join();
      channel.send(embedz);
    }
  }
});

client.on("message", async (message) => {
  if (message.content == "!leave") {
    client.leaveVoiceChannel;

    channel.send(exampleEmbed);
  }
});```
orchid pasture
#

hey u should put it on event

eternal osprey
#

wdym

orchid pasture
#

thats the reasons message isnt define

eternal osprey
#

could you give me an example

#

on how to put it in a event

orchid pasture
#

when will pros come online :/
I want someone to help me with that fkin webhook thing
@small zenith what kind of problem?

#

wdym

eternal osprey
#

how do i put it in ane vent

orchid pasture
#
client.on("voiceStateUpdate", (oldState,newState)=>{
   //put ur code here
})
eternal osprey
#

huh

orchid pasture
#

but u cant use message cuz voicestateupdate event didn't have message return

eternal osprey
#

i already have an event

#

client.on("message", async (message) => {

#

okay, let me try!

orchid pasture
#

wait

eternal osprey
#

uhhm

orchid pasture
#

ok i wrong

eternal osprey
#

it only gave me lots of errors

orchid pasture
#

ur problem is put the code outside the client.on("message")

eternal osprey
#

you mean, the embed?

orchid pasture
#

yeah

#

let put it inside the event

eternal osprey
#

still doesn't work lmao

#

(node:14180) UnhandledPromiseRejectionWarning: ReferenceError: Cannot access 'embedz' before initialization

#
const Discord = require("discord.js");

const client = new Discord.Client();

client.on("ready", () => {
  console.log("Ready!");
  client.user.setActivity(`on ${client.guilds.size} servers`);
  console.log(`Ready to serve on ${client.guilds.size} servers, for ${client.users.size} users.`);
});




client.on("message", async (message) => {
  if (message.content == "!join") {
    if (message.member.voice.channel) {
      const connection = await message.member.voice.channel.join();
      message.send(embedz);

      const embedz =
      new Discord.MessageEmbed()
    
        .setColor("#FF0000")
        .setTitle("**Leave/Join traffic**")
        .addField("```The bot has joined your voice channel!```") +
      "<@" +
      message.author.id +
      ">"
        .setImage("https://media.giphy.com/media/Dw2M6GsuAWR68/giphy.gif")
        .setfooter("Command hosted for Cameronbra!");
    


    }
  }
});

client.on("message", async (message) => {
  if (message.content == "!leave") {
    client.leaveVoiceChannel;

    channel.send(exampleEmbed);


    const exampleEmbed =
    new Discord.MessageEmbed()
  
      .setColor("#FF0000")
      .setTitle("**Leave/Join traffic**")
      .addField("```The bot has left your voice channel!```") +
    "<@" +
    message.author.id +
    ">"
      .setImage("https://media.giphy.com/media/sFuUyrIqP0mpG/giphy.gif")
      .setfooter("Command hosted for Cameronbra!");




  }
});
#

new error..

#

ooowh shit

#

i fixed it

orchid pasture
#

lel

eternal osprey
#

(node:13696) UnhandledPromiseRejectionWarning: TypeError: "The bot has joined your voice channel!".setImage is not a function

#

wut the fuck is dis

orchid pasture
#
"<@" +
      message.author.id +
      ">"

keep it inside the field

small zenith
#

@orchid pasture i want to send every vote to a channel but idk how to do that

#

idek how to setup its basic things

orchid pasture
#

oh lel i never use top gg webhook

#

lel ahaaahaha

#

let see the docs page

eternal osprey
#

(node:3960) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setColor(...).setTitle(...).addField(...).setImage(...).setfooter is not a function

#

ffs

#
client.on("message", async (message) => {
  if (message.content == "!leave") {
    client.leaveVoiceChannel;


    const exampleEmbed =
    new Discord.MessageEmbed()
  
      .setColor("#FF0000")
      .setTitle("**Leave/Join traffic**")
      .addField("<@" + message.author.id + ">" + "The bot has left your voice channel!") 
      .setImage('https://media.giphy.com/media/sFuUyrIqP0mpG/giphy.gif')
      .setfooter("Command hosted for Cameronbra!");





    channel.send(exampleEmbed);

#

what is the problem?

sudden geyser
#

The error is quite self-explanatory: setfooter is not a function

You probably meant setFooter

small zenith
#

let see the docs page
@orchid pasture docs wont help me it doesnt have it explained deeply :/
it has explanation for normal users but im beginner in dblapi i never had my.bot here before cuz the long queue it takes 2 months for a bot to get accepted.. :/

#

and in most cases they try to find any small reason to reject bot

#

My last bot got rejected cuz of kiss gif
they said its nsfw but i used the gif from OwO bot

orchid pasture
#

ok let's open a webserver for retrieve the hook

small zenith
#

Kk

orchid pasture
#

lel my bot was rejected cuz its actually nsfw bot

bold jetty
#

nsfw bots arent allowed?

orchid pasture
#

yeah i know that

bold jetty
#

i didnt know

#

but why r there nsfw bots on top.gg

open rune
#

maybe you can put NSFW command inside NSFW channel only

bold jetty
#

Dank Memer

orchid pasture
#

but i keep it on NSFW channel

bold jetty
#

Dank Memer has nsfw

eternal osprey
#

my bot doesn't show the members in the guild

#
  client.on('ready', () => {
    console.log('Ready!')
    setInterval(() => {
        let membersCount = client.guilds.cache.map(guild => guild.memberCount).reduce((a, b) => a + b, 0)
        client.user.setActivity(`[${membersCount}] Players`, {type: "PLAYING"});
    }, 1000 * 60);
});
open rune
#

Dank Memer has nsfw
@bold jetty Zero Two has NSFW command as well

orchid pasture
#

the reasons is i include a NSFW message in description

bold jetty
#

so nsfw only in nsfw channels

orchid pasture
#

i already waiting for 2 month an just "u rejected cus description can't contains any NSFW"

bold jetty
#

f

orchid pasture
#

yeah if u prevent and keep in on NSFW ch ur bot can accept

open rune
#

huuu... Not Safe For Wife

orchid pasture
#

not save for while

faint zenith
#

I want vote updates in my server channel what i have to do

small zenith
#

Not Safe For Work

bold jetty
#

not simply funny water

#

I want vote updates in my server channel what i have to do
@faint zenith top.gg api

faint zenith
#

u know how tu use

#

or how to setup

bold jetty
#

I don't even have a bot on top

#

lol

small zenith
#

@orchid pasture Nvm i will pay someone to setup it for me

eternal osprey
#
client.on('ready', () => {
    console.log('Ready!')
    client.on("ready", () => {
      console.log(`Bot: Hosting ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`); 
      client.user.setActivity((`Hosting ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`));```

why is my bot activity not showing?
bold jetty
#

set precense

#

use client.user.setPresence

quartz kindle
#

do not ever put one event listener inside another

open rune
#

^

eternal osprey
#

owh shit

#

sorry

bold jetty
#

dont swear

small zenith
#

u have 2 ready event
client.user.setActivity("activity", {type: "PLAYING"}) for custom one
PLAYING WATCHING LISTENING for streaming add url
type: "STREAMING", url:""

eternal osprey
#
  client.on("ready", () => {
      console.log('Ready')
      console.log(`Bot: Hosting ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`); 
      client.user.setPresence((`Hosting ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`));
});
#

like this?

orchid pasture
#

@small zenith its ok

open rune
#

I currently having 2 library installed, one for status, another one for commands

eternal osprey
#

it still doesn't work

#
  client.on("ready", () => {
      console.log('Ready')
      console.log(`${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`); 
      client.user.setPresence((`Hosting ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`));
      client.user.setActivity("activity", {type: "Hosting"}) 
});```
open rune
#

my thought, use discord.io instead, if your code still doesn't work

misty sigil
#

ooh

eternal osprey
#

what is that

misty sigil
#

isnt that deprecated as fuck

eternal osprey
#

fuck

#

but it only gave me a white screen

open rune
#

isnt that deprecated as fuck
well, I know, that's why I put it only for bot statuses

misty sigil
open rune
#

yes

eternal osprey
#

i have tried everything

#

but my bot's acitvity is still not changing

#

it stays blank

open rune
#

thus, I put this:

const Discord    = require('discord.io');
const Discordjs  = require('discord.js');
misty sigil
#

thats dumb

open rune
#

lol, I tried many ways to make statuses for my bot

misty sigil
#

thats literally the dumbest shit i've ever seen

open rune
#

but only discord io work for status, I don't know why

misty sigil
open rune
#

I tried it long time ago, it just bumped some of my commands

eternal osprey
#

could anyone help me tho

#
 client.on("ready", () => {
      console.log('Ready')
      client.user.setPresence((`Hosting ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`));
      client.user.setActivity("activity", {type: "Hosting"}) 
});```
#

this bot is not showing anything as activity\

misty sigil
#

hosting isnt a type

#

lmfao

warm marsh
#

Use just one, Activity or Presence not both.

misty sigil
#

^ that toooooo

eternal osprey
#

still doesn;t work lmao

#
      console.log('Ready')
      client.user.setPresence((` Playing with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`));
       
});```
warm marsh
#

What's with the double parenthesis?

open rune
#

(( ))

eternal osprey
#

huh

#

where

#

woops

open rune
#
client.on("ready", () => {
      console.log('Ready')
      client.user.setPresence(` Playing with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);
       
});
eternal osprey
#

fucking hell

#

i changed it

#

still nothing

restive furnace
#

go full d.js

misty sigil
#

fuck

open rune
#

still trying

misty sigil
#

thats d.js v11 code

eternal osprey
#

nothing

misty sigil
#

client.users.cache.size

eternal osprey
#

still

misty sigil
#

client.channels.cache.size

eternal osprey
#

omg

misty sigil
#

client.guilds.cache.size

#

ae

open rune
#

I am using it lol

misty sigil
#

no

open rune
#

old one used only client.guilds.size

#

without caching, probably

misty sigil
#

dont use both discordio and discordjs. why?
1 - it will use more ram, cpu, and other shit

eternal osprey
#

i still have nothing showing

#
      console.log('Ready')
      client.user.setPresence(` Playing with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
       
});```
misty sigil
#

lets see your code

#

i think its too long

open rune
#

yes, I am still seeking commands for statuses, I am using IO temporarily

misty sigil
#

no need for the playing with thats put in automatically iirc

restive furnace
#
  1. dont copy paste
  2. use latest versions of the packages
  3. look the docs before asking from others
  4. don't spoonfeed.
orchid pasture
#

// Set the client user's presence
client.user.setPresence({ activity: { name: `Playing with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.` }, status: 'idle' })
  .then(console.log)
  .catch(console.error);
#

try it

misty sigil
#

spoonfeed spoonfeed spoonfeed🥄🥣

orchid pasture
#

🥄🥄🥄🥄🥄🥄

eternal osprey
#

ClientPresence {userID: null, guild: null, status: 'idle', activities: Array(1), clientStatus: null}

orchid pasture
#

and then

eternal osprey
#

how do i fixx this null error?

misty sigil
#

is it in the ready event

#

it has to be in the ready event

#

lmao

eternal osprey
#
client.on("ready", () => {

client.user.setPresence({ activity: { name: `Playing with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.` }, status: 'idle' })
.then(console.log)
.catch(console.error);
       
});```
warm marsh
#

It doesn't have to be in the ready event, just the client requires to be connected to the gateway prior to that method.

open rune
#

is there any error log?

eternal osprey
#

Debugger attached.
ClientPresence {userID: null, guild: null, status: 'idle', activities: Array(1), clientStatus: null}
<node_internals>/internal/process/task_queues.js:97
activities:(1) [Activity]
client:Client {_events: {…}, _eventsCount: 2, _maxListeners: undefined, _timeouts: Set(1), _intervals: Set(2)}
clientStatus:null
guild:null
get member:ƒ member() {\n return this.guild.members.cache.get(this.userID) || null;\n }
status:'idle'

open rune
#

if you can set it for your bot, I swear I will copypaste the latest quoted code

eternal osprey
#

it is null, idk how to change that tbh

restive furnace
#
(@-€;!"?*+#+/ sPoonFeed
ClIEnT......usER.....sEtPreSence({name: true + true, url: null, type: 69})
eternal osprey
#

i am not stupid you fucking morron

#

i am just asking questions

orchid pasture
#

ahahaha

eternal osprey
#

that i cannot find answers on

restive furnace
#

if you can set it for your bot, I swear I will copypaste the latest quoted code
i answered to this question....

orchid pasture
#

well lets chage to set activity

eternal osprey
#

if you can't help and can't resist fucking around

#

don't even reply

#

it is not like they write my whole code

#

this is only the fucking presence i am stuck at

orchid pasture
#
client.user.setActivity(`on with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`, { type: 'WATCHING' })
  .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
  .catch(console.error);
restive furnace
#
client.user.setPresence({name: "something"}) // type & url, status exists too.```
try this snippet
eternal osprey
#

@orchid pasture still gives me undefined

#

Activity set to on with undefined users, in undefined channels of undefined guilds.

open rune
#
client.user.setPresence({ game: { name: 'with discord.js' }, status: 'idle' })

I got this from stackoverflow

jovial nexus
#

Does someone know to do that when you make an update to the code in github the server downloads it and restart the bot with the new code? automaticly

warm marsh
#

Awesome what version of DJS are you using?

eternal osprey
#

v12.18.3

warm marsh
#

In v12 setPresence uses:

{ 
  activity: 
  { 
    name: str 
  }, 
  status: 'idle' 
}```
 as it's options
eternal osprey
#

hmm

#

the bot's presence works

#

still undefined tho

warm marsh
#

Undefined where?

eternal osprey
#

i fixed it

#

i had to use .cache

warm marsh
#

Make sense.

#

So it's working?

ember ibex
#

would this code be fine if it's sending 1 message in 1 channel per server that enabled the feature?

await Promise.all(channelList.map(channel => channel.send('foo')));
sick cloud
#

best just to avoid mass sending all together

#

you can still get flagged on the api

ember ibex
#

kinda not possible since the server subscribes to livestreams GWseremePeepoThink

#

but I at least wanna slow it down

olive swallow
#

my quick.db is not downloading what to do?

fringe axle
#

Downloading?

#

You mean NPM?

olive swallow
#

yes

fringe axle
#

Error?

olive swallow
#

Wait i send you a picture

#

ho

#

forget abuot this

#

i download

#

🙂

blissful tinsel
#

i try to make code for commands it worked before i added second command what should i do here is script

#

const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = '!';

client.once('ready', () => {
console.log('DarkTardis status - online');
});

client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

if(command === 'help'){
    message.channel.send('!help: shows commands and features.');
    message.channel.send('!version: shows versions of bot.');
    message.channel.send('more features soon....');
}

{  if(command == 'version'){
    message.channel.send('My version is 1.0.0');

};

client.login

#

here error

#

C:\Users\artur\DiscordBot\Main.js:30
client.login('NzQzOTM0Mjc1MjM3NDQ1NzUy.Xzb4yA.3rWHe_8NlfAwylE-mrQbvgcwhR4');

SyntaxError: Unexpected end of input
 at wrapSafe (internal/modules/cjs/loader.js:1053:16)
 at Module._compile (internal/modules/cjs/loader.js:1101:27)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
 at Module.load (internal/modules/cjs/loader.js:985:32)
 at Function.Module._load (internal/modules/cjs/loader.js:878:14)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 at internal/main/run_main_module.js:17:47

#

false alarm

#

i got something from discord system

#

someone tried to take my token

ember ibex
#

delete

#

well you posted your token

blissful tinsel
#

i?

#

where

hollow saddle
ember ibex
blissful tinsel
#

where it is

#

ok regenarated

hollow saddle
#
  1. Use codeblocks
  2. You have an extra bracket right before your second if statement
blissful tinsel
#

ok sorry

#

just im beginner started yesterday

hollow saddle
#

No worries, just... never share your token again

blissful tinsel
#

kk

finite bough
#

in the guildMemberAdd event how many roles can the bot add to the member before it reaches the rate limit

misty sigil
#

i dont think you should be making a bot if you just started coding yesterday but

earnest phoenix
#

LoL

#

make some website first

#

learn HTMl and css then Javascript

#

@pale vessel i figured out the canvas package thingy you told me about (it's literally just the HTML canvas) but I don't get how I can send the image generated through the bot
I can use fs to write a test file but that'll take a lot of storage space if multiple people use it at the same time

#

then u will get better

finite bough
#

u buffer the image

#

and then send it as an attachment

earnest phoenix
patent geyser
#

so basically I'm having trouble making my prefix case sensitive in discord.js

#

I've tried a lot of things but if anyone knows how they do it

earnest phoenix
#

@earnest phoenix don't flex with ur NITRO

#

smh

misty sigil
#

const attachment = new Discord.MessageAttachment(ctx.toBuffer(), "image.png")

#

I've tried a lot of things but if anyone knows how they do it
@patent geyser just .toLowerCase()

patent geyser
#

oh damnn i put toLowercase

blissful tinsel
#

i still have error help

earnest phoenix
#

const attachment = new Discord.MessageAttachment(ctx.toBuffer(), "image.png")
@misty sigil uhhh spoonfeed but thanks

misty sigil
#

nice

#

another token

blissful tinsel
#

i forgot

earnest phoenix
#

Copied message

#

Muahahahha

blissful tinsel
#

ooops

earnest phoenix
#

LoL

blissful tinsel
#

i regenerated

north bobcat
#

Kurdy tyaya

misty sigil
#

this is why you dont make a bot if you dont know how to code

north bobcat
#

Kurdakan awa chya

misty sigil
earnest phoenix
#

@north bobcat English pls

north bobcat
#

@earnest phoenix iam kurdish

misty sigil
#

@blissful tinsel show code in a hastebin

#

dont spam chat pls ty

earnest phoenix
#

me ?

#

im spamming

blissful tinsel
#

ok sorry

#

i forgot

#

that there was token

misty sigil
#

no

#

you post a token again and im out

blissful tinsel
#

sry

patent geyser
#

hold up

#

so i changed the "toLowercase()" to "toLowerCase"

misty sigil
#

its str.toLowerCase()

patent geyser
#

o h

#

i see

misty sigil
patent geyser
#

okay

granite echo
#

how would i add a role to a bot on join?

#

i completely forgot

misty sigil
#

guildMemberAdd?

granite echo
#

yes ive got that, but im stuck with how to add the role

#

???

patent geyser
granite echo
#

str is not defined

#

maybe you should learn JavaScript basics before continuing

blissful tinsel
#

i have error here C:\Users\artur\DiscordBot\Main.js:32
};

SyntaxError: Unexpected end of input
 at wrapSafe (internal/modules/cjs/loader.js:1053:16)
 at Module._compile (internal/modules/cjs/loader.js:1101:27)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
 at Module.load (internal/modules/cjs/loader.js:985:32)
 at Function.Module._load (internal/modules/cjs/loader.js:878:14)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 at internal/main/run_main_module.js:17:47

#

here is script

granite echo
#

code blocks exist

blissful tinsel
#

const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = '!';

client.once('ready', () => {
console.log('DarkTardis status - online');
});

client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

if(command === 'help'){
    message.channel.send('!help: shows commands and features.');
    message.channel.send('!version: shows versions of bot.');
    message.channel.send('more features soon....');


 if(command ==+ 'version'){
    message.channel.send('My version is 1.0.0');

client.login

granite echo
#

...

#

@glad charm

glad charm
#

?

granite echo
#

is it a rule to put code in an codeblock?

glad charm
#

No?

granite echo
#

if not can it be made a rule that code over 10 lines is put in a hastebin or something

blissful tinsel
#

....

patent geyser
#

maybe you should learn JavaScript basics before continuing
@granite echo I forgot to define str whilst typing the code
thank you for being so welcoming to new javascript users

gritty bolt
#

ReferenceError: messageReminderModel is not defined
even though i did

global.messageReminderModel```
#

i need to use this variable in another function, so how do I go about doing this?

granite echo
#

ofc @patent geyser

#

@gritty bolt whats the code

#

liek the code ur trying to do

gritty bolt
#
await messageReminderModel.find({}).forEach(data => {```
granite echo
#

hmmm, ive never really used messageReminderModel so i cant help sry

gritty bolt
#

thats the name of my variable

#

i just need to know how to make it usable in another function

quartz kindle
#

If you do global.bla = 10

#

The you also need to use it as global.bla

dreamy thistle
#

Maybe a newbie ask, but whatever.

How do you detect if an user is on a voice channel (message author)

quartz kindle
#

Check if message.member.voice exists and then check if it has a channel: message.member.voice.channel

dreamy thistle
#

Okay, i wanted to make a command that mutes in the server all user that are on the same chat with you

#

(not for play among us, btw)

blissful tinsel
#

what should i do with this error C:\Users\artur\DiscordBot>node .
C:\Users\artur\DiscordBot\Main.js:32
};

SyntaxError: Unexpected end of input
 at wrapSafe (internal/modules/cjs/loader.js:1053:16)
 at Module._compile (internal/modules/cjs/loader.js:1101:27)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
 at Module.load (internal/modules/cjs/loader.js:985:32)
 at Function.Module._load (internal/modules/cjs/loader.js:878:14)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
 at internal/main/run_main_module.js:17:47

granite echo
#

no

blissful tinsel
#

?

#

idk how to make code blocks

#

or script blocks

quartz kindle
#

That error means you have incorrect brackets somewhere

granite echo
#

o wrong channel no its no u, i mistyped

blissful tinsel
#

oh and here is code

#

const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = '!';

client.once('ready', () => {
console.log('DarkTardis status - online');
});

client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

if(command === 'help'){
    message.channel.send('!help: shows commands and features.');
    message.channel.send('!version: shows versions of bot.');
    message.channel.send('more features soon....');


 if(command ==+ 'version')
    message.channel.send('My version is 1.0.0');

client.login('');

};

granite echo
#

btw for code blocks you add these at the start and end ```

quartz kindle
#

Your ending bracket is the closing bracket for the if command === help

blissful tinsel
#

kk'

granite echo
#

aka backticks

quartz kindle
#

Which leaves the message event open

blissful tinsel
#

kk

quartz kindle
#

Also client.login should be standalone, not inside any code block

#

What... No...

granite echo
#

ye

#

s

#

actuall

#

y

#

the <>'s are on purpous im not gonna give code that they dont need to work out a lil

quartz kindle
#

You closed the message event prematurely, leaving all code afterwards invalid

granite echo
#

o i didn't even see that, one sec

dreamy thistle
#

Okay, i made this

-mute all -
} else { message.reply('You need to join a voice channel first!'); }```
#

If someone knows how to mute i will appreciate

granite echo
#
const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = '!';

client.once('ready', () => {
    console.log('DarkTardis status - online');
});


client.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();

    if (command === 'help') {
        message.channel.send('!help: shows commands and features.');
        message.channel.send('!version: shows versions of bot.');
        message.channel.send('more features soon....');


        if (command == + 'version')
            message.channel.send('My version is 1.0.0');
    }
})
<client>.login('');

@blissful tinsel

#

@dreamy thistle by learning the basics of js

#

here

dreamy thistle
#

XD okay dude

granite echo
#

they go oever voice

#

iirc

quartz kindle
#

The version command is out of place

granite echo
#

out of place in what way

quartz kindle
#

Its inside the help command

granite echo
#

maybe he wants it like that

#

¯_(ツ)_/¯

quartz kindle
#

Then it will never work lol

granite echo
#

how would i add a role to a bot on join?, i completely forgot and cant find it anywhere cuz my wifi sucks

#

i have guildMemberAdd just stuck on the adding role

dreamy thistle
#

If guildmemberadd === bot .then

#

I think it should work

granite echo
#
client.on("guildMemberAdd", member => {
    client.roles.cache.get('752135362947842140')
})

i mean something like this

eager iron
#

m.help

granite echo
quartz kindle
#

member.roles.add(role)