#development
1 messages Β· Page 1101 of 1
bro it took you 10 minutes to get copied code to work
what do u need?
but how do I make it not send the other error message
use return
but then it wouldn't work for any command
that's... not how that works
no
and also...
bro it took you 10 minutes to get copied code to work
use return
I only want it to not send the error on the purge command though
because it has it's own error
if (ur check to see if its a guild) {
return <send-message>
}```
dont see why thats not going to work
oh
who knows how to make this backround thats not already a dev
what?
(I don't really know what return does I just use it anyway) does return keep it from doing anything else?
`
~
can u stop
bruh
` hug
the
log`
return stops the program from executing anything down the line
lol
@shivaco
are we allowed to ping a mod for this?
@OfficiallyLost#3429
um, yes
hi
this isnt related to development at all
ik
@bright dove give this a read: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return#:~:text=When a return statement is,where x is a number.&text=If the value is omitted%2C undefined is returned instead.
im bored
so why not stop before a mod gets in here
ok
returnstops 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
ill just code the commands
it explains how return works and when to use it
or you could just ignore all messages sent in dms
I started using db and the server prefixes are stored there but the prefix turned to default today. I hosted it yesterday
true
what database are you using?
could you do that?
some guy told me to use quick db cuz I was using json
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 πΉ
good luck
π
o lord
I am addicted to that emoji... if you see me use it again have someone ban me πΉ
So may I ask? I'm in team with someone and I coding bot with my friend will I get verify?
if you're on the application, yeah
If it follows the rules
-mute @indigo oriole
π€ Muted anyone#9641 (@indigo oriole)
ty
ly xig
@digital ibex I mean in team
Yes
then i believe you should get the badge (assuming you've sent your credentials)
Oh thanks for telling
the original post about bot verification says that everybody listed on the application gets the badge
the original post about bot verification says that everybody listed on the application gets the badge
@bright dove everyone APPROVED
?
yeah that
And up to 10 members
oof 11 devs developing one bot
no more badge
Yep
i say any team with more than 3 devs is doing it just for the badge
That was actually expected
The badge shouldn't be something everyone can get without effort
yeah but its like one capable person does it and invites 9 others to the team who pay them
what's bulma
flexbox framework
what's flexbox
a css framework
why not just use plain css 
idek what css is 
Flexbot might be rich
oh, wait... i just realised flexbox isnt a framework π€¦ββοΈ
make a bot with css π
its for styling on websites
Hmm
lmao
Nice xd
how is it easier? just easier to understand?
yeah
wait now I'm confused lol you said
make a bot with css π
and then you said
its for styling on websites
Im made a bot and it works!
oh lol
u cant make a bot with css
You can't lol
ok lol
lmao
but it is prety simple though
try learning it for like a month
and u'll get the hang of it ez
I think its weird I developed a bot and I have no role LOL.
is it listed?
only for approved bots
can i make my Eris code so its not else if for the next command?
use a command handler?
^
dynamic one
Yes
And i have a question
@bright dove It just got added
then wait
is it approved?
takes 3+ weeks
ha lmfao
How can you make so you can change it's prefix?
oh
change the global prefix?
To what?
or a different prefix for each server?
So people can change bots prefix for their server.
I hope it gets accepted I will be so happy.
you need a database for that
k
use mongodb
k
Discord server list is way better then disboard
k
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
Yeah
Anasta I think they're talking about @pliant gorge
@sudden geyser oh lol... totally knew that... me smart
^
oh where should I chat?
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
oop?
thats my take on it tho, i've never used quick.db only mongodb so cant really compare the two
object orientated programming
oh
What is a good way of getting members in your discord bot server? Cause I need people to know about my bot lol.
its also designed for large scaled apps
apart from jsonB tables, ive been loving it the past months ive used it
jsonB scarred me emotionally, a bit
loads of bots use mongodb
dyno uses mongodb
its not the best bot, but sometimes its fast, when its online lul
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?
you'll only get urself muted or banned or something eh
what
they dont really care about it tbh
How do i make visual studio code go in discord.js
i mean, ofc they've got to keep it up, but thats about it
what free db would y'all recommend for a beginner (if there are any)
the installation and the set up is a bit tricky
but other than that
everything else is simple
Ok tysm
ok
don't ask to ask, just ask
{
success: 1,
result: [
{
player_key: 4127669367,
}
]
}
ok
obj.result[0].player_key?
I can print this
result is an array
then replace obj with result.data
ok
ok
I'm going to try
do you understand accessing object properties?
Hi
get the index of the result first before accessing player_key
i need help
how can I take bot developer tag?
how do i make my code discord.js
elaborate
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
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]
yeah for example that, but you're forgetting the = in between
ya ya
but result could be more than one element, so you'll need to decide what to do with each element
what
Hi
<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
<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
how do i turn message.author into a member
oh
@idle mountain i tried both of them and none seem to work
Why the FontAwersome icons looks like this?
uh one more question: how do i set the nickname of a user
Can any1 help?
@viral iris Canvas?
can someone help me above please
uh one more question: how do i set the nickname of a user
FGGGGGGGhsdf
@viral iris Canvas?
@ember lodge yes
Use paint to get cordinates of a photo
Can u help. Me with that?
[]
Any1 know canvas can help?
but connected :P
Any1 know canvas can help?
@viral iris https://discordapp.com/channels/264445053596991498/272764566411149314/738593463813275658
@karmic compass message.member.setNickname
kk
@viral iris you using Canvas?
Might be able to -- you're processing all images as one?
Reason I ask is it might be easier to process them each individually
Yes yes 1 image
Yes
As far as I understand it.
You should be able to define a x,y
and write the text in that
Under x and y?
Yes
Why the icons of Bootstrap looks like this?
U have to have y and x
@ember lodge have you put everything in the <head> of your html file?
yes
are you making sure you have the correct order?
Sometimes making sure your icons <style> comes above your other stylesheets is a solution
do you have the actual font-awesome.css?
yes of course
is it right ?
var text = ctx.measureText(desc)
var where = 256 - (text.width / 2)
ctx.fillText(desc, where, 128);
fillText(text,x,y) - draws "filled" text on the canvas
@ember lodge
are you trying to use premium icons?
yeah thanks 
@cunning oxide can u come dm for sec?
@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
Does the discord API include the ability to have bots share video/stream/screen share?
@viral iris make sure you're loading all of them
@faint prism not to my knowledge -- discord supports streaming of audio though.
now how to flip it ?
ctx.fillStyle = 'rgba(18, 18, 18, 0.5)';
ctx.fillRect(x, y, 256, 128);
Nah. I specifically want video.
Thank you though
mhm
https://whatis.techtarget.com/definition/x-and-y-coordinates#:~:text=The x coordinate is a,the top of the screen. @viral iris
define x,y
i did
var x = i * 256
var y = (round(i, canvasWidht) / canvasWidht) * 256
x = y > 0 ? (i - round(i, canvasWidht)) * 256 : x
what?
So i used botghost and my bots were online yesterday now their offline today why?
@queen marsh prolly go and ask their support
can i give u the code?
ok
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
but i don't know canvas a lot
yeah but how will you learn if you get me to do it all for you?
so how to flip the half black thing ?
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.
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
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
any1 know canvas can help?
It worked for me and now both of my bots are back online.
Ik what your saying but if you want something good if you can't code go on steam and get dbm
Discord bot maker
link?
It on steam look it up
Like $10
nothing is freeβ’οΈ
I mean i use it but I also code because I've coded like botnets for people and stuff
nothing is freeβ’οΈ
True
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
I mean you can try to look up a free version but you'll just end up with a virus on your computer
yeah last time i got a virus and delt with it myself
that its not happening againβ’οΈβ’οΈβ’οΈ
Lol
Lmao
i was told by one of yall to try using botghost so shut it
I said it
@queen marsh LMAOOOO
@queen marsh lol
I mean everyone tried botghost atleast once
i will use it until i can find something better -_-
@queen marsh you know how to coding ?
How to code**
not much expirience
Stf
and why code a bot when it only has 7 commands
XD yt to code pffft
@low shard what language do you code in
Nice
are you trying to make fun of me :l
because i really dont care
"Bot Ghost"
everybody starts off not knowing how to do something
thats why you do/use what you can until you can find/learn something better
@queen marsh you have in yt how to make a bot
In guild object
any1 know canvas can help?
@queen marsh dm him @delicate shore
We use guild
XD
yes i think
Yeah
Any leave ?
Just try yourself
Else*
π
i did try using yt for help it didnt work, so i came here and was told to use botghost
guild.leave ?
I'm rolling bruh
why
@queen marsh my guy you should just try to code
i will
Coding not that hard
No
Im literally gonna take coding classes
@queen marsh so easy
Guild.leave is nothing
Is guild.invitr
Coding*
I mean when I can code a botnet im sure coding a bot not hard
im already enrolled in a coding class pfffftt
XDDD
@delicate shore yes

it takes time lol
guys do u know a way to update a channel with discord.js
@queen marsh yes

lets say a user join and i need to update it to current memebrs
i mean using the bot
Bruh im dying
and its not for that purpose but ill go with that example
How de hell sum yall get developer
@earnest phoenix me?
No
@earnest phoenix ctrl-c + ctrl-v 
any1 know axios package ?
you should just ask the question and see if someone who knows it responds
^^^^^^^^^
any1 know axios package ?
who know how to get api data from the package ?
await channel.send(embed=embed)```
i keep trying variations of this and i cant get it to work!
@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
already open source https://fortnite-api.com/v2/cosmetics/br/new
in an async function, await waits for the following promise to finish execution before continuing to the next line
Alguien espaΓ±ol?
Ah okay
@viral iris did u log res?
translating a interesting message...
Is res.data.data.items valid?

Yes.. I mean no lol
π
Try logging res
any1 have any idea ?
ctx.fillRect(x, y, 130, 256);
console.log(`${res}`)
^
ReferenceError: res is not defined
Where did u put that line
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
After var res and before var data right?
yes
so args[1] doesn't exist
[object Object]
res.data.data
[object Object]
why are you getting [object Object]
use util.inspect()
idk
Console should display all
[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]
Help me please .....
lol spam
@weak rain args[1] doesn't exist
Object object won't work now
https://fortnite-api.com/v2/cosmetics/br/new
ok
oh lol
[object Object]
please require the util module and run util.inspect(object) instead lol
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 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
after you define text, there's a return statement that sends the error message and stops executing the rest of the code
There can be error in that
There can be error in that
@jolly quail show code?
So what to do ? π @sonic lodge
Cuz so many objects r coming, i think ur data is fine
so implement a check to see if text exists; only if not, send the error message
u know canvas 2 ?
ik sm
is it right ?
Lemme see more wait
Name and desc are different for each item right
yes
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 are their any canvas templates code available on the internet?
Idk.. Never used canvas
let me check
Ask john
args[1] doesnβt exist, again
@viral iris hm
what did you want to do with canvas?
kk
Log args @weak rain
hm
const categories = require('../commands/');
is giving me
throw err;
^
Error: Cannot find module '../commands/'```
and I can't figure out why
@jolly quail same
Show the pic
what did you want to do with canvas?
@lusty quest t??
?
@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 well all i can do are Charts. never did more
@lusty quest but how
i want to combine only
Β―_(γ)_/Β―
Lol
i guess they have a image of the logo and attach it to the provided Image
1min
Bongo bot has those jail, pregnant commands
@lusty quest Yes
but how idk
@jolly quail u have?
Nah not me
same
guys can someone help? lol
https://discordapp.com/channels/264445053596991498/272764566411149314/738621398330769439
Is canvas good?
@jolly quail yes
@viral iris ig i can't solve ur problem maybe
But its tough :/
can i replace axios with request ?
@viral iris no wait
That name and desc u defined above
Just try moving em inside the forEach
var name=item.name and var desc=item.description
i have rip command but i cannot fix it in my project :/
That name and desc above is most probably wrong
it gives error
Hmm
Ur images are coming fine so axios request is successful @viral iris
No need to change that
../commands only then
it's looking for a file called commands.js
../commands only then
@jolly quail is that not the same thing
@jolly quail
Cannot read property 'items' of undefined
he said it's looking for a file called commands
yea i think no need
item is not defined
@viral iris define item then
kk
Item is defined there
hm
it's looking for a file called
commands.js
@sonic lodge how would I make it search through the foldercommands
./commands
is there a file in the folder you want to require
all of them
data is not defined
but cant fit in the editor
as its giving error
Line 11 and 12 @viral iris
data.forEach(async (item, i) => {
Var name and var desc one
use fs.readdirSync to get all the files in the commands directory
ik
Show code again xD
from there, you can loop through the resulting array to find javascript files and require each
18
It's not there
var data=res.data.data.items
@jolly quail
data.length
This thing
Add it after line 10
11
Why did u remove this?
u say that
now item is not defined
Damn I should just correct the code myself ig
ok thx
@weak rain what do you need help with
@sonic lodge i want to put my code in my repo but it shows error
and that error is
canvas code
quite the unique error
i forgot the error lol'
u know canvas @weak rain ?
https://hastebin.com/akizewiziv.js @viral iris
@viral iris my friend gave me code
Try this
how can i help if i don't know what the error is
wait lemme try again
Np
now need fix canvas ;-;
var data=res.data.data.items;
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 tried and now I'm getting this error: https://hastebin.com/dizetitaza.php
help.js is one of the files so idek
what does your require code look like
for (const file of commandFiles) {
const categories = require(`${file}`);
}```
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
make sure you're requiring from the commands directory
OH
require('./commands/' + fileName)
:/
welp
now it said the same exact error except it changed "help.js" to "./commands/help.js"
is it ./commands/ or ../commands/
didn't you say earlier it was ../commands/ or something like that
yeah
../ refers to the parent directory, ./ is the current directory
ig it should be ../commands/
π
the error means AME_API is undefined
are you sure that's the correct path to your config.json file
my friend had this type
uh is that your actual api token
@sonic lodge any chance you could take a quick look at the whole code?
idk
show me
i m just copying this
idk what that is but you shouldn't send it here most likely
@sonic lodge https://hastebin.com/ukonodegok.js
const is block scoped, meaning it will only be available in the for of loop
@weak rain delete tht
done
oh
perhaps you could do
let categories;
for (const file of commandfiles) {
// require here
}```
I'll try it, thanks oop
api key i think
kk
you better regen that soon
@sonic lodge new error: TypeError: Cannot read property 'forEach' of undefined
https://hastebin.com/ulesufoqim.js
any1 know canavs
you're missing the assignment to categories
require(`../commands/${file}`);
}```
how do i make the footer of an embed display the AvatarURL of my avatar?
I thought that's what https://discordapp.com/channels/264445053596991498/272764566411149314/738631052578390056 was for
jimp or sharp
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();
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)
maybe one of the files you're requiring isn't exporting an array, since arrays have the forEach() function
let me check
i just noticed that the current code causes categories to get replaced with each new file getting requried
o
@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
you can just put your avatar URL in instead of code
hmm
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
}```
also you need quotes around it shadow

hi boing
hi
if you replace it with the url, it would be a string
wut
do you want to get the avatar url of a user from their id?
can someone please help, i cant get this to work
await channel.send(embed=embed)```
fetch it idot
either way works

whether you resolve or just paste in the image url
i mean theres code above it but thats the part that doesnt work
do you want to get the avatar url of a user from their id?
@sonic lodge i want it to show only MY avatar
.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
ok
yes that is one way
if u change ur avatar
lol ok
omg ok I have no idea what I'm doing
TypeError: category.slice is not a function
??
what isn't
category
what
log typeof category
slice works for strings too so category must be an object or something
y'all being same colour with same pfp really confused me lol
log typeof category
just log category
typeof could return object so we need to use Array.isArray() and stuff
what
its an array 
ok just console.log(category)
if it was array slice would be a function
well then we know it's an object
just to arr = []
why not console.log it
dow wqhatver
true
you make me angry
same
editing sauce.js
any1 know ?canvas pure
nope
lmao
no lol

bruh
i mean fix this
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```
fortnite shop 
FORTNITE
u are overwriting it
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
huh
so what u trying to do now
getting the commands inside same category?
arr.filter(x=>x.category === 'General')
and that goes where? me still dumb...


