#development

1 messages Β· Page 1101 of 1

bright dove
#

I got it to give an error when you do it in DMs, but how do make it not send the other error message (first one is in commands code, second one is in main code)

indigo oriole
#

ok i might help

#

hmm

bright dove
#

bro it took you 10 minutes to get copied code to work

digital ibex
#

what do u need?

bright dove
#

but how do I make it not send the other error message

digital ibex
#

use return

bright dove
#

but then it wouldn't work for any command

indigo oriole
#

post it on top.gg so i can test it

bright dove
#

that's... not how that works

digital ibex
#

no

bright dove
#

and also...

bro it took you 10 minutes to get copied code to work

indigo oriole
digital ibex
#

it would work for commands

#

if you do it correctly

bright dove
#

I don't know how to do it correctly

#

lol

#

that's what I'm asking

digital ibex
#

use return

indigo oriole
#

what are u using

#

to make the bot

bright dove
#

I only want it to not send the error on the purge command though

#

because it has it's own error

digital ibex
#
if (ur check to see if its a guild) { 
   return <send-message>
}```
#

dont see why thats not going to work

bright dove
#

oh

indigo oriole
#

who knows how to make this backround thats not already a dev

digital ibex
#

what?

bright dove
#

(I don't really know what return does I just use it anyway) does return keep it from doing anything else?

indigo oriole
#

`

~

digital ibex
#

can u stop

indigo oriole
#

`

#

`

`

digital ibex
#

bruh

indigo oriole
#

` hug

the

log`

sonic lodge
#

return stops the program from executing anything down the line

indigo oriole
#

lol

digital ibex
#

@shivaco

sonic lodge
#

are we allowed to ping a mod for this?

indigo oriole
#

@OfficiallyLost#3429

digital ibex
#

um, yes

indigo oriole
#

hi

digital ibex
#

this isnt related to development at all

indigo oriole
#

ik

digital ibex
indigo oriole
#

im bored

sonic lodge
#

so why not stop before a mod gets in here

indigo oriole
#

ok

bright dove
#

return stops the program from executing anything down the line
@sonic lodge it's not part of the same code though, the code that send the error message I don't want is from the main code, and the error message I do want send is from the commands code

indigo oriole
#

ill just code the commands

bright dove
#

unless I'm still not understanding how return works

#

lol

digital ibex
#

it explains how return works and when to use it

bright dove
#

ok lol

#

I'll read

sonic lodge
#

or you could just ignore all messages sent in dms

slow fable
#

I started using db and the server prefixes are stored there but the prefix turned to default today. I hosted it yesterday

bright dove
#

true

digital ibex
#

what database are you using?

sonic lodge
#

could you do that?

slow fable
#

some guy told me to use quick db cuz I was using json

digital ibex
#

its an upgrade ig

#

no idea how quick.db works, sorry

bright dove
#

could you do that?
@sonic lodge I got it to work already

#

with the return

#

so thanks for the help

#

and now I gotta read so I don't have to ask for help on the same thing again 😹

sonic lodge
#

good luck

bright dove
#

πŸ˜›

#

o lord

#

I am addicted to that emoji... if you see me use it again have someone ban me 😹

golden bear
#

So may I ask? I'm in team with someone and I coding bot with my friend will I get verify?

digital ibex
#

if you're on the application, yeah

faint prism
#

If it follows the rules

coral trellis
#

-mute @indigo oriole

gilded plankBOT
#

🀐 Muted anyone#9641 (@indigo oriole)

bright dove
#

o did we forget to ping

#

lol whoops

faint prism
#

ty

crystal socket
#

ly xig

golden bear
#

@digital ibex I mean in team

digital ibex
#

can u like

#

view and regen the token and stuff tho?

golden bear
#

Yes

digital ibex
#

then i believe you should get the badge (assuming you've sent your credentials)

golden bear
#

Oh thanks for telling

bright dove
#

the original post about bot verification says that everybody listed on the application gets the badge

digital ibex
#

probably should double check though, im not entirely certain

#

oh

lyric mountain
#

the original post about bot verification says that everybody listed on the application gets the badge
@bright dove everyone APPROVED

digital ibex
#

?

bright dove
#

yeah that

lyric mountain
#

And up to 10 members

crystal socket
#

they changed it

#

if you add someone after you verify

digital ibex
#

oof 11 devs developing one bot

crystal socket
#

no more badge

lyric mountain
#

Yep

crystal socket
#

i say any team with more than 3 devs is doing it just for the badge

lyric mountain
#

That was actually expected

#

The badge shouldn't be something everyone can get without effort

crystal socket
#

yeah but its like one capable person does it and invites 9 others to the team who pay them

lyric mountain
#

Yeah, ik

#

Here in brazil we can them "fridges"

digital ibex
#

im starting to hate bulma

#

it severely lacks features

bright dove
#

what's bulma

digital ibex
#

flexbox framework

crystal socket
#

what's flexbox

digital ibex
#

a css framework

crystal socket
#

why not just use plain css MegaThonk

digital ibex
#

for responsiveness?

#

no actual site uses plain css lul

bright dove
#

idek what css is KEKW

golden bear
#

Flexbot might be rich

digital ibex
#

what

#

not flexbot

#

flexbox

#

its the easiest language, anastasius

bright dove
#

language for what? programming

#

or like web design or something

digital ibex
#

oh, wait... i just realised flexbox isnt a framework πŸ€¦β€β™‚οΈ

#

make a bot with css πŸ˜›

bright dove
#

oh

#

well like

digital ibex
#

its for styling on websites

golden bear
#

Hmm

digital ibex
#

lmao

golden bear
#

Nice xd

bright dove
#

how is it easier? just easier to understand?

digital ibex
#

yeah

bright dove
#

wait now I'm confused lol you said

make a bot with css πŸ˜›
and then you said
its for styling on websites

digital ibex
#

this is all it is

#

well, not all, but the jist of it

#

it was a joke lmao

plush fractal
#

Im made a bot and it works!

bright dove
#

oh lol

digital ibex
#

u cant make a bot with css

plush fractal
#

You can't lol

bright dove
#

ok lol

plush fractal
#

lmao

digital ibex
#

but it is prety simple though

#

try learning it for like a month

#

and u'll get the hang of it ez

thin trout
#

I think its weird I developed a bot and I have no role LOL.

bright dove
#

is it listed?

winter basalt
#

only for approved bots

bright dove
digital ibex
#

how do u expect top.gg to know if u've created a bot or not???

restive notch
#

can i make my Eris code so its not else if for the next command?

digital ibex
#

use a command handler?

bright dove
#

^

digital ibex
#

dynamic one

thin trout
#

Yes

plush fractal
#

And i have a question

thin trout
#

@bright dove It just got added

winter basalt
#

then wait

bright dove
#

is it approved?

winter basalt
#

takes 3+ weeks

digital ibex
#

ha lmfao

plush fractal
#

How can you make so you can change it's prefix?

thin trout
#

oh

digital ibex
#

change the global prefix?

plush fractal
#

To what?

bright dove
#

I think he means so guilds can

#

you need a database for that

#

like quick.db

digital ibex
#

or a different prefix for each server?

plush fractal
#

So people can change bots prefix for their server.

thin trout
#

I hope it gets accepted I will be so happy.

bright dove
#

you need a database for that

plush fractal
#

k

digital ibex
#

use mongodb

plush fractal
#

k

thin trout
#

Discord server list is way better then disboard

bright dove
#

k cool

#

wrong place

plush fractal
#

k

sudden geyser
#

eh I don't know about that

#

Anasta I think they're talking about @pliant gorge

bright dove
#

use mongodb
@digital ibex pros and cons? been gathering info on databases since I started and I want to make the right choice in the future

thin trout
#

Yeah

bright dove
#

Anasta I think they're talking about @pliant gorge
@sudden geyser oh lol... totally knew that... me smart

winter basalt
#

still wrong place

#

this is development

bright dove
#

^

thin trout
#

oh where should I chat?

winter basalt
#

but you probably shouldnt talk about other listing aswell

digital ibex
#

im pretty sure mongodb is faster, mongo has a gui which u can add data manually, quick.db doesnt support graphs where as mongodb does and uhh

#

thats all i can think off the top of my head at 3am lul

#

oh and

#

mongodb stores data in json format, which is easier to interact with if ur familiar with oop, and sql uses tables

bright dove
#

oop?

digital ibex
#

thats my take on it tho, i've never used quick.db only mongodb so cant really compare the two

#

object orientated programming

bright dove
#

oh

thin trout
#

What is a good way of getting members in your discord bot server? Cause I need people to know about my bot lol.

bright dove
#

still wrong place

#

but I'd be happy to answer you in #general

opal plank
#

use postgres if you want good UI

#

pgAdmin is rather comfy to use

digital ibex
#

its also designed for large scaled apps

bright dove
#

yeah I know a bot that's transferring to postgres

#

because they got big-ish 😳

digital ibex
#

seems useless to me

#

not the db ofc

opal plank
#

apart from jsonB tables, ive been loving it the past months ive used it

#

jsonB scarred me emotionally, a bit

digital ibex
#

loads of bots use mongodb

#

dyno uses mongodb

#

its not the best bot, but sometimes its fast, when its online lul

bright dove
#

lol I'm telling dyno!!1!!!!!1!11!!1

#

true though

#

anyone know why dyno goes off for 5 days at a time all the time?

digital ibex
#

you'll only get urself muted or banned or something eh

bright dove
#

what

digital ibex
#

they dont really care about it tbh

timber linden
#

How do i make visual studio code go in discord.js

digital ibex
#

i mean, ofc they've got to keep it up, but thats about it

slow fable
#

what free db would y'all recommend for a beginner (if there are any)

digital ibex
#

uh

#

mongo?

#

im pretty sure most databases are free

slow fable
#

Alright

#

But is it beginner friendly

digital ibex
#

the installation and the set up is a bit tricky

#

but other than that

#

everything else is simple

slow fable
#

Ok tysm

timber linden
#

.

#

@digital ibex how do i make visual studio code do js

plush fractal
#

There is more code under lmao

digital ibex
#

ok

old gulch
#

anyone?

#

Someone can help me?

sonic lodge
#

don't ask to ask, just ask

old gulch
#

{
success: 1,
result: [
{
player_key: 4127669367,
}
]
}

pale vessel
#

ok

old gulch
#

how can I take the player_key

#

using axios?

pale vessel
#

obj.result[0].player_key?

old gulch
#

I can print this

pale vessel
#

result is an array

old gulch
#

I'm consoling log(result.data)

#

so

sonic lodge
#

then replace obj with result.data

old gulch
#

ok

pale vessel
#

ok

old gulch
#

I'm going to try

sonic lodge
#

do you understand accessing object properties?

old gulch
#

yep

#

I was trying to use result.data["result"]

sonic lodge
#

that works too

#

but you still need to access player_key at the end

delicate shore
#

Hi

pale vessel
#

get the index of the result first before accessing player_key

timber linden
#

i need help

old gulch
#

how can I take bot developer tag?

timber linden
#

how do i make my code discord.js

sonic lodge
#

your bot must be approved on top.gg

timber linden
#

ewhy does no one

#

answer me

sonic lodge
#

elaborate

old gulch
#
const player = await axios.get(url)
        const {player_name: Nome, player_number: Num, player_country: pais, player_age: idade, player_goals: gols, player_yellow_cards: amarelo, player_red_cards: vermelho, team_name: time } = player.data["result"]
        console.log(Nome,Num,pais,idade,gols,amarelo,vermelho,time)
        console.log(player.data)
#

this is my code

#
undefined undefined undefined undefined undefined undefined undefined undefined
{
  success: 1,
  result: [
    {
      player_key: 4127669367,
      player_name: 'Neymar',
      player_number: '10',
      player_country: 'Brazil',
      player_type: 'Forwards',
      player_age: '28',
      player_match_played: '2',
      player_goals: '1',
      player_yellow_cards: '0',
      player_red_cards: '0',
      team_name: 'Paris SG',
      team_key: '3040'
    }
  ]
}
#

this is the result

sudden geyser
#

player.data["result"] returns an array of objects

#

you still need to access the element(s) in the array

#

such as player.data.result[0]

old gulch
#

oh

#

for example

#
{player_name: Nome } player.data.result[0]

#

result[1]

sudden geyser
#

yeah for example that, but you're forgetting the = in between

old gulch
#

ya ya

sudden geyser
#

but result could be more than one element, so you'll need to decide what to do with each element

old gulch
#

I just copied and pasted

#

that why i'm using axios?

#

!

digital ibex
#

what

delicate shore
#

Hi

potent ridge
#
<html>

<head>
<style>
body {
  background-color: #333333;
}
</style>
</head>

<body>
  <h1 style="color:White;"><b><center><u>Yakushi Bot</u></center></b></h1>
<center>
<p style="color:white; font-size:200%;">
<b>
β€’ [Moderation Commands]
<br>
<br>
β€’ [Music System]
<br>
<br>
β€’ [Info/Utility Commands]
<br>
<br>
β€’ [Server Config]
<br>
<br>
β€’ [Channel Management]
<br>
<br>
β€’ [Role Management]
<br>
<br>
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
<br>
If you have an questions, suggestions or issues with the bot please join the <a href="ul">support server (click)</a>
<br>
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
</b>
</p>
</center>

</body>
</html>
#

im trying to set the background to dark

#

in my editor it works

#

then when i use it on top gg

#

the background just stays light

idle mountain
#
<style>
body {
  background-color: #333333;
}
</style>```
^ change this to
```html
<style>
html {
  background-color: #333333;
}
</style>```
#

i believe that'll work

#

everyone's bot page is different but usually people use an html tag rather than a body tag

karmic compass
#

how do i turn message.author into a member

potent ridge
#

you dont

#

just change
message.author
to
message.member

karmic compass
#

oh

potent ridge
#

@idle mountain i tried both of them and none seem to work

ember lodge
karmic compass
#

uh one more question: how do i set the nickname of a user

viral iris
bright dove
#

well uh

#

not much to go off of

ember lodge
#

@viral iris Canvas?

potent ridge
#

can someone help me above please

karmic compass
#

uh one more question: how do i set the nickname of a user
FGGGGGGGhsdf

viral iris
#

@viral iris Canvas?
@ember lodge yes

karmic compass
#

woops

#

caps

ember lodge
#

Use paint to get cordinates of a photo

bright dove
#

btw

viral iris
#

Can u help. Me with that?

ember lodge
#

sorry bud, i am working on my website

#

i have this error tho

bright dove
#

[]

viral iris
#

Any1 know canvas can help?

bright dove
#

but connected :P

potent ridge
#

@karmic compass message.member.setNickname

karmic compass
#

kk

viral iris
#

I need to get these half black thing in the all of images and the name & description

cunning oxide
#

@viral iris you using Canvas?

viral iris
#

Yes

#

Can u help?

cunning oxide
#

Might be able to -- you're processing all images as one?

viral iris
#

By api

#

Yes

cunning oxide
#

Reason I ask is it might be easier to process them each individually

viral iris
#

Yes yes 1 image

cunning oxide
#

Like

#

is one?

viral iris
#

Yes

cunning oxide
#

As far as I understand it.

#

You should be able to define a x,y

#

and write the text in that

viral iris
#

Under x and y?

cunning oxide
#

have you read the docs?

#

beccause it explains it within them

viral iris
#

Yes

cunning oxide
ember lodge
viral iris
#

U have to have y and x

cunning oxide
#

@ember lodge have you put everything in the <head> of your html file?

ember lodge
#

yes

cunning oxide
#

are you making sure you have the correct order?

#

Sometimes making sure your icons <style> comes above your other stylesheets is a solution

ember lodge
cunning oxide
#

do you have the actual font-awesome.css?

ember lodge
#

yes of course

cunning oxide
#

cool

#

are you trying to use premium icons?

ember lodge
viral iris
#

is it right ?

          var text = ctx.measureText(desc)
          var where = 256 - (text.width / 2)

          ctx.fillText(desc, where, 128);
cunning oxide
#

fillText(text,x,y) - draws "filled" text on the canvas

#

@ember lodge

are you trying to use premium icons?

ember lodge
#

nvm, i forgot to add the script

#

thanks tho

cunning oxide
#

LOL

#

all good man

#

sometimes shit happens

ember lodge
#

yeah thanks SwoloLikes

viral iris
#

@cunning oxide can u come dm for sec?

cunning oxide
#

@viral iris your x would be 256px - half of the width of the text

#

in tht case

#

i'd prefer not

#

i feel like its pretty straight forward js

#

like canvas is an EXTREMELY well documented lib

faint prism
#

Does the discord API include the ability to have bots share video/stream/screen share?

viral iris
#

why not all of them have text ?

cunning oxide
#

@viral iris make sure you're loading all of them

#

@faint prism not to my knowledge -- discord supports streaming of audio though.

viral iris
#

now how to flip it ?

#
        ctx.fillStyle = 'rgba(18, 18, 18, 0.5)';
        ctx.fillRect(x, y, 256, 128);
faint prism
#

Nah. I specifically want video.
Thank you though

cunning oxide
#

mhm

#

define x,y

viral iris
#

i did

#
    var x = i * 256
    var y = (round(i, canvasWidht) / canvasWidht) * 256

    x = y > 0 ? (i - round(i, canvasWidht)) * 256 : x
cunning oxide
#

@viral iris width

#

canvasWidth

viral iris
#

cuz i define canvasWidht as canvasWidth

cunning oxide
#

what?

queen marsh
#

So i used botghost and my bots were online yesterday now their offline today why?

cunning oxide
#

@queen marsh prolly go and ask their support

viral iris
#

can i give u the code?

queen marsh
#

ok

cunning oxide
#

i mean im not gonna do it for you

#

i feel like its super well documented

#

like enough to do it yourself

#

i dont know much about canvas -- all the answers i've been giving you are just me googling

viral iris
#

but i don't know canvas a lot

cunning oxide
#

yeah but how will you learn if you get me to do it all for you?

viral iris
#

so how to flip the half black thing ?

queen marsh
#

im scared my bot is gonna get declined due to it being offline, i got it back online but i just worry its gonna be declined.

earnest phoenix
#

So i used botghost and my bots were online yesterday now their offline today why?
@queen marsh botghost is a kid site for bots fr fr unless you pay

queen marsh
#

i will show you what i did

#

go to bot status

#

click start to make the bot online then click stop then click start again

viral iris
#

any1 know canvas can help?

queen marsh
#

It worked for me and now both of my bots are back online.

earnest phoenix
#

Ik what your saying but if you want something good if you can't code go on steam and get dbm

#

Discord bot maker

queen marsh
#

link?

earnest phoenix
#

It on steam look it up

queen marsh
#

ok

#

is it free lol

#

i dont have a budget

earnest phoenix
#

Like $10

crystal socket
#

nothing is freeℒ️

queen marsh
#

lol i can do $10

#

i'll use botghost till then i dont feel like doing all that

earnest phoenix
#

I mean i use it but I also code because I've coded like botnets for people and stuff

cunning oxide
#

nothing is freeℒ️

earnest phoenix
#

True

queen marsh
#

ill pay for botghost premium then, i like botghost because i already setup my bot through it and it works the way i want it to

earnest phoenix
#

I mean you can try to look up a free version but you'll just end up with a virus on your computer

queen marsh
#

yeah last time i got a virus and delt with it myself

#

that its not happening againℒ️ℒ️ℒ️

earnest phoenix
#

Yeah

#

Especially look out for those people using bots to grab ip address

low shard
#

@queen marsh lol

#

Bot ghost

earnest phoenix
#

Lol

low shard
#

Lmao

cunning oxide
#

i didnt wanna say it

#

someone had to

queen marsh
#

i was told by one of yall to try using botghost so shut it

earnest phoenix
#

I said it

cunning oxide
#

@queen marsh LMAOOOO

low shard
#

@queen marsh lol

earnest phoenix
#

I mean everyone tried botghost atleast once

low shard
queen marsh
#

i will use it until i can find something better -_-

earnest phoenix
low shard
#

@queen marsh you know how to coding ?

earnest phoenix
#

How to code**

queen marsh
#

not much expirience

low shard
#

Stf

queen marsh
#

and why code a bot when it only has 7 commands

low shard
#

@queen marsh just type in yy

#

Yt

#

How to make discord bot

earnest phoenix
#

XD yt to code pffft

queen marsh
#

ik how to make a bot

#

i have 2

earnest phoenix
#

@low shard what language do you code in

low shard
#

2 what

#

djs

earnest phoenix
#

Nice

low shard
#

Yo ?

#

Botghost

queen marsh
low shard
#

πŸ˜‚

#

Lollllll

#

Lmaooooo

queen marsh
#

are you trying to make fun of me :l

earnest phoenix
#

XD

#

Lmao

queen marsh
#

because i really dont care

low shard
#

"Bot Ghost"

queen marsh
#

everybody starts off not knowing how to do something

#

thats why you do/use what you can until you can find/learn something better

low shard
#

@queen marsh you have in yt how to make a bot

delicate shore
#

In guild object

viral iris
#

any1 know canvas can help?

delicate shore
#

What else can I use except name

low shard
#

@queen marsh dm him @delicate shore

delicate shore
low shard
#

For best bot

#

@delicate shore what?

delicate shore
#

In guild create

#

Listener

low shard
#

Ye

#

L9p

#

LOL

delicate shore
#

We use guild

earnest phoenix
#

XD

low shard
#

Glitch

#

Nice

delicate shore
#

And what other can we use

low shard
#

yes i think

earnest phoenix
#

Yeah

delicate shore
#

Any leave ?

low shard
#

Just try yourself

delicate shore
#

Else*

low shard
#

πŸ˜‚

queen marsh
#

i did try using yt for help it didnt work, so i came here and was told to use botghost

low shard
#

guild.leave ?

earnest phoenix
#

I'm rolling bruh

low shard
#

🀑

#

@queen marsh stop using it

queen marsh
#

why

low shard
#

Just find in yt

#

How to make discord bot

earnest phoenix
#

@queen marsh my guy you should just try to code

queen marsh
#

i will

earnest phoenix
#

Coding not that hard

delicate shore
#

No

queen marsh
#

Im literally gonna take coding classes

low shard
#

@queen marsh so easy

delicate shore
#

Guild.leave is nothing

low shard
#

@queen marsh cloding

#

🀑

delicate shore
#

Is guild.invitr

queen marsh
#

Coding*

delicate shore
#

Something ?

#

Oh

#

I am mad

#

I can just eval them

#

With my bot and try

#

Smh

earnest phoenix
#

I mean when I can code a botnet im sure coding a bot not hard

queen marsh
#

im already enrolled in a coding class pfffftt

earnest phoenix
#

XDDD

low shard
#

@delicate shore yes

earnest phoenix
queen marsh
#

it takes time lol

distant bramble
#

guys do u know a way to update a channel with discord.js

low shard
#

@queen marsh yes

earnest phoenix
low shard
#

Go to setting and update what you want

#

🀑

distant bramble
#

lets say a user join and i need to update it to current memebrs

#

i mean using the bot

low shard
#

Im joking

#

🀑

earnest phoenix
#

Bruh im dying

distant bramble
#

and its not for that purpose but ill go with that example

earnest phoenix
#

How de hell sum yall get developer

low shard
#

@earnest phoenix me?

earnest phoenix
#

No

low shard
#

Oj

#

Kk

cunning oxide
#

@earnest phoenix ctrl-c + ctrl-v PepeLaughing

earnest phoenix
#

πŸƒβ€β™‚οΈ

low shard
#

Loll

#

Cute dog

pale vessel
viral iris
#

any1 know axios package ?

sudden geyser
#

you should just ask the question and see if someone who knows it responds

cunning oxide
#

^^^^^^^^^

viral iris
#

any1 know axios package ?
who know how to get api data from the package ?

jolly quail
#

@viral iris wdym

#

Everything is documented in axios

#

How to make a GET request

restive lily
#
        await channel.send(embed=embed)```
i keep trying variations of this and i cant get it to work!
viral iris
#

@viral iris wdym
@jolly quail like this

async function getNewItems() {
  var res = await axios.get('https://fortnite-api.com/v2/cosmetics/br/new');
  var data = res.data.data.items;
#

ik it's wrong

jolly quail
#

Hmm no headers required for that api?

#

Token or api key or anything

viral iris
#

already open source https://fortnite-api.com/v2/cosmetics/br/new

jolly quail
#

Ic

#

well i don't have experience with using "await"

#

I just use .then()

sonic lodge
#

in an async function, await waits for the following promise to finish execution before continuing to the next line

earnest phoenix
#

Alguien espaΓ±ol?

jolly quail
#

@earnest phoenix English only here

#

I see

earnest phoenix
#

Ah okay

jolly quail
#

@viral iris did u log res?

earnest phoenix
#

translating a interesting message...

jolly quail
#

Is res.data.data.items valid?

viral iris
#

yes

#

i mean no

pale vessel
jolly quail
#

Yes.. I mean no lol

viral iris
#

πŸ™‚

jolly quail
#

Try logging res

earnest phoenix
#

Abocado

#

Thats all for today have a good dia v:

viral iris
#
console.log(`${res}`)
             ^

ReferenceError: res is not defined
jolly quail
#

Where did u put that line

weak rain
#
  name: "say",
  description: "Get the bot to say what ever you want!",
  usage: "<msg>",
  run: async (bot, message, args) => {
    if (!message.member.permissions.has("ADMINISTRATOR")) return;
 if (!args[1]) return message.reply("Please add a message");
  let text = args.slice(1).join(" ");
      return message.channel.send(`You did not specify your message to send!`);
    message.channel.send(text);
    message.delete();
  },
};```
This is my code
was perfectly working when i was using V11
now it is not taking commands properly
and saying
please add a message
jolly quail
#

After var res and before var data right?

viral iris
#

yes

weak rain
#

Anyone?...

#

..

sonic lodge
#

so args[1] doesn't exist

viral iris
#

After var res and before var data right?
@jolly quail no wait

#
[object Object]
jolly quail
#

Ya

#

Now log res.data

viral iris
#
[object Object]
jolly quail
#

res.data.data

viral iris
#
[object Object]
sonic lodge
#

why are you getting [object Object]

jolly quail
#

res.data.data.items

#

Ikr

sonic lodge
#

use util.inspect()

viral iris
#

idk

jolly quail
#

Console should display all

viral iris
#
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
weak rain
#

Help me please .....

viral iris
#

lol spam

jolly quail
#

Lol

#

I need to view one of that item

sonic lodge
#

@weak rain args[1] doesn't exist

jolly quail
#

Object object won't work now

viral iris
#

https://fortnite-api.com/v2/cosmetics/br/new

jolly quail
#

res.data.data.items[0]

#

I wanna see this

viral iris
#

ok

weak rain
#

oh lol

viral iris
#
[object Object]
sonic lodge
#

please require the util module and run util.inspect(object) instead lol

weak rain
#
``` now this is coming @sonic lodge
#

i specified :/

#

V11 was better i guess

sonic lodge
#

of course

#

it will always send that:

      return message.channel.send(`You did not specify your message to send!`);
    message.channel.send(text);
    message.delete();```
jolly quail
#

@jolly quail like this

async function getNewItems() {
  var res = await axios.get('https://fortnite-api.com/v2/cosmetics/br/new');
  var data = res.data.data.items;

@viral iris after this what did u do with data

sonic lodge
#

after you define text, there's a return statement that sends the error message and stops executing the rest of the code

jolly quail
#

There can be error in that

viral iris
#

There can be error in that
@jolly quail show code?

weak rain
#

So what to do ? πŸ˜• @sonic lodge

jolly quail
#

Yep

#

Ig

viral iris
jolly quail
#

Cuz so many objects r coming, i think ur data is fine

sonic lodge
#

so implement a check to see if text exists; only if not, send the error message

viral iris
#

u know canvas 2 ?

weak rain
#

kk

#

@viral iris canvas sucks

#

:/

viral iris
#

ik sm

jolly quail
#

Why did u write that

viral iris
#

is it right ?

jolly quail
#

Lemme see more wait

viral iris
#

@jolly quail if u know canvas please see line 42

jolly quail
#

Name and desc are different for each item right

viral iris
#

yes

weak rain
#
  name: "say",
  description: "Get the bot to say what ever you want!",
  usage: "<msg>",
  run: async (bot, message, args) => {
    if (!message.member.permissions.has("ADMINISTRATOR")) return;
  if (!args[1]) return message.reply("Please add a message");
  let text = args.slice(1).join(" ");
    message.channel.send(text);
    message.delete();
  },
};```
@sonic lodge now please add a message
jolly quail
#

@viral iris

weak rain
#

@jolly quail are their any canvas templates code available on the internet?

jolly quail
#

Idk.. Never used canvas

viral iris
#

let me check

jolly quail
#

Ask john

sonic lodge
#

args[1] doesn’t exist, again

weak rain
#

@viral iris hm

lusty quest
#

what did you want to do with canvas?

weak rain
#

kk

jolly quail
#

Log args @weak rain

weak rain
#

hm

bright dove
#

const categories = require('../commands/');
is giving me

  throw err;
  ^

Error: Cannot find module '../commands/'```
#

and I can't figure out why

viral iris
#

@jolly quail same

weak rain
#

@lusty quest brazzers,rip,etc commands

#

xD

jolly quail
#

Show the pic

viral iris
#

what did you want to do with canvas?
@lusty quest t??

lusty quest
#

?

viral iris
#

the same

lusty quest
#

@weak rain well all i can do are Charts. never did more

#

maybe you can combine 2 images. but this probably require that the overlay you want to add has to have a transperent background

weak rain
#

@weak rain well all i can do are Charts. never did more
@lusty quest but how

#

i want to combine only

jolly quail
#

@viral iris line 61 replace desc by item.description

#

Try it

lusty quest
#

Β―_(ツ)_/Β―

weak rain
#

see like this

#

brazzers command\

#

xD

jolly quail
#

Lol

lusty quest
#

i guess they have a image of the logo and attach it to the provided Image

viral iris
#

1min

jolly quail
#

Bongo bot has those jail, pregnant commands

weak rain
#

@lusty quest Yes

lusty quest
#

but how idk

weak rain
#

@jolly quail u have?

jolly quail
#

Nah not me

weak rain
#

if yes give me please

#

xD

viral iris
jolly quail
#

I wanna try image commands too now

#

Is canvas good?

bright dove
viral iris
#

Is canvas good?
@jolly quail yes

jolly quail
#

@viral iris ig i can't solve ur problem maybe

weak rain
#

But its tough :/

viral iris
#

can i replace axios with request ?

jolly quail
#

@viral iris no wait

#

That name and desc u defined above

#

Just try moving em inside the forEach

weak rain
#

i have rip command but i cannot fix it in my project :/

jolly quail
#

That name and desc above is most probably wrong

weak rain
#

it gives error

jolly quail
#

Hmm

#

Ur images are coming fine so axios request is successful @viral iris

#

No need to change that

sonic lodge
#

@bright dove ../ refers to the parent directory

#

is there a file commands.js there

bright dove
#

no it's a folder

#

:/

jolly quail
#

../commands only then

sonic lodge
#

it's looking for a file called commands.js

bright dove
#

../commands only then
@jolly quail is that not the same thing

jolly quail
#

Yeah

#

Why is he saying .js

viral iris
#

@jolly quail
Cannot read property 'items' of undefined

jolly quail
#

I think it's looking for commands folder

#

@viral iris where

#

Line?

bright dove
#

he said it's looking for a file called commands

viral iris
#
var data = data.items;

#

11

jolly quail
#

Hmm

#

Why would u do that

#

data=data.items?

viral iris
#

yea i think no need

jolly quail
#

Ur data was res.data.data.items

#

Already

viral iris
#

item is not defined

jolly quail
#

Where did u add item

#

Show me code

#

I told to add inside foreach

weak rain
#

@viral iris define item then

jolly quail
#

No no

#

He probably put before foreach

weak rain
#

kk

jolly quail
#

Item is defined there

weak rain
#

hm

viral iris
bright dove
#

it's looking for a file called commands.js
@sonic lodge how would I make it search through the folder commands

viral iris
#

./commands

jolly quail
#

Move those 2 line.. 12 and 11 to line 20 almost

#

I mean inside foreach

sonic lodge
#

is there a file in the folder you want to require

bright dove
#

all of them

jolly quail
#

11 and 12

#

Not 10 and 11 sorry

weak rain
#

@sonic lodge can u help me in canvas

#

i have the code

viral iris
#

data is not defined

weak rain
#

but cant fit in the editor

jolly quail
#

Hmm?

#

Oof

weak rain
#

as its giving error

jolly quail
#

Line 11 and 12 @viral iris

viral iris
#
  data.forEach(async (item, i) => {
jolly quail
#

Var name and var desc one

sonic lodge
#

use fs.readdirSync to get all the files in the commands directory

viral iris
#

ik

jolly quail
#

Show code again xD

sonic lodge
#

from there, you can loop through the resulting array to find javascript files and require each

bright dove
#

ah

#

ok

#

thanks

viral iris
jolly quail
#

Where is the data line

#

var data=res.data.data.items

viral iris
#

18

jolly quail
#

It's not there

viral iris
#

no

#

it's 11

#

and 12

jolly quail
#

var data=res.data.data.items
@jolly quail

viral iris
#

data.length

jolly quail
#

This thing

viral iris
#

no

#

look 12

jolly quail
#

Add it after line 10

viral iris
#

11

jolly quail
#

Why did u remove this?

viral iris
#

u say that

jolly quail
#

add it

#

Lol

#
var data = data.items;

@viral iris

viral iris
#

now item is not defined

jolly quail
#

This is wrong

#

Just Send the code

viral iris
#

i did

jolly quail
#

Damn I should just correct the code myself ig

viral iris
jolly quail
#

According to what I think

#

Wait

#

Lemme correct it

viral iris
#

ok thx

sonic lodge
#

@weak rain what do you need help with

weak rain
#

@sonic lodge i want to put my code in my repo but it shows error

sonic lodge
#

and that error is

weak rain
#

canvas code

sonic lodge
#

quite the unique error

weak rain
#

i forgot the error lol'

viral iris
#

u know canvas @weak rain ?

jolly quail
weak rain
#

@viral iris my friend gave me code

jolly quail
#

Try this

sonic lodge
#

how can i help if i don't know what the error is

viral iris
#

thx worked

weak rain
#

wait lemme try again

jolly quail
#

Np

viral iris
#

now need fix canvas ;-;

jolly quail
#

Yep xD

#

See the changes i made @viral iris

#

U were defining name and desc wrong

viral iris
#
    var data=res.data.data.items;

weak rain
#
const { AME_API } = require('../../config')
const ameClient = require('amethyste-api')
const AmeAPI = new ameClient(AME_API)

module.exports = {
    config: {
        name: "rip",
        noalias: [''],
        category: 'image',
        description: "Shows Grave Of An User!",
        usage: "[username | nickname | mention | ID] (optional)",
        accessableby: "everyone"
    },
    run: async (bot, message, args) => {

        let user = await message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.member;
        let m = await message.channel.send("**Please Wait...**");
        let buffer = await AmeAPI.generate("rip", { url: user.user.displayAvatarURL({ format: "png", size: 512 }) });
        let attachment = new Discord.MessageAttachment(buffer, "rip.png");
        m.delete({ timeout: 5000 });
        message.channel.send(attachment);
    }
}
#

this is the code

#

for rip command

sonic lodge
#

and the error?

#

wow the user declaration

bright dove
#

help.js is one of the files so idek

sonic lodge
#

what does your require code look like

bronze dagger
#

What should I do to get my bot approved on top.gg?

bright dove
#
for (const file of commandFiles) {
    const categories = require(`${file}`);
}```
weak rain
#
    at new ameClient (/rbd/pnpm-volume/ceb92d00-5f04-4c6c-869b-f20d93d93181/node_modules/.registry.npmjs.org/amethyste-api/1.1.4/node_modules/amethyste-api/src/main.js:16:27)
at Object.<anonymous> (/app/commands/moderation/rip.js:4:16)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
at /app/handlers/command.js:19:24
    at Array.forEach (<anonymous>)```
#

@sonic lodge

sonic lodge
#

make sure you're requiring from the commands directory

bright dove
#

OH

sonic lodge
#

require('./commands/' + fileName)

bright dove
#

I noticed it the seconnd you said that

#

thanks

weak rain
#

:/

bright dove
#

welp

#

now it said the same exact error except it changed "help.js" to "./commands/help.js"

sonic lodge
#

is it ./commands/ or ../commands/

bright dove
#

./commands/

#

should it be ..?

sonic lodge
#

didn't you say earlier it was ../commands/ or something like that

bright dove
#

yeah

sonic lodge
#

../ refers to the parent directory, ./ is the current directory

#

ig it should be ../commands/

bright dove
#

YES

#

IT WROWRKAF

#

thanks dude

sonic lodge
#

πŸ‘

weak rain
#

@sonic lodge Please help

#

:/

sonic lodge
#

the error means AME_API is undefined

#

are you sure that's the correct path to your config.json file

weak rain
#

wait

#

i have kept like this

bright dove
#

buuuuuttttttt not

#

Idk what I messed up

#

ugh

weak rain
#

my friend had this type

sonic lodge
#

uh is that your actual api token

bright dove
#

@sonic lodge any chance you could take a quick look at the whole code?

weak rain
#

idk

sonic lodge
#

show me

weak rain
#

i m just copying this

indigo folio
#

idk what that is but you shouldn't send it here most likely

bright dove
sonic lodge
#

const is block scoped, meaning it will only be available in the for of loop

cunning oxide
#

@weak rain delete tht

weak rain
#

done

bright dove
#

oh

sonic lodge
#

perhaps you could do

let categories;
for (const file of commandfiles) {
  // require here
}```
weak rain
#

Was that a token?

#

@cunning oxide

bright dove
#

I'll try it, thanks oop

cunning oxide
#

api key i think

weak rain
#

kk

sonic lodge
#

you better regen that soon

weak rain
#

kk

#

Can someone help me in Canvas Commands

bright dove
viral iris
#

any1 know canavs

sonic lodge
#

you're missing the assignment to categories

    require(`../commands/${file}`);
}```
mild flower
#

how do i make the footer of an embed display the AvatarURL of my avatar?

bright dove
slow fable
#

jimp or sharp

sonic lodge
#

i meant you need to assign the value to categories

let categories;
for (const file of commandFiles) {
    categories = require(`../commands/${file}`);
}

// down the line
categories.forEach();
bright dove
#

OH

#

I'm stupid

#

sorry

sonic lodge
#

😦

#

@mild flower what language?

bright dove
#

sigh

#

categories.forEach is not a function?

#

(sorry I'm very new to this and am probably jumping into things I shouldn't be for a while)

sonic lodge
#

maybe one of the files you're requiring isn't exporting an array, since arrays have the forEach() function

bright dove
#

let me check

sonic lodge
#

i just noticed that the current code causes categories to get replaced with each new file getting requried

bright dove
#

o

mild flower
#

@sonic lodge js

#

i wanna make it so it says "bot created by me " and my pfp in the footer

#

.setFooter(`Elite Bot created by Shadowblazer93`, message.author.displayAvatarURL())

#

but i cant figure out to display the pfp of a specific user

#

id

indigo folio
#

you can just put your avatar URL in instead of code

mild flower
#

hmm

sonic lodge
#

to get the user object from an id, client.users.resolve('id_here')

#

@bright dove what you probably want is

let categories = []; // an array of all your command categories
for (const file of commandFiles) {
    categories.push(require(`../commands/${file}`)); // require each file, pushing the data it exports into the categories array
}```
bright dove
#

also you need quotes around it shadow

indigo folio
#

only if its a string

#

?

restive pebble
indigo folio
#

hi boing

restive pebble
#

hi

bright dove
#

if you replace it with the url, it would be a string

mild flower
#

wut

sonic lodge
#

do you want to get the avatar url of a user from their id?

restive lily
#

can someone please help, i cant get this to work

        await channel.send(embed=embed)```
restive pebble
#

fetch it idot

indigo folio
#

either way works

restive pebble
indigo folio
#

whether you resolve or just paste in the image url

restive lily
#

i mean theres code above it but thats the part that doesnt work

mild flower
#

do you want to get the avatar url of a user from their id?
@sonic lodge i want it to show only MY avatar

restive pebble
#

fetch urself

#

kek

mild flower
#

.setFooter(`Elite Bot created by Shadowblazer93`, "https://images-ext-1.discordapp.net/external/bRWN5fB6sJqwpN9xMQwVYk5mnpZVJHz_9A3X8taN80o/https/cdn.discordapp.com/avatars/411548232133640203/2046bbd6807aac07513ce80020116148.webp")

#

this worked

restive pebble
#

ok

indigo folio
#

yes that is one way

mild flower
#

πŸ€“ πŸ‘

#

thank

restive pebble
#

GWjianWut if u change ur avatar

mild flower
#

ill update it

#

not like i have any life

indigo folio
#

lol ok

bright dove
#

omg ok I have no idea what I'm doing

#

TypeError: category.slice is not a function

#

??

#

what isn't

indigo folio
#

category

bright dove
#

oh

#

I can fix that

#

lol

#

wait

#

does putting [] around it not make it an array

indigo folio
#

what

bright dove
#

idek

#

I'm stupid

indigo folio
#

log typeof category

pale vessel
#

slice works for strings too so category must be an object or something

bright dove
#

y'all being same colour with same pfp really confused me lol

indigo folio
#

log typeof category

pale vessel
#

just log category

#

typeof could return object so we need to use Array.isArray() and stuff

indigo folio
#

its

#

not

#

an array

pale vessel
#

what

restive pebble
#

its an array GWjianWut

pale vessel
#

ok just console.log(category)

indigo folio
#

if it was array slice would be a function

pale vessel
#

well then we know it's an object

restive pebble
#

just to arr = []

pale vessel
#

why not console.log it

indigo folio
#

dow wqhatver

pale vessel
#

true

indigo folio
#

you make me angry

pale vessel
#

same

indigo folio
#

editing sauce.js

viral iris
#

any1 know ?canvas pure

pale vessel
#

nope

restive pebble
#

what u want to do

#

with canvas

indigo folio
#

lmao

viral iris
#

no lol

restive pebble
indigo folio
#

bruh

viral iris
bright dove
#

category is one of the things in the exports thingy... lemme get example

name: 'test',
description: 'test',
aliases: ['othertest'],
usage: 'test',
category: 'Test',
execute //and so on blah blah```
restive pebble
#

fortnite shop GWjianWut

pale vessel
#

poggers FORTNITE

viral iris
#

not shop

#

and whatever it's still canvas πŸ™‚

restive pebble
#

u are overwriting it

earnest phoenix
#

category is one of the things in the exports thingy... lemme get example

name: 'test',
description: 'test',
aliases: ['othertest'],
usage: 'test',
category: 'Test',
execute //and so on blah blah```

@bright dove you are the most awesome guy idk smh

bright dove
#

huh

restive pebble
#

so what u trying to do now

indigo folio
#

anastasius what are you trying to do with the category variable

#

jly πŸ‘€

restive pebble
#

getting the commands inside same category?

bright dove
#

blurred are yucky words 😳

restive pebble
#

arr.filter(x=>x.category === 'General')

bright dove
#

and that goes where? me still dumb...