#development
1 messages · Page 759 of 1
if a user is a member of two guilds with the bot in it, both guilds will have the user in the member cache
but still struggle to do simple things like that
adding the user counts from both builds results in that user being counted twice
True.
nodejs is very well documented actually lol
It is.
yeah but checking the users cached is too unconsistent
I don't I just type
"Javascript print map"
I can't find anything
that is a really vague search term
search that in java, C#you'll find
"js how to loop over map object" will get you plenty of stackoverflow results
the docs for discord js collections also have plenty of functions for looping
sometimes with examples
awesome thanks
So I did that
var servers = client.guilds;
var users = 0;
for (var key of servers.keys()) {
users += servers.get(key).members.size;
}
but it didn't fix the problem unfortunatly
that's one way, kinda inefficient. If you want the number of guild members, check out <Guild>.memberCount
^
thanks @sudden geyser
client.guilds.forEach(g => {
userCount += g.memberCount;
channelCount += g.channels.size;
})``` something else.
oh thanks
you can get even shorter if you use reduce 
Right
Okay I used your code
but why the hell do my member count keeps getting higher and higher
until I restart the bot
Do you actually tell it to stop
E.g you're not just calling it again and again and again
no
It's increasing slowly
Like 1 user every second
when I restart the bot it comes back to right number and starts to increase again slowly
@modest maple you can check #commands to see
var servers = client.guilds;
var users = 0;
client.guilds.forEach(g => {
users += g.memberCount;
})
var uptime = process.uptime();
tools.sendCatch(channel, eb[lang].getInfoEmbed(users, servers.size, tools.format(uptime)));
that's my full code
Does it stop after a lil bit of time?
I have no idea then
Saying that
I can't iterate over my guilds and add up the members without it bugging df out and maxing to the limit and duping counts
-_-
yeah 
it's at 39579 now
it was at 38000 I think when I booted it up

what's hapenning inside my bot when I'm coding
bugs
40 108 yeah
I wonder how much it will be tomorrow

finally
i beat everyone who told me to use SQL when i kept using json
async function loadConfig() {
let config1 = fs.readFileSync("config.json").toString().split("} ]");
loopnum = 0
done = 0
config2 = ""
while (done === 0) {
if (config1[loopnum]) {
config2 = config2 + config1[loopnum].toString()
loopnum = loopnum + 1
} else {
done = 1
}
}
fs.writeFile("config.json", config2.toString(), function(err) {
if (err) throw err;
});
}
yeah but why
(not you btw daluina)
There.
Hello guys, I have this big question, I'm dev my roblox game and I want that when someone uses a command in the game appear here on my discord server
Someone can help me with the script, please.
....
ew
but fine
you would embed a discord bot into your roblox server
idk how that shit works so there ya go
that's what you would do
Webhooks would be more secure than a token, so use that
I know I have to use discord webhooks but I don't know how to script for it, only for msg
we wont spoonfeed. I'd reccomend researching how to make a discord bot in C/java(/whatever the fuck roblox uses)
you'll need to learn how to create web requests
post/get/patch/delete etc etc discord webhooks use the post method btw
Roblox is written in C++
Script what
Do you mean in Roblox
yeah
I get it now, I thought you were talking about sending web requests in C#/Lua
when I'm talking about scripting I'm meaning like creating modes/games for people to play
and I was meaning to say you'd need to learn how to create web requests in lua
Thanks for elaborating
yes np 🤣
let balance = db.fetch(`money_${message.author.id}`)
let bank = 2000;
if(!args.length) {
return message.channel.send(":x: | Please give me a proper item id!")
} else
if(balance < bank) {
return message.channel.send(":x: | You don't have enough money to buy this item!")
}
if(args[0] === "bankacc") {
let fetched = client.inv.fetch(`inv_${message.author.id}.items.bankacc.name`)
if(fetched === null) {
client.inv.set(`inv_${message.author.id}.items.bankacc.name`, "Bank Account")
client.inv.set(`inv_${message.author.id}.items.bankacc.amount`, 1)
message.channel.send("[NEW] Item `Bank Account` was bought!")
}
if(fetched === "Bank Account") {
message.channel.send("Item `Bank Account` was bought!")
client.inv.add(`inv_${message.author.id}.items.bankacc.amount`, 1)
}
} else if (args[0] === "rod") {
let fetched1 = client.inv.fetch(`inv_${message.author.id}.items.fishrod.name`)
if(fetched1 === null) {
client.inv.set(`inv_${message.author.id}.items.fishrod.name`, "Fishing Rod")
client.inv.set(`inv_${message.author.id}.items.fishrod.amount`, 1)
message.channel.send("[NEW] Item `Fishing Rod` was bought!")
}
if(fetched1 === "Fishing Rod") {
client.inv.add(`inv_${message.author.id}.items.fishrod.amount`, 1)
message.channel.send("Item `Fishing Rod` was bought!")
}
}
else {
message.channel.send(":x: | You have provided an invalid item!")
}
When i buy the 1st item, it works, but when i buy the second item it doesn’t return anything. Why is this happening?
nvm fixed
anyone know how to detect when my bot is disconnected from a vc? (js)
Guild.CurrentUser.VoiceChannel will be null
thanks
Hello guys, would anyone want to explain me how "foreach" "for x in y" and those kind of things work please?
like, how to use them to loop trough maps, array
uhm
@icy osprey what language
Javascript
well
forEach is just recursiving the array but not really useful for big lengths (>20)
for (x in/or y) is a faster & better way to recurisve the array for small and big lengths
Anyone know online unlimited image hosting free with API (no request limit)?
So I should always use for each x in y ?
This ?
for each (variable in object) {
statement
}
it's just for (variable in object)
you can do ```js
const array = [];
for (let i = 0; i < array.length; i++) {}
or ```js
const array = [];
for (const arr of array) {}
what's the difference between
var i = {};
var i = [];
var i = new Map();
please, I'm not sure to understand
thanks for your help btw
I would recommend using the MDN for basic JavaScript help
you don't need each
oh okay thanks
it's just for (x in y)
Since that doesn't work for maps
I use
for (var entry of map.entries()) {
var key = entry[0],
value = entry[1];
console.log(key + " = " + value);
}
Is that a good way to go ?
or
mapmap.forEach(variable => {
console.log(variable);
});
You can remove .entries() and you'll still have the same result
thanks
That array of key, value doesn't read that smooth
Unless you actually need both the key and value
Your code would "look" and read better if you just used the forEach
or a for of map.values()/map.keys()
de ellos aprendi
just wondering, is the ability for bots to use the search engine on discord something that is planned to happen?
@slender mountain don't think they will
You could probably make a system
how could i shorten this code?
let cmd = null
cmdRegex.test(message.content.toLowerCase()) ? cmd = message.content.toLowerCase().slice(2) : cmd = null
if (cmd === null)
return```
Hello guys, do anyone use MongoDB JS for his bot ?
Why do I get empty field when looking for data ?
guildCollection.find({}, { projection: { _id: 0, channel: 1 } }).toArray(function (err, result) { });
Your query is just {} so it'll be all documents in that collection, the projection makes it so it'll only display their channel field
So the empty objects are most likely documents in your collection that don't have a channel property

What are you trying
I want
let me take a screen$
I have fields like this
with channel propertie
I want to get only those
There's an $exists operator
should be collection.find({field: {$exists: true}})
in which you replace field with channel
I'm trying now
But like, it would be a good idea to make collections have a set model for their documents
wdym
If the document will have different properties, you might want to put it in a different collection
oh okay
I don't have a lot of knowledge in database
the collection name is the server id
and I put everything inside
awesome it works, thanks @late hill
@mossy vine You could move the cmdRegex line up and use it as the cmd declaration directly?
let cmd = cmdRegex.test(message.content.toLowerCase()) ? message.content.toLowerCase().slice(2) : null
if (cmd === null)
return```
Should do the same thing
why not just if(!cmdRegex.test(message.content.toLowerCase())) return;
then proceed with let cmd = message.content.toLowerCase().slice(2);
how to check if a member has a certain role
library?
Depending on the library and language it's something like
member.roles.contains(expectedRole)
does anyone know a reliable way of calculating the probability that 5 alphanumeric characters (uppercase included ) will be a certain set of characters, for example gFh4K?
1 in the total number of possibilities
alphanumeric characters would be 26 (lowercase) + 26 (lowercase) + 10 (numbers) = 62
there are 5 characters in the string, with 62 possbilities for each character
so 62^5
1 in 916 million
if i can math correctly
62^5 = 916132832
anyone know how to do a GET request to https://reddit.com/r/shiba/hot.json and then get the images in python? (using aiohttp)
thanks cyber
Any HTTP requests library (requests for sync, aiohttp for async) @barren heath
By viewing the JSON that endpoint returns, you would need to iterate over response_json['data']['children'] and access the url key from there
ok thx
#the ".shibapic" command
@client.command(pass_context=True)
async def shiba(ctx):
embed5 = discord.Embed(title="Shiba", description="test")
async with aiohttp.ClientSession() as cs:
async with cs.get('https://www.reddit.com/r/shiba/new.json?sort=hot') as r:
res = await r.json()
embed5.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
await ctx.send(embed=embed5)
Now im getting 2 errors:
- Too many positional arguments for method call
- Missing mandatory keyword argument 'url' in method call
- set image requests a url not a load of spaces and stuffs in it
res['data']['children'] [random.randint(0, 25)]['data']['url'] that entire line is invalid
well first off
the " " space will break it as its not actually doing anything
second off
it wants a string a argument url=
ok...
that space is gonna break it?
Is it possible to make a list, and if a specific word/number is found in that list sent into a command to respond with something?
(I know it is but I have about 1000 words and It would be useful as a JSON type of list so I don't screw my code)
javascript
search up checking if an item is in an array in js
mostly are based on normal censor-like actions
idk if i'll find something useful
well tbf yh thats what u gotta do
in python its just item in List
idk about js
but the same principle
how
https://www.w3schools.com/jsref/jsref_indexof_array.asp @earnest phoenix
Yes, that's what basic js censor command uses
I want to make a .json list
and check from that list
why a json list
a json is just essentially a dictionary
youre just comparing a key, if the content has an array its the same principle
as its still an array
yes
Unless you make { 1: x, 2: y} where the values are the words
not a well formed url
whats does that mean
means ur url is wrong
"redirect_uri": "https://discordapp.com/api/oauth2/authorize?client_id=660198591264194581&permissions=8&scope=bot"
are Your Sure about that?
@modest maple
Why would redirect_uri be undefined there
give me a "Well Formed URL"
no?
Why
a bad formed url means
you have screwed up the layout of the url
aka
youre making an invalid request
Wtf
how xD
It's literally undefined
Make it any well formed URL
why does it neeed this tho?
Wym
why does your bot need to know my guild list?
Dashboard
alright
have u realised your mistake in that url yet?
No xD
No
.._url?
But whats the Error
Mind not
i changed it to url
URI is legit
it worked
Google it up ty
or like
The redirect_uri is undefined
How would IT be defined?
I'm pretty sure you can't redirect to undefined
https://discordapp.com/developers/docs/topics/oauth2 Ctrl+F -> "uri"
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
uri is correct but for redirects
The param name is ok, the value isn't
hi
@slender thistle when the value isn't right, HOW WOULD IT BE RIGHT?
Well is undefined an actual URL?
idk why this is still going on
No @slender thistle
So
i did.
good point
hence why it literally doesn't matter if it's there of it isn't there
redirect_uri param name was ok from the beginning, the value they gave that param is "undefined" instead of an actual URL
Hey, in a list e.g
Name, List, Ip, Word, Apple
How can I make it so its
'Name', 'List', 'Ip', 'Word', 'Apple'
... what?
How to fix it
fix what
24 hours
use getter methods
getDay() getHours() getMinutes() ... on a Date object
if you're using js that is
I use client.uptime for bot uptime and Math for seconds, minutes, hours and days
I mean...
Wait
Got the solution
if (hours === 24) hours = 0```
is hours not a number?
Hours is a number here
^ and what if it goes to 25+ hours
well your comparing a number to a string
@sudden geyser it will loop back to 1 hour
not sure
client.uptime returns the time that your client has logged in right? so you could use npm, pretty-ms which can format ms
also you didn't see what i said, you were comparing a number to a string
and hours is not a string
oh nvm you edited the code
ok..
I had a bug which made user count increasing weirdly yesterday for some reason it'sjust gone
I did nothing but it's gone

message.guild.members.forEach(m => {
let db = require("quick.db")
let r = message.guild.roles.find(ro => ro.id === "620986482936512524")
if(!m.roles.has(r)) return;
db.push("bounce.verified", {id: m.user.id, username: m.user.username})
message.channel.send(m.user.username)
})
why did this not do anything? It gave no errors
you're checking if a role object is the key in the roles map
You need to use r.id in where you're checking if the member has the role.
Ah! Thanks!
this is in event for member joining guild:
let ro = member.guild.roles.find(r => r.id === "620986482936512524")
why do I get cannot read property id of underfined
check if the role exists
it does
@earnest phoenix in NSFW channels yes
I just checked, it does exist, this is the id when copied 620986482936512524
@sudden geyser
hm, are you sure it's coming from that line? the role would never be undefined
it said line 21, and that was on line 21
maybe it was the line above
if(member.user.id.includes(p.id)) {
it would be the first id
what is member and p defined as
client.on("guildMemberAdd",async member => {
if (member.guild.id === "551070196958363648") {
let db = require("quick.db");
let vv = await db.fetch("bounce.verified")
vv.forEach(p => {
let obj = JSON.parse(p)
if(member.id.includes(obj.id)) {
let ro = member.guild.roles.find(r => r.id === "620986482936512524")
member.addRole(ro)
}
})
})
db.fetch("bounce.verified")[0]
Output (Object):
{ id: '589543644378431509', username: 'kakakakaka' }
cool
@sudden geyser That would be what p is defined as
Hmm, I don't know myself. I'd assume it'd be obj, but it'd not return undefined. Though, is p already an object or are you parsing it again for some reason
no, its not, I honestly have no idea what is wrong, and the thing is, the console is saying its the first id
Ok I seemed to change something good, I am getting a new error
let obj = JSON.parse(p)
unexpected o in position 1
@sudden geyser
yeah, because p may already be an object. I don't think you need to parse it
how df should we know
not rlly #development related tho
How do i make this if(command2 !== "check") return; work only if it's !check + something (e.g !check google.com -> Google.com checked not !check -> checked)
If it's only !check alone, to not trigger.
check how many args were passed/if there's anything after the command name in the content
Hi i have problem with my vote system
With my shad system
My code :
try {
fetch("LINK WEBHOOKS", {
method: 'post',
body: JSON.stringify({
embeds: [{
title: `${bot.users.get(vote.user).username}#${bot.users.get(vote.user).discriminator} (${bot.users.get(vote.user).id}) vote for Akimitsu !`,
description: `It can now collect rewards in our games: **?vote ** (Pokemon Part) | **?claim** (RPG Part)\n\nIl peut maintenant récupérer des récompenses dans nos jeux : **?vote** (Partie Pokemon) | **?claim** (Partie RPG)\n\nShard : ${bot.shard.id}`,
thumbnail: {
url: bot.users.get(vote.user).displayAvatarURL,
}
}]
}),
headers: { 'Content-Type': 'application/json' },
});
db.set(`hasvote8_${vote.user}`, true)
db.set(`hasvote9_${vote.user}`, true)
if (db.get(`MV5_${vote.user}.pseudo`) == null) {
db.set(`MV5_${vote.user}`, { pseudo: `${bot.users.get(vote.user).username}`, nombre: 0 })
db.add(`MV5_${vote.user}.nombre`, 1)
} else {
db.add(`MV5_${vote.user}.nombre`, 1)
}
} catch (e) {}
})
if (bot.shard.id == 1) {
server.listen(5000, () => {
console.log("--> DBL opérationnel !")
});
}```
He is in the index.js file and he work just on one shard
this is probably more #topgg-api related
On the shard : 1
ty @sudden geyser
right
firstly
give the full error
send being undefined
is a thing yes
but
how df do we know whats going wrong unless u send the code and full error
module.exports = member => {
let guild = member.guild;
member.send('niye gittin?');
guild.defaultChannel.sendMessage(${member.user.username} gitti.);
};
Kann mir wehr helfen bitte
?
Bitte 🙏🏻
wht
ignoring william
Why
😕
you're doing member.guild
yes
so assuming its assigning guild as a object
but it was working normally in 5 mins
thats a not command
if no dan i'm sorry i need help with a bot you can help me further
member.send('niye gittin?');
youre trying to send a message
to what
exactly
cuz atm ur tryna send it to a guild object not a channel or user
wait
nvm
i was reading the code wrong
basically saying the property member cant do .send as its undefined
what can i do
so some how member is not being defined properly when the command is getting called
trying logging what member is
if you get an error see what it it thinks member is
and trouble shoot ig
on why its not being defined
um dude
Can you write properly? strange things in translation
@modest maple
or edit the code directly
console.log member
check what member is
if error
look for what might be causing member to be unassigned
Anybody know if JSDoc has something for @param'ing arrays and documenting what each element (by position) should be? eg ```js
/**
- @param {Array} arrayParam
- @param {String} arrayParam[0] First element should be string
*/
Does anyone know what this error means?
(node:9524) UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOTFOUND discordapp.com discordapp.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
it means your internet died
internet issue
nice
I don't think you can document each element of an array, but you can document what the array may hold
thanks
@zealous veldt I don't see why you would want it like that though, why have the first element a string
It's for a command class, where part of the constructor requires an array of aliases, the first of which is the command's name
oh so it is an array of strings all together?
I could just say that in the @param for the array
but that doesn't feel like the best way to do it
have you checked this? https://github.com/jsdoc/jsdoc/issues/1073
@surreal sage thats two completely different things
you can do both of them, but they mean different things
lets say string2 = "lol"; string3 = "xd"
It becomes lolxd ?
string[string2 + string3] = string.lolxd
string[string2][string3] = string.lol.xd
i needed the first
A user does not have a .roles property. You're looking for a guild member.
are you using discord.js?
Yeesh
also message.author doesn't have a .guild property
i love when this happens
since js isn't a typed language you have id- i mean people making up their own properties
im not gonna act like ive never done that 
message.author.guild.channels.get(message.channel.id).messages.get(message.id).react("😂")
that's what im talking about
message.author.guild ??
read above
How i can make if, if the discord with id XXXX is in the shard ?
this.client.guilds.get(message.channel.guild.id).channels.get(message.channel.id).messages.get(message.id).delete()
@lofty hamlet you mean find what shard a user is in?
#memes-and-media or #general btw
wat
hey
im writing like A LOT of code rn
most of it same
so rn i have a bunch of let values of db.fetch(board_${a})
a is basically oneOne - fiveFive
i just have like a lot of lets
then I want if oneOne-fiveFive === somthing, oneOne-fiveFive = 1
the value corresponds
is there an easier
way
what lib
eris
idk
ye that's a good way to get the total
?
invalid discord tokwn
are you sereus?
depends what version you're on, but you should use .send instead
the value before .sendMessage is undefined
For Discord.js, I'm trying to get a cached version of client.users.size cause it doesn't display an accurate count. I added this line near the top of my code: let client = new Discord.Client({ fetchAllMember: true }) to get client.users.size to display correctly. It still doesn't work for me, it displays the same number as client.users.size does normally. Anyone have any fixes? (Sorry if I'm not being clear).
I think it's fetchAllMembers (I'd have to check the docs). A much more efficient way of getting the total count is by iterating through all the guilds your bot's in and adding the <Guild>.memberCount together.
Oh, I'll try that. Thank you!
hey im trying to add reddit to my bot in python. How can i do it?
i have most of the praw code but it's cause errors not letting my bot work
is it your server
Yes
Copy the OAuth2 link and paste it. It will ask what server
Shall I add you to it and you do it?
i cant its your bot
what is the actual problem? when you open the link you cant select your server?
I think thats his issue
@quartz kindle ye
that means you're logged in in the wrong account
the app account and website account are not linked, you need to make sure you are logged in with the correct account in the website
so logout and login again from the discord website
what is that for? what program/server/framework/etc uses that file?
discord bots dont have a file like that
unless you're using a framework or library that uses it
where did you read/watch/hear that you need to create that file?
Jagrosh Vortex bot need this file
@quartz kindle ```java
Caused by: java.io.FileNotFoundException: application.conf (No such file or directory)
thatttt
that is a very diffrent thing to a regular config
that isnt for a bot thats for java
at com.typesafe.config.impl.Parseable$ParseableFile.reader(Parseable.java:638)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.open0(Native Method)
I wouldn't recommend it. Self-hosting this bot (running a copy yourself) is not supported, and no help will be provided for editing nor compiling the code in this repository. The source code is provided here for transparency about how the bot's primary features work. If you decide to edit, compile, or use this code in any way, please respect the license```
there are no instructions and no help about it
How to create this file?
you have to open the source code and see how the application.conf file is used
you can create it with any text editor but you have to open the source code to see where this file should be placed and what it should contain
@quartz kindle I have still won't work I'm on mobile BTW
@pliant siren supposedly in the same folder as the vortex.java file
@quartz kindle
why
I found only it
did you ping the web admins
So I can ask them for help
@earnest phoenix dont ping all mods
Ok

why did u fucking ping website administrators

@earnest phoenix which browser are you using? try opening the chrome app and going to https://discordapp.com/channels/@me
logout from there
and login again
@modest maple either? I didn't ping two types SMH
@quartz kindle you see my picture?
@pliant siren there are no instructions and the bot creator does not provide help or support for it. you need to study the code yourself and figure it out. im not going to do it for you
for example, the config file asks for database username and password
for which database?
there is a lot of things you need to figure out
its not a simple thing
👍
what
I'm setting up my server but Tim helped me do this
how can i let my bot count down to a specific date?
if (command === "addbadge") { //Add Badge
const bannedbadges = require("./nobadge.json")
let user = message.mentions.users.first()
if(!user) return message.reply("Hey! You got to specify an user!");
let badgea = args[1]
if(!badgea) return message.reply("Hey! You got to specify an badge!");
if(badgea.includes(bannedbadges.badges)) return message.reply("That Badge isnt allowed!");
let uppercaseBadge = badgea.toUpperCase()
let finalBadge = `[${uppercaseBadge}]`
let userdb = JSON.parse(fs.readFileSync("./database.json", "utf8"));
let firstBadges = userdb[message.author.id + message.guild.id].inca
db[message.author.id + message.guild.id] = {
inca: `${firstBadges}, ${finalBadge}`
}
fs.writeFileSync("./database.json", JSON.stringify(db))
message.reply("I've sent `" + user.tag + "` **" + uppercaseBadge + "`")
user.send(`Hey! You got **${uppercaseBadge}** in *${message.guild.name}*!`)
}``` it says "inca" is unedifined
let db = JSON.parse(fs.readFileSync("./database.json", "utf8"));
if(!db[message.author.id + message.guild.id]) {
db[message.author.id + message.guild.id] = {
inca: '[USER]'
}
}```
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ is on top of the command
u sure it exists in the database
like when you get the instance, it should be { inca: '[USER]' }
debug your code every step and find what the problem is
how do i
i would do is console log db and see what it returns
and then console log the value ur trying to get
well
i think it gets it good
but at start it does not add the user
hello?
i have it
didnt log
i added fs.writefile
How to remove something from a json db?
like it includes hello, world but i want it to remove hello,
dbl uses json confirmed
are u being serious rn
that was a joke
exactly
oh
if you dont want to help me il figure it out by my self
i mean, there is this magical place called google
ik
that's the spirit 
would it make sense for me to prepare for sharding if my bot is barely in 500 servers and is growing very slowly?
mine is at 2100 and i still didnt start working on sharding it lol
but yeah, the sooner you make it future proof, the better i guess
discord recommends sharding at 1500
do you have the executable in /bin or /usr/bin or wherever its supposed to be
yes
restart ur terminal
already did
can you run which node
node not found
is it actually in /usr/bin or /bin
the installer does that
but can you find the executable there
i dont see it
Oh first time coding?
yea not close
how do I change the bot's status
@knotty steeple if installing node on linux, install it through nvm (node version manager)
im on macos
ah
i just used the installer on the website
how do I change the bot's status?
@versed vapor what language?
python
@knotty steeple wait you're not using brew?
well you should install brew, most packages are there that you will need imo
also never installed node from official installer so idk
but it does work fine on brew
where can I learn banned codes?
what
Code for a ban command(maybe?)
Does Discord Rich Presence support Android? Browser or app/command line
what
do you mean the other way around?
@earnest phoenix Code it yourself.
that's
not what I said
I was trying to figure out what "banned codes" mean
he wasnt asking for ban command code
<form action="/?" + document.getElementById("text").value>
<input type="submit" value="Submit" />
</form>
this isn't 100% related to discord bots, but how would you do something like this? I'm trying to make a website
What are you trying to do?
nvm i found out
I want security code
72393
what
need security codes
FOR WHAT
69420
Give the man security codes!
stop with the shitposting this is #development
yees, dis is #development not spampost/non-related, if you want then go #memes-and-media (dont spam but you can talk there other than discord related things.
How hard is it to make the prefix custom?
what lang
k its super easy
integrate a database system and pull the prefix out of the database when you're handling commands
for better performance have in memory cache, like a Map
gotcha
i remember trying to make custom prefixes
all i can say is that it was probably bad
depends what language
I just store a guild with a bunch of settings with prefix being one of them and just check on message ```rs
c.dynamic_prefix(|_, msg: &Message| {
let guild: crate::db::model::Guild = crate::db::get_guild(msg.guild_id.unwrap().0 as i64);
Some(guild.prefix)
});```
speaking of this, are ids u32 or u64
or which would be the best to store it as
not in rust
???
looks like they u64 though
rust problems™️
error: literal out of range for `u32` --> src/main.rs:2:21 | 2 | println!("uwu {}", 257521982021566464 as u32); | ^^^^^^^^^^^^^^^^^^ | = note: `#[deny(overflowing_literals)]` on by default
they are then
@mossy vine anyways, no they're not in rust
i am too scared to mess up my bot so i am just gonna start over
here's the definition for GuildId ```rs
pub struct GuildId(pub u64);
whats u64
unsigned 64bit integer
they probably are u64 tho
^
lul i wanna try rust but it seems to 200iq
yes i know we just figured that out sam :>
wew
d.js?
ma'am* let me find the docs rq
you can get the hex color from the role and use it as the embed color https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=hexColor
ty ty ty

How would I go about debugging this... (node:47603) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 [ManateeClient undefined] listeners added to [ManateeClient]. Use emitter.setMaxListeners() to increase limit
usually that error just means u have too much emitters
I only have 15 events
but it's worked fine for a long time
i normally see that error when i have lots of listeners for the same event
nah its just listeners in general
Maybe you just have a lot of listeners, or maybe you have a lot of the same listener (e.g. Message collector). You can see all the listeners under <ManateeClient>._events
i guess
that don't look right.
yeah, but why is it all undefined and the same

Hi I've never tried .net core before, is discord.net will be working on windows and linux? thx
could it be because of singletons
i feel like they often cause memory leaks for some reason
Normally yes
lmao what
no
.net core is built to be crossplatform
stop talking nonsense
i wouldnt on linux
so what? js?
imagine using f#
...
in all, .net core has no trouble running on platforms that aren't windows
i ran my bots on linux and am running 2 asp.net core sites which are performing really good
m
!help
=help
+help
.help
🐍
no
@merry holly no shitposting here
@earnest phoenix ok so, if you want if a value is greater than on equal to or what?
^
the types are different though apparently
You could parse the "curlvl" as an int or something and check it that way
It's a variable
Which is why the types are different
It can be any
yeah, how do i not do that? >== isnt a real thing
>= is what you use for equal or greater
=== is exact, == is equal, <= equal or less than, and ofc= assign
yeah, but how do i do that, if they're different types? i tried that but it doesn't work
Parse the string as an integer
If curlvl is a string at the moment of comparison, it need to be converted to integer
what type is curlvl in the if statement
how do i parse it?
parseInt(curlvl)
and the radius!
the default is unreliable
That assumes curlvl is actually a valid number represented as a string
I mean, I would assume that if it can't be parsed, it's already equal to 'MAX'
if(!isNaN(curlvl) && parseInt(curlvl) >= 1000)
Yes
It's something different before the if statement
ok and i also want to make it so afte reaching max level it'll stop adding xp and whatnot but everytime ive tried doing it with a while loop the level command juist stops working
why while loop???
I don't trust those fuckers 
i dont know how else to do it xD
while loops are fine
you just could do whole thingy in if (!lvl.get("lvl") > = 1000)
while loops use more ram than that ^
yeah
About the second if statement, add a check to make sure that the level is below 1000
add vefore xp[msg.author.id].xp++; if (xp[message.author.id].level >= 1000) return
smh spoon-feed
so the if before the embed
Yes
or make while loop to make your ram usage high :)
Am I having some sort of brainlag, or are you moving the goal further away every time? 
They're not
not here
guys how to make a random thubnail?
wdym
i I did it now but it gives an error
wait
can ypu wait bro
um i cant ss error
bro here code
@modest maple
its a pokemon command
this random thub.
whats the error
No error, but does not respond to the command
well thats very diffrent from getting an error with a random thumbnail
if its not triggering on the command it has nothing todo with the thumbnail
yes
you're passing a string
remove the quotes so its a normal variable accessing a prop
also you said there was an error but you're saying there's no error
so just a logical error?
yes
whut?
@sudden geyser something strange appeared in the translation. can you say it more smoothly?
no no
but dont get the expected result
"you're passing a string
remove the quotes so its a normal variable accessing a prop
"
this
You're passing "poke[Math.floor(Math.random()" as the thumbnail, rather than the actual thumbnail (e.g. https://example.com/...). You need to pass it like accessing the element in the array. Like poke[index] where index is the number you got from the random guess. Either way, it'll be a syntax error if you remove the quotes as that's not proper syntax.
yh
thx @sudden geyser
no emoji spam tnx
What is so special about lavalink?
not much just basically the go to for music systems
Am i able to overwrite discord sound quality ?
the bit rate ?
how is the music quality?
- you cant override the discord sound quality on a VC
- quality is G
Hmmm
I see that you've joined the voice chat my bot is playing in rn, my bot uses lavalink
Ye
But I did modify a great portion of LL and I'm using a custom build
Bitrates don't matter for bots
Gotcha
What makes you say that LL is trash
high ram consumption, it's a webserver with really bad GC, and the error handling is really bad
What is high ram consumption in your option?
Because 728MB for 6 connections and 25 active players is not high
it really is considering that you can go much lower with alternatives
doing audio processing natively, i didn't exceed 300mbs on my entire main bot process
that is audio and every other trash the bot had
But did you have all the features that LL has
yes






