#development
1 messages · Page 1133 of 1
I'm setting up my cusom prefix command in my complete rewrite of my bot
i use mongoose too, its pretty neat and simple
i use mongodb official because i find it easier imo
now what I plan to do use the guildCreate Event to get the message id and set the prefix as default
i don't store defaults myself
oh my god i have asadgouihdsfoaihoisadfhj
what?
how to make headers stay between redirects?
how to use google
ok so ive bought the vps
how do i connect it to my api
b
lol
ssh root@ip
you can use putty to do that
There's an extension on visual studio code for it
idk if its just not loading for me but is there a reason why an emoji like this for a bot <a:Nitro:emoji id> turns into :Nitro:on the message and not the actual emote, from what i can tell bots can use animated emojis but it just doesnt seem to work.
it even works until i reload discord and it just turns into the text lol
The emoji ID is incorrect
now im really confused wtf-
huh
dude
I had the same issue before
its always returning 'access denied' even though im a: not running it on post requests and b: its a different path all together
alright
Dm me need Java devs. $
this is not fiverr
Bye
how do I add things using mongoose
how do I add things using mongoose
updateOne
You can use this keyword that I can't remember to create a new doc if one doesn't exist
@flazepe
Weird
how i can get all the guilds name with py?
@torn ravine updateOne with opt { upsert: true }
Upsert is a failsafe incase the thing doesn't have a document assigned to it
Creates a new doc*
specifically I want to get guildID from the guildCreate channel
wait I meant event not channel
The event returns a channel object
@pure lion No, guildCreate event returns a guild instance not a channel instance
Okay cool
@torn ravine So you want to update the prefix for example or
let t = ['0', '1', '2', '3', '4']
const collector = msg.channel.createMessageCollector(x => {
return x.author.id === msg.author.id && new RegExp(`^([1-${t.length}|cancel])$`, 'i').test(x.content);
}, { time: 30 * 1000, max: 1});
Problem: a number from 1-5 works but "cancel" doesnt
yes
Why are you putting the cancel inside a category
category?
"]"
oh ofc
How do I print every emoji out that a guild has?
iterate over the guild's emojis?
message.guild.emojis.cache.forEach(e => {console.log(e)})
@torn ravine You gotta get the guild or the guild prefix model and use updateOne on it but it only works if you provide the document id
how i can get all the guilds name with py?
@earnest phoenix iterate through all guilds bot is in and make sure to convert them to string usingstr()
<Mongoose model>.updateOne({ _id: <document id> }, { $set: { "prefix.type": <new prefix> } });``` for example @torn ravine
how would I get document id?
okay
Well if you want to find it you gotta use findOne() but instead of doing all this, there's a method combined
findOneAndUpdate() @torn ravine
how i can get the permissions of the member in array? (py)
I've got a question for discord.js: When using a message event, how does the bot need to get contacted on discord that msg.member (msg as result from event) does not exist?
okay thanks
<Mongoose model>.findOneAndUpdate({ "guildID": <guild id> }, { $set: { "prefix.type": <new prefix> });```
@torn ravine
@jagged sun Just check it with a boolean,
Boolean(<message>.member);```
Would return that if it exists, it's true, if not, it's false
Ok, but I want to understand why this happened? msg.member can't get created if it gets a message in a group or via a dm, so i added that it should return if msg.channel.type === 'dm' or msg.channel.type === 'group' but it somehow still crashed, because of not being able to get msg.member... Thats weird
But thank you
you cant get a member object in a dm 
If I'm reading that correctly @jagged sun
ooooh I see. Are you by chance using return; in a promise
?
If you send over the code it would be helpful, kinda going off a hard to understand sentence
return
}``` When getting a DM msg.member is undefined, so I added this before using msg.member in the event, but it still crashed because it could somehow not get msg.member. So the bot must have activated the message event, even though not getting a message via guild, dm or group, and I don't think there is even another way on discord..?
It always worked fine, but some random dude got it to crash...
return
}
if(!Boolean(msg.member)) {
return
}``` I was able to fix this with those two (i think), but I just wanna understand why this happened😆
If the guild was unavailable at the time for some reason it is possible it didn't get the info from discord, and based on what you are saying... that may be the case - I know some guilds were offline earlier because the api is stupid
Ok, that might be the reason but thats weird
but nvm, then if(!Boolean(author)) return shall fix it...
why not simply if(!msg.member) return
sure, also works
tim how do i code
tim spunfeed me inde.json
@_@
Ok then tim
im dead serious tim spunfeed
How do i check if a user has 0 roles in eris
lmao
u made my day
Yes
if(message.member.user.client.guilds.first().channels.first().client.channels.first().client.users.find(message.author.id).guild.members.find(message.author.id).guild.roles.filter(role => !message.member.roles.includes(role.id)).size) {
return
}```
That seems over complicated
replace it with channels.guild.channels.guild.channels.guild.channels.guild.client
Anyone know why my bot doesn't send custom emojis? The id and name are correct, and the first time the message is sent the emojis are there
When i reload discord though they just turn from the emoji into the :emoji:
Is the bot in the server that the emoji originated from
Yeah
ok so i have a line of code that whenever the bot is mentioned it returns with the guilds prefix
```if (message.mentions.has(client.user.id) && message.content.length < 23) return message.channel.send(My prefix in this community is \${serverSettings.prefix}`\nUse ${serverSettings.prefix}help for help!`)
but
also this code was given to me by woo
and he says it doesnt give him this problem
when i start the bot
```if (message.mentions.has(client.user.id) && message.content.length < 23) return message.channel.send(My prefix in this community is \${client.prefix}`\nUse ${client.prefix}help for help!`)
^
TypeError: Cannot read property 'has' of undefined
at Object.<anonymous> (C:\Users\urmum\Desktop\Society Bot\index.js:54:22)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47```
discord removed the developer insign?
?
what's an insign
they didn't remove that
yes they didn't
no they didnt
You're saying that they did when you have it...
gaus , how can i connect between electron and my njs codes?
wish they did tbh
woo gave me the code and he claims that this works perfectly fine for him
@eternal flame then don't copy code???
Ok so I'm genuinely confused. Is it more efficient to see if you can perform the action then do it and get no errors or put in it a try catch
I like to see if I have permission to perform an action, then try and catch.
In case it somehow does not work.
for what
@sudden geyser ah ok
hey.... im trying to check if in mongo "lconfig" is set to false (ex. lconfig: false) and then disable leveling if it is... could anyone help me on that?
Edit: lconfig is a boolean.
How can I get the bot to give an error message if the given role is above its role?
How can I get the bot to give an error message if the given role is above its role?
@torpid tiger check the bot's highest role and compare it's position with the other role
If the bot's position (a number usually, but varies on libraries) is greater than the other role, it's above it. Else, it's not.
@sudden geyser No, how can I send an error message on the bot as the code
How can I get the bot to give an error message if the given role is above its role?
@torpid tiger for this reason
Well if you tried to hit the API it would say Missing Permissions (I think), but really you'd just need to try it, then catch any error that may arise. What library are you using
djs v12
Here's an example: ```js
// Promise functions.
member.roles.add(someRole)
.then((role) => console.log(Added role: ${role}))
.catch((err) => console.error(Could not add role: ${err}))
// Or, try catch. Requires an async function.
try {
await member.roles.add(someRole)
console.log("Added role")
} catch (err) {
console.error(Could not add role: ${err})
}```
hey.... im trying to check if in mongo "lconfig" is set to false (ex. lconfig: false) and then disable leveling if it is... could anyone help me on that?
Edit: lconfig is a boolean.
@royal tapir check message.guild.id then lconfig and if true/false, if disabled thendon't add XP or leveling or whatever
I may have misunderstood so I'm sorry, I want the bot to say "This role is above my role, I can't add the role to you"

You can send a message, rather than logging
Yeah, so like I said last time, you'd need to compare the role's position to the bot's highest role position.
Which is just <Role>.position and using > or < (the higher the number is, the higher it is on the side bar)
Hmm, thanks
i need help
so
i have a custom prefix command
and for ever guild
every
guild that uses a cp command
it store it in the database (guild id, prefix)
so
what im trying to do
is make a command
where when the bot is pinged
it pulls that data out of the db
and replies with it
please make your question to one message
i have a habit of that sorry
I need help with my index.js
let me read your mind and see what is wrong with your index file
Hi, guys! Is there a difference between User.displayAvatarURL() and User.avatarURL()?
@daring warren thats.... what is called.... erm... being a developer. you WRITE code 
I know
then....?
show what you go thus far
@mystic tundra
<User>.avatarURL()
Returns the url of the users avatar but if the user has a default discord avatar it will return null
<User>.displayAvatarURL()
Same as avatarURL() but this time it doesn't return null if the user has a default avatar url and returns both the display avatar url if exists, if not the url of the used default discord avatar
thanksss bro
Np
const token = 'token'
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = 'fp!'
const fs = require('fs');
client.commands = new Discord.Collection()
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'))
for(const file of commandFiles){
const command = require(`./commands/${file}`);
client.commands.set(command.name, command)
}
client.once('ready', () =>{
console.log('This bot is online!');
});
client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'food'){
client.commands.get('food').run(client, message, args)
}
else if (command === 'pasta'){
client.commands.get('pasta').run(client, message, args)
}
});
client.login(token)```
?
@opal plank here ya go
okay lets start with a couple things
since you already got your commands outside in different files
Your 90% of the way to dynamic execution
you'd prob want a dynamic command handler
i'll link you one
take a look at that ^^
k
i need to build my own oauth2 api for a website but i have zero idea what it's like
ty
First result when you google "Oauth2"
interesting and complex
Hmm anyone know why events like guildMemberAdd and guildMemberRemove sometimes don't emit?
because of your internet
Discord api issues or they do but maybe you don't realize?
Idk
It can't be because of your internet connection bruh
This is an event
.... and how do these events get to your pc or server
via the internet
specifically the websocket / gateway, which maintains a real time connection, which due to the nature of the internet can drop out
discord can also never replay events
it happens sometimes
Bruh the websocket is bound to the events i know but they're aren't in real time connection are they
I've never seen them not emit
welp idk
are you a library developer
i assume no
because events are sent real time
when an event triggers, discord sends it as an OP 0 via the gateway websocket
sometimes, due to the nature of the internet, or maybe discord's servers being stressed, the event doesn't send, or doesn't get received
I mean if your internet is trash like mine then your bot could disconnect and reconnect and while it is disconnected is when the event happens sometimes
and in most cases its hard/impossible to detect that
@wooden ember if a bot disconnects and reconnects, events are "replayed"
are they
so when your bot comes back on, it gets all the events it missed
ah didnt know that
i've made my own library so i know how the gateway works
fair enough
What should I make for a game for my bot
is your bot purely a game bot
then ask yourself if you really need a game in your bot
will it benefit it, will it improve it, will it make sense, and will users actually make use of it
Thx for the help
does anyone know how i can use digitalocean with github?
how do i set it up?
Like what, pulling a repo or GitHub Actions deployment?
same
i mean like
i use github desktop, so i'd put out the repository, then how do i get digitalocean to take that repository and run it
with heroku you just upload it, add in a few configs and add in Procfile with a node index.js in it and you're good
use git clone https://github.com/yourrepolinkhere
That'll pull the code from the repo
I was thinking git clone
look up docs for that
kk
```
data is undefined
Err
no no
but it works if i set that to a string
and all <%- data %> is
is just like and object
are you using a framework in your website..? like angular, vue, or react or something
Oh right
ping if someone has solution
Any recommendations on how I could improve the server card?
I dunno if they should be a different color
Or have some shadow
can someone give me quick code on how to get the invite url of the servers my bot is in
here
one sec
bot.on('ready', () => {
bot.guilds.cache.forEach(guild => {
console.log(" - " + guild.name, +guild.memberCount);
})
})
this logs in the console the names of all servers and the member count of all the servers its in
can you maybe integrate it into that?
is what it spits out
does anyone have flat gifs
You could use the <Guild>.fetchInvites() method to fetch the invite from a guild, but you should typically avoid it. You probably don't need the invite in the first place and it's a breach of privacy.'
does anyone have flat gifs??
Plus it requires you sending an HTTP request to the API since I don't think it's given to you
that is very true, but there is someone spamming the customcommand command and it is flooding the db, and on join my bot says the max custom commands for on server is 10 and this person has 47 and counting
i really wish to speak with them
It would make a lot more sense to log who is running a command (or logging when written to a database) rather than fetching the invite to a guild.
@eternal flame I recommend logging the channel ID and then sending a message to chat channel with the bot:)
if you must give them a warning
hi
also
with custom command
is it better to store the server for the custom command as the servers name or id?
alr
would anyone know how to code a bot that says anything that you dm it?
and if you specify the channel and server
thats
just do a say command
have the bot delete the command message
so it goes
would anyone know how to code a bot that says anything that you dm it?
and if you specify the channel and server
@earnest phoenix It would have to be already in said server for that to work
But that would not be hard at all the do
well, i have no experience with java script
Well you'd have to pay someone to make it or learn JS then make a bot
Or use the Steam app Discord Bot Maker #502193464054644737
ima do the latter
sounds like u were either really young or....really young
also, is there a way to code a bot on a chromebook

download an IDE
ok no then, im on a school chromebook and i cant install chrome applications
anyways
i need sum help
yes
so
don't ask to ask ty
tysm kyando
is if someone is spamming the custom command feature (which is stored in a mongodb) and is flooding our db and they are not in the server
we can do
society-cross-server-warn [channel id] you have been warned etc etc
but
im stuck
lemme get
screenshot real quick
Next time, try to think about what you're gonna ask, before asking it to evitate this situation ^-^

I JUST READ THAT
LOL
Ok so this is my cross server warn commansd]
when you make a custom command, it logs the channel that the command was made in the db
but right around the 2nd let MSG
the 2nd let msg is the issue
how do I make conditional embed statements
ohh
if
else if
else if
else if
else if
else if
else if
else
I mean I didn't ask to be taught yandere dev code
you should learn JS syntax
@torn ravine you mean
uh
what?
i don't quite understand
Not trying to be rude, but your code is a mess ;-;
yeah ik
my everything is a mess rn
@earnest phoenix I know syntax. I wanna use if statements to add stuff to embeds
add field?
oh
sort of
@still badge more/less
if you’re running multiple bots on your account it won’t last
only 1
should be good
ok thanks
Anyways IF6
had to set everything up before it get reviews
If i understand correctly, you want to add something to embed inside if else statement?
yea
Alright
you need to make a variable of the embed
and then inside your if else statement, you can call the variable and modify it
and also edit the message to the new one
is it kinda like if if (x) { <embedName>#addField(`whatever`) }
ah
why tf does discord bot maker cost money? i dont have that!
not everything can be free. Welcome to the Real World.
why do u think we have money
how do you check to see if the id of the author of a message matches up with the id given?
js: message.author.id gives you the author id
if(message.author.id == your ID variable){
do stuff
}
both work
=== is better
== will still compare them if one of them is a Bigint and the other one a String. === Will not
ik, anyways
== is better here
since otherwise values that match might be seen as not matching
so uh, i have a question about bitshifting, how does it work?
be more precise what do you not understand?
thx @lusty quest
I don't understand how it work, for example if i do 1000 << 1 what does it mean?
I did try google, but i don't understand it.
the most left bit, here it's 1, will be lost and we add a zero on the other side
your basically pushing it towards the left
1000 >> 1 = 0000
0100 >> 1 = 1000
1000 << 1 === 000?
0000
ah i seel, thanks
help, i want to filter multiple category of commands but i cant figure how.
code:
if(!message.channel.nsfw && message.author.id !== BOT_OWNER) {
categories = [...new Set(client.commands.filter(cmd => cmd.category !== ['NSFW', 'Owner']).map(cmd =>cmd.category))];
}```
so what do i do?
#Array.includes("String"); //True if array have element
still a long way to go
for example
let x = ["TEST", "OWO"]
x.includes("TEST") //True
x.includes("OwO") //False
@lusty spade ^^
how do i send an embed to a specific channel?
uh
ok
where do i identify what channel to sne dto
where do i put it
Hello for anyone familiar with mongo db can you help?
In my insert function example:
collection.insertOne({ "userId": message.author.id, "here": color })
Instead of here I would like to use variables for that based on user input, however, when I use ${} in the here part it does not accept it, anyway around this?
I basically want it to be like this
collection.insertOne({ "userId": message.author.id, `${args[1}`: color })
However, right now it does not accept it
This is a mongo db field
I did that
show me the error output
sorry the `` turned into the discord markdown thing
isn't it github flavoured markdown though 
nvm it's disc flavoured
you can't really use template strings like that there
this works...but
not what I want
you can't really use template strings like that there
@sudden geyser in mongo db?
make a value with the stuff you want to insert and then just pass the value
try and see
or will mongo db wont accept it
in JavaScript in general, You can't have the key be a template string, but you could use it like "{ [${something}]: 5 }" However, I'm not experienced in MongoDB and probably can't help you there
If you need to use it that way, but do you really need it?
one question is color a value or a key?
If you need to use it that way, but do you really need it?
@sudden geyser I do
is your bot Approved?
yes
here on DBL?
it supost to be
what is the userid of your bot?
client id?
yes or run in #commands -bots your userid or mention
if no bot is listed its not added here
Not super urgent/serious, but I’ve always wondered how to add text onto an image with JavaScript, kind of like MEE6 leveling
use Canvas.
Oh
i need help ;-;
so i made abot of myself and i was trying to do a custom command and i had it as !shigarakipat {user} and it wont work :/
language and error please?
huh?
what coding language do you use
and what is your error (if any)
wdym language and error? im sorry for asking these questions i just start making bots
um- botghost
oh boy
no. I just don’t know how to use it
I use javascript
yes we code
there is no “messing up” in coding
it either work or doesnt work. there is no inbetween
i like just started and id know to do anytthinnggg
I wanna setup mongo db
Which language?
because what you typed counts to 15 characters
@earnest phoenix hi
I wanna setup mongo db
@earnest phoenix Did that recently with Discord.NET
mongoid db
How would I call prefix outside of this if statement?
im 99% sure this is how you do it but idk what im doing anymore.. console.log() for debug, commented out database if that was the issue
but prefix still is the one outside

(i cleared the db and commented out the check if it exists)
Does anyone know to set a status on a bot? (it is discord.js)
no i dont sorry
you would use the client.user.setPresence({})
ok
why would you need to check the channel type?
because im using server prefix
and if its in a DM it's not gonna be able to check message.guild
cause it's not a guild, it's a dm
Does anyone know to set a status on a bot? (it is discord.js)
@vapid cosmos setGameStatus or something
should i use postgresql
My bad. Kinda intoxicated
'tis ok
should i use postgresql
@strong tundra SQLite and MongoDB are pretty good options as well. The only once I've used
xd
probably gonna use postgres then
what lmao
is cockroachdb compatible with postgres?
interesting read anyways: https://www.cockroachlabs.com/blog/why-postgres/
Mongodbs quite good actually, the database is easy to set up, the API ehh it's intermediate
The only thing id say about mongodb is that queries take forever for me >:( (I'm using indexes)
Hey uh, was watching a tutorial, was wondering if this is supposed to be done:
The guy had all commands in separate files, I have 1 single file, am I supposed to use multiple?
its better if you use multiple
i see code splitting being done for organization
most people split it but you can keep everything in the same file if your bot has a small featureset
how do i make that it will send his name. not the id?
Yeah it’s only maybe 50kb in total
are you planning for a lot of features?
No, I usually just look at things, think “I like that” and try to add it
someone
ah
Eventually though I might make like a “fun.js” and “mod.js”
ron ahve you checked the docs
yeah you may as well split then
Also how do I split them? Have multiple client.logins?
heck that wasnt edit
Lmfao
nah
Also how do I split them? Have multiple client.logins?
@karmic compass https://discordjs.guide/command-handling/#individual-command-files
is this node.js?
that can work yeah
let him use his brain:)
man ive been writing like 6 extra characters whenever i want to do that
:(
im probably gonna sleep,
tried multiple things for this, if there's an obvious solution just DM me..
-- I dont want it to try and get guild.id in a DM, and instead just use the default prefix.
so yeah DM me if you have a solution, gonna go sleep pce
i got a problem with the displayAvatarURL idk what to do?
What's the error?
Are you actually mentioning someone?
you can surround it in <@> if you want to show their ping
no i dont want it to ping them. only their name
Then do .username after .first()
thx
did you add a check to see if a user was mentioned
@rocky hearth ask here
hello im migrating to discordjs v12 and i cant find how to check if a role exist in server or not
v11:
if (message.guild.roles.exists("text", "Support")) {}
i (probably) found a way:
array list
nope
lagged my bot out
read docs
what is offline mode
yes u can but i cant test it
ok?
so you answered your own question
i couldn't find if role exist
ima search in role's cache
does array method in role's cache returns arraylist of roles?
let role = message.guild.roles.cache.find(r => r.name === "name");
if(!role) return message.channel.send("role not found")
@exotic prism ^^^
oh ty
like this?
ty man
yo
how do i get discord's database?
@earnest phoenix hack it
;))
Ah thanks dude
np
LOL
ok smh
how do i get discord's database?
@earnest phoenix u mean Discord API ??
A Public part from Discord Database
js?
ay my first starboard <3<3
message.member.roles smth
Idk
Ask someonw
Me never tried role stuff
How i check message.author.id includes in support guild?
suchas People A type command !check if he in side support server mine guild bot will reply success if don't revoke
Fix your English first
Or speak another language
We have Googke Translate
Let's not be rude
Me not rude
The way you worded it was rude.
Me just saying that if he has some problems with English then he should ask in some other language/use grammarly
Also we getting off topic
How i check message.author.id includes in support guild?
@earnest phoenix do you want to check if the guy is in your guild?
yes
@earnest phoenix
Check to see if they are a member
You using discord.js?
yes
@earnest phoenix
@earnest phoenix don't ping me
Pretty sure you need to search for the user id X in guild Y
bot.guilds.cache.get("Y").members.cache.find("X");
@earnest phoenix
Try that
You need to get the guild ID of the support server
someone please help me how to add mongodb with discord.py
You can't
Mongodb is for JS
https://api.mongodb.com/python/current/tutorial.html @lethal pine
You can use pymongo,
this link will give you all the information you need to get started/use pymongo
https://www.w3schools.com/python/python_mongodb_getstarted.asp
and alhassan's link ;-;
@earnest phoenix Please dont spread false information.
kk
lmao
make sure to store what you need, such as only storing guild id's, channel id's, and that kind of stuff
you can then use the ids and the discord.py lib to get the objects needed
Also if i make a syntax error in a try catch block will it still crash the js program
Really depends on the use case
@earnest phoenix What are you saying...
Lol
Me has gone nuts maybe
Also if i make a syntax error in a try catch block will it still crash the js program
@earnest phoenix
pretty sure it will just stop at the line of code, then exit the try-catch block and continue where it left off
hayper, really depends on your style of coding and which one suits your preferences
They have "code intelligence" for freaking discordjs
And a lot of other npm packages
function iCrashYou() {
while(true) {
iCrashYou()
}
}
Lol
^ @earnest phoenix that will crash ur stuff
Why
if you use java, python, c++ or c#, then i can recommend my favorite ide's
Oh you mean my stuff
I thoughr it will burn my pc
Time to wreck windows by running it on startup

public static void crash(){
while(true){
system.out.println("why tho");
}
}
crash();
if you use java, python, c++ or c#, then i can recommend my favorite ide's
ide's
Your ide's what
what language are you using?
QBasic
let gayembed = new Discord.MessageEmbed()
.setDescription(`${message.author}, you are ` + Math.floor(Math.random() * 100) + `% gay. :rainbow_flag:`)
.setColor("#A4C9F6")
if (!message.guild.me.hasPermission("EMBED_LINKS")) {
return message.channel.send("Oh no! I don't have `EMBED_LINKS` permission! May I please have it?");
message.channel.send(gayembed);
}``` for some reason, this code doesnt seem to send the embed?? May someone help?
My skool sucks
then i can't recommend an IDE, never used QBasic, or heard of it
let gayembed = new Discord.MessageEmbed() .setDescription(`${message.author}, you are ` + Math.floor(Math.random() * 100) + `% gay. 🏳️🌈`) .setColor("#A4C9F6") if (!message.guild.me.hasPermission("EMBED_LINKS")) { return message.channel.send("Oh no! I don't have `EMBED_LINKS` permission! May I please have it?"); message.channel.send(gayembed); }``` for some reason, this code doesnt seem to send the embed?? May someone help?
@stable eagle there is a ` before case
there wasnt, accidentally typed 1 extra, but no
use hastebin
you need to queue the message if you're using JDA
you can
Milo, dont you need to put a ";" after the .setColor()?
imma try
still doesnt work
Maybe
Try sending an embed object
Wait
You used a template string and a +
Was the template string terminated before the +
I somehow made it work,
Why is there a template string with +s
Oh fuck the download process on vs went from 45 to 44
ReferenceError: Cannot access 'target' before initialization
But I have declared it? let target = message.mentions.members.first();
Dam boi dam boi he thicc
Js is read
Line
By
Line
So you have to declare it higher
Does anybody know how's the magik images are actually created?
What's used to do the manipulation of this
you can use the imagemagick module
warn
lock channel
already there
You'll probably want to have some sort of antispam feature if your doing moderration.
Chat filter
Hmm
Um opus installing is spamming my console with pink warnings
../deps/opus/silk/macros.h:59:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
../deps/opus/silk/macros.h:69:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
#if OPUS_FAST_INT64
``` this is being spammed like a million times
I want to add reset chat but i dont know a lot coding so i dont know the code for it i use d.js
Yes
by using that comamnd all the messages of a particular channel deletes can only be used by the admins
@earnest phoenix yes i m
But talk in english here if you wanna talk in hindi dm
Hmm
Or do message.channel.bulkDelete(100000008888034619154646491);
Hmm
Hmm
ban kick purge warn mute?
Pretty easy
i have these all
Except for mute
wait
Your bot goes down = the guy never gets unmuted
Some beginners use setTimeout
Like me
guy never gets unmuted? well, uh, deal with it
Which lang?
node.js
Nodejs is used to run javascript
Wait a sec
Javascript is the langauge
^
I got a dm
Also what are promises in JavaScript
you cant natively wait in js you can use async await or promises to "wait" for something
You can
setTimeout
the syntax:
setTimeout(function(){
//code
}, time in milliseconds);
That doesnt wait for something
everything else will keep running
waiting is wait for that part to be done and then the other should start
in settimeout after the way only the function given in settimeout will run and anyone after it will keep running
^^
Put your other code in .then
you cant natively wait in js you can use async await or promises to "wait" for something
.then will run after setTimeout has done doing stuff
.then is a part of promises
and .then can make the code super messy i prefer using await
can't you just use something like this:
const delay = (msec) => new Promise((resolve) => setTimeout(resolve, msec));
await delay(1000);
???
I use it in several commands, and it waits for time to run out
great then
Cool
I just chain setTimeours
A setTimeout inside setTimeout works too
I used it for my hack command to edit the message after 2 second intervals then stop at the 7th
Api spam smh
Why cant i install OPUS ;-;
@small prairie check dependencies
Leveldown has a weird installation
So i switched to levelup

opusscript is bad
Aghhhh
I accidently was installing opus
just opsu
im dumb
i removed those from package.json and it worked
Hey I'm new in discord
Ok.
So I want to know that how to invite bots in servers
Yeah like dank memer, rythm etc.
Ok, so you wanna go to top.gg
and search the bot's name
then you can tap view on the bot you want to invite
there should be an "invite" button
What do you mean?
Ok
How is db.get(`test_${user.id}_{message.guild.id}`)but in json ?
don't do json
json is a bad drug
worse than meth
have you tried reading the error
Can anyone help?
have you tried reading the error
@earnest phoenix
The command "npm i quick.db" doesn't work
read instructions on the npm page on how to install quickdb
you could've done this yourself by just ✨ r e a d i n g ✨
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-08-09T10:42:31.785473+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-08-09T10:42:31.863830+00:00 heroku[web.1]: Process exited with status 137
2020-08-09T10:42:31.901715+00:00 heroku[web.1]: State changed from starting to crashed
error in heroku
stop using heroku as a bot hosting
problem solved
why
I didnt ask you
dont interupt if you are dumb
because they do not allow it and heroku is a WEBSITE host
nope
i mean you're the dumb one here but sure LMFAO
if it is possible then we can
fk
it is also possible to eat shit, doesn't mean you should do it
I am not like you
How is db.get(`test_${user.id}_{message.guild.id}`)but in json ?
does anyone know ?
oh you do eat shit? interesting
stop using json, yungspanac
tell me
a better db
lol
to script my mute command
he interupt everytime
any database, i personally suggest sqlite for small scale if you want to do sql
if not, there's mongodb for nosql
hmm
Ok
i want a
in hots db
@ember atlas
u understand ?
host*
i do understand
can you plz gift a mute to this guy
which one is good
@earnest phoenix are u from?
holy shit im crying laughing from that convo
I didnt ask you
dont interupt if you are dumb
?




