#development
1 messages · Page 1999 of 1
Looks fine to me?
it's supposed to resolve the IP from a string
adds a "." before
It's better to use embed object or the MessageEmbed function? For optimisation
I mean, does it change something
It's more for convenience and validity.
A MessageEmbed is turned to an embed object when it's sent, so there's no performance benefit ("optimizations") of using a MessageEmbed.
What MessageEmbed does for you, however, is give you the builder pattern so you can set properties with methods (e.g. .setTitle), so if you like that, there's a plus.
Plus, it'll run checks on each property you try altering, like if the input is too large.
I'd personally suggest using an embed object since you probably don't need the checks.
Hello i'm trying to define a variable after my guild is created into my db, but when i redefine the variable with the .then it return me undefined because the code after still running before the variable is set, but i don't know how to fix this
let guildInfo;
const createGuild = await new Guild({ id: message.guild.id });
createGuild.save().then(g => { guildInfo = g });
console.log(guildInfo) // return undefined
setTimeout(() => { console.log(guildInfo) }, 1000); // return the guildInfo
That's because calling .save() returns a promise. As in, saving the document will happen some time in the future.
You'll need to use g inside the .then block. You can't assign it to a variable like you're doing right now.
I dont understand how then
You'll need to do what you're doing with guildInfo inside the .then(g => {...}) block.
but thats what im doing
e.g.
createGuild.save().then(g => {
console.log(g); // Should have some value.
setTimeout(() => console.log(g), 1000);
});
Yeah but i really need to define the guildInfo var this is why im stuck
Then you'll need to handle that scope as a promise as well.
I know but i dont understand how promise work
Considering you're using await above, you could easily do:
let guildInfo = await createGuild.save();
And use it below.
Though you may want to read this guide on using promises: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises
Okay thanks
I'm planning to make an evolution game where the child will inherit "features" (e.g. vision length, hearing, speed, aggression, strength etc) from the parents and im wondering an "inheritance" strategy
how would you compute which features to inherit and to what extent
I'd create links and just store the properties that have changed on the child.
You could think of it like a linked list (as one item to points to another) or an immutable data structure (where, for efficiency, unchanged data points to the prior data structure)
But that can be harder and more costly to compute. You could easily just take the properties of some entity, change some up a bit, and return a new one without using links.
Of course, it depends on what child is anyway
Features should be stored in genes, you could make some genes hereditary (only from female parent, or only from male parent, or there's a chance from either of them) , others could be random mutations etc.
life 2
Then create an array of common genes - Collect all (or maybe some) genes from both parents and possibly their parents. Then maybe have a 75% chance of the child inheriting each of those genes, but allow for some randomness and create mutations of some genes. (Also you could disallow some genes based on some stats of the child OR what genes they already have)
Sounds hella complex already
You could also implement dominant and recessive genes but yeah
what have i stumbled upon
yeah what im planning#
so i will have random mutations
and make up a huge index of genes
and then randomly assign 'recessive' or 'dominant' to the gene
my only problem lies is there a better way of inheriting value based features
such as speed
i could simply go "fast", "very fast", "slow", "very slow" but thats kinda repetitive

or i can just randomly generate the set of speeds lmao
yeah i'll do that
for value based genes i'll generate a large variation of them
Worst case you can do randomness with bias / weighting
or something like a custom seed
yeah sounds good
will also implement disease genes which make you die after 5 minutes or whatever
fun way for rng to wipe out an existance
I'm trying to print out the value between two dates: one that is stored in a SQLite database, and the current time. However, when printing out seconds I get 0.821 which doesn't seem right at all.
console.log(curTime);
console.log(parseInt(rows.lastDaily));
let diffTime = curTime - parseInt(rows.lastDaily);
let seconds = diffTime / 1000 / 60;
let minutes = seconds / 60;
let hours = minutes / 60;
let days = hours / 24;
resolve({ "seconds": seconds, "minutes": minutes, "hours": hours, "days": days });
This is the output I get:
1647121949359
1647121900071
{
seconds: 0.8214666666666666,
minutes: 0.013691111111111109,
hours: 0.00022818518518518514,
days: 0.000009507716049382715
}
can you give more info?
Read the error "guildin is not defined"
ok
I’m attempting to find the difference in time between two date objects.
Have you tried turning it off and on? 
const config = require(".../config/config")```
```js
Error: Cannot find module '.../config/config'
Require stack:
- C:\Users\Churt\Desktop\help desk\routes\admin\index.js
- C:\Users\Churt\Desktop\help desk\routes\index.js
- C:\Users\Churt\Desktop\help desk\app.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Churt\Desktop\help desk\routes\admin\index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Churt\\Desktop\\help desk\\routes\\admin\\index.js',
'C:\\Users\\Churt\\Desktop\\help desk\\routes\\index.js',
'C:\\Users\\Churt\\Desktop\\help desk\\app.js'
]
}```
thats C:\\Users\\Churt\\Desktop\\help desk\\routes\\admin\\index.js and i want C:\\Users\\Churt\\Desktop\\help desk\\config\\config.js
dont use .../?
../config/config doesn't work in the admin/index.js bit
whats the full path of the config file?
C:\Users\Churt\Desktop\help desk\config\config?
yes
yeah
ahhhh
so add another ../ to go back one more
well now i know 
Atleast with vscode, it'll tell you which directory your in if you do a require like that. https://scs.twilightgamez.net/g/vGdeD.gif
��<�x�}��5��.;�}�߭8.ׯZs�4��:k�6�q�>���ݻ�_| so I made a basic implementation of discord's token system on how I thought they did it, but this is the result of it. Is this cause I did something wrong when using base64 or is my pc not able to handle viewing it?
Cause this is a pretty unreadable token
Same with most decent ides out there ngl
Ye you showed me that before which is how I based tthe generation of the token before
generateToken(id: string): string {
return `${Buffer.from(id, 'base64')}.${Buffer.from(Date.now().toString(), 'base64',
)}.${Buffer.from(randomUUID(), 'base64')}`;
}
this is how I generated the tokens
I didn't know how to generate the HMAC thing but you basically told me it was random junk before so I just decided to encode a randomUUID
if (args[0] === 'management') {
let mnge = [];
client.commands.forEach((command) => {
if (command.config.group === 'management') mnge.push(`\`${command.config.name}\` - ${command.config.description}`);
})```
args is not defined so define it
how?
by giving args a value
ok so what do i put?
idk depends on what you are doing and what you think args is
you need to toString() the Buffer instances
Buffer.from(id).toString("base64");
🤔 ok I thought that is what the second prop of Buffer.from did tho
Buffer.from second param doesn't stringify it 
Buffer.from is the safe variant of new Buffer(data);
new Buffer is deprecated due to security
Send the whole code
icic
Is it possible to get user votes for a server listing?
Like fetch the voters id when they vote for a server listing
NjkwODU3OTk2NzU5MjgyNDgzMg==.MTY0NzEzMzgxOTQ4Mw==.MDU5MDg0MmYtMWQ1Ni00NGUwLWFlOTAtN2RlZjM4N2QwOGUz ty
np
For the Date.now(), you need to subtract that value by the Discord Epoch
Why?
Buffer.from((Date.now() - 1293840000).toString()).toString("base64");
to decode, it's an int, then you add the Discord epoch to that int and you have a unix timestamp of when the token was created
Oh
Thought you were trying to replicate Discord's system. mb
I mean I am but it is separate from discord
I will subtract later when I release a stable version of this website to do it properly
Then you should use your own Epoch :)
ye how do you get an epoch btw?
It's just a timestamp represented as an int
I see
So basically I just take Date.now() save that value in the code somewhere and subtract Date.now() by that?
3rd time this answer is presented to you
Yeah
but you can set the timestamp to any value if you can get it via the Date constructor
I will just grab the date.now from when I started developing this and use that as the epoch
Reasonable
there now it is using the epoch

Now to figure out what I wanna use as the default avatar for users for this project

Oof pink
Usually, the default avatar URLs are 0-4, but they secretly added a 5
iirc, nobody has it because it's based off of the discrim you were generated with
damn no 6
😔
no 69 either
But I should probably use an avatar that is based off the logo of this project which I also don't even have

I am very prepared :)
evenin' folks 😗
its morning but okay
Just speak in terms of unix timestamps when referring to time online unless it is requested to know your local time

I wish you all a wonderful (whatever this message's snowflake decrypts to in unix time)
Does topgg-autoposter work with Detritus client?
@near stratus I use python not js
can anyone help me to setup reply and typing thingy for my chatbot?
cry
I am so sorry to hear that 😭 🥺 🥺 😱 😱
Lol
Good job
My bot suddenly stopped reacting to prefix commands while slash and commands with ping still work
Whats the reason for that
I have message content intent too
For example when i type, aa.help it doesn't respond. But @Bot help and /help work fine.
looks like a problem with your handler then
hmm, can you explain a bit please
I cant, i dont know how your command handler works.
anything you wanna know, for understanding how it works.
it just started happening suddenly
like yesterday it was working
when i run the bot locally, prefix commands work, but when i push to hosting service, it just behave like that
it would require code sharing at this point
what code?
if that is what you asked
i have two tokens, one for the bot thats public and one for the private one, when is_Test is true, it loads the bot with private token so that i can test without affecting the public one.
is the position of a channel in a category is relative to the category??
like if, there is only one channel in a category, will it have position 1?
nextjs has wayyyy too many protections for accidental css conflicts
apparently I cant use any element selectors in module.scss files because it's not "pure" even though the global stylesheet doesn't use any of them
That's py idk den
anyways how do i use element selectors without inline styles or a style tag
anything wrong with the library import?
ok i found a solution: className hell
pray for my soul
sounds like a problem with message intents
yeah, this started happening after i got a mail from discord
saying that my bot has been approved for the message intent
wait, even with the intent?
you don't have the intent if you're not approved for it
what py libs do u use?
unless you have a single server bot or something
pycord
After it's been approved to use the message content intent, you must have it enabled in the Discord Developer Portal (which it has been as it's been approved to use it), and also specify it as an intent in the client options
oh has been approved for intents
its already enabled and i can't change it
yeah
wait let me send ss
u use the alpha?
Sleep smh
ig
you need to also specify that intent in your client iirc
like this?
Assigning an attribute does not add the intent bitfield to the total intent bitfield
use tailwind. Its so much better
what am i supposed to do then?
iirc it works like that tho, my bot using member intent and its like that
Oh nevermind it actually does in Pycord
It's message_content for the message content intent not messages
https://docs.pycord.dev/en/master/api.html#discord.Intents.message_content
This has absolutely nothing to do with crappy css frameworks
It's about css modules
oh, wait let me try that one sec
wait xetera's here
@woeful pike hello weeb i heard you use nextjs so i had a question
i can't use element selectors in *.module.scss files because it's not a "pure" selector
and i don't wanna plunge in to styles.classname hell so what should I do
I can't use a style tag because my code is sass
remove .module
then i can't import it at all
what are you planning on importing with a full element style
you want a style that applies globally
imagine putting css for ONE page in a global file
header { height: 100vh; }
ul { list-style: none; }
then dont add messages intent?
idk css modules is ass I don't really use it
since it is still v9 ig
i guess i could put it in a style
my bot works fine on beta4 dont need to specify message intent
or, get this, <link rel="stylesheet">
I advice switching back to discord.py instead of pycord since it's development will continue
why
python discord developers having a seizure trying to figure out what library to use
javascript developers getting a seizure trying to figure out how not to use a library for one line of code
well
discord is the only api I know thats so complicated you can't interface with it sanely without a library
its shitty that he wrote a gist for why he doesn't wan't to continue and now this
just don't go back
topgg api be like :cerealspit:
indeed
You can't blame him for not wanting to continue the development since Discord's API is so fucking huge and it's rapidly changing, it's not easy to continue maintaining things like this considering Discord's history on shitty decisions/designs for their APIs and going against the library maintainers' opinions and ideas
yeah, i am not blaming him... what he said in the gist made total sense
And not only that, but he is the sole maintainer of the whole library
but continuing again is weird
yea, especially after a long time
What do you expect when the whole Python land for Discords bots are falling apart and just crumbling

some are moving to js 💀
imagine not using rust
I guess the d.py community is also a factor?
Maybe the man just wanted a break
Perhaps
in ts I hv a type like
type A2Z = A | B | C | D | ... | Z
and I want to make a new type from A2Z
type NotA = B | C | D | ... | Z.
i want to remove a certain ORed type from base type
Can someone make a Utility Type for that? Or is it even possible?
You can use the Exclude type utility in TypeScript
type A2Z = A | B | C | D | ... | Z;
type A2ZWithoutA = Exclude<A2Z, A>;
You can also exclude more types by wrapping them in union types
As Exclude<TYPE, Type1 | Type2 | Type3 | Type4 | Type5 | ...>
@Schema()
class Colums {
@Prop({required: true, unique: true})
_id: string;
@Prop({required: true, default: Tables._id }) // <--------------- How is the correct syntax?
parentId: string;
}
@Schema()
class Tables {
@Prop({required: true, unique: true})
_id: string;
@Prop({required: true})
title: string;
@Prop({required: true, default: 0})
type: number;
@Prop([Colums])
colums: Colums[];
@Prop({required: true, default: { $inc: { seq: 1 } } })
position: number;
@Prop({required: true, default: Date.now})
createdAt: Date;
}
I have something like this, how I can access the Tables's _id for the parentId in Colums
Although I don't know Prisma, wouldn't it be smarter to leave out the parent? Assuming you can perform backwards queries, you should be able to look at the column and query for tables where it's part of the colums (although this method can return multiple results)
ok, yeah I think parentId is kinda unessesary
also small nitpick, but shouldn't colums be columns
haha sorry my bad english
all good
everyone who says they have bad english have very good english
says the dollar tree harvard undergrad
😡
i graduated subway university with honours
thats actually a thing if you're wondering
didn't go to hamburger university, weak 
yeah i used it multiple times in the past
I hear that Argon2id is good as well
does discord have upload components yet
It does support attachment types for args yes
If I'm building a custom protocol atop TCP, what encoding method would you suggest I use to transmit data?
I've been leaning towards XML but please let me know if there are some downsides I might not be aware of and if there are better alternatives.
JSON is cool since its widely adopted
alternatively, you can make your own arbitrary format
I leave become developer. Need a json.
You're absolutely right about JSON being widely adopted and ngl I was about to use it too but XML is just fancy and old school. Also, making my own format would be very cool but then I'll have to write a encoder/decoder for every language which is just too much work
(every language i interdepend on)
I don't think that just because something is fancy and old school, doesn't mean it should be used. For instance, JSON can save so much data being sent vs XML because XML has a lot of overhead
That is so hard to become a developer.
That easy to edit files at computer but always overnight.
What in the name of…
That's true. Guess I'll be going with JSON then. Thanks for your insight!


probably didn't pass in a valid ttf or otf file
how can i fix that
Send it a ttf or otf file
how
I think the user is not using the raw node-canvas module but this https://www.npmjs.com/package/simply-djs.
you should probably read the docs for canvas


As a JavaScript developer I understand your need for an entire npm package in order to make a rock paper scissors command
lmao
the rank one is kinda understandable tho
I prefer screenshotting an svg rather than using canvas 
this pic goes so hard. Feel free to screenshot
Ok
thanks
Promising peace of art
Is it possible to animate background-image gradients
now selling for 1mil in btc 

With CSS?
Self proclaimed free thinkers when they realize there are other cryptocurrencies than bitcoin
Yes
Damn I was about to answer
imagine not manipulating gradients by hand like caveman
imagine doing everything raw
Hey hey! That’s what older people do
We don’t trust this new modern technologies 
They are all evil!!1!
I mean. Some are actual malware
such as python3
real
I got carried away with gradients for that site 😄
I hope you disable the animation for prefers-reduced-motion
no... the site is only used by game devs lol
yes but still remove the animation for @media (prefers-reduced-motion: reduce)
nah... that'd require me to edit the site code 😄
imagine using snakes
Peach
lmao
i can read lua and coffee script but i can't read python
JavaScript is extremely readable, C makes me go death but python is kind of in between, which is what makes it terrible
lmao
best of the worst
imagine trying to recode googles search engine and it's all null
c is readable you muffin
its just the fact you have to write ugly code to do what you want to do:(
pog cmds 
i made my own cmd handler so i'm glad something works lol but
when i pull for a command the args don't come with it
so brB
Do anyonne know about this?
context please
does the channels in a all category starts from position 1?
yes
or are they hv position value in sequence from top to bottom?
if your pulling channels from a category it starts from the first to last
if you want to get a specific channel you can give args for the exact channel name or set an interval so after x channels log x
@ivory siren i hab a question
Yes
so you've seen alot of bottums and stuff and i wanna know if this function looks pog or generic
my music cmd
whenever you play a song it brings up a yt queue and whatever number you send it'll play that number
Ye gotcha
i wanted to do spotify but yk no api
Ye
is there a limit on howmany msgs you can fetch from a channel?
100 at a time
uh
make another request
make a interval i assume or have it cache channels
cuz if i do fetch twice it will just give me the same mgs over again though
and set the message ID
then do a interval or make a json
so after x messages return and fetch again
mmm
if the id's are stored properly you can jus check if you have the message id already
like are you py or js?
true but i dont want to fetch the same msgs orver and over cuz thats a wast of resources and will probably get me rate limited id asume
im using JS
okay so like
async function lots_of_messages_getter(channel, limit = 500) {
const sum_messages = [];
let last_id;
while (true) {
const options = { limit: 100 };
if (last_id) {
options.before = last_id;
}
const messages = await message.channel.cache.get(options);
sum_messages.push(...messages.array());
last_id = messages.last().id;
if (messages.size != 100 || sum_messages >= limit) {
break;
}
}
return sum_messages;
}
idk if it's still like that tho
it's a basic idea though
true lol
if it gets the job done it doesn't matter too much
also true
yeah but i dont want to spam discord with requests
you can use a if(!) statement there i'd assume
yeah
cuz this is how my mate did it with his bot
async def index_servers(self):
status = self.loop.create_task(
self.wait("Indexing Servers")
)
index = {}
for category_id in self.config["category_ids"]:
category = self.get_channel(category_id)
if not category:
print(f"Couldn't get the category under ID {category_id}")
continue
index[category.name.lower()] = {
channel.name.lower(): {
msg.content.split("\n")[0].replace("__**", "").replace("**__", ""): msg.content.split("\n")[1]
for msg in list(await channel.history().flatten())
if msg.content.count("\n") and msg.content.count("discord.gg")
}
for channel in category.text_channels
}
self.index = index
status.cancel()
print("Successfully Indexed Servers", end="\r")
```but its in python and all my crap is in js
also the context of the bot is for a discord server that is an archive of many discord links
I think the crap should be python not js
yeah but tell that to 2020 me where i couldnt get py to work on my laptop so i just started using js and thats how i got into this state
true
good code tho
if i eval my token it returns my token and im scared please halp
I meant python was crap and I respect your decision for switching to js
i do wish i persued py more though cuz unlike js its actually usefull for many things (yes i know js has its uses but they aren't anything i can see myself doing)
i don't feel like recoding it
oh fair enouhg
misread
but even then i would rather c# or somthing over python
when i do -eval tokem it returns my token but when i do -eval tokem return; it sends the "i don't have a token" message
pog gamer moment
That is even better than js
But the bottom line is anything > js >>>>> php >>>>>>>>>>>>>>>>>>> python
you should just accept that eval is dangerous but useful
yeah
indeed
i think it only returns my token cause of my id but i'll check
i think all my cmds work besides my spotify and urban ones but there not that important so hopefully when i submit it they won't count it off
I love how people panic over owner locked commands
no it's not owner locked lmao that's why i ws scareD
unless its not owner locked
better safe than sorry they said
of fuck
it'll be fine they said
the exec command is cause the eval is setup so it only checks over the code it doesn't run it
why tho
exec however does both so if i typed in client.destroy() it would restart but in the eval it'll just return the function
cause i'm a flaze wanna be
And it just so happens @pale vessel knows how to make a public eval
what about that sandbox built-in module
yes i was there when he made it lol
he
how to get free bot hosting:
paste bot code into another bots eval
smug mode activate
stonks
i just
use a custom webserver and constantly ping it offline so it won't shutdown after like 3 hours
Has money for nitro but not for a vps
hush
i just use a dell dimentions that i got for free
pogg
it lives under a table
bruh
i wasted 500$ just to get 30*% in genshin and no soft pity lol
i mean id say that cheep vps' are a scam tbh cuz my crap dell from 2006 costs a fiver a month to run
and you get dedicated hardware
oouu
the only bad thing is you have to do your owen maintinance and thus you get more downtime
but eh
if you can maintain it on your own it means you've mastered it
which is why i code so much >.<
fair
damn
i have over 9k lines \
i dont think i have that on all my bots combined tbh
i overcomplicate alot though
but then most of them are spesualised and i just add the same commands to all of them just as filler
it would be like 3k but i made the cmd handler myself so i went over the top
to make it flashy
i have like 50 args statements
11 of them are in my help cmd
i remember i made an error handler that was bigger than the bot it was connected to once
had verbose levels and everything
relateable
i gotta add 4 more categorys
most of my bots dont even use embeds tbh
i wanna add like reaction embeds but i've tried before and i don't feel like recoding my help cmd
oh
cuz i like the md codeblocks
true
i jus like the color and the format it's in
omg my shop command is like
590 lines
i think
> headder >
#info and that
[comand][info]
<blue yellow >
``` see
indeed
if your bot blows up it'll def be because of that
lol
CSS selectors be like
yeah
the last actually different bot i've seen is crowby
w bot btw i'm cool with the owner #notapromo #raidshadowlegends
i was inisually inspired by the commands groovy had cuz that didnt use embeds
but i never worked out what it used to use that colour thing
cuz i just used md
there is also ansii or somthing
but alot of people use dthat
same
using code blocks as a style is pretty creative
i still use RANDOM as the color lol
but for users I'd argue they'd prefer the embed
Mobile users 
plus they're standardized
LMAO
this too
yeah codeblocks suck on mobile
i think they fixed it on android
Embeds suck harder (no pun intended)
long live desktop
hey now embeds on mobile aren't that bad
true but they do have alot functionality
codeblock though
it doesn't like show the colors
It does
bruh it doesnt?
yeah that sucks for mobile users
They fixed syntax highlighting
only on android
apple users ar invalid lol
<p>balls</p>
What else is new
hehehe
[0;30mTest
[0;31mTest
[0;32mTest
[0;33mTest
[0;34mTest
[0;35mTest
[0;36mTest
[0;30mTest
unless
what language did you use
go to the search thing on this discord server and type "ansi"
and there are people who posted it
yes
oh bruh thats tereble
what the heck is that font
how the fuck can I know
some apple monospace font I guess
POHG
show me codeee
who need help i am hungy for dweeb coders who are in need of savings

The screenshots aren't enough?
right above your message... very B I G
i also said where you can find it too
oh with the message counter?
grrrrrrr
see what
i am now back in development
my codeee
hello world
it's poG
who simps for a golden apple pfp
yes
addWarning(guild, user, d, reason, issuer) { // Returns: Number (The users new total warning point value)
return new Promise((resolve, reject) => {
try {
this.db.push(`/guilds/${guild}/users/${user}/warnings[]`, { d, reason, issuer }, true);
this.db.push(`/guilds/${guild}/last`, user);
// Return data
resolve(this.db.getData(`/guilds/${guild}/users/${user}/warnings`).reduce((prev, val) => prev + val.points, 0))
}
catch (err) {
reject(err);
}
});
}
poG
what db is that
uhh
[0;31mNO,[0;32m please[0;36m not
json db 
Moown loves children
loves
welp back to degen code
i am not a degenerate 
omg bubs sorry
what markdown type is that
its ansi
discord aparently suports escape codes
but only on desktop
which is anoying
oh so its kust ``` and then the text?
i was imagining something like ```py if u get what i mean
```ansi
then the escape code and text here
ah thanks
just serch "ansi" in the server search thing and you will see where i got it from
```ansi
It's three `
```
yeah ?
indeed
bruh ansi isnt even what i was inisually thinking about either but was just a side track
i ment anciidoc
= This =
== Sub Header or somthing ==
command :: result
another :: command
looks like that
but alot of people use that so eh
Could someone give me some ideas on how to make a large number of chunked concurrent TCP requests w/o multi threading?
for ?
What do you mean for?
Platform is not an issue, I am concerned about system limitations and if there is something I can do to elevate those limitations.
oh
well each thread can't hold more than 65535 simultaneous connections to a single server
i think
I think you're referring to the amount of ports.
probabl
not very good with anything outside of bot coding unless it's ts or for a website s soz
so*
i'm sure someone will be of help though 
what
Reset it because it error
sigh
Please don't come into development unless your developing a bot/something related to coding.
if there is a bot error take it up with the owner you can find there discord on top.gg website on the bottom right corner of the bots page
thank you and enjoy your day

did you not read what i said lol
'
User in a nutshell
How fix it???
Have you tried asking in its support server?
Inb4: no, I don't have the server invite
Heyo
okey
url only supports twitch links or yt live stream links.
Use name instead
url also only shows when using type STREAMING
ohh kk
what dont you understand
how to declare message.guilds.member as a function
Pretty sure you're trying to get a member by ID, right?
yes
message.guild.members.cache.get
even without id it does that
where do i put it?
replace message.guild.member with that
yes
ok
get is a function
module.exports.config = {
name: "serverinfo",
description: "Shows Information about the server",
group: 'info',
usage: '.serverinfo',
example: '.serverinfo'
, botperms: ['EMBED_LINKS']
}
module.exports.run = async(client, message, args) => {
const {MessageEmbed} = require('discord.js')
const owner = message.guild.ownerID
const cato = message.guild.channels.cache.filter(ch => ch.type === 'category').size
let embed = new MessageEmbed()
.setColor(client.color)
.setTitle(`${message.guild.name}`)
.addField("**Owner:**", `<@${owner}>` , true)
.addField("Region", message.guild.region, true)
.addField("Text Channels", message.guild.channels.cache.size, true)
.addField("Members", message.guild.memberCount, true)
.addField("**Role list**", message.guild.roles.cache.size, true)//a70f3e9169546b2c67d301aaeef38.gif
.addField("**Catogory size**", cato, true)
.setThumbnail(message.guild.iconURL())
.setFooter(`${message.author.username}`, message.author.displayAvatarURL())
message.channel.send({ embeds: [ embed ] });
}```
when i run that code i get that
change client.on("message" to client.on("messageCreate"
can you show me an example?
Guild regions are no longer a thing prior to the <Guild>.region property, now every voice channel have their own regions
that's the whole code right there
so remove it?
Yes, and use the messageCreate event instead of message like PapiOphidian said, as it's deprecated and will be removed soon
ok i can’t find where to put client.on("messageCreate"
wherever you had your on("message"
ok
I highly doubt that, but okay
check the code
It seems like you're using an event handler, rename the message event to the messageCreate event
like anything they says message. ?
That one specifically might not have it, but your entire project has it
@earnest phoenix

am i wrong?
very much so
oh god then i’m really tired
so i’m confused
OOOOH
I MIS RESD
ima just remove the command
I'm attempting to play audio via @discordjs/voice, but for some reason the bot doesn't play anything. I have the GUILD_VOICE_STATES intent enabled, and the file is in the correct directory and in the correct format (see screenshot). I mostly copied from the DJS Guide website to learn a bit on how the package works.
Code:
https://sourceb.in/6sv8XBdOij
uhhh
i have a question
wait nvm
ghat was weird
it was like my client just died , i'd restart it and the ready event would'nt fire and then my bot went offline but nothing was wrong with my code
js being very wonky imo
how about guild_voice_states
oh wait
My brain is literally fried

const Discord = require('discord.js')
module.exports = {
config: {
name: "lockdown",
category: 'mod',
group: "moderation",
description: "lock server",
aliases: []
},
run: async (bot, message, args) => {
let lockPermErr = new Discord.MessageEmbed()
.setTitle("**User Permission Error!**")
.setDescription("**Sorry, you don't have permissions to use this! ❌**")
if(!message.channel.permissionsFor(message.member).has("MANAGE_CHANNELS") ) return message.channel.send(lockPermErr);
if(!args[0]) {
return message.channel.send("Please specify something.`Either on/off`")
};
const channels = message.guild.channels.cache.filter(ch => ch.type !== 'category');
if (args[0] === 'on') {
channels.forEach(channel => {
channel.updateOverwrite(message.guild.roles.everyone, {
SEND_MESSAGES: false
})
})
let lockEmbed = new Discord.MessageEmbed()
.setThumbnail(`https://media.giphy.com/media/JozO6wdFcC81VPO6RS/giphy.gif`)
.setDescription(`**\n\nDone! Server Fully Locked! 🔒**`)
.setColor('#2F3136')
return message.channel.send({ embeds: [ lockEmbed ] });
} else if (args[0] === 'off') {
channels.forEach(channel => {
channel.updateOverwrite(message.guild.roles.everyone, {
SEND_MESSAGES: true
})
})
let lockEmbed2 = new Discord.MessageEmbed()
.setColor('#2F3136')
.setThumbnail(`https://media.giphy.com/media/JozO6wdFcC81VPO6RS/giphy.gif`)
.setDescription(`**\n\nDone! Server Fully Unlocked! 🔓**`)
return message.channel.send({ embeds: [ lockEmbed2 ] });
}
}
}
should i replace override with
mm.updateOverwrite(message.guild.roles.everyone.id, {
and add
let mm;
if (channel === args[0]) mm = await message.guild.channels.cache.get(args[0]); else mm = await message.mentions.channels.first();
- The
joinVoiceChannel()method returns a promise, resolve it - The voice connection must be subscribed to a player for it to broadcast the player's stream to the voice connection using the
<VoiceConnection>.subscribe()method
For #1, thank you I forgot about that. Regarding #2 I do believe I have a connection.subscribe() line.
You're subscribing the player after calling the <AudioPlayer>.play() method
ah i see. mb, thank you for the help!
i added let channel = message.mentions.channels.first() to my code and still get this error
channel.updateOverwrite isn't a function.
so i remove it?
it’s meant to lockdown the whole server
No, .updateOverwrite isn't a function entirely.
ok so i’m so confused
^^ the docs show the correct function you should use
Use:
channel.permissionOverwrites.edit(message.guild.roles.everyone, {
SEND_MESSAGES: false
})
so i switch it for permissionOverwrites?
Yep
ok
remove this? @simple stump
I didn't say remove it. As I said before, .updateOverwrite isn't a function.

userid is not defined
The variable isn't defined then. Define it.
i’m so confused
I would suggest learning JavaScript fundamentals first before making a Discord bot in discord.js, TW rblx
i do know it i’m just tired
Then take a break
did they say it?
then sleep or take break lol
@earnest phoenix look at pog advancement
That's pretty epic
Maybe you should switch to slash-commands sometime, their argument handling is really good and all the functionality it brings
@earnest phoenix i added const user = message.guild.users.cache.get(args[0]);
and it worked
nvm
The <Guild>.users property does not exist
undefined reading cache

You're obviously not
https://discord.js.org/#/docs/discord.js/stable/class/Guild?scrollTo=members
we stan urban dictionary
we stan
you would be surprised how many sites have an api
prob. ive only used like 3 sites w/ apis
whats the best way of doing a search system with mongodb
okay so i get this error whenever i run my spotify command
but i have presence defined
ill try it
okay so
if(command === "spotify") {
let user = message.mentions.users.first() || message.author;
if(!user) return message.channel.send('invalid user');
let spotify = message.member.presence.activities.filter(x => x.name == 'Spotify' && x.type == 'LISTENING')[0];
if (spotify) {
let trackIMG = `https://i.scdn.co/image/${spotify.assets.largeImage.slice(8)}`;
let trackURL = `https://open.spotify.com/track/${spotify.syncID}`;
let trackName = spotify.details;
let trackAuthor = spotify.state;
let trackAlbum = spotify.assets.largeText;
const embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setAuthor(client.user.username, client.user.displayAvatarURL())
.setThumbnail(trackIMG)
.addField('Song Name', trackName)
.addField('Album', trackAlbum)
.addField('Author', trackAuthor)
.addField('Listen to Track', `${trackURL}`)
.setFooter(message.member.displayName, message.author.displayAvatarURL())
.setTimestamp()
message.channel.send(embed);
}
}
full command btw
i don't get any errors and it doesn't send anything in the channel
where lol
i'm just thinking of random fixes 
djs version?
is it possible if(spotify) is false?
I updated my code a bit and found that the issue is in getting the mp3 file. However, the directory looks fine and the file is in the correct folder. I uninstalled ffmpeg and ffmpeg-static since that was causing some weird issue with the file ending before I even play it.
Code: https://sourceb.in/arcrl6VM10
Logging resource results in ended returning in true along with autoDestroy, destroyed, and closed returning true.
uhh i don't think so
Embed needs to be in an array
cause it used to work
not in v12
message.channel.send({ embeds: [embed] });
your okay lol
I would update to 13 but I'd have to recode my boy
instead of an embed
bot*
rip
Uhh sure
might be an issue with whether the bot is detectingf the cmd or not
¯_(ツ)_/¯
I think it is
Cause it doesn't even register the user args
dang
i don't get like a error message in my console either
update to v13 🙏
they acting like apple
frfr
I wonder how long until v12 stops working 👀
same cs my bot is already almost finished
which is why i didn't switch in the first place 
solution is for discord devs to not update their api at all
how would u deal with messageCreate being deprecated
or wait nvm interactioncreate is kinda similar
yep
i didnt want to switch to slash cmds but then i realized that the two events are almost the exact same
Repost
I updated my code a bit and found that the issue is in getting the mp3 file. However, the directory looks fine and the file is in the correct folder. I uninstalled ffmpeg and ffmpeg-static since that was causing some weird issue with the file ending before I even play it.
Code: https://sourceb.in/arcrl6VM10
Logging resource results in ended returning in true along with autoDestroy, destroyed, and closed returning true.
Changing resource to let resource = DiscordVoice.createAudioResource(createReadStream(join(__dirname, 'file.mp3')));, however, results in ended being false, but nothing is played.
H u h
idk tbh lol ¯_(ツ)_/¯
aight gl
rip
Yep jus gonna void it all together
Not really important anyways mainly for style points
as you can see, the tester tried to use my bot but didn't respond, and asked someone in my server to use it but was able to, any idea why?
In d.js, does client.application become available in the ready event automatically?
The member you're try to get the Spotify activity of either doesn't actually have a Spotify activity, or you don't have the GUILD_MEMBERS and GUILD_PRESENCES intent which are required to get access to a guild member's activities
Yes
What the fuck then
OH
Oh, it's UNDEFINED?
Why does it still not send a message though or give console error
If it was a intent error it'd be like can't access or missing permission right?
Any permissions required to run your help command?
Or any reason you might be returning from your functions before responding?
nop
and all intent are up
The client application is known to be undefined in certain cases, either when it can't establish a gateway connection properly due to network limitations, or something similar, you can listen to the debug and warn event listeners and see what those tell you in the console
Have you tried making a second server, giving your bot no other perms than basic everyone permissions and seeing if it responds?
ye i did
i did that even before applying xd
The Discord API won't throw errors if you have few intents which are enough to run the bot, especially when you're accessing data you don't actually have access to, the reason it's not sending anything is because it doesn't even pass the if statement conditional, as I've said, you need those intents
Pain in the ass. Can fetching the application directly from Discord API via client.api.applications() be an alternative solution?
Hmm, I'm not sure then.
Could be, although it may not work, because there are edge cases where this can happen
You're welcome 💙
Do I blame Discord or d.js in those edge cases?
i thought i already enabled my intents but i guess i didn't save my changed
Both are kinda blamable in this case, best to listen to the debug and warn event listeners to find out
I haven't seen much people encountering this issue
Repost
The Discord bot can join the VC and log that it is playing correctly, but nothing gets played.
Code: https://sourceb.in/UjKeXlARex
This is what resource logs after the message, "The audio player has started playing!"
https://sourceb.in/379zolwlqM
Here's my TTS command showcasing how to use @discordjs/voice properly, maybe you can get an idea
https://sourceb.in/LZ4zNLAJ0r
Thank you! That's really helpful.
How do you get your genius api key
after this cmd my bottums should be finished 
nvm i got it
okay so
@earnest phoenix
i get this error whenever i run my lyric command
but the song i search has lyrics on the genius website
Show code
if (command === "lyrics") {
let songs = args.join(" ")
if (!songs) return message.channel.send('No song lyrics to search');
const searches = await Client.songs.search(songs);
let firstSong = searches[0]
const lyrics = await firstSong.lyrics();
if (!lyrics) return message.channel.send('No lyrics found');
let embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setAuthor(client.user.username, client.user.displayAvatarURL())
.setDescription(`Lyrics of the Song:\n\n ${lyrics}`)
message.channel.send(embed);
}
im using the genius api btw
const Genius = require("genius-lyrics");
const Client = new Genius.Client(config.api);
ues
it is lol
Hmm, I suppose the song that is being searched may include characters that may be invalid to search, try searching another song or multiple songs and see if any of them succeeds
okey
Give Sabaton songs a try!








