#development
1 messages · Page 1897 of 1
This is line 30: return config ? res.send(config) : res.status(404).send({ msg: "Not Found" });
also this ^ leads me to believe you are trying to send a mongodb object instead of the value
there is mongodb involved yes
full thing:
const { guildId } = req.params;
const config = GuildConfig.findOne({ guildId });
return config ? res.send(config) : res.status(404).send({ msg: "Not Found" });
})```
pretty sure findOne is a promise
...
hmm wait what
GuildConfig is a mongoose schema
and what does findOne return?
all good
for (const key in reps) {
var val = reps;
var sorted = Object.keys(val).sort((a, b) => b.points - a.points);
console.log(sorted)
m = reps[key].points
g = await client.users.fetch(key)
arr.push(`#${i++}. Points: ${m} ~ User: ${g}\n`);
}
for (const perUser of arr) {
content += perUser
}
```y is my code not filtering and sorting properly
it doesn't look like it's filtering based on highest > lowest points
does anyone know an easy way to make a log in system?
login like for a website?
using discord/anotherservice as the login? or just stand alone?
on a website or on discord
does anyone know why this issue occurs?
if on a website, look into https://auth0.com which is highly integratable and comes with lots of documentation and examples
Hey again! I get this error that i dont understand:
PUT http://localhost:3001/api/discord/guilds/860889793009156106/msgmoney 400 (Bad Request)
the error comes from this block of code:
try {
const update = await updateMsgMoney(match.params.id, msgMoney);
console.log(update);
} catch (err) {
console.log(err);
}
}```
what is localhost:3001?
im guessing thats a local database or server you're running?
proxy server probably
trying to get the bot to mention everyone?
<@&guidid> right?
or just <@guildid>
never mentioned everyone with a bot
just regex match it and replace with something else
or this <text>.replace("@everyone", "EVERYONE_PING")
<@&guild_id> is not @everyone, that's just the everyone role which won't ping
it's just @everyone
@everyone @everyone -> EVERYONE_PING @everyone

well to be fair I want to make a node.js tool, just want some kinda log in system, that won't require me to hardcode every password, some kind of storage system that will access the passwords I add through the cloud
js doesn't replace all instances?
datsucks
string.replaceAll() or replace with regex
in java replace replaces all instances
why does it say empty fields..
all
of them have a string in them
ping in replies
Are you even allowed to add that many fields?
25
Whatever the case, are you sure that’s the embed causing an issue?
That won't work, just using the direct string like message.channel.send('@everyone') does the job
Using guild I'd to parse it into a role mention would gives you 2 @ symbols like this
<@&264445053596991498>
Well I technically use the same tho, one sec
It didn't ping cuz I turned off everyone mention in my client*
Lol that's what happens when u use guild Id to create a everyone mention
The only way I know of is using it directly as a string. But I have no idea why that doesn't work for you
Discord privilege ON_READY when? 

"Thank god discord approved my send messages intent request"
Bots should be using telepathy to communicate; not sending messages smh
Telepathy? Sound like a privacy issue.
It's in beta and badly implemented

Sounds...familiar
Discord privileged interactions when?
You must have discord nitro to create a bot user!
And it must be nitro, not nitro classic
Worked?
is it bad having in my bots page (in top.gg) having a hidden iframe that lodes my repel page (so the bot is running when they add)
but mee6 uses iframe
Different usages
You want a cheap solution, mee6 properly uses iframe to embed its own site
It's a bad option bcuz
A - chances are it won't work at all since it'll be hidden and
B - you have absolutely no guarantee you'll have enough visits to keep it 24/7
no im not wanting it 24.7 i just want it running so when they add it the bot can say a message
Having the bot run for a few minutes after someone add it is worthless if it dies a few moments after
and sofar its running when i keep the tap open
Plus I imagine everyone else will kick the bot since it'll not be working
like i will make it say "this bot isnt 24/7, visit <repel linl> to have run"
They won't visit
Users don't care enough to do that on a frequent basis
what you use to host?
Like, unless your bot is a one-of-a-kind chances are they'll just find another bot for it
Personally I use contabo
no its pritty boring bot (just submited)
Just ask yourself: would you use it on your server?
well i use it on my server
Then chances are it is good enough
and when im awake i keep tab (with link) open
Bots don't need to be the next crysis, they just need to fulfill a purpose
If it does, it's a good bot
ok thanks
Btw, why didn't uptime robot work for u?
GG! :love:
i think i may have fixed the issue after further reserch
is it normal
to have your GPU tempature
65 degress celcius all the time
also its a small GPU card from like 2014 with 2G space
playing minecraft with spotify
What is considered a "good" GPU temperature?
My GPU runs in the 60-degree celsius range and rarely goes up to 70C under heavy gaming load.
so seemes like its normal
65 °C is lukewarm for games
👌
90c+ is where it's gonna be a problem
most graphics cards shut off around 95c
to prevent physical damage
mine is litilery at 98 right now-
alright I guess its time to stop playing minecraft for some time
barly played 45 minutes
🤡no
I guess if you're writing to a json file 
But if you're trying to make a db use mysql, postgresql or mongo
which host should i use
i cant pay
it should free
or included free in github student pack
What free host are you already using and why do you want to change?
replit
I'm pretty sure you've already asked this question and people have answered you
but replit ran to error
Then fix it 🤷♂️
i didnt asked or maybe i asked and i dont remember
The host isn't the problem it's your code
i asked person in discord developer
i ran into api blocked
Yeah any free host isn't good. You get what you pay for when it comes to hosting.
hmmm i used hacker plan free on github student pack
I see. Then just make a new replit I guess?
^
digitalocean requires a payment method that i dont have
Every host requires payment. Replit isn't a host. It's a container.
and how about microsoft azure?
Free options are pretty much replit and heroku, and Google has a free proper vps but it requires cc details and only lasts for a year iirc.
can you help me host on heroku?
i use discord.py
idk how to host
anyone can see something wrong in this line? ```js
var foundedItem = items.find(item => item.name.replace(" ", "").toLowerCase() == ItemName1.replace(" ", "").toLowerCase())
No but there are a bunch of tutorials online. I started out on heroku but I quickly got a vps after a month or two.
Heroku also requires credit card details to unlock extra free hours iirc
Otherwise you'll have downtime during the month
haizzzz....
const Discord = require("discord.js");
const { Client, Intents } = require('discord.js');
const client = new Discord.Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_BANS, Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS, Intents.FLAGS.GUILD_INVITES, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_MESSAGE_TYPING] });
const config = require("./data/config.json");
const fs = require("fs");
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync("./data/commands").filter(file => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(`./data/commands/${file}`)
client.commands.set(command.name, command);
}
client.on("message", msg => {
if (!msg.content.startsWith(config.prefix) || msg.author.bot) return;
const args = msg.content.slice(config.prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (command == "help") {
client.commands.get("help").execute(msg, args)
} else if (command == "social") {
client.commands.get("social").execute(msg, args)
}
});
"TypeError: Cannot read properties of undefined (reading 'execute')
at Client.<anonymous> (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\index.js:37:30)
at Client.emit (node:events:390:28)
at MessageCreateAction.handle (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:18)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:350:31)
at WebSocketShard.onPacket (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)
at WebSocketShard.onMessage (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
at WebSocket.onMessage (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (C:\Users\M. Salan\Desktop\reduxproduct\reduxbot\node_modules\ws\lib\websocket.js:1022:20)"
can anyone help me?
random question but how do i send a request with a cookie with axios?
axios.get('...', {withCredentials: true})
so how do i set the cookies?
oh, idk about that, afaik it will use the target url's cookies
wym target url's cookies?
like if you want to fetch data to https://a.com with withCredentials sets to true, it'll use https://a.com 's cookies
oh sadge
you can set it manually on headers too tho
does anyone know an embed generator no webhooks needed only my own bot?
aws free tier lasts 1 year
I wasn't talking about aws
I know you weren't, that was an additional information in case someone was interested in free tiers 🤷♂️
Discord verified?
The verified check mark on your bot?
Dbl verifybot
Hi! It seems like you are looking for information on how to get your bot verified.
Once your bot reaches 75 servers or more, you are eligible for bot verification. Since October 7, 2020, bots that reach 100 servers will not be able to be invited to any more servers. You verify your bot on your bot's application page, under the "Bot" section in the sidebar.
If you need more information, check out this article written by Discord about The Future of Bots on Discord and you can ask questions in the Discord Developer Server.
We cannot provide support on how to get your bot verified.
Read that
discord isnt granting it
Then go to https://discord.com/developers/applications and find your bot, then click “Bot”, then “Verify” at the top
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
it says invalid
We can't help
ik
You need to ask in the Discord developers server https://discord.gg/discord-developers
ok
f
how?
axios.get('...', {
headers: {
cookie: theCookie
}
})
module.exports = (client, oldMember, newMember) => {
const oldStatus = oldMember.premiumSince;
const newStatus = newMember.premiumSince;
if(!oldStatus && newStatus){
client.emit("guildMemberBoost", newMember)
}
if(oldStatus && !newStatus){
client.emit("guildMemberUnboost", newMember)
}
}```
its not Emitting when user is boosting twice
Do you have them cached?
wym
because I want to delete the registered one and I need thier IDs
Ah
"theCookie" will be an object r8?
You can use command.id
okey thanks
its a string
key=value; key2=value2; etc
ah
is it possible to avoid repeating the 0.25s in scss?
and should I use CSS animations for animating that many properties instead of transitions
is there a limit how many times a / command can be used per day on a server?
nope
nope
but there is a limit for how many slash commands your bot can create per day
so i can have a certain amount of commands but there is no limit on usage
because i made a command that works with slash but im too dumb to make it work with prefix lol
yes
you have to add command cooldowns yourself
Cuz member's premiumSince only gets updated if the user is boosting after being a non-booster. If the user is already boosting and boosts again, the premiumSince would not get updated
there isn't a reliable way to detect a boost
ironically
user tokens get the boost event
bot tokens don't
You can check guildMemberUpdate for users who get the Server Booster role
But it only updates once, if a user boosts more than once (ie) a user boosting while having the server booster role would not be caught by that event
Yeah if an existing user boosts again I don't think there is a way to do it?
check for the boost message, if you want to replace it just delete it and send your own
Well only way you can is to listen to the message event for system message saying a user has boosted which contains the message mention of that user
this is by far the best solution you can get, however it doesn't work if the guild turned off boost messages
^^ thats how the tanku bot does aswell
Or when message intent becomes a thing and your bot does not have the message intent. Or if your bot doesnt have permission in the system message channel
you can tell people that in order to use the custom boost message (or any other features related to boosting) they need to enable boost messages
can anyone tell me how to send a interaction reply with menus?
hey ive been told to come here
i need some help making a command that helps me get my bot out of inactive servers
its pending verificaton with 98 / 100 servers being used rn
You just need to work out what you define as "inactive" and figure out a way of detecting that. Then just use guild.leave() for each of the inactive guilds.
Hey! I'm making a dashboard for my bot and I want others to be able to visit the site. I have port forwarded the ports, but i cannot make this work -> pubicip:port. How would i port forward a react app?
any solution?
client.on('messageReactionAdd', async (reaction, user) => {
if (reaction.emoji.name === `\u2728` && user.id !== client.user.id) {
user.send("**You have selected: \u2728")
}```how do i get an array of all usesers that reacted?
push them to array?
but how would i get them in the first place
No
Well via the event you showed or fetching them of your target message
then how mimu is doing that?
I dont know about mimu. But if a bot has that feature, it probably does this
This
There is no way for that, except looking if a user totally loses the server booster role
ok
thnx for the information
@hybrid cargo how does @livid jackal get the boost event
hi
hi
Idk, i have no idea. Maybe they have the same setting but maybe the boost messages are being listened in a different hidden channel?
Idk i can only guess
maybe a self bot
When do buttons timeout so it will throw an error when you click them with "Unknow Webhook" and how to fetch this error?
why will it throw unknown webhook
buttons dont have a timeout. Only the Interaction Listener has a timeout (if you set it). If not you can get the interaction with the interaction event anytime
Lets not talk about that tho, but just to understand how things work, self bot will only receive the event for it's own boost not for other's boost.
well
That is weird because when I click a button 5 min later it will throw an error "Unknow Webhook, method patch"
Because u use a interaction collector
tracking system messages from boost in a separate hidden channel
Which times out after a x amount of time
yes I do
and how to fetch it?
Fetch what?
by fetch you mean get the timeout?
the error
yeah or sth like that
djs will ignore errors after timeout
then... fetch the error?
your code cannot detect an error
and then how can I impede the "Unknow Webhook token, method: patch" error then?
I don't understand
the error happens within discordjs itself
it is not passed to your command code
when I click a button after for example 10minutes it will throw an "Unknow Webhook token, method: patch" error
anyways can someone help me with SCSS
.card {
position: relative;
z-index: 0;
transition: padding 0.25s, transform 0.25s, height 0.25s, width 0.25s;
&:hover {
height: 350px;
width: 256px;
z-index: 999;
transform: translateY(-10px);
padding: 10px;
}
}
Everything works but the z-index stays the same
And when I manually set the z-index using devtools it doesn't appear on top of other elements that have z-index: 0
ty
At this point it's just how good people here are at googling problems in Stack Overflow
well none of the answers helped so
¯_(ツ)_/¯
DiscordAPIError: Invalid Webhook Token
at RequestHandler.execute (/home/development/test-bot/node_modules/discord.js/src/rest/RequestHandler.js:298:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/development/test-bot/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async InteractionWebhook.editMessage (/home/development/test-bot/node_modules/discord.js/src/structures/Webhook.js:268:15)
at async CommandInteraction.editReply (/home/development/test-bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:139:21) {
method: 'patch',
path: '/webhooks/894599461735661578/aW50ZXJhY3Rpb246ODk2NzI2NDU4NDI3Mzk2MTE2OjZFckp4aVd3bXZWVWN5VGg5VTJtUURrdlU4TEFLZFQ4MWoyUWVweFlnMThkZE5BbEJydmd3Q1ZtQjVoUWJrM2gyMmpXejhtYTJac294T3JMQWdGa0tQSDdydnliYWFIV21zU3Z6d2dOSVVIUHZSNWJTZmQ5a2lxem9vdlJvZ0dP/messages/@original',
code: 50027,
httpStatus: 401,
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: undefined,
components: [ { components: [ [Object], [Object], [Object] ], type: 1 } ],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
},
files: []
}
}
your webhook token is invalid
how do i redirect someone to another page using native js?
But I dont have something to do with webhooks
rowsValues[arrayIndex][valueIndex] = newValue;
// example
rowsValues[0][0] = 1;
console.log(rowsValues); // [ [1, 0, 0], [0, 0, 0], [0, 0, 0] ]
window.location.href = "new page"; // preferably youtu.be/dQw4w9WgXcQ
ty
Hey! Are anyone able to help me? Thanks in advance :)
your best choice is to NOT host a bot dashboard on your own hardware
why not?
because it is too much extra work
tm.question('Voor welk dag wil je je inkomen berekenen? Voorbeeld: maandag\n\n', (answer) => {
console.log("Correcte database zoeken...")
tm.question(`Wat was je begintijd op ${answer}? Voorbeeld: 06:00\n\n`, (answer1) => {
console.log("Begintijd ingevoerd!")
tm.question(`Wat was je eindtijd op ${answer}? Voorbeeld: 20:00\n\n`, (answer2) => {
console.log("Eindtijd ingevoerd!")
setTimeout(() => {
console.log("Aan het rekenen.....")
if(answer == 'maandag'){
let geggeg = Number(answer2) - Number(answer1)
console.log(Number(geggeg))
}
}, 2000);
})
})
})
```why is geggeg logging NaN?
i have a separate computer
Pretty sure it's a number right
log the value of answer1 and answer2
and you don't need to convert geggeg to a Number when logging
the cloud is better
it's a string, i used typeof.
huhhh
you're using react for your dashboard?
its baically just 20:00
remove the : before converting to a number
the : makes it NaN
aa
whats the difference between nextjs and react?
(massive oversimplification) nextjs is a server for react
like express but easier
DiscordAPIError: Invalid Webhook Token
bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:139:21) {
method: 'patch',
path: '/webhooks/894599461735661578/aW50ZXJhY3Rpb246ODk2NzI2NDU4NDI3Mzk2MTE2OjZFckp4aVd3bXZWVWN5VGg5VTJtUURrdlU4TEFLZFQ4MWoyUWVweFlnMThkZE5BbEJydmd3Q1ZtQjVoUWJrM2gyMmpXejhtYTJac294T3JMQWdGa0tQSDdydnliYWFIV21zU3Z6d2dOSVVIUHZSNWJTZmQ5a2lxem9vdlJvZ0dP/messages/@original',
code: 50027,
httpStatus: 401,
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: undefined,
components: [ { components: [ [Object], [Object], [Object] ], type: 1 } ],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
},
files: []
}
}
I am getting this error on "interaction.editReply()
so i need to change the whole dashboard?
nope
how does anyone unironically use this language
expiry date on a pack of pure honey
this is like the onion level bad. I'd laugh if you told me you wanted to use numbers for placeholders when formatting dates
who thought Println in Pascal Case was a good idea
can you send the link to that stackoverflow question
I don't like flaming languages but go makes so many terrible decisions on top of each other despite being a modern language built on decades of language research like... I just don't get it
so i have this chart based on my work hours.
How would i ever check if the inputted worktime fits in the first field?
so react wont work on vercel?
for example i worked from 7:00 till 20:00
it will
nextjs is like express for react
but i have express and react?
express doesn't work on vercel
is this supposed to be standard
aww
cuz i dont know how to convert etc
pretty easy
it's supposed to be the go alternative to C's strftime
keep a backup
moving to nextjs is pretty easy
make a folder called pages and add your website pages
example: put this in a file named index.jsx
export default function HomePage() {
return <h1>Hello World!</h1>
}
@tribal crow
then install nextjs with npm i next react react-dom webpack and run npx next dev
next : The term 'next' is not recognized as the name of a cmdlet, function, scr
ipt file, or operable program.
wait
you can just try npx create-next-app
i just have to wait until the backup is finished
console.log(realanswer2)
if(realanswer1 >= 0000 && realanswer2 <= 0600){
g = base*1,44*faka```why is realanswer2 <= 0600 false?
realanswer2 is literally 0600
0600 is not what you think it is
it's an octal literal
go add "use strict"; at the top of your file and you'll catch this bug
remove the 0 at the start
uuh... im new to Lavalink.. i set everything up, migrated to it.. everything works but.. uuh.. for some reason my bot keeps being silent
alrighty
Thats the last log
2021-10-10 14:44:12.122 INFO 12656 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded playlist Search results for: dreamcatcher
2021-10-10 14:44:12.130 INFO 12656 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketServer : {"track":"QAAAlgIAJ0RyZWFtY2F0Y2hlcijrk5zrprzsupDss5ApICdCRWNhdXNlJyBNVgAVRHJlYW1jYXRjaGVyIG9mZmljaWFsAAAAAAAC9dAAC1BFS2tkSVQ4SlBNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9UEVLa2RJVDhKUE0AB3lvdXR1YmUAAAAAAAAAAA==","op":"play","guildId":"879376100273311774"}
2021-10-10 14:45:12.473 INFO 12656 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketServer : {"op":"destroy","guildId":"879376100273311774"}
just gonna delete it because that had your webhook token in there
Oh+
wait
DiscordAPIError: Invalid Webhook Token
bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:139:21) {
method: 'patch',
path: '/webhooks/token',
code: 50027,
httpStatus: 401,
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: undefined,
components: [ { components: [ [Object], [Object], [Object] ], type: 1 } ],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
},
files: []
}
}
I am getting this error on "interaction.editReply()
I already defer Updated:
collector.on('collect', async (i) => {
i.deferUpdate()`
how is an interaction response a webhook
Well..... I dont know
I get this interaction error when I clicked a button 10min after the interaction reply was sent. First thought was it is a timeout error
defered interactions are basically webhooks
i dont even know how to troubleshoot it even more..
now what?
The error occured after 15 min when I clicked the button
I used:
const filter = (filter) => {
filter.deferUpdate()
if (filter.user.id === inter.user.id) return true
return
}
I have no idea what i have do e wrong but slash command works prefix does not.
Any pro bot dev able to help me solve my issue.
import { ICommand } from "wokcommands";
import DiscordJS, { Message, MessageEmbed } from 'discord.js';
import axios from "axios";
export default {
category: 'esportal',
description: 'Checks an user from Esportal.',
minArgs: 1,
expectedArgs: '<username>',
options:
[{
name: 'username',
description: 'Username of the person you want to check from Esportal.',
required: true,
type: DiscordJS.Constants.ApplicationCommandOptionTypes.STRING
}],
slash: 'both',
testOnly: false,
callback: async ({ message, interaction }) => {
const { options } = interaction
const username = options.getString('username')
let res = await axios
.get(`https://api.esportal.com/user_profile/get?username=${username}&bans=1&team=1&twitch=1`) as any
let data = res.data;
console.log(data)
const embed = new MessageEmbed()
.setTitle(`View the Profile of ${username}`)
.setURL(`https://esportal.com/profile/${username}`)
.setColor('AQUA')
.addFields([
{
name: ':bust_in_silhouette: User',
value: `${username}`,
inline: true
},
{
name: ':no_entry_sign: Banned',
value: `${data.banned}`,
inline: true
},
{
name: ':green_square: ELO',
value: `${data.elo}`,
inline: true
}
])
.addFields([
{
name: ':+1: Thumbs Up',
value: `${data.thumbs_up}`,
inline: true
},
{
name: ':-1: Thumbs Down',
value: `${data.thumbs_down}`,
inline: true
},
{
name: ':trophy: MVPs',
value: `${data.mvps}`,
inline: true
}
])
.addFields([
{
name: ':regional_indicator_w: Wins',
value: `${data.wins}`,
inline: true
},
{
name: ':regional_indicator_l: Losses',
value: `${data.losses}`,
inline: true
},
{
name: ':regional_indicator_d: Drops',
value: `${data.drops}`,
inline: true
}
])
.addFields([
{
name: ':gun: Kills',
value: `${data.kills}`,
inline: true
},
{
name: ':skull: Deaths',
value: `${data.deaths}`,
inline: true
},
{
name: ':busts_in_silhouette: Assists',
value: `${data.assists}`,
inline: true
}
])
return embed
},
} as ICommand
// /user <username>
// e!user <username>
ok so
one question
am i able to host the backend on repl.it and the frontend on vercel?
Because the backend is express
and the frontend is react
That’s possible yes
SyntaxError: Cannot use import statement outside a module
import fetch from 'node-fetch';
What does that error comes from?
Nextjs can handle the backend for you too 
Put your backend APIs inside the pages/api folder
npm i then npm run dev
nextjs api functionality feels like express trial edition
express is bad anyways
what was the alternative to express that is supposed to be decent 👀
Web Frameworks Benchmark. There are many frameworks, each one comes with its own advantages and drawbacks. The purpose of this project is to identify them and attempt to measure their differences (performance is only one metric).
any of these
Any idea how to replace all \\n using regex?
As \\n in regex becomes \n
Nvm
Fixed it
time to switch to nanoexpress i guess
so much speed
shame they have to have some very scuffed benchmarks
they benchmark with basically none of the framework's speedups or optimisations
e.g. if you look at the python frameworks and see falcon being the fastest because they handicapped the asgi servers by no uvloop or httptools
👏 Dont 👏 listen 👏 to 👏 benchmarks 👏 like 👏 this
its open source, open a pr to fix it
open a pr to fix 14 python frameworks and add something more significant than an echo benchmark to every benchmark? no thanks lol
I left the benchmark game when I stopped development on pyre
not to mention the fact that request per second mean nothing compared to how well a framework handle's concurrent clients
Hey! i get this error when trying to authenticate via discord -> Invalid OAuth2 redirect_uri, even though it is the correct one. Does anyone know why?
How dare you question Tim
Have you considered searching?
there is this thing called a search engine
its useful to use that first
and if you still dont find what you are looking for
then ask somewhere else not here
jk
how rude
makes me not wanna help you on purpose for that
regex cant be compared like that
a piece of regex needs to be executed by the regex engine
js has a built in regex engine which is automatically called by many functions and methods
is there any way to connect quick.db to my bot dashboard?
i have mongo.db, and with quick.db, does it work?
yeah, should be able to use it the exact same way you do with your bot.
I use .pug
@solemn latch
does it work the same way?
can you send me some documentation link to show you how to do this?
depends on how you want to provide the database data
what is the best way?
reject pug accept ejs
I only work with pug
pugs are c- oh that type of pug
your bots in js right?
correct
yeah, you can access the data the exact same way and just pass it when you render a template.
https://stackoverflow.com/a/38047123/16910071
i'm also willing to delete the pug, and switch to using html. can you get any documentation to be able to use quick.db in html? please
I personally would use an API in that case
I don't know how to use this, can you explain, or send some kind of documentation?
You know, im just going to google a guide right?
its not like I have guides just lined up for every question everyone has.
yes of course, can you please do that pls
@solemn latch how long dose ur bot need to get accepted
2+ weeks
tnkuu. i'll see
and is my bot even submitted?
obviously, you've edited your submission like 25 times
wdym
also, might help to read #rules-and-info, as just looking at your bot page I already see a decline reason.
why
@solemn latch what do you think about this npm?
https://github.com/Discord-Bot-Dashboard/discord-bot-dashboard
use quick.db
I wouldn't use a library for a dashboard, but that's just a personal opinion.
okey...
Hi
why is it not working? css .p{ background: transparent; background: url('https://images-ext-1.discordapp.net/external/b3thmAKwSu-uACt9_jql7hIT7_tBjv5mujsA8czHiEI/%3Fsize%3D512/https/cdn.discordapp.com/avatars/719578187516084226/8fd52095ebd96da1a055ba7bea7e3bf2.webp'); }
hi
How are you?
good u?
you are selecting the class p, not the tag
wdym?
npm ERR! code 1
npm ERR! path C:\Users\rafso\Desktop\Discord-Bot-Dashboard-main\Discord-Bot-Dashboard-main\bot\node_modules\better-sqlite3
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || npm run build-release
npm ERR! > better-sqlite3@7.1.4 build-release
npm ERR! > node-gyp rebuild --release
npm ERR! prebuild-install WARN install No prebuilt binaries found (target=16.10.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.10.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.0 found at "C:\Users\rafso\AppData\Local\Programs\Python\Python310\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.10.0/node-v16.10.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.10.0/node-v16.10.0-headers.tar.gz
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd C:\Users\rafso\Desktop\Discord-Bot-Dashboard-main\Discord-Bot-Dashboard-main\bot\node_modules\better-sqlite3
npm ERR! gyp ERR! node -v v16.10.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\rafso\AppData\Local\npm-cache\_logs\2021-10-10T17_46_27_765Z-debug.log````
what this error?
Good hehe
oh ok leme try
still didnt work
are you sure you are trying to select a paragraph?
wdym?
tnks
idk with css so
css selects specific html elements.
you need to know what element you are trying to use that css on before you can do anything
so what element are you trying to select?
p aka paragraph long desc
it shloud be p
in the background transperant?
depends what you want to do with it
where?
thats not regex?
does background:transparent even exist 👀
checking if strings are equal does not require regex
didnt work
if(variable === "string1" || variable === "string2")
const something = function() {
return something()
}
``` something() is not a function
why tf?
@tribal crow
Stop pinging people and wait for them to respond when they want to
why can you not use a function inside a function
wdym?
I mean you can but for some reason you can't use the fuction you've declared
let me explain then
because u just defined it
//simple variable function, right?
const something = function() {
//different function('do something', (err) => {
if (err) return something()
})
}
``` and it says that function "something" does not exist
yeah that's precisely why it should work
it is defined
its used in the definition
whatchu mean
u need to define and use after
like js const somthing = funtion() return somthing()
no that won't work
then idk
I know how to use constant variables
they just don't work inside the function as if
I want to recall it on error
can u help me in css?
I dont think you can hoist a function expression
Which is very likly why it doesn't work
so you can not use a parent function inside another function?
then how do people do on error try again type stuff
then why is it not working?
p{
background: transparent !important;
}```
Not when you are defining it as a variable
transparent is not a thing
bump
also background?
my friend is trying to make a code with if statements and for some reason the ones with msg.channel.send work but the one with the embed doesnt
here is the embed's code:
else if (args[0] === "Squirtle"|| args[0] === "#007"|| args[0] === "007")
{
const embed = new Discord.MessageEmbed()
.setTitle('Squirtle')
.setDescription('Squirtle is good')
.setThumbnail('https://d275t8dp8rxb42.cloudfront.net/pokemon/portrait/Pikachu.png')
.setColor("EEF507")
msg.channel.send(embed);
}```
msg.channel.send({embeds: [embed]})
wdym?
try that
p {
opacity: 0.5 !important;
}
ok
its because they changed stuff in v13
still doesnt work
he is in version 11.6.4
update to 13?
1m
11's been deprecated for ages
no what i want for the background to be transparent and have a image
you want the image to be transparent then?
in the background yes
Try changing your function definition to be the standard definition.
I think the fact you can't hoist with your expression definition may be the cause for your error.
maybe try
p {
background-color: rgba(0, 0, 0, 0.3); //0.3 is the transparency
}
0,0,0 will remain no colour
ok leme try
I have a love/hate relationship with HTML/CSS
true
I don't think that's the case
I love it when things just magically work as intended, but I hate it when I try 1000 things that don’t work just for the solution to be some obscure garbage
I can do a similar thing if you add additionally parenthesses, however that won't work in my case
Then you'll need to call the function from another function(probably)
just gotta know the tips and tricks
that sucks
Exactly why it sucks for people fairly new to frontend like myself 
probably cuz you don't understand how css works at its core
Yeah
I had the same problem at first
I have basically no experience with CSS
I’m getting into it though, it’s starting to make more and more sense as time goes on
As with most things
have you worked with backend stuff before?
in my case it's waaaaaaaaaaay harder
I do mostly backend stuff, but not for websites
if that's so
could you tell me how to make a log in system with a database?
:]
I’ve got no professional experience whatsoever, I just like to make things from time to time
oh yea I get it
css is more like redirecting a river and less like placing potatoes on a field. You create elements to make things "flow" into the right place instead of taking an element you want and "putting it" on the right corner or whatever
I’ll tell you this rn for that though: hash your passwords
Huh?! Got pinged and can’t see who did it…
you can make an entire games with just css
thats kind of where the "how to center a div lolol" meme comes from
pretty powerful
I think CSS is a lot easier to work with when you have the proper HTML structure
Otherwise you’ll be making stupid solutions to otherwise easy to solve problems
me who uses css in html style be like:
you don't center things, you add elements to the page that center its contents. It's just Legos rly
the right css always depends on the html structure, that's why stackoverflow is borderline useless for css
ok
does anyone have any idea
how to easily make a restart function
without creating two separate functions for it
plaese
pm2 I guess
Process manager
yea that also won't work
btw
does anyone know how to make a proxy rotation?
I need this bad
:[
context

"how to do this pls? send youtube tutorial in dms"
He jumped from a function calling itself, to a restart function and now a proxy rotation
Must be an interesting project 
context... is not important
I'm joking, I just need it to make some scripts
I tried making one but failed
must be the worst sneakerbot of all time
figure it out, if you need rotating proxies there's a 100% chance you're doing something you're not supposed to
Then provide some context what you wanna do 
no human has ever needed to change their ip address for every request other than to abuse a service
yeah I think he's making a privacy bot with a login system and a restart command
for sure
😦 thanks for that
few things
for example music, and a api url gen
I have an idea
I would make a txt file with different proxies, and then rotate between them using fs file reader

can anyone give me a lavalink server working
You probably won't get much help here for stuff like that if you are not going to explain why. But probably best to not read the file each time but once at startup and rotate them from memory.
I feel like I'm the only one who doesn't understand why that insinuates something against ToS/illegal
Granted I've never heard of rotating proxies before so
yes, but I need something in exchange, what about a Lamborghini?
I accept a Maseratti too
Sounds like a good deal to me
I dont either ur not alone
Typically you only rotate proxies is if you are hitting a ratelimit. Getting around ratelimits is against most services tos's.
because the only way services can stop a client from spamming their api is by ip and a rotating proxy would probably be built solely to bypass this limitation
some services keep a table of known vpn ips or you need to be whitelisted to access them
there is no use case where you dont use it for non malicious purposes in this case
I'm sure there are reasons to rotate proxies which are legitimate, but I'd prefer to know about it to determine it myself before assisting with it.
also if youre not specific it makes it super sus
oh i was about to go into that
it's just from an overarching view, there's nothing it has a practical use for
maybe the whole like youtube api thing to bypass ratelimits or whatever, but even that's against their tos
floating upon the surface for... the birds
That's the cutest bird I've ever seen

Can I get coding help here?
Sure just go on ask
Hello. Im using djs v13 and the bot is using a lot of ram, i dont know if its because of the cache. This are my options: js makeCache: Options.cacheWithLimits({ ChannelManager: { sweepInterval: 3600, sweepFilter: Util.archivedThreadSweepFilter(), }, GuildChannelManager: { sweepInterval: 3600, sweepFilter: Util.archivedThreadSweepFilter(), }, MessageManager: 50, StageInstanceManager: 10, ThreadManager: { sweepInterval: 3600, sweepFilter: Util.archivedThreadSweepFilter(), }, VoiceStateManager: 10, }),Does someone know to changue this for it to consume less?
its also internal sharded, i dont know if that consumes more than traditional sharding
This code (for now) is supposed to log everything to the console but it won't even do that
Discord.js is just chomky by design since it caches quite a bit internally for type safety
what
set to 0 the ones you dont need
the sweepIntervals?
no the managers
these are all the ones you can configure
set the ones you dont need to 0
ok thank you :D
if i set the MessageManager to something like 20 what does that mean @quartz kindle ?
that channel.messages will only have 20 messages max
I'm afraid to ask why GuildManager is set to Infinity
it doesnt really matter, its the same as not limiting it
djs basically checks if(limited && maxsize > ...)
or similar
whats Options 
and also util
discord.js v13 things
ah
Made.my 6th bot tonight. 61 commands. I'm getting good at this ^.^
1200 lines long tho >.>
I hope it's not all in one file...
Why would it be in one file?
Haha
You said 1200 lines long so I was thinking that you meant one file with 1200 lines 😛
and 61 commands in 1200 lines is impressive!
^.^
Made a calculator in php for a video game battle in 7000 lines and the python to break was 30 lines lmao
I put quite a few spaces between my lines of code to make it more readable usually, so my commands end up being unnecessarily long in terms of lines
Depending on what lines they are, I usually separate blocks of code with 1 line
i have a lib with a 5k line long .d.ts file lol
because i put both typescript types and jsdoc descriptions in the same file
damn
some functions have really big jsdoc lmao
legit just learned the reverse image search bot i made can also scan gifs and videos for matches online. i legit had no idea
how do i add/remove a client's cookies using native js
nvm found it
handlers help braincells
imagine if elses on every single byte
if(data[0] === 234) {
if(data[1] === 24) {
if(data[2] === 3) { ... }
} else if(data[1] === 25) { ... }
} else if(data[0] === 255) { ... }
needs more sauce
more tomato sauce
and cream cheese
talk to me when all your variables are emojis
Any one tell some good theme of vsc
tokyo night
looks like this
why
seems distracting imo
how
I've seen some people with betterdiscord themes that have background images and it makes the text really hard to read and really distracting
download link
I get distracted by bd and vsc backgrounds lmao
I already get distracted as it is
don't need a multiplying factor
Evon theme
I just find the theme with the brightest syntax colours and dark like background
vscode light theme is beyond a joke
that shit burns my retinas
discord light theme isn't bad compared to it
Electronic moonlight
dude xd
Preferences
I hate this
@rustic nova
One dark pro
any of the Amethyst Themes

that works? wtf
bit late, but I'm making a mixed tool with batch/c#/node.js that allows to do bunch of things, also wanted to use the proxy rotation for my music bot
how do i auto add line breaks to html
ppl at Firebase won't answer. does anyone here know?
¯_(ツ)_/¯
basically
a guy told me to make my own http helper
and that there are StackOverflow threads for that
@lyric mountain was talking about manual queries
from what I'm seeing, firebase is a nosql thing
yeah
you're kind of stuck with the http helper option because firebase doesn't use its own query protocol like mongodb or postgres does
you can use grpc over http2 to query it from a server environment if you're feeling brave though
never seen any examples of the rpc api though so I'd just stick to the regular rest api
aight
anyone got a code so i can make the invite button be like heartbeat?
@lyric mountain do u?
no, u need to do it yourself
i dont code css
because you're supposed to use finally if you want to ignore promise rejections
theres no need to use finally
promise
.then(smth)
.catch(_ => {});
vs
promise
.finally(smth);
put the redirect uri in your oauth page
thats not the same thing
promise.then(smth, smth)
how tho
in your example the catch is called if promise rejects without running smth
I did...
what's the point then
I've never ever used finally. Forgot it even existed outside of bluebird
me neither
im not sure there even is a use case for finally that cant be easily done in a different way
what's bluebird
a custom promise library
don't put any parameters for .then
the og promise library before promises were a thing in js
nice
or was that Q.. idk
I started learning js after async/await became a standard so I have no idea lol
ayo mdn has deno in compatibility tables now
@earnest phoenix what does the uri look like, since I am doing it wrong....
it looks like a link?
nice
Is your DMs open? So I can send the think I got, lol.
Don't wanna get in trouble for sending Links Here
you are allowed to breathe and send links without mod bots banning you
Is that the URI?
localhost definitely
???
localhost doesn't exist on the internet
you cannot use localhost for oauth
it's like saying "here"
you can redirect to localhost for testing
here where?
How?
does 127.0.0.1 work tho
I have never worked with this stuff before. Always been just coding lol
no
make sure you have localhost in the oauth redirects in the discord bot page or whatever that's called
try using an online editor for testing
localhost on your own pc doesn't work
no, the site just redirects you to whatever localhost means for your computer
wait localhost does work lol what are you guys talking about
since when is the redirect client side?
all redirects are client side redirects
weird lol
I am so confused looking at all of this lol
the Location: xyz header (which is what a "server side redirect" is) is interpreted by your browser and your browser sends a request to that url
so localhost is an acceptable redirect. It just won't work outside of your own pc so it's only for testing
I use Safari
in short:
this will work as a redirect
http://example.com/oauth
what you are using will not work
http://localhost
cring
Ight, let me try that.
apple doesn't allow you to change default browser right
lmao example.com doesn't work either
because it's not setup for oauth
I kow
[ inaudible disappointed noises ]
https://music-bot.deathjones.repl.co/oauth
Would this work?
you just need to make sure you have the url here that's it
yes
K
my sister uses the browser app in MiUI
Same with that lol
did you change the url in discord.com/smth
I added it to my DDP Bot
This work?
https
dude's waving his localhost ssl certificate
ssl doing handshakes during corona
???
I mean you can test things through https in localhost, I've had to do it for one of my previous projects. It's just not very common
Me being confused...
need to self-sign a cert and then have your browser get angry at you
@stray seal did you try authorizing again
how can you self sign
it's simple, openssl lets you create any cert you want
imagine having ur browser angry at u for having self-signed on localhost
I keep running my site, then clicking Dashboard, then it does what I showed you.
???
imagine having ur browser angry at you for using javascript on localhost
but if it's not signed by a trusted certificate authority your browser is going to raise a bunch of alarms
not a problem for testing locally
did you change the authorizing link
What do I input to that lol
How do I do that?!
I've never seen someone so confused over deleting a single "s"
lol
Where?
change it to use the other domain
your entire existence is wrong
eslint is just pointing it out
???
that's true

change the link to use the repl.co thing

:^)
repl needs to be https

At least you tried
[ inaudible disappointed noises intensifies ]
Still after adding
you also need to change it on the Discord applications panel too
I'm getting confused myself
first time?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
:^)
I did it on that.
and change it on your replit project too
florida man spends 12 days trying to fix his oauth problem by asking the same question on discord instead of trying to understand how oauth works
your /dashboard command still uses the localhost redirect
also make it https on the dashboard

<script>
$(document).ready(() => {
$.get("/api/info", (data) => {
//check api/routes.js
let url = `https://discord.com/oauth2/authorize?client_id=${
data.ClientID
}&permissions=${data.Permissions}&scope=${data.Scopes.join(
"%20"
)}&redirect_uri=${data.Website}${data.CallbackURL}&response_type=code`;
This?
that's even more cursed than my react <div> soup
lol
if(!message.member.permissions.has("MANAGE_SERVER")) return message.channel.send("**You need Manage_server Perms to use this command!**")
error: invalid bit Feild```
var user_money = db.fetch("moneyss_" + message.member.id + "_" + message.guild.id);
if(user_money == null) user_money = 0;
const bal_embed = new Discord.MessageEmbed()
.setDescription(`You have $${user_money.toLocaleString()}`)
.setColor("GREEN")
message.channel.send({embeds: [bal_embed]})
why isnt it saying it with the ,'s
console.log the value of user_money
umm



