#development
1 messages Β· Page 1278 of 1

thought you're also gonna have the problem people describe where it's going to spam 10 edits every 5 seconds. Just... btw.
const embed = new Discord.MessageEmbed();
embed.setTitle("Twitter Feed Poster");
embed.setDescription(`${status.text}`);
embed.setImage(`${status.user.profile_image_url}`);
embed.setFooter("Command created for Pokehub!");
embed.setColor("#FF0000");
embed.setAuthor(
"@" + `${status.user.screen_name}\n` + `${status.user.name}`
);
embed.setURL(
`https://twitter.com/${status.user_screen_name}/status/${status.id_str}`
);
await message.channel.send(embed)
let msg = embed
msg.edit()
message.channel.send(msg)```
i do have this?
idk if it would work tbh.
no, the message.channel.send needs to be put in the variable, not the embed
because it's the message you're going to edit
and then, msg.edit needs to contain the new embed - INSIDE your setInterval.
pseudo code ```
msg = await channel end
setInterval( () => {
get the tweets
make a single embed for all tweets
msg.edit(tweetembed)
}, 5000)
Don't end channels
send is what he meant
i give up tho.
3 hours
and still not working.
thanks for the help!
You would struggle a lot less if you took the time to go through a javascript tutorial.
for a couple weeks.
How can I remove all listeners from an EventTarget?
apparently you can't according to mozilla, you can only remove one at a time. https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener
oh thanks
@quartz kindle from internet
which website
syntax my greatest enemy
"Either get a user, or get a member"
it works if you type .user
member is a user if you mention someone
but if i type .user @umbral zealot it wont work
so you're doing user.user
maybe do the mentionedUser since it has message.author
where in the code
which line
i have mentioned user
else if (message.content.startsWith(".user")) {
const exampleEmbed = new Discord.MessageEmbed()
let mentionedUser = message.mentions.users.first() || message.author;
let member = message.mentions.users.first() || message.member
const embed = new Discord.MessageEmbed()
.setTitle("Lightbot Dev Team")
.addField("ID:", mentionedUser.id, true)
.addField("Account Age:", Date.now() - member.user.createdAt)
.addField("Highest Role", member.roles.highest)
message.channel.send(embed).catch(err => console.log(err));
}```
client.users.cache.get('487511010886942720').voice.channel.name no work
which line
@peak osprey the error will tell you all
i got it
else if (message.content.startsWith(".user")) {
const exampleEmbed = new Discord.MessageEmbed()
let mentionedUser = message.mentions.members.first() || message.author;
let member = message.mentions.members.first() || message.member
const embed = new Discord.MessageEmbed()
.setTitle("Lightbot Dev Team")
.addField("ID:", mentionedUser.id, true)
.addField("Account Age:", Date.now() - member.user.createdAt)
.addField("Highest Role", member.roles.highest)
message.channel.send(embed).catch(err => console.log(err));
}```
but the account age is in ms
remove the date.now
ok
or use moment
and now you have "the mentioned MEMBER or the message USER"
message.mentions.members.first() || message.author;
stop mixing data types 
@frail seal
joinedAt
is that for the Guild?
stop making up properties and read docs
~cry
yes, and that ^
owo
client.users.cache.get('487511010886942720').voice.channel.nameno work
@carmine summit because the user is not in a voice channel?
@carmine summit because the user is not in a voice channel?
@earnest phoenix I am in the channel
listening to music
f
https://discord.js.org/#/docs/main/stable/class/User there is no voice for users
voice is for GuildMembers
read docs
yep
any best host website to host my repl
message.member returns a GuildMember
any best host website to host my repl
best host website
repl
@narrow cloak yeah it's big brain time
hey wht you mean
repl is best if you're broke and need it to run semi 24/7
repl is best if you're broke and need it to run semi 24/7
@carmine summit how can i
sadly it doesnt support ffmpeg and all that juicy stuffs
any best host website to host my repl
@narrow cloak why and/or how the fuck would a different website host your repl.it repl that's just weird
please find a brain
so how can i host
any steps from any websites
any steps from any websites
@narrow cloak the (other) host website has docs probably
npm i express
google cloud has a lot of tutorials and stuff for hosting
copy paste your code
then press run?
@carmine summit imagine giving repl.it hosting instructions to a guy that's tryna move to a new VPS/host
oh
read the β¨ pins β¨
oh any help please tell me detail
and to upload your π₯ bot π₯ simply use filezilla or git
who uses filezilla on 2020
use filezilla
theres an option in the hamburger "download as ZIP"
@carmine summit society has changed a lot burgers now have buttons
who uses filezilla on 2020
@carmine summit well if the man/woman is π© not π© familar to git
why π©
because i like to β¨ emojize β¨ my messages, even i am not a 7 year old.
you all dont fight i am a beginner and i just want to clarify my douts thats alll
https://anidiots.guide explains about hosting too if i remember β¨ right β¨
yes, Im using repl to host my bot because im to poor to use digitalocean
yes, Im using repl to host my bot because im to poor to use digitalocean
@carmine summit theres more than one π₯ host π₯ for example: contabo, galaxygate.
are u looking 4 hosting?
yah but i prefer digitalocean
when I was kid, I used to try hostinger
digitalocean isnt the best/fastest tho
if i can speek my bot ???????????
big companies uses some random unknown hosting/their own
if i can speek my bot ???????????
@narrow cloak What language is that?
why not VPS (just asking)
quick question i forgot
does setInterval() run the moment its declared?
or only when the timer runs out?
runs out
setinvertval will be repeated after timer runs out
it should have an option to run immediately tbh, its so annoying having to wrap stuff into a function and call it twice
Songs too long???
@quartz kindle i know
i did recall a term with a self calling function
its runs once its declared
but i forgot how to do it
huh
self-invoking*
anonymous functions?
a self invoking function is easy, but you cant really combine it with an interval that easily
could run the whole thing inside itself
call this after its done
actually this wouldnt rok
work*
function selfCalling() {
//logic
delay(100);
selfCalling();
}
that should do
yeah you could do something like that instead of an interval
setTimeout inside to mimic delay
so something like ....
(function selfCalling() {
//logic
delay(100);
selfCalling();
})()```
this
that should work i guess
though im not sure if it counts for functions
does it throw error/warning of infinite loop?
it runs every 2 seconds so its not a big deal, but if i hit f12 its still there
ctrl shift r should clena it
its not an infinite loop because its on a timer
hard reload
i mean, i guess thats exactly what setInterval is
guess who just crashed the production server again

noob
lmao Tim lazy bum
you have no idea
windows has been complaining about updates for over a month and i refuse to restart it because i dont want to have to reopen all my shit
π π π
even though i have a good enough ssd so the update should take less than a minute
windows 10 2004 preview took 2 hours to update even though my pc is buff
to update or to install?
One message removed from a suspended account.
One message removed from a suspended account.
update
One message removed from a suspended account.
from 1904
because like if you're updating from 2004 to 2004, thats an update
from 1904 to 2004 thats a full install
not a from scratch install, but an install update of a big part of the system
thats why the update is 3gb+ big
ye but windows 10's build releases are like that now, they are basically trying to copy what apple does with its mac versions
idk why it took so long
going from 1904 to 2004 is almost the same as going from osx 10.14 to osx 10.15
its like a system upgrade
I have 5-10gb read/write per second ssd, beef cpu
sequential speeds !== to random speeds
well good random speeds too
ye but still, randoms are usually an order of magnitude lower than sequential
it is hot
it's m.2
jeez thats a lot
rip
yeah those look like normal temps
either that one is some beefy motherfucker that needs dedicated cooling, or theres something wrong with it
that 64 though 
lmao
i used to undervolt my gpus
i mean
of course it will be fine
just like a cpu running at 90c will be fine
but thats not good for long term health
true...
true
these are my temps (acer laptop)
how does discord detect if the embed link is a valid image link?
remember people running pentium 4's at 5ghz with liquid nitrogen 15 years ago? that shit was dope
I would've definitely bought 3900x or 3700x
remember people running pentium 4's at 5ghz with liquid nitrogen 15 years ago? that shit was dope
I remember seeing vids
but im 16 so I kinda couldn't see it myself πβ
How shady and unethical is it to use the production server to use a VM for playing games?
asking for a friend
π
I always use my production servers for random stuff
@shy turret it detects urls from http basically, but it later on it checks if its an image by either loading its headers, or by checking the file extension
that doesn't brake it
for example if you're uploading a file to use in your embed as an attachment, you have to give it the proper file extension in the file name
hm ok
so -> if starts with http/https -> check if a valid image -> sends embed with image
|-> else give error |-> if not, sends embed without image
?
How shady and unethical is it to use the production server to use a VM for playing games?
@opal plank depends on context I guess, though don't expect great performance due to network latency (those game streaming networks/platforms are heavily optimised), and most VMs don't come with a GPU anyways so you'd get poor graphics performance
@shy turret something like that, idk what they do internally
if you use embed.setImage() maybe discord.js also checks something before sending it to discord
@fluid basin i mean, i know that, but im just saying, 10 gigabit internet and, 128gb ram, 2 insane processors and a fuckton of other shit

or maybe they dont check if its a valid image, they just post the embed with the link anyway, and then your discord client loads it or not
well make sure it doesn't interfere with any services running on there basically
kk
although the fact that cpus can't replace gpus still stand
:^)
jeez thats a lot
@quartz kindle Mines running 46*C
I feel like under 70 isn't too hot
it's warm at that point for sure
whatever temp your shit is at, mine is 27ΒΊC Higher due to tropical country room temp

No cooler can keep up with Brazil and a Laptop
Lool
How would i use a mysql database in python
Amd I'm in minnesota amd its 45 f
I'll covert it to c hold on
thats like 5c lmao
7c
@quartz kindle qt 
@quartz kindle not really
for certain standards it is lmao
and good heating
@quartz kindle do you speak brazilian Portuguese
yup
lmao, should probably move to #general-int tho
Ye
let logchannel = message.guild.channels.cache.find(ch => ch.name === "log-channel")
if(!logchannel) return message.channel.send("Cannot find a log-channel.\n\n:warning:`you cannot currently change to a custom channel`")
I have no idea how to put the text in a embed in this code position?
someone help?
how do you get the shard id?
XD
client.shard.ids?
oh youβre using internal
i think it worked
yah
.shardID didnt work the first time but it works again
how do you set the shard id of the ready statement
(for Bot is ready!)
are you using the shardingManager?
yes
specifically
let { ShardingManager } = require('discord.js');
let manager = new ShardingManager('./bot.js', { token: settings.discord.bot.token });
manager.on('shardCreate', shard => console.log(`[Shard ${shard.id}] Loading shard.`));
manager.spawn();
client.shard.ids[0] would just get 0 or null
i think
yes its client.shard.ids[0]
hm ok
client.on('ready', () => {
console.log('[Shard ' + client.shard.ids[0] + '] Shard is ready!');
});
something doesnt feel right
but ok
idk why im adding this useless piece of code, im just gonna make Bot is ready! for shardCreate
almost finished with my bot with 1 command
kurasuta π
else if(command === "purge") {
const deleteCount = parseInt(args[0], 10);
if(!message.member.hasPermission("MANAGE_CHANNELS")) {
return message.channel.send(`**${message.author.username}**, You do not have perms to purge the chat`)
}
else if(!message.guild.me.hasPermission("MANAGE_CHANNELS")) {
return message.channel.send(`**${message.author.username}**, I do not have perms to purge the chat`)
}
else if(!deleteCount || deleteCount < 2 || deleteCount > 100)
return message.reply("Please provide a number between 2 and 100 for the number of messages to delete");
else {
async function purge() {
message.channel.bulkDelete(deleteCount)
.then(message.channel.send(`Purged ${deleteCount} messages!`))
.catch(e => message.reply(`I could not purge because ${e}.`))
message.delete({ timeout: 3000 })
.then(msg => console.log(`Deleted message from ${msg.author.username} after 3 seconds`))
.catch(console.error);
}
purge()
}}```
i have had some many problem's with this i just want confirmation I did it correct
what are the problems?
@pale vessel how can I use a mysql database in python?
it wont delete the "purged (Number) messages!" after 3seconds
do you have a mysql server set up at least?
Ye
Is this enough for a 8ball command kek
@dense nest found a tutorial for python, this could be useful: https://www.w3schools.com/python/python_mysql_getstarted.asp
guys why did I get an error for npm quick.db?
npm i quick.db?
I assume
is it because of that shitty "Integer" lib?
@earnest phoenix no like alot of errors
quick.db uses shity ass integer module which fails to install 99.9999859843598374985% of times
@misty sigil
@earnest phoenix no like alot of errors
@autumn aspen send like a screenshot of a few of them please
quick.db uses shity ass integer module which fails to install 99.9999859843598374985% of times
@earnest phoenix how can u install it otherwise?
you cant
bruuuuh
that shitty ass lib is mandatory for quick.db
just use mongo?
@pale vessel so do i have to define it?
i swear if the question is "do i need to define a variable to use it?"
Does anyone know how to get the ID of a timeout?
i dont know to be honest
if you want to clear it
You do
i want to clear a timeout i have set but i dont know how to get the id?
or am i just stupid
uh
var timeout = setTimeout()
// timeout is the timeout id
clearTimeout(timeout)
imagine not using codeblocks
ohhh
i get it
thank you
imagine not using codeblocks
@hazy sparrow you're making a fun of yourself mate
yeah i know
- imagine not using code blocks
smh me and the boys in our group chat by changing the group name
...
kill me
||you mean this shit?||
I am EPIC
@sinful thistle bruh it's three backticks not two with a space quit whining
Dam
Dam
@sinful thistle *beavers intensify*...?
wait how do you do that
EPIC
@sinful thistle btw there is no soace between the backtick
wait how do you do that
@hazy sparrow he put a backtick inside an (inline) code block
epic
Oh
oh lmfao
not #development anymore
It is so great to figure out how much of a Dumbass I am
guys how do I intall the package antispam?
the only reason i want to be mod here is that i can change #development to #general
guys how do I intall the package antispam?
@autumn aspennpm install <package-name>it would benpm install antispamfor antispam
code913 is a dick sometimes, endph
code913 is a dick sometimes, endph
@digital ibex always has been
@autumn aspen
npm install <package-name>it would benpm install antispamfor antispam
@earnest phoenix but it said it doesnt exict
like the antispam
so what do I type
correct name of the package....
yeah you can look it up
lmao
https://lmgtfy.app/?q=how+to+download+antispam+package @autumn aspen
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
how's it pseudocode lol
npm i discord-anti-spam
how's it pseudocode lol
@digital ibex read it throughly
look it up
did you try looking it up first
that
i think?
i don't really know don't take my word for it i am not legally responsible if npm i discord-anti-spam ruins your bot
still dont understand how it is but ok
@digital ibex read it throughly
@earnest phoenix is antispam = pseudocode
im pretty sure the library is called discord-antispam @autumn aspen
did you try looking it up first
@pale vessel do you actually think they will
i remember u being a dick code, but jesus calm tf down
i asked you...
wrong emoji sry
lol my host just requires me to put the thing in package.json and it will work
ez windows-build-tools in 0.5secs
:|
im pretty sure the library is called
discord-antispam@autumn aspen
@digital ibex no its not
lol my host just requires me to put the thing in package.json and it will work
@hazy sparrow that's how npm works it reads data from package.json and installs it when needed
however you can still do limited npm shit without package.json
what is it?????
i have a question on how to include multiple files in my program :/
@autumn aspen https://lmgtfy.com
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
did u try discord-antispam?
i have a question on how to include multiple files in my program :/
@upper elm explain pls
so i want to make my code cleaner by putting my code for different commands in different files
just require them then
@autumn aspen https://lmgtfy.com
@earnest phoenix bro stop gay
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
you can require more than one file
use command handler
yea that's what i said
"stop gay" lmfao
@upper elm use a command handler
what's that
@earnest phoenix bro stop gay
@autumn aspen imagine asking us a billion times a thing which every single node.js programmer knows then telling us to stop
this channel is hell
yes it is
always has been
yep
it never used to be this bad tho
guys lmao it better-discord-antispam
lol this is the third time i've asked for command help on here and it was fine the first two times
lol this is the third time i've asked for command help on here and it was fine the first two times
@upper elm whasup bud
@upper elm d.js?
mhm
you can use this guide https://discordjs.guide/command-handling/
nom nom intensifies
@earnest phoenix lmao it is npm better-discord-antispam
how the fuck do you open shell on repl.it mobile
tried typing shell in the commands tab nothing shows up
why are companies trying to eradicate smartphones
can u dowload a js file from an array in index.json?
I cant get a command handler :/
LMFAO jk!!!!1
can u dowload a js file from an array in index.json?
@autumn aspen
lemme rephrase that
can you download a file from an array inside a JSON file?
how da fuck do you download files from an array in a can't-run-an-HTTP-server-and-serve-files JSON file

how much nodes do you need for 2500 servers?
2
ok
thanks
ok so far this makes sense
ok so far this makes sense
@upper elm we literally told you nothing who are you talking to lmfao
i need help
```if (message.content.startsWith(${prefix}embed)){
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply('Sorry, you do not have permission!');
var title = message.content.slice(prefix.length).split(' ').splice(1).join(' ')
var color = message.content.slice(prefix.length).split(' ').splice(2).join(' ')
var sayembed = new Discord.MessageEmbed
.setTitle(title)
.setDescription(sayembed)
message.channel.send(sayembed);
message.delete().catch(O_o=>{});
}
help
it wont work
Why?
@cobalt spruce you can't just send a big-ass code block and ask what's wrong

"it wont work" provides absolutly no information for us
Found the error
itβs new Discord.MessageEmbed()
and why
why are you setting the fucking embed as the description

.catch(0_o=>{});
takes deep breath
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
0_o
I love using that. π
@earnest phoenix lEtS caLM nOw
Guys Im so fucking stupid I deleted of mistake my serverinfo.js FILE!!!!!!!!!!!!!!!!
How do I get it back π€‘
tuff
The recycle bin idot
remake it 
unless if you somehow emptied it while it was in there
The recycle bin idot
@misty sigil oh forgot how do I get it there lmao
remake it :mmLul:
@zenith terrace π
guys how do I got to recycle bin
get to
@earnest phoenix how do I get to recycle bin now again
π€‘
this is the one time im hoping this is a troll
this is the one time im hoping this is a troll
@opal plank yeaaaaaaah..

you telling me you trying to make a bot and you dont know what/where the recycle bin is?
you telling me you trying to make a bot and you dont know what/where the recycle bin is?
@opal plank yes π€‘
but just answer how do I get to recycle bin?
how to make aliases for commands with a command handler?
just map the command again but instead of name use the aliases too
const Discord = require("discord.js");
const client = new Discord.Client();
const fs = require('fs');
const prefix = 'bow ';
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync(`./Commands/`)
for(const file of commandFiles){
const command = require(`./Commands/${file}`);
const name = file.split('.')[0];
client.commands.set(name, command);
}
const cooldowns = new Discord.Collection();
client.on("ready", () => {
console.log("bow bot is online!!");
client.user.setActivity(`${client.users.cache.size} people!`, { type: 'WATCHING' });
});
client.on("message", (message) => {
if (!message.content.toLowerCase().startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (!cooldowns.has(command.name)) {
cooldowns.set(command.name, new Discord.Collection());
}
if(client.commands.has(command)) {
client.commands.get(command).execute(message)
}
}
)
client.login('NzI1NjMwMjkwNTg3ODExOTQ5.Xw8lQ.aNqF_ii6thN-J9hhTWOdLXOsQEI')
// fake token dw
this is my index.js
go reset that shit
yo
delete that
read the comment
@opal plank read the comments
and go reset your token
dum dum

what if he's bluffing

sure go ahread and check 
aw i wanted to ruin someone's day today
Oof
aw i wanted to ruin someone's day today
@sonic lodge probably gonna get alot of hate that happened to me in #memes-and-media
check if alias exist
@opal plank how? do i go into every command and check?
oh shit
invalid token
@opal plank you still have a chance
i deleted one charecter from somewhere in the token gl finding it out
why not just set the alias as a property in the command file and use commands.find(x => x.name == input || x.alias && x.alias.includes(input)) for example
looping seems a bit too much
how come?
you only mapping it once
and then indexing it
better than running loops on EVERY command
what is he even trying to do
aliases for commands
if(command.alias) for (alias in command.alias) map(alias, command)
@opal plank smol brain cant comprehed where to put that >:(
smol brain should know im telling you the framework and that you shouldnt be copy pasting stuff
Something is wrong with my bot it's not responding to the commands did my bot crashed?

@earnest phoenix is the person
module.exports = {
name: 'reload',
description: 'Reloads a command',
execute(message) {
const prefix = "bow"
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
if (message.author.id === '542278740537769985'){
if (!args.length) return message.channel.send(`You didn't pass any command to reload, ${message.author}!`);
const commandName = args[1].toLowerCase();
const command = message.client.commands.get(commandName)
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
delete require.cache[require.resolve(`./${command.name}.js`)];
try {
const newCommand = require(`./${command.name}.js`);
message.client.commands.set(newCommand.name, newCommand);
} catch (error) {
console.log(error);
message.channel.send(`There was an error while reloading a command \`${commandName}\`:\n\`${error.message}\``);
}
message.channel.send(`Command \`${command.name}\` was reloaded!`);
if (!command) return message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`);
}
else return;
},
};
this little piece of crap always tries to reload user-ifo when i command it to reload user-info
thats the issue?
message.client is fine
try{
user.send(`${user} you have been **Warned by** ${message.author} in the server ${message.gild.name} with the reason of \`${reason}\``)
} catch (err){
console.log(err)
}
I got an err of "Cannot read property of 'name'" why?
My command works good it doesnt break but when I warn someone this pops up why?
also it doesnt send it to the user
the embed
help anyone?
you misspelled guild
lmaooooooooooo
pls give code help discord.js
Does anyone know how to change a bot's language in discord.py? If someone were to do changelanguage spanish, then it would be in spanish
that is a big thing
Also, is there a way to make it so an admin can make another user have perms to ban?
not just like a few lines
hey
message.content
.slice(prefix.length)
.replace(/^tweet/, "")``` i also want to cut an args
cuz i have a !tweet (your messsage) #channel command
how would i replace 2 messagess?
can't i jusst add another .replace?
Guys fun fact: if u get a message by the bot and u type its prefix of a one of its command it gives u a err but dont break it
no?
Always when Im getting an err I think its broken lmao
it doesn't give an error for me
@compact oriole wdym what does like stop that

How do I make a modrole command that sets the modrole so that users with that role can ban and stuff?
How do I make a modrole command that sets the modrole so that users with that role can ban and stuff?
@leaden rover dude search up
@earnest phoenix how do I get to recycle bin now again
@autumn aspen can you fucking stop randomly pinging me then telling us I'm cancer
@leaden rover dude search up
@autumn aspen well, the internet won't be specific enough
@autumn aspen can you fucking stop randomly pinging me then telling us I'm cancer
@earnest phoenix lol ok
Guys why do I get a message by Durchie bot?
idk
@modern sable hey
@humble gyro Why does everyone get this message?
yeah it dm'd everyone that was sending a message
That's a not cool bot
already kicked it
@earnest phoenix how do I get to recycle bin now again
@autumn aspen can you fucking stop randomly pinging me then telling us I'm cancer
veld ping
already kicked it
@modern sable thx
veld ping
@misty sigil lmao
@autumn aspen can you fucking stop randomly pinging me then telling us I'm cancer
@earnest phoenix what again?
network issues sry
seems like I'm sending messages through four instances of discord
dude search up
@autumn aspen imagine telling other people to do smth you ignored when we told you to
exactly
and also stop asking every question here
and try to actually make it yourself
Anyone here performance test their API?
what api?
Their own, not one in particular
https://cdn.discordapp.com/attachments/272764566411149314/760190042580320270/Skarmklipp_18.PNG is that message logger in red? π
I'm using LoadRunner right now, and it's got some good stats tbh. I kinda like it

could someone help me
oh thats a handled error
its just a timeout
nvm its fine
bot is fine
false posivit
https://cdn.discordapp.com/attachments/272764566411149314/760190042580320270/Skarmklipp_18.PNG is that message logger in red? π
@opal plank woah
lol
Check my 30 HTTP 500 errors 
I just ran
c.eval Client.users.cache.forEach(user => {
user.send("hello");
});
Good job
uppercase client
Did it work at intended
imagine not making your own clustering for apis that dont offer sharding. Plebs
combination of redis and custom

ew shardingmanager

yes it can
Who needs clustering when you can just spawn a new thread for it's own sharded client 
also I don't use bad discord.js shardingmanager
I use chad kurasuta shardingmanager
twitch doesnt enjoy haivng 1 client connected to 10k streams as its flagged for datamining

shards:"auto" > kurasuta
what exactly does a prototype mean in JS?
It's their attempt at a class structure
It's their attempt at a class structure
@faint prism congrats you're deprecated (MDN strikethroughs stuff in the sidebar which is deprecated)
that's why i don't use virgin JS
I use chad TS :)
(basically js with types/interfaces/latest es support)
@faint prism congrats you're deprecated (MDN strikethroughs stuff in the sidebar which is deprecated)
@earnest phoenix I can't event find that original post I made lol
who needs either of those, discord is cheap af in resources
cough discord.js-light cough
you
cough
(node:16644) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
i do not know what i did to cause this
i quite literally just updated my schemas in mongoose

oh ok i shouldv'e googled it
it happens when you make something required that's unique
js's prototypes are awesome

C @uneven badger
js's prototypes are awesome
@quartz kindle yes and no

How do you guys think I should go about making cooldowns in my bottom?
1οΈβ£ Make a discord.js Collection that stores timestamps
2οΈβ£ Store the timestamps in SQL
cooldowns in your bottom?
do you shit that much?
@quartz kindle uhh yeah
Make it runtime
yea
Don't bother storing in a dbms
Unless the cooldowns are more than an hour, store them in memory
yea
also it would be a huge hassle to make it in db...
except like redis would be easiest
Somebody knows how to get random line from .txt file then remove the line from .txt file
const embed2 = new Discord.MessageEmbed()
.setTitle("Muted")
.addField(`${message.mentions.users.first().username} was successfully **Muted** by ${message.mentions.author.first().username} for \__${time}__\, with the reason of \`${reason}\``)
.setColor(0x75ff58)
.setFooter("Modicus | Muted")
message.channel.send(embed2)
Is this smh right?
well try it 
Refer to the documentation for help: https://discord.js.org/#/docs/main/stable/class/Message
For example, if you go click on mentions, you'll see there's no property called author. If you go back to the Message class, you'll see there is a property called author which will be the user who sent the message (message.author).
ok making 50 shards
70 and hope each shard gets its own guild
true
just started making a bot for luls and i can say im bot fascinated and confused so props to u lot :)
Refer to the documentation for help: https://discord.js.org/#/docs/main/stable/class/Message
For example, if you go click on
mentions, you'll see there's no property calledauthor. If you go back to theMessageclass, you'll see there is a property calledauthorwhich will be the user who sent the message (message.author).
@sudden geyser thx it worked now as I expected
i also have a question gettubg type error for line 11 (file.endswith) wondering if any of u had any ideas on this
did you mean endsWith?
possibly
nope that dont work
im rather lost cus it was working for the vid im following (like i said never done this before) but not for me
Do you get a new error? Are you sure it's not working, as it should. endswith is not a method on a string, but endsWith is (case sensitive). Did you save the file?
does readdir return a file or directory?
array of files or directories in directory
probably a directory
says endswith is not defined
show your source code pls
if you enable withFileTypes it returns an array of Dirent objects
You still haven't changed it?
i put it back a second ago cus i was getting not defined error
helps if i put the client id back in
Like I told you, you need to replace endswith with endsWith. JavaScript is case-sensitive and endswith is not a method on a string.
ahhh ok sorry didnt see the caps W first time
im smart lol
hm
now i see why my friends told me that java is ew
XD oh well thanks anyway. i gotta bounce. have fun
It's not that it's bad (no matter how bad JS is, Python ftw), it's that you're using it incorrectly.
if (message.content.startsWith(`${prefix}embed`)){
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply('Sorry, you do not have permission!');
var title = message.content.split(" ").slice(1);
var saymessage = message.content.split(" ").slice(2);
var sayembed = new Discord.MessageEmbed
.setTitle(`${title}`)
.setDescription(`${saymessage}`)
message.channel.send(sayembed);
}```
guys
why this wont work
No errors
what doesn't work
No Embed Message
find out why
what did you try
will u help or not
you're expecting me to feed you the answer, which i will not do
i will guide you on how you're supposed to diagnose your own problem
i asked you what did you try
i tried to change
var saymessage = message.content.split(" ").slice(2);
with
var sayMessage = message.content.slice(prefix.length).split(' ').splice(2).join(' ')
but nothing
console.log both title and saymessage and see what the console logs
no you aren't because github isn't a host
nasty
what does that matter anyways
you can console.log regardless on what platform you're on
that means there no logs
lol
am dum
yes
i didnt exect dat
lol
@earnest phoenix
did u know how to solve that
or u just driving me to no were
i knew where the problem was as soon as you sent the code
its in the message.slice
i'm just teaching you how to resolve your own problems
but idk were
it actually isn't, or well is, but you're missing something
nope
that's just string interpolation
right now title and saymessage are arrays
you can't feed an array to a string
you need to join the array (in order to make it a string)
that's why i told you to console.log it
console.log would say that it's an array
oh i didnt metion that am new
.setFooter("Time warned", client.user.displayAvatarURL())
Guys I want it to send the guilds avatar
how do I do?
guild.iconURL()
What version are you on?
it isnt
Don't forget the ()
hmm
It's a function
look wait
can someone help me
@earnest phoenix What's up
Show me the full embed code
aight
where can i send the code?
const embed = new Discord.MessageEmbed()
.setTitle("WARNED")
.addField("Read!", `${user} you have been **Warned** by ${message.author} in the server **${message.guild.name}** with the reason of \`${reason}\``)
.setFooter("Time warned", guild.iconURL())
.setTimestamp()
.setColor(0xff2e2e)
user.send(embed)
@earnest phoenix
look
the footer
const { MessageEmbed } = reuqire("discord.js")
const Commando = require("discord.js-commando")
const muteShema = require("@schemas/mute-schema")
module.exports = class IsMutedCommand extends Commando.command {
constructor (client) {
super (client , {
name:"ismuted",
group:"moderation",
membername:"ismuted",
userPermissions: [
"ADMINISTRATOR"
],
discription: "Displays mute information for a user",
argsType: "multiple"
})
}
run = async (message,args) => {
//ismuted ID
const {guild} = message
if (args.length !== 1) {
message.reply("correct syntax: ${guild.commandPrefix}ismuted <User ID>")
return
}
const id = args[0]
const currentMute = await guild.members.fetch()
const target = members.get(id)
const isInDiscord = !!target
const currentMute = await muteSchema.findOne({
userId: id,
guildId: guild.id,
current: true
})
const embed = new Messageembed()
.setAuthor(
"Mute info for ${target ? target.user.tag: id }",
target ? target.user.displayAvatarURL() : ""
)
.addField("Currently muted", currentMute ? "yes": "no")
.addField("Is in Discord", isInDiscord ? "yes": "no")
if (currentMute) {
const date = new Date (currentMute.expires)
embed
.addField("Muted by", "<@${currentMute.staffId}>")
.addField("Muted for", currentMute.reason.toLowerCase())
.addFfield("Muted expires", "${data.toLocaleString()} EST")
}
message.reply(embed)
#delete
const { MessageEmbed } = reuqire("discord.js")
const Commando = require("discord.js-commando")
const muteShema = require("@schemas/mute-schema")module.exports = class IsMutedCommand extends Commando.command {
constructor (client) {
super (client , {
name:"ismuted",
group:"moderation",
membername:"ismuted",
userPermissions: [
"ADMINISTRATOR"
],
discription: "Displays mute information for a user",
argsType: "multiple"
})
}run = async (message,args) => { //ismuted ID const {guild} = message if (args.length !== 1) { message.reply("correct syntax: ${guild.commandPrefix}ismuted <User ID>") return } const id = args[0] const currentMute = await guild.members.fetch() const target = members.get(id) const isInDiscord = !!target const currentMute = await muteSchema.findOne({ userId: id, guildId: guild.id, current: true }) const embed = new Messageembed() .setAuthor( "Mute info for ${target ? target.user.tag: id }", target ? target.user.displayAvatarURL() : "" ) .addField("Currently muted", currentMute ? "yes": "no") .addField("Is in Discord", isInDiscord ? "yes": "no") if (currentMute) { const date = new Date (currentMute.expires) embed .addField("Muted by", "<@${currentMute.staffId}>") .addField("Muted for", currentMute.reason.toLowerCase()) .addFfield("Muted expires", "${data.toLocaleString()} EST") } message.reply(embed)
@earnest phoenix dude put ```js
Astrolimit u know error?
!
@earnest phoenix
U know js?
Yeah
@earnest phoenix error: ReferenceError: guild is not defined
Bro stop spamming
``` if (message.content.startsWith(${prefix}embed)){
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply('Sorry, you do not have permission!');
var title = message.content.split(" ").slice(1);
var saymessage = message.content.split(" ").slice(2);
var sayembed = new Discord.MessageEmbed
.setTitle(${title})
.setDescription(${saymessage})
message.channel.send(sayembed);
}```
idk why this wont work
can you please stop posting walls of text
use a bin service, like pastebin or hastebin
@earnest phoenix error:
ReferenceError: guild is not defined
@autumn aspen Add msg. in front of guild
js
can you please stop posting walls of text
@quartz kindle exactly
@earnest phoenix error:
ReferenceError: guild is not defined
``` if (message.content.startsWith(
${prefix}embed)){
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply('Sorry, you do not have permission!');
var title = message.content.split(" ").slice(1);
var saymessage = message.content.split(" ").slice(2);
var sayembed = new Discord.MessageEmbed
.setTitle(${title})
.setDescription(${saymessage})
message.channel.send(sayembed);}```
idk why this wont work
@cobalt spruce I can't know what the problem is if you don't tell me, what's the error
lol
NO ERROR
I just dont get Embed message
it doesnt post
i think problem in Slice but idk how to fix
Do you have the MANAGE_MESSAGES Permission?
yes
new DIscord.MessageEmbed**()**
is not MANAGE_MESSAGES
let me try
ReferenceError: guild is not defined
at Object.module.exports.run (C:\Users\admin\apemodicus\commands\warn.js:35:27)
at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
@earnest phoenix it didnt work either
I tryed guild.msg.iconURL()












