#development
1 messages · Page 732 of 1
the user who was banned
^
guild.user.username?
how do you get the person who kicked/banned the user?
im gonna go afk for a bit
i should read docs again soon
Okay i search
@shy turret you have to watch the audit log
Guild#fetchAuditLogs(), returns a promise btw
https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=fetchAuditLogs


Is there any reason the bot would be constantly looming at 80% cpu usage?
I have zlib-sync installed
Depends on bot usage and what it does however I don't know how it can reach that much unless the CPU is shit
@shy turret fetch executor from audit logs
const entry = await guild.fetchAuditLogs({ type: "MEMBER_BAN_ADD" }).then(audit => audit.entries.first());
let moderator = await guild.members.get(entry.executor.id);```
like this
This is nice
I'm getting this error. Anyone know why?
Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (_tls_wrap.js:1213:19)
at Object.onceWrapper (events.js:281:20)
at TLSSocket.emit (events.js:198:15)
at endReadableNT (_stream_readable.js:1139:12)
at processTicksAndRejections (internal/process/task_queues.js:81:17)
code: 'ECONNRESET',
path: null,
host: 'discordbots.org',
port: 443,
localAddress: undefined }
Please not discordbots.org @grave mist this is top.gg
Api is discordbots.org I guess
Whatever it is, just help me with the error if you can
yeah the API is still active at discordbots.org
Also @grave mist that means that the request didn't make it through
do you have a firewall or something?
You saw me using discordbots.org anywhere?

Omfg
Yea it does
by api do you mean a library/module/package?
Bro I'm not making any requests
because 'api' means on their end
Wait let me check the code wait
if you're not making any requests then there's a package that's doing it
I use this api
@scenic kelp library/module/package = Wrapper
nope tonkku hasn't updated it
I can make a pull request real quick
Ty
nvm he's already done it
You're a lifesaver 
So what should I do now
K
discordbots.org should still work for the api
does it truly matter if it's discordbots.org as it should redirect?
i havent updated my dbl code in like a year and it sill works
so the old domain still works
@quartz kindle but discordbots.org redirect to top.gg
This is better To make directly a request to top.gg
yeah its better, but shouldnt crash because of that
This is the error
Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (_tls_wrap.js:1213:19)
at Object.onceWrapper (events.js:281:20)
at TLSSocket.emit (events.js:198:15)
at endReadableNT (_stream_readable.js:1139:12)
at processTicksAndRejections (internal/process/task_queues.js:81:17)
code: 'ECONNRESET',
path: null,
host: 'discordbots.org',
port: 443,
localAddress: undefined }
I get discordapp.com at host sometimes
code: 'ECONNRESET',
path: null,
host: 'discordbots.org',
port: 443,
localAddress: undefined }
...
that doesnt matter
@grave mist you're bot is in a vps?
No in glitch but that isn't the problem cuz I have another bot that runs perfectly fine
does it use dbl's api?
The another bot?
yeah
Yea it uses it
weird then
whats the node version in your package.json?
are both bots in the same glitch project? or two separate projects?
hmm, try disabling the webhook to see if the problem stops
btw is your server http or https?
you use it for uptime robot?
if the problem is on the webhook, thats probably why, but if the problem is when POSTing then not
@summer torrent thx, how do you detect on new audit msg?
so try running it without the webhook
msg?
to see if the error continues
dont think you can do that
k wait
Still getting
Both discordbots.org and discordapp.com
As two errors with host name only different
discordapp.com too? does your bot even login at all?
can i see your full code?
main file probably, where all the servers, connections, webhooks, logins are done
also your package.json
const http = require('http');
const express = require('express');
const app = express();
const db = require('quick.db');
app.get("/", (request, response) => {
response.sendStatus(200);
});
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 80000);
const server = app.listen(process.env.PORT)
const Discord = require("discord.js");
const client = new Discord.Client({ disableEveryone: true })
const DBL = require("dblapi.js");
const dbl = new DBL('a', client);
dbl.on('posted', () => {
})
``` that's enough of mail file I guess
{
"scripts": {
"start": "node index.js"
},
"dependencies": {
"axios": "^0.19.0",
"better-sqlite3": "^5.0.1",
"bindings": "^1.3.0",
"blapi": "^0.4.5",
"canvas": "^2.6.0",
"canvas-constructor": "^1.1.2",
"cleverbot.io": "^1.0.4",
"cpu-stat": "^2.0.1",
"cpu-stats": "^1.0.0",
"dblapi.js": "^2.3.0",
"discord.js": "^11.5.1",
"expres": "^0.0.5",
"express": "^4.16.4",
"ffmpeg": "0.0.4",
"figlet": "^1.2.0",
"fortnite": "^4.1.1",
"google-tts-api": "^0.0.4",
"isgd": "^1.1.3",
"memejs": "^1.0.7",
"memjs": "^1.1.0",
"minimist": "^1.2.0",
"moment": "^2.22.2",
"moment-duration-format": "^2.2.2",
"nekos.life": "^2.0.2",
"node-gyp": "^3.8.0",
"node-opus": "^0.3.2",
"opus-encode": "^2.0.2",
"os": "^0.1.1",
"parse-duration": "^0.1.1",
"parse-ms": "^2.0.0",
"path": "^0.12.7",
"pm2": "^3.2.8",
"pretty-ms": "^4.0.0",
"quick.db": "^6.2.0",
"relevant-urban": "^2.0.0",
"simple-youtube-api": "^5.1.1",
"strict-uri-encode": "^2.0.0",
"superagent": "^3.8.3",
"weather-js": "^2.0.0",
"ytdl-core": "^1.0.0"
},
"engines": {
"node": "11.x"
},
"license": "MIT",
"author": "Awesome Stickz"
}
A lot there tbh
@quartz kindle
Yea, like only 1 time of each of them
I guess I found the thing that goes wrong
Both discordapp.com and discordbots.org uses TLS 1.3 and some said that node 10.x and higher uses TLS 2.3 so it can't do what it needs to. I switched to node 9.x to look it
TLS 2.3 doesnt exist
this error happens when trying to connect to a TLS 1.0 website, with node 10+, because TLS 1.0 is deprecated for being insecure
And yea, bot doesn't respond and error came
current standard is TLS 1.2 or preferably TLS 1.3
but that would make it a server side problem if it were the case
and we are sure this is not the case, else the server would be throwing this error to everyone using node 10+
he probably mistyped TLS 1.3 lol
I see
i dont know what the problem is, but i can see you have a whole load of packages installed that you might not be using/needing
Yea maybe
although its unlikely that will fix the problem, you could probably do well with a cleanup
Made it an year ago
for example, you have a package called expres ?
Yea'
with is probably a mistake
expres or express
and both axios and superagent can basically do the same things
so having both is kinda redundant
express is the webserver
expres is idk what
Yea looks like expres I added without seeing
you probably dont need pm2 on glitch
probably not
im still thinking what can be the cause
let me take a look at the dbl source code
But discordapp.com too comes here
hello, i'm having some issues
I have an iter called members_iter and there is a method on it called filter which is what it sounds like
well when I do: rs let bc = members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len(); it doesn't work but this does: rs let bc = members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len();
the difference being the !
here the whole function for anybody wondering: ```rs
fn get_member_counts(ctx: &Context, guild: &Guild) -> (usize, usize) {
let members_iter = guild.members(&ctx.http, None, None).unwrap().into_iter();
let bc = members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len();
let uc = guild.member_count as usize - bc;
(uc, bc)
}```
bot does exist btw https://docs.rs/serenity/0.7.2/serenity/model/user/struct.User.html#structfield.bot
API documentation for the Rust User struct in crate serenity.
@grave mist does the discordbots error always appear when you start your bot?
only after 2 mins?
is the error consistent with this timer?
try removing that interval to see if the error still happens
That interval is to make bot project alive I guess
yup, but its possible that its actually killing it instead of keeping it alive
if you want you can also set the timer lower, to like 30k, and see if the crash happens sooner lol
Ok I removed interval
Let me check
Bot no respond
No error too
Ok it came
1 min after start
can i see your ready event?
And then error occurs, it goes off and comes on
I have lots of things in it
Nothing related to http tho
so the bot never responds to any message? but the ready event works?
Yea
so lets check the ready event
What you wanna check in it
It logs things to console
Then uses function that changes status after a particualr time
It changes as long as the bot is alive
any possible infinite loop or otherwise bot breaking things
Nope bro cuz it was working fine before a week and I didn't change any code too
if you want, try running a barebones test, just the discord client, a ready event and a simple message event
if that works, then the problem is somewhere in your code
K I'll check later I have to sleep now
👍
Or you can look into my code?
anybody have a solution to https://canary.discordapp.com/channels/264445053596991498/272764566411149314/646498927188901909 ?
I'm still really confused
sorry, i dont know rust, but if you're trying to filter bot users out of the iter thing and if ! also means NOT in rust, it should make sense to filter by not being a bot?
i want to return the bot count and the member count (without bots included)
so member count works, but bot count returns 0?
correct
when im NOT checking for bots i works but it doesnt when I am
which is confusing me
have you tried with !! ?
members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len(); returns 1 with a server of 4 and 3 bots
uh
lemme try
what library is this, if you don't mind me asking?
serenity
oh then do you need to unwrap() the read()
unwrap() after read()
since read() returns a Result
hm nope https://i.imgur.com/HK31Euq.png
any way to log m.user.read().bot ?
uh
to make sure its actually returning booleans?
wtf
well, afaik i cant log it inside the filter but it says it exists so https://i.imgur.com/zFpCWMo.png
but the thing is members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len(); works
but members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len(); doesnt
when you say it works do you mean as intended
yes
oh
members_iter.filter(|m| !m.user.read().bot).collect::<Vec<Member>>().len(); is 1 as it should be
i mean, i dont know rust, never used it before, but from what i've read, .filter takes a boolean, and the only explanation i can think of is that .bot might not be returning a boolean for some reason
what does members_iter.filter(|m| m.user.read().bot).collect::<Vec<Member>>().len(); return?
0 lol
when 3 bots are in the server
@quartz kindle i dont see why it wouldnt return a bool
well considering the way rust is bot must return a bool
if it was returning an err rust would surely let me know
could it be returning false for bots for some reason?
if it was returning false then it would return 4
yeah true
any way to check the pseudo-result of the filter function without collecting/refining/digesting/whatever it is that it does after the filter?
could be that guild.members just doesn't have any bots in it
possibly lemme log that too
client.on('roleUpdate', async (oldRole, newRole) => {
try {
console.log(oldRole.name)
console.log(newRole.name)
let guild = client.guilds.get(newRole.guild.id);
const entry = await guild.fetchAuditLogs({ type: "GUILD_ROLE_UPDATE" }).then(audit => audit.entries.first());
let user = await guild.members.get(entry.executor.id);
console.log(user)
if (user == topsecretbotid) return;
let name = newRole.name
if (config[name] !== undefined) {
let role = guild.roles.get(newRole.id);
role.edit({
data: {
name: oldRole.name.toString()
}
})
}
} catch(err) {
console.log(err)
}
});
this likes to spam my console
i mean you have 4 console.log()
one of them being a full User object
no like...
if i only add 1 console.log(), it keeps looping
let me remove console.log(user)
const entry = await guild.fetchAuditLogs({ type: "GUILD_ROLE_UPDATE" }).then(audit => audit.entries.first());
let user = await guild.members.get(entry.executor.id);
console.log(user)
if (user == topsecretbotid) return;
if (user == topsecretbotid) return;
is topsecretbotid the id of your bot?
@tranquil drum hmm you're right
Ok([Member { deaf: false, guild_id: GuildId(643218138506461227), joined_at: Some(2019-11-10T22:39:14.639+00:00), mute: false, nick: None, roles: [RoleId(643227058910003200)], user: RwLock { data: User { id: UserId(257521982021566464), avatar: Some("fc512e91d1c82e32024028adaa57cd81"), bot: false, discriminator: 9, name: "Dream", _nonexhaustive: () } }, _nonexhaustive: () }])```
audit log isnt updating so im guessing it is something else
@west raptor what if you try guild.members()
that's what im doing https://i.imgur.com/s3N77oJ.png
oh?
maybe try that then lol
API documentation for the Rust Guild struct in crate serenity.
so members() is basically for fetching members from api
interesting to have properties/fields with the same name namespace as methods lul
client.on('roleUpdate', async (oldRole, newRole) => {
try {
let guild = client.guilds.get(newRole.guild.id);
const entry = await guild.fetchAuditLogs({ type: "GUILD_ROLE_UPDATE" }).then(audit => audit.entries.first());
let user = await guild.members.get(entry.executor.id);
if (user == 645706703354068992) return;
let oldname = oldRole.name
let newname = newRole.name
let role = guild.roles.get(newRole.id);
if (config[oldname] !== undefined) {
role.edit({
data: {
name: oldRole.name.toString()
}
})
return;
}
if (config[newname] !== undefined) {
role.edit({
data: {
name: oldRole.name.toString()
}
})
return;
}
} catch(err) {
console.log(err)
}
});
I still don't get it... why isn't this working?
the moment you realize you are very dumb
yeah so members as a field works
wait nvm... i tried .toString()... didn't work
error?
no errors
@shy turret test oldRole.name
the only problem i see is that the audit log doesn't show anything new
Oh yes add ""
but me editing the role
audit logs aren't guaranteed to arrive
what is config ?
const config = require("./config.json");
i lost too many brain cells
i wonder if the event even passes
gonna debug
im gonna make my code simplier
maybe
console.log() clearly shows it passed
Bot is ready!
276497792526974996
645714324815347713-168766548725596160-KICK_MEMBERS | lol
2
276497792526974996
lol | 645714324815347713-168766548725596160-KICK_MEMBERS
3
but the role doesn't edit rip
just gonna use role.delete()
i just deleted the whole section out
message.guild.roles.create({
data: {
name: permname,
permissions: [permission.toString()]
},
reason: message.author.id + ' < (user id) | (command sent) > ' + message.content.toString(),
})
.then(roles => focuseduser.roles.add(roles).catch(console.error))
.then(roles => configSet(permname + "-id", roles.id))
.catch(console.error);
well why am i coding so much rn..
Lots o' spaces
ikr
I just wrote a function to read the file of my code and send certain amount of lines based on my input 
like so
Because why not 
cool
It's actually kinda useful if someone wants to see any of my code whilst I am away
yeah, but will you be able to remember those lines all the time 
hold up, "whilist I am away"?

I don't know the exact position but after a few attempts I am able to find what I am looking for
finally fixed
Why ```js
const a = bot.users.get("id");
message.channel.send(a.tag)```
Logs saying Cannot read property tag
Probably Cannot read property tag of undefined
as bot.users would only contain cached users
You might not get a result
either id doesn't exist, user isn't cached or they are running the code before the bot has connected
use fetchUser
@high lava @granite tartan Hi - sorry to bother but looking at using the Server screenshare but it looks like it doesn't work on tablets or mobiles - any info you could give me on working that out or does it just not work on those? Thanks if you read 🙂
Sorry I read the description for this channel and it seemed to be right
But thanks for responding regardless 🙂
sa
Um why would u ping me LOL 😂😂😂
😂 😂 😂 YOU WON'T BELIEVE WHAT HAPPENED NEXT...
Hello, someone found an invisible characters ?
for space channel name
yep i know Dany
But easy to make
hold alt + 0173 on the numpad
RIP this is a bad caracter
kek
I have the best :)
there is ** ** but that ofc wont work on channels
Lol
I can use spacechannel
@earnest phoenix how ?
Private 
there are a lot of characters that count as spaces but discord doesn't check for them
these will work if you input the name directly through the api, through the client they will not
Anyone know how to convert an image to html code?
what
the screenshot you posted just uses an img tag?
yes a zero width space you're so talented wow
imagine deleting your message lul
The image is specified in the code....
@white pond
thats not nice @earnest phoenix
:/
please re-read our channel rules https://canary.discordapp.com/channels/264445053596991498/272764566411149314/643187635434684455
Srry
i know
@white pond read this guide about using images in HTML: https://www.w3schools.com/html/html_images.asp
thanks

y0u LIk3 JaZZ
@boreal jolt i mean you can talk to @tidal parrot but he's only the pokeverse dev 😔
also this isnt the pokecord support server
I actually hate you spider
f
i love you too miles
could somebody un-ban me from the official pokecord server??
LULLLLL
I quit
THIS IS NOT OK SPIDER
could somebody un-ban me from the official pokecord server??
@golden maple no
@golden maple not our problem
¯_(ツ)_/¯
What were you banned for, out of curiosity?
@loud salmon Look at my status. This is your fault.
oh well.
fuck
@golden maple Use p!appeal to get a link to an appeal form
@earnest phoenix I do not like being banned you know!!
i swear
p!appeal
good lord
lol
brother
-botcommands @golden maple
@golden maple
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
p!appeal
don't bother appealing
LUL
2 cases of server ads

😔 👌
Appeal me daddy
to return on topic I shall ask a development question
Probably just code and stuff 😔
how do I add 2 + 2
4
2 * 2
Imagine if they actually developed feelings here instead LOL 😆 xD
You are gonna develop my ba- ok no this is to far
thnks @earnest phoenix
np 👍 😄
obviously not tho cuz ya know we're both straight guys right 🙈 😄
Math.pow(2,2)
unless.. 
no homo bro
Never say never :)
but you just sai--
hahahahahahah xdddddddddddddddd
I’m tryna make a bot similar to application bot on glitch can someone help me
Idk how to make it dm a person who ran a command
@halcyon ember glitch runs only on js
also glitch isnt meant for bot hosting
I mean
It’s like literally a small bot
For like 10 people
Also too lazy to get hosting cuz I’m broke
You can get a vps for like $12/yr
no
one of your dependencies may depend on that now

my bot should not require that
maybe it's a sub dependency
assuming your bot has dependencies
it's fucking npm being a little shit
or a dependency that requires another
i think ytdl core is the problem
FUCK
removing/adding packages resolves nothing
it's a fucking mp4 streaming package
imma have to be forced to take my bot down, currently no solution
Is MySQL good for simple stuff like storing and fetching IDs level ect or is there something else you guys would recommend for that
Yeah I was just looking into Enmap my self cause they offer per server settings
But just wanted another opinion on the best option to use first
Any form of database is good for simple stuff. NoSQL, MySQL, SQLite, just find what fits what you're wanting to do.
Is there a huge difference between MySQL and SQLite or is it essentially the same
One is column/row based, the other is not.
Alright, thanks 😁
Yeah lol
I've barely slept the last few days.
http://prntscr.com/pzuspv thanks stackoverflow now i know not to go to your site for questions on errors
that was to my error i'm getting
@grim aspen it's rare that it happens but there could be possibilities that no one there has experienced that error
If you post it here im sure someone will help
Ahh what have you installed lately maybe check the NPM page for it and see if it requires that if you don't want it if that's not the issue then I personally don't know I've never heard of it requiring dependencies on its own unless something else relys on what it's requiring so 🤷🏻♂️
<div class="bg-dark border-right" id="sidebar-wrapper">
<div class="list-group list-group-flush">
<a href="#" class="list-group-item list-group-item-action bg-dark text-light">Home</a>
<a href="#" class="list-group-item list-group-item-action bg-dark text-light">Add to Discord</a>
<a href="#" class="list-group-item list-group-item-action bg-dark text-light">Commands</a>
<a href="#" class="list-group-item list-group-item-action bg-dark text-light">Premium</a>
<a href="#" class="list-group-item list-group-item-action bg-dark text-light">Login</a>
<a href="#" class="list-group-item list-group-item-action bg-dark text-light">Status</a>
<a href="#" class="list-group-item list-group-item-action bg-dark text-light" id="menu-toggle">Toggle Menu</a>
</div>
</div>
how do i make the last a tag go the bottom of the containing div
^
Error: Cannot find module 'm3u8stream/lib/parse-time'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/rbd/pnpm-volume/71b5ddd8-2a78-46fc-aba4-68049f14880d/node_modules/.registry.npmjs.org/ytdl-core/1.0.0/node_modules/ytdl-core/lib/info-extras.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
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)```
How do I fix this error?
I just restarted my bot and this error suddenly appeared, even I didn't changed anything
Creeper55k had the same problem a few hours ago, don't think he found a solution
I think ytdl-core is the problem. But I already installed it
requireStack: [
'/app/node_modules/ytdl-core/lib/info-extras.js',
'/app/node_modules/ytdl-core/lib/info.js',
'/app/node_modules/ytdl-core/lib/index.js',
'/app/node_modules/ytdl-core-discord/index.js',```
I saw his problem in stack overflow but still no one had answered
@heavy void try npm install fent/node-ytdl-core
@grim aspen ^ could you try that too?
Didnt work
Currently getting new icon made for my bot by a proper artist 🖌️
finally don't have to worry that as my bot grows, it's logo will piss off discord's legal team 😛
because this @valid frigate
aight
Time to report you to Discords legal team before you change then 
someone any idea why i need to send 2 times the same command before my bot replies 🤔
Code?
@valid frigate not sure anyone would know wtf is happening in my actual dev, heres a screenshot 😄
im currently profiling my bot to try and figure out where i can lower its cpu use
it does a lot, so its like trying to pick flies out of a bucket of ice cream
What is the difference between int and signed int in C++?
Or, well, is there any?
No difference between int and signed int with today's compiler. But a small one with char and signed char
int is a representation of a number in binary
all bits are used for the value of the number
signed int takes one bit away from the number and uses it to "sign" it as positive or negative
so signed numbers can hold positive and negative numbers, in exchange of halving its maximum absolute value
a 16bit unsigned int can hold a value between 0 and 65535, a 16bit signed int can hold one between -32767 and +32767 (1 bit for the sign, 15 for the number)
c++ basically makes its int a 32bit signed long int by default (depending on the compiler), same as many other languages
^
Error: Cannot find module 'm3u8stream/lib/parse-time'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/rbd/pnpm-volume/71b5ddd8-2a78-46fc-aba4-68049f14880d/node_modules/.registry.npmjs.org/ytdl-core/1.0.0/node_modules/ytdl-core/lib/info-extras.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
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)``` Any solutions for this? I tried everything but still won't be able to get my bot up
how can i know on which servers my bot is added?
depends on library. with JDA you can get the jda object and then .getGuilds()
not sure with other libraries
are html <script>'s somehow blocked on top.gg's description field? i added some collapsibles and it worked fine in preview. does not work after publishing...
(https://top.gg/bot/436916794796670977 at the bottom)
@earnest phoenix
let serv = client.guilds.map(r => "**" + r.name + "**");
message.channel.send(serv)
And if you want
let serv = client.guilds.map(r => "**" + r.name + "** | " + r.id+ " | **" + r.memberCount+ "**");
message.channel.send(serv)
@dapper dome <script> is blocked for non-certified bots
We are not looking for: Multipurpose bots

aight then no scripts
but i got british english, so i get some extra points 
throw err;
^
Error: Cannot find module 'snekfetch'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/rbd/pnpm-volume/89f57bc8-9932-4d43-9864-f45b13c950de/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/util/Util.js:1:81)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
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)
i am not using this module anywhere
Trying To Install It
SnekFetch
Whats it for??
Didnt work
@grim aspen @heavy void
if reinstalling ytdl-core doesnt fix it, go into its installation folder and copy all the files from m3u8stream/dist to m3u8stream/lib
the m3u8stream folder should be located in node_modules/ytdl-core/node_modules
ytdl's next update should properly use the dist folder once again
@small prairie snekfetch is a library for making network requests and getting data from the internet. but it is deprecated, and not updated any more
so it should not be used
Not Using it
Idk why my console asking for it
@quartz kindle Any fix??
Tried npm install
it is still used by discord.js
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'ws'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at findWebSocket (/rbd/pnpm-volume/89f57bc8-9932-4d43-9864-f45b13c950de/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:21:12)
at Object.<anonymous> (/rbd/pnpm-volume/89f57bc8-9932-4d43-9864-f45b13c950de/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:23:2)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
Now whats this
also a module used by discord.js
Oof
installing discord.js should automatically install all of those
so try reinstalling it?
Kay
Its on glitch if it helps
WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none was installed.
WARN discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none was installed.
WARN discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none was installed.
WARN discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none was installed.
WARN discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none was installed.
WARN discord.js@11.5.1 requires a peer of opusscript@^0.0.6 but none was installed.
WARN discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none was installed.
I will need to install these then?? @quartz kindle
no, those are optionals
Ohkay
uws is bad anyway
bufferutil and erlpack can help using less cpu
Reinstalling didnt work
sodium and opus related are only for voice features
@small prairie how are you installing?
you should not be needing npm install if you add them to package.json, glitch should be doing that automatically
you're using the add package button?
what do you have under engines in your package.json?
go into the console and type enable-pnpm
Glitch Used Node.js 10 By Default
Thanks A ton
It Worked
If you dont mind
What was the issue?
@quartz kindle
glitch usually automatically handles things
but if you manually install something using npm install i think glitch disables their fully automatic thing
and it might break shit
enable-pnpm does a full reset and puts everything back on auto
Thanks Fam Will keep it in mind for future
@quartz kindle problem was is that the package 'part-time' was never installed
it is installed but not in the lib folder
its in the dist folder
ytdl-core released an update yesterday which changed the package to look for it in the lib folder, which caused this problem
there is a PR in place to change it back to dist
opened 3 hours ago https://github.com/fent/node-ytdl-core/pull/520
changes include:
Got some nice admin image management going so i can search for stuff and the edit button will show a popup to edit the image info and hide/delete or move albums.
https://cdn.discordapp.com/attachments/110373943822540800/647080780459278339/unknown.png https://cdn.discordapp.com/attachments/110373943822540800/647080921065062419/unknown.png
How can i learn any server how many boosted?
with code.
i n
wh i c h
l i b r a r y
^^
There are multiple librarys
i'm out
d.js or eris or something else
For js
discord.js
true
first time?
Why not helping any user?
its pretty damn tough helping a user without knowing what they are having problems with
its like going to hospital because you have pain somewhere but not saying where the pain is
@earnest phoenix I say get all members by the date and see if it's not null
if you use an ide that can autocomplete try typing in "premium" after a member class
eg member.premium, which is not actually a property, but your ide might list properties with that in the name
not sure if vsc does that but try it out
@valid frigate yea vscode will show a list of properties the class has like you described
@toxic junco remove the word Fun
spider
its meant to be server ids
you can test bots?
can you test mine now?
¯_(ツ)_/¯
I don't know if this is the right place to ask, but how could I create an RSS feed that sends data from my JSON file to someone else?
do bots also have the same file limit size as Regular users?
I think
But I think it also goes up if the server is nitro boosted
I'd keep files under 8mb anyways
yh just wondering if it keeps the 8MB file limit
just changes what the bot's file limit is and what users can store
Well this server is boosted, you can try to send a 100mb file here.
its just for global stuff that i need
ill just have to limit the user's file size to 8MB
Ah then yeah 8mb is safe
Is it possible to change a guild shard?
Guild A (shard 1) => Guild A (shard 2)
@earnest phoenix not possible
Okay :/
I have created a second server lol and he is in shard 2 but ty x)
message.client.shard.broadcastEval(`this.guilds.get('647154992402268160')`).then(console.log)```
```json
[ null,
{ members: {},
channels: {},
roles: {},
presences: {},
deleted: false,
available: true,
id: '647154992402268160',
name: 'test(shard 2)',
icon: null,
splash: null,
region: 'europe',
memberCount: 2,
large: false,
features: [],
applicationID: null,
afkTimeout: 300,
afkChannelID: null,
systemChannelID: '647154992402268163',
verificationLevel: 0,
explicitContentFilter: 0,
mfaLevel: 0,
joinedTimestamp: 1574364307653,
defaultMessageNotifications: 'ALL',
ownerID: '615610281569026108',
_rawVoiceStates: {},
emojis: {} } ]
But if i want to send this in a channel
message.client.shard.broadcastEval(`this.guilds.get('647154992402268160')`).then(message.channel.send)```
(node:27871) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'client' of undefined
hi short question how can you record a voice in vc i searching but didnt found a good answer yet discord provides docs are really rare and only a few bots does offer this feature so how are they doing this
This is not allowed
but some bots already doing it ??
Send a bot with this
its a certified bot dany
its only against the tos if the bot does not require these records and if i dont inform the users?
https://top.gg/bot/craig @earnest phoenix
^
Hum okay
😩
Use a stream module?
do you have any doc or tutorial for understanding
@earnest phoenix delete your guild and create it again, if you're lucky, it will go to shard 0 lul
the guild id defines which shard it goes to
i have a problem using typecasting in c, i think?
int i;
char str[] ="Hell0 World";
printf("str[%d] = %c", 4, str[4]);
i = (int)str[4];
printf("\n int i (using char) = %c", i); // why does this work print an int using %char
printf("\n int i (using int) = %d", i); // and this doesnt? print an int with %digit
output
as for your problem Dany, you have to send the message inside the broadcastEval
recording in voice is literally reading the user's voice stream and storing it, its allowed @honest stratus @earnest phoenix
@quartz kindle the guild is in the shard 0...
broadcastEval("this.channels.has(channelid) ? this.channels.get(id).send(message) : null")
something like that
@earnest phoenix the question is how
which lib are you using
js
yes but which damn library
? discord.js ?
No i want the guild infos in the channel
i only know this https://discord.js.org/#/docs/main/stable/class/VoiceReceiver
opus event and read the buffer
i now want to play around with recording user streams
seems fun
Listen to their secrets
breh
maybe they do
ooh
x doubt
sell it to google
how many GBs of data would that be?
oha
or TBs
more
yeah what i wanted to say tim
where they start doing targeted adds
they would also double/triple their bandwidth usage
stored as uncompressed wav files
@earnest phoenix do you want to explain how the opus things works? 😅
#readthedocs
Is that why they need 9 servers for the bot
not home right now but what do you not get
i know theres a alternative pcm stream but that cant be simple converted to like mp3 cuz its a more dimensional strean
you can also use the pcm event which is easier to work with cause its one of native formats
yeah
opus is lightweight and encoded
so you would have to decode opus bytes
which is annoying
what do you suggest
try pcm
ok
for now i suggest just reading the stream and piping it back through the bot just to see if it works
woah ok i will do my best and ask if i stuck
@quartz kindle No i want the guild infos in the channel
what do you mean?
Th infos can be console logged but not send
i just told you how to send to a channel in a different shard
Yup ty x)
what part of the d.py docs is it that goes over Receiving files sent from a user?
wait
nvm im fucking blind
missed attachements
hes always here, he has no life, like me
oh hi i take a seat next to you no life freestyler
btw do you have any experiences with opusstream?
so, sharding; runs a new instance of the bot correct?
is that the equivalent of running a another identical bot in terms of system resource usage?
I believe so as the servers are split between the shards
yeah, internal sharding still uses a single process/instance
Probably will want to run an entire new instance as I think the webhandler will be a bit slow otherwise
If the bot has a dashboard we must necessarily run it independently of the bot(if the bot use sharding)
Hmm?

I haven't set up a dashboard yet and not sure if i will or not
But it's just the shear ram usage that's a problem F
you don't have to @earnest phoenix
monolithic design exists
@earnest phoenix 🤔
How?
pack everything into one
RAM per shard for me is like 5GB per instance and 9GB usage peak
And oof not monolithic design again cry
host your bot and the web server in the same app
Yup i see
But the dashboard have to be modifier with boradcasteval etc...*
Modified *
monolithic design is fine for a small audience but if you plan on growing, avoid
Hmmm take notes
Catch me up cause idk how you shard between servers
servers as in server servers or discord servers
Server servers
Lol
you can define with which shard id you connect to the gateway
so you can have n independent bot processes each with a different shard id
Yeah but what if they’re on different machines
still possible
Same principle
Will requests from one discord server always end up on the same shard?
because you're connecting to discord in all cases, where the process is located doesn't matter
This is possible to make sharding bot with multiple machines???
Altho the size your bot has to be to make it remotely practical is extensive
@tranquil drum yes
Yh rythm is on multiple servers
What if a shard is down
Oh
I think 7 seperate machines atm
If a shard dies a shard dies
depending on what your bot does, its possible to drastically reduce its ram usage
it's really not hard at all
Where do the requests meant for that shard end up
If requests from a discord server always end up on the same shard
how many guilds in that 7gb?
what might be iffy is making your processes aware of each other and make them communicate
600 xD
what the fuck
I don't see how it's possible to do that when the machines don't really come out connected....
d.js for you
@earnest phoenix huh?
What's d.js xD
Nah I use py
how tf is that so heavy
Ram usage is high cuz of how the system works
thats 59mb fyi
I don't see how sharding can work with multiple machines for 1 bot
Bearing in mind it's caching 2GB of locations
So where do requests end up if the shard that was supposed to handle that discord guild is down?
To then boot 12 webdrivers
they don't @tranquil drum
And then upload all cache to webdrivers
Will the shard manager spin up a new shard?
@earnest phoenix inter-process communication via tcp/http
Who can setup sharding with multiple machines here 😭😂
Why would you want to
Your talking massive massive server count to make it worth it
What’s the point of sharding on the same machine?
@quartz kindle oh yes why not 😏 take notes
taking advantage of multiple cpus
Its basically just threading lol
No
i had a system where i had a parent machine which was a ws server and then just let other smaller machines connect to that ws
There's a big difference between threading and using async
And multiprocessing aswell
Only in python
I’m using Java lol
Pretty sure the principals are everywhere
There’s no multiprocessing without threads I think
Just cuz u use java doesn't mean it uses all cores and all threads together
And there's a difference between them
Threading can share vars
Multip processing doesn't and can't exchange global vars between processes (as far as I'm aware)
That doesn’t exist in Java though
java or javascript?
Like you’d have to straight up call exec and spin up a new jvm
node.js has worker threads
Java
https://prnt.sc/q0bkk8
https://prnt.sc/q0bks2
This is a dream x)
That is what uses multiple machines^^^
Yup
That too
Hmmmm
Sometimes I don't get the ram usage some times I goes upto 90% and it's always when I fucking at school with no way of checking what's up
Oh
whats actually using most of the ram tho?
Webdrivers
you have a ton of shit running in there from what you said
Alot of stuff yh
It's cuz the bot doesn't hold any data on a DB cuz of legality reasons
So it gathers all data live and processes with the command
You can use db...
can't hold any data on a DB cuz of legality reasons
Technically yh
Altho that data changes
What's on memory are just the systems that create the requests and handle the temp data till a new payload comes in
well, depending on what exactly you're doing, there are probably ways to optimize stuff
Possibly
Doesn't help that some of the sites (the main one aswell -_-) says it's loaded before it's actually loaded any data
Overall it's still pretty quick
what does it do if i may ask?
Main part of the system interacts with https://DungeonMastersVault.com
Rest works with donjon.com
Dndwiki
Some couple 5000+ thing I think overall
and you hold stuff like images in memory?
No
Images are temp stored as a file till it's needed
Try not keep any images in memory cuz of the sheer size of images sometimes
It's mostly the .orcbrew files that take up the memory on the pages
how big are those files on average?
Depends it's user specific
those are the ones you cant save because of legal reasons?
If the user hasn't got a custom file it's the defualt 3.5MB file
And the .orcbrews are similar to JSON files but they store any data the website can't store
So the user caches any data etc... On their browser only
So it becomes user 'hosted' rather than 3rd party
If u know cojure u can see the code for the site on the GitHub xD
nope, i dont lul
im just thinking about what you could do about using stupidly huge amounts of ram
Mostly just the webdrivers themselves
if you absolutely cannot outsource some of that to disk, you could always use swap or something
Maybe
Life would be alot easier / less ram intensive if there was a decent API for it but ¯_(ツ)_/¯
so basically the webdrivers are used to interact with the websites because they dont have apis
Yup
are they not scrappable?
What it does
do they require going through login systems and ajax calls?
