#development
1 messages ยท Page 1944 of 1
Hello, is it possible to do example / mod tempmute and the custom suite will be different from / mod kick for example?
Can a collector be made in a DM Channel?
Like this:
when a user joins a server, the bot DM's them a embed asking to send a SS of the invite they used.
then they send a attachment
*sends attachment*
attachment gets sent to a channel?
Mainly can a collector be used in DM's? ๐คฃ
you cannot sent stuff directly like that with v13
.send() expects an object of options, something like { content: "abc", etc }
a MessageAttachment is an object
so its trying to find attachment.content, attachment.embed, attachment.files, etc
which of course do not exist
you have to specify that you're sending an attachment object
.send({ attachments: [reply] })
put it in files instead
{ files: [reply] }
but actually, if you have the url, why not just send the url directly?
if its an image, discord should automatically embed it
Why do that lol
You can get the invite they used on join
Instead of making them verify
How do you do that o-o
If I just run my tiny express script it works flawlessly, but if I use pm2 to start it, it starts and logs 1 thing but doesnt respond to requests anyone know why?
tf is wrong with pm2 lol
Now this doesn't work :why:
client.on('GuildMemberAdd', async member => {
const verify = new MessageEmbed()
.setAuthor(`Staff Verification`, client.user.displayAvatarURL({ dynamic:true }))
.setDescription(`Please send a **image**/\`attachment\` of who invited you. You will need to do this to get access to the rest of the Staff Server. `)
member.send({ embeds: [verify] })
})```
Discord.js v13 is so much different for these index.js events lol
Not sure if that would work but sure? I alr have MessageEmbed defined.
Nope ๐คฃ
whaaat
why would I even do that?
confusion
That didn't work.
Fixed, I just had "guild" Capitalized.
guildMemberAdd works.
yea its guildMemberAdd not Guild ๐
Well, ik now
how long have you been getting it? just pushed an update?
500 errors are server side errors, might just be discord problems?
if you are doing these tests on a test bot then I would wait a few hours and see if they go away.
If you are testing on your main bot I would revert the changes.
ah, then I would just wait tbh.
Hello, is it possible to do example / mod tempmute and the custom suite will be different from / mod kick for example?
Can I make it so it only sends the welcome embed if they join a specific server using guildMemberAdd?
just check the guild id
huh
How in a event?
like if(member.guild.id === '') {...}?
wait no cause I have it set as message, so it would need to be in a server huh?
Heya! I was wondering is it possible to use Spotify Web Playback sdk with discord.js to play songs directly from spotify in a voice channel?
guildMemberAdd doesnt give you a message.
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildMemberAdd
possible, yes. I don't think its common due to spotify having a pretty expensive api for playback(iirc)
wut?
I see
Thanks for the reply!
As I see it, that api is currently available only for Spotify premium users
๐ am I mis-remembering.
is it spotify that only gives metadata
I cant keep track
nah, my wut was for noah, but my internet decided to fart so it sent late
ah
very thankful with my 200/20
even if the 20 up sucks
Mine is 150/220 LOL
Why does .sendTyping() stop typing after like 10 seconds?
Because that's whats supposed to happen?
yeah, it stops exactly after 10 seconds or a message is sent
if you want to do so for longer best to use a slash command and defer update.
but you technically can(best not to do it more than a few times)
send a message is the only way I know of
files.map is not a function
bruh
files is defined but it's not an array ig
try console.log(this.options.files)
show search.js line 17
Whats the best way to make a transcript of a particular channel?
catch the error from .send()
SELECT
rooms._id as _id,
rooms.title as room_title,
rooms.votes as room_votes,
rooms.topic as room_topic,
rooms.banner as room_banner,
p.nsfw as playlist_is_nsfw,
pe._id as playing_entry_id,
pe.title as playing_entry_title,
pe.description as playing_entry_description,
pe.nsfw as playing_entry_is_nsfw,
owner._id as owner_id,
owner.name as owner_name,
owner.picture as owner_name,
owner.premium as owner_premium,
owner.created_on as owner_created_on,
guild._id as guild_id,
guild.name as guild_name,
guild.picture as guild_name,
guild.premium as guild_premium,
guild.created_on as guild_created_on
FROM rooms
INNER JOIN playlists p on rooms.active_playlist = p._id
INNER JOIN playlists_entries pe on rooms.playing_now = pe._id
INNER JOIN entities owner on owner._id = rooms.owner_id
INNER JOIN entities guild on guild._id = rooms.guild_id
WHERE
rooms.owner_id = $1 AND rooms.active = true
LIMIT 1;
so somewhere in this something is wrong
I suspect the last 2 joins but 
-->>
Finally fixed the bugs in the little module i wrote earlier that convers md files into embeds for discord.js ๐
if anyone wants to play with it: https://www.npmjs.com/package/dekita-md-embed
looks a bit different from md tho
you could name it something like embed-down
xD
yea, its not really markdown syntax supported i guess, not for the most part
but if you use the format shown in the template, and save it as an md file, you get syntax highlighting etc, so...
yeah
and can use markdown style links in descriptions and stuff, so highlighting on that is nice
there are actually many markdown "flavors" out there, although they all share the same basic markdown syntax, some have different features
so you could just make it another flavor
embed-flavored markdown
mark-the-bed-with-discord---js
hahaha
nice
so at boot i scan the dir for all md files, and use that as the choices for the command
so all i need to do now is write up whatever info files i need following that template
and i can pass whatever variables in to the template as shown
handy af imo
tbh this is the most useful/creative/good-idea lib i've seen around here in a long time
im usually like "but... why..."
thanks lol ๐
yea most things are pointless or just derivatives of other projects that arent as good ๐
ye
i've been debating releasing my discord.js minigame module for years now
recently updated it to support buttons instead of reactions
but idk, i like to hogg the good code ๐
i have one critique tho
besides the different syntax
i'd use raw embeds instead of MessageEmbed internally
that way you get rid of the discord.js dependency, and it works on all libraries, not only discord.js
yea i did consider using the message embed object for more flexibility
for that very reason
like, object structure {}
ye
if you really want, you could slap in a formatter
for example embedMD.parse(file, { format: "discord.js" })
and it returns a MessageEmbed instead of a raw embed
optional peer compat is wonky imo
you dont need a dependency for that either, just check if the lib is already installed in the user's project
honestly i much prefer having peer libs manually controlled than just included as a dep
if lib exists in the project, use it, if not, throw an error/warning and tell the user to install it
oh, flagged user, but you get the point ๐
could initialize the lib with a set of options for the user to define
like, global replacers
mmk
then ```js
THUMBNAIL
this.avatar
tbh I dunno when this would be useful, you can just export the embed object in a different js file and import it when u need it
but well, it does get increasingly more complex if you try to support multiple libs or make it lib agnostic
so i'd basically use this as a refernce to gain the globally defined variables rather than the embed specific one?
im using it to reduce the amount i need to type for adding various simple embeds with dfynamic data to my project
Is there anyway to pass data from a event to a React Component?
import {Client, Intents} from 'discord.js'
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_PRESENCES,
]
})
client.on('ready', async () => {
console.log('Bot is ready');
const user = client.guilds.cache.get('id')?.members.cache.get('id');
if(user){
const data = user.presence?.activities;
// Pass it to a component
}
})
client.login('token')
@willow mirage What are you trying to accomplish?
Are you trying to run a discord bot in the browser, do oauth2 with Discord or have your bot running on a server send a websocket event down to a frontend react client?
if you want to send websocket events to the browser, you need another websocket in the browser
otherwise you'd need to queue events and run an update query in a interval in the browser
Keep on trying mate
Backend <-> frontend communications can be hard.
Kinda all depends on what you need. If you just need to have all the users presence listed on lets say a Web UI, there is a few ways you can do it
You could spin up a http server on the same instance as your bot, and on frontend page load you ask the http server on an endpoint for the presence data
db.set(`warnid_${message.guild.id}_${number}`, `${uuidv4()}`)
``` Why does that return "null"?
Yo, Not sure what lib you are using, but just asking a few question for clarification
Where is it returning null? The return of db.set function, when you fetch the data from the db, or one of the two args?
What is the console.log of:
console.log(`warnid_${message.guild.id}_${number}`)
console.log(`${uuidv4()}`)
Is the record added to the database?
Discord.js is fetching every channels at startup. The ChannelManager cache is filled with more than 200 000 channels! It takes time and fill the RAM with data I don't need. It seems that I can't disable this cache in the client option. What can I do?
I've encountered an interesting problem... I want to generate a random number from 0 to x, but I want a few numbers to not be possible to be generated. I really care about performance here, so for example generating a random number until it's not one of the forbidden numbers won't fly.
I've thought about doing something like this:
const fobiddenNumbers = [...]; // It's sorted
const rng = Math.floor(Math.random() * max);
// Binary search if the random number is in the forbiddenNumbers array
// If it is, return rng + 1
But what if rng + 1 is also inside the forbiddenNumbers array 
Maybe try this from their docs https://discordjs.guide/additional-info/changes-in-v13.html#customizable-manager-caches
const client = new Client({
makeCache: Options.cacheWithLimits({
MessageManager: 200, // This is default
PresenceManager: 0,
// Add more class names here
}),
});
I have never used it before tho. So not sure how/if it works as you expect.
I think this is all the stuff:
makeCache: Options.cacheWithLimits({
ApplicationCommandManager: 0, // guild.commands
BaseGuildEmojiManager: 0, // guild.emojis
GuildBanManager: 0, // guild.bans
GuildInviteManager: 0, // guild.invites
GuildManager: Infinity, // client.guilds
GuildMemberManager: {
maxSize: Infinity,
keepOverLimit: (value, key, collection) => value.id === this.user.id,
sweepFilter: collection => (value, key, collection) => value.id !== this.user.id,
sweepInterval: 600
}, // guild.members
GuildStickerManager: 0, // guild.stickers
MessageManager: {
maxSize: 100,
sweepInterval: 60
}, // channel.messages
PermissionOverwriteManager: 0, // channel.permissionOverwrites
PresenceManager: 0, // guild.presences
ReactionManager: 0, // message.reactions
ReactionUserManager: 0, // reaction.users
RoleManager: Infinity, // cache all roles
PermissionOverwrites: Infinity, // cache all PermissionOverwrites. It only costs memory if the channel it belongs to is cached
ChannelManager: {
maxSize: 0, // prevent automatic caching
sweepFilter: () => channelFilter, // remove manually cached channels according to the filter
sweepInterval: 3600
},
GuildChannelManager: {
maxSize: 0, // prevent automatic caching
sweepFilter: () => channelFilter, // remove manually cached channels according to the filter
sweepInterval: 3600
},
StageInstanceManager: 0, // guild.stageInstances
ThreadManager: 0, // channel.threads
ThreadMemberManager: 0, // threadchannel.members
UserManager: {
maxSize: Infinity,
keepOverLimit: (value, key, collection) => value.id === this.user.id,
sweepFilter: collection => (value, key, collection) => value.id !== this.user.id,
sweepInterval: 600
}, // client.users
VoiceStateManager: 0 // guild.voiceStates
}),
But what if rng + 1 is also inside the forbiddenNumbers array
@cinder patio then how about incrementing the number until it exceeds the max or is not forbidden? Or how about just biting the bullet and retrying the random number? What's the actual performance cost of usingMath.random()andMath.floor, anyway?
The forbiddenNumbers array could contain all numbers except one
So repeating would make the performance depend on randomness, same with the other solutiom but to a lesser extene
const forbiddenNumbers = [4, 40, 100]
const randomNumber = (max: number) => {
const random = Math.floor(Math.random() * max)
if (forbiddenNumbers.includes(random)) {
return randomNumber(max)
}
return random
}
maybe?
Just sudo code, not sure it it would even run ๐
I really care about performance here
I for some reason read it as "I do not care about performance"
disabling some of these caches doesn't seam to be supported
UnsupportedCacheOverwriteWarning: Overriding the cache handling for ChannelManager is unsupported and breaks functionality.
If you don't need guild data, then you can disable this intent and channel caches will not be populated on startup.
Otherwise, you will need to move to a different lib which is less memory intensive or even stateless such as cloudstorm and snowtransfer
the GUILDS intent is required by Discord.js. Do you have any suggestion of a lighter lib? I don't want to rewrite everything
If you want an as close as possible experience to Discord.js,
I've already mentioned a combination of cloudstorm and snowtransfer and this can be combined with https://github.com/AmandaDiscord/ThunderStorm
I'm working on making ThunderStorm more like v13
Then how about an array of all except the random numbers (assuming your range is static and small) ๐
Unless you find some fancy paper describing a random number algorithm for this, I don't see anything except retrying randomness as a feasible solution.
thanks for the suggestion I'll take a look at that. But if I change the lib I'll either choose a fork of Discord.js or choose something completely different (if I have to rewrite my code, I'll take the opportunity to choose a clean base)
If you're getting to the point of needing to micro manage your client's memory state, then you should be using modular libs instead of Discord.js because it caches anything and everything it can
The closer you get to raw socket writing, the more performance you will get, but induce a headache. The libs I mentioned are a nice middle ground
kvm
ws itself has a pretty stupid overhead
net.Socket is what I meant
i wrote my own websocket for my custom lib instead of using ws and the difference is pretty stupid
can you send a link? I'll probably implement it into cloudstorm
Ah hm. Cloudstorm does allow for proxying the gateway connection which could be over http, so this might be fun to implement
i'll publish some benchmarks in the next couple months, but one of the tests i ran was measuring the time it takes from a packet to be received by net until its emitted by client, and over ~1800 GUILD_CREATES my code spent around 500ms combined, while ws took 6000+
God damn
i also got performance improvements for etf
my pure js etf unpacker is about 30% faster than the official native discord/erlpack
do you have a link for that as well
Okay. If you ever make those into standalones, do lmk since I don't exactly want to dupe code or copy/paste
i dont think i'll make the etf standalone, at least not for now
because its a limited subset of the etf spec, i only coded the parts that discord actually uses
if i make it standalone, i'll need to code the entire spec
I'd say that's good enough since they don't pack the entire erlang spec either in erlpack
they cover the parts that js supports
i only cover what discord uses, which is even smaller lel
yeah
same thing with my websocket code
i only coded a subset of the websocket spec
and cut a lot of corners to make it faster
perhaps you don't have to label it as full spec and instead advertise as Discord specific
so long as Discord doesn't dramatically change their communication layer
its pretty modular already
A little bit of a conflict of interest since I maintain all of the WeatherStack modules
i guess
any nextjs nerds here
i want to clear all of my query string on the client side with useEffect but the query string is briefly reverted after being removed
window.history.replaceState({}, document.title, "/");
@woeful pike sorry for ping but im sure you'd be excited to answer this
maybe something to do with dev mode?
You canโt put an object in a parameter expecting a string
image url requires the actual url
not an attachment
meaning setImage requires the actual text value
setImage("https://c.tenor.com/G6DW8l99nKsAAAAC/sakuya-fumo.gif")
Right click the picture and select "Open in new Tab" then copy that url
Or do you mean dynamic
use whatever the search gives you
like
use the url directly
dont create an attachemt
setImage(googleresulthere.url)
@earnest phoenix all you'd have to do is ```js
.setImage(${reply});
lmk if that works
try using message.reply, it's a cool new feature with inline replies
you can also add this to disable the mention ```js
allowedMentions: { repliedUser: false }
so it'd be ```js
message.reply({embeds: [embed], allowedMentions: { repliedUser: false }})
I'm trying to get the body of my HTTP server post request but it's nothing while there is something..
I'm logging with json stringify body
and req.on data
var body = ''
req.on("data", function(data) {
body += data
})
console.log(JSON.stringify(body))```
Also tried logging 'body' itself
Also nothing
I have this as body 'WHtest'
Body is a string
Why are you stringifying a string?
double string
Also, log it after it's done, in the end event
what is reply
can you console log it and send me exactly what it is
console.log(reply)
yeah no of course
just ping me whenever
@client.command()
async def howlong(ctx):
today = datetime.date.today()
d = datetime.date(2021,12,25)
diff = d - today
embed = discord.Embed(title="How long until Christmas?", description=f"{diff.days} days!", colour= 0x003DFF)
print(str=(embed.colour))
print("triggered.")
await ctx.send(embed=embed)
I have a embed here and it works but its not changing the colors nor is it printing the color.
what are the aspect ratios supposed to be for these images?
https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
thumbnail is 1:1 i think
I doubt the option colour is British English here tbh, try color=0xffffff instead
Nobody actually uses fucking British English
But idk the py library, just assuming
Both work
both color and colour works
well the discord.py documentation says both work
Haha lmao
also colour works on another embed I have
Is it because of the whitespace between colour and the hex code?
i'm not sure
Idk py, too so try it at least
I'll try and run it without it but I doubt thats the issue
Wow that actually fixed it tysm
i also had to pass the print as a string
what causes this?
this is my bot that pings mc servers and changed channel names to weather they are up or not
it pinged on server said it was down and tryed to edit the channel and got this error
is there a way to fix this or is it just my internet being crap?
and if so would just catching the error on the channel.edit be enough to stop it from crashing
likely yes, to both
ah cool
what is the Discord variable?
console.log it
or show where you define it
{ abc } = require("something")
is the same as
require("something").abc
you are doing { Discord } = require("discord.js")
which is the same as doing this
const Discord = require("discord.js")
Discord.Discord
there is no Discord.Discord
a ok thank u
there is no Discord inside the exported variables
can you do .catch when you fetch a channel? cuz if my internet is gone then i guess that will error too
you can .catch anything that returns a promise
ah fair enough
likewise anything that returns a promise does so for a reason, and usually the reason always involves a risk of failure
so unless you have full control over what the promise is doing, you should probably be catching ALL promises
i have been lazy at that tbh but im trying to make the bot so everything it cought and delt with so it wont crash
i just wish there was a "if there is an error anywhere just log it and move on" function i can make so i dont have to type out a catch for everything
that would be espesually useful when dealing with ytdl- core cuz that spews errors out everywhere since google is mega annoying
still never got my music player to work but there seems to not be any real documentation on how to get crap to work so i just gave up in the end
Personally I havenโt had many issues with ytdl-core
it not ytdl thats the issue is google breaking the api every month
and that causes ytdl to error and crash the whole program
also to clarify the reason i cant get music to play isnt due to ytdl either i just cant fined any mention of how to get audio to work with d.js v13 other than "heres how you joijn a channel you can figure the rest out"
anyway must sleep
streaming audio seems to cause so many people so much issues, is it really that complicated?
djs v13 did complicate stuff a little bit by separating audio from the core
since now people have to manually control it instead of most of it being automatic
and on the lower level audio is indeed quite complicated, discord is very demanding in regards to audio formatting, encoding and encryption
yea, audio can get really complicated
I've written a few audio visualizers in js
like, it can be easy once you understand how it flows
but when getting into it, it is quite the pain lol
im still pondering whether or not i'll make an audio module for discord
since i dont use audio myself
oh? for what purpose? just ease of use?
for my discord lib
fair lol
I've been enjoying my shiny new module that i wrote ~ even if others dont see much point in it, its super helpful for me ๐
was thinking of cleaning up some of my other things and publishing that
nice :)
i'd kind of like to have a standard project that i can clone for bot related projects that lives in a docker container, along with other containers for a bot website, system metrics, routing, etc
Stop extending the todo listโฆ
Finish something!!1!
Life time is short, boy

hey im trying lmao
those are all things i already started long ago
and never finished
...it shouldn't
probably not
perhaps you should provide some more code
because that 1 line is not the problem
well that's why
you're getting 3 results
Why not
Shouldnโt the message option be attachments instead of files?
Ahh alright
You should post an embed with the url to the image file set as the image url
Don't download anything you don't have to
No. files array is for when you have Buffers of files
message.reply({files:
That's using files
No I didn't sorry. The one you linked should be correct
I thought you linked to the files one
That's not a valid image url sir
Note how it didn't even appear the gif embed
https://c.tenor.com/6VVh7C5NzUcAAAAC/horse-hi.gif
This is the url
Idk, it's the gif from that url u sent
interesting naming conventions
Idk, what's the payload you get?
(payload = the returned json/xml/whatever from the api)
Only the link?
Like, nothing more?
Transfer ownership
I think so
hey is there a way using node so that if someone clicks specific text in the console it gets copied to clipboard?
I think that would require a special terminal interface instead of just the basic terminals shipped with the os since there are no events when a user highlights text or when the curser goes to a row and column in the terminal afaik. Although might be worth looking up if you can get the cursor position
you can embed with that link as well
I just tried
Only reason it didn't appear is cause I think he bolded it (just checked bolding an image url makes it not embed)
You can try just sending the image url itself
without bolding
Noice
im getting TypeError: Right-hand side of 'instanceof' is not an object
when trying to add a command to a collection (im using eris)
my code is
require('dotenv').config();
const Eris = require('eris');
const client = new Eris(process.env.BOT_TOKEN, { intents: ['all'] });
client.commands = new Eris.Collection();
const fs = require('fs');
[...]
const commandFiles = fs
.readdirSync('./commands')
.filter((file) => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.add(command);
console.log(`Registered command : ${file.replace('.js', '')}`);
}
[...]
the Collection.add probably is what checks if the passed reference is an object. You might want to log the value of command before it's added and make sure it's an object
you might be passing undefined on accident
im getting { id: 'ping', execute: [Function: execute] }
and it goes on for the other cmds etc
do you have any undefined entries, or something similar?
no, i just retried and commented other commands leaving just ping
this is all the code for Eris's Collection class, at some point you're passing something that isn't an object into it
Are you logging the commands before or after you try to add them?
If you're logging after, log before instead
im logging before
[...]
console.log(command);
client.commands.add(command);
paste what it logs in here
The same thing happens with discord gif picker
Registered event : messageCreate
Registered event : ready
{ id: 'ping', execute: [Function: execute] }
/Users/.../node_modules/eris/lib/util/Collection.js:60
if(!(obj instanceof this.baseObject || obj.constructor.name === this.baseObject.name)) {
^
TypeError: Right-hand side of 'instanceof' is not an object
at Map.add (/Users/.../node_modules/eris/lib/util/Collection.js:60:18)
at Object.<anonymous> (/Users/.../index.js:29:18)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Node.js v17.3.0```
interesting
if you try it on a pc it shows tenor.com/kdlskwndndnsn.gif urls instead of c.tenor.com or tenor.com/view
seems like you have to pass in the base object when creating a collection in eris
(Perhaps?)
just use a djs collection
class Command
then when inserting do new Command(command)
my cmd code is just
module.exports = {
id: 'ping',
execute() {
return;
},
};
make a class called Command that defines what properties the command can have
yup
into objects
your nickname is a lie
*can't
.-.
Seems like Eris' Collection class expects you to assign the baseObject property first, but it's meant to store instances of classes that follow the format of
ClassName {
id: string
}
I've been stuck on this for hours and am gonna... How do you remove a rich embed from a message when you edit it with python?
baseObject is supposed to be an typeof Class and add expects an instanceof Class
the new Array of embeds you supply to edit will be what shows up on the message
But i want to clear the rich embed completely
Then pass an empty array of embeds
he tried that once
I've tried embed=None, embed=[], embeds=None, embeds=[]
then you need to make a raw request patching that message supplying an empty array
or stop using python
I have no idea how to make a raw request but at least i've got something to go on now 
Idk either since I use JS, but gl
alright figured it out, should know in a min if it works
Okay this is what i've got so far... I have no idea what i'm doin
data = {"content" : "message content", "embeds": []}
patch_url = "discord.com/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}"
result = requests.patch(patch_url, json = data)
what is my webhook id and token 
what the hell
how do you expect to be able to fix anything with code like this
use variables my man
have you checked what the size of message.guild.channels.cache.size is
Am in starting Trouble
In Database am adding a userid with so an so time like reminder.
So for particular Interval it should send message to user DM. Unfortunately am stuck over there. Can somebody assists me with reminder on ready event if possible
@quartz kindle Took your advice and added global replacers to my module/lib/thing, and then also uploaded some spiffy documentation for it all (https://dekita.github.io/md-embed/). hopefully dont need to touch it for a while now ๐
POV someone leaked top.gg source code
bruh don't scare me with pings like that
lmfao
I'm doing a post request via php but it just returns bool(false), what did I do wrong?
$url = "noneofyabusiness:69420";
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: text/html',
'content' => "EN".$lastArg
)
);
$context = stream_context_create($opts);
$result = file_get_contents($url, false, $context);
print(var_dump($result));```
To my knowledge, it isn't even sending the request
I want to send a text/html body to the server
So discord has introduced timeout/server mute,i was wondering how can i timeout someone using discord py anyone has any idea?
How to make reactionrole with discord.py
@bot.command()
async def reactionrole(ctx):
msg = await ctx.send("reactionrole")
await msg.add_reaction('๐
') #and stuff...
on raw reaction add, check message ID and emote
How can i get the date of when a user was banned in djs?
v13 or v12?
cant wait til' u see my messy code

why would i
if it works
it works

but it works
give me a sec
good luck cleaning that code ;)
my code:
<div class="form">
<form method="POST"><label for="tag">Your discord tag.</label><br>
<input type="text" id="fname" name="fname" placeholder="@dream#6262" required><br>
<label for="fage">Your Age [optional]</label><br>
<input type="number" id="fage" name="fage" min="13" max="20" placeholder="13"><br>
<label for="fwhymod">Why do you want to become a mod?</label><br>
<input type="text" id="fwhymod" name="fwhymod" placeholder="I want to help the server!" required><br>
<label>If there was someone who was breaking the rules and ignoring warnings what would you do?</label><br>
<input type="text" name="test" placeholder="i will kick him." required><br>
<button type="submit">Submit</button>
</form>
</div>
whenever i press submit button req.body gives undefined
router.get("/chmod", (req, res) => {
res.sendFile(path.join(__dirname, "../pages/chmodform.html"))
})
router.post("/chmod", (req, res) => {
console.log(req.body)
})```
you need to require body-parser
2 secs i'll get the code i use
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(bodyParser.raw());```
that works and then you can do req.body.fieldname
ive tried that but i still get the same error
my BaseCommand is
module.exports = class BaseCommand extends Object {
constructor(id, execute) {
super(id, execute);
this.id = id;
this.execute = execute;
}
};
require('dotenv').config();
const BaseCommand = require('./schema/BaseCommand');
const Eris = require('eris');
const client = new Eris(process.env.BOT_TOKEN, { intents: ['all'] });
client.commands = new Eris.Collection();
const fs = require('fs');
const commandFiles = fs
.readdirSync('./commands')
.filter((file) => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
console.log(command);
client.commands.add(new BaseCommand(command.id, command.execute));
console.log(`Registered command : ${file.replace('.js', '')}`);
}
client.connect();
TypeError: Right-hand side of 'instanceof' is not an object
that might help
im getting not an object, the post is discussing not callable
ho about you show the full error
nevermind, i scrolled up, what is index.js line 29?
Hi
client.commands.add(new BaseCommand(command.id,command.execute));
idk whats with the weird line wrap on discord
maybe its just me
separate those lines and log it
console.log(command)
const basecommand = new BaseCommand(...)
console.log(basecommand);
client.commands.add(basecommand);
then show the logs for both console.log(basecommand) and console.log(command) that come up right before the error
both display { id: 'ping', execute: [Function: execute] }
kk
Registered event : messageCreate
Registered event : ready
{ id: 'ping', execute: [Function: execute] }
BaseCommand { id: 'ping', execute: [Function: execute] }
/Users/kyrok/Programming/NodeJS/verbose bot/node_modules/eris/lib/util/Collection.js:60
if(!(obj instanceof this.baseObject || obj.constructor.name === this.baseObject.name)) {
^
TypeError: Right-hand side of 'instanceof' is not an object
at Map.add (/Users/.../node_modules/eris/lib/util/Collection.js:60:18)
at Object.<anonymous> (/Users/.../index.js:32:18)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Node.js v17.3.0```
index.js line 32 is client.commands.add right?
yep
hey
hi
wdym not working
long back
never run python in my pc
i use jupyter or repl or google collab or vs code
install python then
install, add to path, restart
according to the eris collection code, the collection expects a base object to be given when the constructor is called, so for example you have to tell Eris.Collection what kind of data the Collection is supposed to have: new Eris.Collection(baseObject). in your case you have to give it the class that you use to create the commands, meaning client.commands = new Eris.Collection(BaseCommand) so that it knows that this is a Collection of BaseCommands
Some require it
nah
i'll play a game
You cant play a game when you dont have a game
???
Patience is of virtue
Depends on ur wifi and pc speeds
Good for you
python in desktop is so hard
Try restarting pc
And then try again
Well
I dont exactly agree with that mindset
it was only a joke
till i do some crime
don't joke about shit like that
Larr
yea my game
Using pygame?
I see
i do use unreal
and i made the game in c++
but
i uses unity
wait a minute
Confusion
wuts the dif between c# and c++
.-.
man
They are 2 different programming languages
i just saw a ytb video
You're joking right
i did?
Step by step tutorials are a thing
Hey he might just be new to development
I cant tell if youre joking or not
i speak in python
On what
You speak in python but have no python installed
print("you are too dumb to understand my joke")
Damn
"pip" is not recognized as an internal command
Lmao
Im confused
So did you actually have a problem with pip
Or were you just messing with us
What software got used for docs like https://ghost.org/docs/ and https://tailwindcss.com/docs/installation. They really look similar, so is it a template? ๐ค
hm, but which one? ๐ง they have a ton I think
look around idk
I'm looking on GitHub, they have the docs code there...
Still trying to find a way to edit a message to remove a rich embed from it...
embeds: []
Heโs on a python lib
Setting embed to an empty array throws and erro, NoneType object has no attribute to_dict()
Asked four different places, keep getting redirected to different servers and channels
lf a jojo fan who has knowledge of javascript
await msg.edit(content='Content Here', embed=None) this doesnt work?
no
does nothing
do you use discord_components?
๐
maybe the issue was python
I'm trying to figure out how to manage clustered sharding. Not sure if anyone else has any better approaches as far as solving this system architecture problem, but so far I've setup a lightweight API (ShardManager) that knows how many total shards I'm going to scale to, and give an ID out to each sharded client that asks for an available shard ID. If none are available, the sharded client exits cleanly. It works... okay
https://i.imgur.com/gH3viZX.png
nothing wrong with it
as long as each of your shard clients is a process that contains multiple shards
Each client is a single shard in this layout
It's a docker swarm, with replicated containers
A single discord client that reaches out on startup to the ShardManager for an available ID (and total shard count) to pass on to the Discord gateway
so each of those shards is a full docker?
mhm
sounds very inefficient
Well it's the only running process in that container
I had a few other architecture ideas as well
my "ideal" architecture would be very similar to yours but with each process containing multiple internal shards
An alternative is Load balancing, by offloading the busy logic to nodes (maybe web apis?)
Or another would maybe be a messaging queue (AMQ?)
But those would likely have to be internal sharding
Whereas this one, each is it's own sharded client.
if you wanna go for a "funnel" that forwards events to workers, you can use worker threads with internal sharding
if you wanna make each worker a self-contained shard+logic, processes are better, but still internal sharding on each process
a full process for only one shard is very wasteful
and does not scale well
thats essentially what discord.js does
Yeah, I'd agree with that. This was my first attempt at implementing sharding and clustering as well. I'm new to both, haha
There is no internal sharding with the library I'm using
you can always make your own internal sharder
just create and manage multiple client instances
But, I can probably wrap my existing usage into either separate background threads or full processes
Yeah
Maybe I'll have each Client ask for a group of shard Ids from the ShardManager API, and internally shard for those groups
its better to ask for individual shards
because the manager also has to control the login queue
otherwise you'll run into gateway ratelimits
You're misunderstanding what my ShardManager API does
It's simply an API that maintains a concurrent stack of available shard ids, and either supplies a new shard id, or returns an unsuccessful response stating "out of available shards". It also exposes a simple interface for me to modify the amount of available shards
Each client, currently, reaches out for an ID and amount of total shards, to pass along to the discord gateway themselves
The ShardManager doesn't communicate with Discord directly
To discord?
yes
no matter how stateless you try to be, you still need a centralized login queue
just handing off shard ids to other processes is not enough, they wont know whether other processes are trying to connect at the same time
so they will run into gateway ratelimit errors
the gateway limits are 1 login per 5 seconds for small bots, and 16 logins per 5 seconds for big bots (100k+)
It's sending the Shard Id and Shard Count along with the Identify gateway interaction for each replicated client. I'm not seeing any failures...
Wouldn't I see that error response from the gatway, since this is a small bot?
try having 2 clients connect at the same time
your logs above are spaced by ~30 seconds, so there wont be an issue there
but if you try to connect twice within 5 seconds, one of them will fail and retry
and disconnections and reconnections must also be accounted for
resumes dont count, but reconnects do
[19:17:01 INF] Retrieving gateway endpoint...
[19:17:02 INF] Starting a new session (949 session starts remaining of 1000; limits reset in 02:32:06.4590000)
[19:17:02 INF] Connecting to the gateway...
[19:17:02 INF] Creating a new session...
[19:17:07 ERR] Local unrecoverable gateway error: The payload after identification was not a Ready payload.
[19:17:07 ERR] Gateway error: The payload after identification was not a Ready payload.
Maybe this is it
Does anybody know how to have mutiple different colors in a console.log function using css
This is my code and it returns as this
use chalk
const chalk = require( 'chalk' );
console.log(chalk.blue('Hello world!'));
@earnest phoenix 
i dont want to use chalk
smh
i figured it out, its not css for console colors its ansi colors
This is a stupid question, but does anyone know how to convert a discord attachment into a buffer?
Nevermind, got it
anyone know where I can find low-level implementation details for nvidia graphics cards?
down to the metal information such as what each register does and what data it holds
Oh fun
Im trying to use the Command design pattern
how add timeout
Is there a way that quick.db can work on a VPS?
Quick db works anywhere realistically
quick.db is already local 
Wym?
Whenever I use a bot that has quick.db on it, it says "Malformed database schema(?)"
You can ask this to the support server discord.gg/plexidev
wait but how does that work? can you show me an example cuz that sounds interesting
cuz atm i just use chalk
ansi escape codes
could someone help me? I dont understand why but im getting a error "Cannot access 'message' before initialization"
const {
SlashCommandBuilder
} = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('embed a message'),
async execute(interaction, client) {
const args = message.content.split(' ')
let message = args[0]
const embed = new client.discord.MessageEmbed()
.setColor('6d6ee8')
.setDescription(` ${message} `)
.setFooter(client.config.footerText, client.user.avatarURL())
.setTimestamp();
await interaction.reply({
embeds: [embed]
});
},
};
You'll need to elaborate a bit more, and show code snippets. However, you're most likely defining message after trying to use it.
You can't use message.content and then define message on the next line! You should try re-working your code to define message before using it. (Or rename variable from message to something else such as "msg")
that was a lot of "message" in a short space of time
just a note, your message definition isnt a message. probably best to name variables of what they are, not random other things
Im trying to follow a guide but its not helping, Sorry
i couldnt find one for message arguments (In a slashcommandbuilder) , Ill look again
I dont think slashcommandbuilder has a method for that ๐ does it?
slash command builder uses options
Yeah it would be options afaik.
Ill try again, My bad
user_id = discord.utils.get(client.get_all_members(), name="olie", discriminator="6728").id```
why does this suddenly not work anymore 
returning None
do you have intents enabled
dont worry about it!
its hard to change from message commands to slash.
let us know if you need more help.
hmm no
pretty sure you need guild members intent to get all members.
.setDescription(interaction.options.getString('message'))
is how i get the input correct?
yeah, it must have been on when i tested it before, hmm how do i fetch a single persons user id from their username 
Try getting their member obj then .id ?
don't i need intents for that
Wait sorry are you trying to avoid using intents?
interaction.options.getString('message')
if you had the option message
.addStringOption(option =>
option.setName('message')
.setDescription('message to do something with'));
registered in the command
I'm not 100% sure what's excluded in the new members intent. I haven't had a chance to dig into it yet.
ugh. i should have saved the ids and the usernames
That was quick wow, thank you lmao. I need to do lots of background before I overhaul my bot 
I was already on the page double checking ^_^
private bots are so much easier to handle
discordpy ๐
yeah kek
Exactly what I have But i still get an error
whats the error?
oh, you did this
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('embed a message')
.addStringOption(option =>
//optiondatahere
),
to add it to the registering
add the option*
I have that tho? Unless im not understanding
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('embed a message')
.addStringOption(option =>
option.setName('message')
.setDescription('The input to message back in a embed')
.setRequired(true)),
๐ค where is the .setDescription you did this with?
in the embed?
Would you like the full code?
yeah please
const {
SlashCommandBuilder
} = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('embed a message')
.addStringOption(option =>
option.setName('message')
.setDescription('The input to message back in a embed')
.setRequired(true)),
async execute(interaction, client) {
const embed = new client.discord.MessageEmbed()
.setColor('6d6ee8')
.setDescription(interaction.options.getString('message'))
.setFooter(client.config.footerText, client.user.avatarURL())
.setTimestamp();
await interaction.reply({
embeds: [embed]
});
},
};
well for starters you basiclly just use ansi codes to change the color of the console
its just ansi code + text
setRequired is true so it should require it regardless mmmm
yea///
๐
Should i try kicking the bot to add it back?
well, it could be guild commands and its not updating for an hour.
Oh I forgot that's a thing !
just to double check.
https://i.imgur.com/9spLlnP.png
you are getting this?
eval would be embed
code would be message
(just what I have on hand)
or are you just typing a message after it
yes im getting that
I kicked the bot and re-added it and deleted the command and re-added it and re-deployed it then it worked
Must not of, Thanks!
Done ๐
Any tips on how many internal shards a single container should run in parallel?
the ideal setup is as many processes as cpu cores until you start getting issues
for example if you have 100 shards and 4 cores, it would be 4 processes of 25 shards each
then you need to monitor the processes to see if they are managing
if you start seeing delays and lag in the event loop, then its time to add more processes
anyone know why vercel is pushing commits just fine to it's default domain but not to my custom domain?
Currently how I'm handling internal sharding for each of my containers is with threading (I'm using C# btw). I think that'll work just as well as spawning individual dotnet processes.
I don't really have a need for sharding yet. Just preparing/practicing
well im not sure what would be the best approach in a language that supports true threading
the advantages of async vs threads is that its easier to setup and consumes less resources (less memory management and no cpu context switching)
the advantage of threads is that they offer true concurrency
however network operations such as websockets dont really benefit that much from true concurrency
Yeah, typically when you want parallel operations, or any sort of background work, we offloaded onto It's own background task (tasks are wrappers around threads, doesn't guarantee every task has its own thread)
At least in C sharp. I don't think I've ever seen The need for multiple instances of an application. It handles it pretty well from a single process from what I've seen
idk how c# does it either, but from the docs im assuming System.Threading.Tasks uses async behind the scenes
it is not happening
Install the wheel package by running pip install wheel and then try installing psutil again
thx a lot!!!
not happening
Show the last part of the error
k
You need to have the Python headers installed, run apt install python-dev -y to install it and then try installing psutil again
Are you on Windows?
yea
Wait, why do keep deleting your previous messages with the errors?
cus @sly sierra suspects me
Hello, I'm a beginner learning pycord and I did a simple command
It gives me an error but I couldn't find the cause
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='.', intents=discord.Intents.all())
@bot.listen()
async def on_ready():
print("Bot has logged in")
@bot.command()
async def serverinfo(ctx: commands.Context):
embed = discord.Embed(title="Server info", description=f"Hello, this server is owned by kratoz", color=discord.Colour.random())
await ctx.send(embed=embed)
bot.run('token')โ
It says
Syntax error: invalid character in indentifie with an upper arrow marking my token
How do I fix this
Ohhh
Alright
But have you found any fix for the error
Why is await ctx.send outside of the function
Is it?
Is it indented?
So I have to leave a space before ctx. Send?
As many as you use for indents in other parts of your code
Tried but the same error
If possible could you please correct the code, I'm in mobile so I don't know whether the indentation is right
Can you send the full stacktrace
Oki
This
Please ping me when you reply
^
Oh, thank you so much for the reply.
How to make giveaway time in <t:{}:R> format using discord.py?
@bot.command()
@commands.has_permissions(administrator=True)
async def gcreate(ctx):
giveaway_questions = ['Which channel will I host the giveaway in?', 'What is the prize?', 'How long should the giveaway run for (in seconds)?\n**Note:** 1hr = 3600s | 1day = 86,400s | 1week = 604,800s',]
giveaway_answers = []
def check(m):
return m.author == ctx.author and m.channel == ctx.channel
for question in giveaway_questions:
await ctx.send(question)
try:
message = await bot.wait_for('message', timeout= 30.0, check= check)
except asyncio.TimeoutError:
await ctx.send('You didn\'t answer in time. Please try again and be sure to send your answer within 30 seconds of the question.')
return
else:
giveaway_answers.append(message.content)
try:
c_id = int(giveaway_answers[0][2:-1])
except:
await ctx.send(f'You failed to mention the channel correctly. Please do it like this: {ctx.channel.mention}')
return
channel = bot.get_channel(c_id)
prize = str(giveaway_answers[1])
time = int(giveaway_answers[2])
await ctx.send(f'The giveaway for {prize} will begin shortly.\nPlease direct your attention to {channel.mention}, this giveaway will end in {time} seconds.')
give = discord.Embed(title=f'{prize}', description=f'React with ๐ to enter!\n Ends: {round(time/60/60/24)} Days!\nHosted by: {ctx.author.mention}', color = 0x37b2cb, timestamp=datetime.datetime.utcnow())
give.set_footer(text = f'Winners: 1 | Hosted at')
my_message = await channel.send(f":tada: **GIVEAWAY** :tada:", embed = give)```
Please help
Library: Python
The {} stands for epoch timestamp in UTC
I'm not sure I understand the full question here though
Use time.time(), cast it to int, finally add up the time input from the user
datetime > 
Kinda overkill to me kekw
I call it balanced effort of productivity and uselessness

how do i fix this error? DiscordAPIError: Invalid Form Body embeds[0].image.url: Scheme "welcome-image.png" is not supported. Scheme must be one of ('http', 'https'). code ```js
const attachment = new MessageAttachment(canvas.toBuffer(), 'welcome-image.png');
const embed = new Discord.MessageEmbed()
.setAuthor(`Welcome to the server, ${member.tag}`, member.displayAvatarURL())
.setThumbnail(`https://cdn.discordapp.com/icons/809479699663290380/030d1709205bb369c8162bdcddfaeba8.png?size=4096`)
.setFooter(`${member.guild.name} | store.runecraft.eu | play.runecraft.eu`, member.guild.iconURL())
.setTimestamp()
.setDescription(`Please read the [#809479700497694741](/guild/264445053596991498/channel/809479700497694741/) and <#> yourself! Have a great time in our server!`)
.setImage(attachment.name)```
what?
why would that make sense
.setImage("attachment://welcome-image.png")
message.channel.send({ embeds: [embed], attachments: [attachment] });
how do i disable all buttons when a button is clicked in nextcord?
any idea
like
@nextcord.ui.button(label = "Yo",style = nextcord.ButtonStyle.gray)
async def YoYo(self,button:nextcord.ui.Button,interaction:nextcord.Interaction):
em = nextcord.Embed(title = "Heya",color = nextcord.Colour.random())
await interaction.response.edit_message(embed = em)
self.value = True
@nextcord.ui.button(label = "End",style = nextcord.ButtonStyle.red)
async def End(self,button:nextcord.ui.Button,interaction:nextcord.Interaction):
this is my code
ah thx i need to do some experimenting with this
in one server that my bot is in it shows it with out the emojis
any idea?
it got admin perms in both
?
<:emojiname:emojiid>
I know that, it works on other servers, just not on that one
Thats weird
you mightve requested admin when inviting but did you make sure you actually were able to give it that or the role / perms were removed?
nvm it works now
I'm trying to add options to slash commands, but when doing so I receive an error. The slash command appears normally, but the sub commands don't work for some reason.
Code:
if (interaction.commandName === 'strike') {
if (interaction.options.getSubcommand() === 'user') {
const user = interaction.options.getUser('target');
if (user) {
await interaction.reply(`Username: ${user.username}\nID: ${user.id}`);
} else {
await interaction.reply(`Your username: ${interaction.user.username}\nYour ID: ${interaction.user.id}`);
}
}
}
(line 306 is if (interaction.options.getSubcommand()...)
Registering the Slash Command:
... new SlashCommandBuilder().setName('strike').setDescription('Strikes an user.').addUserOption(option => option.setName('target').setDescription('Select an user')),
You didnโt specify a subcommand
The error tells you exactly whatโs wrong lol
Youโre trying to access options, not subcommands
I can't add a bot to the server
which server
My
what issues do you face
I am writing that I cannot attach the bot to the server and I should contact this server
Ship It
Could you send a link to it?
I can not
ty
i have a problem
yes yes you too
9 hours left for us edt peeps
Cannot read properties of undefined (reading 'send')
at DisTube.<anonymous> (/app/index.ts:66:65)
at DisTube.emit (node:events:390:28)
at DisTube.playVoiceChannel (/rbd/pnpm-volume/b454ff45-fa92-45a8-97d4-4cad670ab5b6/node_modules/distube/dist/DisTube.js:203:34)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async DisTube.play (/rbd/pnpm-volume/b454ff45-fa92-45a8-97d4-4cad670ab5b6/node_modules/distube/dist/DisTube.js:119:9)```
i use my friends code
what
also whats a distube
idk
distube is a package for music
then don't answer
wait
do u like have a perm to send a message
.on("playSong", (queue, song) => queue.textChannel.send(
`${client.emotes.play} | Reproduciendo \`${song.name}\` - \`${song.formattedDuration}\`\nPedido por: ${song.user}\n${status(queue)}`
).then(setTimeout((message) => message.delete(1), 15000)))
this is the code
no
can bot see that channel*
the bot works fine and plays the music but gives this error
It should be like that
weird
can it be because of the .then?
The .then is weird.
You're passing the value of calling setTimeout
But you'd usually pass a function that calls setTimeout
I will see then
wait
I think Discord.js can handle the timeout for you as well
oh it doesn't seem like it
maybe it was deleted
in discord v13?
yeah
i have discord v12.5.3
can i do something like this?
Object.values(object.family === "Obojectto")
object: ```js
const object = {
"heelo": { name: "Heelo", family: "Obojectto", lvl: "11" },
"hello": { name: "Hello", family: "Target", lvl: "none" },
"heello": { name: "Heello", family: "Obojectto", lvl: "21" }
Then you could use:
.then((m) => m.delete({ timeout: 15000 }));
And Discord.js will handle the timeout for you.
wait ill try
How about a filter?
let obj = {...};
Object.values(obj).filter((o) => o.family === "...");
Well the error is complaining about .send, and that precedes queue.textChannel, so you may want to check the value of queue for what .textChannel should be.
Right now, queue.textChannel is returning undefined
ok thx
and if i change it to queue.channel.send?
You won't get anything out of that
Since there's no property for channel
Though in the docs textChannel is marked as optional, so that may be why it's undefined
the thing is that the others use the same method and are doing well
it works fine again wtf
xd
well anyway thanks for the help|| @sudden geyser ||
intents_use_case_supplemental_material_description Trying to verify my bot and I've got this error. I assumed all I needed to do was increase my reasoning for wanting the members intent was increasing the word count to at least 100 words and so I did. I increased it by 120 total but I still get this error.
thats speaking about length, aka characters
check your text with a word/character counter
yeah I did
I typed it out in a word counter and it's 120 words in total and 610 characters
then ask in discord.gg/discord-developers
Ok it worked, for whatever reason it also wanted an essay on the part where it only asked for a screenshot.
i store discord users avatar on a database for my website, the issue is when they change their pfp the db doesn't update it obviously
what would be the best way to update their pfp
put a check on userlogin?
i wouldn't want it to slowdown authentication
can I remake this in a few lines? ```js
if(chss.rarity === "Common"){
chr = [
"nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","chr","nada","nada"
];
} else if(chss.rarity === "Rare"){
chr = [
"nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","chr","nada","nada","nada","nada","nada"
];
} else if(chss.rarity === "Epic"){
chr = [
"nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","chr","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada"
];
} else if(chss.rarity === "Legendary" || chss.rarity === "Champion"){
chr = ["nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","chr","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada","nada"];
}
What the f*ck is it
the droprate of new character appearing in chests
I choose "chr" randomly
and somehow that makes it harder to appear





