#development

1 messages · Page 1522 of 1

fluid basin
#

if message has m: do stuff
else if message has c: do some other stuff

timber fractal
#

okay

#

@fluid basin what code then bcz what i tried doesnt work

sacred trout
#

is there a bot dev badge as well? not the early one

fluid basin
#

thats means your filter is wrong

fluid basin
sacred trout
#

sad

fluid basin
#

there is a verified bot tick

sacred trout
#

they stopped giving badges right?

fluid basin
#

but no badge

timber fractal
fluid basin
#

...

#

basically, your filter isnt working

timber fractal
#

woops

#

lol

#

i made it startsWith() instead of toLowerCase()

#

now it works

earnest phoenix
#

Guys why is this not working, not outputting a error, not working, just saying error banning “I’d”

#

Id*

#

that indentation really said body crazy curvy wavy big tiddies lil waist huh

#

What lol?

#

pop culture reference

earnest phoenix
#

Wtf kind of errors are that?

feral aspen
#

Hello

earnest phoenix
#

How to make a file like detect if the message has an attachment and then use that attachement

feral aspen
#

You guys see the kind of folder picture emoji next to the folder? Is there an extension for that?

earnest phoenix
#

Probably

feral aspen
#

Do you know the name?

earnest phoenix
#

Just search on vscode extension

#

Like folder colors

#

Extension

feral aspen
#

Ok, the name though?

#

Ah

earnest phoenix
#

Maybe

#

Try to find the name

#

Can Someone help?

lusty quest
feral aspen
#

Ayy found it! 😊

#

Thanks!

limpid shadow
#

Guys when you are adding ban commands and other Commands do you add it to a different server

lusty quest
#

?

earnest phoenix
#

@limpid shadow what?

#

wrong server probably

#

Maybe he thinks command handler means putting files in another server

#

Lol

#

@earnest phoenix ok how are you getting dick - i mean dict - errors in javascript

#

that's a python thing

#

I got no idea

#

@earnest phoenix all my codes are js tf

earnest phoenix
#

can you send the error stack trace on hastebin

#

Like console?

#

Basically send the whole error

#

@earnest phoenix holy wtf the errors are gonna but commands still not working

#

lmao wat

#

Yes I’m confused the errors go away

#

Does the bot have permissions to ban the member

#

Ye

#

You should add a check for that

#

I think so

#

Alr

inner jewel
#

Hey guyz i just started making bots so dm for offer

earnest phoenix
#

The code looks right, right?

earnest phoenix
#

Yeah

#

Send me your repl link

#

Sure, wait I’ve been recently getting problem with my index.Js

#

Lemme dm

#

You

#

why dm

#

@earnest phoenix i mean the link which takes you to the repl page

#

Not the link to join multiplayer

#

Ohh

#

Lol

#

Like to view?

#

People cant edit code there but they can only view it

#

Ohh

#

Sorry I’m blind LOL

#

@earnest phoenix error again..

#

Not fixing anything

#

what's the error

#

i cant see your console

#

It’s not outputting any errors

#

well then it probably succeeded in banning

#

No, I’m trying and always says

#

Error

#

Error while banning @earnest phoenix

#

smh

#

you have a console.log in your catch function

#

it should probably output the error

#

It’s not tho

#

huh

#

Yep weird situation

#

Your entire code seems really bugged

#

Like there are no paranthesis around new Discord.Client

#

And the missing semicolons

#

Yea...

#

so umm

#

ive got a question myself

#

Eyyyy

#

Is it a good idea to use Object Destructing for props in React Components?

#

Personally idfk

#

Do u know how to make the bot detect an attachment

#

?

crimson vapor
#

message.attachments in djs iirc

slender thistle
#

plural

#

attachments

earnest phoenix
tardy hornet
#

i have that command

#

and i want that if there is not a number in args 1, it will return

earnest phoenix
#

So would this be better:

function GreetUser  ({ username, userid }) {
  // ...
}
#

Or should I avoid destructuring

tardy hornet
earnest phoenix
#

||@quartz kindle ||

#

@tardy hornet includes takes a primitive or object

#

not the constructor

#

lmao

quartz kindle
#

wut

crimson vapor
#

thats

#

youre naming things wrong

#

camelCase in js

#

first letter is lowercase

quartz kindle
#

that doesnt matter lol

crimson vapor
#

thats because classes use first letter capitilized

earnest phoenix
#

ik that was judt an example

#

and no i used pascal case for that

crimson vapor
#

hmm

tardy hornet
earnest phoenix
#

use a regex pattern to match args[0]

#

or just parse it to a number using a math library

quartz kindle
#

you want to check if args[1] is a number?

#

or if args[1] contains a number anywhere in its content?

earnest phoenix
#

nah i pinged you for a react question

tardy hornet
#

i did that it will return if args 1 isnt a number, but if they do like, 1e3, its working

#

and i dont want it to work

lusty quest
#

isNaN if it returns true its not a number

quartz kindle
#

because 1e3 is a number, in scientific notation or whatever its called

earnest phoenix
#

it's called E

#

like i said use a math library to parse it

tardy hornet
earnest phoenix
#

mathjs is a good one

tardy hornet
#

oki

earnest phoenix
#

i need help

#

with an embed

#

so basically

#

when someone says

#

m!Premium

#

it sends them an embed

#

message.reply(embed);

#

done

tardy hornet
#

i think they want it to send it in DM

earnest phoenix
timber fractal
#
msg.channel.send(`**Calling the Police:typing:**`).then(
        (msg) => {msg.edit(`**Calling the Police:typing:**\n**You:** Come fast! There are criminals robbing me! Help Me!`, {timeout: 2000})})``` Why if i use this code right after it sends the message it edits it while i have a 2000ms timeout?
earnest phoenix
#

then it says

#

"sent you the details in dms!"

quartz kindle
#

there is no timeout for edit

timber fractal
#

@quartz kindle aw man how can i fix that?

#

so it actually waits before it edits it @quartz kindle

quartz kindle
#

setTimeout

tardy hornet
timber fractal
quartz kindle
#

then you did it wrong

earnest phoenix
#

Been 2 years since I’ve seen u

quartz kindle
#

wat

lusty quest
#

?you are not even this long here or where inactive for over 1 1/2 years

quartz kindle
#

11/2 years

earnest phoenix
timber fractal
quartz kindle
earnest phoenix
#

Tasty

#

👅

timber fractal
quartz kindle
#

then you still did it wrong lol

timber fractal
#

how would you do it than?

earnest phoenix
quartz kindle
#

what did you do?

earnest phoenix
#

can u help me

earnest phoenix
#

Are you sure

#

I don’t think so

#

🤔

lusty quest
earnest phoenix
#

LOL

lusty quest
#

"How do i make my bot public?" where the message

timber fractal
#

@quartz kindle can you show how you would do it?

quartz kindle
#

show how you did it first

forest ginkgo
#

;-;

timber fractal
#
msg.channel.send(`Something`).then(setTimeout(function(){(msg) => {msg.edit(`Something`)}}, 2000)``` @quartz kindle
crimson vapor
#

.then takes a function

#

that won't work

timber fractal
#

how than?

misty sigil
#

() => setTimeout

crimson vapor
#
msg.channel.send('X').then((m) => {
  setTimeout(() => {
    m.edit('Y');
  }, 2000);
})``` would work
misty sigil
#

or something

crimson vapor
#

msg.edit would fail

#

no perms

feral aspen
#

from index.js to handlers

#

what is the path?

#

Can't seem to figure it out

#

I keep have to make it like ```js
require(../src/handlers/${x})

cinder patio
#

./handlers, index.js is inside the src folder

feral aspen
#

Works!

pale vessel
#

Pog!

wise lark
#

Commonde skyrock ?

misty sigil
#

??

earnest phoenix
#

WHY IS THIS NOT WORKING

#

Ban command lol..

#

It’s not showing error neither

earnest phoenix
#

What lol?

#

Alrighty

#

Some guy told me it’s BAN_MEMBERS and not BAN_MEMBER

#

@opaque fern nope not working

#

No errors..

split cipher
#

What are you trying to do

#

ban someone from a server>

#

?

earnest phoenix
#

Just use the ban command I guess

merry shuttle
#

Anyone having issues rn?

earnest phoenix
#

Ye

merry shuttle
#

With d.js

earnest phoenix
#

Ye me

merry shuttle
#

Cuz i get a 404 error on all my scripts

#

idk why

earnest phoenix
#

Lol

merry shuttle
#

yeah

#

Form the snekfetch package apparantly

#

lmao

cinder patio
#

but discord doesn't use snekfetch anymore

sudden geyser
#

snekfetch is deprecated though

split cipher
#

I think you didnt put the method that bans the person
so you add

in about line 13

sudden geyser
#

are you using an older version

merry shuttle
#

no?

earnest phoenix
#

member.ban()

cinder patio
#

I meant discord.js

earnest phoenix
#

? @split cipher

split cipher
#

yeah

sudden geyser
#

What version of Discord.js are you using

earnest phoenix
#

Okie

sudden geyser
#

They removed snekfetch from their dependencies a while ago

zenith terrace
merry shuttle
#

yeah

#

i see

#

doing it rn

#

it's a pain in the ass xd

earnest phoenix
sudden geyser
#

What are you using as a replacement

split cipher
#

o

merry shuttle
#

It probably comes from another package

split cipher
#

did you change "BAN_MEMBER" to "BAN_MEMBERS"?

merry shuttle
#

weird

earnest phoenix
#

No it’s not that

#

WHY IS IT NOT WORKIGMDJJDNSUJSUJSS

#

Why? It was hard making it

split cipher
#

ok put

const memberID = message.guild.members.cache.get(member.id)
and change member.ban() to memberID.ban()

#

yeah

delicate shore
#

How can I make a YouTube bot
For livestream
Like it will have custom commands and etc
I don't wanna use stramlabs chatbot

#

I wanna start from scratch

#

There is nothing on docs about it

#

Or any project on GitHub I can learn basics from

earnest phoenix
#

But this one was a bit complicated since so many problems

#

Why?

split cipher
#

lemme try recreate

earnest phoenix
#

I’ve tried everything to try to make it workokeh

split cipher
#
module.exports = {
  name: 'ban',
  execute(message, args) {

const target = message.mentions.users.first()
 const targetMember = message.guild.members.cache.get(target.id)
targetMember.ban()
}
}
#

thats all really

earnest phoenix
split cipher
#

maybe u put those line codes in the incorrect place or something

#

:))

earnest phoenix
#

Lol thanks

#

But hm

#

I wanted a embed respond and that’s where the stuff started @split cipher

#

I will go hardcore

#

I WILL BE THE BEST

#

Lol

split cipher
#

ok show me ur entire code

#

rn

earnest phoenix
split cipher
#

you put member.ban() below line 14

delicate shore
#

How do I make a bot for YouTube?
Like there is no freaking repo on GitHub which I can look at to learn

#

Like a bot which will have diff commands in it and will work on yt livestream

#

I tried

#

I came here to help

earnest phoenix
delicate shore
#

For*

split cipher
#

oh yeah u havent changed that yet

earnest phoenix
#

Lol

#

So hm

#

It’s

delicate shore
#

I am making a YouTube bot for YouTube livestream
Like nightbot

#

Where to start

#

Like what is the functioning of yt API because it's docs are confusing at

#

Af*

earnest phoenix
#

.then(() => { member.ban()

#

@split cipher ?

delicate shore
#

member.ban not ,

earnest phoenix
#

Yes my bad

#

Need little assistance

delicate shore
#

Ale

#

Alr*

earnest phoenix
#

How to check if message is bot message

split cipher
#

add const memberID = message.guild.members.cache.get(member.id) below line 9 and change to memberID.ban() and add it to below line 14

#

yeah

delicate shore
#

yers

#

Yes

earnest phoenix
#

Alrighty @delicate shore

delicate shore
#

shut up
I said I am not getting it

cinder patio
#

message.author.bot

#

not message.bot

delicate shore
#

If you can't help then please shut up

earnest phoenix
#

I wan tk check any bot

#

@split cipher ye?

split cipher
#

yeah

earnest phoenix
#

So it’s only with Id now right?

split cipher
#

yeah

earnest phoenix
#

Hm let’s see

#

@split cipher nope nothing

split cipher
#

yeah i think i know the answer

#

you didnt put those {} thing like

#

if (message.member.hasPermission('BAN_MEMBERS') ) {
}

#

yeah

#

your if statement is broken

trail edge
#

hi i have a "issue" with mongodb, i try add 1 "caña" with method "inc" but it doesnt works, here is the code, someone meets the error?

#
      db.collection('Users').updateOne({user: message.author.id, objetos: { objeto: "CañaBasica"} }, {$inc: {cantidad: 1}})
                        message.channel.send(new Discord.MessageEmbed()
                              .setColor('GREEN')
                              .setDescription(emoji.bien+' | Compraste exitosamente una :me_drod_flaming: **Caña Basica** '))  
earnest phoenix
#

@split cipher haha I deleted my coding I guess I’ll have to start again

split cipher
#

:0

earnest phoenix
#

Lol

#

I’ll work on this 😎

#
module.exports = {
  name: 'ban',
  execute(message, args) {

const target = message.mentions.users.first()
 const targetMember = message.guild.members.cache.get(target.id)
targetMember.ban()
}
}
crimson vapor
#

I mean it works

earnest phoenix
#

Ye

earnest phoenix
#

@split cipher hahahahahya thanks for that lol

split cipher
#

np

earnest phoenix
#

@split cipher but uh it’s I’d only right! Yes

split cipher
#

Id?

earnest phoenix
#

Id*

#

Ye

#

@split cipher btw the id is unidentified it says

#

This will work right?

split cipher
#

did you type this:
ban @earnest phoenix

earnest phoenix
#

Mhm

split cipher
#

who was the target?

#

apparently you cant ban youself

#

if you are the owner of the guikd

earnest phoenix
#

No I tried banning someone else

#

It’s not working

split cipher
#

uh

earnest phoenix
#

Disappointment 240

split cipher
#

idk why lol

earnest phoenix
split cipher
#

does targetMember.kick() work tho

#

Did the bot send the embed message?

earnest phoenix
#

No idea since I don’t have it

#

Nope

split cipher
#

smh

lusty quest
split cipher
#

oh, but haspermission still work at this time

lusty quest
#

yea its only deprecated on the latest D.js builds

#

if you run a older one it still works

split cipher
#

i see

earnest phoenix
#

I AM GOING TO EXPLODE

lusty quest
#

first time?

split cipher
#

do other commands even work

#

get rid of "run"

split cipher
lusty quest
#

it depends on how the message handler works

split cipher
#

^

lusty quest
split cipher
#

oh

glad violet
#

help me how to search in youtube to play a sound

#

in music bot

#

js

earnest phoenix
glad violet
#

dm me if u found

lusty quest
earnest phoenix
#

WHY THE WORLD IS THIS JOT WORKING IVE BEEN WORKING ALL DAY

lusty quest
split cipher
#

lol

glad violet
#

youtube-search-api

#

and ytdl

lusty quest
#

if you sit already all day on it, maybe take a break, a tired programmer is a stupid programmer

lusty quest
glad violet
#

what is RTFD

lusty quest
#

Read the fucking Docs

glad violet
#

../

#

but i use the old js way

#

all commands in index.js

lusty quest
#

this has nothing to do with ytdl or ytsearch

earnest phoenix
lusty quest
# earnest phoenix Lol no

then take my other suggestion, take a break, and get your brain clear. its possible that you get an idea

split cipher
#

then ur command handler isnt working properly

#

yeah, go take a break

earnest phoenix
#

Yes lol

split cipher
#

i know how it feels

earnest phoenix
#

Finally it outputted some errors

split cipher
#

i kept getting stuck when i was a beginner

earnest phoenix
#

Lol

#

Same

glad violet
#

do i use that
mine
server.dispatcher = connection.play(ytdl(server.queue[0], {filter: "audioonly"}));
that new
ytdl(searchYouTubeAsync(args), { filter: 'audioonly' });

split cipher
#

you could replace message.author.tag with message.author.username

cinder patio
#

target.user.tag is not a thing because target is already a user

split cipher
#

ez

sterile lantern
#

how do i delete a slash cmd

#

i tried yesterday but the function didn't work

split cipher
#

oh

glad violet
#

CAN SOMEONE HELP ME

spiral crag
#

guys does anyone know how to get a voice channel by id

glad violet
pale vessel
#

have you tried reading docs?

glad violet
#

to copy an id right click and copy id

glad violet
#

help me how to search in youtube to play a sound
in music bot
js
node 14v
Windows 10 x64 1909 Pro
Code App: Visual Studio Code (Now Using Notepad)
101 Lines Of Code
Using Index.js
OS Launguage : Greek

pale vessel
#

Very detailed

hardy geyser
glad violet
#

ik xd

pale vessel
#

You never know

lusty quest
#

if you use a compiled language it can matter

glad violet
#

i just do it very detailed for fun xd

#

more detailed now

hardy geyser
#

@glad violet you can search in youtube by youtube api itself , saving the link you get from api top result , and then using ytdl to install your top result vid by it link and playing that with djs

glad violet
#

but how to use youtube search api

#

what command to search

sudden geyser
cinder patio
#

there are many tutorials online

glad violet
#

send code here

hardy geyser
glad violet
#

i searched but not helped me

#

it used an other way to play

lusty quest
glad violet
#
        case 'play':
            
            function play(connection, message){
                var server = servers[message.guild.id];
                
                server.dispatcher = connection.play(ytdl(server.queue[0], {filter: "audioonly"}));

                server.queue.shift();

                server.dispatcher.on("end", function(){
                    if(server.queue[0]){
                        play(connection, message);
                    }else {
                        connection.disconnect();
                    }   
             
               });
            }

               
             if(!args[1]){
                 message.channel.send("You Need To Provide A Link")
                 return;
             }

          
             if(!message.member.voice.channel){
                 message.channel.send("You Must Connect To A Voice Channel To Play")
                 return;           
             }  

             if(!servers[message.guild.id]) servers[message.guild.id] = {
                 queue: []
             }

             var server = servers[message.guild.id];

             server.queue.push(args[1]);

             if(!message.guild.voiceConnection) message.member.voice.channel.join().then(function(connection){
               play(connection, message);
             })

            
              break;
#

play code

hardy geyser
sudden geyser
lusty quest
#

actually yes, ive learned some C# and wrote a bot with it, but the tutorial i followed made the bot in a way that it will not run on Linux bcs of some Nuget packages

glad violet
sudden geyser
#

But that's not limited to a compiled language

glad violet
#

pls can someone

#

send code dm

sudden geyser
#

It can be any language

lusty quest
#

node is mostly not affected by its platform, py mostly too, sure there is every an edge case, but it could also happen that someone try to run a Bot compiled for ARM on a x86 Server

sudden geyser
#

oh in that case then yeah

earnest phoenix
#

Alr so I’m uh back

#

Why is this not working?

lusty quest
#

sure you could use some hackery like docker or wine but why then not compile it directly for the target platform

#

also docker is limited to linux containers if not on a Windows machine

lusty quest
#

also message.mentions.members.first() is a thing

zenith terrace
earnest phoenix
#

Nine

#

None*

lusty quest
#

then you can skip the entire cache get thing

earnest phoenix
#

What should I replace it with?

#

Or should I just delete it

lusty quest
#

it removes some unnecessary code

#

also maybe run isBannable on the member first. just to make sure you can ban the member

#

otherwise it still should error

earnest phoenix
#

Well I have to use run in any single command...

lusty quest
#

but i think this way is more gracefull

earnest phoenix
#

To keep my bot online 24/7 I have to use run

lusty quest
#

where is the issue?

earnest phoenix
#

It’s just not working

lusty quest
#

well you show a command that is designed for a bot with Command handler

earnest phoenix
#

It’s not showing error

lusty quest
#

but try to run it in a single file bot

earnest phoenix
#

Hmmm

#

Otherwise does the code look clean?

hardy geyser
lusty quest
#

like i said i would remove the members.cache.get line and use what i suggested

#

then you are not relying that the user is cached

earnest phoenix
#

Hm I see

#

message.mentions.members.first() should I replace it with this?

lusty quest
#

replace your target line with it

#

since it does the same thing as this line and the one beneath

#

i suggested it him already

pale vessel
#

🙄

hardy geyser
cinder patio
#

the indentation is horrendous

earnest phoenix
#

anyone who can help me with github

sudden geyser
#

Explain what you need help with about GitHub

sterile lantern
#

doesnt work

#

yes i provide the id

#

error:

#

(node:41) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown application command

cinder patio
#

shouldn't it be .commands.delete("id");

earnest phoenix
#

mrriage

#

mariiage

umbral zealot
#

maaarige?

earnest phoenix
#

bot

umbral zealot
#

ARe you trying to say something? 😂

pale vessel
#

It's client.api()

earnest phoenix
#

i speak turkish

#

i not speak inglish

#

ben bot aramaya geldim

umbral zealot
#

Then at least write in turkish and use https://translate.google.com/ to give us half-decent english

earnest phoenix
#

you translet

cinder patio
#

yes as the http method, to add a command you do .commands.post(...) so I'm assuming it should be .commands.delete

pale vessel
#

Well you need to specify a command to delete

#

So /applications/{application.id}/commands/{command.id} = client.api.applications[id].commands[id].delete();

tardy hornet
#

why its deleting my message

pale vessel
#

@tardy hornet remove the invite url lmao

#

You can't send invites

delicate shore
#

Why

#

I just installed it globally

tardy hornet
pale vessel
#

But why Discord.Guild.id?

#

What's Discord?

sterile lantern
#

let response = await axios.get(`https://api.blox.link/v1/user/${id}`)

#

i console.log response.data

#

it prints the correct thing

#

i try to send response.data

#

it prints object

umbral zealot
#

"send"?

#

send how

sterile lantern
#

message

#

discord

lusty quest
#

did you de serilized the data?

umbral zealot
#

Well you can't just literally send an object to Discord.

lusty quest
#

discord api only accepts json iirc

sterile lantern
#

o

umbral zealot
#

When logging an object, node will display a certain level of data, but when you send it to discord it does .toString() which means it's going to be [object Object]

#

you can use JSON.stringify() to convert it to a readable string or just... format it correctly in a message 😉

sterile lantern
#

ah

#

alright

#

JSON.stringify only adds quotations

umbral zealot
#

But it will display it correctly though

#

I mean, as correctly as you can display an object in a discord message

#

Which usually is ugly as hell however you do it

sterile lantern
#

oh

#

i had

#

the two ` around it

#

thats why

#

thanks

delicate shore
mellow kelp
#

try restarting the shell

lusty quest
mellow kelp
#

if you're on vscode you gotta restart the whole thing

delicate shore
delicate shore
#

and I restarted

mellow kelp
#

did you reopen the terminal?

delicate shore
delicate shore
mellow kelp
#

hm

#

run echo $PATH

#

see if your package manager's path is set

balmy knoll
#

In Node.js, how can I convert code ' into a '?

mellow kelp
delicate shore
#

what does $path do

lusty quest
#

try gitfolio build <username>

mellow kelp
delicate shore
lusty quest
#

restart your pc

delicate shore
#

I will brb in 30 min

#

Leave your suggestions

mellow kelp
#

k

#

so i don't see any path for npm or yarn whatsoever

#

add your package manager's bin path

sterile lantern
#
.setAuthor(interaction.member.user.username, interaction.member.user.displayAvatarURL());```
#

the first member.user.username works

#

the member.user.displayAvatarURL doesn't

#

i tried interaction.member and then interaction.user

#

neither work

slender wagon
#

guys I am kinda confused is glitch the one who doesn't want you to host bots on their platform or does discord block glitch ip's?

solemn latch
#

Glitch doesn't want users using bots on their free platform

slender wagon
#

oh okay thanks

solemn latch
#

Or more specifically, glitch doesnt want users to use uptime robot or force the program to be up on their free platform.

delicate shore
#

Sorry if my ping disturbed you notlikenoot

mellow kelp
#

so

#

run npm/yarn bin

#

idk what your package manager is

#

and copy the path you get

tribal siren
#
let channel = oldState.guild.channels.cache.get(await db.get(`newtext_${oldState.channelID}`));
channel.channel.delete()```
#

cannot read property 'channel' of undefined

mellow kelp
#

what is oldState in this context?

earnest phoenix
#

channel.channel

#

doesn't that seem a bit wrong to you

#

:p

glad violet
#

invalid channel.channel

mellow kelp
#

oh yeah that too KEKW

tribal siren
#

no it doesn't

glad violet
earnest phoenix
#

they weren't saying it isn't wrong

#

they were saying it doesn't look wrong to them

tribal siren
#

because if i do channel.delete() it will say that cannot read property 'delete' of undefined

glad violet
#

if u created a const or a var channel its alerady exist so rename it channel2 or something

earnest phoenix
#

console.log channel

#

see what it is

quartz kindle
#

that doesnt mean channel.channel is a thing lol

tribal siren
#

it gets a guild channel through the database

earnest phoenix
#

nvm the error says it's undefined

quartz kindle
#

your channel is undefined, meaning, your database did not return any data for the query you asked for

tribal siren
#

if it doesn't return data it says null

quartz kindle
#

which makes the channel undefined

#

because channel = ...cache.get(null)

#

put your database query in a separate line and log what it returns

tribal siren
#

so that means i search the wrong database?

quartz kindle
#

its either returning null, or its returning an invalid channel

bitter dome
#

türk developer varsa dm

glad violet
#

@tribal siren it says an error of channel.channel or oldstate.channel

earnest phoenix
#

ignore them

tribal siren
#

well still rn i don't have time to solve it so im just gonna think about it tomorrow thanks for advice

sterile lantern
#

how would i make this work
.setAuthor(interaction.member.user.username, interaction.member.user.displayAvatarURL());

member.user.displayAvatarURL doesn't work
neither does user.dAURL
or member.dAURL (shortened for displayavatarurl)

delicate shore
#

Why do I always forget to disable ping

mellow kelp
#

now you gotta do export PATH="$PATH:the/path/you/copied"

#

that will add the path you copied to the list

glad violet
#

displayAvatarURL().replace('webp','png')

sterile lantern
#

yea but

#

it says its not afunction

#

a function*

#

member.user or user.displayavatar

delicate shore
#

Thanks

glad violet
sterile lantern
#

this is a slash cmd

#

usually something like

#

message.author.displayAvatarURL() would work just fine

#

but this doesnt

#

work

earnest phoenix
#

interactions can't respond with embeds regardless

sterile lantern
#

?

#

they do

cinder patio
#

they can

#

up to 10

sterile lantern
#

up to 10 per cmd?

#

or just 10 in total

cinder patio
#

per command

near stratus
sterile lantern
#

ah alright

#

thats not the issue tho

#

its not a function

#

for some reason

#

interaction.member.user.displayAvatarURL()

#

interaction.user.displayAvatarURL()

cinder patio
#

those are raw objects, not discord.js ones

glad violet
#

oh wait

lethal trout
sterile lantern
#

o

glad violet
#

then wait

sterile lantern
#

./models/prefix.js i think

near stratus
#

@sterile lantern user.avatarURL is the function

lethal trout
sterile lantern
#

so no interaction.user?

#

oh

#

avatarURL

#

alright

quartz kindle
glad violet
#

use
message.member.user.displayAvatarURL();

lethal trout
near stratus
glad violet
#

or
message.author.displayAvatarURL();

cinder patio
#

you will have to use something like this:

const guild = client.guilds.cache.get(interaction.guild_id); // to get the guild
const user = client.users.cache.get(interaction.member.user.id); // to get the user
quartz kindle
#

and account for missing cache

sterile lantern
#
client.ws.on('INTERACTION_CREATE', async interaction => {```
#

thats how tis defined

#

its*

cinder patio
#

yea

glad violet
sterile lantern
#

this wont work

#

its a interaction

glad violet
#

oh

sterile lantern
#

its different bc i dont think d.js has support for it yet

lethal trout
#

pls help me

#

pls

near stratus
sterile lantern
#

that doesnt work

cinder patio
sterile lantern
#

hm

#

ok

near stratus
quartz kindle
lethal trout
quartz kindle
#

which means you're receiving raw data from discord itself

lethal trout
glad violet
#

open bot folder

sterile lantern
#

yea

glad violet
#

and open models

#

and find it

lethal trout
near stratus
glad violet
lethal trout
lethal trout
glad violet
#

yes

#

. = bot folder

lethal trout
#

?

sterile lantern
#

(node:1699) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'displayAvatarURL' of undefined

near stratus
glad violet
#

. = BOT FOLDER

#

the folder do u make the bot

near stratus
#

I mean the file you're accessing the file with

lethal trout
#

?

near stratus
#

. = SOURCE directory

glad violet
#

and used cd to get into the folder and install npm

#

THAT BOT FOLDER

#

BRUH

lethal trout
tardy hornet
tardy hornet
#

why is it on the other side?

glad violet
#

go to modules folder

cinder patio
#

show the code samm

glad violet
#

and find prefix.js

lethal trout
tardy hornet
lethal trout
glad violet
#

yes that is

lethal trout
glad violet
#

FINALY U FINDED IT

#

👏

lethal trout
#

now?

near stratus
lethal trout
glad violet
#

.catch()

sterile lantern
#

  const guild = client.guilds.cache.get(interaction.guild_id); // to get the guild
          const user = client.users.cache.get(interaction.member.user.id); // to get the user
            const embed = new Discord.MessageEmbed()
                .setTitle("Bloxlink API - Interaction")
                .setColor("#83ff8f")
                .setFooter("Hanalei Bay", client.users.cache.get("botidishere").displayAvatarURL())
                .setThumbnail(client.users.cache.get("botidishere").displayAvatarURL())
               .setDescription(`Sent a request to https://api.blox.link/v1/user/${id}\n` + "```json\n" + JSON.stringify(response.data) + "```")
                .setAuthor(interaction.member.user.username, user.displayAvatarURL());```
#

oh uh

#

ignore the formatting

lethal trout
glad violet
glad violet
lethal trout
glad violet
#

wait

quartz kindle
#

you need to fetch

near stratus
#

@sterile lantern

  const guild = client.guilds.cache.get(interaction.guild_id); // to get the guild
          const user = client.users.cache.get(interaction.member.user.id); // to get the user
            const embed = new Discord.MessageEmbed()
                .setTitle("Bloxlink API - Interaction")
                .setColor("#83ff8f")
                .setFooter("Hanalei Bay", client.users.cache.get("botidishere").displayAvatarURL())
                .setThumbnail(client.users.cache.get("botidishere").displayAvatarURL())
               .setDescription(`Sent a request to https://api.blox.link/v1/user/${id}\n` + "
json\n" + JSON.stringify(response.data) + "")
                .setAuthor(interaction.member.user.username, user.displayAvatarURL());
lethal trout
glad violet
#

%UserProfile%\Documents\Flame Bot\flamebot\models\prefix.js

#

ok now

cinder patio
#

client.users.cache.get("botidishere").displayAvatarURL()

lethal trout
#

now?

tardy hornet
#

why dose it put it like that

cinder patio
#

"botidishere" is not an id...

tardy hornet
#

i want it to be all the way left

sterile lantern
#

same error

#

i know its not an id

#

i put that there on purpose

#

theres an actual id there

near stratus
quartz kindle
#

keep in mind that fetching is a promise and requires awaiting

sterile lantern
#

oh

lethal trout
glad violet
lethal trout
#

then

glad violet
#

copy it

cinder patio
#

it's not cached or it's not an actual id, then

frail holly
#

So im an idiot and have a very very basic math question
"Image size can be any power of two between 16 and 4096"

How is 320 a power of 2

lethal trout
frail holly
#

And is there a valid value between 256 and 320?

frail holly
#

?size=320 is valid though.

#

Which is weird

glad violet
lethal trout
glad violet
#

for file path

#

C:\Users\Sakith\Documents\Flame Bot\flamebot\models\prefix.js

earnest phoenix
glad violet
#

this is the file path

lethal trout
#

yes

glad violet
#

if it cant read use "

frail holly
#

It works with banner images

#

see

#

its weird

#

i wonder what other sizes are valid.

quartz kindle
#

maybe because they use widescreen format

#

320p

frail holly
#

Hmm possible

lethal trout
frail holly
#

240 isnt valid

glad violet
#

thaths the path

lethal trout
glad violet
#

its ready

near stratus
#

@glad violet you did your best
BTW I'm gonna die laughing if this continues

lethal trout
quartz kindle
#

that wont work lol, backslashes are escaping

#

if your folder structure is too complicated just use process.cwd()

near stratus
glad violet
tardy hornet
quartz kindle
#

windows supports both tho

glad violet
#

its great

lusty quest
near stratus
quartz kindle
#

but hes referencing it from inside another folder

lusty quest
#

also easy

quartz kindle
#

yes but he seems to be confused about it

near stratus
lusty quest
#

.. gets you to your root directory

quartz kindle
#

because ./ means current folder

lusty quest
#

from there you can reference normally

glad violet
#

i know

quartz kindle
#

.. is not root

#

its previous

near stratus
lusty quest
#

yea sry my bad

tardy hornet
#

@near stratus

#

like that?

lethal trout
quartz kindle
#

process.cwd() is process root

lethal trout
#

me?

earnest phoenix
near stratus
glad violet
tardy hornet
lethal trout
earnest phoenix
#

markdown is built to be an easier alternative to html & css, you can't mix those

near stratus
quartz kindle
near stratus
#

in CSS put the float value

glad violet
near stratus
#

you deserve an award

glad violet
#

do .\flamebot\modules\prefix.js

lethal trout
#

😦

glad violet
#

try this

quartz kindle
#

dont blindly try things

#

just show us the full path of both files

near stratus
#

he did

quartz kindle
#

the other file too

lethal trout
glad violet
#

try now
%UserProfile%\Documents\Flame Bot\flamebot\modules\prefix.js

quartz kindle
#

what is the path of the other file

#

setprefix.js

lethal trout
#

no

near stratus
#

@lethal trout where is setprefix.js ???

lethal trout
#

just prefix

near stratus
#

where is the file ?

lethal trout
quartz kindle
#

where is the file

#

what is the full path of the file

sterile lantern
#

yeah the displayavaturl isnt working since user isnt cached

#

avatar*

#

if i specify a user id itll work

#

otherwise the other methods dont work

near stratus
sterile lantern
#

so i think i gotta wait for d.js support

lethal trout
glad violet
quartz kindle
#

no

#

jesus

quartz kindle
#

now look

near stratus
quartz kindle
#

your file is in bot/commands/utility

#

so

near stratus
#

use .. to go back

sterile lantern
#

easy solution move your bot folder to C:\Users\botfolderhere

#

lmfao

#

or just

#

move your prefix.js

sterile lantern
#

wdym

#

you can literally just use file explorer

near stratus
#

./../models/prefix.js will do fine

sterile lantern
#

unless he already has other paths set up

#

hmm

#

alr

glad violet
quartz kindle
#
./                       = bot/commands/utility
../                      = bot/commands
../../                   = bot
../../models             = bot/models
../../models/prefix.js   = bot/models/prefix.js
near stratus
#

no need to move

glad violet
#

its more easiest

near stratus
#

./../models/prefix.js

earnest phoenix
#

why don't you just use forward slashes again

#

windows supoorts forward and back slash

glad violet
#

i have my bot on
D:\Discord\Bots\Music Bot

earnest phoenix
#

when you're going to be moving to UNIX for hosting you'll only get forward slash support

near stratus
quartz kindle
#

you did ./../ tho, not ../../

lethal trout
pale vessel
#

??

near stratus
#

??

lethal trout
#

correct?

earnest phoenix
#

that first slash is redundant

pale vessel
#

I use forward slashes on my windows machine and it works fine

#

Too lazy to use path.join()

near stratus
near stratus
pale vessel
#

Just add an extra period

near stratus
#

in the beginning

#

of the string

glad violet
#

why u dont have it on Flame Bot

quartz kindle
#

they are escapes in js strings

#

not literal backward slashes

near stratus
glad violet
#

yea its \

#

not /

near stratus
#

\is backwards

quartz kindle
#

/ is forward

near stratus
#

yea

glad violet
#

directory uses \

#

\

#

C:\

near stratus
#

and I use them (/)

quartz kindle
#

because windows is stupid, but windows supports both

lusty quest
#

\ is for windows bcs its retarted and / is linux

quartz kindle
#

if you type C:/ it works too

#

if you want to use backward slashes in js, you need to use two, because they escape each other

#

"C:\\bla\\bla\\bla"

lusty quest
#

if you would use the absolute path you will have to edit it again if you deploy to a server

near stratus
#

Windows can even run Bash give up backslash.

glad violet
#

yea but the normal is \

slate apex
#

Pls rich

glad violet
#

if u type C:/ it will be C:\

near stratus
#

wait @lethal trout is not replying. maybe his problem got fixed

lusty quest
#

normal is / \ is only windows. Most server Enviroments run on Linux

quartz kindle
#

because windows is stupid

near stratus
glad violet
near stratus
glad violet
#

and the games

quartz kindle
#

no program uses \ in the code

lethal trout
near stratus
quartz kindle
#

linux does have one click install tho?

lusty quest
#

Linux got one click install on some distros

earnest phoenix
#

manjaro KEKW

glad violet
#

and linux mint its easy to install

#

if u start linux mint from usb stick

lusty quest
#

i wish EA would support Linux more

#

and not Ban Linux Users

glad violet
#

u will have a shortcut in desktop named "Install Mint"

lethal trout
#

it worked thx everyone

solemn latch
#

I'm convinced one day linux will take over the windows pc market.

lethal trout
solemn latch
#

Hopefully

quartz kindle
#

linux doesnt have good support for gpu drivers tho

glad violet
lusty quest
#

i would switch to Linux if EA would not stop me than from Playing Titanfall 2

lethal trout
#

prefix.findOne is not a function next issuse

#

oof

umbral zealot
earnest phoenix
#

windows is making big moves with windows 10X and bringing the same redesign to normal windows 10

solemn latch
#

10x?

umbral zealot
#

Stop trying to dotpost you stock muppet

earnest phoenix
#

it will finally be the modern day OS we got promised

umbral zealot