#development
1 messages ยท Page 806 of 1
Probably the monthly reset
Though it happens to stay at the number until someone votes, which can push it down from something like 30 -> 2.
Yeah this is the montly reset
In Discord.JS is there a way to see if youโre being global rate limited?
there is a rateLimit event
Where?
@glad sonnet #memes-and-media
#memes-and-media, yea
@stoic gate wdym global
my bad
Some rate limits are global, some are per channel/guild right?
So JS has an eval function that bot's like to wrap with eval commands
How do they usually ensure Discord users don't eat their resources, curious?
eval must be a bot owner only command
Ah ok
One of my commands is going to have a custom-written scripting language, and running the scripts requires manual approval of said script, is that fine?
Thanks NMW
In Discord.js can you tell which is which though?
Like can I tell if the rate limit is one of all sent messages
Not just for a channel
i dont think thats possible
actually it is
idk if discord.js handles it though
client.on('rateLimit', rateLimitObj => {
console.error(`Rate limit reached! Method: ${rateLimitObj.method}, Path: ${rateLimitObj.path}`);
});```
Edit: For u

he wants to differentiate between per-route limits and global limits
from what i can understand in the d.js code, it doesnt handle actual rate limit errors, it preemptively prevents them to happen
the rateLimit event is not a discord rate limit, its discord.js's own rate limit pevention
discord.js handles global rate limits, but doesnt expose them to the user afaik
Oh okay
I
I think problem is your server.
I am using glitch
Normal?
Doesn't give everyone fastest server.
Ik
So you sharing server to other people's.
That's not how it works
also changed the project name
Lmao
No
You don't get a choice about others using the same server as u
Glitch is sharing server to other people's. Not you
You get a fraction of the system resources of the actual server
This true
Then what should i do?
Because Glitch is free service.
Just waiting ?
Or leave bot developing
Or suck up the shit hosting and live with the issues of glitch

Or leave bot developing
@charred jetty

Until then i am leaving the bot
๐คทโโ๏ธ
In glitch
I'm using google cloud.
Ee
How?
Ew
First year trail balance 300$
But it requires a credit card sign up
doesn't it?
Even if not paying
and using free $300
Speedtest:
i may have one, one sec
Oof
yes i do ill post the numbers here if you wanna try it. but it may block prepaid ones
My vpn has some nice upload speeds
Was just replying to this
Ps it has no money so donโt bother trying to buy anything lol
in this channel
@slate oyster I know, but i wasn't see development channel.
Welp I should work on my bot some
Haven't done so since Saturday
Need to fix an issue were I was storing chatlink data in a channel doc instead of a chatlink doc
For whatever reason, I forget and I'm not looking at the code rn, I couldn't just switch out the two docs
Oh I see why I didn't have time
There's some data that is legitimately stored to a channel document
So I have to seperate that data from the stuff stored to the chatlink doc
Should be easy enough
Oof fixed it I think
now just gotta test
My ide doesn't see that I'm in a Gradle project
also Eclipse is alot better than VS-Code based products
GitPod and Openshift Che, both VS based
never work properly
While eclipse does
Well I'm out of time rn
Someone gives me credit card without money in dms to have 1000 hours of heroku dynos
And it works
Cool
hey
That's quite good
Compared to me on a vpn at public wifi
I can do better at home though, at >100MBS
That's pretty good internet
compared to googles cloud tho... ๐
But here on public wifi and vpn
My upload speed <5 mbs
there is a company here in the uk called that is working on giving 1gbps speeds to households! ๐ฎ
oh, idk what its called*
hyperoptic i think
Me in the US...
I hope they gonna export to france
i cant get virgin in my area ๐
ooft, lucky bath
tbh i used to work for virgin, their service in london is years ahead of everywhere else
i worked for them like 5 years ago, and even then london was capable of 100gbps apparently
no one had it
but the foundations are laid out
idk if that was like, buisiness only or what tho
and tbh, whos even got the cabliing in their offices to run that ๐
England's overall internet and fibre system is still fucked
It really is fucked
i scotland, but yea, samesies.
literally every area surrounding mine has virgin capabilities ๐ข
i feel like my street alone has been left for dead lol
infrastructure is laid out slowly to accommodate enough bandwidth for years ahead
and after that, companies and vips are serviced first
there arenโt many packages
thats why they lay out 100gb connections and only sell a fraction of it
@empty owl google if there is an api for that, if not you need to scrap a website
Ah
@neat ingot yea but not everywhere, currently they working in my area, im so done with virgin after they go
@tight plinth not heroku, when you need to add additional services they want bank
id go aws or do, and dockerize your app
Ok
make your own>?
i had to make an analytics module last night, called it anal-cavity cause why not
GitPod
I'm dead now
It has such bad initial load times
abd their Gradle integration is terrible
how would i "dockerize" a discord bot in a way that every container is a single shard?
i've been wondering this also
not had to shard my nubbot yet tho ๐
i mean, its possible to use things like kubernetes and such with docker
to have multiple instances of your containers running
GitPod: Switch statement missing case abc, please insert this case
Also GitPod: No quick fixes available
When literally it just said the fix
but then, if your sharding via js, for example, that'd be done within the dockerized app
of course
right now i can only think of a "master-container" idea, where the container asks the master container what shard number it should run, and then runs it
yea i was thinking similar, you basically have one container that handles the spawning of additional shard containers, passing some env args to them at creation for shard id etc
no clue tbh
but could easily run a script 'from the outside'
but its not CLEAN
yea its clean af tbh
at least ~ within docker-compose files etc
just need to load the .env file
no i dont mean that
you mean when running a container? passing the args via cmd line?
docker run [...] -e SHARD_NUMBER_TO_RUN_PLS=69 spawns the 69th shard haha funny secks number
i was also wondering if it'd be possible to have different shards running on entirely different machines in different locations
yes
it sounds like it'd be fine?
you can do that
for example in d.js it would be ShardingManager given [69] as options.shardList if i get this right
see i've got the additional issue of: my website is its own individual container that speaks to my bot container to get stats and commands info etc for displaying on website
so then, i need to completely change how thats handled for shards
cause atm the bot itself has a simple api exposed internally that the website container contaccts
make the bot speak to the website instead :cosmicbrain:
but if it was sharded, i'd have to be contacting multiple instances of the api
can containers communicate with each other?
yea im gona
im pretty sure yeah
via ipc or tcp
yea tim
internet ports can be exposed
then you can orchestrate self-organizing instances
and you can use nginx as reverse proxy
so that those ports can not be contacted 'from the outside'
oh yeah docker-compose is a thing
they all share an internal network
the shitty thing about discord sharding, is that you cant simply add/remove shards
and you can choose to expose specific ports manually, or via a sepeerate nginx container
you need to restart the whole system and all instances
no
oh
discrd sharding you need to ?
that sucks!
i thought you meant docker-composed containers ๐
because guilds are assigned to shards based on how many shards you have
if you change the total amount of shards you're running, all guilds will be reorganized
into different shards
but if a container restarts with the same shard number it will just reconnect fine right
it needs shard number and total shard count
Google translate is smart enough not to translate commands
if the total shard count changes, the guilds it holds will change as well
disableEveryone is gone?
Lol
Oh
My rewrite has the same ping permissions
except I named "all" as "strict"
How to clear cache?
which cache
๐
discord.js?
Yes
why is there no good cache memes ๐
there is guild cache, channel cache, user cache, guild channel cache, guild member cache, guild roles cache, guild emojis cache, guild presences cache, guild voicestates cache
etc...
221/500 isnt alot
@quartz kindle every cache
you need to clear them all one by one
Oh
But how to do?
you have like 50% ram free
@neat ingot ik
thats not slowing down your bots speed
client.channels.cache.clear() will delete all channels from the cache
Ok
client.channels.cache.sweep(function) will delete all channels that pass the function
in v12
if you're using v11, then its client.channels.clear/sweep
It's a fir Discord v11 ?
not .cache.
Oh
Ok
or you can use a library that does that for you
It will regain the caches na?
So what should I put instead of disableEveryone here?
yes, channels and users are recached automatically
disabledEvents was also removed btw
disableMentions: all
?
"all"
you extend your discord.js client? for what purposes?
Ok
i guess if your sharding you technically have more than 1 client ?
depends how you shard
if you use the sharding manager, you have one process per shard
if you use internal/auto sharding, then you have multiple websocket instances in the same process and client instance
one process per shard in the context of a node js environment tho? is that actuall running its own process, or still using the shared node process?
ie, would it be able to utilize a 2nd core?
OwO
discord.js's shardingManager uses node's child_process
oohhh nice
so yes, it spawns a separate process that can use a separate cpu
thats good ๐
i've been debating if its worth sharding my bot prematurely
just in case
atm its like, 60 guilds only ๐
no need to shard prematurely, but good to code with sharding in mind
if you're going the shardingManager route, you need to make sure all your code supports it
for example, cross-guild posting or member getting will not work
How is the second ping in that image not pinging? Unless there's an invisible space their
because not all guilds/members will be available in each shard
ahh good to know! i do have cross guild posting for my bots 'report bug' command
@slate oyster the library has a disableMentions option that does that for you. it essentially inserts a zero-width space after the @
it sends a post from them to my support server
but i can easily offload that to some web api endpoint
the shardingManager itself has IPC that you can use
guys after the discord.js update it broke my bot
for cross posting and cross instance communication
@solemn harness did you update to v12?
ahh nice, if each shard was a container on a different machine though i'd need a different approach right?
yes
did you see the v11->v12 update guide?
i can easily setup basic sharding with manager for now and once its hurting my single container work on splitting it more ๐
but again, no rush ๐
@solemn harness https://discordjs.guide/additional-info/changes-in-v12.html
when did v12 get released?
ok ty
yesterday
it is
ahh, fudge ok
i best update then
was from when i installed it a month or so ago
should maybe check all package updates as a point
make sure you check your code because v12 has a gazillion breaking changes
ok yea no not even updating
cause it wants git to be in the path
and my path is technically in a container
that im not adding git to
๐
idk it says for now gits needed
oooh wait
its just to install?
nvm then thats fine
lol
wait npm uses git anyway?
will posting feedbacks submitted to my bot to the support server not work when using sharding?
like, npm installs git automatic?
Why is Discord.js so popular?
There are discord libs for languages that, in the long run, are easier to organize and maintain.
because javascript is so popular probly
Ah ok
Will cross guild messaging not work when bot sharding?
And I'd assume JS is popular because it is used by browsers
even wasm requires js to work
MY real acc got disabled how to fix it?
no rahul, you need to accomodate for such things
๐ฑ
alts??!!
they say to check enail nothing in there
cause not all shards wil have all guilds in their client
email^
Can we make all shards have one guild at least?
you can however use internal sharding instead of the shardingManager
@tough kraken not exactly
js is popular for it's high speed, efficiency, age, capability
wdym?
js is losing its popularity slowly
js will not be forgotten while the web exists in its current state
^
help me
imagine Tim being like what's js in 2070
help with what
js will lib forever ๐
ping me when js is no longer needed @finite bough
pretty sure discord is gonna die soon

doubt it, js is still much more flexible and easier learning curve than wasm
^
Ah ok
atleast sooner than js's extinction
so many changes in v12 ๐
@quartz kindle My real acc got disabled idk why
it says to check email but no email ffrom discord
then you should ask discord
dont use v12 for the time being
why not
bugs
i asked them
no response
lul
yea tbh, im not gonna update to v12 quite yet
contacting big companies usually takes about a week for them to respond
3weeks?
yes
there are about 3M people on disc
tim, are you experienced with docker?
take 20k emails every day for diac
nope
anyone here works for ds?
so you just know scraps of how it works?
no one can help u batman
as
the email goes to a specific person
not the whole ds worker team
but
@mossy vine btw i didnt find the problem you reported yesterday, but i found other similar problems while i was at it lmao
if its disabled
glad to sort of help?
u should be able to login
try befriending ur main account and see if it still exists
as it may get terminated
when i trys to login it says your acc is disabled check email
screen shot?
k
@quartz kindle holy christ that's a fuckton of things to change in v12
good luck
ha, cba ๐
exactly
quick question
this is what it shows
safety measures
hiding from the russian hackers
woah
the ss looks like a part of the chat
does not look like a pic
like i can click that login button
@tough kraken I think ur account has been banned
Yeah
wtf
This is a ban
my friend's account was banned too
What are you doing on the account 
Selfbot? Raid? Giveaways serveurs(nitro)?
i make bot
self bots?
A simple bot can't be banned
self bot?
selfbot can be banned
what is that?
using bots on ur own account
hmm is it possible?
rlly...
well i got no idea on that
With a selfbot you can ddos, hash, "generate nitro codes" etc...
You can change your password, your email, send a number of message for spam
Mmmh
try to find a player for pubg
I can't trust you
did u use better discord?
better discord?
Am i allowed to offer a incentive for people to vote?
Yeah better discord = client modified = banned
uh
chances are your account wasn't disabled for thaz
that*
And
contact discord for the reason
Better discord is only because discord use electron...
ive never heard of any punishments for better discord, if so then its probably rare.
Not saying that its allowed though
@earnest phoenix I have heard tons
idk that things
because even though they say it's not allowed to mod your client, they in fact give 0 fucks about it
like i said
Better discord = forbidden
and there is no way to enforce it
and what it has to do with development... conversation going places
people here don't know the reason, contact discord themselves
Or
@tough kraken you can view the reason in your mail box generaly
@vernal yoke nothing, that's the point
@finite bough fair 
GitPod stop killing me
It's obviously defined in a lambda
u sent something else?
if you sent something like
not related to ur ban
u r banned for that
as the messages say
oh yea i sent
"no reply"
i sent a report against a server

possibility
and it depends upon the message content
so i sent a report for scam
i dont think it is a ban
or disabled
because my server is still there
is ur acc still there
it's not a possibility it's a certainty; their entire email system is automated so stop making things up lol
but the loss is i have to add the bot again if i cant retireve my acc and losses a 300+ server
@earnest phoenix
this is the real one
why are you ignoring the fact that contacting discord for the reason is the only thing that can actually tell you the fucking reason??
why are you ignoring the fact that contacting discord for the reason is the only thing that can actually tell you the fucking reason??
@earnest phoenix waiting
till they respond going through things to find a way to get acc back
be sure you also sent it to the right email
and from your disabled accounts email
it bounced back?
somethimng like that
lmaoo
it sent the message back to me in another format
then i found another email and sent
that's called bouncing back
instead of a person the clyde bot send a msg back
try contacting them on Twitter
they r pretty active on answering questions there
i dont have twitter
uff
i am trying to get the tag of one of my friend
which i am friend in the real acc
his friend works for discord
pls how to put a bot in my discord surver
@tough kraken try using ur bot and get all the people's tags in a json file
click the invite button
LOL
one of them would be ur friend?
when i click it it send me in discord and that its
@austere sun what bot
when you click an invite button, a page should open where you can chose a server to put the bot in
and it was the time i studied to make bot
no
and i made them a gen bot
gen?
which sends a random acc from a list
they gave me acc and all
what
tts?
eample: ,spotify
output(dm):your spotify acc ||spome acc info||
i dont understand anything you're saying
also, this is not exactly about development anymore
idk
they asked to make a bot which dm advertisement
from what site
move to another channel batman
@austere sun what bot do you want to invite? what is this bot's website or link?
invalid user
did he just leave? lmao
ots lmao
looks like it
of terms service
Ask discord not us
explicitly ask for the reason
I've recorded all the times of the process that run before my bot fires the ready event, and for some reason it takes ages for the bot to log in
Any ideas why?
is that 4918 ms?
All times are ms yeah
14
hmm ok maybe too much for only 14
Sometimes it can be up to 30 seconds
where is it hosted?
An AWS instance in ohio
does it have load all members enabled?
Not sure I'll check
or whatever the option name is
Yeah I know what you mean
are you using discord.js?
Yeah I am
you can do this to measure more accurately
client.on("raw", r => {
console.log(Date.now(),r.t)
})```
Oh right thank you
or new Date().toISOString()
to make it more readable
Yeah thanks
Hmm I don't know
default is false, so if you dont know its probably false
Yeah I don't remember specifying it
yeah just check the raw packets
Alright I'll give it a go
also, you'll probably be flooded with presence updates if you're not using intents
ok how do u even use 12.0
npm install discord.js
if you already have v11 installed, either uninstall it first, or do something like npm install discord.js@12.0.1 or something
i forgot the exact syntax
because npm does not allow you to update major versions by default
welp i dont use glitch
i use vs code
and glitch
i test on vs code and then paste into glitch for free hosting
yay im approved
nice profile picture
Guys I Need help, When I Was whit only the index.js the bot was working, now i did multiple folders and the bot doesnt work -_-
change the file in package json
@pale vessel thanks lmao
what were you trying to do
u can connect the 2....
@finite bough no . But we have copy paste and upload file
@solemn quartz then you did something wrong. if you want help, either post your code or your error if you have one
it will send it to glitch
umm
Does getting user presences (i.e. online/idle/dnd/offline) count as an API request?
Because that wouldn't be cached I assume
there are no presences in the rest api
if you dont enable presence updates, there is no way of getting them
well, there is one way, via requesting guild members
I've been checking if users are online for a while and it's worked fine
What I was wondering was if I could be being rate limited for continuously checking presences
are you using intents?
No not at the moment
then you're receiving and caching presences
checking for a user presence checks the cache
it doesnt make any request
Oh right thank you
theres an npm package that you can run to update all dependencies at once if you want ๐
can check, or update, quite handy ๐
d.js v12 is still a bit unstable so it should not be the default now because a lot of people are complaining with glitch ๐ฉ
a lot of noobs are complaining
v12 has been pretty stable for a long time now, i've been using it for like 6 months
lol
what isnt?
12
error?
I am probably doing something wrong
/rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/discord.js/12.0.1/node_modules/discord.js/src/client/Client.js:40
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/discord.js/12.0.1/node_modules/discord.js/src/index.js:8:11)
Edit
like a cmd with }catch()
deleted the whole index.js
That's basic js stuff
What
.catch is invalid it's suppose to be just catch
try {
//code
}
catch (error) {
console.log(error)
}```
or
```js
} catch (error) {
console.log(error)
}```
try {
}
catch (error) {
}```
Not .catch
big brain chat
.catch(error => console.error(error));
});
People using d.js complaining
Me happily using d4j
Me: Using C# so that is does not succ ram like d4j and d.js
oof
if you use discord.net congrats you still waste memory
lol
Disqord enough?
disqord and dsp are good
@slate oyster
gj
discord.io best
@green kestrel
my DO droplet keeps getting shut down because they were "compromised in a ddos attack" or something like that
@finite bough your error might actually be this https://github.com/discordjs/discord.js/blob/3142d8cf18acc9b995d98c6ff2eabc1ead799087/src/client/Client.js#L40
hello. I have an issua with the bot . i send comands but he don't respond because he's offline. what could i do?
ooooooooh thx
no it is
at require (internal/module.js:11:18)
at Object.<anonymous> (/rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/discord.js/12.0.1/node_modules/discord.js/src/index.js:8:11)

how does embed.insert_field_at work?
read the docs?
client.on("guildMemberAdd", async function (user) {
const member = user.user
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
const embed = new Discord.MessageEmbed()
.setTitle(`*${member.username}`)
.addField("Joined Discord At:", nice(member.createdTimestamp))
.addField("Joined This Server At:", dateTime)
.setThumbnail(member.avatarURL)
const channel = user.guild.channels.find(a => a.id === "684108537206407177")
channel.send(embed)
})```
`(node:9807) UnhandledPromiseRejectionWarning: TypeError: user.guild.channels.find is not a function` Hmmm Ok???
How to then?
in v12 channels is of type GuildChannelManager
you're looking for https://discord.js.org/#/docs/main/stable/class/GuildChannelManager?scrollTo=cache
how can I do daily credit comand for all users hmm ...
store the unix timestamp of the command execution in a database
on credit command check if it's been 24 hours since the stored unix timestamp
if it has - the user is allowed to do the command again
if it hasn't - the user isn't allowed to do the command because it hasn't been 24 hours since they last received credits
ohh thx
@earnest phoenix wdym
?
i dont know how to use the new fucking discord.js api
oh gee too bad i didn't link any docs to help yo-- wait i did :)
Help more please
you can help yourself - by quite literally reading the docs
http://prntscr.com/rahu8f not much information here
All the info you need
so i have to do
const channel = user.guild.channelManager.cache(r => r.id === "id")
question
answer
const User = message.mentions.users.first()
let avatar = message.author.displayAvatarURL
const Embed = new Discord.RichEmbed()
.setColor()
.setTitle(`${message.author.username} is gay!`)
.setImage(`https://eclyssia-api.tk/api/v1/gay?url=${avatar}`)
message.channel.send(Embed)
}
}
yes its fucking a piece of ...
you don't have to memorise...? docs exist for the very exact reason
what do you mean lol
v12 is really good
Well its just a piece of cr*p
hey woah why be mad
managers instead of stores aren't that bad
this piece of cr*p of v12
you're complaining because you don't know javascript properly and can't logically resolve problems yourself ๐
there is a reason behind it after all
I make bots for others and i do know javascript but i hate alot of changes in updates
@earnest phoenix new api = bulk changes = people raging about syntax
thx (node:11804) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
const channel = user.guild.channelManager.cache(r => r.id === "id")```
wtf is that
???
client.on("guildMemberAdd", async function (user) { const member = user.user var today = new Date(); var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate(); var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); var dateTime = date+' '+time; const embed = new Discord.MessageEmbed() .setTitle(*${member.username}) .addField("Joined Discord At:", nice(member.createdTimestamp)) .addField("Joined This Server At:", dateTime) .setThumbnail(member.avatarURL) const channel = user.guild.channelManager.cache(r => r.id === "684108537206407177") channel.send(embed) })
keep in mind that's not what i told you
ewww
i told you that the channels property changed its type
reading comprehension ๐
i still can't get into js after switching to ts
vat
strong-type languages are bae
@mossy vine I've read the docs, but they're really vague
resolveId("id")?
What is this index they're talking about?
no @surreal sage
the cache propery is what you need
it's a collection
I have a problem with my bot when i send !play music my bot crash and send this:
TypeError: Cannot convert "null" to int
C:\Users\Administrateur\Desktop\Neotux\node_modules\opusscript\build\opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(M
abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)```
cache didnt work
what
client.on("guildMemberAdd", async function (user) { const member = user.user var today = new Date(); var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate(); var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); const dateTime = Date+' '+time; const embed = new Discord.MessageEmbed() .setTitle(${member.username}) .addField("Joined Discord At:", nice(member.createdTimestamp)) .addField("Joined This Server At:", dateTime) .setThumbnail(member.avatarURL) const channel = user.guild.channelManager.cache(r => r.id === "684108537206407177") channel.send(embed) })
so?
it's a collection
oh
learn javascript
before you say it, no, you don't know js
const channel = message.guiild.channels.cache.find(...)
and it's clearly visible here
@surreal sage what is so hard just to add .cache after collections
as of now i have seen enough that you can't read the docs
no
hey @earnest phoenix I fckd commands again you have a command line about that or something ?
yeh what
nwm I found something
p!hjรฆlp
if you want help post your code and error
nwm bro I found How to save data
Help
I fixed my self the first prob
but i got a question now
I have like
a timestamp
nvm
Wait
i got a timestamp
i want it to be like Year:Month:Day
How do i format it
get moment and format it
Modulus and math.floor and division and stuff
How do I format an embed to it's only 2 columns instead of 3?
i searched for packages but cant find but thz
you can see some formating at their site moment.com i think
https://www.npmjs.com/package/moment @surreal sage
ik
ik
here you go for the formating as well
do i have to use timestamp or ms
moment.utc().format
moment ew
moment is quite useful for dealing with timezones
I used luxon
Hye ! I have a problem with my bot when i send !play music my bot crash and send this:
TypeError: Cannot convert "null" to int
C:\Users\Administrateur\Desktop\Neotux\node_modules\opusscript\build\opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(M
abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)```
Probably an Emscripten error
Cannot convert "null" to int
Emscripten ?
Yea
Google it
your library probably used it
Emscripten allows users to compile C to JS and/or Wasm
Your library probably used it
I donwloand this and it's good ?
So basically emscripten is giant
so chances are you can't fix the code yourself
You can try rebuilding the library from the source maybe though
um
?
@earnest phoenix what d.js version do you have
if you have v12
use node-opus
not opusscript
i have v12
yeah
Ah
he only posted the emscripten-compiled file
So I assumed it was a problem due to emscripten
install @discordjs/opus
@slate oyster It's dont probleme with emscripten ?
Just install node opus ?
The script you posted was emscripten-compiled
but @earnest phoenix is probably right
It's good !
thank's u
The preferred opus engine is @discordjs/opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose @discordjs/opus.
@lethal mauve is no good
(on the docs i linked)
It would be nice if Emscripten gave more detailed errors lol
also @earnest phoenix if you use the d.js library you should join their discord
they also offer support there
@earnest phoenix Have you ever used emscripten
Nah
Anyways
I assume you figured out the lib he used by the filename
Becuase the actual file contents were generic emscripten generated code
nah lol, i just looked for similar errors in the d.js disc and found the solution
oh ok
You should try Emscripten
You can port C libraries to JS and Wasm
I forked a library that compiled Lua to asm.js and modified it to support newer emscripten features like compiling to wasm
So I have sent a web request to a website I made, which is a JSON including information like "title" and "author" of a tweet
How do I detect that and show it on the website?
I make a web request using IFTTT and send it to my website https://somthingidontwanttosay.com
How do I get https://somthingidontwanttosay.com/ to detect it and run JS with it?
on frontend?
Yeah
ideally you would want to have an endpoint in your backend which receives the IFTTT request, then you'd have a websocket server in the backend your front users can connect to when they load the website, you can use that to forward the request from IFTTT to your clients on frontend
How would I do that at all?
you want to receive those in real time without reloading the page?
then you don't want detection
It needs the most recent which should be stored
then you send them to page in your website
for example
http://mywebsite.com/receive
then in your server side code, you should handle the data you receive, and save it somewhere, like a database
then when a user opens mywebsite.com the page should open the data that was saved before, and send it
The bit I really need is the recieving and storing
Has anyone worked with Instagram API?
Like idk how to receive a request
It's hosted on glitch so I think so
do you have require("express.js")?
then you have stuff like app.on("/", (req,res) => { code here })?
app.get("/"...
@quartz kindle no but I can add it
then what do you have?
@quartz kindle when i think this is better to use app.get
how does your website work?
yeah i said "stuff like", i dont use express so idk the exact syntax
Oh okay



what