#development
1 messages · Page 1893 of 1
and store the card as lowercase too
and i tried ```js
cardss.includes(args.join(' ').toLocaleLowerCase())
or use cardss.some
?
k
It's like .includes but better
pass a function that converts the card name and args to lowercase then checks if they're equal
better i leave it like this
["Mega Knight"].some(c => c.toLowerCase() === args.join(" ").toLowerCase());
this will make it work if it put megA kNighT?
or just lowercase
try it and see
mega knigh
ok
works
args.join(' ') === "GoblinGang"
but this?
like
this determines the rarity
but if args.join(' ') is not Mega Knight (or GoblinGang) it won't work
to make something case insensitive, you need to convert the case for BOTH sides of the comparison
a.toLowerCase() === b.toLowerCase()
?
what dont you understand?
both sides
of the ===
v this has to be lower case
something === something
^ this also has to be lower case
ok
thx
- let tru = {
+ "Mega Knight":"megaknight"
- }
How to change chat? .toLowerCase() doesn't work
already have it
Why discordjs coders are low
They even dont know how to code flex css
sweats in not using css at all
then what they are using?
Yeah.. uuh..
What?
https://i.imgur.com/EHlmQzi.png
shush do not tell anyone about https://chakra-ui.com
i mean.. i exported it.. its has to be defined.
ill keep that between us
try running console.log(client)
also even if you exported it your command handler did not pass the client to the command
ugh
MORE IMPORTS
fix your command handler?
Oh.. how could i miss that
// command
function (args, client) { console.log(client) };
// command handler
command(args, /* put client here */);
Prefer to use html lol
you are too powerful to be kept alive
Die allready
sigh
@earnest phoenix are we having a raid again
I just realized it isnt from a Command.
if it was a problem with the command you will get a completely different error
nvm. its the a Structure Element that gets loaded through a command
Scam
scam?
Looks like it
so it's not real
Now im completely lost and cant understand my own code
"You gotta understand boy. Money, it's just an object"
"Then why do you want it?"
help
change chat?
Yes some ppl send it
ok
you can't edit someone else's message
i do not understand the question
money is everything money brings girls money brings peace money bring ppls
you want to change Mega Knight to meganight?
like if i put Mega knigHt it'll recognise it as Mega Knight and change it to megaknight
He wants lowerCase dedector
tim already answered you
^
money gives you a spaceship to go to the moon
.toLowerCase() doesn't work there
money gives you css flex
try reading what tim said again ¯_(ツ)_/¯
im getting confused myself
guys whats this error
cardss.includes(args[0].toLowerCase()))
package.json is wrong
means
?
"Mega Knight".toLowerCase():"megaknight" doesn't work
yeah but all the cardss are not in lowercase and you need to convert them
doesn't work
Go 16468.line
how about you show your code
there is an error in package.json file
otherwise we have no idea what you're doing
ayo tim
and what you're saying makes no sense
you
ok
is it safe to declare functions/objects (not from useState) inside react components?
because it will be regenerated again everytime it rerenders
no idea, i dont use react
then what do you use
nothing
ofc a god like you uses raw html
html+css+js
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
lmao
scam link
Okay.. so... my command seems to the fine with the client (i guess) So... yeah.. uh... how can i import something with it?
const Queue = require('../structures/Queue');
that code is extremely inefficient lol
you could remove like 80% of it
client.queue = new Map()
yeah
if(args.join(' ').toLowerCase() === "Archers".toLowerCase() || args.join(' ') === "Barbarians" || args.join(' ') === "Goblins" || args.join(' ') === "Minions" || args.join(' ') === "Knight" || args.join(' ') === "Arrows" || args.join(' ') === "Spear Goblins" || args.join(' ') === "Bomber" || args.join(' ') === "Skeleton Dragons" || args.join(' ') === "Fire Spirit" || args.join(' ') === "Skeletons" || args.join(' ') === "Elite Barbarians" || args.join(' ') === "Rascals" || args.join(' ') === "Firecracker" || args.join(' ') === "Zap" || args.join(' ') === "Mortar" || args.join(' ') === "Tesla" || args.join(' ') === "Royal Delivery" || args.join(' ') === "Giant Snowball" || args.join(' ') === "Cannon" || args.join(' ') === "Bats" || args.join(' ') === "Ice Spirit" || args.join(' ') === "Skeleton Barrel" || args.join(' ') === "Electro Spirit" || args.join(' ') === "Minion Horde" || args.join(' ') === "GoblinGang" || args.join(' ') === "Royal Recruits" || args.join(' ').toLowerCase() === "Royal Giant".toLowerCase())rarity = "Common";
that determines the rarity
lol
you are repeating your code too much
"//1": "describes your app and its dependencies",
"//2": "https://docs.npmjs.com/files/package.json",
"//3": "updating this file will download and update your packages",
"name": "hello-express",
"version": "1.0.2",
"description": "A simple Node app built on Express, instantly up and running.",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"@discordjs/opus": "^0.5.0",
"@distube/ytpl": "^1.0.11",
"akaneko": "^3.0.2",
"ascii-table": "^0.0.9",
"avconv": "^3.1.0",
"await": "^0.2.6",
"axios": "^0.21.1",
"canvacord": "^5.0.8",
"canvas": "^2.8.0",
"canvas-constructor": "^4.1.0",
"canvas-senpai": "^0.1.6",
"common-tags": "^1.8.0",
"cpu-stat": "^2.0.1",
"di": "0.0.1",
"discord-akairo": "^8.1.0",
"discord-backup": "^2.5.0",
"discord-buttons": "^4.0.0",
"discord-giveaways": "^4.4.3",
"discord-music-player": "^7.2.0",
"discord-xp": "^1.1.16",
"discord.js": "^12.3.1",
"discord.js-commando": "^0.10.0",
"distube": "^2.8.12",
"dote": "^1.1.0",
"dotenv": "^8.2.0",
"env": "0.0.2",
"erela.js": "^2.3.1",
"express": "^4.17.1",
"ffmpeg-static": "^4.3.0",```
"fs": "^0.0.2",
"hastebin-gen": "^2.0.5",
"i": "^0.3.6",
"imdb-api": "^4.2.0",
"instagram-api.js": "0.0.8",
"mal-scraper": "^2.11.3",
"mathjs": "^7.1.0",
"moment": "^2.27.0",
"moment-duration-format": "^2.3.2",
"mongoose": "^5.9.29",
"ms": "^2.1.2",
"neko-love": "^2.0.2",
"nekos.life": "^2.0.7",
"node": "^14.17.2",
"node-fetch": "^2.6.1",
"node-superfetch": "^0.1.11",
"novelcovid": "^3.0.0",
"npm": "^7.6.1",
"opusscript": "^0.0.7",
"or": "^0.2.0",
"os": "^0.1.1",
"parse-ms": "^2.1.0",
"path": "^0.12.7",
"pretty-ms": "^7.0.1",
"quick.db": "^7.1.3",
"random-code-gen": "^1.1.2",
"request": "^2.88.2",
"request-promise-native": "^1.0.9",
"simple-youtube-api": "^5.2.1",
"smartestchatbot": "^2.0.0",
"snekfetch": "^4.0.4",
"something-random-on-discord": "^0.0.1",
"soundcloud-downloader": "^0.2.4",
"sourcebin_js": "0.0.3-ignore",
"spotify-url-info": "^2.2.0",
"srod-v2": "^1.0.1",
"twemoji-parser": "^13.0.0",
"twitter-api.js": "0.0.12",
"weather-js": "^2.0.0",
"yt-search": "^2.5.1",
"ytdl-core": "^3.4.2",
"ytdl-core-discord": "^1.2.5",
"ytpl": "^2.0.4",
"ytsr": "^3.2.2"
},
"engines": {
"node": "12.x"
},
"repository": {
"url": ""
},
"license": "MIT",
"keywords": [
"node",
"glitch",
"express"
]
}```
??
tell what is wrong
Lmao
Libary guy is back
pls tell
jesus christ
what
the bot took me alot time
if (["Archers", "Barbarians", "Goblins"].some(c => c.toLowerCase() === args.join(" ").toLowerCase())) rarity = "Common";
@earnest phoenix
lmao
coc??
why dont you do this instead:
oh thx
hello can you help me please i wanted to make a database with mongoose but i had an error
i love how a guy who doesn't know how to read npm errors is saying lmao to a beginner's bot
Holy mother of god
destruction 100
this will change like 5 files
lmao
Help me please 👀
urgh.. im really lost in js. burried under tons of files.
pay 5$ and get unlimited help
first time?
-report
helppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
@earnest phoenix```js
// create an object where the keys are already in lowercase and include the name and rarity inside:
const cards = {
"archers": { name: "Archers", rarity: "Rare" },
"mega knight": { name: "Mega Knight", rarity: "Epic" }
etc...
}
// in the message code
const card = cards[args.join("").toLowerCase()];
if(!card) { return message.channel.send("invalid card"); }
const name = card.name;
const rarity = card.rarity;
i wrote it.. and dont get what i wrote... so.. xD
5$ is like 1% of what unity charges for support
1$ per minute at least
You arent unity lol
$500 looks like a bargain
500$ is double the average monthly salary of indians
Thats less than our company pays for Support Contracts
why am i chatting instead of coding?
True.
@lost berry damn i think it's time for another rules only
For Turks too 
So.. yeah.. i dont get this map-thingy you posted earlier
that wasn't for you lol
Ooooooooh now that makes more sense xD
Because it was something with queue
it's not?
k
client is undefined
that has nothing to do with queue
someone could help me
Yeah.. but the File that throws the error is Queue.JS that is loaded through play.js.
And that File is loaded by the handler. i look into the docs how i can give it the Client.
Ask mongoose's server
you can send the link pls
So it cant be the Command Handler. I just tested it with another Command and that Command gets the Client.
thx
Thats my Handler...
fs.readdir('./commands')
.then(files => {
for (const file of files.filter(file => file.endsWith('.js'))) {
const loaded = require('./commands/' + file);
if (!loaded.command || !loaded.run)
return console.error(`Missing params from ${file}`);
commands.set(loaded.command, loaded.run);
console.log(`Loaded command ${loaded.command}`);
}
});
And thats the head of the Command where "Queue.js" gets loaded
onst discord = require('discord.js');
const { queues } = require('..');
const Queue = require('../structures/Queue');
const { msToHMS } = require('../utils');
const config = require('../config.json');
module.exports = {
/**
*
* @param {string} args
* @param {discord.message} message
*/
run: async (args, message, client) => {
console.log(`PlayCMD: `, client);
how are you running the command
i type it into the Textbox and Send it.

i think the Problem is in the Class itself... i guess
The mighty class
onst?
Forgot the "c" while copying it into the Textchannel
k
The error is on line 75
hey guys How do i set up a menu to show my commands?
Yeah guys don't click those links my McAfee is saying those links are bad
HOW?
through a virus ofc
it's called AMOGUS LEAKED VERSION
all external AVs are bullshit
just don't do stupid shit on your pc and you're good with windefender
Yeah lol
Finally some normal dude in here
useEffect(() => {
socket.on("message", msg => {
updateMessages(React.Children.toArray([ ...messages, <Message {...msg} />]));
console.log(messages);
});
return () => socket.disconnect();
}, []);
the value of messages isn't updating in the useEffect smh
It's still shows as an empty array
even tho the component rerenders with the new value
What are you trying to do?
setting an event listener on mount?
you need useEffect for the messages too
that would run socket.on twice
you're only supposed to do that once
so like
useEffect(() => {
console.log(messages)
}, [messages])
Hey guys to add a Embed do i need to install a package?
You don’t need a package for an embed
ok then how do i add a embed?
Library?
<socket>.off('event name') or <socket>.off('event name', cb_function_here)
bc i get this when i try to
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! UnimportantLikableDesigners@1.0.0 start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the UnimportantLikableDesigners@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-10-03T14_30_24_401Z-debug.log
exit status 1
ty
np
what does it mean?
try downgrading node-fetch
what?
how do i fix this embed error?
Ok are you like going through code without installing any packages required for a discord bot to work
the newer version of node-fetch require us to use import fetch from "node-fetch"
what do i need to install?
Thank you
@pearl trail
nonono you can't, downgrade to node-fetch 2.x.x
import can be only used in es modules
What should I do?
^
npm i node-fetch@2.6.5
You can also require node-fetch async
not a problem 👍
and for random card?
when opening chests
how
to get the rarity of that card
array = Object.values(cards)
array[Math.floor(Math.random() * array.length)]
array = cards.name(cards)
array2[Math.floor(Math.random() * array.length)] ?
did i understand it?
no
Object.values() is a built in function that converts an object to an array of values
let a = array = Object.values(cards)
let ab = a[Math.floor(Math.random() * a.length)]
like this?
ik
k
@quartz kindle but, it gives a random card, no? how do i obtain that card's rarity and that stuff
cards.rarity doesn't work
the card contains it
card = a[...]
card.rarity
oh
ab.rarity?
yes
thx
hello online code, im dad
no some give me online code
what is online code?
this is the best server for getting help
hello online code, im dad
Grandpa is what you should say, Sir
hey i may be old but im not that old
im not even old enough to be these people's dad
unless i had them when i was 15
or something
You dirty, dirty boy 
i didnt even like girls when i was 15
lmao nerd
Well i got my Bots Server running
you need to change the event name
wdym?
Renaming the message event to messageCreate as the warning says.
lmao
clear cache
v12 🤓
but wouldn't that clear all my stuff?
i won't update
idk, it didn't clear all stuff of my browser but i'm not sure
you can no longer import node-fetch this way
then how?
import fetch from "node-fetch"
is the correct way
import fetch from "node-fetch";
you have to enable esm modules though, and also change the extension of all JS files
its saying cannot use import outside of a module
extensions to ?
Where did you require this
add a semicolon 
.mjs, and add "type": "module" to package.json
actually I think doing only one thing works too
so like, just do "type": "module" but then you'll have to use the import syntax everyone
such a mess tbh
..
You can also require node-fetch async
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
is this in d.py
so people can right click a message, and it reports the message to me
its a nitro scam report feature
const { MessageEmbed, MessageButton, MessageActionRow } = require("discord.js")
const fetch = require("node-fetch")
module.exports = {
name: "animeme",
aliases: ["anime-meme"],
group: "anime",
description: "shows an anime meme",
clientPermissions: ["SEND_MESSAGES",
"EMBED_LINKS"],
memberPermissions: [],
examples: ["animeme"],
cooldown: {
time: 5000,
message: ""
},
nsfw: false,
run: async(client, message, args) => {
try {
let data = await meme()
const row = new MessageActionRow()
.addComponents(new MessageButton()
.setCustomId('refresh')
.setStyle('PRIMARY')
.setEmoji('🔄'))
message.channel.send({embeds: [embed(data)], components: [row]}).then(msg => {
let filter = m => m.user.id === message.author.id
let collector = msg.createMessageComponentCollector({ filter, time: 90000 });
collector.on("collect", async i => {
let id = i.customId
if(id === "refresh"){
let data = await meme()
msg.edit({embeds: [embed(data)]})
}
})
collector.on("end", () => {
msg.edit({components: []})
})
})
} catch (e) {
message.error("Something went wrong ;)..\nError: " + e.message)
console.log(e)
}
}
}```
Did you try import way?
yep*
anyone help me with this
Type it to shell
dn
Did it work?
yep
Idk why but node fetch latest giving error on replit
So.. what is the best practice for Per-Guild Settings? i mean per-guild prefixes. how can i let it set by only Guild-Admins?
Replit just crashed but my code still runs lol
Store them in a database, cache them on startup and update them in both if a user changes the guild config.
The whole system is already done... my only thing is the Perms of the usrs
Use database is better
I dont want that random users from a guild change the Prefixes
so check the user's permissions
Then save with guild id?
Well check the user permission then?
Is there a Check for Guild Admins?
Always was
user_permissions & admin_flag != 0
note thats just a bitwise AND
Get the member permissions as array and check if, for example MANAGE_SHIT includes it.
normally what ever lib you're using will provide a nicer interface to it
if(!message.member.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR)) return;
That's generally very inefficient as opposed to just checking the flags
Depends on how much permissions he wanna check.
mmm Not really
Bit flags are used for a reason
you can compare multiple flags in a single bitwise op
as opposed to doing several lookups
😉 Bit flags are cool, look em up
It take while to search for flag codes

I would call that micro optimization but okay
Not really micro, It's an industry standard
ping 
because they get stored in 8 Bytes or less and can contain up to 64 unique keys that can be added and removed by a single OP
https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags is your friend
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
the logic becomes
Sorry... was migrating my custom Prefix thingy to my master branch
I mean that its easier to use MANAGE_MESSAGES than using perm.flags = 4729202
required_flags = (1 << 11 | 1 << 13)
has_perms = user_flags & required_flags != 0
all programming languages should have a built-in bitfield data structure, change my mind
many would argue that's just either an Enum or the default bitwise ops
Like, personally, I've tried using some 3rd party libs for them and just found them to be a bit over abstraction? ig?
yeah but what I meant was to make it readable, like C++'s bitfields
Other than managing serialization and deserialization
Why is that a big int
oh wait
JS moment
Although I thought the flags were already under 52 bits?
39
same here, when I'm using bitfields I always create a tiny wrapper which just has a hasBit and add / remove
so not quite sure why they make that a big int
What I'm trying to show comes out the same
Im not sure what you're trying to show but sure
Discord.Permissions.FLAGS.MANAGE_MESSAGES === user_permissions_flags
thats... Not how that works
That would fail on any user check that has more than the single permission MANAGE_MESSAGES I.e. litterally everyone will fail that check
top gg seems buggy
because it is
lol
To djs guide i dont need the check second permission
It is, put simple, awfully buggy
thats some interesting operator overloading if thats the case
Bro that link doesnt work
use this
that might actually be a link
how do i put it in a if?
before it was cardss.includes but now its different, no?
if(card){
//code
}
```?
I smell scam
works
there is anything that changes quick.db's db.push comma to other symbols? like: ```js
db.push(cmm_${message.author.id}
db.push(mcm_${message.author.id}
cmm, mcm
What i''d like to make
cmm | mcm
idk
k
log your command var and you will see your issue, btw. it should probably be called folder
(or category?! - don't understand your path logic)
2 readFileSync for the same file 😔
"silence" 
testing doesn't mean using unnecessary steps tho
but anyway
also, both ifs will fail everytime, //something is not a valid path for anything except network related stuff
if you say so
both files are in the same directory
Can we see the whole folder structure?
and log _dirname
path is good
why are you using "utf-8" when scanning a directory??
is that _dirname?
couldn't u show the whole path and censor only the private stuff?
ye wait
like, r\cmds doesn't help much
is this what u mean
how does one change the background picture?
bots cant afaik
bots are people too
ok, now the whole _dirname pls
try using the user endpoint
selfuser???!!!!1 
no
you should use relative paths instead of absolute ones
just looking at the request the client sends when you change it, no selfbotting here
you missed the joke
when you use bot endpoint to manipulate user stuff it's selfbotting
in this case ur using user endpoint to manipulate bot stuff
js devs dont joke
am not js dev
good
y am i even using js
try using ./cmds/<command>.js
it legit shit
you are forced to use it in the browser
fuck you brendan
people try to break the JS language all the time
its already broken
but then they are forced to put their bad ideas into TS
ctrl z moment
Wait are you literally just trying to push all your cmd names into an array?
Fantastic, what's the issue
Lmfao
so if u use user endpoint to manipulate user stuff ur not selfbotting? :thonk:
ur selfusering kekw
How'd it go btw?
but technically, u can't use automation for anything user-related anyway
bcuz that's explicitly against tos

when AI becomes self aware they wont like these rules

why cant it find the file when the thing is uncommented
start testing the if condition
I'm pretty sure it's the reason it's failling
also u don't need utf-8 for filenames btw
it just crashes when reading it
oh i just realized why xd
its file name not full path lmao
btw, use for-each instead of forEach
imma just rewrite it in cs, fk this language
that's nice too
whats the diffenrencne

you mean for-of, not for-each
I don't acknowledge the existance of for-of
but... there's no such thing as for...each
there's for...of, for...in and a normal for loop
PHP foreach > any other forEach
for each element
for of element
see, no such bs in normal langs
...
for (const element of array) {
//code
}
Maybe you should learn the language before you shit on it
u cant shit on shit
I do know that exists, still call it for-each
then why are you using it
so then why are you shitting on it?
didnt say its good 
btw shux, use annotations instead of relying on dirname to find out which category it is
that way u can retrieve all commands annotated by it
idk if js has something like that tho
java has for sure
maybe c# too, since it's a java++
java on steroids
cant even write hello world in java
does anyone even use cs for bots here
yes
js is the most normal language
the only thing weird about it is how normal it is
JS
bruh ```js
(node:633) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'rarity' of undefined
let card = cards[args.join(" ").toLowerCase()];
let rarity = card.rarity || "Unknown"
if there is no arg, the error shows
i made a embed with if !args[0] but same
what are the keys for cards?
name: "name", rarity: "rarity", low: "lowercased"
"electro giant": { name: "Electro Giant", rarity: "Epic", low: "electrog"
the embed of args[0] is first of the definition of rarity so idk the error appears
the embed shows but the error too
what is the args input that causes the error?
oh, no args causes the error
that makes sense
let rarity = card ? card.rarity : "Unknown"```
k
works 👍
success
howd what go
thx tim now is ultra fast adding cards
before it was difficult so i didn't wanted to add cards often
but now it's easier
ÑÑÑÑÑÑÑÑÑÑÑÑ
Hey guys how do i uninstall Node on replit? my Node broke
like what do i run to uninstall and to reinstall
i can't i spent days on my code
No, it’s not me tho
scam
This guy really tried scamming me? Dafuq
wtf fake scamming people
I met him as a customer on fiverr, and he randomly sends this shit
His account probably got hacked or sumthinf
send their ID
Aifht one sec
i blacklist hacked accounts/nitro scams
Owh no he is not from this server
as 90% won't get them back and they will be sold and used abusively
He was an old customer of mine
doesn't matter
865348491819352115
ty
Shhh, not so loud
Yeah, right id for sure
My bot used to only start up like once every 10 or so tries of me booting it up and I thought it was just a shitty vps... I forgot to await my client run function...
I suffered for so long because I’m a moron

Brain took damage while working with Java.
That’s irreversible…
Poor Waddle
_thanks auto correct _
😂
for me it was the opposite
when I awaited my login function it blocked my code from running any more code
lol
screen
I just started working with djsv13. what is @discordjs/builders?
that module will build your slash command easier... so like example:
new builder().setName("name_here").setDescription("description here").toJSON() , it'll return JSON that is needed to register your slash command to discord {"name": "name_here", "description": "description here"}
@rose warren hewwo :3 scams above
but now that mongoose findOneAndUpdate is deprecated, what shall we use?
updateOne?
do it in two steps
// findOne...
const guild = await Models.Guild.findOne({ id: context.guild.id });
// ...AndUpdate
guild.members.set(context.user.id, { weeb: true });
await guild.save();
there's no updateOne in mongoose?
there is
so you will be doing two database requests instead of one... ok then 😩
Neither findOneAndUpdate nor updateOne is deprecated?
huh
const express = require("express")
const app = express()
const server = require("http").createServer(app)
const io = require("socket.io")(server,{ cors: { origin: "*" } })
const DiscordAuth = require("disc-auth.js")
const config = require("./config.json")
const defObj = {
cdns: config.cdns
}
app.use(require("cookie-parser"))
app.set("view engine","ejs")
app.get("/",(req,res)=>{
console.log(req.cookies)
res.render("not-av",{...defObj})
})
server.listen(2000,()=>console.log("Server Running . . ."))
io.on("connection",(socket)=>{
console.log("Connected "+socket.id)
})
Page wont load or anything when i go the the url that is hosted on
help 
when object reference problems make you detach the state from the component :(
clone it
the problem is:
useEffect(_ => {
socket.on("message", msg => {
console.log(messages);
updateMessages([...messages, msg]);
})
}, []);
the value of messages never changes

👀 what is ejs
what does useeffect do?
a view template
i cant rlly explain much but
it makes like u can display things from an object given
like ...defObj
runs something only when the component mounts/unmounts/a specific state value changes
componentDidMount()?
why wont this load a single content?
they're using websockets too
^
oh its on the same server
for a project im building 
like it makes it possible to make a real time chat app for example
like the client side can communicate to the server side etc. etc.
I remember using vanilla websockets
it was horrible
or maybe it was just typescript or deno fucking up
why were you using deno
because it was a lib for deno
ok
can anyone help me why it isnt sending something back 
wdym?

??
yeah
??
why do people shit on stuff for no reason
(python obviously sucks and im allowed to hate on it)
also it logs Server Running . . .
does it logs the cookies?
just realized the cookie-parser module was the issue
and i just needed to call the function when requiring that module

mhmm
dum bass
I'm reading replit docs for authentication
where tf does the user data go after authenticating???
<script authed="location.reload()" src="https://auth.turbio.repl.co/script.js"></script>

ok i found it
req.headers["x-replit-user-name"]
wait what authentication
im interested :misosface:
i don't know how to word this question so i'm sorry if it makes no sense but
within this form, i want the user to be able to enter their mysql credentials as many times as they like on this page without having to restart the server
what currently happens is if they enter their credentials wrong or some other fatal error happens, when they go to submit their credentials again, this error gets logged to the console:
how do I fix this?
if necessary, i can provide the code:
/////////////////////////////////////////////////////
// //
// BTS Bot //
// //
// File: checkMySQL.js //
// //
// Written by: Thomas (439bananas) //
// //
// Copyright 439bananas 2021. All rights reserved. //
// //
/////////////////////////////////////////////////////
const log = require('../core/logHandler');
const mysql = require('mysql');
var connection; // Apparently this needs to be declared prior to the function to prevent overloading with event listeners
function checkmysql(hostname, username, password, database) {
if(!connection) { // See first comment
connection = mysql.createConnection({
host: hostname,
user: username,
password: password,
database: database
});
connection.on('error', function(err) { // If there's an error, log and handle it, don't crash
log.error(err);
});
}
return new Promise(function(resolve, reject) { // Rejections/resolutions will be returned to the called
connection.connect(function (err) { // POOL ONLY CONNECTS USING FIRST ENTERED CREDS, THIS IS BAD. INVESTIGATE NOW
if (err) {
//console.log(err)
if (err.code == 'ER_ACCESS_DENIED_ERROR') { // Reject with various errors based on what the server returns
reject('INCORRECT_CREDENTIALS');
} else if (err.code == 'ER_DBACCESS_DENIED_ERROR') {
reject('ACCESS_DENIED');
} else if (err.code == 'ECONNREFUSED' || err.code == 'ENOTFOUND') {
reject('CONNECTION_REFUSED')
} else {
reject('UNKNOWN_ERROR');
log.error(err)
}
} else {
resolve('OK') // If blow test successful, return OK
}
//connection.destroy()
});
});
}
module.exports = checkmysql;```
I can't help with mysql but dude this looks sick
@drowsy crag
aaaaaa thank you
someone i know called it ostentatious
@rose warren
looks like nom is ignoring pings
i took the idea from dave plummer and the format from a minecraft modder so thank him
@rustic nova
your code sets the connection if it doesnt exist
once it exists it will not set it again, because connection already exists
if you want to redefine the credentials without restarting the process, you need to close the connection and clear the connection variable
so i declare connection by itelf within the function right?
function checkmysql(hostname, username, password, database) {
var connection; // Apparently this needs to be declared prior to the function to prevent overloading with event listeners
if(!connection) { // See first comment
connection = mysql.createConnection({
host: hostname,
user: username,
password: password,
database: database
});
connection.on('error', function(err) { // If there's an error, log and handle it, don't crash
log.error(err);
});
}
return new Promise(function(resolve, reject) { // Rejections/resolutions will be returned to the called
connection.connect(function (err) { // POOL ONLY CONNECTS USING FIRST ENTERED CREDS, THIS IS BAD. INVESTIGATE NOW
if (err) {
//console.log(err)
if (err.code == 'ER_ACCESS_DENIED_ERROR') { // Reject with various errors based on what the server returns
reject('INCORRECT_CREDENTIALS');
} else if (err.code == 'ER_DBACCESS_DENIED_ERROR') {
reject('ACCESS_DENIED');
} else if (err.code == 'ECONNREFUSED' || err.code == 'ENOTFOUND') {
reject('CONNECTION_REFUSED')
} else {
reject('UNKNOWN_ERROR');
log.error(err)
}
} else {
resolve('OK') // If blow test successful, return OK
}
connection.destroy()
});
});
}```
ooooo ok thanks
what test
lol basically if everything goes well with pinging the mysql server then return ok
blow test is DROP table users
blow up the database

lol my guy you definitely don't want to create a new connection pool just for ping
also don't reject strings
bad: reject('Something went wrong')
better: reject(new Error('ERROR_CODE'))
Errors contain stacktraces, if you throw strings you have no idea where the error came from
how can i get the image?
like
this link's image
it shows a image
how do i get that image?
sure, look at the sites meta tags for it
ok
how
make a request to the url, check the meta tags
how
Perhaps you should look up how to query a website for html data 😛
how what, how to make a request, or how to check the meta tags?
what programming language, how are you getting the url, what type of tags do you want to support, and any other relevant information needs to be provided.
both
I asked like 5 questions there.
what does "both" mean?
first 5
ok, answer the rest please 👀
im not sure what that means
That... wasn’t the question
idk
I don’t think he can guess what tags you want and what programming language you’re using
better i make a json with all the data
json of?
bruh
you are making a request
Parse the data from the html, then you could throw that in a json if you need to for some reason
just to clarify, we are not assuming you are making a website(not sure where you got that from).
We are wanting you to do this, but programmatically.
https://i.woo.pics/2ea45c0b57.mp4
This is the same basic method twitter, facebook, and discord uses to get that information from websites.
clash royale brings back memories 
it suppose to be globally
Yeah but it won't appear if you didn't invite your bot with the applications.commands scope.
o okay and how exactly do i do that?
In your invite link include the applications.commands scope.
I get "has is not defined" when someone without perms executes the command
const { Client, Message, MessageEmbed } = require('discord.js');
module.exports = {
name: 'kickeeee',
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async(client, message, args) => {
if (!message.author.permissions.has(`KICK_MEMBERS`)) {
message.channel.send("user has kick perms, cant kick them")
return;
}
message.mentions.members.first().kick().then((member) => {
msg.channel.send("Get yeeted" + member.displayName + " . Haha yes I kicked that guy");
}).catch(() => {
message.channel.send("There was an error. This could have been caused by:\nThe user has a role higher than mine.\nMember who tried to kick does not have sufficient permissions.\nI do not have sufficient permissions.");
});
}}```
has is not defined, or you cannot use has on undefined?
I use it at many places undefined
not sure what that means, but message#author doesnt have the property permissions.
https://discord.js.org/#/docs/main/stable/class/User
which means the error probably isnt has is undefinied, but you cannot use has on undefined.
You're probably looking for message#member.
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=member
Would anyone like to help me make a Grammarly bot for discord? (Idk what else to make, one of my friends suggested this)
But how would it work
As bots can’t edit other peoples messages
why is my vscode doing that lmao https://omg.free-robux.download/hYUL8O7G
my tab size didnt change
how to vertically align text 
you want vertical centering?
you need to make the parent height 100% or 100vh
doesnt matter
let jobs = ['member', 'helper', 'moderator'];
let myJobs = ['member', 'helper'];
let toBuy = 'moderator';
let lastJob = myJobs[myJobs.length - 1];
So, I'm trying to figure out how I can check if the user has the previous job before buying another job.
Example, when he buys moderator, I need to check if he bought helper before it.
What? How am I going to be using them in my situation, I mean I know I'll be using .find() but to search what exactly, since I'm confused.
let jobs = ['member', 'helper', 'moderator'];
let myJobs = ['member', 'helper'];
let toBuy = 'moderator';
let index = jobs.indexOf(toBuy);
let hasPrevious = myJobs.includes(jobs[index-1]);
Ah, why the - 1?
OH WAIT.
My bad.
how do I get a random number between 80 & 40 bc this gives me 100 sometimes, I want like if it's less than 40 it'll change it to 40
let amount = Math.floor(Math.random() * 80) + 40;
-
-
- 40
-
yes
I say MongoDB can be a good start.
I'd like to ask, why when I console log some arrays, some return different design of outputs.
-
-
- 2300
-
Basically,
- max-min) + min
I never used it honestly, so I am not sure if it is good or not. 🤷♂️
yes its good
An SQLite database is limited in size to 281 terabytes (2^48 bytes, 256 tibibytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this.
what about ntfs?
does ntfs have a limit?
you think you'll store more than 281 terabytes of data??
each sqlite database is a single file, if you want multiple files you can run multiple databases
Maximum disk size: 256 terabytes
Maximum file size: 256 terabytes
Maximum number of files on disk: 4,294,967,295
Maximum number of files in a single folder: 4,294,967,295
is it really 256 tb 
Imagine backing up 256 tb
exfat:
Max. volume size c. 128 PB, 512 TB recommended
Max. file size c. 128 PB (theoretical 16 EB–1)
Max. number of files up to 2,796,202 per directory
Max. filename length 255 characters
linux ext4:
Max. volume size 1 EiB (for 4 KiB block size)
Max. file size 16 TiB (for 4 KiB block size)
Max. number of files 4 billion (specified at filesystem creation time)
Max. filename length 255
whats the biggest limit on the filesystems
your hard disk 😎
what about my soft disk
so 300gb is the biggest limit?
or SSD
300gb is nothing
depends on the hard drive
i know
2 terabytes for samsung 850 pro
ReFS:
Max. volume size 1 yobibyte (2^80 bytes)
Max. file size 16 exbibytes[citation needed] (2^64−1 bytes)
what about terry's fs?
yobibyte 
idk the name
ReFS was designed to overcome problems that had become significant over the years since NTFS was conceived, which are related to how data storage requirements had changed. The key design advantages of ReFS include automatic integrity checking and data scrubbing, elimination of the need for running chkdsk, protection against data degradation, built-in handling of hard disk drive failure and redundancy, integration of RAID functionality, a switch to copy/allocate on write for data and metadata updates, handling of very long paths and filenames, and storage virtualization and pooling, including almost arbitrarily sized logical volumes (unrelated to the physical sizes of the used drives).
good shit
2-16 terabytes for a hard drive is the max
come on now who's gonna use up 1 yobibyte
if it's windows 10
games n stuff
There isn't a storage medium which can store 1 yobibyte of data sooo yeah
and a motherboard which can handle 10 billion 100tb ssds :^)
What's the regex to take out an emoji from a string?
let channel = "🔒general";
let emoji = '';
function locking() {
console.log(channel.match(//))
};
does anyone have ideas on what bot to make?
is this 60 mins ?
No, 10
depends
👀
ae you serious ?
Ye
I used ms
oh ms
Because 604.8 seconds = 10 minutes
hell
i thought its just time stamp
whatever in my dashboard i need to use this token once
oh sqlite files have 140TB of storage
kek
im making a wait_for function but like i want to check if its the right answer bot if its not it says incorrect and yes i know the bot.wait_for("message", check=check)
help
pls
so discord won't make sounds of messages now?
then i can enable my sound, i disabled the message sound from discord but it re-enables in 1 day or 2 days
you're*
Changing your bots banner with the user endpoint
Is it possible to pick another region for Cloudflare Workers?
on discord.py, how can i make my bot dm a user if they say something in a certain list of phrases? so far i have
if any(word in msg for word in dm_user):
but i can't work out how to get the bot to dm the user something when the certain phrases are sent
i didnt do that, i just suggested a way to do it
the other guy was asking how to do it
By converting the buffer to a string in the first place
by JSON.stringify?
toString()
What are you trying to do at all?
transcript command
Write the CSS part into a CSS file and include it into your HTML script
how
im new to js
sry.
Is this your string you got from the buffer?
yep
Then try to write the whole content to a HTML file using fileSync
(assuming you’re using nodejs)
.replace
👍
await fs.writeFile("trans.html", file, err => {
if(err){
console.log(err)
} else {
console.log("dn")
}
})
Writing it to the user? You mean sending it via Discord? If so send it as attachment
yep
😂
and if i put the radio in url this now full crash of codes
and lucky i have back up codes onyle i hope backup codes still works if theres no erros coming out :/
ye
I need start over
i really dont nou yet what error this is when u use command of play this joining and channel saying music start onyle bot leaves some resson
and i can't find in codes why?
This is resson ever time if i found some stupid thinks about the bot i really love to trun it off when i still in queue of top.gg 😄
What

is that tim?



