#development
1 messages ยท Page 819 of 1
Hmm
Nah node only without vps
Oof
Both functions good
Well terminus is meant to be used with a vps
Nah... It's up to you...
You can use both but you need to choose which one is more stable for you
@tight plinth btw which discord bot wrapper are you using?
Discord.js
Eris
Or what?...
discord.js
Djs
Hmm very good
@tight plinth where u got vps?
A friend lend it to me
k my friends arent nice :{
I can't ping you without using your id
True
@earnest phoenix
jeez
great job
who's ed
Ed
@earnest phoenix use nekos.life .
no
nekos.life isn't SFW as it can return loli content
ah wait
the anime endpoint should be fine
i think you can filter it
U can
well ok
and
i'm having an issue forming tablecells for eachpart of my array.
Anyone can help me out with that?
let html = "";
username = Tabledata.map(u => "<tr><td>" + u.userInfo[0] + "</td><td>" + u.userInfo[3] + "</td></tr>") //</tr>")//"
// Ships from Array are inside u.userInfo[3] where u.userInfo[3][0] is the name and need to be seperated in a cell.
let room = request.params.room
let data = request.session.discorddata
var cards = new CardCollection();
username.forEach(discord_id => {
html += discord_id
});
accidently change cuddles with lewd hentai
if(command === "warn") {
if(!message.member.hasPermission("KICK_MEMBERS")) return message.reply("You're missing permissions! **Required Permission** `KICK_MEMBERS`");
const user = message.mentions.members.first()
const reason = args[1]
const channel = message.guild.channels.find(ch=>ch.name==="moderationlog")
const embed = new Discord.RichEmbed()
.setTitle("Action Taken")
.addField("Action", "```WARN```")
.addField("โ Target", user)
.addField("โ Reason", reason)
.addField("โ Commander", message.author)
.setColor("#ff4500")
.setTimestamp()
if(!user) return message.reply("You forgot to enter the `USER`");
if(user.hasPermission("ADMINISTRATOR")) return message.reply("Hey! He's an administrator!");
if(!reason) return message.reply("You forgot to enter the `REASON`");
const embedDelete = new Discord.RichEmbed()
.setTitle("Deleting Command Message. . .")
const embedWarn = new Discord.RichEmbed()
.setTitle("Warning *" + user.tag + "*. . .")
const embedSending = new Discord.RichEmbed()
.setTitle("Sending Moderation Log. . .")
message.channel.send(embedDelete).then(thatEmbed=>{
message.delete()
thatEmbed.edit(embedWarn)
thatEmbed.edit(embedSending)
user.send(`------------------------------------------------\nYou've been warned in ***${message.guild.name}***\nWhy? *${reason}*\n\nIf you think this is a false warn,\nPlease appeal here: *https://forms.gle/yNSqjmBMDkxktGod8*\n------------------------------------------------`)
channel.send(`${user.id}`)
channel.send(embed)
const embedFinished2 = new Discord.RichEmbed()
.setAuthor(`${user.tag} has been warned`, user.avatarURL)
.setDescription(`**Reason:** ${reason}`)
thatEmbed.edit(embedFinished2)
setTimeout(()=>{
thatEmbed.delete()
}, 7000)
})
}```
```.setAuthor(`${user.tag} has been warned`, user.avatarURL)```
It says "undefined"
user.tag is unefined?
y
User
does the user have a default avatar?
that's a member
const user = message.mentions.members.first() check the first 1
yes
i jsut wanted to say that
correct
change the constant user to member to avoid confusion
yes
i'm having an issue forming tablecells for eachpart of my array.
Anyone can help me out with that?
let html = "";
username = Tabledata.map(u => "<tr><td>" + u.userInfo[0] + "</td><td>" + u.userInfo[3] + "</td></tr>") //</tr>")//"
// Ships from Array are inside u.userInfo[3] where u.userInfo[3][0] is the name and need to be seperated in a cell.
let room = request.params.room
let data = request.session.discorddata
var cards = new CardCollection();
username.forEach(discord_id => {
html += discord_id
});
const response = await fetch(
`https://newsapi.org/v2/top-headlines?sources=reuters&pageSize=5&apiKey=${newsAPI}`
);
const json = await response.json();
const article1 = json.articles;
let article = [Math.floor(Math.random() * article1.length)]
console.log(article);
const embed = new RichEmbed()
.setColor('#FF4F00')
.setTitle(article.title)
.setURL(article.url)
.setAuthor(article.author)
.setDescription(article.description)
.setThumbnail(article.urlToImage)
.setTimestamp(article.publishedAt)
.setFooter('Powered by NewsAPI.org');
return msg.channel.send({embed});```
it returns undefined
Is article defined ?
see up
U log article
code
So what appears inside the console
So
the article1 value returns in array
jsonify it and see results
๐
If I use math.random it returns me array value so how I can find which array value it has returned 0, 1 or...
What lol
This entire conversation
Article is just a number
This returns a number
^
@earnest phoenix idfk what you try to do
let random = Math.floor(Math.random() * article1.length);
let article = article1[random];```
oh!
delicious spoon of codes
ye
Dur better off article1[process.exit()]
What's ur issue @peak venture
what's the issue? is there an error with that code?
We need a problem to solve it
Guys is disconnect event working ?
Yes
oh okey ๐
What is the error
there's no error
nothing i just ask
Just trying to figure out how to obtain a new cell for each ship i have in the array
behind the user
so like this and in ships a cell each shipname
draw in ms paint what your trying to do @peak venture
and send the current code for that pic
its just some minor frontend tweaking you have to do
@earnest phoenix
so you want a table inside the cells
Well it's already a table
but yea; kind of a table inside a table?
Just 2 things to be done indeed but i can't get my head around that
It's like the userInfo[3] is the shipname where userInfo[3][1] should be the colorCode to fill in the color as a background
whats [3][0]
also how is this implamented into the frontend
im guessing [3][0], [3][2], [3][4] are the ship names
and 1 3 5 etc are color codes
mk one sec
@peak venture something like this?
that shape...
so like: { username, region, discord_id, [Shipname, colorcode]}
.db maybe
@quartz kindle you mean the array? or the image it should be
the file extension inf sqlite doesnt matter, you can name it whatever you want
@peak venture the image
how you want the table to be
yes, the horizontals should be for each username
{ username, region, discord_id, [Shipname, colorcode]} will that array always be just 2 values
or does it change depending on how many ships they have
the amount of ships will always be different right? so the way i did it above will not be efficient
you better simply use divs with borders and backgrounds
instead of table cells for ships
the amount of ships will be different
but divs may be an option. Though i gotto drop the Table thing then
to clarify
you can keep the table as it is
username = Tabledata.map(u => u will always have 1 ship and 1 color
?
if so you can just throw it in like this
username = Tabledata.map(u => {
return `<tr><td>${u.userInfo[0]}</td><td style=\"background-color:${u.userInfo[3][1]};\">${u.userInfo[3][0]}</td></tr>`
})
Tabledata.map(u => contains the userInfo with name and stuff
like the package
u.userInfo[3] contains the ship data (shipname and color)
yea
if there will only ever be just those 2 entries in the array
you could use that above
will make background the color you want
and put shipname in it
now idk how your implementing all this in the frontend but you might want to rethink your approach by what you sent me
Yea. my tutor also said to make something similar as to what i have done in a different feature
let me get you a link so you can see that
But then do it slightly different. To make it a card a user and get it horizontally
it's not loading for me
same
thats odd
๐
It's loading. Though it needs to get quite some details
give it a bit of time before entereing. most i've seen is roughly 30s time O_O
ah yes i too take 5 mins for a database fetch
i made a promise for alot
test the code i sent above
to decrease waiting time
that sounds way slower than it needs to be
It's deffo extremely slow today though
But there may be some execution perfections i could do on my end
no clue
they have only ever done one vc funding round
oh but it was last july
coorious
I was trying to send a message if our mods are off
I created this but it only check for first mod
let mod = list.members.get("414622975598395398")
let mod1 = list.members.get("280754036989493248")
let mod2 = list.members.get("528917780561526804")
let mod3 = list.members.get("420598739984711680")
let mem = mod|| mod1 || mod2 || mod3;
if(!mem) return message.reply("error")
if(mem.presence.status === "offline"){
message.reply("**our mods are offline..** *** we will reply you soon*** ") }
i am 5 so gonna punch my laptop
maybe they just had the company registered sitting around
Based in New York City, Fog Creek was founded in 2000 as a consulting company by Joel Spolsky and Michael Pryor. As the consulting market started to dry up due to the collapse of the Dot-com bubble, Fog Creek moved to a product-based business.[2] In December 2016 Anil Dash was appointed CEO.[3] Fog Creek's offices are located in the Financial District of Manhattan.[4][5] On September 25, 2018 the company was officially renamed Glitch after their flagship product.[6]
@pallid zinc cause mod1 exists even tho its offline
huh
neat
they only got funding last july too
@pallid zinc sec ill spoonfeed you
are you on master or what of djs
const list = client.guilds.get("id");
list[i]
}```
starting dor u
think last ur self
look docs
there is no guild.cache
Err.. some reason the webpage is lagging like hell xD
Why is my memory usage so low?
I literally put objects in a HashMap, so the garbage collector can't collect them
thats assuming you arent making onlineMods a global var
and its incapsulated in a method/function/event
depends the size of data your storing/manipulating and the computational stress of that @slate oyster
if its just a script taht stores a few things to a hashmap
thats like nothing resource wise
and it should actually be way lower
also hashmaps are actually pretty memory effecient
why would memory usage be shown in the terminal app tho?
unless you're using like bash variables or something
Yea
yea i mean depends how much your storing etc
But my main thing is I'm holding on to objects
I create one for each user who talks per guild
And never let go of the obiect
And I've been doing this for 70 hours across 11 guilds
So I would expect memory usage to be much higher
how big are the objects
but i still dont understand why you're expecting the memory usage to be shown in a terminal app? i mean i highly doubt the memory is being stored there
try looking for a jvm process or something
The program is running on the app
So realistically, I'd assume my program is using somewhere <22MB since Termux altogether uses 22 MB
It is sorted by app. No jvm listing, because it is Termux running the jvm, not android
do you know how many object were created total?
and are currently loaded into memory*
It could just not be registered as the terminal process
No
But I'd assume quite a lot
Since it is across so many servers
Also those objects contain references to a third party api's objects
Highly developed=large
if you can open 2 tabs, do a command to se ram usage
any way to see how many are existing? 11 guilds isnt a huge amount
and 1 object per unique user
i cant imagine would be intensive
what
I don't log how many objects I have
unique users per guild
not really, commands and events dont use a lot of memory
what uses memory is storing data
commands practically use none compared to storing data
More than an object though, right
no, ye to tim
hashmaps are just refrences not clones so maybe it just stores that the object exist but they point to the same methods etc? I dont know about the inner inner workings of hashmap to say that with confidence
but might be a thing?
id say first find a reliable way to monitor memory usage
i wouldnt take what the app reports as reliable
Oof
yea best bet is to log memory stuff out and test
since hashmaps arent pass by value might just be refrencing the same methods etc etc
but then the vars of the refrenced objects and such 
idk
just log your memory usage
I think in Java methods of a class are only loaded into memory up to one time
that would make sense
methods of classes yes, but each instance of the class uses memory
if your classes only have methods and no actual data, then yeah it will be very little
but still a minimum amount per instance
what do you do if you recieve the js Error: Client network socket disconnected before secure TLS connection was established error
My classes have data
Including references to instances of objects from a third party library
are they super data intensive?
get better network
if its all pretty much methods with a few global vars here and there
then its a real /shug
I dunno
It's a third party lib
so I can't say how much data they use
i mean, just look into how to monitor its memory usage
open a new terminal tab, and run something like top
ok
@earnest phoenix gotto await this answer from me. According to the status of Glitch projects at this moment are very slow. I'll get back to you
resource management/monitoring on a phone sounds not fun
welp
nice
we are doing lots of java swing gui stuff recently all manually long form
and i want to die
java gui's without something like intellijs scene builder hurt
your phone is not rooted is it?
Nope
The main theme song to Larry David's show.
flash magisk
@slate oyster try using some monitoring app that lists per-process cpu and memory
should show processes like: app.android.termux.apk or something along those names
want a quick way to know if your app is monitoring correctly? just write a quick recursive function that fills an array with arrays of like 2mil size over time 
lol
attempts were made
Lol
WHY IS SQL SO HARD
I don't get it
Probably because I don't use SQLTools
what are you trying to do?
SQL's syntax always confused me. It's supposed to be english, so it should be easy, but I find it easier to use properties and methods like that
to view my data
cant you just make it with code?
like
if you want to edit the file directly, use something like db browser
what does "didnt work" mean in this case?
db browser
.... what didnt work?
nothing works in life ๐ญ
True
nvm screw sql ima play something
Could somebody help me with dblapi webhooks?
#topgg-api @vestal star
No, vote
@vestal star you can either make your code check for lastest votes or setup a webhook
the latter is a bit harder, but will be more efficient
@quartz kindle and @earnest phoenix i adjusted the code slightly but now only getting the last ship in the line (most likely due to overwriting the dataObject)
Can you guide me the right direction again?
let shipNames, shipColor
let html = "";
ships = Tabledata.map(s => s.userInfo[3])
console.log(ships[0].length, ships[0][0].length)
// ships[0].length = 35, ships[0][0].length = 2 [[Zao, #1b82e3]]
for (var i = 0; i < ships[0].length; i++) {
shipNames = ships[0][i][0]
shipColor = ships[0][i][1]
}
console.log(shipNames)
console.log(shipColor)
username = Tabledata.map(u => {
return `<tr><td>${u.userInfo[0]}</td><td style=\"background- color:${shipColor};\">${shipNames}</td></tr>`
})```
those last 4 lines must all be inside the for loop
and that return there is weird
what do you want to return?
you have to do something completely different than what you're doing
for (var i = 0; i < ships[0].length; i++) {
let user = Tabledata[i].userInfo[0];
let ships = Tabledata[i].userInfo[3].map(ship => `<div class="ship"><span class="shipname">${ship[0]}</span><span class="shipcolor">${ship[1]}</span></div>`)
let html = `<tr><td>${user}</td><td>${ships}</td></tr>`;
}
or if you want the color to be directly used for background color and nothing else, change the .map to <div class="ship" style="background:${ship[1]}">${ship[0]}</div>
then this would be the complete thing hm?
https://hasteb.in/ecucoloz.js
no
if you have let html = ""; then change the one in the loop to html +=
and remove this `username.forEach(discord_id => {
html += discord_id
});`
also remove ships =
also remove userShips
no need for username either
UnhandledPromiseRejectionWarning: TypeError: Tabledata[i].userInfo[3].map is not a function
actually i made a mistake, change the loop to for(let i = 0; i < Tabledata.length; i++)
and it seems i got the structure for userInfo wrong
can you show what console.log(Tabledata[i].userInfo) looks like?
you can just do console.log(Tabledata[0].userInfo) somewhere
How can i attachfiles in an embed?
files or images?
an gif
use an attachment, then set the embed image URL to http://attachment/imagename.gif or something like that
let me check
How client will know the attachment?
Please send me that doc link
@quartz kindle
[ 'yohane1',
'eu',
500370681,
[ [ 'Zao', '#1b82e3' ],
[ 'Yueyang', '#ab7ee3' ],
[ 'Groรer Kurfurst', '#ab7ee3' ],```
then it should be correct
helpo
helppp
How can I land when anyone opens Tiket sends a message I am writing
@unreal cape
@wanton rock
PLZ Help
stop mentioning people
people will help when they can or when they have the time
also, your objective is vague af
^ plus your question seems super vague
yeah
guys can you help me with a command?
i can or no?>
sure
"a npm"
node comes with npm though
"a module" โ
"a npm" ร
Do you know the bots that does something like "To use NSFW commands u must vote"
yeah an npm sounds better 
an npm package maybe
...
that sounds like an API thingy majig
when i install something i do npm install (something) Ok?
yes
yes that is how you install npm packages
gud
what
stop mocking him smh
Best way to do that is to use the webhook that dblapi.js provides
lmao
lazy people do npm i, including me
and me
I am mocking ricochet
npm i or npm install
I do yarn add
tim you are no longer welcome here
i do how i want to in that moment
npm i team
hi
...
hi
Hmm
๐ณ
npm i > npm install
yes
^
if anything, programming teaches you to be as explicit as possible. install is more explicit than i so...
ยฏ_(ใ)_/ยฏ
help him
This server never stops surprising
why are we talking about npm again
This server never stops surprising
@slender thistle yes
smh
npm install tim
Can we get to the issue now
module tim was installed
Shitpost in #memes-and-media
yes we can
:p
ok to the issue
stop
Do you know the bots that does something like "To use NSFW commands u must vote"
?
i want to do that
you need the API
Wait for ur bot to get approved
Best way to do that is to use the webhook that dblapi.js provides
Oki
go to #topgg-api and see some examples in the meantime
Wait for ur bot to get approved
I know
On vote, save user in DB for 12 hours
Store in cache to quickly fetch the data
Fetch user ID and if they voted, allow them to use NSFW commands
challenge accepted
it's the only way
if you don't do things you don't know how to do, you won't learn how to do new things
you gotta get gud
damn i can't type today
me neither
lol
i dont even know how to rwurqw.type.AHDASD
Me: Alexa, Write "Me: Alexa, Write lol"
Alexa: Move your fucking fingers idiot
to get votes you need to use the top.gg api. there are two ways to use it: receive vote updates in real time and store them, or fetch votes and check if the user voted

latter being more prone to delays
So ill probably do that when my bot is released
approved you mean
^
remove caret posts
^
Since a while my bot shows as offline on top.gg. Is there any requirement to be shown as online?
it needs to be in this server. if it shows offline it means it was kicked from here
check #mod-logs
Oh okay. My bot was already approved. is there a way to get it invited again?
dm a mod
what's a verification level?
A criteria that users who join your server must meet.
None Unrestricted
Low - Verified email with Discord
Medium - Registered for longer than 5 minutes
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป - On the server for longer than 10 minutes
โปโโป ๏พใฝ(เฒ ็เฒ )ใๅฝกโปโโป - Verified phone on their Discord account
ah, that
i cant get ping in v12
const client = new Discord.Client({ fetchAllMembers: true });```
is this why?
the ping cmd not working
i cant think of any reason for it to be undefined
The output is NaN
k
module.exports = {
name: 'ping',
execute(message, args){
message.channel.send(` Pong!! \n Latency is ${client.ws.ping} API Latency is ${Date.now() - message.createdTimestamp}ms`);
}
}```
which one is returning NaN?
guyz hey
need a little help about node
Error: Cannot find module 'C:\Users\minecraft\Desktop\Lemniscate Development\nod
e_modules\sqlite3\lib\binding\node-v72-win32-x64\node_sqlite3.node'
Latency
sqlite3 already installed btw
client.ws.ping``` Not working
it says use npm rebuild but its not working
i defined client
@tight forum what does "not working" mean? what happens when you run rebuild?
mm
@thorny meteor client is not defined there
w8 please
you have execute(message,args) so you're only receiving a message and args
if you are creating a new client up there, then that will be a completely separate disconnected client
execute(client,message,args)
you need to get from the same client where you are running your commands from
thats one option yes
another option is to get it from message
message.client
@earnest phoenix message.guild.verificationLevel does not return a number in v12, you cannot use it as an index for another array
just do message.guild.verificationLevel and not serverLevel[message.guild.verificationLevel]
and remove serverLevel
guild.roles.cache.find
go to the v12 docs
how do u guys learn new updates this fast?
i've been using it for over 6 months
i actually am lol, i make money with coding
how?
i get hired to do coding jobs
oh nice
let muteRole = client.guilds.cache
.get(message.guild.id)
message.guild.roles.cache.find("name", "Muted");```
getting error as
TypeError: Cannot read property 'roles' of undefined
.guild__s__
i hope gonna fix my problem
.guild__s__
@tight plinth huh?
oh the s
thats my mistake
in program it is correct
if message.guild is undefined, then the message came from a DM
lmao
it's not guilds
it's guild
if guild is undefined
then the message is....
what tim said
how to get a persons id in v12?
still, client.user.setStatus("dnd"); doesn't change the discord icon into the red one on 12.0.2 :\
@thorny meteor wdym
@vernal yoke works for me
@tight plinth doesn't work for me for 4 days already.
never worked in the first place
12.0.2
Oh
@earnest phoenix message.member.permissions.has('BAN_MEMBERS') maybe?
@vernal yoke try going back to 12.0.0
@tight plinth cant be arsed honestly, for a simple icon change, everything works fine :p
Lol
Lemme check @earnest phoenix
if(!message.member.permissions.toArray().includes("BAN_MEMBERS")) @earnest phoenix
setStatus is not working for me either lul
w!serverinfo
@tight plinth what db do u use
guyz need with glitch
npm ERR! path /app/node_modules/.staging/winston-2cc80f13/node_modules/async
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/app/node_modules/.staging/winston-2cc80f13/node_modules/async' -> '/app/node_modules/.staging/async-ba5de1c7'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
when i try to install express
How are you installing it?
by the way i cant access to '/app/node_modules/.staging/winston-2cc80f13/node_modules/async'
with console
npm i express
should i use pnpm ?
And it added it to your package?
nope
Make sure it's in your Package.json
With glitch if you open the Package.json inside the editor there is an option to install packages
Use that to look for express and install it
normally i use package.json
to install packages
but
this time express is not written
idk how was it
thank you anyway

do u get an error?
"https://top.gg/api/widget/669569770059989024.png" +
"?gen=" +
Math.random()
.toString(36)
.substring(2, 6);```
So you know the fact that he is trying to string an image and a text together and send them via a image field isn't the issue!?
Lol
Notice the " + "?gen
๐ค interesting never tried it personally was just a suggestion honestly
As Lumap said it's a bug that no one really knows how to fix right now so honestly I'm not really the right person to ask considering I haven't even experienced the bug yet
Maybe admins knows
what bug?
... what are you even doing?
trying to read the file and make a copy
copy to where?
step 1 - ctrl+C / right click copy
step 2 - ctrl-V / right click paste
Step 1 - shutdown ur pc
Lmao
Same file, different name?
Right click rename
Enter new name
Press enter or click off
How does one know coding yet not know how to copy and paste a file
cant
Using glitch?
.,.
And rename it
I m using glitch for almost 4 yrs now
Surprisingly, the buttons aren't lying to you
sql is
SQL is a different story altogether
why do you want to read it?
an sqlite file can only be read by an sqlite database program
does a sqlite file contain loads of question Marks and stuff?
holdon
@finite bough yes it does, because an sqlite file is written in binary, not text
you cannot read it as text
Usually some kind of database program like MySQL will allow you to read/edit them
@quartz kindle sorry for the ping. Can you help me? https://discordapp.com/channels/264445053596991498/272764566411149314/687728919478009922
@earnest phoenix i think problem is top.gg
How i commit some updates to a branch ?
For example i have the branch dev, how i upload these files for this branch
Without uploading it to the master branch
WELL
error: src refspec dev does not match any
error: failed to push some refs to GITHUB_URL
Same error that were giving me before
''
how do you make a bot
and javascript?
You don't have to use javascript if you don't want to
But I do
You can use python, java, javascript, the list goes on
no, luca does not like being on other servers
xd
what do you do if you recieve the
Error: Client network socket disconnected before secure TLS connection was established
error
restart your wifi
ho
in the faq there is a link to a tutorial on learning the basics of making a bot on js
huh
i know you arent
oh
Why do you put return there
what are you trying to do?
reaction.message.guild.member(user).has("687741847988076604") return;
What was it like to do that if the user who reacted and had x role made return?
sdl[
hi
hi
how do i get the cpu usage my bot is using
?
@violet frost not the place to ask
No ads @violet frost
@violet frost you will get banned for that
Need a help on discord.js version 11
So in guildMemberAdd I wanna check if a member has a certain role in a different guild.
client.on('guildMemberAdd', async (member) => {
if(member.bot) return;
if(member.guild.id !== `687615474774573096`) return;
});```
What is the best way to do it?
get the guild by id, and check if the member exists there
Is it always the same guild you wanna check?
if it does, check its roles
Yeah if it's a know guild use Tim's method
yep in the same guild
Mr Delivery ManToday at 23:48
Is it always the same guild you wanna check?
if the guild is large, you might wanna fetch the member, just in case its not cached
ahhh
what is the difference between cheerio and jquery
jquery is a framework to simplify DOM operations
cheerio is a scraping library? i think?
Cheerio - Fast, flexible & lean implementation of core jQuery designed specifically for the server.
so its basically a dom parser for server side
yes
well then they should be like the fetch api and node-fetch
one is for browser, the other is a simulation of it for server side
client.on('guildMemberAdd', async (member) => {
let user = await member.guild.fetchMember(member);
if(member.bot) return;
if(member.guild.id !== `687615474774573096`) return;
if(!user.guilds.get(`687615474774573096`).roles.find(r => r.name === "Server Staff Team") return member.kick();
});
Is this wrong?
yes
What would be the mistake?
All?
you cant get guilds of user
you dont need to fetch the member of the guild it just joined, since it will be cached automatically
and what NMW said
*without oauth2
to get guilds of a user you need to do the other way around. loop over client.guilds and see if user exists on each of them
But want client be undefined?
all discord.js objects have client attached to them
you can get it from everywhere, even member.client
oK MESSED up
discord js v13 
what is emojiID
is it a custom emoji?
then thats the problem
a custom emoji is obtained from a guild, and not all guilds are available in all shards
^
you might be able to share emojis using broadcast eval
fetchUser doesnt exist in guilds
there are users and members, they are two separate things
fetchMember
users are stored in the client, members are stored in a guild
ooo
because one user can be a member of many guilds
yes that should work
but that will give you a member, not a user
you can get with .user
try it
//Check if the user has the a staff role in join
client.on('guildMemberAdd', async (member) => {
let user = await member.client.guilds.get(xxx).fetchMember(member.id).user;
if(member.bot) return;
if(member.guild.id !== `687615474774573096`) return;
if(!user.roles.find(r => r.name === "Server Staff Team") return member.kick();
});
you cant do await ...fetchMember().user
you have to await it first, or do (await ...fetchMember()).user
but anyway it seems like you dont want a user
so just remove the .user and you have the member
//Check if the user has the a staff role in join
client.on('guildMemberAdd', async (member) => {
let user = await member.client.guilds.get(xxx).fetchMember(member.id);
if(member.bot) return;
if(member.guild.id !== `687615474774573096`) return;
if(!user.roles.find(r => r.name === "Server Staff Team") return member.kick();
});
yes
Can we do member.addRole(xxx)
yes
O.O
your message will be in one shard, the emoji in another
neither in both shards
i can see two options (both are pseudocode and will probably not work straight away, but you should get the gist of it):
- broadcastEval("if(client.emojis.get(emojiID)) { client.chanels.fetch(channelID).then(channel => channel.messages.fetch(messageid).then(message => message.react)) }")
- fetchClientValues("emojis.get(emojiID)").then(value => client.emojis.set(emojiID,value).then(m.react(emoji)))
the gist is:
- find the shard that has emoji, fetch the channel, fetch the message, react (since neither channel nor message will be cached in other shards)
- attempt to import an emoji from another shard and cache it in the current shard
I need help with something
When i play music with my bot close to the end of the song it starts skipping like every five seconds til the end, imm using ffmpeg, js, ytdl core, and opusscript.
@uneven monolith have you tried changing the server's region to us?
Also, maybe it's bitrate issues
maybe, how do i change it?
Server settings -> change region
For bitrate: channel settings -> set bitrate slider
ok, it is set to central us
Also, the next music might be caching before it starts, which could be the cause if you're using a weaker host
like a 4gb laptop
Are you hosting the bot yourself?
yes
Hm, try the region or bitrate solutions, if those don't fix it then you might need help of someone who's more experienced with the library that you're using
ok
Library?
are you getting any errors?
should I regenerate my token?
there more than likely is an error happening
you probably just aren't handling it properly
Discord will return an error when your token isn't working, so it looks like you don't handle errors correctly
would a card drop like Pokecord make the bot invalid for sign up?
(based on non prefixed messages, e.g. drops randomly based on user messages)
Almost every bot is valid, except dickbots and spam/advertising ones
I think the bot will be accepted, but it will be muted on this server if it has random card drops
Who pinged me?
idk but my bot that im working on only one out of the 5 commands work im sad lmao.
When I try to make new commands and stuff, it makes this error.
It's done this before.
at load (C:\Users\Cools\dog1bot\handlers\command.js:15:36)
at C:\Users\Cools\dog1bot\handlers\command.js:29:27
at Array.forEach (<anonymous>)
at C:\Users\Cools\dog1bot\handlers\command.js:29:14
at FSReqCallback.oncomplete (fs.js:152:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fyre@1.0.0 start: `node src/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fyre@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Cools\AppData\Roaming\npm-cache\_logs\2020-03-13T02_54_47_511Z-debug.log
C:\Users\Cools\dog1bot>```
I can read that's name undefined, but it happens when I make any new code, and when I would then delete the new commands I make, this error of undefined name would go away.
And it's not possible on my end, because it says that it's undefined in handlers.
In the handler*
Does anyone know why this just randomly happens?
show your code
members
yea
thats not working
How to get channel count in v12?
probably msg.guild.channels.cache.size for server and client.channels.cache.size for total
wdym
r u on latest v12?
v12? for nodejs?
o
if ye try emojis.cache.get() instead
will do, what's a quick way to check my version?
require('discord.js').version
msg.author.presence.activities is an array
[0] is custom status and [1] is 'game'
iirc
so try msg.author.presence.activities[1].name
(replace msg with message)
@red hollow not working
what version of d.js u using
and if u dont have custom status set try msg.author.presence.activities[0].name maybe?
idk
what error are you getting
TypeError: Cannot read property 'name' of undefined```
yes it does work for me
and you can use old version
npm i discord.js@version
for ex npm i discord.js@11.5.1
its about damn time, my bot was verified!
Imagine not waiting and accepting any bot that gets added including ones that will just spam your DMs 
Yeah takes a while
Congrats but also #memes-and-media
What is the fastest way to move files from your computer to a DigitalOcean Ubuntu VPS?
FTP? @earnest phoenix
thanks @broken jay
How do i find a role in v12?
I'm trying to fetch an emoji from a specific guild in my shard but it's returning my emoji object as empty
Here's my code (I use "this" because when I use "client", it says that "client is not defined"):
client.shard.broadcastEval(this.guilds.get("664509279251726363")).then(value => {
console.log(value);
//this.emojis.set("671848138935500836",value);
//m.react("671848138935500836");
});
when I log value, it shows that the emoji object is {} for my guild, even though I have over 30 emojis in that guild. Any ideas?
My goal is to grab one of the emoji's from that guild and use it to react to a message handled by the current shard
Since the current shard does not have the emoji cached it can't use it unless I set its cache somehow, right?
I also tried
client.shard.fetchClientValues(emojis.get("671848138935500836")).then(async value => {
client.emojis.set("671848138935500836", value);
console.log(value);
m.react("671848138935500836");
});
but to no luck ๐ญ Value returns [ { }, { } ] ๐ญ
What if you remove the ` here
is it supposed to be double quotes? O.O
So now I have
client.shard.fetchClientValues("emojis.get("671848138935500836")").then(async value => {
client.emojis.set("671848138935500836", value);
console.log(value);
m.react("671848138935500836");
});
returns [ null, null ]
๐ญ
hmm in the examples, if I do client.shard.fetchClientValues(guilds.size).then(value => console.log(value))
Then I get [ 5, 13 ], which is right
so the single quotes thing should work
just I can't seem to be able to grab a specific emoji from a specific guild that one of my shards is serving ๐ญ
Hmm
It seems when I try to fetch the 'emojis' object of the guilds in my shards, I receive an empty result
client.shard.fetchClientValues(emojis).then(value => {
console.log(value);
});
Value is [ {}, {} ] for both of my shards, even though I have tons of emojis. Any ideas?
Could it be because my sharding is not set up correctly?
I'm using Discord.js 11.5
I console logged my client.shard, and noticed there's no "emojis" property anywhere, nor is there any mention of emojis. How could this be? O.O
I'm guessing because the emojis object is inside one of the guilds object in my shard?
Update:
This worked: console.log(client.shard.client.guilds.get("677592580334288948").emojis);
https://discordapp.com/channels/264445053596991498/272764566411149314/687910377396502573 @wide ridge @tight plinth isnt` how js does variable interpolation

Pretty sure

ok, so why does every damn lame-ass botlist have a problem with my invite link, except top.gg and maybe 1 or 2 others
everywhere i put my invite link, they strip it down to just the bot id and no permissions
taking out my oauth2 scope and redirect uri
they all exhibit exactly the same bug, are they all forking some generic "bot list" code?
Generally it's to keep servers safe from being nuked with bots that decide to go crazy upon joining with permissions
but it doesnt make sense, some bots need the oauth2 scope
and on those same lists nothing stops me putting a permissions with everything or Administrator
i think its just a crap regex they all copy
Sorry to say it, but they don't exactly care as far as I understand :^)
Other bot lists are bad anyways
