#development

1 messages Β· Page 1700 of 1

earnest phoenix
#

No, the CDN link to discord user avatars

frigid mountain
#
const Discord = require('discord.js')

modules.exports = {
    name: 'record',
    run: async (message, args) => {
    const avatar = `${message.author.displayAvatarURL({dynamic: true})}`
    const embed = new Discord.MessageEmbed()
    
    .setTitle("Voice Recording")
    .setColor("RANDOM")
    .addField("**How does it work**\n - !record in a voice channel records your voice\n!play-audio plays last aduio from author\nabusing/spaming is forbidden", false)
    .setThumbnail(avatar)
    .setFooter("play audio")

       message.channel.send(embed)
    }
}

Now working did I forget something?

lost heath
#

oh yea. i didnt read thru the entire docs. clearly. because if i had! I MUST HAVE UNDERSTOOD IT!

vernal moth
#

OH

lost heath
#

riGHT?!

#

thats not how it works

vivid fulcrum
#

yes it does

tacit sequoia
#

Lmao.

pale vessel
#

it is

candid harness
#

poggies

lost heath
#

bye

earnest phoenix
#

KEKW wtf is going on

tacit sequoia
#

Love the Toxicity PB_Clown

vivid fulcrum
#

if a book says "A banana is yellow" then you understand the banana is yellow

#

reading with understanding ✨

candid harness
#

its honesty not toxicity

lost heath
#

if anyone here would be willing to help me. then tag me. if not then fuck off and leave me alone. im going out of this chat now

summer torrent
earnest phoenix
tacit sequoia
#

When you read something you dont understand it straight away, you know. Everyone is different

#

So something which may apply to you or other experienced developers may not happen to others

vivid fulcrum
frigid mountain
tacit sequoia
lost heath
tacit sequoia
#

Ya

summer torrent
#

if you don't want to learn then stop crying and yelling at people

earnest phoenix
candid harness
#

listen, you cant understand something if you dont learn it, you cant read it once and understand

vernal moth
#

hmm

candid harness
#

takes time

earnest phoenix
#

Bro

#

"This sign isn't gonna stop me, because I can't read"

vernal moth
#

sorry im dumb sometimes

candid harness
#

lemme just drive this plane fuck tutorial

candid harness
#

green means start right?

earnest phoenix
pale vessel
frigid mountain
earnest phoenix
vivid fulcrum
#

tip: you don't even need an extension, discord will automatically decide what's the appropriate image format to return

earnest phoenix
#

how does it not work exactly?

#

Is it not responding? Giving errors? Issues?

pale vessel
#

it just doesn't work :|

frigid mountain
frigid mountain
candid harness
#

show any error or code

earnest phoenix
#

Society

vernal moth
pale vessel
#

/avatars/

vernal moth
#

OH

earnest phoenix
#

PepegaBlind moment

pale vessel
#

Why blind?

earnest phoenix
vernal moth
pale vessel
vernal moth
#

even in the gif form lmao

#

I uploaded gif when I had nitro

pale vessel
#

they followed your old one

vernal moth
#

but my nitro expired but the gif is still there

earnest phoenix
#

I guess

vernal moth
#

LOL

vivid fulcrum
#

lol so

#

discord doesn't actually delete the gif

#

they just make everyone who's viewing the profile use .png

vernal moth
#

xD

#

yep

frigid mountain
vernal moth
#

It works perfectly :D

earnest phoenix
#

Also I think you can pass the <InteractionResponse>.member.user to <discord.js>.User() class to make it easier to deal with

vernal moth
#

thank you so much guys! :DDDD

candid harness
vernal moth
#

also yes 1st of september is my bday lol

earnest phoenix
frigid mountain
candid harness
#

type this in console: node --version

#

does it return anything?

frigid mountain
#

v12

candid harness
#

then how doesnt it run anything ;d

#

maybe your file.js isnt listening

earnest phoenix
#

Refer to my message I guess?

candid harness
#

showing any code would be epic

frosty valve
#

this code string doesnt work for me

let user = message.mentions.member.first() || message.guild.members.cache.find(c => c.user.username === args.join(" ")) || message.guild.members.cache.find(m => m.user.tag === args.join(""))``` the error says it doesnt know what .first is
pale vessel
#

members

frosty valve
#

now it cannot read property of 'id'

#

pog

old cliff
#

you aren't searching for id anywhere

frosty valve
#

another code line

#

let me send it

#
    if(user.id === message.author.id) return client.send("You can't ban yourself cutie!")
    if(user.id === message.guild.ownerID) return client.send("No one is able to ban that user!")
    if(user.hasPermission(["ADMINISTRATOR"])) return client.send("That's a admin of this server! >:(")```
pale vessel
#

check if user exists before accessing its properties

frosty valve
#

that let is before that code

#

so it exist

pale vessel
#

yeah but it could be undefined

knotty sigil
#

Did discord removed guildMemberAdd?

river panther
#

no?

#

shouldn't it be async(member)

pale vessel
#

or async function(member) {}

knotty sigil
#

btw they removed it

pale vessel
#

They didn't

#

Do you have the guild members intent?

#

If you don't, the event won't trigger at all

river panther
#

^

tired panther
#

Does someone know how I can pass 3000objects in Array on clustering to each process?

lusty quest
#

did you have a master node?

cinder patio
#

worker.send

earnest phoenix
#

how can I send message to mentioned user discord.js?

lusty quest
#

.reply()

#

instead of send()

earnest phoenix
#

to DM

lusty quest
#

fetch the user then call .send() on the user object

earnest phoenix
#

I tried js let theAcceptedUser = message.mentions.users.first(); theAcceptedUser.createDM.send(acceptEmbed)

lusty quest
#

why do people still use var

#

is createDM a thing?

earnest phoenix
#

it was according to docs

tired panther
earnest phoenix
vivid fulcrum
#

it's a method

#

not a property

#

and it's also a promise

sick fern
#

I always get this error and it's kinda annoying

Fontconfig error: Cannot load default config file and` }).catch((err) => message.channel.send({embed: {
^

typeerror: cannot read property 'catch' of undefined
at object.run (/.../hum/commands/general/invite.js:30:11)
at module.exports (/.../hum/events/guild/message.js:26:38)
at processticksandrejections (node:internal/process/task_queues:94:5)`

After this the bot goes offline

lusty quest
#

did you call it on a promise?

earnest phoenix
#

I'll just use .send method

sick fern
#

I never got this before

lusty quest
sick fern
lusty quest
# sick fern ??

so you just throw together stuff without knowing what it does?

sick fern
#

-_-

lusty quest
#

on what method did you call .catch()?

steep drum
#

You can only use .catch() on a promise, if you don't know what a promise is, study up on a tutorial

sick fern
#

Oh alr but then what about Fontconfig error

onyx hare
#

i got told off by my bot for .catch(console.error); not being a function to catch a error, but thats the function of that to catch an error when a error is found xD

sick fern
#

Smh

cinder patio
#

well, default* way

#

there are other ways but I think this one should be fine for any amount of objects

tired panther
#

okay

earnest phoenix
#

What are recommend cooldowns for role add/remove?

#

Can you revert git commits on github web/mobile?
Gitbook added shit to my repo to "sync" with the gitbook space and i dont want it

earnest phoenix
unreal estuary
#

im drawing text on my html5 canvas but when i set a max width to it it looks really ugly and squished

#

i need the text to fit inside an image so what should i do

steep drum
#

I don't know what font config is but your error is saying it can't load the file. So make sure the file is where it expects and contains what it expects

tulip ledge
#

Can anyone tell me why this doesn't work?

if (x === 7) context.fillText(["A", "B", "C", "D", "E", "F", "G", "H"][y], (y*100 + 5), 795);

But if I manually set the "y" to a value like 2 for example it does work? And if I log y it is defined and a number between 0 and 7

pale vessel
#

what's x and y?

tulip ledge
#

2 for loops inside each other from 0-8

#
    for (let y = 0; y < 8; y++) {
      for (let x = 0; x < 8; x++) {
        context.beginPath();
        context.fillStyle = ["#F0D9B5", "#B58863"][(x + y) % 2];
        context.fillRect(x * 100, y * 100, 100, 100);
        context.font = "30px Impact";

        // Fill text and letters
        context.fillStyle = "#ff0000"//["#B58863", "#F0D9B5"][(x + y) % 2];
        if (y === 7) context.fillText(x+1, 775, x*100+35);
        if (x === 7) context.fillText(["A", "B", "C", "D", "E", "F", "G", "H"][y], (y*100 + 5), 795);
        context.closePath();
      }
    }
#

this is what I have rn

#

if I change the y to 5 for example I get this:

earnest phoenix
latent heron
#

@slender thistle have you messed with discord.py voice bots before?

#

i'm about to go one step up and start actually competing for something really cool

slender thistle
#

nae

latent heron
#

I have reaction, manual and automatic translations coded in

slender thistle
#

Never worked with audio in Python

latent heron
#

mmLol now i want to cry and try audio translations

slender thistle
latent heron
#

and I know it's possible at least with video files with subtitles

#

because i can extract the rip

slender thistle
#

Another way of saying that is "I feel like giving up on myself"

latent heron
#

fair

#

but if i'm at least somewhat 50% successful

#

it's going to outplay every other translator bot on Discord there is

#

and at that point, my source code will instantly go private instead of open-source rn

#

it would need the highest state of the art Speech to Text conversion there is, and all I can think of right now may be Google Cloud's Speech-to-Text API

#

because unlike Google Translate, that shit is really high grade

vivid fulcrum
#

i wasted the entirety of the $300 credit on a random account

#

just on speech-to-text

#

it's expensive but it's so good 😩

latent heron
#

i can imagine its expensive

#

right now i don't get enough funding through Patreon nor' my job to handle it but hopefully in the future I will

tacit sequoia
#

What will? Just curious

latent heron
#

oh

#

it's my personal translator bot

tacit sequoia
#

Ah

opal plank
#

i will translate languages into js, jsfuck and pirate language, therefore making it the ultimate translation bot

tacit sequoia
#

Lmao

latent heron
lusty quest
#

sadly translation bots are expensive to run, good translation APIs are so fricking expensive

#

and making your own is just not worth the efford

latent heron
#

that's so painfully true

tacit sequoia
#

There are some modules out there which do "free" translations by making authenticated requests to translate.google.com

lusty quest
#

if its free it sucks or has a major drawback

tacit sequoia
tacit sequoia
#

I use those types of modules for my translation bot, lol. I'm a cheap guy πŸ˜†

earnest phoenix
#

That’s sad

#

Your translate thing is looking lit @latent heron

latent heron
#

thanks

#

i still don't feel satisfied with it though

#

internally i mean, the code feels wrong

tacit sequoia
#

How so?

crimson vapor
#

fl0w for your bot do you host a websocket or only a webserver?

latent heron
#

i run it on my PC

crimson vapor
#

that doesn't answer the question eyesshaking

tacit sequoia
#

Doesn't need web server, just posts to webhook

latent heron
#

^

tacit sequoia
#

Websocket

latent heron
#

I use the RequestsWebhookAdapter class in d.py

#

so it's just JSON request based

manic light
#

which one is better ?

tacit sequoia
#

Uh the incorrect spelling is sus

lucid prawn
#

help pls

earnest phoenix
#

Why my bot restarts when it got any error like missing perms in any server?

#

Why did it restart

steep drum
#

Guild is undefined

lucid prawn
steep drum
#

The error says it's not

#

What happens when you console log guild in the set interval?

#

That's because guild.channels doesn't have a find function. At least not that I can see in the documentation

#

You probably meant to do it in the cache, which is a collection and does have a find. But your input into the find is also incorrect. It expects a function

latent heron
#

very, very primitive design of the commands page i want to make

#

@drifting shell thoughts?

pale vessel
#

looks like discord's

latent heron
#

thats my goal tbqh

pale vessel
#

I like it

latent heron
#

users are very used to seeing discord's UI

#

so i want to see if designing it like that will make it easier to understand

pale vessel
#

The description is really small though

#

Compared to the command name/usage

tired panther
latent heron
#

ah

#

it's designed in Figma and then I code it into HTML/CSS

#

it's going to look proper once you see it on the website

#

this is how it would appear in 1080p

#

it actually needs to be scaled down a lot if anything πŸ˜‚

pale vessel
#

Yeah

latent heron
pale vessel
#

I was referring to the /trl text

latent heron
#

ahhh

pale vessel
#

Oops

latent heron
#

hmm yeah it is a little big

pale vessel
#

The description lmao

earnest phoenix
#

Guys how do I make a command which automatically gives the voter rewards when he votes my bot

lusty quest
pale vessel
earnest phoenix
#

Guys how do I make a command which automatically gives the voter rewards when he votes my bot

latent heron
#

i'll tweak it down a bit then

#

oh my god can you not

latent heron
earnest phoenix
#

Also dont spam the same message

latent heron
#

thats literally an API question

earnest phoenix
#

it's basically #dead-channel-xd

earnest phoenix
#

We dont have ones for servers iirc

latent heron
earnest phoenix
#

@earnest phoenix do you only want to assign a role to people who vote your server?

pale vessel
#

Just a littleeee smaller

latent heron
#

agghhhh

#

i'll have to fix it tonight, im out of time πŸ˜‚

earnest phoenix
latent heron
#

because it's automatic

earnest phoenix
#

what

earnest phoenix
latent heron
pale vessel
#

Where's the option for text though

latent heron
#

you send the message

#

and it translates it for you

earnest phoenix
latent heron
#

there is no requirement for a text option field

earnest phoenix
#

which one exactly do you want

pale vessel
#

Oh

earnest phoenix
#

Heyyy

#

Btw where is logs channel

#

rewarding people with stuff for voting bot: https://top.gg/api/docs
rewarding people with roles for voting server: look into dsl

earnest phoenix
latent heron
#

i can show you it in the support server if you want

earnest phoenix
latent heron
#

i don't think i'm allowed to post an invite in the server though

earnest phoenix
#

Btw I see this

lusty quest
#

you need to be logged in iirc

pale vessel
earnest phoenix
#

Iirc??

lusty quest
#

?

earnest phoenix
pale vessel
latent heron
#

would you like an invite link flaz

pale vessel
#

@latent heron I'm fine

latent heron
#

oh wait i think the bot is still in the Secretℒ️ server

#

the 69 one

earnest phoenix
#

Pls explain how trla gets the text i want to translafe

pale vessel
#

It says this interaction failed

earnest phoenix
#

Uh guys

#

You only have an option for target lang

#

Is my bot good?

#

maybe

pale vessel
#

ping and help

earnest phoenix
#

not a place to ask for suggestions

#

@earnest phoenix hey my bot also has server configuration commands like u can disable rob and enable rob within a server

#

More 100 commands

opal plank
#

smells like discord bot maker

lusty quest
#

sometimes less is more

earnest phoenix
pale vessel
earnest phoenix
#

?

#

i dont understand weeb talk

pale vessel
#

That's english

opal plank
earnest phoenix
#

or is it

#

How to disconnect bot from vc If there is inactive for limited time after a join command.

opal plank
#

check for the amount of people in that channel

#

if its 1 (aka only the bot is there)

#

then you can do a setTimeout()

earnest phoenix
#

oo

opal plank
#

once it runs, check if there are still 1 user only(aka, the bot itself)

#

scuffed but will work

earnest phoenix
#

Noice

opal plank
#

you'll need more setup if you wnat it more fail-safe

earnest phoenix
#

I'll

crimson vapor
#

hi Erwin

opal plank
#

why are you guys starring that?

cinder patio
#

you tell me

crimson vapor
#

what the fuck

#

why did you star that

#

man

earnest phoenix
#

can somebody fucking explain why i cant revert commits on github web

crimson vapor
#

no clue

earnest phoenix
#

or on the github mobile app

crimson vapor
#

its dumb

earnest phoenix
#

github killed two platforms with one stone

#

android users and linux users

cinder patio
#

github has a mobile app?

#

why

earnest phoenix
#

(u cant install github desktop on linux)

opal plank
#

git revert head

earnest phoenix
#

@opal plank how the fuck am i gonna execute that on mobile

opal plank
#

terminal?

#

ssh?

earnest phoenix
#

Git is usable on Termux

#

shh

opal plank
#

git should be installed on ur thing no?

earnest phoenix
#

im just a sad kiddo trying to revert gitbooks shit

#

I have a full version of Kali Linux on my Android

#

with a GUI that I can connect to with a VNC

opal plank
#

git kraken might be a thing on mobile

#

though im really not sure

crimson vapor
#

wait what the fuck you never said hi back

opal plank
crimson vapor
#

thank you

onyx hare
#

this would work right?
message.react(":bomb:" + ":boom:")

opal plank
#

no?

earnest phoenix
#

no

cinder patio
#

I mean

opal plank
#
await message.react('πŸ’₯');
await message.react('πŸ’₯');
``` will tho
earnest phoenix
#

@opal plank it's the same emoji

opal plank
earnest phoenix
#

message.react("Theodore John Kaczynski" + "πŸ’£" = "πŸ’₯")

opal plank
#

what

earnest phoenix
#

nothing

opal plank
river panther
river panther
opal plank
#
function handlerError(message, em, ...args: any[]) {
  console.log(args);
  console.log(`Error reacting to message ${message?.id} and emote ${em}`);
}
(async function reactTwice(message:Message, emotes: Array<string>) {
  if(!emotes) {
    console.error('Fatal, no emotes array provided.');
    process.exit(1);
  }
  for (let em of emotes) await message.react(em).catch((err) => handlerError(message, em, err));
})(message, ['πŸ’₯'])
```@onyx hare 
here, a simple code to react to a single message
opal plank
earnest phoenix
#

Tbh I've never even attempted to make a Discord bot, but I really should

river panther
opal plank
#

sounds sexist, i'll pass

river panther
#

wot

earnest phoenix
#

sexy*

river panther
#

WOT

earnest phoenix
river panther
#

0.0

crimson vapor
#

ok

opal plank
#

its a simple good way to handle reactions

#

instead of the bad message.react()

#

might publish on npm

crimson vapor
#

pretty good

#

does its job

#

would get so many uses

#

1/2 typed tho what the fuck

opal plank
#

nothing to be concerned about

#

dont blame the package

crimson vapor
#

its my fault isnt it

opal plank
#

blame the user for having bad strict ts settings

crimson vapor
#

eI see I se

opal plank
#

El see I SE

crimson vapor
#

me when strict

opal plank
#

actually

#

where is it

#

1 sec

misty sigil
#

what about neverStrict

opal plank
#

add this to your code

cinder patio
opal plank
#

cuz good variable names

#

even though it doesnt react twice

crimson vapor
#
{
"noImplicitAny": true,
"allowJs": false,
"strict": true
}```
cinder patio
#

trash

crimson vapor
#
process
  .on('uncaughtException', () => {
    process.exit();
  })
  .on('unhandledRejection', () => {
    process.exit();
  });```
opal plank
cinder patio
#

At least don't make it self-invoking so it's reusable

opal plank
#

feud

crimson vapor
#

wait

opal plank
#

you seem to be missing the point

crimson vapor
#

does this force you to have no errors?

opal plank
#

thats suppose to be trahs code

crimson vapor
#

or it crashes?

cinder patio
#

maybe

slim heart
#

too strict

#

hate it

opal plank
#

hence why its called a challenge

cinder patio
opal plank
#

that was pre node 15 tho

crimson vapor
#

I catch all my errors bro

#

dw

slim heart
#

well rose was made with strict: true but i have to turn it off cuz tsc is fucking weird

#

it like

#

crashed whenever i had strict true

#

while it was compiling idk

#

in order to fix it i had to remove a line from tsc.js lmfao

crimson vapor
#

update your tsc

#

lol

quartz kindle
#

ts is a good language :^)

cinder patio
#

ur probably not doing something properly

slim heart
#

but then i couldnt compile it in github

opal plank
#

and i'll bite you if you say otherwise

quartz kindle
#

yes it is

crimson vapor
#

what are you an anime loli?

quartz kindle
#

a "good" language

#

xD

crimson vapor
#

biting people

slim heart
#

it was a max call stack size exceeded error

crimson vapor
#

yeah

drifting shell
crimson vapor
#

update your ts

opal plank
#

imagine not using ts nightly builds

crimson vapor
#
    process
      .on('uncaughtException', process.exit)
      .on('unhandledRejection', process.exit)```
slim heart
#

lmao i just have a github action to push to a build branch

cinder patio
#

It gives you a false sense of security which is kinda meh but still better than nothing

quartz kindle
#

@opal plank remember the astro calculation lib? my .d.ts is already 3.3k lines long

#

and still not finished

opal plank
#

tsc can make the declarations for you

crimson vapor
#

yeah

#

just use ts

quartz kindle
#

its not the declarations

slim heart
#

hence why you make packages in ts

quartz kindle
#

the declarations are all done

opal plank
#

you the one who chose to port cpp

quartz kindle
#

its the jsdocs

opal plank
#

same shit

quartz kindle
#

its not

crimson vapor
#

@opal plank

#

pushing rn

quartz kindle
#

one is actual docs, the other is just type declarations

opal plank
crimson vapor
#

im node 14

#

wait

quartz kindle
#

no need for this anywhere in any js version

#

dafuq

crimson vapor
#

it crashes on 15?

opal plank
#

node 15 crashes for you

crimson vapor
#

LOL

opal plank
#

cuz unhandled promises

#

like a champ

quartz kindle
#

any node crashes for you

crimson vapor
#

they were deprecated

#

pog

slim heart
#

fr?

quartz kindle
#

dafuq you on about

slim heart
#

thats annoying

opal plank
#

it doesnt

#

it just errors

#

node 15 ACTUALLY closes the process

quartz kindle
#

it does if it boubles up to the main event loop

slim heart
#

can you atleast void it

quartz kindle
#

and uncaught exceptions always crash

crimson vapor
#

you shouldn't be able to

#

since you need to catch promises

#

I pushed @opal plank

quartz kindle
#

thats just stupid

crimson vapor
#

the way I do my commands it shouldn't matter I think?

quartz kindle
crimson vapor
#

yeah bro

#

my commands don't kill the bot

#

pogging

opal plank
#

ik, but its also closing the process

#

prior to 15 it just errors

crimson vapor
quartz kindle
#

yes unhandled rejections now crash the process

#

but that doesnt mean you're supposed to use the events

#

you never were

opal plank
#

well yeah, thats what im saying

quartz kindle
#

let alone force it to exit on the event lul

opal plank
#

adding that will to any prior to v15 will also have a similar effect

#

will crash on unhandled rejection

#

also

quartz kindle
#

no idea why you would want to do that

#

but ok

opal plank
crimson vapor
#

it is ts

opal plank
crimson vapor
#

why would it not crash?

opal plank
#

not ts

#

detritus

crimson vapor
#

its not detritus smh

opal plank
#

i got my mind stuck on ts for some reason

crimson vapor
#

discord-rose

opal plank
#

detritus has its own handler for errors

crimson vapor
#

so does rose

opal plank
crimson vapor
#

lemme see if I can remove the error handler

slim heart
quartz kindle
#

so what happens if an error is fatal and if an error is not fatal?

slim heart
#

non-fatal errors dont log to console

#

you can make your own error handler the nonFatal part is just for the default

quartz kindle
#

ah so non-fatals are sent as a message

crimson vapor
#

yeah

slim heart
#

all errors are

#

but non-fatal ones dont log to console

crimson vapor
#

default shit

slim heart
#

i also plan on changing the throws to ctx.error(message) instead since that just does with the nonFatal

crimson vapor
#

doesn't that already exist tho

slim heart
#

yes

#

i mean changing the internal usage

crimson vapor
#

ah

crimson vapor
#

what

opal plank
#

imagine coding instead of watching monogatari

#

shamefull stare

crimson vapor
#

:loli_dance:

lusty quest
#

@opal plank what does detritus have over d.js exept better ram usage? i might switch if its enough reasons.

crimson vapor
#

oh no

#

not this

slim heart
#

i mean ram alone should be enough lmfao

lusty quest
#

i have a dedicated root with 64GB ram Aviable, i would not care if the bot would use 10GB of it

slim heart
#

how big is your bot

lusty quest
#

there would be probably some memory leak but nah

#

the one i plan to port currently about 40 Guilds, got a larger one that is stuck at around 270 Guilds, but i guess i will EOL this one with the D.js V13 update

slim heart
#

i mean realistically then there's no true reason to switch

#

unless you're like bored or something

lusty quest
#

to answer why i have the root is that the smaller bot runs an AI and a VPS with specs to run the AI properly is more expensive than the root for lower specs

slim heart
#

djs has stability issues but they're minute on small scale

lusty quest
#

im bored anyways, i guess i will port the bot to something else, if im bored enough maybe even C# but there is the issue that i need to learn more C# first. and i have no idea how to implement some stuff that the bot currently does in C#

cinder patio
#

C# is pretty easy

lusty quest
#

i know, but im currently in some weird motivation, i want to code something, but then again C# would be nice to know, but then again im not in the mood to learn it rn

cinder patio
#

I feel ya

lusty quest
#

would also like to learn Rust, know some basics of it, but some stuff in the lang is just weird.

slim heart
#

no matter what anyone here says ignore them, rust isnt a good language to use for discord bots kekw

cinder patio
#

why not

slim heart
#

rust is only popular here because it's a boredom language

lusty quest
slim heart
#

people only pickup rust because their bot isnt gaining servers and they're bored

lusty quest
#

on a technical level rust is nice language, really fast in execution.

slim heart
#

and then they only learn the basics and add it to their "i know the basics in 40 languages" speil

cinder patio
#

Rust is great

#

I don't know it that well but

slim heart
#

my point

cinder patio
#

I'm not claiming I know it though

#

but I do know it's good

slim heart
#

rust introduces some interesting problems and challenges that you need to be an advanced rs user to deal with, people like zoro can figure them out, but unless you want to get down and dirty with it, going from a js user to rewriting your bot in rust will make your life more difficult

cinder patio
#

The only thing I struggle with is ownership

modest maple
#

generally i wouldnt recommend Rust for discord bots

cinder patio
#

Implementing a simple data structure is not so trivial in rust

modest maple
#
  1. the performance isnt noticeable because you spend most of your time waiting for IO
  2. the lack of dynamics in this case is more of a negative because things like hot reloading etc... is out the question (to do sanely)
near igloo
#
if (message.content.startsWith("+eval") && ((message.author.id == "827796221510549515") )){
        message.channel.send("` ``" + JSON.stringify(eval(message.content.substring(6, message.content.length))) + "` ``")
}```
modest maple
#

would i use rust for a distribution gateway? yes and i do

#

would i write the whole bot in it? god no

umbral zealot
onyx hare
#

the command turned out perfect.. nearly the cache did a great job making names numbers

near igloo
modest maple
#

yikes

near igloo
#

i just need you to help me make +eval message.author.send(content) work

umbral zealot
near igloo
#

i can deal with the eval

umbral zealot
#

it'd be funny if the error was that the eval was crashing somehting, I dunno

near igloo
umbral zealot
#

I can't even remember what your problem was

near igloo
#

trust me its not the eval cmd

umbral zealot
#

which 100% cannot be caused by sending a DM to a user, and that's the funny part

near igloo
#

ive done it straight in some code and it was same issue

#

hold on lemme test something

umbral zealot
#

I mean are you saying you've never sent a DM to yourself with the bot?

#

what if oyu run this command in DMs?

near igloo
#

ill try message.reply()

umbral zealot
#

what version of discord.js are you on?

#

npm ls discord.js

near igloo
#

message.reply works... πŸ€”

near igloo
#

i can try to update if its the issue

#

but ik i havent updated since it last worked

slim heart
#

100k bot on rose starts in 50 seconds and uses 3GB of RAM with default caching

#

big pog

lusty quest
#

i wish i would get a Unique idea that is not to niche for a bot. sure a large bot is a bit of Headache to manage but would be fun too i guess.

slim heart
#

big multipurpose bots like rarely blow up

lusty quest
#

bots that do to many things at once are bad, its like with tools, if it does everything it does everything mediocre

#

the 2 Bots ive made public are mostly focused around what they are designed for, not really a ton of commands to bloat it.

#

i have somewhere my Poll bot that i havent made Public, the Polls work quite decent and it uses Chart.js to render a Graph when the poll is done, but im not sure if its worth to make public.

#

also for making it public ive probably have to rework some stuff, like currently it uses MongoDB for storing the Poll informations together with an end Timestamp, but i guess using Redis would be better. (or MongoDB offers a Event that is called when a TTL runs out)

onyx hare
#

i got told this would work if someone mentioned my bot for a reminder of the prefix, i testing it and got no results

const escapeRegex = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
client.on('message', message => {
    const prefixRegex = new RegExp(`^(<@!?${client.user.id}>|${escapeRegex(prefix)})\\s*`);
    if (!prefixRegex.test(message.content)) return;

    const [, matchedPrefix] = message.content.match(prefixRegex);
    const args = message.content.slice(matchedPrefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();

    if (command === 'prefix') {
        message.reply("To Use Me , My Prefix Is The Following `c!`");
    }
});
#

was-

slim heart
#

@opal plank dont u have a guide on dbl html/css

brave tendon
#
UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

why would the bot say that? I handle all promise and the invite link is also correct with the permissions

lusty quest
#

maybe a channel override?

brave tendon
#

nop

lusty quest
#

or permissions changed after the invite

#

anyways before you make stuff that need permissions, check if you have the permissions to run it, this will limit somewhat unnecesary API calls

brave tendon
#

the bot does check if it has the permissions it needs

lusty quest
#

before executing the command?

brave tendon
#

yes

#

it's the first thing that happens when someone wants to execute a command

lusty quest
#

then it should return before it throws the error

brave tendon
#

when I tested now with removing perms the bot did return but still throw the error

lusty quest
#

then you have something else in the flow that needs permissions for no reason

brave tendon
#

oh damn

#

why it needs perms for things it doesnt even use

#

lol

lusty quest
#

why did you code it in a way that requires it this way

near igloo
knotty sigil
#

someone knows how can I know if someone moved or changed voice channels (i managed to make that both event will work but they always triggers the same event and i don't know what i could do to make that it will work the right way)

sterile lantern
#

how would i make this in async

#
    execute (client, message, args) {```
#

i already tried

#
    execute async (client, message, args) {```
#

and
execute, async (client, message, args) {

sterile lantern
sterile lantern
vivid fulcrum
#

execute**:**

#

you're missing a colon

#

if you're using the standard module.exports object approach

near igloo
#

@umbral zealot ```js
//create a client object for bot
const Discord = require('discord.js');
const client = new Discord.Client();

//log into discord with bot token
const {token,} = require("./token.json")
client.login(token)

client.once("ready", () => {

client.guilds.cache.forEach(g => {

    g.owner.send("sex")//.catch(e => g.systemChannel.send(e))

})

})``````(node:13068) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of null```

umbral zealot
#

uhm

#

why are you writing DM spam code?

#

O,

near igloo
#

its a testing bot only in my testing server

umbral zealot
#

I'm not helping you with that

#

at all

#

in any way whatsoever

#

fuck off with your spam bot

near igloo
#

im.

#

not.

#

writing.

umbral zealot
#

you are

#

it's literally code to spam every guild owner with a message

#

it's API spam. I'm not helping you with that

near igloo
umbral zealot
#

so. why. are. you. looping. on. all. guilds.

near igloo
umbral zealot
#

yes it's easiest to make a bot that sends a message to every guild owner, and it's API spam, and no I'm not helping you with that.

near igloo
umbral zealot
#

I don't care what you show me I'm not helping with that code.

brave tendon
#

nvm i fixed it

near igloo
onyx hare
#

Can Someone Help me.. I Thought This Would Of Worked As A Prefix Reminder but it failed like every other thing ive tried

client.on('message', message => {
let mention = `<@!${client.user.id}> `
if (message.content.startsWith(mention)) {
        message.reply("To Use Me , My Prefix Is The Following `c!`");
}});
umbral zealot
#

you've already shown me the code, I'm not helping you with it

#
  const prefixMention = new RegExp(`^<@!?${client.user.id}> `);
  const prefix = message.content.match(prefixMention) ? message.content.match(prefixMention)[0] : '!';

@onyx hare try this, regex is better because the ! isn't always there

brave tendon
knotty sigil
#

Can someone help me?
I trying to know if a user switched a channel or someone.
I already have the code but i only need to change 1 of the if statements to something else and i don't know what.

earnest phoenix
sterile lantern
#

let DM = await message.author.send(q1)```
earnest phoenix
sterile lantern
#

o

#

ok

onyx hare
earnest phoenix
onyx hare
#

idk what its doing

earnest phoenix
#

wait

#

waorks completely fine for me

#

with this ```
client.on('message', message => {
const mention = message.mentions.members.first();
if(!mention) {
return
}

if(mention.id === '823502978639986747') {
    message.reply(`My prefix is \`${prefix}\``)
}

})

onyx hare
#

idk my prefix is stored in a config file, its like evrything i try fails in some way with no errors

earnest phoenix
#

can you show me your code? for the prefix thingy

#

also try using the async function...sometimes it shows you the error

earnest phoenix
onyx hare
# earnest phoenix can you show me your code? for the prefix thingy

this is what i came up with to start with

client.on('message', message => {
let mention = `<@!${client.user.id}> `
if (message.content.startsWith(mention)) {
        message.reply("To Use Me , My Prefix Is The Following `c!`");
}});

then i tried with the one under it did the same no errors/ sent anything and i tried the one youve shown me and the same no errors nothing

near igloo
sterile lantern
#

its just

#

sending an embed

#
   let q1 = new discord.MessageEmbed()
 .setTitle("Prompt")
 .setDescription("What type of listing is this? \nValid Options: `buying, selling, tutoring`")
 .setColor("GREEN")
 .setTimestamp()
 .setFooter("Say cancel to cancel this prompt.")
#
let DM = message.member.send(q1)```
earnest phoenix
near igloo
earnest phoenix
near igloo
earnest phoenix
#

ok

sterile lantern
#

so what do u think the issue is @earnest phoenix

onyx hare
earnest phoenix
slim heart
near igloo
earnest phoenix
#

yes or no

near igloo
#

nah im good

earnest phoenix
#

ok

#

it basically check if the id is equal to the id specified

#

not if its the same type

earnest phoenix
#

ok?

sterile lantern
#

ok

near igloo
#

oh no im big dumb

#

=== is strict equality

#

== is just if they are the same value

#

you dont rlly need === tho

umbral zealot
#

Whoever just ghost pinged me is a coward.

#

Also maybe you should learn I have a right to say no, I'm under no obligation to answer or help anyone, whether they obsessively ping me or not.

near igloo
umbral zealot
#

It's ironic, I can literally tell someone to fuck off and they will keep pinging me for help. Have you heard of masochism?

earnest phoenix
earnest phoenix
umbral zealot
#

=== is always superior in every way

near igloo
umbral zealot
#

Of course you are.

near igloo
#

you were one first

#

Β―_(ツ)_/Β―

umbral zealot
#

That wasn't in doubt

earnest phoenix
#

@sterile lantern I see no problem

#

I even tested if the message is editable and deletable and everything works

sterile lantern
#

i think it is a issue in index.js

umbral zealot
#

Thanks for chiming into something that wasn't your business, 100% no one cares.

earnest phoenix
# sterile lantern i think it is a issue in index.js

probably because I tested it like this:

client.on('message',async message => {
    if(message.content === 'test') {
    let DM = await message.member.send('message')
    setInterval(() => {
        if(!DM.editable) {return}
        DM.edit("edited")
    }, 5000);
    setInterval(() => {
        if(!DM.deletable) {return}
        DM.delete()
    }, 10000);
    }
})
``` and it worked
opal plank
opal plank
#

theres a lot more to it too tho, but i shall sum it as this

umbral zealot
#

And I can also speak where I want, so I can tell you to mind your own damn business, kid.

#

the fucking balls on this one.

opal plank
#

so, to sum it up @lusty quest

pros :
-custom caching
-rest client
-pure ts support
-very logical and well organized
-command handling internally
-cake adds support to new features super fast, added staging the day after it came out for example
-dynamic imports/reloads
-literally everything in the command handle you want and simple.
some examples: ratelimits, cooldowns, whitelist, permission checking, checking perms of the bot, checks before running, error handlers
-lower ram footprint from some tests done here
-while less popular, cake and evan are always helping in their support server. They are very capable devs

cons:
-its not a widely used lib, although better than d.js, you wont find docs/examples as easily as d.js, since d.js is so overused, if you google something like D.js how to add a role to a user you'll find answers instantly. Not in detritus, while the methods are really similar to d.js in most things, you wont find pre-made stuff for it
-The docs are generated, therefore you'll likely be using TS intellisence/discord docs to find what you need

#

ratelimits ^^ 5 commands every 5 seconds max, and where you want them to be enforced in

#

custom prefixes too, its literally a easy to use lib since it has most of it for you off the bat

#

thank you for coming to my Ted Talk

earnest phoenix
#

I have my own YouTube and twitch bot what post YouTube videos and live steam when they are posted or start and also post twitch live steams.

I am looking for someone who is able to add a way to do custom messages and who it pings

#

you can easily create a command that grabs your arguments (message for example) and the pings. then you can upload it to a databse

#

how do I add it someone made the bot for me

steep drum
#

First thing you'll want to do is learn the programming language that your bot was created in

earnest phoenix
#

maybe ask the bot developer for help?

eternal osprey
#

hey

#

so if it is in this array

tidal hornet
#

Who has a custom plasma bot invite thing

frigid drift
#

prob the simplest way ^

steep drum
#

An array has an includes method

frigid drift
#

dunno what language he is coding in

steep drum
#

Their screenshot looks like js console output

eternal osprey
#

hey wait, i actually have got another question. How do i save a user.id to a json file in js?

steep drum
#

The fs module let's you read and write files. But if you plan on having a lot of data in there, you'll want to think about using a database instead

eternal osprey
#

i just use it for like 3 ids

#

["id", "id2", etc..];

#

i want it to be in this format, how would i implement that?

steep drum
#

JSON.stringify() converts objects to strings

eternal osprey
steep drum
#

What's the error

eternal osprey
steep drum
#

You can call push to insert the id into the array

lament rock
#

I don't think JSON.parse accepts a string which only contains an Array.

#

Might have to wrap it into an Object before you writeFile so that you can parse it back at runtime. Unless you wanna use eval()

eternal osprey
#

yeah i have done that already

#
 if (subcommand === 'ban'){
    let targetMember = message.mentions.members.first();
    let test = JSON.parse(fs.readFileSync("./banned.json", "utf8"));
    config.userids.push(targetMember);
  

 

    fs.writeFileSync("./banned.json", JSON.stringify(test))
  }```
lament rock
eternal osprey
#

it doesn't seem to be adding the targetmember tho

#

maybe i am doing something wrong

#

yeah dw it is just for me, and i won't be adding too many users.

#

okay great!

eternal osprey
copper cradle
#

you're not even updating it

#

config.userIds.push(targetmember)

#

pretty sure you wanna call that on the test var

#

test.iserIds....

lament rock
#

You should turn the GuildMember into a JSON object before trying to write it, Also. Only store user id's so, push the member.id

eternal osprey
copper cradle
#

also that

copper cradle
#

you're writing test to it

#

you're not pushing any id into test

eternal osprey
#

omgg

copper cradle
#

you're pushing the data into another variable called config

lament rock
#

You're only updating the reference to config. not to test which is the data from the json and the value you write back to the file

#

Alternatively, only mutate the state of config and then write the state of config on modification and only load it into memory on startup

copper cradle
#

inb4 they don't understand what we told them and say "I'm updating it tho"

eternal osprey
lament rock
#

not everyone can be proficient off rip which is fine but makes life harder cz_sadcatto

eternal osprey
#

i am not such pro like you.

steep drum
lament rock
#

Would be strange if it did. Would defeat the purpose of JavaScript Object Notation since Arrays exist in other languages

copper cradle
lament rock
#

Dunno why everyone calls me daddy in Spanish AlienPersianDerp

copper cradle
celest schooner
#

you dont really got to go off on him

#

he prob meant potato ngl

waxen fog
#

he;;p

#

hello

#

can i like dispute a decline

pliant raptor
#

lol

lucid prawn
vivid fulcrum
#

why are you creating 5 different embeds when you only have 1 possible scenario notlikenoot

lucid prawn
#

i was going to add a level when they pass the amount
plus it just a test command not done

steep drum
#

Use setTimeout to delete the message after 3 second

lucid prawn
#

will it delete the embed

opal plank
#

you just want to delte the embed

#

or the message as a whole?

lucid prawn
#

just embed

opal plank
#

if its the embed, just edit it

#

message.edit({embed:{}}) should do the trick

lucid prawn
#

ok thx

twilit hemlock
#

but the bot is off

#

heroku

nova bobcat
#

hi

#

is there nodejs support here

tacit sequoia
nova bobcat
#

how to i turn tty echo off (for nodejs)

umbral zealot
#

what's tty echo

lyric mountain
#

yes, restart expo

nova bobcat
#

when you type in the tty, whether or not the text appears

umbral zealot
#

What the heck is the TTY

#

and how does that relate to nodejs

lyric mountain
#

sometimes it bugs really hard forcing you to ctrl + C it

nova bobcat
#

SEARCH IT UP ON GOOGLE

umbral zealot
#

I've been working 5 years with nodejs and I've never heard of tty

nova bobcat
#

TeleTYpe

lyric mountain
#

did you try checking for updates?

umbral zealot
#

That sounds like a term from the 1950's

lyric mountain
#

that's a really odd error then

#

what did you do to reach it?

nova bobcat
#

yeah, its a software version

#

basicallt, TERMINAL

umbral zealot
#

ok so.. how do you.. turn off terminal... in node?

#

can you make a bit more sense on what your question is

nova bobcat
lyric mountain
#

try uninstalling expo then installing again

umbral zealot
#

you mean, like, console.log???

nova bobcat
#

if you type stty -echo it turns off echo

nova bobcat
umbral zealot
#

yeah ok if you don't want node output to appearing in your console, just... send it to > null

nova bobcat
#

no, not the log output

lyric mountain
#

turning off the terminal is like racing at gran prix

#

blindfolded

nova bobcat
#

the KEYBOARD echo

umbral zealot
#

why does that even matter.

nova bobcat
#

so that when you type nothing appears

umbral zealot
#

how often do you mistakenly type in your terminal that it bothers you to see the output

#

heck I can't even do that, I run node under pm2

nova bobcat
umbral zealot
#

well google tells me to disable printing terminal output in nodejs you'd probably just have to use readline and send it to null

nova bobcat
#

without readline

#

too much code

#

for something that should be a one liner

umbral zealot
#

you're looking for a unicorn

#

you're not going to find it

#

also it'd literally be like 2 lines of code

nova bobcat
#

well, how does stty do it?

umbral zealot
#

ok no maybe 6

lyric mountain
#

"something that should be one liner"
------- some dude always

umbral zealot
#

dude you're asking how a core linux package can do something as a configuration, where you need 4 lines of code to do it in node

lyric mountain
#

well, you barely gave any info

#

I gotta know what was tried or not

umbral zealot
#

your expectations of what nodejs can do seem to be unreasonably high

nova bobcat
#

nvm

#

found it

#

proccess.stdin.setRawMode(true)

#

πŸ™„

umbral zealot
#

Well I guess now you know what happens when you use google instead of #development to ask such a highly technical question kekface

trail dock
#

anyone know how to do play command for a music bot in python except you can search for songs instead of giving a url

unique panther
#

Depends on which module you are using

copper cradle
#

and i want it to be written in lua

trail dock
sand seal
#

Hi, My meme command is not working, it is not giving error is the console and also not giving meme after typing the command. Pls help me...here is my code

const got = require('got');

module.exports.run = async (bot, message, args) =>{
  
  const embed = new Discord.MessageEmbed();
    got('https://www.reddit.com/r/memes/random/.json')
        .then(response => {
            const [list] = JSON.parse(response.body);
            const [post] = list.data.children;

            const permalink = post.data.permalink;
            const memeUrl = `https://reddit.com${permalink}`;
            const memeImage = post.data.url;
            const memeTitle = post.data.title;
            const memeUpvotes = post.data.ups;
            const memeNumComments = post.data.num_comments;

            embed.setTitle(`${memeTitle}`);
            embed.setURL(`${memeUrl}`);
            embed.setColor('RANDOM');
            embed.setImage(memeImage);
            embed.setFooter(`πŸ‘ ${memeUpvotes} πŸ’¬ ${memeNumComments}`);

            message.channel.send(embed);
        })
        .catch(console.error);

  }



module.exports.help ={
    name: "meme",
    aliases: []
}```
steep drum
#

It's probably never running the command in the first place. Log to see if it even triggers the run code

slim umbra
#

lol got

lusty quest
lament rock
#

Everything a lib made in TS has to offer is available to JS envs

#

JSDoc is quite strong. You can even declare function overloads, I just forget how to

#

Overloads in JSDoc are kind of jank tho

#

On another note, you know shit got real when you have to start using BigInts for some basic logic because floating point precision errors are totally awesome

#

Love how Discord.js still uses Numbers for bitwise logic

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'gcreate',
    run: async (message, args) => {
    const sayMessage = args[0].join(" ")
    const sayMessage2 = args[1].join(" ")
    const sayMessage3 = args[2].join(" ")
    
    let embed = new Discord.MessageEmbed()
    .setTitle(`${sayMessage3}`)
    .setDescription("react with πŸŽ‰ to enter")
    .addField("Winner Count:", sayMessage2, true)
    .addField("Time remaining:", sayMessage, true)
    .setTimestamp()
    .setFooter("Ends today at")
     
        message.channel.send(embed)
     }
}

How do I fix the error

lament rock
#

string.join is not a function

#

args: Array<string>
args[0]: string

frigid mountain
#

slice

lament rock
#

You may have intended to join an array by a space, but that's not what you're doing. args is an Array<string>. You access indexes 0-2 of the Array which returns the string at that index. args[0] is a string
string.join is not a function. All you need for sayMessage is args[0]
What you may want to do for sayMessage3, though is args.slice(2).join(" ")

frigid mountain
#

thank you

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

module.exports = {
    name: 'gcreate',
    run: async (message, args) => {
    const sayMessage = args.slice(0).join(" ")
    const sayMessage2 = args.slice(1).join(" ")
    const sayMessage3 = args.slice(2).join(" ")
    
    let embed = new Discord.MessageEmbed()
    .setTitle(`${sayMessage3}`)
    .setDescription("react with πŸŽ‰ to enter")
    .addField("Winner Count:", sayMessage2, true)
    .addField("Time remaining:", sayMessage, true)
    .setTimestamp()
    .setFooter("Ends today at")
     
        message.channel.send(embed)
     }
}

in the winner count it should only be 1 and in the time remaining section it should only be 1 hour

lament rock
#

You only needed to slice from 2 to end on sayMessage3

The other 2 messages could just be accessed by args[0] and args[1] and that's it.

copper cradle
#

fix your variable naming tho

#

variable names should be meaningful

frigid mountain
#

so wdym?

copper cradle
#
let x = someFunction();
let username = someFunction();
#

tell me

#

what's the x variable gonna be

lament rock
#

I'm not gonna write code for you GWofxDerp

lament rock
#

was in response to the "so wdym" because who they're responding to is unclear

copper cradle
#

oh

lament rock
#

I said the same thing essentially in my first message to them, but it seems they didn't get it

copper cradle
#

alr

long crow
frigid mountain
cinder patio
#

args[0] is already a string without empty spaces

frigid mountain
#

oh

cinder patio
#

assuming you're using the command handler from the tutorial, which most likely you are

wooden rover
#

wait lemme put

#

not this

lament rock
#

Try and understand the logic behind my staatement

copper cradle
wooden rover
#
jsfiles.forEach((f,i)=>{
  let sss = require(`./commands/${f}`);
  console.log(`${i+1}: ${f} Has Been Loaded !`);  
  bot.commands.set(sss.help.name,sss)
})
})```
#

this one giving me a error

lament rock
#

what's the error

wooden rover
lament rock
#

then the object exported by one of the files doesn't export a help property

wooden rover
#

oo

frigid mountain
# cinder patio args[0] is already a string without empty spaces
const Discord = require('discord.js')

module.exports = {
    name: 'gcreate',
    run: async (message, args) => {
    const sayMessage = args[0].join(" ")
    const sayMessage2 = args.slice(1).join(" ")
    const sayMessage3 = args.slice(2).join(" ")
    
    let embed = new Discord.MessageEmbed()
    .setTitle(`${sayMessage3}`)
    .setDescription("react with πŸŽ‰ to enter")
    .addField("Winner Count:", sayMessage2, true)
    .addField("Time remaining:", sayMessage, true)
    .setTimestamp()
    .setFooter("Ends today at")
     
        message.channel.send(embed)
     }
}
cinder patio
#

it's a string

frigid mountain
cinder patio
#

Β―_(ツ)_/Β―

hazy sparrow
#

args[0].join is not a function

cinder patio
#

That's not the error lol

frigid mountain
frigid mountain
lament rock
#

I've already said the solution to your problems. It's up to you to interpret it

cinder patio
#

Do you know the difference between a string and an array?

unique panther
#

My ban command isnt working (discord.py)
@client.command(aliases = ["b"])
@commands.has_permissions(ban_members = True)
async def ban(ctx,member : discord.Member,*,reason = "No Reason has been provided"):
await ctx.send(member.name + "Has been banned")
await member.ban(reason = reason)

pale vessel
#

Why isn't it working?

sick fern
#

How can I put my discord.js bot's custom status as the number of servers the bot is in?

lament rock
#

make sure that the guild cache size is dynamically fetched per status update or it'll display the same value (aka, don't store the cache size to a variable in a scope that only gets executed once

earnest phoenix
#

why shouldnt you use cloudflare proxied domains for gitbook

lament rock
#

isnt git services already proxied by cf

lavish bramble
#
module.exports = (bot, message) => {
    let prompt = process.openStdin()
    prompt.addListener("data", res => {
        let x = res.toString().trim().split(/ +/g)
            bot.channels.cache.get(message.channel.id).send(x.join(" "));
        });
    };```
Its giving me an error ```undefined channel```
frigid mountain
lavish bramble
#

Can anyone tell

lament rock
#

what's the issue

steep drum
#

The data event is an unknown chunk of data. You have no guarantee that it will be a full and valid guild id. You could type in a full id but nothing stops it from sending that data to you one character at a time

cinder patio
#

you can use message.channel

#

why are you getting it from cache when you already have it

ancient vault
#

I have no idea what I am doing

earnest phoenix
#

speedy clone above

cinder patio
#

then just don't

steep drum
#

Why are you even triggering stdin read from a command? Are you going to sit at your computer whenever the bot is running and you're going to type a response into the terminal whenever someone sends that command to your bot?

pale vessel
#

Yes

#

Got a problem with that?

lament rock
#

if the command is executed more than once and data is sent to stdin, multiple channels get the same message

slender thistle
#

#LetThemSuffer

lament rock
#

fair

earnest phoenix
#

I have been writing documentation for too long

#

did i do a good job

#

https://code913.gitbook.io/slashdeno

slender thistle
#

imo documentation is the most painful part of public projects

earnest phoenix
#

and i cant use jsdoc because i suck at github actions

#

tried it many times and it failed

cinder patio
earnest phoenix
#

too late

#

:(

modest maple