#development
1 messages Β· Page 1643 of 1
this.this.this.this.thing = this.this.this.this.this.this.this.seomthing_else```
i wonder what would happen
confusion
(function loop() {console.log('this.'); loop()})()
run this in console 
ok π
no balls
HEHHEHEHEH
slow cpu 
tim no reply, sad face

yeah mine was too
just record with your cellphone, duh
its dead tho
me too
agreed
just inside tho
ah
quality development going on here
always bro
teach me ur this ways
sorry im really bad at explaining things
right so I never tried importing N defining inside cunst does it actually work
does the client id of a bot change when u change its name?
ids do not change
@opal plank I did while(true) console.log('this.') and my chrome tab crashed
π
it should last a bit before it actually crashes if you're using pure js
Is using switch statements better than chaining else if statements?
it depends on the context
who want nitro
me
yes switch is better in that case
switch
Like if it equals (the cases) to 1, or 2, or 3, and on those cases, I will add an if statement inside of them.
case 1:
case 2:
etc.
Is that better?
well...
Thanks
who get it
Me
π
nice
Go ahead.
switch is supposed to be better by design
Yes.
however as far as performance goes, if else usually beats it, at least in js
Oh.
nah
idk about very large chains tho
if you have like 100 if elses
then maybe switch will beat it
but for small amounts, if else is usually faster
Aight.
π
Thanks.
what is the code, lemme try on brave
doesn't matter the JIT compiler will convert to the right one anyway
if(command === 'a') {}
else if(command === 'b'){}
else if(command === 'c'){}
else if(command === 'd'){}
else if(command === 'e'){}
else if(command === 'f'){}
the difference between both is insignificant

case a:
case b:
case c:
case d:
.. and some more stuff.
If you're dealing with a lot of cases then you'll definitely notice a difference
timism is up again lol
usually if you're comparing the same thing, you'd wanna use switch
I have no switch in my bot code 
Hope I said that correctly.
i generally go for switch if i have more than 3 ifs
just for organizations sake
tim
and only if i can actually switch the value
im dissapointed in you
i dont switch(true)
I have two else ifs, so I don't mind for switch at this moment.
lmao
tim betrayed me
π€·ββοΈ Lmao
what did i do lmao
when
Btw, is it your birthday?
ye
it totally isn't
Off-topic: Happy Birthday! π
tyty
π
here
#development : console.error("Ram Exceeded. Take your free time! Its your birthday!")
but like
π
thats the thing yall dont get
tim's free time IS SPENT HERE
he's procrastinating
found it
i have some results for md5 hashing
π
but im not home rn
my free time is also spent here
frick
I just have a lot of free time
my school time is spent here
spam ping me when you get home then tim
if i remember correctly it was tsmd5
ts
one of the fastest
π
but i dont demember
based
stonks
nobody gave tim nitro on his birthday π
Stonks emoji from Weeb server 
I had Discord credits, but you cant use them for gifting π¦
well nobody gave me on mine either, so its tied 
is this nitro begging? it feels like nitro begging
anyway, back to hashing blobs

@opal plank can you toss me a simple query to show gateway events in time-series format?
hmmm sure
I'm struggling a teeny tiny bit
Zoro!
ORDER BY timestamp
why md5 tho
thats all you need
md5 bad
cuz i need md5 for urls and sha256 for blobs
Timisim good critics
overkill
wait I'm still lost. just show me it lol
ah lul
What are the alternatives for md5?
sec
google hashing algorithms
there are tons
for fast hashing, check djb2a, fnv, murmurhash, xxhash, citiyhash, farmhash
whats the queries for logs?
dont u have something like this that you can show me?
yes
hmmm
that ideally should be mad simple but I'm just lost lmao
well I do but thats for monitoring thins that aren't very dynamic like servers and dbs
my only thing i can tell you is to ORDER BY timestamp DESC
that will sort it by timestamp
though you dont need it
as long as you have a time table it should be fine
you're using query builder?
thanks boo
@opal plank where can i find https://www.npmjs.com/package/detritus docs?
Hellooo
@earnest phoenix 1 sec
yo erwin
1 / 10 (10%)
How can I show the percentage of two numbers.
sup
how did you do the server logs on grafana
SQL raw
oh thx π€
you technically shouldnt be using grafana for this
check kibana
the queries im using are hella complicated
unless you copy paste you wont understand shit
lemme see
im so bored dont know what to code
use elk
its meant for logs
grafana is more for graphs
im the one going out of my way to abuse it
How can I do this percentage thing with JavaScript?
lol calc it ?
its some complicated queries, unles you're comfortable with advanced sql, you wont be able to understand it
doesn't stop me from wanting to see it
i'll look into this in the meantime
Managed.
people had lib only for you like this percent-value
I got it managed, no worries.
is that a package that simple does Math.round() with a single digit?
added to the list of cursed packages, right below is-thirdteen
it has 10 lines code lol
what is is-thirdteen
Erwin's moment
i get commission for each user i bring 
hehe xD
oh no
lol
is it ```js
module.exports = (num) => num == 13;
Erwins critic on useless npm packages xD π
anyone mind giving feedback on a short video I made to show how to set the webhooks role on my bot and rename it and set it's pfp?
this will eventually be a gif.
yea ok
I tried to keep it as short as possible
https://cdn.discordapp.com/attachments/731562189416300674/819271934122262568/TriviaBot_Webhooks.mp4
turkey
it ended up about 30 secs ish, I thought about having captions on it but 25% triviabot users don't speak English
π¦ ?
quality
that's part of triviabot icon set
But I unterstood it, even though I already knew it xD
theres flags for every country iirc but I used the turkey one in some promo material
premium?
@inner dirge
oh... no anyone can do it @tired panther
if I was using a token and connecting a separate custom websocket per user that would be premium but I'm not going to do that, it's resource suck city
I've built a queueing and marshalling system around webhooks with error rate monitoring so it's an advantage to me as well to encourage uptake of the new feature, the fact that people can change the pfp is a bonus
it's actually more "expensive" for me to send an image with each message than not
anything you'd change in the video?
make the quality higher, probably you compressed it for uploading on here
wait, wdym?
It uses my resources, when I use a custom WebHook avatar?
Tadaaa what yah guys think
the font must be darker
hello guys can you please help me with my music system in my bot? when the bot joins the voice channel it disconnects immediatelly and sends a message saying: Queue has ended. No more music to play
if you know how to help me please tag me with the solution.
sounds like you copied someone's code
who did you get that from?
a bot on github @opal plank
hard to read
ask the author
depends how you send it ... my webhook creation call sends it base64, if you use a URL it won't use any extra resources
oh thx


footer: {icon: member.user.displayAvatarURL({ dynamic: true, format: 'png', size: 2048 }),
How do I put the bot icon in the footer?
bot.client
?
discord.js?
yes
i don't think it is icon, is it?
hello guys can you please help me with my music system in my bot? when the bot joins the voice channel it disconnects immediatelly and sends a message saying: Queue has ended. No more music to play
if you know how to help me please tag me with the solution.
@queen axle in what code is it and if you have questions about the code i would request you to send the code so that people can look at it
client.user.avatarURL()
Thank you
This is pretty pog
what is it then?
footer uh
footer icon url
idek
Bytecode which gets turned to a sort function
Devs check this xD : #general message
meanwhile this is my interpreter hell
is that c++?
rust
ah
tetanus
two footers?
jest?
yeah?
remove first footer

ok
that py level indentation is driving me nuts, im not even gonna try hiding it
mocha and chai
ah nice
if you want to add text and icon url just do
footer: {
text: "Text here",
icon_url: ""
}```
yes
solar system is made in python
do you know how I know?
distance between planets?
xD
tim yellow
footer: {text: "The Suite", icon_url: client.user.avatarURL({ dynamic: true, format: 'png', size: 2048 }),
@summer torrent
happy cake day
yes
thats racist dood
solar system is written in whitespace lang
tyty
No more big memory usage tim
Imagine Coding In VBasic Or Pascal Where Everything Is Titlecased
SELECT fucks FROM SELF WHERE toGive NOT NULL
are files supposed to appear above embeds
ImAGine NoT CoDInG IN SponGEbOB CaSE
that's not showing the icon url
Even more pog
technically wrong, this however
SELECT fucks FROM 'user' WHERE fucks NOT NULL```

what I read
'user' referes to self
@quartz kindle so much for taking a piss at me earlier today init bud
lmao not again
how the turn tables
stop debugging my memes, Erwin.
Ricky?
for the record, tim was actually calling me a loli earlier on #general message

loli weeb tsundere

neko loli
timotei, timoteei, timotii
Does anyone know how to get a windows host something up on a domain rather then localhost?
xD
like, on a vps?
why do you want a windows host
now tim is legally obligated to end his debugging sentences with nyaa
buy a domain name and point it to your vps ip
Technically you get a domain on a window machine the same way as a linux machine. you point the domain to it. (or its IP, to be precise)
nyaa
wsl2 
Same as u would with Linux?
well thatβs something I never thought Iβd see Tim saying
@quartz kindle #starboard message wdum?
gottem
nyaa
actually
never heard 
thatβs what he means
lmao
@nocturne dagger here, watch this
Who is ted
o
@pale vessel

vague question
Is there a bot for people to enter your server?
i made one
Apparently there is a really obvious error in this code but I don't know what and the guy that helped me just went offline does anyone see it as I can't see it https://pastebin.com/Ji9h4piC
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Can you pass it to me?
it's not a join4join bot thoughj
lul yansim code
i dont even know how to even beging to tell you how bad this is
it lets you host a game that people can search for and join
first, dont use var

use let/const
listen, there are two types of coders: non-coders, coders and YanDev
don't be yandev
You can just use permissions.toArray().join(...) instead of... that
and if you use let then rethink your logic
second
omg 
if(message.member.hasPermission("KICK_MEMBERS")){
permissions.push("Kick Members");
}
if(message.member.hasPermission("BAN_MEMBERS")){
permissions.push("Ban Members");
}
if(message.member.hasPermission("ADMINISTRATOR")){
permissions.push("Administrator");
}
if(message.member.hasPermission("MANAGE_MESSAGES")){
permissions.push("Manage Messages");
}
if(message.member.hasPermission("MANAGE_CHANNELS")){
permissions.push("Manage Channels");
}
if(message.member.hasPermission("MENTION_EVERYONE")){
permissions.push("Mention Everyone");
}
if(message.member.hasPermission("MANAGE_NICKNAMES")){
permissions.push("Manage Nicknames");
}
if(message.member.hasPermission("MANAGE_ROLES")){
permissions.push("Manage Roles");
}
if(message.member.hasPermission("MANAGE_WEBHOOKS")){
permissions.push("Manage Webhooks");
}
if(message.member.hasPermission("MANAGE_EMOJIS")){
permissions.push("Manage Emojis");
}
if(permissions.length == 0){
permissions.push("No Key Permissions Found");
}
if(member.user.id == message.guild.ownerID){
acknowledgements = 'Server Owner';
}```
this
var permissions = [];
var acknowledgements = 'None';
var permissions = [];
var acknowledgements = 'None';
Why are those there twice? 
Put it in the dbl bad code repo
no u do it
i already fed you enough code

uh
I understand like
50% of the whole thing that got said here
ok ok ok
ok hold up
you want to check if the member has one of many permissions, right?
at least one of them?
it should list all the perms that the member has
kek
member.permissions.toArray()
why not just... convert the name instead 
we just told you another way to do it ^-^
Lodash would be great here actually since it has a function for that
yes but where do I put it do I put anything next to it which line aaa
big boys use raw bitwise
lmao
just do that in 1 line
with a for loop
just
member.permissions.toArray()
permissions.toArray(), except that it will give you MANAGE_SERVER instead of Manage Server, like you want it to
you should check docs before writing code
close enough
I mean the rest is basically just "make it pretty"
indeed
pretty comes later xd
which is still doable in 1 line
member.permissions.toArray().map(_.startCase) with lodash 
.replace("_", " ").replace("/ [a-Z]/g", "$1".toUpperCase())
then I added the module.exports part and then it died on me
That's how it looked like
then I wanted to add the nickname, full name and id
and I added module.exports to make it appear in the help command and it said fuck you to me and died
good story
ye so
nickname is nullable
why module exports tho
to make it appear in the help command
it auto adds when I do that little part in it

member.permissions.toArray().map((perm) => {
let arr = perm.split('_');
for(let _arr of arr) {
_arr = _arr[0].toUpperCase() + _arr.substring(1);
}}
return arr.join(' ')
})
this might work
maybe
perhaps
somewhat
ish
kinda
need to flat() and join tho
ah you mean to add the command to the command list
bru
but you get the gist
i tjought you meant to add nickname
but yes to make it appear in the help command list
lul
oh no xd
painfully done on mobile
But what is the error that makes my bot to not respond to it
It's really obvious he said and then went offline 
well what was the error?
The error redirected to the event message but he said to ignore the error because the thing that was causing the error was in the userinfo.js file
He told me that it was showing the error because something was wrong in the userinfo.js file and that made the error pop up in the message.js file
I also had it with the info command something was wrong and then fixed it and the error didn't show up anymroe
you didnt add an execute function
show userinfo.js
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Really obvious he said and then went offline
delete module.exports
how else will I put the thing in the help command list appear?
youre reassigning module.exports to a new object, which dereferences it from exports
youre already using exports
module.exports makes all exports invalid
o
if you edit it
.hasPerm will be depreceated
and do this
if(message.member.permissions.has("MANAGE_CHANNELS")) permissions.push("Manage Channels");
more structure @earnest phoenix 
let me test this first
@quartz kindle ok it works again
This will be a kind of stupid question
but what does inline do at
.addField "blabla" inline,
puts them in a line
INLINE | INLINE | INLINE
NOT INLINE
NOT INLINE
NOT INLINE
just check it on mobile
\n
\n
\n
\n
\n
\n
happy scrolling
chat killer command, just send it once π
in my info user command i put manage_messages permission for use the command, thats a correct permission or need other permission
??
depends
do your command removes user messages or their reactions?
if yes, it needs MESSAGE_MANAGE perm
else it doesn't
im using discord.py and there is someone who is abusing my bot and spamming with it. how do i make a command that prevents a menteioned user from using the bot?
my command show info of the user what permission is recommend to use
you'd need a database to store blacklisted users
or just ban them from every server they are in 
||im clearly joking, dont||
no one laughed, ouch, that hurts

π©
tim wtf when did you turn into a catgirl
since i called him out after he called me a loli
shush loli
cause neko's are too cute to booli

boowi

so, loli erwin
const loli = client.users.cache.get('188836645670223872')
loli.booli();```
is that erwin's id?
yes
xD
wanna booli him with me?
yes
prepare for bully
owo
and make it doubly
@opal plank loli
((commandClient.client as ClusterClient).shards
.map((shard) => [...shard.users.values()])
.flat() as User[]).find((u) => u.id === '180112943612952577').nyaa({options: {loli: true}, booli: true, amount: -1})```
beat that scrubs
.unoReverseCard();```
nou
no w
I can now
jesus, do you really have to do all that in detritus?
Bro, just do an epic gamer move
you have to do the same for djs sharded no?
though you broadcastEval
your that big you need sharded

not internal sharded
idk anything bout sharding so I took a guess
wait for ur ass to go to loli jail
now make him go to jail
Sure
const loli = client.users.cache.get('188836645670223872')
loli.goToJail();```
this.jails.random().put(Loli);```
noice
ik it is off topic but happy bday Tim!! Keep the cool on!
erwin
miyuka
you'll be fine
hello Miyuka

Hai star β€οΈ
Wait why we bullying erwin
cause he a loli
tim neko loli cofirmed tho
@opal plank 
NEKO'S TOO CUTE TO BOOLI
I'm a loli with a mustache
how are ya β€οΈ
context #development message
well well n you β€οΈ
HOW
Don't question me
hormones

bored rn β€οΈ
Top.gg development, more like general
exports.name = 'serverinfo';
exports.execute = (bot, message, args) => {
const verlvl = {
0: "None",
1: "Low",
2: "Medium",
3: "(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»",
4: "(γΰ² ηΰ² )γ彑β»ββ»"
}
let inline = true
let sicon = message.guild.iconURL;
let serverembed = new Discord.RichEmbed()
.setColor("#00ff00")
.setThumbnail(sicon)
.setAuthor(message.guild.name)
.addField("Name", message.guild.name, inline)
.addField("ID", message.guild.id, inline)
.addField("Owner", message.guild.owner, inline)
.addField("Region", message.guild.region, inline)
.addField("Verification Level", verlvl[message.guild.verificationLevel], inline)
.addField("Members", ` ${message.guild.memberCount}`, inline)
.addField("Roles", message.guild.roles.size, inline)
.addField("Channels", message.guild.channels.size, inline)
.addField("You Joined", message.member.joinedAt)
.setFooter(`Created ${message.guild.createdAt}`);
message.channel.send(serverembed);
message.delete();
}```
cuz i mean, i did make it easy to access stuff like that 
This module doesn't have a name
how do I give it a name so it gets defined
couldnt be arsed to extend commandClient
You're exporting different values than just an object
Booli loli Erwin with hugs

OYE
Pog
you're suppose to be on my team!

tf shiv
Loli.bully({ method: 'hugs' })```

I added this exports.name = 'serverinfo';
to define the module but it's not defining it
The module doesn't have a name
while(true) {
global.blockBooli();
}```
Impossible
how do I change that?
Well export an object and assign values
lazy
then get boolied
but how I'm kinda dumb and new to this lol
module.exports = {
name: 'bruh',
execute(...params) {
// Code
}
};``` as an example
i thought you had to declare module before
Yes
The amount of stuff existing in global object is interesting
i wonder
Reflect.ownKeys(global)
I'll see if I can mess with it and kindly bully the bot till it goes online
bullying @opal plank noises

loud screeching drunk high piched noises

oh no the loli is drunk
name: "serverinfo",
aliases: [],
category: 'Infos',
utilisation: '{prefix}serverinfo',
execute: (client, message, args) => {```
Like that?
that works
loli helping the white name?
Bulli the loli erwin

Can I say that it looks like I did more if I add the extra client, message, args inside the () xd

wait wot
thats not what i meant
i mean that semicolon and space is unecessary
you keep the stuff inside the parenthesis
I already have
reject d.js, come to monke detritus
Wait, what's detritus
slash commands but be a fun thing to implement
a lib that puts d.js a run for its money
const loli = client.users.cache.get('188836645670223872')
loli.pat();```
So a better d.js?
@opal plank 
better? LMAO
its 10 - 0 on d.js
i was bragging about it yesterday
and the day before
....
and the day before....
Sounds kinda sus
@earnest phoenix #development message read past this
thats just the tip of the iceberg
What do I do instead of discord rich embed
Richembeds don't exist anymore or do they
you can send() directly
they dont
its MessageEmbed
he's reading an outdated guide
Wtf that's amazing
i fucking know, been telling people here but the stubborn dorks dont listen
That's literally everything a discord bot needs packed together in a lib
been trying to advertise it to get it kicking
its an amazing lib
custom caching out the gate
command handler
It's a kick-ass lib
https://discord.gg/9beBCMAm
http://detritusjs.com/
https://github.com/cakedan/notsobot.ts/tree/master/src
Not so bot is written in that lib?
they ported it, yeah
it was py, i think its running both now
Well that lib is literally the best thing i've ever seen, anyway did you see my question?
In the future? Shoot I want to be able to think of something and an ai programs it.
Lol
make a bot that uses some other platform thats not easily accessible, like instagram
why? cuz why not


hiya π
etto i have a question ;-;
spam
it all can be done in ts
dont expect stuff to be pre made
im fairly certain theres no wrapper for instagram
you'll have to write your own
except command handlers π
I know, but like a feature that would really helpful in the programming language itself
use detritus for the discord side
i used discord.js and I'm still confused on how to mention someone in an embed message, can someone help me plz?
and instagram you code
<@IDHERE>
but like
dealing with apis you'll have to write your own types for the requests, its a good practice for ts to cast stuff
where? in description?
Well imagine if I add whatever you said to the v8 engine itself, as both node and TS extend v8

wherever you're trying to mention them, some fields in emebed dont work, footer, title, etc
Wot

oketh ty~
you asked for features about ts right?
types is the major thing about ts if you wanna use language stuff
with API calls they are all returned as any
No no no
Features you would like to see in the programming language itself in the future, like I want to add stuff to the programming language by contributing to it
That's what i meant
you could try solve an issue i had a couple hours ago
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
.addField("Status",`${status[member.user.presence.status]}`, true)
It's giving as output offline/invisible
but the user is online and status is online
Did I do something wrong?
When I fetch a guild from the API does the icon return as icon or avatar
icon right?
@earnest phoenix do you have the presence intent enabled
uh uh uh
It's off
That's a really interesting issue, I'll check something in the engine
A lot of stuff is returning undefined
.setThumbnail(sicon)
.setAuthor(message.guild.name)
.addField("Name", message.guild.name, inline)
.addField("Server ID", message.guild.id, inline)
.addField("Owner", message.guild.owner, inline)
.addField("Region", message.guild.region, inline)
.addField("Verification Level", verlvl[message.guild.verificationLevel], inline)
.addField("Members", ` ${message.guild.memberCount}`, inline)
.addField("Roles", message.guild.roles.size, inline)
.addField("Channels", message.guild.channels.size, inline)
.addField("You Joined", message.member.joinedAt)
.setFooter(`Created ${message.guild.createdAt}`);```
Just like here
how?
it seems you used v11 before
so check how to update v11 to v12
When I fetch a guild from the API does the icon return as icon or avatar
Anyone know?
It's up to date
just gonna check docs actually I am dum
but I used code from v11 when i'm in v12
your lib may be but code isnt
Code needs to be changed reflecting the updates. Read the doc he sent u
thats exactly what i sent
alright
i want royalties tho 
bug catching is also part of the job

there are also some other oddities i know of
The Type Checker node seems fine to me, i don't see why is that even happening, I'll do some debugging later on
Yea but like, that's kinda unexpected
hi voltrex
Hey extreme
Hey hey
well, in fairnes, yeah, its a quirk
howver
the proper way of doing what i was attemping is a simple Object.assign()
that would override existing properties
.addField("Owner", message.guild.owner, inline)
I can't find the v12 version of this
that.... is... the v12
but it's showing undefined
inline is either ture or false btw

not inline
ok
here
o
you using vsc?
yes
perfect
learn this and you'll never have another question regarding whats going wrong with code
you can stop code real time and see the current value of your variables
no problomo
sneeze

I'm scared π₯Ά
Why? Have you broken any of the #rules-and-info ?
no My bot is being reviewed
${guild.roles.cache.filter
what's wrong
heh
It's guild.roles.cache.filter right
It's not being reviewed right now. It's in the review queue, which can take 2-3 weeks before your bot's in the front of the queue. You can breathe.
Anyone here good with databases? So i have this code: https://sourceb.in/BrnKjw8UQf which is for my blacklist and antiswear. I already have it logging all bad words said to a channel, but I also want to make a database for it so that it counts how many times they have sworn or tried to say a bad word in the server. I know how to display it, my issue is that its not updating the database or creating a profile for the user.
offf I'm free and happy because I can freely edit because I wrote only eula lmao
you mean your bot isn't actually written yet?
Github buffet intensifies
no it's written but it won't accept my text
There's an error
well... maybe we can help, if you need assistance?
when you count you shouldn't modify a value in the database. add all the records to the db as separate records and then count the number of records
Please state the nature of your technological emergency.




?













