#development

1 messages · Page 1832 of 1

solemn latch
#

in a lot of cases I agree, but detritus's is quite good and powerful imo.

sudden geyser
#

Most wrappers go like that

#

Yes, but Discord.js is currently the most mainstream library. Though, one of the few things I like about the message intents update is everyone using the same command framework (slash commands)

sterile thicket
#

how can I refresh my command list

sudden geyser
#

Depends on what refresh means to you and what you're using

#

If you mean reload it

#

Then it depends on your language and how you loaded the command

sterile thicket
#

I use command handler

#

and added slash commands

#

but the first time I use bot on slash after the bot starts, I get an error Invalid interaction application command

sudden geyser
#

Be specific

sterile thicket
#

after that it works fine

split hazel
#

why does everyone get wet over detritus

#

at that stage you might as well just make your own websocket connection and api requests

sudden geyser
#

It does a lot of stuff right for them

split hazel
#

ah it does provide a lot of abstraction

#

nevermind

sterile thicket
sudden geyser
#

But I find that too many libraries and frameworks are concrete and just easy rather than simple so it comes back to haunt them later

sterile thicket
#

basically, I'm using slash command.
When I first use the bot on slash after it starts, it shows an error Invalid interaction application command
But after that, it works fine...
Can anyone help?

long crow
#

^ Is that global command?

sterile thicket
#

yes

long crow
#

Then it is is expected behaviour when you set it for first time or doing it on every time you reboot bot

#

where command will re-register to discord

sterile thicket
#

how can I make it register when the bot starts?

long crow
#

You don't, only register it once

sterile thicket
#

so that it doesn't give the error the first time

long crow
#

dont register it everytime restart

sterile thicket
#

how can i make it happen?

long crow
#

you can do deploy command via the normal message command

#
module.exports = {
    name:'deploy',
    description: 'Deploy global slash command(s)',
    guildOnly:true,
    owner:true,
    /**
   * @param {import('discord.js').Message} message
   */
    async run(message) {
        // @ts-expect-error
        const { SlashCommands } = message.client;
        const guildCommand = await SlashCommands.get('deploy');
        await message.client.application.commands.create(guildCommand, guildCommand.guildId);
        message.channel.send({ content:'Done' });

    },
};``` This I do to register my `/` command for deploying
#

then after it I can deploy from my /deploy after it registered

sterile thicket
#

is there a way to auto deploy, bc I use a free host service and the bot restarts randomly

grim sundial
#

what do u mean auto deploy

sterile thicket
#

so that I don't have to use command but it'll still work

grim sundial
#

what

sterile thicket
#

is there any after(ready) thingy?

grim sundial
#

i dont get it

long crow
#

you only need to deploy once. then the command will stay on discord db

grim sundial
#

just do it when on the ready event?

sterile thicket
#

ok thank you very much for your time

lyric mountain
#

discord loves to randomly disconnect you, thus calling onReady again

#

and onReady is called for every single time a shard (re)connects

#

this can easily make you hit command update ratelimit

#

@sterile thicket ^ read this too

tulip ledge
#

Thats why you want to implement a function to compare the code of the original command and the command you’re registering

slender thistle
#

Why can't Discord dispatch RECONNECT?

tulip ledge
#

At least thats how I do

lyric mountain
slender thistle
#

True lol

lyric mountain
#

discord actively competes with riot for messiest codebase

slender thistle
#

What I don't get is why they disconnect you in the first place

#

One reason I fucking hate working with Discord API lol

#

Alright, multithreading is already feeling like pain to do

#

Or... let's see how my program does without it

#

What are you trying to require

lyric mountain
slender thistle
#

Selenium!

lyric mountain
#

no I mean, WHAT exactly

slender thistle
#

A function that utilizes Selenium in Rust

#

idk how more precise it can get KEKW

#

It automates logging in via few accounts and doing stuff with them

#

What's your filetree like?

#

God, how do I chunk my MappedRows now, ffs

#

Where in your code does it happen?

#

Can you send the full traceback?

#
91 |                     .chunks(2);
   |                      ^^^^^^ method not found in `MappedRows<'_, [closure@src\structs.rs:83:36: 89:22]>`

upsideThink pain

#

Full traceback could help someone who is actually proficient in JS

solemn latch
#

its used for image modification

solemn latch
#

tbh, the error explains everything.

#
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
primal plinth
#

Hey, I have a problem, I'm doing the welcome system but when someone enters any server, it appears on all servers, could someone help me?

#

,.,

#

somebody?

split hazel
#

on all servers?

#

how did you even achieve that by accident

wooden dust
#

Yeah lmao how'd that happen

primal plinth
#

It is not that I have the guildMemberAdd in event, so when someone joins in any server it is sent to all servers

#

Well, I do not know

wooden dust
#

are you using djs

primal plinth
#

yes

#

So how could I make that not happen?

wooden dust
#

Are you thinking about having the channel set on a db

#

for each server

primal plinth
#

Do you think I did not make a database?

#

Not even that.

wooden dust
#

So you did

primal plinth
#

yes

wooden dust
#

Haven't used djs yet but couldn't you just get the guild id of the server, search with that on the db and then collect the channel id and send it into there

primal plinth
#

I'll try.

grim sundial
split hazel
#

@primal plinthor just show us your code

kindred ridge
#

i changed bot name and picture but didn't change in top.gg

grim sundial
primal plinth
#

thats

#

wait

#

i forgot something

split hazel
#

idk if it still works

primal plinth
primal plinth
kindred ridge
grim sundial
primal plinth
#

I am with the welcomes but when someone enters any server they send the welcome message to all the servers

grim sundial
#

oh

#

uh

#

r u listening to the guildMemberAdd event yeah?

hot star
#

anyone have heroku discord server invite?

solemn latch
#

heroku has a discord?

hot star
#

I got locked out of my account and 2FA is not working

hot star
solemn latch
hot star
#

I have to login for support also

#

but i can't login that's the problem

solemn latch
solemn latch
#

oh weird

hot star
#

😩

solemn latch
#

didnt for me and i dont have heroku

#

try visiting in incognito

hot star
#

so much work T_T

solemn latch
#

tbh, on discord if you get locked out of 2fa you just lose the account.
👀

solemn latch
#

ye

hot star
#

9 or 12 of them

solemn latch
#

99% of users dont save them anywhere

hot star
#

but in heroku they give you .txt file when u enable 2fa and i lost that file also

summer torrent
#

any prisma users here?

split hazel
#

i save all my 2fa codes

#

otherwise you're royally fucked

#

always save them somewhere in the cloud

hot star
nocturne grove
#

Is it possible to use those external link buttons together with interactions? As it says data.components[0]: The specified component type is invalid in this context
But maybe I'm doing it wrong

tawny rune
#

Anyone who uses dpy, and was able to use slash commands?

tawny rune
#

Or?

lyric mountain
#

maybe, that's the first thing that popped when I seached "discord.py slash commands"

tawny rune
#

Also, this:

NameError: name 'slash' is not defined
earnest phoenix
earnest phoenix
#

it could be console.log(slash) too which leads to the same error, so you have to be a little more specific

restive furnace
#

python... not js

umbral lake
#

My error: ```
C:\Users\asus\Downloads\test\node_modules\discord.js\src\rest\RequestHandler.js:154
throw new DiscordAPIError(request.path, data, request.method, res.status);
^

DiscordAPIError: Missing Access
at RequestHandler.execute (C:\Users\asus\Downloads\test\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async RequestHandler.push (C:\Users\asus\Downloads\test\node_modules\discord.js\src\rest\RequestHandler.js:39:14)
at async GuildMemberRoleManager.add (C:\Users\asus\Downloads\test\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:96:7) {
method: 'put',
path: '/guilds/840984159618990113/members/681407594354573312/roles/851390008086626314',
code: 50001,
httpStatus: 403
}

My bot is admin and its my code: ```
client.on("presenceUpdate", async (oldPresence, newPresence) => {
    if (!newPresence.activities[0]) return
    if (!newPresence.activities[0].state) return
    const guild = client.guilds.cache.get("848100598908846110")
    const role = guild.roles.cache.get("851390008086626314")
    if(newPresence.activities[0].state.includes(".gg/aruna")) {
        newPresence.member.roles.add(role)
    } else if(oldPresence.activities[0].state.includes(".gg/aruna")) {
        if(!newPresence.activities[0].state.includes(".gg/aruna")) {
            newPresence.member.roles.remove(role)
        }
    }
});
nocturne grove
#

maybe the other role is higher than the bot's highest role

#
const { MessageButton } = require('discord-buttons');
client.api.interactions(interaction.id, interaction.token).callback.post({ data: {
    type: 4,
    data: {
        components: [ new MessageButton().setStyle('url').setLabel('Google').setURL('https://google.com') ]
    }
}});```
How can I fix ```DiscordAPIError: Invalid Form Body
data.components[0]: The specified component type is invalid in this context```
tulip ledge
#

new MessageActionRow().addComponents(new MessageButton()…)

nocturne grove
#

@tulip ledge thanks! Now it says data.components[0].type: Value "ACTION_ROW" is not int.

tulip ledge
#

Huh.

nocturne grove
#
const component = new MessageActionRow().addComponents(new MessageButton().setStyle('url').setLabel('Google').setURL('https://google.com'));
#

oh that doesn't have anything to do with this line

tulip ledge
#

Its where u send it

#

Issue might be with discord buttons, I just use the built in methods of djs

nocturne grove
#

is there a built in method? Ohh, then I will use that one

tulip ledge
#

Might be dev only tho

#

Dev version

arctic notch
#

`

nocturne grove
#

hmm oh yes I think so too
console.log(Discord.MessageButton) is undefined for me

tulip ledge
#

U can just say
import { MessageButton, MessageActionRow } from “discord.js”

#

Ye

#

Its dev then

nocturne grove
#

yes so I got this now to try it out, before doing it with interactions, but it's only sending the content

const { MessageButton, MessageActionRow } = require('discord-buttons');
const component = new MessageActionRow().addComponents(new MessageButton().setStyle('url').setLabel('Google').setURL('https://google.com'));
client.channels.cache.get(interaction.channel_id).send('hi', { components: [component] })```
#

very ugly, but just to try

tulip ledge
#

Can u show the error again

nocturne grove
#

no error with these lines

#

console.log(component):

MessageActionRow {
  type: 1,
  components: [
    {
      type: 2,
      style: 5,
      label: 'Google',
      emoji: undefined,
      disabled: false,
      url: 'https://google.com',
      custom_id: undefined
    }
  ]
}```
tulip ledge
#

I cant help anymore, entering al elevator, then going to the shop, sorry bro

nocturne grove
#

no problem, thanks for your help

#

will go now too, but any help still welcome 🙂

tawny rune
#

I was just using the test code

restive furnace
#

wrong.

#

where's slash declared even

tawny rune
#

Yeah, please ignore that ss

#

I got it to work

#
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction```
I get this now
feral aspen
#

Hey, quick question.

#
let text = "<h1>Winter is coming</h1>";
let myRegex = /<.*?>/; // Change this line
let result = text.match(myRegex);

console.log(result); // ["<h1>"]

How does this return <h1>.. in the regex, I was supposed to make it /<.1*?>/ not /<.*?>/.

quartz kindle
#

what do you want it to return?

feral aspen
#

The regex, based on my understanding, has it start with < then a . which is known as a wildcard period.. but where's the 1?

#

Create an embed.. and put the invite link there.. or a command that sends a message containing the invite link.

#

Show your code.

#

.. wait.. I have a question. If it was this.

let text = "HamoodiHajjiri";
let myRegex = /H.*?i/; // Change this line
let result = text.match(myRegex);

console.log(result); // ["Hamoodi"]

.. so the regex is finding anything that starts with H and then a character from [a-z] meaning even though I don't add the . or the [a-z].. it will still send, right?

nocturne grove
#

about the discord.js dev version: is it easy to get that version and does it break any working things in the stable version?

quartz kindle
nocturne grove
nocturne grove
quartz kindle
#

wdym bugs?

#

it changes a lot of existing things, so if you dont change your code to the updated versions, it will likely break things

feral aspen
#

Tim, quick question.

#

What does the . symbolize in the regex I mentioned in this example.

let text = "HamoodiHajjiri";
let myRegex = /H.*?i/; // Change this line
let result = text.match(myRegex);

console.log(result); // ["Hamoodi"]
#

.. does it mean all the characters in between the start from and the ends with?

#

. as in [a-z]

nocturne grove
nocturne grove
sacred aurora
quartz kindle
nocturne grove
#

hm okay
But it will better support slash commands and message components right?

quartz kindle
#

yes it has built in support for them

#

and they should be in a working state

nocturne grove
#

okay that's awesome

quartz kindle
#

which discord.js version did you install?

#

did you install opus?

nocturne grove
#

hm my discord.js version won't update. I uninstalled and installed it again, but it's still 12.5.3

quartz kindle
jolly vale
#

do you guys have something where i can host my bot 24/7 for free

jolly vale
#

ok thanks

feral aspen
#

👍 👍 👍

feral aspen
nocturne grove
quartz kindle
#

doesnt work how

#

error?

#

or still v12?

earnest phoenix
nocturne grove
#

still v12

#

sorry

quartz kindle
#

delete your node_modules and your package-lock.json

#

and install again

jolly vale
nocturne grove
earnest phoenix
#

Express replit

#

Ez bz

#

⣿⣿⣿⣿⣿⠟⣩⣴⣶⡶⣶⣲⡶⠶⣶⠶⣶⣶⣖⣀⣉⣭⣉⣛⠻⢿⣿⣿⣿⣿ ⣿⣿⣿⡿⢃⣾⣿⣻⣟⢮⣿⣮⣽⣿⣿⣻⣿⣿⣶⡲⣾⣿⣿⡳⣿⣶⡌⢿⣿⣿ ⣿⣿⠟⢡⣾⣿⣿⢿⡷⠋⠉⠉⠩⣭⣙⠻⣿⣿⣿⡿⠟⠛⠛⠻⡿⣿⣿⣘⢿⣿ ⡟⣡⣵⠟⣩⡭⣍⡛⠿⠶⠛⣩⣷⣶⣬⣴⣿⣿⣦⠠⣶⣶⣾⣿⠿⠛⠿⡪⣧⢸ ⡇⣿⣿⢘⣛⠁⣬⣙⠛⠿⣿⣛⣻⡝⢩⠽⠿⣿⣿⣶⠍⠻⢷⣶⣾⠹⣿⣣⡟⢸ ⣷⣌⠮⢾⣿⣷⡈⣙⠓⠰⣶⣦⣍⢉⣚⠻⠿⠿⠭⠡⠾⠿⠟⣊⢡⠁⢱⡿⢰⣿ ⣿⣿⣷⡙⢿⣿⣷⣌⠓⣰⣤⣌⡉⡘⠛⠛⠓⠘⠛⠂⠚⠛⠂⠛⠈⠄⢸⡇⣿⣿ ⣿⣿⣿⣷⣌⠻⡿⣿⣿⣦⣙⠛⢡⣿⣿⣷⠄⣦⣤⠄⣤⠄⡤⢠⡀⢢⣿⡇⣿⣿ ⣿⣿⣿⣿⣿⣷⣬⣑⠻⢷⣯⢟⣲⠶⣬⣭⣤⡭⠭⠬⢭⣬⣥⣴⢶⣿⣿⣧⢸⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣍⡓⠿⢿⣤⣿⣿⣟⣛⣿⣿⣿⣷⣛⣿⣾⡿⣸⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣬⣭⣙⣛⡛⠿⠿⠿⠿⠿⢟⣋⣴⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣬⣭⣙⣛⡛⠿⠿⠿⠿⠿⢟⣋⣴⣿⣿

boreal iron
#

@quartz kindle Some necessary changes in v13 have been made as I can see.
Great property names changes (for example ownerID to ownerId)
god damn...

earnest phoenix
boreal iron
#

huh which new verification form?

pale vessel
#

Did they not realize ID is a valid word

nocturne grove
#

yup 😂

pale vessel
#

I don't like that change

boreal iron
#

now I have to fucking take a look at the docs for any damn property

nocturne grove
#

and I can't even update to v13 ...

jolly vale
earnest phoenix
#

Bot verification form

#

They upgraded it

boreal iron
#

The server region doesn't seem to be available anymore, too, at least I can't see it inside the guild obj.

nocturne grove
#

@quartz kindle is there anything that should be enabled or something in order to have v13? Or a node version? I have Node 14.15.4 so that should be good

earnest phoenix
nocturne grove
nocturne grove
earnest phoenix
#

Now u don’t have to spam no 100 times

quartz kindle
earnest phoenix
#

Place holder for forms makes it easy to understand what question means what

quartz kindle
#

you still cant install it?

#

show your npm install logs

earnest phoenix
#

What you talking about timmey

nocturne grove
#
npm WARN nobotesterbot@1.0.0 No repository field.

+ discord.js@12.5.3
added 15 packages from 18 contributors and audited 194 packages in 1.593s

39 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities```
oh I see it has a warning but idk
#

or isn't this what you mean

quartz kindle
#

show the command you ran

nocturne grove
#

edited ^

earnest phoenix
#

I see you probably a discordjs newbie

quartz kindle
#

did you not do npm install discordjs/discord.js?

earnest phoenix
#

Also Js

#

Please learn basic Js 😭

nocturne grove
nocturne grove
quartz kindle
#

show the install log from discordjs/discord.js

earnest phoenix
#

Then why can’t you install a simple package

regal creek
#

Im bored anyone need help

nocturne grove
#
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/discordjs/discord.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\menno\AppData\Roaming\npm-cache\_logs\2021-08-04T18_02_45_542Z-debug.log```
boreal iron
# earnest phoenix

Looks like these changes have been made recently.
Before my bot got verified I got asked about details regarding the infos you can now find in the new select options etc.

quartz kindle
#

thats the problem

#

you need to install git

earnest phoenix
#

Yea

#

Obviously

nocturne grove
feral aspen
#

The Message Developer Q&A has begun. 🎉

earnest phoenix
#

npm install discordjs@latest

quartz kindle
#

because that is written to be the future stable version

#

not a dev version

#

to install dev versions you always install it directly from the github master branch

boreal iron
nocturne grove
#

ohh I didn't know that, thanks
and that's why you do npm install discordjs/discord.js instead of npm install discord.js?

quartz kindle
#

yes

nocturne grove
#

okay

quartz kindle
#

username/package installs from github
package installs from npm

nocturne grove
#

ohh right

quartz kindle
#

you can also try what fake said

nocturne grove
#

oh wait git is not a npm package right

quartz kindle
#

no

nocturne grove
#

and with FakE's option I don't need to install git from the internet?

boreal iron
#

haven't installed git as well, that's why you can install it how I said, too

quartz kindle
#

apparently yes, try it

boreal iron
nocturne grove
#

awesome, it's changed!

#

but package.json now has the url as the version, is that right?

quartz kindle
#

yes

#

because dev versions dont have a fixed versioning

#

it simply means "always download from this url"

#

meaning its always the latest possible version

#

(including broken/experimental stuff)

nocturne grove
#

ohh

#

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
there we go again lmao

quartz kindle
#

yes

#

thats in the v13 changes guide

nocturne grove
#

yes shouldn't be too hard to fix those things, it's all nicely documented

#

fixed topggSunglasses

quartz kindle
#

👍

nocturne grove
#

really thanks for the help, everyone who helped me!

boreal iron
#

I've noticed the GUILDS intent doesn't include the members anymore?

#

The member collection only includes bots... huh

nocturne grove
#

huhh

#

I'll check if I have that too

#

@boreal iron for me it's working

boreal iron
#

weird

nocturne grove
#
const g = client.guilds.cache.get(interaction.guild_id);
await g.members.fetch()
console.log(g.members.cache.size)
// => 12

and 12 members in the guild

#

oh wait I don't know if this is correct

boreal iron
#

oh... you're fetching the members

nocturne grove
#

does it matter that this bot isn't verified?

nocturne grove
#

always has been like that for me

boreal iron
#

yeah, somehow my cache doesn't show up any member except the bot

nocturne grove
#

oh wait

#

it does cache me
But it does that after the second time I send an interaction which is weird

frail zenith
#

how can i make sure my day command doesn’t @ everyone?

vivid fulcrum
#

in which library

frail zenith
#

discord.js

digital ibex
#

nvm

nocturne grove
#

👀

earnest phoenix
frail zenith
earnest phoenix
frail zenith
#

tyyyyy

earnest phoenix
#

np

frail zenith
#

was looking for something w the wrong name in the docs

earnest phoenix
#

lol

signal estuary
#
client.user.setActivity("Managing B. Support", { type: "STREAMING" })

Why will this shown as "Playing Managing B. Support"?

earnest phoenix
#

v12?

lyric mountain
#

it'll always show activity + message

sudden geyser
signal estuary
sudden geyser
#

To some Twitch stream

signal estuary
#

How is the event called when a member leaves? GuildMemberRemove?

sudden geyser
#

lowercase g

signal estuary
signal estuary
#

"guildMemberRemove"

sudden geyser
#

Do you have the intent enabled on the developer portal and when initializing your client

signal estuary
sudden geyser
#

and in your source code

signal estuary
# sudden geyser and in your source code
var Discord = require('discord.js');
const client = new Discord.Client({ intents: ['GUILDS', 'GUILD_MESSAGES'] })
module.exports = {
    name: 'guildMemberRemove',
    async execute(member) {
    }
})
sudden geyser
#

that's probably your problem

#

are you trying to create a new client and listen for events from it

#

rather than using your existing client

signal estuary
sudden geyser
#

For example, listening to member.client.on(...)

#

ah I see now

#

You need to include the GUILD_MEMBERS intent.

#

In your original client initialization.

#

You can't just create a new client instance like that

signal estuary
sudden geyser
#

Do you get the events now?

signal estuary
#

all events are working fine excpept of this one

sudden geyser
#

Can you show what your event handler looks like?

signal estuary
#

guildMemberAdd does work fine too

signal estuary
sudden geyser
#

Hmm, it looks correct at glance.

signal estuary
#

I am on v13 dev

earnest phoenix
#
    let starboardChannel = reaction.message.guild.channels.cache.get('<ID>');
    let starboardFetch = await starboardChannel.fetch({limit:100})

    let exists = starboardFetch.message.cache.find(m => m.embeds.length >= 1 && m.embeds[0].title === '⭐ Starboard' && m.embeds[0].fields[0].value.match(reaction.message.id));

why do i get this error:
(node:9660) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined (on the let exists)

signal estuary
lyric mountain
earnest phoenix
zinc talon
lyric mountain
earnest phoenix
#

so much it covered my entire console and i cant see anything about it lmao

lyric mountain
#

show how you're doing it

earnest phoenix
#
    let starboardChannel = reaction.message.guild.channels.cache.get('871766974236098640');
    let starboardFetch = await starboardChannel.messages.fetch({limit:100})
    console.log(starboardFetch);
    let exist = starboardFetch.cache.find(m => m.embeds.length >= 1 && m.embeds[0].title === '⭐ Starboard' && m.embeds[0].fields[0].value.match(reaction.message.id));

this is it really

lyric mountain
#

remove .cache

#

collections don't have a cache

#

you already fetched those messages

earnest phoenix
#

welp

#

(node:48864) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 messageReactionAdd listeners added to [Client]. Use emitter.setMaxListeners() to increase limit (Use `node --trace-warnings ...` to show where the warning was created)

#

even more errors lol

lyric mountain
#

...are you adding listeners inside commands?

earnest phoenix
#

wait omg

#

bbbb i fixed it

digital ibex
#

idk if im being stupid or what

#

like uh

#

(the names dont matter cuz i changed the code after)

lyric mountain
#

did you wait at least 1 hour?

digital ibex
#

you dont need to for guild slash commands

#

and even if i had to, it would create the command as a whole, it won't leave out the options but send the name and desc

wheat mesa
#

Test in DMs

#

Best way to do it imo

digital ibex
#

same

#

what is that gonna change btw?

wheat mesa
#

Probably nothing, just giving general advice

#

Loads instantly (as long as your reload your discord)

boreal iron
#

As we figured out these days having the same issue clear your browser cache

#

ALL of the Discord cache

#

And/or try the commands on mobile

tawdry talon
digital ibex
#

would it be possible for someone to make a thread on my issue btw

#

?

signal estuary
#

Index:

let set = new Set()
client.on('message', msg => {
    if (msg.member.user.bot === true) return
    let  functions = require('./function')
    functions.spamCheck(msg, set, 10000)
})

function.js

function spamCheck(msg, set, time) {
    let bool = false 
    let user = { id: msg.author.id, time: Date.now(), times: 2 }

    for (let u of set) {
        if (isNaN(u.times)) u.times = 2
        if (u.id === msg.author.id) {
            bool = true 

            if (u.times >= 5) {
                msg.reply(`Woah, not so fast!`)
            } else if ((Date.now() - u.time) <= time) {
                u.times++
                u.time = Date.now()
            }
        }
    }
    if (bool === false) {
        set.add(user)
    }
}

Error:

TypeError: functions.spamCheck is not a function
wheat mesa
#

Are you exporting the function?

#

ex ```js
// index.js
let functions = require('./function.js')

functions.myFunction()
js
// function.js
module.exports = {
myFunction() {
console.log("My Function used in a separate file!")
}
}

digital ibex
signal estuary
#

I linked the file and defined it as functions

wheat mesa
#

You’re not exporting it

signal estuary
#

import "./functions"?

wheat mesa
#

You need to export it to use in other files afaik

signal estuary
signal estuary
wheat mesa
#

In that example, index is just whatever file you need to use the function in

#

Also you should use require at the top of your code unless you’re dynamically loading something

wheat mesa
#

What?

signal estuary
#
const  functions = require('./functions')
wheat mesa
#

Yes

#

You should do that at the top of your file, rather than in an event

signal estuary
wheat mesa
#

Because you’re not exporting the function

#

Export the function

signal estuary
#

where?

wheat mesa
#

That’s a way of exporting your function from that file

signal estuary
# wheat mesa Look at this, you see where it says `module.exports =`?
module.exports = {
    myFunction() {
        console.log("My Function used in a separate file!")
        function spamCheck(msg, set, time) {
            // if (msg.member.roles.cache.find(role => role.name === 'Muted')) return
        
            let bool = false // the bool will be set to true if a member was found in the set object
        
            // 'times' is the amount of messages
            let user = { id: msg.author.id, time: Date.now(), times: 2 }
        
            for (let u of set) {
                if (isNaN(u.times)) u.times = 2
        
                if (u.id === msg.author.id) {
                    bool = true 
        
                    if (u.times >= 5) {
                        msg.reply(`Woah, not so fast!`)
      
                    } else if ((Date.now() - u.time) <= time) {
                        u.times++
                        u.time = Date.now()
                    }
                }
            }
            if (bool === false) {
                set.add(user)
            }
        }
    }
}

Like this?

wheat mesa
#

No

#

You don’t need myFunction()

#

That was just an example

#

Also when you’re in the scope of module.exports you don’t need to define your function with the function keyword

#

Instead of function spamCheck(), it would be spamCheck()

signal estuary
# wheat mesa Instead of `function spamCheck()`, it would be `spamCheck()`
module.exports = {
    spamCheck(msg, set, time) {

        let bool = false
        let user = { id: msg.author.id, time: Date.now(), times: 2 }

        for (let u of set) {
            if (isNaN(u.times)) u.times = 2
            if (u.id === msg.author.id) {
                bool = true

                if (u.times >= 5) {
                    msg.reply(`Woah, not so fast!`)
                } else if ((Date.now() - u.time) <= time) {
                    u.times++
                    u.time = Date.now()
                }
            }
        }

        if (bool === false) {
            set.add(user)
        }
    }

}

like this?

wheat mesa
#

Yes

signal estuary
#

thx it works

lyric mountain
#

bool === false 😩

fierce ether
#

how can I pass window or document to my controller in ejs?

wooden kindle
#

im tryna run one of my bots and its giving me this

pale vessel
#

One of your commands export is fucked probably

wooden kindle
#

ive checked through all of them

#

literally all of them

#

AND NOW ITS SAYING Encountered an error when trying to execute command.

#

BRUHRUHRHURUHRRH#

#

i give up

pale vessel
#

Is that your error handler?

#

Then you must have the actual error silenced then, print that I suppose

fierce ether
#

can someone body help it still redirects to next page even if the passwords dont match

        <script>
            var password  = document.getElementById('register-password')
            var repeat    = document.getElementById('register-password-repeat')
            var incorrect = document.getElementById('password-match')

            function validateRegister() {
                if(password.value && repeat.value && password.value !== repeat.value) {
                    incorrect.style.display = "block"
                } else 
                    if(password.value && repeat.value && password.value == repeat.value) {
                    incorrect.style.display = "none"
                }
            }
            
            repeat.onkeyup    = validateRegister;
        </script>```
oak cliff
#

@wooden kindle dont ghost ping me, thanks.

wooden kindle
oak cliff
#

then dont delete your message

wooden kindle
#

one of those grabify links to free nitro

oak cliff
#

just leave it

wooden kindle
#

okay sorry

boreal iron
#

darn Discord mobile trash

quartz kindle
#

hes assigning the function to the keyup event

boreal iron
#

Oh yeah you’re right, nvm then

wooden kindle
boreal iron
#

Damn I wish Discord code blocks on mobile would be scrollable horizontal instead of forcing line breaks anywhere.

wooden kindle
#

does any1 know how to make a help command with pages

solemn latch
#

Sure, pretty simple. Just array/list of pages.
On a button press just edit the message to the index of that page.

wooden kindle
solemn latch
#

Not on hand, there are a ton of examples online

wooden kindle
#

okay ima look

#

\⬅️

heavy wren
# signal estuary ```js module.exports = { spamCheck(msg, set, time) { let bool = fal...

would be better if you do:

function spamCheck(msg, set, time) {

        let bool = false
        let user = { id: msg.author.id, time: Date.now(), times: 2 }

        for (let u of set) {
            if (isNaN(u.times)) u.times = 2
            if (u.id === msg.author.id) {
                bool = true

                if (u.times >= 5) {
                    msg.reply(`Woah, not so fast!`)
                } else if ((Date.now() - u.time) <= time) {
                    u.times++
                    u.time = Date.now()
                }
            }
        }

        if (bool === false) {
            set.add(user)
        }
    }

module.exports = spamCheck;

Another file:

const spamCheck = require('../../path/to/function');

spamCeck(params, of, function);
lyric mountain
#

Boi

#

Just do if (!bool) down there

#

That's giving me shivers

heavy wren
lyric mountain
jolly vale
#

do you guys know any way to disable the automatic packaging on replit

errant flax
#

:dog_kek:

heavy wren
sage crypt
jolly vale
heavy wren
wooden kindle
#

u think 2 GB is good enough to host a discord bot

#

because i want to stop using a VPS and start self hosting

lyric mountain
#

Define "self hosting"

wooden kindle
#

raspberry pi

lyric mountain
#

Like, at your home?

#

Ah, the pi

wooden kindle
wooden kindle
lyric mountain
#

Well, some people here managed to run on it

#

But you need to make some sacrifices

#

Like with caching

wooden kindle
#

because the VPS i use RN is 3GB and im gonna downgrade by 1gb so it aint much

#

does raspberry pi have google

lyric mountain
#

3 -> 2 is actually a -33% downgrade

#

Ye

#

Pi can run ubuntu iirc

wooden kindle
#

okay because ive never used a raspberry

#

thats why

#

does it have VSC

lyric mountain
#

Pi is just a mini computer

wooden kindle
#

ahh i see

lyric mountain
#

But you don't want to code ON it

#

Code elsewhere then push to the pi

wooden kindle
#

or should i just update the repo and copy it from there

lyric mountain
#

No, i mean, leave coding to outside resources

#

Or if it's just a quick fix use a text editor

#

Like nano

wooden kindle
#

ok

#

when i host it tho dont i have to keep a terminal open

lyric mountain
#

You have

#

Or launch it as a service

wooden kindle
#

should i just keep VSC open to use that as a terminal or no

lyric mountain
#

No, forget vsc please

wooden kindle
#

okk

lyric mountain
#

You'll be running on terminal

#

Raw terminal

#

Minimal graphical stuff

wooden kindle
#

i see

lyric mountain
#

If possible don't even install graphical version of the OS

#

Too much space used for little advantage

wheat mesa
#

vsc would take up like 25% of your ram available on the pi just from running it

lyric mountain
#

You want to maximize available space and ram for your bot

#

Bot first
Everything else is disposable

wooden kindle
#

ok

jolly vale
#

is heroku good?

lyric mountain
#

Depends for what you need

paper frigate
#

Alright

lyric mountain
#

It's like asking if a potato is good

paper frigate
#

What is the language for your bot @earnest phoenix

lyric mountain
#

Nutritive? Yes
Can win a soccer game? Don't think so

earnest phoenix
#

@paper frigatediscord.js node.js making on repl

paper frigate
#

This here is what I suggest,

#

Unless you make an API yourself

earnest phoenix
#

@paper frigatein this any credit i am able to upload my bot on discord

paper frigate
#

If it looks good, yeah

earnest phoenix
#

@paper frigatewhich type of ip

paper frigate
#

just use embeds and stuff

paper frigate
earnest phoenix
#

api

#

which

#

type of

jolly vale
earnest phoenix
#

@paper frigate

paper frigate
#

To interact with Discords API and YouTubes

paper frigate
earnest phoenix
#

@paper frigatehow i will get it

paper frigate
#

just use this

earnest phoenix
paper frigate
#

Yes

#

As long as you are in a node.js project for repl.it

jolly vale
earnest phoenix
#

@paper frigate how i get api of youtube and discord

wanton walrus
#

Hey @earnest phoenix! I'm glad you are interested in learning about nodejs development but this isn't the place for it, this is for minor help on ongoing projects and such

#

I'd be happy to send you some links with information on learning if you'd like

earnest phoenix
#

@wanton walrusthxx

#

@paper frigatelisten

wanton walrus
#
#

This is a site I send to most people starting out, it's got most of what you'll need to get going

#

There's also a bunch of somewhat low cost courses on udemy, just check the reviews first

rocky hearth
#

in C, how can I read a black and white bmp file, and detect if it is completely white?

crystal wigeon
#

hey

#

so umm, how do i enable json1 extention on sqlite on grafana?

#

i basically have a json column to be used in where clause

wanton walrus
#

Looks like you can't

#

Just read some threads on their forums

crystal wigeon
#

yeah, just checked their github

lethal trout
#

Uncaught Promise Error: TypeError: Cannot read property 'user' of null

in some servers it gives the name in others it shows this

earnest phoenix
#

(python) i added this bot status code to it and now it is saying that the keep alive row is incorrect when it wasnt before?

earnest phoenix
#

oops 😆

#

thank you

fierce ether
#
 req.session.user = user;
            
            return res.redirect('/account/management/dashboard')

        }
    }

    admin(req, res) {
        console.log(req.session)``` req.session dosent return user in admin
wooden dust
#

huh

#

that doesn't really make any sense @earnest phoenix

#

can you copy and paste the full code?

earnest phoenix
#

nothing i add works anyways

#

dw\

vast crown
#

it should detect when user has a role, but it always returns false

fair axle
#

Is there any idea about how can I solve this problem?

rose warren
vast crown
#

yes

#

it worked before idk whats the problem now

rose warren
#

Remove the exclamation from the if statement

vast crown
#

i did

#

i tried like this even

rose warren
#

That's the same as the first one

#

Does the same thing

vast crown
#

ye

rose warren
#

That's saying "if the user doesn't have the role, reply to the message with "cancel that"

vast crown
#

im perfectly aware of that

#

but even when user has the role

#

it returns false ;d

rose warren
#

Did you put the correct ID in the role fetch?

#

In vrole

vast crown
#

yeah, i tried with find but that didnt work too

rose warren
#

So the role id is correct? You're sure about that?

vast crown
rose warren
#

Wait. Just replace vrole in the if statement with the ID

#
.has("id here") 
vast crown
#

it worked 😄

#

tnx

rose warren
#

Sorry i should have seen that immediately 😂 it's too early

crystal furnace
#
let role = message.mentions.roles.first() || await message.guild.roles.cache.get(role.id)```
 ReferenceError: Cannot access 'role' before initialization
#

when I put a role = ID it is not work

cinder patio
#

role.id you try to access the variable before it's initialized

cinder patio
#

what

tulip ledge
#

You need to change the variable name

crystal furnace
cinder patio
#

What do you want to do exactly...

fierce ether
#

same thing

crystal furnace
cinder patio
#

that's very descriptive ....

narrow sedge
#

I need help with some mongoDB questions

#

So I already saved this in my mongoDB Database

prefix: "="
guild: "my guild id"
``` Now , how do I push and change the old prefix to the new prefix I set from a command
small tangle
#

JS?

narrow sedge
#

TS

#

typescript

small tangle
#

which driver are you using?

narrow sedge
small tangle
#

i mean like mongoose, monk, etc

narrow sedge
#

mongoose

small tangle
#

but idk if they are available with ts

#

ok

true ravine
#

Just a quick question - if I want people to be able to connect their discord account to my website (say for a bot dasboard) would I throw the oauth on the same discord application as the bot or create a new application

narrow sedge
small tangle
#

@narrow sedge should be await MongooseModel.updateOne( query_to_get_the_doc, { $set: { prefix: newPrefix} });

narrow sedge
#

o

#

ok I'll try tht

small tangle
#

the query should be like { guild: <guild>.id }

#

i guess im not sure what youre querying over

narrow sedge
#

I query the guild id

small tangle
#

nice peepoHappy

#

yeah then updateOne({ guild: guild.id }, { $set: { prefix: newPrefix }});

earnest phoenix
#

Did somebody used vuepress with @discord-message-components/vue

crystal wigeon
#

anyone use socketio?

true ravine
#

I have used it, why's that?

crystal wigeon
#

do you know how i can proxy pass a socket connection to a second service?

#

like web -> api gateway -> comms

#

how can i connect to comms through api?

true ravine
#

I didn't get quite that advanced sorry

quartz kindle
#

with nginx?

crystal wigeon
#

nop

#

custom nodejs

#

ik how to do it nginx

crystal wigeon
quartz kindle
#

so you have a nodejs and want to proxy to another nodejs?

crystal wigeon
#

yeah

#

im already using it to proxy other routes

#

but not sure how to proxy ws

#

from the web i call api with the port and stuff, i needs to redirect that connection to comms

quartz kindle
#

have you tried one of those proxy libs from npm?

crystal wigeon
#

nop, my api gateway is fast-gateway, there isn't much middlewares around it

#

trying to find a workaround and see if i can pass it manually or something

#

i think im using a proxy itself actually, but for routes

quartz kindle
#

hmm

#

i guess the only way would be using requesthooks

#

you can intercept a request in the gateway, and if its a websocket, you can create a socket connection

#

i dont know if you can redirect the whole thing to comms you might need to create a socket in the gateway itself

#

can you access comms from the web? is it publicly accessible?

#

if so you can make a redirect instead of a proxy

crystal wigeon
#

ideally i dont want to allow comms to be accessible publicly hence the api gateway

#

i just read fast gateway github

#

they dont have ws support

#

sad

sly sierra
#

node.js isn't a vallid command

spice arch
earnest phoenix
#

Node .

sly sierra
#

^^

earnest phoenix
#

done everything but need help on how to put welcomes in. Because i am stupid!

winged juniper
#
    const banned = await message.guild.fetchBans();

Why this is err🥲

shrewd hazel
#

Is it even allowed by gooogle TOS?

winged juniper
shrewd hazel
#

Probably not if i making money of out it

rose warren
#

I don't know. Best to read Discord's TOS and Gmail TOS

#

Also what's the use case scenario?

shrewd hazel
#

@rose warren but thats not what i meant

rose warren
#

Why not just DM the person?

shrewd hazel
#

For someone who left discorf

rose warren
#

Why use a command to send an email?

#

If they left Discord without giving anyone details on how to contact them, that's probably for a reason.

shrewd hazel
#

Yea, someone will also gonna increased trust level

rose warren
#

I just think it's an invasion of privacy and could also be maliciously used

shrewd hazel
#

But i still wanna make a bot with third party support like gmail

rose warren
#

Even if it's not against TOS it doesn't mean it's a good idea

shrewd hazel
#

Also are cloud storage via discord is on at least not death topic?

signal estuary
#

How can I check if the bot's highest role is higher than another user he tries to kick? I mean if the role hirachy is high enaugh to make something

pale vessel
#

You mean member

small tangle
#

there is a position property on a role

pale vessel
#

member.manageable

small tangle
#

or that

rose warren
#

It depends on what language you're using

pale vessel
#

They're using Discord.js last time I helped them

#

Maybe that changed 👀

signal estuary
pale vessel
#

Read the docs I sent

hollow depot
#

how can i get the voice channels my bot is connected to? i’m using discord.js

quartz kindle
#

in v12 its client.voice.connections

#

that will give you a collection of VoiceConnection

#

which have .channel properties

winged juniper
hollow depot
hollow depot
quartz kindle
errant flax
#

how do i make an anti-nsfw system,
like what api should i use vvGFXRT_flushedspin

lethal trout
#
        throw e;
        ^

Error: \\?\C:\Users\sakit\Documents\Flame Bot v12\node_modules\better-sqlite3\build\Release\better_sqlite3.node is not a valid Win32 application.
\\?\C:\Users\sakit\Documents\Flame Bot v12\node_modules\better-sqlite3\build\Release\better_sqlite3.node```
vast crown
reef pine
#

how do i correctly define a directory for my config.js
my setup is Main file + the node modules and everything that you get at the start > commands > information > help.js

#

i have tried so many different things but its not working

#

it should be .../ right?

reef pine
errant flax
#

how?

reef pine
#

check if the channel is nsfw or not and work accordingly

errant flax
#

how do i check if the image is nsfw?

reef pine
#

idk if you can scan images like that but you can filter nsfw commands

errant flax
#

im asking how to check if an image is an nsfw image

reef pine
#

ye idk if thats possible :3

waxen bough
#

probably exists some 3rd party modules

reef pine
#

true true

long crow
#

you look at it, if it has bewbs it is nsfw, if not, it not nsfw

reef pine
#

Loll

#

ikr

errant flax
#

bruh

waxen bough
#

build a program where you sit down look at and check every image being sent

reef pine
#

you might be able to find some high tech api for it but ik ive never seen it done lol

long crow
#

Though discord have setting for it. I did set up the nsfw filter on for my server

#

no need code etc

reef pine
#

lol

waxen bough
vast crown
#

😳

#

doesnt discord handle nsfw by default

waxen bough
#

im not familiar but i'm sure theres some docs

long crow
waxen bough
long crow
#

¯_(ツ)_/¯

reef pine
#

monika ily

waxen bough
#

no

reef pine
#

rejection

waxen bough
#

i don't exist

reef pine
#

you do in my world

waxen bough
#

sure (we're ot here)

reef pine
#

loll

#

well imma go back to remaking my bot from scratch so top.gg cant decline it for the millionth time

#

have fun

azure ore
#

I need help making the bot say that he doesn't have the permission to kick people, i know it's dumb but client.hasPermission doesnt seem to be a thing

earnest phoenix
#

Command kick args kick??

#

Then your command is !kick kick ?

azure ore
#

it would be !kick {username}

#

the rest is working but i've noticed that if my bot for some reason is missing the permission to kick people it crashes

vast crown
#

this is not a thing i think

reef pine
#

its not the client needing permissions

#

its the user using the command

#

try something like this

#
 if(msg.member.hasPermission("KICK_MEMBERS"))
azure ore
#

I know, i've made it that if the user making the command doesn't have permission the the bot says that he's not strong enough, problem is that if my bot doesn't have permission it crashes

reef pine
#

the bot doesnt use permissions

#

the user does

earnest phoenix
#

<message>.guild.me

azure ore
#

Then is there a way to make the bot that he doesn't have permission either, like if someone removed him the permission to kick people?

boreal iron
#

@earnest phoenix got something for you

reason = [{"264445053596991498":"test"},{"264445053596991492":"test"}];
result = reason.find((element) => element["264445053596991498"]);

will return the found element, an object in this case
How would I return it's obj.values as "one-liner"?
I mean getting obj.values of result is boring... is there a one line solution also respecting if find returns undefined?

waxen bough
#

it should be the bot's perms you are checking

vast crown
#

bruh

#

try this

#
msg.guild.me.hasPermission("KICK_MEMBERS")
boreal iron
#

hasPermission isn't up to date anymore, but ...permissions.has(...) is

azure ore
#

so it'll be more like this

vast crown
#

no

#

wait

reef pine
#

is .me a thing?

vast crown
#

yes

waxen bough
#

yes

reef pine
#

since when :3

#

oh wait

earnest phoenix
reef pine
#

i dont think ive seen it but never used it that often

#

so idk couldnt help ya there

boreal iron
#

What does the var m represents?

azure ore
#

Thanks guys, it's now working

boreal iron
#

Oh err ok I see

reef pine
#

idk why it wont let me define the dir right

#

ive tried so many things

long crow
#

That sexy tohsaka distracting

reef pine
#

LOL sorry

vast crown
#

how do u read that bruh

reef pine
#

watchu mean

vast crown
#

its bullying my eyes

spice finch
#

can someone help me with discord buttons?

reef pine
#

lool

reef pine
#

watchu need man

long crow
#

../config.json double dot

reef pine
spice finch
#

i had to start over so i need help from the start...

reef pine
#

still failed ayeven

boreal iron
#

wtf are you doing? If you wanna jump to the parent folder use ./../config

spice finch
reef pine
#

bruh lemme try

reef pine
vast crown
spice finch
boreal iron
#

show the code

reef pine
#

heres*

boreal iron
#

Looking at your screenshot your path the commands is in two subfolders?

#

/commands/informations/help.js?

#

If so you will have to chdir 2 times

#

Can't see the full path on your screenshot, but if so, ./../../config.json

vast crown
reef pine
#

yes

#

lemme try

#

omg it works ty

boreal iron
#

../ means parent folder, if you need to jump 2 folders, than use it 2 times

reef pine
#

true true tysm

boreal iron
#

./ means relative to the current file location

reef pine
#

yuh

boreal iron
reef pine
#

i hate when my bot doesnt work but doesnt error oml facepalm time to spend 3 hours finding the issue

boreal iron
#

that's why you catch the errors and print them or log them at least

reef pine
#

ive tried but sometimes even that fails

vast crown
rare granite
#

how do i make a subdomain that redirects to a bot invite
like i have a domain example.xyz which is redirected to github pages with cname but how do i make invite.example.xyz to redirect to a bot invite

earnest phoenix
#

make invite.example.xyz a cname to the invite page

rare granite
#

i cant enter that large invite in my value

boreal iron
#

It should allow up to 250 chars.

#

The common auth URL is around 100 or something

#

https://discord.com/api/oauth2/authorize?client_id=xxx&permissions=xxx&scope=bot%20applications.commands

rare granite
#

im temporally using freenom for testing and its isnt allowing

earnest phoenix
#

welp

wary flame
#

You can't use CNAME to redirect to urls only domains

earnest phoenix
#

use a web server that redirects to the invite

wary flame
#

^

rare granite
#

alr ty

wary flame
#

Actually

#

This might work

nocturne grove
#

is it right that inside an object property, this is undefined, while inside an object property that is a function, this will return the object?

boreal iron
earnest phoenix
#

how are you going to access this inside a property when not being in the object scope

nocturne grove
#
const obj = {
    name: 'objectName',
    description: 'an object',
    values: this
}

const obj = {
    name: 'objectName',
    description: 'an object',
    values() {
        return this
    }
}```
wary flame
# boreal iron Of course you can, you don't add the protocol to the record which would effectiv...

No you can't you can only redirect to a domain or subdomain, eg discord.com https://en.wikipedia.org/wiki/CNAME_record

A Canonical Name record (abbreviated as CNAME record) is a type of resource record in the Domain Name System (DNS) that maps one domain name (an alias) to another (the canonical name).This can prove convenient when running multiple services (like an FTP server and a web server, each running on different ports) from a single IP address. One can, ...

boreal iron
#

that's a valid URL, too just missing the protocol

nocturne grove
wary flame
#

CNAME Isn't for urls, it's for domain to domain

boreal iron
#

god damn, you actually don't even understand what I quoted

earnest phoenix
wary flame
earnest phoenix
#

use a web server that redirects to the invite link

wary flame
#

^ or https://en.wikipedia.org/wiki/URI_record which cloudflare at least does seem to support (you can always point your freenom domain to cloudflares free dns)

In the Domain Name System, a Uniform Resource Identifier (URI) record (RFC 7553) is a means for publishing mappings from hostnames to URIs.

nocturne grove
earnest phoenix
nocturne grove
#

okay thanks

rare granite
#

well ig ill make two github repos

#

and redirect one to the subdomain

#

using cname

nocturne grove
#

btw, if I'm using slash commands and I want different choices inside an option for each guild, do I have to make that command guild specific?
for example, the choices of the option are all members with admin perms

#

or does the API provide a way to have dynamic options inside a global command?

rose warren
#

You get the data from the interaction

#

So they don't need to be guild specific

#

You handle the interaction data similarly to how you handled message args

nocturne grove
#

No, I mean that they can choose from one of the admins from a dropdown menu

rose warren
#

I haven't tried dropdowns but I imagine you can get that data dynamically and populate the dropdown with it

nocturne grove
#

or maybe I don't understand the slash commands yet, I will make an example and screenshot it

#

that would be very helpful tho

rose warren
#

I'd say read the docs and see if you can do a for loop around the list of admins to populate the menu

nocturne grove
#

I read the docs on the dev portal, but will look at discord.js.org. Thanks

#
{
name: this.name,
description: this.description,
options: [{
        name: 'title',
        description: 'The title',
        type: 3,
        required: false
    }, {
        name: 'description',
        description: 'The description',
        type: 3,
        required: false
    }, {
        name: 'colour',
        description: 'The colour',
        required: false,
        type: 3,
        choices: [{
            name: 'red',
            value: '#FF0000'
        }, {
            name: 'green',
            value: '#008000'
        }, {
            name: 'blue',
            value: '#0000FF'
        }, {
            name: 'yellow',
            value: '#FFFF00'
        }]
    }, {
        name: 'image',
        description: 'The url to an image',
        type: 3,
        required: false
    }
   ]
}```
#

this is what I mean. Of course, it isn't about the colours

rose warren
#

Oh those are command options

nocturne grove
#

yes

rose warren
#

I thought you meant the dropdown selector

nocturne grove
#

oh the select menu's?

rose warren
#

Yeah

#

I guess try it and see. I'm not sure.

nocturne grove
#

hmm that could be an option too, but this would be nicer and user-friendlier

rose warren
#

Sure. I just don't know what you're trying to do it for.

rose warren
nocturne grove
#

😅
np

solemn latch
#

I'm not sure if that's possible.
But one way to do it would be to have the slash command without it.
Send a message response letting them select menu.

Practically the same experience for the user.

rose warren
#

But I know you can pass roles and channels as args so I guess there's probably a way to do it

#

I've had about 10 minutes experience with v13 so far so I'm not much help

#

I've only adapted my ping command so far

nocturne grove
#

I asked it in the DDevs server, it will be added to slash commands so it would be a waste of time to do it with select menus now

New option types: Autocomplete - choices populated dynamically by the applicaiton
https://github.com/discord/discord-api-docs/discussions/3581

GitHub

Hey all, an update on plans for the API. We've reviewed a lot of your survey responses and messages in DDevs #message-intent. We appreciate your candid feedback and want to offer a peek int...

nocturne grove
#

I did all/most args free commands now

boreal iron
#

I'm currently investigating, too building a new command handler as we got 9 months to so, only KEKW

digital ibex
#

im rewriting my library lol

#

its annoyin

boreal iron
#

Not sure what type of bots Discord will whitelist in the future requesting the message.content privilege

nocturne grove
nocturne grove
boreal iron
#

Well the slash commands aren't a bad thing at all tbh

long crow
#

Already quite ahead with slashies

digital ibex
errant flax
#

imagine not having a slash command handler danceydance

long crow
#

imagine seeing the duck as an apple

nocturne grove
errant flax
#

anyways offtopic to development danceydance

boreal iron
# digital ibex https://support-dev.discord.com/hc/en-us/articles/4404772028055

yeah, I'm aware of this, but

We know that many bots and apps function specifically to read, moderate, and otherwise manage messages sent by Discord users. We expect to grant those requests for message content without issue.

If your bot has unique functionality that cannot be replicated or otherwise implemented with interactions, you can begin applying once we open the queue for this intent in fall of 2021.

... can be interpreted very differently

nocturne grove
#

just add a function that will delete messages containing "f*ck" and you're safe ;)

long crow
#

It like the question, does your bot really require to read other's member message to functioning

boreal iron
#

Yes, as I need to report the messages to the NSA.

lyric mountain
#

obviously, how else would I sell conversation data to google?

nocturne grove
#

xd

lyric mountain
rose warren
#

Imagine making an AI that learns off Discord conversation data KEKW

nocturne grove
#

🤯

boreal iron
#

That poor AI, need to learn from

trash
bullshit
meme
trash
actual good content
trash
meme
meme
...
rose warren
#

That's the point 😂

boreal iron
#

That's the reason AI will try to wipe out human life in the future, I'm sure

rose warren
#

Discord ML AI bot will end humanity

#

It will deem the end of human existence necessary

quaint wasp
#

Why does it say Cannot read property 'includes' of undefined

nocturne grove
#

then config.globalBannedUsers is not defined

quaint wasp
#

it is

boreal iron
#

log config and you will see the issue :)

quaint wasp
#

listed with an id

long crow
#

the error say otherwise, so log it and trace from there

quaint wasp
#

wait lol

nocturne grove
quaint wasp
#

I misspelled users

nocturne grove
#

lol

boreal iron
quaint wasp
#

How can I pass a varable from there to here?

boreal iron
#

declaring the var outsite of your loop

quaint wasp
#

o

boreal iron
#

let yano = false;
loop { yano = true }
console.log(yano);

lyric mountain
boreal iron
#

MAX COMPATIBILITY

lyric mountain
#

🤌

#

and here's me, iterating over the whole portuguese dictionary to gather data for my game

boreal iron
#

Pfff... just 245'054 records, lame

#

You remember my database generation?

lyric mountain
#

nope

boreal iron
#

got it somewhere ...

quaint wasp
#

wierd.... still doesnt reply..

lyric mountain
#

4b

boreal iron
lyric mountain
#

tf

#

how tf you even get near 4b?

boreal iron
#

better don't think about it, the amount is necessary

#

just took ~ 15 days to generate as you can see oldEyes

lyric mountain
#

and the index is bigger than the actual data

boreal iron
#

Would have been faster if I would have 800GB of RAM available of course

boreal iron
#

That's the cause of the huge index size

lyric mountain
stray seal
#

On Pins, it says how long it was. How does he do this API?

boreal iron
#

Oh.. timestamp snowflakes

stray seal
boreal iron
#

<t:timestamp:d> for a timestamp of a day for example

#

<t:1628167661:d>

stray seal
#

Where do you find the commands?

#

<t:timestamp:d>

#

. . .

#

<t:timestamp:d>