#development
1 messages · Page 1766 of 1
Is it only rewarding on x stars or reviewing in general? Bad or good reviews = incentive?
I don’t do this with my bot regardless but just for clarification
If you like the bot make sure to leave it a review
If you like the bot give it a 5 star review
If you leave the bot a 5 star review you'll get game currency
If you leave the bot a review you'll get to use this command again before 12 hours
Tyty
you should pin that btw
should all be explained in how reviews on zendesk work but okay
help?
Is it related to discord bots or is it a different system?
Can I put buttons in embeds?
I've seen that error occur when someone tries migrating their bot from one platform to another but keeps stuff like node_modules the same
rather than rebuilding it on the native platform
^ yeah, you gotta rebuild your node_modules folder whenever you migrate platform
inside embeds? no
hmmm I remember in one of the discord previews for these featurea there were buttons in embeds
and dropdowns too
Try sending raw request
maybe they will add it in a future update
apparently theres more stuff coming, like dropdown menus
i'm hoping they're going to add input fields soon
lemme try manually added a components list
you can't have message components in embeds
¯_(ツ)_/¯
kinda ruins the look aswell, they just look like images
but it's still new
give it some time for them to polish it
the whole rebrand is ugly
CSS flexbox is perfect for this
auto adjusting button sizes
grids
sad they dont even use it
they saturated all colors and it hurts to look at them, especially the new blurple
oh also, no support for outlined buttons
Atleast they brought back the original text brand
I personally like the new clyde
but
that cringe text logo
was horrid
they cheap out on the developers
wouldn't be surprised if they took a hobo and said "you'll be our new team manager"
I think they saturated the color because there were some contrast issues
(this is the original blurple from the dev portal)
people with specific conditions couldnt read it or something
Im probably way off
idk
yeah it was kinda hard to read but that could've been fixed by using an alternate text color
but the new blurple is heavily saturated to the point your eyes physically hurt when you look at it
¯_(ツ)_/¯
NGL, the saturated color is a little refreshing
maybe Im just getting used to it
but
the old blurple
nice
thank you, it took 5 minutes to upload
oh that reminds me
people are storing full blown b64 data in buttons
lol
yup
lmao
it's kinda a smart thing to do
theres no length limit to them?
what kind of b64 data can you store in 100 chars?
i was thinking like b64 images lol
from ddevs
true that i used to store the data in the footer before
but yeah if the custom id uses utf16 then you could technically store data in base64k
or just binary/blob in utf8
honestly the best thing about buttons is that you can directly reply to them instead of going through the rest of the api
it's uh
not pleasant to look at
don't make the fields inline
or paginate them
or link to an external website
callback(new MongooseError(message));
^
MongooseError: Operation prefixes.findOne() buffering timed out after 10000ms
got this error message
Hah yes, they are actually quite nice to implement, with a bit of abstraction to help.
What does Google say?
Time out
Learn to Google, you will become a better person :)
there are lot link
Just read through them one at a time, until you find your answer.
[PostgreSQL] I'm designing my database to be completely immutable—no UPDATE or DELETE allowed. Mutability is the enemy.
Although this is an issue that may only effect me slightly, I'm a bit concerned about it since a lot of duplication can go into each revision (I call them assets) and data integrity. Take the two tables attached for example.
An asset can include one or more of the following tags:
- Addition (a
nullcolumn got data added) - Deletion (a column with data was reset to
null) - Modification (a column with data got replaced with some other data)
If I want to modify the media table, I need to add a new row to the media_assets table. It looks like I'm forced to mark each column as nullable to represent deletion. I'm currently limited to:
- Mark every column as nullable and treat
nullcolumns as deleted (current implementation). - Mark every column as nullable holding another nullable value (
Nullable<Nullable<T>>).
The advantage to the first implementation is it's simple and is a full copy from an asset. The disadvantage is I'm storing more data than I actually need. The advantage to the second implementation is it only stores as much as it needs, but I'm unsure how to model it. So, for my question, how can I model a Nullable<Nullable<T>> type in SQL? The first nullable can be implicit (aka not supplied). The second nullable can be explicit (deleted).
why is it that when I send an embed and a button at the same time... the embed turns into an "[object Object]" string
its very annoyying
discord-buttons is honestly trash
you're better off making requests to the API without a wrapper
got a better option?
I said better...
thats
um
no
this is in their FAQ
i don't know how they thought that was a solution
and i don't think they have support for emojis
and their typings suck
someone needs to make a better wrapper
bro... theres literally nothing else
dont trust people with butchered english
what do you expect me to do
just do raw requests
poor database
It can suffer
js is not typed so you can easily send buttons without modifying djs
does it not filter properties before sending them?
last time I tried passing message_reference and it didn't work
because discord.js uses two different ways of defining content
.send(content, options)
or
.send(options)
if you pass a second argument, the first one is treated as text only
so .send(embed, options) causes object object because it tries to use the embed as content
it does, you have to use client.api
oh that's what i use
so I went onto their server... and yeah... their library sucks
and their community sucks too
instead of fixing things
I kid you not
he said "you get what you get and you dont make a fit"
like
Wtf
i mean, they're not wrong
lul
but its an API
you dont just say "im not going to fix it"
and tell people to suck it up
its not like you purchased a service, you're using a free open source code, no guarantees
they don't have full coverage either
does it allow you to have more than one ActionRow?
Yeah, its garbage... I think Id rather write my own
I dont think those even exist on the API
those do
buttons are inside action rows
people even made a gameboy emulator using multiple of them
message has components, component has action rows, action row has buttons
one action row can have up to 5 buttons
buttons have to be inside an action row component
basically a flexbox without the flex part
a fekbox
CRUD and immutability are two separate things :)
CRUD can burn in hell
cRUDE
really? I thought they were just statically scaled
cuz they dont appear to size very well
or they have bad margins
that's because the front devs have autism
guilded > discord incoming
guilded still has long ways to go
and it looks ugly
i've been getting messages about guilded recently
people saying its 1000x better than discord
and asking me to port my bot there
lul
ye
i wouldn't say crappy
alive and kicking and apparently better than discord
but it's still worse
it literally looks like discord
like they copied everything
icons, font, appearance
wtf
guilded has a built-in basic bot functionality
you can go in the guild settings and create a basic bot
with built-in functions and commands
discord copied slack 
it was basically a full on clone at first
every thing on the internet is a copy of something else
you know the rule, the most known one is always the "original" one
keydb is a copy of redis
remixing is a part of creating new art
postgres is a copy of mysql
Remixing.. its getting to the point that its just straight up copying
ejs is a copy of php!
like
to the pixel.. copying
except it's not and you're being completely disingenuous
Internet explorer is nothing like chrome
as a... painfully admitted webdev... I can admit Ive wished IE didnt exist
Ive always wished it would just rot in hell
well ms is finally dropping support for it
it was always different
dont even start about DirectX Objects
blegh
it was a competing product
sure
competing products are always somewhat copies of each other
i didnt say they were the same, just that chrome was a copy
to compete with something first you have to copy it
in terms of functionality at least
Almost everything you interact with is a copy or based on something else
That meme you saw 2 hours ago? Probably a repost
ye
fuck
oxygen isn't
fucking
when and where
yes it is
it just borrows other atoms
hold on I need that one fullmetal alchemist quote
"In order for something to be obtained, something of equal value must be lost."
so, I want to obtain the destruction of world
occasional sudden exit from his chair to do a quick ten pushups. He explained this last one as "Compiler found error in code. This is punishment"
will I get another world?
rethink.db
what happened with rethink db?
2-3 years ago everyone was talking about it and using it
It was deprecated then it got undeprecated.
never heard anyone mention it again
orms walk in
second level cache!!
ever since i discovered the use of second level cache, i don't use orms without it
I like the idea of ORMs but never get far with them
SQL is already a declarative abstraction
and trying to abstract it again with an ORM doesn't go well further
Hi
lmao
Bay
hdd bay
Even mongoose is pretty horrible to use compared to the offical mongodb client.
Especially if you want good typescript support.
Hi guys. I host my BOT in my friends server and we noticed that it uses lots of memory, do you guys know if there's a lighter way to make it run 24/7, even without vs? thanks
aws
I prefer GCP 🙂
You should find the sources of the memory usage and try to optimize it.
| Require stack:
0|index | - /root/moderation/index.js
0|index | at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
0|index | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
0|index | at require (node:internal/modules/cjs/helpers:93:18)
0|index | at Object.<anonymous> (/root/moderationeconomy/index.js:2:17)
0|index | at Module._compile (node:internal/modules/cjs/loader:1109:14)
0|index | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
0|index | at Module.load (node:internal/modules/cjs/loader:989:32)
0|index | at Function.Module._load (node:internal/modules/cjs/loader:829:14)
0|index | at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
0|index | at Module._compile (node:internal/modules/cjs/loader:1109:14) {
0|index | code: 'MODULE_NOT_FOUND',
0|index | requireStack: [ '/root/moderation/index.js' ]
0|index | }
``` why is this error occuring
when trying to start my bot
moderationy ?
no my bad i changed the dir name
is there a moderation directory in your root folder
yeah of course
It will likely be your discord client caching lots of stuff.
Especially if you have GUILD_MEMBERS intent turned on.
anyone that knows how to fix this
it happened after i updated my node to v16
What does ls -la /root/moderation output?
drwxr-xr-x 7 root root 4096 May 30 01:31 . drwx------ 11 root root 4096 May 30 00:08 .. drwxr-xr-x 2 root root 4096 May 29 12:30 commands drwxr-xr-x 2 root root 4096 May 29 12:30 events -rw-r--r-- 1 root root 2563 May 30 01:44 index.js -rw-r--r-- 1 root root 0 May 4 14:31 json.sqlite -rw-r--r-- 1 root root 391 May 22 15:32 mongo.js -rw-r--r-- 1 root root 185 May 28 23:55 n.json drwxr-xr-x 3 root root 20480 May 30 01:44 node_modules -rw-r--r-- 1 root root 1402 May 28 23:51 package.json -rw-r--r-- 1 root root 228685 May 30 01:25 package-lock.json drwxr-xr-x 2 root root 4096 May 29 13:41 schemas -rw-r--r-- 1 root root 57671680 May 30 01:31 thLogs.sqlite drwxr-xr-x 2 root root 4096 May 29 13:44 util -rw-r--r-- 1 root root 34 May 29 00:11 warnings.json
If you updated to node v16, you will probably need to reinstall node_modules 🙂
reinstall? rebuild?
Just remove the directory and re-run npm install
Eh, same thing kinda. My OCD likes removing the directory first lol.
Probably. It makes me sleep better starting from a clean slate for some reason.
Do Mongoose come with Schema
What am i doing wrong?
why the whole code
I'm having errors with this
just show us the error
Ok
this here is legit spamming lmfao
yep
yeah
Ok
[VOICE (715707547247575122:2)]: Authenticate failed - VOICE_CONNECTION_TIMEOUT``` I get this right after my bot connects a vc
It works thanks
cool
does your bot have the correct permissions?
Yes it has admin
try finding out the issue by debugging ws
client.on('debug', console.log)
additionally see this could help.
Well that's the debug, u want more of it?
Ok
Above it is Authenticated as sessionID undefined
Client joins but doesn't authenticates
uhm, well see this, no one resolves the issue lmao
yes
Ee and I can't join stage channels without master lmao
I wonder if you try debugging the client, you'll find out the problem's core
Ye I tried debugging and I just got the things that I told u
Ig cuz sessionID is undefined
Or idk
sessionID?
Ye
could you show me the debug screen?
im trying to create a "login with discord" but im getting a 400 when trying to use the token url, could anyone help me out?
<?php
$code = $_GET['code']; // works fine
$clientID = '468138032680402944';
$clientSecret = 'REDACTED';
$grantType = 'authorization_code';
$redirectURI = 'http://localhost/(REDACTED)/identify.php'; // correct URL
$tokenURL = 'https://discord.com/api/oauth2/token'; // plucked straight from the docs
$dataArr = array(
'code' => $code,
'client_id' => $clientID,
'client_secret' => $clientSecret,
'grant_type' => $grantType,
'redirect_uri' => $redirectURI
); // all of the params (it says that) it needs
$options = array(
'http' => array(
'header' => 'Content-Type: application/x-www-form-urlencoded', // same content type (it says that) it needs
'method' => 'POST',
'content' => http_build_query($dataArr)
)
);
$context = stream_context_create($options);
file_get_contents($tokenURL, false, $context);
?>```
sorry idk how php works
@near stratus issue solved
.catch(() => {
message.channel.send("Coundn't fetch response!");
})```
oh good job
like 400 on the discord oauth
on the code/token exchange
so, basically the discord oauth works but it doesn't redirect to the dashboard?
the session expires before you reach the dashboard
the error doesn't give me any details in browser but it seems that insomnia does. im gonna try it again from there and see what it says
idk what you mean, im just sending the post to the token url with the params that it wants and it's smacking me with a 400
bad data somewhere i guess
or just something missing
are codes one-time use?
after clicking login with discord, do you see this page(please fuck the bot you see there its just a test app)
seems codes are one-time use
no
its for a dashboard not to add a bot
i authorize
yeah, but
it gets the code and redirects to the page im trying to call the token url from
and then from that page, when it tries to send the post to the token url, all i get is a 400
when you click the login. It must direct you to the oauth2 page?
well yes
i go to my login.php
it goes to discord's thing
i authorize
it brings me to my auth.php where i post the code to the token url
I don't think there's something wrong with the discord oauth then
right now it's looking like discord api doesn't want localhost as a redirect uri
but I'm surely thing there's something wrong with you choosing php, don't get me wrong.
at least that's what i can tell from insomnia
it does,
check your firewall
you need to set a session cookie
or maybe cache the session with redis
session != cookie
what do you want me to do lol
cookies are client-side, sessions are server-side with a cookie that has the session id
if im on localhost then firewall has no consequence because im not doing anything with another machine - it's localhost
anyway
insomnia is telling me invalid redirect uri
http://localhost/(REDACTED)/identify.php
this is what im using
with (REDACTED) being something i took out for here
yes there is
lol
<!DOCTYPE html>
<html>
<body>
test
</body>
</html>```
for the time being this is my identify.php
why don't you use js instead
unless it's erroring out trying to post something?
kthx
well im not doing that but ty for the input
does discord have a php oauth2 lib?
https://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html#:~:text=The PHP OAuth class either OAuth 1.0%2C OAuth,access token value and an access token secret.
this could help maybe
This class can authorize the access of users to an API using the OAuth protocol. It abstracts OAuth1 (1.0 and 1.0a) and OAuth2 in the same class, so you can use the same code to authorize the access on behalf of the current user any API that supports any version of the OAuth protocol. It works on Linux, Windows and any other platform without the...
i got it
idk what happened
i think it has something to do with the fact i didn't have anything handling post in the identify.php
i changed the redirect_uri to my auth.php instead and it worked
or get? idk, i'll figure it out
thanks for the assistance
that's some pretty bad php
cURL should not be a relied method for OAuth2 access, simply put.
This post tries to prove that vulnerabilities can in fact be very subtle and that even people who master their toolkit andlibraries can easily fall for them....
that oauth2 script follows a few good vulnerabilities that can be exploited 😬
i figured out exactly what the issue was
two different redirect_uri cannot be used
i was using one to get the code
but then trying to use a different one to get the token
it won't let you do that, the code is directly reliant on the redirect_uri you initially specified
if you guys want, I'll write a PHP class that handles OAuth2 connections completely with Discord
I don't mind making it public for use
i used all my own code - except the stream thing, i got that from an example somewhere
all i did was use plain php, no curl or anything extra
what are you doing btw
me?
yes you
dashboard for a bot
oo
you should use the php lib while you're at it
bot with djs?
indirect flex
i would but i felt it would be more fun to learn all of it in-depth
bot with djs of course lol
im only using php for web because i know it better for that purpose
there is a discordphp though too
bleh
i'd rather keep php for web use
i've tried javascript (web) frameworks, they aren't as familiar to me as php is
you mean stats from the bot to web?
ah
noted
for now im just working on the basics first
mainly getting basic user info via identify endpoint
cool, good luck
thank you both frens 
I'ma stick to doing shit and nothing productive lmfao
for a while that's what i did too
but this college semester i finally learned php from one of my classes, which i was really excited for
and it was pretty fun
cool
so i decided i'd use it for my bot's dash instead of a js framework
yeah good, express is shite
lol
you could though have used nestjs 
like i said, i tried js web frameworks
didn't like them much
php works with my tiny brain better for now
PHP is a really good language to begin learning a lot about OOP design imo
it's a good entry level
yeah, don't mind. Good luck with php.
being able to put the server-side code directly into the pages makes php easier for me to get used to
later on once im more familiar i'll probably look into a js solution
tyty
i did that for my group project
led my group actually
cause i already had a lot of background with databases and coding
we got full marks in the code ;>
and it was pretty
I'm waiting for the bot to finish 
the bot?
oh
i mean technically my bot is finished, been in use for a while, i just haven't pushed it cause it doesn't have much
it's just xp for now
i figured before i added more stuff (esp flexible customizable things) i should write a dash first
only thing is i didn't have the know-how
now i do
and i also didn't have much patience for the many many quirks of web design
now i have a tiny bit more patience
hmm, ggs
I'ma do animation with an empty canvas by then 
meh, I don't know where to start
premiere pro is fun
i also learned why you need a good pc to do it
mine is p decent but still struggled with a couple hundred small things i put in the timeline
How do I get rid of this warning ?
(node:15049) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
I'm using it as
const MongoClient = require('mongodb').MongoClient;
nvm goggled it out
would anyone out there have a responsive iframe code?
tbh you should probably change it to
const { MongoClient } = require('mongodb');
this is called object destructuring, I'm not saying this fixes the problem you had
it's the same you already have, but looks nicer
he just needed to add useInifiedTopology:true to the client configs
I know
And they also said they already did that, that's why I suggested them to use object destructuring
why you don't use mongoose?
just simple create Schema and using it like a simple database?
mongoose is shit
mongoose got its downsides, its slower compared to the mongoDB driver bcs of the additional validation of the schemas
also still needs the same client option to not get the same error
did you try to do somewith with the Discord Class before its initialited?
No?
Show the code causing the error
Sure
(hide your token)
ok
client.commands = new Discord.Collection();
Where do you define Discord
Isn't discord already defined?
No
That might be why its not working right?
You need to require it
Probably
After defining Discord, it says that it is already declared
Identifier 'Discord' has already been declared
Hi I have a vps on which I am hosting a bot in node js that generates a .txt file with data to do it temporarily saves it on the vps and then retrieves it and send it in a chat on su discord but the problem arises in the deletion of the file as it does not happen causing errors, on( local windows 10) everything worked fine maybe and ubuntu that does not allow this type of action (I have little experience in the linux world)
const headers = {
"Authorization": `Bot ${config.BOT_TOKEN}`
}
fetch(`https://discordapp.com/api/channels/${msg.channel.id}/messages?limit=100`, { headers: headers })
.then(res => res.json())
.then(json => {
json.forEach(async function (obj) {
await fs.appendFile('msg.txt', `${obj.author.username}-${obj.content}\n`, function (err, files) { if (err) throw err; });
})
forcecloselog.send("", {
files: [
"msg.txt"
]
});
setTimeout(() => {
fs.unlink('msg.txt', function (err) {
if (err) throw err;
});
}, 3000);
})// fine then json
sounds like file permission issues
does the user who manages the files have access to delete the files?
That means it was already defined, please show the code that's before line 20
from the terminal I can delete files
Well why would I need Scheme when I'm using a typed Interface ?
I don't want this to get over-complicated
(Also I fixed the problem. Thank you)
i have no experience with linux i don't even know how to check permissions
@novel jetty you're requiring discord.js three times. Line 1, 19 and 70. (line 1 is without capital first letter so doesn't cause issue but it's still a bad practice) you need to remove the require at line 19 and 70 (requiring is generally done at top of the file) and make sure your casing of the Discord module is consistent throughout the file since variables are case sensitive
@formal pulsar Are you sure this is a permissions issue? What is the error? Because if I remember correctly on Linux a user has access to delete all files it creates
ok this should be it
it returns no errors but restarts the bot
Just going to reformat your code so it doesn't hurt my eyes 🙂
const headers = {
Authorization: `Bot ${config.BOT_TOKEN}`,
};
fetch(
`https://discordapp.com/api/channels/${msg.channel.id}/messages?limit=100`,
{ headers: headers }
)
.then((res) => res.json())
.then((json) => {
json.forEach(async function (obj) {
await fs.appendFile(
"msg.txt",
`${obj.author.username}-${obj.content}\n`,
function (err, files) {
if (err) throw err;
}
);
});
forcecloselog.send("", {
files: ["msg.txt"],
});
setTimeout(() => {
fs.unlink("msg.txt", function (err) {
if (err) throw err;
});
}, 3000);
});
Are you sure this is causing the issue?
if I put the part that deals with this thing in the comment the bot works without problems
Ok, just making sure
Your json.forEach call isn't actually waiting for the appendFile op's to finish. Needs to be something like:
// At the top of your file
const fs = require("fs/promises");
await Promise.all(
json.map(function (obj) {
return fs.appendFile("msg.txt", `${obj.author.username}-${obj.content}\n`);
})
);
forEach will not wait for the promise returned from the callback to resolve before continuing so you're randomly overwriting msg.txt with different json files out of order
you also don't need to do any of this at all
forcecloselog.send("", {
files: [{ attachment: Buffer.from(`${obj.author.username}-${obj.content}\n`), name: "msg.txt" }],
});
no file writing/deleting needed
you say that I don't need to save it on the vps, recover it, send it to discord etc etc
Probably want to use this for the attachment content too:
const contents = json.map((obj) => `${obj.author.username}-${obj.content}`).join("\n");
you're writing to disk, reading the data from disk and then deleting a file when you could just send the data you have in memory to discord directly without any IO
json.map is not a function
you tried to access something before you initialized it
aka
console.log(x);
let x = 4;
ok bot you're kidding right
In this case: { animated: false, name: '🎉🚓', id: null }, how can i get only first emote (🎉)
please*
because the array you're using is not a typeof Array
The first reaction ?
like this !
const st = "💥🔥🤯";
const symbols = [...st];
symbols[0];
this would break with grapheme clusters, or emoji sequences
imagine representing strings as an array of characters 
Cries in C
dude
you can access characters directly by index
no need to array them
Won't emojis break ?
I thought they were unicode 16 or something
Glad you asked
(?:[\uD83C\uDF00-\uD83D\uDDFF]|[\uD83E\uDD00-\uD83E\uDDFF]|[\uD83D\uDE00-\uD83D\uDE4F]|[\uD83D\uDE80-\uD83D\uDEFF]|[\u2600-\u26FF]\uFE0F?|[\u2700-\u27BF]\uFE0F?|\u24C2\uFE0F?|[\uD83C\uDDE6-\uD83C\uDDFF]{1,2}|[\uD83C\uDD70\uD83C\uDD71\uD83C\uDD7E\uD83C\uDD7F\uD83C\uDD8E\uD83C\uDD91-\uD83C\uDD9A]\uFE0F?|[\u0023\u002A\u0030-\u0039]\uFE0F?\u20E3|[\u2194-\u2199\u21A9-\u21AA]\uFE0F?|[\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55]\uFE0F?|[\u2934\u2935]\uFE0F?|[\u3030\u303D]\uFE0F?|[\u3297\u3299]\uFE0F?|[\uD83C\uDE01\uD83C\uDE02\uD83C\uDE1A\uD83C\uDE2F\uD83C\uDE32-\uD83C\uDE3A\uD83C\uDE50\uD83C\uDE51]\uFE0F?|[\u203C\u2049]\uFE0F?|[\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE]\uFE0F?|[\u00A9\u00AE]\uFE0F?|[\u2122\u2139]\uFE0F?|\uD83C\uDC04\uFE0F?|\uD83C\uDCCF\uFE0F?|[\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA]\uFE0F?)
lmao
w h y
d o
I
g e t
a l l
f e m b o y s ?
why not?
this new system seems to work thanks to everyone
good question
i hope u stub ur toe in the corner
Already use dropdown button erwin
Being stung in the webbing of your fingers is better 
im waiting for discord staff to come back at monday, but i'll likely be able to use it, yes
from what i got, only 4 or 5 people got whitelisted to the private beta before staff left for the weekend
it is
cake just added it to detritus
What do i do if i forgot the bot prefix? i added a new one and can't remember
Ping it
Did nothing happend
as im still working on the website desktop to mobile redirect this goes in the header or body?
if (screen.width <= 699) {
document.location = "mobile/index.html";
}
</script>```
Nothing happend
@blissful valley dont you have a Config.prefix? in your config file if you have one
make an announcement channel
and connect it
actually, you dont even need to make one
just open the original announcement channel and click follow
const { AutoPoster } = require('topgg-autoposter')
const poster = AutoPoster('token', shards)
poster.on('posted', (stats) => {
console.log(`Posted stats to Top.gg | ${stats.serverCount} servers`)
})
so i jxt do this in my shard file so it post server stats on site?
Don't understand.
do you have a file where you have your token stored? thats normally where youd store your prefix
jokes on them you need to pass the dtesters quiz to get inside
and everyone waiting for buttons
no?
its discord developers, not bug hunters
If I'm confident enough to make my own wrappers, I not even need to wait. But that's that.
What does this mean? Could someone help me?
https://cdn.discordapp.com/attachments/847896512641499208/848488018909200384/unknown.png
Look at the error?
Yea
No, I mean you should read what it's saying
#discord-news also includes dtesters
existing data was supposed to be a number but it got string
And i did look in my code but can't find any string
i assume you arent searching for string
cuz if u do, i got bad news for you @novel jetty
Whats up
pls tell me you arent looking for string
Im not
okay good
Im trying to find the sting and fix it but i can't find
let me help you
Sure
read that
breakpoints will show u the way
Uh...
There are no breakpoints...
but the pic he showed was from developers
He showed the channel, to get the same news as #discord-news he'd have to pass on dtesters
by finishing my bot
How do i disconnect the github on the version control? (Idk if this off topic)
or, do it like @crimson vapor and read mushoku tensei
Or is there a way idek
Does anyone how can we add reactions to a particular number of messages after we execute a command
is there any other way to get guildsCount other than client.guilds.cache.size
await message.react('\✅')
reading the question is hard, clearly
fetch last 100 amount of messages from the channel and then react to X amount that were sent
the reason for fetching 100 is so you dont have to fetch multiple times
fetching 1 or 100 will still be a single request
i guess u could do oauth, but theres no reason not to use guilds.size
i heard after sharding there'll be problems
yes but will bot cache read all servers in all shards?
my bot is at 6 shards rn, and as you can see by clicking me, works absolutely fine

d.js you'd likely have to reduce() broadcastEval(0
i mean updating server_count is vc is my task iam using cache and to get guilds count. will i get problems when bot gets sharded?
read what i said

hey
does anyone know why there is no node_modules folder inside my projectory
when i use npm install on my vps
like the node_modules is fucking empty
https://srcb.in/U1YoWO6okM
When I completed first part its not sending me the second part
Ping me if you got it
??
oh nvm firefox was blocking loading the site for whatever reason
god damn that's a mess
But the code was too long to send here
you have so much repetition in your code
your comparisons can be abstracted to a single method
Do you know why its not sending second part?
naah I mean the messages that come after the command is executed
listen to messageCreate event and then remove the listener
Line 20
or wait x amount of time and react to the messages collected
Error: Cannot find module 'sqlite' 1|index | Require stack: 1|index | - /root/moderationeconomy/index.js 1|index | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1014:15) 1|index | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29) 1|index | at require (internal/modules/cjs/helpers.js:72:18) 1|index | at Object.<anonymous> (/root/moderationeconomy/index.js:8:13) 1|index | at Module._compile (internal/modules/cjs/loader.js:1185:30) 1|index | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10) 1|index | at Module.load (internal/modules/cjs/loader.js:1034:32) 1|index | at Function.Module._load (internal/modules/cjs/loader.js:923:14) 1|index | at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) 1|index | at Module._compile (internal/modules/cjs/loader.js:1185:30) { 1|index | code: 'MODULE_NOT_FOUND', 1|index | requireStack: [ '/root/moderationeconomy/index.js' ] 1|index | } I have ran npm i sqlite a fucking million times
it still returns me this
well did sqlite install successfully lol
you have a comparsion that checks whether status is a truthy value in the main() function
status is always going to be a truthy value
ake: *** [binding.target.mk:111: Release/obj.target/binding/src/binding.o] Error 1 make: Leaving directory '/root/moderationeconomy/node_modules/ref/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 5.4.0-42-generic gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /root/moderationeconomy/node_modules/ref gyp ERR! node -v v14.0.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok first error in the line
should io rebuild the npm?
therefore, the code returns out of the function
what's the full stacktrace
install build tools
So how can I fix?
it's your code and a very simple logical fix
might be it.
think about it for a second
if you're checking whether status is a truthy value and it returns, what do you need to do for it to check that it's a falsey value
apt install build-essential
root@UmbralSkies:~/moderationeconomy# apt install build-essential Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version (12.8ubuntu1.1). build-essential set to manually installed.
also you should genuinely consider abstracting methods out of your code and cleaning it up, your current code is hot garbage
put words in an array and then iterate over the array
try npm rebuild sqlite --update-binary
and still doesnt work?
nope
i hate galaxygate so much as their vps needs so much updates etc
it worked, thanks tim,
that's not their fault is it lmao
lmao
all linuxes are like that
open source moves fast, so every day you login and you see "XX updates are available"
if you dont like seeing that then use something like unattended-updates
let registrations = args[0]
let teamName = args.slice(0).join(' ');
const filter = m => m.content.includes('!join ' + teamName);
const collector = message.channel.createMessageCollector(filter, { max: registrations});
can someone tell me why does this does not work
only talking about the collector
Hi, I now want to fix the error when I write the bot commands on the server, everything is fine, and when I write in a personal message, they give an error, you can fix it so that there is no error when writing
if i just use a number in max it works, but does not work with args[0] which is a number
show error and code
/home/runner/sdsad/index.js:48
${message.member.joinedAt.toLocaleDateString()}
^
TypeError: Cannot read property 'joinedAt' of null
at Client.<anonymous> (/home/runner/sdsad/index.js:48:23)
at Client.emit (events.js:326:22)
at Client.EventEmitter.emit (domain.js:483:12)
at MessageCreateAction.handle (/home/runner/sdsad/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/sdsad/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/sdsad/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/runner/sdsad/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/sdsad/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/sdsad/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:314:20)
error
.member is null
client.on('message', message => {
if (message.author.bot) return;
if (message.content == '!профиль') {
let embed = new Discord.MessageEmbed()
.setTitle(message.author.username)
.setURL("https://discordapp.com/channels/561512048811442198/607586745269354526/607838205479485464")
let status = ''
switch (message.author.presence.status) {
case 'online':
status = 'онлайн'; break;
case 'idle':
status = ':orange_circle:нет на месте'; break;
case 'offline':
status = 'нет в сети'; break;
case 'dnd':
status = ':red_circle:не беспокоить'; break;
}
embed.setDescription(`**🛡️ ID пользователя
${message.author.id}
🛡️ Присоединился к Discord
${message.author.createdAt.toLocaleDateString()}
🛡️ Присоединился к серверу
${message.member.joinedAt.toLocaleDateString()}
**`)
.setFooter(message.author.tag, message.author.avatarURL)
.setColor('RANDOM')
.setThumbnail(message.author.avatarURL())
message.channel.send(embed)
}
});
code
a member doesn't exist in a dm
Russian-speaking bot
If I sent the server chat, this command is ok. And if a person sends a private message, then the bot flies
Yo anyone got python codes to make giveaways as I can't find any one
Did you try to search on github?
Yep none worked
because you dont know how to use them
use a npm package if you cant
oh wait
py
but copy and pasting does nothing
Listen, I'm not super good on the coading side, can you explain in more detail
Pls assist
I know a little bit on how to code and I have never copied and pasted
572 people are furiously typing...
bruh
im willing to debate this
you can hypothetically learn programming by only copy pasting snippets
its a concept that involves guided learning
but that's only if you believe in that concept
If u dont learn and copy paste then when u want to modify stuff u wont be able too
a DEDICATED person can learn with examples, the majority of people cant
i think the majority can
they wont even bother reading what they are copying
I hate code snatchers
look at block coding as a good example
you can convert block code to actual language code
that's arguably a form of copy pasting
under that logic it's feasible to learn from it
like i said, the majority of people wont even bother reading what they are copying before using it
i think that's an assumption of how people think in general
u cant learn if you dont even know the contents of the snippet
what validity do you have to that statement?
you may know "okay, this works for this case" but not the reason it does
literally everyone that asks for code here
what can you use to prove that a majority of people cannot interpret coding by reading
literally everyone?
i doubt that
they ask for either cogs/files or straight up whole snippets
Back to my question.....
"someone give me giveaway code pls"
that's more about spoonfeeding
tbh i learned a lot from copying code
they are correlated most of the times
that's why i think the claim is really invalid because it is possible
if you READ what you're copying, thats a thing
most people here just want functional code, pre digested for them
right, but correlations between that behavior doesn't mean that's exactly what it is
you're making an assumption that people cannot interpret things properly for what they are, ie. code snippets and their purposes
i don't think the current observations you have here show the full spectrum
specially due to the fact that if you EVEN GIVE THEM, they will still come back when something errors
i believe you're broadly stroking over the whole group of people who are learning code and copy paste code for people wanting to be spoonfed due to laziness
yes, once again, that's pure laziness
thats precisely what im doing
that doesn't mean a majority of people can't learn though
which is sad, because thats the majority you see here
copy/pasting code can be very useful if you do it right, the difference is:
good:
copy paste code, didnt work? read error, check variables, check arguments, figure out what the code needs to work, change and adapt both the copied code and your code until it works.
bad:
copy paste code, didnt work? code is bad/broken, give up, look for a different code.
i can agree with those sentiments
bad:
#2: ask in #development
is asking really that bad of a thing though
when you dont even try urself, and go back to your argument of laziness, yes, it is
i'd rather someone own up to their ignorance and be guided than make presumptions about programming and then give false advice/information to other programmers
i really hate people who give out the wrong advice to other coders
Who can reset the edited code so that it does not produce an error when writing in private messages
that bothers me a lot
ok so
look at this dude for instance
it's about being spoonfed
i don't think it's really about not being able to understand the concept
because if anyone is dedicated, like you mentioned, they have the ability to learn
if you want to become a developer, you NEED to create your own problem-solving skills as well as independence if you ever hope to get a job in this career. Not even trying to solve the problem and INSTANTLY relying on other devs to solve YOUR issue, without you even trying, is where i draw the line for not helping, and instead showing them the importance of "breaking your own legs"
i'm not really arguing about the semantics of educating someone to become a developer though
i'm merely arguing the ability that learning can be possible through copy pasting code
LMFAO
but thats what i mean, laziness stops people from doing that
theres good and bad laziness
ok that's fair
people often chose the bad
i'll agree with you on that, laziness disables people from that proper learning state
i'll just copy this and move along
we already told you how to fix it. message.member doesnt exist in DMs
didn'treadthedocs™️ moment
jokeOnYou,DidntEvenReadTheLast5Replies™️ moment
pretty sure tim already had answered them
idk why i got that person blocked
but surely i had a reason
oh pfft
wdym someone still use that
ptb is the stable'st branch
everytime theres an outtage, the only one up most of the times is ptb
yeah
and i dont get bombared with updated(shitty one specially) like canary
bruh
theres no dev version
im on canary, i live on the edge
theres no such thing
its canaray
canary*
the development version is canary
its canary
also canary
if u even bothered looking at the files when it loads up development version you'd see its literally canary
how can i scrap the source code of a website with python?
without any changes whatsoever
just makes u look dumb bragging about "oh look at me, im doctor lupo" with the development version
open that
ugh fine, here
download it
im doctor uvuvwevwevwe
im doctor ossas
pleasure to meet ya
now run it, and go to settings
likewise
oh wow, would u look at that
its just fucking canary with a fancy black icon that skids flex cuz it has 'development' in the name

good luck
better-sqlite3 takes 50 years to build on shit software btw.
So repl is probably taking forever to build it.
ooo Thanks
i am guessing you use quick db which is bad idea
what is the meaning of the comment here
I didn't get it
I mean its not a hard application to obtain
"so we don't swallow exceptions from actual bugs in components" doesn't make much sense to me
passing a second parameter in then is the same as using catch afaik
catch internally uses the then function too
yes, so y r they saying to avoid a catch block
its an unlisted build, everyone who gets that is by someone who has it(and likely flexed about it)
it's referring to how you change the state in response to an error, not that it's using a second parameter instead of .catch
but it's saying "instead of catch"
doesn't make much sense in this context. Normally the point of using the second parameter instead of .catch() is to make sure you only handle errors originating from the promise you're attached to and not any of the errors that could be originating from .then() branch the catch is attached to
That's probably what the comment means, but that isn't really a good example
On this page of the React docs:
https://reactjs.org/docs/faq-ajax.html
A code comment says...
Note: it's important to handle errors here instead of a catch() block so that we don't swallow excepti...
apparently it's just a copy paste mistake from a previous version of the docs lol
for class based components with this.setState yes it matters but hook setters can't throw
ah lol
if unique is false, it will return an existing invite that has the same options as you provided (if exists). otherwise it'll create a new one
It's in default false, right?
if true then it'll always create a new invite
Ohh.
default is false yeah
Ooo.. alright! Thanks! 👍
Does anyone know why my bot user count is always 1? ( I have SERVER MEMBERS INTENT and PRESENCE INTENT both enabled. I'm in discord.py.
Options is a object, and unique is the data in the object
oxide or vultr(this is what I use)
or maybe azure if you're onto some very high level hosting
Do you have it enabled on both the dashboard and in your source code when you initialize the client
Oh Damn, I'm stupid lol. Thanks
i want to add an if statement to check if the command is from a group of IDs or from users that have this role ID..
?
Who here has worked with slash subcommands?
I did and it was pretty much dumb
I ended up rewriting my whole bot
Do you have an example of the subcommands visuals on hand?
wdym ?
I started working with it a bit early before discord.js git support for it so I'm using a third party library
Ah, that didn't come off as clear as I wanted it to, my bad. I meant how a subcommand looks client-side
I assume it's like this?
Anybody knows how to clean all the documents in a mongodb database?
Friends, I am getting such an error in the log record, how can I solve it?
Well, technically subcommands are options, aren't they?
What I meant is how they looked client-side with multiple subcommands (options with type = 1)
delete the whole collection with
collection.drop()
client.player is null. You should check what's the instance of client and what .player should be.
@slender thistle Okay I tried a demo
and unless you use type 2 (Subcommand group) It'll come up as a list.
Like
/ping hello
/ping world
/ping beep
/ping boop
when you type /ping
Where hello, world, beep, boop options are type 1
I'm gonna try with type 2 and tell you later
||I'm on Ubuntu and IDK how to take screenshots||
Just found another way: <mongoose>.connection.db.dropCollection('collection name')


