#development

1 messages · Page 1188 of 1

carmine summit
#

┬─┬ ノ( ゜-゜ノ)

opal plank
#

like it explained in the docs

earnest phoenix
#

it's not our job to help man

opal plank
#

the application has a generate oauth for you

#

you only need to do this once, you dont need code to fetch it everytime

earnest phoenix
#

Is it possible for someone to see my databases if I leak the URL?
News: A lot of people's mongodb databases got leaked

opal plank
#

just like a discord token

#

you do it once and thats it

carmine summit
#

the application has a generate oauth for you
@opal plank how exactly

opal plank
#

it says in the docs

#

i cant hold your hand for every step my dude

#

its way too much spoonfeeding

#

in your developer dashboard you have a generate token option

#

step one

#

you already skipping it

carmine summit
#

Thats what im doing

#

But it needs oauth redirect smh

opal plank
#

it dont

#

use localhost

carmine summit
#

Ahhhhhhhhh

#

Kkk

opal plank
earnest phoenix
#

whitename

opal plank
#

read whats literally below

#

im not gonna hold hands along the way dude

#

its explained in it

carmine summit
#

xD

opal plank
#

you just not reading it

earnest phoenix
#

Hhh

#

Hhh???

opal plank
#

ive given you a guide on how to get your token, the user endpoint with the parameter and headers needed, and the endpoint to get your follows. Last thing left for me to do is code for you

#

¯_(ツ)_/¯

earnest phoenix
#

Read docs before asking smth

#

@light wolf

opal plank
#

the worst part is that its literally under the field he was asking about

earnest phoenix
#

Really? Lol

opal plank
#

yeah

carmine summit
#

i didnt thought it will work

waxen cloak
opal plank
#

even though twitch api is notorious for having some random shit that dont work and i have to do open requests to get them to fix, its usualy retarded to assume 'i thought the docs wouldnt work'

earnest phoenix
#

well, i am new to this thing~
how can you change the background color of a server in top.gg server list?

rigid maple
#

how to do "live stream notifications on Twitch"

carmine summit
#

how to i put header on axios?

earnest phoenix
#

well, i am new to this thing~
how can you change the background color of a server in top.gg server list?
@earnest phoenix css

#

use CSS in the long description

#

should i store OAuth tokens on mongodb atlas

opal plank
#

is it encrypted?

earnest phoenix
#

not sure

opal plank
#

no

#

then no*

#

storing sensitive data without encryption, bad bad bad bad

#

i'll slap another bad just in case

#

bad

thick gull
#

bad

slender thistle
#

Imagine not encrypting your data... totally not relatable

thick gull
#

you should store the entirety of topgg in a quick db and make it openly available

opal plank
#

just store the rows that has sensitive data

#

or collums

#

well, im assuming the schemas works similarly to what postgres has

#

tuples/rows/columns

earnest phoenix
#

i store my password in an env file

opal plank
#

not password

earnest phoenix
#

don't yoi need the password to see the databases

opal plank
#

password protected db isnt encryption

#

imagine this

earnest phoenix
#

alrighty

opal plank
#

|username|oauth token|
|erwin | 126792148|

earnest phoenix
#

downloading cryptojs

opal plank
#

your database should likely alreayd have encryption

#

in postgres once you request that data, you need a token to decrypt the oauth token field

earnest phoenix
#

should i use sha256 or aes wtf sha256 is a hash function not an encryption one

opal plank
#

its been a while ive set it up

#

on postgres theres a whole deal around it

#

i also use ssh tunneling, so its even harder to grab something on my end

earnest phoenix
#

ssh tunneling???

opal plank
#

yeah the database is local and cant be cnnected from the outside

#

you need to ssh tunnel inside first and query locally to grab the stuff

#

thats one step more in security

earnest phoenix
#

does mongo have built in encryption

carmine summit
#

How do I use header on axios

#

@opal plank how do I do step 2?

#

how do i do this with axios?

opal plank
#

check axios documentation dude

#

i told you i cant hold your hand all that way

#

you need to learn how to properly read the docs

earnest phoenix
#

How to set bot have 2 prefix, like default prefix and general prefix

opal plank
#

database + cache

#

cache the prefix and dump it into a database for persistent

#

on every message just check if message starts with (fetch guild prefix)

earnest phoenix
#

hmm

#

i know that

#

i need to give my bot a multiple prefix

#

if (message.content.startsWith(prefix) || message.content.startsWith("hey")

opal plank
#

thats literally what i told you

earnest phoenix
#

hmm

#

i want my bot have 2 prefix

opal plank
#

on every message just check if message starts with (fetch guild prefix)

#

then just check for both prefixes

earnest phoenix
#

i want my bot have 2 prefix

#

Bruh

carmine summit
#

ive read it and I saw nothing about header

opal plank
#

you answered your own question dude

earnest phoenix
#

its error

opal plank
#
if (!(message.content.startsWith('a') || message.content.startsWith('b')) return;```
#

¯_(ツ)_/¯

#

@carmine summit you havent read it then, cuz the whole point of axios is http request with headers and parameters

earnest phoenix
#

hmm

carmine summit
#
  baseURL: 'https://some-domain.com/api/',
  timeout: 1000,
  headers: {'X-Custom-Header': 'foobar'}
});```
earnest phoenix
#

Thx

opal plank
carmine summit
#

twitch is hard

#

and i have minimal knowledge about axios

opal plank
#

curl, axios, winget, fetch, nuget, request, cheerio, snakefetch

#

dealing with api's isnt for anyone

carmine summit
#

uh

opal plank
#

you need to have a basic knowledge of http requests

carmine summit
#

I dont know

#

how to i get my oauth2 token?

#

please help me my brain already spinning

#

i dont wanna die early

carmine summit
#

._.

#

i quit lol

#

i cant handle this anymore

lusty spade
#

how can i get the information of an invite by using the invite code

#

like uses, creator and stuff

carmine summit
#

how do i make a loop for an array?

opal plank
#

you should really stop using this channel as your google search dude

surreal sage
#

Is there a thing in javascript that you can like await a message sent in CONSOLE, the like visual studio console if you are running a node app. like if i sent: consoleTest it will reply with: "yES"

#

if there is a function send me how to use it (can be a video or website that explains it)

wind oak
#

@fossil oxide I need help

surreal sage
#

TF

wind oak
#

pls help me

winter basalt
#

why do you need oliy

surreal sage
#

You are not supposed to ping him lul

wind oak
#

nvm

#

i leave

winter basalt
#

ok

delicate shore
#

Hi

earnest phoenix
#

do I need to set up dbl api before approval

surreal sage
#

no

earnest phoenix
#

can I?

surreal sage
#

you can

#

not required

winter basalt
#

you need dbl key which you get after approval

#

so no

#

atleast right now

earnest phoenix
#

oh ok thanks Jly

#

Hello

#

I need help with smth

#

I make a Streaming Status

#

Wait...

#
    function randomStatus() {
      let status = ["Discord Bot", "Youtube", "Discord", "Glitch", "Node.js"]
      let rstatus = Math.floor(Math.random() * status.length);
      client.user.setActivity(Status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/bogscam"});
    }; setInterval(randomStatus, 30000)
  
      console.log('Logged in as BOGSCAM!');
  })```
#

This is my code terminal says that it is online it is online but it has no status

surreal sage
#

@earnest phoenix the let rstatus = math.floor
the math.floor has to be status

restive furnace
#

use numbers

#

instead of "STRING"

#

in the type

earnest phoenix
#

So what should I fix?

surreal sage
#

and the brackets or so ()

#

have to be []

#

change Math.floor to status

#

just replace it

earnest phoenix
#

Pls send the code with the coreect code

surreal sage
#

no

earnest phoenix
#

ReferenceError: Test is not defined
at Timeout.randomStatus [as _onTimeout] (C:\Users\User\Desktop\BOGSCAMs Ultities\index.js:9:21)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)

surreal sage
#

Read pins

earnest phoenix
#

cough no spoon feeding

split hazel
#

we won't spoon feed you, we're giving you good advice

earnest phoenix
#

This is the error

surreal sage
#

it says what is the problem lol

#

read

#

and the problem isnt even in your status stuff

#

I want to build a CLI system but i want it to work while running like Inquirer.js

#

Is there anything in vanilla javascript for that too?

#

or (node.js)

split hazel
#

I mean I doubt many people tried building a cli in raw js

#

don't know if you even get access to props like console.stdin

surreal sage
#

hmmm

split hazel
#

you could try i guess but without packages it might be a hassle since read line isn't in js

surreal sage
#

readline aint files?

split hazel
#

you can use readline (native nodejs module) to read the next line in the terminal and return it to you

surreal sage
#

ah

#

thanks

split hazel
#

though I'd promisify it before use to avoid callback hell

surreal sage
#

k

earnest phoenix
#

Is there a thing in javascript that you can like await a message sent in CONSOLE, the like visual studio console if you are running a node app. like if i sent: consoleTest it will reply with: "yES"
@surreal sage process.stdin

delicate shore
#

Bruh There are people in my dms asking to make bot for them for free

wheat jolt
#

can bots publish messages?

earnest phoenix
#

To announcement channels you mean?

orchid vortex
#

i dont know bout that one

waxen cloak
#

can someone please help me?

wheat jolt
#

To announcement channels you mean?
@earnest phoenix yes.

earnest phoenix
#

Not yet

wheat jolt
#

ah ok

#

thanks

earnest phoenix
#

@waxen cloak What's the issue

waxen cloak
earnest phoenix
#

That's not possible to know

waxen cloak
#

then how to remind user?

#

many bots like Prism send reminders

earnest phoenix
#

Setup a webhook that emits when a user votes as it has a vote event and set a timeout to remind that user on that time

waxen cloak
#

ok but if user selects not to remind ?

earnest phoenix
#

That's not possible to know

waxen cloak
#

ok

#

thanks

delicate shore
#

how to declare

#

use of interns

#

intents*

#

in bot itself

earnest phoenix
#

discord.js?

delicate shore
#

yes

earnest phoenix
#

You can set them up in the clientOptions of the client

delicate shore
#

ok

earnest phoenix
#

Oh wait nevermind

#

They're aren't included in the ClientOptions

delicate shore
#

oh

pale vessel
#

they are

#

under { ws: { intents: <intents> } }

delicate shore
#

i need all intetns

#

intents*

#

what are their names?

pale vessel
#

i'd recommend the latter

delicate shore
#

ok

#

under { ws: { intents: <intents> } }
@pale vessel i add the number here?

pale vessel
#

yeah

delicate shore
#

ok

carmine summit
#
if (verifyPlayer == toVerify) {
                message.channel.send("verified")
                const role = guild.roles.cache.find(role => role.name === 'Guild Member');
                const member = message.mentions.members.first();
                member.roles.add(role);
                return
            }```How do I define "guild"?
delicate shore
#

message.guild?

pale vessel
#

what guild do you want to get? message's?

orchid vortex
#

message.guild in place of guild .. []

delicate shore
#

depends

#

message.guild in place of guild .. []
@orchid vortex depeneds on what he wants

carmine summit
#

umm

orchid vortex
#

in this case up there at guild.roles he means message.guild.roles

#

just replace this line

const role = guild.roles.cache.find(role => role.name === 'Guild Member');

with

const role = message.guild.roles.cache.find(role => role.name === 'Guild Member');
delicate shore
#
if (verifyPlayer == toVerify) {
                message.channel.send("verified")
                const role = guild.roles.cache.find(role => role.name === 'Guild Member');
                const member = message.mentions.members.first();
                member.roles.add(role);
                return
            }```How do I define "guild"?

@carmine summit
And. u should add verified message at the end in try catch block

pale vessel
#

bruh you sent the whole line of code lmao

carmine summit
#

cannot find property "roles" of undefined

#

???

orchid vortex
#

did you replace guild with message.guild?

wheat jolt
#

bots can now mention all roles with that permission?

orchid vortex
#

idk yes most likely

carmine summit
#

yep

wheat jolt
#

ok, thanks

orchid vortex
#

send same part again then

#

just send that part again

carmine summit
#
if (verifyPlayer == toVerify) {
                message.channel.send("verified")
                const role = message.guild.roles.cache.find(role => role.name === 'Guild Member');
                console.log(role)
                const member = message.mentions.members.first();
                console.log("success")
                member.roles.add(role);
                return
            }```
orchid vortex
#

that works perfectly fine

#

oh wait

#

can you give me the exact error

pale vessel
#

if the role exists and they mentioned a member that is

orchid vortex
#

yes, the mention part is sus

#

if they didnt mention someone it would error, yes

carmine summit
#

huh

earnest phoenix
#

I have a problem with my yunite, someone can help me ?

carmine summit
#

TypeError: Cannot read property 'roles' of undefined

#

@orchid vortex

#

oh waitttttttttttttttttt

#

i should change to autho

vapid sail
#

im coding a bot for myself with discord.py
a simple bot
for example giving avatar or user info and ...
can you guys give me the code for getting avatar from bot and getting users info?
Thanks 😄

orchid vortex
#

@carmine summit

carmine summit
#

how do i change it to author btw

#

lol

#

message.author?

orchid vortex
#

if it doesnt find a mention, then just return a message saying
"give me a mention, idiot"

#

yeah but you cant just verify yourself if youre verified

#

and have perms to use the bot

#

yeah but like

#

make it so it requires a mention

carmine summit
#

No what i mean is

#

it rwequires mention

#

what i need is message.author

orchid vortex
#

ah so you want it to verify the author

carmine summit
#

but i dont know how to code message.author

#

lol

orchid vortex
#

yes indeed message.author

carmine summit
#

how

orchid vortex
#

like that

#

well technically

#

it will be

carmine summit
#

const member = message.author

#

?

orchid vortex
#

message.member

#

const member = message.member

carmine summit
#

ok ok lemme try

orchid vortex
#

should work

carmine summit
#

it works

#

tysm

#

but why member

#

not author

orchid vortex
#

because author returns User

#

and member returns GuildMember

#

@carmine summit

#

you cant assign roles to a User

#

only to GuildMember

earnest phoenix
#

what is the code to make the bot status and game in discord.js bots

#

Is that right?

nimble kiln
earnest phoenix
#
client.on('ready', () => {
   console.log(`----------------`);
      console.log(`Desert Bot- Script By : Salah_Ken`);
        console.log(`----------------`);
      console.log(`ON ${client.guilds.size} Servers '     Script By : Salah_Ken ' `);
    console.log(`----------------`);
  console.log(`Logged in as ${client.user.tag}!`);
client.user.setGame(`Hello Word!`) 
client.user.setStatus("online")
}); ```
#

Is this right code?

orchid vortex
#

"desert bot script by salah ken"

#

wtf

#

and arabic?

earnest phoenix
#

yeah I got it from my old friend

#

yes he is arabic

#

idk what is that

orchid vortex
#

the S and the K and the I and the D

earnest phoenix
#

if its right or no

orchid vortex
#

i mean

#

i think it should work

earnest phoenix
#

alr

#

I'll test

#

Well it works

nimble kiln
#

setGame doesn't exist

#

Scroll up a bit and use setActivity

earnest phoenix
#

Alr

orchid vortex
#

depends on discordjs version yknow

#

meaning that i dont know

#

¯_(ツ)_/¯

earnest phoenix
#

both works

#

👀

#

wait

#

setActivitydoesn't work

nimble kiln
#

depends on discordjs version yknow
Ok didnt think of that, but he should use discord.js v12 anyway 👀

earnest phoenix
#

k

high bough
#

Is this practical enough?

// Creating array variables so it doesn't return undefined when we try to `.concat()` it.
let sentences = [];
let temp = [];
// Loops every args
for(l=0;l<args.length;l++) {
  // Adding the args as an array to the `temp` variable.
  temp = temp.concat(argss[l])
  // If we meet `|` which is a sentence separator.
  if (args[l] === "|") {
    // Join the `temp` array, making it a sentence while removing the `|` operator.
    sentences = sentences.concat(temp.join(' ').slice(0, -2));
    // Resetting `temp` to reset the saved sentence and start a new one.
    temp = [];
  }
}
cinder patio
#

Why not split the message content with |

#

should have the same output

high bough
#

Owh, I can do that? Wow I'm so dumb

#

Thx btw

#

I had no experience so I do things the hard way xd

cinder patio
#

The code you provided is also valid!

high bough
#

Thx

#

I take that back

#

Still, the results kind of have spaces along them @cinder patio

[
  'Say hi ',
  ' Sp ',
  ' say ',
  ' ajfse s fse fs ef se f ',
  ' sjnfjwbfiesfnsd'
]
pale vessel
#

add .map(x => x.trim())

#

a loop for that is a bit too much

#

join(" ").split("|").map(x => x.trim())

#

you might want to filter blank ones too by using filter()

earnest phoenix
#

My .env file randomly decided to stop working
This is the content of the file:

TOKEN=botTokenNoSpaceAround=
MONGODBPASS=myMongoDBPasswordForTheUser

It was working fine yesterday, today it ain't working but returning undefined whenever I put process.env.smth in my code. HELLLLLLLLP

pale vessel
#

because some people would do | | |

#

try adding quotes

#

TOKEN="token"

earnest phoenix
#

lemme see

#

still doesn't work

#

even tried the dotenv package

nimble kiln
#

I declare it like so:
DISCORD_TOKEN = 'mytokenhere'

And use it like that:
client.login(process.env.DISCORD_TOKEN).catch(console.error);

earnest phoenix
nimble kiln
#

Declaration:
const dotenv = require('dotenv').config();

earnest phoenix
#

I declare it like so:
DISCORD_TOKEN = 'mytokenhere'

And use it like that:
client.login(process.env.DISCORD_TOKEN).catch(console.error);
@nimble kiln wtf glitch said no spaces around =

#

lemme try

nimble kiln
#

Works on every config entry ¯_(ツ)_/¯

pale vessel
#

spaces shouldn't matter

earnest phoenix
#

still doesn't work

#

should i....

nimble kiln
#

thonk dotenv installed?

earnest phoenix
#

make a config.json

#

lol

#

and allow anyone to peak at my tokens

nimble kiln
#

Uh no that stuff has to go in .env

#

and allow anyone to peak at my tokens
@earnest phoenix O yes good idea 😄

#

I mean, if you publish your code on github then discord will yeet your active token the second you commit/push/whatever i dont use git

earnest phoenix
#

When you spend ten hours trying to figure out why your .env isn't working and then you find this in your expressjs code:

#

please don't star me

#

i'm not dumb enough

nimble kiln
#

That prevents dotenv from working? thonk

faint prism
#

I mean, if you publish your code on github then discord will yeet your active token the second you commit/push/whatever i dont use git
@nimble kiln then make sure you put your .env or something in the .gitignore

nimble kiln
#

@nimble kiln then make sure you put your .env or something in the .gitignore
@faint prism yeee I know, was referring to code913's statement about peaking his tokens

earnest phoenix
#

actually that wasn't the error

stark sinew
#

hello

slate zodiac
#

like not specifically Alex flipnote any like that would be fine

winter basalt
pale vessel
hollow stratus
#

Hi, my server shows that the bot is not on the network, what should I do?

carmine summit
#

TypeError: message.guild.members.filter is not a function

#

ummm

#
message.guild.members.filter(m => !m.user.bot).forEach(member => member.addRole(role))
hollow stratus
earnest phoenix
#

members.cache

#

@carmine summit

hollow stratus
carmine summit
#

ohhhhhhhhh

earnest phoenix
#

@hollow stratus what happened

carmine summit
#

tysm

earnest phoenix
#

tysm
@carmine summit welcome also cache is considered common sense in d.js v12 soooo

#

you don't have common sense lol

hollow stratus
#

@earnest phoenix I invited the bot to the server and he is not on the network

earnest phoenix
#

he's offline\

#

bruuuuuuuuuuuuuuuuuuh

#

the bot isn't running

pale vessel
#

addRole

earnest phoenix
#

why don't people have common sense

hollow stratus
#

@earnest phoenix

earnest phoenix
#

dudddde

#

it is offline

#

because

#

the process is not running

#

stop pinging me asking to explain common sense

hollow stratus
#

I don't know English well I'm sorry (

#

so what should I do?

opal plank
#

google translate

#

¯_(ツ)_/¯

golden condor
#

Start your process

earnest phoenix
#

^

opal plank
#

wait, which issue we fixing here? the code or the english?

golden condor
#

What language do you use for coding?

hollow stratus
#

Yes @opal plank

golden condor
#

@hollow stratus what coding Language do you use?

hollow stratus
#

code

opal plank
#

javascript?

#

python?

#

java?

golden condor
#

assembly?

opal plank
#

haskell?

golden condor
#

kotlin?

opal plank
#

go?

hollow stratus
#

damn i can't make it

golden condor
#

binary?

opal plank
#

C++?

earnest phoenix
#

whatsup gamers

golden condor
#

C?

winter basalt
#

portuguese?

opal plank
#

lmao

golden condor
#

Russian?

opal plank
#

we gooing for a while

pale vessel
#

shotpost?

#

shot

#

shot

earnest phoenix
#

i'm about to press alt + f4

hollow stratus
#

Russian?
@golden condor +

opal plank
#

imagnie misspelling shitpost 3 times in a row

golden condor
#

what language do you use to code your bot?

pale vessel
#

no i was pointing out that i said shot lmao

earnest phoenix
#

boop closes Discord tab

opal plank
#

oh i see

hollow stratus
#

This is translator(

opal plank
#

what language you speak?

pale vessel
#

kore wa translator?

opal plank
#

looks russian os lovak

hollow stratus
golden condor
#

Install it

opal plank
#

@hollow stratus Na kakom yazyke govorish'?

golden condor
#

на каком языке вы кодируете своего бота?

hollow stratus
#

@opal plank Русском

pale vessel
#

???????????????????? what are you all doing

opal plank
hollow stratus
#

@opal plank Russkom

opal plank
#

yazyk programmy

#

i asked which language he speaks, he said russian

pale vessel
#

and why speak russian here

opal plank
#

idk, i dont know russian either

golden condor
#

Какой язык программирования вы используете?

pale vessel
#

o

opal plank
#

just tryna help

pale vessel
#

callum bruh

golden condor
#

Idfk

tropic gulch
#

what code for java script changes the bots status

opal plank
#

fyi russian isnt 1 -1 with english

golden condor
#

ik

hollow stratus
#

@golden condor я добавил через интернет этого бота а он не работает

earnest phoenix
#

oof I have a problem on the god damn status and activity

opal plank
#

setAcitivty() @tropic gulch

golden condor
#

@Callum I added this bot via the Internet and it does not work

hollow stratus
#

@golden condor я не програмист

tropic gulch
#

k

earnest phoenix
#

when I go to the code

still merlin
#

@tropic gulch readthedocs

pale vessel
earnest phoenix
#

and do a new thing

#

the status

#

and

#

others

#

shows

#

but

#

like

golden condor
#

@Callum I am not a programmer

opal plank
#

can

#

we

#

not

#

talk

#

like

earnest phoenix
#

3 minutes it goes

pale vessel
#

can
you
not
talk
like
this

opal plank
#

this

#

appreciate it, ty

orchid vortex
#

ok

#

so

#

like

#

can

pale vessel
#

uh

orchid vortex
#

we

pale vessel
#

lie

orchid vortex
#

not

#

talk

pale vessel
#

stop

orchid vortex
#

like

pale vessel
#

please

orchid vortex
#

this

opal plank
#

okay, for real, cease

pale vessel
#

please kill me

golden condor
#

aaaaaa

earnest phoenix
#

hey hey dont touch me there this is my no no square

#

ehhh problem on the status and act, when I go to the code and do a new status, it shows, but like 3 minutes ago it goes, how to fix?

orchid vortex
golden condor
#

Set an interval?

orchid vortex
#

this is my no no square

earnest phoenix
#

idk

#

let me show the code

opal plank
golden condor
#

Set an interval

earnest phoenix
#

that isnt a shitpost

orchid vortex
#

this is development related

earnest phoenix
#

its about development

orchid vortex
#

my bot suddenly started showing these

opal plank
#

'dont touch my nono square'

orchid vortex
#

and that only happens when something is "undefined"

opal plank
orchid vortex
#

nvm fixed it

pale vessel
#

bismillah, what a mess

earnest phoenix
#
let nonosquare = function touchMeThere() { 
return
}
#

dont touch my nonosquare

pale vessel
#

just stop

earnest phoenix
orchid vortex
#

a

earnest phoenix
#

the problem on it like i said

opal plank
#

none of my concern but you can do multiple lines when console logging marcsus

orchid vortex
#

"Y O U R C O M M A N D S"

pale vessel
#

what's the problem?

#

and is that v11? please upgrade

opal plank
#

also why multiple ready events?

earnest phoenix
#

when I do like a new status or act, it shows in the bot's, but like 3 minutes ago it goes

orchid vortex
#

also why "Your Commands" up there

earnest phoenix
#

I wanted it like ' watching your commands

#

etc

#

but let's not talk on the act

opal plank
#

upgrade to v12

#

and try setActivity()

#

at this point you shouldnt be running v11 anymore, its deprecated

earnest phoenix
#

problem is I don't know how to upgrade on glitch website

#

my project is all on glitch website

opal plank
#

just change your code and reupload

#

¯_(ツ)_/¯

#

anyhow, back to minecraft

earnest phoenix
#

But how do I upgrade it and the coding is generaly from a website

delicate shore
#

is this shitpost

#

i scrolled up

#

and it's worse then shitpost

opal plank
#

@earnest phoenix im assuming you CODED your bot and didnt copy it from somewhere

delicate shore
#

problem is I don't know how to upgrade on glitch website
@earnest phoenix go to package.json and send pic

earnest phoenix
#

:((

opal plank
#

@earnest phoenix no code, no help

#

¯_(ツ)_/¯

#

i cant guess what you are doing on your code

#

my future sight is only limited to lottos

earnest phoenix
#
lines = require('lines-js');

        format = lines()
            //horizontal
            .line({
                from: [0, 5],
                to: [30, 5],
                style: 'bold'
            })
            .line({
                from: [0, 10],
                to: [30, 10],
                style: 'bold'
            })
            //vertical
            .line({
                from: [10, 0],
                to: [10, 15],
                style: 'bold'
            })
            .line({
                from: [20, 0],
                to: [20, 15],
                style: 'bold'
            })

        let embed = new MessageEmbed()
            .addField("Tictactoe", `
            \`\`\`
            ${format.toString()}
            \`\`\`
            `)
        message.reply(embed);
#

@opal plank just the first line in the embed

opal plank
#

before reply

earnest phoenix
#

huh ?

opal plank
#

add console.log(format)

earnest phoenix
#

i did

opal plank
#

and run command again

earnest phoenix
#

it is good

opal plank
#

show me console

earnest phoenix
#

nothing

#

wait

opal plank
#

actually i think it might be toString() thats formatting it

earnest phoenix
#

here it is good

opal plank
#

that looks cropped

earnest phoenix
#

if i dont do .toString()

#

it show error 😦

opal plank
#

do console.log(typeof(format))

delicate shore
#

@earnest phoenix that's discord.js v11

earnest phoenix
#

object

#

@opal plank

opal plank
#

why is that an object though?

earnest phoenix
#

idk

#

but toString()

#

it return sring

opal plank
#

i cant see why it'd be adding that much space

earnest phoenix
opal plank
#

well yeah, thats what i meant

earnest phoenix
#

maybe discordapi error ?

#

or maybe djs

opal plank
#

dont think so

pale vessel
#

why not just slice if it's only the first row

earnest phoenix
#

still

#

i tried

opal plank
#

work around but definetly not the solution

earnest phoenix
#

wondering how ppl make tic tac toe game : /

opal plank
#

canvas would make it a lot simplier i assume

delicate shore
#

Can i rename my bot ?

#

after it is verified

pale vessel
#

no

delicate shore
#

what will happen if I do?

cinder patio
#

You could do tic tac toe with emojis

pale vessel
#

you can't

delicate shore
#

I can

#

there is an option

pale vessel
#

not now

delicate shore
#

i cahnged name

#

@outer marsh

pale vessel
#

shrug

#

try it

delicate shore
#

it's already verified

#

ok

#

WIll i lose verification mark?

pale vessel
#

no

delicate shore
#

on my bot

earnest phoenix
#

@opal plank i dunno anything about canvas

#

i am not good in thoose (x, y)

opal plank
#

Guess what?

earnest phoenix
#

wut

opal plank
#

Me neither

earnest phoenix
#

lol

pale vessel
#

that totally helped [@delicate shore]

delicate shore
#

ikr

earnest phoenix
#

@pale vessel can u give a example to make a line with canvas

#

then i figure out how to another lines

cinder patio
#

There's the lineTo method

earnest phoenix
#

wut

#

lineTo() ?

#

@cinder patio where

cinder patio
#

on the context object

#

Maybe you should you know do some research before asking someone to teach you

restive pebble
#

then i figure out how to another lines
@earnest phoenix moveTo(x1,y1)
lineTo(x2,y2)

earnest phoenix
#

Can someone help me

#

How to change role name in discord.js v12

#

Do anyone know how can I make my discord bot send a message when I am live on Twitch?

gleaming niche
#

no one answered my question 😔

earnest phoenix
#

Mine neither

#

@delicate shore

knotty sigil
#

someone knows how can i make that when i create a channel its will link the channel i made? (like the picture)

pale vessel
#

events

earnest phoenix
#

@pale vessel but how can I make an event to announce it?

pale vessel
#

😩

opal plank
#

only way i can think is either check your twitch often(which is what i would go for) or use guild presence updates

#

¯_(ツ)_/¯

earnest phoenix
#

@earnest phoenix that's discord.js v11
@delicate shore ikr

pale vessel
#

regarding the twitch api, erwin

#

you sure you don't need oauth?

#

i needed client credentials flow

#

where do you get the bearer token then

opal plank
#

thats your token

delicate shore
#

🥳 🥳 🥳 🥳 🥳 🥳

opal plank
#

lemme show the proper names

#

you'll see what i mean

delicate shore
#

My bot got verified today
Also it hit 700 guilds

pale vessel
opal plank
hazy sparrow
#

is there a way to make my bot status dnd?

opal plank
#

look at my configs

hazy sparrow
#

d.js

opal plank
#

token =/= oauth

#

oauth starts with oauth: on it

pale vessel
#

oh

#

i thought i was doing something unnecessary

opal plank
#

you should only need token for most things that you'll likely be doing

pale vessel
#

yeah

opal plank
#

there are some api endpoints that require it

#

but the common ones only need token and id

#

twitch api is janky af

pale vessel
#

why do they use query parameters for oauth

opal plank
#

their whole docs is fucked

#

when they mention oauth they mean token

pale vessel
#

yes yes

#

which is what confused me

opal plank
#

wanna see something else thats hella good?

pale vessel
#

yes

opal plank
pale vessel
#

LMAO

opal plank
pale vessel
#

nice docs

opal plank
#

guess what?

#

the snippets dont work either

#

cuz they dont have token

#

will return 401

#

unauthorized

pale vessel
#

that announcement broke my command

earnest phoenix
#

glitch is bad

pale vessel
#

but at least it was an easy fix

sharp thicket
#

hi how do i make my bot status dnd?

#

is it like

pale vessel
#

read docs

sharp thicket
#

oh

opal plank
sharp thicket
#

can u link one as i can't find em

opal plank
#

when you check the open request

#

its from april

#

@pale vessel

earnest phoenix
#

@sharp thicket what's the launguage that your using

sharp thicket
#

discord.js

pale vessel
#

amazing

opal plank
#

thats the main reason i disencourage people from using twitch api

pale vessel
#

use setActivity or setPresence in v12. client options work too

opal plank
#

this shit is a minefield

pale vessel
#

is there anything better anyway

opal plank
#

do as little requests as possible

earnest phoenix
#

Damn

pale vessel
#

i have two requests per command, one for user, one for followers

opal plank
#

im doing a bit more complicated stuff and even after working with that api for almost a year im still getting hiccups here and then

#

im implementing a library cache for the channels

pale vessel
#

pog

#

ts i guess

opal plank
#

indeed

earnest phoenix
#

Anyone know how to let glitch website into the new version? cuz i have discord.js vs11

sharp thicket
#

what category is setActivity in?

pale vessel
#

npm upgrade?

opal plank
#

update*

earnest phoenix
#

??

#

I mean

pale vessel
#

@sharp thicket client.user

#

upgrade works too for me

earnest phoenix
sharp thicket
#

ik but in the docs

pale vessel
earnest phoenix
#

The site glitch let us update the version?

sharp thicket
#

ty

opal plank
#

doesnt upgrade upgrade npm?

pale vessel
#

it's an alias iirc

opal plank
#

i though update was to update opackacges

#

oh i didnt know that

#

today we learned

earnest phoenix
#

:/

sharp thicket
#

so like

pale vessel
sharp thicket
#
client.user.setActivity('discord.js', { type: 'DND' })```
#

or is it

pale vessel
#

dnd

sharp thicket
#

DO_NOT_DISTURB

earnest phoenix
#

not DND

sharp thicket
#

oh

earnest phoenix
#

dnd

sharp thicket
#

oki

#

ty

earnest phoenix
#

no caps

#

np

sharp thicket
#

why am i dumb ;c

earnest phoenix
#

no your not

opal plank
#

we all are

earnest phoenix
#

true

#

beacuse

#

I have one problem

#

AND i can't solve it

#

lmao

sharp thicket
#

lol

opal plank
#

welcome to programming 101

earnest phoenix
#

👀

opal plank
#

where we create problems, get frustrated at them, try to fix them, cry, fix them, and then create more problems. #DevLife

sharp thicket
#

my bot still says online e.e

#
  
const { Message, send } = require("discord.js");

let config = require('../../config.json')
module.exports = (bot) => {
  console.log(`${bot.user.username} is now online!`);
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`,type: 'dnd' })
  
};
earnest phoenix
#

ikr

#

like mine

#

what version are you using?

sharp thicket
#

wdym

#

discord.js?

earnest phoenix
#

yeah

#

discord.js version

sharp thicket
#

wait letmee check

earnest phoenix
#

k

sharp thicket
#

12.2.0

earnest phoenix
#

oof

#

not like mine

#

hmmm

sharp thicket
#

it removed the text too e.e

earnest phoenix
#

what text?

sharp thicket
#

With Avio Developers | ${config.prefix}help

#

this

earnest phoenix
#

Umm

sharp thicket
#
  bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })```
#

thats my code..

earnest phoenix
#

The thing is Im using discord.js version 1.0.0

pale vessel
#

what

opal plank
#

what 2

sharp thicket
#

bot status

pale vessel
#

version 1.0.0

opal plank
#

discord.js version 1.0.0

sharp thicket
#

that code is not working e.e

#

HOW

earnest phoenix
#

eh...

#

👀

pale vessel
#

@sharp thicket where did you put that

sharp thicket
#

in my event file

pale vessel
#

ready event?

sharp thicket
#

it worked before

#

yes

#
const { Message, send } = require("discord.js");

let config = require('../../config.json')
module.exports = (bot) => {
  console.log(`${bot.user.username} is now online!`);
  bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })
  
};```
#

what do i do e.e

earnest phoenix
#
"name": "simple-music",
  "version": "1.0.0",
  "description": "Simple shitty music",
  "main": "server.js",```
#

that's my version

#

1.0.0

pale vessel
#

yikes

sharp thicket
#

um\

#

any help?

earnest phoenix
#

ikr

summer torrent
#

it is package.json's version

#

not discord.js

sharp thicket
#

any help?
@sharp thicket

summer torrent
#

elaborate

earnest phoenix
#

ehhhhh ooff

sharp thicket
#
const { Message, send } = require("discord.js");

let config = require('../../config.json')
module.exports = (bot) => {
  console.log(`${bot.user.username} is now online!`);
  bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })
  
};```

@sharp thicket

opal plank
#

thats not d.js version

earnest phoenix
#

damn

summer torrent
#

so? @sharp thicket

earnest phoenix
#

my mistake

sharp thicket
#

my status does not set

#

or the bot status

earnest phoenix
#

and the problem is I applied saying it's discord.js 😱

#

my bad

summer torrent
#

to check discord.js version, run: npm ls discord.js

sharp thicket
#

12.2.0

earnest phoenix
#

Idk if it works if I am using glitch

#

that dumb glitch

elfin tulip
earnest phoenix
#

is killing me

sharp thicket
#

@summer torrent so?

summer torrent
#

im telling to Marcsus

sharp thicket
#

??

#

oof

quartz kindle
#

you can underline stuff by adding underscores around it: __like this__

sharp thicket
#

test

#

whats wrong with this code tho?

#
 bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })```
quartz kindle
#

dnd is not an activity type

#

its a status type

sharp thicket
#

hm

quartz kindle
sharp thicket
#

so how do i set it

quartz kindle
#

these are activity types

sharp thicket
#

oh

summer torrent
#

tim did you used grafana before

sharp thicket
#

how do i set it to dnd then?

summer torrent
#

status: 'dnd'

sharp thicket
#

so insted of type

quartz kindle
#

you need to use either setStatus or setPresence

#

setActivity doesnt support status

sharp thicket
#

oh ok

#

so

quartz kindle
#

@summer torrent no i havent

violet haven
#

does this serv have no owner?

quartz kindle
#

it does

violet haven
#

wtf

quartz kindle
#

guild owners are not guaranteed to be cached

sharp thicket
#

bot.user.setStatus(Playing With my devs, {status: 'dnd'})

violet haven
#

ah

summer torrent
#

it is uncached @violet haven

sharp thicket
#

would that work?

violet haven
sharp thicket
#

bot.user.setStatus(Playing With my devs, {status: 'dnd'})
would this work?

violet haven
quartz kindle
#

you need to fetch it

orchid vortex
#

no no

summer torrent
#

use .ownerID to fetch

violet haven
#

.fetch()?

quartz kindle
#

@sharp thicket setStatus doesnt accept text, only status

sharp thicket
#

oh

quartz kindle
#

bot.user.setStatus("dnd")

sharp thicket
#

oh

earnest phoenix
#
  client.user.setStatus("dnd");
orchid vortex
#

no no

earnest phoenix
#

that's mine

sharp thicket
#

so can i set the activity first?

orchid vortex
#

if its client then its client

#

if its bot its bot

#

how did you define your "new Discord.Client()"

earnest phoenix
#

mine is client so client

quartz kindle
#

setStatus and setActivity are separate, so either you use both or use setPresence

violet haven
#

can u hellp me about the fetch?

sharp thicket
#
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`)
  bot.user.setStatus("dnd");```
quartz kindle
#

setPresence supports all of them at once

glacial sun
#

How do i fix this?

earnest phoenix
#
bot.user.setGame(`Whatever you want`);
quartz kindle
#

@violet haven ```js
let owner = await guild.members.fetch(guild.ownerID);

glacial sun
#
const DBL = require("dblapi.js");
const dbl = new DBL('my_token', client);

// Optional events
dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });
  dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
  });```
violet haven
#

thx

glacial sun
#
TypeError: Cannot read property 'on' of undefined```
earnest phoenix
#
bot.user.setGame(`Whatever you want`);
quartz kindle
#

@glacial sun check the webhook example

#

dbl.webhook requires a webhookPort or a webhookServer to be defined in the dbl options

sharp thicket
#

my bot still has no stattus

#

and it isn't on dnd

#

bot.user.setActivity(With Avio Developers | ${config.prefix}help)
bot.user.setStatus("dnd");

#

thats my code e.e

earnest phoenix
#

As he said

#

That's the Activity type

sharp thicket
#

im not using activity for the dnd

#
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`)
  bot.user.setStatus("dnd");```
faint prism
quartz kindle
#

sometimes setStatus doesnt work because discord is weird

#

try using setPresence

sharp thicket
#

bot.user.setPresence

quartz kindle
faint prism
#

@earnest phoenix you have discord on your PC. To take a screenshot, click bottom right square of screen, click on "snip", draw a square for the picture, and paste in discord

quartz kindle
#

or windows + shift + S

earnest phoenix
#
  if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have the permissions to do this!")
  if (isNaN(args[0])) return message.channel.send("Please input a valid number!")
  if (args[0]> 100) return message.channel.send("Insert the number less than 100!")
  if (args[0] < 2) return message.channel.send("Insert the number more than 1")

  message.channel.bu1kDelete(args[0])
  .then(message => message.channel.send(`Deleted ${message.size}/${args[0]} messages!`)).then(d => d.delete({timeout: 10000}))
  .catch(() => message.channel.send("Something went wrong, while deleting messages!")
}```
#

This is my code

#
    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```
#

And this is the error

violet haven
quartz kindle
earnest phoenix
#

Thnx

quartz kindle
#

@violet haven user.flags

violet haven
earnest phoenix
#

Still no

#

Now there are 2 errors

#

SyntaxError: missing ) after argument list
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

#

anyone good at writing secure express api's?

#

if so dm me

#

ReferenceError: message is not defined
at Object.<anonymous> (C:\Users\User\Desktop\BOGSCAMs Ultities\index.js:28:1)
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

#

@quartz kindle what does this mean?

quartz kindle
#

message is not defined

earnest phoenix
#

what does this mean?

#

And how can I fix it?

frail ocean
#

You probably defined it as msg.

Show us your message event and we can see.

violet haven
#

@quartz kindle do i need to delete the fetch?

quartz kindle
#

it means the name message doesnt exist because it has never been created

frail ocean
#

^

earnest phoenix
#

how can I create it?

quartz kindle
#

you already created it

frail ocean
#

Message = "message"
is not = is not.
defined = not created, it doesn't know what "message" is.

quartz kindle
#

but you gave it a different name

#

so you have to use the name you created it with

frail ocean
#

Show us your message event @earnest phoenix and then we can see what you defined it as.

glacial sun
quartz kindle
#

@violet haven wdym delete the fetch?

violet haven
earnest phoenix
#

const client = new Discord.Client();

const PREFIX = "b!"

client.once('ready', () => {
    function randomstatus() {
      bot.user.setStatus("dnd");
      let status = ["BOGSCAM", "Prefix = b!", "Golf Blitz", "BOGSCAM's Cave"]
      let rstatus = Math.floor(Math.random() * status.length);
      client.user.setActivity(status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/bogscam"});
    }; setInterval(randomstatus, 600000)
  
      console.log('Logged in as BOGSCAM!');
  })

let memberlog = "737658405296144510"

client.on("guildMemberAdd", member => {
  if (member.guild.id !== "737658404868194365") return;


  client.channels.cache.get(memberlog).send(`Hello and welcome to the **${member.guild.name}**, <@!${member.user.id}> !!!`);
  member.roles.add("737658404868194366");
})

if (message.startsWith(prefix + prune) || message.startsWith(prefix + purge)) {
  if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have the permissions to do this!")
  if (isNaN(args[0])) return message.channel.send("Please input a valid number!")
  if (args[0]> 100) return message.channel.send("Insert the number less than 100!")
  if (args[0] < 2) return message.channel.send("Insert the number more than 1")

  message.channel.bu1kDelete(args[0])
  .then(message => message.channel.send(`Deleted ${message.size}/${args[0]} messages!`)).then(d => d.delete({timeout: 10000}))
  .catch(() => message.channel.send("Something went wrong, while deleting messages!"))
}```
violet haven
#

the toARRAY sry

earnest phoenix
#

This is my code

quartz kindle
#

you dont even have a message event wtf

glacial sun
#

How do I reward someone for voting?

frail ocean
#

@earnest phoenix You don't have a message event.

client.on("message" you need

#

(don't copy and paste the code, I just started off the line so you know where to check in the documentation)

quartz kindle
#

@violet haven what you have is correct, no need to delete anything

earnest phoenix
#

Where should I add it?

violet haven
#

but its not showing what i want @quartz kindle

quartz kindle
#

what do you want?

earnest phoenix
forest drift
#

anyone have a better command system than

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

? I only realised now that if my prefix was dbr!, then even aaaa would register...

violet haven
#

the image of the flag

#

not just HOUSE_BALANCE

frail ocean
#

Above this: if (mes.........

This is basic stuff, you need to research and use docs if you aren't sure. @earnest phoenix

quartz kindle
#

@earnest phoenix package.json is the package manager file, it contains a list of packages that your project needs. discord.js is one of the packages that your project needs, it will be listed in the dependencies section of your package.json

frail ocean
#

The message event is well documented.

quartz kindle
#

@violet haven discord doesnt give you the icons

earnest phoenix
#
if (message.startsWith(prefix + prune) || message.startsWith(prefix + purge)) {
  if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have the permissions to do this!")
  if (isNaN(args[0])) return message.channel.send("Please input a valid number!")
  if (args[0]> 100) return message.channel.send("Insert the number less than 100!")
  if (args[0] < 2) return message.channel.send("Insert the number more than 1")

  message.channel.bu1kDelete(args[0])
  .then(message => message.channel.send(`Deleted ${message.size}/${args[0]} messages!`)).then(d => d.delete({timeout: 10000}))
  .catch(() => message.channel.send("Something went wrong, while deleting messages!"))```
}
#

Like this?

frail ocean
#

No,

violet haven
#

so how

real nacelle
#

Hey, someone knows how to code bot with python?

frail ocean
#

Once again, use the docs to help you @earnest phoenix

violet haven
#

i saw many bots displaying em

quartz kindle
#

discord gives you which flags the user has, up to you to decide what to do with them, for example map them into custom images or custom emojis

restive furnace
#

```js
code
```
ok?

earnest phoenix
#

@earnest phoenix package.json is the package manager file, it contains a list of packages that your project needs. discord.js is one of the packages that your project needs, it will be listed in the dependencies section of your package.json
@quartz kindle

This is my dependencies in package.json

violet haven
#

ah yes ur right

real nacelle
#

I am invisible!!

violet haven
#

i'll do that

earnest phoenix
#

Pls tell me cause I must eat now and I wanna finish the command before eat

quartz kindle
frail ocean
#

You know events anyway, @earnest phoenix unless you copy and pasted code, if so then you know nothing.

client.on("guildMemberAdd", member => {
  //event on guild member add
})

so just replace it with message.

earnest phoenix
#

oh right

frail ocean
#

We aren't going to spoonfeed you,

#

you need to also learn yourself, else you can't improve.

earnest phoenix
real nacelle
#

I am finally invisible because of my hardwork!!

digital ibex
#

?