#development
1 messages Β· Page 870 of 1
i used parseInt(bet) and it didnt work
will it work on args[1]
?
they are the same thing
so why didnt bet work and args[1] will ?
it wont work if you give it NaN
if parseInt gives you NaN, whatever you gave it is not a valid number
i mistyped it
its args[0]
but it wouldnt work
but if you use parseInt, it defeats the pupose of using isInteger, as any valid number will be converted to an integer, therefore it will always say that it is an integer, even if its not
oh
the proper way to convert a string into a number is Number(string)
isNumber(args[0])?
no
can i use Number(bet) then ?
what is bet?
is it a number?
then yes
i used 100
but it would still return t
if(Number.isInteger(Number(bet))) return message.channel.send("T")```
am i doing it wrong?
then add !
alright
Thanks Tim!
Again lmao
i feel like if it takes more then 2 weeks its easy accept

wrong chat
exports.run = async(client, guild) => {
console.log(
`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`
);
let value = 0;
await client.guilds.cache.forEach(g => value += g.memberCount)
client.user.setPresence({ activity: { name: `c!help | ${client.guilds.cache.size} servers | ${value.toLocaleString()} users` }, status: 'dnd' })
const cnl = client.channels.cache.get("672484520175599636");
const embed = new Discord.MessageEmbed()
.setAuthor(`New Server Joined!`)
.addField("Server name ", `${guild.name}`)
.addField(`Member Count`, `${guild.memberCount}`)
.addField(`Server ID`, `${guild.id}`)
.setThumbnail(guild.iconURL())
.setColor("#00aaff");
cnl.send({ embed });
}``` Why won't this code work when a server joins, it shows no errors
does the console.log not show either?
you dont need to await forEach, its not a promise
console.log(cnl) to see if the channel exists
cnl.send().catch(console.log) to see if there is any error when sending the message
You could always use fetch in the case that it's not cached
guilds and channels should always be cached by default
All channels?
Guess that's one reason for high ram usage? Constantly cached channels.
yup
djs is such a joke tbf
well, its a general purpose library
it needs the caching for all its features to work
but its not suitable for very large bots
large bots should either create their own custom library for their specific needs, or modify discord.js for their specific needs
Yeah or just don't use js.
my bot is barely in 700 servers and im leaning very close to writing my own library
Ive been in the process of migrating my bot to rust and its way more performant memory wise
i heard good things about rust
but icba learning it at this point
especially because i dont wanna have to learn a whole other graphics engine, too used to canvas
Just setup some sort of API and use Canvas like that?
java has something akin to canvas
and waste network requests
which is graphics2d
every time i looked into java it just seemed so weird lmao
rust can probably interface with canvas through wasm stuff
it's not, it's actually a cute little puppy who wants to play
What's your thoughts on Dart? I'm still trying to pick a language.
depending on how you develop it'll either become a savage bloodthirsty hellhound or a cute chubby doggo
dart is okay afaik, ive used it a tad with the flutter library
I used it a small amount, It compiles to JS iirc
also, tim, you can use js in java too
practically everything compiles to js nowadays
Most languages can be used in Java due to embedding.
yep
yeah i looked into stuff like vert.x and es4x
I might give JDA a try.
jda is almost perfect, just lacks proper wiki
but the javadocs are pretty well explained
description takes a string
.setDescription doesn't have an options object
var embed = new discord.MessageEmbed().setColor("BLUE").setTitle("Your Random Number Is...").setDescription({"answer"})
Please correct it and send
They told you whats wrong, fix it yourself
https://discord.js.org/#/docs/main/stable/general/welcome here are the docs, take a look
i am not a that much big coder
I can't find the oauth2 discord api invite link
Then learn to code.
I tried
hostname: 'discordapp.com',
path: '/api/v6/invites/xgBbY3',
but don't work
@surreal notch what are u trying to do
i am trying to learn
ohk sorry
without the braces
ok lemme try
we need a bill wurtz version of have you tried reading your error
Ummm..... i am coding first time
Then learn to code first.
can u copy paste ur code
here?
He'll not learn from copy and paste.
ohk wait
you're cluttering the chat when you paste blocks of code here

i am lazy π

ok so you dont know what defining a value means right?
yup
We arenβt spoon feeding are we?
here date is defined
ohkk
no no and no.

it can be integer, and all strings require " before and after, it can be object and anything else too.
(what you have been made, example a class, like Discord.Client on discord.js, or embed for example)
and?
but even now i couldn't find my error
whats the error?
coz i am a nub in coding
@surreal notch ctrl + c and ctrl + v?
if (message.content.startsWith(`${prefix}randomnumber`)) { var numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]; var answer = numbers[Math.floor(Math.random()*numbers.length)]; var embed = new discord.MessageEmbed().setColor("BLUE").setTitle("Your Random Number Is...").setDescription("messagecontenthere") message.channel.send({embed: embed}) })
yea here
you havent defined message, so i think this is ctrl + v
u see message.content?
ohh yes

that means it checks if a message's text has the stuff you asked for
i dont recommend using startsWith, use messageContent is "somestring", instesd of messageContent#startsWith.
and why dont you?
if i am helping someone to use dyno bot
and i said to ban someone use !ban @finite bough
according to you
it will trigger it
dyno prefix is ? by the way :)
customizable :)
1st lets start off with the basics
dm?
hmm sure
I think no but thought of asking, can slowmode be relative to a member's role ?
no
the only difference is that roles with MANAGE_CHANNEL or MESSAGE_MANAGE can bypass it completely
^
I wouldn't entrust a normal member with that much power tbh.
what you can do is have a different channel for certain roles
Thanks o/
how to move a client from his id ?
you what?
move ?
you can change the bot's connected channel
Well check for bool if voice connection then move ?
not an user's
Not anymore ?
ah, yeah, forgot users can be moved too
anyway couldnt finde a great way
to move a user from the user id in a channel id
in which lib
discordjs v12
it took me less than 20 seconds to find this
couldnt fine it
"edit"
was cherching move or channel move
so like
What if I want to have a value for use.api and another for use.api.github?
What if I want to have a value for use.api and another for use.api.github?
My Code
const use = {
api: function(req){ ... }
}
ok
you already defined api as a function
you can make a getter
but getters in objects have bad performance last time i checked
If i shard my existing bot, can I distribute servers already allocated to my bot or can I only distribute future servers?
you don't control which servers are distributed to what shard
oh wait
servers as in machines?
or discord guilds
As guilds
yeah you don't control that
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
(node:5260) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
DICT_TYPE_CONVERT: Only dictionaries may be used in a DictType
why are you passing in a string
what
did you even take a look at the docs
I did lol
holy shit that code
Else i won't be able to get the edit("channel"
i tried without and got an error
the first argument asks for an object (https://discord.js.org/#/docs/main/stable/typedef/GuildMemberEditData) and the second argument is an optional string to provide a reason for the change
it require proprieties
Tim is an object
But will sharding only affect future guild or does it shard current guilds too? If i have a bot with 100 guilds and shard it into 100 bots will each bot serve 1 guild or will I have 99 bots without a guild??
you won't
@earnest phoenix this is a string js "channel" and this is an object: js {"a":"something"}
@earnest phoenix what?
@earnest phoenix sharding splits all your servers into shards
if you have 1 shard with 100 servers, when you change to 2 shards, your bot will restart and get approx 50 servers on each shard, according to the formula posted by cry
the formulas on the discord docs
And each shard means I would host an instance of the bot on separate servers right?
you don't have to
yes, each instance of the bot will handle an X number of servers
only huge bots like mee6, rythm and dyno do that
Oh that was just an example
Alright so its working but i still have a little problem now π
https://i.imgur.com/pzQ0ZOs.gifv
That's normal
what
cuz my code is
if (oldState.channelID !== newState.channelID) {
client.guilds.cache.get("688151170971336735").members.cache.get(newState.id).edit({"channel" : oldState.channelID})
}
}
So its always moving me
π
so you're just going back and forth
you don't do it in the event?
i do
client.on('voiceStateUpdate', (oldState, newState) => {
if (newState.id == "425328259056664596" ) {
if (newState.serverMute == true) {newState.setMute(false) }
if (newState.serverDeaf == true) {newState.setDeaf(false) }
if (antimove == true) {
if (oldState.channelID !== newState.channelID) {
client.guilds.cache.get("688151170971336735").members.cache.get(newState.id).edit({"channel" : oldState.channelID})
}
}
}})
if you want make it always move back to the same channel, instead of comparing oldState and newState, compare if newState !== channelID you want
or just check if they're in the right channel and if they are don't do it
you should also ensure that the change that happened is actually a switch between voice channels
@quartz kindle i don't understant
do you want it to always be moved back to the same channel?
yeah
i don't want to be moved
and if im moved from my channel i just get moved back
then if newState.channel exists, and newState.channel NOT EQUAL TO channelID you want
move to channelID you want
do you understand?
you are comparing oldState.channel to newState.channel
petition to make tim write all comparisons in words
instead of that
in all caps
compare newState.channel to a fixed channel ID
The fixed channel ID is the one im in
is the one where you want your bot to stay
No
My bot is not involved
Like i join
i just type "!"
And then if im moved
just get moved back
what
i join a channel
No π
type "!" will enable anti move for me
If then i gve moved anywhere
the bot will move me back to the voicechannel where i tiped the "!"
then thats a whole different story lol
for starters you need to track states
save the state for each user, if they are fixed or not
and if you want to keep the setting saved between bot restarts, you need a database
yes but
if you do ! and save it in a variable
when your bot restarts, that information will be lost
and the bot will forget you ever used !
That's not a problem
cuz the bot won't restart
and i wil change frequently channels
how are you so sure
Cuz its just a protection to avoid toxicity
Its like when we are in conflicts
idiots move other people
so i want to lock myself
to not get moved by other idiots
alright so i need to get my client actual channel it
when you type !
yes
but you need to save it somewhere that will be accessible
for example, a global variable
or attached to client
yeah a global var
Literaly doing that
works π
don't ask
what it that
lol
then once you set the that, in your voiceState event you can check for that
if(globalvariablechannelid && newState.channelID !== globalvariablechannelid) {
move channel
}
yeah
Bruh im trying to find the actual user channel id
Am i suposed to use that ? π€
yes
or member.voice.channelID
author is not a member
author is a user
user and member are different things
message.member
yes
Payment = discord nitro
I dont think thats the place for this.
Where then
nowhere
remove decimals
Wtf
?
Where can i ask for development
here?
here
but ask specifically for bot development
Wtf
instead of "Payment = discord nitro"
@reef summit If it is a company looking for a job there is #434058442764714002
umm can we get back to my problem/
@earnest phoenix remove decimals
itay, string manipulation
#434058442764714002 is for actual jobs, not one-time payments
Math.round(somenumber)
it isnt one thing lol
Where do i sent my messages
then it isnt here
not this server
Wtf
please stop asking I already answered that
stop saying that when we try to tell you what goes on here
@reef summit no one will make a bot for u for free atleast but if u want there are many people willing to make a bot for u for a decent money
-needdev @reef summit
@reef summit
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
Helped not did
helped or got hired?
those kind of people are rare to find
This channel is for help, not freelance requests.
id help, but i wouldnt make a bot for you
No he was making a bot for me
lmao?
Iβm paying discord nitro
.=.
Again, you are in #development and your topic is not related to this channel. Move to #memes-and-media.
I have a coin system and I want to make a command to reset the economy
I tried using coins.delete(message.guild.id) and some other stuff but it doesn't seem to be working
I keep getting the error TypeError: this.remit is not a function and Its coming from my message collector. Has anyone seen this before/knows how to fix it?
.addField("**SUGGESTION**", `${suggestmessage}`)
.setFooter(`Suggestion By ${message.author.tag}`)
.setTimestamp()
suggestchannel.send({
embed
}).then(msg => {
msg.react('β
').then(r => msg.react('β'))
});
Why not working?
what error are you getting ?
(node:5419) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Emoji
No, it's still the same
well this is weird
that means the emoji is wrong
yeah but these seem part of discord emojis?
β and β
yeah
i used unicode emoji
make sure you're using the right version of it, there might be multiple versions
'\β '
\β
i used this
try this one 'β'
but this is the mini version of the emoji he is looking for
\β
he used it correctly
i dont see whats the problem
it's still the same
well

try only one emoji at a time, to see if one of them works
^ was going to suggest
what are you hosting your bot on?
Google Cloud
@earnest phoenix https://pastebin.com/Mw9Ru813
@gritty bolt ?
oh alright
I keep getting the error
TypeError: this.remit is not a functionand Its coming from my message collector. Has anyone seen this before/knows how to fix it?
@gritty bolt
what line is it coming from?
Yes, I tried both separately
it doesnt say
MessageCollector.handleCollect (C:\Users\myname\Desktop\PlutoBot\node_modules\discord.js\src\structures\interfaces\Collector.js:100:12)
ive never seen this error before
me neither so i really dont know
that makes no sense
what is your node.js and discord.js version
lmao
unknown error
again, confused
do you have .handleCollect anywhere in your code?
no
can you open the file C:\Users\myname\Desktop\PlutoBot\node_modules\discord.js\src\structures\interfaces\Collector.js
i've opened it
show line 100
emoji doesn't work in my code :v
yes
how did that happen
no idea
i havent touched that file
reinstall discord.js
So i have my bot that's called @royal knoll and i would like to ask why it isn't responding anymore...
It was responding yesterday and today it isn't responding at all...
Yea...
bot status
is it this server only or all the servers
All servers
did u update ur discord.js version?
Yup
like yesterday
doesnt rlly matter
do you have an eval command?
Yes
do you have sharding?
No
try evaling client.ws.shards.first()
Hmm lemme see if even the bot responds
oh yeah nvm lol
if it doesnt respond to that, there is nothing you can do besides restarting it
Oh lol
it might be on a dead connection
do the djs peer dependencies have an effect in performance
I restarted it 2 times... It didn't work
say in keeping websocket connections
And if you're wondering if my bot is ratelimited... It's not ratelimited
if you already restarted and it still doesnt work, then its not a dead connection
does the ready event work?
Yup
My bot is running slowly and its in 85 servers but when i use a new bot token and run the same code using a different bot is runs faster. Any reason why this happens?
do ```js
client.on("raw", r => {
if(r.t === "MESSAGE_CREATE") { console.log(r.d) }
})
Hmm lemme try that
@earnest phoenix which language and library?
node.js version and discord.js version?
"discord.js": "^12.1.1",
@quartz kindle after i did that eval...
It responded after a long time but it doesn't respond to other messages still
ping 18k lmfao
Lol
your connection is dying
@quartz kindle i think it's 100% because of my internet connection being SUCCY
Welcome to Node.js v12.13.0.
@finite bough you talking to me lol?
@finite bough yea it's self-hosting
and discord.js version?
ok so i have 1 bot thats in 85 servers and then i made another bot thats in 1 server i took the code from the one in the 85 servers and put it in the bot in 1 server and ran it
WHEN INTERNET CONNECTION BECOMES SUCCY...
"discord.js": "^12.1.1",
@quartz kindle
when you say slow, its at responding to commands?
logging in is much slower with more guilds and more users
but responding to messages shouldnt be
where do you host it?
its local hosted right now but im using ethernet on 500 MB down and 500 MB up
show your code
oh god theres so much code
do you have any code that gets information from many members/users?
such as members.fetch()
do you have a database with prefixes and stuff?
is it slow on all commands or only a few?
do you have any command that sends many messages at once?
im getting members
like how many members the bot is connected to
and how many guilds its in
using .cache or .fetch?
im using guilds.foreach
put your code in pastebin or something
client.users.cache.size.toString()
full code https://github.com/OcULaR-Krowned/Pixelz
dont setPresence every 5 seconds
alright ill do it every 30
oh dang that actually fixed it
i think since its in so many guilds thats what was messing it up
i dont think that alone was the cause, as it doesnt depend on guild size
but presence does have higher rate limits than messages
so it might have been rate limiting you
if you install discord's peer dependencies, will discord automatically use them or do you have to use them
it will automatically use them
is it best to go crazy and install them all (except voice stuff lol) or just 1 or two that are necessary
xd
you wont go wrong with installing those 4
So on my info command for my bot itself... I have that discord bot widget in the bottom...
But do those widgets update or it's just stuck?
zlib-sync, bufferutil, erlpack, utf-8-validate
you need to add a cache breaker to the widget url
Hmm how's that tho?
for example url + "?v=" + Date.now()
this will append a changing number to the end of the url, making it invalid for caching
Hmm
@quartz kindle do you see that url right there?
That discord widget url + "?v=" + Date.now()?
Idk... Is it necessary?
no lol
Lmao
its like doing 0+10 when you can literally do 10
way worse than that actually
because its defining a global variable
Ah yes...
But like this?:
https://top.gg/api/widget/id.png + "?v=" + Date.now()
?
yes
but since you already have a string
you can just do "https://top.gg/api/widget/id.png?v=" + Date.now()
lol apparently it only works if the number is smaller
what kind of bullshit is this lmao
Hmm lol @quartz kindle
you can also do + Math.random().toFixed(5)
as long as the value is not bigger than 6 or 7 characters
why do u need it?
oh god nononononoooooooooooooooooooooooooooooo
no
dont do that
no
why do you think you're using async def
do you know what asynchronous means?
so think about it, why do you think with python we use async def and asyncio rather than just def
Which is better MongoDB or SQLight?
follow up question: what are your thoughts on SQL
probably referring to sqlite
*sqlite
what are your thoughts on SQL?
I personally think MongoDB, as it has mongoose which makes it easy to use
It's used by a lot of the big bots and has a neat web dash built it (compass)
I know very little of it,
the npm mongo driver is quite easy to use too
they both have their use cases so you can't reasonably say one is better than the other
though my settling point was that i personally don't like SQL
i honestly am uncool and i am probably gonna use rethinkdb 
SQL is better and quicker for large datasets
sql databases also have ORM wrappers so that isn't a valid argument but both nosql and sql databases excel in specific fields the best type of database for you depends on what you want to use it for
^^
nosql is better for storing objects that may have variable fields
yes and no
sql is better for tighly coupled data with fixed fields
other than that, its mostly user preference
something like postgreSQL with the ability to store datetime fields and json objects quickly and efficiently can put it easily up there with nosql databases
ontop of the speed with large datasets and reliability
mongo
hey guys
so i am feeling very stupid and stumped...
console.log(res.needs.happiness)
if (14000 <=res.needs.happiness < 15000) {
a(0)
console.log("a")
} else if (10000 <= res.needs.happiness < 14000) {
a(25)
console.log("b")
} else if (5000 <= res.needs.happiness < 10000) {
a(50)
console.log("c")
} else if (1 <= res.needs.happiness < 5000) {
a(75)
console.log('d')
}
and when i log res.needs.happiness, it goes out with 10... but for some reason, after that, it logs A, showing that the number is somehow between 15000 and and 14000... Any help? Sorry if this is very stupid...
mongo is way easier to learn
if you're not using an orm mongo is easier
postgres is one of the if not the most performant sql databases out there often used in the gaming industry
but SQL is generally faster
and imo mongo is hard to get into, but its worth the trouble
yes, but json functions in sql databases are an addon, not part of the original SQL design, so their performance might not be as good
i still find Postgres outpacing mongo ever time ive used it
Postgres is a very strong choice
tho personal opinion i would go with postgres
postgre is possibly the best database out there, no denying that
but depending on your data, mongo will be much easier to use
and sqlite much easier to setup
do you guys use orm
The only thing I miss about postgres is easy-to-install clients
i dont
the only thing postgres hasnt got going for it, is ease of use when hand writing querys, and setup
setting up a postgres server and managing it all can be a right pain
saying that the inbuilt docker image makes like 1000000000000000% easier
life*
Pgadmin4 in beautiful but BOI.....does it give a headache to make work
if i don't seek maximum performance i use orms
yh
huh
i dont use orms because i like being in control of what exactly the database is storing and how it is structured
Omnidb is great, but doesn't work at all with nginx
there are still some performant orms which can compete against some hand written queries but more often than not hand written will be faster than what ORMs generate
So I'm stuck with either phppgadmin or intellij database manager
rip
My Pgadmin4 started to throw weird CSRF errors
there isnt just those two
Not even stackoverflow could help me
in general my goto dbs:
sqlite3 -> if its a simple program and only testing
postgres -> the production database getting used with heavy workflow
there isnt just those two
@turbid bough I'll not use windows 2000-like interface clients
yee
one thing i love about pgsql is the fact that it's open source
atm im just using sqlite for everything lul
I run a few queries on every message, although there is not any noticable performance issues, performance.time ranges from 40-50ms... mysql
ew
which is not acceptable
@lyric mountain tried heidisql?
look into caching those queries
for example, getting guild prefix can and should be cached
Nope, does it have a decent interface?
for me: (i run on every message that the bot responds, sometimes upto 45 times a sec) it takes 5ms to send a request to the webserver, get the data and return it
it's smart to cache and update the data in the cache alongside the database
well, i cant say much, but its ok
Can't cache these queries
for example, getting guild prefix can and should be cached
@quartz kindle I use sqlite for caching, it's very lightweight and doesn't seem to impact performance at all
@trim nexus just dont use MySQL lol
if you gonna go through the effort of MySQL you could of just setup postgres
well, i cant say much, but its ok
@turbid bough it gives me IBExpert PTSD
ig ya gotta deal with ur 40ms then
it also supports ssh tunnels too
i would advise setting up a system which you can load and unload data to transfer databases easily
like what pgadmin also does
e.g i can dump my entire database into a json -> change database backend -> load json -> data fully setup and ready to go
hi
a database
i dont know what mongoose is
@turbid bough
looks fancy, but has too many jpg artifacts
ew heidi does the job 4 me
it also supports ssh tunnels too
@turbid bough
what does postgres?
Guess I'll stick with IJDM until I find a better manager or pgadmin devs fix that issue
@digital ibex Is that your IP in the screenshot, if so delete it.
postgres is a database.
Ok good proceed
lmao
lol when i post my screenshot with an url its fine
theyre trial mods let them be
is that question
@turbid bough Which one supports SSH?
both pgadmin and heidisql
And IJDM
I thinks they have miss understood what you ment by ssh
i said ssh tunnels, so yeah, they probably did not read the tunnel part
ooh i see
so I have a cat thing
a cat command
how do I make it so
when you say -cat
it says finding a cat
then edits message
to 'found one'
and then sends cat
nvm i found it
lol

does anyone else randomly have their shards go down without any errors?
I have this code in my shardingManager to check if one of my shards disconnected
shard.on("disconnect", console.log);
One of my shards just disconnected (I think it was the main shard), and it did not log anything to the console. The shard stayed disconnected for about 3 or 4 mins and I just manually restarted my bot
That sounds more like blocking rather than fully disconnecting
Nd also probably you lib hasn't adapted to the sharding changes discord has made
sharding changes? o.o
I implemented sharding about a week ago
so i'm not sure if it has to do with being outdated?
O.O
and in terms of blocking, the bot's status showed up as "offline" for the shard that was acting strange
it happened to me too, a shard randomly fails to reconnect
hey
so
im making a triggered command
and it just sends the file itself
if(message.content.startsWith(`${p}triggered`)) { //message.channel.send(`We're currently making this command!`) let target = message.mentions.users.first() || message.author; let profilepic = target.avatarURL; let url = `https://eclyssia-api.tk/api/v1/triggered?url=${profilepic}`; await message.channel.send({ files: [{ attachment: url, name: `triggered.gif` }] })
i want the image to be seeable
@slow cape why not send it in an embed?
@earnest phoenix would that fix the problem?
you cant just do that lmao
@slow cape i mean... It would look way better in an embed and yea...
you need go GET the file returned, download it into memory or to your local storage and upload it from therw
there*
d.js doesnt automatically download the file for you
putting the image url in an embed or just sending it eliminates having to download it since you're telling discord "get the image from this link directly instead of my bot"
https://oliy.is-just-a.dev/c9n8ei_3567.png does if you do it like this
https://oliy.is-just-a.dev/wiwuzi_3568.png doesn't if you do it like this
weird so the docs are incorrect? (wouldn't doubt it lol)
i guess because most times when fetching a remote file, the user would want to keep the original name
while when sending a local file, the user would probably want to specify its own name
@earnest phoenix how woulld code be in an embed
Hmm you don't know how to do an embed? @slow cape
I can show you if you don't know how to do it...
@earnest phoenix ik but how do i put the file inside it
Hmm @slow cape is it a url?
@slow cape what is your discord.js version?
ok
if you're using v12, the problem is not even that
author.avatarURL is a function in v12
not a property
so your entire url is wrong and you get an invalid file
@slow cape @quartz kindle is right...
It's:
author.displayAvatarURL()
with the code you showed, the url will actually be like this lmao https://eclyssia-api.tk/api/v1/triggered?url=avatarURL(%7B format, size, dynamic } = {}) {undefined if (!this.avatar) return null;undefined return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size, dynamic);undefined }
now i have an error TypeError: (intermediate value).addTitle is not a function
if(message.content.startsWith(`${p}triggered`)) {
//message.channel.send(`We're currently making this command!`)
let target = message.mentions.users.first() || message.author;
let profilepic = target.displayAvatarURL()
let url = `https://eclyssia-api.tk/api/v1/triggered?url=${profilepic}`;
let embed = new Discord.MessageEmbed()
.addTitle(`${target.displayName} is Triggered!`)
.setImage(`${url}`);
message.channel.send(embed);
}```
@quartz kindle
@earnest phoenix
@slow cape it's
.setTitle()
Lol chill... We all make mistakes lmao...
@slow cape also you can do
target.user.username
Hmm lemme check your code real quick
k
if(message.content.startsWith(`${p}triggered`)) { //message.channel.send(`We're currently making this command!`) let target = message.mentions.users.first() || message.author; let profilepic = target.displayAvatarURL() let url = `https://eclyssia-api.tk/api/v1/triggered?url=${profilepic}`; let embed = new Discord.MessageEmbed() .addTitle(`${target.displayName} is Triggered!`) .setImage(`${url}`); message.channel.send(embed); }```
@slow cape
@earnest phoenix
Also
Do target.user.username
Instead of that and also try changing the `${url}` to just url
hi
hmm
does anyone know how to fix this error with mongoose?
when i try to connect, i get that
@earnest phoenix can ya help pl0x
@slow cape oh ok... Change that to target.username i guess
probably because uh
Also i can help ya in dms to make the command work flawlessly... Tho
if(message.content.startsWith(`${p}triggered`)) { //message.channel.send(`We're currently making this command!`) let target = message.mentions.users.first() || message.author; let profilepic = target.username; let url = `https://eclyssia-api.tk/api/v1/triggered?url=${profilepic}`; let embed = new Discord.MessageEmbed() .setTitle(`${target.displayName} is Triggered!`) .setImage(url); message.channel.send(embed); }
@earnest phoenix
Hmm i think ik why...
y
Because you need to separate the user mention logic and message.author to different embeds
try changing target to message.mentions.members.first() || message.member;
@digital ibex that won't work lol
ye
i don't see anything wrong with it
should i do an if else statement
@slow cape so come to DMs and i'll show you something...
I have the widget set as an image on one of my commands but it gets outdated after a few hours and it doesn't automatically update unless I modify the link.. how could I keep it updated?
idk much about rdps
this is for Vultr
which is the best for 5k guild bots etc
Does a bot goes offline if it got rate limited?
No
@visual sandal
Url + "?v=" + (Date.now() >> 0).toString(36)
which is the best for 5k guild bots etc
@earnest phoenix Probably Cloud Computer
Btw, thanks to all who supported and helped me here!
@high bough GG
^^
Already got a lot of random servers xd
@icy crane light mode is brighter than the sun itself lmao
What do I do if my bot gets too big and is getting rate limited a lot because of commands ran?
Make an interval for all your commands so it can be used every 10 to 15 minutes lmao @earnest phoenix
if(message.embeds.length === 1 && message.embeds[0].description ("ποΈ"))
``` how do i make this so if description startsWith \ποΈ
@calm shore what are you trying to do?
@earnest phoenix use the cooldown from here https://discordjs.guide/command-handling/adding-features.html#cooldowns
if you have a command handler
Hmm [Visible CONFUSION] but anyways
guess i should have asked about that first
like
for example
message.content.startsWith This grabs the first thing and it can be added on to it, but if you get rid of startsWith then its the whole thing in quotes
i want that for the embed
but i get an error when i do description.startsWith
Hmm wait... Like are you trying to put anything in the message.content that starts with that emoji in an embed's description? @calm shore
Yes exactly
so if the embed description startsWIth that emoji then...
it will react to it
Hmm... Imma have to test that tho
I literally don't know if something like that is even possible or not
if(message.embeds.length === 1 && message.embeds[0].description.startsWith("ποΈ"))
it will work
but if you run another command
it will error it out
Like is it that necessary to check for that?
Yes
very necessary
if(message.embeds.length === 1 && message.embeds[0].description.startsWith("ποΈ"))
Does anyone know the CSS selector for the Long Description?
I have tried .longdescription and .content
longdescription only changes the outside bar
Np

