#development
1 messages · Page 1713 of 1
what is your question....
It's the main function
My bot is hosted but it's offline
you are being ratelimited
Ik
you need to wait for the timeout to end
But it's already 4 Hours
Which the ? operator is trying to propagate up to
can be easy 12 hours
listen to the ratelimit event to see for how long you are locked out
I see.. so if the consume function were to return a Result, there would be no errors?
Ok bye
how many times did you break the 429?
Yeah, but I think the Ok variant would need to be an empty tuple
Break?
go past ratelimits
If you don't want to change the consume function's return type, you could use a match or pattern matching to get the Some variant value
api spam
O
I'm currently doing .unwrap_or
Understand!
Hello, I was wondering how reliable Heroku is for (one) discord bots?
unreliable from what people say
I think it's good as a starting point
but once your bot starts growing you should get a VPS
Didn't work :(
or upgrade to premium
I find heruko pretty easy to use
yes, replit kills it with the free version+uptime robot
@sudden geyser Uptime Robot
still unreliable
It kills my daily loop, even if I made reconnect=True
My bot still respond
but the daily loop is a requirement for my bot
Hi
let busqueda = args.slice(1).join(" ")
let reg = /[^\s"']+|"([^"]*)"|'([^']*)'/g;
if (args[0].toLowerCase() == "nombre") {
let obj = busqueda.split(reg)[1]
let busca_obj = data.Items.find(x => x.nombre.toLowerCase() == obj.toLowerCase())
console.log(busca_obj)
if (!busca_obj) {
mal_.setDescription("El objeto que quieres editar no existe")
return message.channel.send(mal_)
}
}
How do I change the value of a property of an object? ||I look for the object by means of its name||
mongodb
@oak crag For what do y use daily loop for?
are you meaning changing the key like "nombre" to "number" , or their value?
thats does not look like mongodb 
Post daily comics :D
I'm Feeling Bored Ya Know? I'm Going To Game Now
Let's say the name value is "computador", I want to change it to another like "Apple"
@oak crag Well I never used such a thing. Good luck finguring it out. I know only one free host but the bot goes down every 3 days
you did not anwser my question
you don't know how to reassign a value?
just 20 days without verifying with a credit card
shame
Ok thanks, I'll try Heroku for now. ¯_(ツ)_/¯
@oak crag To use heeoku you have to verify a credit card or it will run 24 days per month
me?
let test = {};
test.food = "apple";
test.super = "@tim"
no
the other guy
Mmh thanks for the info
They do not know?
test.ping = "@Tim";
I was talking about this
? 
I want to change the property of an object
then just reassign it
<Collection>.updateOne(query, {key: value}
@cinder patio
the code they showed had nothing to do with mongo tho
lemme check it again
huh? Y'all hearing something?
key equals what?
Umm
it's just the wind
don't ping random people
the property you want to change
Web name?
Say
that's not how it works my guy
learn a programming language
I mean
The web name where we program the bot
??
sigh... I guess you could check out repl.it... you can code bots there in js / python
your terminal and Visual Studio Code
but it is an array of objects
If you know js you should also know that code is generally written in a text editor and executed on your PC, not on some website, but sure 
Yeah that makes things harder, I've never had to do this so I dunno how, search on google
I entered my bot token but it isn't working
🧐
that's a crime
I am seeing a yt vid
wow... it took you a few minutes to create an entire working bot?
I added everything and my bot token but not working
Who?
Any errors?
Idk
they probably got an error
See
considering everything we've already seen... they probably don't know where to check for it
delete that
Is there any way to save?
I'm outta here
Then what you use?
a code editor
Glitch hub?
:o
We don't code on our phones
get a PC or just use already existing bots
O
Coding on mobile is doable, but it's a lot harder and the tooling is nonexistent
Mostly thanks to repl.it and glitch
people should be punished for trying to code on their phones
Uh
didnt Million maintain stuff like node from a phone
False
as for now coding on a phone is horrible, there are no good editors for it. sure repl.it exist but it sucks imo
False!!!
There are many bot coders I have seen who use dB language for coding bots....
?
Naaah
coding on phones is horrible for now, there exist editors but they are not even close to stuff like np++
Huh however there is new developed unstable language called dB
It's easy with it
And not horrible
probably something like scratch
U can keep ur bot everytime online with no cost with dB language
Nah
No verified app
doesnt mean anything
Just watch 90 mins ad
there are verified Discord bot scamming people
and there you pay
90 min ad? 
I don't pay
you pay lol, with time
No watch ad to get 90 mins hosting
any maybe a tracker within the ad
Watching an is is the same as paying, you're still giving them money
Bruh it's verified play store app
and/or data
when i do const { checkCommandModule } = require('./utils/validate'); in my index.js file i just get a Cannot find module './utils/validate' error
there where verified play store apps that scammed the shit out of people
why does Date.getMonth give me the month 03 althought its 04 (nodejs
let colg2 = console.log;
//n = ms
const format = '{DD/MM/YYYY; HH:mm;ss:nnnn}';
console.log=(lo)=>{
let dateObj = new Date();
var date;
var y = dateObj.getFullYear();
var mo = dateObj.getMonth();
var d = dateObj.getDate();
var h = dateObj.getHours();
var m = dateObj.getMinutes();
var s = dateObj.getSeconds();
var ms = dateObj.getMilliseconds();
mo=mo>=10?`${mo}`:`0${mo}`;
d=d>=10?`${d}`:`0${d}`;
h=h>=10?`${h}`:`0${h}`;
m=m>=10?`${m}`:`0${m}`;
s=s>=10?`${s}`:`0${s}`;
ms=ms>=100?`0${ms}`:ms>=10?`00${ms}`:ms>=1?`000${ms}`:`${ms}` //(ms<10?`0${ms}`:`${ms}`);
date=format.replace("DD",d).replace("MM",mo).replace("YYYY",y).replace("HH",h).replace("mm",m).replace("ss",s).replace("nnnn",ms);
//date=`${h}:${m};${s}:${ms}`;
colg2(`${date} ${lo}`);
};
I used bluestacks to download it on my pc
i am running node index.js inside the src folder
Noo it's not possible u can do some research on it
dB seems to be btfd or how the bot creator app is called
its possible lol
It's definitely possible that a verified app scams you
Nah discordbot script
happened a lot
U can checkout their server
I don't see how that would change anything?
why are you ignoring me
But if u need hosting without ads we need to pay
Money
Exactly, so you pay by watching ads, or pay real money
ok thx but why
maybe look into some libs for the parsing of time, making it in plain js is painfull
However that doesn't matter much it's easy to code with it
db script easiest script
nah i made it myself and its good
I tried personally
Easy usually means that it's very limited, you might aswell just learn an actual programming language
I mean it's easy computer language than others and we can understand it fast
ok
arguing with these people wont get you anywhere, had one of these guys here a few days ago, after 2 hours he still wanted to make me believe that btfd will overtake d.js in most popular way to create bots
Python and JavaScript are also considered to be "easy". But it's personal preference anyways
Yh
Oh yeah, I'm not trying to argue
what is btfd?
Huh we are just discussing
mobile app for creating bots, its a bit like scratch
bdfd = Bot Designer For Discord, it's a mobile app that lets you make a bot without any coding knowledge essentially
I used mobile app on bluestacks
another shot for today, nice
isnt scratch that crappy "programming language" with that cat that is preinstalled on raspberian?
Yh it has its own coding language
"i used a microwave to cook the chicken"
i think
scratch is a visual programming language
never used it
bdfd is just trash
hmm well i tried it once when i hab like almost no programming knowlage and it was harder than a normal programming language for me
dont know why anyone would use it
is there a difference between
function name(params){}; and const name=(params)=>{};?
How do you disable the implementation and reference buttons in Visual Studio Code?
can you detect if someone is typing
You can listen for typing events I believe
mk
that did help, ty
youre welcome
function creates a new scope, arrow functions use the parent scope iirc
what did you agree to lol
like it was the first search result on on bing with typing
mk
also arrow functions are another way of declaring anonymous functions
I don't really see the point on doing
const x = (y) => ()
as it's just the same as
function x(y) {};
it's not bad tho I see no point on doing so
ye but i like it more i dont know why
If I'm correct declaring them as arrow functions doesn't make them globally available
well it does for me i think
IT's not the same thing
arrow functions are different in a few ways
Read more about it here https://js.evie.dev/functions#es6-functions
x(); // true
function x() {
return true;
}
h();// reference error
let h = () => {}
besides they're different
That's not "global" that's just cheating the system into declaring it after using it
like var
well you didnt return anything
functions get hoisted at runtime
...
either way, https://js.evie.dev/functions#es6-functions tells you the exact differences between them.
def get_quote2():
response2 = requests.get("https://evilinsult.com/generate_insult.php?lang=en&type=json")
json_data2 = json.loads(response2.text)
quote2 = json_data2[0]['q'] + " -" + json_data2['a']
return(quote2)
Any advice here?
You don't need the [0] because the data isn't an array
Ty
anyone have any advice on how to fix “error: cannot find module “../config.json” ? this only started happening after i coded to support subdirectories, which is why i’m using ../
../ is the directery above
and why would you want the config file to be in a subdirectory
where i have the “../config.json” is to go to the directory above (where config.json is) and be able to find it
config isnt in a sub directory, but the command that requires it is
../../config.json maybe? We can't really tell without looking at your file structure
that was it, thank u 
How paths work:
./file.ext => current folder level
../file.ext => up one folder (parent)
./sub/file.ext => inside the folder called sub (child)
../sub/file.ext => up one folder, into a folder called sub (sibling)
/file.ext => at the root of the project, usually where package.json is (root)
i want to make a dashboard but i don't know how show users servers
const user = message.mentions.users.first();
if (user) {
const member = message.guild.members.resolve(user);
if (member) {
member
.ban({
reason: "he was bad",
})
.then(() => {
message.channel.send(`Sikeresen bannolva ${user.tag}\n Reason: ${reason}`);
})
.catch(err => {
message.channel.send('Nem tudtam kidobni!');
});
} else {
message.channel.send("Ez az ember nincs a szerveren!");
}
} else {
message.channel.send("Nem pingeltél meg senkit se!");
}```
help me
making a dashboard isn't easy - do you know what technologies you can use? How to make the client communicate with the server, and the server with the bot?
a!ban @ mention and then the reason is he was bad but i want to make: a!ban @ mention [reason that i write]
reason: args.join(' ') ?
It's tricky...
If you want the mention to always be the first arg, just use .shift() or slice and then .join
but if not, you'll have to find the mention, remove it from the array, and then join
args.shift?
yeah
hmmm
oki
and finally
i downloaded mongo-db
ReferenceError: reason is not defined
at C:\Users\user\Desktop\discordbot\commands\ban.js:25:78
at processTicksAndRejections (node:internal/process/task_queues:93:5)
bruh
what did you expect
you never defined a variable called reason
yet you tried to use it
:/
Is there a list of regular test cases? I'm a bit afraid that I can miss something
How should i define reason?
do you know how variables work?
yes
then you know the answer
._.
Let's try now it became 2+ Hour
var reason=args.join(' '); ?
Yay
Bot is now working
Online
gud
:)
: )
i am thinking what is my mistake
Check params of promise, mb reason provided there
Better use async/await
What? o_o
.ban return promise, check argumets of .then callback
oh
C:\Users\user\Desktop\discordbot\node_modules@discordjs\collection\dist\index.js:161
if (fn(val, key, this))
^
TypeError: fn is not a function
what is this
._.
hey tim
do you know if there is a way to use auto in a vector
i want to like make a function that can take in any kind of data as it will only be looking for equality so idk
Mb you should use overloaded functions?
what is that?
im a noob in c++
im a js person
vscode moment
if(!message.channel.type.toLowerCase() === "nsfw")```
Is this correct to detect NSFW channels in djs?
It's when you write more than one declaration of only 1 function
you can re define the same function with different datatypes
that's basically what an overloaded function is
ill llook into that
float sum(float a, float b) {
return a + b;
}
int sum(int a, int b) {
return a + b;
}
Imagine implementing the same function for every type
when you can use std::variant
I was just showing an example of what an overloaded function is
std::variant, mb it works for similar dadatypes, but with totally different i know only overloading
It's basically a modern union
or using generics
what
std::string
I tried my bot code on VS Code Many Times But It Didn't Work And I Got Errors
When I ran it in repl it worked
SAME Code
static typin drives me nuts aaa
why are you using c++ then
okay
it happened when i want to write out a custom emoji
clojure walks in
I doubt you really need it
compiled + completely dynamic
but oke 
and also barely readable 😔
It's a beautiful language really
Clojure isnt really dynamic in the same way OOP and procedural langs are
Looks cryptic at first but makes perfect sense
its functional so everything is immutable from the get go by default
the immutably makes it much easier to manage dynamic typing
still it's a bit weird that they choose to go with it
just oofs the JVM from doing much optimizing
is this right? if (message.channel.id === "833771277914996816")
looks right to me
try it out and see
Do any of you guys have any automated git-pull stuff (as soon as a change is made to your github repo it gets pulled to your server) and if so how did you achieve it?
From my brief research it seems like there are multiple ways, I just wanna know what people really use
@rustic nova
@rustic nova
cringe
i agree
-m 663069883009073202
🤐 Muted PROFESSOR#1628 (@atomic walrus)
spam in all the channels™️
Thank you for adding nothing to the conversation 😔
when i do const { checkCommandModule } = require('./utils/validate'); in my index.js file i just get a Cannot find module './utils/validate' error. the index.js file is inside the commands folder
full code:
index.js: https://srcb.in/gu8mMVUyfg
validate.js: https://srcb.in/hDUIK25xEw
C++ switch cases only take int/char lol
Hello there! How can I translate something spoken out loud into text? (edited by translate)
You should use an enum for this
idfk what... 
Is this homework or something homie
how can i do a loop that wait for promises to finish ```js
var res = "someString";
["someValue1","someValue2"].forEach((v,i)=>{
res=res.replace("something",/the result of the promise with input of array/);
};
//do something with res
enum TYPES {
Type1,
Type2,
...
}
// and then...
switch (someVar) {
case TYPES::Type1:
...
}
not really but im trying to learn c++
idk i just do await on async stuff
alr
FUCK OFF KONQUERER
Something like
await Promise.all(array).then(arr => {/* your stuff here */})```
i tried but it didnt work and maybe its just because the libs i use are crap
i tried that too
nah you can only await in async function
Oh?
Hello there
then probably the libs are crap or something
can you help me
yes
await in async is javascript vanilla's tho
^
can i get some help with this?
However, I do not understand most of the things you say, I would appreciate it if you set the keyboard translation to Turkish and write it.
Each enumerator becomes a named constant of the enumeration's type (that is, name), visible in the enclosing scope, and can be used whenever constants are required.

what
How about you start from the beginning lol
https://www.learncpp.com/
LearnCpp.com is a free website devoted to teaching you how to program in C++. For programmers of all levels (but especially those with no prior experience).
Anyway, let me see the concubines of my own press.
Rust question:
Let's say I have 3 files in the same folder:
I want to access the public stuff from A in B, but I'm getting the error
mod A;
^^^
file not found for module `A`
help: to create the module `A`, create file "src\B\A.rs"
This works fine when I'm using mod in main.rs but not in any other file
gtranslate failed successfully
nah i give my self a big project and dig myself out
Sounds like a good way to teach yourself horrible practices.
welcome to my development
i learn first how to
then secondly how to do it so that i can read it later
You're just making it harder for yourself but sure, have fun with that.

when i do const { checkCommandModule } = require('./utils/validate'); in my index.js file i just get a Cannot find module './utils/validate' error. the index.js file is inside the commands folder
full code:
index.js: https://srcb.in/gu8mMVUyfg
validate.js: https://srcb.in/hDUIK25xEw
./commands/utils/validate
^ Goes from the root folder.
src being the root because that's where your package.json is
3 levels
thx
help meh
with?
nevermind
Let's check this : https://learnjs.com
Lmao
In your main.rs file, define the module for A and B.
I figured it out, thanks anyways 💗
hi, I have a question, is there any bot that you can check your warzone stats?
do you even google?
is it possible to warn someone that they have leaked a bot token when you dont know who the owner of the bot is?
no, but leaked where?
on stack overflow
if it was leaked in discord, github, reddit (?) or most major sites discord instantly knows it
probably even stack
how does discord even know that
the server is only running on one server tho so i dont think its that big off an issue
hey if i run return(true) in the middle of a for loop, the rest of the loop shouldnt exec right?
it should terminate the funct right then and there right?
Sounds reasonable, so yes
definitely not spies
alright
yes, returns are function level, loops are block level
welp my check if right channel didnt work :c what have i done wrong?
exports.run = (client, message, args, guild) => {
let wyr = "833792272252010506"
if (message.channel.id === "833792272252010506") {
return message.channel.send(
`Sorry But You Cant Play **Would You Rather** Here Go To The Proper Channel; <#${wyr}>`
);
}
let a = ["Fight The President Of The United States", "Shoot A Tree"]
let b = ["Kiss The Queen", "Kill A Frog"]
message.channel.setTopic(`Amount Of Question 1's: **${a.length}** | Amount Of Question 2's: **${b.length}** | Last Player: **${message.author.tag}**`)
message.delete().catch(() => {});
message.channel.send(`**Would You Rather**\n1:**` + a[Math.floor(Math.random() * a.length)] + `**\nOr\n2:**` + b[Math.floor(Math.random() * b.length)] +`**\n`).then((message) => {
message.react('1️⃣').then(() => {message.react('2️⃣')});
});
}
My bot go wired post help messing twice
wat
either you ran sent twice or you have multiple instances running
Don’t know I haven’t use my bot today
i always thought thats how you were supposed to do it
what is the error mean tho 
or c++ or Rust
I never did that for C++
oh did c++ not need that?
no lmao
you dont need that anywhere
return is a statement not a function
^
Wait you need to in Rust?
It thinks it's going to a case.
yes
wtf
Does C++ have the functional returns?
Just remove the () and put spaces around
neither is if but you need one for that 
No
Think I need to change host that hosting my bot
Might be why then ig
I'm not putting parentheses around the return value and I'm not getting any errors
i might be miss reading this convo
lmfao sure okay

then it's a tuple
lmfao
I just check on hosting there lot of error on hosting
reason #6742 why I hate lua
lua is awfulsome
i put it there cuz error but that no fix error
you needs semis there lol
It would've been awesome for me if it had curly brackets
Lua is a great example of what a dynamic language could be performance wise and interoperability wise
rust 
yeah, like, lua is indeed fast and supported in pretty much anywhere
but...why
they made a deformed language
refresh vsc
ive been doing that a lot
Yeah VSC might just need some cache cleared
close and reopen
couldn't expect less from brazillians but anyway
but aa
Who would win, A entire dedicated team at google and open source community or one man on a missions 
V8 vs LuaJIT
LuaJIT is just insane
Did y'all know that there is a special operator just to get the length of a map
the fact it reaches near C speeds at times being Dynamic is just
in Lua
H O W? restart?
ctrl+shift+p then do reload window
Well technically there arent maps in lua the same way they are in other langs
ty
okay tables or whatever they're called
a lua map


i give up 
You removed it
i need it?
Yes
yes

semicolon goes on the closing paren for class definitions
I love semis lmao

it gives you so much control tho
i always use semis in js
People that hate strongly typed languages probably write dogshit js or pytohn code 24/7
same ^
but you cant just check plain equality without defining types
cant change my mind
i love js 
didn't say you didn't
Because each type gets compared differently, that's some dynamic language mindset right there xd
generally yeah
alot of code is pretty bad
LuaJIT performance for Python Soon™️ though
Typescript gang where youa t
exactly. i learned most fundamentals in js
Typescript really missed out on making use of the performance possibilities they could do along side the transpiling 
show me on the map where cf
wait what if i did a thing to convert all to string and brrrr
convert what to strings lmao
But why would you convert them to strings anyway?
but what about doulbe digit nums
👀 What
what do you mena
tbf, Lua is much simpler than javascript
??????????????????
22 is going to be equal to 22
what kind of question
holy fuck js programmers really be like
so I kinda see how it's JIT can be faster than V8's
cuz everything can go to string and then i can check that equality
you can check the equality of numbers???????????
????????????????????????????????????????????
char can only be one digit?
IF YOU KNOW WHY WOULD YOU CONVER TOT A STRING
????????????????????????????????????????????????????
🤨
You can also use variants and ya know
variant1 == variant2
[ord(a) for a in "ahhh"] == [ord(a) for a in "ahhh"] moment
lmfao
hii could i ask a question about bots here?
Yeah what's up
whats down
is there a way to set a limit on the amount of servers my bot can be in?
Uh
i tried googlgin and cant really find anything on it
yeet yourself out of them after a certain amount
I mean I guess you could force the bot to leave a server if it surpasses a number
or just make it private
If you want
ah
why... would you want that
uhh
Cuz not everyone wants some shitty public bot repo 
client.on("guildcreate", guild => {
if (client.guilds.size > someLimit) guild.leave()
})```
I guess
i may try that, or like @modest maple said i may make it private through the dashboard thingy
yeah
which would be better tho
private probably
yeah
for n in 0..100 {
match (n % 3, n % 5) {
(0, 0) => println!("FizzBuzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
_ => println!("{}", n),
}
}``` Match in rust is v powerful
the what
Now see thats one thing
wait till you start algebraic matching with enums
like
match foo {
Ok(SomeThing::Tm) => {
},
Ok(other) => {
},
Err(ref e) if e.kind() == Foo => {
},
Err(fuck) => panic!("fuck")
}```
dafuq
right
so if you have a Result enum for example like this
thoughts on this?
congrats you learned templating
if your enum matches Ok you'll then match the internals (rust will do this in a pass though
I was joking xd
if the value contained in the enum matches the matched value
it will branch
otherwise
How does it get to the last error?
it defaults to the other var just called other
but it can be anything
the error side of stuff
if you have Err of a Result enum
Ah
you can take the reference of the internal value (but not take it) and compare it to a condition
if that seperate condition is true branch
otherwise
I should learn rust some
🤤
and probably one of my favourite things
js -> ts = congrats now everything screams at you
cpp -> ts = congrats, now your're doing exactly the same thing but slower
ts != speed
it should be though
its fast if you know what you're doing, its slow if you dont
and if you know what you're doing, you shouldnt need ts
Sadly that's not how it works when you're on a team of 30+ people.
true
They basically went "Who needs this massively performant runtime we made for wasm that works great with typed languages"
haha i used templates to cheat the static typing
congrats you learned generics
There's AasemblyScript which turns typescript to wasm
AssemblyScript*
that doesnt look good
Man I love C++ errors lmao
size is a function
oh
It says it
this isnt js lmfao
invalid use of member function
you're not ready
no im not 
alr how can ```cpp
//checks if the vector of ints (param 1) contains an object that is equivalent to the refrence (param 2)
bool some ( std::vector<dynamic> dataSet, dynamic refrence){
for(int i = 0; i < dataSet.size(); i++){
if(dataSet[i] == refrence){return(true);}
}
return(false);
}``` in any way return a integer
so how did i get an int 
Because true = 1, false = 0
ohhhhh
When you output it to the screen it gets converted.
It's not going to print true or false
Ask the buffer that question
hey buffer...
i did and it hasnt errored tho?
im confuse
templates must be known at compile time
what templates do is basically create multiple copies of the same thing with different types
for example
then idk how this works```cpp
#include <iostream>
#include <vector>
#include <unistd.h>
template <typename dynamic>
//checks if the vector of ints (param 1) contains an object that is equivalent to the refrence (param 2)
bool some ( std::vector<dynamic> dataSet, dynamic refrence){
for(int i = 0; i < dataSet.size(); i++){
if(dataSet[i] == refrence){return(true);}
}
return(false);
}
int main () {
std::vector<char> e = {'1', '2'};
std::cout << some(e, '1') << "\n";
std::cout << some(e, '3') << "\n";
}```
im not smart 
but it compiles and runs fine
im pretty sure thats not actually using the template
I'm pretty sure you can't insert bool into stdout
that's why it's implicitly converted.
oh god now i have the top.gg team watching me be stupid 
so you dont need to explicitly call some<char>()?
Not for functions No
I still don't understand what can and can't be implicitly converted in cpp lol it's wack
im pretty sure i got errors when i tried doing that but oh well
You declare templated classes
You're probably thinking of a tempalted class non default constructor
Most liekly
Wait til you realize you don't have to template any member functions inside a class because it's also implicit
bless your soul
if i copy one file code to another file it dosent copy the css file for some reason
what
I did a little bit of work with the node api last week it was really interesting
im still trying to figure out how to define templates based on input arguments from the js side
especially when instantiating classes
yikes
had to update this library that was using outdated nan methods https://github.com/node-gfx/node-canvas-webp/pull/3
ew NaN
How do I code my bot to make a log file of deleted messages with python
nan is such a clusterfuck
yeah I've realized lolol
better lmfao
this was my first time touching native dependencies so I'm pretty new to all of it
n-api was made to fix nan's issues
which include deprecations from node and v8
n-api provides stable abstractions so that it never gets deprecated or changed across node versions
I feel every lib devs says that lmfao
says what
isnt that what stable ABI's are for?
How do I do that
I once made a gif library in C++ I should try adding nodejs support to it
although it can read gif files/buffers but can't really do anything with it 
nono I mean the goal was to be able to edit the gifs and serialize it back into the gif format like remove looping and stuff like that but it took me a long time to figure out how to decompress the LZW compression gif uses for its frames and I couldn't get compression working so I could work backwards to a gif 
it was still pretty fun though
yo pog
I mean it outputs the gif data correctly but that's all, not very useful
gif-metadata-viewer could be interesting though
output an array of png buffers
thats good
thats usually useful
what did i do to fault the segment this time 
With the questions you've asked I literally cannot tell
yo why the fuck does chrome need 2gb ram to take a 300mb heap snapshot
chrome 
except when its not
Keep sent messages twice
firefox also just has the same issues with ram with my experiences lmao
sadly their js engine sucks compared to v8
we use the unix memory usage philosophy of nomnomnom
also same dylan
in my experiences its way better
like way better
bro just stop using js just use wasmm
proceeds to leave 300 tabs open
With all command it sent it twice
that means you have multiple instances of your bot running
try restart the machine your hosting on and try again
Did that
🤔
yikers
here's your cpp of fun
Cutting out a fairly reasonable amount of client support there
I think it the hosting
mixing what's implicit and not just for you
Especially considering some of the limitations and overheads
How do I make my bot store deleted messages in a log with python
now this though https://github.com/neon-bindings/neon
aparently using cpp std::vector<dynamic> causes me to fault the segment with large vectors
this I'm kinda interested in
bet
you'll have to cache every message you get from the message create event in your library
show code
too large for code block 
Thanks and what's the code for that
what input did you give it
Are you really need vectors? You can use list, vector more complicated with memory management
i barely heard of vectors so ill try that ig
0x70 0x72 0x69 0x6E 0x74 0x20 0x22 0x6E 0x6F 0x20 0x73 0x70 0x6F 0x6F 0x6E 0x66 0x65 0x65 0x64 0x69 0x6E 0x67 0x22 0x0D 0x0A
Lol
Thanks
i tried ctrl + shift + h it in
bad idea
Search engine fun
You need to isnert into the vector lol
As I read vector items locates one by one in memory, therefore adding any items force to move all vector to relocate
You just made an empty vector with no memory size
oh i need to push?
Vectors are dynamic and if you try to override memory the way you are of course it'll segfault
lmfao

I'm pretty sure std::list is straight up trash
this looks like itll work nicely

why is my bot crashing on heroku
2021-04-19T21:29:19.913468+00:00 app[worker.1]: at runMicrotasks (<anonymous>)
2021-04-19T21:29:19.913469+00:00 app[worker.1]: at processTicksAndRejections (node:internal/process/task_queues:94:5)
2021-04-19T21:29:19.913469+00:00 app[worker.1]: at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14) {
2021-04-19T21:29:19.913471+00:00 app[worker.1]: method: 'post',
2021-04-19T21:29:19.913471+00:00 app[worker.1]: path: '/channels/113743192305827841/messages',
2021-04-19T21:29:19.913472+00:00 app[worker.1]: code: 50013,
2021-04-19T21:29:19.913472+00:00 app[worker.1]: httpStatus: 403
2021-04-19T21:29:19.913472+00:00 app[worker.1]: }
2021-04-19T21:29:20.039683+00:00 heroku[worker.1]: Process exited with status 1
2021-04-19T21:29:20.105502+00:00 heroku[worker.1]: State changed from up to crashed
2021-04-19T21
39.472568+00:00 heroku[worker.1]: State changed from crashed to starting
I've heard from C++ people the constant time prepend isn't worth losing the caching benefit you get from the adjacent memory addresses of vector elements
I fix my bot
you don't handle your errors properly and you don't check for permissions, you got a missing permissions error
which inherently crashed your app
also
cancer nickname
or rather username
Well, I'm just learn cpp at university. Basically I'm js only
Ever wonder why fuzzy search doesnt work? Ever realize that you're on the wrong versioning 
who would've thought
in fact
not only was i on the wrong versioning
i was connecting to the wrong machine

https://i.imgur.com/o2O0eJp.gif bigger problems
I'm digging the layout here though
what code should I write if I want my bot to deleted messages if certain words are in them (im using python)
It's probably best if you try to get started on your own, and ask here if you run into any questions on the way
i wrote
@client.event async def on_message(message, ctx): if ctx(no_words): await ctx.message.channel.purge()
but it sends me TypeError: on_message() missing 1 required positional argument: 'ctx'
pretty sure ctx should be the first parameter as well
oh ok thanks
and I'm not sure what you're trying to do with ctx(no_words)
i only know discord.js but it caches for you so you literally just have to handle the delete event and it gives you the message obj right there
no_words is a list of words
you can do ctx.message.content to get the message as a string, then compare that string to your list of words, best way would probably be splitting the string and using any()
ok thanks
and definitely don't use purge
y
it's both wrong and unnecessary
why would you purge N messages if ONE has blacklisted words
its the only command that I know can deleted messages
If you look at the docs for discord.py
https://discordpy.readthedocs.io/en/latest/api.html#message
You'll find that message actually has a method called delete :)
int quantity ( std::vector<dynamic> dataSet, dynamic refrence){
int filtered;
for(int i = 0; i < dataSet.size(); i++){
if(dataSet[i] == refrence){filtered++;}
}
return(filtered);
}```why is it returning whatever refrence is
<button type="button" class="ervatw-5 iboXtn">
<img src="assets/plusOne.svg">
</button>``` how do i make this open a menu ive tried form but still nothing?
what menu?
so its meant to show the guild roles
hello
when i do cpp int quantity ( std::vector<dynamic> dataSet, dynamic refrence){ dataSet.size() is always 0 
i want to ping tim so badly rn
but i shall not
Is the size of the vector you're passing in not 0?
no its very much not
i mean i guess i can run a check to make sure
okay aparently it is?
but how
Could you show the code you use to create the vector?
c++ moments
You have a vector with vectors with ints inside of it?
perhaps
Hmm okay
||yes yes i do||
tbh I'm pretty damn new to c++ myself so I probably won't be able to help much
show code?
you're not actually initializing the vectors are you?
I'd recommend the discord py server they could help quicker (invite is just dpy)
Also afaik only message is passed for the on_message event
its fixed and its working but thanks!
Ah alright
vector<vector<int>> results(batches, vector<int>(amount));
you dont need reserve
how would i define the text color as the role color? js <span style="color:<%=role.color %>"><%= role.name %></span>
i have this announcement command but in the error with 'pass' it doesn't send it to even the servers who do have the channel. how do i fix this?
member.roles is undefined?
You shouldn't announce in text channels. Server staff would not appreciate messages like that. You should use your bot's status instead
in the announcement channel
thats not what announcement channels are for lol
can someone help me? member.roles is undefined...
Probably that no one will care, but here is how I plan to tackle the situation since I don't have time to switch to an alternate cloud provider: Every time Replit restart my bot, it will automatically restart the daily loop by itself. I hope it works.
message.guild.members.fetch(message.author.id.toString()).roles roles is undefined
string.toString() lol
also, MemberManage.fetch returns a Promise<GuildMember>
not a GuildMember
ah k


