#development

1 messages · Page 1897 of 1

tribal crow
#

Aaaaah

#

i need glasses

quartz kindle
tribal crow
#

This is line 30: return config ? res.send(config) : res.status(404).send({ msg: "Not Found" });

quartz kindle
#

also this ^ leads me to believe you are trying to send a mongodb object instead of the value

tribal crow
#

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" });
})```
quartz kindle
#

pretty sure findOne is a promise

tribal crow
#

...

eternal osprey
#

hmm wait what

tribal crow
#

GuildConfig is a mongoose schema

quartz kindle
#

and what does findOne return?

blissful coral
#

findOne is a promise though

#

await it

tribal crow
#

tysm

#

my brain is kinda not-worky

blissful coral
#

all good

eternal osprey
#
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

ancient nova
#

does anyone know an easy way to make a log in system?

solemn latch
#

login like for a website?
using discord/anotherservice as the login? or just stand alone?

spark flint
eternal osprey
spark flint
tribal crow
#

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);
        }
}```
spark flint
#

im guessing thats a local database or server you're running?

boreal iron
#

proxy server probably

tribal crow
#

web server

#

its in react/express

solemn latch
#

trying to get the bot to mention everyone?

#

<@&guidid> right?
or just <@guildid>

#

never mentioned everyone with a bot

lyric mountain
#

just regex match it and replace with something else

#

or this <text>.replace("@everyone", "EVERYONE_PING")

pale vessel
#

<@&guild_id> is not @everyone, that's just the everyone role which won't ping

#

it's just @everyone

pale vessel
ancient nova
# spark flint on a website or on discord

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

lyric mountain
#

datsucks

pale vessel
#

string.replaceAll() or replace with regex

lyric mountain
#

in java replace replaces all instances

quaint wasp
#

why does it say empty fields..

#

all

#

of them have a string in them

#

ping in replies

wheat mesa
#

Are you even allowed to add that many fields?

solemn latch
#

25

wheat mesa
#

Whatever the case, are you sure that’s the embed causing an issue?

hybrid cargo
#

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

earnest phoenix
#

Discord privilege ON_READY when? FLooshed

boreal iron
#

lol

#

privileged gateway connection

#

soon

hybrid cargo
earnest phoenix
#

"Thank god discord approved my send messages intent request"

#

Bots should be using telepathy to communicate; not sending messages smh

boreal iron
#

Telepathy? Sound like a privacy issue.

earnest phoenix
boreal iron
earnest phoenix
#

Sounds...familiar

boreal iron
#

Reminds me of every game released after 2000

#

beta and bad...

blissful coral
wheat mesa
#

You must have discord nitro to create a bot user!

pale vessel
#

And it must be nitro, not nitro classic

hybrid cargo
#

Worked?

pastel ruin
#

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)

lyric mountain
#

Yes, very bad

#

Either use uptime robot or buy a vps

pastel ruin
#

but mee6 uses iframe

lyric mountain
#

Different usages

pastel ruin
#

i tryed to use uptime robot but no success

#

yeah

lyric mountain
#

You want a cheap solution, mee6 properly uses iframe to embed its own site

pastel ruin
#

i know

#

if i show it non hidden and put informatoin hosted on repel

lyric mountain
#

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

pastel ruin
#

no im not wanting it 24.7 i just want it running so when they add it the bot can say a message

lyric mountain
#

Having the bot run for a few minutes after someone add it is worthless if it dies a few moments after

pastel ruin
#

and sofar its running when i keep the tap open

lyric mountain
#

Plus I imagine everyone else will kick the bot since it'll not be working

pastel ruin
#

like i will make it say "this bot isnt 24/7, visit <repel linl> to have run"

lyric mountain
#

They won't visit

pastel ruin
#

oh big rip

#

for me

lyric mountain
#

Users don't care enough to do that on a frequent basis

pastel ruin
#

what you use to host?

lyric mountain
#

Like, unless your bot is a one-of-a-kind chances are they'll just find another bot for it

lyric mountain
pastel ruin
#

no its pritty boring bot (just submited)

lyric mountain
#

But any vps will suffice

#

Or spare raspberries

pastel ruin
#

i was just putting it out to top.gg to see if they like it basicly

lyric mountain
#

Just ask yourself: would you use it on your server?

pastel ruin
#

well i use it on my server

lyric mountain
#

Then chances are it is good enough

pastel ruin
#

and when im awake i keep tab (with link) open

lyric mountain
#

Bots don't need to be the next crysis, they just need to fulfill a purpose

#

If it does, it's a good bot

pastel ruin
#

ok thanks

lyric mountain
#

Btw, why didn't uptime robot work for u?

pastel ruin
#

umm something weard

#

idk

#

should i try again

hybrid cargo
#

GG! :love:

pastel ruin
quaint wasp
#

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

pastel ruin
#

umm is it

#

it seemes hot

#

but considering what they do it may be normal

quaint wasp
pastel ruin
#

so seemes like its normal

lyric mountain
quaint wasp
#

👌

wheat mesa
#

90c+ is where it's gonna be a problem

#

most graphics cards shut off around 95c

#

to prevent physical damage

quaint wasp
#

mine is litilery at 98 right now-

#

alright I guess its time to stop playing minecraft for some time

#

barly played 45 minutes

cinder patio
#

🤡no

rose warren
#

I guess if you're writing to a json file KEKW

#

But if you're trying to make a db use mysql, postgresql or mongo

sinful night
#

which host should i use

#

i cant pay

#

it should free

#

or included free in github student pack

rose warren
#

What free host are you already using and why do you want to change?

rose warren
#

I'm pretty sure you've already asked this question and people have answered you

sinful night
#

but replit ran to error

rose warren
#

Then fix it 🤷‍♂️

sinful night
sinful night
#

replit isnt good

rose warren
#

The host isn't the problem it's your code

sinful night
#

i ran into api blocked

rose warren
#

Yeah any free host isn't good. You get what you pay for when it comes to hosting.

sinful night
sinful night
rose warren
sinful night
#

but it isnt good

sinful night
#

digitalocean requires a payment method that i dont have

rose warren
#

Every host requires payment. Replit isn't a host. It's a container.

sinful night
rose warren
#

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.

sinful night
#

idk how to host

tardy hornet
#

anyone can see something wrong in this line? ```js
var foundedItem = items.find(item => item.name.replace(" ", "").toLowerCase() == ItemName1.replace(" ", "").toLowerCase())

rose warren
#

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

sinful night
burnt anchor
#
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?

sinful night
#

hi

#

i got this proble when deploy my bot on heroku

errant flax
#

random question but how do i send a request with a cookie with axios?

pearl trail
errant flax
pearl trail
#

oh, idk about that, afaik it will use the target url's cookies

errant flax
pearl trail
errant flax
#

oh sadge

sacred aurora
#

you can set it manually on headers too tho

earnest phoenix
#

does anyone know an embed generator no webhooks needed only my own bot?

earnest phoenix
rose warren
#

I wasn't talking about aws

earnest phoenix
#

I know you weren't, that was an additional information in case someone was interested in free tiers 🤷‍♂️

swift glacier
#

can anyone help me verifying my bot

#

?

rose warren
swift glacier
#

?

rose warren
#

The verified check mark on your bot?

swift glacier
#

no

#

my bot is not verified yet

#

i want to

rose warren
#

Dbl verifybot

livid jackalBOT
#

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.

swift glacier
#

my bot is on 100 server

#

and i got message

rose warren
#

Read that

swift glacier
#

from discord

#

yeah

#

i know

#

then when i give my idntity card

rose warren
swift glacier
#

discord isnt granting it

rose warren
spark flint
swift glacier
#

it says invalid

rose warren
#

We can't help

rose warren
swift glacier
#

ok

woven lake
#

f

errant flax
sacred aurora
flat copper
#
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
dense flame
#

@pale vessel brudda how can I get a slash command ID?

pale vessel
#

Do you have them cached?

dense flame
#

wym

pale vessel
#

How are you getting the commands?

#

Or do you mean how to get a slash command by ID?

dense flame
#

because I want to delete the registered one and I need thier IDs

pale vessel
#

Ah

errant flax
pale vessel
#

You can use command.id

dense flame
#

okey thanks

sacred aurora
errant flax
#

?

#

so how it is formatted then?

sacred aurora
#

key=value; key2=value2; etc

errant flax
#

ah

earnest phoenix
#

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

glacial vapor
#

is there a limit how many times a / command can be used per day on a server?

vivid fulcrum
#

nope

earnest phoenix
#

but there is a limit for how many slash commands your bot can create per day

glacial vapor
#

because i made a command that works with slash but im too dumb to make it work with prefix lol

earnest phoenix
#

you have to add command cooldowns yourself

hybrid cargo
vivid fulcrum
#

there isn't a reliable way to detect a boost

#

ironically

#

user tokens get the boost event

#

bot tokens don't

rose warren
#

You can check guildMemberUpdate for users who get the Server Booster role

vivid fulcrum
#

isn't reliable

#

an existing booster can boost again

hybrid cargo
rose warren
#

Yeah if an existing user boosts again I don't think there is a way to do it?

cinder patio
#

check for the boost message, if you want to replace it just delete it and send your own

hybrid cargo
#

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

vivid fulcrum
hybrid cargo
hybrid cargo
cinder patio
#

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

earnest phoenix
#

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

rose warren
tribal crow
#

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?

eternal osprey
#
 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?
flat copper
#

push them to array?

eternal osprey
#

but how would i get them in the first place

hybrid cargo
boreal iron
flat copper
hybrid cargo
#

I dont know about mimu. But if a bot has that feature, it probably does this

flat copper
#

oooo

#

then what about unboost?

hybrid cargo
#

There is no way for that, except looking if a user totally loses the server booster role

earnest phoenix
#

@hybrid cargo how does @livid jackal get the boost event

sinful night
#

hi

earnest phoenix
#

hi

hybrid cargo
#

Idk i can only guess

earnest phoenix
#

maybe a self bot

signal estuary
#

When do buttons timeout so it will throw an error when you click them with "Unknow Webhook" and how to fetch this error?

earnest phoenix
#

why will it throw unknown webhook

hybrid cargo
hybrid cargo
# earnest phoenix *maybe a self bot*

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.

earnest phoenix
#

well

signal estuary
hybrid cargo
#

Because u use a interaction collector

earnest phoenix
#

tracking system messages from boost in a separate hidden channel

hybrid cargo
signal estuary
signal estuary
hybrid cargo
earnest phoenix
#

by fetch you mean get the timeout?

signal estuary
signal estuary
earnest phoenix
#

djs will ignore errors after timeout

signal estuary
earnest phoenix
#

your code cannot detect an error

signal estuary
earnest phoenix
#

I don't understand

#

the error happens within discordjs itself

#

it is not passed to your command code

signal estuary
earnest phoenix
#

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

cinder patio
pale vessel
#

At this point it's just how good people here are at googling problems in Stack Overflow

earnest phoenix
#

¯_(ツ)_/¯

snow urchin
signal estuary
# earnest phoenix I don't understand
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: []
  }
}
earnest phoenix
errant flax
#

how do i redirect someone to another page using native js?

signal estuary
earnest phoenix
#
rowsValues[arrayIndex][valueIndex] = newValue;

// example
rowsValues[0][0] = 1;
console.log(rowsValues); // [ [1, 0, 0], [0, 0, 0], [0, 0, 0] ]
earnest phoenix
tribal crow
earnest phoenix
tribal crow
#

why not?

earnest phoenix
#

because it is too much extra work

eternal osprey
#
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?
tribal crow
eternal osprey
#

Pretty sure it's a number right

earnest phoenix
#

and you don't need to convert geggeg to a Number when logging

earnest phoenix
eternal osprey
#

huhhh

earnest phoenix
#

you're using react for your dashboard?

tribal crow
#

yeah

#

react and express

eternal osprey
#

its baically just 20:00

earnest phoenix
#

try nextjs on vercel

#

the free plan's pretty good

earnest phoenix
#

the : makes it NaN

eternal osprey
#

aa

tribal crow
#

whats the difference between nextjs and react?

earnest phoenix
#

(massive oversimplification) nextjs is a server for react

#

like express but easier

signal estuary
#
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()

tribal crow
#

so i need to change the whole dashboard?

earnest phoenix
#

nope

woeful pike
#

how does anyone unironically use this language

earnest phoenix
woeful pike
#

this is like the onion level bad. I'd laugh if you told me you wanted to use numbers for placeholders when formatting dates

slender thistle
#

wtf lol

#

Who thought that was a good idea

earnest phoenix
#

who thought Println in Pascal Case was a good idea

#

can you send the link to that stackoverflow question

woeful pike
#

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

earnest phoenix
eternal osprey
#

so i have this chart based on my work hours.

#

How would i ever check if the inputted worktime fits in the first field?

tribal crow
eternal osprey
#

for example i worked from 7:00 till 20:00

earnest phoenix
#

nextjs is like express for react

tribal crow
#

but i have express and react?

earnest phoenix
#

express doesn't work on vercel

earnest phoenix
tribal crow
#

cuz i dont know how to convert etc

earnest phoenix
#

pretty easy

woeful pike
#

it's supposed to be the go alternative to C's strftime

tribal crow
#

i tried to follow the guide

#

but im afraid it will f up everything

earnest phoenix
#

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

tribal crow
#

ait

#

i already have a pages folder

earnest phoenix
#

then install nextjs with npm i next react react-dom webpack and run npx next dev

tribal crow
#

next : The term 'next' is not recognized as the name of a cmdlet, function, scr
ipt file, or operable program.

earnest phoenix
#

wait
you can just try npx create-next-app

tribal crow
#

i just have to wait until the backup is finished

eternal osprey
#
console.log(realanswer2)
                if(realanswer1 >= 0000 && realanswer2 <= 0600){
                g = base*1,44*faka```why is realanswer2 <= 0600 false?
#

realanswer2 is literally 0600

woeful pike
#

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

eternal osprey
#

ooh...

#

how would i encounter this problem then

earnest phoenix
#

remove the 0 at the start

woeful pike
#

it's not possible for a number to have the value 0600

#

you're working with a string

slow ibex
#

uuh... im new to Lavalink.. i set everything up, migrated to it.. everything works but.. uuh.. for some reason my bot keeps being silent

eternal osprey
#

alrighty

slow ibex
#

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"}
rustic nova
#

just gonna delete it because that had your webhook token in there

signal estuary
#

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()`
earnest phoenix
#

how is an interaction response a webhook

signal estuary
#

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

quartz kindle
#

defered interactions are basically webhooks

slow ibex
#

i dont even know how to troubleshoot it even more..

tribal crow
signal estuary
#

I used:

        const filter = (filter) => {
            filter.deferUpdate()
            if (filter.user.id === inter.user.id) return true
            return
        }
glacial vapor
#

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>
tribal crow
#

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

spark flint
#

That’s possible yes

tribal crow
#

SyntaxError: Cannot use import statement outside a module

#

import fetch from 'node-fetch';

#

What does that error comes from?

pale vessel
tribal crow
#

aaah

#

thats rigjt

#

i forgot to downgrade

earnest phoenix
#

Put your backend APIs inside the pages/api folder

earnest phoenix
split hazel
#

nextjs api functionality feels like express trial edition

earnest phoenix
#

free trials are good

cinder patio
#

express is bad anyways

solemn latch
#

what was the alternative to express that is supposed to be decent 👀

cinder patio
#

koa

#

fastify

quartz kindle
#

any of these

tulip ledge
#

Any idea how to replace all \\n using regex?

#

As \\n in regex becomes \n

#

Nvm

#

Fixed it

earnest phoenix
solemn latch
modest maple
#

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

quartz kindle
#

its open source, open a pr to fix it

modest maple
#

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

tribal crow
#

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?

earnest phoenix
modest maple
#

hmm Have you considered searching?

marble juniper
#

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

quartz kindle
#

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

modest maple
#

it is

#

magic

mellow flint
#

is there any way to connect quick.db to my bot dashboard?
i have mongo.db, and with quick.db, does it work?

solemn latch
#

yeah, should be able to use it the exact same way you do with your bot.

mellow flint
#

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?

solemn latch
#

depends on how you want to provide the database data

mellow flint
split hazel
#

reject pug accept ejs

mellow flint
split hazel
#

pugs are c- oh that type of pug

solemn latch
mellow flint
solemn latch
mellow flint
solemn latch
#

I personally would use an API in that case

mellow flint
solemn latch
#

You know, im just going to google a guide right?
its not like I have guides just lined up for every question everyone has.

mellow flint
#

yes of course, can you please do that pls

earnest phoenix
#

@solemn latch how long dose ur bot need to get accepted

solemn latch
#

2+ weeks

earnest phoenix
solemn latch
#

obviously, you've edited your submission like 25 times

earnest phoenix
#

wdym

solemn latch
earnest phoenix
#

oh

#

ook ty

solemn latch
#

also, might help to read #rules-and-info, as just looking at your bot page I already see a decline reason.

earnest phoenix
#

why

mellow flint
#

use quick.db

solemn latch
#

I wouldn't use a library for a dashboard, but that's just a personal opinion.

spark flint
#

how can i use an SVG as a meta image tag?

#

og:image doesn't allow SVGs

unkempt jay
#

Hi

earnest phoenix
#

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'); }

earnest phoenix
unkempt jay
#

How are you?

earnest phoenix
#

good u?

earnest phoenix
#

wdym?

mellow flint
#
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?
earnest phoenix
#

or just p or?

solemn latch
#

that would be id p

#

you seem to want to select the element p, which would be just p

unkempt jay
earnest phoenix
earnest phoenix
solemn latch
earnest phoenix
#

wdym?

earnest phoenix
solemn latch
#

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?

earnest phoenix
#

p aka paragraph long desc

earnest phoenix
solemn latch
earnest phoenix
#

in the background transperant?

quartz kindle
#

depends what you want to do with it

earnest phoenix
quartz kindle
#

thats not regex?

solemn latch
#

does background:transparent even exist 👀

quartz kindle
#

checking if strings are equal does not require regex

earnest phoenix
quartz kindle
#

if(variable === "string1" || variable === "string2")

earnest phoenix
#

@boreal iron

ancient nova
#
const something = function() {
return something()
}
``` something() is not a function
#

why tf?

earnest phoenix
#

@tribal crow

spark flint
earnest phoenix
#

ok sorry

#

can u help me

ancient nova
#

why can you not use a function inside a function

earnest phoenix
#

wdym?

ancient nova
#

I mean you can but for some reason you can't use the fuction you've declared

#

let me explain then

earnest phoenix
ancient nova
#
//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
ancient nova
#

it is defined

earnest phoenix
#

its used in the definition

ancient nova
#

whatchu mean

earnest phoenix
#

u need to define and use after

ancient nova
#

yes

#

but

#

I want to return to that function to try again incase error

#

u get me?

earnest phoenix
#

like js const somthing = funtion() return somthing()

ancient nova
#

no that won't work

earnest phoenix
#

then idk

ancient nova
#

I know how to use constant variables

#

they just don't work inside the function as if

#

I want to recall it on error

earnest phoenix
#

can u help me in css?

ancient nova
#

I'm god in css

#

😉

solemn latch
#

I dont think you can hoist a function expression

#

Which is very likly why it doesn't work

ancient nova
#

then how do people do on error try again type stuff

earnest phoenix
solemn latch
#

Not when you are defining it as a variable

spark flint
ancient nova
#

also background?

glossy quarry
#

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);  
  }```
earnest phoenix
#

yes

#

ig u are not a css god then

ancient nova
#

maybe

misty sigil
#

msg.channel.send({embeds: [embed]})

earnest phoenix
#

wdym?

misty sigil
#

try that

ancient nova
#

p {
opacity: 0.5 !important;
}

earnest phoenix
#

ok

misty sigil
#

its because they changed stuff in v13

glossy quarry
#

he is in version 11.6.4

misty sigil
#

11.6.4

#

there's your problem

glossy quarry
#

update to 13?

misty sigil
#

yea

#

you need to update library

glossy quarry
#

1m

misty sigil
#

11's been deprecated for ages

ancient nova
#

how can you maybe a function on fair rexecute/try agian

#

please I need this 😦

earnest phoenix
ancient nova
#

you want the image to be transparent then?

earnest phoenix
solemn latch
ancient nova
#

maybe try
p {
background-color: rgba(0, 0, 0, 0.3); //0.3 is the transparency
}

#

0,0,0 will remain no colour

earnest phoenix
#

ok leme try

wheat mesa
#

I have a love/hate relationship with HTML/CSS

ancient nova
ancient nova
wheat mesa
#

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

ancient nova
#

I can do a similar thing if you add additionally parenthesses, however that won't work in my case

solemn latch
#

Then you'll need to call the function from another function(probably)

ancient nova
wheat mesa
woeful pike
wheat mesa
#

Yeah

woeful pike
#

I had the same problem at first

wheat mesa
#

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

ancient nova
#

in my case it's waaaaaaaaaaay harder

wheat mesa
#

I do mostly backend stuff, but not for websites

ancient nova
#

could you tell me how to make a log in system with a database?

#

:]

wheat mesa
#

I’ve got no professional experience whatsoever, I just like to make things from time to time

ancient nova
#

oh yea I get it

woeful pike
#

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

wheat mesa
boreal iron
#

Huh?! Got pinged and can’t see who did it…

ancient nova
woeful pike
#

thats kind of where the "how to center a div lolol" meme comes from

ancient nova
#

pretty powerful

wheat mesa
#

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

ancient nova
#

me who uses css in html style be like:

woeful pike
#

you don't center things, you add elements to the page that center its contents. It's just Legos rly

woeful pike
ancient nova
#

ok

#

does anyone have any idea

#

how to easily make a restart function

#

without creating two separate functions for it

#

plaese

woeful pike
#

pm2 I guess

ancient nova
#

pm2?

#

what's that

wheat mesa
#

Process manager

ancient nova
#

yea that also won't work

#

btw

#

does anyone know how to make a proxy rotation?

#

I need this bad

#

:[

vivid fulcrum
#

context

woeful pike
#

proxy rotation? lol

#
  1. build an illegal botnet
boreal iron
rose warren
boreal iron
#

He jumped from a function calling itself, to a restart function and now a proxy rotation

#

Must be an interesting project pepowot

ancient nova
#

context... is not important

#

I'm joking, I just need it to make some scripts

#

I tried making one but failed

woeful pike
#

must be the worst sneakerbot of all time

ancient nova
#

sooooooooooooooo

#

how bout it?

#

anyone know

woeful pike
#

figure it out, if you need rotating proxies there's a 100% chance you're doing something you're not supposed to

ancient nova
#

if I did I wouldn't be talking on this on discord

#

😐

woeful pike
#

uhuh

#

beat it kiddo

boreal iron
#

Then provide some context what you wanna do waitWhat

woeful pike
#

no human has ever needed to change their ip address for every request other than to abuse a service

boreal iron
#

He may wanna receive ultimate privacy

woeful pike
#

yeah I think he's making a privacy bot with a login system and a restart command

#

for sure

ancient nova
#

😦 thanks for that

ancient nova
#

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

rose warren
placid sentinel
#

can anyone give me a lavalink server working

solemn latch
wheat mesa
#

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

lyric mountain
#

I accept a Maseratti too

wheat mesa
#

Sounds like a good deal to me

solemn latch
#

Typically you only rotate proxies is if you are hitting a ratelimit. Getting around ratelimits is against most services tos's.

valid frigate
#

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

solemn latch
#

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.

valid frigate
#

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

spark flint
#

Lmao

proven lantern
#

floating upon the surface for... the birds

solemn latch
#

That's the cutest bird I've ever seen

slender thistle
dapper jasper
#

Can I get coding help here?

boreal iron
#

Sure just go on ask

jovial nexus
#

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

dapper jasper
#

This code (for now) is supposed to log everything to the console but it won't even do that

lament rock
jovial nexus
#

what

quartz kindle
jovial nexus
quartz kindle
#

no the managers

#

these are all the ones you can configure

#

set the ones you dont need to 0

jovial nexus
#

ok thank you :D

#

if i set the MessageManager to something like 20 what does that mean @quartz kindle ?

quartz kindle
#

that channel.messages will only have 20 messages max

lyric mountain
quartz kindle
#

it doesnt really matter, its the same as not limiting it

#

djs basically checks if(limited && maxsize > ...)

#

or similar

quartz kindle
#

discord.js v13 things

errant flax
#

ah

earnest phoenix
#

Made.my 6th bot tonight. 61 commands. I'm getting good at this ^.^

#

1200 lines long tho >.>

wheat mesa
#

I hope it's not all in one file...

earnest phoenix
#

Why would it be in one file?

quartz kindle
#

why wouldnt it be in one file?

#

:^)

earnest phoenix
#

Haha

wheat mesa
#

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!

earnest phoenix
#

^.^

#

Made a calculator in php for a video game battle in 7000 lines and the python to break was 30 lines lmao

wheat mesa
#

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

earnest phoenix
#

I put two lines in-between them

#

So if can find easily

wheat mesa
#

Depending on what lines they are, I usually separate blocks of code with 1 line

quartz kindle
#

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

wheat mesa
#

damn

quartz kindle
#

some functions have really big jsdoc lmao

earnest phoenix
#

legit just learned the reverse image search bot i made can also scan gifs and videos for matches online. i legit had no idea

errant flax
#

how do i add/remove a client's cookies using native js

errant flax
#

nvm found it

wheat mesa
#

handlers help braincells

quartz kindle
#

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

wheat mesa
#

talk to me when all your variables are emojis

earnest phoenix
#

Any one tell some good theme of vsc

wheat mesa
#

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

earnest phoenix
split hazel
#

I get distracted by bd and vsc backgrounds lmao

#

I already get distracted as it is

#

don't need a multiplying factor

proud oracle
split hazel
#

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

late topaz
earnest phoenix
old cliff
#
() => null
// vs
() => { }
#

which one is better

pale vessel
#

Preferences

old cliff
#

I hate this

cinder patio
#

They don't do the same thing though?

#

one returns null, the other undefined

old cliff
#

linters say fuck you for () => { }

#

nvm I just deactivated the linting rule

gaunt mango
#

@rustic nova

hybrid cargo
outer perch
old latch
#

works

old cliff
#

ok

#

() => { /* noop */ }

old latch
old cliff
#

that works? wtf

ancient nova
spark flint
#

how do i auto add line breaks to html

outer perch
#

ppl at Firebase won't answer. does anyone here know?

marble juniper
#

just ask untill they respond

#

at some point they have to

#

lol

outer perch
#

¯_(ツ)_/¯

lyric mountain
#

hmmm query commands to write on database?

#

u mean sql?

outer perch
#

a guy told me to make my own http helper

#

and that there are StackOverflow threads for that

outer perch
#

@lyric mountain was talking about manual queries

lyric mountain
#

from what I'm seeing, firebase is a nosql thing

outer perch
#

yeah

lyric mountain
#

don't think u can without some database manager

#

since...well...nosql has no sql

woeful pike
#

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

outer perch
#

aight

earnest phoenix
#

anyone got a code so i can make the invite button be like heartbeat?

earnest phoenix
lyric mountain
#

no, u need to do it yourself

earnest phoenix
#

i dont code css

lyric mountain
#

although idk whether you'll be able to

#

well, there's always a first time

earnest phoenix
#

i am on phone so that is why

#

if pc yeah

#

but phone

#

red line

earnest phoenix
quartz kindle
#

theres no need to use finally

earnest phoenix
#
promise
.then(smth)
.catch(_ => {});

vs

promise
.finally(smth);
stray seal
#

How to I get these to work?

#

Trying to make a Dashboard

earnest phoenix
#

put the redirect uri in your oauth page

earnest phoenix
woeful pike
#

in your example the catch is called if promise rejects without running smth

quartz kindle
#

finally neither gives you the promise result, nor does it catch the error

stray seal
earnest phoenix
#

what's the point then

woeful pike
#

I've never ever used finally. Forgot it even existed outside of bluebird

quartz kindle
#

me neither

#

im not sure there even is a use case for finally that cant be easily done in a different way

earnest phoenix
#

what's bluebird

quartz kindle
#

a custom promise library

earnest phoenix
woeful pike
#

the og promise library before promises were a thing in js

earnest phoenix
#

nice

woeful pike
#

or was that Q.. idk

#

I started learning js after async/await became a standard so I have no idea lol

earnest phoenix
#

ayo mdn has deno in compatibility tables now

stray seal
#

@earnest phoenix what does the uri look like, since I am doing it wrong....

quartz kindle
#

i always used callbacks

#

never used bluebird lul

quartz kindle
stray seal
#

Don't wanna get in trouble for sending Links Here

earnest phoenix
#

top.gg is not like a typical discord server

lyric mountain
#

depends on what link

#

also code913 requested it, so it's fine

earnest phoenix
#

you are allowed to breathe and send links without mod bots banning you

quartz kindle
#

localhost lol

#

you cant redirect to localhost

lyric mountain
#

localhost definitely

stray seal
#

???

lyric mountain
#

localhost doesn't exist on the internet

earnest phoenix
#

you cannot use localhost for oauth

lyric mountain
#

it's like saying "here"

woeful pike
#

you can redirect to localhost for testing

lyric mountain
#

here where?

stray seal
earnest phoenix
#

does 127.0.0.1 work tho

stray seal
#

I have never worked with this stuff before. Always been just coding lol

quartz kindle
woeful pike
#

make sure you have localhost in the oauth redirects in the discord bot page or whatever that's called

quartz kindle
#

how would that even work?

#

does discord do client side redirect?

earnest phoenix
woeful pike
#

no, the site just redirects you to whatever localhost means for your computer

#

wait localhost does work lol what are you guys talking about

quartz kindle
#

since when is the redirect client side?

woeful pike
#

all redirects are client side redirects

quartz kindle
#

weird lol

stray seal
#

I am so confused looking at all of this lol

woeful pike
#

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

earnest phoenix
#

cring

woeful pike
#

thanks for the info

earnest phoenix
#

apple doesn't allow you to change default browser right

earnest phoenix
#

because it's not setup for oauth

stray seal
#

I kow

lyric mountain
stray seal
woeful pike
#

you just need to make sure you have the url here that's it

earnest phoenix
#

yes

stray seal
earnest phoenix
stray seal
#

Same with that lol

earnest phoenix
#

did you change the url in discord.com/smth

stray seal
earnest phoenix
#

um okay

#

did you try to authorize again

#

with the new url

stray seal
#

This work?

woeful pike
#

https

lyric mountain
#

dude's waving his localhost ssl certificate

earnest phoenix
#

ssl doing handshakes during corona

stray seal
#

???

woeful pike
#

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

stray seal
#

Me being confused...

earnest phoenix
#

repl.co has ssl tho so it doesn't matter

woeful pike
#

need to self-sign a cert and then have your browser get angry at you

earnest phoenix
#

@stray seal did you try authorizing again

earnest phoenix
woeful pike
#

it's simple, openssl lets you create any cert you want

lyric mountain
#

imagine having ur browser angry at u for having self-signed on localhost

stray seal
#

I keep running my site, then clicking Dashboard, then it does what I showed you.

earnest phoenix
woeful pike
#

not a problem for testing locally

earnest phoenix
stray seal
#

What do I input to that lol

stray seal
earnest phoenix
#

click the link on the oauth page

#

or smth

#

don't remember

woeful pike
#

I've never seen someone so confused over deleting a single "s"

errant flax
#

lol

woeful pike
#

copy the redirect url from your app into the discord dashboard

earnest phoenix
#

eslint when you forgor to add a single opening tag

#

all code marked as wrong

earnest phoenix
quartz kindle
#

eslint is just pointing it out

stray seal
earnest phoenix
#

that's true

boreal iron
earnest phoenix
outer perch
quartz kindle
#

:^)

quartz kindle
#

repl needs to be https

woeful pike
boreal iron
#

At least you tried

lyric mountain
spark flint
earnest phoenix
#

I'm getting confused myself

quartz kindle
spark flint
quartz kindle
#

:^)

spark flint
woeful pike
# quartz kindle first time?

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

stray seal
#

I don't remember adding it on replit

#

let me look

spark flint
#

your /dashboard command still uses the localhost redirect

spark flint
earnest phoenix
stray seal
#
  <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?

earnest phoenix
#

that's even more cursed than my react <div> soup

stray seal
#

lol

earnest phoenix
flat copper
#
if(!message.member.permissions.has("MANAGE_SERVER")) return message.channel.send("**You need Manage_server Perms to use this command!**") 

error: invalid bit Feild```
tardy hornet
#
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

earnest phoenix
earnest phoenix