#development
1 messages ยท Page 1005 of 1
send ur code and error
Derku did you try it and did something go wrong
yes
got it ๐
it doesnt work i may need to remake the wole cmd as i dont get it
ik
Math.floor()
just glad it works
nice
thank you
Derku in the object you passed, there should be a data property which is an object of that role data
So like { data: { name: "Muted", ... } }
I have a set of status's that my bot uses, 3 status's that change every now and again, but how would I refresh that with a setTimeout function? Like every so often (say every 5 minutes) the status's reload with new data, so that way I don't have to bring my bot offline.
So?
but when they write .catch it catches the most recent pokemon spawned on the whole bot but i want it so it only catches the pokemon in the channel it was spawned in
probably something to do with this
W-what is this
did it create the role
@sudden geyser it created role but it didnt set perms and name
so it turns out it was just I can't use https
Are you using json?
when you use foreach to list the embed it is duplicated. How can I solve that?
@earnest phoenix That's because it doesn't take an object. It takes either a string, number, instance of Permissions or an array of itself (https://discord.js.org/#/docs/main/stable/typedef/RoleData).
confused
Try passing an empty array and see if any permissions are added to the role.
?
What are you confused about specifically?
all of it
Do you know how to pass a key/value object to a function? Do you know how to add a property ({ key: "something" })
Uh so, i try to deploy my discord bot to heroku but heroku just gives me this 'Build timed out while waiting to start.' anyone know what o can do?
Get a VPS?
Money?
ยฃ
Aw shit here we go again
Hey. It has been a while now since I have been looking for how to retrieve a user's e-mail address via oauth2, only I have the impression that the subject is poorly documented. Do you have any information or links that could help me? My DMs are open, I prefer to get an answer from DM elsewhere. Thanks in advance.
it isn't poorly documented at all
all you need is to authorize the user with the identify scope
and make a call to the @me endpoint
it'll return the user object with the email
Thx. :)
so when someone writes .spawn it spawns a pokemon
but when they write .catch it catches the most recent pokemon spawned on the whole bot but i want it so it only catches the pokemon in the channel it was spawned in
probably something to do with this
Pspspspsps
you should seriously stop using json as your database
@long yew make a map, set it with the guild ID and the pokemon
you should seriously stop using json as your database
This too
this is getting ridiculous, you want to store way too much data for a json database, which is a horrid choice in the first place
Who is french
To create a bot with me
@tribal belfry
cry, I'm really sorry to bother you again .., but I was wondering if npm libraries like express were available on the JS of websites?
what?
@earnest phoenix can u help me do it?
this is getting ridiculous, you want to store way too much data for a json database, which is a horrid choice in the first place
@earnest phoenix what do u recommend me doing?
wow my spawns channel
See here's the thing: If you're attempting to simultaneously read a file and write to it at the same time, or if you're writing to a file from more than one location, the file risks being corrupted. And the more this happens, the higher the chances. It might work for small bots, but as it grows you are going to lose that data.
jesus this mans DB is JSON
Do you need a DB server? I can give you one to use
If you're asking that question, then don't even try moving
Do it when you have time to learn something like MongoDB or SQL
an someone help me make Say/Announcement Commands
-atmods
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
sorry
You pinged 20+ Mods for that for something unnecessary. 
...
sorry
..
can someone help me make Say/Announcement Commands
ghost ping?
Ghosts dont exist
someone pinged mods but they edited the message
@fossil surge the guide you're using is outdated.
You could look at what's on screen and mirror it in your IDE/code editor, but I recommend you check the documentation for the Guild class for all the data you likely need.
yo anyone here got verified by them and know how long that takes?
Who's them. Discord Bot List? Discord?
discord bot list
2-3 weeks rn
how do i stop it from sending the main help screen when i ask for the other ones
case `help`:
var embed = new Discord.MessageEmbed()
.setColor(0xffa500)
.setAuthor('cheems Commands', 'https://i.imgur.com/u5Zb05O.png')
.setThumbnail('https://i.imgur.com/u5Zb05O.png')
.addFields(
{ name: 'Bot', value: '`-h commands`', inline: true },
{ name: 'Fun', value: '`-h fun`', inline: true },
{ name: 'Memes/GIFs', value: '`-h memes`', inline: true },
{ name: 'Admin', value: '`-h admin`', inline: true },
)
message.channel.send(embed);
if(args[1] === "fun"){
var embed = new Discord.MessageEmbed()
.setTitle("Fun Commands")
.addField("`coin, randomnumber, poll, 8ball, iq, clap, numberguess`", "Use - before each command")
.setColor(0xffa500)
message.author.send(embed);
message.channel.send("Fun commands have been sent");```
you only want to display the main one when args doesnt exist
otherwise you send the requested page
if(!args[1])
! means NOT, aka it inverts things
so you can use it to check if things are NOT true, aka dont exist
:o

ok
double !! is actually pretty common, its used to convert stuff to boolean lmao
Basically it inverts the bo-
got it ๐
oo
oo
oo
= yes in Filipino
i have been working on my bot all day
to distract me from the fact of how lonely i am
sure
*hug*
Yey
so my database stores 32 bit values(2.1billion)
I have a check to make sure it doesnt go over this.
i ran my code through codacy and i got this.
how do i perform this check properly?
Why the fuck do you think that you'll go over 2.1 billion values
server owners can spawn
Is JavaScript's BigInt useful?
Idk are they
thanks lite i think thats the right way to do it
(can't watch rn)
yes BigInts are useful
Smallint
all javascript numbers are represented by 64 bit floats
So bigint/2
the maximum safe value a js number can have is 9007199254740991
The fact that you remember that
BigInt gives you a way to have numbers with unlimited size/length
without losing precision
Oh shit that's cool
1+2 = +1
at that size, normal numbers start giving inaccurate results due to rounding, but bigints remain accurate
That's so useful :oooo
so what was the issues with 2.1b being a different value at runtime?
not sure honestly js isnt limited by 32 bits
probs codacy being dumb, because i tested it pretty hard, even one over it would throw the error properly
not sure if PMD is related to codacy, but this is what PMD says
that second line number is much bigger than yours and its still ok
So you trade precision somewhere for precision elsewhere then
well they are integers, not floats, their precision is limited to integer-esque values
but since they have no limit, you could devise your own system with them
for example multiply by 100000000000000 and reserve x digits to act as if they were decimals lol
Lmao
How does it have no cap?
Im curious as to how that'd work
It cant be good for performance
internally they are probably built with multiple integers in sections
you mean doing math larger than the number of bits you have?
its actually a really really intresting concept
you do the math stacked
i built a cpu, that had 8 bit bus width, but did 64 bit math on it
it took 3 days
before they were introduced, there were many libraries that did the same thing, they held numbers as strings, and math operations would be applied in sections
to do something simple
So I'm guessing performance takes quite a hit?
huge hit
on modern pc's tho, the number of bits is 64 bits, your working with obserdly massive numbers before it becomes an issue
128 bit systems when
Let's build a circuit that adds numbers! Binary addition is even easier than decimal addition since you don't have to know how to add numbers larger than 1.
Support me on Patreon: https://www.patreon.com/beneater
You can get all the components used in this video from any onl...
getting off topic, but you can kinda see how it stacks logically, its a great video
Ye
fetchUser
no js.d
But tbh it feels like an unnecessary API request
B a l l s
So i was using puppeteer to screenshot websites, i used it on heroku with a buildpack and worked fine... But when i moved from heroku to a vps... On this vps it doesn't work and keeps saying Failed to launch the browser process! how can i fix this?
My launch of puppeteer is
<puppeteer>.launch({ args: ["--no-sandbox"], defaultViewport: { width: 1440, height: 1080 } });```
looking around on github, there are a handful of reasons this could happen, i think looking at the closed issues on github will probably have the answer for you
Ok so I got my music bot to work but, its sending the message twice now
@atomic quarry for all?
make sure you are not running the bot twice

Interesting I just happened to check the log and...
DiscordAPIError: Missing Access
at RequestHandler.execute (/rbd/pnpm-volume/3b5f9c99-2ab5-49f0-a1fc-f120a96885d4/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:88:5) {
name: 'DiscordAPIError',
message: 'Missing Access',
method: 'delete',
path: '/channels/723324276630880348/messages/727322367688179713/reactions',
code: 50001,
httpStatus: 403
}
that means you sent a request for something you couldnt do
Hmm
intresting, since i generate balance every time i talk, and i dont reget it from the database every time(only update on add, not on checking)
two of my bot running at once breaks balance
even tho they run on the same db
which isnt really an issue, since balance is per guild.
how I get the changes to the role? https://pastebin.com/gZb1rPUc
I want like:
Removed permissions: ['administrator', 'ban_members']
Addeds Permissions: ['speak']
theres an event called
GUILD_ROLE_UPDATE
waow
is there a way to use command for a bot through the console?
afaik, no
@solemn latch how i can get the permissions addeds/removed is my question
anyone know good alternatives to glitch.com. im broke
you would have to get the diffrence between old role and new role perms
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-roleUpdate
how?
@wooden ember it is possible, but you would have to build it yourself, and define the channel manually every time
yeah I know it would be hard to do but I was thinking of making something similar to the say command in a mincraft server console
you could just do !say channelID message
so like general say: and what you whanna say and the bot will post it
how do i make an embed response from a bot on user input
@earnest phoenix if old role has a permission new role doesnt have, it was removed.
if new role has a permission old role doesnt have, it was added
but i want a array xd
role permissions come in an array
so
xor actually might be what you want
if your comfortable performing bitwise operations
tryna look up a way to get the console to accept an input and I think my brain just caught fire
I know but I whant to annonomusly ridicule people
your bot wont be approved if you do that
I not making it public
I but as you say ill probably just not do it at all
its 2:30 in the morning I started js two days ago why am I doing this to my self
how i do like:
<bitfield_permissions>.toArray()?
how can i add reaction on embed
same as any other message
pretty sure you can just declare the bits a new discord.permissions()
@earnest phoenix
Hi just wondering how do i make it send it to a specific user e.g. <dm @weary ridge
anyone know how to get a users profile picture
discord.js
i have looked everywhere all the things i have tried havent worked
user.avatarURL()
is it possible to .setImage on a rich Embed with an image generated from Canvas?
yes
can you point me to where I can read up on it, or example code? I'm having a hard time figuring it out
I can get this to work:
const attachment = new Discord.Attachment(canvas.toBuffer(), 'Test.png');
message.channel.send(attachment)
But this generates an error message:
let rich=new Discord.RichEmbed()
rich.setImage(attachment)
return message.channel.send(rich)
you can't use Discord.Attachment in embed
hm, I tried using rich.setImage(canvas.toBuffer()) as well, but no dice
I think there's something I'm not understanding
hm, .attachFiles has it sending outside the rich embed itself. Thanks for the link, I'll try to poke around some more
sweet
try this
let buffer = canvas.toBuffer('image/png');
message.channel.send({files: [buffer]})
Also shouldn't RichEmbed() be MessageEmbed()
depends on the djs version
Quero that sends the image as it's own message, but I'm trying to get it as the .setImage value in a RichEmbed
and I will look into MessageEmbed(), thank you
beep boop error
those errors seem self explanitory
I just cant find the index.js error
beep boop error
@spare mirage take the note off thats why
take this off
// logs in
๐
that's just a comment
I already fixed that
oh
i believe your issue is scope
that's just a comment
@clever rampart some times it does that for me i just take the not off and it works
it is rlly weird
but yeah
ok
@spare mirage you literally tried to re-define an argument to the function inside of it
you can't declare a variable that has the same name as a parameter inside a function
oh lmao i see
So
channel.send({
embed: {
image: {
url: "attachment://image.png"
}
},
attachments: [
{
name: "image.png",
file: <Canvas>.toBuffer()
}
]
});
and, omg that indentation
i also dont see why your requiring so many things in your execute
Mobile
function image(message, parts) {
/* extract search query from message */
var search = parts.slice(1).join(" "); // Slices of the command part of the array ["!image", "cute", "dog"] ---> ["cute", "dog"] ---> "cute dog"
var options = {
url: "http://results.dogpile.com/serp?qc=images&q=" + search,
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};
request(options, function(error, response, responseBody) {
if (error) {
// handle error
return;
}
/* Extract image URLs from responseBody using cheerio */
$ = cheerio.load(responseBody); // load responseBody into cheerio (jQuery)
// In this search engine they use ".image a.link" as their css selector for image links
var links = $(".image a.link");
// We want to fetch the URLs not the DOM nodes, we do this with jQuery's .attr() function
// this line might be hard to understand but it goes thru all the links (DOM) and stores each url in an array called urls
var urls = new Array(links.length).fill(0).map((v, i) => links.eq(i).attr("href"));
console.log(urls);
if (!urls.length) {
// Handle no results
return;
}
// Send result
message.channel.send( urls[0] );
});
}
because this is in my index.js file :/
also those params
most of these you already have acess to
wtf is require lmao
npm i --save require and you will seee
lemme guess, content is message.content
you can make this image function a module
so that anything that needs these can just be requested in the command itself
how?
hiya, doing custom guild prefixes and it registers there is a custom prefix, but does not actually respond to it. Any ideas? ```ts
let db = await guildModel.findOne({guildID: msg.guildID})
let prefix = db.prefix
if (!prefix) {
prefix = config.prefix
}
if(msg.content.toLowerCase().startsWith(prefix)){
const args = msg.content.split(" ").slice(3);
const cmdLabelar = msg.content.split(" ").slice(2, 3);
const label = cmdLabelar[0].trim().toLowerCase();
return ["normal", label, args];
}
lemme guess, content is message.content
@copper cradle why do u have to be so mean tbh
nah just roasting me because im new to coding
@spare mirage you actually try, a lot of people who ask for help here, dont try at all
What does prefix log?
$$
Alexis, using what you sent, I only generated an empty embed. I'm really not sure what url I would be using in "embed.image.url", since I'm generating an image from Canvas
which is the custom prefix i set
The name of the buffer
is it because the way your slicing?
possibly, but it worked fine before i added the prefix getting from the db
at a fixed length, when your prefix can be different lengths
@solemn latch do I use module.exports
for image?
You export the function
^
at a fixed length, when your prefix can be different lengths
@solemn latch dont think so considering the default prefix is way longer
well, if they are diffrent lengths, you need to account for that.
const args = message.content.slice(serverSettings.prefix.length).split(/ +/);
const commandName = args.shift().toLowerCase();
I'm slicing after the length of the prefix
I am actually confused
You export the function
do I export the function from index.js to image.js or the otherway around?
ah
and you require it in files that need it
You can even add more functions as well
its 1am, i gotta get food, brb
name: 'image',
description: "this is an image command!",
execute(require, cheerio, message, args){```
do I require it here?
you can require at the top
that woould work?
@ember atlas prefix is $$ but you are slicing 3 
ahh
but not discord
yeah, just prefix.length
try prefix.length instead of 3
ok brb
this was something my friend clearly did and i didnt realize
this was something my friend clearly did and i didnt realize
@ember atlas I dont believe u
@summer torrent still nothing
@spare mirage i didnt ask for you to believe me, but ok 
this is a shared bot that me and my 4 friends coded one night where we each took a section of the bot and coded it
Are you slicing after splitting
yes
slice first, split after
Good spot, I wouldnt have seen that in 2 weeks
To get the arguments you need to slice the length of the prefix and then split
@solemn latch so I do
weird api stuff```
almost.
module.exports = {
function righthere() {
}
}
you need the second set of brackets
around the function
I'd use an arrow function
so it is
module.exports = {
function image(message, parts) {
weird api stuff
}
}```
im used to doing module.exports at the end anyway tbh
Unless you need to access this or use the call method 
module.exports = { con, render };
That's what I do
its not something you really need to do
is con a function u made earlier?
you can declare the functions you have, and export at the end
const myfun = () => {}
module.exports = { myfunc }
it just looks nicer imo, i dont think theres really a purpose
so it would be
function image(balblalbla)
blablbalba
module.exports = { image }
var search = parts.slice(1).join(" "); // Slices of the command part of the array ["!image", "cute", "dog"] ---> ["cute", "dog"] ---> "cute dog"
var options = {
url: "http://results.dogpile.com/serp?qc=images&q=" + search,
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};
request(options, function(error, response, responseBody) {
if (error) {
return;
}
$ = cheerio.load(responseBody); // load responseBody into cheerio (jQuery)
var links = $(".image a.link");
jQuery's .attr() function
(DOM) and stores each url in an array called urls
var urls = new Array(links.length).fill(0).map((v, i) => links.eq(i).attr("href"));
console.log(urls);
if (!urls.length) {
return;
}
// Send result
message.channel.send( urls[0] );
});
} ```
this is everything I use for the image search api, how do I put this in image.js?
you can just copy paste it into image.js
and add the exports line at the bottom

did i just get pooped
no
?
ima scroll back
Then you don't really need to export it. Just declare the function and use it within the file
ok
for the vast majority of cases the only thing your command handler needs to send to your command is the message, and the args.
require, content, Discord, parts, cherrio really dont need to be sent
thanks @solemn latch and @strange trout for all the help :D

Yo doesn anyone know how to make a command to grab random images by tag from imgur?
in discord.py rewrite?
I was gonna say yes
drn
Yeah that's why I asked. It's something I've been trying to figure out for a while now, but your the first person I've seen make one. Sadly yours was in js instead of python so figured id see if anyone knew how to do it in the code im using xD
no mine is using a google search api
ooff.. yeah that's wher emy issue is. I'm trying to find a simpler way to do it since I don't have any skill with using APIs for free. Not a lot of them can be used free from what I've seen.
And living of SSI makes the payed ones virtually impossible for me xD
I Dont think u can do it without an api
aaahh.. okee. Will have to look into seeing if it is possible to get good image apis free then.
is there a video tutorial/playlist for https://discordjs.guide/#before-you-begin
Not anything official no. That I know of at least
Guide and Docs are great on their own though 
im too dumb to understand code written , i like it automaticly writing in my pase and explaining it
like a video tutorial
Most videos are outdated
The guide does a great job at explaining everything
Coding = a lot of reading/research
ok ty
@hazy sparrow dont use videos you wont learn unnderstanding it
actually nvm
this youtuber lyoncode is kinda good at letting u understand
Hello, I can not seem to figure out the following:
message.author.send("RichEmbed")
Send a message before the bot Dms the user.
"I have sent you a DM With an invite link"
const { Command } = require('discord.js-commando');
module.exports = class WhoMadeMeCommand extends Command {
constructor(client) {
super(client, {
name: 'invite',
aliases: ['inv', 'botinvite'],
memberName: 'creator',
group: 'other',
description: "Sends a Invite link to the bot."
});
}
run(message) {
message.author.send(
"[Click here to invite me to you're server.](https://discord.com/api/oauth2/authorize?client_id=724079715811328043&permissions=8&scope=bot)"
);
}
};```
Also
The Click here
Dos not work on that for some reason.
because it is for embeds
My bot seems down not 24/7
where do you host it
My own server
I also has another question....
Do I need put command on server.js or readme.md
So is there able to edit command from server.js
someone here got an idea how to remove a key with value from a Json? (json is a MongoDB return and i want to remove the _id field for displaying the content in a message)
tryed remove jsonfile.key but it doesnt do anything
wait what exactly are you trying to do?
remove one field from the json
from a json file or just a javascript object?
Current settings: {
_id: 5ef9e60abfc9f06ad7aga4,
prefix: '*',
glyph: 'none',
lfg_channel: '0',
wf_channel: '0',
playercounter_channel: '0',
module_playercounter: true,
module_baro: true,
module_arbi: true,
module_baguette: true,
module_bird: true,
module_cat: true,
module_cattext: true,
module_chuck: true,
module_credits: true,
module_dadjoke: true,
module_darvo: true,
module_discord: true,
module_dispo: true,
module_dog: true,
module_donate: true,
module_ehp: true,
module_glyph: false,
module_hug: true,
module_leaderboard: true,
module_lfg: true,
module_meme: true,
module_owo: true,
module_pat: true,
module_price: true,
module_rfact: true,
module_riven: true,
module_sabatonmeme: true,
module_sentient: true,
module_urban: true,
urban_nsfw: true,
module_userinfo: true,
module_wfmeme: true,
module_whereis: true,
module_wiki: true,
module_wink: true,
guildID: '0',
__v: 0
}
``` i want to remove the _id field, guildID and __v
so that's a JS object?
tryed to convert the return to json with JSON.parse(JSON.stringify(jsonfile)); and then use remove.jsonfile._id on it
yes its an js object
but like... do you want to remove the key from the JSON file or just from the JS objet
just from the object would be enought want to display it in a command
doesnt want that everyone can see the ids or the Guildid
delete object.key
doesnt work
Should work
delete settings._id;
``` object is called settings (return from MongoDB)
delete settings._id;
console.log(settings);
``` still contains the id
so i was looking at the oauth docs because i found the prompt=none thing (love that btw)
and found this https://discord.com/developers/docs/topics/oauth2#state-and-security
I was thinking of implementing it but i wanna make sure i get it right
i could be getting the logic completely wrong so just lmk. the first thing i thought abt was creating a state when requesting /api/auth which redirects to the authorize page. so creating a token there sending it along and then checking it when it receives the /api/auth/callback?
something feels not right about this and i've a feeling its more complicated so do let me know
wait
๐ข
Only explanation that makes sense is that the object is actually a Proxy which blocks you from using the delete operator, try
settings._id = undefined
and code the bot to not spam the API
and code the bot to not spam the API
@lusty quest how?
Only explanation that makes sense is that the object is actually a Proxy which blocks you from using the delete operator, try
settings._id = undefined
@cinder patio where ?
add a query for new Songs
i am not getting it
That was for Superbrain
Rate limiting, it's so that the api isn't slowed down by clients
oh
but how to do whhat @lusty quest is saying
and @cinder patio where to add it?
That was not directed at you but at Superbrain
@cinder patio thx this worked
add a query for new Songs
@lusty quest ๐ฆ pls help
@delicate shore you can either use a database or a map to store the songs
@delicate shore you can either use a database or a map to store the songs
@finite bough in glitch how can we?
Is msg.channel.send for deleting comment
let this.queue = new map()
Is msg.channel.send for deleting comment
@dusk sphinx no
it justs send the message
msg.delete();
What about channel
I mean about different command
oh
Is [...] and <...> for command
no no
yes
where should i place this
u can look is mdn
[] is for arrays
MDN?
this creates a map
ok
and u can acess or write it
but only this code?
<> are generally used for greater than and less than signs
u must put it in ur main module
help me
mian module of musi cplay command
problem
or queue
queue?
like in my bot i defined it in index.js
how can i make reaction menu
m.react(emoji)
its shouldsend embed when reaction.
message.channel.send(embed).then(m=>m.react(emoji))
like in my bot i defined it in index.js
@restive pebble me too but in what line should i place it?
u want to make page systems?
@restive pebble
dont use this.qรนeue
let queue=new map()
if i react its send help in dm or here or cancl
@shut wolf
ok
help me
create a reaction collector
@restive pebble
and how to create
queue is already defined
ok
@restive pebble but it's not solving problem
of rate limited
d
should i change api? @restive pebble
hey everyone, im new to making discord bots, and need to know somewhere i should upload my bot to always have it running, for a low price, thanks!
and how to create
@shut wolf message.channel.send(embed).then(m=>m.react(emoji).then(r=>r.awaitReactions()))
try like it
hey everyone, im new to making discord bots, and need to know somewhere i should upload my bot to always have it running, for a low price, thanks!
@candid hinge aws
u have to pay only for the databas u use
or services
@candid hinge contabo 4$/month
Ok
red alert
can you read the error
300 words
yes add 300 words
@restive pebble
how u defined client
@restive pebble that is what i dunno
change it to bot cos that is what youre using
const client = new Discord.Client()
my bot 30m later ago offline why this problem@restive pebble
first
u dont have 300 characters
2nd ur short description exceeds word limit
3rd ur owners are not separated by commas
or
if(command === "stats") {
var mcount = client.users.size
var scount = client.guilds.size
var tcount = client.channels.filter(c => c.type === 'text').size
var vcount = client.channels.filter(c => c.type === 'voice').size
msg.reply(`${client.user.username} is on ${scount} servers with ${mcount} members, chatting on ${tcount} text channels, with ${vcount} voice channels!`)
console.log();
}```
what is wrong here
๐ฆ
change to bot not client
send ur full code
send ur full code
@restive pebble this is full
@restive pebble
@restive pebble my bot offline before 30m why
why do you require discord.js 2 times
why do you require discord.js 2 times
@tepid canyon wot
new Client()
@restive pebble my bot offline before 30m why
@earnest phoenix ur vps is down i guess
new Client()
@restive pebble what
ur code is correct
ok
yes change client to bot
@restive pebble i am host from glitch.com
ok
@restive pebble solution
nice
???
glitch premium
either u buy glitch premium
is solution
or visit ur bot site evry 5 mins
pinging services are banned
more??
no

imagine using client instead of bot
hmmm
bot.channel.cache.filter
are you using discordjs v12?
if(command === "stats") {
var mcount = bot.users.size
var scount = bot.guilds.size
var tcount = bot.channels.filter(c => c.type === 'text').size
var vcount = bot.channels.filter(c => c.type === 'voice').size
msg.reply(`${bot.user.username} is on ${scount} servers with ${mcount} members, chatting on ${tcount} text channels, with ${vcount} voice channels!`)
console.log();
}```
are you using discordjs v12?
@tepid canyon ys
then use what he said xd
wottttttttttttttt
what are u tryig to make?
bot.channel.cache.filter
stats command
@delicate shore cache.size
channels.cache.filter
cache.filter
How to host yourself@restive pebble
node index.js
I dont know what command does

I always use if (message.content.startsWith(PREFIX + " command"))

use construtors
How to host yourself@restive pebble
@earnest phoenix reply bro
node index.js
node index.js
@restive pebble what
dude just use process manager
bruh @earnest phoenix
k
bruh @earnest phoenix
@spare mirage yuss
hosting urself is easy...
@restive pebble what about users
lol
bot.users.cache.size
like just host on ur pc
@spare mirage i mean 24/7 ๐
moni
happy yt
sorry guys i am not good at coding lol
If you really want free 24/7 hosting your main option left is heroku
lol
atleast better than glitch
just add a card
def allowed(ctx):
return ctx.author.id ==561049763286614017
I done this to make a secret command in my bot but by this all command become only for me i only want 1 command hide
5 mins lol
๐ฅณ


i dont help witb python
what did u change @delicate shore
Sad
i mean cant
@spare mirage i mean 24/7 ๐
@earnest phoenix that costs money
new Discord.RichEmbed()
whats the difference?
const EMBEDNAME = new Discord.RichEmbed()
if (command === "help" || command == "cmd") {
const helpembed = new Discord.MessageEmbed()
.setColor("#7289DA")
.setAuthor(bot.user.tag, bot.user.displayAvatarURL())
.setDescription(
`
__**Commands List (Prefix s!)**__
> \`play\` > **\`play [title/url]\`**
> \`search\` > **\`search [title]\`**
> \`skip\`, \`stop\`, \`pause\`, \`resume\` ,\`ping\`
> \`nowplaying\`, \`queue\`, \`volume\`,\`info\``
)
.addField(
"**Fun Commands**",
`> \`tf(question)\` , \`insult\` , \`beg\` ,\`slap\``
)
.addField("Moderation",`> \`ban\` , \`kick\``)
.addField("Support Server", "link")
.setFooter("Made By PGamerX#7350");
msg.channel.send(helpembed);```
@earnest phoenix check pinned messages
v12 is MessageEmbed()
oh
can i change it to rich embed
i dont have much iQ
yes you can
plus
no you cannot
inline?
.addField(somedata,somedata,true)
you can also just put everything in 1 field
we cannot add more than 3 .addField in thta
@delicate shore field limit is 25
@delicate shore your pupps is so cute
thanks





guys can you stop this
what error does it tell you if you put more than 3 fields lol
ok @summer torrent
Thc
it works

lol
all solved

there is no command called "stats"
lemme try again
What's this hybrid of a command handler?
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
bot.commands.set(command.name, command);
}
tasty
what is the name of stats command
that's why
uh
in your ss it looks like stats to me
my stats file was named stays
@spare mirage rip typos

check for "help" too
@restive pebble you dont have verified bot dev. why 
then remove that

imagine not using auto-save
did you changed name of stats
show stats command

yes
You can use 10,000 units per day.
You can use 10,000 units per day.
@restive pebble so tom it will be fine?
@spare mirage you're executing bot, message, args
what is head
yes i know
@summer torrent what is HEAD
wdym
wdym
@summer torrent what
what do you mean
htt[ sequil
it would be nice to have like require: everything
@spare mirage yes install all npm packages

and run out of storage
xD
joice
still would be nice
i wanted to send message to a user using his user id


js
go to the top

and then settings
@restive pebble what is temporary solution to rate limited in YouTube Api
@restive pebble what is temporary solution to rate limited in YouTube Api
@delicate shore use ytsearch
How ?

why do people use these sites to code on?
free
! ERROR: Application not supported by 'heroku/nodejs' buildpack
!
! The 'heroku/nodejs' buildpack is set on this application, but was
! unable to detect a Node.js codebase.
!
! A Node.js app on Heroku requires a 'package.json' at the root of
! the directory structure.
!
! If you are trying to deploy a Node.js application, ensure that this
! file is present at the top level directory. This directory has the
! following files:
!
! botconfig.json
! commands/
! index.js
! LICENSE
! README.md
!
! If you are trying to deploy an application written in another
! language, you need to change the list of buildpacks set on your
! Heroku app using the 'heroku buildpacks' command.
!
! For more information, refer to the following documentation:
! https://devcenter.heroku.com/articles/buildpacks
! https://devcenter.heroku.com/articles/nodejs-support#activation
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed
i am saying
@restive pebble
go to settings
and
bit ?
yes scroll to buildpacks
then remove any existing buildbacks
then click on add buildpacks
how would i make my sticky message command work?
code:
(inside the .on message, as a prefixed command:)
let messageStc = args.slice(1).join(' ')
let sticc = await msg.channel.send(messageStc)
StickyMessages.set(`Stick.${msg.channel.id}`, `${sticc.id}`)
(inside the .on, every time there's a message)
if (StickyMessages.get(`Stick`) === msg.channel.id) {
let stAcc = await msg.channel.messages.fetch(StickyMessages.get(`Stick.${msg.channel.id}`))
msg.channel.send(stAcc)
}
then node js
@restive pebble but how to configure it
What is code etc
It's completely different
:(
boeing do you know how to help me?




