#development
1 messages · Page 1013 of 1

Jaja niiiice
@low phoenix what is Command
ya
OmG CusToM NamE Is In ThiS SerVer
class needs constructor
message.member.hasPermission(["")] should work @low phoenix
It doesn't make sense at least
lol
@still merlin comes the same error.
neither to a human nor to a machine
mhm
this keeps on loading
and never comes
no
my net is 100 mb/s
there is a problem
Down or up
its not code related then
🤔
its the site u using
Is the cdn up?
umm can someone help me?
i get this error Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "memes" is not found
its the site u using
@restive pebble tenor
sorry
even tho theres clearly a command
if(command === "gif"){
if(!args[1])
return msg.reply("**Kindly tell a keyword along with**")
let gifo = args.slice(1).join(" ");
fetch(`https://api.tenor.com/v1/random?key=APIKEY&q=${gifo}&limit=1`)
.then(res => res.json())
.then(json => {
let embed6 = new Discord.MessageEmbed()
.setTitle("Here is a gif of $args[1]")
.setImage(json.results[0].url)
.setFooter(`s!patreon | s!help`)
msg.channel.send(embed6)
});```
this is the code
wait
oh
you python?
who me?
i suggest u to console.log that
he uses js
what’s going on here
can u help me?
i am node js guy
@restive pebble
i suggest u to console.log that
@restive pebble @delicate shore
¯_(ツ)_/¯
its possible
let color = member.roles.highest.hexColor
if (color === '#000000') {
'#232829'
}
``` this dont wokr
You can
I’ve never tried embeding gifs
if its loading then its not visible to u
let color = member.roles.highest.hexColor
if (color === '#000000') {
'#232829'
}
``` this dont wokr
@earnest phoenix
what are you trying to do
replace the defualt to that color
if(color.includes(hex))color.replace(hex,newhex)
@restive pebble logs empty
why do you just have “#232829” in the middle of no where
ok
it shows nothing
if(color.includes(hex))color.replace(hex,newhex)
@restive pebble this is extra work lol
ohjhoohoh
?
@delicate shore is your APIKEY the actual api key
k
???????
( ͡👁 ͜ʖ ͡👁)
derku d.js v12 right
of what = means?
@restive pebble he knows what = means
:(
u are not assigning
?
let color = member.roles.highest.hexColor
if(color.includes("#000000"))color.replace("#000000", "#232829")
``` code
Oh
of my backround thing for uhh my profile mcd
replace doesn't modify the original string
then color = “background color hex”
you have to reassign it
and easy
stop spoon feed
shamelessness
it was black
oh well
it worked
compare changes
it doies that random
github has compare changes
no it doesn't
no it did it before
Deku has large eyes
i did that thing
you did something wrong
flazepes more big
last time you used ' instead of `
no it fixed
@earnest phoenix your sending the file and not attaching to embed?
dude ur image is so blurry
?
The profile img
ok
?
for his bot
@empty owl whos bot
not urs
oh i need help with making mine
don’t ask just ask
the code thing
don’t ask to ask just ask*
what

can anyone help me
with one thing
if(command === "gif"){
if(!args[1])
return msg.reply("**Kindly tell a keyword along with**")
let bruhgg = msg.author
let gifo = args.slice(1).join(" ");
fetch(`https://api.tenor.com/v1/random?key=EH35O4HY8VDJ&q=${gifo}&limit=1`)
.then(res => res.json())
.then(json => msg.channel.send(json.results[0].url)
.then(msg.channel.send("**This Gif Was Requested by : &msg.author**"))
)
.catch(e => {
msg.reply('Failed to find a gif that matched your query');
console.error(e);
return;
});```
so bruhgg
it is not mentioning or even writing name
Your using "" and its ${} not &{}
ok
whats the bot client id
Your using "" and its ${} not &{}
@solemn latch ' this should come?
`
whats the bot client id someone help
`
whats the bot client id someone help
@azure moth its the id of bot
@restive pebble how do i get the id
and whats the invite url
oh
client.user.id
@restive pebble is that it
yeah how
webscrap
or something
ok
@azure moth everything you need is in your discord developers page
webscrap
@restive pebble that the url
webscrape should be the last resort
but liek any example or tuorial
oh
wheres that
k
@restive pebble can you help me with giphy
idk
how do you not know, lol creating an application in the discord developers website is the first step towards creating a bot
you cannot add a bot anywhere if it doesnt exist
and use api
@restive pebble like what is link?
i mean
wtf am i saying
like
in tenor we do www.tenor.com/api+ebfibw
like that
Just Google it
just see guides on how to create bots @azure moth
what is the link
google lol
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
whats a secret kkey
@delicate shore Dont ask everything here ;/
1st u ask the docs
after that u ask google
after that u ask us :P
^
youtube is final option becuz it sucks
@azure moth secret keys and its usage can be found at discord developers site
can someone join my test server to test my kick command?
@delicate shore Dont ask everything here ;/
1st u ask the docs
after that u ask google
after that u ask us :P
@spare mirage
ok so i first asked here when everyone said no so i asked is there any docs related to it everyone sais no
then I tried myself didn't worked
so i asked here and everyone said to google
so
.
you dont need to use a secret key anywhere
just for the future
whats a secret kkey
@azure moth don't tell me you use Discord Bot Maker
does dbm need your secret key?
does dbm need your secret key?
@quartz kindle nonono
good lol
only token kek
8ball
hentai
^

at least it's allowed
no
ok
i am 14.5
who wants to help me
me
ok
who wants to help me
@azure moth ques ?
idiots guide
You've yet to ask a question
with my bot
an idiots guide
const Discord = require('discord.js')
module.exports = {
name: 'kick',
description: "this is a kick command!",
execute(Discord, bot, message, args){
if (message.member.hasPermission("KICK_MEMBERS")) {
if (message.mentions.members.first()) {
try {
message.mentions.members.first().kick().then(message.channel.send("I just Kicked his ass" ));
} catch {
message.reply("I do not have permissions to kick " + message.mentions.members.first());
}
}else {
message.reply("You do not have permissions to kick " + message.mentions.members.first());
}
}}}
why is my catch and my else not working
Isn't it finally, not else
@delicate shore i sent you invite to test it if you want to test it
Oh its else for the if
@spare mirage try/catch doesnt work on promises if you dont await them
@restive pebble wanna test my bot
uhhh
so.. what do I do @quartz kindle
oh ok
You can also .catch
whos alts
Your alt
@spare mirage ```js
// this works
try {
await bla()
} catch(err) {
await bla2()
}
// this doesnt work
try {
bla()
} catch(err) {
bla2()
}
// this works
bla().then(whatever => {
// do something
}).catch(err => {
bla2()
})
i dont know what that is
I have to require async right/
uhh
ie execute: async function(bla,bla,bla) => {
not sure if async execute(bla,bla,bla) { works inside objects
you can also try that
That doesn't load for me
That does
@azure moth can you explain to me exactly what did you do so far? which steps did you take to create your bot, which guide did you read if any?
otherwise i have no idea what you need help with, how much experience/knowledge you have, and what's the next step you should take
@quartz kindle :/
all ive done is the name bc i dont know what to do
and im as dumb as a brain dead dog
@spare mirage why did you remove the rest lol
?
you broke all your ifs
@azure moth creating a discord bot is not a simple thing, it requires logical thinking and problem solving skills
this was my first code
and preferably knowledge of programming concepts and a programming language
I gtg now though
wait a second
i used to be really good but then i was kicked out of school in year 4 for telling my headteacher to get the f off me before i get him in a headlock
im dumb
school has nothing to do with it, its simply your ability to think things through
i go to a specie needs school now and im 13
the reason my mongodb was spitting errors out was because my ip wasn't whitelisted
aaaaaaaaaaaaa
and i cant think about stuff because i get distracted
do you have a discord server? if not you should create one, so you can test your bot in
definently, do make one
i have 4
then head over to the discord.com delevopers website, and click on your application. on the left side menu, you will see some options, click on OAuth2
MAKING IT CHANGE IP
in the OAuth2 page, you can create your bot's invite link
so you can invite it to your server
There was a really good getting started website
you mean https://discordjs.guide ?
^ this one
Language independent
those are copied from anidiotsguide lol another site maybe
can i just
host my own mongodb
Yeah
i need another serverboi
You can put multiple things on one VPS
imagine making a mongodb bot
imagine your bot sends a message with a mongodb query, mongodbbot responds, and your bot reads the response message
lmfao
you can host mutiple MongoDB instances on the same machine.
how much cpu will that use tho
Lmao tim
i have a digitalocean 5$ droplet and with 1 mongoDB server running on it next to nothing
http://node0.s8s.app/FueI this is the current load
heroku wants you to use their own postgre api
how much ram is mongodb using there?
actually, if one prefix entry takes up, lets say 70 bytes
I'm working on getting bot statistics on prometheus, kinda fun to work with.
300mb is used
how much could i store in my 512 free thing
the rest is cached
for the mongodb server alone?
the entire VPS (only docker and 1 MongoDB container)
so mongodb by itself would use like 200mb i guess, excluding all containers and overhead
its nothing. also i have 3 VPS with each running 1 MongoDB Container. All containers Run into 1 Replica set
ez
how
wait
don't tell
pls don't
lemme try myself first
i wanna learn myself
Can my bot use nitro emji's?
emoji's*
no
It’s the solution
😦
But don’t
you did it to me
lol that's included in dank memer's source code already
but you need to change some stuff @delicate shore
Wait DM is open source?
uh
hello
||
message.channel.send(args.join(" ").split("").join(":clap:"));||
@craggy token ok now help me
yeah
Yep
lol
if(!args[1])
return msg.reply("What should i clap")
this ^^^^^^^^^^^^^^
No if you want the clap to split the letters like DM does
yeah
not here sir
^
Does anyone know how I can get my bot to respond to @mentions . For example
Me: @bot#0008
Bot: responds with whatever I set it to.
if(command === "clap"){
if(!args[1])
return msg.reply("What should i clap")
message.channel.send(args.join(" ").split("").join(":clap:"));
}```
is this correct
slap on every single character? why lol
he wants to do what DM did
Does anyone know how I can get my bot to respond to @mentions . For example
Me: @bot#0008
Bot: responds with whatever I set it to.
@white drum regular expression
dank memer
@white drum regular expression
@golden condor
Wdym?
Aparently its what people consider funny these days
slap on every single character? why lol
@quartz kindle not character i need word
l 👏 i 👏 k 👏 e 👏 t 👏 h 👏 i 👏 s
args.join("\👏")
args.join(":clap:")
Split by space, join with clap
args.join("👏")```
thats what i thought lol
actually
you need to make an if statement if the author only did 1 argument
args.slice(1).join("👏")```
Can anyone help me?
A regular expression
uh
example
Regex
What does that mean tho
if(command === "clap"){
if(!args[1])
return msg.reply("What should i clap")
message.channel.send(args.slice(1).join(":clap:"));
};```
is this correct ?
args.split(" ").join(emoji)
:clap:
.join("\👏")
Regex is a complex subject, its best you google it @white drum
or you could do
you dont need regex, you can literally check for bot mention
👏
args.split(" ").join(emoji)
@empty owl wot
@empty owl his first arg is the command
oh
he did if(!args[1]) return
Then args.slice(1).split(" ").join(emoji)
and I don’t think the command is supposed to be in the args array
you cant split args again if its already an array
HELP
you cant split args again
^^^^^^^^^^^
Oh
help with what
do args.slice(1).join("\👏")
Ye
@quartz kindle is it good?
since u need to put the \
@solemn latch Meh i tryed
And?
there is no user.guild
^
what i do there
You already have guild defined, use it
^
yes
Save the file
am not that stupid
are you sure the error is coming from there? whats bot.js line 42
yes i do worry
User is the User object
it contains all properties that belong to that specific user
profile pictures, usernames, discriminators, id etc
Check the docs to see what properties and methods exist for user
to get the ban reason you need to fetchBan
@quartz kindle can i declare the guy who banned?
^
sorry to barge in, but can anyone help with FFmpegPCMAudio?
pretty new to discord bots
@cobalt spruce not afaik. ban info contains only user that was banned, and reason
Tim can i use express.js to interact with my db?
does your db expose any kind of REST api?
or you mean receiving requests directed towards your db that you interact with locally
Tim can i use express.js to interact with my db?
@pure lion what db do u use
Quick
o
Would I need to switch
Can you run me through that
if you want to make your database available to http requests from other applications, yes you can use express
Can I write to it too?
yes
Ok epic
Just gonna learn full stack don't mind me
can ppl help me make a coin system?
so is ejs
im using mongoDB and djs v12
@pure lion it can be as simple as ```js
app.post("/write", (req,res) => {
let data = req.body // or whatever the body parser does
db.set(data.key,data.value)
res.send("data written")
})
webpack is hell
@pure lion it can be as simple as ```js
app.post("/write", (req,res) => {
let data = req.body // or whatever the body parser does
db.set(data.key,data.value)
res.send("data written")
})
@pure lion check for auth too
webpack is hell
@quartz kindle actually now I look further into it yes it is hel
took me like 3 days to get some basic setup working
ejs is much better
ejs is pretty good imo
i wish i had known about ejs a year ago. back then i wanted to make a API but forgot for what
i wish i learned node.js earlier before i bought a xampp stack webhost for 3 years and wasted all of it writing bad php
rip
hi
im using quick.db
const Discord = require("discord.js");
const Eco = require("quick.eco")
const eco = new Eco.Manager();
let db = require("quick.db");
//db.init("./economy");
let invalid = [0, -1, -0];
let invL = [-1, -0];
//const User = require("./User");
module.exports = {
name: 'add',
description: "adds money into someone's balance if you have perms",
execute(message, args) {
/*let userid = args[1];
let amount = args[2];
//if (!userid) throw new EcoError("User id was not provided.");
//if (typeof userid !== "string") throw new EcoError("User id must be a string.");
//if (!amount) throw new EcoError("Amount was not provided.");
//if (isNaN(amount)) throw new EcoError("Amount must be a number.");
//if (invalid.includes(Math.sign(amount))) throw new EcoError("Amount can't be negative or zero.");
let oldbal = db.fetch(`money_${userid}`);
this.db.add(`money_${userid}`, "+", amount);
let newbal = db.fetch(`money_${userid}`);
return { before: oldbal, after: newbal, user: new User(userid, undefined, this.db), amount: amount };*/
/*if (!message.member.hasPermission('ADMINISTRATOR')) {
return message.reply('You do not have enough permission to use this command.')
}*/
if (!args[0]) return message.reply('Please specify an amount to add.')
if (!(isNaN(args[0]))) return message.reply('That was not a valid number!')
let user = message.mentions.users.first() || message.author
message.channel.send('Successfully added ' + args[1] + ' to ' + user.username)
db.add(`money_${message.guild.id}_${message.author.id}`, args[1])
}
}
amount isnt getting added
whyyyyyyy
you're checking args[0] but adding args[1] ?
@quartz kindle because they bigbrain
yeet
It's basic js
lol
:/
Amount is set to args[2]
can ppl help me make a coin system?
im using mongoDB and djs v12
ive had some issues when i started with mongodb (tryed to store a userid as int but its to long and i didnt knew why, additional mongoose dont support bigint)
just make it a string
@earnest phoenix litteraly the yt series i send you adds a coin system
@earnest phoenix what exactly do you need help with
oh really?
@honest perch i know found it on stackoverflow
const DBL = require('dblapi.js');
const dbl = new DBL('CENSORED', { webhookPort: 25565, webhookAuth: 'CENSORED' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
I'm running this on ptero, when I visit the url provided it doesnt connect
is the port open?
I'm around
f(command === "clap"){
if(!args[1])
return msg.reply("What should i clap")
msg.channel.send(args.split("").join(":clap:"));
};```
it is not working]
That's a nice f statement you got there
f
if
Looks like you already split if you have args[1]
Your splitting something that's already split
just do if args.length = 0 then do what should i clap
hi
- you need two = signs
- his first arg is the command
like ```js
message.member.hasPermissions
is there a way
i mean
is there something like
message.member.hasID
Your looking for a user with an id?
im trying to make a command
which can only be done
by one guy
one specific guy whos id i know
message.member.id === userid
message.author also works
Or
['Id','id2'].includes(message.member.id)
If you want multiple IDs
Or or
Nah jk thats all I got
Or
You could overcomplicate it
function isUserThisUser(user1, user2){
if(user1 != user2) return false;
if(user2 => user1) return false;
if(user2 <= user1) return false;
if(user2 === user1) return true;
}```
I say create a website, that has an api with the id, and when the bot gets the command, it checks that api for the ID.
And then send the two IDs to another api that checks if they are equal.
And then if they are, run the command
🤔
Lol
or train a AI to check the id and repond if the ID is correct
@quartz kindle how would i show a server count on a website
Discord API or embed bot/create API in bot project.
if its the DBL side add a autoposter (add the client to the DBL client)
I made sure my port is open, and when testing nothing happens
Code: ```js
const DBL = require('dblapi.js');
const dbl = new DBL('CENSORED', { webhookPort: 25565, webhookAuth: 'CENSORED' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
I'm running this on ptero, when I visit the url provided it doesnt connect
did you have a console.log if the bot connected to DBL?
console log what exactly
*crying*
Thats api abuse
forEach
- Don't
wat
Don't do that
oh
forEach loop
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
``` maybe this will catch something
lol
forEach is slow.
Sotp
for loop is gut
But you shouldn't post a message in all servers.
Abn
yeah
@lusty quest dbl.webhook.on you mean?
Nab
you shouldn't
so no .webhook?
kk
yep
not 0.0.0.0:port it needs to be your serverip
did you use the offical dbl package or the non offical one?
official
so dblapi.js
I'm in settings
in your bot
This is bot's settings
not on the webpage
from where then?
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
``` you get this print into your console right?
the path at the end is needed
hi superbrain8 we meet again
Webhook running at http://0.0.0.0:25565/dblwebhook only thing I did was replace 0.0.0.0 with the actual ip
thats correct
nothing in console though
did you added ```
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});
just for debugging its enought
yep
and if you use the test button on the website nothing happens?
exactly
hmm 404 says page not found
yea that should be fine
i dont have anything displayed there
I tried console logging the constructor dbl
threw an object at me, I don't see any errors seems fine
hmm
Api is pretty slow rn
30 mins? wtf
Has been for a few weeks
Oh no
but trying to fix a non existing issue is painful
IKR
Honestly docs should say it can take time for votes to be sent
""""time""""
days
""""""""""days"""""""""""
My bot just came out of queue lol 1 month
Bruhhh
i applied my 2nd bot a few days ago
also my first one reached 100 Guilds a few days ago
Yooo niceee
what kind of bot is it
I low key wish I would be allowed to send documents to discord so I can be verified :<
did you know the game Warframe?
Who?
Almost
I think we listed the 3 reasons it didn't work @delicate shore did you fix them
I think we listed the 3 reasons it didn't work @delicate shore did you fix them
@solemn latch yes
math.floor and math.random is a way to get a random from an array
not here too my gowd
i```js
f(command === "clap"){
if(!args[1])
return msg.reply("What should i clap")
msg.channel.send(args.split("").join(":clap:"));
};```
this is the code
I dont see any changes
You just said you fixed the issues
then
that we listed earlier
you listed noothign
one person said do arge 0
other said that it won't worl
work
both were bot devloper
@restive pebble bru
dayum
show me how u defined args
yea
bot.on("guildCreate", message, guild => {
bot.channels.cache.get("728260629466447892")
.send(`Joined New Guild - ${guild.name} with ${guild.members.cache.size} members!`)
})
``` will this work?
use args.join(" ") if args is already splitted
Yeah, his args are already split
Your args didn't remove the command
why is this happening
@delicate shore because of .join("clap")
Slice it out
args.split("1")
@delicate shore because of .join("clap")
@fallen arch i mean why is s!slap there
args.split("1")
@calm saddle not a string
i used copy paste soo it was a MISTAKE
xDD
pls help 😢
we are trying
@delicate shore i know what can fix your problem ||read those fucking DMs||
Don't spoonfeed boys
yeah
@delicate shore i know what can fix your problem ||read those fucking DMs||
@earnest phoenix you never dmed me
Lol
lol
You where told exactly what to do
no spoonfeed is there
emm gee
?
no spoonfeed is there
@delicate shore use.split(1)
what i thought no spoonfeed
thats not spoon feeding
Spoonfeeding is giving a copy paste answer
yeah
-faq
its completing the code for them
@delicate shore use
.split(1)
@fallen arch not working
because i had already splitted it
Faq is mod command
@fallen arch not working
@delicate shore show me how you did it
const args = msg.content.split(" ");
the command as in !clap is args 0 use .slice(1) to slice that off
the command as in
!clapis args 0 use .slice(1) to slice that off
@calm saddle args 1 i think
but the same thing yes
yea you have to slice of the !clap argument
const args = msg.content.split(" ");
@delicate shore ```js
const args = message.content
.slice(prefix.length)
.trim()
.split(/ +/g);
doesnt matter
@delicate shore ```js
const args = message.content
.slice(prefix.length)
.trim()
.split(/ +/g);
@calm saddle spoon feed boi
bruhhhhhh i was showin him how i use it ;-;
thanks
ur welcome
what was he trying to do anyway?
Remove the command from the args
slice of the command part
||it does matter if it is s!clap or !clap that is one argument||
^ plus we are not your dev team. You can't expect us to know your command prefix or command names
anyone need help?
lol


yikes
So I'm working on adding metrics to prometheus.
I mostly have everything
Prometheus?
But I need to initialize the client with the metrics on startup
Its a time series database
😮
ahh yes a thing i want to figure out to is sending metrics to InfluxDB
nice there is a node-influx client
stocks
did someone know a way to get around the caching in d.js for the membercount and guildcount or a way for refreshing it?
not sure if client.users.fetch() is enought
would be nice if you could call a event for refreshing the cache
there is no way to track memberCount without the GUILD_MEMBERS intent
the initial GUILD_CREATE packets contain an initial memberCount property, but then you need to rely on memberAdd and memberRemove to keep it updated
there is no way to obtain that number otherwise, aside from disconnecting and reconnecting to the gateway
ohh thanks for letting me know
Can my bot use Animated Emoji/
with the intent you can update the cache?
?
or did i get there something wrong? (without the events)
bots have nitro
Yes
with the intent, you will receive memberAdd and memberRemove events
ok
which you need to increment/decrement the memberCount property
what a stupid way to implemet this stuff
agreed
i can understand they want to take load off the API but it would be nice if it would autoupdate every 10-30 minutes
there is a of guild info that its only obtainable when logging in
hi tim
they could at least allow you to request guild chunks
the same way you can request member chunks
or this
cant you loop GET/guilds/id/members every so often to overlook that guild intents requirement?
its stupidly expensive
well, yeah
you can request member chunks, which is way faster than going through the rest api, but still slow
i just tested this today actually
requesting member chunks took about 10-15 seconds to receive 120k members
wtf?
jesus christ
ok
same with guilds
@cobalt spruce args is not defined
takes 20 seconds to connect 4 shards and receive 3.7k guilds
takes 1.5 minutes to get them from the rest api
hmmm i see the problem
Is the limit on the maximum values in a embed 25?
Because my bot is supposed to return more than that but it only returns 25
if (message.member.hasPermission("KICK_MEMBERS")) {
if (message.mentions.members.first()) {
try {
message.mentions.members.first().kick().then(message.channel.send("I just Kicked his" ));
} catch {
message.reply("I do not have permissions to kick " + message.mentions.members.first());
}
}else {
message.reply("You do not have permissions to kick " + message.mentions.members.first());
}```
why does this not work?
you're still stuck on that? lmao
try/catch doesnt work on promises without await
^
soo..
run the kick function async
turn everything into an async function and await them all




