#development
1 messages · Page 1890 of 1
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
well, no matter what you do, its always gonna be o(n)
wait
why not just use a normal vector
but read it in reverse?
lmao
reverse iterator exists
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?
Huh no I’m driving
Could also be a wrongly configured charset value in your webserver config
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
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
Yeah it’s the webserver then
ah- how would i fix that?
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
Gimme a sec
<t:unix-timestamp:R>
(Or another modifier than R, I can’t remember them off the top of my head though
A long sec… 
Huh np was wondering only
Fixed the issue
Made a quick change in the html file
Adding the ASCII set ' to make '
You set a wrong charset min it?
It didnt seem like it, the webserver was set to UTF-8
and changing it to ASCII or ISO didnt do shit
Might be a google font thingi tho
Oh
Thank you for the help! i appreciate it!
That’s an important information tho
Oh my apologies.
Yeah not all fonts support special chars
<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
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
Yeah thats true potentially
Truth be told this is my first time working with css etc to make a fully fledged website so.
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
@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
moment
howdy
why not just use list::push_front()?
its for an assignment
or was, i already handed it in
and it's a vector class
@quick ginkgo
i dont know anythin with c++
i... see
delete system 32
ez destruction
is there a way to send a message to a text channel that only one user sees?
nice, i think i have this. they will be clicking on a dropdown button
that's awesome! slash commands are great. im going to replace all my DM code with this
yeah, thats pretty much the most optimized o(n) you could achieve

A
is there someway to input a date into a slash command parameter?
<t:1632969154>
is there some sort of date picker?
Looks like there’s no component type yet.
like a date option?
if so theres currently no way
You could add all days from 1970 to today inside a combobox 
this may be hard to do but maybe make an option "STRING" type then parse the string to a date 
or what KuuHaku said
i do what moment.js does
Enjoy having users complain when they can’t enter 1-1-21 correctly
1 year 2 month => 3.68164136 × 1010ms
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
/event starts-in: 1 month 2 days
just mention the format
like MM-DD-YY
in the description of the option


no date formats
i just use ms to parse things like 1 second 2m
guys suggest hosting pls
@drowsy crag look at this
Is there a way to set aliases of app / commands
Dm
no there isnt
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
i dont know
There is no discordjs v12.6.1
You're trying to use a variable you never declared, declare it and learn basic JS; there are tons of free courses out there
I suggest you to learn JS first
You do not define Discord
All free courses, go ahead
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
the @everyone role id is the same as the guild_id on every server right?
Yes
thanks!
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:
-
browser make random string, put into localstorage and set it to the state param when opening oauth link
-
after you get returned to the callback url the oauth service (discord in my case) returns it to the callback url in a param
-
????
most people ignore the first sentence and it makes me sad
still no understand how can it prevent csrf or how to use it exactly
if your session cookie is set to http only it cannot be sent using javascript
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)
wdym by "cannot be sent by javascript"
sorry ive never used cookies before 
I wouldn't store the state parameter on the client-side,
- Generate state on server-side and send to discord
- Once the user visits your redirect url, the state will be set as a search parameter
- Compare the value you generated on the server with the value you got from the redirect URL, if they are not the same then something happened, deny access
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
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
The error is self-explanatory, you're trying to re-assign the value of a constant variable
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)
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?
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
what how did mongodb's ssl certificate expire
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?
use discord api for example
Hey! can anybody explain me what is crypto.js ?
does cryptographic operations?
it does crypto stuff
my opinion: if an api does not have a "teach me like im 5" explanation of the data structures im not using it
uses discord api
is there a way to make the bot reload the files without closing itself?
depends on your command handler
require() all the commands again ¯_(ツ)_/¯
dont forget that delete require.cache["file path here"]
^ this too
Like this
Use the api
could you just fake that and put like an insane amount while ur actual server count is 2
Sure, but then your bot will be deleted from our site
So like this?
int serverCount = ...; // the total amount of servers across all shards
api.setStats(serverCount);
I am using import, TS
any tips on how to debug this
it only shows that
but not where error it happened (at which line)
no stacktrace?
nop
is that the whole error?
Do you handle the errors?
sec lemme show u
and im not even sending a message, it sends what its supposed to send, then that error happens
blyat
@mod scam
@drowsy crag scam
What are you trying to send?
nothing
is there any part in the code where you reply to a message?
btw that guy was just asking for people to play with him xd
sec
nvm i found the issue
nice
whats like the best lang to make a website that has some authentication etc.
A server sided language, like PHP
ah 
how do i make (key) accessible to function bellow?
[key]
but like, thats extremely inefficient, its loading the file again everytime you read it
just load the file once, and keep it loaded
cant u just do require("file.json")
if im correct that i understand what ur doing
java
blasphemy
java can do websites?
any lang can lol
SQL website when???
even when i require it it still returns undefined
[key] not .key
.txt website when
wait nvm
it can be a website
if some website parses it
and .md
but once json is loaded, will it update data when its changed?
.key is a literal .key, [key] is the value that key contains, not the literal key
what command did u ran?
when you change it, change both the file and the loaded one
node .
is that unofficial-pagination repo private?
but i dont know when it sgonna change
thats why i read it every time
no
im guessing its a git error
idk about git so i cant help u
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
does npm need any special repo to fetch github stuff?
actually it worked fine till now
but when i restarted my bot yesterday this error came
well alright, but if you start noticing slow downs, it will likely be because of that
until then its fine
until then
but if i dont know when json updates, how am i gonna deal with that
go back to dev
when i run my bot on my PC it works fine
it updates from another app
u will know
whats wrong with heroku
you update it from another app?
yes
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
or just attach a file listener
you can also use a file watcher yes
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.
whats the use case?
usually you can get away with that using only division and modulo
no need for arrays
ye, modulo the day by 7
A calendar of some sort where each day contains some data
it'll be exatcly which day it is in the week
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
+floor
just cast to int pleb 🗿
cast to uint8
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
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?
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 
xD
floor(day / 7) = week index
day % 7 = day in week
so days 0-6 would be week 0, 7-13 week 1, 14-20 week 2 and so on
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
data['Group1'][day % 7]
My issue isn't about finding the data I need, but about actually storing the weeks in my Vec
are the items different every week?
They alternate with each passing week. Weeks 1-3-5 have one sequence, weeks 2-4-6 have another
are they different for each group?
Yup
data = {
group1: {
odd: [ day1, day2, day3, ... ],
even: [ day1, day2, day3, ... ]
}
}
``` something like this?
Mhm, that explains it better
The issue with storing data is resolved, but my initial issue with storing weeks in my Vec remains 
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?
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
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
Huh
I'm actually working with chrono which abstracts the timestamp work for me
I'll see what I can do
somewhere above line 2 of index.js
😅
can someone explain what is happening in here
can you show where?
it must be in line 1 to function, as you are using it on line 2.
discord is not Discord
You’re defining it as discord when you need to define it as Discord
No
the squiggly line typically means "somethings wrong"
const Discord, not const discord
This type of mistakes I used to make in python
verified bot dev doesnt mean anything
most verified bot devs just stole the code and ran it
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 
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
So not off-topic
Does anyone have a layout on how I can implement guild counts for my bot?
Like that
we answered your exact same question a couple hours ago ._.
lmao
lmao
same response lmao
Fucking Windows trash
my screenshots do pretty much always cut off half way
We did post that even on the same timestamp, lol
You see... old people are on the same level
lol
limão
autocorrect 
no, its on purpose
run npm i discord.js in shell
Use npm init
Try to remember where you called npm the last time 
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
there is no .env file on replit
it wont let you make one
you have to use the lock button on the left
oh its replit
did they do touch woman .env

you just learned how to code 🎉
also, for future reference, repl.it also has a button on the sidebar for installing packages
no need to run npm commands
time to hack nasa 

I beg you PLEASE 👏 LEARN 👏 JS 👏 BEFORE 👏 MAKING 👏 A 👏 BOT
Average bot login in environment variable file fan
in your code:
client.login(process.env.TOKEN)
in the repl.it lock:
key: TOKEN
value: 97t734yt3h0y83j048y34y.34y973h4y3h4y83h4y803h04y834
value: deez nuts
Makes it double secret
Hacked
thanks
Np
integrating cheap ads into your bot
require("nasa-hardware").hack(new God("Tim"))
@quartz kindle what are you wondering ofc you're a programming god
code913 is not in the sudoers file, this incident will be reported.
not to sound rude but we're not op we just have common sense
Imagine how active this channel is gonna be when April 2022 rolls around
why
and rare sense
Message intent
Good reminder to taking a break
and epic sense, mythic sense, legendary sense
I prefer uncommon sense actually
aka American sense
I forgor to switch to slash commands :(
"yeah i use intents"
He forgor 💀
wrong channel
LMAO
ujhhh
LMAO
what
ITS SCARY
winsock
.replace(“o”, “e”)
question: im bored so should I learn a new framework like vue or practice my cursed react skillz
Learn typescript and use it with detritus
hi
fucking no
Instead of using js with detritus 
But... that’s the point of detritus!
i am a shitty frontend dev and i need help making good looking web dashboard
detroit us
is what i use
no
start with a simple command

Why would u create a help command before other commands
php has a broken version of sql escaping for "backwards compatibility"
You're broken, Sir
shut Mr. Texan
kek
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:
sorry i dont speak ?id=<script>alert(document.cookie)</script>
I don't speak query string too
What the hell is happening in #starboard
When #starboard becomes PHP
lol
see how popular it is, Sir
all ur hate goes wrong
Luca close to run 25 instances
try typing Array = "amogus";[1,2] in the discord tab's console
dw it won't cause any havoc
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?
fuck no
https://vuejs.org/v2/guide/single-file-components.html i guess idk i dont use vue
ty
i'll try astro for the bundler (if vue needs one)
i literally googled "vue js and html in same file"
what is google?
according to wikipedia: "an American multinational technology company that specializes in Internet-related services and products"
ooh nice this would 've taken an extra 5 lines in react
😐
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
calm down
told you what to use
i have been sitting at this for like half an hour tryna come up with a design
or im just procrastinating
that looks like windows 10 "almost ready" screen
yes
trick #1 choose a random aspect of any website and do that
for example, a navbar
footer
i told you use a lib like chakra ui
css is pain
Dribbble is where designers gain inspiration, feedback, community, and jobs and is your best resource to discover and connect with designers worldwide.
best way to come up with a design you like is to look at existing ones
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
Where would I find the CSS Viewer?
at the bottom
there's a styles button
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>
Google has Yahoo hijacking
Which takes your sensitive info
hey, so what your looking for is making things that are being overwritten !important.
to find those you need to look inside the inspector.
https://i.woo.pics/70c6700ca2.mp4
so in this case all the styles being used are default top.gg styling, and i added one(setting p to red)
the color isnt being overwritten so it stays red, if it was I would need to add the important flag.
Thank you for your response! Let me take a look now, appreciated.
so true
Can you show where you define Client?
Client = commands.Bot(command_prefix="?")
thats python
not js
remove new from there
and you should do const { Client } = require('discord.js');
is there a yt tutorial on mongodb for djs v13?
I just updated to djs v13, now i get no errors but none of my commands work
Yeah it requires you to update a lot of stuff.
Because they are using client interactions
You might wanna use the update guide from 12 to 13.
And/or the change log
Which version of SQLite would be for node v13?
any?
v23.25.233-3f98df2c build 2 release candidate 2 or above
?-?
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?
Get the guild and set the variable on the ready event
I cannot because the guild.fetch function does not work in the ready event
I managed to fix it, the issue was not awaiting the fetch properly
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
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
if you don't not have the role or don't not doesn't do have permissions
I wanna check if it has the role or the permissions
If neither then return error
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
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?
he didn't not get it
Ah so just if statement it
Are we still talking about #development message ?
I just tried to explain your conditions in words
Yeah
Isn't that what it was doing?
Ohh
I need to change || to and
Which is & iirc?
Bot development is fun 
&&
Thanks
👍
Don’t use a line break for the language
Put it directly behind the brackets
```js
Not
```
js
Ayy works now
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
The replit restarts after inactivity
You was just dissing a guy for not being able to make a music bot…
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
yeah there is another random ' above it
ur missing a starting `
bruh
for no reason
isnt that obvious
I highly recommend learning js before starting more complicated things like that
^
yeah also code on a desktop or laptop
you forgot the ` after the console.log(
it'll make it much easier to avoid simple syntax errors like this
It should be ```js
console.log(Example app listening at http://localhost:${port})
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
what coding language
js
ahh
hey null you're good at c++ right
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?
yea
binaries are arch and os specific
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
it would as long as their machine has the same arch and OS as yours
Yeah, it for sure does
Thank god I finally don't need a runtime environment just to run console apps on people's computers
that's compiled languages for you 
I love it
hell yeah
Only downfall being compiling different binaries for different archs and os's
but it's worth it
yea
speed increase and you don't need those stinky little runtime environments (yeah, I'm looking at you Java)

Huh..?
Ephemeral replies
you misspelled ephemeral
also I don't believe you can do button.reply.defer()
button.reply({ content: "Works!", ephemeral: true});
^^
also why are people still using discord buttons when v13 already has it
wdym
stubborn™️

stop using d-buttons and then use d.js v13
ye and if u have some problems with installing latest node use this
just put run.sh file into ur repl
how to make clickable buttons in python?
then go to the run.sh file and the change the VERSION variable into "v16.10.0"
to install the latest version
half my screen is covered by his face
why is it so huge
I mean I'm not complaining 
by tims face kek
simp ^
im not a simp
there happy
how to automatically reconnect when lavalink is not working?
Discord.Templates.Moderation()
wait that exist
what
That doesn't exist XD
🤔
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
not that hard tbh

also activate ur windows
I'm using node.js so I have to use powershell
I have no money :(
there are activators
Do you know a solution that will allow me to continue using powershell
why do you wanna use powershell
because i like it
do you know a package that turn ms to that time thing
<t:1633075377:R>
there are packages that turns ms to readable
i want a package that turns in into <t:1633075390:R>
you don't need a package for that
do you need what epoch is
no
what lang are you using
js
ok so how are you getting the ms
i var the ms
show me your code please
yes you do
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
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.
<t:timestamp:R> without the colon before the t
yes, sorry
welllll i dont think i worked that long ago
console.log(time_to_work);
<t:3332:R>
well
any idea?
i got it fixed, ty
if const voter = await bot.users.fetch(userID) fails without a catch, what happens?
your process will exit if it errors
hmm, I just wanted voter to be undefined if fails
catch(() => undefined)
I literally did that, but with return xDDD
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 😅
anyone knows how to add this grey line thingy in embed discord.py
Seems like a quote
text
abc
> abc
thank you so much
owo
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)
!true === false
!false === true
any falsy value (0, [] iirc, false, undefined, null) will show as true when tested for falsiness with unary negation
Seems [] is a truthy value
O_O
so to make sure I understood
let member;
if (member) // returns false
if (!member) // returns true
well
correct since member would evaluate as undefined

yeah because you didnt assign a value
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
That would work. (nit picky, but you can replace undefined with void 0)
what's the difference?
less to type, but the value still evaluates to undefined
well, Imma go for readers for this one
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
.catch(()=>1)
I don't think you understood what I meant by scope
oof
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
ah, that
void can count as return
this actually makes sense
1 is a truthy value
is?
booleans are 0 and 1
but return 0; is also true
if it's not a scam it's okay
it returns 0
if it's a scam you better leave that server before discord takes action
if (!0) // will always run
if (!1) // will never run
0 = false 
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
0 is not false but it will be converted into a boolean
You can't reassign primitive values anyways
primitives aren't apart of the global Object
You can’t teach primitive humans anyways


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
lol
but this will always run
if (!1) // line break
console.log("never gonna give you up");
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
mdn lied :(
wait what
Okay. I just tried, but apparently comments don't get stripped and they "count as an expression"
or is it just WebJS
web3.js moment
imagine if you can use ethereum vm as your backend
infinite uptime
TypeScript emits single line if expressions on the next line and they run just fine, but this is weird
cringe
ts cringe indeed
can't live without brackets rn
No
if someone understands what they're doing they wont work at discord
I bet you havent used it
i thought that was an invite link 
good that you aren't a mod rn

what were you doing in the devtools btw
we don't talk about that
mmm
after you've registered your routes just do
app.use((req, res) => {
res.send("404");
});
wouldn't that just send a 404 status everytime
for 404
app.get("*")
its that route
but idk abt 500 error
no
dont use var?
use this
it works for me
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)
use app.all if you plan on using that ^^
whats app.all?
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
How much time does it take to rename a bot
Verified bot? You can't, unless you know a staff personally
lmao what
no its not, its pretty new
If its verified by discord, u cant rename it
<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>
why can't .gitignore actually ignore eslint files?
it can?
I added .eslintrc and .eslintignore to .gitignore, but the files aren't greyed out
in VSC explorer
but .env is greyed out when ignored
.gitignore
.env
.vscode
.eslintrc
.eslintignore
*.sh
serviceAccountKey.json
backups
node_modules
i think its because they are still being tracked with git
if they are already on github, then you need to delete them first
^^
ah
yes k
gonna fix that
.eslint* this line alone should cover everything
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
yeah yeah, I know that
kk
wdym mutual server limit
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
I have this on tsconfig: "baseUrl": "./", but I still have to add it to imports
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)
where did that error come from even? from pressing the run button?
or did you type some command?
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
Oh damn I didn’t even see that
People with a cat pfp are always the most guilty
Ah
My brain is fried from reading c++ errors for the last few hours of last night
You're the dog person huh...
Well that’s why

You don’t have a mongodb URL provided
lol
I’m not sure if the functionality of the bot depends on mongodb
you are cloning a bot that runs with mongo, you cant simplty remove it, the bot wont work
^^
@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?
Me?
or clone a simpler bot
Yeah
that doesnt have external dependencies
It’s also much easier to start off with basic js with no dependencies on anything and learn the concepts of programming
wrong mention xD
Lol
yeah, exclusively that
inclusively that
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
stupid question but do modern computers use sign magnitude or twos complement to represent negative numbers
Good practices combined with your own thoughts and ideas
Creating things with code is fun, yes

Like you want to visit example.com/somefile not example.com/somefile.css
?
I like turtles
no idea, but i believe hardware uses 2s and software uses sign
do u
I don't
Y NOT
I hate you
k




