#development

1 messages · Page 1890 of 1

ripe prairie
#

yeaaaa

#

mann

#

I wish I could just do something like

#

Add it to the end

#

Then just shift all the elements easily

#

But that sounds like too much magic

quartz kindle
#

well, no matter what you do, its always gonna be o(n)

ripe prairie
#

yeah

#

C++ dum

quartz kindle
#

wait

#

why not just use a normal vector

#

but read it in reverse?

#

lmao

#

reverse iterator exists

ripe prairie
#

huh

#

Would that work even though I'm constantly adding new elements?

quartz kindle
#

it should

#

everytime you run a new iterator it should start from the new last item

cold meteor
#

Sorry bit off topic but em- im trying to make a error 404 page for my website and for some reason im getting this.

#

Any clue how to fix this?

boreal iron
#

utf8 is the keyword

#

Did you save the file as ascii format?

cold meteor
#

Mmm i can show u what i got.

#

any chance you can vc?

boreal iron
#

Huh no I’m driving

#

Could also be a wrongly configured charset value in your webserver config

stray seal
#

How do i do this in chat?

#

Showing the time and everything

cold meteor
#

Its kind of stupid because when previewing the document everything is fine!
BUT- the moment i load it into the browser then its like- nahhhh

boreal iron
#

Open the file with your Windows notepad, press save as and check if utf8 is selected or ascii

#

Sounds more like a webserver misconfiguration but make sure that’s not the issue in the first place

cold meteor
#

its currently utf8

#

@boreal iron

boreal iron
#

Yeah it’s the webserver then

cold meteor
#

ah- how would i fix that?

boreal iron
#

Which software do you use?

#

Apache, NGINX…?

cold meteor
#

I got a webserver thats using a directadmin panel

#

sooo truth be told- no clue

boreal iron
#

Is there a httpd.conf file somewhere?

#

If the signature is enabled by default, just create a blank 403 site

#

The webserver version and software will be shown if signatures are enabled

#

But if you got an administration panel anyways it might be a setting in there somewhere

#

Search how to change the charset

cold meteor
#

Gimme a sec

wheat mesa
#

(Or another modifier than R, I can’t remember them off the top of my head though

boreal iron
cold meteor
#

Yeah sorry

#

Im still messing around with it

boreal iron
#

Huh np was wondering only

cold meteor
#

Fixed the issue

#

Made a quick change in the html file

#

Adding the ASCII set ' to make '

boreal iron
#

You set a wrong charset min it?

cold meteor
#

It didnt seem like it, the webserver was set to UTF-8

#

and changing it to ASCII or ISO didnt do shit

boreal iron
#

That wil not fix your issue

#

Hm weird

cold meteor
#

Might be a google font thingi tho

boreal iron
#

Oh

cold meteor
#

Thank you for the help! i appreciate it!

boreal iron
#

That’s an important information tho

cold meteor
#

Oh my apologies.

boreal iron
#

Yeah not all fonts support special chars

cold meteor
#
    <link id="u-page-google-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Barlow:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i">```
#

I got these 2

boreal iron
#

But I mean you find that out real quick loading the default font

#

Just to make sure

#

This could mean more trouble for you later on

cold meteor
#

Yeah thats true potentially

#

Truth be told this is my first time working with css etc to make a fully fledged website so.

boreal iron
#

But if it’s a font issue idk why using the hex or ascii tags would make a difference then

#

Hmm well can’t take a look atm unfortunately

#

Maybe head back to me in 12 h, should be at my PC than

#

If you couldn’t figure it out

cold meteor
#

Nope- nothing changed.

#

Im not sure what is but ill try to figure it out

ripe prairie
#

@quartz kindle

    void push_front(const Object & x){ 
      if (theSize == theCapacity){
        reserve(2 * theCapacity + 1);
      }

      for (int i = theSize; i > 0; i--){
        objects[i] = objects[i - 1];
      }

      theSize++;
      objects[0] = x;
    }```
#

this is as best i got

#

gave me ~270ms at 10k elements

#

as opposed to ~450 at 10k before with my older method

#

i think thats a pretty pogthumbsup moment

wheat mesa
#

c++ moment

#

I approve

ripe prairie
#

pain

#

@quick ginkgo send help

#

ur good at c++

quick ginkgo
#

what

#

what the fuck are you doing

#

and why

quick ginkgo
quick ginkgo
ripe prairie
#

its for an assignment

#

or was, i already handed it in

#

and it's a vector class

#

@quick ginkgo

quick ginkgo
#

i dont know anythin with c++

ripe prairie
#

oh

quick ginkgo
#

i put random code until it bluescreens the pc

#

which is my goal

ripe prairie
#

i... see

grim aspen
#

ez destruction

spark flint
#

anyone here used pterodactyl panel?

#

i'm trying to setup on a vps

#

but im failing

proven lantern
#

is there a way to send a message to a text channel that only one user sees?

lyric mountain
#

Ephemerals

#

But u can't send one without user interaction

#

Which sucks

proven lantern
#

that's awesome! slash commands are great. im going to replace all my DM code with this

quartz kindle
ripe prairie
brave stump
#

A

proven lantern
#

is there someway to input a date into a slash command parameter?

#

<t:1632969154>

#

is there some sort of date picker?

boreal iron
#

Looks like there’s no component type yet.

errant flax
lyric mountain
errant flax
#

or what KuuHaku said

proven lantern
#

i do what moment.js does

wheat mesa
#

Enjoy having users complain when they can’t enter 1-1-21 correctly

proven lantern
#

1 year 2 month => 3.68164136 × 1010ms

lyric mountain
#

That moment when u type 01-02-21 and don't know whether it's Feb 1 2021, Jan 2 2021, Feb 21 2001 or Jan 21 2001

proven lantern
#

/event starts-in: 1 month 2 days

errant flax
#

like MM-DD-YY

#

in the description of the option

lyric mountain
proven lantern
#

no date formats

errant flax
#

i just use ms to parse things like 1 second 2m

proven lantern
#

const eventStartsAt = moment().add(2, 'days').add(1, 'month');

inner fulcrum
#

guys suggest hosting pls

marble juniper
#

@drowsy crag look at this

earnest phoenix
#

Is there a way to set aliases of app / commands

brave stump
errant flax
earnest phoenix
#

No need to ping random people for help, people will help once they know the answer

#

You're trying to install a non-existent version of discord.js

proven lantern
#

i dont know

cobalt junco
#

There is no discordjs v12.6.1

royal herald
#

go to package json and change discord.js version to 12.5.1

#

np

earnest phoenix
#

You're trying to use a variable you never declared, declare it and learn basic JS; there are tons of free courses out there

cobalt junco
#

I suggest you to learn JS first
You do not define Discord

royal herald
royal herald
#

i learned js from Mozilla for example

#

its a rlly good source

carmine magnet
earnest phoenix
#

yea, you should learn the programming language you're using

#

Or else you may encounter tons of errors which you have no idea on how to resolve them so you'll repeatedly ask for help like you were doing

proven lantern
#

the @everyone role id is the same as the guild_id on every server right?

pale vessel
#

Yes

proven lantern
#

thanks!

scarlet cliff
#

im making a web dashboard and im currently at the oauth part,
i heard about the "state" param multiple times while looking at various docs but monke brain still no understand how can it prevent csrf or how to use it exactly
from what i understood:

  1. browser make random string, put into localstorage and set it to the state param when opening oauth link

  2. after you get returned to the callback url the oauth service (discord in my case) returns it to the callback url in a param

  3. ????

earnest phoenix
earnest phoenix
#

so any malicious script logging the cookie will get an empty string

#

(this also means your own website cannot send the cookie through javascript you'll have to send the user data on page load)

scarlet cliff
cinder patio
remote nova
#

anyone help me why this error is coming idk i just started my bot today and getting this error also no command is working in my bot too

bright thorn
#
TypeError: Assignment to constant variable.
    at Object.run (C:\Users\REAL PUKHRAJ\Desktop\Real-Music-Update\commands\Misc\customplaylist.js:485:32)
    at Client.<anonymous> (C:\Users\REAL PUKHRAJ\Desktop\Real-Music-Update\events\messageCreate.js:52:21)
    at Client.emit (node:events:394:28)
    at MessageCreateAction.handle (C:\Users\REAL PUKHRAJ\Desktop\Real-Music-Update\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\REAL PUKHRAJ\Desktop\Real-Music-Update\node_modules\discord.j

this error

#

anyone can explain

#
 if (!player) {
                        player = client.manager.create({
                            guild: message.guild.id,
                            voiceChannel: message.member.voice.channel.id,
                            textChannel: message.channel.id,
                            selfDeaf: true,
                        });
                        player.connect();
                        player.set("message", message);
                        player.set("playerauthor", message.author.id);
                        playercreate = true;
                    }
#

code is here

earnest phoenix
#

Make the variable mutable by declaring the variable using the let keyword instead of const (The var keyword can also be used but its not recommended as it's scope is attached to the global scope and can be declared multiple times, which can cause unintended behavior and bugs)

spark flint
#

what is the best platform for me to be able to sell subscriptions on, whilst allowing the user to input information such as userid and botid when checking out?

split hazel
#

the big bots seem to prefer chargebee

#

and you should implement that on your own

#

there aren't many subscription services that let you do that it's also very unintuitive

#

login through website -> pick server -> checkout modal -> check purchase status -> activate

earnest phoenix
whole totem
#

I'm currently writing a blog post about APIs. Can you give me your opinion on APIs and whether you even use them? And if so for what?

earnest phoenix
#

use discord api for example

lethal pine
#

Hey! can anybody explain me what is crypto.js ?

split hazel
#

does cryptographic operations?

earnest phoenix
earnest phoenix
#

uses discord api

outer perch
#

is there a way to make the bot reload the files without closing itself?

earnest phoenix
#

require() all the commands again ¯_(ツ)_/¯

scarlet cliff
#

dont forget that delete require.cache["file path here"]

lapis thunder
#

Hey

#

Does anyone know how your bot on top.gg can display its guild count?

earnest phoenix
lapis thunder
#

Like this

lyric mountain
#

Use the api

lapis thunder
#

Like what do I need to do?

solemn latch
scarlet cliff
#

could you just fake that and put like an insane amount while ur actual server count is 2

solemn latch
#

Sure, but then your bot will be deleted from our site

lapis thunder
#
int serverCount = ...; // the total amount of servers across all shards

api.setStats(serverCount);
outer perch
scarlet cliff
#

import("file").then(brbrbr => {
//stuff
})

#

you can use require in ts btw

earnest phoenix
#

any tips on how to debug this

#

it only shows that

#

but not where error it happened (at which line)

lyric mountain
earnest phoenix
#

nop

lyric mountain
#

is that the whole error?

boreal iron
#

Do you handle the errors?

earnest phoenix
#

sec lemme show u

#

and im not even sending a message, it sends what its supposed to send, then that error happens

#

blyat

cobalt junco
#

@mod scam

lyric mountain
#

@drowsy crag scam

cobalt junco
earnest phoenix
lyric mountain
#

is there any part in the code where you reply to a message?

earnest phoenix
#

btw that guy was just asking for people to play with him xd

earnest phoenix
#

nvm i found the issue

lyric mountain
#

nice

errant flax
#

whats like the best lang to make a website that has some authentication etc.

boreal iron
#

A server sided language, like PHP

errant flax
#

ah iara_sunglasses_cool

earnest phoenix
#

how do i make (key) accessible to function bellow?

quartz kindle
#

[key]

#

but like, thats extremely inefficient, its loading the file again everytime you read it

#

just load the file once, and keep it loaded

errant flax
quartz kindle
#

blasphemy

errant flax
#

java can do websites?plump_isee

quartz kindle
#

any lang can lol

errant flax
#

oh

#

lel

lyric mountain
#

SQL website when???

earnest phoenix
#

even when i require it it still returns undefined

errant flax
#

.json website when

quartz kindle
errant flax
#

.txt website when

#

wait nvm

#

it can be a website

#

if some website parses it

#

and .md

earnest phoenix
#

but once json is loaded, will it update data when its changed?

quartz kindle
#

.key is a literal .key, [key] is the value that key contains, not the literal key

sturdy vine
#

what could be the problem?

#

heroku build failed

errant flax
quartz kindle
sturdy vine
lyric mountain
earnest phoenix
#

thats why i read it every time

errant flax
quartz kindle
#

for example, ```js
loaded[key] = newvalue
fs.writeFileSync("file", JSON.stringify(loaded))

both loaded and the file are changed, but you continue using loaded only
lyric mountain
#

does npm need any special repo to fetch github stuff?

sturdy vine
#

actually it worked fine till now

#

but when i restarted my bot yesterday this error came

earnest phoenix
#

this works

#

its a small bot tho

#

doubt its gonna cause some problems

lyric mountain
#

they all say that

#

until it cause

quartz kindle
#

well alright, but if you start noticing slow downs, it will likely be because of that

#

until then its fine

clear marlin
#

until then

earnest phoenix
#

but if i dont know when json updates, how am i gonna deal with that

clear marlin
#

go back to dev

sturdy vine
#

when i run my bot on my PC it works fine

earnest phoenix
#

it updates from another app

sturdy vine
#

whats wrong with heroku

quartz kindle
#

you update it from another app?

earnest phoenix
#

yes

lyric mountain
#

just check file CRC or something

#

if they mismatch is because file changed

quartz kindle
#

well, the proper way would be for the other app to somehow be connected to the bot app so they can communicate, but thats more complicated to setup

lyric mountain
#

or just attach a file listener

quartz kindle
#

you can also use a file watcher yes

lyric mountain
slender thistle
#

Rust
Is there any preferred/best way to divide days into weeks starting from a specific date and month? I'm thinking about storing a Vec<Date<Utc>> in memory and each entry's index would be the week's number.

quartz kindle
#

whats the use case?

#

usually you can get away with that using only division and modulo

#

no need for arrays

lyric mountain
#

ye, modulo the day by 7

slender thistle
#

A calendar of some sort where each day contains some data

lyric mountain
#

it'll be exatcly which day it is in the week

quartz kindle
#

you can store the data in a vec<data> and access it directly by division+modulo+floor the starting date

#

you can calculate the indexes like a sort of hash table

lyric mountain
#

+floor
just cast to int pleb 🗿

quartz kindle
#

cast to uint8

slender thistle
#

Forgot to mention that the data might be dynamic depending on what group the data refers to. That would mean I have a HashMap with groups and the data for each weekday.

How would div+mod+floor help me exactly? The data may vary for each week

#

u128 ftw

quartz kindle
#

xD

#

each group has its own list of dates?

#

and each list of dates has data asigned to arbitrary dates?

#

that may not be sequential?

slender thistle
#

Not dates exactly, but each date has specific data. Say, a list of items each group has to bring/buy

#

Let me rephrase this in a way I myself can understand KEKW

quartz kindle
#

xD

lyric mountain
#

so days 0-6 would be week 0, 7-13 week 1, 14-20 week 2 and so on

slender thistle
#

The data sequence alternates between odd and even week number. Each group has their own items on each weekday

#

Something like:

data = {
    'Group1': [('Banana',), ('Apple', 'Pen',), ('Fucking piano',), ('Hats', 'Helmets',), ('Laptops', 'Bags',), ('Body', 'Shovels',), ('Pickaxes', 'Grenades',)]
}

Each tuple in the list indicates items the group should bring. Their indexes will indicate the weekday

#

I was thinking just going with a while loop until I hit the date I need, but... yeah, it's a bit not fun

lyric mountain
#

data['Group1'][day % 7]

slender thistle
#

My issue isn't about finding the data I need, but about actually storing the weeks in my Vec

quartz kindle
#

are the items different every week?

slender thistle
#

They alternate with each passing week. Weeks 1-3-5 have one sequence, weeks 2-4-6 have another

quartz kindle
#

are they different for each group?

slender thistle
#

Yup

quartz kindle
#
data = {
  group1: {
    odd: [ day1, day2, day3, ... ],
    even: [ day1, day2, day3, ... ]
  }
}
``` something like this?
slender thistle
#

Mhm, that explains it better

#

The issue with storing data is resolved, but my initial issue with storing weeks in my Vec remains XGWkekwlaugh

quartz kindle
#

you need to store them so you can retrieve them later as labels or something?

#

technicaly you dont even need to store them at all, you can always recreate/recalculate them from your pattern, no?

slender thistle
#

It's a calendar so I'd prefer to have convenient (and optimized) way to retrieve such data for weeks in a month

#

Oh, that could be possible, I think

#

Saves me some RAM if I can pull that off correctly lol

quartz kindle
#
time = timestamp - starttime; // in ms
day = floor(time / 86400000);
dayofweek = day % 7;
week = floor(day / 7);
type = week % 2 ? "odd" : "even";

val = data[group][type][dayofweek];
return {
  day,
  dayofweek,
  week,
  val
}
#

you can do a for loop with a timestamp range where you increment by 86400000 and rerun that to create the calendar

slender thistle
#

Huh

#

I'm actually working with chrono which abstracts the timestamp work for me

#

I'll see what I can do

solemn latch
#

somewhere above line 2 of index.js

bright thorn
#

😅

scarlet cliff
#

can someone explain what is happening in here

solemn latch
#

can you show where?
it must be in line 1 to function, as you are using it on line 2.

wheat mesa
#

That’s why

#

JS is case sensitive

solemn latch
#

discord is not Discord

wheat mesa
#

You’re defining it as discord when you need to define it as Discord

solemn latch
wheat mesa
#

No

solemn latch
#

the squiggly line typically means "somethings wrong"

wheat mesa
#

const Discord, not const discord

rich copper
#

This type of mistakes I used to make in python

solemn latch
#

verified bot dev doesnt mean anything

solemn latch
#

most verified bot devs just stole the code and ran it

wheat mesa
#

I can go to GitHub and copy paste a bot and get verified bot dev on here

#

So it doesn’t really mean much

#

Why would I need to invent a time machine when I already have one smirk

#

Learning js is the first step

#

(Or the language you want to make your bot in)

#

Starting off with discord bots will probably be overwhelming

#

🙂 happy to help

meager sinew
#

So not off-topic

lapis thunder
#

Does anyone have a layout on how I can implement guild counts for my bot?

#

Like that

quartz kindle
#

you need to post them to the top.gg api

scarlet cliff
#

we answered your exact same question a couple hours ago ._.

boreal iron
quartz kindle
#

lmao

spark flint
#

same response lmao

boreal iron
#

Fucking Windows trash

spark flint
#

my screenshots do pretty much always cut off half way

boreal iron
#

We did post that even on the same timestamp, lol

#

You see... old people are on the same level

spark flint
#

lol

lyric mountain
#

limão

boreal iron
#

eww a south american lmao

#

shoo

outer perch
quartz kindle
#

no, its on purpose

earnest phoenix
#

run npm i discord.js in shell

boreal iron
#

Use npm init

cerulean matrix
#

Fake

#

Scam!

#

Anyone ban him

boreal iron
#

Try to remember where you called npm the last time oldEyes

cobalt junco
#

You provided an invalid token

#

You probably typed wrong in client.login()

boreal iron
#

There's no command, you need to put the token into your code

#

Loggin in the client

cobalt junco
#

Ok, how do you declare your token in .env?
This is case sensitive as well

scarlet cliff
#

you need to load the actual .env

#

first do npm i dotenv
then add this at the top of your index.js require("dotenv").config();

#

ye

earnest phoenix
#

there is no .env file on replit

#

it wont let you make one

#

you have to use the lock button on the left

scarlet cliff
#

oh its replit

earnest phoenix
#

did they do touch woman .env

scarlet cliff
earnest phoenix
#

you just learned how to code 🎉

quartz kindle
#

also, for future reference, repl.it also has a button on the sidebar for installing packages

#

no need to run npm commands

scarlet cliff
earnest phoenix
#

that is what i said

#

bruh

#

you pressed the stop button

#

on top

quartz kindle
#

whats your code?

#

its internal status doesnt matter

#

wheres your client.login?

boreal iron
#

Loggin in the client

#

we already had that

quartz kindle
#

...

#

Lol

#

you put the token in the lock, not client.login

wheat mesa
earnest phoenix
#

I beg you PLEASE 👏 LEARN 👏 JS 👏 BEFORE 👏 MAKING 👏 A 👏 BOT

grim aspen
#

ok js

#

let's pause for a second

wheat mesa
#

Average bot login in environment variable file fan

quartz kindle
#

in your code:
client.login(process.env.TOKEN)

in the repl.it lock:
key: TOKEN
value: 97t734yt3h0y83j048y34y.34y973h4y3h4y83h4y803h04y834

boreal iron
rose warren
#

Tim token leak confirmed

#

:^)

quartz kindle
#

yes, thats my token

#

hack me

wheat mesa
#

Hacked

quartz kindle
#

thanks

wheat mesa
#

Np

boreal iron
#

integrating cheap ads into your bot

earnest phoenix
#

@quartz kindle what are you wondering ofc you're a programming god

scarlet cliff
earnest phoenix
#

not to sound rude but we're not op we just have common sense

wheat mesa
#

Imagine how active this channel is gonna be when April 2022 rolls around

scarlet cliff
#

why

wheat mesa
#

Message intent

scarlet cliff
#

ah

#

lmao

boreal iron
quartz kindle
#

and epic sense, mythic sense, legendary sense

wheat mesa
#

I prefer uncommon sense actually

quartz kindle
#

repl.it doesnt use env files anymore

boreal iron
#

aka American sense

earnest phoenix
scarlet cliff
#

"yeah i use intents"

wheat mesa
#

He forgor 💀

spark flint
#

wrong channel

wheat mesa
#

LMAO

quartz kindle
#

????

#

LOl

scarlet cliff
#

ujhhh

spark flint
#

LMAO

scarlet cliff
#

what

spark flint
#

ITS SCARY

earnest phoenix
#

socks

#

it's just socks

quartz kindle
#

winsock

wheat mesa
earnest phoenix
#

question: im bored so should I learn a new framework like vue or practice my cursed react skillz

scarlet cliff
#

hey

#

while we're at react

wheat mesa
#

Learn typescript and use it with detritus

earnest phoenix
#

hi

earnest phoenix
wheat mesa
#

Instead of using js with detritus angeryBOYE

earnest phoenix
#

no typescript

#

i have a life

#

and a family

wheat mesa
#

But... that’s the point of detritus!

scarlet cliff
quartz kindle
#

detroit us

boreal iron
#

Learn PHP

#

That's the future

#

Best frontend tech

scarlet cliff
#

no

earnest phoenix
wheat mesa
#

PHP is the past

#

Huh

grim aspen
#

start with a simple command

boreal iron
wheat mesa
#

Why would u create a help command before other commands

earnest phoenix
#

php has a broken version of sql escaping for "backwards compatibility"

grim aspen
#

like a bot that replies with pong

#

very simple starter

wheat mesa
boreal iron
#

shut Mr. Texan

grim aspen
#

kek

earnest phoenix
#

here's my challenge for you: make a bot that responds with Hello! :wave: when someone says hello but if they say hello my name is code913 it responds with Hello code913! :wave:

scarlet cliff
boreal iron
#

I don't speak query string too

wheat mesa
earnest phoenix
boreal iron
#

lol

#

see how popular it is, Sir

#

all ur hate goes wrong

#

Luca close to run 25 instances

earnest phoenix
#

try typing Array = "amogus";[1,2] in the discord tab's console

#

dw it won't cause any havoc

scarlet cliff
#

not at all

#

mfw it doesnt work

earnest phoenix
#

I made a hello world in vue yesterday

<div id="#root">
  <h1>Hello {{ name }}!</h1>
  <input v-model="name" />
</div>
<script src="script.js" defer></script>
const App = {
  data() {
    return { name: "World" };
  }
}

Vue.createApp(App).mount("#root");
#

but I've seen people use .vue files that put the html and js both into a single file

#

how do i do that?

boreal iron
#
<?
  echo '<h1>Hello $name!</h1>';
?>
#

better

earnest phoenix
#

fuck no

scarlet cliff
earnest phoenix
#

i'll try astro for the bundler (if vue needs one)

scarlet cliff
earnest phoenix
scarlet cliff
#

according to wikipedia: "an American multinational technology company that specializes in Internet-related services and products"

earnest phoenix
#

ooh nice this would 've taken an extra 5 lines in react

scarlet cliff
#

😐

earnest phoenix
#

so... instead of setState I just change the value of the state's property and Vue re renders the app?

#

that's the only use of Proxy I've seen

split hazel
#

calm down

boreal iron
#

told you what to use

scarlet cliff
#

i have been sitting at this for like half an hour tryna come up with a design

#

or im just procrastinating

lyric mountain
#

that looks like windows 10 "almost ready" screen

scarlet cliff
#

yes

solemn latch
#

trick #1 choose a random aspect of any website and do that

#

for example, a navbar

#

footer

earnest phoenix
#

i told you use a lib like chakra ui
css is pain

woeful pike
#

best way to come up with a design you like is to look at existing ones

spark flint
#

great site

woeful pike
#

dribbble is kind of annoying because there are ton of designs that look really sick on photoshop but make no sense from a web design perspective but there are some pretty good ones in there too

velvet topaz
#

Where would I find the CSS Viewer?

earnest phoenix
#

there's a styles button

velvet topaz
#

oh thanks!

#

I'm not sure how to fix this problem, the HTML I'm using isn't putting the images next to each other. It's worked on other sites. I understand that it's probably some sort of CSS Styling on top.gg that is overriding it however I'm not sure how I'd go about fixing it. Can anyone help? 🙂

<a href="https://bit.ly/PBGSWIKI-TOPGG"> <img width="94.5%" alt="tournaments card" src="https://user-images.githubusercontent.com/76446112/131024347-7b14f8b4-4ea3-4a06-82e5-c4663caaf4b9.png"> </a>

<a href="https://bit.ly/PBRWIKI-TOPGG"> <img width="47%" alt="lobbies card" src="https://user-images.githubusercontent.com/76446112/131024429-4997db37-fe7a-4e3a-b90a-7c009f61ce3d.png"></a><a href="https://bit.ly/PBACWIKI-TOPGG"> <img width="47%" alt="lobbies card" src="https://user-images.githubusercontent.com/76446112/131024561-dc96150a-cdfd-4697-8ac4-8f08dd681ef2.png"></a>

<a href="https://bit.ly/PBTBWIKI-TOPGG"> <img width="94.5%" alt="tournaments card" src="https://user-images.githubusercontent.com/76446112/131011304-fa56f49c-7833-46b8-8a83-469a39138762.png"> </a>

<a href="https://bit.ly/PBTBWIKI-TOPGG"> <img alt="join tourney card" src="https://user-images.githubusercontent.com/76446112/131011473-14fcccb9-c446-4663-9017-76422cd3c4fc.png" width="31%" /> </a><a href="https://bit.ly/PBBBWIKI-TOPGG"> <img alt="join tourney card" src="https://user-images.githubusercontent.com/76446112/131012567-0e34bc50-0a5d-49ea-a8a1-fbbcc2852f18.png" width="31%" /> </a><a href="https://bit.ly/PBSBWIKI-TOPGG"> <img alt="join tourney card" src="https://user-images.githubusercontent.com/76446112/131014179-be0811cb-6778-41d5-9577-33aa987e788f.png" width="31%" /> </a>

<a href="https://bit.ly/PBSUPPORT-TOPGG"> <img width="94.5%" alt="tournaments card" src="https://user-images.githubusercontent.com/76446112/104239095-2f54ce00-5417-11eb-9b21-b50a3fd78a63.png"> </a>
rich copper
rich copper
#

Which takes your sensitive info

boreal iron
#

Use float if you wanna show them beside

#

Or create a dynamic table

solemn latch
velvet topaz
#

Thank you for your response! Let me take a look now, appreciated.

solemn latch
#

Can you show where you define Client?

rich copper
#

Client = commands.Bot(command_prefix="?")

earnest phoenix
#

thats python

#

not js

#

remove new from there

#

and you should do const { Client } = require('discord.js');

rocky dagger
#

is there a yt tutorial on mongodb for djs v13?

wheat mesa
#

Yes, look up “MongoDB documentation” and you’ll find what you’re looking for

fluid tendon
#

I just updated to djs v13, now i get no errors but none of my commands work

boreal iron
#

Yeah it requires you to update a lot of stuff.

grim aspen
#

Because they are using client interactions

boreal iron
#

You might wanna use the update guide from 12 to 13.

grim aspen
boreal iron
#

And/or the change log

grim aspen
#

Which version of SQLite would be for node v13?

quartz kindle
#

any?

pale vessel
#

v23.25.233-3f98df2c build 2 release candidate 2 or above

quartz kindle
#

?-?

grim aspen
fluid tendon
ancient nova
#

guys I'm trying to get the guild name of a guild saved into a variable, but I want it done right after the "ready" event has been called, how can I do that?

pale vessel
#

Get the guild and set the variable on the ready event

ancient nova
pale vessel
#

By default discord.js caches all guilds

#

Simply use guilds.cache.get()

ancient nova
#

I managed to fix it, the issue was not awaiting the fetch properly

main trench
#

im doing like role based permissions and its throwing the no perms error even though im the guild owner

#
 if (!message.member.roles.cache.has(ifhasrole) || !message.member.permissions.has('MANAGE_GUILD')) return message.channel.send({ embeds: [noperm] });

code

boreal iron
#

Ask yourself what’s the result of
NOT OR NOT

#

You wanna check if he has not the role and not the permission

#

Then return the error

lyric mountain
#

if you don't not have the role or don't not doesn't do have permissions

boreal iron
#

Logic but different

main trench
#

If neither then return error

boreal iron
#

I know but your statement is wrong

#

You wanna check if he has not the role and not the permission

#

That’s the solution

#

You need to change 2 chars only

main trench
#

Hmm

#

So just remove the !

boreal iron
#

Nope you’re checking it the user does NOT have the permission - then return an error

#

Removing the ! will check if the user has the permission or role and will return the error

#

I’m repeating once again, please read carefully and think about it

#

Just posting the result will not help you…

#

You wanna check if he has not the role and not the permission

#

(then return your error message)

#

Did you get what I mean?

lyric mountain
#

he didn't not get it

boreal iron
#

More like he did not get it OR !got it

#

Dunno how to explain better…

main trench
boreal iron
#

I just tried to explain your conditions in words

main trench
#

Ohh

#

I need to change || to and

#

Which is & iirc?

boreal iron
#

That’s the example in words which would word

#

Finally

main trench
#

Bot development is fun hdtroll

boreal iron
main trench
boreal iron
#

👍

main trench
#

Code block

#

```language here <example: js>

Code

```

#

Np

boreal iron
#

Don’t use a line break for the language

#

Put it directly behind the brackets

#

```js

Not

```
js

main trench
#

Ayy works now

boreal iron
#

Check the logs if there’s any error you might not handle which crashes the application

#

Your screenshot doesn’t show much else than you’re not awaiting a promise somewhere

earnest phoenix
#

The replit restarts after inactivity

marsh pewter
#

Replit stops project after inactivity

#

Yes

earnest phoenix
#

You was just dissing a guy for not being able to make a music bot…

delicate shore
#
client.on('voiceStateUpdate', (oldState, newState) => {
  if (oldState.channelID !==  oldState.guild.me.voice.channelID || newState.channel)
    return;

  if (!oldState.channel.members.size - 1) 
    setTimeout(() => {
      if (!oldState.channel.members.size - 1) member, 
         oldState.channel.disconnect(); 
     }, 300000);
// I want bot to stay for 5 minutes that's why timeout 
});
#

bot still leave vc if I am there

#

discord.js v13

#

I have the intents

wheat mesa
#

anyone know how to use relative file paths in c++

#

can't seem to get it to work

wheat mesa
#

nvm

#

you forgot a `

#

look above that

#

you're not ending a string somewhere

rigid dock
#

yeah there is another random ' above it

wheat mesa
#

Oh yeah

#

I see that now

errant flax
#

ur missing a starting `

wheat mesa
#

Line 11

#

You put a ` on line 11

errant flax
#

bruh

wheat mesa
#

for no reason

errant flax
#

isnt that obvious

rigid dock
wheat mesa
#

I highly recommend learning js before starting more complicated things like that

radiant kraken
#

^

rigid dock
#

yeah also code on a desktop or laptop

radiant kraken
#

you forgot the ` after the console.log(

rigid dock
#

it'll make it much easier to avoid simple syntax errors like this

wheat mesa
#

It should be ```js
console.log(Example app listening at http://localhost:${port})

radiant kraken
#

still spoonfeed spoonfeed

#

bruh

rigid dock
#

you should never have a ' on its own without a subsequent ' to end that beginning of a string you're initializing by having the '

#

if you, do, your code ends up looking like the screenshot you sent

timber kettle
#

what coding language

radiant kraken
#

js

timber kettle
#

ahh

wheat mesa
#

hey null you're good at c++ right

radiant kraken
#

yes

#

quite proficient at it

wheat mesa
#

when I create a release build of a console app, it shouldn't need any external downloads to run on any machine (as long as it's built for that architecture/OS), right?

radiant kraken
#

yea

wheat mesa
#

finally

#

a language that's cool

radiant kraken
#

binaries are arch and os specific

wheat mesa
#

Just made a simple little console app as a gift for a friend with some ascii art and such, just making sure it would run on their machine

radiant kraken
#

it would as long as their machine has the same arch and OS as yours

wheat mesa
#

Yeah, it for sure does

#

Thank god I finally don't need a runtime environment just to run console apps on people's computers

radiant kraken
#

that's compiled languages for you iara_sunglasses_cool

wheat mesa
#

I love it

radiant kraken
#

hell yeah

wheat mesa
#

Only downfall being compiling different binaries for different archs and os's

#

but it's worth it

radiant kraken
#

yea

wheat mesa
#

speed increase and you don't need those stinky little runtime environments (yeah, I'm looking at you Java)

radiant kraken
wheat mesa
#

Huh..?

#

Ephemeral replies

#

you misspelled ephemeral

#

also I don't believe you can do button.reply.defer()

scarlet cliff
#

button.reply({ content: "Works!", ephemeral: true});

wheat mesa
#

^^

earnest phoenix
#

also why are people still using discord buttons when v13 already has it

scarlet cliff
#

wdym

wheat mesa
scarlet cliff
#

wah

#

im confused

errant flax
#

clickButton doesnt exist

#

what the faq

earnest phoenix
#

stop using d-buttons and then use d.js v13

errant flax
#

ye and if u have some problems with installing latest node use this

#

just put run.sh file into ur repl

timber kettle
#

how to make clickable buttons in python?

errant flax
#

then go to the run.sh file and the change the VERSION variable into "v16.10.0"

#

to install the latest version

scarlet cliff
#

why is it so huge

wheat mesa
#

I mean I'm not complaining smirk

earnest phoenix
earnest phoenix
#

im not a simp

rose warren
#

Tim

#

🙇

errant flax
earnest phoenix
#

how to automatically reconnect when lavalink is not working?

split hazel
#

Discord.Templates.Moderation()

errant flax
scarlet cliff
#

what

lament rock
#

That doesn't exist XD

crimson pike
split hazel
#

you guys have been trolled

#

you thought there was an easy way out

#

no you have to suffer

#

get writing those event handlers and databases

scarlet cliff
#

not that hard tbh

crisp stratus
#

I open a terminal, such an error comes up and the terminal closes

#

how can i fix

scarlet cliff
#

dont use powershell

#

fixed

crisp stratus
scarlet cliff
#

also activate ur windows

crisp stratus
#

I'm using node.js so I have to use powershell

scarlet cliff
#

no?

#

lmao you can use cmd

#

i am

#

i dont like powershell

crisp stratus
scarlet cliff
#

there are activators

crisp stratus
#

Do you know a solution that will allow me to continue using powershell

scarlet cliff
#

why do you wanna use powershell

crisp stratus
#

because i like it

scarlet cliff
#

cant help you in that case

#

all i can say is switch to cmd

tardy hornet
#

do you know a package that turn ms to that time thing
<t:1633075377:R>

scarlet cliff
#

wdym

#

<t:epoch>

tardy hornet
#

there are packages that turns ms to readable

#

i want a package that turns in into <t:1633075390:R>

pale vessel
#

you don't need a package for that

tardy hornet
#

really?

#

then how?

scarlet cliff
#

do you need what epoch is

tardy hornet
#

no

scarlet cliff
#

what lang are you using

tardy hornet
#

js

scarlet cliff
#

ok so how are you getting the ms

tardy hornet
#

i var the ms

scarlet cliff
#

ok but how do you get it

#

like

#

let ms = ???

tardy hornet
#

yes

#

i do

scarlet cliff
#

show me your code please

pale vessel
#

yes you do

tardy hornet
# scarlet cliff show me your code please
 const ms = require("pretty-ms");
                      var timeout = 3600000
                      let houry = await db.fetch(`hour_${message.author.id}`)
                      if(houry !== null && timeout - (Date.now() - houry) > 0){
                        let time_to_work = ms(timeout - (Date.now() - houry));
                        const workTime = new Discord.MessageEmbed()
                        .setDescription(`You already worked this hour! work again in \`${time_to_work}\``)
                        .setColor("RED")
                        message.channel.send({embeds: [workTime]})
                      }
   
                   else{
//code here

#

this is the ms part

pale vessel
#

change let time_to_work = ms(timeout - (Date.now() - houry)); to just ```js
const time_to_work = <t:${Math.round((timeout - (Date.now() - houry)) / 1000)}:R>

#

assuming timeout - (Date.now() - houry) is a timestamp (if it's not, you can add Date.now() to it), you can use <:t:timestamp:R> where timestamp is the unix timestamp in seconds

#

the R flag makes it relative, which will show in X hours or X hours ago etc.

scarlet cliff
pale vessel
#

yes, sorry

tardy hornet
scarlet cliff
#

console.log(time_to_work);

tardy hornet
scarlet cliff
#

well

tardy hornet
#

any idea?

tardy hornet
#

i got it fixed, ty

outer perch
#

if const voter = await bot.users.fetch(userID) fails without a catch, what happens?

pale vessel
#

your process will exit if it errors

outer perch
#

hmm, I just wanted voter to be undefined if fails

pale vessel
#

catch(() => undefined)

outer perch
#

I actually don't know the core funcionality of it

#

I just know I need to use it for Promisses

#

like that one above

#

.fetch() returns a Promise. a Promise can be fulfilled or rejected

#

sure

#

there's some info for you

#

well I am only experienced in D.JS and basics in c++, java and c#

#

if it's Python, don't even ask me 😅

earnest phoenix
#

anyone knows how to add this grey line thingy in embed discord.py

#

Seems like a quote

sacred aurora
#

text

scarlet cliff
#

abc
> abc

earnest phoenix
#

thank you so much

scarlet cliff
#

owo

outer perch
#

I always forget about this:
can I use if (member) to check if member is not undefined/null?

#

or should I keep the looks and use if (member !== undefined)

lament rock
#

!true === false
!false === true

any falsy value (0, [] iirc, false, undefined, null) will show as true when tested for falsiness with unary negation

outer perch
#

nice

#

[] is empty, seems falsy to me 😆

lament rock
#

Seems [] is a truthy value

outer perch
#

O_O

#

so to make sure I understood

let member;

if (member) // returns false
if (!member) // returns true
scarlet cliff
#

well

lament rock
#

correct since member would evaluate as undefined

outer perch
scarlet cliff
#

yeah because you didnt assign a value

outer perch
#

yes

#

but for this specific situation

#

const member = await message.guild.members.fetch(mention).catch(() => undefined);

#

I have to assign it undefined

#

it's the same I know, just pointing out

lament rock
#

That would work. (nit picky, but you can replace undefined with void 0)

outer perch
#

what's the difference?

lament rock
#

less to type, but the value still evaluates to undefined

outer perch
#

well, Imma go for readers for this one

lament rock
#

void evaluates the expression and then returns undefined, but you'd have to be careful of the scope you use it in since it could technically count as an alternative to the return statement

outer perch
#

I see, but it's in an else scope

#

so wait

#

😮

scarlet cliff
#

.catch(()=>1)

lament rock
#

I don't think you understood what I meant by scope

outer perch
#

oof

lament rock
#

functions are their own scopes and returning out of them doesn't affect the scope above them unless you're assigning their return value to something

#

returning in a scope when you don't intend to can lead to a headache

lament rock
#

void can count as return

outer perch
lament rock
#

1 is a truthy value

outer perch
#

is?

lament rock
#

booleans are 0 and 1

outer perch
#

but return 0; is also true

lament rock
#

no

#

!!0 === false
!!1 === true

#

note the 2 !

scarlet cliff
#

@earnest phoenix shush, this is the wrong channel

outer perch
#

hmm

#

so in the end, I never understood what return 0; meant in reality

earnest phoenix
#

if it's not a scam it's okay

earnest phoenix
#

if it's a scam you better leave that server before discord takes action

lament rock
#

if (!0) // will always run
if (!1) // will never run

outer perch
#

yeah makes sense

#

so false means don't run anymore

scarlet cliff
lament rock
#

if a value is true in an if statement and if there are any logical and operators and all of their expressions evaluate to true, then the code inside of the if block is run

boreal iron
lament rock
#

You can't reassign primitive values anyways

#

primitives aren't apart of the global Object

boreal iron
outer perch
lament rock
#

Well. You could, but you'd hate yourself. How do you think I feel talking here every now and then

#

jk. I love most of the ppl here

boreal iron
#

lol

earnest phoenix
lament rock
#

false

#

That code will never run

#

The if statement checks for the next expression to run if it's not on the same line and there are no brackets

lament rock
#

wait what

#

Okay. I just tried, but apparently comments don't get stripped and they "count as an expression"

#

or is it just WebJS

earnest phoenix
#

web3.js moment

#

imagine if you can use ethereum vm as your backend

#

infinite uptime

lament rock
#

TypeScript emits single line if expressions on the next line and they run just fine, but this is weird

earnest phoenix
#

ts cringe indeed

outer perch
#

can't live without brackets rn

old cliff
earnest phoenix
#

if someone understands what they're doing they wont work at discord

old cliff
#

I bet you havent used it

outer perch
#

do you guys keep tabs in empty lines?

#

or just make sure nothing is there? xD

errant flax
marble juniper
errant flax
scarlet cliff
earnest phoenix
scarlet cliff
#

mmm

scarlet cliff
#

after you've registered your routes just do

app.use((req, res) => {
    res.send("404");
});
errant flax
#

for 404

app.get("*")

its that route

#

but idk abt 500 error

errant flax
#

dont use var?

errant flax
#

and no

// variable declarations

app.get("/",(req,res)=>{
// a 200 aka good status
res.status(200).send("helo world")
})
app.get("*",(req,res)=>{
// a 404 
res.status(404).send("u lost?")
})

app.listen(3000)
scarlet cliff
#

use app.all if you plan on using that ^^

errant flax
#

whats app.all?

scarlet cliff
#

all methods

#

not only get

errant flax
#

u mean like the all the http methods

#

ahhh

#

and afaik users r only redirected to * route if they dont get a response

#

u dont have to worry abt .status() part btw

#

its just letting the user who requested it what http code the server sent back

rocky hearth
#

How much time does it take to rename a bot

pale vessel
#

Verified bot? You can't, unless you know a staff personally

old cliff
#

lmao what

rocky hearth
#

no its not, its pretty new

hybrid cargo
stray seal
#
<div id="applicationshub">
    <div class="application_wrapper">
        <a href="#" class="applicationlink"><i class="fas fa-user-shield"></i> Staff Application</a>
        <div class="appreq">
            <h3>Staff Application Requirements</h3>
            <ul>
                <li>Must be 18 Years of age or older (No exceptions)</li>
                <li>Must be Fluent in spoken and written English</li>
                <li>Must have a working microphone and access to discord</li>
                <li>Must have at least 50 hours logged on the server</li>
                <li>Must not be currently staff on any other minecraft server</li>
                <li>Must have at least 50 hours logged on the server</li>
                <li>Must not be currently staff on any other minecraft server</li>
            </ul>    
        </div>
    </div>
    

That is the current code.
I want to add this:

<iframe src="https://docs.google.com/forms/d/e/1FAIpQLScg68ZMtrMpWYwRDaeTGIbMrZPgbM3nGox4dXqARNVy-vDFbQ/viewform?embedded=true" width="640" height="1551" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe>
outer perch
#

why can't .gitignore actually ignore eslint files?

quartz kindle
#

it can?

scarlet cliff
#

gitignore can ignore any file you want

#

btw why is my eslint doing that

outer perch
#

I added .eslintrc and .eslintignore to .gitignore, but the files aren't greyed out

scarlet cliff
#

uh

#

i think its because the names begin with a dot

outer perch
#

in VSC explorer

#

but .env is greyed out when ignored

#

.gitignore

.env
.vscode
.eslintrc
.eslintignore
*.sh
serviceAccountKey.json
backups
node_modules
scarlet cliff
#

i think its because they are still being tracked with git

quartz kindle
scarlet cliff
#

^^

outer perch
#

yes k

#

gonna fix that

#

.eslint* this line alone should cover everything

scarlet cliff
#
git rm -r --cached .
git add .
git commit -m "Drop files from .gitignore"
#

run that and itll remove and readd everything that should be there

outer perch
#

yeah yeah, I know that

scarlet cliff
#

kk

flat copper
#

what is the maximum mutual servers limit

#

in bot verification

#

by discord

scarlet cliff
#

wdym mutual server limit

flat copper
#

like first my bot was in 75 servers so i applied for verification but discord declined it and said you have many mutual servers with bot

#

then i have yo recreate the bot

outer perch
#

I have this on tsconfig: "baseUrl": "./", but I still have to add it to imports

flat copper
#

and now its again in 75

wheat mesa
#

I recommend not using the discord-buttons package as was recommended to you last night

#

Show your package.json file

#

(I don’t think it’s a problem with discord-buttons, just saying you shouldn’t use it)

quartz kindle
#

where did that error come from even? from pressing the run button?

#

or did you type some command?

wheat mesa
#

Oh I see you’re not using discord buttons anymore

#

That’s good

quartz kindle
#

why do you have a "node" package installed

#

uninstall it

#

also, are you cloning someone else's bot?

#

also, you hid the actual error

#

scroll up to see the important parts of the error

wheat mesa
#

Oh damn I didn’t even see that

cinder patio
#

People with a cat pfp are always the most guilty

solemn latch
#

Ah

wheat mesa
#

My brain is fried from reading c++ errors for the last few hours of last night

outer perch
wheat mesa
#

Well that’s why

outer perch
wheat mesa
#

You don’t have a mongodb URL provided

quartz kindle
#

lol

wheat mesa
#

I’m not sure if the functionality of the bot depends on mongodb

quartz kindle
#

you are cloning a bot that runs with mongo, you cant simplty remove it, the bot wont work

wheat mesa
#

^^

outer perch
#

@earnest phoenix if you want to learn coding, why won't you try some 'From scratch' course on youtube instead of cloning other people's code?

wheat mesa
#

Me?

quartz kindle
#

or clone a simpler bot

wheat mesa
#

Yeah

quartz kindle
#

that doesnt have external dependencies

wheat mesa
#

It’s also much easier to start off with basic js with no dependencies on anything and learn the concepts of programming

outer perch
wheat mesa
#

Lol

quartz kindle
#

inclusively that

wheat mesa
#

The method you choose to learn mostly depends on the way you know you learn

#

Some people learn from examples, others learn from experimenting

#

Just gotta find what works for you

#

Usually the best way to get into programming is a mix of those two imo

split hazel
#

stupid question but do modern computers use sign magnitude or twos complement to represent negative numbers

wheat mesa
#

Good practices combined with your own thoughts and ideas

outer perch
wheat mesa
#

Creating things with code is fun, yes

outer perch
solemn latch
calm night
#

I like turtles

quartz kindle
calm night
#

do u

outer perch
calm night
#

Y NOT

calm night
outer perch
#

k

calm night
#

screw u

#

@everyone