#development
1 messages · Page 1169 of 1
What do you guys think about me being a bot hoster? Where I'd put a bot in it's own lightweight VM and have every connection for that VM go through tor.
oHH
ive never seen a bot hoster be not sketchy af @faint prism
youd have to find out how to not be sketch
Yeah, it would be super sketchy
VERY sketchy
If fact, I shouldn't do it. That's how sketchy it would be. Thank you for talking me out of it lol
man
i only said a few words 😄
i know what went wrong oin my OG code
yw
Only in rare cases
filtered.get(ids[i]).user.username instead of filtered.get(ids[i]).username
The issues are still there
if i did
The issues are still there
I CRASHED
my discord crashed 4 times today alr
hi?
crashed again
ok well it would work if i did filtered.get(ids[i]).user.username not filtered.get(ids[i]).username
Still has the potential to error
ok
im not sure if this was a command or something, but your also fetching every member of the guild every time this is run.
which will result in a major increase in ram usage
i only said a few words 😄
@solemn latch I mean. Only new bot devs, who don't know what their doing, would go for a random server host like that.
It makes me think of how many bad actors there are who are doing just that
i use a host i am affiliated with
idk if i get the credit for using my own code
lmao
how would I push data to an array in a mongoDB?
findGuild.update({ $push: { ignoredChannels: args[1] } })
await findGuild.save().catch(e => console.log(e))
the findguild is just the guild, if i log it it returns the proper ID
guild is just
{
ignoredChannels: [],
guildID: 'id',
}
i've looked online
it's not working for me
such a common question weirdly
@thick gull is this what you tried?
https://docs.mongodb.com/manual/reference/operator/update/push/#definition
db.student.update( { "subjects" : "gkn" },{ $push: { "achieve": 95 } });
like that?

not sure, ive had this question a few times and i just gave thost two links
always worked out 🤷♂️
why this not wanna work? https://i.callumdev.pw/cu636.png
this being client correct?
ya
O
next time will result in a ban
someone clearly dont care
rip them
i think it is around 1 per second (or 5 every 5 seconds)? not entirely sure though
just make sure it is a reasonable cooldown
you need a cooldown between adding roles
make sure it is reasonable
so give it a couple seconds between each time you add a role
@thick gull I know you should be able to push an array of objects to a mongodb document
Idk the command, but ik it's possible
yeah
i figured it out now
probably not the best method
but my code isn't optimized whatsoever
anyone do discord.py and wanna work on a bot with me and my mates as a project
we are all pretty decent not pro pro
dm me
this ain't the place to ask for devs to join your project
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
Welcome to InfoJobs
ngl saying stuff like that makes it sound like you want someone to do 99% of the work for you

^
Rip badge for those who wanted it
@opal plank what did discord do
they seperated it
if you verifiedd before today
you get 'early' verified bot dev
like early nitro supporter
Oh lmao
which im not sure was a good idea cause there's already a ton of accounts being sold, it'll like 4x that market
If u applied before today*
XD
and there will be WAY TOO many badges on some people's profile
Does anyone know how to make a discord command that tells how old someones discord account is with JavaScript?
that's the client
?
well, still applies for users
Does anyone know how to make a discord command that tells how old someones discord account is with JavaScript?
what lib
discord.js v12?
(i assume so) so check https://discord.js.org/#/docs/main/stable/class/User?scrollTo=createdTimestamp out
Yes it's discord.js
this just returns the timestamp their account was created
then you can do whatever you want with that, such as getting the precise time their account was created
and you can use a simple package to do that, such as moment.js if you really want https://momentjs.com/docs/#/parsing/string-format/
Thx
wut
What
Im using "screen" command to let the bot running
like screen node bla bla
nvm I have an error at my code
I leave my bot running for like a week, and after an update it crashes like... 24h after being online
Use pm2
any command is throwing an error and Im not handling it correctly
Use pm2
@honest perch Yeah just saw it right know
pm2 leave logs right?
just watching the console, someone just typed 3 commands at the same time with the argument: SPAM
someone is getting blacklisted 
../../fonts/comicsans
@client.command(aliases=["die"],pass_context=True)
async def leave(ctx):
guild = ctx.message.guild.voice_client
voice_client = guild.voice_client()
await voice_client.disconnect()
Having issues with a leave Voice channel command.
Error: 'VoiceClient' object has no attribute 'voice_client'
../../fonts/comicsans
@honest perch thsi DIDNT work
No such file or directory /home/fonts
Add a dot for every level up
?
..../fonts maybe or just .../fonts
Pleas Help Me For Bot
whats a good db thats not mongodb
So if you give my bot an ascii symbol(UNESCAPED_CHARACTER) it will go down cuz i didnt put an error handler there

how do i make a command that pulls a random image from a google search
like !image cat
font not loading
how do i make a command that pulls a random image from a google search
@worthy glacier you sure you need a google search, or should you be looking for a cat api
google search
i want any keyword
i tried using the duckduckgo api
but it kept failing
font not loading
@earnest phoenix code?
there's one on youtube I saw a while back using cheerio
How long does it normally takes to approve a bot?
Yap, +4 weeks
oh ok
Hello i have one question
User#flags
Returning bitfield: 256 what does that mean?
I want to check badges of an user but idk how
uh
how to self deaf in discord.py
A bot cannot self deaf someone, this only possible on client side
A number indecates if they're partner/employee/systm etc
Yeah but
UserFlags returning 256
That's not in the list
And also i don't understand this part of the doc
https://discord.js.org/#/docs/main/stable/class/UserFlags
new Discord.UserFlags(bits) what is that
Hm i think i understand
Maybe flags.toArray()
Ah yeah it was toArray() nvm
cheerio didnt work for me it kept getting flagged as a ingenuine search
and i didnt get it to successfully scrape from duckduckgo either
How do i have a always running check. Like if a user reaches a certain amount of currency the bot sends a message?
why is my mysql broken
my query is SELECT * FROM ads ORDER BY ads..bid DESC LIMIT 1
how do i prevent images from overlapping on canvas?
how can i get the guild's id in an on_user_update event? (in discord.py)
Error: Error: EACCES: permission denied, open './../../coins.json'
how to give permission

The dev server is a shit show rn
you don't get a badge at all @topaz fjord
Unless you already verified you can't get one now
Verified dev is changing because too many people made shit rushed bots for it
yeah
but now nobody gets it
they ruined it for everyone
but discord has valid reasons
¯\_(ツ)_/¯
I 100% agree with the reasoning
Good thing I don't notice badges 95% of the time
I only began to notice them because of everyone going ogmgogkgomg bot
Can you send me a link to the dev server? @thick gull
@earnest phoenix I can't find an invite
That's the official one
When i give someone coins, i store it in a json file, but if they have 100, and i give like 90, they now have 10090 instead of 190. heres the code
json database go brrr
wouldn't you just get the value do data+90?
not 100% sure what your doing
Im doing
might be my migraine brain
Don't use json as a db
You're adding a number to an string
It will inevitably mess up and corrupt the entire thing
Which doesn't actually add up
parseInt(userinfo[message.author.id].coins) += parseInt(coins);```
omfg so smart so smart
Don't use json as a db
It will inevitably mess up and corrupt the entire thing
JSON isn't a read write file
lol no
yeah but that doesn't mean your supposed to
if u need a 1 file db use sqlite
whats a good db?
Mongodb
Wot
Mongo is easy to learn once you get the hang of it
Haha JSON database go BRRRRRRRRRRRRR
it took me a while to figure out prefix but now that I have its easy
sqlite for JS requires python
@zenith knoll no?
You need python to use quickdb iirc
u only need build tools to compile
Could not find 'python'

quickdb is fucking sqlite
mongodb and mongoose overwrite to the same driver, they both just have different functions and methods
lemme test my bot
Yes
after the parseInt(userinfo[message.author.id].coins) += parseInt(coins);
oh
better-sqlite3 is a native c++ package that needs node-gyp and build tools to compile
node-gyp requires python
I have tried several times to try to even connect to mongo and I fail at it 😫
Provide the correct the username, password and database name then @zenith terrace
Idk i wrote it while sleep deprived
Clusters have them
get precompiled build
Provide the correct the username, password and database name then @zenith terrace
@earnest phoenix I know that part but I just stupid at everything else
read docs
Lmfao
https://hasteb.in/uyakunag.js
does this usage look "usable"
My bot restarts everytime weather command is run
Tf
My bot restarts everytime weather command is run
@delicate shore glitch runs it again right
Your bot crashes and glitch restarts it after five minutes
when vps is cheaper than glitch
oh
https://hasteb.in/uyakunag.js
does this usage look "usable"
@sick cloud to me yeah
cool
wdym language
i mean liv
probably
lib
no
but I want a role in this server
ok

you don't get a role in the server for making a discord library
I wanna join discord but i am only 15
?
if I can't have verified bot dev badge I'll do it for library
you don't get a role in the server for making a discord library
@sick cloud ik
that's for dbl api libs
no
shivaco has no role

why
its the one i sent the hastebin of b4
Server stats
@short lantern wrong server
wrongserver™️
go to its bot page and click join support server
Boomer™️
nice
I found this lib https://github.com/iam4x/diskord
there's alot of libs like that
they have no docs tho
oo
i made one
never completed though and unsure of if it works
but you could look at it if you want
I want to make a full game on my bot
Still thinking of a decent idea
maybe a fishing game..? That's done to death though I think
^
what is lua
so I'm brainstorming a hecc alot
lua is a language
it was my third language but its the oldest one I know how to use still, well not LUA but roblox lua
disappointing
there's alot of things I would want to do
I want to make a social media for somereason but it won't go anywhere obviously 
my js db is half done and i haven't done docs yet so that's a nice oof
Can you get info on a user without any mutual servers
dumb question time but how can i filter using a sort of object
like filter this
[
{ id: 1, name: 'bob' },
{ id: 2, name: 'bob' },
{ id: 3, name: 'fred' }
]
using this
{ name: bob }
to get this
[
{ id: 1, name: 'bob' },
{ id: 2, name: 'bob' }
]
not a func but an array of values that all must === true to filter correctly
find all ids with name bob
loop
not helpful
make a for loop
not a good idea with large files
because i want it to be dynamic
so i can do a filter ie. { name: 'some username', type: 'user', age: 4 } etc
but aren't loops
- Types it out *
not good
loops are synchronous
in long files
Idk man im kind of -3 iq
How can i filter user with a certain type of badges ?
i have try with
client.users.cache.map(u => u.flags)
But it's returning
[
UserFlags { bitfield: 0 },
UserFlags { bitfield: 256 },
UserFlags { bitfield: 0 },
UserFlags { bitfield: 65536 },
undefined,
undefined,
undefined,
UserFlags { bitfield: 128 },
UserFlags { bitfield: 64 },
... 41628 more items
]```
isn't that just literally filter()?
.toArray()?
yeah but i want to do it without a function
.toArray is not a function
oh
for (let info of userInfoArray) {
// insert code to check if it passes the filter
// on false
userInfoArray.splice(info);
}
arch, not all flags are cached, you have to fetch them using user#fetchFlags() if it's not cached
hope that's correct
probably won't work using map
gtg attend zoom class
you probably need a for loop for promises
welp back to manga
const users = message.member
const flags = await users.user.fetchFlags()
const userFlags = flags.toArray()
That's returning the user flags but idk how i can do that for every users
just run it when a user talks or wdym
hm i really need all users
it's a function that returns a promise
@sick cloud try my loop
lemme explain it better
not really sure if that's what i'm looking for
something like js const array = []; for (const user of members.map(x => x.user)) array.push(user.flags ? user.flags : await user.fetchFlags());
i have the array of db items and then the object of values which much = true for them to be returned
so
@earnest phoenix
hm i'm trying
for (let info of userInfoArray; var filteredArray)
// loops on every element of the array
// and also creates a temporary array
{
// check if the info passes the filter
info (smth)
// on true
filteredArray.push(info);
// on false
// do nothing
}
return filteredArray;
@sick cloud
filteredArray contains every element of userInfoArray that passed the filter
i haven't included the filter in my code above because 1. spoonfeeding and 2. idk what you want the filter to be
Cannot read property 'flags' of undefined hm weird
show code
const members = client.users.cache
const array = [];
for (const user of members.map(x => x.user)) array.push(user.flags ? user.flags : await user.fetchFlags());
console.log(array)
idk if it's good
users aren't member
iirc, Mapped values aren't arrays
it's literally Array.prototype.map()
@earnest phoenix appreciated anyways, pointed me towards for which helped
arrays are objects thank you
^
use Array.isArray()
but Map() isn't array lul
const members = client.users.cache.array()
const array = [];
for (const user of members) array.push(user.flags ? user.flags : await user.fetchFlags());
console.log(array)
No error, but returning anything
iscomputeron()
but Map() isn't array lul
@pale vessel Yeah, I meant that one.
ya
new Map()
lmao
maps are key value data stores, .map on array is different
Yeah, I'm sorry, I'm dum dum
nothing.
Map and arrays are objects
if i do delete object[key] will it delete that part of the object or the entire object
like
const obj = { "a": "a", "b": "b" }
delete obj["a"]
// should be => { "b": "b" }
right
Mhm, should at least
me and 2 other people are making a bot like dyno anyone know how to code websites?
yeah
ok cool cool
Didn't I answer that already
attention span of a goldfish
$10.. LUL
Making a dashboard isn't trivial. It requires a whole lot of moving parts, including express, templates, oauth2, and having a website.
If that sort of thing is critical for you, check out https://github.com/AnIdiotsGuide/guidebot/tree/dashboard which is a complete working example of a discord.js dashboard integrated inside a bot. Note: It won't work on a sharded bot, but is a good stepping stone for smaller bots.
@earnest phoenix ikr
mayb
ok thanks
Not like that.
so uhh, some sort of json.push?
in a way, i guess
you can do obj[key] = value
Push exists on arrays not objects.
You're creating a key, that's not really pushing
in a way, i guess
you can doobj[key] = value
@sick cloud Uhh, What if I use strict?
oh right, I was just asking for an object equivalent for push
unless you meant an array of objects then you can just push an object normally
like
object.somefunction("key", "value");
that's like the same as setting the key and value isn't it
or does that not exist?
The obj[key] = value or using Object.defineProperty
object.defineProperty, Mdn docs. Here I come.
but that syntax is identical to Map.set()
anybody has a spare music bot i can modify ?
Well, there is a Map class that stores key-value pairs just like an object
anybody has a spare music bot i can modify ?
@vast iron We aren't sharing source code.
maps are just fancy objects change my mind
It takes object, key, value, and options.
oki
maps are just fancy objects change my mind
how?
He's not wrong.
They're*
just fancy
But they are optimized differently
Arrays are also fancy objects
@cinder patio Not really. Arrays are a whole other book.
Yeah
client.user.setPresence : You sure I have a use?
Nah, arrays are objects where the key is an integer
mhm.
but they can be useful for taking out random properties from an object.
Like an 8ball command or something.
Yes. Every data structure has it's use
^
Why the F do people need 'use strict'? I know what it is, But it isn't helpful.
nice thing about arrays and objects is that they're mostly (though diff names over langs) a uniform data struct on languages
Functions are the one things which have different names EVERYWHERE.
In js they are called methods
No.
👏
Methods are functions attached to objects, are they not?
Yes.
how do you guys host your bot
const members = client.users.cache.array()
const array = [];
for (const user of members) array.push(user.flags ? user.flags : await user.fetchFlags());
console.log(array)
No error, but returning anything
Did someone know why?
how do i set bots status to streaming? discord.js v12.3.1
client.user.setActivity('with my bot friends!', { url: 'https://twitch.tv/your/stream/here', type: 'STREAMING' });
thanks
Are you sure the code is even executing?
?
If nothing gets logged, then the code probably doesn't run in the first place
dumb question but are for loops able to be awaited or something
yeah
just a simple await or what
yeah
trying to do an edit function but it's resolving true before it even finishes
i'd use a for loop for that
for loops are synchronous, the code after them will always execute after the loop is finished
weather.find({ search: args.join(" "), degreeType: "C" }, function(
error,
result
) {
if (error) return msg.channel.send(error);
if (!args[1]) return msg.channel.send("Please specify a location");
if (result === undefined || result.length === 0)
return msg.channel.send("**Invalid** location");
let current = result[0].current;
let location = result[0].location;
const weatherinfo = new Discord.MessageEmbed()
.setDescription(`**${current.skytext}**`)
.setAuthor(`Weather forecast for ${current.observationpoint}`)
.setThumbnail(current.imageUrl)
.setColor(0x111111)
.addField("Timezone", `UTC${location.timezone}`, true)
.addField("Degree Type", "Celsius", true)
.addField("Temperature", `${current.temperature}°`, true)
.addField("Wind", current.winddisplay, true)
.addField("Feels like", `${current.feelslike}°`, true)
.addField("Humidity", `${current.humidity}%`, true);
msg.channel.send(weatherinfo);
});```
my bot restarts whenever this command is run
needless to say, make sure you putting a catch block capturing any errors
my entire json db is 300 lines including it all nice
should prob learn a programming language then Arch
@opal plank it's not easy to do what i want to do
how come?
needless to say, make sure you putting a catch block capturing any errors
@opal plank should i log err only?
yeah
still restarts?

🧠
maybe the lib?
maybe
cries in glitch
glitch also has a debugger option
shouldnt be using glitch in the first place
@opal plank i purchased galaxy gate and today i am shifting to it

So, as of today--August 19, 2020--we are changing the “Verified Bot Developer” profile badge to the “Early Verified Developer” badge, and will not be granting it to anyone who submits for approval after today. If you have already submitted your application, you will still receive the badge.
i can't install sqlite3 on win server, pls help me
I can care less about the badge
fancy pants then
now I feel less pressure
Only if my bot gets approved 🤞
;-;
had to delete over 20 guilds with less than 5 members in it
why
cuz they were inactive dead servers
ok
either test servers or something else
my bot is in 5 test servers
but i don't think it matters
out of 614
614-5 = 609
609
@earnest phoenix appreciated anyways, pointed me towards for which helped
@sick cloud welcome 🥰
I have the badge
Will it be changed?
Wait so ill keep this badge forever and it cant be gotten anymore?
yes
Pog
indeed

h
h
Yo, Having some issues with discord embeds on messages. Generating a image to be shown. Works fine when attaching to a message without an embed.
var attachment = await new MessageAttachment(image, "whatever.PNG");
What should I do to get an embed image to work with this? or image even!~
await message.add_reaction("✅")```
i've defined to give reactions till the role.members is 20, but it's exceeding and giving upto 23
Are you sure len(Role3.members) is actually over 20?
await only pauses for a return on the function/value you're setting @glass steeple
example. you should use return; to just get out the process or another method.
if (len(set(message.mentions))>= 4 && len(Role3.members) < 20) return;
I am not 100% sure if you want to halt them after on that if but just looked like you wanted to.
????
oh he wasn't on javascript probably nevermind.
But how does add_reaction look anywhere close to a return
and is php and other languages for if statements.
Did javascript ever pickup those words?
he said ~i've defined to give reactions till the role.members is 20, but it's exceeding and giving upto 23~
I was assuming he wanted that if statement to stop after but i didn't edit anything. Valid point. Shouldn't have added any cents to it.
it's py
What i am doing is , on every reaction I've set to give role
so, it should stop as soon as there are 20 members in that role
but it's exceeding that
and giving 23 roles
how can i fetch server details with its invite link? D.js v12
Can i add custom emoji to footer?
Yes....
@small zenith what do you mean
import java.util.Scanner;
public class Pro
{
public static void main ()
{
Scanner sc = new Scanner(System.in);
String name, address;
char type;
int amount,d;
System.out.println("Enter your name.");
name = sc.next();
System.out.println("Enter your address.");
address = sc.next();
System.out.println("Enter the type of your purchase.");
type = sc.next().charAt(0);
System.out.println("Enter the amount for which you purchased the product.");
amount = sc.nextInt();
switch(type)
{
case 'L': d = (amount <= 25000) ? 0/100 : (amount > 25000 && amount <= 57000) ? 5/100 : (amount > 57000 && amount <= 100000) ? 75/1000 : (amount > 100000) ? 10/100 : 43243;
break;
case 'D': d = (amount <= 25000) ? 5/100 : (amount > 25000 && amount <= 57000) ? 75/1000 : (amount > 57000 && amount <= 100000) ? 10/100 : (amount > 100000) ? 15/100 : 43243;
break;
default: System.out.println("You have entered an invalid purchase type!");
}
int total = (amount) - (amount * d);
System.out.println("Name: " + name + "/nTotal Price: " + total);
}
}
just see this
it says d isnt initialized
but
no the value is given from the ternary operator
switch(type)
{
case 'L': d = (amount <= 25000) ? 0/100 : (amount > 25000 && amount <= 57000) ? 5/100 : (amount > 57000 && amount <= 100000) ? 75/1000 : (amount > 100000) ? 10/100 : 43243;
break;
case 'D': d = (amount <= 25000) ? 5/100 : (amount > 25000 && amount <= 57000) ? 75/1000 : (amount > 57000 && amount <= 100000) ? 10/100 : (amount > 100000) ? 15/100 : 43243;
break;
default: System.out.println("You have entered an invalid purchase type!");
}```
helppppppp
Try to definr d as 0
still says: variable d might not have been initialized
why
So, ive heard that from yesterday night, discord are no longer giving out the bot developer badge to anyone that gets verified. those that have it will keep it (its going to be subtly renamed to Early Verified Developer) and verification will still exist, just no badge. Tbh, i think its a great idea because there were far too many people trying to game the system to get their bots to 75 servers just for a badge. What do you all think?
I think they shouldn't have started with the low requirements for the badhe
keep verification low
@vale garden tell me when you see it
but badge high
like couple hundred servers at minimum for the bot
that way it's not people who made a bot and spammed servers
it'll take more effort for the spammer ywah
but it'll reduce the amount ofnpeople
Hey is there a way to react with custom emotes across shards? Currently my bot can only react with a custom emote that it has on that shard.
Yes..
help pls
(node:12536) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
@rugged terrace depends what database youre using
help me someone
Hey guys what's the best nodejs database library for a bot with around 2k servers
@rugged terrace depends what database youre using
yes so what should i do?
how?
did you separate them for each command or
I'm rewriting the bot so I'm open to any options really for basic user points etc
umm i didnt get u
@rugged terrace it depends on preference then, sql, no sql
personally i use mongodb
What's the key difference? I used enmap but I had data corruption issues
does someone know how to create a server invite with a discord.js bot?
Which is sqlite
NoSQL is a type of database that stores and retrieves data without needing to define its structure first - an alternative to the more rigid relational databases.
personally i'd look at mongo, redis, mysql and postgres.
mongo, redis and *sql do different things
(node:12536) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
@royal ore help pls
redis is in memory-db, so its best at caching
when youre getting to 2000 servers, tbh i'd skip sqlite entirely. its locking scemantics dont scale well for stuff like that imho
Yea I had data corruption issues with enmap with uses sqlite3
i think a lot pick sqlite because it has a really nice interface in node.js
Yea I used enmap and it's dead easy
im used to old-school sql, issuing actual queries not representing queries as fluent objects
i think im a dying breed lol
if youre going to use mongo i suggest mongoose for the lib as its also very easy, from what ive seen sql isnt too hard either
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 12.x
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.18.3...
Using default npm version: 6.14.6
-----> Installing dependencies
Installing node modules
npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR!
npm ERR!
npm ERR! Missing: discord-modmail@^0.0.1
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.72Ugs/_logs/2020-08-20T08_33_05_693Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed```
Aight thanks
How to fix it
mongo and sql are for different problems
mongo is like... imagine you wanted to store a million identical objects, e.g. user records, or channel records... but you dont care too much about the relation between them, you use an object ("document") db like mongo
*sql is like, imagine you have tons of spreadsheet-like tables, and you want to run a query that automagically joins them together... then you use sql
My bot @delicate pendant basically has to store two things, user info some strings and numbers alongside bets like this {"20190302": {"02828372":"PHX|20|200"}
from what i understand things like mongo dont really have a concept of foreign key relations between tables, you have to make that sort of thing yourself in your middleware
Sorry what do you mean by relations?
for a small number of 'bets' mongo might suffice
so... in discord terms, a user is related to a membership, which is related to a guild
Around 5k users actually are registered
and one or more channels is related to a guild
you might if you get bigger still
depends how quick mongo can search the list for a specifically keyed item (fast?)
@umbral pollen just install the npm
which one ??
ive never used postgres, just been a mysql user out of popularity of the software
and how ??
npm install discord-modmail
i assume mongo etc support clustering like sql servers do?
Ok I'll look at testing, mongoose, postgres and a sql variant
(i know redis does)
And redis too
once you go postgres you never go back
imho redis is "mongo for smaller objects"
it can hold larger "documents" but isnt designed to
i got to a point where i was getting speeds as fast as 570 db calls per mintue
Yea I'm expecting up to 10k servers once the bot gets a lot bettee
was holding just fine
Maybe 5k
hmm, i think i can tell you that figure, bearing in mind my db server has a lot running off it
Anyways thanks for the help guys
what is shards
Questions since startup: 7,660,978 Documentation
ø per hour: 164,638
ø per minute: 2,744
ø per second: 46
this db server hosts about 6 websites and two bots each with ~2000 servers
^^ from phpmyadmin
yo\
running 2 calls on every message
nice
how many guilds
it managed to keep up to 810K
i do many sql queries on each message
Error: Failed to lookup view "/home/kayuimineko/Cecyl/dashboard/templates/index.ejs" in views directory "/home/kayuimineko/Cecyl/views"
at Function.render (/home/kayuimineko/Cecyl/node_modules/express/lib/application.js:580:17)
at ServerResponse.render (/home/kayuimineko/Cecyl/node_modules/express/lib/response.js:1012:7)
at renderTemplate (/home/kayuimineko/Cecyl/views/dashboard/dashboard.js:85:9)
at /home/kayuimineko/Cecyl/views/dashboard/dashboard.js:141:5
at Layer.handle [as handle_request] (/home/kayuimineko/Cecyl/node_modules/express/lib/router/layer.js:95:5)
at next (/home/kayuimineko/Cecyl/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/kayuimineko/Cecyl/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/kayuimineko/Cecyl/node_modules/express/lib/router/layer.js:95:5)
at /home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:335:12)
at next (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:275:10)
at urlencodedParser (/home/kayuimineko/Cecyl/node_modules/body-parser/lib/types/urlencoded.js:91:7)
at Layer.handle [as handle_request] (/home/kayuimineko/Cecyl/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:317:13)
at /home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:335:12)
Help?
just very butchered irc
they do
yeah twitch's IRC is a bit wanky
youtube aint much better either when it comes to sending messages
one day i'll have a go at it, irc was my thing for a very long time
its okay
.
both my bots were originally irc bots 😄
thus far what i got is kiwi, youtube, twitch and discord when it comes to irc
though
i dont think youtube is techncially considered irc
their stream bit is similar though
for youtube streamed chats?
I was trying out express to make a web dashboard and this error came up
yeah
i havent even looked at how theirs works
is it irc with a websocket protocol? like inspircd m_websocket?
lemme grab the docs
it explains better than i do
my side is just auth and parse from there
hmm, its simple REST with OAUTH2
i dont see any irc there at least from the public api perspective
Does anyone happen to know how to react with custom emotes across shards?
thats why i said, its not techncially irc
oh noes
do u know how it works
@vale garden tell me when you see it
@earnest phoenix see what
what new exploit is this @open acorn
testers
switch(type)
{
case 'L': int d = (amount <= 25000) ? 0 : (amount > 25000 && amount <= 57000) ? 5/100 : (amount > 57000 && amount <= 100000) ? 75/1000 : (amount > 100000) ? 10/100 : 43243;
break;
case 'D': int d = (amount <= 25000) ? 5/100 : (amount > 25000 && amount <= 57000) ? 75/1000 : (amount > 57000 && amount <= 100000) ? 10/100 : (amount > 100000) ? 15/100 : 43243;
break;
default: System.out.println("You have entered an invalid purchase type!");
}
is it publically known?
then keep schtum and report it 🙂
i dont know it
spamming wont get you anywhere mate
what the actual..... start by taking out all those horrid ? : single line if's
@vale garden bro its literally easy, you just have to think logic
yeah that chaning is horrid
trying to figure out order of exection for them when you chain them together like that is like drinking hydrochloric acid.
chill bro
submit it to where
i think the exploit works with embeds, as the discord server loads links meta as an embed
we arent your homework helpers 😛
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
there
Whats that good for, you not gonna learn anything from me spoon feeding you @vale garden
you need to decalre d beforehand
declare d without value before the switch
Isn't each case it's own scope? You initialize d only in the case scopes.
int d;
switch(...) {
... d = ...
}

nope
cases dont have scopes
you need to add {} if you want to scope them
the switch is a scope though

hes scoped the whole switch {}
yeah, though the question was
Isn't each case it's own scope?
cases dont have scopes unless you specify
well, that is assuming this is typescript or js or something
its js
its java, right?
though i use typescript
@vale garden i will give you two solutions to this
I need help
System.out.println?
good question
oh
could i make a kick command for my discord bot on visual studio code?
you can
cuz i find no vids on youtube explaining that
oh
you will have to write it yourself then
LoL
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOh

@earnest phoenix I want to get server id and name from its invite link ( dis cord.gg/XD )
stop spam
i started yesterday so could some people give me an example
@vivid wadi u sure in yt has no tutorial for kick command ???
- null check it and do something if condition is true
- instead of initiating a int that is null by default, make it 0 by default
@vale garden
YES
do you know Javscript or some other langauge?
^^^
and im using discord.js v12








