#development
1 messages · Page 1946 of 1
you need to download the image
you can use any http library
like https, node-fetch, axios, etc...
then you can store it as a file with fs yes
^
encrypting a password is a bad idea
plain text it 
Security of users' passwords should be at the forefront of every web developer's mind. Tom takes us through the insecure ways in which some websites deal with passwords.
Note: At circa 8mins, the animation does not show how the 'salt' is also stored in the database alongside the username.
Hashing Algorithms and Security: http://youtu.be/b4b8kt...
somebody remove my embed what the fuck does discord have against mobile
store the password bytes as bytes in a jpeg image
make an image of a bunch of hands and arrows pointing at a specific point in the image, and replace the pixels inside that area with the password bytes
people will understand but computers will never get it
good luck training it
the arrows are made by a computer
so if you use top.gg server to generate the arrows not even a human can understand it
like that
and store the password bytes in there
and randomize it with different images
lmao
that would be resource intensive ,
"Gpu shortage due new safe password generation method"
most companies hash the password and crypto miners use the GPU for hashing

bcrypt and argon2 are gpu resistant
ytho
because we can
we
wewewe
Anyone here ever used pixi.js? I'm trying to apply a filter but It aint working
The old film filter
is that even possible?
will those bytes make the image diffrent?
like 01011101 is a
and 01011100001 is something else tho
yes, those bytes will be interpreted as pixels, so their color will depend on which text character it is
that would be a genius idea :))
although with algorithms like jpeg its not so simple
because jpeg doesnt really use pixels in the common sense
kinda complicated tho
Jpeg has the weird habit of getting worse every time the image is saved
anyone else having issues when trying to install @discordjs/opus?
I've just got a massive list of errors when trying to npm i @discordjs/opus
odd
one of the first errors I receive is C:\Users\...\Documents\Auxcord\Auxcord\node_modules\@discordjs\opus\deps\opus\src\opus_multistream.c(29,10): fatal error C1083: Cannot open include file: 'config.h': No such file or directory [C:\Users\...\Documents\Auxcord\Auxcord\node_modules\@discordjs\opus\build\deps\libopus.vcxproj]
which is an internal c error so I'm not quite sure how to fix it
because thats not how the channel types are named
This is the error I get when attempting to install @discordjs/opus: https://www.toptal.com/developers/hastebin/idipuxefew.apache
I'm not entirely sure what's causing it
$ npm i
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /app/node_modules/abab
npm ERR! dest /app/node_modules/.abab-YC7vESjL
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/app/node_modules/abab' -> '/app/node_modules/.abab-YC7vESjL'
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/16.12.0/_logs/2021-12-26T19_17_07_122Z-debug.log
?
i dont know djs v13 xd
wait
.setThumbnail(message.guild.iconURL({ dynamic: true }))
is the same
Did you put .setThumbnail under .setTitle? @earnest phoenix
gives error?
try something
const tns = message.guild.iconURL({ dynamic: true })
then in .setThumbnail
tns
like
.setThumbnail(tns)
weird
ill send my code
thumbnailserver
my command is like that
try
forgor
your windows is 32 bit?
it'll be <message.author>.displayAvatarURL() in v12
message.guild.displayIconURL()
wait a sec
i'm searching for it
Nope. I’m on 64 bit windows
oh, it's without display
It’s just iconURL()
my browser crashed lol
is your node.js 32 bit?
yeah
looks like it
it's under my x86 program files
I have a bad habit of clicking on the x86 versions of things because bigger number
so for what I came, I came here because some irregular things are happening with my bot. It automatically deletes a random user's all the data (coins, etc..) and sometimes it deletes only some data like some cards or coins. Is there a solution for it? It's json.sqlite format and npm is quick.db (replit's database is weird and with only 50MB as I read it). I'm in replit
I suppose I should reinstall nodejs as 64 bit instead?
try it
in your error log its trying to find a pre-built version of opus for win32
which doesnt exist, they only have prebuilt versions for x64
Oh yeah that prob explains it
its not a real solution, but if for some reason you cant build it, then you have to rely on a prebuilt version
How I can send attachments using a express server
send attachments from where to where?
Is GitHub slow for anyone else today
how can I solve this?
I believe marcrock is trying to send attachments as a response to a slash command based on what I’ve seen in the detritus server
sad
: |
xD
you cant. replit does not offer file persistence. the only alternative is using the official repl.it DB instead of quickdb
Thanks Tim! Got it to install without any issue now
onRunError: Error: Cannot create a Buffer larger than 0x100000000 bytes hahahaha, now I've fucked up somewhere
times are already in UTC, they are only converted to your local timezone when you try to see the time as a text string
if you want to see the text in UTC as well, you can use for example .toISOString()
or other methods
for some reason my buffer is trying to create something larger than 5gb which I have no idea how it's getting that number
all I'm doing is ```ts
const buffer = await fetch(attachment.proxyUrl!).then(data => data.arrayBuffer());
const encoder = new OpusEncoder(48000, 2);
const encoded = encoder.encode(Buffer.from(buffer));
Maybe I'm supposed to use attachment.url and not attachment.proxyUrl
I'll check rq
Nope same thing
Yeah, I have no idea why it's doing that. Logging the buffer I get from fetching is this <Buffer 00 00 00 18 66 74 79 70 64 61 73 68 00 00 00 00 69 73 6f 36 6d 70 34 31 00 00 02 60 6d 6f 6f 76 00 00 00 6c 6d 76 68 64 00 00 00 00 d9 9e e0 56 d9 9e ... 17872 more bytes>
Which is the rough size of what I'm sending (about 17kb)
log both buffer and Buffer.from(buffer)
seems fine to me
ArrayBuffer {
[Uint8Contents]: <00 00 00 18 66 74 79 70 64 61 73 68 00 00 00 00 69 73 6f 36 6d 70 34 31 00 00 02 60 6d 6f 6f 76 00 00 00 6c 6d 76 68 64 00 00 00 00 d9 9e e0 56 d9 9e e0 56 00 00 ac 44 00 00 b4 00 00 01 00 00 01 00 00 00
00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 ... 17822 more bytes>,
byteLength: 17922
}
<Buffer 00 00 00 18 66 74 79 70 64 61 73 68 00 00 00 00 69 73 6f 36 6d 70 34 31 00 00 02 60 6d 6f 6f 76 00 00 00 6c 6d 76 68 64 00 00 00 00 d9 9e e0 56 d9 9e ... 17872 more bytes>
I'm thinking this has something to do with my issue https://github.com/discordjs/opus/issues/51
You need to make sure that the length of the argument to encoder.encode() is a multiple of 2.5ms. Since you are encoding with 16000 and two channels (!) that would be multiple of 1622.5 = 80 frames that is 160 bytes. A good normal window size is 20ms, so that would make you have the data buffer at 8*160 bytes exactly.
Problem is I don't know where they're getting these numbers from
then you need to align the buffer
...how?
you need to create a new buffer that is bigger than your buffer and whose size is a multiple of what they require
alright
moment.utc(message.guild.createdAt).format('MM/DD/YY, h:mm:ssa [UTC]');
``` is generally how I do it
something similar
👍
do you guys recommend me heroku, github and VSC?
I do not recommend heroku unless you have literally no other option
in addfield
it's like ```js
.addField(HI,"HI2", true/false)
true/false not needed tho, but te first two are needed
I'm still struggling to figure this buffer thing out. I've got it at one of the specified intervals (a buffer length of 3840) and it still gives me the same error.
are there better options of heroku freely?
You'll need to escape those characters.
Doing it on the fly like that will probably take some work.
Not sure the cleanest way of doing so.
how about replacing * and _ with escaped versions of them
All of them will need to be escaped.
Including | too, and possibly others
I'd pull up the list but can't use my pc currently
will there be a problem? when my bot got in 75+ servers, it asked me the host and I typed replit but now i'm going to change with local one
Probably not
ok
ah
right
i forgot them
but you prob dont need to escape <>
is this a problem or something? it's not starting like 1h
first of all
might need to cancel and restart if its been an hour.
idk
lenovo shit
exactly that
I can't even reset it because winRE missing and I tried to set the winRE a few times but it's shit
finally it started
you dont need to reset windows to remove those shits
that's not the thing
I can't update windows
you should have done a clean install after you got your laptop
idk I was a kid wen I got this
@quartz kindle
know a better way of escaping characters in a username?
Was thinking just str.replace()
but that seems bad since you need to do so on several characters
but yeah finally it'll be 5 years old and I'll be able to get a new one
i dont think there is any better option
you can try using indexOf before replacing
but if you need multiple chars, regex will likely be better
@earnest phoenix ^
how would i make a command take n inputs instead of just doing args[0], args[1], etc
If you're using slash commands no can do.
well for text-based then
also, once i split it, how would i make it so for every n input, it sends a request to an api with each input
like 4 inputs: 1,2,3,4
each of them go through the api and give a result
Parse the input into an array
ah ok
e.g.
"1,2,3,4".split(",")
Then you can treat it as an array and do your iterations
Yep ty
"1,2,3,4".split(",").join(",").split(",").join(",");

anyone else having problems with github being shit slow
like 1990s slow
4kbps local checkout of a repo in an action... slow golf clap.
its been like this ALL DAY and nobody has acknowledged it or updated the status for github or azure
Yeah
I thought it was potentially my internet/ISP
but see others having the issues
for anyone wanting to stay up-to-date with discord.js, make sure you prepare for this change in .setAvatar;
passing strings for urls or icons is deprecated, you now have to pass a single object with options.
Old:
.setAuthor('Name', iconURL())
New:
.setAuthor({ name: name, iconURL: iconURL() })
Consistency. They want to match their builders' implementation.
but why
the only thing I see good about embed builders is convenience
modeling it after the implementation just destroys that purpose
and it ends up being a glorified map again
Ok there's more to it
They were trying to get rid of MessageEmbed in favor of Embed from their builders package
So I have a few questions for anyone that knows what's wrong/how to fix the issue
- How would I calculate the Buffer length I need so that
@discordjs/opusaccepts it and encodes it properly? - Does the sampling rate/channel count need to be changed per file in order for encoding to work?
- I keep getting an error of
Cannot create a Buffer larger than 0x100000000 bytes, which means my Buffer is improperly aligned, since I'm only sending it about 17000 bytes of data. How would I align it properly?
It seems the only benefit of using Embed is validation. :(
So I've done some debugging and even when making sure the buffer length is a multiple of 5, it still barks at me saying Error: Cannot create a Buffer larger than 0x100000000 bytes
From what I've read it either needs to be a multiple of 2.5, 5, 10, 20, 40, or 60
i dont really understand how that guy arrived at 1665.5 or whatever the number was
Yeah me neither
I just tried that and the problem persists
const encoder = new OpusEncoder(48000, 2);
const offset = 5 - (buffer.byteLength % 5);
const aligned = Buffer.alloc(buffer.byteLength + offset, Buffer.from(buffer));
const encoded = encoder.encode(aligned);
connection.sendAudio(encoded, { isOpus: true });
``` I've got this
have you tried with 60?
nope I'll try that rq
same thing
buffer length was 17940, which is indeed a multiple of 60
I have a feeling I'm missing something crucial about the formula to calculate the length
since that guy pulled 1622.5 out of his ass
there is something to do with your bit rate
those were the numbers he got from 16000 and 2 channels
you have 48000
so try something like 480
multiple of 480
it throws the same error on a multiple of 480, but when I set the aligned array to 480*8 bytes, it doesn't throw an error
however I don't hear anything in vc either
granted that might just be because there's not much voice data contained in 3840 bytes
less than a third of a second of data p sure
same thing works with 480 * 32 length
it seems like it throws that error if the length of the new buffer is bigger than the length of the old
it only seems to work with 480 * x where x is a multiple of 8 and the total does not exceed the original buffer length

idk if anyone can help me but idk how to fix the error of missing a required positional argument on an optional slash command option
nevermind - does not work with larger numbers
only seems to work up to 32
which obviously will not be enough to play most files
not to mention it just doesn't play any audio either
this just doesn't make any sense to me lol
I pulled shit out of my ass
this is what you have to base yourself on
Buffer<char> buf = args[0].As<Buffer<char>>();
char* pcmData = buf.Data();
opus_int16* pcm = reinterpret_cast<opus_int16*>(pcmData);
int frameSize = buf.Length() / 2 / this->channels;
int compressedLength = opus_encode(this->encoder, pcm, frameSize, &(this->outOpus[0]), MAX_PACKET_SIZE);
I'm using somebody else's opus now, I was having too many issues with that
lmfao
they're helping me
ok
is that c or c++
cpp
hey
so...if
I define this person as this: ```js
let dUser = message.guild.members.fetch(message.mentions.users.first()) || message.guild.members.get(args[0]);
how can I send a dm to them?
I've tried .member.send, .send, .user.send, .member.user.send but non worked
You can use message.mentions.users.first() by itself since it'll be a User instance.
it smelled like shit
thanks
You should be able to call .send(...) on it afterwards.
pov you use c++ in node
TypeError: dUser.send is not a function```
But where you go wrong is how you handle the args
Since you've gotten a manager; not a collection: https://discord.js.org/#/docs/main/stable/class/GuildMemberManager
Then can you show your current code
let dUser = message.guild.members.fetch(message.mentions.users.first())
Again, you don't need to wrap it in that fetch
dUser.send(`...`)
Since you already have the user instance.
So remove that message.guild.members.fetch part
i do actually
oh
And it should work
Your current error is due to .fetch returning a Promise. You're trying to use it as a GuildMember instance.
i have a doubt...
ive been making this discord bot
but ive been getting a rate limits exceeded error
it happens from time to time and idk what to do to stop it
this is the error im getting
yea
Then it may be due to the shared environment of the platform.
Other bots' activity may be influencing the rate limit.
A solution would be to get your own dedicated environment.
class Dropdown(nextcord.ui.Select):
def __init__(self,client):
options = [
nextcord.SelectOption(label = "Moderation",description = "Set of mod commands",emoji = ":G_Moderation: "),
]
super().__init__(placeholder = "Choose command options",min_values=1,max_values=1,options=options)
self.client = client
async def callback(self,interaction:nextcord.Interaction):
if self.values[0] == "Moderation":
mod = nextcord.Embed(description = "**Moderate your server with these commands.**",color = 0xED4245)
mod.set_thumbnail(url = self.client.user.avatar.url)
await interaction.response.edit_message(embed = mod)
class DropdownView(nextcord.ui.View):
def __init__(self,client):
super().__init__()
self.add_item(Dropdown())
class help(commands.Cog):
def __init__(self,client):
self.client = client
@commands.command()
async def help(self,ctx):
view = DropdownView()
await ctx.send("hi",view = view)
def setup(client):
client.add_cog(help(client))
Im trying to get my bot's avatar for my help command
but Im getting an error __init__ missing a required arguement "client"
can someone help?
nextcord
So Im trying to make a bot that reads a message that says
{
"value": "10"
}
and replies with
10
using discord.py
I was considering making the bot command prefix { but realized it probably would have an issue with a command of "value"
because of the quotations
So you want to parse JSON
the message is in json format, but its not actually json, I dont think
Well, it is some format, so using some existing parser to extract "value" would be nice.
I have one bot that says
{
"value": "10"
}
as a message
Trying to get another bot to read that and reply
10
Let's say our command is -read <message-id>
Assuming it is JSON, you can use Python's built-in json module.
Which will turn it into a dictionary
So you can get value easily
But it could be more complex
Maybe you want to ignore markdown or surrounding text as well
when I tried that I got
File "c:\Users\Hal\Desktop\scalene\discord\bot.py", line 16, in on_message
parsed_json = (json.loads(message))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not Message
That's because you're giving it a Message instance.
You should be giving it a string.
Aka the .content
Yep
cool ^^ ty
cool, now to deal with 1000 other bugs 😂
await bot.send_message(channel, content = embed)
does this need to be ctx? Im not really sure the difference but I see ctx everywhere
You can see if it does in the documentation.
I managed to get it when I type a test message of
{
"value": "10"
}
but realized the bot is actually sending
{
"value": "10"
}
specifically this
which I believe is a poorly formatted embed
@earnest phoenix read this
ctx is not required
original
parsed_json = (json.loads(message.content))
updated
parsed_json = (json.loads(message.description))
is it this easy?
what is message.description supposed to return
embed description
If I get this setup the bot takes webhooks from blocknative and integrates blockchain mempool data into discord in an embed.
cus Im not on testnet each test costs $2.80 😅 yes I could be on testnet but I thought this would be quick and easy
bot command would work wonders 😂
ok so what are u trying to do with this code
I'll dm you probably easier
Because you're sending every single result that was found, and the reason it returns many results for that query is because Tenor's search endpoint does not support punctuations properly much, only get the first result, see if it exists then send it
why would you do that when you can just grab the first result
Not a bad idea but some punctuations are supported
Then get a random result from the array of results
limit it with slice
so i have to type something like this self.add_item(dropdown(client))
It's case sensitive
It does, but it's not intended
Of course you can do it inside the __init__ method, but that's hacky
Use commands.group instead
im using
@commands.group(invoke_without_command=True)
@earnest phoenix OMG it worked ty
I'm probably sounding like an idioit but ty
Can you forEach a JSON structure? { }
If yes, how?
IIRC you can
<object>.forEach(variablename)
I thought I tried that but i'll double check
forEach is not a function
I could just toString replace { } to [ ] and back to json
or you can do
Object.keys(theObject).forEach
Keep object like that?
^
?
Object.keys(thatJSONthing).forEach
yup
it'll get all the key
ty
then you can just do theObject[key]
remember that the keys will not always appear in the same order
Help me
Main.java:20: error: cannot find symbol
Message message = event.getMessage();
^
symbol: class Message
location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
1 warning```

https://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-or-cannot-resolve-symbol-error-mean dont know if this is helpful or not
but the first answer seems to explain it rather well
ok
Is it possible to wildcard SSL with Cloudflare?
cloudflare already manages that within it's TLS system
i.e just wildcard the domain
hello i want a good host for my bot
Kick then readd iirc
i want per years free or payed no matter
advinservers.com is a great VPS host
£1.50 a month for 2gb ram VPS
Or plox.host for haas (hosting as a service) bot hosting
ok ty
Np
but you have any host to pay per year not months
Advin is monthly
Hey guys, im making premium system to my bot. People voted to make it per-user. How can i make it, and should i make it using codes (/premium redeem <code>) or to user logged into dashboard
How can i make it charge every month/year
Patreon can be
But i would want to charge thru dashboard instead of redirecting to patreon
Well you define guild as ID… not as guild object
interaction.guild.members.kick(…)
Yeah I wonder why you would define a var for it
Hi
check perms before sending the confirmation message
✔️✖️ also try using these
instead of confirm and cancel
might look cleaner
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'dict' object has no attribute 'key'
When clicking the button you will receive another interaction event
No need to use collectors
dict.key huh
What did you do
No... the interactionCreate event
message.channel.send(text).then(m => m.delete()) ?
That's the reason you gotta use unique IDs on your components
Once the button is pressed you check in your event if the interaction is a button interaction and taking aktion based on the unique ID
The only way to make a button click locked to a user is emphemeal (?) Or? I mean you could bake the user id into the component id and parse it back
Wut?
how do i timeout the cmd
What do you need to "timeout"?
Well yeah a timeout is the easiest way.
When sending the message with the buttons, await the promise which returns the whole message object (of the sent message) and remove the components in your timeout, or disable them.
huh that's the easiest way I'm aware of
wait a second
And how about using then() instead of awaiting the promise?
map the row buttons and set them to disabled then edit the message with the new row
after interaction.reply()
hmm
wait i just gave you a detritus example
reply().then((message) =>
{
setTimeout(() =>
{
message.edit({ content: message.content, components: null });
}, 15000);
});
omg dude...
the .then returns a message not an interaction
paste it and watch the magic
hope there's no bidirectional unicode characters in there
Can you edit a embed using embed.editReply or something?
A reponse, the text you see, is always a message
The interaction is what the client does
o-o
what buttons
``` await embed.edit({content: **Break Approved**, embeds: [embed], components: [row1]})
Error: `embed.edit is not a function`
You completelly misunderstanding the difference between the interaction and the actual message (response)
because embed.edit is not a function
Yeah but how would I edit a embed?
interaction.edit?
think about what you're supposed to edit
The embed.
yes
But I'm not editing the reply.
I'm editing another embed in another channel.
Because nobody wants kids in their system
message.channel.send().then(msg => msg.edit({ embeds: [modifiedEmbed] }));
But it's on a button.
they want
If they click accept then it edits the embed.
👀 does that actually work
We forgot the fetch reply option
Add fetchReply: true after ephemeral
Aye
f here to save the day
Well the docs are well written
Use the fetchReply option to get the bot's reply message.
You just have to read the BIG HIGHLIGHED TEXT, FakE
Yes I know.
detritus is clearly better
I feel like the ghost of Erwin is around
I think I'm possessed
👉👈
literally just edit the message with the new embed
Okay, how?
I gave a code example
interaction.reply().then(msg => msg.edit({ embeds: [modifiedEmbed] }));
Its not a reply tho!!
Its sending to a whole another channel
const updates = client.channels.cache.get('923246751442403398')
const ch = client.channels.cache.get('925045878337732719')
There's no edit function for interactions
ch.send({ content: ` **Pending Break Request**`, embeds: [embed], components: [row] })

You can only edit the reply
erwin would like to know your location
#development message
hmm do button clicks allow you to access the message it was triggered from
a = await ch.send();
a.edit()
Imagine using a command handler you didn't write yourself 
but
onbuttonclick= msg.edit
and msg is declared after the button is sent
im dumb
wat
why can't you declare the variable beforehand
const updates = client.channels.cache.get('923246751442403398')
const ch = client.channels.cache.get('925045878337732719')
const row = new MessageActionRow().addComponents(
new MessageButton()
.setLabel("Accept")
.setStyle('PRIMARY')
.setCustomId('accept'),
new MessageButton()
.setLabel('Deny')
.setStyle('DANGER')
.setDisabled(false)
.setCustomId('deny'))
const row1 = new MessageActionRow().addComponents(
new MessageButton()
.setLabel("Accept")
.setStyle('PRIMARY')
.setDisabled(true)
.setCustomId('accept'),
new MessageButton()
.setLabel('Deny')
.setStyle('DANGER')
.setDisabled(true)
.setCustomId('deny'))
const embed = new MessageEmbed()
.setAuthor(`New Pending Break Request`, interaction.guild.iconURL())
.addField(`User:`, `${interaction.user.tag} | ${interaction.user.id}`, true)
.addField(`Reason:`, `${reason}`, true)
.addField(`Duration:`, `${duration}`, true)
.addField(`Department:`, `${department || "All"}`, true)
ch.send({ content: ` **Pending Break Request**`, embeds: [embed], components: [row] })
const embed1 = new MessageEmbed()
.setAuthor(`Request Approved`, interaction.guild.iconURL())
.setDescription(`Break was approved.`)
.addField(`User:`, `${interaction.user.tag} | ${interaction.user.id}`, true)
.addField(`Reason:`, `${reason}`, true)
.addField(`Duration:`, `${duration}`, true)
.addField(`Department:`, `${department || "All"}`, true)
const embed2 = new MessageEmbed()
.setAuthor(`Break Approved`)
.setDescription(`${interaction.user.tag} | (\`${interaction.user.id}\`)'s break was approved.`)
//updates.send({content:`<@${interaction.user.id}>`, embeds:[embed2]})
const collector = interaction.channel.createMessageComponentCollector();
const wait = require('util').promisify(setTimeout);
collector.on('collect', async i => {
if (i.customId === 'accept') {
await i.deferUpdate()
await wait(100);
await i.edit({embeds: [embed], components: [row1]})
await updates.send({ content: `<@${interaction.user.id}>`, embeds: [embed2] })
There it all is 🤣
The magik
my gosh... takes like 3s to scroll through
what is that wait for?
Wait before it does the other thing 🤣 quite useless but its whatevs
never have i been more glad i use detritus
lel
i mean, there are better ways to do it in djs too
Yeah... was about to say that
how does detritus do it?
onClick handler on the button itself
Nobody knows why people are using collectors for interactions
yeah
Because nobody wants to migrate their reaction collector to buttons
I would say because people don't understand an interaction and the event it triggers
But yours might be true, too
so erm, is there a way to edit the embed?
i used to have a reaction menu before buttons, but i didnt use collectors
i used the reactionAdd events
Try console.log(i); inside the collector
It should have a message property
How dare you Tim for not using collectors
I did reactionAdd events too 👀
but because tim said he did 
lmao
It sent a bunch of info lmfao
now that i switched to buttons i use the raw event instead
I am pretty sure you use raw api
because im still running djs v12
i will after the rework
Ok... somebody throw Tim out of this channel
lmao
Ok
Try i.message.edit() instead of interaction.edit()
We're moving to v14 already, Sir
im not even gonna use v13
Not a single day has gone by without fixing breaking changes in new djs versions
and im not gonna support light for v14 either
Why use message?
uh because you're editing the message with the new embed?
Not interaction?
the interaction is what the user does not your bot
Btw Tim I got it to work finally
oh?
Started using @evan/opus instead and turned my audio files into raw pcm streams with ffmpeg
evan
Then the rest was easy
god bless evan
Yes
He helped me a lot getting it set up properly since I’ve never done much with audio stuff
god bless timotej roiko
Timotej Qt Epic Programmer Roiko
naming as a service
Tim.js
BetterMessagePack
besides that
lmao
Move on klay
messagepack++
uberpack
its a different protocol tho, so its a different thing, not a better version of the same thong
thong
is the project public
DifferentMessagePack
DifferentProtocolMessagePack++
lmao
if you can't think of anything'
just look up some archaic greek word and name it that
alphapack
alpha male
Sigmapack
alphapacker + betaunpacker
hello how can support
yes

Support very expensive
Unitu tekh suport
Is it free to throw my imgur links?
my name is john smith i am a certified microsoft technician and i will repair your computer for only 399 a year
@earnest phoenix We need some indian tech support here
Look, I want to put a banner on togg, I'm uploading the imgur link, it's giving a link, I'm writing to the banner posting section, I don't accept it, I say get imgur, but I can't get the imgur link
what for
.
Oh I notice that's you lol
no
Uh ok
https://imgur.com/a/rzjyltj
Support denied
yep
aap shayad skill issue ki samasya se guzar rahe hai
no
@spark flint where do i get this emote
did you even exlain your issue or send some codish code?
i'll add to alsworlds
:painn

I'm trying to sign a JWT with HMAC. Am I doing this right?
openssl rand -hex 32 # Generate random key for HMAC
openssl dgst -sha256 -hmac <key> /bin/ps # Generate secret to sign JWTs with.
wtf I don't understand one word
there @earnest phoenix
I can't put banner :/
h
@near zephyr reload the page
it does h
Your code just waits for the interaction to be replied to
Just remove the .then and edit the message after 15 seconds
If no interactions have come through on the buttons
No it's the command interaction response
I’m confused
yes but same
You want to edit it after 15 seconds of no buttons being pressed, right?
sad, #support and ask not here. Here is 🌟 coding 🌟 stuff
: |
?
It's a known issue on the site iirc
@earnest phoenix dude, it is the same thing to reload the page
After this reply is sent, the code then waits 5 seconds before editing the message regardless of what buttons have been pressed or not
From my understanding at least
:v bro, why u need to so toxic. When u are asking and need help here too. People just want to help other
Did you decide to ignore this message, Sky
Cache stinky
In order to clear your cache for the site, press CTRL+F5.
If this does not work, try one of these resources below:
Instructions on Microsoft Edge
Instructions on Google Chrome
Instructions on Mozilla Firefox
Instructions on Safari
Instructions on Opera
Instructions on Brave
Remember the days brs didn't have luca tags? 👀
Wouldn't worry much, 99% of the people here will say that and then have the same dumb questions or answers.
not really
I always manually cleared cache lmao
I’ve asked tons of stupid questions in the past
well I don't care a lots, but we need stop argue here. Here is for asking question not about if ppl know something :))
SHIFT R is chrome specific, any other browser uses CTRL R
It’s ok to not know things
just to say
built different huh
Nobody knows everything that’s why channels like these exist
And nobody uses chrome without a weapon at his head
(Except maybe Tim, I’m pretty sure he knows everything)
I still ask stupid questions.
the only difference is what level it happens at lol.
You get people shitting on beginners for making silly mistakes
and then those same people will go ahead and do the equivalent silly mistakes in front of people far more experienced going
Normally though more experienced people dont shit on them as unintelligently lol
dude, stop. I don't want to fight with u
I shit on people for not using detritus 
Move on Erwin
cringe
Remember when #development etiquette was enforced? :^)
Check for buttons being pressed, and if they have then don’t run the message.edit
Remember when you had roles?
well he called me not educated, even he asking questions here :/
If roles define my value then I'll gladly have none just to prove my point
are rolls now a scale of how reasonable someone is lol 🤣
I'm not gonna continue that conversation here
bro im above you because I have a role despite not owning any bots
let buttonPressed = false;
when button is pressed buttonPressed = true;
in the timeout
if (buttonPressed) return;
// rest of the code
We're tied
Except I'm purple name
built different
read this
you're orange
🤔 probably should remove your bot dev role then
setTimeout(() => {
if(buttonPressed) return message.edit(text)
}, 15000) // 15 sec
This is probably going to be your easiest solution

whatever bot gives the bot dev role is broken
no thanks, i can't sacrifice my life and sit all day testing every single cringe command in an indian bot
nah I think it should be left to remind us of top.gg being broken af
We will never forget that, don't worry
here
...by making a variable?
is the way
Ew
here too
Then when a button is pressed you set it to true
im confused how uneducated can people be
After 15 seconds you check buttonPressed to see if it’s true or false
If it’s true then return

If it’s false then run your edit
but good lib
he use detri.. ? ( can't spell)
No
say it out
After raw api

use a map function
imagine using the raw api and scrap a Discord Api gateway by ur self
for(const button of row.components) { button.setDisabled(true) }
wait setDisabled mutates row.components
use a for loop instead
I'm confused how uneducated people can be
not this again 
channel very weird today
only reason I didnt give out warnings was because it looked like you all would resolve it quickly yourselves.
please stop
homo time
this server is great for beginners
I’m confused at how educated people can be 
so it's best not to discourage them
agreed.
some people here are so smart
everyone yelled at me till I learnt javascript BEFORE learning djs
oh u mean the living stackoverflow Tim?
yes
Tim is a walking js doc
yeah, they're leading you down the right path
This server is basically beginners shitting on each other lol
to learn discord.js you need to learn javascript
so they're trying to encourage you to take the right path
of course you can learn without knowing js but it's harder
much harder
true
Asm
=== 1
have anyone tried brainfuck? it is much better
The first ever code I wrote was in js
Did you mean php?
Unless you count scratch as code in which case you’re a psychopath
no I mean Brainfuck
first code i ever wrote was javascript
but without the script 
Scratch teaches the beginnings of code
I wrote js when I was like 7 or 8 at a summer camp
Was really boring
Then I rediscovered it later
u guys just too noob, my first code is 🌟 HTML 🌟
Thought it was really fun
the best "programming language"
html is actually not bad for getting comfortable with writing technical stuff.

you can instantly see changes
imagine getting an error in HTML
there is no fucking way to trigger an error
:))
HTML is designed so that browsers can try their best to interpret it even if it’s technically wrong
"I write 5000 lines of code and it work at the first time, with no error" - HTML devs
Which is why it's so easy to break


would errors in html even make sense?
did errors even exist when html was created
yes
nah I think html is just perfect with no bugs
too much backwards compatibility
css errors could work.
I think if the css makes error then it just won't run that part
it won't show the error
trying to apply properties on !important things.
no existing element etc
but most editors do all that
and we just have to wonder why the div is not centered
woah woah woah css frameworks will probably break from the first part
use a bulma button and then change the background to a custom color forced with !important
instant break

only cave man
dead chat xd
nobody have questions tho
json is just too good man
can't use json properly in other languages
yeah for "old languages"
If you need to interact with some ancient API.
e.g. logback
but that's java
lol the word "ancient"
literally every modern front end framework uses XML's base to work so, yes
they use XML ?
woah
most libraries and frameworks will abstract XML away from you
litterally React, Vue, etc... are all built off of the XML tree.
xml is the <tag> thingy right?
yes
ahh
essentailly
then yeah
its a very basic format / markup
I don't think that's the kind of XML we're talking about
not really
otherwise we would have to limit to "Is there any modern uses for SOAP still"
so Html is based xml or the other way?
because that's what you're talking about lol
there are a lot of things that are part of some family but act completely different
It's like Java being part of the C family. Sure, it shares similar syntax, but that's about it.
Okay, so with buttons, how do I make it so that it does not give the role to the person who clicked the button, but the person who used the command?
interaction.member.roles.add('911236347912679424')```
That just gives it to the person who clicked the button
I write Java so I don't have to work with pointers 🙃
so the author get the role or the person who clicked?
The person who used the Slash Command, so ig "author"
v13
I think its member
One is user one is member, those two are different.
Iirc user can't have roles.
Didn't think so
nope
it doesn't
but you can get id and then from the guild.members to get it
After all these years I still don't see the difference between XML and HTML
the difference is that they're all valid XML... It's not like a completely new system that isn't compatible.
HTML is a specialised XML format, it's logic and structure is built upon XML but it's underlying syntax is still XML.
This is why most HTML parsers are built with XML parsers in their core
User objects aren’t associated with guilds, Member objects are
because they're the same
HTML just adds a few standard attributes to nodes
but HTML is valid XML
Yes but a user can't have roles o-o
yeah I get that
that is what I said
and things like libxml are used for parsing the HTML DOM because it's just a XML DOM
dude I thought about message.author
Author is a user object though isn’t it?
but the op probably meant XML in a way of "will I have to work with XML occasionally like we do with JSON"
you can do
const user = interaction.guild.members.cache.get(interaction.user.id)
I guess, i haven't tried the interaction
and then access the .roles from user
yeah
but that is message
we mean interaction here
Oh
Then use interaction.member
yeah so this here is no need @earnest phoenix, just use interaction.member
I haven't tried those button and slash command thingy, so I don't know so much about it
I didn't saw it lol, so had to take the member from guild.members
Most of the time that's done separately from discordjs
I sometimes feel like you don't speak English... might just be me
Alternatively if you’re checking permissions you can do interaction.memberPermissions
Because you have to do interaction.member.permissions.has()
even on v12 member.has doesn't exist
That method still has the term "permission" in it, hasn't it
No need to argue
Why has this channel been so stinky today
wtf
People getting their Christmas venting out of the way 
exlpaining it until the dead end, Sir
Personally I think a lot of the questions asked can be solved using the docs
That’s just what I’ve been using to answer them, I don’t even use djs lol
I tried that for a long time.
A lot of people dont like reading docs, so they don't understand and just becomes more of an issue.
yeah it does still exist
why tf my env ain't working (today i'm moving to VSC, git and heroku)
DBL_TOKEN=NOPE
Moving "to" vsc?
yeah from replit
Your app probably isn't loading it.
Heroku has its own env
ENVs in normal environments are different than replit envs iirc
Are you using the dotenv package
yep
Are you getting an error when you try to access the env variable?



It's from XML's family
