#development
1 messages · Page 1512 of 1
Galaxygate
what language is the code of ur bot?
python?
discord.py right
mhm
can you give me a code from example?
they just did -_-
That is the example
Hey thats wrong bruh :v
yeah ik
@sacred aurora just give some code
delete that
Hmm wdym
im going to see if they copy the code
I don't need the code
app.set('/views', '../dashboard/views'); this dosent set views?
The galaxy gate has double the memory, and unlimited bandwidth for 50 cents more a month.
And 5gb more ssd space
but no ddos protection
If your ip isn't being shared, you probably won't be ddosed.
hmm
yeah why the hell would you need ddos protection
bc people are stupid
what
I remember carl bot got ddosed one time
how do you ddos a bot
you can ddos a vps
hey do you get the bot to open your link
legit
how would you get the ip from nothing
ddos protection is only relevant for public facing services
a discord bot is not public facing
but a dashboard for a discord bot could be
yeah theres no db
if you create a command that lets the bot scrape the web and go to different sites and take screenshots
you could make it go to whatismyip.com
but I doubt that would be the actual IP
image generation like using canvas too
Owo
Are there the equivalent of sql injection attacks on mongodb or can I just throw whatever info I want into it?
whatever info you want
apparently it can be a thing
no system is perfectly safe. It's best not to pretend they are, and start doing research on them.
Wow thanks for linking that article
Has this been coded right LMfao?
no
@sand condor I knew that lol
ok
suure
@cinder patio yes I knew it wouldn’t work bruh
then why did you ask?
If you want to see if code works, run it
why do you format like that
Well, I tried to make my own command for the first time by documents LOL
Because he has no idea how to format code either way.
Where can I see the format?
well most of the time
you'd need a proper editor that's not a browser on an iPhone for that
umm
it is on the function
I meant for makign it look nice
@crimson vapor commands like, mute, unmute, unban like not the coding but the format
That's something you can learn from experience, how to make your code readable
Unless you mean the features available in discord.js which is just... in the documentation.
like
function() {
code().then(() =>{
})
}``` looks ugly
I am still learning
and should be formatted?
if vsc just press shift alt f iirc
ok but what do yo umean
you could use beautify
what exactly are you asking
Like,
How to make it prettier?
So what, use your words....
Like mute it starts with something and goes all the way down like a format like that to show me which line I should put the coding to make it work
Yea it’s kinda hard to explain
That's not what's meant by format
do you mean the spaces on the left of the code?
I think they want a "fill in the blanks" of the commands
format is just how your code looks.
Should I make a file for handling mutes in a db
where to put the code is the logic
And how to use the special characters like () or [] or . is called "syntax"
It's a bit like grammar for code
hm yes
@cinder patio like, if I put the lines randomly then it wouldn’t work like I need to use a format kinda. So like that
gramer
Get what I mean?
"put the lines randomly"? wat
It sounds like you're asking how to learn programming, as a whole.
No it’s not that
One of the key things for beginners to learn is how async works because it's different to the synchronous code you may have learned at school or something
And that's done by actual experience and literal learning which you still haven't done
Ima try to explain it with the best words I got
your first language is english?
IF you can't even express your problem it means you don't understand enough about programming to even form that sentence, and that means you still gotta lot to learn
@crimson vapor what??.
I know what you mean - code gets executed from top to bottom
you don't put your code randomly - you put it in an order that makes sense
I had that problem with I was trying to type something in ts
I didn't know enough to explain what I wanted
EXACTLY!
That’s what I mean
turs out it was just export = class
use logical thinking 
Yea well, bot how would I know lol?
should you check if a user is cached or if there are args first?
Learning the coding language
hi Miyuka
I’m still learning

Uh lol
You don't put a cake in the oven before you've mixed the ingredients in a bowl, it's common sense to a certain extent
@umbral zealot I think its left to right
bruh imagine a programming language that reads code from bottom to top and right to left
nah my code is writen in manga
someone ought to create that
@umbral zealot can ya send the uh documents again? I can’t find them
@umbral zealot @crimson vapor thanks
+1
watch fireship's yt channel too
@mellow kelp who’s that?
the guy's videos are really simple to understand
don't watch any video just read docs
It is the best way to learn
@mellow kelp btw I got my bot using 6mb heapUsed
I never suggest any "Bot making tutorials" without knowing the coding language first.
then remove "Coder" from your name
@craggy pine I’m still learning I won’t really like to uh change my mane :(.
my bot got me into js so imo its not bad
Name*


Before you learn in what order to put the code, you must know what it does
but you need to understand how to search problems
and understand answers
my internet slow
learn how to google
Yes yes
thats really important ngl
Any one python developer here
send code

yea wassup
@gilded olive you are a python developer
okay now this is fun
wdym
auto generated types
from my database
simply input the table name, and the primary column name, and it generates a full d.ts file for the declarations
@crimson vapor could you send me an example of the body you send to when sending a file
never again updating code to adjust for new character nor updates for it, add to database and let the rest handle it dynamically

yea one sec
// message = new FormData();
const req = await this.#shard.client.api().channels[this.id].messages.post({
method: 'POST',
body: message,
headers: {
'Content-Type': message.getHeaders()['content-type']
},
parser: (_) => (_)
});
if (req.code !== undefined) throw new Error(req.message)
return new (require('./Message'))(req, this.#shard);```
no i mean the body
body is just formdata
why won't this delete the message I send? First time ever having this problem
client.on(`message`, async message => {
console.log(1)
if (message.author.bot) return;
const channel = message.guild.channels.cache.find(c => c.id === '797559702783131680')
console.log(2)
const embed = new MessageEmbed()
.setTitle(`Suggestion by: ${message.author.username}`)
.setDescription(message.content)
.setFooter(process.env.FOOTER)
.setColor(process.env.COLOR)
.setTimestamp()
console.log(3)
let msg = await channel.send(embed);
console.log(4)
await msg.react(`👍`);
console.log(5)
await msg.react(`👎`);
console.log(6)
await message.delete;
});```
message.delete is a function
Bro how can get a person how invite the members
can anyone assist me with python code I'm not a bot developer but I payed for someone to make one for me and I can't seem to fix the error codes nor do I understand them.
@gilded olive Bro how can get a person how invite the members
anyone know if Google will index URLs that 301 redir to a discord login page?
hey guys
what?
what error
notification.notify(
title = "Price of your stock is below " + buyPrice,
message = "Current price is " + str(price),
app_icon = "test.jpg",
timeout = 100
)
b=b+1
s=0
elif(float(price) > float(sellPrice)) :
if(s==0):
notification.notify(
title = "Price of your stock is above " + sellPrice,
message = "Current Stock price is " + str(price),
app_icon = "test.jpg",
timeout = 100```
why is it giving me that error?
are you sure that the image exists
yup
Thanks for the reply can I dm you the issue?
sure
i found a selfbot that's streaming anime 24/7 
any help?
aren't selfbots illegal?
yes
ah you are just using it to test or something.
I guess it is good then?
Idk tbh. Have fun tho 😉
illegal?
banned from discord
doesnt make it illegal
Pov: you're cringing because someone made a 24/7 anime selfbot
no cringe
best vps hosting under $5?
which one do you recommend from that list
but it doesnt have ddos protection
slap it behind cf
if you're hosting a site on it, yea
what
or you're hosting a site elsewhere and wanna just slap a dns record to it
anyone willing to fix some python code im willing to pay.
I mean everyone here will do for free
if that is the case, could somebody help me with this py error?
Wait, you guys are getting paid? /s
Did anyone try to figure out a way to assign roles after the member screening feature ?
i guess there aren't a lot of people that know py
with ddos pretection
with ddos protaction
without ddos protection
which one should i buy
Do you need DDoS protection?
If you don't need it right now there's no point paying for it
If you need it in a couple months most hosting sites let you add it on
If they don't you can always just copy and paste everything over, although galaxygate do allow upgrades without having to do that
Idk about vultr because I've never considered them
whats hostname
galaxygate is a good one tho
i have bought the vps too
w/o ddos protection as i won't really need it..
Its the name of the vps.
oh
Yeah Tim says good things about galaxygate
so i can make it anything
Ye ^
Almost everyone says good things about galaxygate.
yeah lmao
Galaxygate has great support and help you out with all problems
^
what ubuntu version should i use
Is that a server advertisement?? :o
no
when i actually uploaded my first website they gave me a free domain name lmao
Galaxygate restocked vps services ?
Any recent lts version
20.04 LTS
They restock a few times a month typically
It really doesn't make any difference as long as it gets security updates
18.04 works fine, but 20.04 also works
The only thing you have to do when you receive your VPS is updating everything.
the node, packages, etc were really outdated
I prefer galaxygate over other providers for the bandwith cap
anyone here good with py?
My aws instance is so broken because I'm running at like 90% disk usage so I can just about update packages 
don't really think you need ddos protection unless you expose ur server ip in dns stuff or elsewhere
They also don't install fail2ban or firewalls by default, which i kind of prefer
or ur stupid and do a cross origin leak
me
okay could i ask you some error
mhm
they dont offer lts
notification.notify(
title = "Price of your stock is below " + buyPrice,
message = "Current price is " + str(price),
app_icon = "test.jpg",
timeout = 100
)
b=b+1
s=0
elif(float(price) > float(sellPrice)) :
if(s==0):
notification.notify(
title = "Price of your stock is above " + sellPrice,
message = "Current Stock price is " + str(price),
app_icon = "test.jpg",
timeout = 100```
owh my bad then. It was 20.04.
I've been trying to load my repository into vscode with the extension but it only loads the main branch and not the one I actually want. I've deleted and re-tried about 5 times now and it's not fun anymore
It works fine on my other repo
Just not the one I want to use ffs
Yo guys
Can somebody help me pls
I have this error
When im using command *pokemon
I need to guess Pokémon
If it doesn't this what i wrote
It should write about this, but i have an error
The error means you tried to do something on a message that didn't exist.
It might be because you're not correctly giving it your guess message
See code
Not in this
Collector can do a memory leaks
actually nvm
Nah, it was wrong.
Oh, ok
vsc is annoying to config
Don't you just love getting locked out of your own repo by vscode
It's my favourite situation
Hey guys please who know a free VPS just for hosting a bot?
Pay.
If you have a debit or credit card you can use AWS free tier for a year
Ooooooof
it is
Check the pins
The only good free ones are the free trials of the paid ones
Paying on a VPS than we don't know it's sure
Yeah pins
me?
Does VSC work with Linux? Specifically a Raspberry Pi?
req.session.guildsif this returns undefined what could it means?
Bro
Pls do not use FREE VPS
ITS A TRAP
:D
If your using a free vps, Google f1 micros are decent low end for being free.
Tag me if you know
On raspberry pi a lighter weight code editor would be a good idea
I just don't have bank card and no PayPal money
I’ll stay with Thonny then
Bank cards are generally free. No reason not to get one if you are older than 14.
Anyone familiar with hosting on a rasp pi
im having errors
it said
cannot load default config file
and it going offline
What i can use to delete last message?
Discord.js
Msg.delete used, but doesnt helps
what do you mean by last message
what exactly do you want to delete
do you mean deleting the user's response?
Yea
just call delete() on the user's response message
yeah because you're calling it on the command message
you have to call the delete() method on the user response, not the command
msg.author.delete();?
No
im having errors
it said
cannot load default config file
and it going offline
like
how i fix
do you use awaitResponse?
Yes
and you're using it to get the user response right?
Yep
You crashed my windows (head)
How i can delete this :/
Road discord.js.org but nothing found
you should have a message object with the user response
or something like that
what's your code?
okay so
you see attempts.first() right?
that's a message
since you're directly accessing the message content, it'd be better to store the actual message in a variable first
then you can call delete() on that message
ohhhh i neex answer.delete();?
if that's how you'll name the variable, yes
Ok, ty
np
Answer.delete is not a function :/
what do you have in your answer variable?
yeah
that doesn't delete the user's response
Yea
Out of curiosity, does anyone see a slight increase in ram usage overtime using DiscordJS? When I restart the application, it always reset it back to the baseline 38 - 45% memory usage. But, overtime, it increases forever until it physically runs out of memory.
Memory leaks
Definitely
or just caching without ever clearing it.
I just don't know the proper ways of debugging a Discord bot using NodeJs 😬
Im just made a cache cleaner
I've checked every single one of my Cache-based functions. They all either have setTimeout ... or leverage the built-in removal function (KeyV)
what about discord.js's cache
well, djs is known for not giving a lot of cache clearing options.
😢
which is why its really not recommended for medium to large bots.
Interesting.
What do most bots use? Or do they just write their own library to interface with the Discord API?
"Great control", I guess
discordjs-lite is super op for dealing with it until you start getting to large bots.
My friend very popular bot using C#
:D
He said thats rly trash code, and trash language
C#, trash? I don't necessarily agree with that.
Xd
My bot, as of right now, is roughly in 115 servers.
Khm
how much ram are you using 🤔
Before I do a planned marketing campaign, I didn't want to blow up my server 😬
Pulling it up now 👍
Btw, I do appreciate your help / advice on this
Heh, 1GB
do you happen to have the load all members on startup thing on?
Is that referring to the privileged intent?
Damn, let me check that. I don't believe so. I'm also not exclusively using DiscordJS. I'm also leveraging Commando.
Negative.
well, even with discord.js you probably shouldnt hit 1gb of ram on 115 guilds.
Keep in mind, I'm also running docker.
ah, whats your ram usage just for the bot.
You know, that's a great question that I'm not certain I have too much insight too.
I'm sure I do, I just don't have the reporting methods in place.
then it might not even be your bot using all that ram.
Here is my memory usage for both docker + the bot. It's also technically running a webhook port as well. Each one of those 'dips' are when an automated update happened (DevOps pipeline that takes the GitHub release code and pushes out a new container / removes the existing)
It always steadily increases.
And it always dips back down to roughly 38% (except most recently)
CPU is only at like .2% lol
so the memory usage drops significantly every time the container is restarted?
Yep, precisely.
Oh, sorry. Ha
Makes me believe it's a memory leak.
so then its the container probably not the bot?
But the bot itself + cache runs within the container 🤔
Oh, my fault.
I don't expect you to know the answer or anything. I was really just wondering if anyone else had these pitfalls when developing on DiscordJS / CommandoJS. I'm starting to think it's something peculiar that I'm doing. Probably one of the scenarios of 'you got a memory leak here, idiot'.
I could slap a bandaid on it and have a CRON job destroy the current container and such, but that's not scalable.
honestly, if it was me, i would setup a test bot that's just a clone of the bot, and remove the main likely causes for this problem and slowly add them until you find the root cause.
Or, someone smarter than me will be around eventually with a better plan.
Heh, I appreciate your advice! Yeah, these types of issues seem difficult to pinpoint.
hello Thomas
Hello!
Still looking for help if anyone knows anything about hosting python on raspberry pi
you should be able to just put ubuntu server on it then run it like you normally run something
let board = [];
for (let i = 0; i < 12; i++) board.push(["_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_"]);
board[randomNumber(0, 11)][randomNumber(0, 11)] = "O";
function spawnApple() {
let options = [];
for (let i = 0; i < 12; i++) {
for (let j = 0; j < 12; j++) {
console.log(i, j) // 0 0
if (options[i][j] === "_") options.push({ x: j, y: i });
}
}
if (options) {
let chosen = options[randomNumber(0, options.length)];
board[chosen.y][chosen.x] = "a";
}
}
spawnApple();
``` give an error `(node:127) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined`
which line is that error pointing to?
show your randomNumber function
if (options[i][j] === "_") options.push({ x: j, y: i });
ok
randomNumber: (min, max) => Math.round(Math.random() * (Number(max) - Number(min))) + Number(min)
hello Tim
wait oh yes
you have options[i][j] while options is still []
yes, i emant to put board
nested loops are O(n^2) right?
yeah im pretty sure
yikes
@crimson vapor is there a guide I can follow?
for?
what is the operating system installed in your PI?
unbuntu
oh
then just google how to install python in ubuntu
best bet search digital ocean python on ubuntu
thats what I do
digitial ocean X on ubuntu 16.04
since im on 16.04
mine is default on debian
if you are using raspian you can just search intall python on raspian
Maybe I wasn't be specific enough I'm running it on python code on raspian already it runs and the bot can run like 1 command the rest has error
sounds like your codes erroring, which typically isnt because of your platform.
see if JS doesn't have some kind of profiler
if it has one, then it will give u estimate memory usage of each function
for code errors, its generally best to provide the relevant code, the error, what you have tried to fix it, and maybe what line the error points to.
I'm running it via thonny all i know is that it can't find the folder cog
sorry if it's a bad picture it's on the raspberry pi so i can screenshot
can't*
That's great to know! I'm sure it does have some sort of profiler, I'm just not aware of it 😄
js profiling is a pain tho
Just curious on your thoughts, Tim, did you see the message thread above? #development message
whats on line 255 https://i.imgur.com/cdi9GtO.png
you need to run node in inspect mode, and then connect to it from a chrome-based browser, then use dev tools to inspect the node process remotely
Your bot was developed in JS, right? Did you experience any problems such as that?
i had issues with discord.js caching, thats why i made discord.js-light
i can send you the .py so you can see yourself??
imagine
It may have been a bad decision to opt for CommandoJS; however, it really helped speed up development.
How I get the bot developer role
i've never used commando so i cant say anything about it, but im pretty sure it shouldnt be leaking
I like making command managers, like, you can be very creative about it
by adding a bot to top.gg
I did
@long marsh how much ram is your bot using? and how many guilds?
then wait for it to be approved
115 guilds, 1GB server
my current manager creates command classes at runtime, then destroy after usage
But, I'm also running Docker.
1gb total or 1gb used?
was trying to make it hotswap, but I don't want to step in hell
how much is it actually using? ie: try evaling process.memoryUsage()
Oh, sorry. Using about 39% when the container is freshly created ... creeps up indefinitely (about 1% per every few hours)
But, that's inclusive of everything ... not exclusively the bot.
are you using intents?
Nope
do you have members/presences enabled in your dev portal?
My bot isn't verified - so a lot of that was unavailable. Let me check.
they should be available while the bot is unverified
they become unavailable once the bot is verified, unless the bot specifically asks for them during verification and its accepted
NOTE: Once your bot reaches 100 or more servers, this will require Verification and whitelisting. Read more here
I can't enable it, lol
you can enable the intents after approval, but it'll lock the bot if you didn't ask for permission
been there, done that
I've never enabled them, and they're still 'greyed' out
weird
eitherway its fine
Right
better have them disabled
does JS have a garbage collector?
yes
They temporarily lifted the server maximum to 250 and closed down the applications
For the holidays
you could call GC once every hour
you cant call gc
meh
js's gc is abstracted and automated, there is no access to it
What language are you using, Kuu, that allows for that?
java
unless you use some special flags to expose it in node
Java gives you access to the garbage collector? Ngl, I kinda forget about that if that's the case.
you can't "force" gc, but you can make it rerun
I don't want to mess with the garbage collector directly though ... seems like bad practice ... even for monitoring purposes.
which effectively garbage collects
@long marsh you said you were running some functions to clean up some caches?
like, I call it every hour because I never reach anywhere near my memory limit, so GC stays sleeping most of the time
just to clean stuff
Every single instance of Cache.set() (only like 3) has a setTimeout(Cache.delete(), whateverTime) ... and every single KeyV Cache.set(k, v, duration) 'set' operation has a duration.
In my code, I mean.
oh, wow
discord.js caches everything
client.users.cache, client.channels.cache, client.guilds.cache
guild.members.cache
Hmmm...
channel.messages
etc
all of those are stored in memory
and discord.js keeps them there
Those inevitably grow over time right?
Oh, wait. It caches messages?
Oh, damn. That could very well be the problem.
200 per channel is a lot
Can I modify that limit?
I honestly don't need to cache more than like ... 5
Does it directly read the latest 200 messages in a channel .. or does it cache the messages 1-by-1?
As they happen, I mean.
it caches as they happen
and mod logs
I figured.
it doesnt load past messages
Yea, that's seems bad to do.
same for users/members
Right. See, I don't use snipe at all. Would there be a point to caching any messages
well, no
with the recent changes with intents, you no longer start with online members cached at login
you start only with your bot and voice channel members
so as your bot receives messages, it caches the users and members as they come
This has been incredibly insightful, Tim. I appreciate that. I bet that's honestly what it is.
so setting message caching to 1 would still trigger member cache, right?
The things you learn from reading documentation ... IMAGINE.
setting to 0 and -1 too
ye
dangerous stuff
0 would mean ... cache nothing ... right?
ye
I really don't see the point in caching messages 🤔 ...
also, stable still has messageEditHistoryMaxSize
With my bot's implementation, of course.
which they removed in master
but for now better set messageEditHistoryMaxSize to something like 1 or 0 too, because its -1 by default
Tim, do you still have that documentation handy? If not, I can simply google the client API reference.
If it's still open on a tab though, that would be great if you could slip it to me 😄
well its just the djs docs lol
Yeah, I know. I didn't know if you had that specific link handy.
Pure laziness on my part.
Thanks!
lul
messageCacheLifetime .. set to 0 by default?
Gotcha, I got it now.
That would be the reason to change that to something else.
If you wanted to sweep yourself.
I gotcha 👍
like if limit is 200, and you're at 50, and from those 50, 20 are older than 60 seconds, and you set lifetime to 60 seconds and sweep time to 60 seconds
Sounds legit
every minute will also check for that, and remove the 20 older out of the 50, even if not close to the limit yet
Sounds like it would add a lot of processing overhead, though.
Maybe not too much, but some 🤷♂️
a bit yeah
Tim, I bet your right though. I was sitting over here thinking I had a memory leak (which is still plausible) ... but this will hopefully show some results.
Lol, so is discordpy
I know, lmao
discord.py is easier to read than d.js
Debatable
anyone here use python? I Need help 😦
CommandJS is a nice read
I switched from discordpy to discordjs. I developed much more quickly on it.
And, I'm a Python Developer in my day job role 😄
If anything, I lacked NodeJS experience and still ended up developing on it way more quicker.
bot developing is much better now after the discord changes
i write typescript and i work at mcdonalds
Believe it or not, I actually have a friend who is a software developer for McDonalds 😄
as someone building his own lib and looked at other libs for examples, d.py's code seems more readable
Outside of the restaurant chain, the company benefits are great.
even if the libraries still stack memory like crazy, the fact that intents exist and that members and presences are no longer enabled by default in the dev portal makes it so that most bots out there should run significantly lighter today that they would last year
Yep, agree.
what does mcdonalds need software for? engineering burgers? xD
You guys should see my deployment pipeline 😄
Haha! POS systems (point of sale), their website, McDonalds app
cool stuff
Even the music in the restaurant is powered by something that the Developers did.
wants there a guy who figured out a way to get a free burger with POS?
Oh, and the self kiosks too.
That's what my friend works on.
But seriously, he has discounted McDonalds lol
the guy figured out that if you got a cheeseburger but removed all ingredients from it, the grand total would be minus 10 cents or something
He never uses it though ... because that food is borderline poison.
🤷♂️
so he bought 10 chesseburgers with no ingredients, and 1 normal cheeseburger
especially the hashbrowns
and the grand total was 0
did the 10 with nothing go -?
yes
So, Tim, leveraging the messageCacheSize: 0 or something should clear up my ram issues for now?
I should probably screw around with that ... idk what side effects that has.
LOLOLOL
possibly some of them
My friend doesn't work with that system, so, not his problem 🤷♂️
xD
djs's caching issues come from several places, some of the worst offenders are users, members, channels, presences and messages
May I entertain you with another question, Tim?
Or at least, another question for your insight?
ya
I'm leveraging the Patreon Bot & my 'community' server to handle the paid role access. My bot is going to load all the members with those specific roles upon startup (requires a privileged intent) ... then is going to listen out for "onRoleGiven" (or whatever the api call is 😄 )
The thing is, how will I know which shard that particular sever is on?
Do I need to run an if/else condition across all the shards upon start up?
if (server id is in the cache of the shard){
const members = loadAllDemMembersWithTheRoleBoi();
addToCacheBois(members);
}
guilds have a .shardID prop
👀
But, how do you know which shard contains the guild?
Can you just do a guild lookup and it'll tell you which shard it's on?
you can use the formula for sharding
Even if you're doing the lookup from a shard it's not on?
i believe discord.js added it recently to the shard class
let me check
client.shard.shardIDForGuildID
assuming you're using the sharding manager
Wow!
That's awesome.
Yeah, I'm using the shardingmanager
This is great, man. I appreciate that!
if you have the members with the roles stored in a database, you dont need the members intent to fetch them
Yeah, but how would you recommend I go about that 👀
let emojis = {C2: '', C3: ''}
[ 'H2', 'C4' ] --> player array
console.log(emojis.player[0])
TypeError: Cannot read property '0' of undefined
Unsure how to fix
if I just do emojis.H2 it works
But emojis is a key/value object
guild.members.fetch({ user: ['66564597481480192', '191615925336670208'] })
this should support up to 100 members per request without the intent
yeah what about it?
It doesn't have a player key
player[0] = H2
I want to do emojis.H2
emojis[player[0]]
oh that's what you wanted
oh thank you
But, I don't know who the members are
thats why i said, if you had them saved in a database or something
Ah, I'm sorry. I originally was asking, how would you go about placing premium members into a database without first knowing if they're assigned the role?
Patreon possibly has a webhook that could send me the information over ... but that's slightly unreliable.
I just didn't see a better programmatical way of determining who's a premium user without first looking at the role 🤔
you will need to fetch all members to find out which of the existing members have a role
there is a way to do that without the intent, but its limited to 100 members at a time
Instead of fetching all members from the server ... can I just exclusively fetch only specific roles? It may not work like that though 😢
unfortunately discord does not offer a way to fetch members by role
Lame
imagine
I'm legit only enabling that intent for the community server. It won't physically require fetchingAllUsers except for that one use case ... which kinda sucks.
yea kinda sucks
i guess it needs the intent because it implicates fetching members without a specific id
if you dont have lots of people with the role, start it by manually adding them to a database
then continue from there
and have future members be automatically added
But, you guys do agree that intent is required to basically make it programmatical ... right?
let me test something
unless you got specific member ids, yeah its required
😢
cri
i know patreon lets you fill in your discord name, do they have an endpoint for that?
https://docs.patreon.com/#paging-through-a-list-of-pledges
social_connections
As far as I know, they allow individual users to link their discord account to their patreon profile. Then, when a tier is purchased, their bot (which sits in my server) adds them. They do expose an endpoint for that, but I'm not sure I would receive that information is the user isn't already linked.
Ah, yeah. I could comb through the pledge api.
Hmmmmm.... good suggestion.
Possibly worth a try.
well, they allow you to fetch all supporters
then just use the webhook while its online.
periodically maybe refetch them all too just in case.
Eh, I may just fetch them all every interval / so often
I don't want to rely on the 'push' architecture ... since it relies heavily on the bot being up & the communication being solid between Patreon / me
Damn, look at me .. getting straight tunnel vision on this problem. Yeah, I forgot that Patreon allows me to comb through the pledges. Thanks for thinking outside the box on that one, Woo!
ye apparently discord disabled access to the members endpoint in the rest api
Yep
so its no longer possible to fetch members without the intent
Yeppers
That's what I was saying earlier 😄
It was greyed out for me.
It requires that intent.
It was a super recent change 👍
yea probably
Dec, maybe
it makes sense tho
Definitely
fetching the WHOLE list of members from a guild definitely isn't something a malicious bot should be able to do
Yep.
Makes sense to me
Honestly, I'm surprised it went this long being the way it was.
yea true
discord was supposed to be a platform that offers complete freedom
but when you get big, people start pressuring you into applying rules
but at least i think this one makes sense
ye
some other, nah
because when you get big, you also become a target for evil doers
yea
i still cant understand why it's necessary to give away a citizen id just to verify a bot tho
to hold bot owners accountable
the 100 server cap is kinda low
another way to handle premium roles without the intent is to require them to be active
as soon as they send a message in your server, your bot will get their data
or even react to something
yeah
for example: "make the donation and then react to a message in my server to get your benefits"
but if you want to fully automate the process, you will need the patreon api
Yeah, I'd ideally like to fully automate the process.
Thanks for the suggestion, though!
I think I'm just going to page through the pledge list for now ... that seems easiest to begin with. Possibly leverage their webhook later.
my donations are fully manual because icba setting up patreon and paypal apis
icba?
Lol
hi tim
hi
Patreon API seems fairly simplistic to implement though .. especially for the 'poll' of the pledges
Quick question, how do you guys run express servers along side your bot? Do you physically start two process by doing node server && node index ... or do you perhaps start the server in the same file as the sharding manager?
how you doing tim, been a while
i cant really transition to patreon anymore because i already had paypal donations in place before, which is a one time donation for a permanent feature
Yikes, yeah
turning everything into a subscription instead of permanent would be a giant fuck you
The only 'one time' donations I'm going to allow are for purchasing 1-time purchases of coins.
doing fine :3
100,000 for $2 ... for example
There are too many bots with commands to add money, so that economy probably will not be used.
discord doesnt allow bump bots to have any sort of pay feature that gives other users a boost/advantage 
'bump' bots?
If no one buy your sub, try adding more features to that sub
bots to help advertise your server
Oh, I'm not using anything like that lol
This is purely for the economy system that's implemented in my bot.
not a lot i could add, but maybe
its basically a server-wide feature
Tim, how many guilds is your bot in?
"enable all users in your server to use X"
ye
about 7k
Mmmm
Ah, yeah. I don't expect any subscription-based purchases before 50k guilds lol
I would love for someone to review my subscription tiers, but only if you want 👀
If you buy it, that feature is only for you.
mine are trash too lmao
my personal features are 1-time permament, so most people just use paypal
this is what the email said if you own a bump bot and verifying it
https://tinyurl.com/yy8nqfcf
Honestly, most of the economy-based bots are simplistic in nature. Gambling, some type of 'work', and gifting
No.
however i've had many donations that were bigger than what i ask for the feature
so it aint that bad
That's true
Good thing none of that applies to me 😄
More on that, my discord bot actually allows you to collect rent from a town (draws out the town using emojis), gamble, work, fish, mine, hunt, etc.
I'm not looking for a gold star or anything, just explaining how my bot would differentiate itself from the others 😄
my friend had premium on his bump bot and they wouldnt verify it so he emailed them again after the response saying about a negotiation if he removes the premium they verify it lol
Yeah, my bot isn't a 'bump' bot though 😄
Unless I'm missing your point entirely?
nah im just saying cause we were talking about premium features before lol
Ahhhh, gotcha.
Yeah, I'd imagine Discord shouldn't deny my verification process. I don't break TOS in any way .... or, at least, not to my knowledge 😄
nice
Sorry, everyone. I'll stop talking about my bot and unrelated-development topics.
this channel is used for talking about bots, channel description
not just coding help lol
Btw, never had a response here:
#development message
maybe @quartz kindle knows
I ran my webserver and bot on separate processes and used IPC to relay info between each.
v1 is semi usable but it doesn't contain a lot of useful data
v2 does contain useful data but it's insanely unorganized and undocumented
it might've changed since i worked with it
but when i did
i developed ptsd 😭
no f that
already did and uninstalled and reinstalled discord
yeah latest alpha is so buggy
i can't see server icons
and members' color on their names
i meant to send that in #memes-and-media
well, counts as #development sort of i guess
and it always crashes on me
