#development
1 messages · Page 1469 of 1
is that even possible
Yep
Python dudes do it all the time
or use a module

yes, whoever codes like that isnt even worth 50 cents

stonks though tbh

do you guys use any tool to collect stats for your bots? i.e how many servers its in
yeah me
Probably quite a few of us
Or bot depending what people use
smh
.hola pendejadas
probably the best decision you've ever taken 
@zenith terrace do you another server set up where you send that info to?
So as some may know, there's this <Client>#api method in discord.js which returns a noop function everytime you access a property of it and it kind of like collects them all in a bucket and does this kind of thing, anyone know how something like this could be made?
not me
i plan to, tho
I use to in a command for myself
mine is bot
just bot
😊
this.client
bot is only people who followed tutorials
because its easier to say bot than client to newbies
yea

client because that's what it's named internally
wait i thought it was client there too
probably different
Hey, have a discord.py bot running in 2k guilds on 2 shards, but the TopGG page isn't showing the shard count. I'm using the python topgg library, and have autopost setup. It keeps the server count updated, but doesn't seem to update the shard count. This is the current TopGG code:
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = TOP_TOKEN
self.dblpy = dbl.DBLClient(
self.bot, self.token, autopost=True,
)
# Autopost will post your guild count every 30 minutes
async def on_guild_post():
print("Posted to top.gg")
Does anyone know how I would fix this?
async function getembedcolor(client){
const guildSettings = await GuildConfig.findOne( { guildID: message.guild.id } );
const embedcolor = guildSettings.embedcolor
return embedcolor
}
module.exports = {
getembedcolor,``` how can i pass message into this?
You can make it a function
* @param {User} [user] - The user that executed the command that resulted in this embed
* @param {object} [data]
* @param {client} [client] - - Data to set in the rich embed
* @param {string} [message]
*/
module.exports = class SnowflakeEmbed extends MessageEmbed {
constructor (user, data, message, client = {}) {
super(data)
let color = getembedcolor(message)
console.log(color)
this.setColor().setTimestamp()
if (user) this.setFooter(`Command Ran By ${user.tag}`, user.displayAvatarURL())
if (!user) this.setFooter('Snowflake Discord Bot')
}```
tryna use it here
and it is a function
+1 for client gang
yes
For getembedcolor, you can make it accept message instead and use message.client
and you also will have access to the message itself
TypeError: Cannot read property 'client' of undefined
let color = getembedcolor(message.client)
as such right?
message doesn't have a client
or in the function?
they do, all structures initiated by a client do

so whys it undefined?
because message is not defined
i dont know how to define message inside of the constructer then
constructor (user, data, message, client = {}) { i thought that worked tbh
pass it as a constructor parameter maybe?
you should put message, not message.client since you wanted to use message.guild.id in that function
but that's not the problem here
<rejected> TypeError: Cannot read property 'guild' of undefined```
define guild with discord.js
it's not passing message correctly
const guild = require("discord.js")
but whys it not passing message correctly?
const guildSettings = await GuildConfig.findOne( { guildID: message.guild.id } );
const embedcolor = guildSettings.embedcolor
return embedcolor
}
module.exports = {
getembedcolor,
"ERRORCOLOR": "#f53939"
}``` this is correct right?
no thats not correct lmfao
yes but I would cache that
it dosent work @crimson vapor
how about this js const { Guild } = require("discord.js");

works in mine lol
you're high
const Guild = require('discord.js').Guild```
nah
mine better
its not Guild with cap
it was about guild
No 🧢
like message.guild
async function getembedcolor(message) {
const guildSettings = await GuildConfig.findOne( { guildID: message.guild.id } );
const embedcolor = guildSettings.embedcolor
}
module.exports = {
getembedcolor,
"ERRORCOLOR": "#f53939"
}```
constructor (user, data, message, client = {}) {
super(data)
this.setColor(getembedcolor(message)).setTimestamp()
if (user) this.setFooter(`Command Ran By ${user.tag}`, user.displayAvatarURL())
if (!user) this.setFooter('Snowflake Discord Bot')
}```
TypeError [COLOR_CONVERT]: Unable to convert color to a number.```
Again, message isn't being passed correctly which is why it's undefined
Can you show me how you used SnowflakeEmbed?
@fierce ether
new Snowflake(author)
that isnt the error
const guildSettings = await GuildConfig.findOne( { guildID: message.guild.id } );
But it also needs, data, message, and client?
i need to pass message so i can get the embed color from the db
It won't work this way
its trying to set the color but it cant fetch it from the db because message is undefined
@pale vessel it always works lol
I guess they're from the super()
But it's weird that message is defined there but not in the function, where you pass the message
well i can get the guild id
using data.guild.id
so how can i make the guild config use that
only getting this error now @pale vessel
TypeError [COLOR_CONVERT]: Unable to convert color to a number.```
const GuildConfig = require('../database/schemas/GuildConfig');
async function getembedcolor(data) {
const guildSettings = await GuildConfig.findOne( { guildID: data.guild.id } );
const embedcolor = guildSettings.embedcolor
return embedcolor
}
module.exports = {
getembedcolor,
"ERRORCOLOR": "#f53939"
}```
What's guildSettings.embedcolor?
constructor (user, data, message, client = {}) {
super(data)
let color = getembedcolor(data)
this.setColor(color).setTimestamp()```
Ah, await your function
returns #fff001
SyntaxError: await is only valid in async function
and constructers cant use await
module.exports = class SnowflakeEmbed extends MessageEmbed {
constructor (user, data, message, client = {}) {
super(data)
let color = await getembedcolor(data)
this.setColor(color).setTimestamp()
if (user) this.setFooter(`Command Ran By ${user.tag}`, user.displayAvatarURL())
if (!user) this.setFooter('Snowflake Discord Bot')
}```
You can make it a method
how
async build() {
let color = await getenbedcolor();
...
}```
under super?
you need the data, yeah I guess
guys i get code support here right?
Not there
where
something like this```js
class SnowflakeEmbed extends MessageEmbed {
constructor (user, data, message, client = {}) {}
async build() {
let color = await getenbedcolor();
...
}
}
const embed = await new SnowflakeEmbed(author).build();```
you need to call super or it will error
so how do i use async aswell @crimson vapor
you can't declare a function inside a constructor lol
well you can
but not like that
Like this
O wait nvm
js a
xd
js Some code
Hmmm
``` not `
const a = 'poggers'
let author = message.author;
´´´js
if (message.author.bot) return;
´´´
uh
oh
if (message.author.bot) return;
client.on('message', async message => {
if (message.content) {
var operation = Math.floor(Math.random() * 5000);
if (operation == '479') {
message.channel.send('You found the secret message :eyes:')
}
}
});
;u
i always use the async
;u
await botdb.queryPromise(`SELECT * FROM server WHERE serverid = ${message.guild.id}`).then(async function(results){
if(results[0].embeds === 0) {
//
}
else {
if(!message.guild.me.hasPermission(`EMBED_LINKS`)) {
await message.channel.send(`Hey <@${message.author.id}>! You have embeds enabled, but I can't \`Embed Links\`! I need to be able to do this!`);
}
}
return;
});
I need help figuring out this god damn return if someone could help.
I've tried every combination I can think of but it won't stop the functions from running.
What's wrong with it
Where can I find the best reminder bot
for TS: I have a type Alpha = 'A' | 'B' | 'C';
How do I make Alpha so that it also has the lowercase letters in it.
Off the top of my head I don't think you can since the type just accepts string literals
Thanks, but I just came to know that ts, has a powerfull Template Literal Types
And it is possible
Or I say, more than that
@rocky hearth you're right
here's something you may want to take a look at if you haven't found it already and for anyone else that is curious https://github.com/microsoft/TypeScript/pull/40580
タフ
weeb
Can you tell me why this doesn't produces red line in my editor? for ts
I should not be able to add null's here, as the type is set to Piece

}
}
Hey, my command system for my bot that I've been using for months now just stopped working, I don't think I touched it or anything, could somebody take a look at it and tell me if something is wrong?
bot.on('message', message =>{
if(message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping') {
message.channel.send('pong')
}
});
have you made any changes to your code
before it stopped working
you return if the message startswith the prefix, I think there should be !
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\
How do I check if there is a specific user of a specific guild?
in which library
discord.js
if fetch throws an error, the user doesn't exist in the guild
I have my prefix defined earlier in the code, it shouldn't be the problem
Nope
Not to my knowledge...
doesn't matter where you declare the prefix, it's going to return out of the handler if it starts with the prefix
you're missing an inverter
Deleted the
message.content.startsWith(prefix) || ```
And it still doesn't work
bruh
does the event fire in the first place?
const Guild = client.guilds.cache.get('ID')
if (Guild) {
guild.members.fetch('ID')
.then(console.log)
.catch(console.error);
}```
yes, that would be correct
I have a bot leveling system for every time I send a message I get xp and it is adding xp and logging it as it should, it's registering the message
🤔
what's your actual code
we can't help you if you omit parts of it
all of my code is right here:
const Discord = require('discord.js');
const bot = new Discord.Client();
const prefix = '!';
bot.on("ready", () => {
console.log('Bot is online.')
})
bot.on('message', message =>{
if(message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping') {
message.channel.send('pong')
}
});
bot.login('token')
where's the part for the xp
var stats = {};
if (
fs.existsSync('stats.json')){
stats = jsonfile.readFileSync('stats.json');
}
bot.on('message', (message) => {
if(message.author.id == bot.user.id)
return;
if (message.guild.id in stats === false) {
stats[message.guild.id] = {};
}
const guildStats = stats[message.guild.id];
if (message.author.id in guildStats === false) {
guildStats[message.author.id] = {
xp: 0,
level: 0,
last_message: 0
};
}
const userStats = guildStats[message.author.id];
if (Date.now() - userStats.last_message > 30000) {
userStats.xp += random.int(15, 25);
userStats.last_message = Date.now();
const xpToNextLevel = 5 * Math.pow(userStats.level, 2) +50 * userStats.level + 100;
if (userStats.xp >= xpToNextLevel) {
userStats.level++;```
oh dear
do you hook into the message event multiple times
Nope
what
are you on any sort of drugs
No lmao
did he mean it's another whole bot
i-
Was going to say I just tried it on another bot and it didn't work
oh my fucking god
i asked you to see if the event's firing in the first place
in the current code
does d.js enable all the intents but the privileged ones by default though?
nope
djs doesn't use intents by default at all
oh, so he should explicitly enable the message intent?
Did you mean to add console.log and see that? @earnest phoenix
Because I did that and still no
i don't think so, you don't need intents by default
do you get the ready event
aka does this thing log
Yes
huh
are you using djs v12
how do I check?
your package.json
12.5.1
🤔
the code you provided should work just fine
oh
you've got a syntax error
how tf did that even run
what you provided shouldn't even run
No, one of the embeds I defined earlier I typed wrong, instead of rankcard it was rankcrad...
what
\😳
That bracket is for the if
oh
oh
i didn't even notice it
Hey tim! nice to see you, always when I need help lol-
Yeah, it's fixed now, sorry about wasting your time
haha
That code will work with any 1char prefix tho
they mentioned an embed being their issue but there is no mention of an embed there
they're omitting parts of their code 🤷♂️
just make your prefix 60 chars long 
I swear I’ve seen that image before
too
prefix = "AAAAAAAAAAAAAAA"
AAAAAAAAAAAAAAAA
There was an embed later down, ping was the first command and something easy to test, I had a chain of else if's and the embed was down there in the code I was writing earlier
yeah but you can't omit code if you expect help
At my first glance over the commands I added I must have missed the type
it’s like asking why a database query won’t work
imagine calling mr. repair man to fix your fridge and you keep showing him a brand new fridge which is perfectly fine, instead of your broken one
it was legit a chain of else if's I don't think it's really needed when I thought it was the part that was broken was up there
I have 90 commands, was I going to paste all of them here? lol
bin services exist 🤷♂️
bin services?
no, I was going to paste the first one that can be used as a test no matter what
hastebin etc
and 90 commands in an
Asking about your attempted solution rather than your actual problem
you should read that page
else if chain?
if(command === 'ping') {
message.channel.send('pong')
else if(command === 'marco') {
message.channel.send('polo!')
else if chain, idk what else to call it
and then I just repeated the else if code
... how many commands again
too many, I estimate it's around 90...
you need a command handler.
Voltrex must be proud of you
That seems like a lot of work mattt
What i did wrong?
are you using v12
yes
🤔
cache shouldn't be undefined
Are you sure?
i don't know
no it’s not
in VSCode i didn't get a error like this
console.log(Discord.version)
🙄
not compared to fucking pain with else if statements
show your glitch package.json
I'll look it up in a bit, gonna take a break for now, cya
it’s not v12
Yup
it’s v11
V11
Bro use ourcord 
how to i make it v12?
Change the version
npm i discord.js
bro don’t
Save the file
my bot's code don't have catch function
you have to upgrade your node version
it doesn't require the ()
how?
yeah upgrade your node version
my bot is now v12
node version
Node, not d.js
not d. js version
no
by npm install discord.js?
help
does that work on repl too
no
fuck
anyway how do you add inline fields to messageembed?
.addField(..., ..., true);
tried that didn't work
I did have
the field right before it was inline
let embed = new Discord.MessageEmbed()
.setTitle(`List of emotes in guild ${message.guild.name}`)
.addField(`#${i}`, `\u200b`)
.addField(`Name`, emoji.name, true)
.addField(`Preview`, `${emoji}`, true)
.addField(`Source`, source)
;
@pale vessel
hey stinky dev help me
what does it look like
that won't work
fuck discord
🖕
fun fact
desktop, android and ios all run on different frameworks lmfao
that's why everything is so inconsistent
what would be the ideal framework for this type of application
that's cross platforms
is flutter good
never tried it
people say flutter is smoother than react native but i yet have to try it
eh, sounds very subjective
i wish js can be like java
when you install java jdk, then you can run java every where
...node works like that too
also in worst case containers exist
if you find some OS that wont run node but docker as example. but this is probably never the case
ah ye i forgot about that
Hello guys, my boot has been closing towards the morning hours for a few days, I try to open it at these hours, and nothing comes out in the cmd part, it stays like this, what should I do?
It turns out, what should I do?
Define client
I don't understand what I need to do
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes
async def on_guild_post():
print("Server count posted successfully")
@commands.Cog.listener()
async def on_dbl_vote(data):
print(data)
c.execute(f'''INSERT INTO vote VALUES ('{data.user}', NULL)''')
user_result = bot.fetch_user(data.user)
embed = discord.Embed(description = 'Vote', color = 0x00ff99)
embed.add_field(name = f'User has voted and recieved a reward!', value = '[Vote Discord Empire at top.gg](https://top.gg/bot/780041639514996787)')
embed.set_author(name = user_result, icon_url = user_result.avatar_url)
channel = await bot.fetch_channel(790163457358037012)
webhook.send(username = bot.user.name, avatar_url = bot.user.avatar_url, embed=embed)
@commands.Cog.listener()
async def on_dbl_test(data):
print(data)
c.execute(f'''INSERT INTO vote VALUES ('{data.user}', NULL)''')
user_result = bot.fetch_user(data.user)
embed = discord.Embed(description = 'Vote', color = 0x00ff99)
embed.add_field(name = f'User has voted and recieved a reward!', value = '[Vote Discord Empire at top.gg](https://top.gg/bot/780041639514996787)')
embed.set_author(name = user_result, icon_url = user_result.avatar_url)
channel = await bot.fetch_channel(790163457358037012)
webhook.send(username = bot.user.name, avatar_url = bot.user.avatar_url, embed=embed)```
Bot doesnt react on vote, why ?
can i see your code?
@glacial drum your client is defined with a different name probably
Also are you using discord.js or something else?
yes I'm doing it via dbm
Bro define client
Or if you dont know how to, go read djs documentation, or learn js
conat client = new Discord.Client()
ig he named it bot
like my code
Anyone there who can help me with Python ?
@stable frost https://dontasktoask.com
Hahaha first line xD
Here is the code. The bot doesn't react on any vote, where is the problem ?
`$nomention
$nomention
$title[Pixel Efekti]
$description[İşte Efektin:]
$image[https://api.alexflipnote.dev/filter/pixelate?image=$userAvatar[$mentioned[1;yes]]]
$footer[$username Kullandı]
$color[7F00FF]
$onlyIf[$getUserVar[kl]!=yes;Görünüşe Göre Karalisteye Alınmışsın.]`
Komut bu
I dont know bdfd
konow wait bruh
Ben de yok.
.d
Nomention tel için flananmı
Zor ama kod bilgin olunca basit
#general-int Geçelim
Ok
Bdfd value
I think we don't speak Turkish here
Bilmiyorum
Bdfd
AlexFlipnote API no longer supports bdfd due to it requiring the authorization header
loooool
anybody help please, how do I store local variable into global?
bot.on("message", message() => {
var variableA = '...' // This is the variable I want to store as public
})
bot.on("guildMemberAdd", member => {
console.log(`this is ${variableA}`);
})
declare it outside of the arrow function
you might not want to do that though
it doesn't support concurrency well*
you're going to experience race conditions
return variableA ?
thats not how that works
const mongoose = require("mongoose");
const socialSchema = mongoose.Schema({
name: String,
userID: String,
bio: String,
privacy: Boolean,
})
module.exports = mongoose.model("Social", socialSchema);
```I currently have this schema for my social commands, whenever I update them, It doesn't update for all the users, even when they perform a social command.
@earnest phoenix @topaz epoch Thank you for helping.
how are u updating them
Like I change or add, example I add
/// ...
privacy: Boolean,
Test: Number, // Example...
When I add that, it doesn't add for all the users.. what can I do?
Guyz I'm facing a weird issue since 2days for Typescript. :(
I see NO errors(red lines) in vscode.
But when I run the code, it is producing the errors seen on the right side.
I'm trying to set some Global Types but sadly it is not working.
how do I edit a dm message?
The same way you edit any other message
by their ids
const msg = await message.guild.channels.cache.get(" ").messages.fetch({
id: client.msgsent.get(message.id)})
I know that
but this is just for guilds
dms are not guild specified?
u fetch via channel
You need to fetch the dmchannel
i was getting there but yes what Tim said
Lol sorry
lol, How do u do that?
and what does this Channel do?
my brain 🤯
So how will I know fetch the Id, I mean my idea:
Someone reacts on the bot dms message
It will refresh the content @quartz kindle
Do I need therefore the .createDM() method?
@tired panther imagine a DM channel as a regular channel without a guild
yes but, my idea does not need this?
Dm reactions are same as any other reaction
because the reaction parameter has the id
You get a reactionAdd event
yes have it
I believe that dming a user effectively creates a DM channel
how did you update it?
You need to enable partials
where?
do I have to contact discod
@quartz kindle or add this in client?
autoReconnect: true,
partials: ["MESSAGE", "CHANNEL", "GUILD_MEMBER", "REACTION", "MESSAGE", "USER"]
}); ?
Yes
This will enable you to receive events from non-cached structures
For example, reactions on old messages
From before your bot started
it will not effect my other settings @quartz kindle ?
No
okay thx
But you will need to handle partial events
how?
For example, a partial message only has id, not content, no embeds, no nothinf
ok
If message.partial === true
okay
if (user.partial) await user.fetch();
if (reaction.partial) await reaction.fetch();
if (reaction.message.partial) await reaction.message.fetch();
?
Yes
ah okay, I thought a extra handler xD
So okay, now how to edit a message by their ids, did not this one time xD
reaction.message.edit() so easy? @quartz kindle
Yes
In DJS, I can't get the member count for a guild without the intents right?
incorrect
you just dont have members cache
so memberCount will work?
should yah
im pretty sure hyperlinks like that can only be sent on embed descriptions
Yes, hyperlinks are embeds only
ah okay
So a bug caused by my update to the intents gateway resulted in my bot getting flagged/quarantined. How likely is it that my appeal will be successful at this point?
@ me when responding please.
They will most like approve it @waxen tinsel
A friend of mine accidentally spammed the API by fetching message history thousands of times and got his bot flagged. He appealed and eventually got his bot unflagged
ah okay
For title, you need to pass the url property to the embed, it's little different than a markdown hyperlink
500+ hours of work for this to happen :(
My bot essentially DMed people every time they reacted to a message..
Whenever someone causes an error via reaction or message, I ask them for permission to send me the errors and explain the info involved so that they have more control over their info and privacy. I was unaware of the bug for 3 hours, and this was happening to 5.8k people. I took bot offline the second I found out, but was too late apparently
Rip
The worst part is timing. Content creators are covering the bot on Tuesday.. I need the bot unblocked by then.. but I have gone 2 days with no response from discord. Any idea or estimates on how long they may take?
did you got API locked or completely flagged?
Damnit
you should try asking in the developer server
you have a bigger chance to get in contact with an employee
Can you dm a link?
Bruh I literally got screwed by a combination of intents and protecting user privacy ..
discord.gg /discord-developers
thank
👍
Hi, someone knows how to import images for discord.js
I want to import images from my pc
to attach them?
Pretty sure you just use FS for that.
What i did wrong i using v12
client.guilds doesn't have an array method
you're probably looking for client.guilds.cache.array()
okay thanks
print(f'Failed to load extension {extension}', file=sys.stderr)
SyntaxError: invalid syntax
Why do I get this error?
that's a python-specific question
SyntaxError: invalid syntax
You have some sort of invalid syntax in one of your python files.
I don't know if it's that one, but see if you have a stacktrace that points to the file
And check your Python version
process.exit()
Ok thanks
if you have a process manager like pm2 it might restart it
Yeah I knwo
ping me
bruh this aint for that
well you never logged it to the console
You only log the possible error
also I recommend you use the ID rather than the guild name to find it
@earnest phoenix are you trying to get your bot to give you a invite to the guilds it joins
Instead I recommend only generating invites if you run a command with the guild id or something
Not every guild the bot joins
or just generate a permanent invite and store it
I just need partial when the bot was offline and it want to fetch something??
Anyone know what this is?
It's happening when I try using my >rank command on a specific user
🤔 simple get?
what are you using simple-get for?
yeah
I'm not 🤔 I'm using canvacord for the rank card in my rank code
Idk what modules its using
does this user not have a pfp?
They do
i think its the loadImage function
the image you're trying to load probably doesn't exist
That's how my card card looks
But doesn't load for a specific user
No idea why cause it just happened today
um
the error seems to originate from your canvas, not the embed
poggers
Hey, please help me. How can i make live counter to my bot? Discord.js is the language
So i want to use this in Bot stats.
Canvas uses simple get
else if(message.client.member.permissions.has("MANAGE_CHANNELS")){```
Theres something wrong
Whatever you're trying to load returned 404
const now = Date.now()
const cooldownAmount = 3000;
let timestamps = new Map();
if (timestamps.has(user.id)) {
const expirationTime = timestamps.get(user.id).now + cooldownAmount;
if (now < expirationTime) {
const timeLeft = (expirationTime - now) / 1000;
return console.log(timeleft)
}
}
timestamps.set(user.id, {
user: user.id,
now: now
});
setTimeout(() => timestamps.set(user.id, {
user: "1234567898765",
now: now
}), cooldownAmount);
``` making a cooldown for reactions, why is this not working?
message.client.member? cant you just do message.guild.me?
and also permissions.has not hasPermission???
tfw
permissions.has() also works
hasPermission() is a shortcut for that not really, it gets all permission from the member's roles combined and check them
message.client.member owo what's that
any ideas? #development message
@tired panther my fucking god are you defining a new cooldown amount every time the command is run
and timestamps isn't set beforehand
no that is not in that command, just copied it
you literally just sent a big chunk of code without explanation lmao
its for a event
throw e;
^
SyntaxError: Error parsing /home/ubuntu/secret/package.json: Unexpected token < in JSON at position 108
at parse (<anonymous>)
at readPackage (internal/modules/cjs/loader.js:270:20)
at readPackageMain (internal/modules/cjs/loader.js:305:15)
at tryPackage (internal/modules/cjs/loader.js:315:15)
at Function.Module._findPath (internal/modules/cjs/loader.js:690:18)
at resolveMainPath (internal/modules/run_main.js:12:25)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:65:24)
at internal/main/run_main_module.js:17:47 {
path: '/home/ubuntu/secret/package.json'
}```
@prime glacier your package.json is wrong
const cooldownAmount = 9000;
let timestamps = new Map();
module.exports = async(client, reaction, user) => {
if(user.bot) return
////////////////////cooldown set
if (timestamps.has(user.id)) {
const expirationTime = timestamps.get(user.id).now + cooldownAmount;
if (now < expirationTime) {
const timeLeft = (expirationTime - now) / 1000;
return console.log(timeLeft)
}
}
timestamps.set(user.id, {
user: user.id,
now: now
});
setTimeout(() => timestamps.delete(user.id), cooldownAmount);
}
it can just set one time the cooldown, then it does not work
{
"name": "secret",
"version": "1.0.0",
"description": "",
"main": "server.js",
"dependencies": {
"ascii-table": "0.0.9",
"colornames": "^1.1.1",
"dotenv": "^8.2.0",
"figlet": "^1.5.0",
"genius-lyrics": "^3.0.0",
"google-play-scraper": "^8.0.2",
"nekos.life": "^2.0.7",
"quick.db": "^7.1.1",
"request": "^2.88.2",
"simple-youtube-api": "^5.2.1",
"superagent": "^6.1.0",
"twemoji-parser": "^13.0.0",
"weather-js": "^2.0.0",
"ytdl-core": "^4.2.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/HYPEDemonXD/secret.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/HYPEDemonXD/secret/issues"
},
"homepage": "https://github.com/HYPEDemonXD/secret#readme"
}```
sorry thats the full
what to do can someone help please 
E
Anyone know how to fix an Error 13 on a Raspberry Pi via Terminal?
Maybe organize them into categories
that bright red/orange bar with almost unreadable menu items is a no from me.
Hi, how can I convert an emoji format to the emoji name
Like  => upvote
I don't know regex 
Your library may already provide a regex for you. What library are you using?
The regex is quite simple though.
discord.js
Huh, they don't have the regex pattern public (used internally). It goes something like /<?(?:(a):)?(\w{2,32}):(\d{17,19})?>?/, which checks for custom emojis (including animated emojis) (https://discordapp.com/developers/docs/reference#message-formatting).
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
bu kod v12 mi
yea I already did that .replace(/<?(a)?:?(\w{2,32}):(\d{17,19})>?/g, '') but I can only replace the emojis from the message
I want to convert an emoji format to an emoji name
so? 
Yes, so you'd use that regex to match the string for tokens that did match. <String>.match will probably be what you want: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match
The match() method retrieves the result of matching a string against a regular expression.
https://million.is-a.computer/files/Efvr6YyxtTp08yJ.png stonks
http://localhost:1234/login?r=/logout
Please help. Its weird
why are you using .mentions.members if you need the user
!userinfo <mention>
why are you using like 3 if statements when you could use 1 map
So get the mentions.users.first()
yo'ure probably getting an error because the member isn't cached.
Now this is the problem
you have to check if the message actually has mentions
are you checking if any members are mentioned first?
without node pad, some which checs the syntax
How?
https://million.is-a.computer/files/TeiF7WLgiy2OXxx.png gotta love typos on prod
yes
ive heard people recommend sublime as a lighter weight ide, or atleast lighter than vsc
Lol yes..
I use vscode xD , bc sometimes , just wanna add one line code and do not have the mode to start vsc
https://million.is-a.computer/files/yxk6Cj79XZ9rtbU.png when you go to a negative page number
for quick stuff ill use vsc
because fast
makes sense
The place that just fired me, they had a typo in production. An H1, basically the page title, that said "Connetion" instead of, y'know, "Connection"
my laptop takes ages to boot up vscode 
can ya help?
LOL
just check the size of the mentions
I should have not fixed it. oh well.
im not going to spoonfeed ya
my laptop opens vsc instantly

loggers
I have a mac air 2015
running linux
fun
idk how to do client side rendering so im making my pages server side
i dont understand it either
isnt server side rendering harder 🤔
ig its less resource intensive to use client-side rendering
you just send the files once
and the client renders different stuff depending on the route or something
does anyone like doing meta tags?
guys how can i fix that
if its for opengraph, yes
original image is this
whats opengraph?
what flag is this?
this thing some websites use for displaying content preview
like
when you send a link on discord
o
yeah thats what I mean
I need to do that
<meta name="og:title" content="Epic Website" />
yea
it seems like so much work to do it for like 10 pages
ok
 Why its not working?
this is why we use SPAs 
SPAs?
"single page applications"
🇦🇿
that
Basically make your damn site in React and stop editing each HTML file separately 😂
damn pleb
ejs go brrrrr
EJS is like PHP templates for javascript
It's 2020 if you don't want to get laughed out of a tech interview for "making ejs sites" better start learning React or Vue.
LOL
Hey i need help setting up the webhooks for voting data (Python)
sa
Dont talk Turkish in here
@midnight imp saol knk ❤️

how would i organize my text on top.gg in categories?
use bulleted lists or a table?
tables are cool
use what?
- commandName
Can anyone teach me how to use discord OAUTH-2?
anyone know the best redis lib for nodejs?
So i need vps advice, i have my bot on 200+ servers atm and my cpu is lagging behind with all the calls it receives, i was thinking of using with galaxygate or vultr but im not sure on either or if theres a better option what do y'all use?
lmfaoo 
LMFAOOO
i cant bruh
wait is that a AI bot?
yea
well the chat command is using googles adaptive api
most of the responses are from the api i made

nice
i use adaptive for like auto monitoring chats
ye
LMFAO
@willow mirage shiv about to explain what is bad about life
to a bottum
hes been typing for atleast 5 mintues

wait it is learning or wha
im not going to sleep so i can see this lmfaoo
but it is kinda nice bro
LMAO
oh god
@young flame i wanna join that server just to see shiv talking to the bot
alr ill inv you
he is
pog
so?
he just joined to help me test commands
my bot got in
Does anyone here want to team up with me to create a game bot?
Language => Discord.js
Pog
@earnest phoenix lmfao
PFFFFF
What game?
"howls"
Just a game, we can come up with our own concepts
this is the best thing ever
LMFAO
might as well jump into UE
why do people restrict themselves to discord but get these amazing ideas for games
actively tries to start relationship
I just like coding in general, I don't particularly care about the language or platform
@weak parrot
There is something wrong with this guy... Doesn't he know machines don't have feelings and that this bot is just going to turn on him
lol it already did
LMAO
LMFAO

What?
can I get a server inv pls
yea hold on
So I get this error when I run my administrative command, and as far as I can tell noting is wrong, but the block of code that it is referencing is definitely strange, as its referencing my custom prefix block.
const prefixes = await botdb.queryPromise(`SELECT * FROM server WHERE serverid = ${message.guild.id}`).then(async function(results){
if(!results[0].prefix) {
return config.prefix;
}
else {
return results[0].prefix;
};
});
Help
the message wasn't in a guild
you should also sanitize your queries
It is however.
🤔
Running it in a private discord server.
are you on v12?
Latest
[2020-12-20 15:32:37.796]: LOG I have updated fuzzyfurry069#0420's command count!
Lifetime Commands: 276,
Daily Commands: 276
[2020-12-20 15:32:37.798]: LOG I have ran: .help
[2020-12-20 15:32:37.799]: LOG Server Info: Discord Bot Test, 681643102787862530,
Encode URI: Discord%20Bot%20Test,
Message Author: fuzzyfurry069#0420,
Encode URI: fuzzyfurry069#0420
It logs everything as it should be though.
are you using intents?
smol brain
discord.js v12.5.1
sad spim noises
lmao
Does anyone know how to get a MongoDB's latency and have it show up in a ping command
haha sans go bRrRR
how can i get my website to show up when u google it?
rn it does, but its like bottom bottom
like u need to do "domain.com"
for it to sho
i'd like to know too 
Use Search Console to monitor Google Search results data for your properties.
SEO
i have the keywords im looking for
What is SEO? SEO refers to search engine optimization, or the process of optimizing a website in order to make it easy to find via search engines like Google. How do you optimize your site content for Google SEO? Welcome to the Google SEO Guide, your complete, all-in-one guide to ranking competitively in Google’s search engine.
and do proper SEO
yes
to get traffic in the first place you need to have good SEO
check out google lighthouse
tells you what google doesn't like about your site
pretty good
they probably lost out on performance huh


