#development

1 messages · Page 1850 of 1

winged mulch
#

Oh

#

@quartz kindle Thank you, I think that "fixed" it

#

No errors

quartz kindle
#

cool

#

still you should look into it

winged mulch
#

I've been struggling with this for a week

quartz kindle
#

you can check if its a network issue with the raw event

#

client.on("raw", r => r.t)

#

that should show you the guilds being received at login

#

if they are coming very slowly, its a network problem, or you have something heavy running in the script at the same time

#

if they come very fast but then get stuck for like 15 seconds on a single guild, then you have bugged guilds

#

bugged guilds can be caused by bot farms and guilds who abuse discord's limits

#

not much can be done about that, sometimes you cant even leave them

winged mulch
#

Guild.leave()

quartz kindle
#

ye, like you send a guild delete request and it errors

winged mulch
#

Woah, why?

quartz kindle
#

because discord is a good company :^)

winged mulch
#

Thank you

quartz kindle
#

👍

lyric mountain
#

better yet, receiving select menu CREATION events

quartz kindle
#

Lol

winged mulch
#

Oh and one more thing, is there anything I should know about when sharding?

#

Multiple connections to databases or something?

quartz kindle
#

should be fine to have one connection per shard

solemn latch
#

Hosting api's/dashboards at a bot level is a concern.

quartz kindle
#

if you write files you have to take special considerations

#

but dbs should do that for you

#

another thing is rate limits, each shard is only aware of its own rate limits, so if you do cross-shard operations, you have to take care of that

#

for example sending a message to a channel in shard 1, from shard 2

winged mulch
#

Ok

#

and message.channel seems to be null

#

or undefined

#
        return null
    }```
This seems to be triggering
quartz kindle
#

wut

#

from which event?

#

show the rest of the code

winged mulch
#

Nevermind it wasn't that. I accidentally removed the await channel.send part

quartz kindle
#

lel

slender thistle
#

I mean natively via Discord features

quartz kindle
#

ask discord :^)

slender thistle
lyric mountain
slender thistle
#

Yis

lyric mountain
#

there are many flaws, those are the ones I remember from the top of my head

slender thistle
#

Fuck that we want perks for boosters

lyric mountain
#

we want perks for bot devs

slender thistle
#

Discord does

#

I want just something convenient from Discord

#

Even allowing customization would be greatful

earnest phoenix
#

I just posted my bot, I'm so pumped, It's my first public one!

quartz kindle
#

congrats :)

boreal iron
simple stump
#

How would I check whether a message has an attachment? Tried this:

if (!message.attachments) {
  message.reply("Please attach an image to the message!");
} else {
  // do stuff
}

But it doesn't seem to work. I don't get the message, "Please attach an image to the message."

boreal iron
#

Therefore it’s always true

#

Check the collection size and there you go

simple stump
#

ah i see thanks. mb didnt read the docs closely

fringe hinge
#

Does anyone know how to make a leaderboard?

rose warren
#

Using a database

sudden geyser
#

Leaderboards are constructed from data.

fringe hinge
#

Like scoring points / hours

sudden geyser
#

You just need data.

#

e.g. adding points to users who talk

rose warren
#

You just store your points in the db and then get the top 10 or whatever for the leaderboard command

fringe hinge
#

Basically I want this

sudden geyser
#

What Mac said pretty much still applies

rose warren
#

The pagination part?

#

I don't understand what you need help with

fringe hinge
#

I’m basically asking how can I make one? Do I need like to program everything or does the bot program most of it??

rose warren
#

No you have to make it

fringe hinge
#

Ik the commands are !slut !work and !crime

#

But i’m not sure where to find the boy

#

bot*

rose warren
#

There might be some package you can use to do it depending on the lib your using

rose warren
fringe hinge
rose warren
#

Still

fringe hinge
#

Yeah I know once again sorry

fringe hinge
rose warren
#

It depends on what lib you use

fringe hinge
#

alright so last question

#

do you know any youtube videos which explain how ?

rose warren
#

No. I don't use YouTube tutorials.

fringe hinge
#

Ahh alright, Thanks though

earnest phoenix
#

Someone here know why tf my bot starts using tts without any reason? wtf

sudden geyser
#

No.

#

That's something you'll have to debug.

#

Maybe you enabled it by accident.

simple stump
#

Is it possible to check whether the attachment an user posted is an image or not?
Ex.

if (!message.attachments.first()) {
  message.reply("Please attach an image to the message!");
} else {
  // do stuff
}
pale vessel
#

You could check the extension but it won't guaranteed to be a valid image

#

You can fetch the attachment as buffer and check the magic headers

#

Or maybe load the attachment in canvas and make sure it doesn't error, to name a way

errant flax
#

if i did

while (condition) {
// code
}
console.log("a")

it will only log a if the loop is finished right?

errant flax
#

oh gud,
i can make like a repeat until statement kind of thing danceydance

earnest phoenix
#

mhm

long crow
#

If I used PUT method onto api, the other property which is not used by PUT will be ignored by receiving end? For example, I'm sending data [{name, description, options, type, guildOnly, cooldown }] where here guildOnly, cooldown is not required by the server.

rose warren
#

You're making slash commands?

#

They'll be ignored

long crow
#

Yup. Just wanted some confirmation, since I'm registering them using map with the extras, not like others who use array.

#

[{name:string, description:string, options:?[object], guildOnly:boolean, slashcommand:?Promise, selectmenu:?Promise, button:?Promise}] This is what I'm sending to discord API to be exact, lol. Using name as the key

vocal bridge
sudden geyser
#

Looks like a code block, but not sure

long crow
#

Markdown code block iirc

pale vessel
#

You could style a div also

#

Try <pre>

vocal bridge
#

Ok

twin jasper
#

anyone know how to track invite urls via a Ganalytics 4 property?

earnest phoenix
#

how to you make it that it requires mention then put into the embed

#

Requires you to mention someone?

#

yes

#

What language

#

then put into the mention and the user that used that command in and node.js

#

d.js?

#

discord.js

#

If so you can get the mention and use an if statement to see if they mentioned someone if not tell em to, if they do use it and put it in the embed

#

like for a hug command

#

Okay you can do this for any command

#

ok

#

Grab the mention and put it in a variable, use the variable to check if they didn't provide a mention in an if statement

#

something like

const member = <Message>.mentions.members.first()

if(!member) return <Message>.channel.reply('Provide a user you wanna hug')
#

ok

earnest phoenix
#

how to add the user mention to the embed?

#

const member = message.mentions.members.first()

if(!member) return message.channel.send
(${message.author} Provide a user you wanna hug)

#

i have this

#

just give it member

#

iirc it is a mention by default

#

const { MessageEmbed } = require("discord.js");
const { LOCALE } = require("../util/EvobotUtil");
const i18n = require("i18n");
const fetch = require('node-fetch');
const superagent = require('superagent')
const akaneko = require('akaneko');
const love = require("discord_love");
const { discord } = require("discord.js");

i18n.setLocale(LOCALE);

module.exports = {
name: "hug",
aliases: ["cuddle"],
description: i18n.__("Vote"),
async execute(message, args) {
let commands = message.client.commands.array();

const member = message.mentions.members.first()

if(!member) return message.channel.send
(${message.author} Provide a user you wanna hug)

const img = await love.hug()

let akanekoSan = new MessageEmbed()
.setTitle(${message.author} hugged ${message.guild.members.cache.get(args[0]) || message.mentions.members.first())})
.setColor("RANDOM")
.setImage(img)
.setFooter("yall look cute <3")
akanekoSan.setTimestamp();
return message.channel.send(akanekoSan);
}
}

#

here the code

#

@earnest phoenix

#

oh god

#

🤔

#

the error is the title

#

What is the error

#

Also use code blocks please

#

ok

#
 .setTitle(`${message.author} hugged ${message.guild.members.cache.get(args[0]) || message.mentions.members.first())}`)
#

this the error

#

well you have an extra )

#

relly

#

yes

#

problem

#

You can't mention people in titles I dont think

#

Has to be a description

opaque sentinel
#

Make it to description

#

And it’ll work

earnest phoenix
earnest phoenix
#

How do you create a table relation with pg sql queries

sudden geyser
#

@earnest phoenix are you looking for foreign keys (with REFERENCES)?

earnest phoenix
#

Yes I am

#

I found an example on the internet

#

umm is this a thing

client.users.cache.find(user => user.id === "user-id")
#

help

#

or should i use get

#

idk

#

help pls

#

imma try get

#

if you are going to use an id

#

just use get

delicate shore
#

hohohoh

#

it's me

earnest phoenix
earnest phoenix
feral aspen
#

This function isn't working in reactions.

promptMessage: async function(interaction, author, time, validReactions) {
    time *= 1000;

    for (const reaction of validReactions) await interaction.react(reaction);

    const filter = (reaction, user) => validReactions.includes(reaction.emoji.name) && user.id === author.id;

    return interaction
        .awaitReactions(filter, { max: 1, time: time})
        .then(collected => collected.first() && collected.first().emoji.name)
}

It used to be message instead of interaction but I replaced them, but I didn't think it would be that easy.

This is the code I did:

const m = await interaction.channel.send({ embeds: [mainEmbed] });
const reacted = await run.promptMessage(m, interaction.member, 30, reaction);

await m.delete(mainEmbed);

.. and the problem is that when I react with the reaction I specified, it is not deleting the embed.

I couldn't solve the issue, here's the code: https://sourceb.in/cZW3o1Ldj1

ancient falcon
#

would anyone know why /api/v9/applications/xxxx/guilds/xxxx/commands returns a 403 50001 Missing Access, when the application has access to the guild id provided

earnest phoenix
#

does it have the application.commands scope?

ancient falcon
delicate shore
#

pk

marsh bluff
#

How do I store a OAuth2 refresh token in cookies securely? If I enable httpOnly, then I can't access the token through node.js/React.

cinder patio
marsh bluff
#

I read a lot of guides yesterday but none of the described how to actually access a httpOnly cookie. How do I get it from the server?

cinder patio
#

like a normal cookie

#

if you're using express it'd be like req.cookies.someCookie

sacred aurora
#

but you need to use cookie parser

#

or something

marsh bluff
#

Yea I'm using a cookie parser

sacred aurora
marsh bluff
#

So the cookie is being sent with the request, I just can't access it otherwise, right?

cinder patio
#

the cookie is stored on the client, and sent with the request, yes

lethal trout
pale vessel
#

That's confusing

#

You're mixing sync methods with async

#

use a for loop

#

You can't use async in array.map()

earnest phoenix
#

forEach and async this never goes good 🤔

cinder patio
#

@drowsy crag

rose warren
#

Got it

near grotto
rare trail
#

dblpy is deprecated?

pale vessel
#

It's topggpy now

lethal trout
#

pls helpl

pale vessel
#

You posted that already

lethal trout
quartz kindle
#

did you set the command type?

long crow
#

Type Message doesnt have description

#

So is type User

tulip ledge
#

Bro clickyboys are sick

woven frigate
#

hey all!
i wanted to ask about that whenever I try to download one file from AWS S3 through console, I am getting following error:
can anyone help with it?
thanks in advance btw

opaque sentinel
#

Can anyone tell me what this means?

raise HTTPException(r, data) discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.

digital ibex
#

the error kinda explains it pretty well

#

very well actually

opaque sentinel
#

the bot just stopped working

digital ibex
#

because its been making too many requests, check your code maybe you have a loop which is always true or something. there are loads of possibilities

rose warren
#

Check your code and console. They don't rate limit people for fun.

#

And read the link to the docs in the error message carefully.

quartz kindle
#

did you try to mass dm people or mass assign roles for example?

opaque sentinel
rose warren
#

You have to check the headers

opaque sentinel
#

The bot is back online

rare trail
quartz kindle
#

the ban is usually 1 hour

quaint wasp
#

is it ligal or like is it against the rules to have google ads on github pages?

#

ping in replies

long crow
#

you can

#

How good is your front end? Me : Yes! Goddamit, it look dang horrible

quaint wasp
#

Idk.. based of a template thats modified like a bunch but no one can see the modifications lol

#

would it make since to do it there ? or.. should I make like ads sections lol

digital ibex
#

"If you are found to do so still, and we find out, you WILL have to PAY us $20 " lmao

digital ibex
quaint wasp
#

lol

quartz kindle
#

qunsequences

quaint wasp
#

I tryed my best spelling it

digital ibex
#

tryed

quaint wasp
#

and too laze to search up every word that idk how to spell

quaint wasp
quartz kindle
#

lazy*

quaint wasp
#

Is this grammer class... ?

long crow
#

grammer*

boreal iron
#

The grammar police is watching you!

quartz kindle
#

yes this is grammar* class

boreal iron
#

Don’t u know that’s the plural?

#

I, you, he/she/it grammer
We grammars

long crow
#

I thought it spell grandma

feral storm
#

anyone else having issues with shards launching? :/

rose warren
#

Are you getting errors in your logs?

feral storm
#

I get the 4th shard and it timesout

#

I check discord status for servers and they online

#

8.5k server 5 shard right? 1.5k per shard

rose warren
#

Unavailable guild maybe? Anything in your code that checks for guilds on startup?

feral storm
#

or is it 2,5k

rose warren
#

I usually keep it around 1k per shard

feral storm
#

Unavailable guild maybe? this is what I am thinking

rose warren
#

900 - 1,200 to be safe

feral storm
#

so 8.5k server 5-6 shards

#

give or take

rose warren
#

If you have anything that checks guild on startup just check if the guild is available before attempting to fetch the data.

feral storm
#

Why didn't I think of that ThroughFacePalm thank you

rose warren
#

Been there, done that, got the API ban to prove it 😂

#

Infinite error loop while I slept causing 1k reconnects and getting locked out for 72h.

feral storm
#

Oooof. Lets hope I ain't API Banned 🤦‍♂️

azure lark
#

why i am getting this error?

at RequestHandler.execute (/home/runner/Bot/node_modules/discord.js/src/rest/RequestHandler.js:172:15)```
novel jetty
feral storm
azure lark
feral storm
#

Hmm never used Repl. Sorry

quartz kindle
#

you need node 16.6

azure lark
#

And, is there any way i can change it to 16.6 using it?

quartz kindle
#

try forking mine

#

my method is a bit slow tho, but its the only way i found

azure lark
#

Okay.

#

Its bash?

quartz kindle
#

its nix

long crow
azure lark
# quartz kindle its nix
error: creating directory '/tmp/nix-shell-67-0': Disk quota exceeded

sh: node: command not found
nix error: building nix env: exit status 1
error: creating directory '/tmp/nix-shell-73-0': Disk quota exceeded```
quartz kindle
#

reload and try again

azure lark
#

Ok.

digital ibex
#

i just realised

#

theres a new node version like every 6 months

#

meanwhile im still on node 13 lol

novel jetty
#

How can i give e a value? Everytime a message gets deleted, the bot crashes

import Discord from 'discord.js'
import { Command, CommandProps } from '../@types'
import { client, db } from '../index'
let e: CommandProps
export async function messageDelete() {
  const {
      message
  } = e
  let channel = await db.fetch(`modlog_${message.guild?.id}`)
        if (!channel) return;

        const deleteMessage = new Discord.MessageEmbed()
            .setTimestamp()
            .setFooter(message.member?.user.username as string, `${message.member?.user.avatarURL}`)
            .setAuthor(`Message Deleted`)
            .setColor("RED")
            .addField("Deleted by", `${message.author} - (${message.author.id})`)
            .addField(`Deleted in `, `${message.channel}`)
            .addField("Content", message.content)

            var sChannel = message.guild?.channels.cache.get(channel) as Discord.TextBasedChannels
            if (!sChannel) return;
            sChannel.send({ embeds: [deleteMessage]})
}
digital ibex
#

literally just message.e = whatever

quartz kindle
#

what is that e supposed to do?

novel jetty
#

CommandProps

#

e is the CommandProps whcih im using everywhere

quartz kindle
#

and what are the command props?

#

where are they defined?

#

right now your e is empty, it only has a type but no value

novel jetty
#
import { CommandProps } from "../../@types";
near stratus
novel jetty
#

Hmm

quartz kindle
#

also, your messageDelete function has no aguments

#

how are you supposed to know which message it is about?

near stratus
#

wow
I'm fucked

quartz kindle
#

no it doesnt

quartz kindle
novel jetty
#

Hmm

winged mulch
#

Would this work?

export function getGuild(ID, client) {
    return new Discord.Collection().concat(...botSharder.manager.getClientValues("guilds.cache")).get(ID)
}```
#

Thats the code I came up with to get a guild with sharding

pale vessel
#

You can concat a map/collection?

winged mulch
#

Yes

#
2021-08-20T13:36:03.402Z Preparing to connect to the gateway...
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Response>".] {
  code: 'ERR_UNHANDLED_REJECTION'
}
/home/evan/node_modules/discord.js/src/sharding/Shard.js:160
        reject(new Error('SHARDING_READY_DIED', this.id));
               ^

Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.
    at Shard.onDeath (/home/evan/node_modules/discord.js/src/sharding/Shard.js:160:16)
    at Object.onceWrapper (node:events:514:26)
    at Shard.emit (node:events:394:28)
    at Shard._handleExit (/home/evan/node_modules/discord.js/src/sharding/Shard.js:392:10)
    at ChildProcess.emit (node:events:394:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) {
  [Symbol(code)]: 'SHARDING_READY_DIED'
#

I love sharding

lyric mountain
#

that error log...

#

I don't get why exposing the token on a log would be necessary

winged mulch
lyric mountain
#

ye but...why?

simple stump
#

How would I check whether the channel a message was sent in is in a category?
Ex.

if (message.content === `${prefix}score`) {
  if (!message.isInCategoryOrSomething() {
    // do stuff
  } else {
     return;
  }
}
winged mulch
#

Why cover it up when people know it?

lyric mountain
#

why show it in first place, that's my question

simple stump
#

alr ill take a look. thx

winged mulch
#

Its still in your message though

simple stump
#

yea its TextChannel#parent thanks

quartz kindle
lyric mountain
#

like, if you have access to the server you already have the token anyway, no need to add it to a log

winged mulch
#

I didn't add it to the log

#

discord.js does it by default

#

When printing the debug event

lyric mountain
#

djs is weird then

winged mulch
#

JS is weird

#

-this message has been brought to you by the Python gang

quartz kindle
#

raid shadow legends > python

sudden geyser
#

at least you don't get ads for one

winged mulch
#

I'm going to be honest, I switched to TS partly because I felt like I wasn't a "real" programmer if I programmed in Python

sudden geyser
#

Programming in Python is 100% acceptable.

#

TypeScript doesn't make you a better programmer.

#

But it's great to learn new things

winged mulch
#

So I don't have to change stuff

quartz kindle
#

if you want to be a "real programmer" you have to go for C/C++/rust

sudden geyser
#

According to whom?

quartz kindle
#

according to people who code in C/C++/rust

#

:^)

sudden geyser
#

begone seas and crabs

long crow
#

I code in html, I feel superior

cinder patio
#

oh my god

#

I finally understand what marked's doing

pale vessel
#

is it doing you rmom

#

Ok sorry

cinder patio
#

😩 yes

timber fractal
#

https://srcb.in/hjzmc4CP9i why at the console log at line 18 they are both undefined? if i check in the database they are there fixed

pale vessel
#

The ts problem you had or what?

cinder patio
#

nah just problems with custom marked extensions but I finally figured it out

winged mulch
sudden geyser
#

You're adding a lot of listener events somewhere (on process)

winged mulch
#

I'm not even adding listeners

sudden geyser
#

Your program is somewhere.

winged mulch
#

I guarantee you I never added 11 events to a shard

#

memory leak?

#

Like it said

quartz kindle
#

process listeners are added by broacaslEval and fetchClientValues

winged mulch
#

Yeah I added fetchClientValues

#

But its in a function

#
export function getGuild(ID, client) {
    return new Discord.Collection().concat(...client.shard.fetchClientValues("guilds.cache")).get(ID)
}```
#

So does that mean every time I call the function, a listener will be added?

quartz kindle
#

yes but its removed afterwards, unless you call it too many times at once, or its crashing

#

also, that code doesnt make sense

winged mulch
#

How does it not make sense?

quartz kindle
#

fetchClientValues returns a promise

winged mulch
#

Oh

quartz kindle
#

you're using the spread operator on a promise?

winged mulch
#

I thought it would return an array

quartz kindle
#

also, as i said before, thats a very inefficient way of doing it

#

you're transfering the full guild cache via ipc to get a single value from it every time

winged mulch
#

Whats a better way?

quartz kindle
#

broadcastEval

#

also, what are you using the returned guild for?

#

js has terrible support for serializing complex types

#

its always better to work with primitives

winged mulch
#

Its run in a setInterval

#

When the time is up

#

It gets the member

#

and tries to unmute them

quartz kindle
#

where is this code running? manager or shard 0?

worn sonnet
#

Hi

supple quest
#

its normal discord.js problem

#

put client.maxlisteners(0) at end at below of client.login

worn sonnet
#
for comment in reddit.multireddit('spez', 'fun').stream.comments():
   print(comment)
quartz kindle
supple quest
#

wait its not exact

worn sonnet
#

how can i generate this 'spez', 'fun' thing

supple quest
#

client.setMaxListeners(0)

#

this

quartz kindle
#

thats not a solution, thats hiding the problem

supple quest
worn sonnet
quartz kindle
#

yes you can

supple quest
quartz kindle
#

write correct code

supple quest
#

uh

#

why del

quartz kindle
#

dot posts are not allowed

worn sonnet
#

umm.. can anyone help me?

supple quest
slender thistle
winged mulch
slender thistle
#
def multireddit(whatever_string_1, whatever_string_2):
    ...
winged mulch
#

In setInterval

quartz kindle
#

without any shard check?

#

so its running in all shards?

supple quest
worn sonnet
#
subs = [x.strip() for x in sub_file.readlines()]

print(subs)
for submission in reddit.multireddit(subs).stream.submissions():
    print(submission)
#

i was doing something like this

quartz kindle
slender thistle
#

What package are you using?

worn sonnet
#

since you said it's something like *kwargs do i need to make a generator?

slender thistle
#

Hold on

worn sonnet
#

alr, i try what i can do for it

slender thistle
#

These docs are cancer at its finest

worn sonnet
slender thistle
#

Eugh. Time to read the source code

slender thistle
#

self.multireddit = models.MultiredditHelper(self, None)

#

Which dumbass does this?

worn sonnet
#
self.multireddit = models.MultiredditHelper(self, None)
        """An instance of :class:`.MultiredditHelper`.

        Provides the interface to working with :class:`.Multireddit` instances. For
        example you can obtain a :class:`.Multireddit` instance via:

        .. code-block:: python

            reddit.multireddit("samuraisam", "programming")

        """```
slender thistle
#

ikr

worn sonnet
#

the source code

worn sonnet
hot sleet
#

do "messageCreate" detect dm messages ?

worn sonnet
slender thistle
#

The event should listen to DMs too

worn sonnet
#

on_message should detect messages

slender thistle
worn sonnet
#

yeah i know

hot sleet
#

message was in discord.js v11 i think

slender thistle
#

What the hell is multireddit?

hot sleet
#

now its messageCreate and my bot now is not working with dm messages

slender thistle
#

Did you enable the DM messages intent?

hot sleet
#

................

#

hell

worn sonnet
#

go to developers portal

hot sleet
#

i hate v13

worn sonnet
#

and enable intents

hot sleet
#

im gonnad add that intents

slender thistle
#

You can't enable the DM messages intent via dev portal

#

@worn sonnet anyhoo if you want multiple multireddit shits use a for loop on each element in subs

#

If that's what you need

worn sonnet
#

but i think i will stick with it

slender thistle
#

That's what would happen under the hood anyway so

worn sonnet
#

yea

winged mulch
quartz kindle
#

if you are not doing any sort of shard check, then the code is running on all shards simultaneously

#

therefore you dont need broadcastEval nor fetchClientValues

#

just make a normal interval with normal code that checks if the guild exists and if member exists and do the job

winged mulch
#

I still need it for getChannel

hot sleet
#

i just added Intents.FLAGS.DIRECT_MESSAGES and still not getting dm messages !

winged mulch
#

I want to send a message in a channel when it joins and leaves a guild

#

So I still need it

quartz kindle
#

a fixed channel?

winged mulch
#

Yes

quartz kindle
#

that is not in the guild?

winged mulch
#

Not in the guild it's joining

quartz kindle
#

then use it for that only

#

use broadcastEval after you finish the job

#

just to send the message

rare trail
#
class Top(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.dbl_token = "token"
        self.dblpy = topgg.DBLClient(self.bot, self.dbl_token)
        self.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("path", "password")

    @commands.Cog.listener()
    async def on_ready(self):
        await self.topgg_webhook.run(port)
        self.update_stats.start()
        print(f"TopGG Loaded")

    @tasks.loop(minutes=30)
    async def update_stats(self):
        try:
            await self.dblpy.post_guild_count()
            logging.info(f'Posted server count ({self.dblpy.guild_count}), shard count ({self.bot.shard_count})')
        except Exception as e:
            logging.exception(f'Failed posting server count on top.gg: {e}')
#

wtf

hot sleet
#

guys my is not detecting dm messages

worn sonnet
hot sleet
#

and yes i add that intent

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES] });
#

and

client.on('messageCreate', async message => {

  console.log("HELLL")
.....
#

and its working with guild messages

worn sonnet
#

@slender thistle can't use for loop since the stream is continious and it won't complete the iteration

#

@hot sleet ```css
client.on('message', message => {
message.member.user.send(message.content).catch(console.error);
})

#

i just copy pasted it fom here

hot sleet
#

its old

#

now its client.on("messageCreate"........

slender thistle
#

Oh God

#

No clue then

#

Do you think you need reddit.subreddits instead?

worn sonnet
#

there is something like subreddits?

#

They didn't even care to mention it in PRAW models

quartz kindle
hot sleet
#

..

#

what is that ?

worn sonnet
quartz kindle
#

new Client({ partials: [ "CHANNEL" ], intents: [...] })

hot sleet
#

you know what

#

i hate discord.js v13
and new discord intents

quartz kindle
#

partials were already in discord.js v11 and v12

#

intents were already in v12 as well

hot sleet
#

ok my dm code was working good with v11

quartz kindle
#

because it used an old version of the discord api

#

when they didnt care about it yet

#

but now they do

#

so blame discord itself lul

hot sleet
#

eh i know

slender thistle
worn sonnet
#

something like this works

#

just need to add subreddit names and it works

acoustic reef
#

I'm doing global slash commands, but everytime I update slash commands/add new slash commands it says this
If I do guild slash commands, it updates within seconds

#

But it's supposed to be public

slender thistle
#

What...

#

Idk chief praw is wired

#

Weird

worn sonnet
#

Yes!
but you are the life saver man whenever i needed help you were there so thanks a lot

wheat mesa
acoustic reef
#

Uh no not really

#

I could try that

wheat mesa
#

I usually get that whenever I update a command and I don’t reload my discord

acoustic reef
wheat mesa
#

¯_(ツ)_/¯

wheat mesa
#

Global commands don’t update instantly

rose warren
#

There's a 1h cache

wheat mesa
#

Guild/DM commands do

#

If you’re testing a bot, I recommend testing in DMs

#

(Or guild specific if the command requires type to use it in a guild)

acoustic reef
#

it does update in dms yes

clever agate
worn sonnet
clever agate
#

he ignores me

#

don't want to reply to my message

#
import os
import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)
       

async def on_message(self, message):
        # we do not want the bot to reply to itself
        if message.author.id == self.user.id:
            return

        if message.content.startswith('!hello'):
            await message.reply('Hello!', mention_author=True)


client = MyClient()
client.run(os.environ['token'])```
sudden geyser
#

Your indentation seems to be off.

split hazel
# clever agate

when you talk to yourself and insert emojis it's a sign you're going insane from the bot

clever agate
#

sorry, i'm new to python

split hazel
#

that indentation looks fine

#

actually no

clever agate
#

he doesn't really answer me

split hazel
#

you have to indent the message def to align with the ready def

#

with all the contents of the function

clever agate
#

👍

split hazel
#

that way it's inside the class and discordpy can detect you're adding an event listener

clever agate
#

... ok

#

@split hazel tysm

coral scroll
#

...

H.E.L.P.

split hazel
#

firstly what line is that coming from

#

my intuition tells me you've messed up your json file somehow

earnest phoenix
#

does discord api allow u to get someones mail ID?

rose warren
#

Not without the email intent

#

But it's technically possible

winged mulch
quartz kindle
#

no

#

dont transfer the channel

#

do the operation in the target instead

#
broadcastEval((client, context) => {
  if(client.channels.cache.has(context)) {
    client.channels.cache.get(context).send("something");
  }
}, { context: ID });```
winged mulch
#

Oh

#

I see

#

Thanks

hollow depot
#

i'm in my command handler, i'm trying to make a help command that only takes a certain category. this is my code in the command:

const Discord = require('discord.js')
const fs = require('fs')

module.exports = {
    name: "categories",
    usage: "none",
    description: '[...]',
    aliases: [''],
    run(client, message, args, guildprefix){
        const funCommandFiles = fs.readdirSync('./fun').filter(file => file.endsWith('.js'));
        const commandsArray = [];
        for (const file of funCommandFiles) {
            const commandFile = require(`../commands/fun/${file}`);
            //my other code here, lol
        };
    }
  };```
i'm getting this error: `Error: ENOENT: no such file or directory, scandir './fun'`
even when these are my files: (the code above is in the categories.js file)
#

anyone can help?

jovial nexus
#

When i reply to a user with a button the emojis wont work, does someone know why?

#

Its only my client or is something with the bot?

rose warren
#

Without sharing any code we'll have a hard time helping you

jovial nexus
#

The code is ts button.reply.send('![success](https://cdn.discordapp.com/emojis/830860492112265217.webp?size=128 "success") OK')and the result is :success: OK and not success OK

quartz kindle
#

do you have permissions for external emojis?

jovial nexus
#

Does the bot need them when is a user interaction?

rose warren
#

Cool tip: Webhooks can use any emoji without the bot needing to share that server (unrelated to this but still)

jovial nexus
rose warren
#

Nope you need the perms Tim mentioned

jovial nexus
#

mhmmmm let me see

#

Ok, thank you!

#

didnt knew that...

#

It does has permissions

earnest phoenix
quartz kindle
# jovial nexus

does it work if you send it as a normal message instead of a button reply?

jovial nexus
#

its only in one server

quartz kindle
#

is the bot a member of the server where the emoji is from?

jovial nexus
#

yup

quartz kindle
#

you have to test with a normal message then

#

so see if the problem is the emoji or the reply function

hollow depot
quartz kindle
#

you're better off using absolute paths with process.cwd()

hollow depot
#

thanks, i'll try that

#

thanks, it worked

azure lark
#

how do i see who deleted a message/created a channel, ect with discord.js

earnest phoenix
azure lark
#

did that get updated with v13 or is it the same still?

earnest phoenix
novel jetty
#

Anyone know what this error means and how i can fix it?

Error: /app/node_modules/canvas/build/Release/canvas.node: invalid ELF header
quartz kindle
#

the file was compiled in the wrong system

#

you cant copy-paste node_modules

#

you have to reinstall them

earnest phoenix
#

at this point

#

i think he ruined it

#

so he has to re initialize the package too

#

but try to npm install first then if it doesnt work then you should re init

#

guys

#

cant i just edit some modules

#

this one has an unhandled error that ends the entire nodejs proccess

novel jetty
#

@quartz kindleI just reinstalled all the packages and also dotenv but it still says it cant be found

#

Nvm

#

I fixed it

winged mulch
#

Still have this problem:

#
export async function getChannel(ID, client) {
    const results = await client.shard.broadcastEval((client, ID) => {
        if(client.channels.cache.has(ID)) {
            return client.channels.cache.get(ID)
        }
    }, {context : ID})
    return firstTrue(results)
}```
#

I know I'm technically not suppost to return the object, but it still works

hollow depot
#

does anyone know why when in an embed description, when i set it to a JSON.stringify(someObject.map()) and in that map i put a \n it does not breakline?
for reference, this is what i mean

hollow depot
winged mulch
wheat mesa
#

You shouldn’t need to increase the maximum listeners if you’ve done everything right, that warning indicates a memory leak

winged mulch
quartz kindle
wheat mesa
#

You’re creating too many listeners somewhere

quartz kindle
#

i have a feeling you're using that more than needed

winged mulch
# quartz kindle how many times are you calling that function?
for(const item of x["entries"]) {
            const guild = await functions.getGuild(item["guildID"], client)
            if(guild) {
                const member = await functions.getMember(item["memberID"], guild).catch()
                if(item["time"] < new Date()) {
                    if(item["action"] === "unmute") {
                        if(member) {
                            if(await functions.unmuteMember(member)) {
                                await member.send(functions.createEmbed("You've been unmuted!", `You've been unmuted in ${guild.toString()}.`, variables.colors["green"], member.user, {name : "Reason", value : "Time out"}, null)).catch()
                            }
                        }
                    } ```
This is part of my code. The function is called every iteration, maybe thats why
quartz kindle
#

you have to add parameters for beautification

#

check the docs for json.stringify, i dont remember if its second or third parameter

hollow depot
#

thanks lol

quartz kindle
#

all using broadcastEval?

winged mulch
#

getGuild is, getMember isn't

quartz kindle
#

you have to rethink that, doing it like this is extremely inefficient

#

you're likely overloading the ipc connection

winged mulch
#

Anyway

somber pebble
#

guys

winged mulch
#

Thats the cause, isn't it?

somber pebble
#

how i can make this gui

#

with bot

quartz kindle
somber pebble
#

pls help

quartz kindle
#

when you are sharding, you are splitting your bot into multiple processes

somber pebble
quartz kindle
#

each separate process cannot access each others data

#

so they rely on sending messages to each other, which is what broadcastEval does

#

sending too many messages too fast is gonna overload it, like a DDOS attack

winged mulch
#

👀

quartz kindle
#

each broadcastEval sends a message to all shards

#

then waits for an answer from all shards

#

so each time you use broadcastEval you are already sending as many messages as the number of your shards times 2

#

if you use broadcastEval once on every shard, then you're sending shards x shards x 2 messages

winged mulch
quartz kindle
#

thats what im saying

#

rethink it

#

dont do it like that

#

dont get objects from one to another

#

whatever you need the object for, you can do it in a different way

winged mulch
#

hmmm

earnest phoenix
#

What exactly are they trying to do

winged mulch
earnest phoenix
#

so fetching multiple guilds at a time?

winged mulch
#

For an unmute timer

quartz kindle
#

again, why do you need the guilds

#

what are you doing with the guilds

#

whatever it is, you can do it without getting them

earnest phoenix
#

As long as you have their Ids you don't need anything else really

winged mulch
earnest phoenix
#

Store the mute timers with the guild id and just check if that guilds timer is up and unmute

quartz kindle
#

how do you unban the member

#

with a command?

earnest phoenix
#

then you can simply fetch the guild and unban

quartz kindle
#

what triggers the unban

winged mulch
#

Users can set an amount of hours

#

Lets say 5

quartz kindle
#

where does the timer come from

#

do you store the ban in a database?

winged mulch
quartz kindle
#

how do you retrieve it from the database

#

do you store the guild id in the database?

winged mulch
#

MongoDB's find method

earnest phoenix
#

so you are fetching all guilds

quartz kindle
#

do you have the guild id in the database?

winged mulch
#
export async function add(collection, key, value, ID) {
    return await collection.insertOne({"_id" : String(ID), [key] : value})
}

export async function remove(collection, key, value, ID) {
    return await collection.updateOne({"_id" : String(ID)}, {"$pull" : {[key] : value}})
}

export async function find(collection, ID) {
    return await collection.findOne({"_id" : String(ID)})
}

export async function update(collection, key, value, ID) {
    await checkIfKeyExists(collection, key, ID)
    return await collection.updateOne({"_id" : String(ID)}, {"$push" : {[key] : value}})
}

export async function erase(collection, ID) {
    return await collection.deleteOne({"_id" : String(ID)})
}
export async function modify(collection, key, value, ID) {
    await checkIfKeyExists(collection, key, ID)
    return await collection.updateOne({"_id" : String(ID)}, {"$set" : {[key] : value}})
}```
#

These are the functions I use to store

#

And remove

#

From the database

earnest phoenix
#

but do you add the guild id with the entry

quartz kindle
#

then problem solved

winged mulch
#

``` {"memberID" : member.id, "guildID" : guildID, "action" : "unban", "hours" : hours, "memberInfo" : ${member.username}#${member.discriminator}}

earnest phoenix
#

you'd wanna fetch by guild id then no?

quartz kindle
#

fetch all items from the ban collection where the guild id exists in your shard's list of guilds

#

then unban them locally

#

done

#

without a single broadcastEval

earnest phoenix
#

Mmm that works yea

#

hey tim what should I call my morse code bot

#

🤔

quartz kindle
#

morsecord?

#

lmao

earnest phoenix
#

omg

quartz kindle
#

dismorse

earnest phoenix
#

morsecord

quartz kindle
#

remorse

#

moose

earnest phoenix
#

poggers

hollow jasper
earnest phoenix
#

morsecord it is

#

ty tim

#

❤️

boreal iron
#

You know u have to pay $5 to Tim each time somebody calls his name?

quartz kindle
#

yes

#

gib moneys

boreal iron
#

capitalism anywhere pfff

quartz kindle
#

i am wolf of wallstreet

boreal iron
winged mulch
earnest phoenix
#

sorry tim im broke

#

unless you want pocket lint

lyric mountain
quaint wasp
#

What the heck does this require other than having embed perm..

#

it has embed perms, and send messages perms, but does not respond and says missing permissions

novel jetty
#

Any idea why the node_modules doesn't grey out when it's in gitignore? Everytime i push it, it goes with node_modules in my repo

round cove
novel jetty
#

Whats an IDE?

round cove
#

😦

earnest phoenix
#

restart vscode

#

lol

novel jetty
#

Ahh

earnest phoenix
pale vessel
#

VSCode is not an IDE

#

But it can be

earnest phoenix
#

Indeed

pale vessel
#

Extensions and stuff

earnest phoenix
#

yea

pale vessel
#

It's p versatile

earnest phoenix
#

I also just realized I might have an issue with this morse code translator

#

ffs

novel jetty
earnest phoenix
#

as I thought

#

you added the gitignore after you already published node_modules

#

just delete node_modules from the repo and from there on out it shouldn't push it

novel jetty
#

Ahh

earnest phoenix
#

also just a note, never add a gitignore file after running git add .

#

cause it won't register whats in it

#

idk if there is a way to fix that but I usually make sure I add a gitignore before running git add

#

I wonder if when translating morse code to normal english would I have issues? Cause the way I am defining the morse code letters there is a space between the dots and dashes, if someone were to not add a space would that cause issues since it wont find the letter in the map. Also I am wondering how I would go about making sure words are split up from each other so it doesn't look like a jumble up mess

novel jetty
#

Ok so i deleted node_modules from the repo and now trying to push with git push, but throws an errors saying Updates were rejected because the tip of your current branch is behind

earnest phoenix
#

Mmmm

#

I am not entirely sure from there.

#

Usually it doesn't give me that issue

quartz kindle
#

if you edit the repo you have to pull first

novel jetty
#

Ahh

earnest phoenix
#

I am wondering if for my second issue I can just enforce them using / between words in morse code

novel jetty
#

Now the node_modules folder is empty

#

Should i run npm i again to install all dep?

earnest phoenix
#

you will have to install again ig

#

yea

novel jetty
#

It works now

#

Thanks

earnest phoenix
#

np

quartz kindle
#

..- -.. .- . --.

winged mulch
#

I'm just going to go back to internal sharding until I recode how the bot works

novel jetty
#

What does this mean again?

Could not find a declaration file for module 'node-fetch'.
earnest phoenix
quartz kindle
#

spaces would be the word separators

earnest phoenix
#

mmmm

#

but heres the thing

#

that is extremely hard to enforce then

quartz kindle
#

you dont need to enforce them

earnest phoenix
#

cause they could do . . -

quartz kindle
#

you try to translate it anyway

earnest phoenix
#

and it wouldn't be found in the map

quartz kindle
#

and it will translate wrong

#

if its not in the map put an ? or something

digital ibex
earnest phoenix
#

Mmmm

simple stump
#

How do I send HTTP requests? I'm trying to get an user's UUID from Mojang API, but the console says that "fetch" is not defined.

let uuidURL = "https://api.mojang.com/users/profiles/minecraft/" + args[1];
fetch(uuidURL)
.then(res => res.json())
.then(data => console.log(data))
.catch(error => console.log(error));
earnest phoenix
#

Which ig it really is their fault if they fuck up

quartz kindle
#

well you could try some progressive combination checker but thats gonna be complicated

earnest phoenix
#

Yea

simple stump
#

mb sry

earnest phoenix
#

I don't know go enough to do that

quartz kindle
#

doesnt discord fuck up sometimes when you try to send multiple spaces?

#

. . - - . .

#

eh it works sometimes

#

you could try multiple passes

earnest phoenix
#

I am thinking about just using / instead of spaces

#

since it is easier to handle

quartz kindle
#

for example try once without spaces, if any unknow character was found, try again with spaces

earnest phoenix
#

anywhere I see a / I can just replace it with a space when returning the translation

quartz kindle
#

well its an option, just not very intuitive for the user

earnest phoenix
#

and anywhere they are going
"I like cats"
I can just put a / where the space is

#

true

#

I guess what I could do is just use spaces like you said, translate the letters and keep the spaces how they are

quartz kindle
#

you can also do something like space counting

#

if number of spaces is bigger than number of non-spaces, assume the user put spaces between the dots and dashes

earnest phoenix
#

🤔

quartz kindle
#

then try to use multiple spaces as a delimiter

earnest phoenix
#

huh

#

is this possible to get my server members activity ?

azure lark
#

is there a npm package that can help me making and use the dropdown menus

earnest phoenix
quartz kindle
#

it supports the two most common usage patterns

#

the user will either do this: ..- -.. .-. ...
or this . - . . . - - . . - -

#

if the user does the first, the number of non-space characters will always be bigger than the number of spaces

#

so you can go ahead and split by space

#

if the user does the second option, the number of spaces will always be bigger than the number of non-space characters

#

in that case, use a multi-space regex (2 or more spaces) as a delimiter

earnest phoenix
#

I don't even know how I would do that in go

quartz kindle
#

since you can safely assume the user wont think of putting more than 1 space between dots and dashes

#

that would be dumb

earnest phoenix
#

Yea

#

and if they do just put a ? if it can't be found

quartz kindle
#

ye

earnest phoenix
#

But anyway, I don't know how I would even start with implementing that in go

#

so for now that will be a nice thought

quartz kindle
#

it shouldnt be hard

#

you should have a way to count the number of specific characters in a string no?

earnest phoenix
#

Yea, Ima get the basis of it done and see about implementing that

#

I think we can use len

quartz kindle
#

then you should also have a way of splitting a string into an array or tuple based on a delimiter

earnest phoenix
#

yea using split

#

I would assume you can use split for this

quartz kindle
#

probably yes

earnest phoenix
#

I am not entirely sure

quartz kindle
#

you need to count how many spaces there are

#

and compare it with how many non-spaces there are

earnest phoenix
#

Mmmm

#

Yea I will figure this out when it comes to it

#

I just wanna get the basis done

quartz kindle
#

if go doesnt have a function to count instances of a pattern within a string, you can use a function to replace all instances of a pattern with nothing, and then use len() o that

earnest phoenix
#

Mmm yea I will see about that

#

thanks for the help tim

quartz kindle
#

👍

earnest phoenix
#

So first attempts didn't work

func Translate(text string) []string {
    var chars = strings.Split(text, " ")

    var translation []string

    for _, letter := range characters {
        for _, char := range chars {
            if char == letter {
                translation = append(translation, letter)
            }
        }
    }

    return translation
}

I was thinking this would work, but now that I think about it, it really wouldn't would it?

#

I get now why it won't work cause I am looping through my map of morse code characters so i am getting the values not the keys

novel jetty
#

How can i get my bots serving user count with the eval command?

wheat mesa
#

Loop through server count and add member count to a variable..?

earnest phoenix
#

Or

#

you could just get the users from client

#

ez

simple stump
#

I'm trying to extract this specific part of a really long string so I can get an user's Discord from Hypixel API.

socialMedia: {
    links: {
      YOUTUBE: 'https://www.youtube.com/channel/UCKtEdr9JvK48QubxBu_vNiw',
      DISCORD: 'Eltik#5776', <-----
      HYPIXEL: 'https://hypixel.net/members/eltik.3776101/'
    },
    prompt: true
  },

I can get the data, but extracting it stumps me. Since the string changes based on a player's stats, how would I check whether a player's Discord is set (whether it exists in the string) and if it does, get their Discord?

Code:

function getHypixel(uuid) {
    (async () => {
        const playerData = await hypixel.player.uuid(uuid);
        var str = player.toString();
        /*
        look for:
        "socialMedia": {
      "links": {
        "DISCORD": "Minikloon#0001"
      },
        */
    })();
}
lyric mountain
#

Like select count(1) from users

sudden geyser
#

player is probably an object, so you could just do player?.socialMedia?.links?.DISCORD

simple stump
#

Okay. Thanks!

earnest phoenix
#

hi

#

can i host my discord.js bot on a linux vps?

pale vessel
#

of course

wheat mesa
#

Yes

pale vessel
#

A linux VPS supports node

earnest phoenix
#

how? i buyed an ubuntu server from ionos and i don't know how to install node

pale vessel
#

Look up some tutorials online

#

Can you access SSH?

earnest phoenix
#

yes

pale vessel
#

Ah wait

#

That's old

earnest phoenix
#

ok

earnest phoenix
#

thanks

pale vessel
#

Don't pick option 1, that version of Node.js is outdated

earnest phoenix
#

and how to take it on 24/7?

#

because

wheat mesa
#

pm2 or some sort of other process manager

hot holly
#

FUCK YOU MAN FUCK YOU

wheat mesa
#

Ok

sudden geyser
#

Rude!

earnest phoenix
wheat mesa
earnest phoenix
#

how to let it on without the console opened

wheat mesa
earnest phoenix
#

ok thanks!

#

in the same vps can I host the bot and a website? or just the bot?

quartz kindle
wheat mesa
#

@earnest phoenix I don’t see why you couldn’t host a bot and a website, but just make sure that your VPS has enough resources to support both

hollow depot
#

in djsv13 client.voice.createBroadcast() is not a function... what can i do? found nothing online

#

sorry today i asked way too many things

earnest phoenix
#

voice is no longer part of the djs main module

#

it is its own package now

hollow depot
#

i actually aldready installed it

#

do i have to require it? @earnest phoenix

earnest phoenix
#

I have no idea how it works

#

But I would assume so

quartz kindle
#

there is a whole separate docs for djs voice afaik

earnest phoenix
#

really shit docs

#

but yes they exist

quartz kindle
earnest phoenix
#

if i close putty the bot goes offline

wheat mesa
#

¯_(ツ)_/¯

pale vessel
#

it should work

wheat mesa
#

Works fine for me

pale vessel
#

how are you starting the script?

#

pm2 start?

earnest phoenix
#

i installed it npm install pm2 -g

pale vessel
#

ah

wheat mesa
#

You have to start it using pm2

earnest phoenix
#

how

wheat mesa
#

pm2 start index.js

pale vessel
#

type the command

wheat mesa
#

(or whatever your startup args are)

earnest phoenix
#

right?

round cove
#

pm2 start index.js --name bot :%^)

wheat mesa
#

^^

wheat mesa
#

How do you normally start your bot without pm2?

quartz kindle
#

pm2 start index.js --name uvuvwevwevwe-onyetenyevwe-ugwemubwem-ossas

earnest phoenix
#

or node .

quartz kindle
#

then its correct

earnest phoenix
#

ok thanks

quartz kindle
#

try closing your terminal now

earnest phoenix
#

ok

#

thanks! it works!

opaque sentinel
coral scroll
split hazel
#

and what does the jason file contain

earnest phoenix
#

guys is there is any one help me ?

#

i have a problem ( The user aborted a request )

#

no error But this is bothering me and I want to solve it

#

i don't want to make a catch(err => 0) or else like this
i want to know Where does the error come from?

split hazel
#

assuming you're discord jsing i think that means that an api request took too long to send back a response

pale vessel
#

detritusing

earnest phoenix
#

@quartz kindle found another issue with the morse code translator I am making mmLol

#

Apparently you can use either _ or - for dashes

sudden geyser
#

are you doing some leetcode problem

earnest phoenix
#

In my map I am only using _ for dashes so if I were to use - it would not detect that it is a dash and thus ignore any letters that match with the correct combination of dashes and dots

earnest phoenix
simple stump
#

I'm trying to create an error message for when the bot doesn't have permission to change an user's nickname, but since the docs are down for me I can't check to see what the new Discord.JS methods are (or whether what I'm doing is incorrect or not). Here's my code:
https://sourceb.in/PtNLXAA3zE

sudden geyser
#

The documentation site is online.

simple stump
#

might just be me then idk

sudden geyser
#

Assuming you're on the stable branch, hasPermission is no longer a method. You can use .permissions.has(...) instead.

simple stump
#

alr thx

#

oh wait im dumb

#

its the browser lmfoa

sudden geyser
#

You don't need to find the role by ID either. You can just do .cache.get(...)

simple stump
#

just tried it on edge it works

snow vector
#

@knotty steeple

#

lets continue in here

pale vessel
#

@tiny mist

#

oh sorry

#

sorry Sammy

knotty steeple
#

sorry Sammy 😔 ✊

#

fiber is a web framework for go

#

static is static

#

i have this channel muted since all my js knowledge has just poofed

snow vector
#

so

#

what should i do if its like a linktree site

#

static?

knotty steeple
#

what does that mean christmasthink

snow vector
#

its just all my links

#

so i can have it in my socials bio

knotty steeple
#

actually why dont u just use linktree

snow vector
#

bc i dont like the logo

#

and i cant customize it

knotty steeple
#

ok

snow vector
#

and i cant have a custom domain

knotty steeple
#

anyhow u need some kind of webserver to serve that html

snow vector
#

whats a good one of those?

knotty steeple
#

idk

snow vector
#

like ovh hosting?

knotty steeple
#

@pale vessel backup

earnest phoenix
#

no a webserver is like express

knotty steeple
#

ovh is for vps' not webservers

#

unless they do that also idk man

earnest phoenix
#

koa, express, fastify those all create webservers

pale vessel
#

if your site is static just use GH pages lol

knotty steeple
#

or nginx

#

or github pages

#

just put it on github and enable pages

#

ezpz

snow vector
pale vessel
#

GitHub pages even supports static site generators like Jekyll

knotty steeple
#

yea bro just use github pages

snow vector
#

ok

long crow
#

Shall I post my awesome page on github page? var

knotty steeple
#

ok?