#development
1 messages ยท Page 1092 of 1
ill remove it
hold on
now its not
do you have sharex installed?
install sharex
yes
No
go away misly
Why be rude
that is sharex
Hahaha hahaha ha
Misty?
No
ok
go
click the thing that says Click here to download your custom uploader file for shareX
download that then open it
click yes on the popup
Wat is that?
done?
Right click the shareX icon -> Destinations -> Custom uploader settings
and then set all of these to cdn.yxridev.com https://cdn.yxridev.com/u/Dv4VPckg.png
then click test next to the image upload one
to see if it works
Can i do that too?
if you want to
nice
ok
now
Right click icon -> Desinations and then change the top 3 options to custom uploader
image, text and file
Ok now hold shift and click PRNT SCR
take a picsure
and then send it here
oh
its
ctrl
or
click the shareX icon
I usually have it like this https://cdn.yxridev.com/u/pYDf8dRa.png
so its easier
wait
right click share X and under after capture does it say upload to host?
niceee
it works!
@earnest phoenix have you got it to work?
well you have to have a website host and domain
domains are pretty expensive to renew
p sure the .cdn is just a subdomain
web site hosts are quite cheap
nothing else
i dont know if getting a subdomain on a sub domain is a really good idea
lul
@earnest phoenix answer me
do you use comic sans ms on your website
unironically?
lmao
i dont get it lol

thats still bad
use arial
or consolas
but not anything ending with "Sans"
JESUS CHRIST THATS WORSE
THE FOOTER DOESNT EVEN FIT
i want to cry
its "Balsamiq Sans", cursive"
sir
:yike:
you should deploy it with them features already
you made a website which only fits on your laptop
tip:
hi
footer {
position:absolute;
left:0%;
bottom:0%;
width:100%;
height:5%;
}
``` @earnest phoenix
@leaden sage hi
di
Hey, I try to code a bot with node.js, with a function that fills an array with random numbers with a while loop, but somehow array.push(value) is not a function. Can someone help me out?
send ur code
var cards = []
while(counter < 21) {
var rand = Math.floor(Math.random() * 10) + 2
cards.push(rand)
counter ++
}```
Are you sure the error is coming from there?
i see nothing wrong with it
100%
1 sec
Can you show the stacktrace then show us the line
at Object.test (C:\Users\Admin\Desktop\BETA\commands.js:98:23)
at Object.cmd_test [as test] (C:\Users\Admin\Desktop\BETA\main.js:90:14)
at Client.<anonymous> (C:\Users\Admin\Desktop\BETA\main.js:239:26)
at Client.emit (events.js:315:20)
at MessageCreateHandler.handle (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (C:\Users\Admin\Desktop\BETA\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)
at WebSocket.onMessage (C:\Users\Admin\Desktop\BETA\node_modules\ws\lib\EventTarget.js:99:16)
at WebSocket.emit (events.js:315:20)
(node:20764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20764) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
Alright, now can you show us commands.js at line 98, column 23 (also can you verify the file is saved)
}
lmao
whats above?
send it all in one message pls
how do i make my bot ping itself in discord.js
the code
line 98 would contain the code in which you included the .push from. Maybe you edited the file and never applied the changes
Qu1ckly <Client>.user.toString()
ok
still having this issue?
yea :/
would that not return [object Object]
I found the problem guys. I tried it with for, but somehow it did not work with while @sudden geyser @digital ibex
ohok
But tf why?!
js is so weird
its not
try logging it officially. pretty sure it would be object Object
js is cool
i know its simple and cool, but weird
it should work tho
i've already logged it, it logs:
Lost copy and pasted your code and it worked for him
with the .toString() call following message, correct? hmm
yeah
what is message?
it shows it as a jsontho, the .toString makes it look like that
U making ur own lib?
its the for (<this thing>... of the websocket.CreateWebserver or whatever its called
im rewriting it
Bruh the problem still did not fix. Sometimes it works but sometimes not ๐ฆ
the old version severerly lacked classes, i understand classes better now so ๐
@jagged sun show more code
let usercards = [], userresult
for(let i = 0; i < 21; i++) {
let randdealer = Math.floor(Math.random() * 10) + 2
let randuser = Math.floor(Math.random() * 10) + 2
if(randdealer == 11) {
if(acecounter >= 4) {
dealercards -= 1
} else {
randdealer = 'Ace'
}
randdealer = 'Ace'
acecounter++
}
if(randuser == 11) {
if(acecounter >= 4) {
usercards -= 1
} else {
randuser = 'Ace'
}
acecounter++
}
dealercards.push(randdealer)
usercards.push(randuser)
}```This right here is the full code, and nothing changed.
My console looks like this if i call it several times:
Dealercards: 8,Ace,3,9,6,8,4,3,7,3,3,3,8,3,10,3,4,2,8,5,2Dealerlength: 21
Usercards: 8,3,4,2,7,Ace,6,9,9,3,8,2,4,4,3,6,5,5,5,10,9
Dealercards: 8,Ace,3,9,6,8,4,3,7,3,3,3,8,3,10,3,4,2,8,5,2Dealerlength: 21
Usercards: 8,3,4,2,7,Ace,6,9,9,3,8,2,4,4,3,6,5,5,5,10,9
(node:7832) UnhandledPromiseRejectionWarning: TypeError: dealercards.push is not a function
<stack>
Dealercards: Ace,10,6,8,9,7,7,8,4,10,6,Ace,Ace,8,10,8,10,10,8,2,6Dealerlength: 21
Usercards: 2,4,6,10,10,8,4,9,4,4,4,9,9,5,9,10,9,4,4,2,5
any idea tim? :/
Ah. I understand what you mean
@digital ibex so if you console.log(message) you get that pic?
can you copy paste it here as text?
So just every time the rand was 11 the whole thing fucked up.
yup
kk
oh
when i remove the .toString(), i get: { code: 4002, reason: "Error while decoding payload." }
the docs say i sent a wrong payload
yeah, thats what console.log(message) does above it
ah
so thats better ๐
so its working now or what?
im gonna try and send a different payload and see what happens
how do i make a bot
As an object
Array would be useless for this kind of thing really
So if you know about using oauth2... Ever used it to see if it returns any data?
I keep on hitting the daily quota limit of YouTubeโs API. Anyone has suggestions on what to do?
music bots typically rotate ip's
wdym
they have multiple ip's that they request from
my bot is hosted on a vps
hiii, @quartz kindle i fixed the issue, now im getting a new one :/
so thats one ip innit
Use a tunnel
but thats not the problem
the code is just: await WS.send(JSON.stringify(GW));
and that causes the rate limit
i dont understand it myself, but what i think they're saying is that you need to have loads of IPs or something so ur not getting ratelimited, like a bot like groovy wouldnt even be functional
isnt it being simply being causes because of the fact that i hit the limit/day?
you have one ip, that ip is getting temp banned
you need to have more ips to use when they get temp banned
Usually ipv6 blocks are the solution
@digital ibex what is GW
const GW = {
op: 2,
d: {
token: 'ur mother',
properties: {
$os: 'linux',
$browser: 'karen',
$device: 'karen'
}
}
}```
@earnest phoenix lavalink?
how do i check
@digital ibex are you sure thats all?
What
also are you sure the error is from there?
idk if im using lavalink
Bruh
i dont think use lol
How do you play the music
@digital ibex did you mess with object prototypes?
i just use ytdl to play it
wdym? ๐ณ
on a connection
Then idk if you can
In lavalink you can set it in the yml file
@digital ibex console.log(GW) before stringifying it
Better sound quality
kk
is it?
As you have to host it
oh
As its a node kinda thing
It runs as a jar file
Although
You can run it on the same vps
And you can use something lik erela for the client
but will it fix my problem?
why is token Client
are you doing GW.token = client?
For a command that can change the users nickname, do I have to add a rate limit or restriction?
im not used to using this many classes
i was doing this.GW.token = token when i was meant to be doing this.GW.d.token = token
so yeah, i messing with the object prototype by accident
afaik: linux for normal, mobile to show ur on mobile
i've only been looking at these docs for 2 days
its android then
cuz im on windows, its worked in the previous versions of my library
never tried using android tho
is there any reason why the messageDeleteBulk event wouldn't be firing when messages are bulk deleted? the messageDelete event is working fine. (using discord.js-light v3.0.6)
let me check
Does someone know how i can make a command who send a shiba pic (like some nsfw bot but with shiba pic) (in python)?
@earnest phoenix you can probably use an api to do that
you'll need to fetch the url of the image from an api and then send it in your message
yes but what api?
^
leme check smth rl quic
super?
super is only when you're extending something
try doing js module.exports = class { constructor...
thats what i do and it works
probably wont change anything but who knows
class utils doesn't extend anything so it doesn't rquire a super call
what exactly logs undefined @summer acorn. first or second one?
i suspect that you are assigning this to an undeclared object property
console.log(this) is logging undefined
i mean, this works for my command handler https://lumap.is-inside.me/x88wOrbu.png
sooo idk
thats different
that is different
still same idea
show the top of the class
i have no idea how it can solve your problem, but try to console.log(this) in the constructor @summer acorn
after you did this.client=client
thats the thing which is undefined
hm
send the whole thing
does the error trigger at the line where you require your class in your mute command
@tight plinth no, it's when I use the getUser function
https://hastebin.com/qamopateho.js
which is the only place where I use this
because message.mentions is unreliable as hell
security
line 9?
whats logged
the client
its go no need there, nothings gonna log
it did log though
which one?
and Lumap literally told me to put it there to see
i'll let pros solve ur problem
@sinful belfry fixed in the next commit (fucking discord.js switching names around)
tim u shud just make ur own library lol
lol
the event name is MESSAGE_DELETE_BULK
and they do MESSAGE_BULK_DELETE: "messageDeleteBulk"
yeah
why the fuck
something lighter than djs
lmao who knows
@tight plinth
just can't make their minds up ig
too much work
so ur client is undefined
no
Crang:entra6
this is amazing
the parent of client is undefined
literally im ded
Crang:entrar

and @robust arrow this isn't the bot file mate, it's the functions class
its 100 facts 
@summer acorn tbh idk
this is the place where the function is used
I have a command that starts a public trivia match in a channel, as of right now people can start new trivia games while one is already going on
Is this ok or should I limit the amount of games per channel to 1 for my bot to be accepted?
you await the function, getUser
I've been going at this for hours, I've just been trying a ton of different things at this point.
I think I've figured out the issue now though.
Not to be political but how the fuck do I get data from a dataurl
you need to await the promise to get its value. the value is delivered in the await line
for example ```js
a = promise()
b = await a;
only b has the resulting value
a is still the resolved promise
just you you know: im more sexy than promises, but pls no use me
64: They understand computers.
im as hot as a ๐ถ๏ธ
if that's nsfw, then a lot of people in #memes-and-media should be banned
91-94 lmfao
confusin1919
Algorithmic complexity and O-notation are used all the time in the "real world".
Algorithmic complexity and O-notation are never used in the "real world".
Academia somehow is not the "real world".
There is a "real world".
yeah, its amazing lmfao
lol
who actually studies cs
feelsbad
not me
idk who does
ppfff
when im older then i'll probably leave the class im in, i started my gcses last september so idk
data url?
nice url
How to read
wtf is that
what do u mean by read it?
It's meant to be an image
like
Uh
a screenshot command or something lul
that's a b64 image
thats not enough data to be an image
i don't understand what you mean by read it
How me get from that to image data
what do u want it to say when its all done the way u want it?
that's just a simple case of encoding and decoding
Oh
decode the b64 to it's byte variant and you have the data
just convert every character in the b64 to a byte
What would I use to do that?
i don't know
It's probably fine
In an embed
in a discord embed?
is it from a package?
Yup
which one
tim, do u know how to fix my problem? D:
qrcode
What's your problem lost?
Just so I know if I wanna stick around with popcord and learn shit
you want an image qrcode?
lol
@pure lion
have you used the toCanvas thingy?
thats the error im getting for some reason :/
nearly finished tmโข๏ธ
@digital ibex did you not remove the GW.token = client?
well show code
kk
you're still adding something too much to GW
GW.d.token = this.token;
console.log(GW);
await WS.send(JSON.stringify(GW));
and what does the log show?
it logs:
sorry... :/
i've got loads of logs and im tryoing to find which one it is
there
well why is token a client?
idk, i didnt put a class named client
how did you define this.token
constructor(token) {
this.token = token
and what is token
what do you pass to the constructor
const karen = require('karen');
const client = new karen('my token goes here');
yeah
your logs are saying that this.token is an instance of a client
show the full client.js then
new SocketManager(this)
oh
constructor(token) // this/client
OHHH
// client.js
this.socket = new SocketManager(this);
// manager.js
constructor(client) {
this.client = client;
this.token = client.token;
}
oh ok
the way you were doing it, not only is a circular dependency, but also this.client would become the class itself, not the instance
would making a getter for token be more performant?
so you dont have 2 token vars
It's super negligible tho lol
@digital ibex is ur code on github somewhere
not this project
and its probably gonna be in like
a week or two when its finished
Could u dm me the link when ur done
a getter would probably be better yes
Just make a repo and commit everything later lol
or simply use this.client.token everywhere
is there a way to make one api call to delete multiple voice channels?
not afaik
why do you want to see it so bad? just look at eris' and d.js' source code, its all the same
and would it change anything performance wise, tim?
cuz thats why im doing this lul, for performance issues
would save you a few bytes of ram
for the token
because if you define this.token twice
once in client
and once in manager
you have 2 copies of it
oh
so the manager should get the token from client instead
instead of having its own copy
What?
Huh
this.client.token
There is this youtube video series that uses deno and ts to do what ur doing @digital ibex want me to link it?
yeah, but like this?
yes
What????
uh ok
what what?
@quartz kindle huh?
?
Excuse me?
Contribute to this Project: https://github.com/ansonfoong/katana
Want to support me and the channel? Donations are not required but greatly appreciated!
Become a Patreon: http://patreon.com/ans0n
Buy me a Coffee: http://ko-fi.com/anson
Streamlabs: https://streamlabs.com/anso...
...
1 sec
Tim, are you confused or disappointed right now?
im confused
this confusion
wtf does this guy want
bad
well thats not appropriate
Mad?
On top of that, memes in #memes-and-media
6

Are you
really
What
Move to #memes-and-media
How does that make sense
what are you even talking about
It just does. Move to #memes-and-media, last warning.
what
@slender thistle cringe
I was talking about moon roock wit a glock @solemn latch
Hi this is #development
sorry daddy shiv
#General
@strange glen do I need to repeat myself?
@slender thistle cringe
ty shiv
i dont understand the question
...
like using the terminal to run nodejs in vcs?
so, the question isnt really about the code editor, but how to make a bot?
i dont now how to explain... can you speak german a little bit...
this channel is strictly english only
kk
:/
hmm
oh
HOW TO CREATE ANOTHER BOT
this is it
i have one bot named Makzzยฒ ... but i want to make another
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
new application
kk
this guide covers it in more detail
https://discordjs.guide/preparations/setting-up-a-bot-application.html
why this dont work?? https://i.imgur.com/xbo5y6r.png
(node:4) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
idk
your url is undefined
im not quite sure which one will get used
one of them is probably right, but your setting it to both. so ones winning out, and its the wrong one ๐ค
well it doesnt ever get there
the promise gets rejected because the url is undefined
i thought the rejection was getInfo()
oh true
@earnest phoenix when its finished, checked my github and see the difference ๐
1 or 2 weeks
I didnt even see that 2nd method call
idk why there would be an await if it's a callback either
yeah, but undefined.join would error
Is there any way to write to a json file without the bot rebooting
Use a real database
Yike
postgresql ๐
I have a trivia command that starts a public game within a channel, atm anyone can start multiple games of trivia in one channel
There can be multiple games going on, my question was is this ok, or should I find a way to limit 1 game per channel
limiting it to one per channel is easy to do, so why not?
limiting it to one per channel is easy to do, so why not?
@solemn latch Im having trouble doing so, can you point me in the right direction?
just create a map of all channels with running games
when the game ends, remove it from the map
But wont the array be empty on each start of a game, since in that games js file nothing has been added yet
or make it viewable elsewhere
Ill give it a shot
i use a map for my games, because i attach a timeout for the objects in the map.
i found it easier to cleanup games that didnt get properly deleted with a map.
Ok so. I have 2 discord servers. I have the same bot in each.
I want someone to come into the 2nd server and type a command such as ;update.
This command then sees what roles the person has in the 1st server and adds them in the second server.
Is this even possible. If so then I would love to know how this would work.
is this supposed to be a public bot?
How Can I attatch to the client object inside of an exported module
Im using a command handler
then yeah, not really that hard.
youd have to make sure each role has the same exact name, or map them to each other.
fetch the user in the first community, and add/remove the proper roles one by one in the second
you want to pass client in the function? or make a client inside exported modules
Hmmm. So for example.
First sever has one role. - Member
The second server has the exact same role.
Person types in a command. For example ;update
The bot then gives the roles that the person has in the 1st server into the second.
It sounds confusing lol.
It is hard to explain.
yeah, get the member from the first guild
get all their roles
get that same member in the second guild
make sure all the roles are the same
Mhm.
the docs for your specific language/lib will say how to do each step
Docs?
the place you get info on your library
Ah yes.
Not going to lie. Not the best programmer in the world.
But I will give it a shot.
Nope.
I have no idea what I am doing.
:/
what lib are you using?
Shall I store the data of the role name in a global variable?
The shot only took 11 minutes
yeah the role name can be global if you want
@solemn latch Discord.js
Then after I have stored the data of the role name from the first guild what do I then do with that?
Is there a guide in the lib?
the guide is more generic djs
this is very specific
and heres the docs
https://discord.js.org/#/docs/main/stable/general/welcome
theres only one djs docs
synchronize roles across guilds
Yes.
for a user doing a command
Nothing I have ever done before
So
Sorry for being slow lol
Yes.
The first guild.
Not really.
I am currently learning at this stage but the course I was taking did not talk about roles.
So I have had to go solo on this one.
So thank you for all the help you are giving me.
Mhm.
It is basically updating the guild perks in guild 2.
The roles in guild 1 have already been created and assigned.
When the user joins guild 2 the command then run adds the specific role in guild 1 to them in guild 2.
If you get what I mean.
Exactly!
That is exactly what i need
I am sorry lol. Do you think it would be easier to test it out first on an app like discord bot maker?
And then code it properly after?
Mhm.
It has all the tools.
I use it for messing about.
It is good for trying out new things
Let me get it up
1 sec
Discord bot heaven.
@earnest phoenix Thank you so much
Hmmm.
This seems useful.
We just need a source role.
I found a free hosting service
Eh what???
:/
I host it off of my raspberry pi.
This look good?
Looks useful.
True.
Yeah...
It would have nothing to do with syncing it.
Ok.
Yes.
It only gives them the role if they have the role in guild 1
That is what I am aiming for here.
No idea how to write it thats the problem.
I can actually execute code.
So.
*script
Ok so.
This will specify my guild
That I want to target
If I execute that script
Do you want me to store it in a variable?
Yes
how do i change the nickname of the author of a message in discord.js?
the context is !verify <IGN> and it would set their ign to args[0]
I am so terrible at making bots. :/
@elder muralafter seing dbm yes
well nothing can be perfect
I just use it for drafts
I just want to sync roles between guilds.
It is very hard.
Well....
It is for me.
Oh really?
Do you think there is anything online?
I mean...
It is just for testing purposes.
But then again.
I'm not going to copy.
if i were to do a !userinfo command, and i wanted it to show all of the user's roles (in that server of course), how would it be done?
in discord.js*
An example of what I am aiming for
would this work:
const rolesOfMember = message.member.roles()
message.channel.send(rolesOfMember)
an easier way would be just accesing the roles directly without making a variable for it if you are just gonna use it once
also no it wouldn't
i didnt think so
it would just try to send objects
css 100
Itโs so low res
or just you know
The owner deleted their account
and the bot isnโt in this server
and the bots been offline for over 6 months
The owner isnโt in this server too
They deleted the bot
I think Iโm in the clear on that one
message.member.roles.cache.map(r => `<@&${r.id}>`).join(', ').replace("@everyone,"")
sry im so slow
also it was typed on my phone lol
@obtuse jolt I am a complete beginner.
use client.on('ready'
Is your ss thing still working?
@earnest phoenix The whole of the index.js . I will not use the script for the real bot. This will be to see if it works to how I want it.
i did mentions.users.first or whatever called it mentionDude and got this error when trying to find roles:
v12?
who are we talking to rn
Mentions.members if you want membere
oh

Wait......
@earnest phoenix You have a YT?
Thats cool.
I was just looking at your tutorials.
i finally get users vs members
users are discord specific, can occur in dms, etc
members are guild members with guild data
coooool
How complex is syncing roles from guild 1 to guild 2.
Because if it is simple I am just shocking
Lol.
30 lines of code max
Well.
I will do it eventually.
Hopefully.
Thank you for all of your help.
๐
Hey guys is it bad my ready.on event is 10,000 lines long?
Shut you mortal you underestimate my codes length
I regret to inform you my ready even if 10,000 lines and my new Client() is 15,000 lines
My database initial loading is 30,000 lines long
And one of my functions is 50,000 lines long
My message event it over 150,000 lines long
And my commands list is over 500,000 lines long
My smallest command file is 1,000,000,000 lines long
My restart command is over 75,000,000,000 lines long
You waffle so much you just changed from millions to trillions
WAFFLE
My database is a zettabyte
I once used a zettabyte of bandwidth on my dedicated servers in a month
HOW
@obtuse jolt I think you should check out this repository: https://github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py
Thatโs ducking beautiful
How do I get the user to show their avatar by simply typing a nickname?
sample: .displayName
How long does it go on
@earnest phoenix could you explain more?
I got to 10k
@earnest phoenix multiple people in a server can have the same nick
@earnest phoenix I just want it
or mentioning them
Woo it's ~20k lines
Oh lol
any1 know about request package ?
or photo-collage
How do I get the bot to create these kind of systems where they collect variables one by one? Without using any prefix
ok got it on the docs
Does anybody here speak a language that isnโt English and is willing to help me
await Species.findOne({
name: name
}, async (err, data) => {
if (err) console.error(err);
if (!data) {
let speciesBody = (await fetch.get(`https://pokeapi.co/api/v2/pokemon-species/${name.split('-')[0]}`)).body
let speciesCreate = new Species(speciesBody);
species = await speciesCreate.save();
console.log('help');
} else {
species = data
console.log(species);
};
});
await Growthrate.findOne({
name: pokeBody.name,
}, async (err, data) => {
if (err) console.error(err);
if (!data) {
let body = (await fetch.get(`https://pokeapi.co/api/v2/growth-rate/${species.growth_rate.name}`)).body;
let createModel = await Growthrate.create({
name: pokeBody.name,
levels: body.levels
});
growthrate = await createModel.save();
} else {
growthrate = data;
}
});``` can anyone tell me why does it returns, cannot read property growth_rate of undefined, and then console.log('help')
clearly the console.log() is above the species.growth_rate but first i get error of that growth_rate then i get the console.log()
https://hasteb.in/koxesoxa.js
console.log('help') -- Line 9
where i get the undefined error --- Line 20,
the code doesnt wait for the species = await speciesCreate.save()
it always sends the error first, then the console.log()
does anyone know how can i do so the bot even if goes offline while someone is muted unmutes it after bot is back online ??
save to db?
database
is this correct to check if the bot has permissions for something?
if(!message.guild.me)
no
then what is
its correct just put hasPermissions()
What language? @earnest phoenix
ie
message.guild.me.permissions.has('permisson here')
ok
@earnest phoenix mail in an application to dbl rn prob
online apps aren't open
Spice up your Discord experience with our diverse range of Discord bots
await Species.findOne({
name: name
}, async (err, data) => {
if (err) console.error(err);
if (!data) {
let speciesBody = (await fetch.get(`https://pokeapi.co/api/v2/pokemon-species/${name.split('-')[0]}`)).body
let speciesCreate = new Species(speciesBody);
species = await speciesCreate.save();
console.log('help');
} else {
species = data
console.log(species);
};
});
await Growthrate.findOne({
name: pokeBody.name,
}, async (err, data) => {
if (err) console.error(err);
if (!data) {
let body = (await fetch.get(`https://pokeapi.co/api/v2/growth-rate/${species.growth_rate.name}`)).body;
let createModel = await Growthrate.create({
name: pokeBody.name,
levels: body.levels
});
growthrate = await createModel.save();
} else {
growthrate = data;
}
});``` can anyone tell me why does it returns, cannot read property growth_rate of undefined, and then console.log('help')
clearly the console.log() is above the species.growth_rate but first i get error of that growth_rate then i get the console.log()
https://hasteb.in/koxesoxa.js
console.log('help') -- Line 9
where i get the undefined error --- Line 20,
the code doesnt wait for the `species = await speciesCreate.save()`it always sends the error first, then the console.log()
wow youโre so funny
if (args[1] > 99) return message.channel.reply("Please choose a number less than 100.")
is this correct
it keeps crashin cus o fthis
y the crash tho?
oh
message.channel.reply is not a function
oops
(node:46040) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body limit: int value should be less than or equal to 100.
its not working
limit should be less than or equal to 100
so whatever you're doing that has a limit field is the issue
less than or equal to 100*
`Server Region: \`\`${[message.guild.region]}
```Cannot read property 'guild' of undefined
What's message
console.log the message.guild
@slender thistle message is not defined
Show your code
@slender thistle dm ?
Preferably here
`Server Region: \`\`${[message.guild.region]}\`\` \n Owner: \`\`${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`\`\n Boosts: \`\`${message.guild.premiumSubscriptionCount}/30 (Tier ${tiers.message.guild.premiumTier || 0})\`\``,
Show the full message event
did you store it?
Itโs in dms
im not sure. usually i would say if you delete it after 30 days you are save. but its annoying to make in discord
client.on("message", message => {
if(message.author.bot) return;
if(!message.content.startsWith(prefix)) return;
if(message.content === ("-serverinfo")) {
var voiceChannelCount = message.guild.channels.cache.filter(c => c.type === 'voice').size;
var TextChannelCount = message.guild.channels.cache.filter(m => m.type === 'text').size;
let embed = new Discord.MessageEmbed()
.setColor("#0012f5")
.setThumbnail(message.guild.iconURL())
.setAuthor(message.guild.name, client.user.avatarURL())
.addField("Overview:",
`Server Region: \`\`${[message.guild.region]}\`\` \n Owner: \`\`${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`\`\n Boosts: \`\`${message.guild.premiumSubscriptionCount}/30 (Tier ${tiers.message.guild.premiumTier || 0})\`\``,
true)
.setFooter(`ID: ${message.guild.id}`)
message.channel.send(embed)
}
});
@slender thistle
ok



