#development
1 messages Ā· Page 1938 of 1
if u remove the bot the commands go away with it
hmm, idk, my command updater script is basic af š
yes
I've tried 
To remove em too? damn lol
no, guild commands do
Not if the commands are already registered globally
As soon as it joins a server it adds the global commands.
if its already been active for 1 hour w/the globals
i still don't get slash commands
They're so easy, I'm still learning myself tho
theres way less documentation and support on it then you'd expect
its hard with python

like how do i get info
Yeah, but you kinda gotta think where stuff would make sense at.
well, discord.py intentionally doesnt support them lmao
you need third party extensions for dpy
i use a third party module
interaction.options.getString('property') is how you do it in js, idk py tho š¦
discord-py-slash-command
do i have to enable port 22 in the sshd_config file for sftp?!?!1
there's no 1.8.9 in ba sing se
mh?!?!1
whats wrong with 1.8.9?
tim help!!1
yes usually itās the default sftp port
but it works without it 
sftp is literally ftp over ssh
it uses the same ssh connection that you are already using
the config has the port option
didnt enable it
lol
because ssh ports can be changed
strict
SEND_MESSAGES and VIEW_CHANNEL permissions seem a fair restriction for using slash commands i think, or have i overlooked one?
some servers are too strict
we don't talk about the 1.8.9 incident
currently its like this
22 is unsecure iirc
but even if its like that, it will still default to that?!?!1
what would be secure?!?!1
idk, 22 is normal tcp
22 is the default port, theres no need to change it. but one popular security trick is to change the ssh port to hide it from potential attackers
not really necessary in my opinion, especially if you use ssh keys and disable password logins
default port is usually 22
sometimes 21
but 22 is usually the default port
i know because of how many vps's i've been through 
even if its commented like this?!?!1
I disabled ssh before I turned my bot on
wait but how will I turn my bot on without ssh
that's the neat part
why woould you change port
surely keeping standard port is better
by changing port you remove one clue from hackers
like if i wanted ftp and someone said "oh yeah my port is port 69" i wouldn;t trust it
true
personally i would say keeping standard is better
like, the first thing they'll try:
- port 22
- user: root
true
i should change my username on my vps
its still root
but password is quite secure
it's so easy to change to another user
true
the only bad thing is that you'll need to get used to sudo
but u can alwayls just sudo -i -u root
port 21 is ftp and port 22 is sftp
what does that do 
i disabled ssh
now login to it 
ohno putty
whats wrong with it 
cmd/powershell already have ssh
putty and openssh use different types of keys
isnt that good?!?!1
you need to reach the island somehow
wdym
like, you need to have a way to login
also wtf is this
C:\Users\<you>\.ssh\known_hosts
just the list of servers you willingly logged into
nothing to worry
I once saw a way to limit ssh to a single ip, then had to use a vpn to login
there is a way
but idk, sometimes security has diminishing gains
i use a site to access the vps
how would i check that?!?!1
for the rescue system? no
without that
probably
Rescue system is a network boot with its own authorization level
They will show or send you the login credentials once you active it
how do i know if its activated?!?!1
sftp
Take a look if the service is running
the rescue mode or what im doing now?!?!1
well i didnt start it
whats the service name?!?!1
how would i test it 
systemctl status sftp
Hmm has a different name then I guess
Oh well then disable it in the conf file
Yeah itās a subsystem
nano /etc/ssh/sshd_config to edit its config
I mean you can also just setup the firewall properly and allow incoming connections for services you need only
Which would be recommended anyways
using discord js slash commands, is it possible to get the data a user types after the command? like, lets say i have a /admin action:send-message command, and i want to read all the junk the user types after the command, without adding another command option, is that possible?
Yeah auto complete is what you need
If thatās what you need
If you just wanna accept any input as argument for your option then choose string
Which has an unlimited length and accepts multi line inputs iirc
Auto complete however will send an event each key(s) the user types
(including the pressed key(s))
nah thats excessive, i just made my admin command have subcommands that can have the relevant options i need š
the commands only available in one server anyway so its only me that will ever use it lol
const emojis = interaction.guild.emojis.cache
.map((e) => `${e} **-** \`:${e.name}:\``)
.join(', ');```
How can I make it so it only shows like 15 emojis?
nah that would still work, since they're mapping the collection to an array, then joining it
inserting the .slice between the .map and .join should work
yea but i was trying to big brain it and return only 15 from the cache lmao
hey
So.. I started using an API and it returns a data with results that is an array of objects
and.. this does not work
data.results.size.toString()```
what are you logged to console there, the data?
yeah
Is it possible to have .setImage or .setThumbnail be a link? Specifically a gif. For some reason the embed shows up as loading for the image.
.setImage returns the same thing. I can have the gif show up as an image/thumbnail if I'm getting the file directly, but via a link it doesn't work.
huh. might just be imgur then. ill try smth elese
How can I delete all the global commands on the bot at once?
Updating them by sending an empty array may still work
But Iām not sure
client.application.commands.set([]);
I have really old Global commands loaded, and they won't delete using the simple one line delete command
Well fetch the commands and delete them in a loop then
Nope, they're all still there.
onst rest = new REST({ version: '9' }).setToken(token);
rest.get(Routes.applicationGuildCommands(clientId, guildId))
.then(data => {
const promises = [];
for (const command of data) {
const deleteUrl = `${Routes.applicationGuildCommands(clientId, guildId)}/${command.id}`;
promises.push(rest.delete(deleteUrl));
}
return Promise.all(promises);
});
Tried that, didn't work.
Said invalid form body
Well, now its that
How do you change what a thing says in HTML with javascript functions?
I got this in my HTML file:
<body>
<script src="js/scripts.js"></script>
<p id="demo">ayo</p>
</body>
``` and this in my scripts:
```js
var axios = require("axios").default;
function logData(data) {
let activeEvents = 0;
let unactiveEvents = 0;
data.results.forEach(data => {
if(data.state == 'active') {
activeEvents++
} else if(!data.state == 'active') {
unactiveEvents++
}
});
let output = `there are ${activeEvents.toString()}/${data.results.length.toString()} active events!`
return output
}
var options = {
method: 'GET',
url: 'https://##########/v1/events/',
// params: {'': ''},
headers: {Authorization: 'Bearer #################'}
};
axios.request(options).then(function (response) {
let data = response.data
// console.log(data);
document.getElementById("demo").innerHTML = logData(data)
console.log(logData(data))
}).catch(function (error) {
console.error(error);
});```
it works when I run the file it self but when I do the document get element it just ignores it
it doesnt change the ayo
Should work to do document.getElementById("id").innerText = whateverYouWantHere
does it still work if its in a function?
It should
but here it doesnt for some reaosn..
same..
Are slash commands just a one-line-thing?
Probably...
not my ad btw
Not if itās a string as option
It is a string.
oh
its required š¤£
It's optional, yet only one line.
And whatās the issue?
How can I get it to add that whole ad in the desc: option?
Start writing behind the parameter not in a new line
the way I would handle it, is by having setdescription send a dm to the user and have a message collector to get it.
Start writing behind the parameter not in a new line
I'll just do that
Dude please read what I wrote
Your answer makes no sense
It has to have new lines tho
Tf does "Start writing behind the parameter, not in a new line" mean...?
I didnāt say remove all new lines, I said START behind the parameter and not START with a new line
It has to he spaced out tho?
Like
here
here
here
It has to have those.
It can't just be one big thrown together paragraph
herhehrherhehrehrhehrehrhehrh ehrh herhehrh ehrhehr
Nah, that looks fugly
Did you actually read what I wrote?
Did I actually understand it? nope š¤£
Idfk what this means
Start writing behind the parameter
Sorry, collectors are much more easier lol
Parameter = option
Your description is a slash command parameter (option in other words)
DONT BEGIN WITH A NEW LINE - JUST DONT
Alr, im just gonna use a collector, bye now š¤£
Am I speaking Spanish?
LMAO
Imagine trying to get help from someone if you arenāt gonna listen and cooperate?
I am trying
but I don't know how to write behind a param
how does it not begin with a new line
its a ad
tf?
Theyāre trying to help you
so confusing
Listen to them
Yeah, but Woo alr helped me.
Donāt just jump to conclusions
All I said was I prefered to use collectors
Why would I do that?

Start that first line of the ad behind your slash command option and do not start the first line with a new line
people are just gonna copy and paste their ads
there are multiple lines
Also
it is only set to get the desc: box
Yeah still I got that.
Paste the first line behind the slash command option and not in a new line
oml
The client will think you let the optional option emptY
Still making 0 sense tbh
It does
To you.
Just change the option to be required and you see what I mean
Dunno what youāre doing works fine for me
New lines works perfectly
As long as you donāt start with a new line right after your option
Your note getting it
:oml:
Wait
how did yours work
OMG
It didn't work fro e
egeigje
im done
not like a new line line
like
/setdescription desc: test
other line here
another here
It does even show the line break in the overview
but it only does desc: test and it reads the others as a "tab"
That works only for one option or if itās your last option
whaaat
I only have one option
Its the lines im trying to show man
let desc = interaction.options.getString('desc')
const { SlashCommandBuilder } = require('@discordjs/builders');
const { Permissions, Discord, MessageActionRow, MessageButton, MessageEmbed, MessageSelectMenu } = require('discord.js')
const db = require('quick.db')
module.exports = {
data: new SlashCommandBuilder()
.setName('setdescription')
.setDescription('Sets the Servers Description!')
.addStringOption(option => option.setName('desc')
.setDescription(`Set the Server Description.`)),
//.setRequired(true)),
async execute(interaction, client) {
await interaction.deferReply()
let desc = interaction.options.getString('desc')```
That's what it is
yet
No lines I can do
so like

Dunno what youāre doing wrong
Works like a charm for me
Thats the thing
Lemme test 3 lines
im not doing anything wrong
/setdescription desc: test
test```
it reads the 2nd line as a "TAB"
and ignores it
cause its not in the DESC box
Well its clearly not working for me
So im done
with it
done
bye
I have a headache 

All that for nothin
At least I now know new lines being removed completely - not being parsed as white space
Yeah I don't think slash commands have support for spaces atm lol
Command names? No as well as options
I mean, aren't you guys using different clients
Newlines should work on mobile client (or at least what I'm using, Android), though nicknames can't have them
I mentioned that the client may interpret the new lines, especially the first line if not placed directly behind the option differently - up to ignoring the option completely
Thing is they had been doing what you said they didn't 
That is,
Start that first line of the ad behind your slash command option and do not start the first line with a new line
Even before you told them to do it, they already did it
Just wait for the new slate framework and multiline input
Error : TypeError: channels is not iterable
for (const element of channels) {
let ch2 = client.channels.cache.get(element)
await wait(4000)
await interaction.editReply({content: `Bump Sent to all Receiving Channels.`})
const emojis = interaction.guild.emojis.cache
.map((e) => `${e} **-** \`:${e.name}:\``)
.join(', ');
const owner = await interaction.guild.fetchOwner();
const e = new MessageEmbed()
.setAuthor(interaction.guild.name+` Server Bumped`, interaction.user.displayAvatarURL({ dynamic:true }))
.setDescription(`${desc}\n\n> __${interaction.guild}'s Server Stats:__`)
.addField(` - Members:`, `${interaction.guild.members.cache.size || '\`Could not Fetch Member Count.\`'}`, true)
.addField(` - Emojis:`, `${emojis}`, true)
.addField(` - Bumped By:`, `${interaction.user.tag}`, true)
const row = new MessageActionRow().addComponents(
new MessageButton()
.setLabel(`| Join ${interaction.guild}`)
.setEmoji('919757103852290059')
.setStyle('LINK')
.setURL(invite),
new MessageButton()
.setLabel(`| Support Server`)
.setEmoji('919757103852290059')
.setStyle('LINK')
.setURL(''))
await ch2.send({ embeds: [e], components:[row] })
}```
@earnest phoenix ayo remove the discord.gg part
Done.
ok ty
what is channels
where is it defined
let channels = db.fetch(`channels`)
let invite = db.fetch(`invite_${interaction.guild.id}`)```
that's a promise
not an object
hm?
channels is a array of channels
in a db
yeah but the db takes time to fetch the channel
so you have to use await db.fetch("channels");
Still the same thing
Check what channels is
it's not
No the error 
Okay now I just got a new error
New error 
wat
what
ok
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" className="" viewBox="0 0 512 512">
<path d="M188.8 255.93a67.2 67.2 0 1067.2-67.18 67.38 67.38 0 00-67.2 67.18z"/><path d="M476.75 217.79v.05a206.63 206.63 0 00-7-28.84h-.11a202.16 202.16 0 017.07 29 203.5 203.5 0 00-7.07-29h-155.4c19.05 17 31.36 40.17 31.36 67.05a86.55 86.55 0 01-12.31 44.73L231 478.45a2.44 2.44 0 010 .27v.28-.26a224 224 0 0025 1.26c6.84 0 13.61-.39 20.3-1a222.91 222.91 0 0029.78-4.74C405.68 451.52 480 362.4 480 255.94a225.25 225.25 0 00-3.25-38.15z"/><path d="M256 345.5c-33.6 0-61.6-17.91-77.29-44.79L76 123.05l-.14-.24A224 224 0 00207.4 474.55v-.05l77.69-134.6a84.13 84.13 0 01-29.09 5.6z"/><path d="M91.29 104.57l77.35 133.25A89.19 89.19 0 01256 166h205.17a246.51 246.51 0 00-25.78-43.94l.12.08A245.26 245.26 0 01461.17 166h.17a245.91 245.91 0 00-25.66-44 2.63 2.63 0 01-.35-.26 223.93 223.93 0 00-344.19-17.4l.14.24z"/>
</svg>
This is for Chrome Logo, I found this online
but lets say I have a custom SVG for which I want to get Path
how can I get that
why would you want to do that
i get this error when embeding a image but when i refresh discord the image is displayed correctly, what could be the cause for that (im using java with jda)
try {
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
ImageIO.write(createImage(user), "png", bytes);
final User dev = event.getJDA().getUserById(Env.get("DEV_ID"));
final EmbedBuilder embed = new EmbedBuilder();
embed.setTitle(user.getNickname())
.setDescription("_Have a llamazing day!_")
.addField("Work", checkCooldown(user.getWork()), true)
.addField("Sleep", checkCooldown(user.getSleep()), true)
.setThumbnail(event.getUser().getAvatarUrl())
.setFooter("Created by " + dev.getName(), dev.getAvatarUrl())
.setTimestamp(Instant.now())
.setImage("attachment://alpagotchi.png");
event.replyEmbeds(embed.build())
.addFile(bytes.toByteArray(), "alpagotchi.png")
.queue();
} catch (IOException error) {
LOGGER.error(error.getMessage());
}
so im using ByteArrayOutputStream to create the image and sending it as a bytearray to discord, but for some reasons it fails sometimes
im using the ByteArrayOutputStream because i want to keep the image in memory and dont want to save it on the local disk, could there be another way?
Hlo
Hi guys
, is there any bot who count all unverified members as fake invites?
I didnāt found anything, thatās why Iām askingā¦
there i even put the search link
if you're not going to help, why are you answering at all?
huh he literally pointed you to a link where you find your desired type of bots
My question is precise, I donāt see this function in these bots
my man just explained all of discord in one sentence
well you'll have to look for the bot yourself
top.gg can only give you a list of bots to see
Very helpful community indeed
true
Holy shiet why is MDX so hard to use
Absolutely terrible developer experience
What MDX should do is transpile markdown to a react component. It tries to do too much
You're looking for a bot that counts all of all unverified members as fake invites?
He left... 
What
What
What
What
What the fuck?
Ayo, language.
I'm trying to make a button that update's the ping, did I do something wrong?
yes
Although, how am I supposed to set the ping of the edit in the embed, you need to wait for it to be done.
you're measuring how much time it takes to generate an embed object
which is 0ms
you have two options:
either measure the ping of all messages, and just send the latest one
or send a temp message/update to measure, then update again with the result
I'm trying to do this...
Although, I got confused at it.
I understood it at first, then I got confused when coding it.
let before = Date.now();
await interaction.edit("calculating");
let time = Date.now() - before;
await interaction.edit(time);
Date.now() is the same thing as new Date().getTime()
but shorter
Let me try now.
#include <iostream> #include <cstdlib> using namespace std; int main() { int a; cout << "Pls Enter an Integer (from 0 to 9): "; cin>>a; switch (a) { case '0': cout << "Zero"; break; case '1': cout << "One"; break; case '2': cout << "Two"; break; case '3': cout << "Three"; break; case '4': cout << "Four"; break; case '5': cout << "Five"; break; case '6': cout << "Six"; break; case '7': cout << "Seven"; break; case '8': cout << "Eight"; break; case '9': cout << "Nine"; break; default: cout << "Invalid character"; } return 0; }
Although the first part of it worked, it didn't for the other half.
Error [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.
at ButtonInteraction.update (C:\Users\HamoodiHajjiri\Desktop\Rewrite\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:202:46)
at InteractionCollector.<anonymous> (C:\Users\HamoodiHajjiri\Desktop\Rewrite\src\slashcommands\utility\ping.js:90:60)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'INTERACTION_ALREADY_REPLIED'
}
I can't use .update() again.
Please use https://sourceb.in/
always giving default statement output https://sourceb.in/HY0pcSgYmV
you defined a as int
but your switch cases are checking for chars?
case '6'
shouldnt it be case 6?
oh thx
a is an int, using ' is for char literals
working šÆ
uwu
can some one explain how on earth this happend
this is the code
function OK(message) {
log(message)
console.log(chalk.green("[ OK ]: ")+message)
}
bot.on("ready", () => {
console.log(`${OK}${bot.user.tag} is online!`);
});
yeah but when i have it asconsole.log(OK) it did the same thing
wait
nvm
im dumb
thats dumb
yeha i just relised
i just remembered it worked when i tested it before and then this was me implamenting it into my bot
and i did it wrong
function OK(message) {
log(message)
console.log(chalk.green("[ OK ]: ")+message)
}
bot.on("ready", () => {
OK(`${bot.user.tag} is online!`);
});
works now

I sometimes wonder how I miss these things
i made the thing my self and i forgot how to use it
I've done cryptography ciphers in Rust and I have no clue how they work
It's okay, you just forget about it after a while
I forget existence
Is there a way you could get bot.ws.ping but each is different value? (I'm doing this for my ping command when you refresh it via a button)
bot.ws.ping is updated whenever discord.js receives a heartbeat packet
which is every 45 seconds normally
also bot.ws.ping is the average ping of all shards
if you want the ping of a specific shard, its bot.ws.shards.get(shardid).ping (only if you're using internal sharding, aka shards:"auto")
Although, I can't refresh it when a button is pressed.
This is my code: https://sourceb.in/N5SPD6VqrB
you can manually call the websocket ping function
What?
Could you check the code? I think the way I did was also good but it would not update.
i have not tested, but according to the docs this is how a manual websocket ping would work:
const socket = client.ws.shards.get(shard_id).connection // or client.ws.shards.first().connection if you only have one internal shard
const now = Date.now();
socket.once("pong", () => {
const time = Date.now() - now;
// do something with time;
});
socket.ping();
alr so
i'm trying to now make a bot with discordjs
how the fuck do i add commands
with discord.py its
@client.command()
async def command_name(ctx):
#do shit```
moeq
discord.js does not come included with a command handler
oh
you have to code it yourself
make command handler
how the fuck
true
its easy
@spark flint want me to send a template?
btw
as long as its easy
here
k
check out the guide
it has the code in there too
do you wanna do it with slash commands or over normal messages @spark flint
or both
idk
normal messages
check out the v12 guide then
its for v12 and therefore not up to date
but the v13 guide only shows you how to use slash commands
so you have to use the v12 guide
but the code in it should still work
bunny dms
ok
this is probably the code you need
mee6
lol

just make sure you have a commands folder
yeah
that is gonna get really ugly if you do it in djs
its better if you split ur commands into multiple files
doing it all in a single file is very hard to maintain with djs
nya has over 50 files or something like that
make sure you got the latest nodejs version
you need nodejs v16 or higher
for discord.js v13 to function
npm install discord.js@12.x.x
ah i have node 14
lol
skill issues
discord.js v13 is better
since you can customize caching with caching options
thus reducing memory usage
still high since its djs but its still an improvement compared to v12
its better than dpy cause dev for that just said fuck dpy im out EoL rn
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILD_MESSAGES] });
client.once('ready', () => {
console.log('Ready!');
});
client.on('message', message => {
if (!message.content.startsWith("f!") || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'ping') {
message.channel.send('Pong.');
} else if (command === 'beep') {
message.channel.send('Boop.');
}
// ...
});
client.login("MY TOKEN");```
what did i do wrong
@covert gale 
uh gimme sec
use my template.........
just add new commands simple
also to prevent crash in the config folder add new commands folder name and add emoji otherwise crash
you didnt define prefix?
ah
got it working now
kek
lel
Tim quick question (or anyone else who is there)
const siteTitle = title ?? content.title ?? 'Astro'
is this valid javascript
lol
are you allowed to chain the ?? together like this
it is like soft and hard (false) (undefined)
for most cases ?? is actually the correct usage, its just || was the only way to do it for so long that everyone still uses ||
The reason is semantics, let's say the user provides some option, and you want to assign it to a variable, or if they did not provide anything, set it to a default value:
const option = selectedOption || 256
But what if 0 is a valid option? Before you'd have to explicitly check if selectedOption is undefined or null
now you can use ??
I know it strictly checks null, but more often than not, I find it literally useless unless dealing with numbers which is less often than I need to use logical OR
same, i dont even bother using it for the cases it's made for either
I guess it kind of depends on your usage, but I use ?? maybe 5/6 times
im not a big fan of writing bleeding edge code that only works on the latest versions
Unless its ts you can transpile to older ECMA versions
thats exactly what transpilers will do, convert all your ??s to ternaries and shit
so i rather just write the end code myself lul
let a = Number.isInteger(b) ? b : 1
yes but ts compiler isn't so intelligent
let a = 0 !== null ? 0 !== void ? 0 : 1 : 1;
thats why i dont use ts
checking if the value is not null and undefined is mooost likely faster than using that method if that's your argument
ok i need help again
getting Command raised an exception: Forbidden: 403 Forbidden (error code: 50001): Missing Access
but the bot has full admin
If i use express in a server with apache2 reverse proxy.Do i have to configure any settings for express.Since i use a ratelimiter pkg,which ratelimit global.
uuuuum what
TypeError: Cannot read property 'Symbol(type)' of undefined
const files = await fs.readdir("./cmds", { withFileTypes: true });
so i want my website link to preview in discord with the image that is on the site. how can i do that?
I think you need to use og:image as metadata
I know they use parts of the open graph protocol
full error pls 
i got this atm but it doesnt work
So you cannot deconstruct methods from objects because they lose the this context and it becomes undefined
I feel like typescript should warn you in cases like these
that was literally the entire error
took me a few mins to figure it out
does anybody know how to fix that
How i make this colourful text
Actually not⦠SQLite is perfect for you needs and easily scalable if you have to move over to MariaDB (MySQL) later on
```js
let thing;
```
Markdown code blocks -> syntax highlighting is what you need
@oblique mist
Bro please make me a text in red
Pls make this
In red colour
There has been one mentioned alreadyā¦
Ok air
My gosh
Sir
If you wanna make it red then take a look into syntax highlighting by googling it
Thereās no other reliable way to colorize your text
can someone help
Is it a complete HTML code or only the head element?
Also Discord sometimes doesnāt wanna fetch images from unknown sources like private domains
Try a different image from a public source like Discord itself or Imgur for example
Also if thatās your domain then check the logs if Discord actually tries to get the image from your server
If so check the status code
it isnt private
its everything thats on the page, is that a problen?
Yeah itās no valid HTML document then
And the domain isnāt a public one
(known)
But you first gotta fix Your html code
how isnt it public?
or known
and how can i make it public/known?
@boreal iron
do slash commands have some way to input datetime parameters
like a date picker or something
Please keep the order.
First fix your HTML code, try again if the image now shows up, if not choose a public known image hoster like Imgur and test it again
Also try to post the image URL in discord manually before using it in an embed
That worked for me in the past if images didnāt show up before
But anyways the code is your issue in the first place
also because there are several meta tags
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="img url"> <meta name="twitter:image:src" content="img url"> <meta property="og:image" content="img url">```
that works for me
How could I get the IDs of the rest of the people interested in the event?
And if I do make a request to the API, does the bot need to be in the server?
I am assuming it has to do with sending some sort of request, but not too sure abt it
He already has that, just take a look at his image.
But his code is no valid HTML document.
Discord may doesnāt like that.
?
ah i see
the image url works tho
wait
am stupid
the html looks valid 
Itās not
oh no <!DOCTYPE html>
HTML doesnāt begin with head tags
<html>
<head>
<title>crab.jpg</title>
<meta property="og:title" content="crab.jpg" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://cdn.luckiecrab.nl/crabimg.jpg" />
<meta property="og:image" content="http://cdn.luckiecrab.nl/crabimg.jpg" />
<meta property="og:description" content="CDN for luckiecrab.nl" />
<meta name="theme-color" content="#FF0000">
<meta name="twitter:card" content="summary_large_image">
</head>
</html>
thats their full code
Hmm maybe⦠canāt view the source code on mobile
If that doesnāt work after posting the image manually in Discord then picking and trying a public image hoster is the next step
Also the links arenāt the same than in his screenshot
The protocol is different
Is this possible??
don't think so
oof
The protocol is HTTPS not HTTP
both works
that worked
CDN for luckiecrab.nl
@timber fractal ^^
<html>
<head>
<title>crab.jpg</title>
<meta property="og:title" content="crab.jpg" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://cdn.luckiecrab.nl/crabimg.jpg" />
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="https://cdn.luckiecrab.nl/crabimg.jpg"> <meta name="twitter:image:src" content="https://cdn.luckiecrab.nl/crabimg.jpg"> <meta property="og:image" content="https://cdn.luckiecrab.nl/crabimg.jpg">
<meta property="og:description" content="CDN for luckiecrab.nl" />
<meta name="theme-color" content="#FF0000">
</head>
</html>```
oh speaking of image hosts, working on gif's from random images 
yep
nice 
How would I send a request to this? I haven't done raw requests like this so I'm not too sure
some libs have custom routers
i was looking at d.js but it seems like they dont have this yet
Djs' is a proxy like
client.api.guilds[guild_id]["scheduled-events"][guild_scheduled_event_id].users
otherwise, if you have a way to make an http request with a path, it'd be /api/v9/guilds/:guild_id/scheduled-events/:guild_scheduled_event_id/users
unless the method that's exposed prepends /api/v9
yeah i dont have a way to make the http request 
when using the djs router, you need to call .get() at the end as well
you can also pass query params to the options object
.get() returns Promise pending
i made the best discord api router
tim helped
he did the hard part
line 15
how come it prints 203/380

there r 383 actually now, but in total thats how many ppl clicked the interested button but only 203 printed out
acc nvm found it
ah i realized
the query is set to default at 100
anyway to change that to 380? (nvM)
Can someone help me come up with a leveling system? I absolutely suck at math.
set xp requirements for each level
and generate a random number between a range to determine how many points some user earns for something
e.g. sending a message
and bam now you have a leveling system
personally I think most/all of them suck
Mmmm
Setting an xp requirement is annoying for the kind of xp system I wanna make
I'd rather see a points system like Points where you can assign and earn points through specific activities defined by the server and spend them on items
I don't want there to be a level cap
It's going to be earned randomly when using the bots commands
But I wanna make an infinite level system
then you can just do the generation part
and have some algorithm for what level the user is at
like exponential levels most bots deploy
Mmmm
That's the tough part for me cause that requires a lot of math and I'm not good at math š©
hmm
So when you mean exponential levels, do you mean like using an exponential growth formula?
yes
so like
f(x) = a(1+r)^x
gotten from google btw
depends on what you wanna do and assuming position 0 in the array is a string then sure
alright then yea that should work
you could shorten that tho
actually
idk if it would work in practice
my thinking is you could probably do if(!args.includes(blah)) but now that I am thinking about it I don't think that will work since you wanna check for both
:p
so ignore me
mhm mhm
what about it

Just perform simple math then
methmetiks
Like growing the xp by 50% for example

Won't growing the xp by percentages like that get too easy at some point
Also, I am trying to make an infinite level system so idk how exactly to determine when they actually level up
Than add the current xp to it
wdym
new xp = current xp * 1.5 + current xp
Dunno why you would like to over complicate such a simple thing
listen here
I suck at math and so my brain isn't as big as urs when it comes to calculations and coming up with calculations
Ok but the upper example is easy, isnāt it?
Multiply it by 2.5 already >:D
But how do I determine when they actually go up a level
that is just calculating new xp no?
By storing the level and xp of course
They're probably saying to do not and instead
That makes me even moreconfused
reeeeeeee
my monkey brain knows this is simple yet still doesnt understand
Yeah correct, not or not is logical nonsense
Well things require a lot of effort, they donāt work magically 
If you wanna store any information persistently you will need to deal with a database
no?
I dont think you understand what I am trying to ask
I know how to store things
I dont know how to determine how to go from level 1 to level 2 when the levels are infinite so there is no xp requirement per level like klay was saying
well, that works too, but literally all you had to do was use && instead of ||
the amount of xp required for the next level is the amount of xp required for the current level multiplied by something
But with an infinite level system how do you know the required amount for the current level
say you start out at level 0
you can come up with a formula that only uses the level and nothing else, like current level multiplied by some constant
how do you determine how much you need for level 1 and then 2 and 3 and so on
there are a million different formulas for that kind of thing
this is exponential
for a lot of people, exponential is too steep, but if you like it, just use that
š¤
So, can you give me an example of how this could work
I assume that the number in the exp method is the level right?
do you reset exp on every level up?
and the result is the amount of xp you need for that level
or is the xp cumulative?
I think the xp will be cumulative
yes
Makes sense
What do you think would be a good amount of xp to add to a user?
Essentially the idea is you get xp randomly when using one of the commands in the bot
but i don't wanna make it super easy to jump from level 0 to a higher level
heres a few examples of different exp curves
depends on what your base xp is
for example, lets say you are level 1
Math.exp(1) = 2.something
thats very low
literally 2 xp
if you want it to be like, 100 xp required
you can do Math.exp(1) * 50
so then instead of 2 xp, 100 xp will be required
then for level 3, instead of 5 xp, if will be 250
so just add a multiplier to get the desired range you want to work with
I think 50 is good
just keep in mind that exponential growth leveling is usually used together with exponential reward increase
like, the higher level you are, the more exp you get
fight higher level monsters etc
The idea behind is at certain level milestones you unlock something else
because level 10 requires literally 10000x more exp than level 2
Ah right
135 xp for level 2
110k xp for level 10
1 million xp for level 10
Yea
so its not a very good system for messages for example, if messages always give the same amount of exp
My idea behind the infinite leveling system was at certain level milestones you unlock something new in the bot
but I am not even sure if that is a good idea anymore
Yea
I am just unsure anymore aha
Cause then I have to go in and code those milestones
which can be tedious since it is infinite
Just use the modulo to check if a level is a potential of 10 for example to dynamically create milestones every 10 levels
_arrr thx auto correct _
what fake said
if(currentLevel % 10 === 0) { 10 levels milestone reached }
if(currentLevel % 25 === 0) { 25 levels milestone reached }
I mean milestone names, icons etc. can be random
That would be tedious still no?
also, here's a simple leveling formula with a more moderate growth curve
Math.sqrt(level) * level * 100
that's 100 xp for level 2
3000 exp for level 10
approximately
That is a lot better
That is the thing
I dont know exactly how much to give per command use
random number between 1 and 5?
since I don't want to make it impossible to level up when they start getting higher levels
In your case i would calculate the xp by the content length
think about how many messages you want people to need for them to level up at certain levels
if its approx 10 xp per message, then its 10 messages to level 2
28 messages to level 3
51 messages to level 4
etc
meaning, 18 messages from level 2 to level 3
Its not per message though
I want it to occur randomly when using the command.
every other command usage should give xp
alright then if there is a 50% chance of getting 10 xp
/command - no xp
/command - get xp
There will be a cooldown for the command
cooldown is not relevant for this
I mean yea, but if wass is worried about spamming to gain levels it won't matter.
there will be cooldowns
just think about how many exp-worth instances of an action the user needs to do to achive x levels, and think if you like that amount
I like the 50% chance of 10xp
if you think its too little or too much, adjust your formulas
How would that formula look? would it essentially be what you were doing with Math.sqrt?
square root is kinda the opposite of exponential
true
instead of the amount increasing with increasing base, it decreases instead
and also when the level gets to a certain point won't you need to raise the amount of xp gained from 10 - something
so the difference from 1 to 2 is bigger than the difference from 2 to 3
ouch my brain hurt with that statement
so i added another multiplier to correct for that
so it turns into a slight increase instead of decrease
just write a loop that counts to 20
and make it log the xp for each number
and tweak it until you like the numbers
for example
i is the current level
ya
tweak the numbers around it, and see how it affects the growth curve
in the above example yes
and what is the 50 again?
another multiplier
to adjust how big you want your numbers to be
ie if you want exp to be 100,200,300 or 10000,20000,30000
I see
That makes a bit more sense
so I could do
if(currXp < (Math.sqrt(currLevel) * (currLevel+1) * 50)) {levelUp()}
yup
also what is the point of the +1
another way to give you more control
Ah
if you increase it to +2 or +3 it wll slightly increase the overall exp requirements
if you reduce it to -1 or -2 it will decrease it
with +3 5k is the req for 20
Makes sense
I like that
So I also wanna ask for advice on how to handle the milestone stuff
I noticed you guys say use modulo right?
so you can give them rewards every 10 levels
for example, the difference between i+1 and i+2 is 50 exp at level 1, and 220 exp at level 20
I see
yes




