#development

1 messages ยท Page 1882 of 1

high crown
#

i can't do anything with people's thoughts

solemn latch
quartz kindle
#

@_@

rose warren
solemn latch
#

sometimes just asking the question helps

signal estuary
#

You can set slash commands with this:

await client.guilds.cache.get(guildId)?.commands.set(data)

But how can you delete slash commands?

midnight swallow
#

Use user_id ig

spark flint
#

Look on stack overflow

midnight swallow
#

Can we log the dms of our bot?

vernal moth
#

so i have made a pause command which pauses the audio stream.

using connection.pause()

then i wanted to make it resume using connection.resume()

#

but it doesn't resume

#

are there any alternative methods to..resume a paused stream?

midnight swallow
#

Yeah, I just wanna check it out... Not going to add tho

split hazel
#

@quartz kindle for robin hood maps looking up non-existant keys is coming to bite me back

#

right now i'm iterating over the whole list to find out if a key doesnt exist since that key couldve simply been moved

#

thats 100% not how to do it i believe

#

(im back to here because i accidentally left in an infinite loop in the checking mechanism not giving up after iterating over the whole map)

last tapir
#

hi

signal estuary
#

When the bot tries to delete 2 times one message he throws an error: Unknown message. So I tried to catch this error but none of these works:

MsgCollector.on('collect', async collected => {
  try { if (collected) collected.delete() } catch { }
}) 

Anyone knows how I can catch this?

last tapir
#
let string = "This is a sentence that has a lot of space and wants each word seperated into its each index in an array."

How can I seperate each word?

last tapir
jade latch
#

string.split(" ");

last tapir
#

appreciate it

signal estuary
#

string.split(/\s+/)

jade latch
#
message.guild.channels.create(`${message.member.user.tag}-ticket`, {
type: "text",
permissionOverwrites: [{
id: message.guild.roles.everyone,
deny: ['VIEW_CHANNEL']
},
{
id: message.author.id,
allow: ['VIEW_CHANNEL']
}],
})```
#

yw

split hazel
#

yes but a restart will ruin your dreams unless you re-await after a restart

#

and thats also a memory leak

quartz kindle
#

The probing terminates when an empty slot is found, or a key is encountered which has a PSL higher than the sought key would have in that slot. (If the sought key had been in the table, it would have been located before that key.)

split hazel
#

oh that's because I don't move my keys back when removing which changed my way of thinking

#

will add that which will let me use that logic thanks

vivid fulcrum
#

the channel is returned to you

#

just save it in a variable

#

show your code

#

create is a promise

#

await it

#

show more of your code

#

execute is async, the callback in .then() is sync

#

if you want to clean it up

#
const collected = await awaitReactions;
if(collected.first().....)
//the rest of the code
#

?

#

yes

#

yeah, i just did it so i don't have to type it all out

#

i'm lazy

#

it was just an example on how to clean up your code to be properly async

#

oh my

#

actual fucking god

vivid fulcrum
#

it was not meant for you to copypaste

vivid fulcrum
#

????????????????????

#

yes

#

it was just an example

#

SO WHY ARE YOU

#

OH MY

#

literally just add message. in front of awaitReactions and add () to make it a method call

split hazel
#

you have been trolled successfully

rustic nova
#

Yup

feral aspen
#
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Mohammad Hajjiri\Desktop\Node.js Projects\Simple\Vocabulary\node_modules\ora\index.js from C:\Users\Mohammad Hajjiri\Desktop\Node.js Projects\Simple\Vocabulary\src\index.js not supported.
Instead change the require of C:\Users\Mohammad Hajjiri\Desktop\Node.js Projects\Simple\Vocabulary\node_modules\ora\index.js in C:\Users\Mohammad Hajjiri\Desktop\Node.js Projects\Simple\Vocabulary\src\index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\Users\Mohammad Hajjiri\Desktop\Node.js Projects\Simple\Vocabulary\src\index.js:9:13) {
  code: 'ERR_REQUIRE_ESM'
}
#

What does this mean?

#

https://www.npmjs.com/package/ora

const Ora = import("ora");

const waitASecond = async () => new Promise((resolve) => setTimeout(resolve, 1000));

const spinner = Ora('Fetching the input.');
spinner.start();

await waitASecond();
spinner.color = 'magenta';
spinner.text = 'Boarding Passengers';

await waitASecond();
spinner.color = 'yellow';
spinner.text = 'Starting Engines';

await waitASecond();
spinner.color = 'Green';
spinner.text = 'Launching the rockets.';

await waitASecond();
spinner.succeed('Houston? We landed!!');

Apparently it's erroring:

const spinner = Ora('Fetching the input.');
                ^
TypeError: Ora is not a function
cinder patio
#

import() returns a promise

feral aspen
#

Ora is not a function, though. ๐Ÿ‘€

cinder patio
#

yeah it's a promise

feral aspen
#

My wifi.

#

Yikes.

cinder patio
#

yeah, it's a promise

feral aspen
#

More explanation?

solemn latch
#

log Ora

feral aspen
#
[Module: null prototype] {
  default: [Function: ora],
  oraPromise: [AsyncFunction: oraPromise]
}
agile seal
#

Hi im new to discord.js and I want to make a youtube post notification is there a tutorial for this?

old cliff
#

Use Ora.default()

feral aspen
#

Solved.

umbral lake
#
const Discord = require('discord.js');
const db = require('quick.db')

module.exports = (oldState, newState) => {
    
    if (!newState.channelID) {
        mainInterval = setInverval(function() { db.add(`coins_${newState.id}`, 30) }, 30000);
    } else if (!oldState.channelID) {
        clearInterval(mainInterval);
    }
};

mainInterval is not defined at the clearInterval :/

umbral lake
#

I do what with?

hexed heart
#

replace setInverval with setInterval

umbral lake
#

its because the mainInterval is not defined for the clear

#

oh

#

wait

hexed heart
#

typeerror

umbral lake
#

euhh

#

can I stop intervals with clearInterval();?

hexed heart
#

wait

hexed heart
umbral lake
hexed heart
#

clearInterval restarts i think

hexed heart
umbral lake
#

oh :/

hexed heart
#

only the (mainInterval) u specified

umbral lake
#

and if I don't specify a name

hexed heart
#

clears all

umbral lake
#

yes so I can clear all?

hexed heart
umbral lake
hexed heart
#
const db = require('quick.db')

module.exports = (oldState, newState) => {
    let mainInterval;
    if (!newState.channelID) {
        mainInterval = setInterval(function() { db.add(`coins_${newState.id}`, 30) }, 30000);
    } else if (!oldState.channelID) {
        clearInterval(mainInterval);
    }
};
umbral lake
#

ah no

#

its not this oof

hexed heart
#

ok

noble linden
#

if i make an changing status in my bot whats the minimun seconds interval to not get rate limited?

inner fulcrum
#

5 seconds i think

noble linden
#

oh k ty

inner fulcrum
#

i might be wrong

#

hm

noble linden
#

i did 15 bc 5 little too fast lol

inner fulcrum
#

i will suggest to change it every 10-15 sec doe

noble linden
#

ye

hexed heart
#

yea

thorny flume
#

Does anyone know why I am getting this error? commands is not iterable

noble linden
#

my bot just hit 75 servers :D

inner fulcrum
noble linden
hexed heart
#

nice

inner fulcrum
#

i cant get mine past 23 servers ;-;

noble linden
inner fulcrum
#

lul moment

noble linden
#

mine wouldt get past 50 or something

umbral lake
# hexed heart ok
const Discord = require('discord.js');
const db = require('quick.db')

module.exports = (oldState, newState) => {
    let mainInterval;
    if (!newState.channelID) {
        console.log(`yes`)
        mainInterval = setInterval(function() { db.add(`coins_${newState.id}`, 30) }, 30000);
    } else if (!oldState.channelID) {
        console.log(`no`)
        clearInterval(mainInterval);
    }
};

when I join a channel, the interval starts and I have 'yes' in the console but if I leave, the bot says 'no' but the intervals dosen't stop :/

hexed heart
#
const db = require('quick.db')

module.exports = (oldState, newState) => {
    let mainInterval;
    if (!newState.channelID) {
        console.log(`yes`)
        mainInterval = setTimeout(function() { db.add(`coins_${newState.id}`, 30) }, 30000);
    } else if (!oldState.channelID) {
        console.log(`no`)
    }
};```
#

try this

pale vessel
#

Why should they try that?

umbral lake
earnest phoenix
#

How can i zoom out on canvas

blazing umbra
#

Need help in Shards

#

Any one can help me ping me ๐Ÿ˜”

lyric mountain
split hazel
#

took the words out of my mouth

lyric mountain
#

Damn, ๐Ÿค๐Ÿ”ก here have it back

umbral lake
#
const Discord = require('discord.js');
const db = require('quick.db')

module.exports = (oldState, newState) => {
    let mainInterval;
    if (!newState.channelID) {
        console.log(`yes`)
        mainInterval = setInterval(function() { db.add(`coins_${newState.id}`, 30) }, 30000);
    } else if (!oldState.channelID) {
        console.log(`no`)
        clearInterval(mainInterval);
    }
};

when I join a channel, the interval starts and I have 'yes' in the console but if I leave, the bot says 'no' but the intervals dosen't stop :/

blazing umbra
#

and when sharding starts and some one uses slash play command bot is giving error unkown interaction

arctic notch
lyric mountain
#

Also, show ur current code

green vale
#

in discord.js, how can i attach a Stream or a Buffer to MessagePayload.files[]?

pale vessel
#

could use MessageAttachment

green vale
#

fair point

#

actually is it possible to attach an image in an ephemeral interaction?

pale vessel
#

Yes

green vale
#

or in any interaction?

pale vessel
#

Add ephemeral: true to the attachment

#

Only interactions

green vale
#

and would i just insert a MessageAttachment like i would with TextChannel#send?

#

like "content", MessageAttachment?

pale vessel
#

I think js send({ content: "content", files: [attachment] })

blazing umbra
green vale
pale vessel
#

Did you get an error

green vale
#

nah it just didn't attach the file

rose warren
green vale
#

ah okay

#

thank you mac

#

could I attach a Stream or Buffer to a message embed then, perhaps?

rose warren
#

No problem! dog_Happy I'm waiting for it to be able to do my djs v13 rewrite.

#

You should be able to do that yeah

green vale
#

fair enough

#

ah? how so? i checked docs and you can only insert a URL into setImage()

rose warren
#

You can put that in an embed but not as an attachment

green vale
#

hm okay

#

i'll probably just attach the embed along with the image

green vale
rose warren
#

I need it to upload canvas buffers as message attachments

umbral lake
#
const Discord = require('discord.js');
const db = require('quick.db')

module.exports = (oldState, newState) => {
    let mainInterval;
    if (!newState.channelID) {
        console.log(`yes`)
        mainInterval = setInterval(function() { db.add(`coins_${newState.id}`, 30) }, 30000);
    } else if (!oldState.channelID) {
        console.log(`no`)
        clearInterval(mainInterval);
    }
};

when I join a channel, the interval starts and I have 'yes' in the console but if I leave, the bot says 'no' but the intervals dosen't stop :/

rose warren
#

Kind of how those welcome or rank canvases work.

pale vessel
#

What's stopping you from deferring and editing the original response ๐Ÿ˜ฉ

#

Canvas might even take over 3s to process anyways

#

So you might probably need to end up deferring

rose warren
#

That's slow and hacky. I just need the interaction option.

pale vessel
#

It's not slow and hacky

#

Oh well

rose warren
#

And my canvases are optimised enough to not take 3s ๐Ÿ‘€

solemn latch
#

even if you need to make a ton of them at once?

rose warren
#

I have a command that involves posting dozens and dozens of canvases in a channel at 15s intervals.

green vale
#

I would personally put it on a temporary CDN but to each their own, it makes sense anyways

rose warren
#

I pre-render canvas parts, store them in memory and use those instead of re-rendering an entire canvas each time.

green vale
#

Ahh I see

blazing umbra
#

Any budy plz help

green vale
rose warren
#

Lol 15s isn't API abuse

green vale
#

Yeah I know but I meant the dozens of canvases

rose warren
#

It's a hunger games simulator

green vale
#

Ah that makes sense

rose warren
#

There's not much of a choice dog_Joy

green vale
#

fair enough

#

i'd just simulate it all in replies

rose warren
#

In one message?

#

Like edit the first response?

solemn latch
#

console.log mainInterval inside the no side.

pale vessel
#

Why declare mainInterval inside the function

solemn latch
#

^

pale vessel
#

Declare it outside or you'll never able to access it ever again

green vale
#

also in djs, why am i not receiving DIRECT_MESSAGES events? i have the intent enabled

rose warren
#

Yeah but people usually chat during the games so the messages would get lost in chat

green vale
#

oh fairs

rich copper
#

Hey I created a welcome command on discord.py but I want to make the bot responsd the user welcome when the bot has a role (welcome) how can I code this any help? Python

umbral lake
umbral lake
pale vessel
#

Just move let mainInterval outside

umbral lake
lyric mountain
#

no need for dms

spark flint
#

How do i check if my bot has kick_member or administrator permissions?

solemn latch
#

djs?

spark flint
#

i forgot to specify

spark flint
#
if "discord staff" in name.lower():
        if member.guild.me.kick_members or member.guild.me.adminstrator:
            await member.send(embed=embed)
            #await log.send(embed=embed)
            await member.kick(reason="Users name was associated with a potential scam.")
            return```
#

i know that didin't work

lyric mountain
#

that's a VERY specific scam detection

spark flint
#

it checks if any user is called discord staff

#

and its the same for hypesquad events too

lyric mountain
#

that's why I said very specific

spark flint
#

true true

#

its basically the purpose of my bot tho

spark flint
#

im not sure if that works lmao

solemn latch
#

I dont know py ๐Ÿ˜”
but I assume so

lyric mountain
#

python devs love long descriptive names doesn't 'em?

urban slate
#

lads

#

after my bot gets into 75+ servers discord verifies it right?

solemn latch
#

youll need to submit a request for verification at that point

urban slate
#

anything i should take care of while verification?

spark flint
#

say if and why you need intents

#

and in detail

urban slate
#

oh

#

okk

#

what if they reject it? can i reapply or something?

solemn latch
#

depends on the rejection reason

#

some rejections are permanent, some are temporary.

urban slate
#

ohkk

solemn latch
urban slate
#

thanks

spark flint
solemn latch
#

nala โค๏ธ

spark flint
#

for more

urban slate
#

Ooo

#

is that your cat?

spark flint
#

site is a bit broken

solemn latch
#

yeah ik

#

idk why cloudflare started rejecting stuff

spark flint
#

ah

#

alr

solemn latch
#

weirdly, as soon as they are sent in discord they work.

spark flint
#

its ubuntu error

solemn latch
#

ah, width failed? ๐Ÿ˜”

spark flint
#

without width it does taht

#

i might make a subdomain of my family domain for my dog

#

not cat

quick salmon
#

hey was wondering if someone might be able to help me with an error I've been having trying to connect my bot to a voice channel? I have a feeling this has probably been said a lot xD I keep getting this error:

#

even tho I already have it installed

raw nest
#

How can I get bot server count on to my website? Topgg does this with every bot so it doesn't have to be a bot -> db -> website connection right?

spark flint
quick salmon
#

yes and I've done that

#

in multiple variations

spark flint
#

pip install discord.py[voice] i believe

solemn latch
#

oh you know what, i bet my vps is out of storage, it tries caching it and fails

quick salmon
#

I also installed that

solemn latch
#

oh ez

#

nah, i bet if i ask they will give me more storage

raw nest
#

How can I get bot server count on to my website? Topgg does this with every bot so I think you only need bot token and maybe discord api fetch??

solemn latch
#

nope, not out of storage. strange

spark flint
#

i was switched over to a new webserver the other day (free upgrade ๐Ÿ˜‰ and its so much faster) but im not used to the new url

spark flint
#

lemme go get the code i used

solemn latch
#

hmm, I enabled UFW recently, maybe I'm accidentally blocking something

spark flint
#

let channel = message.guild.channels.cache.get(channelid)

#

try that

solemn latch
#

kek yeah, firewall was blocking a port I needed public.

raw nest
sterile lantern
#
info.updateOverwrite([
    {
    id: '887988412508938270',
    allow: [],
    deny: ['VIEW_CHANNEL', "SEND_MESSAGES"]
    },
   {
  id: message.author.id,           
  allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'ATTACH_FILES', 'EMBED_LINKS', 'READ_MESSAGE_HISTORY'],
   deny: []
  },
  ])```
(node:1554) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
#

the id is a role id, idk why its not working

spark flint
sterile lantern
#

huh?

spark flint
#

i don't quite know with js

#

but with py thats an issue

sterile lantern
#

i literally have this in another file but its channel.createOverwrite or smth

#

and it works fine

lament rock
sterile lantern
#

what?

#

i mean

#

the 2nd one works

#

the first one doesnt

lament rock
#

all IDs are strings

sterile lantern
#

could it be because

#

info is defined as

#

let info = message.mentions.channels.first()```
lament rock
#

If your client has permission to alter the channel mentioned, it'd work regardless

sterile lantern
#

yh it has permission to do so

#

i dont understand why its not working though

lament rock
#

Ok. So read your lib's docs and see what you have to pass into the array objects

#

most likely a type field

sterile lantern
#

there's no type in updateOverwrite

lament rock
#

Then it wouldn't be complaining about types if there wasn't

sterile lantern
#

???

spark flint
# raw nest thank you
<strong id="servers">0</strong>

<script>
$.getJSON('APIURL', function(data) {

document.getElementById("servers").innerHTML = `${data.server_count}`;
});
    </script>```
#

replace server_count with whatever the API output you want to show

lament rock
#

Then it probably checks for you. That means that first ID you passed doesn't belong to a role of that guild or isn't a user you have cached

sterile lantern
#

the role provided is a valid role.

spark flint
sterile lantern
#

i have a diff cmd and i have this;

#
 channel.overwritePermissions([
                        {
                            id: `${message.guild.id}`,
                            allow: [],
                            deny: ['VIEW_CHANNEL']
                        },
                        {
                            id: message.author.id,
                            allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'ATTACH_FILES', 'EMBED_LINKS', 'READ_MESSAGE_HISTORY'],
                            deny: []
                        },
                        {
                            id: '887988412508938270',
                            allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'ATTACH_FILES', 'EMBED_LINKS', 'READ_MESSAGE_HISTORY'],
                            deny: []
                        },
                    ])```
#

works perfectly fine

#

but when it comes to updateOverwrite its not working

#

and idk why

#

well nvm then

#

this works

#

the thing above doesnt

#

weird but oh well

raw nest
spark flint
#

i made a simple api that gets the bots server count

#

then gets the server_count json output and displays on the site

raw nest
#

can't I just fetch guild count with the bot token or botid? f.e. topgg also doesn't have an api for every bot xD I mean for the guild count

raw nest
#

how have they done it?

solemn latch
#

bots post their server count to topgg

spark flint
#

you post the server count to top.gg

#

exasctly as woo says

spark flint
solemn latch
#

front end or back end?

spark flint
raw nest
solemn latch
#

no, bot devs send us the data. we dont send anything

raw nest
#

but the guild count updates automatically.

sterile lantern
#

how can i check if message.mentions.channels.first() starts with a certain name (e.g: ticket-)

raw nest
#

the token and prefix etc. yes the bot dev does provide this but guild count updates automatically

solemn latch
solemn latch
raw nest
#

does https://top.gg/api/bots/:bot_id/stats work even if I don't have the bot on topgg?

solemn latch
#

no

sterile lantern
#

aight works ty

raw nest
solemn latch
#

your bots guild count?

raw nest
#

yes

solemn latch
#

what library?

raw nest
#

discord.js

solemn latch
#

sharding or no sharding?

raw nest
#

no sharding

solemn latch
#

client.guilds.cache.size

raw nest
#

yes but now I want to be able to access it from my website

solemn latch
#

make an api which serves that data

#

or use IPC

solemn latch
#

๐Ÿ‘€

#

wordpress works too

spark flint
#

i'll send the link when its done

earnest phoenix
#

Someone know how to run async code with isolated-vm?

proven lantern
#

why does dynamodb think this is a good idea? adding types as a field

nova basin
#

hello how to center the title in a web page (HTML)

quartz kindle
#

margin: 0 auto

nova basin
#

me ?

quartz kindle
#

yes

nova basin
quartz kindle
#
h1 {
  margin: 0 auto;
}
nova basin
#

oh okey thx

vernal moth
#

hi so i tried to pause a

let controller = connection.play(stream, { seek: 0, volume: 1 })
    .on('finish', () => {
        //something
    });

by doing

controller.pause();

which paused well, but

controller.resume();

does nothing. am i missing something here?

#

also please ping me, i may miss it

azure lark
#

can someone help me make a / command handler with djs?

solemn latch
#

The djs guide covers that

azure lark
#

it dose??

solemn latch
proven lantern
#

anyone know how to make bulk calls to dynamodb using the v3 library

#

the first test is able to get the record.

#

id is the primary key

#

i needed to use single quotes here.

lyric mountain
#

use statements

#

also, u dont need to quote column names

#

unless it has uppercase chars

#

like guildName

proven lantern
#

they call this partiql

#

Aliasing is not supported

#

wonderful

#

doesn't look like counting is supported

woeful pike
#

dynamodb is very frustrating to deal with I gave up on it a long time ago

soft glade
#

manz just got banned the second i opened this channel

proven lantern
#

it knows count is a keyword

cosmic forum
#

Hello, does anyone have a good fun fact api?

lament rock
#

fun fact: I've never heard of one

cosmic forum
#

ah ok

vivid fulcrum
#

just find some random subreddits correlated to that and fetch a random post from reddit

lyric mountain
#

it's not that hard to google

shy turret
#

for discordjs

#

to get a member from cache (i have the intent)

#

it's .members.cache.get() right?

proven lantern
#

i think cache is just a normal array

#

and those dont have get

boreal iron
shy turret
#

yah i checked

#

it works

shy turret
fresh verge
#

How can you check with code if a channel is required (Community Servers) (JavaScript).

boreal iron
boreal iron
fresh verge
boreal iron
solemn latch
#

looking at the discord docs, community channels have zero public flags for telling if its rules, guidelines or updates channel from a bot.

simple stump
#

How would I add a value to a 2d array?
Ex.

let test = [];
test.push(memberID);

let userElo = rows[0].elo;

// Add userElo to the memberID so its:
/*
memberID | userElo
someID | someElo
*/
pale vessel
#
let test = [];
test.push([memberID]);

let userElo = rows[0].elo;
test[0].push(userElo);

test; // [[memberID, userElo]]```
simple stump
#

Thanks!

#

What about a 3d array (or multidimensional array)?

let test = [];
test.push(memberID);

let userElo = rows[0].elo;
let skips = 0;

// Add userElo to the memberID so its:
/*
memberID | userElo | skips
someID | someElo | skips
*/

Would it be the same thing?

slow terrace
#

Error:

E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\util\Util.js:414
    if (!allowEmpty && data.length === 0) throw new error(errorMessage);
                                                ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
    at Function.verifyString (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\util\Util.js:414:49)
    at Function.normalizeField (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:443:19)
    at E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:464:14
    at Array.map (<anonymous>)
    at Function.normalizeFields (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:463:8)
    at MessageEmbed.addFields (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:286:42)
    at Object.execute (E:\C) Developing\Wolfy Djs-13\commands\bot\cmd.js:40:12)
    at Client.<anonymous> (E:\C) Developing\Wolfy Djs-13\index.js:295:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  [Symbol(code)]: 'EMBED_FIELD_VALUE'
}

Fields

          .addFields(
          { name: 'Usage', value: `\`${prefix}${cmd.name} ${cmd.usage}\``, inline: true },
          { name: 'ALIASES', value: text.joinArray(cmd.aliases) || 'None', inline: true },
          { name: 'COOLDOWN', value: `\`${cmd.cooldown}\``, inline: true },
          { name: 'Permissions', value: `${text.joinArray(cmd.permissions.map(x => x.split('_')
          .map(a => a.charAt(0) + a.slice(1).toLowerCase()).join(' '))) || 'None'}`, inline: true },
          { name: 'Examples', value: `${cmd.examples.map(x=>`${prefix}${cmd.name} \`${x}\n\``)||'None'}`}
          )

That happened when there is no permissions: ["perms"], or any other thing
in the handler model

pale vessel
simple stump
#

Alright. Thanks!

hybrid cargo
slow terrace
hybrid cargo
#

Just check if the array length is >= 1 before proceeding to map it, if its false then add a predefined string

slow terrace
#

ok

lyric mountain
#

I've never seen a use-case for one

simple stump
#

I need to have an array that contains 3 values.

#

user id, elo, and the amount of skips they have

lyric mountain
#

That'd be 2d then

simple stump
#

(now im having an issue with figuring out how to sort a 3d array by the second value lol)

simple stump
lyric mountain
#

Each index would have an array

simple stump
#

im doing a match making system

lyric mountain
#

So an array of arrays

simple stump
#

how would i sort the array then?

#

by elo descending

lyric mountain
#

3d would be an array of arrays of arrays

lyric mountain
#

If u use sql, a simple ORDER BY will do it

#

For nosql idk

simple stump
#

i use mysql

#

wont it be better for it to just be a 3d array?

#

since i only need the data temporarily

lyric mountain
simple stump
#

:(

lyric mountain
#

3d is an array with 3 levels

simple stump
#

mb

lyric mountain
#

If you'll be retrieving data anyway, you can just retrieve it ordered

simple stump
#

using a db?

lyric mountain
#

Ye

simple stump
#

hmm

lyric mountain
#

For mysql, ORDER BY table.mmr DESC

simple stump
#

aight

lyric mountain
#

table being ur table's name

green vale
#

okay so in discord.js i'm attempting to fetch a user's voice channel status; however, it's not returning the voice state. i have the voice states intent specified. is there a partial that i need to have or something?

lyric mountain
#

Do u have guild_presences enabled?

green vale
#

is that it-

lyric mountain
#

Ye

green vale
#

pain

lyric mountain
#

Everything related to user status goes into that intent

green vale
#

well at least i have a valid reason for the intent in whitelisting now

lyric mountain
#

Well, until u remember < 100 server bots can use that intent freely

green vale
#

ye p i know

#

im specifying GUILD_PRESENCES now and it still isn't returning that i'm in a channel

#

it has admin perms so it can see the channel and all too

lyric mountain
#

U need to enable it on client too

#

It's disabled by default

green vale
#

i did

#

i specified it in Intents

hybrid cargo
#

Could be caching issue

green vale
#

THANK YOU FOR THE IDEA i think it might be discord.js-light

lyric mountain
#

Eh

slow terrace
#

@hybrid cargo

          let cmdpermissions;
          if(cmd.permissions >= 1 || cmd.permissions === null || cmd.permissions !== String) {
            let cmdpermissions = 'None';
          } else {
            let cmdpermissions = text.joinArray(cmd.permissions.map(x => x.split('_')
            .map(a => a.charAt(0) + a.slice(1).toLowerCase()).join(' '))) || 'None'
          }
          let cmdexamples;
          if(cmd.examples >= 1 || cmd.examples === null || cmd.examples !== String) {
            let cmdexamples = 'None';
          } else {
            let cmdexamples = cmd.examples.map(x=>`${prefix}${cmd.name} \`${x}\n\``) || 'None'
          }
E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\util\Util.js:413
    if (typeof data !== 'string') throw new error(errorMessage);
                                        ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
    at Function.verifyString (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\util\Util.js:413:41)
    at Function.normalizeField (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:443:19)
    at E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:464:14
    at Array.map (<anonymous>)
    at Function.normalizeFields (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:463:8)
    at MessageEmbed.addFields (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\MessageEmbed.js:286:42)
    at Object.execute (E:\C) Developing\Wolfy Djs-13\commands\bot\cmd.js:54:12)
    at Client.<anonymous> (E:\C) Developing\Wolfy Djs-13\index.js:295:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  [Symbol(code)]: 'EMBED_FIELD_VALUE'
}
slow terrace
lament rock
#

oh my god

pale vessel
#

what's wrong?

lament rock
#

reading the code is actually

pale vessel
#

my brain stopped functioning a while ago

lament rock
#

cmd.permissions !== String

#

will always return true

#

same for cmd.examples !== String

pale vessel
#

this man needs to know the power of ternary operator

lament rock
#

your code also isn't related to your error

#

Your error is trying to pass something like a number or an Array or whatever into an embed name or field or whatever when it needs to be a string and only a string.

slow terrace
lament rock
#

Because there is no embed code there

slow terrace
lament rock
slow terrace
# lament rock Because there is no embed code there
          const embed = new Discord.MessageEmbed()
          .setAuthor(message.author.username, message.author.displayAvatarURL({dynamic: true}))
          .setColor('738ADB')
          .setTitle(`${prefix}${cmd.name}`)
          .setDescription(`\`\`\`${cmd.description}\`\`\`\n`)
          .addFields(
          { name: 'Usage', value: `\`${prefix}${cmd.name} ${cmd.usage || 'None'}\``, inline: true },
          { name: 'ALIASES', value: text.joinArray(cmd.aliases) || 'None', inline: true },
          { name: 'COOLDOWN', value: `\`${cmd.cooldown}\``, inline: true },
          { name: 'Permissions', value: cmdpermissions, inline: true },
          { name: 'Examples', value: cmdexamples }
          )
        message.channel.send({ embeds: [embed] })
lament rock
#

That's great and all, but the first block of code you shared is flawed

#

use the typeof operator to get the type of something.
typeof "poggers" === "string"

#

typeof false === "boolean"

#

if (typeof something !== "string") console.log("something isn't a string");

slow terrace
#

oh

#

ok

lament rock
#

String is a ConstructorFunction

jaunty ore
#

can anyone teach me how to track down a system hacker?

hybrid cargo
crimson pike
#

๐Ÿคฆโ€โ™‚๏ธ

lunar patio
#

how do i make bot music join stage?

high crown
#

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.

#

what error is that?

#

anyone

#

ah wait

split hazel
#

there is one imposter among your bits

earnest phoenix
#

H

flat copper
#

error while pushing

cinder patio
#

don't push your node_module folder

earnest phoenix
#

guys

#

my bot is not replying

#

๐Ÿ˜ญ

#

client.once('ready', () => {
    console.log('Successfully logged into the bot.')
});

client.on('interactionCreate', async interaction => {
    if(!interaction.isCommand) return;
    const { commandName }  = interaction;
    if(commandName === 'ping'){
        await interaction.channel.send('Pong.')
    }
});
#
const discord = require('discord.js');
const fs = require('fs');
const botintents = new discord.Intents()
botintents.add(discord.Intents.FLAGS.GUILD_MEMBERS);
botintents.add(discord.Intents.FLAGS.GUILD_PRESENCES);
const client = new discord.Client({ intents: botintents });
const { prefix, token, bot_updates_channel } = require('./config.json');
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const rest = new REST({version: '9'}).setToken(token);
#

here is my code

next eagle
#

Hey Guys Can we use replit database with Node JS also? Or it is only valid for python?

cinder patio
#

@lost berry

next eagle
#

??

timber fractal
#

what does this mean? TypeError: players is not iterable

cinder patio
timber fractal
#

i wanna push their data to an array

#
const players = require('../../players.json').players;
        let keepers = new Array();
        for (const player of players) {
            if(player.keeper === true) {
                Array.push(`**${player.name}**\nPower: ${player.power}\n\n`);
            } 
        }```
nova basin
#

Hello how can I make a mobile version for my site (if possible also for tablet please)

cinder patio
cinder patio
timber fractal
#

used for player in players

worthy ivy
earnest phoenix
#
Error: Cannot find module '../../config.json'
Require stack:
- /home/runner/music-bot/src/modules/laffeyUtils.js
- /home/runner/music-bot/src/Laffey.js
- /home/runner/music-bot/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/music-bot/src/modules/laffeyUtils.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/music-bot/src/modules/laffeyUtils.js',
    '/home/runner/music-bot/src/Laffey.js',
    '/home/runner/music-bot/index.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! laffey@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the laffey@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-09-20T09_57_45_881Z-debug.log
exit status 1
๎บง 
#

what this error?

flat copper
#

but still

cinder patio
#

Then you haven't put node_modules in that .gitignore

earnest phoenix
#
home/runner/music-bot/src/events/message.js:24
        if (client.prefixes.get(message.guild.id)?.prefix) {
boreal iron
#

Ha! Was wondering where this douche isโ€ฆ finally he got banned.
Big thanks to marco_rennmaus. ๐Ÿ‘

earnest phoenix
carmine magnet
#

Wait no

#

Ok nvm

earnest phoenix
#

ok

carmine magnet
#

Whats the error?

earnest phoenix
high crown
#

guys

#

i need help

#

again

#

my bot is lagging

#

idk why

boreal iron
#

Measure the pings and check if that's an issue or your code might be the issue.

high crown
boreal iron
#

Well it's impossible to tell you where the problem coming from.
That's why I said just measure the pings to Discord and if these are okay, measure times in your script, like how long it takes from receiving an event until the response happens.

high crown
#

to measure it, I'm using guild map in console

#

and it is taking long ๐Ÿฅฒ

wooden kindle
#
       member.guild.defaultChannel.send(`Welcome to the server, ${member}!`);
       console.log(`${member.user.username} has joined`);
});```
#

why doesnt this work

earnest phoenix
#

do you have the intents enabled both in the dev portal and your code

wooden kindle
#

lemme go look

wooden kindle
#

FUCKKKKKK

#

it verified

#

how do i apply to get it

earnest phoenix
#

i dont really know but its like emailing to discord/making a ticket

wooden kindle
#

yea i just asked in there

#

@earnest phoenix what one do i need to tick

#

for it to work

#

server member

boreal iron
#

You will need another verification to get the intent.

earnest phoenix
wooden kindle
#

alr

rose warren
# wooden kindle how do i apply to get it

You send a ticket and wait for 8 months to get approved. You should include a proof of concept of what you're trying to do and why you need the intent. Otherwise you'll be declined.

#

I'm not sure about the 8 months but that's how long I had to wait anyway.

wooden kindle
#

yea ill send proof

#

i have the cmds ready

#

i just need perms

rose warren
#

Yep just make a test bot with the intent to be able to include screenshots etc of what they do.

wooden kindle
#

alr bet

wooden kindle
rose warren
#

Guild members

stiff lynx
#

throw new RangeError('BITFIELD_INVALID', bit);

help with this err?

#

idk why i still get it

grim aspen
#

library?

#

language?

loud ore
lyric mountain
#

nice

#

welcome to the jet

molten flint
#

Who know where i can host this api?

#

I cant leave my pc 24/7

#

nvm i find

rose warren
#

Anyone have any clever tips when making command files that work for messages and slash commands? dog_Joy I'm doing fine it's just I feel like there might be a better way to transition. This is a lot of work ๐Ÿ‘€

grim aspen
#

language?

rose warren
#

js

grim aspen
#

i'm assuming discord.js?

rose warren
#

Yep

grim aspen
#

i'm using command handlers currently, i recommend it

#

although it's much more difficult for understanding

rose warren
#

I've pretty much gutted the whole core of the bot and started over. I'm using command and message handlers then running the same command file just passing message / interaction to the command file.

solemn latch
#

Couldnt you just place each command in both its form(content/slash) in one each file.
then exporting each as its own export?

rose warren
#

And I've started using an event handler because things were getting messy

rose warren
#

At the moment I'm making them run off the same function

solemn latch
#

ah, then separating them entirely probably makes the most sense.

rose warren
#

I basically wanted them running off the same code so it's easier to maintain and the UX is the same

#

But idk

#

That has its limitations

sinful night
#

how to hosting bot 24/7 for free

grim aspen
#

@sinful night not possible

#

unless computer

solemn latch
#

google m1's are a good choice for free tbh.

rose warren
#

I've managed to do it for a few commands already but I have a feeling some of the more complex ones might be a bit of a nightmare

grim aspen
sinful night
grim aspen
#

glitch used to allow it but it had some limits

#

then it banned discord bots

solemn latch
sinful night
grim aspen
#

a vps is like $3

solemn latch
#

๐Ÿค” since when does github student give free hosting.

grim aspen
#

works better

#

do not use github

solemn latch
#

ohh

sinful night
grim aspen
sinful night
rose warren
#

My code is going to look nothing like it did before... Pretty much everything is being overhauled.

solemn latch
#

yeah, good thing you have like 10 months to do it still

#

9 months?

grim aspen
#

i do not reccomend repl because they set discord bot codes as public since it's shared. unless you wanna like by the pro plan which costs more

rose warren
#

April 2022 right?

stable eagle
rose warren
#

Idk when v6 of the API gets officially killed off

#

April 2022 is message intent

stable eagle
#

im sure every api version dies when april 2022 is here

except v9

rose warren
#

But Idk if v6 is a different date

grim aspen
#

wait they're getting rid of discord bots api for js?

rose warren
#

I guess that makes sense

#

API โ‰  lib

solemn latch
rose warren
#

The API v12 runs on will stop working

grim aspen
#

ohhhh

solemn latch
#

^

rose warren
#

djs v13 runs on v9

sinful night
solemn latch
#

sharing code publicly also isnt a bad thing.

rose warren
#

Man I have so much to do I need to stop procrastinating KEKW

solemn latch
#

id say over 90% of devs here have their most/all of their code publicly listed somewhere

grim aspen
#

it isn't bad but repl.it also shows hosted code

urban slate
#

guys can someone explain this error to me cause my bot is about to reach 75 servers and i am looking through the verification system of discord and lets just say i have been lazy before and just took all the intents but now i need to check what intents are actually required by my bot

rose warren
#

I don't open source anything I don't want ripped off by someone else

grim aspen
#

that means users can see your bot's token

solemn latch
#

not true ๐Ÿ‘€

#

code != token

#

replit can hide tokens on free tier

grim aspen
#

since when?

solemn latch
#

using env var

#

forever?

#

id presume

grim aspen
#

env is depricated

solemn latch
#

???

#

env is os level

#

it cant be depricated

grim aspen
#

try to do .env

urban slate
#

hey is there an intents calculator?

#

llike i got the number

#

but what intents does that number have

#

idk shit about intents

grim aspen
#

"you can create environment variables via the sidebar! (env files are deprecated)"

royal galleon
#

ye

sinful night
royal galleon
#

kk

grim aspen
#

huh, i thought i couldn't use it anymore

sinful night
#

how long do i need to get a bot approed to top.gg

livid jackalBOT
#

@sinful night

The average up-to-date approval times are stated [here](#support message).

This does not mean it will take the same amount of time someone else's bot took to be reviewed and does not mean your bot is guaranteed to be reviewed within that time frame.

There is no exact time for how long bot approval will take.

There is a queue and you're not first, nor are you last.

Read more about our reviewal process here.

grim aspen
#

average 1-2 weeks

#

or 3 on rare occasions

sinful night
#

ok i read it.

#

how can i being a verified bot developer

earnest phoenix
solemn latch
#

that badge is no longer given by discord

sinful night
solemn latch
#

bots can be verified, just you(verified bot developer) cant

sinful night
#

and... how can i find a server by server id?

solemn latch
#

via code? djs?

sinful night
sinful night
#

and how to be bot reviewers

solemn latch
boreal iron
#

That's what I thought, too

grim aspen
#

throw new TypeError('CLIENT_MISSING_INTENTS');
^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.

#

bruh

solemn latch
#

did you include intents?

grim aspen
#

fixed

solemn latch
#

^_^

grim aspen
#

no i had one extra piece of code

#

it wasn't needed

#

nevermind wasn't fixed

#

am i missing something here

pale vessel
#

rusty

#

show code

grim aspen
#

oh ffssss

#

i know what i did wrong

#

when i defined client, i never included intents

solemn latch
#

that is what the error says

grim aspen
#

when did they start requiring intents for command handlers

#

that wasn't a problem a week ago

solemn latch
#

not for commands handlers, its been a requirement for djs clients since v13

#

technically it was a requirement in v12 too, but it defaulted to all

smoky spire
#

v13 goes to api v9 which requires intents

timber fractal
#

why does this js for (let player in players) { if(players[player.keeper === true]) { await keepers.push(`**${players[player.name]}**\nPower: ${players[player.power]}\n\n`); } } return nothing in the "keepers" array

solemn latch
#

because [player.keeper === true] is a boolean

#

i assume players[true] or players[false] isnt what your trying to do

grim aspen
#

finally fixed

timber fractal
grim aspen
#

two new issues

solemn latch
grim aspen
#

embed, and message content cannot be an empty string

timber fractal
solemn latch
#

so it will never run

grim aspen
#

TypeError: Cannot read property 'fetchReply' of undefined

solemn latch
#

code?

eternal osprey
#

How do i check if an image is sent in djs v12?

solemn latch
grim aspen
#

oh wait wrong one

#

well actually that one needs fixing too

solemn latch
#

whats the error in that one?

timber fractal
grim aspen
#

cannot send empty message

solemn latch
timber fractal
#

finally someone who actually helps, thanks

solemn latch
grim aspen
#

YES

#

the error is included in the link

solemn latch
#

double check client.ws.ping is actually giving a response.

#

oh wait it wont be

#

since client isnt logged in

#

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
is a new, non logged in client.

grim aspen
#

ok so throw that code away

#

i'm presuming

solemn latch
#

in the code you gave me its not needed

grim aspen
#

wait so that means it

#

all the other code would just create a new client?

solemn latch
#

you shouldnt need a new client, unless you plan on logging into discord every time a command is run(pls no)

grim aspen
#

i'm sorry, i mean i'm importing old code to command handlers

#

oh boy

#

ok so one more thing

#

let's say i wanted to find guilds, would I just still use eval

solemn latch
#

find, like you wanted to find a guild personally?

#

or like find them in code

grim aspen
#

i mean like if i were to find the amount of guilds the bot is in, i would just find it through the eval command still?

#

i know how to do it, it's just i'm worried it would still require client to be defined

solemn latch
#

no matter where you are, you can get your logged in client

grim aspen
#

because the code would be like "client.guilds.cache.size"

solemn latch
#

for example, in a command run, interaction.client would give you client

grim aspen
#

through an eval

#

oh

solemn latch
grim aspen
#

ok

#

looks like some commands will be trashed today

solemn latch
#

why? ๐Ÿ‘€

grim aspen
#

some commands will require client to be defined

#

so instead of causing multiple clients to be logged in, getting rid of the commands that require that will make it easier

solemn latch
#

or just use const client = interaction.client

#

๐Ÿ‘€

#

or just use interaction.client directly

grim aspen
#

question

#

no wait nevermind

dreamy kindle
#

@fiery flame mamy dl addakm war gra kame eshm peta

signal estuary
#

When I do this:

await client.application?.commands.set(data);

The slash commands dont appear in every server. The appear in no server

boreal iron
#

Global commands need up to 1 hour to be visible in all guilds

signal estuary
#

Ah alright

signal estuary
boreal iron
#

This optional chaining doesnโ€™t make sense either, as commands is always a property of the application base
No commands means itโ€™s an empty collection

#

New slash commands will be rolled out automatically if the bot joins a new server as long as the invite contain the commands scope

signal estuary
#

and if I do this?

    client.guilds.cache.forEach(server => {
        await client.guilds.cache.get(server.id)?.commands.set(data)
    });
#

@boreal iron

worn sonnet
#

can anyone explain what is this doing?

var onDataCallbackRecaptcha = function(e) {
        document.getElementById("verification_string").value = e, document.getElementById("continue_button").style.display = ""
    },
    onloadCallbackRecaptcha = function() {
        grecaptcha.render("recaptcha_element", {
            sitekey: "6Lc5hC4UAAAAAEx-pIfqjpmg-_-1dLnDwIZ8RToe",
            callback: onDataCallbackRecaptcha,
            theme: "light"
        })
    },
    onDataCallbackRecaptchaHard = function(e) {
        document.getElementById("verification_string_hard").value = e, document.getElementById("continue_button").style.display = ""
    },
    onloadCallbackRecaptchaHard = function() {
        grecaptcha.render("recaptcha_hard_element", {
            sitekey: "6LdA778UAAAAAMsE9lC5_SPIOI3kwK2qNMshCu0o",
            callback: onDataCallbackRecaptchaHard,
            theme: "light"
        })
    };
#

I dunno JS and stuck here

urban slate
#

Whats the error?

worn sonnet
#

no error i wanna what does this code do

boreal iron
worn sonnet
#

kinda like what does that e mean and all

#

and why are they declaring function inside function

#

What happens when i call onDataCallbackRecaptcha

boreal iron
worn sonnet
#

umm...

#

you sure?

#

most of us are programmers here

grim aspen
#

@solemn latch

#

wait give it a sec

warped owl
#

how can i sync all channel permissions from the category
without going in particular channel and clicking sync now

earnest phoenix
warped owl
#

server

#

any bots who can do it

earnest phoenix
warped owl
#

i just need to find out that how can i sync all channel from the category

#

my all channels are in sync

#

but when i change catergory perms

earnest phoenix
#

just use a template

#

easy

warped owl
#

they unsync

warped owl
earnest phoenix
earnest phoenix
# warped owl then?

then you can search up google for templates or if any server owns the template then just say them to give thier template link and then add it to the xenon it will generate a code with that code you can change your server to the exact template

#

every permisson will be same as the template you took

warped owl
#

seems complex but i will give it a try

earnest phoenix
warped owl
earnest phoenix
#

my bot is still not replieng

#

spent 3 days figuring out the errr

#

and here;s the code

#
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');

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

client.once('ready', () => {
    console.log('Ready!');
});

client.on('interactionCreate', async interaction => {
    if (!interaction.isCommand()) return;

    const { commandName } = interaction;

    if (commandName === 'ping') {
        await interaction.reply('Pong!');
    } else if (commandName === 'beep') {
        await interaction.channel.send('boop')
    }
});

client.login(token);

waxen depot
#

22ms

grim aspen
#

what error?

earnest phoenix
#

the bot doesnt replies anything.

grim aspen
#

what is the error?

#

wait try deleting the awaits and async

earnest phoenix
lyric mountain
#

did u upload the commands?

boreal iron
lament stump
#

Does someone here know Canvas and has a lot of time?

#

Cuz I wanna make a profile command

still surge
lament stump
wooden kindle
#
  let channelID;
  let channels = guild.channels.cache;
  for(let key in channels) {
    let c = channels[key];
    
    channelLoop:
    if(c[1].type.toLowerCase() == "guild_text" {
      channelId = c[0];
      break channelLoop
    }
  }

  ch = guild.channels.cache.get(channelID);
  ch.send('Thanks for inviting me, you can use +help or +h to view my commads!')
})``` why da fook isnt this working or am i just stupid
#

its not giving me a error code

#

or anything

rose warren
#

You're not defining channelID anywhere

#

It looks like you have a typo near the middle of your code

lyric mountain
#

sensitive case kekw

rose warren
#

channelId should be channelID

vivid fulcrum
#

also .cache returns a collection... you can shorten that for loop to a one liner with .find()

wooden kindle
#

alr bet

wooden kindle
#

so its a embed now

rose warren
#

Thanks for the ping ๐Ÿ‘

wooden kindle
#

do i still not have reply mentions off

#

sorry

#

it keeps turning back on every time i start up discord

#

sad times

tribal pine
#

is anyone using Golang for their bot?

boreal iron
#

do i still not have reply mentions off
Huh is there a way to do so?

green kestrel
#

so discord got a new secret feature

#

it can time travel

grim aspen
#

looks like an epoch fail

green kestrel
#

groan

lyric mountain
blissful coral
#

dafuq

#

Oh wait

#

I am dumb

#

LOL

errant flax
#

hows that possible

blissful coral
#

name link

#

not link name

errant flax
#

oh

#

oh now i get wym

#

the formatting misosface

proven lantern
#

are there any discord rules about creating a skinned clone of your own bot?

#

like is that against the rules

#

if i create a team will they have access to all my bots or only ones i specify?

ashen pier
proven lantern
ashen pier
#

anyone have this file for the dog

proven lantern
#

like the image?

lyric mountain
ashen pier
lyric mountain
#

Safari?

#

Oh wait, discord desktop?

wooden kindle
#
  let channels = guild.channels.cache;

  textchannels = channels.filter(c => c.type == "text");
  cnl = textchannels.map(c => c.id);

  console.log(cnl)

  ch = guild.channels.cache.get(cnl[0]);

  console.log(ch);

  const Embed = new Discord.MessageEmbed()
    .setTitle('')
    .setDescription(``)
    .setColor(`RANDOM`)
    .setURL(``)
    .setTimestamp();
  ch.send({embed: Embed}).catch((e)=>{console.log(e)});
})```

This Is If You Want To Have A Message Sent When Your Bot Joins a Guild
**IMAGE FOR E.G**
errant flax
#

how do i update a collection with the new mongoose update

grim aspen
#

TypeError: Cannot read property 'split' of undefined

#

trying to do args with interactions and command handler

solemn latch
#

whatever you are doing .split on is undefined, what is it?

grim aspen
#

i am trying to use args in a command handler

solemn latch
#

you need to define args then

grim aspen
#

lemme see

#

const args = interaction.content.split(/ +/).slice(1);

#

i'm not sure if i did it correctly

errant flax
#

slash commands or any interactions doesnt have a content

grim aspen
#

so it would be interaction.split

errant flax
#

no lmfao

#

discord already handles arguments for u?

#

in slash commands btw

grim aspen
#

ffs

#

no don't star that shit

#

i get the point

errant flax
#

no i will

#

btw how u get args is by
<CommndInteraction>.options.get("argsname")

#

@grim aspen ^

errant flax
grim aspen
#

the thing is i've been using discord.js v12 a year ago and i discontinued my bot til now. i am trying to merge my old code into command handlers. it's that one line of code literally worked with v12. i am trying to get through the struggle of being a dumbass with command handlers.

nova basin
#

Hello I am making a website for my bot and I am making several pages for the site all worked well but when I leave on another page on the link of the site it puts name-of-site/exo.html it puts the name of the file for the second page and how I could make it put name-of-site/commands please?

errant flax
#

use djs v13

#

djs v12 doesnt do slash commands or any other interactions

grim aspen
#

did you read what i said?

errant flax
#

unless u do some magic

solemn latch
#

might help to read the changes

grim aspen
#

i have never used command handlers til just this month

lyric mountain
solemn latch
#

every change listed in one location

#

handle every single one, all at once.
for example, if you used the old arg system(making it yourself, to using interaction params), swap every command at the same time to the new one

#

will save you a ton of time

grim aspen
#

The code and split options have also been removed. This functionality will now have to be handled manually, such as via the Formatters.codeBlock and Util.splitMessage helpers.

#

fuck

solemn latch
#

split is native to js

#

it hasnt been removed, it cant be

grim aspen
#

it literally says it has

solemn latch
#

error?

grim aspen
#

...

errant flax
#

how do i update an index in a collection or something with the new mongoose update

grim aspen
#

in the html guide you sent, it says split has been removed

solemn latch
#

oh, split for message object?

#

thats not for things like strings, or arrays

grim aspen
#

lemme go back into my code real quick

lyric mountain
#

Watch me break js in 3 easy steps

errant flax
lyric mountain
#
String.prototype.split = String.join
errant flax
#

that took u long enough to write that jk

solemn latch
lyric mountain
#

Mobile

solemn latch
#

imagine if djs did that

grim aspen
#

i'm going back to v12 til i can learn v13

#

i'm too much of a dumbass with command handlers, and the code is too complicated for me to even use

lyric mountain
#

That's not a wise thing to do

grim aspen
#

well it's the only thing to do when you have to learn v13

lyric mountain
#

Then learn v13

#

Procrastination will only make you stick to v12

grim aspen
#

THAT'S WHAT I'M DOING

lyric mountain
#

Which will die very shortly

lyric mountain
grim aspen
#

until i can learn v13

lyric mountain
#

Learn while you use it

#

V12 is not a solution, it is bound to die when message intents become a thing

grim aspen
#

i can probably figure it out before then

lyric mountain
#

I'd not risk it

#

Migrating code is way harder than it looks

quartz kindle
#

v12 wont die just from that

grim aspen
#

isn't v12 going to not be a thing in december or something?

quartz kindle
#

its deprecated and no longer supported, but discord hasnt released nor announced any change that would break it yet

#

v12 supports intents, so the message intent wont break it

#

it just wont support new features

grim aspen
#

but is still temporarily usable right?

#

or am i fucked

quartz kindle
#

it should still be usable for a while

grim aspen
#

then that should give me time

errant flax
#

die*

#

shit