#development
1 messages · Page 1509 of 1
hold up
@solemn leaf console.log(n.assets);
ok cool thx
RichPresenceAssets {
largeText: 'Akiisqt (rank #1,922,131)',
smallText: 'osu!',
largeImage: '373344233077211136',
smallImage: '373370493127884800'
}
@solemn leaf console.log(n.assets.largeText);
lmao
okay got it
let n = message.member.presence.activities.find(x => x.applicationID === "367827983903490050"), h = n.assets.largeText; console.log(h.split(" ")[0]);
.match
replace split with match and put that regex there
wow i just started to read into Rust and i like it already, so much nicer language than js
wrong channel i guess
right
can a bot in 2 different languages be sharded?
so you want to use a Multi Language system on a sharded bot?
well no?
or a bot written in 2 different Programing Languages?
im using a JS eval command and a py bot
bruh
idk if its possible but i guess it could
ok
or a node process inside a python process
ew
@earnest phoenix Help me a little
first time ive heard of something like that
its quite common that you use 2 different languages to build applications
And it responded properly
only time ive seen that happen is (HTML CSS JS) for frontend and (Nodejs and Bash) for backend
its possible that an Website you use frequently uses a Backend that uses GO and JS
a lot of proper quality applications are built with 3+ languages
what do channel perms look like
@neat harness betterdiscord detected
you might want to check the bot's perms for a channel before sending in it
/home/kayuimineko/NekoNeko/node_modules/discord.js/src/rest/RequestHandler.js:154
throw new DiscordAPIError(request.path, data, request.method, res.status);
^
DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/kayuimineko/NekoNeko/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async RequestHandler.push (/home/kayuimineko/NekoNeko/node_modules/discord.js/src/rest/RequestHandler.js:39:14) {
method: 'post',
path: '/channels/797092671944392735/messages',
code: 50013,
httpStatus: 403
}
[nodemon] app crashed - waiting for file changes before starting...
This turns out
maybe that could help
yeah so it doesnt have perms to send in that channel
That's what pops out when it does
When it doesn't this pops out
take use of discord's view as role feature and view your guild as your bot's roles and truly verify if you set the correct permissions
This one
Damn ur a genius
I just do this:
bot.on("message", async (message) => {
if (!message.guild.me.hasPermission("SEND_MESSAGES")) return;
});
I'm too old with discord to realize such a feature
sorry if im being stupid here, but can't you just look at permissions for the bot user in the channel?
yeah
Hm I want to warn them that I don't have the send message perms
Yes that's exactly it
You can
just dm them and make it an opt in feature
otherwise return
Lik this
You need to send a message to warn them that you dont have send message perms
^^
Send DM
my bot has a dm feature which you can opt in/out
It clearly says THAT CHANNEL not the current one
I simply return if the dm doesn't reach them
ik
so implement something that checks if the user wants dms, if so then dm then
otherwise, just return
i dont know if its against the rules to always dm for no perms
message.author.send(...).catch(err)
It's fine
Why do you want to remind people that your bot doesnt have perms to send messages when they dont want your bot to send messages
As long as it's within the person using the command
Not some random text then saying the bot doesn't have perms
well users that dont know its not to be used in that channel will be informed
That's the point I only do so when they run an existing command not just some random text
its just a peace of mind feature
that channel not the current one
async fetchMessages(num) {
const req = await this.#shard.client.api().channels[this.id][`messages?limit=${parseInt(num)}`].get()
if(req.code) throw new Error(req.message);
return req;
}
async bulkDelete(num) {
const messages = this.fetchMessages(num).map(msg => msg.id);
const req = await this.#shard.client.api().channels[this.id].messages['bulk-delete'].post({
body: { messages: messages }
})
if(req.code) throw new Error(req.message);
return req;
}``` this is how I would fetch and delete messages right?
@crimson vapor what the fuck is this shit
im not sure about the .channels[this.id] part
this.#shard.client.api().x.y.z is essentially fetch('x/y/z')
how are you able to put $ or # as part of the property name
so then you'd want it to be #shard.client.api().(this.id), no?
makes it private or something
or am i misunderstanding
nah its a class
what exactly does private mean
does anyone know how to make a confess order?
like
ah wait
whats the fetch retrieving from?
and you cant make references to it in other objects I presume
nope
well fuck
why?
it means other classes can't refernce it iirc
does anyone know how i can evaluate python code on node? I cant find any safe packages so i was wondering if there was an api
lmao rip
I have 2 roles colliding
ytho
@ everyone has the perms revoked
so then your fault 
While the @ Bots has it granted
i want to be able to eval a lot of languages
But it works fine for users
Discord shouldn't make that
yeah i was just joking
roles can get kinda confusing, but i dont think discord is at fault
So it detects that it has the role
ytho
I mean perms
they have a robust role system, its just hard to grasp
i just told you why
It has perms, then when it tries to send
I dont see the point of using more than one language for the backend
^^
I tried using the view as role
but you do you
I can
interesting
But then discord doesn't let my bot do it through the api
code im not using more than one language i just want to eval stuff and get the result
How dumb is that...
with an http server
like a math cmd?
or just eval in general
you can get some pretty good math modules
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
on npm
its not maths
ok i asked earlier
so what are you looking to do with eval
im not questioning you, just seeing if it could be solved otherwise
with a different method
ppl i got this error how to get rid of it??
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In content: Must be 2000 or fewer in length
message too long
have you tried reading the error
yea
what does the last sentence say?
is there any work around
split your string into chunks every 2000 chars
how do i take something long, and make it shorter 🤔
if its an embed then just make the fields shorter
np, just try looking at the error you get and making sense of what you can
thx guys
sometimes errors can be quite cryptic
but what little you can get is sometimes more than enough
hmmm
anyone know anything about getting a color from args and converting into a hex?
discord.js
hey guys so umm can i pass a function to my jobs in node resque and then execute that function in the job?
more like dynamically create the name of the func in the jobs
and then exec it
!help
@umbral zealot if you're still here
how so?
as in the user gives a color name?
that would be a little hard because you'd need a bit dataset of color names
like changing the role color
idk i thought someone wouldve made an api for it or smth
ok
let me check npm
maybe theres a module
maybe color? https://www.npmjs.com/package/color
a potential option
says it has hex and string constructors
https://www.npmjs.com/package/color-convert this might be better no?
you know how to edit the metadata length ?
lel
so either one
well
your choice
thanks
np
?
the role metadata or you talking about smth else
I want to edit the hex data for the tag for length on a file
tag for length?
yes
its complex
ok
so
ina-
i'm not entirely sure thats possible
it is

yeah
I know how to do it
just not how to translate it
like
what
maybe I can inspect it?
idk
a little?
yeah, just a little bit
ill look at it again, maybe i can figure something out
well here is the chase I got
mvhd is circled in red, time scale in black, and duration is highlighted.
ok
6D 76 68 64 00 74 35 B3 B2 63 B4 00 E0 2A 53 E6 80 C4 FF FB E4 44 ED 0E E7 3C 3D CC 03 DD D8 EB 67 A9 70 77 DB 50 5C BC F5 32 6F 77 61 43 A8 9E E6 09 DE 65 B2 88 6A B9 DE 17 28 4C 51 42 8C 29
gl
so here's the thing, i've been able to replicate the effect before, but not manually
i only recently started looking into how i could do this through modification of the hex code
so i'll see what my method does that im missing
So that FF FF FF FF is the duration metadata of the audio?
@solemn leaf, here's what i find most interesting...
you can actually see the borders between the two files
its either the one before it or ff
also its in seconds
the video is 251 seconds long
so you can see the oggs header at the start
the first file
but later on, you see another oggs at the end of the first file
then FFFFFF cannot be the duration cause FFFFFF is 16777215
im trying to figure out how they got it to stop
oggs is how an ogg file starts
so theres something up here
wait a minute
well
for the ogg im pretty sure its vendor string length (32 bit unsigned quantity specifying number of octets)
@cinder patio so what is 00 00 03 E8
exactly 1000
The length value is stored in Samples, so you can convert that to hex and search for the value. It should be just a few bytes behind the "OggS" string.
String OggS is 4F 67 67 53 in base-16
yes
hi
hex to dec
i'm gonna try something and it may or may not work
there can be multiple metadata containers
they?
@pale vessel my buffer stuff isn't working
import * as f from "file-type"
import * as fs from "fs"
class PetalsFile {
baseString: string
buffer: Buffer
constructor(path: string | Buffer) {
console.log(path)
if (Buffer.isBuffer(path)) {
this.buffer = path
this.baseString = path.toString("base64")
}
else {
this.baseString = fs.readFileSync(path, { encoding: "base64" })
this.buffer = Buffer.from(this.baseString)
}
}
async stringify() {
const b = await f.fromBuffer(this.buffer)
console.log(b)
return `data:${b.mime};base64,${this.baseString}`
}
}
export default PetalsFile
any filepath or buffer that comes through
you need to use Buffer.from() to use toString("base64")
but path would be provided by the user
@cinder patio
top is a normal ogg file
its 4mins and 14secs long
@trim saddle what is the path
it's a buffer
i think i need a new module to find the mimetype
everything else seems to work just fine
what is rn'
rn?
nice, which bytes did you delete?
that would be a very large number Aki, the duration of the file would most likely be 4-8 bytes
ah lmao
Are sure it's in the selected bytes in the screenshot
yah fixing it
bcs you cant copy and paste here
@cinder patio according to the site yes
wait no
@cinder patio
its more
wait nvm
so
this is for the already broke .ogg
nice
I found a reddit page on it
47 votes and 13 comments so far on Reddit
intersting
dont mind the top
read the bottom
it defines the stuff you need to know about the headers
lmao i just realized something
if you pause the second file it glitches out when you resume it
for me at least
oh never mind
@trim saddle what you using rn
kk
file-type
you only using it for that?
yeah
doesn't look like i can retrieve with this
Aki... your goal is to change the duration metadata of an ogg file right
hi
pov: you've never felt the touch of a woman
hi
what did i do then
Well, looking at the ogg header, it doesn't look like you can get the duration from it, so it won't be that simple
i need help retrieving a mimetype from a buffer
im not that smart
i can't retrieve with that
what are you needing to retreive?
you've lost brain privileges
now back to your room^
sad face
well then
@solemn leaf https://stackoverflow.com/questions/20794204/how-to-determine-length-of-ogg-file see this
review this and tell me if i'm doing something wrong
the path isn't a Buffer instance?
yes
why
it should always be
skull look at https://github.com/mscdex/mmmagic
Skull, what files are you trying the code against
no but like with what buffer are you testing if it works or not
buffer from what type of file
uhh
text file? png? svg?
const testFile = fs.readFileSync("./tsconfig.json", { encoding: "base64" })
// ...
await msg.channel.send({file: new PetalsFile(Buffer.from(testFile, "base64"))})
my tsconfig
I think they want to do all
I'm pretty sure file-type cannot recognize json files
how
it can only recognize binary-based formats, aka files which store buffer (think png)
json stores plain text
uh i can get one for testing
how would i make like a div or something, that stays in my bottom right of my screen
that would like be fixed, so if i scroll up, it would too
and it doesnt like interact with the other elements?
position: static iirc
*fixed
static?
i think so
fixed just made the entire thing disapear lmfao
Like
file-type works by looking at the buffer's magic numbers (https://en.wikipedia.org/wiki/List_of_file_signatures) and you are just turning the json's file contents to a buffer, because JSON stores plain-text, not buffer like png files or audo files
top 100%?
left: 0
right 0?
That makes it go to the left
hm,
so, you cannot use file-type to get the type of the buffer for some file types. I'm not sure what you're doing, but if the user has to choose a file, simply read the file's extension to figure out the right mime-type
now discord thinks i'm sending an empty message
so like, its not constant
width: 95%
like its however long the chars are
try auto
how can this return undefined
I'm seeing it more that the bot returns on normally working things, undefined.
message.channel?
should i try that?
can you eval message.guild?
yes
like auto makes it the entire pagee
are you using regular discord.js?
Yea
i wanna make it like padding, but not the entire page
which version?
just however big the chars are
did you ever do guild.fetch?
No
do you have any code that uses invites?
No
Hmmm... Where do you see 400k? Because I never said that.
Looks empty to me
i've seen that happen in discord.js-light, and it was a bug with server invites, but i've never seen that happen in discord.js, no idea what it could be
Hello all you awesome devs
joak is still alive
Always
discord thinks i'm sending empty messages when i try to send a data uri file
data uri is not a buffer resolvable
what does that mean?
so i should send a buffer to discord is what you're saying.
Buffer.from(dataUrl.split(",")[1], 'base64')
A bunch of other smart people here to help you already
all they need is the base64 of the data???
yes
they get the file type from the file extension, so if you name it whatever.png it whould work
No time is wasted, it's all just a means to an end
base64 is just a different way to represent an image buffer
so i assume they actually need the data uri if i'm sending image data in edit payloads
you cant send image data in edits
guild icon?
user pfp?
@quartz kindle so a little snag
discord also thinks the data string is empty
files:[{attachment:Buffer.from(data), name:"whatever.png"}]
oh ok
The guild was uncached probably, I added message.guild.fetch() and all issues were fixed.
It now does not returns undefined, but the server name
your friend said you had 400k servers
@whole condor #development message
past that point
hello i would like to get a rank, how do i get in?
get your bot approved
how?
how do i enable these? my bot has already been verified
your bot hasnt been verified
well
ok
it appears to be
ok
ask in the =verificationc hannel
rabbit should be the one taking care of submissions iirc
Oops wrong link
not testers, developers
thanks for pointing me in the right direction
np
Rabbit Tank?
correct
First of all I don't know him and he just can't read properly. I wrote users and not servers.
then take it to him, he was stating you had 400k servers
which sounds really bad once we actually went and found out it wasnt anything like that
Well that's not the case, I do have 400k users but I have by no means 400k servers.
well yeah, like i said, its not me you need to talk to about it, its them
Don't worry, I've already told him and he realized himself.
all good
{files: [{attachment: "...", name: "e.png"}]}
@quartz kindle still empty
i thought only webhooks could use files
how do I make my bot say something when it joins someone’s server? like dank memes
how can i make my command like if someone used the command it waits for 3 options like "1" " "2" "3" and it waits for one of the options without a prefix?
@trim saddle
Not quite sure what you were doing | but since you were talking about gifs and avatars... My bot is a static image with keyframes to animate it like it's floating.
on member join event?
Like, if it joins a server it says something
no when his bot joins a server if im right
someone?..
Yes you are
read your docs
Can ya send?
Coder is in the names but doesn't know how to find the docs of their library
Which lib are you using?
idk what lib you're using.
LMFAO
some1?
Sounds like you need awaitMessages
@trim saddle discord.Js
i already tried some but dont really works
Well... what, are you expecting us to write it for you? The library has examples.
There’s no about guild joins @umbral zealot
u have a github repo maybe?
Nope
There totally is
If you've tried something, show us what you did and tell us what doesn't work instead of "how do I do this" from scratch?
Uh lol
no not write it just maybe u know some
@craggy pine what do I search in it?
u have the link of the docs from it maybe?
I did bruh..
thx
Also this is useful https://discordjs.guide/popular-topics/collectors.html
wow that was hard.
oh man using words is so hard.
thx
how are u doing that LMFAO
screenshots? ShareX. Great app, awesome app 😄
how do u send a link? LMFAO

jesus fuck
i know just kidding @solemn latch @umbral zealot
they don't keep a client#on anywhere
woo tech tips, control + c to copy, control + v to paste 
really wait... where is the control on my keyboard
it scares me devs dont use hotkeys
To copy it's Alt + f4 have fun.
thx man im gonna try
alt + f4 enables cheats in video games
LMFAO

yes ur right
i know what happens LOL
ngl i fell for that once
I can’t find it @trim saddle
||How do you use spoilers?||
I think we all have fell for it once in our lives.
i just sent you the event.
||really?||
||Yes||
click the link instead of playing with spoilers
wait how the heck u got nothing in ur message?
don't ask
how?
because discord is giving me a headache
lol
HOOOOOOW
STOP SPAM
can you not spam
Chill @earnest phoenix
Ok lol
Guys, stop shitposting.
Tell me how pls
This is not the place to teach you how to do spaces on your computer
bruh you're giving him more attention
@pale vessel {file: {attachment: "FATFUCKINGBASE64STRING", name: "anything.png"}}
tell me this is wrong
if you use spaces it will not send a message bruh
this is wrong
Don't care, this isn't the place for you to learn how to use Discord.
Go write your bot or something
can you repeat your original problem because at this point the children screaming and smearing crap everywhere have obscured what you needed help with
Which lib/language?
i'm making my own lib
which language then
js
Ok and the issue you're having it.... ?
so i'm sending this basically
{file: {attachment: "FATFUCKINGBASE64STRING", name: "anything.png"}}
and discord keeps saying i'm sending an empty message
You seem to be thinking that using the format Discord.js uses magically works... it doesn't.
@quartz kindle you fucked me
i still can't tell what i'm supposed to send a file as
show your code
this is my file class
import * as f from "file-type"
import * as fs from "fs"
class PetalsFile {
baseString: string
filename: string
buffer: Buffer
constructor(path: string | Buffer, filename: string) {
this.filename = filename
if (Buffer.isBuffer(path)) {
this.buffer = path
this.baseString = path.toString("base64")
}
else {
this.baseString = fs.readFileSync(path, { encoding: "base64" })
this.buffer = Buffer.from(this.baseString, "base64")
}
}
async stringify() {
const b = await f.fromBuffer(this.buffer)
return `data:${b.mime};base64,${this.baseString}`
}
get toJSON() {
return { attachment: this.baseString, name: this.filename }
}
}
export default PetalsFile
lmao
sooooo
you need to change the content-type to multipart form-data and pass payload_json or something
a bare buffer
did you read docs
man
woman
child
adult
when you asked me how to send files, I tried to follow the docs but I gave up midway
Just to give you an idea, it takes 37.4k lines of code for discord.js to work.
Keep that in perspective.
i told you since the beginning that you're supposed to send the buffer
Buffer.from(dataURI)
djs is bloated
But it's also a complete library that does all that a library is expected to do.
When I get the UNKNOWN_BAN error in the handler I want it to return so it wouldn't continue. But it only returns the thread. How can I make it return the class?
ErrorHandler handler = new ErrorHandler();
handler.handle(ErrorResponse.UNKNOWN_BAN, (error) -> {
event.getChannel().sendMessage("This user isn't banned!").queue();
return;
});
(java)
As I said. Just putting things into perspective.
cough ourcord
uncough i'm leaving
lmao
I mean discord.js devs literally keep saying they don't want to cater to noobs which is pretty funny I guess.
also im gonna ask the question
let me just phrase myself
so I want to decode a gif so that i can iterate through each frame and add a picture as an alpha layer
but the lib that im using, gif-frames, throws an error when i try to decode the frame to canvas:
not compatible right?
I bet no one uses java here right
yeah
feck
@umbral zealot alright so i got the multipart crap set up
I can guess that you'd have to put the class to return after the return keyword
how exactly am i supposed to send the file, all discord leaves in docs is file content
you have to output type it as a png or jpg
how wud i do that ;-;
ah okay
then put it in canvas
return <classname>
return me.scorpion37.scorp37.Moderation.class;?
never returned a class before >-<
@pure lion
@knotty obsidian i dont do java
oh
type it so that it can
wot
the method returns a void so you need to change the return type
ou
handler.handle probably returns a void
¯_(ツ)_/¯
no it does
if (bot.categories.owner.has(cmd) && !message.author.id === "485987127809671168") return;
How can I do soemthing like this error was
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'has' of undefined
I have no idea on how to do this it was just idea
F
?
I'm trying to make an object where the property name is a variable, but obviously if you just put the variable name it uses the variable name not the value. What is the correct way to do this?
Example of what I want:
name = "whateveriwant"
mything = {
[name]:"epic"
}
what
that's exactly how you do it 
me?
i meant @true ravine
Wait
ok
Js
can you help me with mine after
yeah thats exactly how you do it
Wow I am too smart for my own good, thank you lol
aight, np
let ownerCMDs = bot.categories.has('owner');
if (!ownerCMDs.toString().includes(cmd) && message.author.id !== "485987127809671168") return;
I want this to return if the member sending this uses a command that is in the categories, and if their id isn't mine.
all commands work but owner commands
it should be letting me us owner commands
im confused on why you are tostringing a bool and then checking if it includes cmd
Assume my code is:
let array = ['a', 'b', 'c'];
array.forEach(element => console.log(???));
```How could I log the position of `element` to the console? (I.E. it should return:
```md
"0"
"1"
"2"
```)
Anyone ?
@ownerCMDs.includes is not a function
ownerCmds = [ 'eval', 'reload' ]
@buoyant aspen
@buoyant aspen foreach has an index
so what could I return to get the index? a little confused here
aki said it "i" being index in that case, or https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#syntax
ah sorry aki I see
did you change your definition of let ownerCMDs = bot.categories.has('owner');
my bad
npnp, i did the same thing too @buoyant aspen
ownerCMDs is a boolean
!ownerCMDs.toString().includes(cmd) makes no sense on a boolean.
yes
ffs
why do you just happen to be looking here
I really don't know
the one time I use this channel
what are the chances
my point
like at runtime?
wdym
while the code is running? or editing the code so its removed?
while
assuming commands is an object, just set the property/method to undefined
walker?
npm walk
let x = 'S2'
let num = x.substring(1);
num + 1 won't work bc 1 is acting like string how to remove it from string?
assuming all references are removed for the property, garbage collection will remove it. @solemn leaf
is there a way to run a command thing from js
like process.run('rs')
soemthing like that
to refresh nodemon
execSync('cd ...', { encoding: 'utf-8' });
execSync('rs', { encoding: 'utf-8' });
@solemn leaf require("child_process").execSync
im getting the error "ReferenceError: Cannot access 'emb' before initialization" when emb (my embed) is defined ages ago
const emb = new Discord.MessageEmbed()
.setTitle(`New Suggestion`)
.setColor(random)
.setDescription(`New suggestion. Submitted by ${message.author}`)
.addField("Suggestion:", suggestion)
.setFooter(`private stuff || *${ServerIp}*`).then(messageReaction => {
messageReaction.react("👍");
messageReaction.react("🕰️");
messageReaction.react("👎")
},
suggestionWebhook.send("<@&797248229829378078>", {
username: `SMP bot`,
avatarURL:
"https://cdn.discordapp.com/attachments/542043910818627584/797234326269984768/unknown.png",
embeds: [emb],```
i am not really sure whats going on here, the formatting ah
but it looks like your using emb in the definition of emb
specifically inside the set footer.
actually, why are you using then on an embed
Not sure, I wasn't sure how to react on a embed and guessed
Also what? that is confusing
programming isnt the place to guess stuff
dont think you can react to a webhook either, you can react to a message sent by a webhook iirc.
same as any other message.
yeah, on the send
after the closing parenthesis of the send
it doesn't work
Does somebody know how i can create a command which shows on how many servers my bot is?
ye
And may write this code into the chat?
Ok thank you
fite me!
bet
join vc rn fite me
i'm too sleepy
hi too sleepy im million
and i still need help with my issue
what did i tell you
that exactly
i saw a webhook example somewhere
oh good idea
sharex repo has one as well
this didn't help me as much because
so payload_json is basically body for normal message
yes
pog
if you were including a file
yep
do we just include the base64 of the file?
fuck my hands are cold
typing is slow
wait
form-data
lemme try something rq
idk
yeah i'm about to test something new
@crimson vapor well i looked at how d.py does it
def send_files(self, channel_id, *, files, content=None, tts=False, embed=None, nonce=None, allowed_mentions=None, message_reference=None):
r = Route('POST', '/channels/{channel_id}/messages', channel_id=channel_id)
form = aiohttp.FormData()
payload = {'tts': tts}
if content:
payload['content'] = content
if embed:
payload['embed'] = embed
if nonce:
payload['nonce'] = nonce
if allowed_mentions:
payload['allowed_mentions'] = allowed_mentions
if message_reference:
payload['message_reference'] = message_reference
form.add_field('payload_json', utils.to_json(payload))
if len(files) == 1:
file = files[0]
form.add_field('file', file.fp, filename=file.filename, content_type='application/octet-stream')
else:
for index, file in enumerate(files):
form.add_field('file%s' % index, file.fp, filename=file.filename, content_type='application/octet-stream')
return self.request(r, data=form, files=files)
looks like making form-data, that depends on the number of files available
myMember.roles.add(mutedRole);
^
TypeError: Cannot read property 'add' of undefined
I have below myMember, which is found by using
myMember = message.guild.members.fetch("the id of the member")
Promise {
GuildMember {
guild: Guild {
members: [GuildMemberManager],
...
},
user: User {
id: 'REDACTED',
bot: false,
username: 'REDACTED',
discriminator: 'REDACTED',
avatar: 'e8c787520c7be3cb02d4da29fae41f29',
flags: [UserFlags],
lastMessageID: null,
lastMessageChannelID: null
},
joinedTimestamp: 1601174973856,
lastMessageID: null,
lastMessageChannelID: null,
premiumSinceTimestamp: null,
deleted: false,
_roles: [
'759149961735962704',
'759607789864615997',
'760538441653026869',
'760626202061832263',
'763648330302488596',
'766725841803280424',
'771062599583662111',
'776527344490774558',
'777965104829956136'
],
nickname: 'REDACTED'
}
}
However, roles as a property of GuildMember exists, and I've tried both myMember.roles.add and myMember._roles.add, neither of which work, returning the same error. my package.json says I'm using v12.2, not sure why I can't add roles
no idea what that is
idk either lol
something with data storage
@slim heart how do you send files?
@slim heart !
i don't think berry wants to offer us part of his brain
ur i ez
I speak in examples
just
become example berry
fuck now I have to find that then
is there a general getting started guide on receiving post requests with a webhook? do I just need to set up a basic web server or something?
i'd suggest you learn about http servers and requests beforehand
the webhook itself is pretty simple
so it is just a little web server then. alright thanks, will do.
aight, np
@slim heart so yeah you did but
{
payload_json: { content: 'wow' },
file1: 'data:image/jpeg;base64,...'
}
this no worky

