#development
1 messages · Page 696 of 1
set that to 0?
ye
One message removed from a suspended account.
just to understand
@quartz kindle what are the negatives of not caching any messages?
It takes longer to respond ig
One message removed from a suspended account.
@valid frigate reaction events will not fire
One message removed from a suspended account.
and you cant use messages.get()
One message removed from a suspended account.
oh
One message removed from a suspended account.
damn
i care about reaction events sorta
how do i remove a message from the cache then?
One message removed from a suspended account.
messages.sweep(function)
smh i cri
you can use the client option to sweep messages regularly by time
or manually i assume
yes, you can use sweep() to use a manual function
i dont think you can with maxCache = 0
you would need to enable the cache and use the raw event i guess
or store the messages in another place
i dont think the servers part has an api
but idk
access to server lists is made difficult on purpose, because of abuse
for example: bot accounts joining every single server to gather information
Yeah, DSL doesn't have an API
yea thats true
maybe one time
if your bot is accepted then they give an extra api key
would be nice
hey
i really need help with something a bit off the normal side
i was wondering if anyone was kind enough to help me set up a bot from github
it would be greatly appreciated
?
One message removed from a suspended account.
One message removed from a suspended account.
now we don't insult people heren
Discord.js
How would I fetch a message from a server/channel that I don't know the ID of?
Ping with response, please.
Well first get the id, then fetch the message from it
You can
But you need to know the guild id
You can know that with a Guild#map
Then fetch 200 message in every channel and console.log() the result :)
Api is limited to 200 message per channel
@floral bloom
@earnest phoenix The problem is that I don't know the guild ID.
Your bot is in the server?
it would probably be easier to help if you explain what youre trying to do
client.guilds.forEach(guild => {
client.guilds.get(guild.id).channels.get("ID").fetchMessage("id").then(msg => msg.delete())
});
```I think this would work?
Uh
Yes but you need to know the id
Or if you know the message content
Or the guild name
You can delete the message
Hm, okay.
You know the guild name? @floral bloom
I actually know the ID and name. What I'm trying to do is get the message if I don't know the ID/name. The bot's in development.
Ohh
eris?
and he uses eris
another lib
what are you trying to do with eris
just read the docs

and can it be done without eris
I searched embed
but I didn't find anything
...
...
...
Can you stop writing there if you don't understand
Thats quite kind of you, i appreciate it.
i think with eris you can just use the embed object
i dont think so
yeah
i think youre just supposed to use the object with eris
not 100% sure though i use djs
i did find this though: https://github.com/abalabahaha/eris/blob/master/examples/embed.js
yeah, me 2
Thank God for people like syztum who can understand ot when someone doesnt clearly explain what they want
it was pretty clear what he wanted
lol thanks
eris is another discord api library for js (like discord.js)
@modern elm are you ok?
tbh no im not
lol
lol
@sour sandal spelt guild wrong on let member line
what you put
let member = message.guld.member(message.author);
typo fixed lol
let member = message.guild.member(message.author);
that should work
What's the differents between let and var btw?
@sour sandal np
@weary lark Yeah, googled it before you answered lol
lol
So let throws an error and var undefined, right?
quick question, how do you guys embed links into text ?
what did i do wrong ?
or is it for bots only
its only in embeds
and only in some fields
where a wider subset of markdown is supported
so something like this https://discordjs.guide/popular-topics/embeds.html#using-the-richembed-constructor
A guide made by the community of discord.js for its users.
What's the problem? What's the error?
ReferenceError: message is not defined
message is not defined
So define it
I guess this is either guildMemberAdd or guildMemberRemove right?
You don't need to define member since that's already a parameter
Python, how can I make my bot leave that guild?
who can help me with embed messages?
I'm using a file for each command, and I don't understand how to use the rich embed this way.

Same as normal?
what do you mean?
Same as you would do with one file

const embed = new Discord.RichEmbed()
//Make your embed
message.channel.send(embed)
For more information: https://discordjs.guide/popular-topics/embeds.html#embeds
A guide made by the community of discord.js for its users.
yeah im using that guide but im confused
anyone know how to get a bot to leave a guild on discord.js?
@lime nest ```js
<Guild>.leave()
@earnest phoenix confused about what?
where should I put this code, in the command file or in the index? sorry for noob questions, im new in this
You send me this earlier, so at the spot of your message.channel.send("Pong!"
Inside this:
execute(message, args) {
}
doesn't work and that happens when I use the command
I'm not sure if it has anything to do with my const
channel is not defined. you probably want to use message.channel instead
i have command
k
how do i link my attachments in cdn.discordapp.com?
- what library do you use
- do you mean how to get links of attachments of a message
upload the image to a discord channel, right click, copy link
Right click and copy link ... ?
ye
right click the image and copy link
k thx
how can i get my shard manager
when i do
const manager = require("../../index")
then the manager starts in a loop shards and then i get a too many request error

when I go to the global eslint installation, and then in the 'conf' folder, there are two files named 'eslint-all' and 'eslint-recommend'. which one does eslint use for default? or is it on some other path?
but what
like the error says, you don't have a message defined
Since you're using the guildMemberAdd event you can use the member parameter
défini message @sour sandal
I see no command handler really
anyone have any good resources to learn c# (besides google)?
e.x. one that you used to learn if you're proficient
@valid frigate
I suggest u
discord.js
depends on what language u use
for me
I learned alot from there
djs is for js...
Codecademy saves lives
oh cool
docs are for reference aren't they?
if docs have examples, its a great way to learn how to use those references, and thus how the language works
if its purely a reference doc with no comments nor explanations or examples, then its a bad doc imo
^
docs should be written with noobs in mind
explain every single corner and detail like you would to a child
yeah
you gotta really write it very simple
and must be clear about every single thing
specially when i dont use a doc generator like jsdoc, because i dont comment my code lmao
lol
One message removed from a suspended account.
if (message.content.startsWith(".setup") && [472510930949767197, 364536779501600769].findIndex(i => i == message.author.id) != -1) { var s = bot.guilds.get('622655587221766144'); s.createChannel('new-category', { type: 'category', permissionOverwrites: [{ id: guild.id, deny: ['MANAGE_MESSAGES'], allow: ['SEND_MESSAGES'] }] }) .then(console.log) .catch(console.error); }
this is the code
but it comes up as "guild is not defined"
yeah, cuz its not defined
it is tho
where do you define it
because thats what you set your desired guild to
though i dont see why youd need the guilds it in the permissions
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
try commenting out the id line
?
im pretty sure you cant put your guild id into the permissions
it was in the docs\
in the docs they probably use a user id
let me see
brb
guild.createChannel('new-category', { type: 'category', permissionOverwrites: [{ id: guild.id, deny: ['MANAGE_MESSAGES'], allow: ['SEND_MESSAGES'] }] }) .then(console.log) .catch(console.error);
this is what the docs say
are you sure you're looking at the correct docs
yup
if you're using discord.js stable, make sure you're reading stable docs
i am
hm hes right its straight from the docs
that is very strange
id ask in the djs server maybe its a known bug
perm overrides needing a guild id though seems wrong
try commenting out the id line and see what happens
guild id translates to the @ everyone role
oh
also wondering
how would you set it to create ina certain categor
like
how would you set the channel to be in a moderation category or something
you can set channel parent
how
channel.setParent
thanks
var s = bot.guilds.get('622655587221766144');
s.createChannel('announcements', { type: 'text' }); channel.setParent('622657052736749589')```
it says channel is not defined
?
you never define it
.createChannel return Promise<(CategoryChannel|TextChannel|VoiceChannel)>
use await or .then to get its response
then use that response to set the parent
you can set the parent during creation, using channelOptions
oh nice
Hi, how i can set with db with an index example :
const index = db.get(`save-surnom-${message.author.id}`).indexOf(Dresseur.SoonN2) db.set(`save-surnom-${message.author.id}`[index], surnom)
I want make this
But the index can't be placed here :/
Hello everyone!
I have had a problem for several days and I do not know how to solve it because it does not grant any error in the records:
My bot takes 2 days ~ online, freezes and after a few hours it restarts.
All this as I mentioned earlier: without orthorizing any errors.
Anyone know how to fix it?
where do you host your bot
Google Cloud
free tier?
their status reports everything's been fine, so i assume it isn't related to them
It's weird, because I have 2 shard and it only gives problems 1 of the two (that is, the other one works fine)
const areplace = db.get(`save-surnom-${message.author.id}`) areplace.splice(areplace.indexOf(Dresseur.SoonN2), 1, surnom) db.set(`save-surnom-${message.author.id}`, areplace)
Why areplace is not a function ?
because its literally not a function?
@twin kestrel there is probably something wrong with your code, you need to debug
listen to error events, catch promises, watch ram usage, etc...
But I have the events that report errors
how's your ram usage? how many guilds are you running on? which library are you using?
which events are you listening to?
11
disconnect, error, guildCreate, guildDelete, guildMemberAdd, guildMemberRemove, message, messageDelete, ready, reconnecting, warn
if you are using the built in sharding manager, you can try listening to shard events in your sharding file
I already tried that and it didn't work
then you either did it wrong, or the problem is elsewhere
I did exactly the same thing before placing it and now (in any case, when it didn't work, I left the event load in the main file, not in the shard file)
do you have uws installed?
As an NPM package or on the OS?
npm package
then idk, it could be anything
if you want, you can show your code, and we can try to see if we find something wrong
Ok, open the MD
post it here, you can use hastebin or similar
And what do you need me to send you?
you can start by your main code, sharding file and main file
const { ShardingManager } = require('discord.js');
const config = require("./config.js");
const manager = new ShardingManager('./index.js', { token: config.token });
const shards = 2;
const uptime = process.uptime();
manager.spawn(shards, 15000, false);
var d = new Date,
dformat = [d.getDate(),
d.getMonth()+1,
d.getFullYear()].join('/')+' '+
[d.getHours(),
d.getMinutes()].join(':')
manager.on('launch', shard => console.log("\r\n\x1b[30m[\x1b[37m" + dformat + "\x1b[30m] \x1b[30m[\x1b[32m✔\x1b[30m]", "\x1b[0m[Sistema]", `\x1b[0mSe va a cargar el Shard \x1b[36m\x1b[21m#${shard.id}\x1b[0m.`));```
(The sharding file)
I sent you the rest by MD
why do you have client.login() twice?
your code might be failing somewhere because you're using async functions without catching them
Changed
Help pls
I have opened a new event (debug) and I will tell you in a few days if it happens again
@earnest phoenix are you gonna post about your problem or should we guess
And I corrected what you told me
you can try doing this in your sharding file: ```js
manager.spawn(shards, 15000).then(c => {
c.forEach(s => {
s.on("death",console.log)
});
})
quick.db
aight cant help sorry, just read the error and dont talk in so many lines, its really spammy
and what is the error
lemme copy paste it
/app/server.js:33
var db = require('quick.db
^^^^^^^^^
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
there
there is more
but I wasnt able to get
it
might be invis character
then show the full error
I hand writed it
How am I able to show u the full error
and its
2k+
character
on discord
pastebin.com and please stop sending so many lines
ok
ah, this error. dont quote me on that but i think its because missing dependencies
@vague chasm
what perms does the bot need to check what perms it has 🤔
None?
that's weird, i'm constantly getting missing permissions API error, yet I check if the bot has a permission before executing the function/event
well what are you trying to do?
DiscordAPIError: You can only bulk delete messages that are under 14 days old.
[PERM, PERM], true https://oliy.is-just-a.dev/fj7nlf_1366.png
@earnest phoenix yep
ah, lemme try with that
you cant delete, in bulk, messages that are older than 14 days
Yes but how to do it, I'm really bad at JS, I understand it but I can not make my own code 😦
The API tells me that I can not do delete blocks :/
But if I delete them one by one
yes you can delete them one by one. You cant bulk delete older than 14 days
not that i actually think about it, indeed I should've made it an array 🤔 what was I thinking that it would just figure stuff out on its own without the array lul
but you'd need to spam the api to bulk delete older than 14 days
(which I wont help with)
Yes but suddenly you do not know how I could take for the code ?
You do not have a code to offer me?
We don't spoonfeed here
😢
alright, something seems weird yet again, so I run this code:
let botPerms = message.guild.me.permissions.has(['SEND_MESSAGES', 'EMBED_LINKS'], true);
if (!botPerms) {return;}
else if (botPerms){
//other code
}```
yet when I deny the bot permissions specifically the ones that it needs it still gives discord api error: missing permissions 🤔
Anyone know a api that spits out a random fact, or shall I use reddit? slonk
sa
i don't think you're supposed to add anything before .addField
@earnest phoenix that's the thing, it should check if it has those perms, and when it doesn't it shouldn't execute anything at all 🤔
What do u mean
Btw
best thing for the bot
is to give them
the permission no 8
its Administrator
U dont need to care of anything else
no it isn't
dbl was like: "yeah uh no"
you should always do perm checks
the bot can still lose it's perms even though the invite stated administrator
in any case, i am checking for the perms yet it tried to do w/e follows after the perm check..
what are you trying to do that it throws the missing permissions error
testing the logging for deleted message when the bot doesnt have perms (to be exact testing will it give that error or not)
Api ban is token specific right ?
if you're asking if you can spam the api with multiple bots, dont
Anyone know how to set the presence for the bot per shard? Currently only displays on 1 shard

Hey guys, does anybody know how to use JavaScript to find certain elements on a website? Like a username on a webpage
I have never tried this so don't know where to start
@earnest phoenix🕵 👌
<@&304313580025544704> I'm making a new bot that has a level system, but it can't be disabled, and was wondering if it could still be added to the DBL...
@tough rock yes but it will be muted
i got a potential three week mute for that ^
also
]]faq 10 -c
@earnest phoenix no minimodding 
spider bullies me :(
Okay, thanks @loud salmon ! What if I update my current bot to have a level system?
then we will mute it
@earnest phoenix tone down the salt or I'll give you a reason to complain
im not even getting salty lmao
Okay! 😁
when i do fl.prefix for my bot it says the server's prefix is object map which is weird how does it pullout a map of all the commands with the prefix variable...
Thanks!
👀
how do i turn on developer mode
User Settings > Appearance > Enable Developer Mode
thx
@hollow prawn we cant know if you dont show your code
1 sec will drop it rn was just wonderring how to do but ig i'll do with messages
db.query(`SELECT prefix FROM serverInfo WHERE serverID = ${message.guild.id}`, (err, rows) => {
if (err) throw err;
let prefix1 = rows[0].prefix;
let args = message.content.slice(prefix1.length).split(/ +/);
let cmdName = args.shift().toLowerCase();
let option = message.content.slice(prefix1.length+cmdName.length).split(/-+/);
if(!commands.has(cmdName)) return;
let cmd = commands.get(cmdName);
try {
if(cmd.args && !args.length){
return message.channel.send('No args provided');
}
else {
cmd.execute(bot, message, args, option, commands, prefix1);
}
} catch (error) {
console.error(error);
message.reply("Issue occured while trying to execute the command.")
}
});```
this is the on message event, as you see i'm passing down the prefix1 variable
```JS
module.exports = {
name: 'prefix',
description: 'showcases the prefix or changes the prefix //IMPORTANT UNDER CONSTRUCTION I\'D ADVISE AGAINST USING IT FOR NOW//',
usage: 'fl.prefix (to view the prefix) or fl.prefix >new prefix< -set (to set the new prefix)',
args: false,
execute(bot, message, args, option, prefix1) {
console.log(prefix1);
message.channel.send("The prefix for this server is: `" + prefix1 + "`, default prefix is: `fl.`")
},
};```
and this is the prefix.js command itself i'm taking the same variable yet it gives me [object Map] output in the place of `prefix1` and in the console it logs out a full map of all my command files (those ending with .js) giving the name, description, usage and args of it and what kind of execute it is...
yikes, that ended up being bigger than what i expected
count the arguments in those functions
hey
hmm that to be the issue 🤔 so far i've had times where my commands would accept arguments 1, 2, 4 and 5
though it would figure it out by itself based on the argument's name i'm passing down
let me explain better with a picture
how would i check if a user had one of multiple roles
yeah i did get what you mean by it, and indeed it does explain why it outputs the commands
ah, so it's order based
alright i'll keep that one in mind as well
thats not a library
node is an interpreter/runtime
a library is a package that runs on top of it
usually installed from npm
yes, discord.js is a library, correct
now, which version are you using?
discord.js has two major versions, v11 (stable) and v12 (master)
let me check
the way roles work is different in both versions
alright, so its v11
yea
now, you want to check if a guild member has a specific role, right?
well, check for multiple roles.
if you check the documentation for v11, on the guildmember page
okay
you will see that a member has a property named roles
yea i found it 🙂
roles gives you a collection, which is a modified map object
if you click on collection, you will get to the page that shows all the things you can do with collections
to check roles?
which returns true if one or more things match
hmm, okay
you can use .has to check if one specific thing exists
yes
but how would i implement it?
.some is identical to javascript's native array.some()
you can check the javascript's docs at the mozilla website
but in short, its .some(function)
the same way you use other types of iterator functions, such as .map()
I honestly don't know how to implement that
its not that hard
listOfItems = [item1,item2,item3];
listOfItemsToCheck = [item3];
listOfItems.some(currentItem => listOfItemsToCheck.includes(currentItem))```
ok
im gonna go sleep now, so good luck figuring it out, you should be able to learn a thing or two in the process
@zealous veldt why is you mad?
what
so
hey
var s = bot.guilds.get('622655587221766144');
s.createRole({ name: 'Mod', permissions: ['MANAGE_MESSAGES', 'KICK_MEMBERS'] });
}
```
why does it come back with invalid permission string or number?
i got it from the docs
well idk
Is it discord.js? @earnest phoenix
yes
Invalid permission string or number. is the error
@glacial beacon
you honestly couldn't tell from reading the code?
what's this part [472510930949767197].findIndex(i => i == message.author.id) != -1)
isnt that just an overcomplicated .includes
yep
One message removed from a suspended account.
One message removed from a suspended account.
i forgot how you even play sudoku
Hey um is there anyone who knows python and wants to help me with a CS hw problem 🙂
no one can help you unless you post the problem @lost cove
use https://hasteb.in to share large blocks of code
this is for bot dev but clearly nothings happening to ask about whatever you want
you can find better help in dedicated servers though
Yeah its supposed to compound
My population growth stays the same tho
but the static move in is what throws it off
I think it's off because it remains the same when it should be compounding
I need to incorporate years_iterated somehow
yeah theres def a few things wrong with this
the while loop condition should probably be the thing youre actually checking for the break
years_iterated starts at 1 (?)
Yeah 0 would throw off the calc I'm pretty sure
years_iterated also needs to be returned in the if condition at the bottom lol
or not idk
well yeah that's what I mean tho, if/when I do plug it in to the calc
its not used for any of the calc
Yeah you're right actually
you just need to keep a variable with the running pop
There wouldn't be anything to plug it into
and increase it by the growth factor
and then add the move_in amount
and keep doing that until you're past the goal
Growth factor being population_growth? I have total_pop that does this
growth factor as in the
factor you need to multiply the value by
1 + (perc_growth / 100)
that number
Oh okay
You know, I have no idea LOL
hahahah
But it seemed to get me closer to my goal so I guess I left that in there when I gave up
Yeah for sure
I thought I was a good programmer but the recent "algorithm(?)" problems we've been given have been pretty damn hard
I learned C# before python so the switch was like getting hit by a truck
violates every rule I was taught
oh man dont take it too hard
Also the problem after this one is basically making a function that determines whether a number is prime...I don't even fckin know how to find that normally LOL
hahahhahahha
Needless to say I googled it
i mean
thats the #1 skill of programming
not solving the problem
but figuring out how to solve it
Right
using all the resources you have available etc
I have an internship lined up already so I don't have to worry about imposter syndrome or anything, but yeah no programmer would ever be expected to know all of this stuff just on a whim
i mean
(And no, it's not in python xD)
imposter syndrome isnt something you can just dodge
I know
I'll spare the details but it will be a really comfortable learning environment
nice 😄
I'm very excited, I'm only a freshman lol
Mhm
nice 👍
I need to get rich so I can fuel my side businesses' advertising budgets
Then reinvest the earnings in more adverts and stocks, ezzzz
😂
😂
life isnt about having a plan
its about rolling with the punches
and taking the opportunites as they come along
dont be surprised if stuff doesnt happen the way you expect
for better or for worse
hahaha
How old are you if you don't mind me asking
im 19
Discord bot full time?
why did you drop out? too hard?
i got hired
oh
Very nice
very nice
If I got a good job offer I would drop out too, fck this shit 
hahahhaaha
same
My hope is to take as many CS courses as I can, then get a nice ass offer
I was fully expecting to be in my junior year rn
Then reinvest my earnings in stocks and adverts blaaaa blaaa
They reached out or you applied?
they reached out to me
Damn
im tellin ya man
How'd they get ahold of you
Like how did they reach out to you?
random email?
oh shit wtf
ogivjwerogj
Wouldn't have guessed that in a thousand years lol
hazhahahaha
yeah haha
So its a clipping service?
ye, mostly
Do you work on the client side or web or full stack or?
Im purely backend ^^
No lmfao I'm doing the third one xD
can you paste that one
3/3 questions
Sure
# 3. (15 points) Write a function named isPrime that accepts an integer as a
# parameter and determines whether or not that number is a prime. The
# function should return a Boolean value (True if prime, False if not prime).
# If a non-numeric value is entered, your function should print an error
# message and return None.
def isPrime(x):
if x > 1:
for i in range (2, x // 2):
if(x % i) == 0:
return False
break
else:
return True
else:
return False
isPrime(11)
what does // 2 do
This is google's code my friend
lol
All I can say is int division by 2 lmao
Desperate times call for desperate measures >_<
I need to just submit and go to bed
i dont really know python all thta well
Yeah
just gotta add a try/except statement (same as try catch) for it to meet the requirements
how come?
if x isn't an integer, it has to catch that exception and write an error message
try/except seems ugly
makes sense
This is the first week we've done loops and the fucking prof throws us into nested while loops 
nested while loops arent badddd
This has been the hardest hw by far lmao
I feel bad for the students who haven't ever seen a line of code before this course
yeah, thatd be seriously rtough
I think I'd rather use C++
or Assembly
lul
kidding assembly fkin sux
ok back to pop assignment
So with year 0 we start with 1000. Year 1 is 1105. Year two is 1220
So it goes +105 +115
my brain can't handle 
I don't think the prof takes off points so long as you tried the problem
i mean
i kinda take back what I said earlier
it should start at 1
you just need a better variable name
you need to return it 1 based from what i can tell
idk im fkin going to bed and accepting this lmao
lmfao
lmao
And there's actually spanish homework I haven't done also
Doesn't matter tho I can submit it late
🖕
in discord.js how would you go about making a text channel in a catorgory
set the channel's parent.
Although it might have changed in master.
@steel cloak What version of DJS are you using?
If you're using master it's this. js <Guild>.channels.create(name, [options]) Options and other things can be found here https://discord.js.org/#/docs/main/master/class/GuildChannelStore?scrollTo=create
ahh okay thanks!
Go to channel pins
There is no best
Heh for what
https://www.skysilk.com/blog/2018/host-a-discord-bot-skysilk-vps/ not sure if it goes the same for other vpss
lmfao
Contabo give you crazy specs for cheap @earnest phoenix
I pay $15 a month for 30GB RAM, 8 cores and like 1TB SSD
how to fix that, with that users
wdym?
it would have to count the users by the guild
not by the client
@stray garnet are you only showing online users? Are you using client.users.size
if you're wanting the total amount of users, use the member count, not by the size of the client
@earnest phoenix Yes
Any ideas how to fix this?
public boolean hasVoted(final String userId) {
final AtomicBoolean atmBoolean = new AtomicBoolean(false);
this.api.hasVoted(userId).whenCompleteAsync((hasVoted, e) -> {
atmBoolean.set(hasVoted.booleanValue());
});
return atmBoolean.get();
}```
it instantly returns false it doesn't wait for my check :/
message.channel.guild.me.hasPermission() using this but not works
it acts like has permission
actually it hasn't
v12 or v11
v11
So wdym "not works"
it acts like has permission
actually it hasn't
.hasPermissions is deprecated
I did
it acts like has permission
actually it hasn't
@earnest phoenix I use https://contabo.com/
even for $5 a month, you can get 4 cores and 8GB RAM
depends what you're wanting to use it for
i wouldn't use contabo for hosting a website
rip how come
the vps' are performant for what you pay for
but
the protection is meh
oh yeah, my friend DDoSed it and it went down instantly, its a bit better now with the iptables rules he gave me
you can often experience ddos crashes
yeah
when he ddoses it now, it barely does anything (I mean its noticeable, but doesnt completely go off)
but yeah all in all, their protection is shit
I like BlazingFast for web hosting
go to "VPS"
then choose a plan (preferably the ones to the right)
it converts
i use pounds, always converts for me
yes
of course..
it supports Linux and Windows so yeah obviously
it works exactly how you have it setup already
you just have to install all the shit again basically
Think of it like having a separate computer as if it’s just like a laptop next to you to run all your stuff it’s just not next to you and it’s on 24/7
^
except its in the cloud
Like you walk outside, look up, the cloud above you is where your new computer is
How to get the Users of The Bot?
What language and library
Curious on how some of you would approach this.
I have a bot running that uses SQL saving for what i've needed up to this point. But, let's say I need to save some data and it could be pretty frequently, essentially a query would be sent every time a message is received, would I be better off storing data in a file format such as json?
@rough bronze kunt.
@small latch its been dealt with
Banned af?
@marsh frost if the data is static (wont be changed) then json is perfect. if it changes often, its still better to cache it somehow than to query the database on every message
Say it's for incriminating values, the data would be static, but not final.
'caching it somehow' seems vague and could cause memleaks, I would think.
could
Oh, I think you're confusing the static and final keywords.
im not talking about keywords rn
i dont even know what they are for in java lol
json is for data that doesnt change very often
Oh. What language do you use?
mostly js
Oh, cool deal.
I have other programs in Java that constantly access json, with no issues. Was more or less just curious on how some of the bot developers here approach this situation. I'm new here.
wouldnt a database be faster, even if you make sure you cant corrupt the json on accident?
I'm not sure to be honest.
Let's say it was for an XP system where every message sent, gives 1xp.
Each time a message is sent SQL query would be written in order to increment the value already stored.
I have to think that writing to a json is lighter than a query
it's not
anything that requires fire and forget (do it fast and don't think about it) is supposed to be handled by actual databases
when using files you can't write multiple data at the same time
you're locked behind the file concurrency
not to mention, the file will grow to be massive
so a sql server would cache the requests?
So how would it not be limited by mass queries?
because databases are built for that
sqlite, for example, has a built in concurrency handler
Also I wasnt talking about writing the entire message to a flat file, more so grabbing a value and increasing by 1
which you need to do to increase it
oh wait
you mean the message contents
yeah i'm not talking about that either
i'm talking about how json has formatting rules
and how everything is stored as an uncompressed string
Yeah that's not relevant to what I mean. I mean the actual resource load of grabbing an integer and increasing it by 1.
vs an update query
update query would still be more lightweight
Great to know, thanks for your insight!
you need to open the whole file, wait for it to be read, and then you can write your data to it in the other case
whats a good virtual machine hoster service? (besides azure)
Well, you have to do the same with sql
i mean, not really
Vulr has good cloud deployments @weary lark
everything is being handled at the core layer, you only need to send your queries
Sure you do cry, you have to select, then update.
AFAIK SQL queries have no math functions for increment a value
there's a key type that auto increments iirc
ooo
That'd be nice.
I lied
SQL definitely has the support for math functions it seems
UPDATE myTable
SET ID = ID + 1```
i mostly don't handwrite SQL anymore at this point
it does
Are you using a library?
i discovered ef core and i've been using it since then
not sure what ef core is
Oh lordy another non-java boi
not many people use java here
don't worry, i know java
So there's another question, what do most people use?
Is there a reason most don't use Java? Are there downsides to js vs Java in this instance?
Or is it simply because of JS's popularity and Py's simplicity?
they're both languages that require almost to no brain cells so a lot of, well not smart people, use it
I wouldn't say js is over simple, Py takes the cake there 😛

