#development

1 messages · Page 2000 of 1

slender thistle
#

Try outputting firstSong

plucky imp
#

kk

slender thistle
#

It very likely errors out on .lyrics(), which is interesting to me

plucky imp
#

no output

#

only error

earnest phoenix
#

I think the genius-lyrics library is outdated or does not function with some aspects of the API, there's also https://npmjs.com/package/genius-lyrics-api which has worked for me

plucky imp
#

kk nd tyy

#

how would i define it in js? and how would i connect it to my api

plucky imp
#

nvm

#

smol brain moment

simple stump
#

I'm terribly sorry to keep asking this, but I've been messing around with this for a while and can't seem to get the bot to play anything locally. I've tried multiple files whether it be mp3 or m4a files, but the bot just won't play anything lol.
Code: https://sourceb.in/GcoxiuCQ9c

If necessary, this is the slash command I use to play the audio:

if (interaction.commandName === "play") {
  const fileName = interaction.options.getString("link");
  if (!interaction.member.voice.channel) {
    interaction.reply("You're not in a voice channel!");
  } else {
    interaction.reply("a");
    audio.playAudio(interaction.member.voice.channel, interaction.member.guild, fileName);
  }
}
plucky imp
#

@earnest phoenix how do you call the functions?

earnest phoenix
plucky imp
#

i saw but i didn't know if i needed an identifier or something

#

getLyrics is very plain lol

digital wagon
earnest phoenix
# plucky imp getLyrics is very plain lol
// CommonJS (CJS)
const { getLyrics } = require('genius-lyrics-api');
// ES Modules (ESM)
import { getLyrics } from 'genius-lyrics-api';

const lyrics = await getLyrics({
  apiKey: 'Your Genius API key goes here',
  title: 'Blinding Lights',
  artist: 'The Weeknd',
  optimizeQuery: true
});

console.log(lyrics);
earnest phoenix
# simple stump I'm terribly sorry to keep asking this, but I've been messing around with this f...

I suppose the audio resource creator can't create the resource properly from a local path, try this:

import { createAudioResource } from '@discordjs/voice';
import { readFileSync } from 'node:fs';
import { Readable } from 'node:stream';

// Read file and get it's buffers.
const buffer = readFileSync('./jammer.mp3');

// Turn the buffer into a readable stream.
const readable = Readable.from(buffer);

// Create the audio resource.
const resource = createAudioResource(readable);

// Play the resource.
simple stump
#

Ty! I'll try that

spark flint
#

i'm making a ticket/helpdesk system, whats the most secure of doing the tickets?
theres no customer authentication, only staff can login

atm its /ticket/TICKETID?e=EMAIL, and having a valid ticketid (uuid v4) and email it unlocks ticket replies

#

whats the most secure way of doing this?

sudden geyser
#

in that system I just need to know the ticket ID and email, so that's not secure

spark flint
#

i'm thinking of having an access token for each ticket that never changes, but has to also be correct to allow ticket replying or viewing

sudden geyser
#

like, if staff can login, then you have some form of authentication going around

#

could easily use some other platform to handle the actual account and flow, like google or discord

#

then just check if the current user is permitted to view the ticket, boom!

spark flint
#

its not using any third party authentication, as its open source and designed to be stand alone without a need for other platforms

#

or i would have used auth0 etc

simple stump
earnest phoenix
spark flint
#

but the ticket ID is a UUID which isn't easy to bruteforce find a ticket

simple stump
#

I also have ffmpeg on my PC path but I uninstalled the npm packages.

earnest phoenix
#

I recommend only installing @discordjs/opus, FFMPEG (or ffmpeg-static, both works pretty well) and sodium

simple stump
#

Aight. Thank you; I'll try that 👍

spark flint
#

how can I set box height

#

using Tailwind and regular CSS

plucky imp
#

okay soi

#

how would i split the name of the song from the artist name ? @earnest phoenix

#

and what if they don't put a artist name is it mandatory to have one?

earnest phoenix
plucky imp
#

so like

#

??

#
args.join(" ").slice('|')
earnest phoenix
#
args.join(' ').split('|');
plucky imp
#

kk

#

ty again bubs

earnest phoenix
earnest phoenix
# plucky imp

Btw the artist field is optional, so if the artist is unknown or not passed in, you just simply pass in an empty string

plucky imp
#

ooo okey

#

i only asked cs when i tried w/o the artist it gave me artist field is missing

sudden geyser
spark flint
#

It is definately a thing I'm considering

#

and I'm now looking into making a signup system for customers to use, and then they can list tickets etc

simple stump
# earnest phoenix I recommend only installing `@discordjs/opus`, FFMPEG (or `ffmpeg-static`, both ...

I can't seem to install sodium, but I have @discordjs/opus and ffmpeg-static. Unfortunately uninstall all my modules and re-adding them didn't seem to work...

audioPlayer.js: https://sourceb.in/VCpSfSBgon
package.json: https://sourceb.in/kBu9K3Fm1D

interactionCreate.js (or at least the part that uses audioPlayer.js):

        if (interaction.commandName === "play") {
            const fileName = interaction.options.getString("link");
            if (!interaction.member.voice.channel) {
                interaction.reply("You're not in a voice channel!");
            } else {
                interaction.reply("a");
                audio.playAudio(interaction.member.voice.channel, interaction.member.guild, fileName);
            }
        }

The issue I currently have is that the bot doesn't play any sound, just joins the VC without any errors.

#

And also the directory.

#

Sorry that I can't seem to figure this out.

pearl trail
#

fileName.url instead of just fileName?

simple stump
pearl trail
#

oh my bad

simple stump
#

nw

pearl trail
#

oh wait, so you give like file.mp3 in the link?

plucky imp
#

@simple stump can you test my bot for me ?

#

as like a proof read to make sure everything runs smoothly

#

i personally already overlooked most of the commands that didn't work but i want to be double sure so woo won't yell at me

simple stump
#

you couold just run it locally

#

or send the code

plucky imp
#

true

#

but enviroment matters to /shrug

#

omg

#

\shrug

simple stump
#

my enviornment unfortunately is very messy lol

#

idk if changing the hoster would do very much ¯_(ツ)_/¯

plucky imp
#

lol

#

true

#

did you ever fix it?

neat ingot
plucky imp
#

pogg

pearl trail
# simple stump yes

guess you need to require it first,

let fileToPlay = require(`./${fileName}`)

or use fs to read the file

#

but what i see from .play method, you need to give this to play local file using buffer https://discord.js.org/#/docs/voice/stable/class/AudioResource

i'd assume you using this one https://discord.js.org/#/docs/voice/stable/class/AudioPlayer?scrollTo=play

earnest phoenix
simple stump
simple stump
neat ingot
#

I created an application for using discord rpc to set my little user card info. wondering if folks might find use for such a thing?

#

makes this -v

earnest phoenix
neat ingot
#

oooohhh

#

i wasnt aware of that 😄

#

tbh that looks way nicer

opaque acorn
#

anyone knows why when i call my bot only with the prefix it turns off?

sudden geyser
#

define "turns off"

#

does it just not respond or go offline/get killed/shut down

sudden geyser
#

do you have any details on why

#

e.g. an error in your console

opaque acorn
#

but i didnt make a command with void name

sudden geyser
#

well then your bot's trying to send nothing to the user

#

e.g. a blank message or embed with no contents

#

you could probably find where if the stacktrace includes the line numbers in your project's code

opaque acorn
#

when i send ? it turns off

lyric mountain
#

Check the console, any error?

opaque acorn
lyric mountain
#

Show the error

opaque acorn
#
      throw new DiscordAPIError(request.path, data, request.method, res.status);
            ^

DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (/home/runner/railban-bot/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/runner/railban-bot/node_modules/discord.js/src/rest/RequestHandler.js:39:14) {
  method: 'post',
  path: '/channels/715210956723978259/messages',
  code: 50006,
  httpStatus: 400
}```
simple stump
lyric mountain
opaque acorn
#

yes

lyric mountain
#

Or does it happen on ping?

opaque acorn
lyric mountain
#

Show how ur handling commands

#

Like, the central part

opaque acorn
simple stump
opaque acorn
lyric mountain
#

You're probably not ignoring non-commands commands

#

So it try to send a message with nothing

earnest phoenix
# simple stump aight i just tried libsodium-wrappers along with tweetnacl, then tried uninstall...

That's pretty strange, I guess the only thing left for you to do is to either ask in discord.js' official support server:
https://discord.gg/djs
Or create an issue about it if the support from the official support server wasn't sufficient either in the GitHub repository:
https://github.com/discordjs/discord.js

GitHub

A powerful JavaScript library for interacting with the Discord API - GitHub - discordjs/discord.js: A powerful JavaScript library for interacting with the Discord API

#

I don't see how else would it not be working

simple stump
opaque acorn
#
const Discord = require("discord.js");
const client = new Discord.Client();
const db = require("/home/runner/railban-bot/models/commands");
const mdb = require("megadb");
let prefixdb = new mdb.crearDB("Prefixes");

module.exports = async (client, message) => {
  
  let p = prefixdb.has(message.guild.id) ? await prefixdb.get(message.guild.id) :   "?";

  const args = message.content.slice(p.length).split(/ +/);
  const prefix = p;
  const cmd = args.shift().toLowerCase();

  if (!message.content.startsWith(p) || message.author.bot) return;

  const load_dir = (dir) => {
    const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js"));
      for (const file of event_files) {
        try {
          const event = require(`../events/${dir}/${file}`)
          let eventName = file.split(".")[0];
          allevents.push(eventName);
          client.on(eventName, event.bind(null, client));
          amount++;
        } catch (e) {
            console.log(e)
        }
    }
}
  
  const command =
    client.commands.get(cmd) ||
    client.commands.find(a => a.aliases && a.aliases.includes(cmd));
  if (command) {
    const check = await db.findOne({ Guild: message.guild.id });
    if (check) {
      if (check.Cmds.includes(command.name))
        return message.channel.send(
          ":x: Este comando fue desabilitado por los admins."
        );
      command.execute(client, message, args, prefix);
    } else {
      command.execute(client, message, args, prefix);
    }
  }
};

lyric mountain
#

Why are u creating a new db for every message?

opaque acorn
opaque acorn
#

megadb is weird

lyric mountain
lyric mountain
#

In a few mins I'll get my laptop

boreal iron
#

Catch the error and command name and log both to your console

#

Then you will know where the error is coming from

#

Or properly handle all promises by catching their errors

#

I better don’t ask why you load files and create event listeners

earnest phoenix
#

It is one way of loading the events and registering them ig

boreal iron
#

You should probably watch the code before guessing

earnest phoenix
#

I am watching the code and that seems like exactly what he is doing

boreal iron
#

module.exports = async (client, message) => {

earnest phoenix
#

Ok

#

He could be using it as a start method to call in another file

#

and then he passes client and message to it

#

I also make start methods to call when I am actually ready to load events and such

boreal iron
#

So it will be called on any command

opaque acorn
earnest phoenix
#

ofc idk the real reason behind why he did that but that is just my assumption

earnest phoenix
#

no

#

Unless he is treating it like a command it won't

boreal iron
#

Wtf

earnest phoenix
#

Wait nvm you might be right

boreal iron
#

Watch the fucking code

earnest phoenix
#

my fucking bad ya twat

boreal iron
#

He is fucking handling the messageCreate event with this

earnest phoenix
#

Thats cool I just realized that so stop riding my fucking dick

oak cliff
#

calm down with the cursing pls thanks

boreal iron
#

Slicing of the message, getting his cmd name

#

What happens if you register event listeners over and over again?

#

funny stuff

boreal iron
#

Log the error and command name and you got the source

plucky imp
#

c l e a n

plucky imp
#

ew

#

why would i recode to slash commands laugh , it's only for noob coders who can't use command handlers

#

it also makes it to easy smh , why write 25 lines of code when you can do 45 and worry about prefixes ect

sudden geyser
#

so I don't ever see your help command!

pearl trail
plucky imp
sudden geyser
#

yeah but I don't want to do that

#

just type / and I can see them all and their descriptions

plucky imp
sudden geyser
#

can click through and see extra

plucky imp
#

then your lazy lol

sudden geyser
#

no, I want something consistent

plucky imp
#

how is that not consistant

#

what are you saying rn

steel sage
#

yikes

opaque acorn
#

djs v13 developers vs djs v12 developers

sudden geyser
#

because every bot creates their own language and vocabulary without a standard like slash commands

plucky imp
#

what

opaque acorn
#

i use v12

plucky imp
#

same

sudden geyser
#

you can think of slash commands like a standard, which is why I mentioned consistency

plucky imp
#

v12 > v13

#

not really

#

the standard is knowning the program lol

sudden geyser
#

I'm talking about as an end user

#

not a programmer

pearl trail
plucky imp
#

then the standard is functionality

#

consistency has nothing to do with either

sudden geyser
#

that's not how standard is applied here

#

but alright

plucky imp
#

doing /help and !help doesn't really make a difference

steel sage
#

Not worth arguing with tbh

pearl trail
#

you cant reject slash command unless you are making a private bot that doesnt need verification

plucky imp
steel sage
#

Calling people noobs in general is childish especially considering the fact that discord is forcing slash commands on a ton of bots

pearl trail
#

^

plucky imp
#

eh i guess

steel sage
#

Blame discord

#

Not the coders

#

I’m personally not a fan of them either

plucky imp
#

w response

steel sage
#

I respect those who like them but I generally hate that bots are being forced to use them

sudden geyser
#

well it gives discord more control so they don't care

pearl trail
#

yeah, being forced to rewrite 250 commands + codebase is pain fr

plucky imp
#

i was mainly talking about new coders and how majority of them are using slash commands instead of actually learning the material so if they won't be able to use slash commands for whatever reason they can actually code a command , not trying to discredit someones skills or anything like that

pearl trail
#

i dont get your learning the material

#

what is the material

plucky imp
#

js lol

#

like

pearl trail
#

ic

plucky imp
#

well i don't feel like typing more code

sudden geyser
#

you're still learning js writing interactions though

plucky imp
#

i guess

#

but you're building off of the interactions so it's still relying on it , regardless discord is garbage either way

#

there already making giga chad moves cause v11 can barely support itself and v12 is inconsistent

steel sage
#

Supposedly they’re making more customizations for slash commands soon but still, I don’t like them lmfao

plucky imp
#

same

steel sage
#

The permissions for them are a nasty wreck atm

plucky imp
#

pretty soon v12 wont work at all and your gonna have to recode to v13 then slash commands will probs be mandatory

steel sage
#

Mhm

sudden geyser
#

flexiblity and slash commands will never go together imo

steel sage
#

I agree

sudden geyser
#

slash commands are more like a framework

#

if it felt just like a schema then maybe they'd work

steel sage
#

Like you said tho, discord doesn’t care unfortunately

plucky imp
#

yeah

pearl trail
#

discord: take it or leave it

plucky imp
#

they hardly care abt anything besides there app and marketings

quartz kindle
#

because thats what actually matters lel

plucky imp
#

they wouldn't give me my old acc back after the obvious proof it was mine lol

plucky imp
pearl trail
#

for some cases, slash commands are bad because if you have multiple bots with same command's name, it's hard to get the right bot, especially on pc

#

you cant scroll

plucky imp
#

yeah but i mean

#

just change the prefix lol

#

ez fix

pearl trail
#

slash command but custom "slash"?

austere surge
#

yes

plucky imp
#

imagine i have bootleg slash command

#

just make / the prefix

#

ez fix no longer needs v13 update

pearl trail
#

v14*

#

more major breaking hooray

sudden geyser
pearl trail
#

yeah but what i meant is, example: like you have 6 bots with same command's name, discord only show 5 of them

sudden geyser
#

oh really? damn

pearl trail
#

yea

plucky imp
#

imagine they do all this work just for v14 to remove slash commands and basically revert back to v10

fiery stream
#

Hii

quartz kindle
#

why is intl so damn slow in js đŸ˜©

boreal iron
quartz kindle
#

check this out

#

almost 2 whole seconds for only 10k iterations

boreal iron
#

Maybe an issue of your performance class

#

Try to benchmark it

quartz kindle
#

lmao

#

performance is built in

boreal iron
#

joke died

quartz kindle
#

i killed it

#

:^)

boreal iron
#

Aye

#

it also makes it to easy smh , why write 25 lines of code when you can do 45 and worry about prefixes ect

quartz kindle
#

alright let me benchmark performance with performance

boreal iron
#

Like the dude arguing about slash commands

quartz kindle
boreal iron
#

damn

quartz kindle
#

Date.now() is faster

boreal iron
#

Now all iterations without calling performance

#

I KNEW IT

quartz kindle
#

this is 1 million iterations tho

#

xd

boreal iron
#

Maybe an issue of your performance class

#

Remember this

opaque acorn
#

ñ

boreal iron
#

May takes 100ms of your 142

quartz kindle
#

process.hrtime wins

boreal iron
#

(micro)2 optimization

quartz kindle
#

now this is surprising

#

process.hrtime.bigint() is just as fast as process.hrtime()

#

even tho bigint in general is slow af

boreal iron
#

You should be careful

#

When the time gets negative as benchmark result you might accidentally create a black hole

quartz kindle
#

i will divide by zero before that

boreal iron
#

lmao

opaque acorn
#

steins;gate?

boreal iron
#

Turning into a super nova then

#

much better

#

I feel like I shouldn’t mention this

#

Maybe an issue of your performance class

#

You’re benchmarking all of them right now, aren’t you?

#

you can’t resist

quartz kindle
#

nah i already finished

#

conclusion: process.hrtime is better

boreal iron
quartz kindle
#

dafuq am i doing

austere surge
#

things

boreal iron
#

I see you tried a few

#

I wish I could test intl for PHP to fuck you up, when it’s faster

#

But damn mobile phones are limiting you a lot nowadays

#

guess I need to buy a Windows phone

#

Haa!

quartz kindle
#

lmao

#

rn im running 2 sqlite dbs an 4 lmdb dbs

boreal iron
#

Damn I somehow like your net-ipc package

#

Looks promising for what I wanna do

#

If I ever have the time to pepowot

quartz kindle
#

exdee

plucky imp
#

Pogginggggg

dry imp
#

yamete

bright hornet
#

I have a weird error encountered on this code line,

if(cmd) cmd.execute(message, client, args)

if I use .lb-exp (which is the leaderboard)
it throws an error like (message.guild.id < undefined id)
If I re arrange the

if(cmd) cmd.execute(message, client, args)

to

if(cmd) cmd.execute(client, message, args)

the leaderboard working but it throws another error like

const target = message.mentions.members.first()``` undefined members
If I re arrange the 
```js
if(cmd) cmd.execute(message, client, args)

to

if(cmd) cmd.execute(message, args, client)

if I use .lb-exp (which is the leaderboard)
it throws an error like (message.guild.id < undefined id)

#

problem solved

#

lmao

dry imp
#

lmao

#

your welcome

hybrid cargo
#

"rearrange" okeh okeh

woeful pike
#

my man's code looking like

const parameters = [message, args, client]
cmd.execute(...shuffle(parameters))
#

you gotta like.. pass arguments in the exact position your code expects them

#

this is what dynamic typing does to a person

slender thistle
#

LMFAO what am I looking at

cinder patio
#

parameter order is one of the first things you learn when you learn functions

modest maple
#

to be fair, not all drivers behave that way

bright hornet
earnest phoenix
#

syntax highlighting on mobile zoomeyes

woeful pike
#

sorry i'm only here to shit on dynamic typing

bright hornet
#

https://sourceb.in/MnlOM1eoSe so, i was trying to move all codes in slappey => normal command handler got error after this, if I do findOneAndUpdate at the last part, the messageCount not changing or adding at all

bright hornet
earnest phoenix
#

It's not

bright hornet
woeful pike
#

this will create the document if it doesn't exist and increment the messageCount by one if it does

#

you might need to use $setOnInsert for setting a default message count of 0 though

modest maple
#

Mongodb moment

#

Just use SQl or a wide column đŸ˜©

#

Litterally poggers

earnest phoenix
#

shut up whitename

spark flint
#

top.gg: where every developers opinion must be correct

woeful pike
#

only if you have a blue name

spark flint
#

blue names are usually correct

earnest phoenix
spark flint
#

lol

dry imp
kindred bramble
#

am i doing wrong for using sqlite? CuteThink

gentle osprey
#

pls fix this bug

rustic nova
#

you can try fixing it yourself, these are the main starting points

marble juniper
#

Read the error

#

Solve it yourself

spark flint
kindred bramble
#

yeah i like it, the other bot devs ik switched to nosql and i felt left behind

safe path
#

There was breaking changes

lyric mountain
marble juniper
#

sql is good and if they don't understand it and switch to mongo they are just stupid

boreal iron
#

Well there are people out there loving a chaotic database storage system
Imagine loving a well organized and optimized storage system

#

Eww

dry imp
#

why people still use d.py

safe path
#

cope

dry imp
#

indeed u need cope

lyric mountain
#

people hate changes, they want to code once and have it live forever

dry imp
#

tbh idrc if people still use d.py i just wanna wait for another big danny drama

gentle osprey
rustic nova
sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

sqlite db + lmdb cache >>>> mongo db + redis cache

lyric mountain
#

djs 12 is still less ooga booga

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

cuz it's very recent

rustic nova
#

"still less ooga booga"

lyric mountain
#

but 11 is barely hanging

rustic nova
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

dry imp
sage bobcat
#

One message removed from a suspended account.

dry imp
#

good

#

discord bot development boring

sage bobcat
#

One message removed from a suspended account.

mint rock
#

Im trying to send message to a member but .send is undefined, I'm pretty sure this worked before but doesn't now

#

Any ideas why its like this?

boreal iron
#

The member isn’t cached

#

Log him and you will see

earnest phoenix
#

try fetch instead

lyric mountain
mint rock
#

alright, ill try

cinder patio
#

or maybe the id is wrong

boreal iron
#

Keep in mind fetch is a promise

boreal iron
rustic nova
#

needs to be more complicated

#

have you made sure the id is actually utf-8 based

earnest phoenix
#

strings are utf 16

rustic nova
#

also made sure there's no zero width characters

boreal iron
rustic nova
#

𝟹 6

#

difficult to determine

#

see

boreal iron
#

That’s why everyone is posting in here


#

Because trolling is legit in here

#

besssst channel

modest maple
boreal iron
#

No don’t!!!

#

Now he will end up benchmarking the whole day instead of developing his API

#

đŸ€Šâ€â™‚ïž

earnest phoenix
onyx socket
#

is it allowed to use flags like đŸ‡ș🇩 in our bot's name? Asking because some platform are like we don't allow stuff like political opinion and what not

earnest phoenix
#

Flags are hard to type so you need to have english characters in your bot name if you put ukraine flag there

onyx socket
#

understand my feelings! i mean i want to show my support for Ukraine, Like updating the profile picture and about me of the bot

#

Is it allowed or against discord's rules

earnest phoenix
#

it's not

cinder patio
#

Put the flag in the bot's status or description

earnest phoenix
#

discord would be ratioed if they did ban it

#

but like i said you shouldn't put in your bot name otherwise you can't ping it

#

it's not against tos but generally looked down upon

onyx socket
#

alr, was just making sure as i dont see any bot do that

#

ty for the info :3

modest maple
lyric mountain
#

so keep that in mind if you plan on going above 100 servers

slender thistle
#

Not like it will change anything anyway...

lyric mountain
#

well, he'd become stuck with a flag on the name

onyx socket
slender thistle
neat ingot
#

like, I just dont see how showing a flag actually shows you are supporting.

safe path
#

Awareness

neat ingot
#

awareness !== supportiveness.

safe path
#

Not always

lyric mountain
#

I'm on the "showing the flag is a marketing strategy" team

#

it's like bmw changing the logo during lgbt pride

neat ingot
#

i honestly felt the same with tons of bots during when BLM was at its peak.

#

and yea, during pride period it happens too lol

safe path
#

I personally have donated money to ukraine

earnest phoenix
#

I love sass's website because all the websites removed the black lives matter banner from their site after the "trend" died down and nobody talked about it anymore, but sass still has it because it's STILL a major issue

neat ingot
#

i remember skittles did a pride special, where all skittles where white, because there was only one rainbow that was important during pride... 😛

#

if that isnt pandering for the crowd, idk what is 😄

safe path
#

đŸš©

lyric mountain
#

and m&m making the green female candy less vulgar

#

I mean, fuck it they all taste the same

neat ingot
earnest phoenix
#

hype about people fucking murdered by police

neat ingot
#

lol, yea... its a pretty sad world tbh 😩

safe path
#

this might be getting too off topic

earnest phoenix
slender thistle
#

This shit's all over news, social media, irl

earnest phoenix
slender thistle
#

Do I look or sound like I give a single fuck

neat ingot
#

i could see - for example, adding a link to every embed your bot makes, that links to some Ukraine relief fund - that'd be actual support imo.

slender thistle
#

Now that can count as support, yes

lyric mountain
#

ye, that is, bringing awareness to how to donate

#

not bringing awareness that ukraine flag is yellow and blue

safe path
#

And then there is the pygame website

neat ingot
slender thistle
#

I didn't know such a flag existed

#

This is a peace protest against war by some people involved with pygame. The pygame website is temporarily down. Thank you for your support.
Fun

neat ingot
#

🏮󠁧󠁱󠁳󠁣󠁮󠁿 <- best flag. SnorlaxDab

neat ingot
#

how did they get an emoji in the button?

#

(discord rpc)

#

I've tried doing the name:id for an emoji, but no luck 😩

lyric mountain
#

isn't that the official psn button?

#

like, steam button also has steam icon

wheat mesa
#

That’s the official button, you can’t specify that afaik

neat ingot
#

not sure, could be. but they also show the emoji in the top right

#

discord js rpc doesnt have emoji support in the setActivity function it seems 😩

wheat mesa
#

That’s integration discord has provided with certain companies I’m sure

lyric mountain
#

ye

#

specifically companies that can be linked in ur profile

neat ingot
#

ahh well, guess i need to start a company for my bot lol

wheat mesa
#

Yeah, you can see that with similar things like Spotify

lyric mountain
#

those ones

earnest phoenix
#

That's specified by Discord's game detection on it's own after partnering with PlayStation, Although I saw discussion for that being made support for, but I don't remember where

neat ingot
wheat mesa
#

RPC is just kind of annoying to deal with in general

#

I’m not gonna bother with it again until they support websocket RPCs

earnest phoenix
#

Although that's only gonna be available in the GameSDK, not the Discord-RPC which is deprecated

wheat mesa
#

You could add it yourself and fork the lib mmulu

earnest phoenix
#

The docs for sdk and stuff is just so đŸ€ź

wheat mesa
#

It’s not trash it’s just not great

#

Plus it’s not their main concern

earnest phoenix
#

It's pretty good if you know how to use it, although I agree, the documentation for the GameSDK isn't really that solid

#

And entire app made for gamers that doesn't like game presence

wheat mesa
#

It works perfectly fine for game presence

earnest phoenix
#

what is rpc then

wheat mesa
#

It was never intended for people who don’t know what they’re doing

#

The docs are sub par

#

But not nearly the worst I’ve seen

earnest phoenix
#

We all know detritus has the worst docs

wheat mesa
#

Detritus is not the worst docs I’ve ever seen either

earnest phoenix
#

It's so bad googlefeud had to make his own

wheat mesa
#

He’s the main contributor of the docs

#

Detritus doesn’t hold your hand, the docs themselves are pretty clear when you think about it

#

It just doesn’t have a lot of examples

earnest phoenix
#

It's the website itself

#

You get random 404s for search results, css sometimes doesn't load although it only seems to be an issue with me, 404s sometimes redirect to /, etc.

wheat mesa
#

If you think detritus’ docs are the worst, you obviously haven’t looked at a lot of docs KEKW

wheat mesa
earnest phoenix
wheat mesa
#

Indeed

cinder patio
#

typedoc's docs are hard to read in general IMO

#

but they have a redesign coming soon which hopefully makes it better

earnest phoenix
#

hopefully

cinder patio
#

Only colors & layout's changed

earnest phoenix
cinder patio
#

This barely readable text's gonna stay 😩

sudden geyser
#

You guys wrote JS to get away from Java only to arrive back at Java

lyric mountain
#

everything boils down to java

#

and programmers make coffee with the water

sudden geyser
#

All roads lead to Java

plucky imp
#

@lyric mountain I GOT APPROVED BBBBB

#

okay who needs bottum help

lyric mountain
fiery stream
plucky imp
#

bottums

#

in under 24 hourS

lament rock
wheat mesa
#

The concept behind OOP is easy to understand; OOP is very structured and is easy to separate different parts of the program from each other

#

I love oop

earnest phoenix
#

What are the differences between flow and ts?

plucky imp
#

If you have to ask there isn't one

cinder patio
#

Barely any difference

#

flow has maybe types, they're quite nice

onyx socket
#

Idk i just felt like doing it

#

Also how does adding flag act as marketing technique

mellow locust
#

My bot is returning this error some times. Did anybody know something about this?

quartz kindle
#

looks like cloudflare error

#

just catch and ignore

wheat mesa
#

5xx errors are server end, nothing to do with you as far as I know

spark flint
#

@mellow locust ^

mellow locust
#

thank you!

plucky imp
#

@solemn latch am i pog champ rn?

heavy marsh
#

Hello so am ..
When I run my bot on a vps/locally I face a small problem - After playing a YouTube audio I cant seem to play a stream audio [Radio Stream].

I dont get any error on my console but no audio seems to be played

random pollen
#

sorry it's not about discord, but does anyone know about that bug? I can't find how to solve it pensiveMagik

plucky imp
#

that moment you have so many packages your bot freezes when you update them

random pollen
#

You tell me?

plucky imp
#

server side error

random pollen
plucky imp
#

lol it should resolve itself

surreal knoll
#

When I take the direct hosting from VSC the bot is still online
I don't know why
And it's a problem for when I'm trying to make changes
It doesn't save

Do you know how to make the Discord client offline after stopping the direct hosting with CTRL+C in prompt?

sudden geyser
#

Then some other process is controlling your bot.

#

How exactly are you starting your bot?

#

It could be a task, a command on the command line (though this is what you claim to be killing), something that spawns a separate process (and hence won't be affected), etc.

surreal knoll
#

When I exit the process on command prompt, the bot stops its streaming status and goes online, and it does not respond to any commands.

#

I also do not have any hosting services holding up my bot currently

surreal knoll
#

It stays online unaccompanied
I would like it to me offline

#

So that my changes in the code would save

boreal iron
#

If you don’t logout from your active gateway connection the API thinks of a disconnect

#

Your status icon won’t change for like 10-30s

#

Make sure when exiting the process to destroy your client

#

Means to end its gateway connection accurately

#

At least for nodejs

surreal knoll
#

And where exactly am I supposed to try this?

spark flint
#
                    <div class="article rounded p-4 mb-4 text-white items-center justify-center md:w-1/2 md:w-2/6 md:m-auto ml-3 mr-3 cursor-pointer" onclick="window.location='/article/<%= article.articleID %>'">
                        <div class="flex items-center">
                            <div class="flex flex-col text-left ml-3 mr-3">
                                <span class="articleTitle"><%= article.articleTitle %> <span class="articleArrow">→</span></span>
                                <span class="articleDesc"><%= article.articleDescription %></span>
                            </div>
                        </div>
                    </div>```
#

how can I make articleArrow's margin change on div hover not arror hover

quartz kindle
#
.article:hover .articleArrow {
  ...
}
spark flint
#

ahh

heavy marsh
boreal iron
#

Inside the event listener of course

fiery stream
#

Hii

random pollen
#

Hello, do you know if the puppeteer has a discord server?

rocky hearth
#

Do I need react-query if I use firebase with reactfire? (in a nextjs project)

rocky hearth
dry imp
#

yes misty

earnest phoenix
#

ty

#

:^)

dry imp
#

wait

earnest phoenix
#

I thought I was doing smth wrong ngl I haven't calculated milliseconds like that in a while

dry imp
#

24x60 returns minutes

earnest phoenix
#

👀

dry imp
#

times 60 again

earnest phoenix
#

7 * 1000 * 60 * 60 * 24

#

ah right cause that turns it to milliseconds, seconds minutes days right?

dry imp
#

should be

earnest phoenix
#

đŸ€”

#

yep

plucky imp
#

bruh my bot broke cs got was to powerfull

plucky imp
#

poggggg

#

@lost berry is this clean

dry imp
#

my ocd

plucky imp
#

lmaooo

#

i'll fix it later

#

my laptop might die at any moment don't want bottums to be offline lols

#

y e s

#

@dry imp

#

please kill me now

dry imp
#

use that cmd on mobile

plucky imp
#

o h

#

g o d

#

i need to check perms with it lol

#

omg the stretch lol

#

i might make it where you can add your own background tbh

#

but my spaget code will cri

bright hornet
#

does anyone know how other economy do dep all to dep their cash? or even using 1e8 = 100,000,000 do you have any idea or know some docs?

slender thistle
#

if input == "all" then money = user.balance

bright hornet
#

ohhh thanks thanks

plucky imp
#

okay so i have a question

#

my economy commands stopped working after i changed it from db.set to economy.set

#

but in quick.db docs it says use

#
var economy = new db.table('economy')
#

but it doesn't show any new table and now nun of the commands work

#

as stated above ^^

#

if you want my code

#
  if (command === "work") {
    let user = message.author;
    let author = await db.fetch(`work_${message.guild.id}_${user.id}`)

    const cooldown = cooldowns.get(message.author.id);
    if (cooldown) {
      const remaining = humanizeDuration(cooldown - Date.now());
      let timeEmbed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setDescription(` You have already worked recently\n\nTry again in ${remaining}`);
      message.channel.send(timeEmbed)
    } else {


      let replies = ['Programmer', 'Builder', 'Waiter', 'Busboy', 'Chief', 'Mechanic', 'Engineer', 'Hitman', 'Hacker']


      let result = Math.floor((Math.random() * replies.length));
      let amount = Math.floor(Math.random() * 80) + 1;
      let embed1 = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setDescription(`You worked as a ${replies[result]} and earned ${amount} coins`);
      await message.channel.send(embed1)

      economy.add(`money_${message.guild.id}_${user.id}`, amount)
      economy.set(`work_${message.guild.id}_${user.id}`, Date.now())

      cooldowns.set(message.author.id, Date.now() + 10000)
      setTimeout(() => cooldowns.delete(message.author.id), 10000);
    }
  }
#

work cmd

#
if (command === "bal") {
    let user = message.mentions.members.first() || message.author;

    let bal = economy.fetch(`money_${message.guild.id}_${user.id}`)

    if (bal === null) bal = 0;

    let bank = await economy.fetch(`bank_${message.guild.id}_${user.id}`)
    if (bank === null) bank = 0;

    let moneyEmbed = new Discord.MessageEmbed()
      .setColor("RANDOM")
      .setDescription(`**${user}'s Balance**\n\nPocket: ${bal}\nBank: ${bank}`);
    message.channel.send(moneyEmbed)
  }
#

bal cmd

#

i get no errors it just doesn't show anything ;-;

#

nvm

#

i needed to change var economy to let economy

#

i hate my life

slender thistle
#

Glad to have helped

plucky imp
#

yes

#

ty very mucH

slender thistle
#

đŸ„° Anytime my donut

solemn jolt
#

why i have

DiscordAPIError: Missing Permissions
at RequestHandler.execute (/layers/paketo-buildpacks_npm-install/modules/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/layers/paketo-buildpacks_npm-install/modules/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async TextChannel.send (/layers/paketo-buildpacks_npm-install/modules/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:175:15) {
method: 'post',
path: '/channels/953206592935964712/messages',
code: 50013,
httpStatus: 403,
requestData: {
json: {
content: ' You need to type 36',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 0,
message_reference: { message_id: '953214484523151371', fail_if_not_exists: true },
attachments: undefined,
sticker_ids: undefined
},
files: []
}
}

error in this code

          try {
            message
              .reply(` You need to type ${data.guild.count.lmite}`)
              .then((msg) => {
                setTimeout(() => {
                  if (msg.deletable) {
                    msg.delete().catch((e) => {
                      console.error(e);
                    });
                  }
                }, 10 * 1000);
              });
          } catch (error) {}
plucky imp
#

@solemn jolt what is the whole thing

solemn jolt
#

i add 2 catch to stop it but the bot well be offline

plucky imp
#

or is that it

solemn jolt
#

yep

plucky imp
#

uh okay well i have 2 questions

#

and a possible answer

solemn jolt
#

ok

#

tell me

plucky imp
#

one why is it formatted like that makes it very hard to ready but nice for style points

#

what is this

#

${data.guild.count.lmite}

#

and your error might be on message.delete make sure your bot has permissions for it

solemn jolt
plucky imp
#

ohh

slender thistle
#

POST /messages means it can't send a message

plucky imp
#

your using mongo db understandable

solemn jolt
plucky imp
#

uh yeah

#

like hold on

#

ima post new code to worK

slender thistle
#

It's not deleting that's the issue here

plucky imp
slender thistle
#

I fucking explained it above already few seconds ago

plucky imp
#

make sure it can send messages to

dry imp
#

DiscordAPIError: Missing Permissions

solemn jolt
plucky imp
#

always check bot perms though because if they don't have a certain perms cmd wont work

slender thistle
#

catch (error) {}
Ehh...

plucky imp
#

oh that to

slender thistle
#

It's not occurring in that code snippet, I reckon.

plucky imp
#
catch (error) {
 console.log(error)
}
#

i think it is

dry imp
#

he just want to catch it

solemn jolt
slender thistle
#

Is that not what he's doing already

plucky imp
#

yeah but if you get an exact line it's easier to find problem

solemn jolt
plucky imp
#

it doesn't log where the error is specifically in the console

solemn jolt
#

i just want to catch it and dont do anything

slender thistle
#

I'll leave the JS clusterfuck to you then

plucky imp
#

lol

plucky imp
slender thistle
#

Though logically the code does make sense I'd say

plucky imp
#

ues

#

i can eval for you

slender thistle
#

Maybe give .catch a try too

plucky imp
#

^

#

or actually

#

@earnest phoenix come pls

solemn jolt
#

i use somthing before in discord.js v11

if (message.deletable) {}

but for now this is dont work

earnest phoenix
plucky imp
#

sadge

#

voltrex isn't on

#

and your smort

solemn jolt
#

🙂

plucky imp
earnest phoenix
#

what's the problem

#

promise.catch(() => {}); to ignore errors

earnest phoenix
#

or just use promise.finally instead of promise.then

solemn jolt
#

i add 2 catch to stop the error but the error make my bot down

earnest phoenix
#

maybe msg is the author's message

solemn jolt
#

no i test in the guild

pearl trail
pearl trail
#

for?

solemn jolt
#

for one check the bot need 5m to come online

solemn jolt
#

?

plucky imp
#

yeah

#

i see no error

solemn jolt
#

i fix it

#
            if (!message.channel.permissionsFor(message.guild.me).has("MANAGE_MESSAGES")) {
              message.delete()
            }
plucky imp
#

that worked

#

AHA

#

I TOLD YALL

solemn jolt
#

yeh ty all

plucky imp
#

np love

#

i'm always here rxq_heart

#

lol

solemn jolt
#

hhhh

plucky imp
#

pog

spark flint
#

pog

plucky imp
#

very pog

#

okay so

#

@spark flint question

spark flint
#

hi

plucky imp
#

is this clean??

spark flint
#

yes

#

very

plucky imp
#

tyy

#

i'm trying to optimize everything

#

the code is spaget tho lol

spark flint
#

nice nice

gilded plankBOT
#

topgg #development Etiquette

topggDotRedThis channel is to help and educate each other. Please refrain from contributing if your intention is to be unhelpful.

topggDotRed Be mindful that we all started as beginners, so be nice to each other. Helping one person helps us all. The more knowledgeable the development community is, the more we all benefit.

topggDotRed If you are unable to answer a question, please refrain from deducing your knowledge from another source - you will mostly create more confusion.

topggDotRedIf you are able to help a user, please do so without expressing a condescending or rude attitude.

topggDotRedDo not use random, unhelpful, unrelated jargon to make yourself seem smarter. Always be mindful that the intention of discussion in this channel is to be helpful and educational, not to show off your vocabulary.

topggDotRedDo not ask to ask - this channel is for questions, so you do not need permission to ask.

topggDotRed Keep inside jokes to a minimum as they will most likely confuse the user asking a question.

topggDotRed No language / library wars - anyone involved will be muted.

topggDotRedDo not assume that users have not already googled their question. If they are asking here, it is likely because they were unable to find a helpful answer via Google. Telling someone to “Google it” is unhelpful and rude.

maiden sage
#

ignore me, i am just updating pins mimu_sip

boreal iron
#

Damn
 we can’t make jokes about py anymore

#

Sad times topggSob

maiden sage
#

we've had this etiquette for a while

#

i just updated it LOL

boreal iron
slender thistle
slender thistle
#

Whoever was smart enough to follow this is just smart enough to use common sense along with experience in helping

dry imp
#

sad times indeed

boreal iron
#

At least jokes about PHP now result in a ban immediately

hoary apex
#

My chatbot error

inner sapphire
#

How do you not know that error

#

It legit says what the issue is

hoary apex
#

Huh

inner sapphire
#

"Missing Permissions"

hoary apex
inner sapphire
#

It has no permissions to chat in that channel

spark flint
#

No language / library wars - anyone involved will be muted. oh no all of topgg will be muted

hoary apex
#

It's has Administrator role

inner sapphire
#

Why are you giving your bot an admin role

hoary apex
#

Bruhhh

hoary apex
inner sapphire
#

Then contact the dev

hoary apex
#

Huh it's my bot

inner sapphire
#

Then how do you not know how it has no perms

hoary apex
hoary apex
pearl trail
#

check if your bot have SendMessages in that channel

dry imp
#

like if there is no code i literally dont know where does the error points to

pearl trail
#

^

plucky imp
maiden sage
earnest phoenix
#

Can somebody help me?

dry imp
#

hmm

#

i've seen a lot of missing access error today

earnest phoenix
dry imp
#

idk my bot works fine tho

earnest phoenix
dry imp
#

dont know js sry

neat ingot
#

its just missing access errors

#

check what permissions your bot requires, and make sure it has those permissions in the areas that your bot is trying to manipulate when throwing the error

#

for example: if error thrown when registering slash commands, if you are registering commands on a per guild basis, some guild might not have application.commands permission for the bot, or if its thrown when scanning channels or sending a message, then its likely a channel or guild permission error for embed_links or something stupid

earnest phoenix
neat ingot
#

idk, i'd guess its likely that your bot has some command that requires a permission that your bot doesnt have. some module called gcommands is mentioned alot in your error message. and the error seems to be getting thrown from the ready event

lyric mountain
#

missing slash scope maybe

#

or you're trying to load slashes in a guild your bot is not member of anymore

earnest phoenix
lyric mountain
#

either way, unless you show some code not much can be done

neat ingot
#

your bot needs both those scopes in the invite link for you to be able to register slash commands

#

it could be some framework is trying to automatically register commands to the dev guild or something but cant ~ idk

#

i agree, need more code or something 😛

earnest phoenix
#

require('dotenv').config();
const { Intents, Collection } = require('discord.js');
const { GClient } = require('gcommands');
const path = require('path');

const client = new GClient({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MEMBERS,
],
dirs: [
path.join(__dirname, 'commands'),
path.join(__dirname, 'events')
],
devGuildId: '951943054892335104'
});

client.queue = new Collection();

client.login(process.env.DISCORD_TOKEN);

need to edit this

lyric mountain
#

show gcommands

earnest phoenix
neat ingot
lyric mountain
#

ah, public lib

#

"remaking"

#

that's one of the worst options available

#

but anyway, yes gcommands tries to sync guild commands

earnest phoenix
lyric mountain
#

not cloning an existing bot would be a good start

#

but if u must, filter out guilds that dont have the required scope

earnest phoenix
lyric mountain
#

publishing isn't the issue

neat ingot
#

diy is where the lernz are @tidal bridge

lyric mountain
#

you're trying to maintain someone else's bot without enough knowledge

fiery stream
#

I lowkey wanted to make a music bot with webpage n cards showing what music is currently playing in the guild

neat ingot
#

oh fk, sorry, it wasnt support to @plucky sonnetonereally lol

lyric mountain
#

this is a huge task even for the original dev

neat ingot
#

ohmyfukinggawd illstop

lyric mountain
#

imagine for an outsider

fiery stream
#

I mean I’m still gonna do it not using d.py 2.0

neat ingot
#

you literally cant put an at symbol with random text without it atting someone

earnest phoenix
#

@lyric mountain did you know how to fix it ?

neat ingot
# earnest phoenix i dont make it publish

tbh, the best way to learn, is to do as much of the code yourself from the ground up. but thats not time efficient, so its all about finding a balance that suits your learning pace, as well as allows you to grow 🙂

lyric mountain
#

you're in for a huge task you'll not be able to deal with

#

nor anyone but the owner can answer your issue

neat ingot
#

i mean, it does seem like the issue is that its trying to register slash commands without the application.commands scope on the bot

#

~ could be wrong tho

lyric mountain
#

that's probably it, but solving that on the probably giant codebase is a big task

neat ingot
#

i'd try just kicking the bot from dev guild, and then reinviting it with the scopes

#

and if that fails, then i'd probably give up on that library 😂

lyric mountain
#

library?

#

my boy, he cloned the whole bot

neat ingot
#

i thought thats all that was used?

#

the gcommands framework thing

split hazel
#

my ssd says the wear level is n/a any ideas why?

lament rock
#

Might not report it. If it used to report it then the module that used to report it might be borked

lyric mountain
#

plus his error paths match with MusicBot source

neat ingot
#

ahhh ok, fair enough lol

#

i gotta go out anyway, so gl lil dood 😗

earnest phoenix
#

how can i use markdown or html

#

?

spark flint
#

its got a cheatsheet

earnest phoenix
earnest phoenix
earnest phoenix
earnest phoenix
earnest phoenix
#

whats the problem?

wheat mesa
#

You need opus or some sort of encoder I believe

earnest phoenix
wheat mesa
#

Try installing @discordjs/opus

#

Oh wait

#

It literally says what to do

#

Didn’t even see that line

#

Do what it says to do

rose lance
#

can someone explain what exactly is happening here?
why is my div 24px even tho the svg and the a are only 16px

wheat mesa
#

Although I’m pretty sure opus would work too

atomic kindle
#

Hold on, there is no padding...?

rose lance
plucky imp
#

moon is here

#

who needs help with spaget code

wheat mesa
#

just ask

atomic kindle
rose lance
atomic kindle
#

@civic scroll css

civic scroll
#

or the bigger menus

#

iirc grid spans to the child which has the largest width

rose lance
rose lance
civic scroll
rose lance
civic scroll
#

since whitespace: nowrap

#

also smaller ones will stretch

rose lance
#

why do I need width when I wanna manipulate height?

woeful pike
#

for what

stiff lynx
#

Hello everyone, need help on an error.

2022-03-15T16:14:49.334504+00:00 app[Worker.1]:     at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
2022-03-15T16:14:49.334504+00:00 app[Worker.1]:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-03-15T16:14:49.334505+00:00 app[Worker.1]:     at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
2022-03-15T16:14:49.334505+00:00 app[Worker.1]:     at async MessageManager._fetchId (/app/node_modules/discord.js/src/managers/MessageManager.js:219:18)
2022-03-15T16:14:49.334505+00:00 app[Worker.1]:     at async Object.run (/app/SlashCommands/partnerworld/visualizzaRichiesta.js:47:30) {
2022-03-15T16:14:49.334506+00:00 app[Worker.1]:   method: 'get',
2022-03-15T16:14:49.334506+00:00 app[Worker.1]:   path: '/channels/951500288123093042/messages/953290244235603988',
2022-03-15T16:14:49.334506+00:00 app[Worker.1]:   code: 10008,
2022-03-15T16:14:49.334507+00:00 app[Worker.1]:   httpStatus: 404,
2022-03-15T16:14:49.334507+00:00 app[Worker.1]:   requestData: { json: undefined, files: [] }
2022-03-15T16:14:49.334508+00:00 app[Worker.1]: }
2022-03-15T16:14:49.334547+00:00 app[Worker.1]: 
2022-03-15T16:14:49.334548+00:00 app[Worker.1]: Node.js v17.7.1```

I'm trying to fetch for a message and send it again, works with another one but not with this one

edit: I send the full console.log
modest maple
#

The message apparently doesn't exist

stiff lynx
spark flint
#

and removed the logo and stuff so no ads

cinder patio
#

it's ok

boreal iron
#

Best server name adding my bot I've ever seen

#

Federation of Equality against Europe and everyone...

sudden geyser
#

Probably headquartered in North Korea

cinder patio
#

I'm wondering whether it's worth it to store ranges as { start: usize, end: usize } and calculate the line & column they're at only when I need it. It saves a few bytes per range, and there are gonna be a lot of ranges, and it's never guaranteed that I'll need the line & column. Only problem is that getting the line and column isn't that easy... or fast

#

16 vs 32 bytes, but also keep in mind that the column & line are going to be counters which will get incremented conditionally every time a new character is getting consumed, so that's also some overhead

boreal iron
#

My gosh... fixed an API issue being around for months returning a bigint as integer and not string

#

When you have to shake your head about yourself...

wintry blade
#

hi

spark flint
wintry blade
#

uh not yet

cosmic forum
#

Quick question, how would I check if a user is in a guild by their ID? (discord.js v13)

boreal iron
#

Without OAUTH you will have to fetch a guild member using that user ID

#

Which works for guilds only, your bot is in

cosmic forum
#

I see, I tried this:

let m = await msg.guild.members.fetch(top[topu][0]);
if (m) {
  tope.push(`<@${top[topu][0]}> - ${top[topu][1]} points`);
  count++;
 };

However it returns the following error:

/home/pi/wordle/node_modules/discord.js/src/rest/RequestHandler.js:350
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Unknown Member
    at RequestHandler.execute (/home/pi/wordle/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/pi/wordle/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async GuildMemberManager._fetchSingle (/home/pi/wordle/node_modules/discord.js/src/managers/GuildMemberManager.js:407:18)
    at async Client.<anonymous> (/home/pi/wordle/index.js:98:21) {
  method: 'get',
  path: '/guilds/941120743083737088/members/567516955922137109',
  code: 10007,
  httpStatus: 404,
  requestData: { json: undefined, files: [] }
}

Node.js v17.7.1
lyric mountain
#

catch ur promises

boreal iron
#

is top[topu][0] actually the user ID?

cosmic forum
boreal iron
#

Well then the message is accurate

#

He's not a member of that guild

cosmic forum
#

ty

boreal iron
#

As Kuuhabawankbuku said

#

You need to catch the promise to get rid of the error

#

As it seems you don't need the error, simply catch the error to /dev/null freerealestate

#

.catch(() => {})

spark flint
lyric mountain
#

I was about to ping a mod

boreal iron
#

damn, these ads nowadays

spark flint
lyric mountain
#

benefits: there are no benefits

spark flint
#

targetted ads!!!

boreal iron
#

300$ free because nobody ain't using that microsoft shit

spark flint
#

lol

boreal iron
#

RIP our Indian tech scammer

spark flint
#

lol

boreal iron
#

nobody helping our grandmas and grandpas anymore to solve their tech issues

#

damn, sad times

rose lance
#

I have this grid and I want the different columns to scale individually
I thought I could fix it by using repeat(3, minmax(0, 1fr)) instead of repeat(3, 1fr) but that' still doing the same thing

lyric mountain
#

then you'd not have a grid at all

#

oh wait, u mean the whole column

#

cant u just set its width?

opaque acorn
#
    queue.textChannel.send(
                      ^

TypeError: Cannot read properties of undefined (reading 'send')
    at DisTube.<anonymous> (/home/runner/railban-bot/index.js:125:23)
    at DisTube.emit (node:events:390:28)
    at SpotifyPlugin.play (/home/runner/railban-bot/node_modules/@distube/spotify/dist/index.js:183:28)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)```
boreal iron
#

textChannel is undefined

lyric mountain
#

textChannel is undefined

boreal iron
opaque acorn
#

no

boreal iron
#

Yes

opaque acorn
#

this error only happens when i play spotify songs

boreal iron
#

In this scope you're using it, it's undefined

#

Simply log it and you will se

rose lance
lyric mountain
#

except if u set table width to 100%

#

there's a property to make columns flexible, but you'll have a smaller table

rose lance
#

that would be even better

cinder patio
#

Thoughts on the best way to get line and column from just an index in a string? I have this:

    fn loc(&self, text: &str) -> Location {
        let mut current_ind = 0;
        for (line_ind, line) in text.lines().enumerate() {
            let line_end_ind = current_ind + line.len();
            if *self > current_ind && *self < line_end_ind {
                return Location {
                    col: ((line.len() - (line_end_ind - self)) + 1) as u64,
                    line: (line_ind + 1) as u64
                }
            } else {
                current_ind += line.len() + LINE_ENDING_LEN;
            }
        }
        Location::default()
    } 

But I'm questioning it's speed đŸ€” This is the first thing I thought of and I can't think of anything better

earnest phoenix
#

God I wish I understood that

#

:^)

lyric mountain
cinder patio
# earnest phoenix God I wish I understood that

It iterates through each line in a string, self being usize. I'm comparing whether self is between current_ind (sum of all lengths of the previous lines) and line_end_ind (current_ind + length of current line), if it is then the index is on that line.

I could probably make the method accept a Lines iterator, or even better, make it accept a vector of strings, and cache each vector, but that kinda kills the optimization I'm trying to make

cinder patio