#development
1 messages · Page 1288 of 1
i cant help then
the role command works.
so that's not the problem
but the gRole variable doesn't seem to log anything.
it doesn't add any roles.
@eternal osprey If you are on Discord.js v12, then I'm pretty sure its
await rMember.roles.add(gRole, '<reason>')
@abstract coyote use google
if(!role) return message.channel.send("Specify a role!");
the usage of the command: !giverole @member rolename
you return the script
wiat what
Does the message "Specify a role!" appear?
no
ok nvm, thought that would happen
if i use !giverole @member rolename
@eternal osprey If you are on Discord.js v12, then I'm pretty sure its
await rMember.roles.add(gRole, '<reason>')
okay
but what the fuck should i input in reason?
just test.
or something?
await(rMember.roles.add(gRole.id, 'reason'));```
whould i have to remove the gRole.id?
and just input gRole?
let helpArray = message.content.split(" ");
@boreal iron
Cannot read property 'split' of undefined
whould i have to remove the gRole.id?
@eternal osprey you should dorMember.roles.add(gRole, 'reason')ifgRoleis a role object, you could also pass in the role id directly
how do i see what item the person uses and then with id's do what its suppose to do through id
discord.py, if you dont understand anything tell me what u dont understand ill try to explain : >
help pls
@eternal osprey If you have ever seen Dyno do its Auto-Role, you would see in the Audit logs that is says With Reason: Dyno Autorole
The reason would show in the Audit logs
oowh okay.
oh sorry
await rMember.roles.add(rRole.id, <reason>')
there
yes, add the role ID instead of the object
how do i see what item the person uses and then with id's do what its suppose to do through id
discord.py, if you dont understand anything tell me what u dont understand ill try to explain : >
help
Map.toArray is not a function???
@cobalt spruce message.content is undefined in your case.
please
it still doesn't work
Send a few line before and after the error
@violet mesa begging is a sign you aren't be a good programmer
???
you're literally begging to be helped
Map.toArray is not a function???
@earnest phoenix my bad it's justMap.array
Hey okay im trying to check if a message includes a mention of a user that has a specific role... How could I check if the message has the mention of the user that has the role?
check if there is a mentioned user -> turn the user into a member object -> check if the member has that specific role
he asked for user
I'm talkin' to him btw
here's a more detailed step by step version:
- Get the mentioned member through MessageMentions#members
- Check the member's roles by getting the GuildMemberRoleManager object through
await GuildMember#roles#fetchAll()ORGuildMember#roles#cache
- Check if it includes the specified role through
Collection.some
- You're now left with a boolean.
All this explanation,
Just get the mention by <message>.mentions.members.first() as it returns a GuildMember,
check if it has the role by <GuildMember>.roles.cache.has(<Role ID>),
Done
- Do whatever you wanna do next.
@earnest phoenix I'm super bored of school hence i typed a whole guide for this guy to pass the time
const pinged = message.mentions.members.first;
if(pinged.roles.cache.has(roleid or wutever lol){
message.channel.send('pog lol')
}
``` something like that? I am not good at this yet :)
yes
:D
Doing all that is kinda mostly useless for beginners hence they don't understand
@abstract coyote first is a method
the role id must be a string btw
yee
could I put an array of role ids into the pinged.roles.cache.has(The Array?)
Check if the mentioned user exists before proceeding
or should I interpret it differently
could I put an array of role ids into the
pinged.roles.cache.has(The Array?)
@abstract coyote no that's not how Collections work
oof ;-;
has also accepts arrays
wut da fuk
help
i am immume to reading updated docs
how do i learn to read new stuff in docs
My bot is still online and there are no errors but Client.users.cache.array() lags up the bot and just stops the function from running???
maybe there are so many users that it couldn't fit into a single message
const Discord = require("discord.js");
const ms = require("ms")
module.exports.config = {
name: "tempban",
aliases: []
}
module.exports.run = async (client, message, args) => {
let user = message.guild.member(message.mentions.users.first());
if (!user) return message.channel.send('Please specify a User to tempban.');
let time = args[2];
if(!user) return message.channel.send('Can\'t seem to find this user. Sorry about that!');
if (!user.bannable) return message.channel.send('This user can\'t be tempbanned. It is either because they are a mod/admin, or their highest role is higher than mine.\n\`Or:\`\nthe bot you trying to tempban with or yourself, owner, etc!');
if (user.id === message.author.id) return message.channel.send('You cannot tempban yourself!');
if (!time) return message.channel.send('You must specify a time in days! (Ex: /tempban @Endph#5742 1 They is / are underaged.)');
if (isNaN(time)) return message.channel.send(`${args[2]} is not a number!`);
if (!isNaN(time)) time = parseFloat(args[2]);
Someone help I cant change the reason? Is it anyways that I can change the / to args[3] the reason or smh
/tempban @autumn aspen 1 They is / are underaged.
Its locked on that reason :/
/tempban @autumn aspen 1 They is / are underaged.
Its locked on that reason :/
@autumn aspen because you ARE underage
facts
when will we know if our bot is accepted?
@clever dust you were right
when will we know if our bot is accepted?
@modest smelt luca will dm you also #support
when will we know if our bot is accepted?
@modest smelt u will get a dm
@autumn aspen because you ARE underage
@earnest phoenix dude pls help me man?
ok
when will we know if our bot is accepted?
@modest smelt @gilded plank dms you
@autumn aspen you're alergic to jokes or what?
ok
what do need?
@autumn aspen well i can't help with the reason one but there are heck more silent errors in your code
Man, I'm tryna regex the json out of this html and it works in regexr but not in my c# script
@autumn aspen well i can't help with the reason one but there are heck more silent errors in your code
@earnest phoenix wdym
Frustrating
you're treating a GuildMember object as a User object
You may forgot the g for global or m for multiline, Auger?
yeah?
You may forgot the
gfor global ormfor multiline, Auger?
@boreal iron You might just be a lifesaver
let user = message.guild.member(message.mentions.users.first());
this is very wrong
this is very wrong
@earnest phoenix oh lol
@autumn aspen You shouldn't pass User objects to a function that treats the passed object as a GuildMember
I'm not going to lie, I immediately switched over to using indexes and substrings
silent errors...silent errors
@earnest phoenix ok you're getting against discord guidelines now
no prawn
please no prawn
don't worry, depending on the callback you sometimes need the options and sometimes not
silent errors...silent errors
@earnest phoenix dude that was only one lol
in case of PHP you don't need them, but need to define the options as parameters of the function
yes
wtf
types a big ass quote
ha..ha
this is very wrong
@earnest phoenix no, https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=member
message.guild.member(user) will turn that user object into a member object
@clever dust still he's treating User objects as GuildMembers. If I tell my bot to eval that same exact line except the message contains a User ping who is not in this server it might throw an error
@clever dust pinged you and it returns null
idk why you would use the user property on the mentions. isn't there a member property?
yeah, if the user isn't in that guild, it will return null https://i.imgur.com/iPWEs9w.png
You can use mentions.members though?
yes
Why use .member
@earnest phoenix lmao it wasnt even a problem Im dumb
It's not a big ass problem but you should try to remove silent errors when you find them. But you shouldn't just go around finding silent errors because javascript is gay and you'll find pointless stuff.
message.mentions.member returns a GuildMember, where as message.mentions.user returns User.
It's not a big ass problem but you should try to remove silent errors when you find them. But you shouldn't just go around finding silent errors because javascript is gay and you'll find pointless stuff.
^ i ignored this once and now i have a big list of stuff to fix
oofers
Javascript isn't gay, bad code is gay
It's not a big ass problem but you should try to remove silent errors when you find them. But you shouldn't just go around finding silent errors because javascript is gay and you'll find pointless stuff.
@earnest phoenix yes I will fix them when I see it
ehhhh i mean if you want to compare it to other languages, it kind of is gay, but yea bad code is much more gay than js
Javascript isn't gay, bad code is gay
@earnest phoenix
stronglyDisagree(sentence.split(",")[0]);
stronglyAgree(sentence.split(",")[1]);
Actually no programming language is gay, they serve their given purpose, only gay programming language is clojure or lisp, bruv
what is disagree, what is agree?
||the question we all ask ourselves, just like jeff||
All programming languages are gay
So it's harder for hackers to use them badly 👍
Wot
what
because nobody can understand them
Why do you program when you don't understand it then
so you mean high level languages
why trademark the "platform"?
because it's a joke
lol
Also all programming languages are understandable except for brainfuck
Like wtf is it supposed to mean
or glass 
Discord is a stable platform™️
@earnest phoenix
agree(sentence); // programming languages don't have sarcasm btw
ReferenceError: agree is not defined
ERROR: agree is not defined
@vernal rivet humans can't decide on anything that's why
Basically why wars happen
but thats what Javascript will say to you
Unless agree and disagree are native functions created by godly powers of some sort
:dogekek: but thats what Javascript will say to you
@vernal rivet where's the funny?
also #general if you wanna milk the joke further
Unless agree and disagree are native functions created by godly powers of some sort
@earnest phoenix you could require a package
How do I know if a message is embed or not?
How do I know if a message is embed or not?
@earnest phoenix messages can contain embeds the whole message can't be an embed
A message can't be an actual embed, embed is a property of it, something attached to the message
my knowledge isn't broad enough to know the discord.js method to check if a message contains an embed
hits up docs
If you want to check if the message only contains an embed and no content,
if (!<message>.content && <message>.embeds[0]) {
// Do stuff
}```
@earnest phoenix message.embeds returns an array. If the array is empty there is no embed
Also follow what voltrex said
^^^
okay, I got it. thanks
agree;
module.exports = function(sentence) {
if (!sentence) sentence = 'sentence'
console.log(`I agree with; ${sentence}`)
}
disagree;
module.exports = function(sentence) {
if (!sentence) sentence = 'sentence'
console.log(`I disagree with; ${sentence}`)
}
your code
const agree = require('agree')
const disagree = require('disagree')
agree('code913 smells')
disagree('code913 smells')
// => I disagree with; / I agree with; code913 smells
i think
maybe
idk
gtg guys
Why make it a npm package tho
idk
not required
could've just done like
'./utils/agree.js'
or something
midk
all these guys making jokes that i smell...if only they knew it's true
doesnt really matter
./ is current directory. just the name is a npm package name
i kn o w
also it would be better to make the functions in the same file, and call on them there
const agree = sentence => sentence ? console.log("I agree with " + sentence) : null;
const disagree = sentence => sentence ? console.log("I disagree with " + sentence) : null;
agree("Bruh"); // I agree with Bruh
disagree("Bruh"); // I disagree with Bruh```
no thats the joke™️
don't you love arrow functions and elvis operators, they are great
im like doing a math quiz while on discord development channels

how to get a passing grade 101
bro math is ez
math is great
Math is great if you understand it
^^^
thats sounds like you should study more, 
thats the problem
I'm pretty sure 97% of members here don't know math
i dont stu d y
then you should, if you want to major in CST, you are going to be seeing a lot of math
don't you love arrow functions and elvis operators, they are great
@vernal rivet by elvis, they're actually called conditional operators
i plan on getting a rasberry pi next week to host my bot but would heroku work for now or are there better options?
I'm pretty sure 97% of members here don't know math
@earnest phoenixwell computers basically do METH with 1s and 0s and 5% of people here are computers programmers so you're 2% wrong mate toldya not to skip METH class
but dude its cooler to say elvis operators, because it makes you wonder did Elvis Presley program?
getting an rpi isn't really profitable per se
Computers are advanced calculators
(getting it only for bot hosting that is)
but aren't we calculators
We don't function as reading an unending stream of 0's and 1's aka binary so not technically
Computers are advanced calculators
@earnest phoenix
you know that thing where some smart guy said that the brain is a computer,
does that mean we do take in unending stream of 0's and 1's.
getting an rpi isn't really profitable per se
@earnest phoenix ok but who asked
you know that thing where some smart guy said that the brain is a computer,
does that mean we do take in unending stream of 0's and 1's.
@vernal rivet literally my fifth grade science book
It does compute stuff just like a computer but doesn't output it as a result of another stream of them, brain just simulates computers in a human organ way

Gives commands for human body to function so yea we might also be advanced calculators in a non digital way
So basically we are robots from the past.
Reject advanced humans as calculators, return to monke
yes
@earnest phoenix ok but who asked
@earnest phoenix
<#development message>
???
if we are like computers can i do deltree in my root directory, and delete myself from existence?
Possible if you find the bash command line in your root directory, if you can though

if we are like computers can i do deltree in my root directory, and delete myself from existence?
@vernal rivetsuicide is already defined
win + x, clicks on Command Prompet(Administrator)
what would be GET https://discord.com/api/v8/invites/INVITECODEHERE but using discordjs
Use node-fetch
have you checked the docs
Or the already made method
<client>.fetchInvite()
win + x, clicks on Command Prompet(Administrator)
@vernal rivet
Command Prompt + Donald Trumpet == Command Prompet
development more like development-shitpost-haha69funny-general-support-testing1
^^^^
development more like development-shitpost-haha69funny-general-support-testing1
@earnest phoenix don't forget499th-modum-shitpost
Wait i forgot ping_modums_24/7
oofers
Well it's in starboard anyway oof
is that ts
what is channels supposed to do
@opal plank what is that nice green line on the left Git?
be a number
yeah thats git support
shows modifications
between repo and current workplace
anyway, some help here pls?
git sucks
i like github
~ me in January, 2020 (when i wasn't into this programming stuff)
hey how would i make a command to stop the setinterval?
clearInterval() exists
Starting from discord.py 1.5.0, intents are supported. My current question is as follows:
Does discord.Indents(messages=True) default all other intents to False?
clearInterval()exists
@earnest phoenix thank god you saved me yet another google search
generateEmbedFromFeed(args, (embed) => {
// once the twitter search is resolved, we can edit the original message with the embed
messageToEdit.edit(embed)
})
// again every 5 seconds
let testing =
setInterval(() => {
generateEmbedFromFeed(args, (embed) => {
messageToEdit.edit(embed)
})
}, 5000);
if (message.content.startsWith(prefix + 'removefeed')) {
clearInterval(testing)
message.channel.send('The feed has been stopped!')
}
}```
i have done this
i have googled, i have looked at the docs.
what is it complaining about erwin?
i just can't get it working.
That interval variable was set inside the function which you can't access it from outside the function
f
okay, i was thinking so.
@opal plank what is the red error saying?
let interval;
// Function {
interval = <interval set here>;
// }
clearInterval(interval); // Stop```
@vernal rivet what red error?
Can you store the value returned from the setInterval function to use it in closeInterval (in the same process)?
or are those both void functions
isn't that just what i have done @earnest phoenix
No
dunno if ts has anything of that sort
i need a NOT somehow
@opal plank!somehow
that doesn't work in ts typing i believe
You're defining the testing variable inside the function, do it outside the function @eternal osprey
|, but if you have a lot of classes to list, it'd be a pain...
^^^
messageToEdit.edit(embed)
})
}, 5000);
}
if (message.content.startsWith(prefix + 'removefeed')) {
clearInterval(testing)
message.channel.send('The feed has been stopped!')
}
``` like this
sorry for the spaces.
@cinder patio thats just OR not NOT
there's no such thing as not
this is outside the function
indeed
*bitwise OR
which is why im asking if you guys know another solution
the variable names are generated dynamically
so it needs to be a string and a channel, depending on the value?
let testing;
generateEmbedFromFeed(args, (embed) => {
// once the twitter search is resolved, we can edit the original message with the embed
messageToEdit.edit(embed)
})
// again every 5 seconds
testing =
setInterval(() => {
generateEmbedFromFeed(args, (embed) => {
messageToEdit.edit(embed)
})
}, 5000);
if (message.content.startsWith(prefix + 'removefeed')) {
clearInterval(testing)
message.channel.send('The feed has been stopped!')
}
}``` @eternal osprey like this
On top
I only know of |, but if there are tons of types, then you're better of using any, and specifying the type in other places
@opal plank maybe add a function that gets executed when you run new on the class/interface that checks if key is NOT channels and throw an error if it is? That's possible in normal js not sure if it's possible in typescript interfaces
-bots
@earnest phoenix not in Ts
how do i update repl thing
f
@opal plank you can use generics
i mean, i guess
okay, i'll try.
how do i update repl thing
@placid phoenix you mean update the software on repl.it or the read evaluate print loop thing?
yup,
a: T
}```
@placid phoenix you mean update the software on repl.it or the read evaluate print loop thing?
@earnest phoenix print loop thing
idk tbh
it still did not work @earnest phoenix
ask shivaco he's da python guy
whats your problem awsome?
my setinterval won't stop.
Stop telling people to contact me for everything that's Python
Did you even execute the function you made to set the interval
I'll help here if I'm available
yea, what voltrex sent should work
@slender thistle hi how do i fix this repl thing
what the fuck is the client package

shit
is regex better than vanilla JS
i fucked up my code
@eternal osprey always has been
what should i do

Rewrite it
@earnest phoenix thanks man.

Define "better"
@slender thistle like it can convert massive functions on strings down to smol/letterstuff
Easier != Better
that doesn't help us, what library
My bot after 10h the status deleted
discord.js
send help quick
@sly dawn how do we know you're not an imposter asking for help to kill us
What's your library and code
Why
code plz this is #development
what does your code look like for that?
@slender thistle djs
kindly shut the fuck up if you're not going to be helpful
@slender thistle its discord.js and my code recently is ```css
broo = new Discord.Client({
presence:{
activity:{
name:${bot.guilds.cache.size} with ${bot.users.cache.size} users! | c!help,
type: 'PLAYING',
}
}
})
this channel is back to anarchy
?
You're part of that anarchy, to no surprise 🙃
Shivaco can you be nice
and my bot is displaying moderating | !help with wrong prefix written

why are you setting it in the ClientOptions?
@opal plank remember when we talked about the self invoking recursive function
How can @gilded plank has "Watching Discord Bots" as activity if there's no "Watching..." activity type? https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
@vernal rivet because my bot disconnects and reconnects and its status not here, so i created client
LMAO
@sly dawn You should not set a presence in client options

you can set them again in the reconnecting event
Use <client>.user.setActivity()
i guess we now ruled out it works fine
@earnest phoenix if i dont, my bot disconnects and reconnects and doesnt appear the activity
LMFAO Tim
@earnest phoenix if i dont, my bot disconnects and reconnects and doesnt appear the activity
@sly dawn How so

you can set them again in the reconnecting event
lmfao
@earnest phoenix look, herkou always disconnect my bot and reconnect it, due to reconnect, its status dissappears and doesnt appear
i just said how ;-;
@sly dawn if its not a dynamic activity, set it in the client options instead
@sly dawn you can't set the status directly in the contructor because the bot ain't logged in so discord says it's offline and ignores status change requests
heroku is not built for discord bots
then i would have been changing it more than 100 times
@sly dawn please stop using heroku
they even said this themselves, that their hosting service was not built for bots
@earnest phoenix then which i use to host mybot
a real VPS
i dont have money lmao
repl is good if you want free
@vernal rivet repl?
Use
<client>.user.setActivity()
its a coding site
(function highFlexing() {console.log('Who needs setInterval anyway :shrug:'), setTimeout(highFlexing, 2000)})()
@quartz kindle run this one too
yes
repl is good if you want free
@vernal rivet only for smol bots
its a coding site
@sly dawn and it also allows hosting apps
i have a big bot lol
doesn't mean you can't abuse it 
@opal plank lmfao
It's an online testing environment with a built-in IDE
@earnest phoenix then will my bot stay 24/7
@sly dawn add premium features then use the revenue to buy a VPS
Big bot hosted on heroku
I don't believe
mhm
@earnest phoenix then will my bot stay 24/7
@sly dawn 90% no 10% yes
i have one running on it, just do repl + uptimerobot
@earnest phoenix my bot has loads of commands
@vernal rivet uptimerobot stays ur bot for only 2 hours i guess
i just use repl for hosting game websites now so i can chill while dbl chat is dead
@vernal rivet uptimerobot stays ur bot for only 2 hours i guess
@sly dawn fuck no
A big bot means it's in many guilds
repl ain't meant for big bots
Not many commands
@earnest phoenix oh lmfao
They're a testing environment
Which is why i took down my bot from their site
thats a very small bot
(function highFlexing() {setTimeout(() => {highFlexing; console.log('Who needs setInterval anyway :shrug:')}, 2000)})()
there we go, that looks better
discord.py
how do i check if arg is a mention or not
uhhh
After my exams are over I'll put my bot on a VPS
Regex?
why does even heroku re-connect
Honestly I'd go with regex for mentions for better precision ngl
doesnt py provide mentions in the message payload?
its for running code 24/7
discord should ship the payload with the mentions in it
bots always reconnect, discord disconnects them at least once every 4 hours
but somehow, my bot is displaying old status which i dont want, and i have new one but it aint displaying the new one
All free services are for testing
Even if you pay
Save up the money for a REAL VPS because VPSs are meant to run 24/7
oh wait
@quartz kindle the code u gave me isnt working lmao
message.mentions
but somehow, my bot is displaying old status which i dont want, and i have new one but it aint displaying the new one
@sly dawn lag and/or API ratelimits and/or error in code
@violet mesa arg in message.mentions for user mentions
@sly dawn what code
bots always reconnect, discord disconnects them at least once every 4 hours
@quartz kindle Every 4 hours? Mine stays up for days? Or you meant only in heroku
or just message.mentions directly
@quartz kindle broo = new Discord.Client({ presence:{ activity:{ name:`${bot.guilds.cache.size} with ${bot.users.cache.size} users! | c!help`, type: 'PLAYING', } } })
thx have a great day
@earnest phoenix discord sends you a reconnect packet at least once every 4 hours for load balancing
the lib then sends a resume packet
to reconnect
theres a 30% chance this might lead to one hell of a scolding but im still doing it
👀
@sly dawn that code is only for static statuses, not for dynamic ones
thats why i said "if your status is not dynamic"
bots always reconnect, discord disconnects them at least once every 4 hours
@quartz kindle finally a good reason to explain @.mattthew#0001 and @.borboss#7877 why i have a setInterval function setting the status every five minutes
Oh like something that would balance the events payload and connection to discord gateway
@quartz kindle wdym by static statuses, and what dynamic, like?
What's the point in reconnect packets being sent on an interval?
static status as in, only text
opposite to a dynamic one with variables
that depend on the bot being logged in
dynamic status: Playing/Streaming/Watching/Listening
static status: just text but it can't be set by bots
you cannot access the caches before your bot logs in, which means you cannot set them in the initial presence
@slender thistle just a one last question how do i copy id of the guy who was mentioned
@earnest phoenix dam what do i do LMAO
you need to set up a dummy/temporary presence and then once your bot logs in, you set the correct presence and replace the dummy one
i said that five minutes ago but ok @quartz kindle
@violet mesa How are you getting the mention in the first place?
Just access .id property of that
arg
you need to set up a dummy/temporary presence and then once your bot logs in, you set the correct presence and replace the dummy one
@quartz kindlenew Discord.UserPresence?
last thing you told me was the wae
there's a typedef called UserPresence
way
@earnest phoenix with a variable?
yes
like example = new Discord.UserPresence
what
because you're gonna need to refernce it later
and then
type: "WATCHING"```?
yes (but the code is wrong)
then if its true
How do you use the command?
cool imma try it
you dont need to use the presence constructor
that is suppose to be mention
@vernal rivet we're talking full on Presences not the quick and simple Activities
@slender thistle this is what i have u will understand this i think
@bot.command
async def rob(ctx, arg):
mention = arg in message.mentions
if mention == True:
if mention == False:
await ctx.send("must be a mention")
you can use the setPresence()
oh my God
btw User and ClientUser have a very slightly different way of presences
That's so smart and dumb at the same time
broo = new Discord.UserPresence()
presence: "<insert status here>"
type: 'WATCHING'``` is it ok?
Wait ClientUser?
Why do that
@violet mesa just apply :discord.Member to arg in the function parameters and ignore any checks
<client>.user.setActivity()
the bot is a client, which can be expressed as ClientUser 
@earnest phoenix what next ahead of it?
look at the link i sent
a complete and correct solution for the activity issues would be something like this ```js
client = new Discord.Client({
presence: {
activity: {
name:"starting up",
type:"WATCHING"
}
}
})
client.once("ready", () => {
client.options.presence.activity = {
name: ${client.guilds.cache.size} bla bla bla,
type: "WATCHING"
}
client.user.setPresence(client.options.presence)
})
@slender thistle now how do i copy the guy who was mentioned id
that takes you to the method
oh
<client>.user.setActivity("Bruh", {
type: "WATCHING"
});```
that ez
but please rename arg to member
lmao
pretty please
thats more work to do tbh tim.
keep your variables explicit
:PandaSouless: thats more work to do tbh tim.
@vernal rivet but Activity can only set Playing and online status
there we go
@bot.command
async def rob(ctx, member :discord.Member):
member = member.id
```is this ok?
like
so far
and? thats what he is doing
idk why you are making more complicated
member: discord.Member make it pretty at least
and just use member.id directly, don't reassign anything to member
@sly dawn
ty!!!
It's actually Discord.PresenceData
@earnest phoenix i went on the link
Not Discord.UserPresence
well not for me specifically, it's just nicer to read code that doesn't look like it was written with feet on a phone
okie
(that's throwing PEP aside)
Auger#8261 once said he hosts his bot on his phone. I still don't get WHY.
Writing code on mobile with hands is already hell to itself
Writing code on mobile with hands is already hell to itself
@earnest phoenix not on repl.it they've got a pretty nice editor which is as powerful as the computer one except that you can't open shell
@earnest phoenix u mean super hell
While here i am, coding everything on mobile and also hosting it
wait i can run my bot on computer? 

@earnest phoenix not on repl.it they've got a pretty nice editor which is as powerful as the computer one except that you can't open shell
@earnest phoenix Repl when i tried it 5 months ago deleted half of my code![]()
![]()
wait i can run my bot on computer? :GWtloLaugh:
@sly dawn a host is a computer...bruh
@earnest phoenix okehh
@earnest phoenix Repl when j tried it 5 months ago deleted half of my code :KEKWLaugh: :KEKWLaugh: :KEKWLaugh:
@earnest phoenix oof i have version control and a setInterval pushing and pulling changes to my backup GitHub repo every five minutes
why does this not update after i update the bullet count again?
is that atom 
uh no
how do I make a changing bot status
why does this not update after i update the bullet count again?
@fervent goblet OMG are you making a shooter game on Discord I'll happily play it gib invite
how do I make a changing bot status
@frank lava Interval
i just started it
how do I make a changing bot status
@frank lava update the status every few seconds (but don't do too often else rate limit)
i need to figure out how to constantly call data after it changes
i need to figure out how to constantly call data after it changes
@fervent goblet events OR setInterval
No arrow function
is that interval supposed to run forever?
you are not getting any new user data
you are operating on res
the same res as before
res is never updated
update res every single time the setInterval runs
but it should tho
@fervent goblet You're only getting the value of it once in the parent function of setInterval (exec)
Also run an actual for loop instead of forEach(), because it's slow
@quartz kindle your a life saver man, thx for it :)
My bot went offline
@quartz kindle your a life saver man, thx for it :)
@sly dawn no he's a Messiah
After saying this
[WS => Shard 0] [HeartbeatTimer] Didn't receive a heartbeat ack last time, assuming zombie connection. Destroying and reconnecting.
Status : READY
Sequence : 716671
Connection State: OPEN
[WS => Shard 0] [DESTROY]
Close Code : 4009
Reset : true
Emit DESTROYED: true
[WS => Shard 0] Clearing the heartbeat interval.
Oh
Shard was destroyed because it didn't receive a heartbeat
[WS => Shard 0] [HeartbeatTimer] Didn't receive a heartbeat ack last time, assuming zombie connection. Destroying and reconnecting.
Status : READY
Sequence : 716671
Connection State: OPEN[WS => Shard 0] [DESTROY]
Close Code : 4009
Reset : true
Emit DESTROYED: true[WS => Shard 0] Clearing the heartbeat interval.
@delicate shore what the fuck is wrong with Tim Berners-Lee why did he add Zombies to HTTP
Ok
idk what .exec does, but you likely need to run it again
no
so you'll have to remove the interval altogether and make it a recursive function
@quartz kindle Oi tim, how would you rate this, taking everything after -- and putting the tag and anything after it into a property and value
Wtf
sounds complicated lmao
Really? How tho
Hmm the --option way might be more complicated than that
Maybe
can you use yargs package on any string/array or does it only work on process.argv
who wants to play a game with me?
The one i showed only took 15 minutes
who wants to play a game with me?
@opal plank me
To make
let's think of the worst ways to crash a node.js app
estimate how little time THIS will get rate limited and yoinked off Twitch's api
what am i looki-
process.on("unhandledRejection", () => process.exit());
you are looking at me manually clustering twitch IRC connections
since the library doesnt handle more than 5,000 streams per connection
i made a dynamic system with a slave/master setup
let's think of the worst ways to crash a node.js app
@earnest phoenix winner gets an eel slap btw
Erwin bro it's main/sub you baka
Erwin making gta 6 in console when
does winner get a POB?
What is YouTube API Value 
lmao shiv
Erwin making gta 6 in console when
@earnest phoenix we have no erwin here we only have a NOT erwin
What is YouTube API Value :719150691880271912:
@iron vine value?
@iron vine value?
@earnest phoenix Yes..
im 100% imma get my ass ratelimited hard
The hell do you mean by that
twitch gonna call the ddos cops
"Solution loaded with 1 warning"
let's see what my classmate did
can you use yargs package on any string/array or does it only work on process.argv
why is there 38 clients coming from the same ip?
sorry for repeating question
oh look it's my .NET framework fucking up again for whatever reason
@earnest phoenix pretty sure you can use it on any string
<a
758735308391972886>
i've never used it personally, but most argument parsers i've seen work on strings
why is there 38 clients coming from the same ip?
anything over 3 is a ddos
[sarcasm, just incase you didnt get it]
purely research purposes
ok ti M
i give up discord on mobile is hell i tried to send a pogger emote and discord send the escaped version
who needs IPC , clustering, and all that when you can simply load 38 connections on one node

First time? @earnest phoenix
First time? @earnest phoenix
@earnest phoenix wut da fuk obviously no
It was a joke
im guessing 30 minutes till i get ratelimited
that long?
joining a massive amount of channels takes a while
but i'd be doing it X's amounts faster
since there are x amount of clients running
usually if you exceed a certain number of requests per second you get insta blocked
so if you're doing 38 clients concurrently

idk
the librabry SHOULD handle this
i guess
maybe
prob not
but lets see
10 minutes to join 400 channels
im fairly certain IRC will run per connection
not sure if they check ip n such though
they should at least be checking number of requests per IP
we'll see what will happen
yeah
so once connected, limits should be per socket, not per ip
ayo tim, could you add my bot to your bots-that-use-d.js-light list 🙂
sure
im just getting final touches to the stress
cuz i need to modify it to work it like this
lol
is it possible to get a user's custom status in discord.js?
lets queue 50k channels and see what happens
yes glassy

here ya go https://top.gg/bot/674457690646249472


this is not an ad
how tho
i know
.presence. ?
@sonic lodge done
ay im famous
presence.activities
presence.activities[0].name
ty
@quartz kindle 10 or 200IQ?
I wish people learned how to use the search function in docs...
yes
activites returns an array but it doesn't return what's my custom status?
just "Custom Status"
in what library
discord.js
its somewhere in the activity
if its not in activity.name, then try activity.state or activity.details
custom status counts as rich presence ^
I pulled an all nighter trying to code a bot just to get the file directories fucked up😻
cool
this is sent in the wrong server. Sorry.
You can DM me if you need someone to talk to. I’m truly sorry to hear what you’re going through^
No no it’s good. It was meant for my server with my friends.
Ahhh okay
I hope you feel better soon!
Thanks!
@green kestrel do you have a pig latin generator and a scrambler for trivia bot or do i have to manually put them in when adding questions?
It uses a generator
Same with the number hint types
They're re generated randomly each time a question is asked @earnest phoenix and sent with the API request for the question
oh ok
i added a question just now
moozic
tho I'm not 100% sure it's correct
can't trust DuckDuckGo
bruh no link embed
Source code for pig Latin 
wait can you scramble strings in regex?
I disabled it with <> as I dont like GitHub embeds
even tho I'm not a c++ guy
is it better to use d3.js for HTML5 games or should i do vanilla js and completely destroy myself
Always use a framework for game dev
For js and web games I can't advise, I make games in ue4
Well, I have made TicTacToe in React ¯\_(ツ)_/¯
free is typing
TypeError: free is a boolean you can't set it to a string dumbass
Always use a framework for game dev
otherwise you end up with something like minecraft with trash memory management and not properly creating, well, anything
otherwise you end up with something like minecraft with trash memory management and not properly creating, well, anything
@earnest phoenix please cease to exist 🙏 🙏 🙏 🙏 🙏
Minecraft is a poor example. There was no existing game engine or framework to make what was at the time a unique idea like that
unity existed
Use a framework or end up with Duke nukem forever.
what the absolute fuck Minecraft is perfect for what it is because making that hell awesome of a game without a framework is super cool
or bethesda
Unity doesn't work well for games like Minecraft, the way it allocates and chunks it's world don't mesh well with unity or ue4 as they aren't designed for dynamic world gen,.it's like bashing a bolt in with a sledgehammer
It's definitely doable, see pixark. Or don't, it's shit
What I'm saying is... Right tool for the job and only if there are no tools do you create one
Well, I have made TicTacToe in React ¯\_(ツ)_/¯
@restive furnace but if you want to make some game whats more native (executable), go with one of these: Unity, UE4, Godot, Panda Engine, BGFX (C++ Drawing Lib - Not Engine, MCPE was made with this), Construct4, Cocos 2dx or GDevelop. I have tried all of those, but ended up with making my own
guys stop everyone knows Minecraft is perfect better than Among Us
what the absolute fuck Minecraft is perfect for what it is because making that hell awesome of a game without a framework is super cool
minecraft is horrid, i went through the serverside code once and it's a disaster
the clientside shit like rendering is horrible too, luckily there's a new project called sodium that completely rewrites the rendering engine
minecraft is horrid, i went through the serverside code once and it's a disaster
the clientside shit like rendering is horrible too, luckily there's a new project called sodium that completely rewrites the rendering engine
@earnest phoenix why are you complaining that Minecraft is written in Java and C++
what
MC Java Edition is written in Java while MCPE is written in C++.
Minecraft's servers can't scale past 128 players. O(n^n) everywhere
Bedrock ones are a lot better. I mean java ones
Minecraft's servers can't scale past 128 players. O(n^n) everywhere
Well, how is there hypixel - with 80k players? on java edition? They probably have rewritten some of the servers code, but anyways
This is why the big java servers have queues
Hypixel: queues and shards
You'll never see an 80k user nick list
hypixel runs their own paper fork and scales to a bunch of mini servers
keep in mind that hypixel still has huge lag problems
that's partly their fault though they have such shit infrastructure
@boreal iron
@boreal iron man
I SPENT ALL DAY LOOKING IN DISCORD JS GUILD AND DOCS
I CANT DO THE HELP COMMAND
Hey
@cobalt spruce well u can visit https://discordjs.guide
@lethal sonnet I DID
I CANT DO THE HELP COMMAND
@cobalt spruce BECAUSE YOUR CODE IS WRONG BECAUSE YOU PROBABLY IGNORED LEARNING PROGRAMMING
@cobalt spruce so ?
stop shouting ffs
IDK HOW TO USE DATA PUSH
@earnest phoenix BECAUSE IT WORKS
@cobalt spruce if it works why the fuck are you screaming over a help command
^^
IDK HOW TO USE DATA PUSH
@cobalt spruce learn...
@earnest phoenix # i want to do it embed
data push? told ya already data is an array and .push() adds elements to the array
tbh I don't even remember ur code and imma to lazy to scroll up
Just wanted to say a little something to everybody here, first thank you all for the help you gave me a little while ago, next just wanted to tell you all that no matter the errors you make in your code, no matter the obstacles, no matter the time you take to make things, no matter the failures, the hard times etc etc you are all doing great, all of you are doing great, from sernior bot creators that makes bot that are in billions of servers to people like me doing small bot for friends or for fun, everyone of you are great so don't give up, you can do it, have a nice day/evening/night and learn from your errors 😉
YAY
but people need to eat
truu
data push? told ya already
datais an array and .push() adds elements to the array
@boreal iron the words u said here ARE EPIC
THANKS MAN
back to work
and don't forget that everyone starts from the bottom before reaching the stars
oof? told u this already hours ago... lel
..
true tho
but im trying to be kind and motivating
Hkdbdksn
LMAOOO
true
on everyone my bot is gonna be tested in no time if you all stops coding
so pls remove your bots from top.gg and cut your hands to ensure that you won't code anymore
LOL
ok nevermind it's been near 1 mounth so it is gonna be tested in not much time anyway
I do remember it was .setFields ?!
yes
Could also used .join(',\n');
if you just want another line then .addField('field title', 'field text')
@cobalt spruce what are you trying to make?
Just wanted to say a little something to everybody here, stop getting spoonfed
but people need to eat
@quartz kindle lmfao
@open rune help command
what makes you stuck?
i want to make it line witch say
CommandName Command Usage
add \n to the join
@open rune am stuck how i add the usage next to the name
Inside of the map
@quartz kindle thanks tim i did that
do you have the usage written anywhere? like command.usage for example
do i do?
commands.map(command => command.name && command.usage).join(', ')
that will just make it true
use string concatenation or templating
you want make help command like this?
@cobalt spruce you can do this statically:
.addFields(
{ name: '🎲 Fun & Games', value: 'css\n'+ prefix() +'roll\n'+ prefix() +'coinflip[flip]\n \n \n \n', inline: true },
{ name: '\u200B', value: '\u200B', inline: true },
{ name: '🛠️ Utility', value: 'css\n'+ prefix() +'invite\n'+prefix()+'helphere[hh]\n \n \n \n', inline: true },
)
I give up, let it be...
lmao³
\n\n\n\n\n\n\n\n\n\n\n
you are an abuse
WTF
send an image of your help command because discord formatting is so inconsistent 
twitch wont even feel that
witch is still trying to edit the message lmao
.
this is why we bin our code
wdym make your prefix as a function
lol
const { prefix } = require('../config.json');
@quartz kindle im proud
what are you trying to do
after 30 min i made a handler that supports custom commands
..
@cobalt spruce I took prefix of each guild.
ok
and I am trying to edit my code...
thats why you dont copy/paste code
stop screaming lmao
commands.map(command => command.usage.join('\n'))
TIM
command.usage doesnt exist
module.exports = {
name: 'help2',
description: 'Ping!',
usage: 'pong?',
@quartz kindle
uhhhhhhhhhh
commands.map means ALL commands have to have it
if one command doesnt, it will error
also, string.join() is not a thing
default dance
you want the join() after the map, not inside it
outside of the map
you want to join the result of the map
not join command.usage
i believe this to be a befitting name for what im about to attempt
@cobalt spruce have you tried function?
function getList() {
var list = '';
list += commandList+'\n';
return list;
}
/** embed here **/
.addField('Album', getList(), false)
i try to install quick.db in another p
pc
but its say Error: Cannot find module 'quick.db'
i know
what is say
but i try
alot of ways to fix it
dont work

help?
you didn't install quick.db
i install
well you clearly didn't
how did you install it?
npm i quick.db
was the install successful?



don't you love arrow functions and elvis operators, they are great
does that mean we do take in unending stream of 0's and 1's.










