#development
1 messages · Page 1838 of 1
Ok
Yep
Just n latest then
Ok
This is heroku 😅
Yes
Workedddd 😂 🤟 🤟
No problem! 😊
Hello 😂 😂
🔥
fast question - is it possible to read users status in discordpy without being verified?
Yeah that's because you're using heroku. I can't remember how to upgrade node on heroku... Maybe try a Google search?
Ok thank you 😊
🔥
What OAuth2 scopes do I have to select for a slash command bot? bot and applications.commands?
only commands if you use only slashes, if it uses both slashes and commands, then both
technically just applications.commands
rate my js code 
window.addEventListener('pollLogin', (event) => {
console.debug("pollLogin", event.detail);
if (timeoutHandle !== null) {
clearTimeout(timeoutHandle);
}
console.debug("checking user")
checkLogin(event.detail);
attempt = 1;
});
function handleMessage(request, _sender, sendResponse) {
console.debug(request);
const event = new CustomEvent(request.eventType, {
detail: {
respond: sendResponse,
data: request.data,
},
})
window.dispatchEvent(event);
return true;
}
browser.runtime.onMessage.addListener(handleMessage);
generally ok
🔥
ik. i just putted this bot to topgg and i heard that unverified bots which use topgg or other lists are excluded from intents =p
and from verification =p
and what now?
;-; @vivid fulcrum
...what
that. if i put yet unverified bot on any list im excluded from verification and intents i heard (not tested YET)
Who told you that?
someone. i forgor who =p
Well it's definitely not true whatsoever
rilly?
would reading messages from multiple channels and forwarding them to multiple other channels be considered api abuse?
API abuse is considered spamming an endpoint even past the ratelimits for it usually. If you're not getting ratelimited, it's usually not api abuse afaik
Just because you aren't getting rate limited doesn't mean it isn't API abuse.
API requests that happen in a short interval being the most basic form of API abuse.
Hey.
.setTitle(`${server.prefix}${command.name.charAt(0).toUpperCase + command.name.slice(1)} Help Command`)
hi
hi also
How can I fucking prevent JSON.parse() from returning an error if my STRING isn't a valid JSON string
typeof JSON.parse() will return an error, too
How about a try and catch block
eww no, isn't there an easier way to check if a STRING has a valid JSON format?
god damn fucking complicated JS...
Probably, but no.
you could make some clusterfuck of a function like isValidJSON() or something
if it catches an error, returns false
etc
How about wrapping it in a function?
function json(s) {
try {
return JSON.parse(s);
} catch {
return null;
}
}
All your pain and suffering can be the function's problem
same idea
I am you!
yee
Thought there would be an easier way but okay... damn PHP has like 1 billion predefined functions
try catching it is the only sane way
someone know maybe a free database which could handle really many discord servers? and its roles?
depends how much is many discord servers
very much as its listed =p
how much
now i have 4 from topgg and idk how more from discord link on twitter. size of bot grows and im not gonna pay for anything for this bot =p (foss)
so you have 4-12 servers?
but bot grows?
what kind of things does your bot do?
its just a port of ubuntu in discord =p moderation, information and 2 cmds of fun =p
I don't know how many servers your bot has, but the number of servers you have usually dictates the traffic your bot receives, which may dictate how much your database is used. Of course, it could be thousands of servers and could practically be unused.
You probably don't need to worry about what database you're using since they'll all work.
But if you just want some database, consider something light, like SQLite (pun) or some key-value store.
ok. now its 4 cause link posted on twiter was link to topgg =p
i was thinking about online service, and should be also safe as will contain discord passwords =p
Maybe check out firebase?
paid
Is Firebase free?
its free
nope
and is it as safe as i can store passwords for discord servers roles (aka password roles)
yeah. you can make the database only allow you to read and write to it
i know bout this, ye? im just searching for a free, with some space, encrypted online db.
noone?
what do you mean by encrypted?
generally to be allowed on discord. im gonna store passwords etc
(not users but discord forces all this type content)
Databases don't encrypt the data you store in them. You encrypt the data you store in them.
ekh. im not best if bout security...
by "encryption", are you trying to store password hashes in a database?
Yo Mac, how did u do the thingy with playing a game and your bot? I assume using discord’s presence thingy but how do u get it to show the amount of servers?
Probably best to read up on it then if you're going to be storing your users' sensitive information.
DblStats API
Passwords suck anyway
is password for a selected role (similar for reaction roles =p) sensitive info?
generally?
k thk
All passwords are sensitive
You could use the top.gg api too but it's just what I had open in my browser at the time. Or you could just store the server count in your db and get it from there.
👍 thanks anyway
Hashing passwords is easy
?
Tons of libraries out there to use
i dont even know what is hash and what is salt lmao
for me hash is just # and salt is in the kitchen lol
😳

hashing is an algorithmic method to encrypt data
eee
salt is a set of serialized characters that you put with the original content of what you're hashing to make it "more secure"
do you know what MD5 is
i heard bout it but my last things where i was seeing "salt" was when i was trying to crack password on my pendrive... it was luks btw
MD5 is a hashing algorithm
eee
ignoring the bias there
Im kidding
?
MD5 is pretty weak
what do you define as weak
MD5 is not encryption.
my "encrypting" is only base64 for the now... 😳
correct, it's an algorithmic hashing function
?
Ah right
but it is used likewise to encrypt data
Got that mixed up
is it is or isnt?
hashing just means you can't plug in the given result and get it deciphered
an encryption means you can cipher and decipher both ways
Once its hashed you can't unhash it right?
base 64 xan be encrypted and decrypted, yes
Only to crack a hash is to brute force it
well there are more ways I guess
but brute forcing is a common one
there's more ways to break md5
the most convenient way is checking an MD5 hash for an existing copy of it in a database
yea
which is essentially what most MD5 "decipher" websites do
check some internal database
Ah I see
the problem with MD5 is that two different contents can produce the same hashed value
that's the flaw
just hashcat and cracked =p
?
i understand 0%
I can't even read it
that's normal
i can but im too dumb for it =p
i took a cryptography class so i learned a fair amount of this
this kind of stuff is extremely difficult
If you’re hashing text one way please consider using a system like bcrypt or something
Sexy af
they pay you huge fucking money to attempt developing an encrypting algorithm
it's big buck
So I am working on this rpg bot and one of my testers managedto make a script that runs commands of cooldown so I implemented a captcha system, now I was wondering what would be the best way to “detect” if a user might be scripting to then prompt the captcha
Why bcrypt
argon2 is just as good
It’s the only package off the top of my head lol
anyways - bye
just use md5
I worked for a couple who both had high level degrees in encryption. They were very well off...
it's convenient and very common
Eh
and the chances of an MD5 leak being possible are fairly low
Ima continue using argon2
you could also just do MD5x3 or MD5x5
But you want to use a system like that that beats the processor up a bit to stop reverse lookups as well as making it harder to decrypt
some people hate the idea of stacked hashing but it works very well
Help pls
i don't see the need for people to reinvent the wheel
yeah it's insane how much money they'll throw at you to make this kind of stuff
you are trying to make an anti cheat for a discord bot?
anything IT job in the digitech sector involving cybersecurity pays you very well
good luck
it's stupidly good for a career path
I'm pretty sure WordPress uses bcrypt. If it's good enough for 50% of the internet it's good enough for me.
Ahah
because many employers are looking for cybsec experts atm
Shouldn't the Discord gateway send a GUILD_DELETE event if a guild (server) gets delete? The bot should get kicked, shouldn't it?
i think pentesters still get paid a fair worthy amount of money?
I would assume so
I’d just like a small push in the right direction as I have no clue where to start with that
I could just prompt it every x commands
Well making an anti cheat for a discord bot can be quite challenging
I mean, I wouldn't have a clue
You can't exactly stop them from using a "script" as you really have no way of knowing
Yeah they both had PhDs in cryptography.
I have a captcha system ready and a way to wipe/ban users from the bot
Well yea
But the problem is you have no way of knowing if they are making a script for this
Best you can do is add a cooldown
I have cooldowns
Then idk what else you can do
I'd say use a second cooldown for the captcha. If they run x amount of commands in x minutes, require a captcha to be solved.
As an extra level of security I guess
Yeah that could work
Should I just make it prompt captchas at random then?
Captchas could be annoying from a UX point of view
Then what do I do vs people running scripts?
Just cooldown
So my game will be dominated by scripters then
It should really be DIscord's job to detect if the user is scripting.
This isn't some game on steam where you could make an anti cheat at root access level
I have cooldowns in place
Maybe increase the cooldown if people hit it too many times
That's a better idea
I don't know what's best without affecting the UX
What’s UX, user experience?
Yeah
But then there's nothing to stop a script user also using cooldowns so... 🤷♂️
Captcha is probably failsafe
I’m just scared of people running scripts on multiple accounts then selling the items and transfering the money to their main
Best you can do really is just implement a report system
Captcha is just annoying
And will probably affect user base
But how do I check reports then?
Like, if I'm savvy enough to make a script to exploit the system, I'll include cooldowns in my own code to avoid getting rate-limited by your bot anyway.
Who's going to report the offender anyway
Like how would I detect if the reported player is scripting
Maybe just have something that flags people in your system if they have suspicious activity on their account.
Trying to battle scripts on a discord bot is a useless battle
Thats what I’m trying to do
So then I prompt a captcha
This isn't some steam game that makes use of an anti cheat with access to your PC
But I dont know how to detect suspective behavior
Captcha is fail-safe but most annoying for the user. So use them sparingly.
This isn't a great channel for this question anyway
You're just going to get a bunch of abstract answers
I know, I’m just trying to make it not bot infested
That's what they want
The best thing you can really do is to implement a system where it detects if the user is actually using an script to automate the process by some ways such as checking how many times they've used the command in a row (People aren't going to just sit there running commands 24/7 unless they got no life) and checking if they're running the commands right after the cooldowns are expired and similar stuff and just blacklist the user
But why? It's always going to circle back to "use a captcha and figure out when to prompt it" where when is abstract
Alright, but how would I save it?
Yes but how
This is a pointless battle
How what?
It's like the swear filter
You can bypass all this
And you can't account for everything
Do I just save every time someone executes a command the timestamp?
yea
I know but I wanto to get the “easy” scripts out
Yes I know
I meant what would be the most effective way of storing it
Won’t that use ALOT of database space?
Yeah
No
I doubt that would use much space at all
Not really, you don't need to save all of them to a new document, just save a few and update them each time
They won't be huge but they'll be pretty big
Yea
ID and timestamp is really all you need rbh
Yep
Plus, you could auto-purge older logs once they've passed your cooldown limit if you wanted to keep it light
I think I should just add a random captcha prompt
Instead of storing them forever
Captcha just sucks so much
It's like they target me with the hardest ones to read
Immutable databases should really be the norm of today
Yeah but it depends how you use it. Owo bot uses captcha quite successfully. If it was too much of a pain it wouldn't be in 2 million servers.
I’d just have this as a captcha ||Tg0Hyk9||
True
those are still easy to beat
Has to be an image. That's too easy to circumvent.
but to stop basic scripts they're fine
I’ll just use canvas rhen
Yeah
I wont make them hard
Pretty sure that's what Owo uses
I just dont want people to make easy scripts
people will still bypass it by using things like 2captcha
If they want to script they have to put in effort
effortlessly
Owo's captchas are easy to read but in an image so no scripts
i totally didn't make a selfbot that plays pokemeow and solves the captcha via 2captcha
You all are really fighting a losing battle.
Alright I’ll do that
banned
Get beaned
hey i said i didnt 
exactly what I said
Ty all for helping
yuh
Glhf
ez anti cheat then
I’ll also add a small and easy filter to try and see if the user is using a script or no
generally no
I mean not easy
But a lot more doable to detect a script
EAC handles it pretty well
sure but desktop games are even easier to cheat in
since you can directly access and edit memory
Which is why anti cheats are a better thing for desktop games
Selfbots are against tos too right?
Yes
yes
Bro the best way to detect if they're actually using an script to automate the process is to just monitor their messages and command usage 24/7 manually
Ever since the Bot api became a thing
actually no
so true
That's quite common in other fields.
selfbots were still allowed after the official bot api came out
I mean for a short period of time yea
Im glad selfbots aren't allowed though
yeah unfortunately they banned selfbots because people kept using it with malicious intent
So discord will handle a part of my anticheat too right
Partially.
My bot uses slashcommands so other bots cant execute commands either
as it is in permissions in dev site it can send. it just isnt yet implemented in js and py =p
They cannot do that 
bot can. here u have :
Can i edit my bot page?
it u use chrome - yes
That permission is meant for users, not bots; all the permissions were placed there no matter if it's related to a user or a bot
ahh, ok
im gonna check api
nothing said nowhere. gimme next 15
U sure about that
yes
i think its might be possible after reading 10 tons of pages on github. just its not implemented =p
here ya have : read it : https://github.com/discord/discord-api-docs/blob/master/docs/interactions/Slash_Commands.md
bots can't execute slash cmds
slashes are a client-side trigger, not just a prefixed command
here ya have how : In your application in the Developer Portal, there is a field on the main page called "Interactions Endpoint URL". If you want to receive Interactions via outgoing webhook, you can set your URL in this field. In order for the URL to be valid, you must be prepared for two things ahead of time:
They cannot execute slash-commands and would never be able to anytime soon, why would they be able to in the first place?
But what does it mean when it says the bot user doesn't need to be in the guild to use its slash commands
that it is a service, not a modded user
What?
that
That's not related to slash-commands, that's for server-side interactions which can be used for oauth and stuff like that
What are you on about a modded user
yes but using this way a bot can send it =p
nope, slash-commands are client-side
i know that my question is idiot.
how to check for permission in discord v1.13
scripted. bot is just like a selfbot but legal =p
Slash Commands and Interactions bring something entirely new to the table: the ability to interact with an application without needing a bot user in the guild. As you read through this documentation, you'll see that bot tokens are only referenced as a helpful alternative to doing a client credentials auth flow. Slash Commands do not depend on a bot user in the guild; responding to interactions does not require a bot token.
I don't get this, is this saying a bot doesn't need to be in the guild for its commands to be useable?
I know what a damn bot user is
am i have to make a bot to do it?
yes, ur bot doesn't need to be in the guild for slash commands be available to be used
yep +1
How exactly does that work
Your bot can create and execute slash-commands in a specific guild just by having the applications.commands scope without being in the server
How does that even work?
It just does
Oh wait
Nvm
I get what you meant now
I assumed it meant globally not guild specific
Again you won't be able, but if you really want to waste your time trying to prove me wrong go ahead

Kinda cool a bot doesn't actually need to be in a guild for its commands to be usable though
As long as its registered in that guild ig
thk. tomorrow it will be
Everything is under a manager of sorts now right?
Perhaps
Yea
always remember author is the user object and htye dont have ties to a guild
How to know how much members my bot is in
Map the approx membercount and than reduce it, which library?
true
what a dirty bot 
lol 🙈
( ͡° ͜ʖ ͡°)🤌🤌
Really thought the bot is dirty but no, your thoughts are

Damn… that interaction, button shit somehow is really cool to use
The global registered interactions are cached for 1 hour, right?
Yep
They need to be registered on every startup?
Good question...
Need to switch to global commands later and wanna know before
Guilds commands need to be registered on every startup
Nothing on the docs page about that?
you only register them once
im pretty sure u dont, but im not sure
You have to
i dont remember seeing that but 🤷
They will be shown sometimes in the guild if the bot is offline if your browser still cached the script.
Reloading the site will clear all commands which means they need to be registered again on a startup.
Test this already
it doesnt say anything about guild commands needing to be reloaded
But I’m not sure about global ones yet
where does it say this
Nowhere. I experienced this the last days
Nope they won’t be shown if your bot restarts
Restarted the bots hundreds of times the last days til I ran into rate limiting
Anytime the same behavior
i've been implementing slash commands in my library and i've only had to register it once, maybe cuz there 2 processes of my bot running but that shouldnt change anything i doubt
Hmm weird need to investigate this again
I haven't tried global commands yet. I'm still developing so I'm only using guild commands.
That lets me think of if there’s cache for guild commands, too?
nope, instant
Yes, me too
global commands r registered once
No cache on guild that's for sure
Well since my bot offline atm they shouldn’t appear at all
? they should
wym they dont appear
Doesn’t make much sense as websocket connection got closed
but i could be wrong (i doubt) because there r 2 instances of my bot running
u r making an api request to discord, wut
Therefore no interaction can happen anyways
registering a slash command can be done without ws, u dont need a ws connection to make an api request
yeah of course ur bot cant respond
Yeah I forgot
Mixed bot scope with command scope
(aka. gateway and API)
nvm
Still need to investigate how long guild commands are cached
they arent
Don’t think they will last forever
they are instant
what
i dont think you understand what something being cached for a period of time means
Nah u didn’t get what I’m trying to say 
But doesn’t matter rn since I’m not able to test it now
What would be the best way to turn custom images into links?
Do I just set up an express server and use my vps’s ip adress?
base64
Can u use base64 urls in discord embeds?
its a topic im not too sure in but can kinda set u on the right path
nope, i dont think so, u'd wanna turn that into a link
Yes, hence my question
I think you can. You can embed canvas images in an embed as attachments so I don't see how it would be impossible to embed a base64 image.
^^^ I like your bot
hey
if (message.content == (prefix + "startservices1")) {
setInterval(async () => {
console.log("test1")
}, 1000)
}
if (message.content == (prefix + "startservices2")) {
setInterval(async () => {
console.log("test2")
}, 1000)
}```if i use both commands, why is only one of the two console.logging?
Try ===
yessir! Let me try
how do i do exceptions in JS?
wel
other than throw
is there a general practice to follow?
did not work
if i first use !startservices1
it starts the first interval
but after using !startservices2
it stops the first one
but i want them both to be starting
since when did setInterval support async functions?
wait can't i just put them under one common command lol
I know i accidentally made it async
it's not needed
was from my previous code
still the same issue
ffs
it does support async functions
throw new Error("bla")

Help, I want to make a conditional that: if x role is above the bot role, it returns x, I already have it, all the code, but I don't know how to mention the bot role in the code
In other words, compare the mentioned role with the role of the bot, but I don't know how the role of the bot is defined
show code
@quartz kindle
I want that when the role of the bot is below the mentioned role it returns x message
mencionado is already a role
there is no role.highestRole
you want the highestRole of the bot member
which you can get from message.guild.me
-> <GuildMember>.roles.highest
^ yes, depending on your discord.js version
v12
yep, you can use that on v12
I recommend updating your codebase to use v13 already
https://i.imgur.com/Rbtgv9V.gif
Im almost a pro js dev now
nice :)
only taken several hours and a bunch of js apis that apparently basically no one talks about
firefox
only difference is this only has 2 deps 
nightly but yeah
I think some version 80+ or so
They redid the UI and seemly made it alot faster
was a noticeable speed increase going from like firefox 70 to nightly lol
nice, just updated mine
mhmmm, but uhh do you know how to fix that issue i have been facing?
what is the issue again?
well, am facing.
i didnt scroll too far back
using one command stops the other interval
well... if thats all of the code, then thats impossible
just a snippet
So i suspect you need to send more code
yup
okkiii one sec
from that code alone, it should work
it's a long code tho so i will just bin it
the interval shouldnt stop unless you run clearInterval or whatever right
ye
Or just crash the program, or it runs out of memory 
huehuehue
wait, wait, why guild member? What I want is to compare the mentioned role with the role of the bot
it;s a big code tho, but basically i can run two intervals: one !startpaid and one !startfree
to get the highest role of the bot, you need the bot's guild member object
your timer variable is global
its the same in all commands
owh so that should be changed
hmm but if they are the same wouldn't it just time it at the same time
wow that was a sentence
sorry, changing it
you set an interval, and store it in timer
then in another command you clear it
and set another interval
so you're always clearing the existing interval
owh but i am not clearing it
with the !stopfree or !stoppaid
i am just using the start commands in 2 different channels
Can I change it for mencionado? Since I must compare the mentioned role with the role of the bot 😔
again, you need the guild member to get the role of the bot
how are you getting the role of the bot otherwise?
Can't you just use .manageable off the guild member?
No need to compare role positions
but i think he wants to mention a role directly, not a member
Ah yes I didn't read up
is someone here familiar with the facebook api?
I am trying to know how to log messages of a certain group: js FB.api('me/feed', 'get', {message}, async function (res) { console.log(res)}
the feed one already works, but i really would want to know how to get group messages.
TIL Facebook has an api
does it also collect and sell your data?
Idk, maybe? ( ͡° ͜ʖ ͡°)
:^)
facebook has an api
but their api is so damn bad
you don't have much options to use
Patreon doesn't have an api
yes they do?
They have a "here take this shit, now figure out yourself what each thing is"
Well you didn't let me finish ¯\_(ツ)_/¯

but seriously, I refuse to accept that as an api
Paypal is worse
to this day I still can't figure out what am I supposed to look at
there are like, 35 objects named "pledge"
all look the same
Lmfao
kofi better
I decided it was easier to convince 30 people to pay through my website than to figure out the API.
kofi is pog
And Chargebee is pog and so easy
What are the kofi fees like?
There are none iirc
Nice
Chargebee has no fees either
You only pay for your payment processor fees (Stripe, PayPal etc)
Donations go directly to your PayPal or Stripe account. We just get a notification that the transaction was successful so we can update the creator's page, but we do not take a fee from donations.
Nice
Same with kofi
They do
Oh nice
But how do you integrate with Discord?
Kofi?
Yeah
gonna take a look at chargebee later
It's amazing. I highly recommend.
meh it doesn't have R$ option
the user has to login with discod
User logs in but it gives a role 🤔 so it's like using the Patreon bot to manage subs?
Ah ok
so I think when someone donates it sends a webhook
That's good
let me see if I can find a post on that
I Want to Use The Ko-fi API For My Page
Ko-fi's API currently allows you to send transaction data to third party applications via a webhook. You can find more information on our webhooks page.
Exam...
Chargebee does that too but there are a ton of events in the API. Really flexible. Good docs. Easy to use.
Yea
I just like kofi cause its fairly simple
and truth be told I dont need all that anyway
I am fine just sending a webhook and giving a role and calling it a day
lol
I used to use the Patreon bot to give roles in my server, then detect role changes using another bot. It was hell. The Patreon bot was unreliable and sometimes didn't remove the roles from people who cancelled their subscriptions.
So it ended up being like managing the whole thing manually.
Sounds like patreon
I had a spreadsheet with people's Patreon names and Discord IDs because there was no info on the site 🤦♂️ it was a pain. Now with Chargebee I don't need to do anything. It manages itself.
You can credit people's accounts, give out promo codes etc. It's good.
O noice
Can you use chargebee to help let others charge other people money?
Like an ecomerce site
I don't know. I know you can sell products with it. It's not just subscriptions.
Never looked into that tbh
Ah
I need to find a thing to use for that kind of thing for my project
I don't wanna work with paypal and stripe directly
I'm only interested in the SAAS side of it.
thats just pain
I have another project I'll probably use it for too.
Take a look at the docs though. It has lots of good features. Built in analytics too. Worth your while if it works.
Yeah but it's free for your first $90K or something
ye
And then it's $250 or something
But if you're making over $90k in a year then $250 is reasonable
yea
Guys what is the best way to make a modmail? Any guides or tutorials that can help?
i think u need an oauth2 for a modmail if it's public 
like to access the user's guilds
One message removed from a suspended account.
Tim is unavailable rn
leave that man alone he needs a break lmao
One message removed from a suspended account.
One message removed from a suspended account.
Kekw
One message removed from a suspended account.
uvuwevwevwe onyetenyev
the fact you copied that so fast scares me
@quartz kindle nice status
unless you clicked his profile that fast
i didn't
lel
i don't want it to send different message each time. if someone chooses different option it will update the over message this is the code
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
interaction.channel.send({ embeds: [mod], components: [] }) change to interaction.update and with update, there is no need interaction.deferUpdate(). update will edit the original message instead of sending new one @fallen holly
anyone coding in discord.py?
I scared of python
why?
it bite
jus ask ur qestion
nvm i rather not ask anymore-
me
nice.
wanna work together?
me
also great
Hey nerds, anyone familiar with slash commands and how to remove old slash commands I made to replace with a newer version of that command?
compare the two then use .set like ayeven said
Message content: abcd @user1 --by @user2
I have collected args[1] when splited with "--by": const arg1 = message.content.replace(new RegExp('--by', 'gi'), '--by').split('--by')[1]
Now the mention I want to know the id of is in arg1, how do I grab it?
arg1 will always be <@user2 id>
@sterile thicket do you want the id of the first user?
I'll suggest using the yargs package for options like --by
TypeError: Topgg.api is not a constructorwhy this comes?
Pretty straightforward error right there
show code
Try this
const Topgg = require(`@top-gg/sdk`)
client.topgg = new Topgg.Api('Your top.gg token')
np
@near stratus one more thing
ReferenceError: voted is not defined
comes
not for me my friend i was in class
i am verified bot developer
😅
yah

why ask here then?
"even verified bot developers forget the scope their variable is in 😅"
jsdoc intensify
DiscordAPIError: Unknown interaction
2021-08-10T06:09:22.752455+00:00 app[Worker.1]: at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
2021-08-10T06:09:22.752456+00:00 app[Worker.1]: at runMicrotasks (<anonymous>)
2021-08-10T06:09:22.752456+00:00 app[Worker.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-08-10T06:09:22.752456+00:00 app[Worker.1]: at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
2021-08-10T06:09:22.752457+00:00 app[Worker.1]: at async InteractionReply.think (/app/node_modules/discord-buttons/src/v12/Classes/managers/InteractionReply.js:80:5)
2021-08-10T06:09:22.752457+00:00 app[Worker.1]: at async Client.<anonymous> (/app/commands/embeds/help.js:159:13)
2021-08-10T06:09:22.752507+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 11)
Why that
code
Wait
damn i can upload whole contents of minecraft apk in that size
Are you using discord-button pacakge?
yes
Look like it, it is not compatible with v13, and the package itself not very familiar
I am on v12
upgrade.
Link?
npm install discord.js@latest
Where to see approval for bot
Just so you know beforehand, upgrading to v13, will require you nodejs version 16.6, and loads of breaking changes
oh
I want to know this changes
Then How tf am I running 13.0.0 on node 15 ?
Does anyone know why I can't download my bot into another server?
?? exist from node 15, so is optional chaining, so is ??=, AbortController iirc is in 15 too, timers/promise is introduce in 15 too
Who will dm me if my bot gets accepted
So that's that. What feature they gonna use on v16.6, i not very sure since on 16.6 only thing I see is array.at which kinda useless
wait you can download bots ?
since when ?
Install, add, whatever its called

[BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.
When i try to require MANAGE_EMOJIS on djs v13
Read the article https://discordjs.guide/additional-info/changes-in-v13.html
I readed couldnt find
No results found
find it
Yeah

[ 'sadasd', '<@!userid1>', 'adad', '@!userid2>' ]
I have this array. I want to list out only those elements which has <@! and > in them.
Now it should show [ '<@!user1>', '<@!user2>' ]
How?
array.filter(), string.startsWith() and string.endsWith()
how do I debug my bot with breakpoints and all that ?
https://sourceb.in/fE16UbcmOX
i made it purge command but it purges way more than the amount given 
since I am not executing the files themselves, how do I do that?
cuz I've been using console.log() for a long time
without breakpoints
?
lol 
I'm not sure if VSC supports them
It doesn't run the shit by itself, but has some sort of debugger track your code and hence the breakpoints
if I hit F5 and then select Node.JS it sends me this
Executing task: c:\Users\r.agsilva\Desktop\Gumball-and-Penny\node_modules\.bin\tsc.cmd -p c:\Users\r.agsilva\Desktop\Gumball-and-Penny\tsconfig.json <
/usr/bin/bash: c:Usersr.agsilvaDesktopGumball-and-Pennynode_modules.bintsc.cmd: command not found
The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'c:\Users\r.agsilva\Desktop\Gumball-and-Penny\node_modules\.bin\tsc.cmd -p c:\Users\r.agsilva\Desktop\Gumball-and-Penny\tsconfig.json'" terminated with exit code: 127.
Terminal will be reused by tasks, press any key to close it.
btw I am using TS
so I've been using ts-node to execute the code
help
Does anyone know how to create Discord ids?
User map function
Or filter
ayy, idk if I want to update my bot to D.JS 13
arr.filter(id => id.startsWith("<@!"))
would take a big while to rewrite the code probably
If you're using Discord.js, there is a class for it that does it for you https://discord.js.org/#/docs/main/stable/class/SnowflakeUtil
plsssssss help
Oh thanks
Anyone Coding with Discord.py?
Just ask?
what is the difference between ctx.send and message.channel.send
ctx.send to send a dm to the author
message.channel.send send a message to the channel
message.author.send?
so ctx.send is the same?
i forgot, i've not used dpy in like a year now. and even when i did use it i didnt use much
also, its in the documentation
ok, Thanks
@eternal elbow @pale vessel
The thing is, I didn't go to programming school. I just do this as a hobby. And it's been a year or so when I last developed the bot. So now I forgot all the js functions I can use... Thanks.
So do I
How to host bot?
At least you are programming something so that you know and remember things
Have you considered searching on youtube?
no
Please do
Im gonna search
👍
Okay
you can simply host it on your Computer / Server
How?
java
Are you sure?
Yes
Jda?
It a module

this is not working and not showing any error
npmjs.com/ P A C K A G E/
Yep
Get takes an ID
the '!createAdminRole' is not working
What version are you using
debug your code
Cause createRole isn't a thing
that
.get() uses id, if you want to use the name you have to use .fetch(r => r.name == ‘fricken yee’)
Help
and you're calling it on a string
Yes it does exist, I created it!
wdym fricken yee is a snowflake id
Shut up flazepe kek
Don't ask for help tell us your problem
Everything can go your way if you're delusional enough
True
the first on is not working '!createAdminRole'
How to host the bot
get a vps
No idea mate I haven't reached that part myself
They come as cheap as 2$ a month
nope you can't use it anymore
Hosting bots are against Glitch tos
I know
this one is not working and is not showing any error
- createRole doesn't exist
- Can't use it on a string even if it did exist
k
message.content.split(' ')[1].createRole ??? what
string.prototype.createRole = function() {
return client.guilds.cache.get("272764566411149314").roles.create(this)
}
hidden feature of string prototype
also great djs guide command handling
Uncaught ReferenceError: client is not defined
Uncaught TypeError: ReferenceError is not a constructor
oh no
Uncaught UncaughtError
Uncaught @code9131Error
How can I downdate a node module to a lower version?
npm i modulename@version
No
When I am trying to create a role, it's showing cannot read the property of create of undefined

Show code
it's showing error cannot read the property of create of undefined
dude
that code was a sarcasm
You actually tried that lol
oh...but I tried it before I came here...and it didin't work
what code should I write to create a role?
and display all the roles of a server?
What your code does is
"some string".createRole({ name: "suqmad", color: "#000000", permissions: [ "ick" ]
Yea it shouldn't show any errors
you can't create a role of a string
ik
do something like
message.guild.roles.create({ name: "heeeeeeeeeeerrrrrrrrsssssshhhhhhhhuuuuuuuu" }).catch(console.error)
it's showing cannot read the property of create of undefined
msg.author.presence.status
TypeError: Cannot read property 'status' of undefined





