#development

1 messages · Page 1818 of 1

plain talon
#

755 instead

brave garnet
#

ye =]

#

or 700 if you have enough of it

plain talon
#

another to never ever try is rm rf --no-preserve-root /

brave garnet
#

Ugh. Pls no!!1

lyric mountain
#

Although doing those two at least once is good for first timers

brave garnet
#

Lol, ye xd

lyric mountain
#

Since you can face despair at least once

brave garnet
#

ik, lol

lyric mountain
#

And know how to deal with it let it happen again

brave garnet
#

xd, ye

quartz kindle
#

navigating around terminals is really easy once you get the hang of it. all you need is this:
ls -> show contents of current folder
cd folder -> enter a folder
cd ../ -> back to previous folder
cat file -> show file contents

brave garnet
#

easiest method...

plain talon
#

cd ./././././././././././ to escape ur folder tree

brave garnet
#

Lol, yeah, xd

lyric mountain
#

It's a MUST to install "screen"

#

It'll be your major tool for keeping the bot alive

plain talon
#

just use services

quartz kindle
#

not if they use something like pm2

#

which most people use

lyric mountain
#

Well, yeah

small fractal
#

are there any *free hosts anyone can recommend?

brave garnet
lyric mountain
#

I like screen because they allow easy access to different envs

brave garnet
#

sry for ping

plain talon
quartz kindle
small fractal
quartz kindle
#

heliohost

brave garnet
#

bro... github or replit

small fractal
brave garnet
#

free, easy and stable

plain talon
#

i like github because of GitHub Actions

brave garnet
#

ok

quartz kindle
#

and very limited

small fractal
#

ohk

brave garnet
#

=p compare to replit. I run a bot there and some pages at once

#

and where helio-something?

quartz kindle
#

heliohost

#

just google

brave garnet
#

Ik just for some laugh

lyric mountain
#

Had to be Tim recommending something named helio

brave garnet
#

yea

#

XD

quartz kindle
#

wut

brave garnet
#

😄

lyric mountain
#

Sun, helio, Tim, stars

brave garnet
#

and moon where?

quartz kindle
#

lmao

brave garnet
#

And earth?

#

And some asteroids?

quartz kindle
#

some steroids

brave garnet
#

ye

#

And comets

#

ooh, i forgot - also black hole !!! (how could i forgot bout to big thing?)

wheat mesa
#

So... My html knowledge is absolute garbage, and I'm trying to throw together a page that has a background of a gradient. However, whenever I try to apply a gradient to the body in css, this is what happens.

#
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <link href="https://fonts.googleapis.com/css?family=Quicksand:300,500" rel="stylesheet">
        <link rel="stylesheet" href="styles.css">
        <script type="text/javascript" src="script.js"></script>
    </head>
    <body>
        <div class="waffle-header">
            <title>Waffle</title>
            <h1>Welcome</h1>
        </div>
    </body>
</html>
body {
    background-image: linear-gradient(#614385, #516395);
}

.waffle-header {
    text-align: center;
    font-family: 'Quicksand', serif;
}
brave garnet
#

Its correct. It repeats gradient correctly

wheat mesa
#

The intended effect is to have a gradient that covers the whole page. How would I go about that?

#

Got it, nevermind

lyric mountain
#

I don't see you defining the coordinatesany where the there

wheat mesa
#

Yeah, just realized

#

did this instead ```css
body {
background: linear-gradient(to left top, #614385,#516395) fixed;
}

lyric mountain
#

Yeah

wheat mesa
#

I should really learn web development...

lyric mountain
#

Just play with inspect element

#

Devtools has auto-complete for css stuff

#

And you can see the result in real time

boreal iron
wheat mesa
#

I kinda wish vscode had a designer type thing like Visual Studio has with XAML, just so that I could see what I’m updating when I type things for HTML.

long crow
#

Another interaction from discord, I'm really curious what it look like

errant flax
#

whats that

long crow
#

No idea, only selected lib dev have the access for now

errant flax
#

no what interaction is it

smoky spire
#

context menus

lyric mountain
long crow
#

Hoo, looking forward to it

#

ts-expect-error go BRRRR

split hazel
#

yeah typescript doesn't like dynamic loading of files

pale vessel
#

Tsnode exdee if you're lazy to use tsc

long crow
#

Just know like 2 days ago can do jscofing.json to typecheck .js and immediately almost all my files go red swiggly

clear marlin
worthy ivy
#

another one

crimson vapor
#

cuz the import isnt at the top with the rest

paper isle
#

Does anyone know a bot that could track my bot's uptime % and tag me when it goes offline?

lament rock
#

You'd best make your own or look into other solutions like notifications via other mediums when your application is down similar to uptime robot

earnest phoenix
#

see, if you use that code inside a cmd is wrong, because clickMenu is an event, u must use clickMenu like the other events, ex message ready guildMemberAdd
if you want to use the event inside the cmd use collector

lament rock
#

Libraries which facilitate connections to the gateway should be coded in such a way that they either reconnect or resume when applicable and only be offline whenever manually calling a graceful disconnect. If your bot is offline otherwise, then you have bigger problems and you should be fixing your logic

#

interactions expire after 15min

cinder patio
#

generally you should use it over require

wheat mesa
#

How do I get a div to align all the way to the left? For example, I'm making a side menu with buttons, and I want the button borders to reach the edge. However, this is the result I get from trying to do so:

quasi shard
cinder patio
#

I suggest using flexbox when making websites

rose warren
#

Flexbox makes life so much easier when adapting for phones

earnest phoenix
#

Does someone know how to fix it?

#

occurs when I try to use quick db

worthy ivy
#

im guessing ur using replit because of that terminal

earnest phoenix
#

I tried to install node 16x with console

#

But still using 12.x

worthy ivy
#

im browsing thru the forums right now and it seems replit only supports node 12.x

#

@earnest phoenix

earnest phoenix
#

Lemme try and thanks for help

earnest phoenix
#

how do you get new fishing rod?

long crow
#

I bought from store

errant flax
worthy ivy
#

anyways

#

does anyone have any experience with mongodb

quaint wasp
#

uuhh

small tangle
#

im using it for my bot, so i guess

quaint wasp
#

My pc cant find a file

#

😐

#

So the file is here:

files > commands > other > jsontest.js

my json file to write json data in:

files > jsons > users > database.json

I put:

../../jsons/users/database.json

small tangle
#

JSON database peepoShake but the path seems fine at first glance

earnest phoenix
#

@worthy ivy @earnest phoenix you can use node v14 if you choose the language as bash or deno when creating the repl

#

try downloading your code, deleting the repl then creating a new one

worthy ivy
#

anyways, send help how tf do you use mongodb

earnest phoenix
worthy ivy
earnest phoenix
#

maybe

#

i once ran node -v in a deno repl and it said v14

#

not sure about bash

#

I downloaded node 16.5 with console

worthy ivy
#

im going to like do a custom prefix system/modlog system thing

earnest phoenix
#

But still running with 12.x

#

you cant update node yourself

#

So trash

worthy ivy
#

lts moment

earnest phoenix
#

The shell does not have system access so it cant download the correct node version

earnest phoenix
worthy ivy
earnest phoenix
#

I did npm i node@16.5

worthy ivy
#

im going to

earnest phoenix
#

Replit so gay

#

i give up

worthy ivy
#

uh

earnest phoenix
#

@earnest phoenix ok i ll do it as you want

worthy ivy
#

try using nodes version manager?

#

npm i -g n

#

@earnest phoenix

earnest phoenix
#

nvm is better

worthy ivy
#

haha update to njs 14 and up or no more djs!

#

fun

earnest phoenix
#

you CANT update node yourself on replit

#

Acses error

#

Calm down litle boy

worthy ivy
#

hes trying to say you cant update node urself on repl

waxen bough
#

javascript how do i hide a property from class when I do console.log?

worthy ivy
earnest phoenix
#

the node command looks for nodejs in the SYSTEM ACCESS ONLY folder where replit installed node
installing with npm downloads it to node_modules which does nothing
and if you use the global flag it will throw an access error

waxen bough
worthy ivy
#

so how do you update node version then

quaint wasp
earnest phoenix
#

you either use a deno/bash repl to get node v14 or keep a replit engineer hostage until they agree to update node

small tangle
worthy ivy
#

yes please dont use json databases unless its really a small project

earnest phoenix
#

try running console.log(__dirname)

quaint wasp
quaint wasp
#

oh right

#

I forgot to tell

#

I renamed the file.

willow mirage
worthy ivy
quaint wasp
#

but I canged it

small tangle
earnest phoenix
willow mirage
#

wdym?

quaint wasp
#

I also renamed it at the place where its trying to locate it too

small tangle
#

saved the codefile too?

earnest phoenix
#

it was a sarcastic way of saying that you havent sent your code for us to see

quaint wasp
#

ya

willow mirage
#

lmao

worthy ivy
willow mirage
#

now it render

#

hmm

quaint wasp
#
const fs = require('fs')

module.exports = {
    name: "json-test",
    aliases: ["js"],
    category: "other",
    description: "store data!",
    usage: "json-test",
    execute: async (client, message, args, emoji) => {  

let user = {
    name: message.author,
    id: message.author.id,
    guild: message.guild.name,
    guildID: message.guild.id
};

// convert JSON object to a string
const data = JSON.stringify(user);

// write file to disk
fs.writeFile('../../jsons/users/database.json', data, 'utf8', (err) => {

    if (err) {
        console.log(`Error writing file: ${err}`);
    } else {
        console.log(`File is written successfully!`);
    }


});

    }
}```
#

there

willow mirage
#

it needs to know ur location

#

but Iam making a location form searcher

worthy ivy
quaint wasp
earnest phoenix
#

dab dab

willow mirage
willow mirage
earnest phoenix
#

anyways, can you tell us what was the problem with your ui

worthy ivy
willow mirage
#

now it render

willow mirage
earnest phoenix
#

oh

#

known problem in chakra ui

#

@earnest phoenix

#

thanks for the ping

willow mirage
#

nvm wrong status code

#

it must be 405

earnest phoenix
#

When i chose bash

worthy ivy
#

or heck JUST USE THE BUILT IN SCREENSHOT TOOL

willow mirage
#

or simple WINDOWS + SHIFT + S

earnest phoenix
#

@earnest phoenix make a .replit file and put run="node yourbotfile.js"

worthy ivy
earnest phoenix
worthy ivy
earnest phoenix
#

Phone is best

willow mirage
earnest phoenix
#

browser moment

#

More fast and easy to use

willow mirage
#

lmao

worthy ivy
#

fun for the whole family

earnest phoenix
#

Yes using browser

#

My machine is a litle bit of old

long crow
small tangle
earnest phoenix
worthy ivy
#

if that even works

earnest phoenix
#

@quaint wasp try running console.log(__dirname) and see what it says

small tangle
#

absolute paths are possible yes

willow mirage
#

CPU: 0.0%

#

AHHAHA

#

ah fuck

#

the last one

#

0.7

earnest phoenix
worthy ivy
#

anyways

#

whats the best permission for setting a custom prefix for a server?

#

MANAGE_GUILD ?

earnest phoenix
#

It worked thanks

#

WHY DID YOU PING ME AGAIN

bronze bane
#

/poll”Wtf” a

sly sierra
earnest phoenix
#

/leaveserver

earnest phoenix
#

dude stop

errant flax
#

too lazy to type it out

#

but why is this happening?

earnest phoenix
#

Can i change bash to node js when i type language node js it didnt work

errant flax
earnest phoenix
#

And still same error

worthy ivy
#

how do you make it so that the bot can accept 2 prefixes?

#

using like one from a config.json, and the other for a custom prefix at a mongodb database

errant flax
#

get the data from mongodb then check if the data exist if not just use the default prefix aka from the config.json

worthy ivy
#

right now i just have args as

const args = message.content.slice(fetchprefix.prefix.length).trim().split(' ');
worthy ivy
#

i meant if there is a custom prefix applied to the guild, i want it to use the default global prefix aswell

#

so like 2 prefixes at once i meant

#

sorry for the misunderstanding

errant flax
#

this is how i do it

const ms = require("ms")
module.exports = {
  type: "msg",
  run:async(client,msg,cache)=>{
    if (!msg.guild || msg.author.bot) return
    const cd = cache.schema.get("cd.js")
    let prefix = await cache.prefix.fetch(msg.guild.id)
    prefix = prefix.prefix
    const commands = cache.classes.get("cmds.js")
    if (msg.content.startsWith(`<@${client.user.id}> `) || msg.content.startsWith(`<@!${client.user.id} `)) {
      if (msg.content.startsWith(`<@${client.user.id}> `)) {
        const str = msg.content.slice(`<@${client.user.id}> `.length)
        prefix=`<@${client.user.id}> `
        if (!str.includes(`<@${client.user.id}`)||!str.includes(`<@!${client.user.id}>`)) {
          msg.mentions.users.delete(client.user.id)
          msg.mentions.members.delete(client.user.id)
        }
      } else if (msg.content.startsWith(`<@!${client.user.id}> `)) {
        const str = msg.content.slice(`<@!${client.user.id}> `.length)
        prefix=`<@!${client.user.id}> `
        if (!str.includes(`<@${client.user.id}`)||!str.includes(`<@!${client.user.id}>`)) {
          msg.mentions.users.delete(client.user.id)
          msg.mentions.members.delete(client.user.id)
        }
      }
    }
    if (!msg.content.startsWith(prefix)) return
    const args = msg.content.slice(prefix.length).trim().split(/ +/)
    const cmd = args.shift().toLowerCase()
    const command = commands.get(cmd) || commands.find(a=>a.alias&&a.alias.includes(cmd))
    if (!command) return 
    if (command.cd) {
      const cdData = await cd.findOne({
        userId:msg.author.id,
        cmdName: command.name
      })
      if (cdData) {
        if (cdData.howLong>=Date.now()) return msg.channel.send(`Please wait ${ms(Math.abs(cdData.howLong-Date.now()),{long:true})} to run this command again!`)
        cd.findByIdAndDelete(cdData._id).then(()=>{
          command.run(msg,args,client,cache)
        })
      } else {
        const newData = await cd.create({
          userId: msg.author.id,
          cmdName: command.name,
          howLong: Date.now()+command.cd
        })
        newData.save()
        command.run(msg,args,client,cache)
      }
    } else {
      command.run(msg,args,client,cache)
    }
  }
}
#

what u mean by 2 prefix at once?

worthy ivy
#

like say, my global prefix is t!

#

and my server prefix is ;

#

i'd like them to be both usable

errant flax
#

oh then just check if the msg content starts with the global or server prefix

worthy ivy
#

const args = message.content.slice(fetchprefix.prefix.length).trim().split(' ');

#

like const args = message.content.slice(fetchprefix.prefix.length || prefix.length).trim().split(' '); ??

#

prefix is my global pref, and fetchprefix.prefix is my server only pref

#

if you dont get it sorry, my english is really bad jfc

errant flax
#
if (content.startsWith("t!")){
prefix="t!"
}

its easy as pie akkoshrug

#

u can do that with ur server prefix as well with else if

worthy ivy
#

ill try my best KEKW

sacred aurora
#

you can do it with regex too

worthy ivy
sacred aurora
#

you could do it like this

  const prefixRegex = new RegExp(
    `^(${firstPrefix}|${secondPrefix})\\s*`
  );
  if (prefixRegex.test(message.content)) {
    ///.......
  }
worthy ivy
#

hm

sacred aurora
#

then you can do

  const [, matchedPrefix] = message.content.match(prefixRegex);

  const args = message.content.slice(matchedPrefix.length).trim().split(/ +/);

to get the args

worthy ivy
#

what would i add in js if (prefixRegex.test(message.content)) { ///....... } then?

sacred aurora
#

do whatever you do with the message

sacred aurora
#

then run your command or something

worthy ivy
sacred aurora
worthy ivy
sacred aurora
#

yes

worthy ivy
#

oh ok sorry im really dumb rn

#

@sacred aurora it dosnt work

#

oh wait no

#

WAIT

#

IM STILL DUMB WAIT

sacred aurora
#

hmm

#

so is it working or not

worthy ivy
#

one sec

#

gimme asecond lmao

#

holy shit it works, thank you so much

worthy ivy
sacred aurora
#

oof

eternal osprey
#

oops sorry

earnest phoenix
#

1,521,157th

sacred aurora
#

nope

#

its js

old kite
#

I wish I knew it all

#

Now I know some

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

clinet.on("message", message => {
if(message.content == "Hi")
message.channel.send("Hi")
}
#

This is what I know

cinder patio
#

you have a lot to learn

old kite
#

I don't understand much English so I can learn it

#

google translate ^^

visual knoll
old kite
#

Arabic

night umbra
#

p

brave garnet
earnest phoenix
#

Can some one explain why is my bot talking to herself

cinder patio
#

Are you using multiple message listeners?

crimson vapor
#

How are you not getting a “cannot read property channel of undefined”

uncut mirage
crimson vapor
#

No it’s not in the message event scope

earnest phoenix
#

Also lol I haven’t got a channel name that

#

So the command won’t work

crimson vapor
#

Yeah, why is it working

earnest phoenix
crimson vapor
#

Nvm

earnest phoenix
#

Kk

earnest phoenix
#

But it’s still a error

plain talon
#

To use catch you have to also start it with try

#

Or not idk

earnest phoenix
crimson vapor
#

Define axios

earnest phoenix
earnest phoenix
#

And I made her type

#

But she isn’t taking

#

She’s just typing

plain talon
#

What is ‘chatBot’

earnest phoenix
#

Ohhh

plain talon
#

To send a message do message.channel.send(“message”);

copper cradle
split hazel
#

I thought for a second a random developer in topgg developed a bot with a consciousness

plain talon
copper cradle
#

I would explain what's wrong to them but my internet keeps going on and off

split hazel
#

same since yesterday its so annoying

earnest phoenix
plain talon
#

The let keyword is to define a variable

earnest phoenix
copper cradle
#

Pretty much the same

plain talon
#

Var also defines a variable

copper cradle
#

It works a bit different

#

But they're the same overall

plain talon
#

It’s better to use let over var from what i know

copper cradle
#

Yeah

earnest phoenix
#

If u cant use var dont u use const

plain talon
#

Const makes it uneditable(?)

earnest phoenix
#

Oh

plain talon
#

Yeah

#

Const makes it constant

#

So you can’t change it once its been set

earnest phoenix
plain talon
#

Bruh look up an introduction to us

#

JS

earnest phoenix
#

Idk what any of them I just caught own to looking at a lot of codes and learn to code a little from there

plain talon
split hazel
#

I forget everything from codecademy

#

I'd watch some very long js tutorial

#

at least you'll have tons of code as context

pale vessel
#

I already forgot how I fucking learned

#

How is that even possible

earnest phoenix
#

Lmao

#

I use to think coding was for Geniuses

#

🧍🏽‍♀️intill I started doing it it’s like learning to define words all over again

plain talon
#

A lot of the time coding is getting angry at your program for doing what you told it to do, not what you wanted it to do

earnest phoenix
#

Or be human

plain talon
#

Not really

split hazel
#

be human i hope that never happens

plain talon
#

AI is teaching your computer to be human

split hazel
#

when machines develop a consciousness I'd like to be dead

#

it'll destroy society

plain talon
#

Damn wont see u in the next 10 or so years then

#

😔

quartz kindle
#

maybe it deserves to be destroyed

split hazel
#

yeah but

#

it's like detroit become human

earnest phoenix
#

Atp Everyone will start to think the earth is raned by computers and not god

#

But the good thing is there computers soo 👀 someone could hack into them and destroy them

split hazel
#

the closest thing we have is gpt3 lol

quartz kindle
#

who says god is not a computer?

split hazel
#

but since its closed source I wonder if it'll go far

earnest phoenix
#

If he is then maybe we are

earnest phoenix
#

Non stop

quartz kindle
#

maybe we are multiple layers deep in virtual reality

earnest phoenix
plain talon
#

It’s called the matrix

quartz kindle
#

we can already create computers inside computers inside computers, so its not that far fetched

errant flax
#

is there an api for reddit?

plain talon
#

Yup

errant flax
#

can u show me the docs for it

plain talon
#

Don’t feel like googling eh

#
#

Here ya go

errant flax
#

thx

earnest phoenix
plain talon
#

@earnest phoenix have you seen the matrix

earnest phoenix
plain talon
#

You’ll enjoy it

earnest phoenix
#

Imma go look it up real quick

plain talon
#

It’s about escaping the illusion and going behind the scenes of reality

quartz kindle
#

dafuq, people who have not seen it exist?

earnest phoenix
#

Lol I have prime

quartz kindle
#

what timeline is this

stable eagle
#

Age of digitalization

quartz kindle
#

age of unculturism

earnest phoenix
#

Idk if y’all like kids movie but it’s a kids movie kinda like the matrix

plain talon
#

What

quartz kindle
#

what

earnest phoenix
#

Has a big plot twist

drifting shell
#

The matrix is the best anime

wary flame
#

Holup

plain talon
#

No that’s Corey in the house

#

SMH

quartz kindle
#

ruining good stuff lmao

earnest phoenix
#

I destroyed by discord bot a week ago it had 50 commands lmao it was on accident I accidentally copy and paste random things on it and could not fix it so I just saved all the codes

#

Imagine

solemn latch
#

That's why you don't copy paste without understanding code

wary flame
#

Imagine copy pasting for your discord bot

earnest phoenix
#

I was copy and pasting a poem

#

To my friend on discord and accidentally pasted it in 1k codes

plain talon
#

Ctrl a

earnest phoenix
#

Anyways lmao it’s fine now

plain talon
#

Ctrl + z

solemn latch
#

Ah, control + z

#

Yeah

earnest phoenix
#

^

#

Yes

wary flame
#

File > edit > undo
Photoshop moments

plain talon
#

Ctrl + shift + z for photoshop isn’t it

wary flame
#

I wish I knew this earlier

#

Does that work?

plain talon
#

Shift + ctrl + z lets you undo multiple times

wary flame
#

Oh thanks

plain talon
#

Alt + ctrl + z lets you re-do what you undid

quartz kindle
#

photoshop's undo redo keys are stupid

#

and they changed them from one version to another

plain talon
#

I swapped to affinity designer

quartz kindle
#

which is even more stupid

plain talon
#

Much better

quartz kindle
#

havent heard of it

#

looking it up rn

lyric mountain
#

as is office 365

#

like, why the hell would you change ALL shortcuts

copper cradle
#

I once used affinity photo

#

It was pretty nice

plain talon
#

I was too used to Adobe Fireworks, but as it ended support for it after CS6 I had to go elsewhere, only Affinity Designer has come close

pure lily
split hazel
#

I will now use my telepathic powers to figure out what's wrong with the command since you haven't given me any details

pure lily
#

playtop meaning when you queue something it should go first in the queue

cinder patio
#

how does it not work? What happens?

#

We can't find the problem without knowing what happens when you run it

crystal wigeon
#

Hey imm

#

I have a quick question

#

Is it good to store image urls in local storage for faster loads?

#

With a ttl ofc

plain talon
#

i love web development 🙃

bright thorn
#
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
    URL: wss://gateway.discord.gg
    Recommended Shards: 1
[WS => Manager] Session Limit Information
    Total: 1000
    Remaining: 0
[WS => Manager] Spawning shards: 0
[WS => Manager] Exceeded identify threshold. Will attempt a connection in 63587058ms

I get this is on my console log

#

anyone can explain me

#

please

lyric mountain
#

well, you're royally fckd

#

you could try reconnecting and see if that's a lib-defined time or a retry-after time

#

if it's a retry-after time...well...I hope you can deal with impatient users

#

for reference, that's around 1059 minutes

#

or 17 hours

willow mirage
cinder stratus
#
root      982695  7.1  0.7 748372 59968 ?        Ssl  18:29   0:01 node /root/tune/index.js
root      982706 52.7  3.2 1113040 263640 ?      Rl   18:29   0:10 node /root/tune/index.js
root      982724  0.0  0.0   8900   668 pts/0    S+   18:30   0:00 grep --color=auto -i tune
``` hey anyone knows how I can kill these 3 process whenever I use kill -9 <pid> it pops up with new pid
quartz kindle
cinder stratus
#

Yeah I fixed it, just removed pm2 completely then killed the process one by one with top command

solemn latch
#

👀 does JS have an out parameter for functions?
Started playing with C# and just learned about out.
seems like a good time saving measure.

lyric mountain
#

out parameter?

#

you mean, like, return value type?

solemn latch
#

I dont think its quite that.

    private void GetXY(Vector3 worldPosition, out int x, out int y)
    {
        x = Mathf.FloorToInt((worldPosition - originPosition).x / cellSize);
        y = Mathf.FloorToInt((worldPosition - originPosition).y / cellSize);
    }

when i use it

  GetXY(worldPosition, x, y);
  //I can use x and y here
  Debug.Log(x);

lyric mountain
#

ah, that

solemn latch
#

or y, so things are defined, and returned from a function

#

multiple things*

lyric mountain
#

that's odd

#

but in javascript you could just pass the class reference and assign like <class>.variable = value

#

then you can retrieve the variable the same way

bright thorn
#
DiscordAPIError: Invalid Form Body
message_reference: Unknown message
#

means?

rose warren
#

Your bot can't see the message you're trying to reference. It's either deleted or the bot doesn't have perms to see it.

bright thorn
#

Oh ohk

keen hare
#

Someone has a minimalistic and clean css for top.gg bot page? o:

slender thistle
#

If you don't want your page filled with random crap, you're very much smart enough and creative to create your own minimalistic design.

Inspect Element can help you if you are on PC

wheat mesa
#

Use markdown, honestly WAY easier than CSS/HTML

cinder patio
#

but not customizable

earnest phoenix
cinder patio
#

but bot pages are not blogs

quartz kindle
#

says who

#

welcome to my botspot

cinder patio
#

me

earnest phoenix
modest maple
#

you know

#

I wonder

#

CR_SipSpit can we submit massive forms

#

write the entire blog in the prefix section

cinder patio
#

why not bloblul

jagged plank
#

Does anyone know how to make a discord bot have an ‘about me’ page on its profile?

cinder patio
#

that's the bots' about me

jagged plank
#

Oh, thanks!

knotty talon
#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    const voiceChannel = message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
    if (!channel) return message.channel.send("fehfeuhfuhashf");
  }
}```
civic scroll
#

what

knotty talon
#

when I only type $leave

civic scroll
#

what's the problems

knotty talon
#

it says channel is not defined

knotty talon
civic scroll
#

message.member.voice

knotty talon
#

but when the bot is not in the channel then I type $leave it causes error

#

saying channel is undefined

civic scroll
#

message.guild.voice?.channel.leave();

knotty talon
civic scroll
#

add optional chaining

#

the thing is

#

if you are not connected

knotty talon
#

yeah

civic scroll
#

the voice is null ot undef

knotty talon
#

not mine

civic scroll
#

damn it

knotty talon
#

yeah it has error

civic scroll
#

you can use (message.guild.voice || {}).channel

#

oh yeah object destruct

#
const { channel } = (message.guild.voice || {})
if (channel) // do sth
#

nah

#

not mem efficient

cinder patio
#

if statements are superior here

civic scroll
#

my solution looks cleaner

civic scroll
knotty talon
civic scroll
#

yes

knotty talon
#

is that wrong

civic scroll
#

that

cinder patio
#

mmmm not really. It overcomplicates stuff and you're still using an if statement regardless

civic scroll
#

no

#

not wrong

#

correct since !undefined is true

knotty talon
#

cause its not working KEKW

#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    const voiceChannel = message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
    if (!channel) return message.channel.send("Bot is not in a VC");
  }
}```
#

I replace it in the bottom

civic scroll
#

NO

#

man

quartz kindle
#

why not just if(message.guild.voice) { message.guild.voice.channel.leave() }

knotty talon
#

aight

civic scroll
#

don't need curly brackets

knotty talon
#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    const voiceChannel = message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
if(message.guild.voice) message.guild.voice.channel.leave();}
}```
civic scroll
#

if it's a single-line statement

knotty talon
#

like this?

quartz kindle
#

you dont, but its good practice to use them

civic scroll
#

what

#

you leave the vc before checking

#

what a gamer

knotty talon
#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    if(message.guild.voice) return message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
  }
}```
cinder patio
#

but then the bot won't react or send a message

knotty talon
#

so like that?

cinder patio
#

not really, no

knotty talon
#

oh

civic scroll
#

@knotty talon lemme

knotty talon
cinder patio
#
if (!message.guild.voice) return;
 message.guild.voice.channel.leave();
 message.react('✅')
 message.channel.send('**Successfully Left the VC**');
civic scroll
#

also another problem

knotty talon
#

No I mean its leaving the VC when it is connected to a VC

civic scroll
#

unescessary import "Discord"

knotty talon
#

but when I type $leave it causing error

civic scroll
#

again

#

and rerun it

knotty talon
#

aight aight

civic scroll
#

the point is, you are not understanding execution order and its data

#

please at least consult the docs

knotty talon
#

sorry can someone join my replt im just so bad

#

so sorry

#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    const voiceChannel = message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
    if(!message.guild.voice) return message.channel.send("I am not in a voice channel");
  }
}```
#

like that?

civic scroll
#

r/facepalm

wheat mesa
#

🤦‍♂️

knotty talon
#

I'm sorry im bad

wheat mesa
civic scroll
#

@knotty talon okay so the execution order is as follows:
check for channel:
if no channel: return
else attempt to leave
send mesaage
return

wheat mesa
#

^

civic scroll
#

you leave the vc before checking

#

that's why it threw the err

cinder patio
slender thistle
#

Take things slowly, step by step

civic scroll
#

since when no connection voice is either null or undef
and neither of these has channel property so when you try to call it, that caused an error

#

also read the error stack

slender thistle
#

As the old quote says, slow is smooth and smooth is fast

knotty talon
#

I mean its leaving tho

civic scroll
#

it's your best friend when anything but async error

civic scroll
#

leaving is not the point, but also for you future commands

#

note stuffs downs first before writing code

wheat mesa
#

If you're new, it can be helpful to create a logical step-by-step plan for what you want your code to do

knotty talon
#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    if (!message.guild.voice) return;
    message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
  }
}```
#

last one

civic scroll
#

FINALLY

wheat mesa
#

There you go

knotty talon
#

yeah IK

civic scroll
#

reiven

#

you

knotty talon
#

but when I type $leave when the bot is not in the channel it cause error

knotty talon
#

I did that before

civic scroll
#

you should learn the language first

#

then the library

#

and soon you understand what you just asked is silly

knotty talon
#

I mean all I need is a error handling

#

I cant do it

slender thistle
#

Which you would be familiar with if you took your time to learn the basics

civic scroll
#

error handling is for intermidiates

#

after all, how can you handle errors if you don't know how to read them?

knotty talon
#

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    if (!message.guild.voice) return;
    message.guild.voice.channel.leave();
    message.react('✅')
    message.channel.send('**Successfully Left the VC**');
    if (!leave) return message.channel.send("Bot is not in a VC")
  }
}```
#

this should work

cinder patio
civic scroll
#

also use ``` next time

knotty talon
#

Cannot read property 'leave' of null

civic scroll
civic scroll
#

that

knotty talon
#

yeah

civic scroll
#

SEE

cinder patio
#

if (!message.guild.voice || !message.guild.voice.channel) return;

civic scroll
#

@cinder patio no

#

don't

#

just channel part

#

voice can't be null

#

so it's okay

cinder patio
#

it can

civic scroll
#

it can't

#

my bot uses v12 libs

#

i know

knotty talon
cinder patio
#

but you just said it can't

near stratus
# knotty talon ```const Discord = require('discord.js'); module.exports = { name: "leave", ...
const Discord = require('discord.js');

module.exports = {
  name: "leave",
  aliases: [],
  description: "loops throught current song",

  async run(bot, message) {
    if(!message.guild.voice) return;
    const leave = await message.guild.voice.channel.leave()
    if(!leave) {
      return message.channel.send("Bot is not in a VC")
    }
    else { 
        await message.react('✅')
        await message.channel.send('**Successfully Left the VC**');
    }
  }
}
civic scroll
near stratus
#

try this

cinder patio
#

that won't catch the error

civic scroll
cinder patio
#

smh bad advice from every angle

civic scroll
#

also Discord is unused

near stratus
#

Yeah i don't if(!leave) {

near stratus
cinder patio
#

your code won't catch the error in his console

near stratus
knotty talon
#

not this tho wtf

civic scroll
#

null is basic data type

#

so is undefined

knotty talon
#

cap KEKW

civic scroll
#

???

brave garnet
#

Cap

knotty talon
#

Ik client.login

#

Hahahaha

#

jk

civic scroll
#

welp

#

here goes

civic scroll
#

lemme write the code and get this done with

knotty talon
civic scroll
#

@near stratus promises are too advanced for him imo

near stratus
#

^~^

slender thistle
civic scroll
#

lemme get his org code

near stratus
cinder patio
#

I don't hate you, but you're wrong

near stratus
#

Yea Rocket science is easier than learning how to poop

cinder patio
#

I feel like javascript is objectively easier to learn due it's relaxed nature, it's just that a lot of people can't be bothered to understand the basics and that's why there are so many incompetent "devs"

wheat mesa
#

js is very forgiving compared to java

#

Mostly due to weak typing

civic scroll
#
module.exports = {
  name: "leave",
  // attr whatever here
  run: async (bot, message) => {
     const { channel } = message.guild.voice || {};
     if (!channel) return message.channel.send("not in vc");
     return channel.leave()
      .then(() => message.channel.send("left successfully"))
      .catch(console.error);
  },
};

@knotty talon

civic scroll
#

sorry, typing on my phone takes time

#

but there you go

cinder patio
#

exactly and they choose javascript cause it's the easiest, and it would be easy for them too if they bothered to learn

#

or maybe programming is not for everyone

civic scroll
#

i used object destructuring, optional assignment and promise-based methods @knotty talon
look those terms up if you don't get it

knotty talon
#

aight ty

#

but your thing had error

civic scroll
knotty talon
#

ahh aight ty

near stratus
civic scroll
#

that has no "await"

civic scroll
knotty talon
#

module.exports = {
name: "leave",
// attr whatever here
run: (bot, message) => {
const { channel } = message.guild.voice || {};
if (!channel) return message.channel.send("not in vc");
return channel.leave()
.then(() => message.channel.send("left successfully")
.catch(console.error);
}
};

cinder patio
knotty talon
#

it says I need a bracket

cinder patio
#

you're missing a ) at the end of .then(() => message.channel.send("left successfully")

near stratus
civic scroll
#

sorry

cinder patio
#

and you were reborn

#

you're now a new man

brave garnet
#

I'm yet staying away from js...

civic scroll
knotty talon
#

thanks a lot

#

I will read the article you sent me @near stratus

#

tyty

near stratus
civic scroll
#

sayuri remembers first time discord bots

#

what this dollar sign do

cinder patio
#

why are you talking in 3rd person

civic scroll
#

yes

#

i refer to past self

near stratus
civic scroll
#

no

brave garnet
#

No

near stratus
#

yes

civic scroll
#

i was talking about string literals

knotty talon
#

its the ${}

near stratus
civic scroll
knotty talon
#

no.

civic scroll
#

it also have some other stuffs too

knotty talon
#

oh yeah

#

I heard of it

#

from heroku

near stratus
knotty talon
#

process.env.token

civic scroll
#

do you know with process you can print this to your console live and have it updated everytime in 60fps

near stratus
#

anyway bye gonna sleep

civic scroll
#

sweetdreams

knotty talon
#

ahh

knotty talon
civic scroll
#

not console log tho

#

and i didn't use any packages for coloring and styling either

cinder patio
#

stop comparing brain sizes

civic scroll
#

no i'm just saying what he could do

#

it's very powerful, if you know how to use it

#

just... learn properly

#

and only learn what you need

#

good luck with your bot @knotty talon

cinder patio
#

cored output to console... yeah sounds very powerful

knotty talon
civic scroll
#

i use stdout instead of console

#

so i have more control

#

just that i have to convert everything to string

#

before i pass

wheat mesa
#

doesn't it automatically call toString() on everything that it can?

civic scroll
#

when typescript

brave garnet
#

When python?

civic scroll
#

console.log will auto call toString

near stratus
civic scroll
#

but not process.stdout

brave garnet
pale vessel
wheat mesa
#

194 errors at 3am

#

typical dev things

sudden geyser
#

Just let it fail in production

restive furnace
#

well, you could make a native module to call printf under the hood

brave garnet
#

?!

#

@rustic nova !!! Steam scam!!!

#

<@&304313580025544704>

modern sable
#

fucking hell

brave garnet
#

Stean...

modern sable
#

might even yeet that ping today at this point

#

-atmods

gilded plankBOT
#

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
brave garnet
#

Was raid

#

Or smth

modern sable
#

one message isnt a raid

brave garnet
#

Aanyways. Mod issue

solemn latch
#

please dont ping all mods for any mod issue

wet dove
#

@brave garnet dont star any unfunny content ty

brave garnet
#

It was funny. Don't ping mod for mod issue... Normally pato...

modern sable
#

you can ping one mod

#

not 20

brave garnet
#

Bro...

brave garnet
modern sable
#

then what was that mod ping

wet dove
#

And then you pinged the whole mod role

modern sable
#

if one mod doesnt respond

#

ping another one

lyric mountain
#

basically:
ping one mod -> someone being naughty, scam, spam, nsfw, etc etc
ping all mods -> top.gg is literally on fire, mass attack, veld goes haywire, etc

brave garnet
#

Yeah because wasn't deleted

modern sable
#

dont ping the entire role

brave garnet
#

OK but... Won't u ban me after this one?

#

;-;

feral aspen
#

My braincells.

#

Dude.. I legit don't want to ask anymore.. let me just get my braincells back.

old umbra
#

is it possible to change the business there in the way? because it is together with the bottom then it gets weird

lyric mountain
#

what business?

crimson vapor
earnest phoenix
crimson vapor
#

Thank

thorny cargo
#
client.on('message', message => {
message.channel.send(message.content)
message.delete()
}
```It works well but, the only problem is that it will delete and repeat the bot message too :/ so it end up being a spammer repeater
plain talon
#

message.author.bot

thorny cargo
quaint wasp
#

what the heck is this..

23.07 18:48:32 [Bot] /node_modules/discord.js/src/rest/RESTManager.js:32
23.07 18:48:32 [Bot] const token = this.client.token ?? this.client.accessToken;
23.07 18:48:32 [Bot] ^
23.07 18:48:32 [Bot] SyntaxError: Unexpected token '?'
23.07 18:48:32 [Bot] at wrapSafe (internal/modules/cjs/loader.js:1047:16)
#

it litilery doesnt let me start the bot

quartz kindle
#

outdated node version

earnest phoenix
quaint wasp
#

I now got version 15.6.0 or smth like that, but now it tells me this:

23.07 19:02:10 [Bot] throw new TypeError('CLIENT_MISSING_INTENTS');
23.07 19:02:10 [Bot] ^
23.07 19:02:10 [Bot] TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
#

what does that mean

wheat mesa
#

Gateway intents

#

@solemn latch

#

That’s one of the better ones I’ve seen so far!

#

More believable than the usual steam scam

quaint wasp
#

lol

quaint wasp
#

?

wheat mesa
#

Show your code

quaint wasp
#

for wut

#

I got like 130 files

wheat mesa
#

Wherever the error comes from/wherever you instantiate your client

quaint wasp
#

I dont think I do at all

#

All I did was added a preinstail called "Multiple bots at ones" on pebblehost

#

and now I moved all my files to folder called "Bot1"

#

and am now re-adding all my dependencies because they were cleared for no reason.

wheat mesa
#

not sure how to help then ¯_(ツ)_/¯

quaint wasp
#

this is the full erorr:

#
23.07 19:02:10 [Bot] /node_modules/discord.js/src/client/Client.js:513
23.07 19:02:10 [Bot] throw new TypeError('CLIENT_MISSING_INTENTS');
23.07 19:02:10 [Bot] ^
23.07 19:02:10 [Bot] TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
23.07 19:02:10 [Bot] at Client._validateOptions (/node_modules/discord.js/src/client/Client.js:513:13)
23.07 19:02:10 [Bot] at new Client (/node_modules/discord.js/src/client/Client.js:73:10)
23.07 19:02:10 [Bot] at Object.<anonymous> (/Bot1/index.js:3:16)
23.07 19:02:10 [Bot] at Module._compile (node:internal/modules/cjs/loader:1108:14)
23.07 19:02:10 [Bot] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
23.07 19:02:10 [Bot] at Module.load (node:internal/modules/cjs/loader:973:32)
23.07 19:02:10 [Bot] at Function.Module._load (node:internal/modules/cjs/loader:813:14)
23.07 19:02:10 [Bot] at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
23.07 19:02:10 [Bot] at node:internal/main/run_main_module:17:47 {
23.07 19:02:10 [Bot] [Symbol(code)]: 'CLIENT_MISSING_INTENTS'
23.07 19:02:10 [Bot] }```
wheat mesa
#

Okay well that would’ve been helpful

#

Index.js

earnest phoenix
#

You need to provide intents in your client options

quaint wasp
#

full?

earnest phoenix
#
new <discord.js>.Client({
  intents: <intents>
});
quaint wasp
#

o...

#

so there will have to be the word new before it, right?
(Just so I could use the ctrl + s to search the word)

earnest phoenix
#

yes, <discord.js>.Client() is a constructor

#

Imagine not importing client directly

#

what a noob

#

The error is thrown at line 3 of your index.js file

wheat mesa
#

I prefer instantiating a client manually imo

quaint wasp
#

o

earnest phoenix
#

What do you mean manually

quaint wasp
earnest phoenix
#

Its not going to do it for you

quaint wasp
#

const client = new Discord.Client();

earnest phoenix
#

@quaint wasp Just show your code

earnest phoenix
earnest phoenix
#

With the new d.js update you have to pass in intents

#

it no longer does it for you

#

As voltrex stated several times

quaint wasp
#

what kind of intents

earnest phoenix
#

Lord o mercy

quaint wasp
#

like.. litilery just intents: <intents> ?

earnest phoenix
#

You never heard of gateway intents?

quaint wasp
#

I never used v13

#

Nope.

earnest phoenix
#

Then why is it requiring intents

wheat mesa
earnest phoenix
#

Iirc only v13 requires you to pass in intents

#

Since it uses the new discord api

#
new <discord.js>.Client({
  intents: Object.keys(<discord.js>.Intents)
}); 

This should allow your bot to use all the intents, if you don't want all intents; you should check out the links sent in this channel

#

Why are you doing that

#

You could just use the ALL Flag if you want all the intents

#

no

#

What do you mean no

#

That property was removed in v13

#

They aren't using v13 they said

#

So it is still valid

quaint wasp
#

no

#

I am starting to

earnest phoenix
#

You legit just said-

#

They're using v13, they meant they never used v13 before

#

Oh okay

#

Well then

#

That will still cause issues

#

Since it uses all intents even the priv ones

quaint wasp
#

ya...

earnest phoenix
#

So unless they have the priv intents enabled on their bot page

#

It won't as long as their bot is not verified and they have them enabled in the developer application

#

They need to be specific

quaint wasp
#

But I got a question.. are there lots of changes? Like will I have to re-write like more than half of the code?

earnest phoenix
#

Probably not

#

There's a few breaking changes

#

Yea

#

There it is

#

I was looking for that

#

ahaha

#

Such as interacting with voice is now its own module

#

You need the discordjs/voice package

quaint wasp
#

o...

#

shoot....

earnest phoenix
#

Kinda cool

quaint wasp
earnest phoenix
#

What is confusing about it

#

Maybe I could help

#

But it shouldn't matter

#

you are using v13 now

quaint wasp
#

Does client.on("event name", function () { //code }) still work?

earnest phoenix
#

Uh yes

#

why wouldn't it

#

Also

#

To manage dms you need the CHANNEL partial enabled

#

So you can receive messages from a dm

#

My bad

#

not guild

#

I meant DM

quaint wasp
#

alright..

earnest phoenix
#

Event names have changed?

#

Since when?

#

For example the message event has been renamed to messageCreate

#

Really?

#

yea

quaint wasp
#

wow..

earnest phoenix
#

Seems pointless

quaint wasp
#

ya..

#

Is there a new thing to message?

earnest phoenix
#

I get why they did it

#

But seems a bit pointless

#

They're trying to keep consistency with the official event names provided by Discord's gateway

quaint wasp
#

why?

earnest phoenix
#

Yea

quaint wasp
#

oh.

earnest phoenix
#

Even <TextChannel>.send() was entirely modified

quaint wasp
#

whyy

#

Did they add some things?

earnest phoenix
#

Yes

#

With the new interactions

quartz kindle
#

they are redesigning a large portion of the library, god knows why

earnest phoenix
#

Just because of people messing up a lot of shit because of 2 parameters