#development

1 messages Β· Page 1099 of 1

mild flower
#

this is happening

robust arrow
#

|| instead of &&

mild flower
#

ok

slender thistle
#

admin permission guarantees MANAGE_ROLES to be given so what's the point in checking for admin anyway

mild flower
#

that doesnt change the issue tho

#

that doesnt matter

#

stop nagging on that

#

:(

#

this is the problem

#

when i mention a non role it does this

misty sigil
#

well check if its a role shrug

earnest phoenix
#

You typed in a command role lmao, not mentioned
so args[1] is a string
It has no id

#

Use !rperson.roles.cache.has(rmentioned.id)

mild flower
#

k

misty sigil
#

args[1] isn't a mention

#

you'd have to fetch/get it

mild flower
#

wait

#

oh ok

#

what should i use then

misty sigil
#

only message.mentions.roles.first()

earnest phoenix
#

Use message.guild.roles.cache.find(role => role.name == args[1])

#

To get role

restive willow
#

anyone have a bot idea that they need help making hmu i need something to do

misty sigil
#

Wouldn't all roles needa be cached

#

for that to work?

#

or are all roles cached as default?

earnest phoenix
#

Wouldn't all roles needa be cached
@misty sigil Then you need to type id and use await message.guild.roles.fetch('id')

#

or are all roles cached as default?
@misty sigil idk

mild flower
#

Cannot read property 'send' of undefined

#

error after error

earnest phoenix
#

Give full error

#

at least we must know where error occurred

#

To help you

mild flower
#

here is the current command

#

`` if(message.guild.roles.cache.has(rmentioned.id)) return message.channnel.send('Please choose a valid role');
^

TypeError: Cannot read property 'send' of undefined``

misty sigil
#

message.channel is undefined

#

anyways

#

anyone got docs on the new Discord.Client(); options?

finite bough
#

as roles can have spaces

#

u can add

earnest phoenix
#

anyone got docs on the new Discord.Client(); options?
@misty sigil https://discord.js.org/#/docs/main/stable/typedef/ClientOptions ?

finite bough
#

r.name== args.slice(1).join(" ")

mild flower
#

well it worked

#

but wut

#

; wont wrk

misty sigil
#

ty

earnest phoenix
#

3 n

#

`` if(message.guild.roles.cache.has(rmentioned.id)) return message.channnel.send('Please choose a valid role');
^

TypeError: Cannot read property 'send' of undefined``
@mild flower

misty sigil
#

nn

#

not nnn

pure lion
#

Nnnnnnnnnnn

earnest phoenix
#

ejs Thonk

sick sandal
#

How to seacrh music? Anyone can explain

earnest phoenix
#

Theres lot of modules can help you

sick sandal
#

Ouh okay tq

nocturne grove
#

Is there a way to search text in strings only in VSC? I want to replace id with ID in all the strings my bot uses

pure lion
#

I want to align a table to the center (html) but it's not moving

restive furnace
#

Is there a way to search text in strings only in VSC? I want to replace id with ID in all the strings my bot uses
@nocturne grove ctrl+ h

nocturne grove
#

in strings only

faint prism
#

Oh neat. It drops down the replace

#

You can use regex

nocturne grove
#

so not the id in const channel = guild.channels.cache.get(id) for example

faint prism
#

or include the '' or ""

#

(id) -> (ID)

nocturne grove
#

idk how to use regex and I don't know if that will work if you look for id inbetween ', as it can also be in between two strings then I think

faint prism
#

Well you usually don't need to whip out regex

violet nimbus
sinful belfry
#

you're requiring a file that doesn't exist at that location

violet nimbus
#

it does

sinful belfry
#

check ur filepath is correct

nocturne grove
#

thanks for that website but still a huge ? for me

violet nimbus
#

isnt it fine?

sinful belfry
#

can u show a screenshot which also shows the file where you are requiring ping.js

violet nimbus
#

im not requiring it

#

wait

modest dagger
#

Hey quick question, what is the permission number for both administrator and audit log

violet nimbus
#
fs.readdirSync("./commands/").forEach(dir => {
    const commands = fs.readdirSync(`./commands/${dir}`).filter(file =>
      file.endsWith(".js")
    );```
modest dagger
#

?

mild flower
#

I fixed it

violet nimbus
#

@sinful belfry

mild flower
#

But code looks nooby noe

misty sigil
#

anyone know how I can delete only one segment of the document mongodb

mild flower
#

I just copy pasted it to .then

sinful belfry
#

@violet nimbus where is the file that that code is in tho?

violet nimbus
#

handlers/cmd.js

#

and other is commands/info/ping.js

sinful belfry
#

@violet nimbus would you mind sending a screenshot?

modest dagger
#

thnks

sinful belfry
#

@misty sigil as in like only a certain field?

misty sigil
#

yes

pure lion
#

aaaaaaa my dashboard is finally done

violet nimbus
pure lion
#

strange

sinful belfry
#

@misty sigil you can just set that field to undefined

#

there is probs a better way to do it lol

misty sigil
#

that just deletes it right?

sinful belfry
#

yeah

violet nimbus
#

starman?

sinful belfry
#

@violet nimbus i think you've got your relative file paths a little wrong

faint prism
#

Man I love namespaces lol

violet nimbus
#

hmm?

faint prism
#

All this directory traversal must be a hassle

sinful belfry
#

to get to the info/ folder, you'll need to do ../commands/info/

violet nimbus
#

whats the solution

sinful belfry
#

try that

violet nimbus
#

wait

#
    throw err;
    ^
Error: ENOENT: no such file or directory, scandir '../commands/'
    at Object.readdirSync (fs.js:812:3)
#

hmm

faint prism
#

Can you give a tree output for the root project dir?

violet nimbus
#

wait

#

tree is not a command in glitch

pure lion
#

t r e e

tight plinth
faint prism
#

no, it's a terminal command

violet nimbus
#

ik

marble loom
#

d

sinful belfry
#

ah sorry

#

the readdir does it from your root folder im pretty sure

#

so use process.cwd() to get to your project folder

#

you can do process.cwd()/commands/ i think

midnight blaze
#

How would you access the information, I have mareked.

Timeout {
  _idleTimeout: 3000,
  _idlePrev: [TimersList],
  _idleNext: [Timeout],
  _idleStart: 9675,
  _onTimeout: [Function],
  _timerArgs: undefined,
  _repeat: null,
  _destroyed: false,
  [Symbol(refed)]: true,
  [Symbol(asyncId)]: 6774,   //// how to access this? :thinking:
  [Symbol(triggerId)]: 37
}

I want to console.log -> 6774

sinful belfry
#

you can do process.cwd()/commands/ i think
assuming the /commands/ folder is in the same place as your index.js/ main file

violet nimbus
#

@sinful belfry ty it works

midnight blaze
#

thanks

earnest phoenix
#

How can i remove all reactions in v11?

#

I forgot pepowot

sinful belfry
#

.clearReactions()

earnest phoenix
#

thanks

pure lion
#

W3schools

queen moss
#

Udemy

#

Get a cheap course there for 10, 12 bucks

digital ibex
#

sololearn

#

sololearn is free and rly good

tight plinth
#

same result

#

returns Promise { false }

digital ibex
#

just do

#

try anyways

#

message.guild.me.voice.setSelfDeaf(true) assuming message.guild.me is still a thing in d.js

tight plinth
#

hm

digital ibex
#

oh

tight plinth
#

same result

digital ibex
#

just await it

tight plinth
#

nope

#

does nothing

digital ibex
#

1 sec

pure lion
#

Omg lumap got green'd

digital ibex
#

try this: message.guild.me.voice.setDeaf(true)

#

also, it could be because your bot doesnt have permissions

earnest phoenix
#

omg

digital ibex
#

wait no idk

tight plinth
#

im literally trying here

pale vessel
#

uh permission to what?

earnest phoenix
#

lumap got green

#

holy shit

#

i am proud

pale vessel
digital ibex
#

oh im retarded

earnest phoenix
#

@digital ibex selfDeaf doesn't require perm

tight plinth
#

nope

earnest phoenix
#

serverDeaf is

pale vessel
#

he knows

#

he realized

digital ibex
#

yeah

earnest phoenix
#

it's fine

#

i am a retard sometimes too

#

there's one time i remember login as connect lol

pale vessel
#

eris moment

digital ibex
#

i wonder if anyone has switched from eris to d.js πŸ€”

pale vessel
#

i did

digital ibex
#

stupid thing to do but shrug

tight plinth
#

@quartz kindle hi, just to be sure: does discord.js-light have any issue with the setSelfDeaf function? it always fails for me

digital ibex
#

oh

#

.............

pale vessel
#

disconnect errors

digital ibex
#

i'd just use my own fork then

pale vessel
#

good for you

digital ibex
#

i've never had any problems with eris disconnecting me \🀑

pale vessel
#

okay

summer torrent
tight plinth
#

@summer torrent you have to use the terminal

summer torrent
#

what

#

oh wait

#

im on remote host

lethal pasture
#

`let nordembed = new Discord.RichEmbed()
^

TypeError: Discord.RichEmbed is not a constructor`

digital ibex
#

its something like: git config --user.name 'ur name' (prob not, im double checking)

summer torrent
#

ik

#

I have to configure that on my vps

#

done

digital ibex
#

ah it- oh noice

lethal pasture
#

`let nordembed = new Discord.RichEmbed()
^

TypeError: Discord.RichEmbed is not a constructor`
Anyone know?

#

huh?

#

MessageEmbed in v12
@earnest phoenix Talking to me?

digital ibex
#
- RichEmbed
+ MessageEmbed```
lethal pasture
#

Ah ok

golden bear
#

I was trying to make a command work but is still not working

lethal pasture
#

Yup lmao

#

ty

digital ibex
#

what do u mean its not working?

golden bear
#

I was make command is call !ping when I typing in my test server is not working

digital ibex
#

what do you mean its not working?

lethal pasture
#

what !ping then it responds with pong?

golden bear
#

@lethal pasture yes

lethal pasture
#

thats easy.

golden bear
#

But is not working

golden bear
#

Who?

lethal pasture
#

`if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
^

TypeError [INVALID_TYPE]: Supplied options is not an object.`

golden bear
#

I change it to !

#

Perfix !

lethal pasture
#

message.channel.send("pong")

#

I think

golden bear
#

But is still not working

queen moss
#

Its MessageEmbed

#

Not RichEmbed

#

new Discord.MessageEmbed()

digital ibex
#

are you getting any errors?

golden bear
#

Oh thank you!

#

@digital ibex no not yet

lethal pasture
#

new Discord.MessageEmbed()
@queen moss who?

digital ibex
#

idk if im missing something, but is ur bot online?

golden bear
#

Yes

digital ibex
#

if the message event, console.log(message.content)

#

see if it logs

lethal pasture
#

`if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
^

TypeError [INVALID_TYPE]: Supplied options is not an object.` Now this error happens.

digital ibex
#

code?

golden bear
#

Hmm

sullen harness
jolly quail
#

Massage lol

golden bear
#

Yes

lethal pasture
#

client.on('message', message => { if (message.content.startsWith(${prefix}random` )) {
if(message.channel.type == 'text') {
let accounts = ["1", "2", "3"]

        let result = Math.floor((Math.random() * accounts.length))

        let nordembed = new Discord.MessageEmbed()
        .setTitle("Your Code:")
        .setAuthor("Zer0 Generator")
        .setColor("#00421fe")
        .addField("-================-", accounts[result])
        .setTimestamp()
        .setThumbnail('link')
        .setImage("link")

    message.author.send(nordembed)
    message.delete(10000)
    message.channel.send("Code Sent To DM's!")
    .then(message => {
        message.delete(10000)
   
    })
    .catch()
    }
}

if (message.channel.type == 'dm') {
    message.author.send("This is prevented to remove exploits")
    .then(message => {
        message.delete(10000)
        })
        return; 
}

})`

digital ibex
#

oh lol

#

moyai moment

lethal pasture
#

if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
^

TypeError [INVALID_TYPE]: Supplied options is not an object.

digital ibex
#

can u delete that pls

lethal pasture
#

which?

digital ibex
#

and show the code where its erroring

#

nvm

lethal pasture
#

its not erroring

digital ibex
#

not the whole thing

#

what

lethal pasture
#

there is no errors but when I start it says that

digital ibex
#

send the full error

lethal pasture
#

Eh?

#

Oh

#

C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\structures\Message.js:501
if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
^

TypeError [INVALID_TYPE]: Supplied options is not an object.
at Message.delete (C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\structures\Message.js:501:44)
at Client.<anonymous> (C:\Users\jayde\Desktop\Commands\index.js:25:23)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (C:\Users\jayde\Desktop\Commands\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (C:\Users\jayde\Desktop\Commands\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20) {
[Symbol(code)]: 'INVALID_TYPE'
}

#

That?

digital ibex
#

yes

lethal pasture
#

ok

digital ibex
#

now send line 25 in index.js

lethal pasture
#

So just line 25?

digital ibex
#

yes

lethal pasture
#

message.delete(10000)

digital ibex
#

are you using v12?

lethal pasture
#

I think so.

stable nimbus
#

Go to your package and look.

digital ibex
#

its just

stable nimbus
#

package.json

delicate shore
#

@golden bear code lyon?

solemn latch
#

10,000 deletes?

golden bear
#

@delicate shore is working now

lethal pasture
#

yes v12.2.0

digital ibex
#

message.delete({ timeout: 1000 }); also, read the docs pls

#

lol

queen moss
#

This channel hurts my brain 95% of the time

delicate shore
#

ok

digital ibex
#

99% 4 me

queen moss
#

"Lemme make a bot but not have any coding experience"

delicate shore
stable nimbus
#

I did that and look at where I got. Pretty successful after I started figuring things out.

digital ibex
#

same

delicate shore
#

yes

#

same

digital ibex
#

i hope i am successful anyways 😳

golden bear
#

Bot need some milk

#

Xd

delicate shore
#

when i firs joined this server

#

i asked for codes

#

alwasy

#

always

#

and everyone said me

golden bear
#

Why tho

delicate shore
#

No spoonfeed

digital ibex
#

moyai

delicate shore
#

Why tho
@golden bear i dind't knew anything about coding

stable nimbus
#

Yeah we don’t spoonfeed code here

digital ibex
#

is this like a therapy session lmfao

winter basalt
#

i mean the rules says no spoonfeeding

stable nimbus
#

I wonder what this turned into

golden bear
#

@delicate shore sad

digital ibex
#

therapy session

#

4 bot devs

delicate shore
golden bear
#

So how can I get bot in here?

delicate shore
#

my first msg

#

heree

stable nimbus
#

I knew bits of coding off the top of my head.

earnest phoenix
#

you know

#

So how can I get bot in here?
@golden bear add your bot to top.gg

#

a channel for questions

golden bear
#

@earnest phoenix okay thanks for help

stable nimbus
#

How to get the bot online and a couple commands.

solemn latch
#

Honestly, if all your experience is bots, your likly missing a whole lot about how to program

digital ibex
#

idk

stable nimbus
#

There is so much more to it that I’m actually exploring.

solemn latch
#

^

digital ibex
#

i've got experience outside of bots too, i just started coding by making bots

earnest phoenix
#

people like that do not know how to program, they learned how to do something in a specific way and only do it like that, woo

#

if you gave them a problem, e.g create a certain algorithm, they probably wouldn't know how to do it

golden condor
#

i've got experience outside of bots too, i just started coding by making bots
@digital ibex same

delicate shore
#

omg

#

i just checked my oldest messages

#

and it is just m

#

me

#

saying when my bot will be accepted

lethal pasture
#

I know I probably annoyed u that I have no experience but now the command is working ty

digital ibex
#

its all good πŸ‘

stable nimbus
#

I’m starting to look into video game development right now for the McDonalds franchise.

delicate shore
#

😐

digital ibex
#

i wanna get into game dev

#

but i just cant be bothered cuz i cant install VS

stable nimbus
#

?

digital ibex
#

i mean i can, idk how to set it up properly

stable nimbus
#

Visual Studio Code?

digital ibex
#

visual studio

golden condor
#

Visual studio

stable nimbus
#

Oh.

golden condor
#

but i just cant be bothered cuz i cant install VS
@digital ibex the install process is so annoying

#

And it takes ahes

digital ibex
#

yeah

#

idk what language to make it in either, i've never got passed the language part kek

golden bear
#

English

golden condor
#

Programming language you sppon

winter basalt
#

Programming language you sppon

earnest phoenix
#

@gilded plank

quartz kindle
#

@tight plinth just tested here and it worked (v3.1.0)

tight plinth
#

I'm using v2

#

maybe that's why

lyric mountain
narrow eagle
#

When I run this code, I get and error saying message is not defined on line 63 (the 1st one with message.channel.send)

I'm guessing I need to define message somewhere, but where do I do it?

#

can someone ping me when they reply please πŸ™‚

lyric mountain
#

is that even defined?

#

like, why are your even awaiting above when you're not using the returned value?

quartz kindle
#

you are working inside a reactionAdd event, there is no message given in this context

#

you need to get the message from the reaction object

narrow eagle
#

it's defined earlier in the code, using sqlite. It's the name of my tag
So if messageReactionAdd doesn't have a message event, is there another way for my bot to send a message when a reaction is added?

quartz kindle
#

you get the message from the reaction object

lyric mountain
#

back to my second question:

like, why are your even awaiting above when you're not using the returned value?

narrow eagle
#

I'm slightly confused on await/async, I just add them lol.
I'm googling stuff as I go to learn, I guess I thought I always needed await

lyric mountain
#

async is basically a task that will be executed parallel to other stuff

quartz kindle
#

the thing is that you're using findOne() which indicates you want to find something, but you dont assign the found item to anything

#

so whatever it finds, is not being used anywhere, the found item is just being ignored

lyric mountain
#

await will transform an async task in a sync one

#

and return the value

narrow eagle
#

ok so sync = simultaneous, async = one after the other?

lyric mountain
#

sorry, I can't write properly with a mouse

quartz kindle
#

its the opposite

#

sync is one after the other, async is simultaneous

narrow eagle
#

ok

#

so I need to find a tag, and then if the tag is found do stuff, meaning I need sync?

lyric mountain
#

you just need to assign the returned value to a variable

narrow eagle
#

and being in an async function, don't I need await to make it sync? Or am I confusing myself here

lyric mountain
#

and see if that variable has a value

narrow eagle
#

O.O

quartz kindle
#

first, check with the database you're using, what is the return value for findOne(). if the return value is a Promise, then you have to use the await keyword. if the return value is not a Promise, then you dont need the await keyword

lyric mountain
#
let hasValue = await someAsyncTask()
if (hasValue) {
  //doSomething
} else {
  //elseDoThis
}
quartz kindle
#

second, with or without await, you need to give the return value to something, for example let a = await findOne() instead of await findOne()

#

generally speaking, always check the documentation for whatever you are using, and if the docs say that it returns a Promise, then it means you need to use either await or .then(), otherwise you dont need to do anything special

narrow eagle
#

okay thanks, I get that. Just changed the code
let variable = await findingTag
if (variable isn't undefined) {send a message}
else {send a different message}

I still have an issue with sending a message, you said I need yo use the reaction object, I'll look that up and try to figure it out.

Also that tip on checking the documentation should come in handy, ty for that πŸ™‚

earnest phoenix
sudden geyser
#

what isn't working. Do you know the issue?

earnest phoenix
#

ive looked around in the api docs and i cant seem to figure out why

slender thistle
#

what the fuck

#

why the webhook

stable grail
#
client_session: <aiohttp.client.ClientSession object at 0x000001D67FF8F488>``` what does this mean wtf
lyric mountain
#

you forgot to close the client session

stable grail
#

wdym

slender thistle
#

an unclosed aiohttp client session

lyric mountain
#

you're supposed to close streams/clients after you've used them

stable grail
#

weird it was working fine last week

slender thistle
#

context managers are the way

earnest phoenix
#

why the webhook
what should i put instead?

polar aurora
#

TΓΌrk Olan

inland aurora
#

If I make a music bot will it work in multiple servers at the same time?

lusty quest
#

it should

inland aurora
#

but like its gonna be pretty simple though

lusty quest
#

(only a few Libaries doesnt support this)

#

depends on how good you are in your selected language

inland aurora
#
const fs = require('fs');

const broadcast = client.voice.createBroadcast();

// From a path
broadcast.play('audio.mp3');
// From a ReadableStream
broadcast.play(fs.createReadStream('audio.mp3'));
// From a URL
broadcast.play('http://myserver.com/audio.aac');
#

this

#

basically

#

will it mess up if its used in two servers at the same time?

lusty quest
#

i think there is a tutorial on this in the discord.js guide

inland aurora
#

yeah thats where the codes from, but I mean If i use the command in 1 server and another at the same time, will the bot work yk

crimson vapor
summer torrent
tight plinth
#

it works for me with ./

summer torrent
#

./src/config.js ?

tight plinth
#

ye

#

and try restarting vscode

hardy steeple
#

hmm

#

im tryna see here

#

i like using js

#

should i use eris?

#

rather than discord .js

summer torrent
#

discord.js best

hardy steeple
#

ive heard otherwise

#

but idk

tight plinth
#

eris is a bit better in term of optimization but dont use it if you dont need to

hardy steeple
#

discord.js works fine for me and also has much more open tutorials so i think ill stick with it for the bot im currently developing

#

im new to this so im gonna be coming back here and asking questions that are probably obvious for you

#

wait

#

i made a profile command that shows an embed with your name and pfp

#

id like to make it so that you can ask for others profiles too

sudden geyser
#

If you're new and just want your bot to work with a lot of support, Discord.js will help you in the early days. If you care more about optimization and can get down to do some of the work Discord.js makes easier (which Eris doesn't have), use Eris.

delicate shore
#

Like there is a guild join member listener

#

Is there any for one

#

In which bot gets added

#

Then it sends a message to a channel in my server

#

Saying I Joined Server Name

hardy steeple
#

y know how you can do like message.author.displayAvatarURL

#

im wondering, how do you replace author so that it shows a member other than the authors pfp?

#

would you just put the username?

#

like message.(insert username here).displayAvatarURL

delicate shore
#

Easy

#

Define member

hardy steeple
#

yeah sorry im new

delicate shore
#

It's ok

#

let member = anything
message.member.blah

#

And message will not come

#

Or will it

#

Hmm

#

Wait

hardy steeple
#

in anything would you put the username or id or what

#

reset the token

earnest phoenix
#

@earnest phoenix AAAAA GLITCH

celest schooner
#

ur running it twice

hardy steeple
#

its a common error that happens when you make too many edits to the bot without changing the token

earnest phoenix
#

Huh

#

Oh

hardy steeple
#

go to dev portal click regenerate copy and put the new token into your bots code and rerun it

#

if that doesnt work idk

earnest phoenix
#

So it's logged in from a lot of locations

celest schooner
#

Yes your running it twice

#

Also why is your message event inside ur memeberAdd event

lyric mountain
#

btw, glitch won't host ur bot for more than 15 minutes

bright dove
#

not how that works

lyric mountain
#

ah, ok then

delicate shore
#

@hardy steeplean example

    let user = msg.mentions.users.first();
      .setThumbnail(`${user.displayAvatarURL()}`)
celest schooner
#

m8 says not in glitch when it’s light theme and uses cdn.glitch

lyric mountain
#

hm, true

delicate shore
#

I use glitch

celest schooner
#

alright but ur running ur bot from two locations

delicate shore
#

but it is bitch

hardy steeple
#

oop

celest schooner
#

You can’t use glitch for discord bots anymore

delicate shore
#

so i a shifting

#

to DO

#

from next month

celest schooner
#

Because that’s not what is meant for

delicate shore
#

but i pay

#

10$/month

#

to glitch

celest schooner
#

So, how can I solve it.
@earnest phoenix stop one of the processes

delicate shore
#

from last 2 months

lyric mountain
#

dude

#

10$/month to use GLITCH???

#

just buy a vps

celest schooner
#

Glitch has 2 gb of ram with premium

lyric mountain
#

it's cheaper 'n better

bright dove
#

You can’t use glitch for discord bots anymore
@celest schooner works fine for my testing bot (bot I test shit I don't know how to do on before adding to real bot) 🀷

celest schooner
#

it’s pretty worth it tho

lyric mountain
#

2gb is miserable

void vale
#

0$/year I pay for VPS

delicate shore
#

Glitch has 2 gb of ram with premium
@celest schooner yes

#

i use it

celest schooner
#

but it’s 5 projects

delicate shore
#

yes

#

and i run 2

#

of them

celest schooner
#

okay

delicate shore
#

i can host

#

3 more bots

lyric mountain
#

oh my

celest schooner
#

@celest schooner works fine for my testing bot (bot I test shit I don't know how to do on before adding to real bot) 🀷
@bright dove isn’t it easier just to use an ide

bright dove
#

idk what that means so I'm gonna guess not

celest schooner
#

It’s like vscode or atom

inland aurora
#

you know those website embeds that show up when you use a link like youtube.com, how do you set that up for a different site?

bright dove
#

oh well yeah but if your computer is shitty then ur bots speed will be too KEKW

hardy steeple
#

@delicate shore still responds with authors pfp

lyric mountain
celest schooner
#

But you don’t host ur bot on ur computer tho

lyric mountain
#

and it doesn't get nowhere near 10$/month

celest schooner
#

just an example, the cheapest VPS has 4GB ram
@lyric mountain how much is that

bright dove
#

But you don’t host ur bot on ur computer tho
@celest schooner you do when you're poor

inland aurora
#

free ez

lyric mountain
#

see for yourself

bright dove
#

but I'm not even close to publicizing and/or hosting, so it doesn't matter anyway lol

lyric mountain
#

and no, I don't work for contabo

celest schooner
#

@celest schooner you do when you're poor
@bright dove i guess but vps aren’t even that expensive

lyric mountain
#

I just like their services

hardy steeple
#

im gonna stop working on that one for now

celest schooner
#

Oh damn

bright dove
#

bruh this website looks like a virus

celest schooner
#

4 gb for 4 dollars per month

#

damnnn that’s a good deal

lyric mountain
#

yeah, VPSs ain't THAT expensive

celest schooner
#

it’s 3 dollars per month for galaxy gate and 5 for DO

#

And it’s only 1 go

lyric mountain
#

and you get WAY more from it than using paid glitch

hardy steeple
#

hmm

bright dove
#

all of the cheap ones are based halfway across the world though :/

lyric mountain
#

nope

celest schooner
#

ig but glitch has 5 2gb projects

lyric mountain
#

contabo has servers in US now

#

NY iirc

bright dove
#

yeah but they're the expensive ones

lyric mountain
#

nope

celest schooner
#

Isn’t the location like 100ms extra or some thing small like that

hardy steeple
#

im not doing anything with vps until my bot is big enough to need one

bright dove
hardy steeple
#

i mean currently my bot is small and doesnt need one

bright dove
#

I'm literally looking at the website they sent

#

the answer is yes

#

😹

lyric mountain
#

the ones on the left are HDD

hardy steeple
#

well it does theoretically

lyric mountain
#

and the ones on the right ain't much more expensive

hardy steeple
#

but as of right now hosting it on my computer is fine

lyric mountain
#

just a dollar in difference

celest schooner
#

Wait is that a no game no life pfp btw

lyric mountain
#

yep

celest schooner
#

poggers

hardy steeple
#

poggers

sudden geyser
#

ngnl was ok

delicate shore
#

@delicate shore still responds with authors pfp
@hardy steeple did u mention

#

anyone

celest schooner
#

My Mac charger broke and now I have to use my 10 year old laptop

hardy steeple
#

yes

delicate shore
#

code?

hardy steeple
#

like @hardy steeple as the next arg?

#

in the message or code itself

delicate shore
#

like @hardy steeple as the next arg?
@hardy steeple no any args

#

send me code

#

which ya using

lyric mountain
hardy steeple
#

im using d.js

#

case 'profile':
let user = msg.mentions.users.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(message.define)
.setImage(${user.displayAvatarURL()})
message.channel.send(ProfileEmbed)
break;

celest schooner
#

AND YOU GET A MONTH FREE WTFF

#

insane

lyric mountain
#

well, yeah

quartz kindle
#

i get a month free on mine too

#

every year

#

lmao

delicate shore
#

@bright dove not a big difference
@lyric mountain which one is that

celest schooner
#

which do u use

quartz kindle
#

galaxygate

celest schooner
#

ah but that one has 4 gb

quartz kindle
#

depends what for

celest schooner
#

For only 4 dollars

quartz kindle
#

if its related to my projects, sure

lyric mountain
#

@lyric mountain which one is that
@delicate shore that what?

delicate shore
#

@earnest phoenix imagine using POKIMANE as your pfp

quartz kindle
#

if general coding, i prefer it here

delicate shore
#

@delicate shore that what?
@lyric mountain VPS

lyric mountain
#

contabo

delicate shore
#

case 'profile':
let user = msg.mentions.users.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(message.define)
.setImage(${user.displayAvatarURL()})
message.channel.send(ProfileEmbed)
break;
@hardy steeple have u restarted bot

#

i mean saving

#

and then again running

#

because code is correct

#

ok wait

#

what is

hardy steeple
#

ok ill save and run again

#

whoops

delicate shore
#

mhm

hardy steeple
#

its supposed to say message.author.username as of right now

delicate shore
#

op

hardy steeple
#

that gives you authors username

delicate shore
hardy steeple
#

k

delicate shore
#

@hardy steeple ik the problem

#

Change js let user = msg.mentions.users.first();
To js let user = message.mentions.users.first();

earnest phoenix
#

Huh

delicate shore
#

@earnest phoenix he probab;y uses message

earnest phoenix
#

Oh yeah

delicate shore
#

not msg

earnest phoenix
#

An dbye

hardy steeple
#

i do

delicate shore
#

u use

#

msg?

#

or message

hardy steeple
#

message

delicate shore
#

ok @hardy steeple then replace it and tell if it worked

#

dont forget to restart

hardy steeple
#

k

#

hmm

viral iris
#

any1 know how to use canvas can help me ?

hardy steeple
#

in the first line it says there is a problem

#

',' expected

delicate shore
#

hm

#

huh

#

send error line

#

and code

hardy steeple
#

idk how ot crop screenshots

#

gtg

#

thanks for help

delicate shore
#

mention not

#

@hardy steeple send code only

#

here

#

by CTRL C and CTRL V

#

Anyone help

quartz kindle
#

there is guildMemberAdd and guildCreate

#

one is when someone joins a guild your bot is in
the other is when your bot joins a new guild

delicate shore
#

Thanks Tim

#

Event

#

Make a listener

#

For guildMemberAdd

#

And @quartz kindle is there any for bot leave msg ?

#

Like if somoen removes bot

#

Then guildDelete?

#

No

#

I am asking for my bot

#

When bot gets removed

quartz kindle
#

guildDelete yes

digital ibex
#

have you read the docs?

delicate shore
#

Ok thanks

digital ibex
#

it says when ur bot leaves lul

delicate shore
#

have you read the docs?
@digital ibex
Was just confirming

#

@quartz kindle how can i get name

#

of guild

#

that bot joined

quartz kindle
#

guildCreate gives you a guild object

delicate shore
#

ok

#

thanks

#
bot.on('guildCreate',guild  => {
  
   var gild = bot.guilds.find(gi => gi.id === "690557545965813770")
  var chan =  bot.channels.find(channel => channel.id === "738415384511905913")
      chan.send(`Just Got Added in ${guild}`); 
});
#

should this be good?

faint prism
#

inconsistent spacing O_e

delicate shore
#

huh

#

yo @quartz kindle sorry for ping but do we use object using ${} only?

#

or is it different

faint prism
digital ibex
#

???

delicate shore
#

like

digital ibex
#

pls indent ur code too btw

earnest phoenix
#

you will use ```

delicate shore
#

i am using

#
bot.on('guildCreate',guild  => {
  
  var gild = bot.guilds.find(gi => gi.id === "690557545965813770")
  
  var chan =  bot.channels.find(channel => channel.id === "738415384511905913")
  
  chan.send(`Just Got Added in ${guild}`); 
});
#

is it clean now?

faint prism
#

ty πŸ™‚

digital ibex
#

wdym by "do we use object using ${} only?"

delicate shore
#

nothing

#

nvm

#

my brain

#

just

#

had a stroke

faint prism
#

Should the two lines starting with var end with a ;?

earnest phoenix
#
client.on('guildCreate, async guild =>{
client.channels.get('channel id').send(`A New Guild ${guild}`)
})
``` how is it
delicate shore
#

clean

faint prism
#

Not indented

digital ibex
#

^

#

and no semi colon

#

smh

quartz kindle
#

why do you need gild

faint prism
#
client.on('guildCreate, async guild =>{
    client.channels.get('channel id').send(`A New Guild ${guild}`)
});
digital ibex
#
client.on('guildCreate', async guild =>{
  client.channels.get('channel id').send(`A New Guild ${guild}`);
});```
earnest phoenix
#

Should the two lines starting with var end with a ;?
@faint prism lines will start let, var

faint prism
#

Must be a JS thing

delicate shore
earnest phoenix
#

D:

digital ibex
#

use get

quartz kindle
#

why do you need this guild anyway

#

you dont need it at all?

delicate shore
#
client.on('guildCreate', async guild =>{
  client.channels.get('channel id').send(`A New Guild ${guild}`);
});```

@digital ibex i will use this instead tbh

tranquil patrol
#

bot.guilds.cache.find πŸ˜‰

digital ibex
#

and im assuming ur on v12, its .cache

faint prism
#

what, just 2 spaces?

digital ibex
#

its just \t

delicate shore
#

you dont need it at all?
@quartz kindle yeh but i was thinking of another thing but

faint prism
#

\t is subjective to the ide

earnest phoenix
#

is that v11 or v12 ?

digital ibex
#

\t is tab

earnest phoenix
#

module.exports = {
    eventName: "guildMemberUpdate",
    run: async function (bot, oldMember, newMember) {
        if (oldMember.roles.cache.size < newMember.roles.cache.size) {
            let { executor, target, changes}  = (await newMember.guild.fetchAuditLogs({ limit: 1, type: 25 })).entries.first();
            let role = newMember.guild.roles.resolve(changes[0].new[0]);

            if (!whitelist[executor.id]) {
                newMember.roles.remove(role);
                return console.log(`The user: ${executor.tag} tried to give ${role.name} to ${target.tag}`);
            }

            if (whitelist[executor.id] && roles.permissions.has("ADMINISTRATOR")) return console.log(`The user: ${executor.tag} gave a admin role to: ${target.id}`);
        }
    }
}```
#

if v12 this would be client.channels.cache.get

delicate shore
#

client.channels.cache.get?

earnest phoenix
digital ibex
#

yeah

delicate shore
#

ok

#

thanks

faint prism
#

ik what \t is

digital ibex
#

u can also press tab on ur keyboard

faint prism
#

I also know that \x00 is a null byte

digital ibex
#

when im writing in sublime

#

thats what i use to indent my code

#

press tab

#

but in vsc, prettier does it for me 🀑

faint prism
#

I saw that

#

you better indent that boy πŸ˜›

void vale
#

πŸ‘€

earnest phoenix
#

Lmao

faint prism
#

and it was missing a ;

delicate shore
#

my bot

#

did not

#

send

#

message

#

😦

digital ibex
#

?

faint prism
#

use breakpoints

tranquil patrol
#

e.e

earnest phoenix
#

did your bot v11 or v12

delicate shore
#
client.on('guildCreate', async guild =>{
  client.channels.cache.get('738415384511905913').send(`A New Guild ${guild}`);
});
#

v12

digital ibex
#

moyai moment

earnest phoenix
#

try

tranquil patrol
#

errors?

earnest phoenix
digital ibex
#

guild is an object

#

not a string

delicate shore
#

huh

#

op

#

OP

digital ibex
#

you cant send an object

earnest phoenix
#

try guild name is it a function

tranquil patrol
delicate shore
digital ibex
#

it would prob say [object Object] but 🀷

faint prism
#

Wouldn't it just eval to something like guild<0xspotInMemory>?

tight plinth
#

does someone have an idea?

delicate shore
#

did not work

#

😦

digital ibex
#

case sensitive

faint prism
#

does it have a on() function?

tight plinth
#

yes

digital ibex
#

u defined it as Shouakau but u put shouakau

delicate shore
#

me

tranquil patrol
#

?

digital ibex
#

no

faint prism
#

I don't think so

#

he imported it as Shouakau

tranquil patrol
#

yes it's imported at shouwhatever it won't be undefined

faint prism
#

the object is this.shouakau

delicate shore
digital ibex
#

oh im stupid lmao

#

mb mb

#

nice unhandled promise you've got there

delicate shore
#
bot.on('guildCreate', async guild =>{
  client.channels.cache.get('738415384511905913').send(`A New Guild ${guild.name}`);
});```
tranquil patrol
#

does the channel exist

#

oh

delicate shore
#

yes

tranquil patrol
#

it's bot not client

#

for you

digital ibex
#

u sure?

delicate shore
#

op

#

lol

#

lmao

#

yikes

tranquil patrol
#

bot.on('guildCreate'

sudden geyser
#

why do you have two client objects though

tranquil patrol
#

client.channels

digital ibex
#

:yike:

glass lily
#

Wait how do I verify

sudden geyser
#

verify what

digital ibex
glass lily
#

This

digital ibex
#

ask in their support serv- oh

tranquil patrol
#

lmao this is development channel

digital ibex
#

uh

tranquil patrol
#

@tight plinth try putting shoukaku = null; above your constructor

glass lily
#

I am so confused

faint prism
#

I don't think that'd help

tranquil patrol
#

idk

faint prism
#

since he instantiates it right below

quartz kindle
#

@glass lily where is that from?

tranquil patrol
#

it's the only thing i see

#

apart from that no idea

tight plinth
#

nvm, it was because i was using discord.js-light, and shoukaku is meant to be used with regular discord.js

tranquil patrol
#

ah

#

kk

glass lily
#

a bot

#

@glass lily where is that from?
@Tim#2373

#

a bot

feral spindle
#

Merhaba TÜRK Varmı

glass lily
#

i dont know why it send me that

tranquil patrol
#

bruh this is the bot development channel πŸ‘€

quartz kindle
#

what is the bot's id?

digital ibex
#

I've been installing react for like 5 minutes... and then i just realised i was installing it in the wrong directory πŸ€¦β€β™‚οΈ

tranquil patrol
#

426537812993638400

quartz kindle
#

and this bot send you a DM when you joined?

tranquil patrol
#

it did it to me too

#

if i remember

slender thistle
#

a

digital ibex
#

is that the real bloxblink??

tranquil patrol
slender thistle
#

relatable

tight plinth
#

k so now i put "config.json" on my .gitignore, but it still doesnt ignore it wtf

digital ibex
#

i accidently installed it in /users/name by accident πŸ˜”

tight plinth
earnest phoenix
#

did you commit the .gitignore

tight plinth
#

yes

earnest phoenix
#

cursed software

#

what about the good old

#

have you tried turning it off and on again

tight plinth
#

git rm --cached worked

#

hm

#

thanks github i'd say

#

or not

#

if i create a config.json it doesnt seem to ignore it

#

or not

#

it worked this time

delicate shore
#

My discord bot is stuck

#

At 425 guilds

#

Not going any further

#

I gained over 320+ guilds in last 2 days

#

But from last 4 hrs it's same

lusty quest
#

lol wait a few days. sometimes you have some down times

#

(also growing to fast can cause issues)

delicate shore
#

Ok

polar aurora
#

Hello $ping

#

??

earnest phoenix
#

Hello guys

#

I have a little question

#

Can a private bot on a server send a welcome message privately when the member enters which contains external links such as the server's instagram, the server's site?

lusty quest
#

if you mean with private bot you mean you set him to Private in the Developer portal yes this will work

faint prism
#

I'm sure it's codeable

lusty quest
#

since it only prevents others to invite the bot

#

also the DM stuff is pretty easy to make

#

listen for the MemberAdd event and just send a Message

marsh surge
#

Sa

earnest phoenix
#

Nah, I mean a bot for only one server

lusty quest
#

yea

#

i know

#

you set the Bot to Private in the Developer Portal

#

this only prevents others that are not Owner or Secondary owner of the bot to invite the Bot somewhere else

#

the other stuff still works

earnest phoenix
#

yes, but sending instagram-like links and the server's website in private doesn't go against the TOS?

lusty quest
#

why?

earnest phoenix
#

promote a third party service through discord

lusty quest
#

if you do it when a User joins its pretty much the same as sending a URL to a website with the Server Rules.

#

did you promote a third party service with it?

#

you dont send them links with as example Discord is shit use Muble instead (mumble.com url)

earnest phoenix
#

ah ok, when a user enters the bot also sends the link of the various social networks of the server. So it doesn't violate the tos. Right?

lusty quest
#

i never heard that this violates the TOS.

earnest phoenix
#

you dont send them links with as example Discord is shit use Muble instead (mumble.com url)
@lusty quest Nah for third part, i mean link like instagram

lusty quest
#

since you promote your Server/Staff.

#

then it would be also illegal to Post Twitter Links. and even some Discord Staff, Partnered Users/servers does it

earnest phoenix
#

Mh, then it is better not to include social links in the welcome message lol

#

Just for security

digital ibex
#

i dont see a problem with it unless you dont want people to know your socials

#

dont see a problem to do with discord*

earnest phoenix
#

so include third-party instagram-like links and the server's website in the welcome message is not a problem?

digital ibex
#

nope

#

uh

#

you're not meant to nest events

#

thats just gonna spam.

#

it prob wont even work anyways

earnest phoenix
digital ibex
#

cuz ur looking for when a message gets sent and a member joins at the same time

earnest phoenix
#

Anyone?

digital ibex
#

dont nest events

earnest phoenix
#

member.user.username

#

wait..

#

nvm

lusty quest
#

why tf are there 2 events netsted in each other?

digital ibex
#

you-

#

you're still nesting them

lusty quest
#

what exactly did you want to do with it?

#

maybe you misunderstand something

earnest phoenix
#

Thanks for the clarification guys ^^

lusty quest
#

why then the nested events?

#

why did you need message?

#

you can use the member

#

member.user.username will give you the username of the user that joined

#

and member.id will give you the userid of the member

digital ibex
#

p sure guildMemberAdd takes message and member

lusty quest
#

iirc only returns the member

digital ibex
#

ah

#

it takes member and guild

#

yeah

#

u can use guild tho, but both work

lusty quest
#

if you add guild , member to the Event you can remove member from member.guild

dusky vector
#

Hello I have a question for a server how we got that πŸ“’ and how to configure it (gitbub, or code)

quartz kindle
#

you need to buy a developer licence

summer torrent
#

buy developer licence

dusky vector
#

Oki tks

faint prism
#

So, I've got a command that runs logic long enough for my logger to report A MessageReceived handler is blocking the gateway task.

#

If the command is called a lot

#

What should I do to prevent my bot getting bogged down if multiple users are calling that command

quartz kindle
#

what language?

digital ibex
#

ratelimits

lusty quest
earnest phoenix
#

@summer torrent tΓΌrkΓ§esi var demi

plucky heart
#

Hey, I'm trying create my own dashboard but I have this error: v I'm using Express and Passport

Error:

TokenError
    at Strategy.OAuth2Strategy.parseErrorResponse (C:\Users\haksi\Desktop\Programming\Projects\DiscordJS\WebDashboard\node_modules\passport-oauth2\lib\strategy.js:358:12)
    at Strategy.OAuth2Strategy._createOAuthError (C:\Users\haksi\Desktop\Programming\Projects\DiscordJS\WebDashboard\node_modules\passport-oauth2\lib\strategy.js:405:16)
    at C:\Users\haksi\Desktop\Programming\Projects\DiscordJS\WebDashboard\node_modules\passport-oauth2\lib\strategy.js:175:45
    at C:\Users\haksi\Desktop\Programming\Projects\DiscordJS\WebDashboard\node_modules\oauth\lib\oauth2.js:191:18
    at passBackControl (C:\Users\haksi\Desktop\Programming\Projects\DiscordJS\WebDashboard\node_modules\oauth\lib\oauth2.js:132:9)
    at IncomingMessage.<anonymous> (C:\Users\haksi\Desktop\Programming\Projects\DiscordJS\WebDashboard\node_modules\oauth\lib\oauth2.js:157:7)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)```
digital ibex
#

send ur code

plucky heart
#
const app = require('express').Router();
const passport = require('passport');


app.get('/', passport.authenticate('discord'));
app.get('/redirect', passport.authenticate('discord', { 
    failureRedirect: '/forbidden',
    successRedirect: '/dashboard'
}));
app.get('/logout', (req, res) => {
    if(req.user) {
        req.logout();
        res.redirect('/');
    } else {
        res.redirect('/');
    }
});

function isAuthorized(req, res, next) {
    if(req.user) {
        console.log("User is logged in.");
        next();
    }
    else {
        console.log("User is not logged in.");
        res.redirect('/');
    }
}


module.exports = app;```
Code from auth.js file
#

I have this code from the tutorial: v

summer torrent
#

@summer torrent tΓΌrkΓ§esi var demi
@earnest phoenix GWcmeisterPeepoShrug

honest perch
quartz kindle
#

probably yes

solemn latch
#

someone else is doing it

amber fractal
#

it just uses canvas doesnt it?

solemn latch
#

yeah

amber fractal
#

then you should be able to pipe the output

honest perch
#

what would i define ctx as

hoary lintel
#

waw

quartz kindle
#

ctx is the canvas context

#

its the same in the browser and in node-canvas

lusty quest
#

@honest perch yes

#

used it already a few times

#

but ran into some issues with it lately

#

but i cant identify where the issue is

honest perch
#

thats where im stuck at

lusty quest
#

hmm. i use a completly different method

honest perch
#

well i dont know what method mmulu

lusty quest
honest perch
#

hmm

#

youre using chartjs-node-canvas while im just using canvas

honest perch
#

thanks, ill take a look at it

shy turret
#

Is it just me or it is weird that discord didnt dm me for my discord bot being in 75 servers

plucky heart
honest perch
#

you need to provide a client id

#

and secret

plucky heart
#

'auth/redirect' send this error

solemn latch
#

the error seems like it can be several things

#

the most common seems to say its related to the callbackURL

hardy steeple
#

this is a dumb question but what do you have to put in an embed to show the time it was sent

queen moss
#

3 words

#

read the docs

solemn latch
#

a blank set timestamp i belive

hardy steeple
#

i did read the docs i couldnt find it

#

lemme try again

honest perch
#

what lib?

misty sigil
#

Is it just me or it is weird that discord didnt dm me for my discord bot being in 75 servers
@shy turret its 76

shy turret
#

wait what

misty sigil
#

yea

queen moss
misty sigil
#

i got dm'd at 76

solemn latch
#

i was told it also can be delayed

restive harness
queen moss
#

please send a screenshot

misty sigil
#

preferably text

shy turret
#

f me i guess i need 1 person to inv my bot while i work on my bot

crimson vapor
#

async function run() iirc

#

or

#

await run() depending on if you are using a function or defining one

queen moss
#

client.on isnt async

solemn latch
#

the callback can be

crimson vapor
#

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

#

lol

queen moss
#

I'm saying theirs isnt

viral iris
honest perch
#

cant load the font

quartz kindle
#

make sure your fonts are in the right folder, and the paths are correct, also make sure you're loading them before creating a canvas

viral iris
#

all done

shy turret
#

@viral iris also make sure you add ./

viral iris
#

but not worked

shy turret
#

while loading fonts

quartz kindle
#

show code

viral iris
#

@quartz kindle can u come dm ?

quartz kindle
#

no

honest perch
#

tim lives in this channel

#

and because of corona no planes are available

hardy steeple
#

wait