#development
1 messages Ā· Page 1847 of 1
you can receive interations in 2 ways: websocket or webhook server
to respond to them you make a post request usually, or you can respond to the request if you're running the webhook server
anyway @quartz kindle
you said you'll make your own discord lib next year
It's been a year
lib where ?
its been a year? since when?
Since last year? 
you are?
its gonna be very basic tho
slash supported ?
is it gonna be another library that tries to achieve -7mb ram
everything is supported
but you use the official api methods
not any abstraction
with node.js thats impossible lol
but it will basically not use any ram, as long as you dont cache stuff
cache is not gonna be built in
New library?
perhaps
Djs based or from scratch?
scratch
Oh intresting
0 dependencies
Oh wow
typescript?
shame
Well gl. Sounds like a pain ^_^
theres not much reason to use ts
there isnt much to type
i'll just slap a .d.ts on it
shame
and you can probably plug in some existing discord-api-types shit
shame
f u
Wasn't d.ts is enough for ts user
most of it is already done
Who needs ts lol
ew voice
The djs new voice is ok. Only prob i see is issue of ytdl-core against node 16
What's its github?
Custom caching with props?
Oh thats nice
Have you benchmarked it against libs like detritus and djs
benchmarking by what measurement?
memory usage, startup times
theres no caching so theres no ram usage
with all caches enabled
i will add caching as an opt-in thing
not done yet
start up times are not really lib dependent, its just 5 seconds per shard
depending on your concurrency limits
that benchmark is dumb
how do you even benchmark a lib with zero cache
depends what you're comparing
if you want to compare memory usage, you have to devise a scenario where each lib is caching the exact same objects and properties, so you can compare structure efficiency
anything other than that will produce worthless results
one thing you can benchmark properly for example is websocket processing efficiency
put a timer to measure how long it takes for the event to be emitted since the packet was received
i did profile my stuff, but didnt compare it to other libs in that area
but my ETF is faster than discord/erlpack lol
Surly your new lib will be the fastest with zero dependencies?
I imagine other libraries have other...
Nvm just answered it.
in general it should have less cpu usage than most other libs
bandwidth usage is the same, depending on your compression and encoding options
memory usage depends on what you cache
So it's probably the library for large scale bots then
plus i didnt make any caching yet
but i have some ideas for a more efficient structure
is gonna be a lib for large bots and for lib makers
since its just the basic components
you can built an actual lib on top of it
That's cool
idk if im gonna make a proper "client", right now theres no client
just standalone rest, websocket and webhook server
Handling ratelimits?
there no rate limit handling
the requests give you the headers for you to do it
since a lot of people want cross-process rate limit handling, this is something they have to implement themselves
how do i run a method in a class?
like:
class {
constructor(){
}
a(){
return "a"
}
b(){
}
}
I want to use the a method in b method. how would i do that?
this.a();
the order doesnt matter
oh
functions and methods are "hoisted" in js
meaning the code is scanned first, and all functions and methods are registered, and then the code runs from top to bottom
Maybe a plugin system, where you can install additional features...
So it's my first time using events handler i am getting this errors like user not defined, etc.. and some events not working but the bot is working without errors so i need someone to tell me the problem or if i am using it with wrong way
(node:11636) UnhandledPromiseRejectionWarning: ReferenceError: id is not defined
at Client.<anonymous> (E:\C) Developing\Wolfy-NewHandler\index.js:59:71)
at Object.onceWrapper (events.js:421:28)
Handler
const eventFiles = fs.readdirSync('./events').filter(file => file.endsWith('.js'));
for (const file of eventFiles) {
const event = require(`./events/${file}`);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client));
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
}
Model
module.exports = {
name: 'ready',
once: true,
execute(client) {
console.log(`š¤ Client is Online!`)
}
}
Hey so I am trying to make a command which invites a different user to a 'battle' and they need to write 'accept' or 'reject' (kind off like y!ship from yui) but I have no clue on how to do this, can anyone help? Because I couldn't find anything on google
whats on index.js line 59?
client.once(event.name, (...args) => event.execute(...args, client));
there isnt anything else in the logs?
I am using this code
const Discord = require('discord.js')
const snipes = new Discord.Collection()
module.exports = {
name: 'messageDelete',
execute(client, message, messageDelete) {
snipes.set(message.channel.id, message)
const LogChannel = message.guild.channels.cache.get('877130715337220136')
if (!LogChannel) return
const DeletedLog = new Discord.MessageEmbed()
.setTitle("Deleted Message")
.setDescription(`**User ID:** ${message.author.id}**\nIn:**Content:** \`\`\`${message.content}\`\`\``)
.setColor('RED')
.setThumbnail(message.author.displayAvatarURL({dynamic: true}))
LogChannel.send(DeletedLog)
}
}
if(message.content === "battle"){
battle()
} else if(message.content === "reject"){
nothing ()
} else {
nothing ()
}
Can you tell me the wrong and the correct ?
alr ty I'll try it out!
it was supposed to be a sarcasm
o h
the order is important
you need to set up a cacher for that
if you want client to be the first one in your event file, then it has to be the first one in the handler as well
Should it be ...client, args ?
ohh alr ty
and etc..
client, ...args
I wonder how is this snipe command going to work after the message.content coming in effect
the biggest question is, will discord accept "snipe" as a valid reason for privileged intent?
Yeah, that what I was going to said, since it really intrusive on prvacy
don't top.gg reject snipe related command too? I read it long ago before my name become green
it's a gray area I think
snipe shouldn't be allowed as a command imo
works now thanks!
content = request.get_json(force=True)
userid = content['user']
Is this how I get data from post request after server voting in topgg website?
because it doesnt work for me, the auto role reward didnt work too, but i did received the post request
you have to show more code than that
@app.route("/***", methods = ["POST"])
async def upvote():
try :
auth = request.headers["Authorization"]
if auth == "***":
content = request.get_json(force=True)
userid = content['id']
# do something with the data
else :
abort(403)
except KeyError :
abort(403)
return 'processed'
is this right for changing a bots status to do not disturb?
async def on_ready():
client.remove_command('help')
await client.change_presence(status=discord.Status.dnd
is the status name dnd or should it be do_not_disturb ?
Sorry if this is rude, but why ask us when you can play around with it and find out yourself?
It won't do any harm
unless you're like me and removed half of the code once trying to redo it and realising you just made a spelling mistake xD
Thanks
Correct
cannot read the property of onclick of null
error: question.context is not defined
https://www.npmjs.com/package/topgg-autoposter
If I use this ? Bot Shard Count will be 1 by default ?
I splitted a part of my code in several machines.
But the problem is that the mongodb cache gets outtodate on some Machines.
Since I hyradte Cached Document for updating it based on the user interactions, ....the out- to-date cache causes problems. Will redis help keeping my cache up to date?
What does snipe do tho?
Donāt know that word tbh
It shows the (last) deleted Message in a Channel...
Hmm I mean it can be seen in the audit log anyways, can it?
ok
Personally I suck with HTML and web design, if you post your code someone else will probably be able to help you
how do i get the server ip form vsc for voting log
i want to test in vsc do how do i get the server ip which is required for webhook in bot edit page
run ifconfig in Linux or ipconfig on windows
oh ok thx
np
so do i need IPv4 Address?
IDK
never tried with ipv6 (don't know how it works)
Do u have to do something like port forwarding after that? Or nah?
umm excuse me ?
If you're talking about kubernates use the port it shows
not the one you opened in code
Ah Alr thx š
Sorry š
Audit logs don't show the contents of the message, and message logs are (usually) restricted to power roles, snipes can be used by anyone
you will have to do stuff in your router too tho
huh?
what i need to do?
i am having hard time figuring it out :/
Never done that but just pointing the webhook to your pc IP is not enough as your request will be blocked by the router
iirc
:/
port-forwarding
umm how?
google it...
:/
Added an A record for docali to my server IP
Tried running certbot to create an ssl certificate but got this
sudo certbot --nginx -d docali.giuliopime.dev
http-01 challenge for docali.giuliopime.dev
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. docali.giuliopime.dev (http-01): urn:ietf:params:acme:error:dns :: DNS problem: NXDOMAIN looking up A for docali.giuliopime.dev - check that a DNS record exists for this domain
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: docali.giuliopime.dev
Type: None
Detail: DNS problem: NXDOMAIN looking up A for
docali.giuliopime.dev - check that a DNS record exists for this
domain
Do I just need to wait more time to have it working?
or am I missing something
If you donāt host your own DNS service it can take a while until your record got pushed to all DNS resolvers
Looks like it hasnāt be pushed yet
If thereās no typo in it
I'm using namecheap and it has been always really fast for the other subdomains I used
uhm ok just gotta wait then
Doesnāt automatically mean itās like this 100% of the time
ik
Automatic is no valid value.
Only seconds are accepted.
That might means automatic is > 60 mins I guess
(regarding your provider)
If so you will probably need to be patient
Just check the tool I mentioned over and over again.
If it resolves your hostname successfully but not so your system, then flush your DNS config
i am high its 1 am
is there anyway to like
check a number
divide by 10
if returns with a decimal
number++
so like
11/10
returns 1.1
so the "explanation" above should return 2
message.guild.bans.create() keeps banning banned users as well. I want an error message or so to tell if someone is already banned. How?
check user if banned in guild
if return true, return nothing
But that also uses cache to check, and thus gives me wrong info
I tested it, but even if the user gets unbanned and joins the server immediately, and I run the ban command, if says takes it as banned user
@earnest phoenix
hi era
?
scam
you weren't fast enough š¦
Lol
so i am getting the error:
discord.ext.commands.errors.NoEntryPointError: Extension 'cogs.basic' has no 'setup' function.
with main.py as:
import discord
import os
from discord.ext import commands
bot = commands.Bot(command_prefix='+')
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{filename[:-3]}')
else:
print(f'Unable to load {filename[:-3]}')
bot.run('token')
and basic.py as:
from discord.ext import commands
class Basic(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def ping(self, ctx):
await ctx.send("Pong")
def setup(bot):
bot.add_cog(Basic(bot))
Anyone can help with the issue?
I'm using "express" to create an API, but I want to create a central route, for example:
router.get('authorization/:userId/:password/router')
how can I do this?
with express.Router()
the code seems right tbh idk what the error is if anyone can help:
Traceback (most recent call last):
File "H:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\env\lib\site-packages\discord\ext\commands\bot.py", line 612, in _load_from_module_spec
setup = getattr(lib, 'setup')
AttributeError: module 'cogs.basic' has no attribute 'setup'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "h:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\main.py", line 11, in <module>
bot.load_extension(f'cogs.{filename[:-3]}')
File "H:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\env\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "H:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\env\lib\site-packages\discord\ext\commands\bot.py", line 615, in _load_from_module_spec
raise errors.NoEntryPointError(key)
discord.ext.commands.errors.NoEntryPointError: Extension 'cogs.basic' has no 'setup' function.
im not sure but i'll give it a try
same error
show what you did
Hi Tim
from discord.ext import commands
class Basic(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def ping(self, ctx):
await ctx.send("Pong")
def setup(bot):
bot.add_cog(Basic(bot))
Can anyone help me with this error please?
This is the code
import { CommandProps, Command } from "../../@types";
import { db } from '../../index'
import Discord, { MessageEmbed } from 'discord.js'
import ms from 'parse-ms'
export = {
name: "beg",
category: "",
aliases: [],
description: "",
usage: "",
run: async function(e: CommandProps) {
const {
message,
args,
client
} = e
let user = message.author;
let timeout = 60000;
if(!message.guild) return
let multiplier = await db.fetch(`multiplier_${message.guild.id}`);
if(!multiplier) multiplier = 1;
let amounta = Math.floor(Math.random() * 30) + 1;
let amounts = amounta * multiplier;
let beg = await db.fetch(`beg_${message.guild.id}_${user.id}`);
if (beg !== null && timeout - (Date.now() - beg) > 0) {
let time = ms(timeout - (Date.now() - beg));
message.channel.send(`You poor little begger... Beg again in ${time.minutes}m ${time.seconds}s `)
} else {
await db.add(`money_${message.guild.id}_${user.id}.pocket`, amounts);
await db.set(`beg_${message.guild.id}_${user.id}`, Date.now());
message.channel.send(`You've begged on the streets and received ${amounts} :basic:`)
}
}
} as Command
and the error is the same? "cog has no setup function"?
Traceback (most recent call last):
File "H:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\env\lib\site-packages\discord\ext\commands\bot.py", line 612, in _load_from_module_spec
setup = getattr(lib, 'setup')
AttributeError: module 'cogs.basic' has no attribute 'setup'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "h:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\main.py", line 11, in <module>
bot.load_extension(f'cogs.{filename[:-3]}')
File "H:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\env\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "H:\Discord Bots\NyxCentral Bots\Nyx's Bots\Lady Nyx\env\lib\site-packages\discord\ext\commands\bot.py", line 615, in _load_from_module_spec
raise errors.NoEntryPointError(key)
discord.ext.commands.errors.NoEntryPointError: Extension 'cogs.basic' has no 'setup' function.
no idea then, i googled it and most solutions have the exact same code as you
check if your fstring has the correct file name
looks like parse-ms doesnt support commonjs
Is there a fix?
you can import it using async imports
or use an older version, for example 2.1.0
otherwise read this
File name is basic.py
Same as Class = Basic and setup = Basic
I might just end up using bot.load_extention command
Imma try something else later but for now I gotta go to my job
not if you retrieve the ban list before checking
Yep figured that out, thanks
does the highest role in a server have the highest position # or the lowest
Did you already notice?
The record got pushed to other DNS resolvers and seems to be active.
Is there any way to do a Discord request ,which returns the intents of the bot
Yeah I opened a ticket and they fixed something
Highest
so <@&264445053596991498> will always be lowest - 0
function getUserFromMention(mention) {
let matches = mention.match(/<@!?(\d+)>/);
if (!matches) return;
let fetchedMember = await message.guild.members.fetch(matches[1]);
return fetchMember;
};```
how can I await here in side a `try{}`?
your function isn't even async
everyone will be the lowest
ah i See
looks like im gonna be flipping a lot of < to >
oh lol, I'm blind
I always confuse that too, but then I remember "nothing can be lower than everyone -> arrays can't have negative values -> everyone = index 0"
bored, give command ideas
a command that says how bored you are
make it check your github commit history to calculate your boredom
less commits = more boredom
If thereās no GitHub profile or history throw an error and exit the process 
I will invite your bot, I promise
A selfban command
better yet, a raffle command where the prize is not being banned from the server
I remember seen that suggestion a lot of times already, thatās your favorite, Mac 
Better yet, the prize is getting banned from the server
Ban lottery
Russian roulette
Damn thatās actually a pretty good idea tho
like, 5 guys deserve being banned, make them play russian roulette and ban one
the last one is pardoned and not banned
Thatās what u tell them but at the end heās getting banned, too
This is actually quite a good idea, Iāll take this for my bot
Shoo go away my patent is registered already
youre evil
I wasnāt before joining this server and channel 
how do I get the sending users profile picture from a SLASH command?
Ive managed to get everything working, but the slash commands only return smt like "84aec7a39f0841689549539d9e09a85c" as the users pfp
more accurately, how do I get it to send me something that could be used as the "author icon" in an embed?
embed.author.icon_url: Scheme "84aec7a39f0841689549539d9e09a85c" is not supported. Scheme must be one of ('http', 'https')
Well yes cause you have to form it into a valid url
how do i convert it to a valid one?
Integrate your service with Discord ā whether it's a bot or a game or whatever your wildest imagination can come up with.
But I am sure there is a better way to do this
Surely that isn't the only option to get the avatar
What library are you using?
interaction.member.user.avatarURL this is the current option im using
discord.js v12, slash commands
use displayAvatarUrl
ok ill try that
That should return a actual url
so
interaction.member.user.displayAvatarUrl?
It's a method
displayAvatarURL
š¤
.displayAvatarURL()
^
URL
Caps
interaction.member.user.displayAvatarURL()
Yes, also try it and see please
interaction.member.user.displayAvatarURL()
perfect
kk
I tried googling, ive been trying to learn slash commands all day, and this is the point ive given up and come here
(node:4) UnhandledPromiseRejectionWarning: TypeError: interaction.member.user.displayAvatarURL is not a function
š¤
{
"type": 2,
"token": "A_UNIQUE_TOKEN",
"member": {
"user": {
"id": 53908232506183680,
"username": "Mason",
"avatar": "a_d5efa99b3eeaa7dd43acca82f5692432",
"discriminator": "1337",
"public_flags": 131141
},
"roles": ["539082325061836999"],
"premium_since": null,
"permissions": "2147483647",
"pending": false,
"nick": null,
"mute": false,
"joined_at": "2017-03-13T19:19:14.040000+00:00",
"is_pending": false,
"deaf": false
},
"id": "786008729715212338",
"guild_id": "290926798626357999",
"data": {
"options": [{
"name": "cardname",
"value": "The Gitrog Monster"
}],
"name": "cardsearch",
"id": "771825006014889984"
},
"channel_id": "645027906669510667"
}```
this is the extent of info the slash commands return
thats from the developer portal
Slash commands are easy once you know what data they return
i need to look into slash commands, they seem cool
The djs docs have all the info
theyre really fun
and annoying
Use the djs docs and it'll be easier
i prefer buttons
ah
ive spend 2 hours there already
youāll get the hang of it
can u do buttons on v12?
Why not use v13?
i took one look at v13 and ran
everything seems confusing at first
its taken me forever to drill v12 into my brain, idk how to learn v13
youāre not gonna find it any better avoiding it
V13 isn't that different
my brains wired weirdly, once ive learnt something i cant "unlearn/update" it
You will have to switch to v13 anyway
And it's probably better to get used to it now than to scramble at the last minute when v12 gets deprecated
Soon the v7 api will deprecate
^^^
if theyre only deprecating the v7 now ill stick with v12 till its one version from being wiped
hopefully by then ill know enough about code to switch easier
anyway, so back to the matter at hand
(node:4) UnhandledPromiseRejectionWarning: TypeError: interaction.member.user.displayAvatarURL is not a function
There are guides online on how to update your code for the changes in v13 if you need help
There is also the change log
which provides everything they changed
which in reality isn't a whole lot tbh
ok, as soon as ive mastered the basics of slash commands ill move to v13
i mean take your time
v13 is the version that has the best support for slash commands
youāre not in a rush or anything
...
I mean, it is the version where it was really worked on, and added everything else the component api has to offer
I didn't even know v12 had any support for slash commands
i just need to work out how to turn
84aec7a39f0841689549539d9e09a85c
into an image...
wait what did u say that was again?
smt like a hex image?
Wait are you sure you are using v12, cause I don't even think v12 had support for slash commands without an external package
im 100% sure lmao
"discord.js": "^12.4.0",
Tf
:OOOOOO
wait lemme try that
AHA!
THASNKS
I don't think v12 had slash commands but you could add an extra package or smth. Idk. I just went straight to v13 for the slash development.
im literally just using pure v12
Magic?
lemme send whole package file rq
Has to be
Seems legit
"dependencies": {
"canvas": "^2.8.0",
"discord.js": "^12.4.0",
"fs": "0.0.1-security",
"ms": "^2.1.3"
}
I am your god now.
Until v13 beta came out slash commands weren't a thing to be used without external packages
Unless im mistaken
That was my belief also
Im just build different :3
I was on v12.5.3 for the longest time
Don't get it why discord.js can't simply update their library like all the other ones
They did update their lib?
I mean, 12.4 isn't even the latest v12 package either
You gotta refractor the code tho

lemme quickly add that to the code brb
With new things you have to do that yes
Its not going to magically do it itself once you update the package
JDA doesn't need you to change all your code
Nor does discord.js
like it has been from v11 to v12 for discord.js

I hope you understand that those were major updates
patch: don't care
minor: don't care
major: you're fucked
"https://cdn.discordapp.com/avatars/"+interaction.member.user.id+"/"+interaction.member.user.avatar+".png"```
?
And those changes were made to keep the use of it as easy as possible
yeah but still not very nice having to refractor your code
Thats how it is sometimes
it means the library doesn't have very good fundamentals
sometimes
JDA has a solid structure that doesn't need to change even for major stuff like slash commands
Looks ok
tesing rn
Yes well java is very different from js
I have found it is easier to maintain a java codebase then a js codebase that needs changes sometimes when implementing new things to work well with others
Why not use buttons
can you have a multi-line slash command?
Buttons are life
can u use buttons on v12>
I am wondering if these are slash commands or prefixed "slash" commands
gimme a sec to show u
Java is far more stable than the JavaScript ecosystem.
client.api.applications(client.user.id).guilds('835167782488113153').commands.post({
data: {
"name": "suggest",
"description": "Suggestion Command",
"options": [
{
"name": "suggestion",
"description": "Type the suggestion here",
"type": 3,
"required": true,
}
]
}});
Indeed
I MEAN IF IT WORKS IT WORKS NO QUESTIONS ASKED lmao
Until it doesn't anymore
smh

Yea stay on v12
i prefer not to think about that ;-;
and then pull your hair out when it stops working
This is not a good practice
Especially if you wanna make a successful discord bot
id rather stay with v12 for now than deal with the bugs on v13 :3
dont tempt me pls
ok name one thing v13 can do that v12 cant atm?
Lmfao
slash commands
Do we even need to
ive just used slash commands on v12 lol
cache control
Slash commands, buttons, select menus, context menus
shhhhhhh ur not helping my case š
All of this can be done 10x easier in v13
through an archaic api
i can do all of those
may be harder
and more complicated
and more stressful
actual support š
and more annoying
fuk u got me
I feel bad for your bot
rude
truth
I mean do what you want but again once the bot starts fucking up don't come whining
š¤·āāļø
new language
*version
š¤
isnt 90% of djs the same, its just a few changes š
ready to be dumped
more like 98% of djs is the same
shhhhhhhh im living a lie rn that its 100% different
wait wha...
All that has changed really is the new component stuff and interactions
ok this weekend ill try switch
and some slight changes to how you send messages and such
but then imma come here and ping u when i need help ;)
š i really havent even looked at the new version lol
no point
AND MY BOT IS TREATED WELL! IT ONLY GETS BEAT TWICE A DAY like smh
Just worry about that shit on v13 im telling you
They have classes and shit that makes it hella easy to make buttons and such
i have to honor the stuff v12 has taught me
my first economy bot was built on it, now thats memories :>
Anyone still on v12 are weirdos 
u sound like one of those people that throws out a perfectly good ps2 calling it trash
No literally v12 is useless
says the one with the succubus lookin pfp :P
You have a pfp of a command block from minecraft
:P
I don't wanna hear it
Also you don't even know who it is in my pfp so that leaves you even less room to talk
i havent changed my discord name in like 900 days
š i havent changed mine in like 5 years
Tbh a basic bot only needs to change the message event to messageCreate and possibly what's inside their message.send() methods. That's all.
wait thats all?
@forest drift keep this server sfw 
sowwy
lemme rephrase my statement
it looks like a very intermate and memorable scene between to deep lovers focusing on the/one of the feminine faces, with added red pencil horns.
who>?
You'd be absolutely wrong
the series sucks anyway
oh crap... ive seen some of that series
Eh
either way i stick by my statement ;P
either way, im proud ive gotten slash commands to work on v12
Or just donāt use djs and never have to wait for huge version updates to use features already in the API
Problem solved
what do u use then?
Detritus
what now>
Itās a library for the discord API
first pic that comes up when i search that
Itās also a term from biology
Node package
this line stops me from wanting to use it
// Tokens should be considered secrets and stored in a configuration file that is not
makes it sound like its babying its reader
The documentation is not very thorough
If anything it does not ābabyā you at all due to the docs being barebones
ur just digging the hole deeper
djs is hot dogshit compared to detritus imo but whatever
BOI
tims lib will dominate even detritus š
Weāll see
opinions are opinions.
I'm also waiting patiently for Tim's lib
ill just stick with the origional
Personally Iāll stick with detritus mainly because I like the format and itās also completely built for typescript use
// Spawn the client in an async context
yo Detritus got either sexual or minecraft references here lol
// Note: Due to how Node handles tasks, the script will block until the Detritus client
// is killed.
sounds sketchy
You do understand that is not sexual or from Minecraft, correct?
I'm just curious, sounds like it will be more focused on larger projects, and not have anything "extra"
really will be intresting to see how that works.
yes
It'll probably just be a light API mirror
still, im tired rn and have no control over the shite i speak
go sleep
states this:
// Tokens should be considered secrets and stored in a configuration file that is not
then does this
const token = '';
lmao
// Simple ping/pong command
interactionClient.add({
description: 'Ping!',
name: 'ping',
run: (context, args) => {
// Commands should return a promise to ensure that errors are handled
return context.respond(InteractionCallbackTypes.CHANNEL_MESSAGE_WITH_SOURCE, 'pong!');
},
});```
tho i will admit that does seem slightly easier
Itās because they arenāt going to waste their time giving you a tutorial on how to store a token properly
Itās not a library meant to hold your hand on the basics of a discord bot
youre starting to sound desperate, its ok, take a deep breath and find your happy place.
Storing your token securely is something thatās a universal requirement across all libraries
Therefore the docs assume that you have some experience
me causally having a token stored in a github config.json file
eh
dw the bots got a bit of security
if anything except the exact applications code is used itll auto reset the token
I feel like thatās not how it works but ok
If someone has your token, they can log in using your token
like i said, i have methods to prevent that

i have a backup script running on my own server, basically detects anything the bot does that isnt accurate to its current script and then automatically resets the token
worst case scenario a discord server gets nuked
And then your bot gets blocked for API abuse.
because that would require a brain :3
Sounds like a complete waste of time when you could just spend 5 minutes to set up an environment variable
and thats something i clearly lack
also i have zero clue what an environment variable is
Google search 
i wonder how many times bots like rythm have had their tokens found and abused?
i mean having a generator find it
Thatās not a reasonable way to find tokens
if u create a decent system, its not a matter of if you get the token, its a case of when
They are specifically designed so that doesnāt happen
I donāt think thatās true
Good luck bruteforcing tokens
The chances of guessing a token are so unbelievably low that it would likely never happen
Ive managed to build a password crack that can solve a 13 character password in an average of 17 hours using a basic counter system
just upscale that
and maybe get the token in like 8 months?
You understand the concept of exponents right
Pointless + ^
It is a ridiculous amount of combinations
ikik
Unsolvable for likely even the worlds supercomputers
hence why i use a counter system, its purely a matter of when, although it could take years
Bruteforcing is not a reliable method of getting anything
but theres always a chance
You'd just be wasting your own time tbh
Just because you can theoretically run a password cracker for 100000 years doesnāt mean that itās reasonable
although slim, you could guess the token by accident lol
No
Good luck
Thatās why tokens are generated like they are
its not meant to be reasonable, its meant to be possible
If i didnt have a slight renascence of morals left id make smt and send u a perfectly plausible script by tomorrow
it would take a long time, but eventually itd get the token
rude smh
mathematically, it would
It would be more efficient to simply wait for quantum computers to exist to then try bruteforcing
Do you know how tokens are generated?
yes. but in those few minutes you have it, you can feel powerful :>
If that boosts your ego you got issues and should seek therapy š¤·
before having rythm send a hitman after u
oh i know i have issues
its more an accomplishment
the more people say its not possible the better it feels to do it
then you feel empty afterwards
An accomplishment of purely random sequence of characters
but i mean meh?
but how many people could say they managed to get rythms token?
How many people bothered?
not much
How many people actually care enough to do that?
but my goal would be to get it, then send the bots creator a small message, before exiting the bot and forgetting about it
Like I said, good luck
There is no remote possibility of you bruteforcing a bot token
Not just Rythms, but any bot token
waffle, its possible. thats a fact
Also fairly sure that is against their tos to some degree
So you would be met with a ban
dude even thinking about trying to get a token is against tos
Well no
Funny what kind of length people will go to to do stupid shit
Thinking about it isn't the same as doing
How many times have I said that just because itās possible, that does not make it a possibility
I just think itd be cool to get the token, login, send the creator a cute message along with the script u used, then leave the bot with no damage done.
I worded that poorly
The fact is that you will not be bruteforcing a token
If you were able to brute force a token within a reasonable amount of time, discord would change the way the generate tokens
some people find a relationship, others complete a pointless task, we all have out wants
Doesn't discord make its tokens with bot ID + Worker start time + worker id or smth
No probably not
I can't remember what it was
Maybe that+ a hashing algorithm or something
Yea
Im now purely gonna make a script and calculate its average token time to prove to yall its possible
Well over 10000 years for the amount of processing power you likely have
Probably even more time
there are already programs that can tell you the amount of time
fudge i just got a massive fright, just saw a dm pop up with the same pfp as my bots, and after this convo i just jumped to conclusions but thankfully its just a group :3
actually heck, lets do the math. you said 17 hours for 13 length right?
64 core?
yes
alright brb
with my current shitty system
how much do you think you could improve that, practically?
i wonder at what point a randomiser is more plausible
i think, if i split the load etc, i could get it down to 5 hours average for 13 characters if im lucky
so 3x faster?
yeah
maybe
the more resource avaliable to me the faster
also then just set the script running on multiple instances...
but lets go with 5 hours average for 13 characters for now
I believe youāre severely underestimating how fast that time will increase when adding more characters
ik
52^13
52^59
how much more is that? š
and thats low for discord compared to a password
A shit ton
because discord has special chars, which i didnt account for
again, if u have the script running on multiple instances constantly u could divide its time a lot
52^59?
yes
52 possible char types, 59 chars long
ye so long a calculator cant display it š
that would be smt like 17.5ZZ...
Literally at the limit
i can easily handle 1.000 x 10^52 and below but higher than that is becomming too long
Lmao no
š im going to actually do the math.
Math sucks
175,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
thats the final number
Literally more than a googol combinations
Math rocks
no
thats just how numbers are displayed above a certain point
If youāre claiming that you can crack a bot token from brute force, youāre just wrong
its to limit screen size
still possible
thats the max time, the min time is "1"
Why are you trying to prove something here actually
Figures.
Itās technically possible for me to win the lottery 150 times in a row, but will that ever happen? No.
???
if u did it long enough
oh its much worse than that
again, its between 1 and 175,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
so it could be 7 if i get lucky
The chances are so impossibly low itās difficult to comprehend
its so much worse, the percentage more is so large its an exponent
You should never forget Iām your best friend, mate 

the thing is i can calculate around 17 thousand possibilities per script, per second with the new system i just checked, so host that script 300 times and itd take around
3.4405439e+94 seconds... fuk
if it took you 3 hours to figure out a password 13 chars long, it would take you
3453136900000000000000000000000000000000000000000000000000000000000000000000000000 hours
to figure out a discord token, on average.
not top.gg

discord
fuk
the thing is again, it could take 1 second or it could take 3453136900000000000000000000000000000000000000000000000000000000000000000000000000 hours
He can wait out the heat death of the universe as long as he gets the sweet sweet reward of your discord bot token
statistically, if you put every computer on earth on this problem, it will take millions of years š
ok, just got to hijack every single processing source on this plannet
lmao
I SHALL NOT GIVE UP
watch i get my own bot token before any other one
thatd be too perfect
waffle stop being negative
Iām not being negative, Iām being realistic
You are not being realistic
the thing is there are millions of bot applications
so in reality i just have to get one to be happy
This conversation isn't gonna get anywhere, is it
nope
interesting math question though š
Millions of bot tokens means nothing when the amount of combinations is so much vastly larger that millions of possibilities makes an unnoticeable difference in your chances of finding it
First the API IP ban appears, then a range ban and after they identify him a few guys with baseball bets will knock at his door and make sure he stops
HAH jokes on u! i dont have a door 
Then they donāt need to knock
fair
ur just grumpy i havent invited u to help ;P
Yes I would love to waste my time on helping you solve a useless problem with no reasonable solution in the first place
tho using the same system, its kinda scary how fast ur password can be worked out lol
perfect, ur in
well ur helpin me so
Ah yes
Guess youāre more effect in crawling all possible IPs and try to brute force insecure (anwsering) endpoints like MySQL databases etc.
Thatās at least what happens multiple times per second on each of my systems the last 12+ years
For opened up endpoints of course
the thing is, i doubt you can figure out a 13 char length password in 17 hours.
13 characters long, 2 million years by actual computers trying to crack a password.
āhttps://i.woo.pics/931ac2a047.webp
if you found a way to do it faster youd be getting praised by every goverment ever, and likely worth millions of dollars.
Yeah
- keep in mind this
Perhaps if your password is aaaaaaaaaaaaa and youāre checking in alphabetical order
(Not including symbols and numbers of course)
unless your environment is you can generate numbers that fast that it can do every possible combination in 17 hours, thats not actually bruteforcing a password
Nowadays security agencies donāt bother with passwords anymore but with vulnerabilities they can use to bypass any security layer before it comes into place
Brute force attacking still happens at any time but vulnerabilities are more attractive nowadays I guess
people do hack "passwords" but its mostly just someone knowing someone elses password because they told them 
EVEN if lots of endpoints, databases etc exist in the public web with default setup passwords
I remember a long time ago at my middle school, the school had a password system based on studentās ID numbers in order to make it easier to remember
The thing is
ID numbers were no secret
years back i used the same password for a few things, one of the services leaked everyones password. I still get emails of people trying to login to random services with my password. 
People passed around their report cards which had their ID numbers on the front
insecurity at its finest
Happens to me too and still, itās quite funny sometimes
Thankfully, being middle school students at the time we had nothing sensitive on our accounts other than some grades and addresses
Still incredibly bad
Yeah
thing is, how will you test if the token is even valid? it doesnt matter how fast you can generate combinations, what matters is how fast you can check its validity
true
didnt think about that
brute force and dictionary attacks heavily rely on having a valid hash to compare with
@solemn latch we need to redo that calculation
otherwise its useless
š
the gateway allows 1000 logins per day, with 5 second cooldown
the rest api will probably ban you after too many attempts
@solemn latch i think its gonna take a couple million more years...
if normally we were gonna do 17k a second...
cloudflare bans on a handful of failed requests
I was giving benefit of the doubt to show how unreasonable it still is despite API limits and such
waffle sit down
we gonna be here
a long time
i wonder if we're reaching the billion years mark?
š yeah i didnt include every combination for tokens either 
we passed billions long ago
three sexvigintillion four hundred fifty-three quinvigintillion one hundred thirty-six quattuorvigintillion nine hundred trevigintillion
^ in words
xD
wait thats hours š
Lmfao
An impossible ride*
Even google doesnāt understand what number this should be
I feel like i did this math wrong.
394193710045660000000000000000000000000000000000000000000000000000000000000000 years?
...
waffle... we gonna need more waffles
and a couple billion computers
should be easy
three hundred ninety-four quattuorvigintillion one hundred ninety-three trevigintillion seven hundred ten duovigintillion forty-five unvigintillion six hundred sixty vigintillion years
š
wtf is a quattuorvigintillion 
Thatās a job for the next generation starting at their age of 1 to brute force the API to see if they were successful with 100
d.js RAM usage?
Sounds right
Guys
I solved it
Just get three hundred ninety-four quattuorvigintillion one hundred ninety-three trevigintillion seven hundred ten duovigintillion forty-five unvigintillion six hundred sixty vigintillion computers, then youāll crack every possibility in just a short year
Just hack the owner's Discord account? Yeah. Sounds easier.
i think were overthinking this
yes
probally
Lmao
(dw its regened)
lol
lol
we'd be quicker finding the guy and holding him hostage till he gives the token, then we kill waffle on the way back and have a good nights sleep
you can find tokens quite quickly. the number of people that put them publically on repl is very high.
Yeah
ikr
And GitHub
couldne be me ;-;
should regen them if you find them, but yeah
github auto resets if its a public github.
Pretty funny how people store their tokens in an insecure config.json file
I wonder who would do that though
As well as people posting them in this channel before realizing
yeah smh
Howās that insecure?
(Uploaded on a public site)
I use GitHub purely because itās convenient
what about discord
deletes account
it is a dev tool š only reason to ever use it is convenience
Im fully oldschool relying on backups I made from my code files
Even better. Store it on a post-it note and type it in every time you start your bot :^)
isnt git like super old
Wow 2005?
Must have been a nightmare
gits not the first version control š
Carve it into your caveman walls while youāre at it, then humans 10000 years into the future can discover shitty code 
āOh no he leaked his token on his wallā
poor guy!
Well at least the humans in the future will only need 10,000 years to find the token 
Starting as total noob ~ 14 y ago there was no Discord to ask code related questions and forums werenāt popular

You was forced to try and see and to read docs if they existed
poor people before 2008
āhttps://i.woo.pics/dba9647adb.webp
Stackoverflow should be in my education section on LinkedIn
That wasnāt a really a thing either at that time
Iām grateful for the existence of discord and forums for programming... The courses Iāve taken in school so far have taught me over the last year and a half what took me 2 weeks to learn from people helping me and just looking things up as I go
Time has changed dramatically
tbh, prefer that method of learning.
Looking things up is so powerful, too many devs on discord dont use it.
But will only benefit from these things if youāre interested and willing to learn not like people getting into here asking for code because they have no clue and wanna learn the basics
In beginner programming, 99% of the time someone else has had the same question as you and thereās an answer for it on the internet with a quick search
You can literally figure anything out if you know how to use Google.
Exactly
Everything I learnt was through Google searches
My Java course last year started with binary numbers and ended on basic array methods. Whereas it took me a few weeks to get through those things by using Google myself
And I've been doing websites since Stackoverflow was released š
Indeedā¦

