#development
1 messages ยท Page 1462 of 1
Unhandled rejection TypeError: fn.bind is not a function
change what
is thatnot v12
message.guild.roles.cache.find
I started using series in math and im so confused, they start at 1 not 0
it might be because of the find function
it doesn't take variables themselves
you pass a predicate function
<guild>.roles.cache.find(role => role.name === '<role name>')
.find(role => role.name === 'Verified')
Random question, if I want to count the total messages send, what is the best way to keep track of that?
Just an int in a database, adding 1 when a message is recieved
yea what you just said might be a solution
Oh wait, maybe have a local variable, and once a minute push that to the DB
Less load for the DB
hi
That's already v12
what do you want to do?
rbx.getRankInGroup(groupid,body.robloxId).then(data => {
let RankForGroup = message.guild.roles.cache.find("name",data);
message.member.roles.add(RankForGroup).catch(function(err){
message.channel.send(`Error: I was not able to update your discord role.`)
});```
i get fn.bind is not a function from here
yea
yeah
but to understand that
you have to know higher order functions
Hi where can I find great canvas tutorials ?
why this throw null pointer
.setImage(event.getChannel().getHistory().getMessageById(event.getMessageId()).getEmbeds().get(0).getImage().getUrl())
(yes, the embed im getting 100% has a image)
also idk how to use a debuger
๐คทโโ๏ธ
"throws a null pointer"? What eaxctly is the error?
is this java?
[JDA MainWS-ReadThread] ERROR JDA - One of the EventListeners had an uncaught exception
java.lang.NullPointerException
yep its java
yep
from the ugly api yes
why so many functions lmfao
conditional chaining in java #when
I would presume that one of those things doesn't exist. Either the message ID no longer exists, or there's no embed on that message, or no image.
c# more like microsoft java
you're not wrong there
never even seen c# code tbh
The message exists and it 100% has a embed image (it should)
can it run on linux?
should, yes. but are you 100% sure? Can you check instead of assuming? Probably the best thing to do.
Trying to help someone while there's completely irrelevant discussions going on ๐
lmao
replies exist just for that reason
javascript is better than both
LOL
no lol
dont start a war pls
this is the best thing ive ever heard in my life
i probably need to explain whats happening
anyway might take a look a the c# hello world now
node is super good for creating applets that just need to be there and do something
if you want performance say bye to node
You can, just keep in mind I don't know Java so I can't give you a code solution, just general ideas of things to try
everything is fair in love and war
love is war
they're nothing alike
is completely different from javascript
this is what im dealing with.
https://gyazo.com/c8339bcfaccd80d6bf946863038f0d69
i want to make a report system for art that people can post.
it should have a image unless something horrible happens and it should have an id
they just named it javascript because java was popular at the time lmao
"I don't know Java" was meant as "I don't write it" not that I don't know how it differs from javascript.
and wanted to get on the train
why do people care about super precise performance for super smol apps
the relation between java and javascript is equivalent to that of a car and a carpet
o
yea
And clearly javascript and java are very similar, since that code looks 100% like javascript ๐
bruh what?
sarcasm
oh lmao
javascript more like salted ecmascript more like better java more like basically C
embed.setImage(event.getChannel().getHistory().getMessageById(event.getMessageId()).getEmbeds().get(0).getImage().getUrl())
looks like JS to me ๐

java is notorious for having utterly disgusting getters and setters
so any help? .-.
I remember when used to tell my friend that java was always better than js
now i just use them for different stuff
pure correct js
meh, to me java is obsolete
If that's your source message then it definitely looks like it would work. But, again, what you're doing is assuming that everything is correct and not even looking whether it's correct. You can't tell me Java doesn't have some mechanisms to print or log things, as well as conditions you can add to check if the image is there, if the message exists, etc?
Trying to do everything in a single line can be very bad in cases like these.
y
java == bad //true
javascript == bad //true
ecmascript == bad //true
python == bad //true
literally any esoteric language == bad //false
im not assuming the embed has a image and if it doesnt it gets deleted from the channel
Yes you can
yeah i do
But it seems like your code disagrees with that statement.
ok
but you gotta install some stuff
python walks in
I see brackeys use c# in visual studio for his unity tutorials
so why does it say no to me?
oh no visual studio
the embed has a image as shown in the screenie
Again, print/log/output the things before that line, and make sure.
unless your pc can run pretty fast
this is called "debugging" when you don't know how to use an actual debugger
<personal-opinion>
please don't even get me started on python
</personal-opinion>
log everything
the reason people used java back in the day is because it was one of a few that was cross platform
nowadays that's not true anymore, .net ate java up for breakfast
.net5 is more performant than java ever will be, you get crossplat support without having to install a runtime, or anything for that matter
visual studio takes like 30 seconds to open on my 2700x so im good
cool then
The snake will start on you if you don't start
Why
It takes me 100 minutes HAIL REPL
yeah i don't trust you
Ok :(
Have you tried any other language?
hmm
In other languages you may get x10 or x100 the performance than you do with JS
Anything that uses chromium is bound to squeeze the juice out of my computer
For web development yes
But otherwise no
i only used c# for unity so idk
and that's on normal conditions
Only JavaScript
.net difficult
If you want to run it directly outside of other stuff like Unity then use an extension called code runner
what
no
you use the official sdk lol
Hey, anyone know of a weather API that displays snowfall totals on the ground?
create a c# project and dotnet run it to debug it
This threw a null pointer too...
System.out.println(event.getChannel().getHistory().getMessageById(event.getMessageId()).getEmbeds().isEmpty());
well because something there is null
Scorpion like I told you
microsoft has a good intro if you want to check it out
you have to check for variables that might be null
You need to debug and see which method is returning null
so print the getMessageId, then print event.getChannel().getHistory().getMessageById(event.getMessageId()), etc etc etc
@earnest phoenix no
Me cry
or split each method call on a separate line so the stacktrace says which line it came from
Tag me with response
HTML and CSS, basically.
. _.
wait thats an actually pretty effective method i should use for my shit
k thanks
wait yes
yes you should
If you don't know how to use html and css, it's time to learn ๐
I POGEYRAM IN HTML
the day html and css ceases to exist will be my peak
so never
please
css gives me mental breakdowns
:(
loggers

says loggers
sends a pogey
yes
this threw a nullpointer first
System.out.println(event.getChannel().getHistory().getMessageById(event.getMessageId()).getContentRaw())
getting the message by id
hm
wait
how do i even get the message by reaction event?
why are you getting the message again?
so i could get the image in the embed
like doesnt the event give you the message
why.do.I.exist()
myself.kill()
commit Kill = event.getJDA().getSelfUser();
System.exit(-1)
die()
SHINEEEE()
I DON'T WANT A LOT FOR CHRISTMAS
AAAA
isn't there a java equivalent of fetch?
hm?
hmm
i can
but i dont think thats the problem
i did java event.getChannel().getHistory().getMessageById(event.getMessageId);
might try asking in jda's support server since most of us here are discord.js peeps
i think that gets it
Hey, where can i see the dc.js html text codes? or idk xd
Like: res.write('')
they don't have a support server?
wdym text codes?

res.write('something')
whatever, ill ask the question and stack overflow and wait for an answer..
i don't know what is it xdd.
good luck lmfao
make sure it doesnt get marked as duplicate
im tryin to execute a func when user has voted on topgg
can someone help me with this
SO best friend
@mellow kelp this..
use webhooks
oh and im using the python api
no one:
dis human: lol idfk what this is but i want halp
yea but thats not discord.js
node.js
so i gvie the auth,url and port ryt?
:/
ye i have the link
poggers
but what port shud i give?
is that express
maybe
wdym
one sec
k
@mellow kelp ye so its a domain
oh cool
then ig you can just put the domain itself
with the path to the endpoint yk
alr so i dont need to provide port ryt
from discord.ext import commands
import dbl
class TopGG(commands.Cog):
"""
This example uses dblpy's autopost feature to post guild count to top.gg every 30 minutes.
"""
def __init__(self, bot):
self.bot = bot
self.token = 'eE' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True,webhook_path = "http://..../dbl",wehook_auth = "") # Autopost will post your guild count every 30 minutes
@commands.Cog.listener()
async def on_guild_post(self):
print("Server count posted successfully to topgg")
@commands.Cog.listener()
async def on_dbl_test(self,data):
print(data)
def setup(bot):
bot.add_cog(TopGG(bot))```
alr so this is the code and its not printin anythin in console when i clck on the test button
http:///?
NEW PROTOCOL
BOTTOM TEXT
ye i removed the credentials
yea boii
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA 
BOTTOM TEXT
webhook_path is a route you will use, not a URL
HTTP:///
HOW
BOTTOM UNDER THE BOTTOM TEXT
To be specific, out of http://someip:someport/dblwebhook specified webhook path as /dblwebhook
When you host stuff on repl, the subdomain <repl name>.<user name>.repl.co is registered on the repl IP right
So my repl IP is visible for repl hosting right?
its still not printing anythin
Did you connect it to your printer?
im pretty sure it is

....ha....ha
from discord.ext import commands
import dbl
class TopGG(commands.Cog):
"""
This example uses dblpy's autopost feature to post guild count to top.gg every 30 minutes.
"""
def __init__(self, bot):
self.bot = bot
self.token = 'ey' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True,webhook_port=34473,webhook_path = "/dbl",wehook_auth = "") # Autopost will post your guild count every 30 minutes
@commands.Cog.listener()
async def on_guild_post(self):
print("Server count posted successfully to topgg")
@commands.Cog.listener()
async def on_dbl_test(self,data):
print(data)
def setup(bot):
bot.add_cog(TopGG(bot))```
whats wrong here
someone needs to make a speedrun for opening visual studio
how would that work
idk
I default my vsc terminal to wsl so when I type code . it opens in wsl mode
hi
anyone here know ts?
hey
type node = {
name: string,
id: string,
url: string,
token: string
}```
what is the difference?
interface Node {
name: string;
id: string;
url: string;
token: string;
}
I don't remember exactly
But i think it was something about errors
wait
If I'm writing for options do I use a type or an interface @mellow kelp
interface
Array<Node>
or
Node[]```?
ok ima do that
k
TS is fun
im working on a wrapper for something I made
poggers
agreed
Wanna make a pull request
You know what
mycord
pr on what repo?
ourcord
ok
Sillype
was my pr merged?
I think so
not a fan of darkreader and gh dark is too blue
I wish they would just use amoled
@mellow kelp if im returning an object with properties from a function, should I use a type or an interface?
interface
i just use types for stuff like
type Category = 'fun' | 'info' | 'images' | 'currency';
Does TypeScript not have enums?
I thought it did
yoo
I commented my code pog
no need to reread this code to understand it
hmmm
Doc string generators 
deno? I don't know her
lmao
20 minutes before class and im barely done with 2 functions
It's node.js, but it has permissions, and require is completely replaced with import/export
yeah
but i don't really like the fact that it isn't compatible with stuff like express
and it has ts by default
and we gotta use urls for everything
but yeah its cool that you can run ts and its secure
'node'.split('').sort().join('')
'deno'

how can i make my bot
log something
in a db
or json file
?
what's the function
ya
are they like rust enums where each variant can hold different parameters or Java enums where they all hold the same number of parameters with the same value types
well you can use an sql or mongodb database for example
wdym log?
what do u mean 
megadb
what is megadb
use jason.db
don't suggest that to beginners
anyone know how to make a ping command in cogs in python
import discord
from discord.ext import commands
class Ping(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print("This cog is online (Ping)")
@commands.command()
async def ping(self, ctx):
await ctx.send(f'Pong! {round(client.latency * 1000)}ms ๐')
def setup(client):
client.add_cog(Ping(client))
i did that code
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'client' is not defined
^ said that
@mellow kelp I need help with ts
im using node-fetch
and I told the function I was going to return FileResponse
but I actually returned response.json()
what do I do
wat
Use self.client to get the client instance from your initializer
ohhh ok
wdym "you told the function"
?
How can I know which shard the server is in? (discord.js)
interface FileResponse {
success: boolean,
message?: string,
fix?: string,
id?: number;
}```
no
oh k
so
what do you want to do exactly?
like, parse the json and just return it?
hi?
let node: Node = this.getNode(nodeID)
if(!node) throw TypeError('Expected "Node" got "undefined"')
let formData = new FormData()
formData.append('file', data)
let response = await fetch(node.url + 'save', {
method: 'post',
headers: {
token: node.token,
},
body: formData,
});
let jsonResponse: FileResponse = await response.json()
if(callback) return callback(null, jsonResponse);
return jsonResponse;``` ill just paste code tbh
They point one value to another
i think that should work just fine
at least if the response returns what you have in the interface, yes
It returns an empty object
whats the type of the callback?
Make an interface or class for it to return
@pure lion did voltrex give you the feedback i sent?
well
you probably can just do const jsonResponse = await response.json()
That gives it an any type
and you can call the callback with that
so I should return any?
well you could do some basic type-checking
any
just to be sure it works

Read and noted
lmao Erwin I really don't know what to do
send that to the other contributors too
Ok hold on
i mean, you should use any if you're REALLY sure the response will always work
you SHOULDNT use any AT ALL
y
well yea
any is saying: fuck this, just run this shit like js
hmm
whats the point of Ts without types?
bruh thats only if you use it like
im confused on what im supposed to do
80% of the code
not even, make an interface
you can make a type guard
unless you dealing with a shit API, you dont have a need for any
how did those work again?
theres are very rare use cases for any in your code
(type guards)
imagine the following
How can I prevent my bot from posting a file when an embed is edited?
Code I use to embed it from URL
req = requests.get("image_url_here")
embed = discord.Embed()
bio = BytesIO(req)
bio.seek(0)
embed.set_image(url=f"attachment://memes.gif")
send_file = discord.File(bio, filename="memes.gif")
await msg.send(embed=embed, file=send_file)
# Then later edit it to change something like embed colour
await msg.edit(embed=embed)
I'm guessing it might be the file kwargs but no clue how to send a file to image otherwise.
End results: https://i.alexflipnote.dev/35efjqi.png
Library: discord.py
Erwin im a bit confused on how I can return a node-fetch response as any other type other than any
an API that returns current stats for every country on the world, with a key and the keys inside are states
{
brazil: {all cities here},
germany: {all cities here},
US: {all cities here}
}
If its something insane like that with a response that might come with 200+ different keys that are optional each, sure, might as well use any
otherwise? dont
any can be used in VERY special places
dont use laziness as an excuse to use ANY in your code

bonk
I would rather send FileResponse because its easier to work with typings
yeah
but im really confused
idk why the callback doesn't work tho
ill just remove it later
or I mean add it
//@ts-ignore
above the line
console.log() the response (as a string, before you parse)
check the shape, make interface
How hard is that?
then whats the issue?
for some reason
but how do I tell ts that the response is actually a FileResponse and not just a {}
FileResponse isn't compatible with a parameter of type FileResponse
wdym how you tell the response
you can ceck 'some-key' in jsonResponse
() : Promise<returnedType(string)>
but apart from that ts doesn't have ways of validating whole interfaces
before you parse it, its a string you donkus
you do parse() to turn the string into an object
THEN that object is type of FileResponse
but first its a normal Promise<FetchResponse>
ok
iirc fetch is really shit for await/async
yea
i'd recommend using a better http lib
i prefer axios
axios gang
o
wdym
i got 2 things to fuck with, dunno which i should do now
lib
mental breakdown
I would do the lib
ANGERY
axios? bruh
and the upgrades on the lib will do absolutely nothing other than improve error logging to the end-user
which arent even coming through

cuz good lib
hmmmmmmmmm
fuck it, i'll work on the bot
ok
Libe!
krista is working on ourcord
so i thought i'd let em have a look at mine for some examples
wait do you have your own custom discord lib?
not discord, no
ok
but just overall
I accidentally forked that repo im pretty sure
yea i think so
i dont plan on making a lib on discord which breaks month with break changing updates
lol
visible confusion
not compiled js files
I thought js could import from ts
ts files go to github, javascript files go to npm
im currently refactoring it
the issue is some people might wanna pull from the github repo for dev updates
o
They will transpile it themselves
o
they can just install typescript and run tsc themselves
but you have to include tsconfig.json in the github
yea
too much work, specially knowing not even half of those users will be using typescript
i think @types go in devDependencies too
its a js/ts lib, not only ts
@types are for developing with typescript
yea
what does adding a @ to the name of an npm package do
users will be forced to use ts to transpile, makes no sense to force ts onto js users
scoping
like basically
but the js is barely readable, and the point of github repos is to share readable code
but they wont need to read the js code, juts use it
do c++ libraries put the compiled code in there? No they put it in releases!
well i kinda agree on that one
just sending the ts is stupid imo. Why do you force the js user to install ts, learn tsc, and do a bunch of stuff just so they can have a dev update?
but dont be too harsh lmfao
@opal plank Don't need inspiration, we have a totally completed project manager

@mellow kelp wdym
scopes owo what's that
scoping is used to "group" packages for example
like
@babel/core, @babel/cli, @babel/preset-env, etc
or @angular/core and other @angular packages
you can also scope it to your username if there's another package with the same name as yours
Erwin its honestly funny how you're still going on about it
misly can shout at you too for those horrid commit names
wdym im still going on about it?
understood almost nothing but ok
if you dont like my feedback, tell me to fuckoff and i'll gladly will rather than spending time trying to give you guys a hand @honest perch
its like putting a package in a "folder"
yes sir
ok
for example i made a wrapper for the reddit api and someone had already taken the name
so i published it as @mellow kelp/reddit-api
hi, i need help im working on a discord porject and i was wondering, how do i dm the member who did the command (but an embed)
i mean the bot
i like feedback and i will take your original advice, but constantly shitting on it isnt advice
Erwin, do you eslint the javascript files that get generated by typescript?
point out all the things wrong in your package is shitting?
no
i do not, im finishing the refactoring rn, i'll add a lint on it afterwards
hi, i need help im working on a discord porject and i was wondering, how do i dm the member who did the command (but an embed)
you started on about it yesterday and you're still going on about it today
then i'll gladly shut up about it, sorry to give you feedback
wont do it again, sorry
can anyone help.... simple quetion......
hi, i need help im working on a discord porject and i was wondering, how do i dm the member who did the command (but an embed)
you can use message.author.send(stuff)
again constantly going on about how bad it is, isnt feedback nor is it helping anyone
does that work with an embed?
yea
if you guys need to get back at erwin: Keep repeating to not push javascript files generated by typescript
thank!
no prob ๐
You are a js user, you want to use the new updates from the github that arent updated on the npm yet, now what?
no need if its been pointed out once already (:
you force them to install typescript, use tsc, add extra tsconfig, just so they can use it?
well um
rather than sending a pre-compiled module?
in my opinion, typescript and @types should be in devDependencies, so that users may install those and compile by themselves
you install typescript and just transpile them. You can also push a release with the compiled javascript if that bothers you that much
what sense does it make to have a js user install ts?
but arent they gonna install a published package i think
@mellow kelp where ezactly do i put that
You can also push a release with the compiled javascript if that bothers you that much
this is exactly what im doing
where you wanna send the message ig
users have a send() method for DMs
-jsubuntu@ip-172-31-43-176:~/secret$ Fontconfig error: Cannot load default config f ile
Error: Error parsing info: Unable to retrieve video metadata
at getWatchPage (/home/ubuntu/secret/node_modules/ytdl-core/lib/info.js:75:1 3)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async exports.getBasicInfo (/home/ubuntu/secret/node_modules/ytdl-core/li b/info.js:84:22)
at async Map.getOrSet (/home/ubuntu/secret/node_modules/ytdl-core/lib/cache. js:24:19)
at async exports.getInfo (/home/ubuntu/secret/node_modules/ytdl-core/lib/inf o.js:226:14)
at async Map.getOrSet (/home/ubuntu/secret/node_modules/ytdl-core/lib/cache. js:24:19)
at async Object.run (/home/ubuntu/secret/commands/music/play.js:86:20)
Members, being an extension of the user class, also have this
this is my code:
client.on('message', message => {
if (message.author.send === '/Nitro') {
const embed = new MessageEmbed()
.setTitle('Nitro Successfully Generated!')
.setColor(0x0059ff)
.setDescription('Check your Dms for a Free Discord Nitro Code! (If you didnt get a dm, please check your privacy settings and try again!)')
.setThumbnail('https://images-ext-1.discordapp.net/external/4ONRTfM0eACv125fNvykyatoHcn-EzxqAMVPhDxyue8/%3Fv%3D1/https/cdn.discordapp.com/emojis/734413249864531979.gif');
message.channel.send(embed);
}
});
where should i put it
what
Oh no
@opal plank What if I am a typescript user and want to contribute to your project?
why
Fontconfig error: Cannot load default config file
Error: Error parsing info: Unable to retrieve video metadata
at getWatchPage (/home/ubuntu/secret/node_modules/ytdl-core/lib/info.js:75:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async exports.getBasicInfo (/home/ubuntu/secret/node_modules/ytdl-core/lib/info.js:84:22)
at async Map.getOrSet (/home/ubuntu/secret/node_modules/ytdl-core/lib/cache.js:24:19)
at async exports.getInfo (/home/ubuntu/secret/node_modules/ytdl-core/lib/info.js:226:14)
at async Map.getOrSet (/home/ubuntu/secret/node_modules/ytdl-core/lib/cache.js:24:19)
at async Object.run (/home/ubuntu/secret/commands/music/play.js:86:20)```
error please help
then you already have the src folder included for the src files
EVEN AS A JOKE
client.on('message', message => {
if (message.content === '/Nitro') {
const embed = new MessageEmbed()
.setTitle('Nitro Successfully Generated!')
.setColor(0x0059ff)
.setDescription('Check your Dms for a Free Discord Nitro Code! (If you didnt get a dm, please check your privacy settings and try again!)')
.setThumbnail('https://images-ext-1.discordapp.net/external/4ONRTfM0eACv125fNvykyatoHcn-EzxqAMVPhDxyue8/%3Fv%3D1/https/cdn.discordapp.com/emojis/734413249864531979.gif');
message.channel.send(embed);
}
});
Kill your friend, it's free and healthy!
_ _
you know whats funny, when discord will make messages an intent and people will come crawling here for help with sending messages
where do i put the
In the bin @lost isle
Change channel to author
Flaz stfu
Learn javascript and PLEASE DONT MAKE ANY NITRO SHIT
No learn TS, it's betterer !
yo wtf i'm just trying to help
let him be
you all are mean
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
It's still against tos
its not even a real generator
like 10$
LOL
chill
@opal plank Alright, so... if I want to contribute to your project, I would have to write my code in javascript - and you write the code in typescript and then transpile it to javascript? How does collaborating work
Man thinks breaking ToS for a friend is good
That's like saying "I made a knife for my friend who's going to kill someone, I know they're going to kill someone and they're paying me for that"
no are you ok?
He's saying that based off of what Erwin said
you code in ts then push the transpiled code to gh so people who are using js can actually use the dev branch
That's what I'm telling Erwin, no actually the oppsosite
no, you would write in ts. the /src is where the source is at, in ts.
the /dist is where the transpiled files are at, which are just to be used bu the end user
TS = TS
Js = Js
but all you have to do it fucking tsc
@pure lion turns out i still have node v12 installed
Yes
time to install v15
Issue being?
how do i type tsc
idk
literally standardised code with /dist /src
fuck
But the typescript code is not in the repo. How will I get the ts files?
it is
last question, How do i make a changing status (my bot)
@pure lion
last question, How do i make a changing status (my bot)
do you know how?
its for my bot
or anyone
client.user.setActivity i think
but im on pc
wait lol
how do i do that
Go away
can you send code
You're a big boy/girl
idk what this is
Hey I'm using chattriggers (it's to make mods for minecraft using js) and I want to make it so that when people talk in a discord chat the user using the mod will execute a command + that text. Now I don't know how to approach this as I don't know if webhooks can post to the chattrigger mod when someone sends a message
yea i found it
Well, the mod must somehow communicate with your bot
it doesnt it communicates wit ha webhook
the bot is hosted on a separate machine, right? It doesn't come with the mod
I already made it so it looks for chat messages and then posts it in the discord channel
my code actually worked fucking poggers
but like, is the bot itself built into the mod, or?
aaaah
It's a mod that picks up messages and then posts to the webhook
Now, I need to reverse it and make it do the same but then from discord chat to minecraft chat
And I have no clue how
I've seen someone do it
So ur saying I'm gonna need like a proxy and a discord bot to communicate between the mod and bot?
I'm looking at the docs right now and I'm not seeing anything about reading messages https://discord.com/developers/docs/resources/webhook
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Well originally I thought that that's what you're doing
hm... I don't think you need a proxy, but maybe a TCP connection with the mod
For example, the bot exposes a TCP server, and your mod makes a connection to that server, and now the bot and the mod can communicate
the bot can send messages to the mod, and vice versa
But that also makes the development a lot more complex
I'm not sure what the right thing would be if you want to keep it simple
mmmh
seems cool
Now
1 issue tho
The mod is not nodejs
its just js
I think
let me check
But
it's possible that it's a different runtime chill
should i wait a set amount of seconds after the ready event is fired before performing actions?
yeah, I guess, depends on the runtime
probably not
The mod is going to act as a client though, not a server
The mod is just going to connect to the server
I really don't think you should start such a complex project if you've never worked with networking before
Maybe try a smaller project first, like a simple TCP server and client?
yeah I'll look into that
There are other alternatives to TCP such as websockets or an HTTP server - those are also options, and are also easier than TCP
But also a bit slower
hello misly
if you think https://ourcord.github.io/ourcord/modules/_handlers_message_.html doesnt return 404 you are wrong
it does
idoyt
i have a github pages site for docs, and i have an index.html for each route. how can i get individual files to load? it throws a 404
its generally <user>.id
so i can add to my bot for my friend his ip
right click their name and copy ID on bottom
thx you guys are awesome
np
by the way
the by way
developer mode first if you didn't do it
@pure lion
science
go ahead
i havent used that
i mean maybe dont use tools that havent been updated in 2 years
ah that must be why
so which should I use tho
idk
from game activity?
yeah I'm making my own status but it didn't work with the current EasyRP thing thing
there are docs
give me an idea of something I could build
doing that
makes pat gifs
anything besides a bot
ah yea i said id try making a lib
lemme make a discord one
I'm trying to learn MERN Stack but i don't know where to start lol
well you should probably know node.js first
yeah I do know that, i don't know the other 3 ๐ญ
message.channel.send('HACKING... BEEEP BEEP.')
for(x = 0; x < 100; x++){
setTimeout(() => {
message.edit(x)
}, 250)
}``` how do i edit the message that the bot sent?
edit the message the bot sent
I know how to make the embed edit
can you show me?
let me try lol, I'm also really bad at coding
what? no?
ohh wait edit the bot message you mean?
yeah
bot.on("message", async message => {
const embed = new DiscordEmbed().setColor(0xe91e63).setDescription('text');
const embed1 = new DiscordEmbed().setColor(0xe91e63).setTitle('TEST');
let msg = await message.channel.send(embed)
message.edit(embed1)
});```
this is how I can think of of it, you can try the await message if you like any custom message that the bot will edit and then edit it back
lol i'm sorry I'm so bad lol
Okay
do msg.edit not message.edit
msg is your message message is the user's message
@distant cobalt
okay
yea id just take postgres anyday 
ive heard when it becomes too big it just starts breaking
what would I say for an error when a constructor doesn't have a required param?
it doest
properly indexed tables wont break even with the stupid amount of stress i put into it
there would be no point in a database if that was true
175 billion scans in 4h
if that didnt break it, nothing will
it DOES however get impacted, if you get to rates at 40k+ queries per minute, then cassandra/elasticsearch are faster
though no, postgres wont break at higher scales, that test was me pulling around 98% of twitch's global traffic onto my server to stress test my library

tbh sometimes i be stress testing my bot
then it takes an absurd amount of time to fetch from the db just to realize my internet is shit
stress testing is good
let newEntry = {
itemname: itemnamex,
itemprice: itempricex,
itemid: itemidx
};
let newDB = new itemDB(newEntry);
await newDB.save();
```
scaling is important



