#development
1 messages · Page 985 of 1
yes
The author's icon?
yep
I want to know how to create roles
@inland aurora same tbh
you want to add an image to the embed that is not an author image?
use .setImage()
@winter basalt #mod-logs message
how do I see how many servers my bot is in?
yes
UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
embed.author.icon_url: Not a well formed URL
i got this error
Message.author.avatarUrl
What did you set as URL?
avatarURL()
@solemn latch ight
Or is it avatarURL
message.author.displayAvatarURL
Should've called it "getDisplayAvatarURL", some odd method/property naming clashes
avatarURL returns null if the user doesnt have one afaik
displayAvatarURL returns the default discord avatar
I remember having that issue
It doesn't return a default- oh
lmao
how does a bot get verified
by waiting
@hasty sparrow i have changed the code to see the correct information.. but still just shows the highest role and not what was removed
Would you like to see the new code?
If you want help with it, sure
This is the response im getting on any role changes add/remove and the role its adding to is Mod Manager Staff
Eddie its like a logger?
Yes @earnest phoenix but also includes other functions
But this section of code is really combuzzling me.
That code makes no sense
You check whether the oldMember's role cache contains the oldMember's role
?
oldMember.roles.cache.every(function (value) {
let role = oldMember.roles.cache.find(role => role.id === value.id);
...
});
What the...
if(message.mentions.users) client.messages.math(key, "+", 1, "mentions");```how do you know if a message contains a mentions?
So would removing the cache from oldMember roles fix the issue?
What? No
... im really struggling with this.. sorry 😦
For removed roles: For each oldMember role, check whether the newMember still has it
For added roles: Do the inverse
You had it correct the first time round, just your role conditional was wrong
Right...
I'd suggest using .each instead of .every
So use the same code as earlier just changing it to .each?
And check whether the role wasn't found, previously you always checked whether it was
Ok let me have a shot and try it.
@mental spade when ur bot is done let me know or dm me a inv link i need a logger, i have been looking for 1 for long
Ahh im not really sure which channel to write this in but does anyone know a good site where I can host a bot 24/7 on
any VPS host
I use GalaxyGate, because they are cheap, and i have no problems with the service
plus free backups

heroku is a free place for hosting your bot 24/7
What's the best way to check if 2 arrays are different in JS? would it just be a for-loop indexing thru the arrays or is there something I forgot? lol
I've only heard bad things about heroku
Won't === be efficient
If (array1 === array2)
@quartz kindle not worked https://kyoya.why-am-i-he.re/pGAHQc
sxcu.net free ShareX uploader
@midnight pike not 24/7
when your dyno runs out
they make you pay
no
[1,2,3] === [1,2,3]
false
``` ok
@earnest phoenix ?
[1,2,3] === [1,2,3] && console.log('true');
will never run
@quartz kindle youre was said remove node modules yesterday
to fix what?
I need to find a way to use AWS for my bot, but I have Windows 10 Home :/
do u have a old pc with windows 7 or 10 pro?
no
u can use the key on ur pc
I don't have one
facts
I can't buy that
bruh
2 reasons:
- It may be a scam
- I don't have the money
Is there an alternative to AWS? I do need to get my bot for 50+ servers
Heroku might not be good
people use heroku, but ive heard nothing but bad things
here
Find many great new & used options and get the best deals for Microsoft Windows 10 Pro Key Activation Key Product Key License Code 32 / 64 Bit at the best online prices at eBay! Free delivery for many products!
for the free thingy
lol
google cloud
wait thats home
Is google cloud paid?
im dumb
it gives you $300 for use
i think they give like $300 in free credit or something
ok
Is there specific settings I need to set? My bot does use ffmpeg
ok
posting bot stats returns bad request with the dbalapi.js module :|
whats your code?
is there anyway to make the bot online 24/7?
option 2: no thanks lmao
@solemn latch Are you here? I have a question. Check ur DM's
Is it possible to customize the existing help-command in discord.py or do i have to make my own?
I suggest making a dynamic help command
that way, whenever you change something/add a new command, the help command dynamically and automatically adds the new command
Aah
@hasty sparrow may i pm
did someone got here a good tutorial for getting x.509 perm files for mongodb? the offical docs are not really helpful
(if that makes sense lul)
it says to me i need a x509 cert but not really tell me how to get one
TypeError: kickMember.hasPermission is not a function
const kickMember = message.mentions.users.first() || client.users.cache.get(args[0]);
if (kickMember.hasPermission('ADMINISTRATOR')) {
return message.channel.send({
embed: {
color: colours.error,
description: `${kickMember} has \`Administrator\` and cannot be kicked.`,
},
});
}```
I have never had this issue
Wouldn't work if the id was wrong and there was no mention..
@digital ibex you could just add a linebreak above the part you want to move down?
idk if it is the best way to do it...
oh, but how would i do the actual moving down?
oh is it like a page separator?
kinda yeah
i guess you can try using margins
i tried margins, but nothing changes
oh
i added ```css
margin-top: 50%;
Anyone who could help me out with AWS?
EFS
-ask2ask @nimble escarp
@nimble escarp
Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
Please read https://dontasktoask.com/ for an explanation on why this is an issue.
percentage only works if everything above isnt percent, right?
It's not a specific problem, I need overall help 🗿
@digital ibex idk but maybe using divs may make a difference?
im a noob at css tbh lol
@nimble escarp just explain what you need help with
I'm trying to use it as a media storage server, basically to share files with a team (files can be 50 gigs).
thats what im doing, lemme show u my css: css .shit-joke { font-family: fantasy; text-align: center; font-size: 50px; } .lost-cat { border-radius: 10px; margin-left: 10% } .bottom { background-color: black; margin-top: 80px; height: 100%; min-height: calc(100vh - 50px); }
and my html is: ```html
<div class="container">
<div class="notification">
<h2 class="shit-joke"><%= joke %></h2>
</div>
<div class="lost-cat">
<img src="https://i.pinimg.com/originals/07/e1/dd/07e1dd4d1a982f9fcd016785cc7a496c.jpg">
</div>
</div>
<div class="navbar is-dark">
<div class="navbar-item">
</div>
</div>
</body>```
But I can't really work out how, since I can't set up a NFS server on the EC2 instance and you can't connect to the EFS server from the outside directly.
Tried to set it up as a VPN but it keeps giving me unknown error when connecting.
@mental spade Sure, but no programming help in DMs
you will probably see the prob when you open this, help me fix it https://codepen.io/heythere-cowboy/pen/abdJeyQ
Is the issue the missing space between Welcome or something else. What is the issue.
I want to be a space between the text
like a \n
2 lines
1 line for each span
nvm my friend helped me
hello
hi
what is the error here
let TOP = "Token :)"
const DBL = require('dblapi.js');
const dbl = new DBL(TOP, client);
dbl.on('vote', vote => {
client.guilds.cache.get('486336174395359232').channels.cache.get('702922225346412665').send(`New Vote By [${vote || vote.id || vote.user}]`)
});
dbl.webhook.on()
The vote listener is only on the dbl.webhook (which needs a server/webhook running)
how can i make a webhook
thats 1 of the things you should know with discord developing 
cant show rn
my justify content (vertical center) doesnt want to work because my css height doesnt want to work
i new developer

a newbie or a help vampire? a secret we'll never know
lol
can someone help?
how do i get my bot to dm the image of the server a person just joined?
setImage(member.guild.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
is that correct?
You're probably looking for iconURL
oooooooo
setImage(member.guild.displayiconURL({ dynamic: true, size: 2048, format: 'png' }))
is that right?
It's explained in the documentation: https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=iconURL
ok thanks
@sudden geyser i just read it all
and couldn't find
anything about icon.url
The link I showed you jumps to the section.
And it's a method
Public Server Lists on a bot can be considered a Privacy Breach correct?
Thank you just double checking
I have big problems with my bot. I wrote a bot to play music from YouTube. Now there is a need to listen to any music via a link from the Internet, but I do not want to rewrite all my code. What can I change in it so that this opportunity appears, while retaining all the commands and answers of the bot. Please, help me.
you just asked us to rewrite something because you dont want to do that 
maybe you should hire a developer if you dont want to make your own bot features
😂
So I'm trying to create an announcement command so what I send with my command sends it to other guilds, my only issue currently is getting the list of guilds my bot is in, this is the error:
at Client.<anonymous> (C:\Users\dargc\Desktop\Coding\betarpbot\index.js:1301:49)
at Client.emit (events.js:310:20)
at MessageCreateAction.handle (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:310:20)```
----
My library is Discord.js@12.2.0
show code
if(message.author.id === ownerid, adminid1, adminid2){
const guildList = client.guilds.cache();
try{
guildList.forEach(guild => guild.defaultChannel.send(message.content));
} catch (err) {
console.log("Could not send message to " + guild.name);
}
}
await message.delete();
break;
}```
client.guilds.cache
not client.guilds.cache()
i think
The error is self-explanatory. client.guilds.cache can't be called as a function. It's a collection. I also don't think there's a defaultChannel anymore.
default channel is gone
Okay, what about the channel function then? I'll need to fix that.
The if statement is also incorrect. You can't check user IDs like that.
also defaultChannel is nullable iirc
you could try getting the top channel on the list.
or letting server admins choose a log channel
ooo
unless its for private use (ie, you own all guilds)
what about dyno always spamming stuff for no reason

dyno would send this, like 20 times a day

isnt it opt-in?
I have consts thank link those up, no worries on that.
lmao
i have dyno in a server and it doesnt do that
so probably something you or someone turned on
btw remember to drink water
no
lol
quick question
i have this:
how can i remove the unnecessary extra bits on the end?
(if i don't respond, please mention)
what extra bits
on both ends, where the text ends, probably around 10 pixels and then the white stops and its blue
if that makes more sense
does anyone work with express-status-monitor?
I am not sure what they mean by
"Monitor can be configured by passing options object into expressMonitor constructor."
Anyone an example how I can access the contructor?
so you want to remove the white background except for around the text?
do what i told you before
Okay so its almost working, I get it to delete the message but it won't send the message, here is the error:
at C:\Users\dargc\Desktop\Coding\betarpbot\index.js:1303:62
at Map.forEach (<anonymous>)
at Client.<anonymous> (C:\Users\dargc\Desktop\Coding\betarpbot\index.js:1303:31)
at Client.emit (events.js:310:20)
at MessageCreateAction.handle (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (C:\Users\dargc\Desktop\Coding\betarpbot\node_modules\ws\lib\event-target.js:125:16)```
Here is the code:
```if(message.author.id === ownerid){
const guildList = client.guilds.cache;
try{
guildList.forEach(guild => guild.message.send(message.content))
}
finally {
await message.delete();
}
}```
try {
let info;
const al = await message.guild.fetchAuditLogs({
limit: 1
});
let auditlog = al.entries.first();
if (
auditlog.action === "MESSAGE_DELETE" &&
message.author.id === auditlog.target.id
) {
if (auditlog.extra.channel.id === message.channel.id) {
info =
"Possibly removed by " +
auditlog.executor.tag +
" (Count = " +
auditlog.extra.count +
")";
} else {
info = "None, possibly has been removed by the author.";
}
} else {
info = "None, possibly has been removed by the author.";
}
//info retorna quíen eliminó el mensaje
} catch (error) {
console.log(error);
}
error(?
function () { [native code] }
I need it to send it to other discord servers however, not just to send the same message over and over.
you would then need to get a channel from each guild
How would I do that? channel.guild?
there is no default channels anymore
the only way is to loop over all channels of each guild and find the first channel that you have permissions to send in
just wondering, how long does approval usually take?
something like guild.channels.cache.find(channel => channel.permissionsFor(client.user).has("SEND_MESSAGE").send())
@nocturne echo 2-3 weeks at the moment
right um... so
any ideas why this is happening? the random whitespace on the side...
width:100%
at Client.<anonymous> (C:\Users\dargc\Desktop\Coding\betarpbot\index.js:1303:36)```
New Code: ```if(message.author.id === ownerid){
const guild = client.guilds.cache;
try{
guild.channels.cache.find(channel => channel.permissionsFor(client.user).has("SEND_MESSAGE").send(message.content.slice(prefix.length).slice(command.length)))
}
finally {
await message.delete();
}
}```
@earnest phoenix same, nothing changes
r u on v11 or v12? @stable nimbus
V12
@digital ibex try position:absolute but be aware that this can cause pain
you removed the forEach
(with width:100%)
kk
it has to be applied to each guild
guild.forEach(bonk => {bonk.channels.cache.(something)}) would work
bonk being the current server
lmao oof
guild.channels.cache.find.forEach(channel => channel
Like this?
Lol
...
.find.forEach is invalid
and makes no sense
you defined guild as client.guilds.cache
meaning guild contains ALL guilds
now you have to loop over all of them, and FOR EACH GUILD, apply that code
ok uh, where the black thing at the bottom is, i do margin-left: 10px; and it goes right a bit, so i change left to right but nothing chnages, it goes back to default
do the following
for the bottom thingy
position:absolute;
bottom:0%;
left:0%;
width:100%;
if it works im glad
lmao
css_hates_me
absolute positioning removes an element from the document flow
web_dev_hates_me
@quartz kindle ik
it becomes "floating"
add the following ```css
transform:translate(0px,100%);
lmao
that should shift it down by itself
you're turning his page into frankenstein's monster
lmao
there we go
just post your html and css
I'm sorry I half know what I'm doing but where would I put it?
my css: css .navbar { position:absolute; bottom:0%; left:0%; width:100%; transform:translate(0px,100%); } and the html: html <div class="container"> <div class="column"> <img class="cat" src="https://vetstreet.brightspotcdn.com/dims4/default/e5cdb1e/2147483647/thumbnail/645x380/quality/90/?url=https%3A%2F%2Fvetstreet-brightspot.s3.amazonaws.com%2F17%2F53%2F446d643647739735401463464158%2FBengal-AP-LQYI02-645sm3614.jpg"> </div> <div class="column about"> <h1 class="about-me">About Me</h1> <p class="text">They say im pretty lost, because im pretty and lost. Pretty Lost<br>About me... I am relatively fluent with JavaScript, and I'm currently learning Python and attempting C++</p> </div> <div class="navbar is-dark"> <div class="navbar-item"> Home </div> </div> </div>
do u need to see more css or?
remove all that css from navbar
kk
what is the css for container?
whats the css it has in the dev tools?
when i remove the css for the navbar, its the same but the ends are blue instead of white
lemme check
it has everything there
What is this error !!
22.06 21:43:36 [Bot] /bot.js:51
22.06 21:43:36 [Bot] const dbl = new DBL(TOP, { webhookAuth: auth, webhookPort: 3000 }, client);
22.06 21:43:36 [Bot] ^
22.06 21:43:36 [Bot] ReferenceError: auth is not defined
22.06 21:43:36 [Bot] at Object.<anonymous> (/bot.js:51:41)
22.06 21:43:36 [Bot] at Module._compile (internal/modules/cjs/loader.js:1133:30)
22.06 21:43:36 [Bot] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
22.06 21:43:36 [Bot] at Module.load (internal/modules/cjs/loader.js:977:32)
22.06 21:43:36 [Bot] at Function.Module._load (internal/modules/cjs/loader.js:877:14)
22.06 21:43:36 [Bot] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
22.06 21:43:36 [Bot] at internal/main/run_main_module.js:18:47
auth is not defined
const DBL = require('dblapi.js');
const client = new Discord.Client();
client.login(TOKEN);
const dbl = new DBL(TOP, { webhookAuth: auth, webhookPort: 3000 }, client);
ooooooh
🤦
how can i find the password .. i'm new developer .. i need help
how can u learn me ?
this is my css: https://hastebin.com/teqatetolo.css
this is the password ?
no
this ?
thats the api key, you put that where you have TOP in your code
@digital ibex i need the css for the container
@celest basin i already told you
in your bot's edit page
click edit
scroll down
until you see webhooks
you put something in Authorization and save it
yes, now you write the password in Authorization
thats the password
nothing in the dev tools either?
nope
then give it width:100% and text-align:center
yes
yes
Thaaaaaaaaaaaaaaanks ♥♥♥
yes
kk
now give your navbar width:100% too
this does:
the code i edited: css .navbar { /* position:absolute; bottom:0%; left:0%; width:100%; transform:translate(0px,100%); */ width: 100%; } .container { width: 100%; text-align: center; } }
oh
how do i uh
check it or something?
kk
also, remove margin-left from cat
and remove padding-left from about-me
and remove margin-left from about
you want to center things, dont you?
never use left/right margin/padding when centering
I've created the 5000 port with "New-NetFirewallRule -DisplayName 'DBLPort' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5000" code in PowerShell but not working i did everything for the votesystem to work.. this is very sad... What can i do something else?
I think i will do votesystem from Glitch, so it will work?
woah!
you always center things using either text-align:center or margin:0 auto
thanks a lot tim!
how would i extend the bottom bit to go all the way?
sorry lol
width:100% like i said above
yeah, i've got that
tf
remove width and margin-left from navbar-item
anyone?
@quartz kindle can u look a sec??
@digital ibex right click on the white part, inspect
show the css
@earnest phoenix look what
I've created the 5000 port with "New-NetFirewallRule -DisplayName 'DBLPort' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5000" code in PowerShell but not working i did everything for the votesystem to work.. this is very sad... What can i do something else?
I think i will do votesystem from Glitch, so it will work?
@quartz kindle This!
is it your home computer? or a server?
wdym
how i can use fetchAuditLogs()?
@quartz kindle server :/
bulma already applies a bunch of flexbox elements, you should use them lmao
did you right click inspect in the white area?
of the navbar
anyone know if i'm allowed to send a message containing guild member count to a channel in the support guild?
the information doesn't contain an invite or nothing too much
alright
Anyone who'd help me with AWS OpenVPN setup? Been trying for hours to get it to work with no success... it'd be easier on a normal VPS 
vote.id mean the id of the member who voted ?
yes
thanks
so just number
yp
igotchu
which hosting company is your server?
@quartz kindle If you're talking to me, Microsoft Azure, lol.
mine is self hosttted
why this code not work ?
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
client.guilds.cache.get('ID').channels.cache.get('ID').send(`User with ID ${vote.user} just voted!`)
vote.send(`**We thank you for your vote**`)
});
i think yp
hmmmm
this
const dbl = new DBL(TOP, { webhookAuth: Pass, webhookPort: 3000 }, client);
Lol
i believe top.gg webhooks are actual webhooks - one which require a webserver. i think
@earnest phoenix did you do this? https://docs.microsoft.com/en-us/azure/virtual-machines/windows/nsg-quickstart-portal
i'm use pebblehost
@digital ibex dblapi.js creates a webserver for you
how can i create web server
@quartz kindle I can't understand that, my english isn't good for that :/
@celest basin does that host give you a public IP address and port?
or a public url?
@digital ibex so when you right click and inspect on that small white area, the dev tools opens the column class? if you hover your mouse over the column class does it get highlighted in the page?
show the highlighted column
yeah, kk
How do I update the bots status on the page?
@celest basin so you need to put that ip address and port in your top.gg edit page
in webhooks URL
How do I update the bots status on the page?
whats your bot's id ?
Why
@digital ibex scroll down, does the highlight overlap the navbar?
@earnest phoenix if it shows ??? it means the bot is not in this server
lemme check
so it was either kicked or banned
you can check that with the bot's id, thats why i asked
@quartz kindle http://147.135.160.192:8099/dblwebhook
nope
what can i do by this ?
oh ok
@digital ibex now inspect the navbar, and highlight it
Does someone happen to have experience with hbs?
the container seems to have padding or margins
and the navbar seems to not even be inside it
manual css oof
do you still have absolute position or float somewhere?
any error here
i'm use discord 12
setInterval(() => {
dbl.postStats(client.guilds.cache.size, client.shards.Id, client.shards.total);
}, 1800000);
lemme double check
cache
you dont need to use postStats
dblapi.js does it for you if you give it your client
i don't think so, this is it: https://hastebin.com/gareruyoku.css
check it in the dev tools
click on the navbar and check the css section
also click on the container and check the css for the container
okay uh I got a weird bug
I am dev'ing a bot that uses the Spotify API
and I can't seem to get it to work for me
but just me, every one else is fine
(just came here from general)
wym by "click on the navbar and check the css section"
yeah, I have a command that displays the spotify thing
like... song title and album titleor whatever
and it works fine for anyone but me
o ok
print something in- oh cool 👍
click on container and show the css
container has max-width:960px
you will need to either override it with your own, or move the navbar to outside of the container
if the parent has text-align:center, all chilren will be centered as long as they are inline-type elements, aka, display:inline and display:inline-block
if the element is a block type, ie: display:block, you can give it margin:0 auto, and it will try to center itself by setting automatic margins
there are other types of elements, for example flexbox (display:flex) which have different rules
bulma uses flexboxes, you can see in its css
oki
I've taken too long of a break from coding, I forget, which is the correct way of writing this?
module.exports = (client, guild) = {}
module.exports = client, guild => {}```
I cant remeber how to use multiple scopes
LMAO
wait I dont need to pass that
nvm
how do we make a top example 10/500 with enmap
Hay something is wrong when i try to connect my github to heroku
Ok ill try that
Nope @earnest phoenix
Didnt work
Yes
how do we make a top example 10th out of 500 with enmap
let usermention = message.mentions.users.first() || message.author
let messages = client.messages.get(`${message.guild.id}-${usermention.id}`, "messages")
let topFetch = client.messages.map((g) => g.user)
let top = topFetch.indexOf(usermention.id)+1```
I tested like this but it tells me the number of members in the data and not my ranking
how do i get it to where i can see how many servers my discord bot is in by coding it
what language?
English
lmao
ohhhh visual studio code
thats an editor not a language
which guide are you following?
um? I am so sorry i don't understand what you mean
are you following a guide or a tutorial?
i mean it's most likely C#, am I right?
how did you start to code?
?
explain which steps did you make until now
non i have the coding all done the bot on 24/7 i just want a code to where it shows like how many servers my bot is in
did someone code it for you?
so it's not your bot
no it my bot
did you code it?
yes
but then you would know what language it is
which language did you code it in?
so... javascript
sure
we will go with javascript
so in discord.js you would count the number of guilds in your guild cache
client.guilds.cache.size
um ok? i just put that in the editor then thats it?
assuming your discord.js is version v12+
yes
no, you need to code a command that uses said code
did you really code your other commands?
you just made a complete discord bot and dont know how to implement a line?
YES
then do the same thing
the same way you coded any other command, code a new command, and make it output the result of client.guilds.cache.size
i do my codes this way tho
then keep doing the same thing
So, im using oauth2 and going through guilds from the user, but when i loop through it it gives me 1 guild then an empty one then another rinse and repeat
Also how do i get a command to like have a timmer on it like this btw i am not copieing that i am just trying to do a command and i want a timmer on it like that
you can use setTimeout() to create timers
but you need to keep track of their state, to avoid creating multiple timers on the same thing
ok
so you need to store timer data in an object or similar
and if you need your timers to survive bot restarts, you will need a database
hey tim can we go into a voice chat so i can understand better
@earnest phoenix you need to do this
how do you reference/require a json file from an upper directory in nodejs
But why? https://kyoya.why-am-i-he.re/TgcWCI
sxcu.net free ShareX uploader
I'm on v11
whatever you tried to use hasPermission on is null
permLevel
if (!msg.member.hasPermission('ADMINISTRATOR')){
//...
}
}```
Like this.
msg.member is null in dms
and can also be null in some situations, like webhooks or system messages
I see
if (!message.member) message.member = await message.guild.fetchMember(message.author.id) 200 IQ
Restarting is 1 thing, but did you deploy the latest version of the branch?
Does anyone know how to make it so you can use the same commands?
for example if(command === "blabla")
and then again somewhere
does anyone know how to get the number of servers your bot is currently in with discord.js?
can someone do a help command by emogis???
on the current version client.guilds.size doesn't exist
"what language did you code in" -> "index.js" 200iq
bot.js
@earnest phoenix client.guilds.cache.size
thank you so much
@royal portal I don't understand what you mean. Could you elaborate?
so lets say you want
a command
if(command === "hello")
and you have if guild not this then return
but then if you want it for another guild, i'd have to do if(command === "hello") again
so it would be something like
if(command === "hello")
if (!['1552918491221309123'].includes(message.guild.id)) return;
}
if(command === "hello")
if (!['12321321321412412'].includes(message.guild.id)) return;
}
You could have it under the same if block. If you wanted to have two separate blocks for some reason, you'd just not use return
For example: ```js
if (command === "hello") {
let guilds = [first, second, third, ...others]
if (guilds.includes(message.guild.id)) {
// Do stuff...
} // If you want to return here, you can just add an else { return; }
}```
im trying to make it so if someone says -hello in guild 1, it will say hello1
and if they say -hello in guild 2, it will say hello2
It's still possible to do that under a single if block, or you could use a second one if that's what you want to do. It's just a matter of condition checking and not using return.
you mean guild specific commands?
yes
you need to check the guild id and respond with some predefined response
for example, make an object of responses mapped by guild id
and then send(responses[message.guild.id])
let responses = {
"2794823422":"hello1",
"3o48573085":"hello2"
}
...
message.channel.send(responses[message.guild.id])
might as well give up
i tried to make it so people can talk from one server to another
but it doesnt work if the command names are the same
it works if i have another client.on
i'll just use it that way
just check if the user is the bot user, and check against IDs
huh
Depends on your issue where you run across command names being the same
is your prefix different?
I've seen a bot do this.
But it was something you initiated with a command, and ended later with a command
-talktorandomserver
Then when another person did it in another server aswell.
Copy messages from the first server into the second server, and the other way around.
When no one talks for a bit, or someone ends it, end it.
@royal portal you want servers to talk to each other? thats a completely different thing
i neeeeeed help
23.06 00:59:03 [Bot] User with ID 684135218537431055 just voted!
23.06 00:59:03 [Bot] /bot.js:71
23.06 00:59:03 [Bot] member.send(`**We thank you for your vote
23.06 00:59:03 [Bot] ^
23.06 00:59:03 [Bot] TypeError: Cannot read property 'send' of undefined
23.06 00:59:03 [Bot] at DBLWebhook.<anonymous> (/bot.js:71:12)
23.06 00:59:03 [Bot] at DBLWebhook.emit (events.js:310:20)
23.06 00:59:03 [Bot] at IncomingMessage.<anonymous> (/node_modules/dblapi.js/src/webhook.js:83:16)
23.06 00:59:03 [Bot] at IncomingMessage.emit (events.js:322:22)
23.06 00:59:03 [Bot] at endReadableNT (_stream_readable.js:1187:12)
23.06 00:59:03 [Bot] at processTicksAndRejections (internal/process/task_queues.js:84:21)
how can i fix it ?
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
let member = client.users.cache.get(vote.id)
if(!member) return
member.send(`**We thank you for your vote**`)
});
I havent looked at the api much.
But your logging vote.user and its giving the id of the user.
But then you use vote.id.
Wouldn't vote.user give the id you want?
anyone know any free domains lol?
Freenom
hm, can you link me to it please
can i use vote.user.send ?
try it
^
↑
lol
😕
getUser(vote.user).send
woo, can you link me to freenom. can't find any anywhere
vote.user is an ID of the user who voted
i will try
How hard did you try?
i go to free and paid, and under the free i have to pay 80p lol
no error and spelling problems?
let user = client.users.cache.get(vote.user)
user.send
@slender thistle
this is right ?
😦
hm, you know why some are unavailable?
hmm i don't have a much trying to vote ! :(
lmao
😂

what
lmao

on what website do you see those?
I see, thanks
Although 99.9999999999995% of domains will give u an "unavailable" error
how to host a website on my pc ?
Use some webserver like tomcat or glassfish
Note that the website won't be available if you turn off your pc
or a node.js express
yhea, like on my pc
Exactly, the options above allow sites to be hosted in ur pc
if you want a domain name, yes
otherwise, you can use a subdomain service, or a dynamic dns
i think im just gonna host bot on my p
or even your ip address
c
It'll be ur public ip
vpn
@sudden sail I'm here 99% of the time in this channel helping or watching
Vpn has nothing to do with hosting lol
yea I see you have some activity here tbf
you can i guess
but your website will be changing ip's as fast as your vpn
you could link it to a dynamic dns service for auto-updating its dns
that way you could keep a domain name working even while changing ips
you'd still have client side dns caching so that's not the smartest idea
browsers do dns caching and some routers do
well, the ddns service could use dns redirection or something
so the client would cache the ddns service
what do i do in
I mean can't you use a VPS service and then a VPN service
node.js command promt
the error still stay
what do i do in node.js command promt
Nodejs isn't a command prompt 
I got a vps, and I only need 500mb of ram, and I got 1GB of ram
No no, node.js is a js framework
wait so is that thing i downloaded
a virus..
it was
in
install additonal tools for node.js
if so dont worry
i got webrot
webroot*
Like, the site is literally nodejs
yes i downloaded that
i downloaded it
No when i downlloaded it
is there suppose to be additional tools for node.js
why is their........
python
Idk, but python is handy to have in ur pc
Is anybody like extremely good at d.js I mean like really really good at it
Like offers paid jobs good
First - not the place to ask that
Second - there's no "extremely good", the difference is knowing how to google properly
yeah I get the 2nd one but where is the place to ask
Try fiverr or freelancer
frick
?
But I want them to add something into my code not make something
Like offers paid jobs good
@obtuse jolt the answer to this are those sites
About the "add stuff in my code", it's a bit trickier
Also, probably more expensive depending on ur code complexity
My code is literally spaghetti
Sometimes I even forget where things are
That’s really saying something
oof
Thing is, having to understand people's code involves reading it and finding out how it works, which costs more development time and making the budged fly up a bit
Try those two sites, they aren't only for ground up projects, you can also ask for implementations
I mean I’m trying to see if anybody can create my bot a queue system because the api I’m using has a strict rate limit
And I have no idea how
And it’s either that or pay €15k a year
How
Tho
Because it’s like queuing up file scanning and url scanning and url shrinking
And lots of other stuff
In js
Make a recurring event (aka timer or cronjob) which checks for queue entries
how
tf
I’m so bad at this stuff
I can do like databases and stuff but queueing things
Like, every X seconds it gets the head element of the collection, if it exists - execute - else it sleeps until next call
For example (not copypaste):

there are entire libraries for queues too
or put each job in an array, when one ends, do the next thing in the array, when its done, remove it.
then repeat
let queue = [];
setInterval(() => {
if (queue[0]) {
queue[0].execute();
remove queue[0];
}
}, 5000);
^
What confuses me is like
Note that idfk how collections work in js
the order?
Collections will do that for u
And then get the positions
If you take index 0 the whole collection will move 1 index back
In my example i used an array because idk how collections work in js
Bro I will so break my bot doing that
Programming is breaking then fixing it back
Read that
After 25 I’ll start making timed automated backups
its also extremely frustrating for users to lose data
I make a backup each day, at the end of the month I compress all backups and send it to me and my devs
But here’s the thing my bot handles like files and actually has to like sandbox and like 1 slip could duck me over SO bad
why do that to yourself
Just a question

Is it a json db?
It’s a security bot
WHY
It scans files and URLs for viruses
Yes

json aint that bad if you use it correctly
also
that's really good
But to use a queue surely my idea of doing it would be to use json to store queue ids and their file locations and what they actually have to do
I actually haven’t experienced any issues so far
Other then cleansing my own databases
A lot
cleansing?
@quartz kindle aka wiping out everything

ok



