#development

1 messages Β· Page 1044 of 1

spare mirage
#

happy now?

earnest phoenix
#

yep

clever vector
#

Yo yo

slender thistle
clever vector
#

My Meme not work can anyone help???

wheat hornet
#

this guide is good but not good if u wanna do some cool stuf

quartz kindle
#

if you wanna do cool stuff you gotta do it yourself

spare mirage
#

my bot is called banana lmao

wheat hornet
#

if you wanna do cool stuff you gotta do it yourself
@quartz kindle faxxx

spare mirage
#

this is scary

quartz kindle
#

djs is onto you

wheat hornet
#

@pure lion gona go and check weather.js and if its not good enough ur dead

earnest phoenix
#

how do i edit my bot's sent message.
this is what i want:

//some stuff above
if (command === "yeetAndIDontUseIFStatementsForCOmmands") {
    message.channel.send("yeeting you...");
    setTimeout(function() {
      //some shit
      messageThatMyBotSent.edit("hope you survived")
 },5000)
}
#

I have all the perms

#

and the bot doesn't check

#

probably thats the error

slender thistle
#

messagemybotsent = message.channel.send
messagemybotsent.edit

pale vessel
#

resolve the promise too

earnest phoenix
#

Help?

#

messagemybotsent = message.channel.send
messagemybotsent.edit
@slender thistle finally someone who types all lowercase like me

slender thistle
#

I just cba to use camel case rn

earnest phoenix
#

pls ping and help me

#

@earnest phoenix pinged

quartz kindle
#

@earnest phoenix its a function, not a variable

earnest phoenix
#

you wanted help with getting pinged right

#

so

#

No

#

do this:

slender thistle
earnest phoenix
#

I have all the perms but doesnt work

slender thistle
earnest phoenix
#

I did it in an another server it worked kind of

quartz kindle
#

@earnest phoenix ```js
thisIsAVariable
thisIsAFunction()

earnest phoenix
#

Hmm

#
if (message.author.hasPermission("ADMINISTRATOR") || message.author.hasPermission("KICK_MEMBERS") {
//yourcode
} else {message.reply("You don't have the permissions to do this!!!")}
quartz kindle
#

your is a function

#

and it needs a parameter

#

learn how functions work

earnest phoenix
#

@earnest phoenix try my method and see if it works

wheat hornet
#

ooof

pure lion
#

gona go and check weather.js and if its not good enough ur dead
@wheat hornet thefuck

wheat hornet
#

πŸ˜… \

#

jk

pure lion
#

...

#

now i will not help you

#

:)

wheat hornet
earnest phoenix
#

yeet

#

me

#

please

wheat hornet
#
if (message.author.hasPermission("ADMINISTRATOR") || message.author.hasPermission("KICK_MEMBERS") {
//yourcode
} else {message.reply("You don't have the permissions to do this!!!")}

@earnest phoenix how do u type like that

slender thistle
#
procedure TForm1.Button1Click(Sender: TObject);
var s, sn: string;
    i: integer;
begin
    s := Memo2.Text;
    for i := 0 to length(s) - 1 do
        begin
            sn := sn + s[i] + ' ';
        end;
    Memo3.Text := sn;
end;

I'm either missing something very obvious or Delphi hates me

earnest phoenix
#

@earnest phoenix how do u type like that
@wheat hornet put three ` and type the name of the language

slender thistle
#

In Memo3 object I'm getting absolutely nothing

earnest phoenix
#

like ```javascript

spare mirage
#

js workst too

slender thistle
#

```js
your code
```

wheat hornet
#

a
a
a
s
s

spare mirage
#
just do ```js
code```
wheat hornet
#

its not sending

#

just jumping lines

#
like this
spare mirage
#

you have to go out of the `s first

wheat hornet
#

ooooo

#

thx got it

#

now i dont have to take screenshots

earnest phoenix
#

lololol

#

Why does message.guild.members.random() give the user ID instead of name#tag???

wheat hornet
#

have u fetched yet

#

@earnest phoenix

earnest phoenix
#
Test
wheat hornet
#
guild.members.random()
#

try it @earnest phoenix

earnest phoenix
#

WHAT to do?
@earnest phoenix PLS help

wheat hornet
#

clear some }

earnest phoenix
#

Which line?

wheat hornet
#

error line

earnest phoenix
#

Delete it?

misty sigil
#

that’s the weirdest message listener I’ve seen

#

yes

earnest phoenix
#

the whole line ?

misty sigil
#

No

#

the }

wheat hornet
#

the single }

quartz kindle
#

@earnest phoenix there is something wrong with your entire code block

earnest phoenix
#

huh?

quartz kindle
#

you need to show everything from the start of it until line 52

misty sigil
#

you know it’s easier if you post it here

wheat hornet
#

@earnest phoenix just download beautify

misty sigil
#

much easier

earnest phoenix
quartz kindle
#

from the start

spare mirage
#

bruh

quartz kindle
#

of the code block

misty sigil
#

KEKWait from the start

wheat hornet
#

-_-

earnest phoenix
quartz kindle
#

Lol

meager jasper
#

How many Commands has your bots? my Bot has 50

misty sigil
#

Mine has 31

wheat hornet
#

17

earnest phoenix
#

131,lol

spare mirage
#

mine has 24

#

ish

misty sigil
#

But I have 2 others, 1 having 6 and the other having 17 more

meager jasper
#

nice

spare mirage
#

what are the most fun commands to add?

meager jasper
#

idk

wheat hornet
#

jokes

pale vessel
#

none

spare mirage
#

I need more

meager jasper
#

I have
time
calculator
date
fn item shop
Bot info
ping
uptime
etc...

spare mirage
#

time?

wheat hornet
#

how can i create a dashboard for my bot

spare mirage
#

as in

#

local time

#

@wheat hornet not lmao

#

its really hard

meager jasper
#

local time
@spare mirage
yah as the time in πŸ‡©πŸ‡ͺ

spare mirage
#

ayy

#

Dutch boy here

meager jasper
#

yahh boyyyy

wheat hornet
#

my bot send a welcome message like mee6 and i need the user to have power to customize the background

meager jasper
#

my bot send a welcome message like mee6 and i need the user to have power to customize the background
@wheat hornet
?

#

How old are you?

wheat hornet
meager jasper
#

nice

#

How old are you all here?

spare mirage
#

im 15

wheat hornet
#

why u want my age

spare mirage
#

he wants pictures duhh

#

jk

meager jasper
#

why u want my age
@wheat hornet
you don't have to tell

clever vector
#

Hello experts

#

my command reasonly dead all only +help work

pure lion
#

Cool

clever vector
#

can anybody help?

wheat hornet
#

code

meager jasper
#

can anybody help?
@clever vector
what Programm

clever vector
#

Node.JS

meager jasper
#

idk

pure lion
#

What library

clever vector
#

discord.js

pure lion
#

Send code

wheat hornet
#

ight ima head out

clever vector
#

@pure lion

#

DM

pure lion
#

No

#

Lol

clever vector
#

Cmon

#

it error like 8-9 command

pure lion
#

Send here

slender thistle
clever vector
#

Yo yo

#

can you help me with my meme

sinful belfry
#

what error are you getting?

#

and what language are you using?

pure lion
#

is there a way to check a message if it has a .txt file then get the content?

sinful belfry
#

language?

pure lion
#

js

sinful belfry
#

check out fs.readFile() from the fs module

pure lion
#

i get that but how would i check if the message is an attachment?

#

actually its fine ill check the docs

quartz kindle
#

message.attachments contains all attachments in a collection

pure lion
#

tim and me reading the docs have a lot in common

quartz kindle
#

i am a walking docs

slender thistle
#

Do you have a Show Source button?

quartz kindle
#

maybe :^)

slender thistle
tulip ledge
#

Thats cursed

#

Tihi

pure lion
#
if (msg.attachments.map(m => m.name).toString().endsWith('.txt'))

i refuse to believe this is the only way i can get .txt files

#

or even is the way

#

:D

slender thistle
#

a for loop over msg.attachments and an if

pure lion
#

okay

earnest phoenix
#
permissions.has('BAN_MEMBERS') || role.permissions.has('MANAGE_GUILD') || role.permissions.has('MANAGE_CHANNEL');

client.on('message', function(message) {
    if(message.author.bot) return;
    if(isValidCommand(message, "hello" )) 
        message.reply("Hello!");
    else if (isValidCommand(message, "rolldice")) 
        message.reply("rolled a " + rollDice());
    else if(isValidCommand(message, "add")) {
        let args = message.content.toLowerCase().substring(5);
        let { cache } = message.guild.roles;
        let role = cache.find(role => role.name.toLowerCase() === args);
        console.log(cache);
        if (role) {
            if(message.member.roles.cache.has(role.id)) {
                message.channel.send("You already have this role!");
                return;
                    
                }
            }
            if(checkPermissionRole) {
                message.channel.send("You cannot add yourself to this role.");
            }
            else {
                message.member.roles.add(role)
                    .then(member => message.channel.send("You were added to this role!"))
                    .catch(err => {
                        console.log(err);
                        message.channel.send("Something went wrong...");
                    }); 
            } 

        }
        else {
            message.channel.send("Role not found!");
        }
    }   
); ```
#

I have all perms

#

but the bot doesnt add

slender thistle
#
            if(checkPermissionRole) {
                message.channel.send("You cannot add yourself to this role.");
            }```
#

if function then run code

#

aka always runs

earnest phoenix
#

I have the permission roles

#

All

lusty quest
#

you check if someone has the permissions then throw the error

earnest phoenix
#

Huh?

lusty quest
#

but i think you want if the user dont have the permission

fringe axle
#

Hey @slender thistle. Im here now

#

Can you help me a a bit now?

lusty quest
#

ohh nvm

earnest phoenix
#

I didnt understand

lusty quest
#

its possible that there is a hearachy issue

slender thistle
#

@fringe axle Send your HTML and CSS

#

Superbrain, are you sure it's not because they're doing if (function)

lusty quest
#

no i think the Bot has less permissions then himself

#

so the bot cant add the role

#

bcs of lower permissions

earnest phoenix
#

Bot has full perms

lusty quest
#

wait.. i need to get some sleep

slender thistle
#
const checkPermissionRole = (role) => role.permissions.has('ADMINISTRATOR') || role.permissions.has('KICK_MEMBERS') || role.
permissions.has('BAN_MEMBERS') || role.permissions.has('MANAGE_GUILD') || role.permissions.has('MANAGE_CHANNEL');

            if(checkPermissionRole) {
                message.channel.send("You cannot add yourself to this role.");
            }``` ![thinkW](https://cdn.discordapp.com/emojis/368319852060082178.webp?size=128 "thinkW")
lusty quest
#

its bcs of the if check

#

the check is always true if you have Administrator

earnest phoenix
#

I have adminis

lusty quest
#

but you also dont pass anything to the function to check i guess

#

yes bcs you have admin your check returns True and sends the message

earnest phoenix
#

normal cant add as well

#

😦

lusty quest
#

also you dont define where you want to check the permission

earnest phoenix
#

@lusty quest can I DM?

lusty quest
#

nope

fringe axle
#

@slender thistle thank you very much... but I did it by myself. I forgot one > at the end

#

All is fine now

slender thistle
earnest phoenix
#

@slender thistle can u help me?

#

with my coding?

slender thistle
#

You are not calling your checkPermissionsRole function

earnest phoenix
#

huh?

slender thistle
#

you see this

restive furnace
#

checkPermissionsRole(roleObjectHere)

slender thistle
#
const checkPermissionRole = (role) => role.permissions.has('ADMINISTRATOR') || role.permissions.has('KICK_MEMBERS') || role.
permissions.has('BAN_MEMBERS') || role.permissions.has('MANAGE_GUILD') || role.permissions.has('MANAGE_CHANNEL');
#

checkPermissionRole is a function, and you need to call it with parentheses and passing a role object

earnest phoenix
#

What change should I make?

slender thistle
#

and you need to call it with parentheses and passing a role object

#

aka checkPermisionRole(role)

lusty quest
#

i think i retire from this channel here. so many Copy / Pasta bots from users who dont know a bit about what they copy/pasted work

slender thistle
#

Hi I'm COVID and I inspired people to make Discord bots

wheat hornet
lusty quest
#

yea but some stuff here make me loose Braincells

restive furnace
#

same

wheat hornet
#

so whats better weather.js or get an api

quartz kindle
#

weather.js is just a middleman for an api anyway

lusty quest
#

im fine with new People trying to write Discord bots, but having 0 Knowledge about any coding language and then just Frankenstein Bots from 6 Different Youtube Videos from 6 Years ago is not really helpfull for anyone.

earnest phoenix
#

::(

wheat hornet
#

@lusty quest tutorials sucks

earnest phoenix
#

😦

#

I cant understand

restive furnace
#

its up-to-date too

wheat hornet
#

@earnest phoenix u should learn basics first

earnest phoenix
#

i am learning

slender thistle
#

You're using a library that isn't meant for JS beginners

earnest phoenix
#

I am just 16

#

😦

wheat hornet
#

-_-

warm marsh
#

Age doesn't matter

slender thistle
#

Age has no role in how you learn programming

wheat hornet
#

Age doesn't matter
@warm marsh u stole my line

earnest phoenix
#

I have many H.W

#

😦

warm marsh
#

πŸ˜‚

marble juniper
#

Age does not fucking matter in terms of knowledge

slender thistle
#

off-topic time anyway

marble juniper
#

a 6 year old could have more knowledge in js than a 16 year old

earnest phoenix
#

Ram & Rem, ok

marble juniper
slender thistle
#

is it up to date

wheat hornet
#

yep

marble juniper
#

yes

#

it is

wheat hornet
#

stable i guess

marble juniper
#

it has v12 and v11

slender thistle
#

nvm it's not the anidiotsgudie

marble juniper
#

lol

#

no its not

earnest phoenix
#

I am gona die or quit 😦

lusty quest
#

the anidiotsguide is not completely up2date

marble juniper
#

I am gona die or quit 😦
@earnest phoenix and the reason is?

earnest phoenix
#

i cant understand

wheat hornet
#

@earnest phoenix take chill pill bro

#

relax and try to understand wht the peice of code do whats it meant for

earnest phoenix
#

😦

fringe axle
#

@slender thistle one question. How can I do Bold texts or something in colors?

slender thistle
#

<strong> or <bold>

fringe axle
#

Yes... I did that

#

But its not working in color text

dire stag
#

can someone review my idea?

sudden geyser
#

what's your idea and what do you want reviewed exactly (e.g. if it won't get you banned, it's good, etc.)

dire stag
#

Im thinking of coding a sign in sign out bot for my staff. This is to check what actions where done when and by who when they sign in (for mods)

sudden geyser
#

Is signing in and signing out going to use some external service/website

dire stag
#

nope

#

a command

#

!signin @sour grove

sudden geyser
#

Then why not just use the user data you already get

dire stag
#

!signout

#

user data doesnt support who did what when for me

#

and at what time period

sudden geyser
#

If you get messages through gateway you should. What library are you using?

dire stag
#

i have no idea

#

there is a botlog

#

thats how i know what happens

sudden geyser
#

A bit confused, do you know what language your bot is written in? Are you using some bot maker?

dire stag
#

python

#

its my bot

sudden geyser
dire stag
#

discord.js

sudden geyser
#

then you're using javascript?

tulip ledge
#

You're using discord.js but using python?

#

Nani?

dire stag
#

im unsure

#

if so

lyric mountain
#

wtf

wheat hornet
#

lmao

sudden geyser
#

If you have a package.json file, you're probably using JavaScript/Node.js

lyric mountain
#

how does one even start a bot without knowing what lib it is

dire stag
#

then its java

sudden geyser
#

If you have a requirements.txt file, you're probably using python

tulip ledge
#

Then it's not discord.js

lyric mountain
#

now it's java????

dire stag
#

i think its HTML

sudden geyser
#

do you have a gradle or maven or ant file

dire stag
#

its java

tulip ledge
#

This guy is trolling

wheat hornet
#

tf

dire stag
#

just checked

lyric mountain
#

java or js?

tulip ledge
#

Java or javascript?

dire stag
#

java

tulip ledge
#

java !== javascript

dire stag
#

javascript

lyric mountain
#

wtf

dire stag
#

what discord.js codeing are done with

tulip ledge
#

javascript

dire stag
#

yes

lyric mountain
#

just show us your file tree for once

tulip ledge
#

Whats the issue?

dire stag
#

there is no issue

#

lite carry on

sudden geyser
#

Lucky do you mind telling us the extension of your main bot file (.<extension>)

dire stag
#

it on my other pc

#

i dont have a recuriment file

lyric mountain
#

then how tf do you know that it's js?

tulip ledge
#

Why are u here for actually if you don't have an issue?

dire stag
#

thats what i can remember

earnest phoenix
#

@dire stag Please learn programming fundamentals, and know what programming language you are using before attempting anything.

dire stag
#

i was asking something to Lite

#

i will

lyric mountain
#

what's lite?

#

sqlite?

dire stag
#

@sudden geyser

sudden geyser
#

I am Lite!

lyric mountain
#

ah

dire stag
#

so lite

#

would that be a good idea

tulip ledge
#

No

#

On commands you can just log stuff to a channel

#

Like a modlog channel

sudden geyser
#

I don't think so. You already have the user who sent the message and the time at when the message was sent if you can receive messages from gateway.

earnest phoenix
#

Development without knowing what language you are using is a terrible idea!

tulip ledge
#

Then you can see people's actions

earnest phoenix
#

why two p i n g s

lyric mountain
#

@earnest phoenix

earnest phoenix
#

gimme the message link someone

lyric mountain
#

now it's 3

sudden geyser
#

You should try familiarizing yourself in your development environment.

tulip ledge
#

@earnest phoenix

#

Now it's 4

dire stag
#

lite dm me

sudden geyser
#

why

dire stag
#

people

tulip ledge
#

I don't think Lite is gonna do that lmao

dire stag
#

you are very irritating

wheat hornet
#

he is trolling bro

tulip ledge
#

Actually you are the one who is irritating here

dire stag
#

here we go

tulip ledge
#

Don't ask for support if you don't even know your own library

dire stag
#

why are you so salty?

#

just relax

tulip ledge
#

I'm not salty

wheat hornet
#

i would love if some mod will mute him

tulip ledge
#

We're trying to help you and you're insulting me for no reason

dire stag
#

i dont need your help

tulip ledge
#

Then don't ask in development

#

Go hire a private tutor or something then

earnest phoenix
#

@dire stag Please stop asking for support when you don't know what programming language you are using.

dire stag
#

i asked lite

sinful belfry
#

no point in arguing here

dire stag
#

thank you

earnest phoenix
#

does this work:

randomUserToPing = message.guild.members.random().user.mention;
message.channel.send(`A random user I pinged: ${randomUserToPing}`);
tulip ledge
#

Not sure if .random() works lmao

wheat hornet
#

it works

earnest phoenix
#

@sinful belfry Is there some kind fo rule stating that if someone doesn't know programming fundamentals and doesnt know what they are doing should learn and not ask for support?

tulip ledge
#

Really?

#

Damn didn't know that

dire stag
#

i didnt ask for help

earnest phoenix
#

Is there some kind fo rule stating that if someone doesn't know programming fundamentals and doesnt know what they are doing should learn and not ask for support?
@earnest phoenix yes

dire stag
#

i asked someone to review my idea

sinful belfry
#

i guess it could fall under spoonfeeding?

tulip ledge
#

This channel is ment for asking support

lyric mountain
#

@dire stag you don't need a sign-in/out system because

a) You already have user data when receiving the message (user is already logged in discord)
b) You would just waste database storage

sinful belfry
#

^

earnest phoenix
#

i guess it could fall under spoonfeeding?
It would

#

It is meant for asking for support but you need to have some kind of knowledge. Don't you think?

dire stag
#

@

@dire stag you don't need a sign-in/out system because

a) You already have user data when receiving the message (user is already logged in discord)
b) You would just waste database storage
@lyric mountain for my staff

lyric mountain
#

still

#

they are already logged in

#

you already have all the data you could need

dire stag
#

be quite.

#

ok

wheat hornet
#

-_-

tulip ledge
#

Just ignore him he's trolling

dire stag
#

starman pls

#

why do you keep having to respond to my question?

lyric mountain
dire stag
#

?

lyric mountain
#

you asked for opinion about your idea

#

we're answering that

earnest phoenix
#

They were given.

dire stag
#

still

tulip ledge
#

And you're ignoring them

dire stag
#

@earnest phoenix dont reply to my convo

wheat hornet
#

so we should too ignore him

dire stag
#

im trying to talk to someone

#

please do

tulip ledge
#

@dire stag You have no right to command people around here

dire stag
#

im not. im asking

tulip ledge
lyric mountain
sudden geyser
#

This is unnecessarily becoming a bigger shitshow than needed

dire stag
#

i know right

#

they just keep talking

#

this could have ended far long ago

sinful belfry
#

ok you can stop it right there

tulip ledge
#

We literally gave you the answers

sinful belfry
#

all of you

dire stag
#

KuuHa

#

carry on please

lyric mountain
#

dude

#

enough of this topic already

earnest phoenix
#

@dire stag Ok so u want a way to clock in and out staff?

dire stag
#

yes.

tulip ledge
#

Like logging in and out?

earnest phoenix
#

You take & store the first timestamp, take & store the second.
Compare them, and boom.

Conversation ends here πŸ™‚

lyric mountain
#

that's an entirely different thing then

dire stag
#

when they sign out all their moderation actions will be logged.

earnest phoenix
#

I sent the basic idea of it

#

You can implement the rest

dire stag
#

not coding

tulip ledge
#

You can just log the commands on executions instead of saving them as it would use unneceserry database storage

dire stag
#

i do log commands

#

i wouldnt be asking if i didnt

tulip ledge
#

Then why do you want to log them a second time?

earnest phoenix
#

Okay then.. store the commands

#

and then post the commands between the two timestamps

tulip ledge
#

^^

dire stag
#

they can be deleted and why ask me that question its totally up to me,

tulip ledge
#

True

dire stag
#

thats not coding a bot though

#

clown im out of here

tulip ledge
#

Yes it is lol

earnest phoenix
#

We're not going to spoon-feed you.

modest maple
#

πŸ€”

lyric mountain
#

what you could do, for example, is set a hardcoded time range (eg: from 09:00 to 18:00) then check if the command is sent between those hours

tulip ledge
#

Also possible

lyric mountain
#

that'd require zero logging-in/out, database storage and user interaction

#

and is somewhat fail-proof

earnest phoenix
#

we can end this conversation here, he already left

pure lion
#

Can someone help me with getting a .txt file from a message

earnest phoenix
#

You can use fs to store the message and encode into a .txt

pure lion
#

No I want to get the attachment

tulip ledge
#

I think you can do .attachments on the message object and then filter through to see if it ends with .txt and use fs on that

earnest phoenix
#

^ Probably

wheat hornet
#

can we do it

pure lion
#

Ty

tulip ledge
#

discordjs docs are pretty bland in my opinion

#

It just sais this is this and use it

lyric mountain
#

they are pretty but confuse af

earnest phoenix
#

They are fine.

wheat hornet
#

ez reaction

tulip ledge
earnest phoenix
lyric mountain
#

this what?

#

the embed?

earnest phoenix
#

make it like that

#

Make what like what

lyric mountain
#

you want to comment it?

earnest phoenix
#

That embed should work

#

Yea comment it

#

CTRL+/

#

k

#

Or SHIFT+/

lyric mountain
#

or type //

#

/* also works as multiline comment

wheat hornet
#

why u wanna add // tho

#

isnt it like # in python

earnest phoenix
#

@wheat hornet That isn't python. Please keep this chat on context.

wheat hornet
#

bruh

lyric mountain
#
/*
This
Is
A
Comment
*/
earnest phoenix
#
// This is a comment
// aswell
wheat hornet
#

i am asking that // in js and # do the some work

lyric mountain
#

yes

#

delphi uses // and {} for comments

#

different langs sometimes use different comment chars

wheat hornet
#

oh

devout wagon
#

Delphi bernd

earnest phoenix
#

do you have npm-gyp installed?

#

yep

#

node-gyp i meant

pure lion
#

What happened to the discord send message as attachment feature????

earnest phoenix
#

yah

lyric mountain
#

What happened to the discord send message as attachment feature????
it's still there

pure lion
#

Where

lyric mountain
#

for users, just type a 2000+ char message

earnest phoenix
#

then it cant find nodejs but that dumb bc i have nodejs

lyric mountain
#

for bots, create a file from text and send it

pure lion
#

@lyric mountain I know this, it doesn't give me a prompt

sudden geyser
#

are you on mobile

pure lion
#

No

lyric mountain
#

ah, they removed it

pure lion
#

oh it only works if you paste it

#

h

lyric mountain
sudden geyser
#

No, it's still here

pure lion
#

Stronge

earnest phoenix
tulip ledge
earnest phoenix
#

Is there something wrong?

tulip ledge
#

It does not show number

lyric mountain
#

I do not ghave
@tulip ledge type until you reach about 1500 chars

pure lion
#

You have to type

tulip ledge
#

I did

#

I did like aaaaaaaaa and copy paste it like 100 times

lyric mountain
#

weird

tulip ledge
#

Oh now it shows

#

I did too less apparently

#

Cool didn't know either

earnest phoenix
#

@earnest phoenix no its fine

pure lion
#
Collection [Map] {
  '731133370003619880' => MessageAttachment {
    attachment: 'https://cdn.discordapp.com/attachments/730523536036331520/731133370003619880/message.txt',
    name: 'message.txt',
    id: '731133370003619880',
    size: 2001,
    url: 'https://cdn.discordapp.com/attachments/730523536036331520/731133370003619880/message.txt',
    proxyURL: 'https://media.discordapp.net/attachments/730523536036331520/731133370003619880/message.txt',
    height: null,
    width: null
  }
}

so attachments are logged like this, but when i tried to access .name of message.attachments it returned undefined

earnest phoenix
#

@earnest phoenix but your not sending the embed to the channel

pure lion
#
  if (msg.attachments) { console.log(msg.attachments.name) }
undefined
lyric mountain
#
Collection [Map] {
  '731133370003619880' => MessageAttachment {
    attachment: 'https://cdn.discordapp.com/attachments/730523536036331520/731133370003619880/message.txt',
    name: 'message.txt',
    id: '731133370003619880',
    size: 2001,
    url: 'https://cdn.discordapp.com/attachments/730523536036331520/731133370003619880/message.txt',
    proxyURL: 'https://media.discordapp.net/attachments/730523536036331520/731133370003619880/message.txt',
    height: null,
    width: null
  }
}

so attachments are logged like this, but when i tried to access .name of message.attachments it returned undefined
@pure lion did u message.attachments.get(index) ?

pure lion
#

o

lyric mountain
#

attachments is a collection

earnest phoenix
#

at the end put message.channel.send(embed) @earnest phoenix

twilit rapids
#

A message can have multiple attachment, so doing message.attachments.first() would be best practise

wheat hornet
#

so how to make a translate command in js

twilit rapids
#

You use a module

#

Unless you want to code one yourself

wheat hornet
#

which one

earnest phoenix
#

or use the google translate api

twilit rapids
#

Any really... Just find one that suits your needs

earnest phoenix
#

at the end put message.channel.send(embed) @earnest phoenix
@earnest phoenix Which line?

#

api

wheat hornet
#

bro api hates me

earnest phoenix
#

Its already there but

#

message.channel.send(embed)

lyric mountain
#

or use the google translate api
@earnest phoenix that one's paid

#

free plan is barely useable

earnest phoenix
wheat hornet
#

thx

earnest phoenix
#

K

pure lion
#

How do I use .get properly

lyric mountain
#

message.channel.send(embed) shouldn't be there tho

earnest phoenix
#

ehhhh

lyric mountain
earnest phoenix
#

wiat

#

why are you making an embed like that?

#

put it outside @earnest phoenix

#

yah

pure lion
#

Can someone help me with .get of message.attachments

earnest phoenix
#

How to make the embbed then?

#

bruh

#

Make normal embed without and pic how?

#

<Discord>.MessageEmbed()

#

Like this?

#

enough?

#

u did it before

#

why did u comment it for

#

For the below part

#

This now fine coding right

#

yes though u dont need embed.setdesp just .setdesp will do

#

and no ; at the end of MessageEmbed()

#

but the bot doesnt do it

#

k

#

The bot wont sent the embed

#

Ooof ∞

#

😦

pure lion
#

Howthefuckdoiuse.get()?

earnest phoenix
#
let stomthing = msg.content.substring(7);
let embed = new discord.MessageEmbed()
.setDescription(stomthing)
.others 
message.channel.send(embed)
#

somthing like that

pure lion
#

:<

earnest phoenix
#

and what's msg.author.defaultauthorurl

#

if u are trying to get the bot's pfp dont use that

#

just use bot.user.avatarURL()

#

and users pfp then user.avatarURL()

digital ibex
#

and no ; at the end of MessageEmbed()
@earnest phoenix huh

#

you should add semi colons, not tell people to remove it

delicate shore
earnest phoenix
#

pfff

delicate shore
#

My bot tells wrong date

#

Of joining

#

It's telling current date

digital ibex
#

how're u trying to display the date?

earnest phoenix
#

js or py

pure lion
#

How do I check if the message has an attachment

earnest phoenix
#

my bot just went offline and it giving me this in the console anyone know what this is?

ERROR  EACCES: permission denied, open '/rbd/pnpm-volume/62330f54-4ce4-4650-bffe-06d5c4341e57/node_modules/path/package.json'

digital ibex
#

if (message.attatchments)

delicate shore
#

I'm on mobile I can't send code

#

This is that lien

#

Line

honest perch
#

@earnest phoenix seems like it cant open that file

#

because of permissions, never seen that though

#

windows or linux?

delicate shore
#

@digital ibex

pure lion
#

@digital ibex not working

  if (!msg.attachments) { 
    return
  } else {
    var key = msg.attachments.keyArray()[0]
    var attachment = msg.attachments.get(key)
    if (attachment.name.endsWith('.txt')) {
      console.log(attachment)
    }
  }
earnest phoenix
honest perch
earnest phoenix
#

The strange thing is

honest perch
#

Uninstall all packages and reinstall

earnest phoenix
#

it’s is a clone of my bot

honest perch
#

or enable-pnpm

delicate shore
#

Bruh

#

Same

#

Pls help me

#

Joining date is having issues

earnest phoenix
#

bruh

#

smh its should be joinedAt

delicate shore
#

Ohh

#

It's that only @earnest phoenix

earnest phoenix
#

wait what befor that

#

i cant see in the image

earnest phoenix
#

this is to get server join date right

delicate shore
#

Yws

earnest phoenix
#

or dicord

delicate shore
#

Yes

#

Server

#

Join

earnest phoenix
#

for server join its joinedAt

#

for discord join its createdAt

delicate shore
#

That's what I use

earnest phoenix
#

use the toDateString()

#

try that

delicate shore
#

Kk

earnest phoenix
#

.addField("**Joined Server:**", `${member.joinedAt.toDateString()}`, true)
u have to define member

pure lion
#
  if (!msg.attachments) { 
    return msg.channel.send('h')
  } else if (msg.attachments) {
    msg.channel.send('hh')
    var key = msg.attachments.keyArray()[0]
    var attachment = msg.attachments.get(key)
    if (attachment.name.endsWith('.txt')) {
      console.log(attachment)
    }
  }

it always sends hh

earnest phoenix
#

hmmm

sudden geyser
#

attachments is an array/collection

delicate shore
#

.addField("**Joined Server:**", `${member.joinedAt.toDateString()}`, true)
u have to define member
@earnest phoenix
I can replace it with user

sudden geyser
#

you need to check the size

pure lion
#

oh

#

ty

earnest phoenix
#

sure

delicate shore
#

Ok

#

Ty

earnest phoenix
#

but u have member already defined

#

so ig it will work

delicate shore
#

Oo

digital ibex
#

ReferenceError, i was afk. whats the issue?

earnest phoenix
#

pfff

digital ibex
#

wot

earnest phoenix
#

Hi

#

How to run a command when someone leaves the server

sudden geyser
#

what library are you using

opal plank
#

if its d.js there are events that you can hook on to run it

digital ibex
opal plank
#

^^

earnest phoenix
#

client.on(guildleave)

#

ehhhh yah see docs

#

lol

#

whatIsCamelCase

opal plank
#

NotPascalCase

digital ibex
#

camel case is likeThis first word is lowercase and second and rest are upper case

earnest phoenix
#

or_actually_what_is_the_name_of_this_case_no_joke

opal plank
#

snake_case

sudden geyser
#

firstWordIsLowercaseAndTheOtherWordsAreUppercase

itLooksBetterThanSnakeCase

opal plank
#

we have somewhat standardized PascalCase for constructors and camelCase for everything else basically as a norm

earnest phoenix
#

butthisismyfavourtiecasewtfreadthefirstfourlettersofthismessage

digital ibex
#

tbh

#

writing in camel case / any case is just effort

#

i just write with no spaces and with no caps or anything apart from like once or twice i think, idk. but usually i dont

lyric mountain
#

and there's llamAcasE

opal plank
#

indeed, if you know your stuff, you shouldnt bother, but even in jobs people will tell you to keep standard as other people have to peer your code

#

its not a bad practice to follow norms of your lang

pure lion
#

am confused

#
                let filebin = fs.readFile(attachment.attachment)
(node:23272) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined

not sure how to fix, ive logged .attachment and its the URL of the attachment

lyric mountain
#

Class
variable
ThreeWordClass
threeWordVariable

#

basically

pure lion
#

:<

lyric mountain
#

callback must be a function

#

you gave nothing

pure lion
#

what was i supposed to give

digital ibex
#

just like

#

add an empty bracket thing with an arrow function / function and do whatever u wanna do in that

lyric mountain
#

() => arrow

pure lion
#

oh

opal plank
#

@pure lion what are you trying to read?

pure lion
#

url of an attachment

opal plank
#

path is local iirc

#

dont think you can read from url's

sudden geyser
pure lion
#
            var key = msg.attachments.keyArray()[0]
            var attachment = msg.attachments.get(key)
            if (attachment.name.endsWith('.txt')) {
                let filebin = fs.readFile(() => (attachment.attachment))
                bin = filebin;
                console.log(bin)

same error

sudden geyser
#

at least it says url instance. I don't know if that also applies to http

opal plank
#

ignore me then

digital ibex
#

yes

#

u would get that error

#

just like

#

do

#

.readFile('bob', () => { })

#

simple

pure lion
#

what is bob

opal plank
#

foo

digital ibex
#

a url

pure lion
#

oh cool, he got a new job

digital ibex
#

in this case, message.attatchments

#

yeah, bob's cool 😎

pure lion
#

is there a way i can put the file content to a string?

#

is it just filebin.tostring()

#

when i log it it returns undefined

golden condor
#

@pure lion use fs

pure lion
#

i am

sly ferry
#

Anyone now how the code must written in python, to get from member the badges?

slender thistle
#

They were added in 1.4.0

pure lion
#

probably something like flags

marble juniper
#

https://hasteb.in/tuqageca.js
I always get
UnhandledPromiseRejectionWarning: DiscordAPIError: 404: Not Found
and that didn't happen before but now it does and idk why the only thing I did was add a stop command after I made this command and thats it

lyric mountain
#

where's the rest of the error message?

golden condor
#

404 not found

marble juniper
#

idk where the issue is dude @golden condor

#

im fetching multiple stuff

sudden geyser
#

There's no guarantee the bot will be in a voice channel likely

marble juniper
#

and the error doesn't show any line

golden condor
#

Full stack trace pls

sudden geyser
#

await client.channels.fetch(message.member.voice.channelID); is probably your issue

marble juniper
#
(node:216) UnhandledPromiseRejectionWarning: DiscordAPIError: 404: Not Found
    at RequestHandler.execute (C:\Users\Link\Documents\coding stuff\Sonic Bot\download copy\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:216) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:216) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
golden condor
#

Crack

marble juniper
#

@sudden geyser it worked before though

golden condor
#

Because the member isn't always in a vc

marble juniper
#

and I tested it with being in a voice channel

solemn latch
#

^

#

Potentially in cache they are not in a vc?

marble juniper
#

I was

#

in a

#

vc

solemn latch
#

Cache?

#

Hello?

marble juniper
#

no

#

I am fetching it

#

so thats not the problem

#

cuz it gets cached bro

#
if (!channel) return message.reply('You need to be in a voice channel.');
#

and I had this

solemn latch
#

Fetching channel

marble juniper
#

so why

solemn latch
#

I'm talking about member

#

πŸ€”

marble juniper
#

yes

#

im using discord.js-light its not normal discord.js

#

it doesn't cache everything like discord.js would

#

so I have to fetch most stuff

#

so no

#

no cache

#

only fetch

restive furnace
#

then how u get the member's vc?

#

if no cache

solemn latch
#

^^^^^

marble juniper
#

I

#

fetch

#

it

#

and I don't need cache for that

#

cache is just so you can use that shit object for later after you fetched it

#

so you don't have to make api calls

#

smh

#

I get it through fetching that shit

#

also I posed the code above

#

in the link

#

and it did work before

#

so I know for a fact it works

#

smh

solemn latch
#

Then you dont need our help

#

And your kinda being a prick

marble juniper
#

now for some fucking reason It doesn't work anymore

restive furnace
#

^^^^

earnest phoenix
#

umm why does npm i libxmljs not work

restive furnace
#

its api problem or smht then

marble juniper
#

k then go ahead and fucking redirect me

earnest phoenix
#

it gives an error

solemn latch
#

Whats the error @earnest phoenix

random shale
#

@prisma ivy metahnet ?

digital ibex
#

hey, does anyone know why im getting this error: TypeError: Cannot read property 'length' of null ? πŸ€” the code is just
message.content.slice(prefix.length).trim().split(/ +/g);

#

I log prefix.length and it logs 2

#

any ideas? im confused why this is happening

solemn latch
#

Is prefix defined

digital ibex
#

and i also log prefix it logs the guilds prefix

#

yes

solemn latch
#

O

earnest phoenix
#

the error is with the fix (npm install libxmljs) for this error:
fuck my mouse took me back to New Tab on Chrome

solemn latch
#

Is it in the same scope?

digital ibex
#

yeah

solemn latch
#

Can we get some code

digital ibex
earnest phoenix
digital ibex
#
const mprefix = new RegExp(`^<@!${client.user.id}> `);
    const prefix = message.content.match(mprefix) ? message.content.match(mprefix)[0] : guild.prefix;
    console.log(`preficx length: ${prefix.length}`);
    const args = message.content.slice(prefix.length).trim().split(/ +/g);``` my one stopped working, so i used the idiots guide
#

but that one errors too

#

now im confused

earnest phoenix
#

an idiots not THE

#

idot

wheat hornet
#

@earnest phoenix its a channel name

solemn latch
#

And it logs 2?

earnest phoenix
#

this is the error that someone on stackoverflow told me to fix by npmi libxmljs. i use glitch for my bot at glitch.com/~codecodiscordbot
@earnest phoenix anyone

digital ibex
#

yeah

earnest phoenix
#

read the message.txt file pls

digital ibex
solemn latch
#

Thars so weird

wheat hornet
#

@earnest phoenix can u pls screnn shot and s3nd the txt file

earnest phoenix
#

ok

digital ibex
earnest phoenix
#

i'll put it on hastebin

#

lmao timings

#

we sent it at the same time

wheat hornet
#

no u dont he was around 20 microsecond faster

earnest phoenix
#

and why is it marked as .sql

#

it is javascript errors

#

not database

#

wtf am i saying

marble juniper
#

well since nobody could help me in here I tried to debug and I found out it was the botChannel part cuz it tried to fetch the vc the bot was in but the bot wasn't in a vc ofc so it didn't work

earnest phoenix
#

no

marble juniper
#

thanks link for helping myself

#

ok cya

digital ibex
#

herouku is shitter

solemn latch
#

Honestly you where raging so much I didn't read your code link

empty tinsel
#

Oop

wheat hornet
#

@earnest phoenix u will have to reset everything when free hoasting ends

#

use google cloud

solemn latch
#

Also will need to reset when free hosting ends

digital ibex
#

google clouds good tbh

marble juniper
#

just buy a vps for 3.99 a month smh

#

contabo

#

its not much

digital ibex
#

ask your mommy

marble juniper
#

still less than nitro classic

wheat hornet
#

fax

marble juniper
#

I get like idk way more than that money monthly so bruh

lyric mountain
#

who said dollars?

wheat hornet
#

4 dollar is 280 for me

lyric mountain
#

it's euros

solemn latch
#

Feels bad

lyric mountain
#

idk if contabo has dollar plans

digital ibex
#

4 dollars is 3 for me

wheat hornet
#

best is buy a rasberry pi

digital ibex
#

use gg

#

cheapest is $1

misty sigil
#

just use contabo or sumthiing

wheat hornet
#

F

digital ibex
#

hm, any ideas with my issue, anyone?

slender thistle
digital ibex
#

gg starts at $1

#

not 3

earnest phoenix
#

I could not join the voice channel: Error: FFMPEG not found

lyric mountain
#

you don't have ffmpeg

misty sigil
#

obvious

earnest phoenix
#

i do

#

"ffmpeg": "0.0.4",

#

use ffmpeg-static

#

prism-media doesnt support ffmpeg module coz it is deprecated

#

ill try that thanks

#

no luck

#

Does anyone here know a lot about webhooks

sinful belfry
#

what exactly are you trying to do?

pure lion
#

Does anyone here know a lot about webhooks
@earnest phoenix i know enough, whats up?

earnest phoenix
#

What is the error???????

pure lion
#

displayAvatarURL()

earnest phoenix
#

huh?

ebon kelp
#
earnest phoenix
#

Instead of defaultavatarurl

pure lion
#

default: the dicord logo

earnest phoenix
#

Lol

#

what should I change?

pure lion
#

omfg

#

what did we just say

earnest phoenix
#

Change defaultavatarurl to displayAvatarURL()

ebon kelp
#

message.author.displayAvatarURL()

earnest phoenix
#

Which line?

wheat hornet
#

tf

pure lion
#

etynjdgshdtfghzdryh

ebon kelp
pure lion
#

edrthrjfgdhnfgsjgfgjfjgdgjfjggfgjggfghj

earnest phoenix
#

31

#

30

ebon kelp
wheat hornet
earnest phoenix
#

I meant 30

pure lion
#

fuckufkcufckufckfu

earnest phoenix
#

i haven't had coffee today I'm sorry

pure lion
#

-m 399221618330697728 1 day you cant be serious

earnest phoenix
ebon kelp
#

then change

earnest phoenix
#

message.author.displayAvatarURL()

ebon kelp
#

yes!

earnest phoenix
#

The full line?

slender thistle
#

default -> display

wheat hornet
#

yes

pure lion
#

<= crying

earnest phoenix
#

K

ebon kelp
#

const pain = true;

wheat hornet
#

lmao

slender thistle
#

Replace message.author.defaultAvatarURL() with message.author.displayAvatarURL()

ebon kelp
#

Replace message.author.defaultAvatarURL() with message.author.displayAvatarURL()
@slender thistle That's what we said a few times xd

solemn latch
#

πŸ€” so how do i add css into the detailed description

pure lion
#

omg woo is green

amber fractal
#

in style tags

ebon kelp
#

style="color: red"

slender thistle
#

<style> tag

wheat hornet
#

@earnest phoenix u should read discord.js docs first

ebon kelp
#

<style> tag
@slender thistle or like that

earnest phoenix
#

OK

#

kk

amber fractal
#
css
</style>```
earnest phoenix
#

I understood

solemn latch
#

oo

#

ty

pure lion
#
<style>
retar{}
</style>
wheat hornet
#

@amber fractal is this html

strong fjord
#

It's css

pure lion
#

diff between html and xml?

ebon kelp
#

No this is patrick peepoLaugh

strong fjord
#

Internal stylesheets.

slender thistle
#

HTML is creating the elements
CSS is styling the elements

pure lion
#

ah

solemn latch
#

oo

pure lion
#

html: saw
css: scapel

solemn latch
strong fjord
#

Yea. If you don't know.. look into external, internal and inline CSS

summer torrent
#

css is so easy btw

ebon kelp
#

scss > css

strong fjord
#

Depends upon what you do lol

ebon kelp
#

css lacks a lot of features, which scss has

strong fjord
#

Css flexbox, grid confuses lots of people.

wheat hornet
#

OwO

earnest phoenix
#

As most of u know there are discord nitro snipers which snipes discord Nitro links or any discord links so if we embed a MSG does it get sniped? Ping me when answering

strong fjord
#

And even i have to look it up again.. as i forgot.

pure lion
#

a:hover {
do:a-barrel-roll
}

ebon kelp
#

And even i have to look it up again.. as i forgot.
@strong fjord Remembering all the syntax is hard

strong fjord
#

Exactly. @ebon kelp

slender thistle
#

I was introduced to flexbox quite early and essentially abuse it almost everywhere where I give up on positions

ebon kelp
#

Front-end web developers have struggles aswell

slender thistle
#

As most of u know there are discord nitro snipers which snipes discord Nitro links or any discord links so if we embed a MSG does it get sniped? Ping me when answering
@earnest phoenix still possible to snipe

earnest phoenix
#

Hmm

strong fjord
#

I know css, html, JavaScript, sql, php, c++, c, java, etc

slender thistle
#

Reading embed content is possible

earnest phoenix
#

How to prevent it @slender thistle ??

ebon kelp
#

php pepeSpit

strong fjord
#

It gets tough to remember all of it.

slender thistle
#

asking "who needs Nitro"

strong fjord
#

@ebon kelp php syntax sucks

misty sigil
#

How to prevent it [redacted]??
@earnest phoenix you can't really (unless you use dms)

pale vessel
#

not really

slender thistle
#

and accepting only whoever's been active recently

earnest phoenix
#

@misty sigil K thnx

strong fjord
#

Especially comparison is like.. you have different operators for string comparison and number comparison

#

Maybe it might have got fixed by now.

pale vessel
#

"hello" . " " . "world"

strong fjord
#

I am not sure. Confirm if you know

slender thistle
#

concat in PHP is hell ngl

strong fjord
#

Second shitty syntax is of shell scripting

ebon kelp
#

PHP is hell

pale vessel
#

i thought this is development channel, not the place to complain about programming languages

pure lion
#

same thing

pale vessel
#

true

strong fjord
#

We can have a conversation about language hehe

misty sigil
#

same thing, probably

strong fjord
#

Don't take php personally

autumn summit
#

how do I see who banned who, trying to make a security bot and I dont know how to find out who banned who