#development
1 messages ยท Page 1782 of 1
Ask stupid questions get stupid answers
lol
lol
6/14/2022
idk
Like come on dude if you need to buy common sense your in luck my shop's open
1 knuckle sandwich is $100
I black eye is $200
Nevertheless Pop Plays call me whenever your ready
kk
any one ther
One message removed from a suspended account.
heyy
do you know how to write code so your bot auto deletes the command start up
so if i go !ping it will delete the !ping and say Pong
One message removed from a suspended account.
could u help me with it
One message removed from a suspended account.
name: 'ping',
description: "a command used to Ping the bot.",
execute(message, args){
message.channel.send('Pong!');
}
}``` This is what i have for ping command rn
.js
One message removed from a suspended account.
One message removed from a suspended account.
ok thx
message.delete().catch(O_o=>{});
Not so secret anymore I guess
lol
new Client({
partials: ['MESSAGE', 'CHANNEL', 'USER', 'REACTION'],
})```
```js
if (messageReaction.partial) await messageReaction.fetch();
if (messageReaction.message.partial) await messageReaction.message.fetch();```
im doing this but still the old non cached ones wont work
i am making 2d minecraft inside discord
am i in my right mind
umm
with only 50 lines of code?
@slow spindle communuty.ru
@coral trellis scam website above
so many of these guys
class Command {
public:
Command(const std::string & name, const std::string & desc = ""): m_name(name), m_description(desc) {}
std::string m_name;
std::string m_description;
virtual void command_exec(const std::vector<std::string> words) = 0;
void run(
const dpp::message_create_t & event,
const std::function<void(std::vector<std::string>)> & callback
) {
const std::vector<std::string> words = content(event);
callback(words);
}
inline std::vector<std::string> content(const dpp::message_create_t & event) {
std::stringstream ss(event.msg->content);
const std::istream_iterator<std::string> begin(ss);
const std::istream_iterator<std::string> end;
const std::vector<std::string> words(begin, end);
return words;
}
bool canRun() {
return true;
}
private:
static int commandsRan;
};``` @latent heron
what in the unholy fuck is this
oh no
I have numerous questions and concerns
this is r/programminghorror at its finest
why is the word content as a constant
how bout this:
var
const is fucking stupid
if you're able to have dynamically changing values
DYLAN YOU ARE DUMB
THE WHOLE POINT OF A CONSTANT
IS THAT ITS CONSTANT
IT DOESNT CHANGE
EXACTLY
var sucks
let is better
????????????????
BUT THE MESSAGE CAN BE CHANGED
YES
BUT LET AND CONST ARE BETTER THAN VAR
THEN IT'LL BE UPDATED????
VAR IS BETTER THAN YOUR BOTUM
ok
holy shit dude
that's kinda true tho
i've triggered dylan
var is literally auto

lmao
i've succeeded
bad then
i personally find more excitement in PHP than C++
no wonder you use php
LMAO
don't even use php correctly
what's the correct way of using it then
templating
ehhh
i disdain template engines in php
since when did we have a spam channel
lmao
go on
no

we are once again reminded that javascript sucks
pings erwin
I thought they were talking about rust lol.
I am once again reminded that I can't read.
they were talking about C++ and i somehow interpreted it as javascript by seeing 913's var statement
also what the fuck it's 12 am
never have i been so offended by smth i 100% agree with
The reasons are indescribable.
detritus bad
i smell haters who never tried the lib
var intervall = setInterval (function () {
client.guilds.cache.forEach(guild => {
let checkif = db.fetch(`voiceactivity_${guild.id}`)
if(checkif === true) {
let voicegain = db.fetch(`voicegain_${guild.id}`)
const voiceChannels = guild.channels.cache.filter(c => c.type === 'voice');
let idUser = [];
for (const [id, voiceChannel] of voiceChannels){
voiceChannel.members.forEach(member => {
idUser.push(member.user.id)
});
let membercount = idUser.length;
for (var i = 0; i < membercount; i++) {
let member = client.users.cache.get(idUser[i]);
let verif = db.fetch(`balance_${guild.id}_${member.id}`)
if(verif === null) return
if(member.bot) return;
console.log(member.id + member.tag + ` ${voicegain}`)
db.add(`balance_${guild.id}_${member.id}`, voicegain)
let lchannel = db.fetch(`lchannel_${guild.id}`)
if(lchannel === null) return;
let asend = guild.channels.cache.get(lchannel)
if(asend){
const color = db.fetch(`embedcolor_${guild.id}_${member.id}`)
asend.send({embed:{ description: `${member} vient de gagner \`${voicegain} coins\``, color: color, author: { name:`โฐ 15 minutes de vocal` }, footer: { text: `๐ ${getNow().time}` } }})
}
}}
}
})
}, 90000);```
Why its spamming x5 messages ?
This should add a sum of money to the voice person every 15 minutes
dont use var
also you have a loop there in ur code
Yes
:////
also this indentation is killing me
I only want get all user in voice channel 
Yes but you are making our eyes bleed :)
pls lint ur code
var intervall = setInterval(function () {
client.guilds.cache.forEach(guild => {
let checkif = db.fetch(`voiceactivity_${guild.id}`);
if (checkif === true) {
let voicegain = db.fetch(`voicegain_${guild.id}`);
const voiceChannels = guild.channels.cache.filter(c => c.type === 'voice');
let idUser = [];
for (const [id, voiceChannel] of voiceChannels) {
voiceChannel.members.forEach(member => {
idUser.push(member.user.id);
});
let membercount = idUser.length;
for (var i = 0; i < membercount; i++) {
let member = client.users.cache.get(idUser[i]);
let verif = db.fetch(`balance_${guild.id}_${member.id}`);
if (verif === null) return;
if (member.bot) return;
console.log(member.id + member.tag + ` ${voicegain}`);
db.add(`balance_${guild.id}_${member.id}`, voicegain);
let lchannel = db.fetch(`lchannel_${guild.id}`);
if (lchannel === null) return;
let asend = guild.channels.cache.get(lchannel);
if (asend) {
const color = db.fetch(`embedcolor_${guild.id}_${member.id}`);
asend.send({
embed: {
description: `${member} vient de gagner \`${voicegain} coins\``,
color: color,
author: { name: `โฐ 15 minutes de vocal` },
footer: { text: `๐ ${getNow().time}` },
},
});
}
}
}
}
});
}, 90000);```
Yes i see that 
you get lost on ur own mess without linting
first, like i said, fix your var
and foreach
Im not on my computer now but ok
also idk what db u have, but you sure those arent promises?
But how fix my foreach 
im trying to make a warn command with case numbers, and when someone warns a user, it adds 1 to the case number, and puts it in the database
do something like
message.inlineReply(text).then(async random => { random.edit(new text) }
pretty sure that works
ok
I think i found something people are using to bypass Top.gg's System.
And Verifying there own Bots.
Declare the (case) ID as primary key in your database and add auto increment to it.
@earnest phoenix Can you describe it to me in DM?
Sure!
How much of it makes logical sense
what if i told you im using it
lies n deceit, you arent in the server
Had a quick look into this, and using it with JavaScript isn't too bad. Still get the intellisense stuff if you are using an editor that support it.
any ejs gurus here?
<%=card("<%=guild.id%>")%>
how can i have a template inside a template
What are you trying to do? Pass the actual guild ID to the card function?
use template literals
<% card("`${guild.id}`") %>
The first message I see, when I open the chat, shame 
lol
How to detect member voted to server?
how do i get my bot to reply like this
depends on the library you're using. If you're using the raw rest, you need to send a payload similar to:
POST /channels/:channel_id/messages
{
"content": "This is a reply."
"message_reference": {
"message_id": "854279202114371584"
}
}
I am using discord.js
message.reply
You need to install discordjs/discord.js then
npm i discordjs/discord.js?
yeah
@lament rock
install git
Same error
restart your cmd window after you install git
Same
did you install git from https://git-scm.com/
I installed npm i git
That's not what you needed to do 

Npm i git/scm?
no lol
go to that link and download the windows version
npm install Photoshop
I host my project on Glitch
okay... and?
just now re-read that. Thought you said GitHub. Not Glitch. I'm tired. Look up how to install git on glitch
const fs = require('fs');
const Discord = require('discord.js');
const emojis = ['โ', 'โ', '๐', '๐', '๐', '๐ญ', '๐ฎ', '๐ผ', '๐', '๐ผ', '๐ค'];
module.exports = {
name: 'ehelp',
execute: async (client, message, args) => {
const embed = new Discord.MessageEmbed()
.setTitle('Help Menu!')
.setDescription('Which Category you want to check!')
.setColor('RANDOM')
.setFooter(message.author.username, message.author.displayAvatarURL());
const m = await message.channel.send(embed);
for (const reaction of emojis) await m.react(reaction);
const filter = (reaction, user) =>
emojis.includes(reaction.emoji.name) && user.id === message.author.id;
const collector = m.createReactionCollector(filter, { time: 60000 });
collector.on('collect', reaction => {
reaction.users.remove(message.author);
if (reaction.emoji.name === '๐') {
embed.setDescription(getcmd('FUN'));
m.edit(embed);
}
});
collector.on('end', () => {
if (!m.deleted) {
m.reactions.removeAll();
}
});
}
};
async function getcmd(dir) {
fs.readdirSync(`../../commands/${dir}`).forEach((file) => {
console.log(file.name)
})
}
Error : no such file or directory
Your path is incorrect, fs paths are relative to where you started the code
Use __dirname
Where
I'm assuming the command handler is the one from the discord.js guide?
You have a client.commands property, where all your commands are stored. You can simply get the command info from there
But
give something like a "category" to each command and then filter them based on that category
Only for 1 category
client.commands.filter(c => c.category === "fun")
but before that you have to give each of your commands a category
Then I map or join?
yup
I have
client.commads.set(command.name.toLowerCase, command)
You get the role after the bot reviewers review your bot
How can I set category
toLowerCase is a function, call it otherwise the handler won't work
Mine was working
How do you even code a bot?
[root@NOVABOT ~]# yum install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm
Last metadata expiration check: 0:00:15 ago on Tue 15 Jun 2021 09:56:02 AM UTC.
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[FAILED] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
anyone that can help me?
i like people
you need to add a category property to all your commands
category: "some category here"
anyone know react?
don't ask to ask friend
lel
okay so, im trying out suspense but every time an api call is made in useEffect the suspense fallback is called making it look like the component has unmounted. but this is not good with pagination
currently when i click on next page the page shows loading until the data is populated
before the table loads again
how do i detect server webhook, like if smn voted server it give its role by !vote
okk
can i get code for it as an example pls?
Do you use .js or .py ?
Just wondering cuz i want to know which is more popular
Oh

is this a new feature?
.js
thanks
can i get code as an example pls
@terse lynx either use https://www.npmjs.com/package/discord-buttons or Discord.js's master branch for buttons (https://github.com/discordjs/discord.js/pull/5674).
Wrong mention?
ah
yeah wrong mention
thought they were asking for an example on how to use buttons
ops
i want to know about this.
why does setting a property on this array throw an invalid lhs error?
stuff ? stuff : (stuff) && stuff[] = stuff
wait, does anyone know how to intergrate google sign in with a website, google is giving me auth issues about my website not authenticated with the app, even though its explicitly shown on the google console...
stuff[] that's invalid syntax
you need to have an expression in there
well there's an assignment in (stuff) && and it works
i fixed it by using if statements
assignments are not the problem
...yes but there's nothing inside, unless you left that out on purpose
left that out on purpose
here's the actual code if you want:
map[y][x] = "air";
where y and x are numbers between 0 and 9
i need a way to like send stuff from my backend to front end
i want to use fetch()
but i cant seem to get it to work
any ideas?
show code
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR! [OperationalError: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR! cause: [Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json',
npm ERR! parent: 'express'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/14.15.2/_logs/2021-06-15T12_27_01_727Z-debug.log```
the precedence of && overrides = so your code is being interpreted as
stuff ? stuff : (stuff && stuff[1]) = stuff
which isn't valid
an assignment is an expression so it's valid wherever other expressions are valid
me?
yes
uhh
wait so basically right there's one more tihng
so im using flask right
ait
wait
ok ok
??
Uncaught TypeError: fetch(...).data is undefined
run: (client, message, args) => {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command")
let cmdname = args[0]
if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd <cmd_name> <cmd_responce>\``)
let okembed = new discord.MessageEmbed()
.setDescription(args.slice(1).join(" "))
let cmdresponce = `${okembed}`
if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd <cmd_name> <cmd_responce>\``)
let database = db.get(`cmd_${message.guild.id}`)
if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.")
let data = {
name: cmdname.toLowerCase(),
responce: cmdresponce
}
db.push(`cmd_${message.guild.id}`, data)
return message.channel.send("Added **" + cmdname.toLowerCase() + "** as a custom command in guild.")
}```
error ```DiscordAPIError: Cannot send an empty message```
let prefix_data = JSON.parse(fetch("my bot's url i dont wanna share").data.response);
@woeful pike
that's not how js works
im just trying to get the response in json format
or promises rather
i mean how do i get the response?
const res = await fetch(url)
const data = await res.json()
you should look up how fetch works
i need the await?
yes
kk
promises are crucial you just gotta learn em
yep
im still learning js
i know the basics
and syntax
but nothing like remotely advanced
promises are just basic async stuff
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR! [OperationalError: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR! cause: [Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json',
npm ERR! parent: 'express'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/14.15.2/_logs/2021-06-15T12_40_30_329Z-debug.log```
help
const bot = new Discord.Client();
bot.login('Token');
/*Codio de comands*/
bot.on('message', message =>{
let responseObject = {
"hp mnt" : "Estou em Manutenรงรฃo Aguarde...",
"hp yt": "https://www.youtube.com/channel/UCIXoIMkvAJbMZqVlpoaSDvQ/featured",
"hp jรก tomou a vacina?" : "Nรขo exite vacina contra meus virus. ;-;",
"hp pow pow" : "Morri",
"hp pei pei" : "Pow Pow",
"hp eu peidei?" : "Claro moh catinga!",
"hp o Pedro peido?": "claro moh fedozรฃo!"
};
if(responseObject[message.content]){
message.channel(responseObject[message.content]);
}
});
help
plz
I hope those aren't your commands
IM FREEEEEEE
lol I love how people randomly pop in here, paste a codeblock and type help with no explanation or context

like, I know the issue just by looking at it
console.log('hello world')
help
but that's so fckin cringe
ty xet tho
I refuse to read like I knew brazillian
and kuuhaku
mostly xet, I barely helped this time
These are my commands, but I didn't put the token
yesterday tho
and the days before
AHH
ily lmfao
im so fuckin tired of js
imma go back to the easy and simple brainfuck
way easier than js
I asked for help upstairs
cara, nรฃo fica pingando os outros
if(responseObject[message.content]){
message.channel(responseObject[message.content]);
}
seu problema ta aki
oq eu fiz de errado
nah, melhor n
dnd
OMFG BEST DAY OF MY LIFE
cool
Anyone?
i can remember the day ive managed to understand how Chart.js works.
i where scratching my head 1 week for this:
well its empty but its generated by a bot
ah
id love to use chartjs for my bot
but i do py
so sad
is there a way to do it in py?
like an api?
where a pain in the ass to get working, but when it worked it where nice. sadly i never made the bot public
like can i make it into an image?
why didnt u?
the codebase where a mess, and i need to rewrite a large part of the bot
i send it as a image in a embed
but how to do it in py idk, i would probably run a expess server and just make a api for it
then answer with either a buffer or a url for the image
how do u turn it into an image?
canvas
oh
use dash
basically the perfect tool for that
dash?
look it up
throw err;
^
Error: Cannot find module '/app/node_modules/enmap/src/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:303:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/app/index.js:6:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32) {
code: 'MODULE_NOT_FOUND',
path: '/app/node_modules/enmap/package.json',
requestPath: 'enmap'
}```
"colors": "^1.4.0",
"discord.js": "^12.5.3",
"express": "^4.17.1",
"http": "^0.0.0",
"images-scraper": "^6.3.0",
"moment": "^2.29.1",
"ms": "^2.1.3",
"node.js": "^0.0.1-security",
"enmap": "^5.8.5"
},```
wat
Wat
Noob/Beginner: 10k lines of explanation, hell na, let's ask another server. ๐
Is smth wrong with my vps?
When it goes down, it has ssh connection issues. I canโt connect to my machine. Why is that happening?
Alright
there was a module that showed it, I don't remember the name exactly
you can probably get it from the process
in js you can use ```js
process.cpuUsage()
{ user: 312561814, system: 57586572 }
?
And as I would know what the limit of the cpu is, it is like making a progress bar
depends on the bot size, your intents, and what your bot does
for example, the presences intent costs a lot of cpu
5000 guilds with presences on would use about 10-20% cpu just from being online
without presences it would use about 1-2%
but it depends on many other factors
run: (client, message, args) => {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command")
let cmdname = args[0]
if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd <cmd_name> <cmd_responce>\``)
let okembed = new discord.MessageEmbed()
.setDescription(args.slice(1).join(" "))
let cmdresponce = `${okembed}`
if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd <cmd_name> <cmd_responce>\``)
let database = db.get(`cmd_${message.guild.id}`)
if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.")
let data = {
name: cmdname.toLowerCase(),
responce: cmdresponce
}
db.push(`cmd_${message.guild.id}`, data)
return message.channel.send("Added **" + cmdname.toLowerCase() + "** as a custom command in guild.")
}```
error ```DiscordAPIError: Cannot send an empty message```
i did some Machinelearning with a small bot, the Machinelearning part hammered the CPU really hard (like 95-100% Utilisation for 2-5 seconds)
it depends on how much you put on the system, like just sending messages and using external APIs will be relatively lightweight, image manipulation can be already quite taxing
why are you turning the embed into a string, what the hell is going on with that code
String literals are all over the place, you're using template literals when you don't need them, and regular strings when you do need template literals
Hi there, I'd like to get some help:
So if for example I send a message like this:
Age: 27
Country: United States``` How can I make my bot to get the values that are next to the "**:**" sign, store them for a moment and send them to other channel?
๐จ You can now import JSON directly from JavaScript. This works via a new import assertions feature - already in Chrome 91!
Learn how to use it from this feature explainer by @dandclark1 from Microsoft: https://t.co/vL2mpx1Dwx
140
js?
text.split(":")[1]
Yes
Goodness.
I need help with this.
const bugHunterModelExample = {
userID: "528256079101034506",
bugs: [{ approved: false }, { approved: true }, { approved: false }, { approved: true }, { approved: false }, { approved: true }]
};
How can I calculate the amount of true in approved: true ?
const trueAmount = /* Calculation on the amount of "true" in the value of a property in a nested object in an array. */
array.filter and array.length?
I'm adding more properties.
still
There's like reason and more.
use a separate table for that
MongoDB.
because that json would become huge
document*
just make a new collection for the bughunter thing, add the userid and the approved stat as fields, maybe a unique id for the bug they reported
thats what I said...
so you have a document for each thing, then you can just search for the userid
i know, but i guess he doesnt get it otherwise
I see
I'm-.. ah.
see
Goodness, dude, give me some time to understand.
instead of one big fat bughunter object
I think a class would work for an object maker...
have many smaller bughunter objects
i dont think it would be a good idea to have 1 document that is 1GB in size
how did you start the cluster?
Lol docs are limited to 16mb
Total is 20 objects.. not more.
20 objects yet
.. I made a check if array.length > 20 return
I don't need some no life people just sweat on finding bugs.
20 is maximum.
.. but.
.. to answer my question.
Like this:
Can I do something like this.
I was thinking about that
like, isn't the whole idea of bughunting to find bugs?
why limit 20 per user?
did you tried to run without the --replSet argument?
Momento..
So.. the strategy I'm doing is wrong, right?
.. since each bug will push an object to the array.
.. and the array will keep getting filled and filled.
that's why we said to use smaller individual objects instead of a big fat one
remember json gets loaded to memory
yes bcs it doesnt run in a replica set
if you want to remove it you have to drop the local table from the master node
db.dropDatabase();``` in the mongod shell
Now what do you mean by this?
this however could remove some important stuff like permissions iirc
Oof, i have few users setup
that if you want to count the amount of bugs the user collected
wait nvm they are in the admin collection
like, instead of getting all bughunts everytime you want to get the amount, just have a numeric field on the user object
Oh..
increment a number if the bug got accepted or so
Mhm.. alright!
if you break down the one large document into its own collection you could refer the user to the bug he reported, if you plan to add rewards for reporting bugs it could be helpful
thanks it works
but why did you want to get out of the replicaset?
you give up high aviability and better i/o distribution
I wanted to use a different replica
ok?
if(command === "start"){
const game = []
const data = Schema.find({Guild: message.guild.id})
if(!data) return message.channel.send("**Game is not setup yet**")
if(data.length < 2) return message.channel.send("**You can't play alone\nMaximum player is 2! **")
data.forEach(g => {
console.log(g)
game.push(g)
})
const gamer = Math.floor(Math.random() * game.length)
console.log(game)
message.channel.send(game[gamer])
}```
Error : data.forEach is not a function
I'm using mongodb
it returns a promise
that's the data
for my bot support website i use wix
bc i can't make websites
so i made this embed is there anything i should change on it bc i think it looks bad
@earnest phoenix any error?
ok thanks
no
Looks better
have you tried console logging
i made my bots with botghost
console log the stuff in botinfo
just get vsc and learn how to use the debugger
can someone help me ?
no
run: (client, message, args) => {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command")
let cmdname = args[0]
if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd <cmd_name> <cmd_responce>\``)
let okembed = new discord.MessageEmbed()
.setDescription(args.slice(1).join(" "))
let cmdresponce = `${okembed}`
if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd <cmd_name> <cmd_responce>\``)
let database = db.get(`cmd_${message.guild.id}`)
if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.")
let data = {
name: cmdname.toLowerCase(),
responce: cmdresponce
}
db.push(`cmd_${message.guild.id}`, data)
return message.channel.send("Added **" + cmdname.toLowerCase() + "** as a custom command in guild.")
}```
error ```DiscordAPIError: Cannot send an empty message```
ima try to make a game on botghost
this u said to me
add breakpoints and see where it breaks
what do you mean
There's this thing where you perform a command like !test and then you can input something without having to type the !.
What do you call it?
hm
should i make any changes to the website??
asking me? ๐
Anyone..
What do you guys to get your bot stats? For example, most used commands
didnt got you
use something like a time series database to track command usage, then just use something to visualize the used commands, i can recommend Grafana for it.
or if you are lazy there is a easy way
I'm looking for a site like https://statcord.com
Which actually works
well statcord works
you just have to set it up properly
if they fucked the API beyond repair you have to make something yourself i guess
then i guess use prometheus and grafana
did you use a code Editor?
yup
VSC?
yeah
good, there is a Buildin debugger
ok
this is how you use it
you can then just add breakpoints to the code and if the code runs over them the process is halted and you can inspect what is going on
didnt got it tbh
coz never had used that
its the fancy console.log("works")
did you have an api key?
Yes
does anyone know a what i could use to make a good website
Html/css are you familiar with it?
statcord.on("autopost-start", () => {
// Emitted when statcord autopost starts
console.log("Started autopost");
});
statcord.on("post", status => {
// status = false if the post was successful
// status = "Error message" or status = Error if there was an error
if (!status) console.log("Successful post");
else console.error(status);
});
``` adding these 2 evens might help you debugging
also it can take a while until stats show up and make sure to use beta.statcord the live version is bugged iirc
but if you have more issues, better join the support server from them
I used to be staff for them, support isn't the best.
lol and why did you then struggle with setting it up?
Been awhile, It stopped working on my old bot when it was working correctly
const Statcord = require("statcord.js");
const statcord = new Statcord.Client({
client,
key: "statcord.com----",
postCpuStatistics: true, /* Whether to post memory statistics or not, defaults to true */
postMemStatistics: true, /* Whether to post memory statistics or not, defaults to true */
postNetworkStatistics: true, /* Whether to post memory statistics or not, defaults to true */
});
// Client prefix
const prefix = "!";
client.on("ready", async () => {
console.log("ready");
// Start auto posting
statcord.autopost();
});
statcord.on("autopost-start", () => {
// Emitted when statcord autopost starts
console.log("Started autopost");
});
statcord.on("post", status => {
// status = false if the post was successful
// status = "Error message" or status = Error if there was an error
if (!status) console.log("Successful post");
else console.error(status);
});
```javascript
Cool key ๐
lul
does it work?
reset that key
o yea very nice key
reset
I just did
editing is not enough
I reset it
ok, you're fine then
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.listener(vote => {
// vote is your vote object
console.log(vote.user) // 221221226561929217
})) // attach the middleware
app.listen(3000) ``` can i get this like if i used it i will get role if i vote
bruh
you're not supposed to show your top.gg webhook auth
ah, sure
i am stucked at it
no, you need to assign the role just like you'd do with a command
the wbhook will give u the user id
like voting rewards
yes
is there any tutorial available?
can you share the code pls..?
i am searching from last few hrs
Who knows how to erase all data on quick db ?
just delete the db
Didnt work
how didn't it work?
isn't quick.db a SQLite extension ?
Yes
just delete the database file
There is a file named as sqlite
SQLite saves the db as a file
just delete it
Lol thanks you it worked
ref to #development message
copied lol
discord webhooks don't require you to be a member of the server or have any perm
all you need is the url to mass spam it
and no, it won't work the way you're thinking
top.gg webhooks <> discord webhooks
i finished my website for now
gfu
it was hard
i dont understood what you meant
top.gg webhooks are not the same kind of webhook as discord's
actual webhooks, as in "http request listeners"
a server listings for requests
in this case votes
and discord Webhooks are just the opposite
We're sending the request and they're listening to it
tbh it's a shitty name discord team chose to use for it
it has almost 0 similarity with webhooks
oh
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.listener(vote => {
// vote is your vote object
console.log(vote.user) // 221221226561929217
})) // attach the middleware
app.listen(3000) // your port
i have this
but
// vote is your vote object
console.log(vote.user)```
/dblwebhook
how to get this name.
anyone?
added this to my bot
You mean the path?
The path can be anything
It's your server IP and webhook port, as it says
So your VPS IP and the port would be the port you use for express
ohh getting it lemme try
the tag turned out to be DiscordLmao
hey, you keep showing stuff with links to your bots. its kind of becoming ads.
no im showning my dev progress of my bot
which is an ad
i only have embeds right now
its still an ad
if you want to update people, do it in your support server. not random development channels
I am doing an add role command, I want to know how I can use the highest property, for example, if a user has a higher role than mine, I cannot add or remove roles with the bot
just check role index
i took all my images with links down
my reward role option is still not working
if (!highest) return message.channel.send(`Your role is lower than the user menetioned`);
how can i do that
i only have a few commands right now any ideas guys??
I don't think that's enough
i need ideas
3 of the 5 are just fixed text
im adding more
isn't your bot about moderation?
yes and it can be for fun too
just create commands around those two categories
ok
think what you'd use in a bot
ok
can anyone give me or help me with server voting code
i added a y/n command
i am new to js pretty much
bruh, look, I don't think they'll consider totally generic commands as custom
also 8ball is yes/no
oh
That's one tall embed
coolio
and now "thats one weird way to say rest and websocket latency"
May I interest you in a lib called detritus?
there's only a few commands right now
It's still not too late.
??

what is it??
It's a library
a better js lib than discord.js
nyone?
uh guys i use bot ghost

i have said that many times
@pale vessel tag, you're it
No, no.

if (!message.mentions.members.first().roles.highest.position) return (`Your role is lower than the user menetioned.`)
how can i fix it
It actually looks good for a BotGhost bot. Did you pay for a subscription?
ain't that too much for botghost?
yeah but...it's not the same thing for interactive games
why are there 3 goals
like dank memer
actually you could use custom emoji
shush, dont discuss the logic of it
that last shot didn't look so straight
but that would need nitro
nope
OMG YOU guys don't get it
bots don't need nitro for custom emotes
Hahaha
๐ฅ
Almost like there is already a goal emote

Just grab that picture and stretch it ez
Hi! I'm making a profanity filter, and I'd like the bot to send a webhook with the author's profile picture and username if my function returns true. Anyone know how I could go about automatically creating the webhook?
which library?
discord.js
thx
inb4, that's virtually impossible
profanity filters are impossible to make without blocking every message
wdym?
for example
lets say you want to block the word "cock"
I can write it as:
- c0ck
- cรตck
- cรณck
- cรฒck
- c[]ck
- cรดck
- c@ck
- cยบck
- cยฐck
- cรถck
- c()ck
- c-ock
- cqck
that only changing 1 letter
and only using alfanumeric
you can imagine how much variation each word can have
ofc thats the word you use lol
and that not even considering other langs
143859^4
language filters are a stupid idea
depending on the audience I don't disagree with the idea when used appropriately.
just ban erwin
guys
I get an err, but idk y
because always worked
and not now
2021-06-16T00:28:36.140469+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
this is my help command made with pages
but messages are not empty lol
I've tried with 2 packages
and no one worked
?
Br?
sรณ ingles aqui, se quiser falar pt , fala em #general-int
man sรณ uma pergunta rapidรฃo
tem como um bot entra call e compartilha tela
nao
รฉ imposivel ??


if you send the error if one exists, or whats not working, and the relevant code here youll probably get an answer.
error: 2021-06-16T00:34:33.315698+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
2021-06-16T00:34:33.315705+00:00 app[Worker.1]: at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
2021-06-16T00:34:33.315705+00:00 app[Worker.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-06-16T00:34:33.315706+00:00 app[Worker.1]: at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
2021-06-16T00:34:33.315706+00:00 app[Worker.1]: at async ReactionCollector.<anonymous> (/app/node_modules/reconlx/src/functions/embedpages.js:34:13)
2021-06-16T00:34:33.315736+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
I've tried also with reconlx package, and same errore
error
honestly, this library kind of sucks.
it seems to delete every reaction and replace them every page change, which is miserably slow.
or well, it seems to attempt to replace them at minimum.
honestly though i dont see where a message is being sent without content
Replace ALL reactions just for a single button click?
they do have a support discord.
https://discord.gg/VBDhRc8
it doesnt actually delete and resend them, but it does attempt to add all reactions every click.
https://github.com/jowsey/discord.js-menu/blob/646d451f34ed00534cf8b4d7b298e8a747e755c6/index.js#L153
djs might internally keep track of this and not readd them all?
only if needed
Like, my lib has a optional mode where it deletes the user reaction after he clicks, but doing that for all reactions sounds way too unnecessary
yeah, this library seems developed for bots which are intended to only be in one guild, the errors are all caught and sent into console.log.
which makes no sense for any public bot.
Lul
why would you want to log every time someone doesnt give the bot manage messages every time they run a pagated command.
https://github.com/jowsey/discord.js-menu/blob/646d451f34ed00534cf8b4d7b298e8a747e755c6/index.js#L135
for what the library seems to be made for its fine though. but its so close to being pretty decent.
yo woo
i need a help if u can help
@client.command()
@commands.guild_only()
async def mod(ctx):
embed=discord.Embed(color=discord.Color.blue())
embed.add_field(name="test",value="testing the test .",inline=False)
embed.add_field(name="testing ",value="not sorryshdiuhsdh",inline=False)
message = await ctx.send(embed=embed)
await message.add_reaction("โ
")
i want the bot to dm the person who reacrted
reacted*
๐ i still dont know python
There's a wait_for method that can accomplish this.
https://discordpy.readthedocs.io/en/stable/api.html?highlight=wait_for#discord.Client.wait_for
They have an example on waiting for a user to react to a message.
alr ty:)
pls see
I still don't know python

How do i fix this? It happens with every command
I tried regenerating the token
I tried changing the code
I tried deleting and remixing the code
I tried RESETTING the code
But its replying twice
Do you have two help commands in code?
sir did you know java then ?
Nope
would be better to show the code
Some guys saying its running multiple instances
can you synchronously use import in mjs files like require
After you reset the token, did it fix for awhile?
//Message
client.on("message", async msg => {
if(msg.author.bot) return;
if(msg.channel.type === 'dm') return;
let prefix = await db.get(`prefix_${msg.guild.id}`);
if(prefix === null) prefix = config.prefix;
//Mention Bot For Prefix
if (msg.content.startsWith(`<@${client.user.id}>`)) {
let tagEmbed = new MessageEmbed()
.setAuthor(`${client.user.username}'s Prefix`)
.setThumbnail(client.user.displayAvatarURL())
.setDescription(
`This Server's Prefix: **${prefix}**\nGlobal Prefix: **${config.prefix}**`
)
.setColor("RANDOM")
.setFooter(`Help command: ${prefix}help\nGuild Name: ${msg.guild.name}`)
.setTimestamp();
msg.channel.send(tagEmbed);
}
if (!msg.content.startsWith(prefix)) return;
const args = msg.content.slice(prefix.length).trim().split(/ +/g);
var sender = msg.author;
var ownerlist = config.owner;
const command =
client.commands.get(args[0]) ||
client.commands.find(
c => c.help.aliases && c.help.aliases.includes(args[0])
);
And i cant show more
I saw the problem
nevermind it's not the actual bug
Uh
Some guys say "use killall node" but my phone cant open terminal it freezes
But tomorrow ill get a pc maybe so i could try
u using replit?
even discord hates them and mass banned most of their server ips THRICE
Even after making the music commands still worked fine
I tried using fs cmd handler
I tried using glob cmd handler
are you sure the prefix is NOT a bot ping?
if the bot crashes because it's not ready yet, its declined
The bot ping is to make users know prefix
no quesions asked
module.exports = {
name: 'link',
description: '**ONLY DEVELOPER**',
run: async (client, message, args) => {
const guild = message.guild.id
const channel = guild.channels.cache.find(ch => ch.type == "text" && ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")).createInvite({
maxAge: 0,
maxUses: 100,
}).then((invite) => {
message.channel.send(invite.url)})
}
}```
err: cant read property of cache
your choice when to submit
ah yes getting the cache from a guild id
I think its wrong
Its not msg.guild.id
Its msg.guild
So then msg.guild.channels.cache
Cuz it would be
msg.guild.id.channels.cache
So its wrong
Delete the .id
even better: let { guild } = message
umm
saves you from retyping guild
@lethal trout ill send u
another problem: you arent checking if the find function returned nothing
so if you execute link command in a server with no create invite permissions then your bot crashes
yea i was testing then ill add
module.exports = {
name: 'link',
description: '**ONLY DEVELOPER**',
run: async (client, message, args) => {
if(message.guild.me.hasPermission("CREATE_INSTANT_INVITE")) {
const guild = message.guild
const channel = guild.channels.cache.find(ch => ch.type == "text" && ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")).createInvite({
maxAge: 0,
maxUses: 100,
}).then((invite) => {
message.channel.send(invite.url)})}else return
}
}```
is this ok
I sent him the correct code
you should store the value of find in a variable then check if it's empty

this is why people never learn
they just get spoonfeeded
This is why i cant fix the double reply
please tell me you use tabs in your code
?
or better if you have node v14 then you can use find()?.createInvite
i am coding on the host it self so it wont be neat
every ide has a formatter

replit has one that ignores the entire country of jsx but ok
ay if i upgrade my macos to big sur what would change?
im at mojave rn
so is there anything, like my node, java, lavalink, or anything vsc or terminal related?
that will change?
im at macos mojave rn
It depends, 'cause it always does. But you should be able to use them (I use Node.js, Java, VSC, etc.). It's good practice to keep your operation system up to date.
instead of sudo you'll get brew
i thought snipe command was like banned right?
sorry I meant apt
sudo still exists
..
against tos
privacy terms i think
The UI gets hella better
then how did dank memer add it back? it was removed for months now it is back 
I'm not sure if it's disallowed, but their privacy policy may conflict given the definition of user consent.
ooh
dam i need 16 gb
whats safe to clean out in my mactonish
cause i have a tb
hard drive
Apple Logo > About This Mac > Storage > Manage






