#development
1 messages · Page 1734 of 1
Moment has all the functions for dates
^^^
may i ask why you first use the modulus operator, and then do /25 ?
hehe
modulo is if you want the remainder, but since we're talking about coins you want the amount
so just divide by the coin value
C floors integer divisions
alright, imagine that the first remainder is 9
you would then do 9 / 25 ?
read the docs in the future
and then x100 at the end
oh yeah, tru
bro how my commad look cn you say pls
: 100
wut
i used moment

i got two dates
i just am unsure how to get it into <x> years/months/days
i dont want weeks
ig bento's solution will be the smaller you can get for amount of coins
oh you meant "how does my command look? Can you give your feedback please?"
how my bot commad look i say
is it look good
Whatsupp ?
make it not scream?
idk, looks fine ig, I wouldn't do all caps and probably would use fields
and don't be too bold
"best bot in X stuff" is the best way to get an user fight between same-genre bots
also fix the grammar in "YOU CAN USE NAMES, VIDEO LINK OF SONG"
and it's inconsistent in punctuation use
irks me a bit
alright, @lyric mountain one question. What if my input is 2.50.
that would give me no remainder at all
he's doing it already
oh, then why is this a question
so i could do var diffDays = b.diff(a, 'days'); but the thing is i want it to round to the appropriate measure.
e.g, if the difference is 35 days, i want it to round to 1 month
if the difference is 368 days, round to 1 year
div by num days in year and floor
to get rounded down year
now is it ok
fix your grammar, run it through a spell checker or smthn
i cnt know english
bro
any one help me pls
It's more like you just miss some letters
for enlish
google translate
cnt work bro
grammarly will prolly fix it all
i've sent that page like 4x, 5 times by now
Grammarly Free is nice for typos
awesome, does your code work
no not really
int cents = money * 100;
int quarters = cents / 25;
int dimes = (cents - (quarters * 25)) / 10;
int nickels = (cents - (quarters * 25) - (dimes * 10)) / 5;
int pennies = cents - (quarters * 25) - (dimes * 10) - (nickels * 5);
if you want a single-liner for variables
i tried what KuuHaKu did, but it is returning me 0 all the time
basically the same as bento's
lmao
my previous answer returns the remainder
not the amount
yeah i know
obv the final remainder is 0
// if money is in dollars
int cents = money * 100;
int quarters = cents / 25;
cents = cents % 25;
int dimes = cents / 10;
cents = cents % 10;
int nickels = cents / 5;
cents = cents % 5;
int pennies = cents;
this was mine
const mappedData = Object.keys(inventory.inventory)
.filter(key => inventory.inventory[key] !== 0)
.map((key) => {
const { name, id, logo } = items.find((val) => val.id.toLowerCase() === key);
return `${logo} **${name}** ─ ${inventory.inventory[key]}\n**ID:** \`${id}\``;
})
.join("\n\n")
Hm.. sometimes it maps through nothing and whenever I set mappedData as the description, it returns MessageEmbed field values may not be empty.. Should I add a if (!mappedData)?
const date = new Date(timestamp);
return date.getFullYear() + "/" + date.getMonth() + "/" + date.getDate();
little bit awkward but why not...
that's an ez solution, I don't see why not
this is music bot
I know, so what can I do so it can return a message if there was nothing?
believe it or not, but at some point i had this code too
If your other commands don't work, your bot will be declined
but i removed it
all work
op
if statement
if (!mappedData), right?
just being a grammar nazi
that's technically bento's answer but inline
i fix wait
that should work, or if (mappedData == "") if it's a string also works
👍
btw, "beta" is marked because you shouldn't really call a released bot "beta"
return await msg.edit(embed).catch((err) => {
msg.edit("Error")
console.log(err)
})```
am i missing something
cuz its not editing the msg indicating theres an error
u forgot to point out the "it support" part
ah true
^
do you need to await msg.edit("Error") ? idrk js tho
"indicating theres an error" and what's the error?
now
i purposely put an error before the editing
b.moment()
thats probs why

you repeat the same thing "To get started........." twice
lo
-info HypeBot
bruh
(node:2353) UnhandledPromiseRejectionWarning: ReferenceError: aaa is not defined```
i put aaa instead of age, it shows the loading embed and doesnt show the error embed

big thanks to bento and kuu, really helped me throught it.
next do it recursively for any coin values
lmao
Because you're not catching the error...
the embed gets formed,
return await msg.edit(embed).catch(async (err) => {
and is expected to edit with it
and if theres an error editing the msg, then return
it didnt edit the msg at all
That still doesn't catch the error you showed
try { ... } catch (...) { ... }
this is kinda redundant
also doesn't aaa have to be instantiated
did you instantiate it?
He's trying to catch the error purposefully to send an embed containing the error or something similar
just say contact our support team on our server (link) or something like that
there's no need for such a long txt
But he's using <Promise>.catch() on <Message>.edit() which will only catch the error on that method
So as I said, use try-catch
I agree with you
no no no
Not there
Put try { before where the command starts
Because the error you showed doesn't occur there in the code you currently showed
How do i get the user id of a user who voted for my bot when they vote?
webhooks, go to #topgg-api
Use webhooks
Thoughts on how this error looks?
It looks pog
Should draw big arrows for those that needs them 
Referring to #starboard message
@earnest phoenix @sudden knoll thx for help I do all thing and do in my main bot from test bot
I don't even know where to start

np
idk what that means but np
I do all thing in my test bot
Now i do in main
imagine using an IDE which doesn't have red arrows 
oh okay
Thx 😭
You making an interpreter?
Any one cnt help you both help me
moment
I mean, I have an idea but it's probably not a good one
sounds like the best kind of code to me
hi
actually my ```html
<style>
body{
background-color: #000001;
font-color: #ff0000;}
</style>
<body>
<h1 style="font-color:"#ff0000"; font-size:48px; text-align:center;"}> Cyte Bot </h1>
Cyte Bot is a multipurpous bot that can do a lot of stuff like
<h3 style="font-color:"#ea24fd"; font-size:20px;"> Giveaways with role requirements </h3>
<h3 style="font-color:"#ea24fd"; font-size:20px;"> Fun commands so that you don't get bored</h3>
<h3 style="font-color:"#ea24fd"; font-size:20px;"> A lovely economy to make you have more fun </h3>
<h3 style="font-color:"#ea24fd"; font-size:20px;"> Moderation system to make the members follow all the rules!</h3>
Bot is worth an invite!
<h3 style="font-color:"#06ee0a"; font-size:20px;"> Benifits of inviting the bot! </h3>
-> Increase server activity!
-> You can make chats more active by doing role req gws
-> And Much More!!!
</body>```
is not working
smh
ah saw it
nvm
why do you open a body tag?
also, you don't need to use <h1>/<h3> since top.gg supports markdown
just set their styles in <style> tag and use # text for h1 and ### text for h3
oops
ok ty
actually i use html css more
so i have habbit
of markdown instead of html
ye i saw lol
and
why is there a curly brace
why is my html <style> body { background-color: #000001; color: #ff0000 } </style>
not working?
quotation
"#000001"
woops my dumbness smh
i had a really bad day today so i am in another world
still no work
<html>
<style>
body {
background-color: "#000001";
color: "#ff0000";
}
</style>
<body>
<h1 style="color:#ff0000; font-size:48px; text-align:center;"> Cyte Bot </h1>
Cyte Bot is a multipurpous bot that can do a lot of stuff like
<h3 style="color:#ea24fd; font-size:20px;"> Giveaways with role requirements </h3>
<h3 style="color:#ea24fd; font-size:20px;"> Fun commands so that you don't get bored</h3>
<h3 style="color:#ea24fd; font-size:20px;"> A lovely economy to make you have more fun </h3>
<h3 style="color:#ea24fd; font-size:20px;"> Moderation system to make the members follow all the rules!</h3>
Bot is worth an invite!
<h3 style="color:#06ee0a; font-size:20px;"> Benifits of inviting the bot! </h3>
-> Increase server activity!
-> You can make chats more active by doing role req gws
-> And Much More!!!
</body>
</html>```
How can I make Join Date allign with User ID
im using embed.addField("\u200B", "\u200B", true)
wtf no
to have only 2 fields per line
,true after the description field
body element is defined already btw.
fields aren't that flexible
then arrange the inline acc my man
ah i can use body style =
smh i am dumb
kty
I mean, you can use blank fields
the website has a body element already
you can modify the content... use an element inspector to get the actual name
those are some evil colors tho
by evil I mean eye hurty
aka "blank fields"
yeah you have to do that for fields if you want nothing it it
\u200B is void character
lol
we cant change the body element?
so basically i am wasting time?
yea ^^^^
you can, I do it
just don't create another body tag
and use !important where top.gg uses it
you should be able to edit anything
correct
overwriting existing rules, requires an !important
tf
the first rule being read will be used
Hmm last thing
Pls say
looks enough to me
yes?
btw Benifits
matching elements already existing will only add rules if they don't exist already
!important will overwrite existing ones

still using bold statements I see
but yeah, it's a bit better
not for at least another 11 days
Hmm
Cn we friends
ik

i can be if u want
i just noticed 35 pending lmao
CYTE's a popular person
I don't like friend requests

they're coarse and rough and get everywhere
I be bold whts your problem
nahi
LIAR!
lol

jk
jk bro
Jk
hindi bolra matlba obv indian
Matlb
jk matlab just kidding
dm
because users will point that and say "nah chip is better"
or groovy, or rhythm, or etc
See this stupid person
lol
that's why calling your bot "best" in something is a risky move
just come dms bro why talk here
please dont argue here 
See chat up
She start
why r u continuing

dms aa
😫
Anyone have some python code for a set prefix command?
anyway, that was just an advice, I'm not saying your bot is bad
we dont spoonfeed
okay boss
You say cheap I also say to you
best way to end convo xd gg

OK ata bro
do you use some db?
or was you joking?
am going to move to a db, I have some ideas for some sql dbs I was just wondering if anyone had some ideas
sql, cool
any db in mind?
you can start sqlite then migrate to postgres later on
since sqlite has primitive datatypes which are supported on pretty much all sql dbs
nice
I use sqlite as a caching db and postgres as long-term storage
for python idk any package to recommend
Soory for bad bhavour
dw

But pls say not chip I make it very hardly
hmm since SQLite is 1 file, it'd be really easy to upload and download from AWS S3 for long term
what I meant is that if you state that your bot is the best in something you'll make people compare it to major bots
like chip, rythmn, groovy, etc
I cnt know English better
So that I cnt write
Any one help me so I do it

tbf, sqlite is so small that you can turn it into base64 and save somewhere
yup, sounds like a decent option for me
ty
dont use flask like that (sorry for long wait) you need to use a production server i recommend gunicorn
https://www.digitalocean.com/community/tutorials/how-to-build-and-deploy-a-flask-application-using-docker-on-ubuntu-18-04 has probably every possible conbination of stuff
luckily for you pre-made images already exist that do it all
FROM tiangolo/uwsgi-nginx-flask
FROM tiangolo/uwsgi-nginx-flask:python3.6-alpine3.7
RUN apk --update add bash nano
ENV STATIC_URL /static
ENV STATIC_PATH /var/www/app/static
COPY ./requirements.txt /var/www/requirements.txt
RUN pip install -r /var/www/requirements.txt```
you're entry point should be just as simple as doing docker run <image>
also building on what that error is saying
the way WSGI (and also ASGI) works when you give the servers something to run it follows the <file name>:<variable name>
so if i had something like my_app.py
and it looked like:
from flask import Flask
app = Flask(__name__)
we would run it doing flask run my_app:app
can anyone show me an article about reading/writing jsons cuz most dont work for some reason (java not script)
they dont even show how the code gets the json file
I used Gson to get JSON strings when I did socket stuff in java, so I'd recommend looking up documentation and tutorials on Gson. It was pretty ez imo
Hello what is the problem? im try to host this bot on my ubuntu vps and if i got this error. And this work for me on my own computer
https://imgur.com/8KKNhMZ.png
you need to update the node.js version on your vps
idk the command off the top of my head, google it
@modest maple Does Selenium support POST requests internally or do I need to use requests for that?
Well it's a browser interfacer
So makes sense if it doesn't
so that's dependent of the browser but easiest is probably just getting selenium to execute a script
Don't think so, but I'll have to see what I can do to achieve something
what r u trying to do
Does selenium support returned values from executed scripts?
I think so?
Fake me using my college website via Selenium and requests
Or as I would say precisely
Forward my notifications from my college website to Discord
And as you could guess, it doesn't have an easily accessible API where I can just fetch a JSON
This shit actually requires cookies to work, so I'm trying to retrieve that once I create a session on the website via Selenium
does it use JS rendering?
What kind of JS rendering do you mean?
AJAX and the likes
Yup
Doesn't look impossible to me though
Tough, but not impossible to accomplish 🤣
So what I do is:
- Make sure I log in;
- Get the cookies that I get when redirected to main page;
- Send "API request" to receive my notifications with cloned cookies
Haven't used selenium, but it sounds easy to do if you are using puppeteer (or python's version of puppeteer)
though you'll have to use chromium
which is an RAM eater
but it shouldn't be that bad for one page
ah
So yeah, Chromium isn't feasible for me. That aside, I think I can make do with the requests module
Just need to figure out how I can get the cookies for my specific domain
o wait you can use puppeteer with firefox, at least the node.js version of it
just make a cookiejar
and re-use the cookiejar
how can i fix that error?
did you copy the entire node_modules folder from your PC to your VPS?
yes
oh my
delete node_modules and do npm i, you shouldn't do that
imagine the bandwidth crying
ahh alr
Transfering 4.9Gb...
the best is when an npm packages includes their own node_modules inside

A loophole
is that a thing?
Heyyy
So I made an eval command and am trying to insertOne() with the eval command
ok and? where's the rest of the question 😛
Like this: ;eval db.collection("ids").insertOne({_id: "info", latestid: 0});
ok and what's the issue?
database manipulation with eval command tsk tsk
that should work fine
But I get this error: js TypeError: db.collection is not a function
well it sure looks like db.collection isn't a function
what's db ?
specifically, how is it defined?
let me find that
const db = mongo.db("main");
Well
you can, yeah
const mongo = new MongoClient(process.env.MONGOURL, {useUnifiedTopology: true})
ok. Now, is this all defined inside your eval command file?"
or a different file?
how does it get to eval?
oh wait
this makes sense.
I'm not quite sure how to do this in that case
My eval command is in its separate file
I need to find a way to access it anywhere.
I could just do it in index.js
yes. we're aware of the error you're having. I'm trying to help you with it.
how do you execute your run() function
in the message event
show me how you call command.run()
const Discord = require("discord.js");
function clean(text) {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
module.exports.run = async (client, message, prefix, player, db) => {
const args = message.content.split(" ").slice(1);
if(message.author.id !== process.env.ownerID) return;
try {
const code = args.join(" ");
let evaled = eval(code);
message.channel.createMessage('`You are authorized to use this command!`')
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
message.channel.createMessage('`Working!`')
message.channel.createMessage(clean(evaled), {code:"xl"});
} catch (err) {
message.channel.createMessage(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
}
module.exports.help = {
name: "eval",
};```
this is my entire eval code
btw, you don't need String.fromCharCode
just use \uCODE
in this case \u8203
that's copied code from an eval command I wrote, don't worry about it 
yeah probably
Also don't worry too much about the fact that this is still the damn frankensteinian horror of mixing two completely different discord libraries. It hurts the brain when you think too much about it.
you're wrong evie
Uh what
Whatever it is, it's a freak show.
There is, but I was just commenting on it so people don't start wondering
but I'm still waiting for your message event code
I'm using eris and eris-additions for the gateway interaction
... why is this relevant
what
just .. show... the... message... event... so ... we... can... get... to... more... debugging.

a car with boat wheels and plane body
I think i figured it out
Nah it's just a Civic with the engine from a Focus, and they slapped the logo from a Hyundai on the front & back for good measure
how do I use Visual studio code?
for?
music bot
ok, for coding then
yes
You open it and then you start typing in it
embeds from djs, command handler from detritus, eris for gateway, rose for caching @lyric mountain
use notepad

after I finish the files, save them and are ready to work the commands?
yes
okay
put a salt on it an use d.net for objects
Do ctrl s for saving if auto saving is off
assembly for the main lang
1.5GB of RAM to run a bot 
Well my bot is mix of javascript and python
I also saw that there are bots to get free follow on Twitch
That's against the twitch terms of service so don't do it.
technically.....
yes I know
actually, not gonna get to that argument
you should do it, for moral reasons
shounldt*
but twitch has a weird as fuck policy with it
there is a code for music bot? Pls...
as long as you are watching ads, they are fine with it
dont ask me why
i asked their staff a couple times about it
There are literally hundreds of music bots on github, Cola
that was the response
okay
İ think we should move to general
technically, the only losing end is who paid for the ads
what can I write to find them?
"discord music bot"
okay thanks!
well, yeah, idk why would they allow bots if they "wacth ads"
as long as its generating revenue, they fine with it presumably
free muny
and then I copy everything to Visual studio code and enter my Bot token?
#general-int time
I mean if you want to be yet another unoriginal music bot in a sea of completely identical bots, sure, yeah, do that
which, funfact, its harder to code the recieving part to "watch the ad" than to actually make a shitton of accounts
yet another github buffeteer
discord.js:
how can I fetch if message author is in a specific server?
oh yeah! I just need it to work...
They should have instructions how to if not proably so yes
Not sure why you can't just invite Groovy and be done with it
oh ahahaha
get the server you want to check. check if the members collection has the id of the author
thats it
PS: you need intents
server members?
yes
uhm no you don't
if so, I'll need to apply
you do not need intents to fetch SINGLE users/members
wait rlly?
just to get the guild member list
Only for multiple right?
jesus fucking christ people this is why the goddamn queue for intents is 5 months
in a guild tho?
can you send me all the code that servers to play music?
message.guild.members.fetch( "139412744439988224") <--- this does NOT require any intents!
i thought the endpoitn for what was whitelisted
client.users.fetch("139412744439988224") <---- neither does this!!!
I see people are just discovering this
@umbral zealot but anyways, what should I make to do this?
this one?
right, its the list that requires intents
message author
hello Airwin
message.author literally is the message author
hello Thousand
hi
So what do you mean then
but what is the string I should make
I want for example
if message author is not in server X, return message.channel.send('you're not in the server X')
@opal plank have you ever heard of this discord library called detritus
uhh whats the link to the message?
for a single server it might be fine tbh
client.guilds.get("the guild ID").members.fetch("the user id") this returns a promise, which will be the member if they exist, and will be undefined if they're not in the guild.
would add a ? there just in case
client.guilds.get("the guild ID?").members.fetch("the user id?")
Erwin being completely vague and expecting people to know what the hell they're talking about lol
client.guilds.????get.memb?ers.fetch

client.guilds.get("the guild ID")?.members.fetch("the user id")
you know very well which of those might return undefined

the comment was for u
repl.it doesn't support this yet
it needs Node 14 I guess
wait what
|| {}
I dont think so
Try client.guilds.get("GUILD ID").members.get("USERS ID")
oh they changed it
wait a second
if its node 14 it supports it
look at the last one
conditional chaining was introduced in 14
which is the same requirement as d.js
That would only work if the member is cached which isn't very useful tbh
not node 14
because members are generally not cached.
repl = 12.65 or smth like that
but d.js is node 14 tho, thats why im confused
hey did you know you could tell repl to use a different node version? lol
maybe that reffers to an older v12 v too, but idk if thats the case
but repl doesnt supports 14 yet
idk
conditional chaining was introduced in 14
before 14: js ((((client || {}).guilds || { get: () => undefined }).get('GUILD ID') || {}).members || { get: () => undefined }).get("USER ID")
They have upgraded their node js version to 14 from 10
Erwin do you like my code?
hmmmmm
not better than mine
where was it
function returnType(staff) {
return staff === undefined ? "staff is undefined" : staff === null ? "staff is null" : typeof staff === "number" ? "staff is a number" : typeof staff === "object" ? "staff is an object" : typeof staff === "string" ? "staff is a tring" : "staff is unkown" }```
not this one tho
it was here somewhere
client is not defined
ok well, adapt the code to your specific context?
how should I define it
yes
const Discord = require(`discord.js`)
const db = require(`../database.js`)
module.exports.run = async (bot, message, args) => {
let user = message.author;
let server = client.guilds.get("774041271655333928").members.fetch(`${user.id}`)
if (server === undefined) return message.channel.send(`You must be in [Support Server](https://discord.gg/hHwXDmQabp) to redeem a code.`)
}```
god, you provide 99% of what the user needs and they still demand th rest of the spoonfeed
yeah what's your client variable here?
you should know, you wrote this code
What variable defines your bot's client
lmao
@crimson vapor found it ts let channel = client.channels.cache.has(args[5]) ? client.channels.cache.get(args[5]) : await client.channels.fetch(args[5]), linkContent:Discord.Message; if(channel) linkContent = (channel as Discord.TextChannel).messages.cache.has(args[6]) ? (channel as Discord.TextChannel).messages.cache.get(args[6]) : await (channel as Discord.TextChannel).messages.fetch(args[6]); console.log(linkContent)
what in the fuck?
options.color = options.color ??
(options.type === 'ERROR'
? this.worker.colors.RED
: undefined) ??
(options.type === 'KICK'
? this.worker.colors.YELLOW
: undefined) ??
(['BAN', 'MUTE', 'NO'].includes(options.type ?? '')
? this.worker.colors.SOFT_RED
: undefined) ??
(options.type === 'YES'
? this.worker.colors.GREEN
: undefined
) ??
(options.error
? this.worker.colors.RED
: this.worker.colors.GREEN)```
don't try to out-noob the noobs 😛
imagine flexing you're noob'er than the noobs
,
options.color = options.color
??
(
options.type === 'ERROR'
?
this.worker.colors.RED
:
undefined
)
??
(
options.type === 'KICK'
?
this.worker.colors.YELLOW
:
undefined
)
??
(
[
'BAN',
'MUTE',
'NO'
]
.includes(
options.type
??
''
)
?
this.worker.colors.SOFT_RED
:
undefined
)
??
(
options.type === 'YES'
?
this.worker.colors.GREEN
:
undefined
)
??
(
options.error
?
this.worker.colors.RED
:
this.worker.colors.GREEN
)
in discord.py, why does guild.get_member(ID) require the members intent while await guild.fetch_member(ID) does not?
is it b/c get_member uses the member list?
neither requires it, just get_member tries to get it in the cache, so it will fail if not cached
oh, that makes sense
the members intent doesnt not guarantee the member will be cached either
Are we doing that again? 
ik that, but it's strange that get_member(ID) returned a member instead of None when nothing changes btwn runs besides the intents
yes but its still not guaranteed
the members intent by itself doesnt give you members, it has to have both members and presences, and even then it will only give you online/active members
offline/inactive members still wont be cached
unless you specifically fetch all
not sure how py does it, if it has an option to automatically fetch all or not
idk, I don't see any of that info in the docs
all I know is that get_member(ID) returned None while fetch_member(ID) returned a member
hmmm wait it does say "If you have Intents.members and member cache enabled, consider get_member() instead."
instead of fetch_member(ID)
fetch_member will always work, regardless of intents
yup, that's what I'll use
but the way the docs are worded, it looks like get_member() requires the members intents, although I'll take your word for it that it doesn't
well i dont use py so idk how it works internally
but thats what the discord api docs say
@sudden knoll
i was talking to evie about it just a couple mins ago
indeed fetching a member doesnt require intents
i assume get_member() looks in cache
which, without intents, wont have much cached, if any
ahhh
thats what i would assume at least
that makes sense
thank you
yw
like tim, idk py well, so thats just a polite guess
welp, I'll be using fetch anyway so I'm not really worried about it
how can I send a message in a specific channel?
I want to put the channel ID inside a database for the currency system command
so there isnt a spam inside chats that are not made for bots
never detritus
i mean the code should be similar tho
if i ever make a discord lib, guess what im gonna call it
discord-light
nope
<client>.channels.get(id)?.send(<content>)
discordtim
timcord
nope

what?
timcord
timcord's good
why the question mark?
conditional chaining
ifs the same as
if(<client>.channels.get(id)) <client>.channels.get(id).send()
it basically checks if whatever returned isnt falsey
The optional chaining operator (?.)
enables you to read the value of a property located deep within a chain of connected objects
without having to check that each reference in the chain is valid.
read that for more
so what's the name gonna be Tim
Erwin when someone finally needs help with detritus https://tenor.com/view/froggy-dance-hype-hyper-kermit-the-frog-gif-12822945
this
Erwin
Tim's fancy amazing super dooper cool gang lib
sope
astrocord @quartz kindle
Hru
Probably "better-detritus"
Bot is talkin
Hi Gucci I am table
same
ok
Tim crashed
lmao
lmao
if i say you guys are gonna steal the name
[420_69]xxXX([BOOSY_SLAYER_LIB_JS])XXxx
Erwin would never betray Detritus

indeed, im committed to my religion
where's my gif
detroit us
lmao
Oh oh it’s happening... we’re losing control 
xD
if cake went fro detritus, i guess tim will go for rubble?
I wonder if Erwin ever payed taxes for the cash he got for his ads
thats some high iq joke there
and nobody laughed

not a single person laguhed
yikes
im gonna retreat myself into coding more useless features onto my bot till i get courage to port it to the new dyamic handler
The more useless stuff the better
how can I get the shard for a guild in discord.py?
guild.shard_id
then get_shard
np
you don't
you can only control dynos via CLI or with the dashboard
but obviously, if you shutdown your process through code it'll auto-restart
Discord.js doesn't have a method like <Guild>.channels.fetch, but you can still get the channel in the cache via <Guild>.channels.cache.get(...)
i found it out
i have another question
How would i fetch the name of a channel that a message author sent a message from?
@sudden geyser ^
or get the channel name
<Message>.channel.name: https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=name
If it's from a DM it won't have a name property.
hi
why hello there
General Kenobi.
Anyone use BDFD ?
no
You are a bold one
ARE YOU CALLING ME FAT
No Kevin you’re not fat, you’re sweet. All the other kids looking differently are abnormal.

I haven't tried it yet, do you need a payment method?
You need to provide a payment method, but they wont charge you unless you step outside of the free resources
I'm sure you can, Heroku has an API
U can do it via CLI or program it
for directly manipulating the dynos? I'm 99% you can't
I wonder why DMChannel.name doesn't exist considering if you send <#DMChannelID> the client resolves it to #recipient
nvm. It's not the client resolving it like that. It's the server
I guess the server resolves it to the current user name if the current user has access to that channel
What. There is no way.
I wonder how the server determines who the recipient to resolve is
That channel ID I provided in the second image is to a bot
Clarified elsewhere: client resolving. Not server. message content is still in <#ID> format
what the fields embed for a message again?
what
how would I detect it when someone finishes a sentence in discord.js when i have put a audio stream on them to record there activity in voice
That would require analyzing the stream and detecting frames "quieter" than frames of when they're speaking. This would require some logic to determine when someone is actually speaking and what's "noise" and such
voice detection tensor flow ai
https://github.com/filippogiruzzi/voice_activity_detection
seems theres a few tensorflow models out there for this.
voiceStateUpdate event with VoiceState#speaking
Someone's mic still might be going off if there's background noise. As such, that's not reliable
yea thats why i didint want to use that
Yeah, so having an AI to detect voice activity would be your best bet
some kind of model
that might just work
but its a bit complicated
and i have absouletly no clue how to use it
and
its
based
in
python
You can pipe that data to that process through IPC
might become computationally expensive depending on user count unless that allows for parallelized stream detection vs just 1 stream
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:592:3)
at tryReadSync (fs.js:366:20)
at Object.readFileSync (fs.js:403:19)
at UnableToResolveError.buildCodeFrameMessage (C:\Users\x\OneDrive\Desktop\testapp\testapp\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:304:17)
at new UnableToResolveError (C:\Users\x\OneDrive\Desktop\testapp\testapp\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:290:35)```
I keep getting this error but unsure what's causing it
`EISDIR stands for "Error, Is Directory". This means that NPM is trying to do something to a file but it is a directory.` is what I found so far. I really don't know what is causing it but it returns an error as soon as i start the app
and then I get
(node:38556) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [HasteMap]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)```
Isn’t it obvious?
You’re using filesync on a directory not on a file.
I don't know what filesync means
if you want to read a dir, use fs.readdirSync
Well I don't think I have coded anywhere to do that because this is a react app
your react module is doing it
probably initialized wrong, or something configured incorrectly.
Probably intended to read an asset, but passed a dir
import TvShowScreen from './screens/tvshow';
is the cause of the error importing a file?
Sorry if I am completely misunderstanding it
is ./screens/tvshow a directory? or a file
directory i guess
fs.readdir('./commands', (err, files) => {
if(err) return console.log(err);
let jsfile = files.filter(f => f.split(".").pop() == 'js')
if(jsfile.length == 0) {return console.log("Could not find any commands!")}
jsfile.forEach(f => {
let props = require(`./commands/${f}`)
bot.commands.set(props.help.name, props)
})
})
``` how do i look for sub folders
A directory
it needs to be a file.
oh
import TvShowScreen from './screens/tvshow.js';?
Pretty sure you can filter by items in the Array which doesn't have a file ending
wait. i dont think its that part. did you just get a random line and ask if its that 👀
yeah
dont do that lol
how
Well it was a hypothesis
your looking for a method/init/usage of your metro npm module which is being passed a directory when it should be a file.
files.filter(i => !i.match(/\.\w+$/))
would return an Array of sub directory strings
I have no clue how to find this tbh
so that you understand regex more because regex is powerful: .\w+ matches the . in the filename and any ascii character (inclusive of numbers) after that . (you need to escape the . because . matches ANYTHING) and the $ specifies the end of the string.
How did this error appear on it's own don't think I caused it 
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @discordjs/opus@0.5.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the @discordjs/opus@0.5.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
@discordjs/opus@0.5.0 install /tmp/build_de9dfaf6/node_modules/@discordjs/opus
node-pre-gyp install --fallback-to-build
-----> Restoring cache
- node_modules is checked into source control and cannot be cached
idk
i get like an email a min from them omg
is this on heroku?
yea
how solve api probaleam in repkit
Confused.
3 versions of the same bot go vroom
I love creating bot tokens, y'know?
@sudden geyser
Basically the middle one runs on my local machine, and is the one I do testing on (V4, local machine)
The top one is the stable version (V3, VPS)
And the bottom one is a version of the alpha one running on a VPS so that users can see my progress. (V4, VPS)
Since V4 is unfinished still.
ah, that's interesting
for my former bots I just had a public and private bot for develoment
Hey, so I was wondering what's the best way to register someones purchase with chargebee, I've the drop-in script working atleast somewhat, and now I want to actually get the premium register working. I hold users in a database with their third-party login, so what's the best way to handle it? Should I have a webhook with the users being redirected to it a different path and that'd link their user to a subscription ID, or should I use the webhooks and link users via their email?
I wish I knew how to answer, but I am not smart enough.
If I'm already using prepared statements for MySQL is there any additional sanitization I should be doing for user input? mysql2 lib for js.
Because I am not smart, I'd say go with your guts and you can change your mind later.
Hmm
Subscription ID, actually
That lends itself to more functionality, like the ability to transfer a subscription to somebody else
Hey, is there a way to track someone using an invite link if they have already joined the server?
Fairly certain you can only record that when the user joins the server, not if they've already joined.
Hmm yeah thought so. Oh well.
yeah, discord doesn't store that unfortunately
I made a bot that automatically adds roles depending on what channel the invite was for.
But it would be nice to somehow make it work even if they were already part of the server.
Getting mods to manually add the roles should be fine though.
Oh man, I wish I had found Eris before building a bot with Discord.js.
look up detritusjs and you'll find yourself in the exact same situation again

Hah, I was sold on pure-Typescript
not only that, read this #development message
pros and cons
how to reactivate it?
by messaging support that you want new intents
ask here for more precise directions discord.gg/discord-developers
Thanks You
Nopes problem
did u read it?
Just reading through the API docs
would highly recommend just checking the basic stuff, the docs are generated
you'll abuse most of the stuff in intellisence
"basic stuff" i mean the examples
forgot to mention. heres the links
https://detritusjs.com/ website/docs
https://www.npmjs.com/package/detritus-client npm
https://github.com/detritusjs/client gh
https://discord.gg/NEq6wws support server
https://github.com/cakedan/notsobot.ts/tree/master/src example of a good bot
Was just making sure I could deploy it on our Kubernetes cluster, with proper sharding support.
it has sharding on its own
no need for kubernetes to spawn them
unless you really want to
I really want to.
it has its own cluster spawning
you should ask in their server how to do it in all honesty, i personally dislike kubernetes
But it looks like you can set the shardID and shardCount just fine. So we are all good 🙂
eyes
stink



lol
lol



