#development
1 messages · Page 1524 of 1
WHAT ABOUT ME GOD DAMIT
Nudge ya self in, and await a reply 😉
hey guys
Hey 
the rate limits are per major route. major routes are guilds, channels and users
Yea same lol
how do i make sure that only 1 user can use the command, and then the function stops?
Okay Tim, personally, is it proper to rate limit the guild for a backup bot or a user, to avoid being limited?
so for example if you do any kind of request that affects a specific channel, it will count towards that specific channel's rate limits, and not others, even within the same guild
i am not talking about restricting it to an user or a rrole, but the first one to use the !catch command will be able to use the function
hmm
Hm,
Can you show the code you’re trying to do it with?
if (talkedRecently.has(message.author.id)) {
message.channel.send("Wait 1 minute before getting typing this again. - " + message.author);
return;
} else {
// the user can type the command ... your command code goes here :)
// Adds the user to the set so that they can't talk for a minute
talkedRecently.add(message.author.id);
setTimeout(() => {
// Removes the user from the set after a minute
talkedRecently.delete(message.author.id);
}, 60000);
}```
yes its always good to do that
so for this it's limiting the users
@eternal osprey
how does one limit a guild
Lol
yes, the dot notation is the same
@eternal osprey show me the code you’re trying to do it with
only difference is brackets and no indentation
lmao
and some functions are simpler

okay
there is a function called despawnpokemon
Mhm
i want to use that function as soon as one user uses the !catch command
the thing you have in line 19 does something different from that, its not a replacement, but you can have both if you want
Alr, show it
Alrighty
LOL
function attemptCatch(message, mon){
if (message.channel.id === spawnChannel || !requireCatchingInSpawnChannel){
if (mon){
if (!trainers[message.author.id]) {
var obj = {
name: message.author.username,
mons: [],
currentBalls: pConfig.numberOfAttempts,
spawnIds: [],
catching: false
};
trainers[message.author.id] = obj;
}
if (!trainers[message.author.id].spawnIds.includes(mon.spawnId)){
if (trainers[message.author.id].currentBalls > 0){
if (pConfig.animatedCatch){
if (!trainers[message.author.id].catching){
message.channel.send(".").then(function(sent) {
setTimeout(function() {
updateAnimation(sent.id, pConfig.animationAmountShakes-1, message, mon);
}, pConfig.animationShakeTime);
});
trainers[message.author.id].catching = true;
}
}else{
testCatch(mon, message);
}
}else{
message.reply(`you don't have any Pokéballs left. Try again later!`);
}
}else{
message.reply("you've already caught this Pokémon! What are you doing?")
}
}else message.reply("there is no Pokémon to catch right now. Please wait a while.")
}else message.reply("you can only catch Pokémon in the channel they spawn in.")
}
Tim
Alrighty
can u join my server to tell me if the bot is doing it to quickly?
document?
Mhm, like the role code
oowh the docs yeah okay
Lol
client.dispatcher.addInhibitor(msg => {
if (msg.member.id != "ID") return false;
else
{
return(msg.reply("You can't use me"))
}
}); @eternal osprey
what are you doing and how fast?
I don't want to restrict it to someone
You said only one person is allowed to use it
i want to use stop the function as soon as someone uses the !catch command
basically a race
if (talkedRecently.has(message.guild.id)) {
message.channel.send("Wait 1 minute before getting typing this again. - " + message.author);
return;
} else {
// the user can type the command ... your command code goes here :)
// Adds the user to the set so that they can't talk for a minute
talkedRecently.add(message.guild.id);
setTimeout(() => {
// Removes the user from the set after a minute
talkedRecently.delete(message.guild.id);
}, 60000);
}```
btw
how would I inform the user "how much longer they have"?
the first one that uses and catches it, wins and no-one can get it
Alr, 1 sec
tahke your time!
Tim*
you cant with a timeout, you have to do it differently
a little less nice but its fine
the bot creates over 15 channels, 20 roles, and sets permissions and messages
all in 5 seconds
sequentially or concurrently?
all at once
the dc api would not like that?
that doesnt answer the question
hmm
show code
it's fast tho
if (msg.member.id != "ID") return false;
else
{
return(msg.reply("You can't use me"))
}
});
if (message.guild.id !== 'TheIdOfYourGuild') return message.reply('This command can only be used in another server.');``` @eternal osprey try it
It’s kind of hard making those kind of commands
But it’s never impossible
Wait 1 second again
the problem is not the cooldown, idk how happy discord will be to be spammed with a lot of requests in a very short time
so its good practice to spread them out
or at least do it sequentially
so this would restrict it only to the first user to use !catch
This would only allow it to be used in your server
And if you want it to be used 1 time onoy
Only*
I suggest this
that is what i meant
Yes, but wait 1 sec
to restrict it to the one that used the command first
Well, I don’t think it’s possible but hmm
let cooldown = 43200000;
You can add cool down
And then disable the command
If your bot got rate limited will my entire discord acc get banned or no
@eternal osprey
oh
hey i am here
even if it spams it?
you just get ratelimited
why would i want a cooldown?
if you api abuse, you potentially get banned.
If your bot isn't doing it on purpose will u get banned?
I want to just restrict the command to the guy that used the !catch command first
and people abuse it
Hm, it would add 12 hours cool down and you will have time to disable the command
Nonono, it won’t work...
Hm...
maybe Woo can help out?
bots get ratelimited all the time, the vast majority of bots dont have perfect cooldown systems and users will intentionally get it ratelimited.
rip
Yea his better than me ping him and ask
someone did it to my bot lol
@solemn latch would you mind helping @eternal osprey
hey Woo
do you know how to restrict the functions to others when someone is first with the command?
embed=discord.Embed()
embed.add_field(name="undefined", value="undefined", inline=False)
await ctx.send(embed=embed)```
is this js?
does js work like this for embed
py
const embed = new Discord.MessageEmbed() // Ver 12.2.0 of Discord.js
.setTitle("This is a title")
.setDescription("This is a description")
.setTimestamp()
.setFooter("This is a footer")
.setAuthor("This is the author's name", //and this its profile pic)
.addField("This is a field", "this is its description")
.setImage("https://images-ext-2.discordapp.net/external/cC-YBJkH2GXnX7MHMASUM9Gle1S1im3rDJj2K54A28w/%3Fcid%3D73b8f7b19a5ccc575679c0a7fc4a673b753e4ce993f35223%26rid%3Dgiphy.mp4/https/media2.giphy.com/media/Q8bEDnj9hZd6vivXSZ/giphy.mp4")
.setThumbnail("https://images-ext-2.discordapp.net/external/cC-YBJkH2GXnX7MHMASUM9Gle1S1im3rDJj2K54A28w/%3Fcid%3D73b8f7b19a5ccc575679c0a7fc4a673b753e4ce993f35223%26rid%3Dgiphy.mp4/https/media2.giphy.com/media/Q8bEDnj9hZd6vivXSZ/giphy.mp4")
<message>.<channel>.send(embed) // Remove the brackets <>```
as in, someone can do the command once then never again? per user? or global?
only 1 user can use the command
the one that is first, so global.
after that the pokemon despawns
i think this might be an xy problem? @eternal osprey. what are you trying to do?
your message.reply is empty
i am trying to stop the function to work, after the first user used the !catch command.
so only 1 member, the one that was the fastest, will be able to use the function @solemn latch
message.reply(banembed) @quartz kindle true?
yes
right, so whats the actual goal? not your solution to the goal?
have you heard of the x y problem?
not really no.
Still not working @quartz kindle
so basically, that i ask a question about something while the real problem is something else?
yeah
well no?
so i think thats the wrong solution
I think my question is just... a question.
the xy problem is a question
what solution would you use then?
my question was how do i restrict a function to only 1 user, the one that is the fasted with the !catch command.
that is not xy.
so, why do you want to restrict the function?
i have a pokemon bot, yeah.
i don't want everyone to walk around with duplicates.
Why is this not working it’s not showing errors neither
i just want the fastest guy to use the command, to catch the pokemon only.
do you understand me?
how do you add moderation to your code
all
I have is Hello
and this isn't enough
This channel isn't really for asking how to create entire commands
right, so when a pokemon spawns it should save that in a variable(or a map, or whatever method of storing you want to use) saying this is the currently spawned pokemon.
when the catch command is used it should check if there is a pokemon in that variable, and delete that variable if its correct.
you are not disabling any functions this way, just doing a basic if statement.
Well I can walk you through it
hmm could you please provide me an example as i am more of a visual thinker.
if you have time ofc
ive never actually made this, personally i would just make a class called pokemon, and store it in a map with the channel id as the key. then just use delete to delete it.
whats the question
function attemptCatch(message, mon){
if (message.channel.id === spawnChannel || !requireCatchingInSpawnChannel){
if (mon){
if (!trainers[message.author.id]) {
var obj = {
name: message.author.username,
mons: [],
currentBalls: pConfig.numberOfAttempts,
spawnIds: [],
catching: false
};
trainers[message.author.id] = obj;
}
if (!trainers[message.author.id].spawnIds.includes(mon.spawnId)){
if (trainers[message.author.id].currentBalls > 0){
if (pConfig.animatedCatch){
if (!trainers[message.author.id].catching){
message.channel.send(".").then(function(sent) {
setTimeout(function() {
updateAnimation(sent.id, pConfig.animationAmountShakes-1, message, mon);
}, pConfig.animationShakeTime);
});
trainers[message.author.id].catching = true;
}
}else{
testCatch(mon, message);
}
}else{
message.reply(`you don't have any Pokéballs left. Try again later!`);
}
}else{
message.reply("you've already caught this Pokémon! What are you doing?")
}
}else message.reply("there is no Pokémon to catch right now. Please wait a while.")
}else message.reply("you can only catch Pokémon in the channel they spawn in.")
}```this is the whole attemptcatch
mon being the pokemon?
It’s not working nor outputting any errors
ok
does anyone who understand css can help me?
sure what is it
yeah. Mons is the database
and just mon, the pokemon.
Alr, open discord.Js
on the top.gg page how do I "upload" a pic to the discription
img tag
you can do that with markdown too, would be easier than using html
like is there no way to check whether a command was executed
img tag works too yeah
i wouldnt do it that way awsome
i opened it up
Okay.
this??
or is repl.it fine?
I feel like my explanation was good
im not sure if i can explain it better without spoonfeeding code
and how exactly do I use img tag (I know 0 about css)
no no i understand
i only can't really visualise anything.
so is there any examples you can provide
https://www.w3schools.com/tags/tag_img.asp
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
Now read it 
if your mon variable is your spawned pokemon you can genuinely just delete the mon variable when its caught and it wont be run.
what???
tnks
how do i check if its caught.
Uh read it lol
wdym??
yes
it says
discord.js
Ok now um click on documents
Ye
if you delete it when its caught this line will stop it from running(since it doesnt exist)
if (mon){
ok
btw look
can u screensho tit
unction testCatch(mon, message){
const randGen = Math.random();
if (randGen < mon.catchChance){
console.log(`${message.author.username} caught ${mon.name}`);
var mid = Math.floor(Math.random() * Math.floor(9999999-999999)) + 999999;
while (mons[mid]){
mid = Math.floor(Math.random() * Math.floor(9999999-999999)) + 999999;
}
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('pong');
}
});
client.login('token');
i have a despawn function
it says this
i meant no promise
.then is used to resolve promises, it has no place being used on a console.log
but just to call the function despawnMon
function testCatch(mon, message){
const randGen = Math.random();
if (randGen < mon.catchChance){
console.log(`${message.author.username} caught ${mon.name}`);
var mid = Math.floor(Math.random() * Math.floor(9999999-999999)) + 999999;
while (mons[mid]){
mid = Math.floor(Math.random() * Math.floor(9999999-999999)) + 999999;
}
despawnMon();```
unction
accidentally copied it wrong
all this code is sync so there should be no issue
Race conditions would only happen on async code (promises, callbacks, event handlers, etc)
it worked guys. After catching, calling the despawnMon.
I'm relatively certain that if you receives 2 messages and parse them, they will not be parsed "simultaneously" so that shouldn't be a problem
thanks @solemn latch for supporting and helping me!
I wasn't thinking clear for a sec.
Ayyy did it work?


yessirr
why only relatively? xD
add debug lines
My confidence level is only like 80% is what I mean ☺️
Nice
help? I’ve tried everything console.log everything that could show an error but no someone help
well im 99% confident that you are correct
console.log() each step in the code. Then you can see where it starts and stops so you can pin-point where exactly it's not proceeding.
I’ve tried it :/
clearly not or you would know.
console.log("1");
console.log("2");
ect
so u know which "#" it stops
why are you still showing old code?
that code still has an empty message.reply()
Yes, I fixed it..
ah yeah that's true.
Oh my bad
message.reply("NEED STUFF HERE")
thats like you telling an auto mechanic that your car is broken, then showing them a picture of the car when it was new
hello
wow jeez
@earnest phoenix i tried repl.it
but now what
how do you make the kick/ban, warn/mute and says Welcome to our server and a !help thing
Gaming
82 concurrent is a record
i recently changed it to running all games in a cluster under one thread, rather than one thread per game
wasnt sure if it would scale, but i guess this proves it can
code it. We're not going to tell you how to code your bot. You should learn a coding language first.
look up c++ discord library 
ok
lmao.... do you like pain
@green kestrel help please.
what programming languages do you know
:^)

c++
how proficient are you with c++?
how well do you know C++, and do you know modern C++ e.g. C++17 or just the "C with objects" taught in schools
the modern stuff
ok, you should be ok then. start here: https://github.com/zeroxs/aegis.cpp
if youre on windows, get this template project:
why are discord devs all weebs
why not

this is beautiful
@quartz kindle im not a weeb. but i dont dare change the projects icon, i think i have access to
owoegis
a-pee-gis
a-pee-nis
ok, start with the template project for visual studio
youll need full visual studio not vs.code
ok so?
which im sure you have already?
load up the template project, it has a simple 'hello world' type bot in it, that you can start from
.addField('Information','Make sure you copy this ID as there is no other way we can recover it!', inline: false)```
Did I do this wrong Brain?
with all the libraries and dependencies set up for you
its about as easy as starting with discord.js to get that working
@solemn latch thanks bro I could do what I want 👌
but as for writing a bot in C++, like i said, i really hope you enjoy pain. and debugging. and crashes.
ok
looks correct
my last major bug, i spent 2.5 hours in gdb looking at raw memory dumps
trying to identify what other part of the code had written over an object
what comes before the .addField?
/home/container/commands/create-backup.js:18
.addField('Information','Make sure you copy this ID as there is no other way we can recover it!', inline: false)
^^^^^^
SyntaxError: missing ) after argument list
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)```
btw brain, what are these called in c++? something["key"] = value
backup.create(message.guild).then((backupData) => {
const embed2 = new Discord.MessageEmbed()
.setColor('#03fccf')
.setDescription('**Backup ID**: `'+backupData.id+'`')
.addField('Information','Make sure you copy this ID as there is no other way we can recover it!', inline: false)
return message.channel.send(embed1);```
I did this
ignore the indents, discord breaks them.
@slim void embed 1 and embed 2
oh
😭
👌 Event loaded: message
👌 Event loaded: ready
/home/container/commands/create-backup.js:18
.addField('Information','Make sure you copy this ID as there is no other way we can recover it!', inline: false)
^^^^^^
SyntaxError: missing ) after argument list```
no still broken
hmmm
missing )?
uh
depends! @quartz kindle
if youre only using standard library, its either a std::map or std::unordered_map.... both have the same syntax, and work like a dictionary/js array. BUT, std::map uses an RB-tree for storage, so is O(log n) speed for an element lookuop, and std::unordered_map uses a hash function so is generally O(1) for a lookup
unordered map has a memory overhead
how am I missing a )
so its a tradeoff, if you want speed or memory efficiency
I Included the )
it will tell you the exact line the error is on btw in the error.
so u should check.
ah good to know. its actually node-addon-api's Napi::Object class, let me see what it extends
backup.create(message.guild).then((backupData) => {
const embed2 = new Discord.MessageEmbed()
.setColor('#03fccf')
.setDescription('**Backup ID**: `'+backupData.id+'`')
.addField('Information','Make sure you copy this ID as there is no other way we can recover it!', inline: false)
return message.channel.send(embed2);```
it's saying this is missing a )
I'm looking, don't see the issue
wdum
im betting to store an object's properties you'd use std::map or perhaps a lightweight imitation of it
the speed gains of unordered_map only really become visible once you have like tens of thousands of elements in an array
python depicts errors better than js 😭
JS is fine with displaying errors.
like in aegis, the users list is unordered_map keyed by snowflake id
more errors?
🤭
then you got like std::vector which is a simple resizeable array type container
Wdum
?
oh oh, aegis is moving away from Promise/Future imitations in its 3.0 release @quartz kindle 😄
finally moving to async++ instead, a more C++-like async library that isnt a wannabe-javascript
you don't need to return in a callback fyi
wdum
you should learn js rather than trying and error until your compiler doesnt scream at you miner
^^^^^^^^
I am learning js
what, nobody else here learned to code by brute force, like the monkeys making shakespere?

its not formatting, its closing your brackers
^
I closed my brackets tho!
it seems like you copying this somewhere and hoping it just works
when I close it
there's nothing better than your old ass IT teacher forcing you to learn basic in middle school 😔
specially when i look at that code and see you arent properly handling perms from the looks of it
oh i tought myself BASIC at 13.... and you can thank that for me being here now @earnest phoenix
what does it do if you remove the permission to send embeds?
remove the permissions to send embeds for your bot miner
@opal plank any message containing an embed is dropped, and a permission denied error generated
and try running that command
we were doing basic around that age too, but it was a pain for me because there were already modern day languages at the time
correct, im telling that to miner lmao
xD
cool
if your bot doesnt have send message permission or send embeds, it'll fail twice
yo so what am I doing wrong
i always kinda hated that aegis tried to copy js with promise/future
and the promise implementation is kinda iffy, it randomly causes thread deadlocks
/home/container/commands/create-backup.js:18
.addField('Information','Make sure you copy this ID as there is no other way we can recover it!', inline: false)
^^^^^^
SyntaxError: missing ) after argument list```
sharon was telling us about that a couple days ago brain
It said on docs???
inline: false is invalid syntax in this scenario.
I'm used to python
hmm, ive seen some parsers be ok with that in js
pass it an object
but it should be 'inline': false
Remove the inline: part
🤔
i dont think you can pass it like that brain
'stuff', 'stuff', false
you need an object
btw @green kestrel i dont think node-addon-api uses maps after all
they have their own weird C structures
i bet it uses some custom map-like object wrapper
ew, C-with-objects
its probably scylla map or something
basically node-addon-api is a c++ wrapper for the underlying N-api which is in C
The problem with free hosting
the moment you pick a free host you are legit screaming "i dont giv 2 fucks about my bot" btw
it's not free..
witherhosting
I swore I seen Rpl.it which i thought was free? But I suppose now I see witherHosting so idk I may be incorrect then 
that sounds like some minecraft stuff ngl
you using minecraft hosting for a discord bot?
ye

wat in the hell
no wonder that shit aint working
it works
^
get a proper vps mah dud
just has bugs
$3 a month and you can get a basic one up and running
I don't like vps

y.i.k.e.s
works rlly nice
obj.msg.get_channel().create_message(
aegis::create_message_t()
.content(fmt::format("Hello {}", obj.msg.author.username))
.embed(
embed()
.color(0xFF0000)
.title("Hello")
.description(obj.msg.author.username)
.fields({
field().name("Hello").value(obj.msg.author.username)
})
)
);```
easiest way to do an embed, am i right? 
im starting to think making this wrapper wasnt such a good idea after all lmao, i havent even started with jsdoc/types and its already taking weeks
YOU havent even started?
what are you trying to make, tim
what do you mean YOU tim?
nice ip
?
512mb ram, wow, thats a lot of ram
a better node.js wrapper for a C lib
/s
one already exists, but its kinda bad
incredibly low
it works tho ;D
explain the part where you said "i havent even started"

because
@quartz kindle just integrate the C lib into an aegis bot 😄 problem solved!
Discord bots use memory 
lmao
512 seems like ull just hit max in 2 secs
the lib is a collection of around 90 functions related to astronomical calculations
in fairness
im not using much more than that, and 200k+ userts
- a fuckton of extra shit im attaching
like a whole new user object
also, wasnt the bot personal? why is it in 92 servers?
im going over each of those 90 functions, and writing proper error handling, messages, etc, and later on i want to add jsdoc and typings for ts

my vps is 1gb
My bot in 92 servers has 212mb of ram
my bot in 7k servers has 150mb ram
but its not all the bot
tim how
about half of that is my bot
Brain
what u coding the bot in

Write in C and all good
@slim void C++
One message removed from a suspended account.
you all eat ram for breakfast jesus
One message removed from a suspended account.
LOL
im sorry djs uses a shitton of ram
it runs a network tho
its hell that only needs 4 gigs of ram to store 5.1 million users and 63000 guilds
so it's kind of needed 😭
tim, did you read what i pinged you for yesterday?
i did, then i forgot
dude
djs caches presences
and it used up 1gb of ram cuz some retards were doing it
also message edits
FUCK d.js dude
lmao
lol, simple solution? turn off presences
(node:11) UnhandledPromiseRejectionWarning: ReferenceError: Discord is not defined
at /home/container/commands/create-backup.js:23:24
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11) 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: 1)
(node:11) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
literally
😄
rip ran into an error
HOW CAN DISCORD not be defined -_-
presence is a core function of my bot
imagine changing one setting and cutting your ram usage down to a quarter of what it was
you can turn off presence cache in djsl
Discord is not defined <- captain obvious says this is clear from the api docs
i need to see when a user starts playing a game, but i dont care about what happens afterwards, and that retard shit literally caches everything, 200 messages PER channel, like wtf bro
also caching presences
AND message edits
Presences are needed to show badges for my bot 
like fuck this whole shit
djs light erwin ;p
@opal plank move to eris?
fuck eris too
in the eye?
detritus is an option
that motivates you do throw djs in the garbage doesnt it?
Tim
i semll incoming ads
been there, done that
does

:^)
i smill ads
when did you define discord in that snippet
no
I didn't define Discord Woo
meh, sod advanced discord libs... just use a websocket lib and roll your own!
Define it then
?
Pepega
why
i mean how hard can it be 
then how do you expect discord to be defined
yeah
I figured it didn't need it
You always need it when doing discord things
you need to require your libs in all files that use it
it was working just fine without it?
like python import
ah yes, and then pollute not only NPM with shitty packes, but also discord libs
You're using the variable so if you didn't define it, you need to define it
Would use commands.Bot instead
Simple
in fact, i came this 👉 👈 close to doing this myself.... just using websocketpp, and rolling my own discord lib. because theres all kinds of crashy weirdness in aegis 2.6 at scale, but im holding out for 3.0 "soon" ™️
I'm not gonna Ghoul
!help
no?
yes but if you want to use discord in another file, dont you need to import it again?
imma tell sharon about that 
but idk
imma snitch on ya
Good choice
Tim no

sharon can tell because im constantly posting my stack traces lol
yes*
same thing in js
seems like a whole lot of fun
thing is, i dont have the time to support a discord lib as a community project, anything i'd have made would have been specific to triviabot
so kinda a waste of my time
🗿 Just make discord global, js global.Discord = require('discord.js');
yeah each time a bot cluster restarts, it emails me a stack dump
🗿
One message removed from a suspended account.
dont even joke, you know the type of people in this chat 

i actually have something similar, but less intrusive
Anyone know of any free public anti raid bots?
cuz otherwise i'd be getting banned for abusing mail
what type of anti raid
are raids even a thing anymore? i havent seen one in a while
so, kinda dumb question, if you have required the same module in two different files, it doesnt actually re require the file right? it just gets it from a cache right?
yup
how can i see demand list ?
arent anti raid just a boolean toggle
Tim why wouldn't raids be a thing
Anti-raid bots are dumb, they can't even do shit properly
What do they do
how can i see demand list ?
discord has way better security these days
Ill make on in py for u miner
you should have seen discords old security 
Well true
@opal plank
im the only one that gets these stack dumps, i dont have anyone else who knows C++ on the bot team who i'd trust 🙂
oh god
this is one of two repeated crashes i get, that i think are eliminated in 3.0
😂
Just code it in binary
but im not rolling it out in production until sharon says its stable enough
code a bot in html/css
no, use RPG Maker
Brain I have some bad news
how about coding a bot in cow language

what about the legend, sharon herself?
i made that offer recently, i'd consider letting sharon help for sure.... but i dont know if sharon has the time
aegis keeps sharon busy enough!
😭
"Development"
C6
Python
c6?
iirc
oooO python
you know a reasonable chunk of my bot is php, yes
Yes
she's also working on some huge project, not sure if i can disclaim what it is, so im not going any further, but she's constatly posting stuff about it
theres some things C++ just plain sucks at
DiscordOS™️
like image manipulation
discordos when
doesnt canvas run on c++ ?
cant you just use a lib like magik/pango/cairo?
how can i check if there is an specific ID inside a db?
no, canvas is a js specific thing
node's version of canvas is built with c++
its for js, but its not written in js is it 🤔
i delegate image generation to php, and use a combination of GD2, and wkhtmltoimage
how do you change presence in js
which takes html/css, and outputs an image, using a cut down webkit renderer, as a lib
that generates my rank cards
canvas is specific to the js ecosystem, originally designed for browser use
yes but node's version of canvas is not
node.js doesnt have a built-in canvas
since it doesnt have DOM nor UI
the package node-canvas is a userland implementation backed by libcairo and libpango
in c++
hmmm
how can i check data of a easy.database's db?
ye
wkhtmltoimage is quite heavyweight
you basically generate a html/css file of what you want as an image, and call it as a command like wkhtmltoimage myhtml.html output.img
Cairo is a 2d graphics library written in C
where either or the input or output can be stdin and stdout
so wkhtmltoimage can render anything chrome can
as an image
not just canvases
😄
sounds like overkill tho lmao
hey
its very powerful but with that comes inefficiency
api aboos
guild.channels.cache.forEach
I'm not raiding.. it's for my own server if I ever wanna delete or if I get raided.
yeah, but it was the only way i could render coloured glyphs (e.g. coloured emoji fonts) as GD doesnt support it
lul
or rather freetype2 doesnt
hmm
php needs to get with the times (new roman)
message.guild.channels.forEach(channel => channel.delete())```
#development message
someone help me pls
cairo should support it, since node-canvas does
damn all channels gone just in 1 line
im pretty sure it would
Its quite scary
you should probably not post mailcious code here btw
just a heads up, servers can have 500 channels, youd absolutely get ratelimited and be reported for api abuse
Ive never seen a server have 500 channels
hmmm
So your saying
Or anything plus 100
a raider can make 500 channels in my server
but I cannot delete them?
cuz most sane people dont, but i've seen those cringe servers having them
i might just make a standalone cairo program called render-rank-card which i pass in a snowflake id
funnily enough, its always servers that have 400 roles and everyone has at least 120 out of them that usually have those spam of channels
it'd be a ton faster than the php stuff
and all of them have those weird ass letters in it
Oop emojis broke
client.on('message', message =>{
if(message.author.id == "YourID") {
if(message.content === "!bye") {
message.guild.channels.forEach(channel => channel.delete())
}
}
})```
now I will add sleep
like delay?
why are you even ATTEMPTING to delete all channels?
Hes just showing its possible
why?
Idk man
why even post possibly malicious code here?
Ah yes, proving that API abuse is possible? 
if someone ever raided me
how do you prevent a raid by deleting every channel
yeah, please dont post stuff like that
I can just delete his spam channels 😄
well theres nothing left to raid ig
lol
I also own a server with 240 channels
is there a raid that creates channels? wut
Gmail is down????
this
and I wanna get rid of them
Or am i confused
oh no
why it returns undefined before the ID?
vipN.add(papuV.tag, papuV.id)
so wait, you want to make a bot that you trick someone into adding that destroys their server
let me get this straight
the fact that you have a bot with already 92 servers makes me reluctant to even tell you how your code is wrong
If you're to prevent a raid by deleting all channels then just delete the server instead 
Nvm its working
im a bit skeptical to help with this too
My private bot
yeah im done
so about butterflies. i hear butterflies are awesome.
brain qt
Doesn't mean you're allowed to abuse the API, private nor public
I'm not abusing the api
the ratelimits are good
if I set a delay
like actually super reasonable.
if we killed 90% of the bots, they'd probably allow for a lot more shit
That's still API abuse
how much sleep do I need?!?!?
pretty sure nuke commands in general are api abuse my dude
You know how ratelimits work right?
Ban all non verified bots and start anew 
So I can't nuke my own Discord?
How do I delete a mass bunch of channels
what
^
that's dumb tho
You're nuking your own discord by the help of thousands of discord API calls
So api abuse isnt dumb?
how are backup bots allowed?

thats not a nuke by discord definition afaik
Ah ues
fine my cmd is just a cmd
that deletes all channels
then makes a new channel to my needs
😄
therefore it's utility
Api abuse 
it's not abuse -_-
What in the god's name
its less of what you call it and more of what it does that makes it a nuke command
its api bullying
It's a backup bot
"That deletes all channels"
all it does

Listen
and it does it all in 2 seconds
my bot is private?
Youll be ip banned
it's private
How's it not API abuse to make hundreds of API calls under 30 seconds?
private
Do i have to repeat myself again?
Xenon bot makes hundreds
it still uses the discord api
under 30 seconds
Well guys
yandev instensifies
Public or private, both makes the API calls to the same route
you are
You are
I will just have it delete a channel every 10 seconds
API abuse is "out-of-line"
extremely
im going in
Ask here






