#development
1 messages · Page 1213 of 1
go dms
<html>
<head>
</head>
<body>
<style>
body{
background-image: url("https://images.app.goo.gl/56jXM17CEnESWa927");
}
</style>
</body>
</html>
do that
you dont have body defined in ur file
or the style tag is above the body tag
so it doesnt work as it says it doesnt exist
@steep shale
new ubuntu vps cant install anything from apt, running v18.10
im root
send ss of error
witherhosting
^yeah what he said
release: 18.10
Yo so I made my bot’s background image as this, but how am I supposed to have all those dark letters pop out? Like be white
Cause the name of the bot and the bot tags and stuff are all non-seeable
inspect element
css
sorry what
What command do I put on my bot so that he can play music from YouTube?
depends how you wanna do it
what lib
discor dpy
I want to be like the rithym I want my bot to play music@misty sigil
its for reddit images
@earnest phoenix is this your first project?
firstly lean py
its very hard
music isnt easy
- learn js
- die of old age
- make an OS
@earnest phoenix is this your first project?
@misty sigil
Yes
you need to
1 - fetch the video (use ytdl)
2 - join the channel
3 - play the video (play ytdl video via ffmpeg)
4 - leave the channel when it ends
it takes hundreds of lines of code
Thank YOU
and not something that you wanna be doing as a beginner
does ffmpeg take a stream or an mp3?
either or
epic
Hum
no you cant edit vids
no
image property on the payload
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
depends on your library
?
embed payload contains image
wrong link, my bad
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
insinde image you can use url
you CAN, but you cant
@opal plank heh time to can
its undocumented and would get you intro trouble
at least for production
there shouldnt be any problems doing it for research only
It depends
You need to somehow fetch stuff from reddit
Maybe there's something on pip
im using praw
alr
no you cant edit vids
@misty sigil
you can, ffmpeg is often used for video manipulation
TypeError: set_image() takes 1 positional argument but 2 were given
wut does it take in?
see the docs for your lib
0exe, a url of an image
What RegEXP expression would I need to get the first mentioned channel in a message?
those are probably already provided in the message object
url = submission.url
embed = discord.Embed(
colour = discord.Colour.red()
)
embed.set_footer(text=f"memes")
embed.set_image(url='url')
await channel.send(embed=embed)
check up your lib docs
I have @earnest phoenix
it just doesnt make sense
message.mentions._channels is always null
like i have the link
and it works without the embed
how can i add the image into the embed?
it's just . channels
where did you get the underscore from
How do I convert a picture into a link?
upload it to an image host
Yeah I tried a lot of links
ok so im making a grafana graph, and i want to graph stuff like guild count and stuff, from a JSON array in postgresql the array looks like this [{"guildCount":0,"cpuUsage":49,"memUsage":70,"ping":58},{"guildCount":0,"cpuUsage":49,"memUsage":69,"ping":59},{"guildCount":2,"cpuUsage":49,"memUsage":69,"ping":58},{"guildCount":1,"cpuUsage":49,"memUsage":71,"ping":58}]
and i want to aggregate all of those together, but i cant seem to do it in raw SQL, can anyone help me?
How do I add commands to my bot? i'm new to bots and setting them up
how tf do i embed imagesss
both of you what library
py
@earnest phoenix see:
oh
how to get error's path? for example im doing:
message.member.roles.add("...")
and if the bot doesnt have permissions it will say in the console "Missing Permissions" and the path to the library where its saying the error, but i want to know the path of the line, for example:
.../server.js:32:24
message.member.roles.add("...")
how to do it?
message.member.roles.add("...").catch(e => console.log(e));
@earnest phoenix You can catch stuff, maybe this will output better informations. If not, then you can extend it and just let it output some unique response:
message.member.roles.add("...").catch(e => console.log('Something unique, this is line 1234', e));
catching it also lets your bot react directly on the given error.
message.channel.send('No permissions');
}```
But i have many functions like that, it can take alot of time to add "catch" to all of them
Im searching for a better way
Eh, maybe wrapping some of your stuff in try { ... } catch(e) { ... } blocks will help you
i'm trying to creat a bot for my discord server but the discription will not exept
how i embed image
NvM
i'm trying to creat a bot for my discord server but the discription will not exept
??
same it just timed out for me
So basically this name for the bot on my list, is dark asf
That isn’t good for when people want to see the name of the bot
Im using css for this too
the discription won't exept and i've tryed everthing
If anyone replies ping
ping
console.log(x).catch(e => {
console.log("ERROR")
return
})
``` this just returns an error instead of the console.log
im talkinga bout the catch statement btw x is undefined to throw the error
Question, is there a type of ‘or’ statement in js? Like
‘If this === this or that’
Without having to create a million else if statements?
Sweet thanks
you'll have to do the equality check again after or though
message.author.id === id1 || id2
message.author.id === id1 || message.author.id === id2
correct
the interpreter isn't smart enough to figure out what you want so you have to exactly say what to compare it against
are there any erros with these?
url = submission.url
embed = discord.Embed(
colour = discord.Colour.red()
)
embed.set_footer(text=f"memes")
embed.set_image(url=submission.url)
await channel.send(embed=embed)
What happens if I remove the LICENSE of my GitHub repostory
the license file is gone
mind-blowing
your code will not be under a license anymore and anyone can do anything they want with it
Does the license protect my source code with anything ?
... it's a license
what else would it do other than license your code
if someone violates your license you can take legal action against them
aaaaa k
thx
client.on("guildMemberAdd",member=>{
console.log(member)
if(member.guild.id!="517265128647950347")return
var guild=member.guild
var channel=client.channels.cache.get("751211614698471455")
channel.edit("Server Members: "+guild.memberCount)
})
client.on("guildMemberRemove",member=>{
console.log(member)
if(member.guild.id!="517265128647950347")return
var guild=member.guild
var channel=client.channels.cache.get("751211614698471455")
channel.edit("Server Members: "+guild.memberCount)
})
these should work right?
the event is being caught the console.log never happens
Aight im here
This is the code if you need ```css
<html>
<head>
</head>
<body>
<style>
body{
background-image: url("https://media.discordapp.net/attachments/714045415707770900/751215657827303495/image0.jpg");
color: darkred !important;
}
</style>
</body>
your code will not be under a license anymore and anyone can do anything they want with it
@earnest phoenix on the choosealicense site, they say not choosing a license means no one can use it
<html>
<head>
</head>
<body>
<style>
body{
background-image: url("https://media.discordapp.net/attachments/714045415707770900/751215657827303495/image0.jpg");
position: relative;
....
``` right
Yep
Nah nothing
But ill recommend add a landscape image
How?
so that it looks better on pc
Is not a how
Just find a image that looks like pc wallpaper
why are you using that picture anyways
Why not?
any text on it is unreadable and it's ugly for web design
Also the low resolution will make the image repeats
yes, yes it does
The desc text eww
choose a repeating svg pattern if you want a fancy background, check out heropatterns
Heropatterns?
You maybe can cosider change the image for a solid color
whats the best hoster?
talking abaut web desing
how my web looks? (ignore blue text, that should be black but im lazy to change css)
i see so many launching soon pages that i hate them
Looks nice
so many sites use particlejs and that exact layout it's not fun to look at anymore
never seen a site use that layout tbf
atleast any sites that i know of
a lot of devs will use it for their portfolio / about me site
u have a site?
i dont
alr
eh idk i just went w something easy and not time consuming
never had the need to, still in school so can't make a CV :p
yeah understandable
took like 20 mins
dont get me wrong it's a nice design, it's just very generic
yyhy igu
Is there any bot that mute people that switching voice channels to fast?
As you surely know, some people entering and leaving vc channels in very quick succession in a short period of time. Discord plays a sound every time someone leaves/joins vc channels and doing it very quickly can be irritating for users already in the vc channels. The bot registers this behavior as spamming and auto-mutes users found to be doing it.
never seen a bot like that, but you can easily turn off discord sounds in the settings
@quartz kindle Would it be hard to code a bot that has this feature?
can anyoine help with embeding images from links? its for praw (discord py)
Or require a lot of resources?
shouldnt be too hard
Im wondering because I cannot find a single bot that has this feature.
you'd need to listen to the voiceStateUpdate event
compare the states to determine if the user joined or left, then have a counter that counts how many times the same user did it in less than X amount of time
nope
no
js uses either console.log or process.stdout.write
Whats the classes for these?
I want to change the color of those boxes from white to whatever I choose
<html>
<head>
</head>
<body>
<style>
*{
color: lightgray !important;
}
body {
background-image: url("https://i.imgur.com/nwV0SBe.jpg");
color: gray !important;
}
span {
color: black !important;
}
.btn-orange {
background: darkred !important;
}
</style>
</body>
</html>``` this is what I have so far
god damn bro
Use py or js
C# looks overkill
If anyone can help with this -> #development message
Use py or js
@steep shale i literally have 98% done
too late now
Honestly c# is not widely used for discord bots, I’d try to find a specific server for it
@fleet hornet the api's discord if full of assholes
@sudden tulip convert ctx.Member.Id to a string
@steep shale the class is called "botpagebutton"
it doesnt do anything when I tried
@fleet hornet discord.js has internal sharding, which you can enable using shards:"auto" in your client options
or the sharding manager if you want to multi-process
<html>
<head>
</head>
<body>
<style>
*{
color: lightgray !important;
}
body {
background-image: url("https://i.imgur.com/nwV0SBe.jpg");
color: gray !important;
}
span {
color: white !important;
}
.btn-orange {
background: darkred !important;
}
report.botpagebutton {
color: darkred !important;
}
</style>
</body>``` I’m confused
I want to change all of those white boxes to a different color
so change the background color
Alr
just curious, are you on a phone rn?
on a desktop you have access to ctrl + shift + i
you can easily find the class names yourself, make changes to their styles, etc
prefix box has no class
bot tags -> .atag
long desc -> .content
prefix box has no class
Seriously?
And thanks Ima change them rn
How can I set this so its like 50% visible 50% transparent
If that makes sense
specify the alpha property as well
Wdym
rgb: #ff0000
rgba: #ff000080
opacity: # right
.content {
color: black !important;
background: darkred !important;
opacity: 0.3;
}```thought I did change the color
you changed the opacity right there
hola alguien me dice como configurar DSL en mi server para que suba publicidad y me paguen??
Hello, someone tells me how to configure DSL on my server to upload advertising and get paid?
is there a way to make your bot set stats to listening and have a song its listening to show up?
like how a bot can stream a url
can a bot listen to something on spotify?
no iirc
rgb:
#ff0000
rgba:#ff000080
Do I just put a hex code and thats it?
like #420000
Thats dark red
add the alpha part
oh alright
Is 80 the max?
like 80 means no opacity at all
Nvm it doesnt change anything
anyone know if there is an actual way to get your bot to be "listening to" a song or something?
.content {
color: black !important;
background: darkred !important;
rgb: #420000;
rgba: #42000010;
}``` that didn’t switch the opacity
no it's just a placeholder
if bots can stream a url then they should be able to have a listening to url
So color: #420000
if anyone knows how ping me
ik we were allowed to before, like a long time ago like years ago, but can we use scripts in our bot descriptions?
.content {
color: black !important;
background: darkred !important;
rgb: #420000;
rgba: #42000080;
}``` Im confused @sonic lodge
no you need to change the color or background property and relace black or darkred with the color code
should i switch from d.js to eris?
if you want
...
@west skiff you need to be a certified dev to use scripts
aw thats why i could before
ok thats sad but also im not gonna try to get recertified im sure its a nightmare now too
.content {
color: #420000 !important;
background: #420000 !important;
rgb: #420000;
rgba: #42000080;
}```
i dont even think they have apps open
its still so weird how big this server got
i think i literally just talked to an admin and they were like sure when I got certified
they mightve messed around with my bot more first or something but that was it I think
you aren't certified anymore?
anyway ignore me acting like an old person
no that was like in 2016 and then my bot went offline for like 6 months and i unsuprisingly lost it
oof
yea
.content {
color: #420000 !important;
background: #420000 !important;
rgb: #420000;
rgba: #42000080;
}``` this would be fine right?
Or close
well you probably want the text color and background to be different im assuming but it's way closer!
Yeah gimme a sec to give an example of what I want
Thats the example, like the white color is fading out
ok so the color code for that would be something like #ffffffc8
and then the text in front is just black or dark grey
So like css .content { color: #420000 !important; background: #420000c8 !important; }
.addField("__Activity__: ", person.presence.activities || "None")
it says it cannot send empty fields
so you're trying to send an embed that has an empty field
building a discord music bot, but how to make it seek to a point in the current playing song?
using discord.js / opus && ytdl-core
#prefix is the id but its also a code block
i think the class is .color-blue but im 100% sure
class of the prefix is a .color-blie?
Is that what it shows on pc
ctrl + shift + i
or code (in inspect window):
<span class="color-blue" id="prefix">
<code>f! (customizable)</code>
</span>
Alr so its css color-blue { ... then
anyways... does anyone know how to do a seek command in discord.js? (with opus and ytdl-core)
I can do time conversions if needed, but how to implement it? i.e. queue.connection.dispatcher.seek is not a function.
I want it to work like
!seek 0:35
How am I supposed to change the color of this prefix box?
I tried css .color-blue { color: white !important; background: #420000c8; } but that didn’t do anything
do you have code blocks in your description?
no why would I do that
okay. so then try
code {
color: white !important;
background: #420000c8;
}
see if that works
Alr
hi
if (bot.on("message", function(message){}))
counter++;
console.log(counter);
if (bot.on("message", function(message){}))
counter++
console.log(counter)
if (bot.on("message", function(message){}))
counter++
console.log(counter)
if(counter % 3 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet`);
}
console.log(counter);
so this is my code
where every 3 messages 'yeet' gets sent
np
but then it only gets sent when a command
is executed
how do i make it so that the message is given after any 3 messages
plz help
when a message is sent, increment a counter; when the counter reaches 3, send your message
var counter = 0;
bot.on("message", function(message) {
counter++;
if(counter % 3 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet`);
}
});
when a message is sent, increment a counter; when the counter reaches 3, send your message
@sonic lodge thats what i did
wat
this doesn't make sense
if (bot.on("message", function(message){}))```
in discord.js, an on message event only needs to be written once, rather than written for each time you want something to happen.
i wanna depthen my knowledge over computer science and programming. does anyone have any suggestions for the sites or apps to download for that?
ok thnx it workss
its essentially a function that is called whenever a message is sent; NP
idk if that would count as spoonfeeding but eh
um does anyone have insight for my question?
hi again
let counter = 0;
bot.on("message", function(message) {
if (message.author.bot) {return}
else {
counter++;
if(counter % 7 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet the feet`);
}
}
});
btw i made it this and now it isnt even working
lol
"yeet the feet"
do you have two on message functions now? or just one, just edited
no just one
hmmm
you should only have one overall
what
ok yea i will do that
im just testing it seperatley
*separetly
so when im done
i can add it back
any idea why the ping is not converting? i have another embed where it works just like that (by putting the id within <@ >)
rip my spelling btw
lol
it doesnt convert in embeds
you cant ping someone from an embed
not ping, but at least the link
you can have mentions though
ive seen it before...
it is working in my own code at another place^^
message.author.tag?
ie js .addField(`${message.author.tag} you gained ${points}`)
try this... not much different. if this doesnt work, ill try something new
let counter = 0;
bot.on("message", function(message) {
if (message.author.bot) return;
counter++;
if(counter % 7 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet the feet`);
}
});
is it supposed to be counter % 7
just if(counter % 7) ? Dont think so
no, i meant did he mean that condition, or was it still supposed to be counter % 3
i think he meant that condition
@vale garden how many messages are you sending
@tacit stag also not working
hi
huh...
lol nvm
it was working
lmao
but btw
does anyone know
how i can make a command that only gets executed if a certain message is typed above
basically the yeet message from my bot
@viral spade the only possible problem i can think of with <@id> is that there was a zero-width space somewhere
if(message.content == "custom_message_here") {
bot.channels.cache.get(`718760245014298654`).send(`yeet the feet`);
}```
kk thnx
a lot
wait what
no thats not what i meant
i need to know
if i can make a command which only excutes if the "yeet" message if above
somewhere
youre asking if a command is typed, then send the yeet message?
or if the yeet message happens, do something else?
okay the mention only works in a Fields description field
you could just do
let counter = 0;
bot.on("message", function(message) {
if (message.author.bot) return;
counter++;
if(counter % 7 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet the feet`)
.then(function() {
//Do something new here!
});
}
});
np
hi im back again
let counter = 0;
bot.on("message", function(message) {
if (message.author.bot) return;
counter++;
if(counter % 33 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet the feet`)
.then(function() {
if (args[0] === "yeeet"){
message.channel.send("You have been yeeeeeted")
}
});
}
})
this is
working
weirdly
im confused
uh
Uh hi?😭💀
Lmao
when you scroll using the mousewheel on another tab, do you lose focus from the original tab?
question
let counter = 0;
let prefix = "t!";
bot.on("message", function(message) {
if (message.author.bot) return;
counter++;
if(counter % 33 === 0){
bot.channels.cache.get(`718760245014298654`).send(`yeet the feet`)
}
if(!message.content.startsWith(prefix)) return;
let messageArray = message.content.split("")
.filter((el) => el !== ""); //finds the args and removes extra spaces
let command = messageArray(0);
let args = messageArray.slice(1);
if(args[0] == "yeeet") {
if(counter % 33 === 0) {
message.channel.send("You have been yeeeeeted");
}
}
})```
something like this?
can i get help
Send here
const { client } = require('dsicrod.js');
const client = new client();
client.login(process.env.BOT_TOKEN);
client.on('ready', () => console.log(` ${client.user.tag} has logged in.`));
const usersmap = new Map();
/*
'id' => {
msgCount: 0,
lastMessage: 'message',
timer: fn()
}
*/
client.on('message', message => {
if(message.author.bot) return;
if(usersmap.has(message.author.id)) {
const userData = userMap.get(message.author.id);
const msgCount = userData.msgCount;
if(parseInt(msgCount) === 3) {
const role = message.guild.roles.cache.get('738731627412193371');
message.member.roles.add(role);
message.channel.send('You have been muted.');
}
} else {
msgCount++;
userData.msgcount = msgcount;
usersmap.set(message.author.id, userData);
}
}
else {
userMap.set(message.author.id, {
msgCount: 1,
lastMessage: message,
timer: null
});
setTimeout(() => {
usersMap.delete(message.author.id)
console.log('Removed from map.');
}, 5000);
}
});```
could you either condense it, or put it in block quotes? kinda hard to read ngl
off this vid : https://www.youtube.com/watch?v=xzMiszeTEiI
Learn JavaScript: https://www.youtube.com/playlist?list=PL_cUvD4qzbkzrpH8det0pvoT_Oxu1JV34
Programming Discord Server: http://discord.gg/bZSwjPy
GitHub: http://github.com/ansonfoong
Add 3 ` on beginning and 3 end
oh uh question
there
if i restart my bot, is there a way I can disconnect it from all of the voice channels it is connected in when i take it down?
idk i think so
or at least get all of the connections on ready? for some reason when i restart it, it stays in the voice channel, and i'd like it to leave before restart...
u dont need dotenv
you do for JS
you need https://npmjs.org/package/dotenv
and then run require('dotenv').config() at the start of your script
and then all you variables will be in process.env
is there a reason why people use .env over json files
Is there any specific way bots reward users for upvoting their bot on top.gg?
Like do the bots store the users in db to know or how does it really work ? 👀
How to see on which number of shards is the server
number of servers in a shard*
ah
which shard the server is in?
guild#shard iirc
try guild#shard#id
look up shardingmanager
wait, so I started a server like this: https://i.imgur.com/ix7Ofim.png
but accessing http://my.ip:8000 grants nothing, i can't see any connection attempts in my console.
is there a firewall or something
@delicate zephyr ree environment config bad
shut up skull. Your opinion is objective stop reeing at me for it
it's all fun and games til we share machine
and then i put in a little... $BOT_TOKEN
Shame you're never gonna share a machine with me
I wanna make something like this
t=turtle
t=turtle.Pen()
t.shape('turtle')
t.color('blue')
t.stamp()
move=20
for i in range (11):
t.penup()
t.forward(50)
t.pendown()
t.forward(25)
t.penup()
t.forward(15)
t.stamp()
t.home()
t.right(move)
move=move+20```
This doesn't work tho
@fathom topaz :(
@crystal socket you’re running on localhost
Meaning you can only access the (I think is aiohttp) server through the local interface
If you want it to be publicly open (don’t do that, use a load balancer like nginx)
Make it bind to 0.0.0.0
And not localhost
why is it bad if my IP address is LEAKED
And I will eat it
I want to track the server count daily for my bots, but I have no idea how to make a graph to track it. Could someone please help me setting it up?
I’m thinking of using auth with my discord bot to fetch global guild counts and other stuff, Except I don’t know what to do first, I’d assume I need to give my bot scopes etc, But what would I do then? I’d guess id make a “auth.json” and require it, And shove something like this in auth.json (On a phone and don’t have code blocks, sorry)
{
client_id: 'bot id',
client_secret: 'client secret',
grant_type: 'authorization_code',
redirect_uri: 'redirect url with permissions api calculator or smthin',
scope: 'the scopes',
}
but like json formation, could someone explain setting up auth to me please, or give a link to a guide or something, I’m thinking of using auth with my discord bot to fetch global guild counts and other stuff, Except I don’t know what to do first, I’d assume I need to give my bot scopes etc, But what would I do then? I’d guess id make a “auth.json” and require it, And shove something like this in auth.json (On a phone and don’t have code blocks, sorry)
{
client_id: 'bot id',
client_secret: 'client secret',
grant_type: 'authorization_code',
redirect_uri: 'redirect url with permissions api calculator or smthin',
scope: 'the scopes',
}
but like json formation, could someone explain setting up auth to me please? That would be greatly appreciated
@still merlin JSON requires ", ' doesn't work
hi
You need to make a post request to the discord API to get an auth code, then use the auth code to get the other info
Hu
What are you trying to do
im egtting this error
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guild' of undefined
im trying to find the users guild name
authord doesnt have guild
authors (users) don-
wat
Okay I'm going to leave this channel
nope, you didn't
what do u want the code to do
Yes but do I need a auth.json file and stuff?
it's message.member.guild @vale garden
ok wait nvm
member not author
do yall use js bruh
author is User, member is guildMember
I’m really confused about Auth, I can’t find any helpful documents on auth that work, Does anyone know any that are good?
Trying to get the lastMessage of a user in that server, but it's showing as null. Here's my code:
let id = message.content.split('')[1].replace(/[\<>@#&!]/g, ""); // User object of person @'ed.
let user = message.guild.member(id); // GuildMember object so I can get lastmessage
That’s because the tester hasn’t sent a message recently I think
lastMessageID is not guaranteed to have a value
No the person sent a message like 100 times
Only works when @'ing myself
Otherwise it's null

As googleFued said, It doesn’t always have a value
Can anyone let me know what's wrong with my code
const { MessageEmbed } = require("discord.js");
const { Client, Collection } = require("discord.js");
module.exports = {
name: "serverlist",
aliases: ["serverlist"],
description: "Display bot's joined servers count",
execute(message) {
let commands = message.client.commands.array();
let ServerEmbed = new MessageEmbed()
.setTitle("Servers Count")
.setDescription("List of all commands")
.setColor("#F8AA2A");
.addFields('**SERVERS - ** ${client.guilds.cache.size}')
.addFields('**MEMBERS - ** ${client.users.cache.size} ')
ServerEmbed.setTimestamp();
return message.channel.send(ServerEmbed).catch(console.error);
}
};
//err
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
wth
@still merlin what decides whether or not it gets a value?
Error on line: .addFields('**SERVERS - ** ${client.guilds.cache.size}')
Syntax Error: Unexpected Token
You need to use array with addFields
oh
someone help plz
If you want to do just one field,
.addField(‘title’, ‘description’)
.addFields(
{ name: '**SERVERS - **', value: '${client.guilds.cache.size}', inline: true },
{ name: '**MEMBERS - **', value: '${client.users.cache.size}', inline: true },
)
is that fine?
//err
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
@vale garden Its nothing to do with your note, As the error said, “send is undefined”, we need code to help you
That should work, Mursaleen
`C:\Users\Mursaleen\Downloads\Compressed\mybot\commands\serverlist.js:14
.addFields(
^
SyntaxError: Unexpected token '.'`
Try “embedName”.addFields
Since lastMessage returns null, is there another alternative to finding the date of the "latest message" of a user?
Alright
I don’t think so, CarrotTheFish
It worked @still merlin Thanks a lot ❤️
Your welcome :)
Hmm. Prune feature in discord ignores lurkers, so I need a command that can detect non-prunable lurkers
use the back tidldie string
let user = message.author
message.channel.send(user.guild+" (server)")
this is my code now
it says undefined
for some reason
Because you haven’t defined it.
let ServerEmbed = new MessageEmbed()
ServerEmbed .setTitle("Servers List)
ServerEmbed .setDescription("List of all commands")
ServerEmbed .setColor("#F8AA2A");
ServerEmbed.addFields(
{ name: '**SERVERS - **', value: '${client.guilds.cache.size}', inline: true },
{ name: '**MEMBERS - **', value: '${client.users.cache.size}', inline: true },
)
ServerEmbed.setTimestamp();
return message.channel.send(ServerEmbed).catch(console.error);
@still merlin help me with it please !
wait how do i define a guild?
right er
hold on
You know the english keybord, Next to the number one there is a weird key
Use ` instead of ' for your value.
This `
I dont have the symbol hold on
hi
i am back yet again
let guild = client.guilds.cache.find(g => g.name);
let user = message.author
message.channel.send(user.guild+" (server)")
shouldnt dis work
No
why
i didnt ask should it wor
i asked shouldnt it work
cuz it didnt
bruh no help
srsly
lol
Do you know the basics of javascript?
I'm not going to burn my hands on that one, you're better off reading the docs.
b r u h
I’d recommend learning, Its useful, Or at least read the guide or docs
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
is your bot approved?
Oh I Need My Bot To Be Approved?
Yes
Thanks
ok
@vale garden it's not our job to help
Is it against discord tos to create a bot that can generate accounts?
yes
if there is it won't last long
I want to track the guild count daily for my bots, but I have no idea how to make a graph to track it. Could someone please help me setting it up?
How can i make the bot send a message to a specific channel by id in discord js v12 ??????
Make a variable and cache and find a channel, then VariableName.send
or use a webhook
err
client.channels.cache is a thing
no need for a variable when you can just do client.channels.cache.get("<channel id>").send("<message>")
Though, if the channel is on a different shard, you'd have to broadcastEval it
@vale garden it's not our job to help
@earnest phoenix ik i didnt say that but you could
help
lol
hi
@vale garden I've already told you... message.author is a User object. message.member is a guildMember object. User objects are not assigned to guild, so it doesn't have a guild property. guildMember objects are specific for a guild, so that is what you have to use if you're going to get the guild through the member.
But message.guild exist as well
And if run in dms, both message.member.guild and message.guild will error, so you gotta lock that to guildOnly unless you handle those errors by doing something differently.
now you've gotten the answer to your issue @vale garden
how to add hyperlink in embed discord.py
[title](url "optional title when hovered")
[]()
ok thankx
How do you use case switches in nodejs
And if run in dms, both
message.member.guildandmessage.guildwill error, so you gotta lock that to guildOnly unless you handle those errors by doing something differently.
@summer acorn kk thnx
Beautiful
Im hosting a bot on my PC and its working just fine
But it has super slow ping when i use in Raspberry pi
Both are connected through wired networks
the memory and consumption doesnt seem much during the load
Any ideas on why it could be happening?
Why is soo much of my memory for cache/reserved for cache
@weak rain read what i wrote please? :/

3b+
wired ethn
The connection is fast
was reading some article
Could the problem be because of my SD card?
Dont have any way to test my theory rn
cant really tell, ive run bots on a Pi4 and always worked fast
Sd card?
yea i have just been working on this hobby project so i wont be running be PC 24/7
Dont run it 24/7, just make some tests
And i dont wanna host it on my VPS coz it might effect my other bots
Nah i need it to run that long for some reasons
I have 24/7 internet with UPS power supply so dont think power lose will be an issue anytime soon
well, if you using raspbian and the right things raspi isnt a problem, ive seen many bots being hosted on Raspis
yea ik
Ive been hosting one for like 2 months, and my friend have one too
raspbian?
since its linux you can do upgrade and stuff commands
im not at all experienced with rasps
i just bought it out of the idea of that small PC never used it really till now
or you can install it by packages from the official website
sure, using wget etc
with linux you dont need to download manually or anything
you can get packages and updates by commands
not just apt, apt is the package system for linux
Its easiest afaik
Curl and stuff to directly download from links right?
or curl isnt linux
but, since its a raspi its probably faster or easier to manually do it on a pc with windows and reset the sd
Got it
yeah, you can do SSH localy to raspi and update it
But i dont have a reader rn
so imma do ssh
i really dont wanna take my monitor to the other side of the house

I always used wifi on pi so 
im too far from my Router with like 3 walls in between
And if im just keeping my rasp right with router might as well use ethernet
its raspi refrigerated?
you mean cooled?
yeh, my eng is poo poo
Lmao
i thought literally refrigiated
Not rn since its literally my second day but yes i have been planning to add a heatsink with a little 70mm fan above it
24/7 raspi running stuff can easly slowdown by the heat
first 2 days with my raspi and my room starts smelling like something is burning
so yeah... better cool it some how
30ºC rn 
Its 32
sad

its probably better to run rasp OS rather then linux i suppose
How to know which version am i running on rn?
i see raspberry pi
raspian is always the best way to go
since its prepared to that machine
running ubuntu or cent its a mess
raspberry pi doesn't run on 64bit except the latest one
Raspbian has been renamed to Raspberry PI Os
can someone help me with the discription for my bot?
raspbian is more nosaltigc and normal to sound :/
#Raspbian4Ever
raspberry pi doesn't run on 64bit except the latest one
@earnest phoenix isnt 3b+ still 64 bit proc?
anyways, always run raspian on the rpi, theres no need to install other OS, even if you can that dnst mean you should
it keeps wanting to tell me to type more or i typed to much and never the right amount
even the ubuntuserver os will make it slow af and you will have a lot of trouble by missing stuff
How are VPS soo optimized?
Better specs?
it depends
Yup rasp 3b+ has 64 bit https://legendary-king.is-inside.me/CUHBdXiH.jpg

Heat can be an issue in raspberrypi, this is captured on my raspberry pi, only 30 seconds from powered up
and VPS are not "optimized" probably at the beginning but you are the guy who controls the stuff
57ºC
i want to run mine just to see what temp it reaches
i want it to see if I can melt it down
didnt you buy any fan or so?
Yo, how can I check if my bot is connected to any voicechannel on a guild in discord.js?
My mom won't buy it
@jagged sun check if guild.voice exists
Fun fact, it is hot enough to burn my finger in 5 seconds
lol
2 fans
Actually, put water cool on it
do PIs really get that hot? wow
better yet cement cool it
drop your Sprite on it
i always thought PIs were supposed to be super power efficient
Drop your vodka
and thats on how much load?
@quartz kindle they are, but they reach high temp if you dont have any cool system
I mean some people are literally running PI's with no heatsink or cooling
what do you expect from that poor chip
if you are runnin the notepad obviously wont reach any risky temp
So,
It mean
if you have a cooling system, then you can just host your bot 24/7, if you're in asian, you will have slow pING
but running servers or so it will
not much different from phone cpus, and phones dont get that hot, even with 0 ventilation
if you're in asian, you will have slow pING
@earnest phoenix what does that mean?
ping
discord gateway is in new york
^
Oh thats wonderful ;-;
That's why i hate hosting bot myself, the ping is bad
my vps is in canada
my ws ping is 100-130 from europe

20-25 from my vps
But when im hosting the bot on my PC the ping is still super good :/
how much is your client.ws.ping?
you probably checking the ping to your connection
I mean, your internet connection ping
not the ping with discord
Hosting the bot myself I get 150 ms client ping and 30 API ping
and where are you located?
Netherlands
makes sense
so EUW
netherlands is one of the main exchange points between EU and NA
so you'd be very close to a direct route
Who has a jailbroken iphone
There is a discord remote server in amsterdam I belive
so that probably explains my 30 API ping
ye
Because i ran the terminal on it
sad life to the asian hosters
does anyone have experience with running javascript bots... after a longer time, lets say 50 hours it crashes because java is out of memory or something...
SO i should buy a VPS close to NY right?
@frigid mesa how many guilds/users? whats your memory usage like? whats your pc/vps's available ram?
probably ram/CPU limitations
@small prairie ideally yes
My pc has 32 GB, currently running around 40 guilds
32 gb ram!?
ye
currently, 70 MB
70mb what, rss or heap?
heap?
peek*
that what the error tells me... something about heap memory
do you have an eval command?
ok, check process.memoryUsage().rss as well
its always good to check both
heapUsed is the actual memory your code is using
rss is what your system sees, including the node process itself, but excluding paged/swapped memory
ahh... thanks... ill check it
what value does it output? because I had to do some math on ().heapUsed to get to MB is that the same with rss?
if you're on windows, you can enable the "Commit Size" column in your task manager to get an accurate ram reading
yes the values are both given in bytes
.addField("• Mem Usage heap", `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} / ${numberWithCommas((os.totalmem() / 1024 / 1024).toFixed(0))} MB`, true)
thats what I had before
@quartz kindle where's the commit size
I was gonna ask the same
These are my outputs now @quartz kindle
good, now monitor these values over time, and check if any of them gets to like 500mb+
@earnest phoenix @small prairie task manager -> details -> right click any column title -> select columns -> enable Commit Size
realized that the moment i said the last thing
if(!message.guild.voice) return
This does somehow not work, when my bot gets vkicked it still does not return... Can someone help me? Using discord.js latest
you will need to check for both, voiceState and voiceState.channel
since discord.js keeps the state cached even after it leaves
How do I do this?
if(!message.guild.voice) return
if(!message.guild.voice.channel) return
or
if(!message.guild.voice || !message.guild.voice.channel) return
or (node 14.8+)
if(!message.guild.voice?.channel) return
or
if(!(message.guild.voice || {}).channel) return
``` lmao
lol ty, I would have just needed one but nvm xD
that last one is a pretty common trick for these kind of situations
lmao that's tricky
i use that in my functions
the last one damn

