#development
1 messages · Page 1369 of 1
thats all you changed?
I think this is when I put it on and it becomes offline as for the rest of the code it works normally
I can not find any error
im having trouble understanding what you mean exactly
but try to do this
add client.on("debug",console.log) to your code
and then see what the logs show
and what are the last logs before it exits
Well my friend I will try this one
what are my options to run tasks that run even if i restart the program with python on windows?
scheduled tasks i guess
One option is to save it to a file/database, and add it on startup.
I need help,
So if the server is not in the unverified list then execute the command
if not dont execute it
i have trid the command.update() func but it dosent seem to work
Hello
If anyone has a command paging code, please give it to me
I will also send a sample
https://cdn.discordapp.com/attachments/772401859020849162/774350042193723392/unknown.png
تس
How i can get custom emoji's id?
js
Whatever I did, I could not write the code for this. I want someone to help me
well for example
you would want to split
let str = "1234567890"
into
someArray = ["12", "34", "56", "78", "90"]
i dont know how to explain it @misty sigil come here
Hello
If anyone has a command paging code, please give it to me
I will also send a sample
https://cdn.discordapp.com/attachments/772401859020849162/774350042193723392/unknown.png
@misty sigil Hellooooo
I do not know how to write code like this
would if "premium test" or "premium-server" not in [r.name for r in ctx.author.roles]: work?
i want to run this is the user does NOT have these roles
either one
lkwjhoweoiqoqwrg
qwruwetqwr
It will literally check first if "premium test" if a true value
you'll have to do x in [...] twice for both roles
@quartz kindle hello i am getting the error TypeError [REQ_RESOURCE_TYPE]: The resource must be a string, Buffer or a valid file stream., im doing: message.channel.send(new Discord.MessageAttachment(client.cardGen(), 'aaa.png')), and client.cardGen() returns a canvas.toBuffer()
and idk anymore
premiumtest in my_list and premiumserver in my_list
unless you literally do if [r.name for r in ctx.author.roles if r.name in ["premium test", "premium-server"]]
or
Check if discord.utils.find(lambda x: x in ["premium test", "premium server"], ctx.author.roles) returns None
ik you did some complex stuff
but does this work?
if "premium test" not in [r.name for r in ctx.author.roles]:
if "premium-server" not in [r.name for r in ctx.author.roles]:
await ctx.send("no premium 4 u noob")```
i mean its only for this
its not going to be used much
its for premium for my bot
so if its used once
ill be happy lmao
you could probably do
if "premium test" not in [r.name for r in ctx.author.roles] and \
"premium-server" not in [r.name for r in ctx.author.roles]:
ill try
but yeah that should work
(node:12304) UnhandledPromiseRejectionWarning: TypeError: client.emojis.get is not a function
client.emojis = new Map()
uh
brb
\ aka indication of a multiline statement
ty
@willow mirage client.emojis is already a native property
client.emojis.cache.get()
🗿
ok
@earnest phoenix
module.exports = (client) => {
const guild = client.guilds.cache.get("769862485053931521");
guild.emojis.cache.map(async e => {
if(client.emoje.get(e.id)){
return await client.emoje.set(e.name, `<:${e.name}:${e.id}>`);
}
})
}
why it is not saving : /
"return await client.emoje.set" since when set() was an async function
All that could have been reduce to
guild.emojis.cache.map(e => client.emoje.get(e.id) ? client.emoje.set(e.name, `<${e.identifier}>`) : null);```
Also where are you running this?
: /
ready event
client.on("ready", () => {
await require("../../functions/emojis")(client);
})
@earnest phoenix
https://moderator-bot.is-inside.me/Hgytt9ZA.png
Guess why it returns an empty map
hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
You're literally trying to set the emojis to the map prototype if they exist in the map which they don't
You're literally trying to set the emojis to the map prototype if they exist in the map which they don't
@earnest phoenix yes
guild.emojis.cache.map(e => !client.emoje.get(e.id) ? client.emoje.set(e.name, `<${e.identifier}>`) : null);```
nc it works
guild.emojis.cache.map(e => !client.emoje.get(e.id) ? client.emoje.set(e.name, `<:${e.identifier}>`) : null);```
There fixed bruv
no
it is fixed
.addField("Skills", `${emojis.join(" ")}`)
now this one
[
'<javascript:774348021303476254>',
'<css:774348020979466280>',
'<html:774311088501293107>'
]
@earnest phoenix : /
What
?
Ok I have a 30 minute cooldown on a command that only works in a specific channel.
The command pings a certain role to get help. I want to set it up so that if the command is run in the correct channel, the cooldown starts but if it is in the wrong channel, the cooldown will not start
I am currently using:
@commands.cooldown```
this works fine i just want it to only start the cooldown if it is in a certain channel
Hey guys, umm. how do i send the description in this format? i keep updating the embed and it keeps flickering.. the name and stuff are static but the "health" bar changes accordingly.. currently sending the same description except for the emojis.. everything else is static
@willow mirage Just change to what i showed or what are you trying to say
does it flicker becasuse of the lag?
is there a way to make it stable?
i mean
will decreasing the latency solve the issue?
I dont belive so.
Context:
This is a fan made pokemon nature/personality picker.
There are many different personalities that apply to each stat type and have either x1.1 or x0.9 stat boost.
If the personality is indifferent, then it will only have that one personality other wise there is a 20ish percent chance to have 2 personalities or it can be a pure personality. In my function, I used recursion to try to determine the personality of a "pokemon"
function determinePersonality(c){ // start of recursion
const a = possiblePersonality[Math.floor(Math.random() * possiblePersonality.length)];
if(a === "Indifferent"){
if(c[0]) return determinePersonality(c)
return ["Indifferent"]
}
if(c[0] && Math.random() > 0.2){
const fPersonality = personality[c[0]]
const aPersonality = personality[a]
if(a === c[0] || fPersonality.stat === aPersonality.stat || fPersonality.m === aPersonality.m) return determinePersonality(c)
return [c[0],a]
}else if(!c[0]){
return determinePersonality([a])
}else return c
}```
possiblePersonality = array of possible personality names
personality = object of all personalities and their stat boost and stat name
Im looking for code review and im also wondering if recursion is okay to use for this situation
I know you dont need recursion but I used recursion because it made it simpler
Mostly want to know about performance
How do i return json?
Return json;

i donated my crystal ball to covid workers so i can't really read your mind
i'm pretty sure you have to use " in json
but the pic just above returns undefined
in json file
in javascript you don't really
are you sure
pytoon
jesus christ
JESUS CHRIST IDIOT
calm down
stop acting ooga booga
yea! @earnest phoenix youre suck a fucking idiot for not doing my code for me for free because your're nice
fuck you!
^ issa joke
Its our code
ik :^)
request.post("https://dev.filebin.net", {
headers: {
bin: bin_id,
filename: file_name
},
body: file_data,
}, function (err, res, body) {
var data = JSON.parse(res.body);
console.log({
url: `https://dev.filebin.net/${data.bin.id}`,
bin_id: data.bin.id,
file_size: data.file.bytes,
expires_in: data.bin.expired_at
})
return {
url: `https://dev.filebin.net/${data.bin.id}`,
bin_id: data.bin.id,
file_size: data.file.bytes,
expires_in: data.bin.expired_at
};
})
}
module.exports = {
upload: upload
}
upload("package.json", "{ 'message': 'hey' }").then(info => {
console.log(info)
})``` you see the `console.log({})` after `var data` right?
that one works
but from the .then(info)
print(x[2])
@drifting wedge 0 index is 2
1 index is 0
2 index is 2
I dont belive so.
@solemn latch is there a solution?
oh
x[2] would return "2"
you're returning in a callback
@drifting wedge 0 index is 2
1 index is 0
2 index is 2
@slender thistle oh ye
wait the - counts?
What do i have to use instead?
returning in a callback will not return in the actual function
@surreal sage you need to promisify the callback
wrap the method with promisify
how?
im confused
for example ```js
return new Promise(resolve => {
bla("ok", result => {
resolve(result)
})
})
return new Promise(resolve => {
resolve(
{
url: `https://dev.filebin.net/${data.bin.id}`,
bin_id: data.bin.id,
file_size: data.file.bytes,
expires_in: data.bin.expired_at
}
)
})``` is this correct?
or using what cry linked above: ```js
const post = util.promisify(request.post)
function upload() {
return post("url")
}
hmm
@surreal sage you need to return it on the function level
function upload() {
return new Promise(...) {
request.post(...)
}
}
the entire request has to be done inside the promise
you resolve whatever you want to return
ah
resolve("bla") would return "bla" when you await it or use .then
is there any solution for the flickering issue when the embed is edited? because the images are reloading..
pls help;-;
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', message => {
let msg = message;
if (msg.content === 'yo') {
var random = Math.random();
if (random > .5) {
msg.Channel.Send("hi2");
} else {
msg.Channel.Send("hi1");
}
}
});
client.login('thething');```
ok so
ive gotten errors from this
and i dont know what they mean
uhh ill try to get the error
what are they
its something about Channel.Send
msg.channel not msg.Channel
all variables are
if i have 2020-12-06 17:31:41.482709 if i make this a var and get [2] what would i pull?
properties and methods too
everything is case sensitive
someone help me with the flickering issue ;-; im only editing the description and then sending the embed..
;_;
you can't do anything about it
you're at the mercy of discord
Does someone have a Giveaway Command For JS?
no
make it yourself
But im new to js.
lots of people are new here
...so?
they all get the same answer
being new to anything doesn't stop you from learning more
i.e. nothing stops you from learning math concepts now that you might learn in the future
yeah, i learnt a lot man in the past few weeks
How do you get the bot developer role
i still learn a lot here.
just learned you cant return directly in a callback, not sure how i didnt know that it makes sense.
#502193464054644737 @earnest phoenix
i still learn a lot here.
just learned you cant return directly in a callback, not sure how i didnt know that
@solemn latch i learnt this the hard way xD
node design language go brrrrr every few months
does math.random return only 1,2,3,4,5,6,7,8,9,10 or does it get specific like 4.5352
in which language
yes
does it return one of those or will it do like
it only returns a number
Math.random() returns a random number between 0 and 1
less than 1
.3475687
ok
.3412124151251241
whatever
got it
.02131921312321
how to upload a package to npm
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/filebin.js - Forbidden
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy.```
"dependencies": {
"fs": "0.0.1-security",
"request": "^2.88.2"
},```
isn't fs default?
it's not accepting request..
You shouldn't have fs as a dependency by the way.
Hello!
Can u help me plz?)
Possibly, could you explain your issue
.clientStatus represents their status via what device they're on (https://discord.js.org/#/docs/main/stable/class/Presence?scrollTo=clientStatus)
Do you have gateway intents for the presence data? .author.presence is non-nullable, so I wouldn't be surprised if .status was then returning offline.
yea you need intents with the new changes
I understand, could you tell me how to do this?
Developer portal > click on your bot > click on the Bots tab > scroll down to Privileged Intents > See the option for presence intents. Is that disabled?
Yes)
Now I turn on this. . .
Thz, now it's work ^^
I just go from version 11 to version 12, and test the commands on a new bot.
But. . .
I have another problem. . .
@sudden geyser
How many servers is your bot in?
122
Is your bot verified?
Yes
When you hit 100 servers, you need to apply for the intents during verification, or contacting Discord support.
Hence, they're called privileged intents.
Okey, thz!
hey, ik this is offtopic but theres no offtopic channel here.
When i ping my Ptero Node, it dosent respond. but the main node which controls the panel does respond. i believe that i have something not installed but cant figure out what
Im using the node's FQDN to ping
Other nodes just show up as "offline"
Ok i wanna make a image uploader that can upload images to Image hosters that use ShareX and other alternatives and i don't know where to start
Hey, I have the following problem. I would like to post some stats to another server. This is looking like this:
console.log(data)
fetch("http://url.com/test", {
method: "POST",
body: JSON.stringify(data),
}).then(res => {
console.log("Request complete! response:", res);
})```
The express server should catch the data like this:
```app.post("/test", (req, res) {
console.log(req.body.botID)
}```
But its giving out an 500: Internal server error and an `undefined` at the Express Server. Can someone tell me where the problem here is? (Btw the variables in data are defined, so there is no mistake)
console.log req.body
are you using body parser?
oooh yeah
Just check the webserver log and see which error occurs
How do i make a discord token into a ENV variable on python?
import the os module and use os.getenv(...)
anyone know how to display the amount of servers you bot is in, in your status
How you set the env variable is up to you. You could do it in the command line when calling the interpreter. You could use the python-dotenv package and load a local .env file, etc.
What library are you using Elf.
client.guilds is a list, so just get the length of that with len
alright, thanks!
import the
osmodule and useos.getenv(...)
@sudden geyser wait you use os.getenv()? tutorials i found use os.getenviron()
That's not a function.
You can't use [...] (which is subscript syntax) on a datetime object.
oh that fucking sucks
how would i be able to get like the chars from it?
do i just str it?
What do you mean by get the chars from it? What are you trying to do?
1 sec
2020-12-06 18:50:33.515718 it gives this
i want to like get the month from it
and the day
etc
When i ping my Ptero Node, it dosent respond. but the main node which controls the panel does respond. i believe that i have something not installed but cant figure out what
Im using the node's FQDN to ping
Other nodes just show up as "offline"
Any help? Please its almost midnight and this is the last on my todo list
Nvm
Dns records were wrong
😭
const channel = client.channels.cache.get(player.textChannel);
channel.send("my message")
.delete({ timeout: 5000 });
channel.send(...).delete is not a function
(await channel.send(...)).delete()
or
channel.send().then(m => m.delete())
werent you able to
message.channel.send("my message!").delete({ timeout: 5000 }) ?
not since .send is a promise
aight thanks lads
how do I use expressjs to get a file from a <form> upload
probably with bodyparser
hii, i have some error log from heroku. how to fix it?
@crimson vapor https://github.com/expressjs/multer
since I am only uploading one file named "file" I should use upload.single("file") right
idk, never used this
ok rip
I keep getting null still rip
alright turns out 1. I was logging req.body not req.files 2. it may not like being used at the same time as fileUpload
from what?
like, let's say you have the number 1300 and you need to find the max power 1000 can be elevated to without going higher than 1300
idk how to explain
but like, 1000 ^ 1 is the max it can go and stay below 1300
for 1300000 it'd be 1000 ^ 2
that would just be algebra tho
I'm pretty sure there's a way to do that without for loops
current code:
well
you could have your code solve it like an exponential equation using log
but that would be painful
//startAt = 1000
//forEach = 1000
//value = 1300
int times = 0;
for (long i = startAt; i < value; i *= forEach) {
times++;
}
but I prefer not to use loops
Im waiting to see when my app will be Menched by Luca
my head is becoming steamed hams
yeah ik how you feel
1000^value = 1300
value * log1000(1000) = 1300
iirc thats correct
lemme see
1000 ^ value would be 1000 ^ 1300
umm
ah, nvm
i'd just use a while loop lol
I wouldnt
maybe an hour or two
lemme see if I was correct
I want to make a bot that pings everyone when a video is uploaded on a certain channel
where do i start?
(i have scripting knowledge, i mean like how do i do it)
if message has attachment and attachment is video send @ everyone
yt api is a pain to deal with, but it's free
log is one thing that I never learnt how to use properly lul
i think it has something to do with square roots idk\
nah its inverse of exponents
ok
let's say I have 1.000.000 points, I want to reduce that to 1kk (each k being 1000)
it'll not affect 999, but will turn 1000 into 1k
and for each 1000 ^ x onwards
so you have X and you want to reduce it to K^Y
lul I thought it was a br thing
but only whole numbers?
may i suggest a library
oh
i was going to suggest humanizer
im really confused still tbh
but i'm pretty sure there are ports of humanizer in java
so if you gave 1,300,000 you would want 1.3(k^2)?
humanizer allows you to do things like that, transform hard to read shit into human readable format
yep, basically that
Just calculate /1000 if number > 1000 and use the iteration as number how much K‘s will be behind ur final number
it'd still be a loop no?
Yes until ur result is < 1000 as mentioned
I'm trying to escape the loop way
If so no more calculation /1000
million's alg looks promising
Well an included lib will also use a loop probably
Means it can also be done by yourself
nah my math probably won't work
unless java's math.log takes base as well as value, it wouldn't work
Java's ok
What do you like about it then
Rust also looks cool 😢
never looked at rust
awesome compiler, lot of stuff to research, awesome lib manager, multiplatform, idk what else
also runs pretty much anything you throw at it by using other lang interpreters
c# 
I don't like build tools with Java though.
i don't see why you'd use java over c# in this day and age
Gradle, Maven, Ant. Why not just one 
gradle is maven but readable
maven is gradle but lightweight
@crimson vapor fckin genius
your math is right
all I need to do is floor that value
yes
thx dude, I owe you one
final method became a lot shorter
I'll show the previous one
ugly, and I don't even know what's going on the return
as I said, steamed hams

How do I know which users are in a role?
I was thinking about using a filter
but i don't know how to start
What library are you using
discord.js
You can do that.
oh thx
<Role>.members is a collection of cached guild members that has a role, so there's no need to filter unless you need to do more work.
Under the hood, it does the filtering for you.
Why is my name Piggi
That's a great question
My name is 𝓢𝓲𝓰𝓰𝓲ツ
Your name was most likely not mentionable, so you were assigned one.
It soppose to be Siggi
@earnest phoenix the library has documentation: https://github.com/SinisterRectus/Discordia/wiki
Ask a mod to change it for you then
OMG
Wait
Crazy
I been in this server for so long but I don’t say anything in this server
I ain’t new
I’ve been here
what size should I use for canvas to maintain performance
the smallest possible
lmao
for server-side you can go pretty high, i currently do up to 4000x4000 without issues, and even went up to 8000x8000 before and it would only crash every once in a while
for client-side/browsers tho i wouldnt go higher than 2000x2000
especially if its gonna be animated
is loading a transparent image faster than one that is completely filled?
possibly yes
but you'd need to test it
if you're loading an image from disc into a canvas, the file size of the image will be much more important tho, so it wouldnt really matter
so compressing the image will be a performance boost? Thats good to know
if you mean compressing the file inside a bot then i can say no tbh
as compressing needs processing power (possibly more than manipulating the image)
all static images should be compressed beforehand yes
same with images in websites
nvm i possibly misread sry
i always run all my images through compressors and optimizers before uploading them to my servers
as for compressing them on the fly, Roki is right
the time it takes to compress an image on the fly is bigger than the extra time it takes for the user to download it
i used to run pngquant on my canvas before sending it to discord
made my bot slower despite the images being much smaller in file size
If I create the canvas on an external server then send it back as an image, would that be even faster
compared to what?
doing it in the same server
ok I see
I just see those manual image editors online that finish in seconds
and I thought maybe it would be better
its a good option if you want to take the load off the main server tho
online image editors do it all client side i think
im assuming at least people here have experience with hosting, im trying to find a way to deploy new code to my bot without having to restart the bot, or cause any pause in service, as in it's current state i have to stop the bot, pull the new code from github, then start the bot
currently my only idea is to use a reload command, but that isn't intuitive, may cause issues, and if i need to update index.js or something of the like i still need to restart the bot. i'm using discordjs, and everything is hosted on a vps running debian (its essentially just a debian vm). i'm using screen currently for multiplexing terminals, so the bot runs under a screen session. i've heard of pm2 but i'm not sure if it is capable of what i want to do, so thus i come here seeking support lol
I mean, without jumping through like a billion hoops, You'd still have to restart your bot if you changed core components anyways.
I think your best option is to restart your bot when you have enough patches and fixes built up to consider it a new version
yeah thats what i was considering, just wasnt sure if there was other options
@south sinew i would just keep index.js as small as possible to not really make updates to it so reload command can fully reload stuff
But you can use a database to find out
Database for server votes. How do I do that? Conversation from here: #support message
realistically it most likely wont be touched for a very long time, but index.js would not be the only thing affected... updating node modules, config.json, .env, etc would all require a full restart
i reload my config.json just fine
i dont use .env so i cant say
and for updating node modules there is technically a way to reload it but i dont think its reliable so requires restart yes
do you use dotenv?
updating node modules is the big one, as ytdl-core needs updates somewhat frequently due to youtube constantly changing
@pale vessel yes
meh ytdl-core does not need updates that frequently
there probably is a way to reload it i dont know of :P
you can just use process.env["new"] = "something"; if you can't restart your bot
yeah that would make sense
How would a database for server votes work? #support message
anyone know js can help me make functions for html?
are you talking about something like react/jsx
i am getting error while installing better-sqlite3 can somebody help me ?
ping me if you can help me
how do i get from data from html to flask?
@drifting wedge try this https://flask.palletsprojects.com/en/1.1.x/patterns/jquery/
so i was looking at a ui demo and i wanted to know what kinda font (on google fonts preferably) looks like this
pretty nice font
repl cant install better-sqlite3
or sqlite3
but I think it can for sqlite
something about C++ or something tools cant install
it cant because it takes too long and repl.it kills it
but you can install an older version
i believe better-sqlite3 v6 will work
depends on the version
newest version of quick.db
last time i tested, quick.db also failed
not like using quick.db is a good thing but its good for beginners
my first bot used it and I had more than 5000 rows
is there a format button on visual studio code
.txt
Thanks
every file is a database if you think about it
every file is a database if you're brave enough
better-sqlite3 doesnt work there
why ?
he provided a short explanation above
With html, how can I get data from forms or input into backend?
instead, use a cloud database or use sqlite which is similar to sqlite3
@tired nimbus it will work with quick.db ?
you use quick.db ?
k but i am currently installing sqlite
ok
I think if you upgrade to repl's hacker plan, you will be able to install better-sqlite3
i dont have money 😦 btw if i got 7 $ then i would purchase a vps instead
how can i use that ?
there should be an icon on your left side with a cylinder
it will you show you their "commands" and documentation
this one ?
yes
@tired nimbus did i need to change anthing else ?
i replace const db = require('quick.db')
with const Database = require("@replit/database"); const db = new Database();
yes
thats it ?
I might not ever finish V4 of my bot, at this rate
lemme run my code
@earnest phoenix I was in that server you used to own before you gave it to Cedar
If I am thinking of the right server
Gotcha
now i got my pc repaired
cedar will run it
Gotcha
cause cedar put alot of effort to make website and purchased domain and a vps
lol
lol
I think I'm going to (eventually) take a shot at my own
I don't expect to be popular lol
My bot is only at 96 servers
And I just transferred ownership of my more popular server, which only had slightly over 100 users
Popularity does not come to me
sure
How do I get a list of permissions, a bot have in a server?
client.member.permissions.has('CONNECT') if I'm not wrong. Check the docs for the property
Hey guys. Just wondering why does the image reload when I'm only editing the description of the embed?
I wanted the, member.permissions.toArray(), thx anyways
If it's a collection. You can use Array.from(collection) @rocky hearth
It'll give you an array from the map
nah, its not - see the method name toArray()
Okays
Hey guys. Just wondering why does the image reload when I'm only editing the description of the embed?
I think this is becoz the entire message/embed has to re-render for any edits
Is there nothing I can do about it tho?
naa, definitely not
using a jpg image with low dpi might help you to load it faster
Im thinking of converting my bot to sql since its growing pretty big and its still using json, what db do you guys recommend? Im looking towards the types that I can connect to so I would prefer not to use something like sqlite.
most people i know prefer postgresql
postgresql
i use what is basically postgresql
do not use mysql
y not mongodb?
they wanted sql
Yeah ive been looking into postgresql for a while now and i was thinking of trying it out
Yeah I tried out mongo and wasnt sure how i felt about it
if (condition) return clearInterval(interval)
// Exec 1;
// wait for some time
// exe 2
}, 2000)```
ideally i want this to happen, but the embed is waiting for the whole process to complete before "updating" everything at once
i wanna alternate 2 executions between intervals
@crystal wigeon use async await
with the embed edit ?
I want the guild icon. If there is no icon, i want the default one? How do I do that?
Something like what member.displayAvatarURL() provides
guild.iconURL()
but that also returns null value
I want the image to be shown on thumbnail
so I need to create an image with that acronym. Is that only thing I can do?
yes
can setinterval take an async func?
@crystal wigeon https://stackoverflow.com/questions/52184291/async-await-with-setinterval
instead of setInterval, for await of is something you may want to search about
that's a weird example
lmao
i figured it out btw, i had to use async await thanks @rocky hearth
now my only issue is the flickering part TwT, all my images are jpg ;-;
how frequently are you updating ur embed?
pretty much every 2 secs
O_O
its a battle thingy
U shouldn't do that
enemy attacks then player attacks
That will not even work for some users, if they hv slow connection
After sent, check if there is a image in the embed
If not attempt to edit it again
To add the image back
but pay attention to rate limits
got it, similarly is there a way where if the image already exists edit only the description or something to prevent it from reloading every time it edits?
in what cases guild.owner will be null?
if the guild owner member is not cached, such as for big guilds, or if you did not fetch the members of the server (with or without intent)
Alright boys puzzle time
client.shard.broadcastEval(`this.guilds.cache.get('${r.id}')`).then(g => {
console.log(g.id)
console.log(g)
guilds = `${g.name}`
console.log(guilds)
}).catch((err) => console.log(err))```
Log of g => guild info
Log of g.name => undefined
Log of g.id => undefined
O_o, u must be lying lol.
Is that an error or a line of program?
What?
show output of log g
what is g
@blissful coral can u send the terminal stuff? is it actually an object or like a map
well it should be a collection/array iirc
yea thats what i thought
ah yea
array
This is on my test bot
um
Main bot has multiple
Ah
what about client.shard.fetchClientValues
also array
Fuckkk
Get a guild and I have to get guild info for certain stuff
Public lfp system thing
Cross-server
Not a way to get it as a object?
@blissful coral it returns [shard 1 output, shard 2 output]
the outputs would be the objects
filter out undefineds and just get [0]
like data.filter(x => x)[0];
client.shard.broadcastEval(`stuff`).then(gs => gs.filter(g => g)[0]).then(g => { console.log(g); console.log(g.id); console.log(g.name); }); @blissful coral this maybe?
what bout us 
xD
well if you're only getting 1 guild
then there will only be 1 guild
and get is faster
i mean
find iterates
you can only get 1 server with one id
across all shards
i mean there are no duplicates
@pale vessel find converts the collection to array then uses find
ic
but find() should be faster than filter() since it returns the first element that passes the function right when it finds it
find() gets the first element
while filter() removes everything except the filter you put in
yes and filter() needs to iterate the whole collection and return elements that passed the function
let arr = [1, 10, 15]
arr.find(x => x > 9) // 10
arr.filter(x => x > 9) // [10, 15]
ye
If you wanna find a guild then filter is a dumb choice
Since guild ids are unique
Yes
How do I type annotate the keyword this?? in typescript?
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
const client = new Discord.Client({ ws: { fetchAllMembers: true, intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MEMBER_ADD', 'GUILD_MEMBER_REMOVE', 'GUILD_MEMBER_UPDATE', 'GUILD_MESSAGES']}})
???
use new Discord.Intents(['GUILDS', 'GUILD_MEMBERS', 'GUILD_MEMBER_ADD', 'GUILD_MEMBER_REMOVE', 'GUILD_MEMBER_UPDATE', 'GUILD_MESSAGES'])
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
new Discord.Intents(['GUILDS', 'GUILD_MEMBERS', 'GUILD_MEMBER_ADD', 'GUILD_MEMBER_REMOVE', 'GUILD_MEMBER_UPDATE', 'GUILD_MESSAGES'])```
idk if i did it right
revert to your previous code, you only needed to wrap new Discord.Intents() around the array
it either accepts a bitfield or the Intents class
const intents = new Discord.Intents(['GUILDS', 'GUILD_MEMBERS', 'GUILD_MEMBER_ADD', 'GUILD_MEMBER_REMOVE', 'GUILD_MEMBER_UPDATE', 'GUILD_MESSAGES']);
const client = new Discord.Client({ ws: { fetchAllMembers: true, intents}})
@pale sapphire make sure your bot isnt responding to itself
^
if(msg.author.bot) return```
if(<message>.author.bot) return```
hi everyone. does anyone here know a 365 7 24 hosting service which doesnt require a credit card and is also private?
Pls
?
if a bot joins a new server. will the guild.owner already fetched?
We already gave you what to do
I didn't saw
Don't attempt to tell us what to do on your code please
um
Hey
Then scroll up
^
That's ur code
hi everyone. does anyone here know a 365 7 24 hosting service which doesnt require a credit card and is also private?
Not mine
?
Bro
I found it on site
And it makes spam bot
@worthy remnant Not a thing
@rocky hearth depends, if the guild is big, the owner might not be cached
:(
make a if statement for bots
if it is a bot don't message
your bot responds to any message with a word
you can simply fetch the owner if it's not cached anyway
which is api spam
No it only spam when i write hi
Then add the filter we said TO ADD
Say again
yeah
@pale sapphire if you are going to blame others for your own failures and not be willing to legit scroll up, stop asking for help. Simply scroll up and fully read the variety of solutions to your bot replying to itself
Scroll up or leave
yes
yes unless you tell it not to
because it looks like a normal message to the bot like any other message
As we have literally said is exactly what has been happening to you, ys
@pale sapphire go delete your bot then
Yea i did
??
we don't give a fuck that you dunno how to read

don't make a new one too
don't make a new one too
@rocky hearth i will make
Stop coding, legit advice
Well I hope it will never be popular
dont make a new one, bcoz that will also starts to spam
@zinc fable mute time?
Are we being trolled
idek
dont make a new one, bcoz that will also starts to spam
@rocky hearth i can try
Or is there any rule of not trying
Are we being trolled
@waxen tinsel no no
It's legit issue
😂
Alright can we chill out now
@pale sapphire we only told you why the fuck it is spamming and you were like "No it's your fault"
Nope
Just make sure to listen to others trying to help and youll be fine
I didn't say it's your fault
I give up
I'm curious on how you forgot the

