#development
1 messages · Page 1495 of 1
why even chain that promise?
i assume your command handler is type void @halcyon kite
actually, i just noticed, there ISNT a command handler
still, why return it?
just await the message and run the rest of the code
Hey
Where do I find that?
https://top.gg/bot/id/webhooks
uh, sorry, it didn't work. I've asked on another server
@coral trellis do you plan on adding more to the shirogg api?
Yeah
I am open to suggestions
Uhh
I recommend don't do anything other apis already have
Cuz it's a waste of time really
I mean what I am doing is just making a safer api for people to use
Maybe do a rank card maker
Mhm
Like don't do same stuff as ksoft or dank memer I think
Mhm
Like u put info
And it returns the card
Hmm maybe
It's unique basically
Yeah
Loggers
Uh... maybe make a Twitter fake message thing
Or a pfp thing like the wallpaper one u have
@coral trellis
Yeah
oh that sounds like a homework problem
how to i setting a voting system like someone voted my bot then my boy sending a message in the dm "Thanks for vote me!"
Hi I'm currently working with this code for my website homepage
https://hatebin.com/qdjlpbduhl
But when I tried to put in my menu
https://hatebin.com/uqwjrgjpgt
It doesn't work and just makes the text on the screen go away can anyone help
What more features should i add to bot? Any suggestions?
what's your bot
Moderation
do tempban
just get snipe command
what it do?
so when someone deletes a message
you could just to (prefix)snipe
and then they can see what message they deleted
isnt it a privacy issue?
well.
it depends
it just depends on how you are able to retrive them.
There's an api that allows you to make that, look up petpet
👍
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.5.0/canvas-v2.5.0-node-v83-win32-unknown-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.5.0 and node@14.15.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)``` why this err? While installing npm canvas package
message.channel.messages.fetch() is there something like this forf the entire guild
Can you recommend a free host (except heroku) for my bot?
there are none to recomend. if you have a credit card, look into the 1 free year Google and AWS offer
):
help me too bruh
there's discloud.com... i had host my bot but has a problem with ytdl-core
reinstall all node packages and try again
> canvas@2.6.1 install E:\OneNaut\node_modules\canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download```
its normal with free hosters, bcs music bots take a lot of resources
delete the entire node_modules folder and install again, also did you have Build Tools installed?
okkk
did you got it sorted out?
Its asking to download additional Dependencies
Building the node-canvas module requires:
A global installation of node-gyp.
GTK 2
For optional JPEG support (node-canvas 2.0 and later): libjpeg-turbo
yea it requires Build tools did you have them installed?
fuck canvas
that shit slow as hell
more leaning towards learning rust and doing image manipulation/generation myself
How can i generate a random color
js?
Referring to embeds or just random hex color?
If just random hex, https://css-tricks.com/snippets/javascript/random-hex-color/
hey i have some questions:
Hey guys
I wanna get image sent by user
But it has to be - must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number},
Hello !
you can grab attached images by users or URLs
this bat file is making the bot run 24/7, but i realised i want to use pm2 instead. How would i stop the bat file?
like should i just remove it?
from the file
let color= '#'+Math.floor(Math.random()*16777215).toString(16);
```as example
how can i
collect the message or fetch it. its an property
message.attachments
quick question: what is your goal?
Do you want to autorestart it when you stop it?
Thanks
i just want to stop it, and then run it again
But now I need to figure out How i get the URL
as it was running against some issues.
so i thought a quick restart should be good as it is running for months nonstop.
bruh
use pause then before the GOTO BOT and after the timeout
This should wait for a key press
after the keypress, it should start it again
i am on ubuntu vps.
@delicate shore
module.exports = async message => {
if (message.attachments.size > 0) {
message.attachments.forEach(Attachment => {
console.log(`Attachment sent by ${message.author.tag} >> Url: ${Attachment.url}`)
})
} else {
console.log(`\nCHATLOGS - [${message.guild}] ${message.author.tag}: ${message.content}`);
}
};
This is from StackOverFlow
would that be able to handle the bat file?
Oh Ok
Thanks
linux doesnt support bat files lol
A vps can't handle a bat file, you'd need to make 2 seperate versions of that
a sh file and your current one
if you're working with deploying your bot onto your vps through sftp/ftp for example
You can start the sh on your vps then
Your bat cannot be run on a linux vps
could you tell me the commands to start/stop the sh file?
Can't really help you with that
how to do as soon as a command is executed (example:! commands) the command message is deleted and it executes the command?
nvm i got it it would be: sudo sh start-CoordsBot.sh
you can also use ./start-CoordsBot.sh to make it easier
first need to give it permissions to actually stop/start the process.
wtf
after running my command.
client.on('message', msg => {
if (msg.content === '! commands') {
msg.delete();
// Your other things. Make sure to catch msg.delete
// incase your bot does not have manage messages
// permissions
}!');
});
What's inside your file right now?
thanks
also, just pasting your bat's content inside it doesn't work
linux shell scripts and windows batch files are two completely different languages
exactly
hi
does anyone here know how to use guilds.join
i tried using it
but
i have no idea how to
lmao
let me show you the things i have
the folder.
the sh:
@staticmethod
def user_join(access_token):
url = Oauth.discord_api_url + "/guilds/768019392596017164/members/446670262440820746"
headers = {
"Authorization": "Bearer {}" .format(access_token)
}
user_object = requests.get(url = url, headers = headers)
user_json = user_object.json()
return user_json
i thought a function like this
would work
and i would be able to join the user to a server
but it doesnt work
im really dumb plz help me aa
@rustic nova
make sure you're in the same directory as the sh file
const logs = db.get(`${user.id}_modlogs`);
var string = ""
for(i in logs){
var string2 = `**Case ${logs[i].casenumber}**\n**Type:**${logs[i].type}`
string.concat(string2)
console.log(string)
console.log(logs[0].casenumber)
}```
and logs is something like
```{
casenumber: 4,
userid: '789380389687918622',
usertag: 'Jet#7073',
reasons: 'bad',
moderator: 'Sahhas#0003',
date: 1609671262454,
type: 'Warn'
}```
also, you do not have a stop-coordsbot file
i am
can someone help me withthat?
why not?
can anyone helpp
Yeah you do not have a file called stop-CoordsBot.sh
that is not how these files work
owh.
(node:7766) UnhandledPromiseRejectionWarning: Error: pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was Image```
Dude, just use pm2. You don't only get a more reliable process manager but you can also monitor your bot's resource usage online.
How can I change image into one of this thing
i would love that but i first need to stop the sh file from running the bot.
otherwise i have 2 instances running the bot.
could i just stop the process by simply removing the sh file?
Did you make the sh file run on startup?
yeah probably as it is running 24/7 nonstop
i already
asked my question..
but no one responded
try deleting the files and restarting your vps
okay.
cant you just do htop or something similar and kill the second process?
yo does anyone know anything about the guilds.join scope here?
maybe?
Never really worked with sh files.
this was just done by a friend of me that moved out.
i want to use pm2
so i could delete the sh files right?
and that would terminate the process?
you should 100% use pm2 dude
Yeah I know. But deleting the sh files would terminate the process?
So i can use pm2.
i dont think they would
sh files are just scripts
aka its like someone running node index.js from a terminal
killing the terminal doesnt kill the process
hmm okay.
you need a process explorer and send a SIGKILL
htop can do it, but idk if you have it
also check this
I can install it?
um just deleting the files and restarting your vps should do it
you need to see what stuff you got running there
what distro, what version, what are the compatible packages
but wouldn't restarting stop and terminate other processes?
of course
i have many bots running on my vps.
restarting would kill all of them
sheesh lets not do that
well you have to stop them anyway in order to transition to pm2
probably best to get np2 ready to be deployed BEFORE killing all ur bots
using canvas
But my module asks me for a - Error: pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was Image
How can I transfer one to any of these
show code
show bebs
show vegana
u first
ok
uhh
if(msg.attachments.size > 0){
msg.attachments.forEach(async(Attachment) => {
let lol = await canvas.loadImage(Attachment.url)
model.classify(lol).then(function (predictions) {
console.log('Predictions: ', predictions)
})
})
}```
Here
i told you what to do
what is model.classify?
It's an module to check for nsfw
whats its name on npm?
you likely need to create the canvas
canvas = new Canvas()
context = canvas.getContext("2d")
context.drawImage(Image)
data = canvas.getImageData()
But I need to make it into a web page??
no, node-canvas supports all of that
but if all you're doing is feeding the image to tensorflow, try giving it a buffer directly
Ok
model.cassify(await fetch(Attachment.url).then(data => data.Buffer()))
or however fetch works
Oh alright
I know uh I asked this before but I can’t remember
This footer which line should I add it so I can use it?
So like
const {Canvas} = require('canvas')
const { data } = require('@tensorflow/tfjs')
const Client = new Discord.Client()
canvas = new Canvas()
context = canvas.getContext("2d")
@delicate shore do u know html or css
Kind of
Anyone help me..
below the "inline" i think
"inline": true,
"footer": "yourtext"
not sure though lol
wait lemme check docs
Lemme try
@delicate shore can u give the code for a registresion and login page and then goes to a blank page?
message.channel.send('Please supply the channels that Talky can access to.');
const filter = msg => msg.member.id == message.member.id;
const collected = await message.channel.awaitMessages(filter, { max: 1, errors: ['time'] })
const result = collected.first().content;
// IT STOP FUCKING HERE, I DUNNO WHY <-----------------------
const ids = await require('../../tools/string/mentions')(result.split(" ").split(",").split("-"))
if(!ids) return message.channel.send("Bruh");
for (let id of ids) {
console.log(id)
const channel = message.guild.channels.cache.get(id);
if (!channel) return message.channel.send("There are some channel that I can't access, please look again.");
if (!channel.permissionsFor(message.guild.me).has("SEND_MESSAGES")) {
return require("../../tools/embeds/missingPerms")(`I don't have permission to send messages in a channel has name ${channel.name}`)
}
guildCache.channel.push({ _id: id });
}
Why my code stop for no reason
Time to add debug lines 
add a few lines to see where exactly it stopped
O/
you dont get the context in node.js
@rustic nova i did
that wont go well
oh
it stop at the line that i made comment
Read over the docs then, as i don't 100% know js nor discordjs https://discord.js.org/#/docs/main/stable/class/MessageEmbed
How to get buffer of image sent by user
Your await is not working then, the const ids
Which topic is it? @rustic nova
make sure the file is there
fetch the attachment url
hm?
hmm let me see
Why not follow the discord.js guide it has a embed section
https://discordjs.guide/popular-topics/embeds.html#using-an-embed-object
Maybe this will help you
Someone help I cannot understand it’s showing no error and not working I
In the same time

it quite literally tells you what and where the error is
Don’t see it where?
look at the big dark blue box
I don’t really see any errors
lol
Just tell me..
@earnest phoenix where’s the error?
I am looking I can’t see it
It’s red if it’s an error...
seems like a you problem
lmfao
yikes
Can you just tell me the problem?
no
:/
learn the difference between syntax errors and runtime errors
I came here for help not a fight
what
Just tell me where the error is
in the big dark blue box
I repeat I can’t see the problem

and i repeat this
an error doesn't have to be exclusively a syntax error and underlined in red
Ok
Why are you acting so hard? Just tell the damn problem
oh, you using djs?
dee jay ass
ye , no other choice so yea
no other good js lib for Discord
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=attachments
grab the first attachment that's an image out of this (since it's a collection)
then you can use node-fetch and fetch the url property of the attachment (https://discord.js.org/#/docs/main/stable/class/MessageAttachment?scrollTo=url)
check out how to get the buffer out of a request here: https://www.npmjs.com/package/node-fetch#buffer
kk thanks
this
I CANNOT FIND THE ISSUE PLEASE
look at top of dark box
yes
@summer torrent it shows no error that’s why I’m confused
cmon this should be obvious
Yes lol but not a capital F
just remove the .footer call from the json
and add a footer property
how can i get total user from all server that my bot in?
.setfooter("nejsjsjs")
but add it outside of fields @earnest phoenix
Ok
except you can't call setfooter because you're passing a raw object
like on the same level where you defined the title
client.users.cache.size
```?
message.reply is ugly
if you want to create an embed look at its
k
Only works if you cache all members
Till not working
hmm
Well no shit
is there any other way then
Wait till djs v13
Alright you shouldnt be a developer
:v
why not using messageembed from discord.js
how to create your self role?
Read it for the love pf god
cuz its shit
dont use that garbage
hmmmm
Check for reaction adding
you copie me
You can combine all your guild's memberCount client.guilds.cache.reduce((x, y) => x + y.memberCount, 0);
Indeed
BRUH
welp
from 15ms to 250ms using messageembed
thanks for letting me know :V
Pffft
let members = 0;
client.guilds.cache.forEach(v => members = members + v.memberCount)
Best code 2020
alright it worked thankss
thank god you used that code
but dunno if its accurate
@opal plank hey you like typescript right
ok why tf does it turn my async await code to this bullshit
They're not unique as 2 guilds could have same 1 member but it's accurate for counting member count across all guilds
pick your target to es6+ where async is natively supported
your async looks fucked cuz ts is LEGIT ADDING async to your code since its not supported

@earnest phoenix do this then
tsc --target "ES6"
im assuming its not picking up your tsconfig automatically
@earnest phoenix since theres no response i assume it worked fine?
not tested yet
did it on a local vsc project on mah pc
me on phone rn
and imma head out play minecrafr
@pulsar bone yes?
@opal plank
what are you even trying to do?
try:
statement
except discord.errors.{unknow message error keyword that I don't know}:
bold of you to assume i know py enough to give advice on it, specially since we were talking about ts/js above
..
i still cant understand why people dont use dynamic generated Help commands, they are set and forget, you make them once and have to never touch them again.
@earnest phoenix what does the first paragraph on discordjs.guide say
because they don't know how to and most of their code is copypasted
learn javascript before trying to make a bot
what being bold have to do with it
i just randomly asked just like everyone else is asking you were helping in above message so i pinged you
then why u pinged me if you didnt know i know python?
because erwin is proficient in js/ts, you started being passive aggressive when erwin said that's python lol
It isn’t smy
what being bold have to do with it
i just randomly asked just like everyone else is asking you were helping in above message so i pinged you
@opal plank u could literally ignore them if you're unable to help...
correct, which is what i was doing, since i dont know python, until i got pinged, them im forced to join the chat
correct 👍
me and the bois mobile push notifications: off
me and the bois desktop
me and the bois desktop client is useless
that's... not how that works
"it's your fault for being murdered, you were standing right in front of the murderer!!"
its still on chanenl topic to not ping random users for just being impatient
i ignore every single ping from creators hub im only there for giveaways
regardless of all that
well you're free to ignore whomever you want, i got pinged, i answered, end of story
when in doubt
ping tim just ping tim
moment
the fact that it doesnt exist on channel?
how to get channel's slowmode then?
say what now?
is that not what i did
you need to cast it to TextChannel
oh, lets see
oh yeah, it sure does
interesting
now why the heck is it not auto detecting its a TextChannel
cuz it should
ye i agree
djs's typings are fucked up
there's a lot of ambiguous stuff, and stuff where they cant make sure what type is supposed to be
I have a problem in the console but I can't see what it could be, can you help me?
miMIMiMI NU ERwiN ThaNK YoU BuT We DOnT NEEd TyPinGs TS usErs KnoW WhAT ThEY ArE DOInG
if (!user.roles.cache.find(`name`, "Muted")) return message.channel.send(new Discord.MessageEmbed().setColor("BLUE").setTitle('Kişi Mutelenmemiş.')) how do i switch this to V12
that calls the question tho, how would you make typings for something ambiguous?
how you would make the typings dectect which class is it?
wdym?
ts works by merging same names
if the class is called TextChannel, so is the typing
its just a matter of copying the code over and changing usable code for types, thats it
yes but lets say you have this in js:
if(a) {
message.channel = new TextChannel()
} else {
message.channel = new DMChannel()
}
unless its shit in c or c++, then you kinda fucked
how would you make typings for that?
message.channel : TextChannel | DmChannel
thats not what i meant though
I didn't understand
its not about your problem
@quartz kindle this is what i mean
ok
that scared me
your issue is that you have somewhere an async function erroring out without any catch block
then when i call it on another file, since it generated from this listener, it should keep the type
but thats ts, not js
correct
how would you type that in js
js you wouldnt even check for this
i dont even think you would be able to do it in js too well
ok but i don't say where
aka, how would you fix the fact that djs cant autodetect types
i guess you can declare jsdocs on it
its possible that you request somewhere something after the ready event that causes this
thats the thing tim
you want types in js
types in js are jsdocs, there ARE no types in js
you need ts to add types
well, you started complaining about djs's types
ok thank
which is TS
djs is not ts
djs is a js lib
with ts types
there isnt ts libs
how would you fix it?
its all compiled to js
well yeah, but it needs to be compiled later on
so how would you fix djs?
how would you fix djs typings to autodetect the channel type?
without having to rewrite the code in ts?
im fairly certain its nothing related to djs tim
its likely ts
ts is type checking on index
still, how would you fix it?
in my code?
in djs's typings
you cant, you need to check it yourself
you complained that djs cant autodetect channel types
typeof doesnt work with ts
so im asking, how would you fix that?
in djs? i cant think of a good way
in my code? i can think of
actually
actually
idk if i can do this, probably not
but lets see
oooh
actually
i think there is
one second
yup
you can
@quartz kindle
this was my guetto idea
aparently it works
this is the better typeof
if i were to assume this is probably being transpiled into a Object.hasOwnProperty() looped on every key of the object to be checked and the checkee' and seeing if they are the same, ontop of typeof to check the types
lmao
@opal plank thats not what im talking about tho, but ok
The instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object. The return value is a boolean value.
im taking about changing .d.ts in a way that it autodetects the channel type
likely using <T> shenanigans
Tim doesn't djs just extend a base channel class?
yes
hmm my bad, i thought it was ts
hmmm im not sure if you could use an observable here
maybe
so are you using the base channel class? or are you doing something else
for those out of the loop,
they were trying to use channel.rateLimitPerUser, which is a property of TextChannel, and ts was complaining that the property doesnt exist, because it gives message.channel a union type, not the specific channel type, so the user needs to typecast the channel themselves to be able to access the property.
my question is if there is a way to create typings in .d.ts that can successfully detect a channel type instead of using Unions, so the user does not need to typecast
I don't think there's a way
assuming they are just using it, they could do something like ratelimit = Channel.rateLimitPerUser ? Channel.rateLimitPerUser : 0
|| 
true
?? is null operator?
nullish coallescensing?
yes
something along those lines
but it wouldn't be null, only undefined right
it checks if a valua is nullable, if its is, it passes the right value
null and undefined
oh
rather than
if(!thing) thing = something;
you do thing ?? something
if thing alreayd has a value, send thing
else, send something
now if only es6 had null coalescing assignment var ??= var2 if var is null
declaring is bad
let foo;
foo ?? bar
that should work
it might screech at declaration though
cuz its doesnt have a declared value
null coalescing returns a boolean
js might be able to pass that by
you would have to foo ?? (foo = bar)
exactly
yeah but this works
well yeah
it's just syntax sugar
i should really go sleep
its 11AM and i havent slept at all
my braincells are fried
yes go sleep
excuse me but i cant remember the commands that delete the command after it is executed
if you use js call .delete() on the message object
thank
does anyone know what this means ? https://hastebin.com/otixacijec.swift
This looks like the error: js The system cannot find the path specified. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\Jozef\Desktop\Xpl_Top.GG_Bot\Xpl Top.GG Bot\node_modules\vultrex.db\node_module s\sqlite3\build\deps\action_before_build.vcxproj]
At the same time it's not descriptive.
what it was, there was somthing in the package which requires it and it wasnt installing it
how to do as soon as the bot arrives on a new server it puts an automatic message?
What library are you using
library ? application ?
Discord.js, Discord.py, JDA, etc.
discord.js
Listen for the guildCreate event
Can anyone help me with this codepython async def status_task(bot): while True: await bot.change_presence(activity=discord.Game(name=f"servers: {len(bot.guilds)}")) await asyncio.sleep(5).change_presence(activity=discord.Streaming(name="Type !help in Chat!", url="")) await asyncio.sleep(5)
Can you tell us what's wrong with it?
I'm sure asyncio.sleep doesn't return a Bot instance, so doing asyncio.sleep(N).change_presence(...) is wrong.
It worked before
Doubt.
what is it supposed to do
It think there is something missing :/
hmmmmm
and if you really want to do something on an interval you should be using timers the library already provides.
A presence code
ahh ok
What the
Python 3.8
sadly i dont code on python nor know stuff about python
so e
goodbye
Object has no Attribute
Z1 may want to fix that spacing
Just the error is fine
change_presence
Im on Buddy
/data/user/0/ru.iiec.pydroid3/files/temp_iiec_codefile.py:22: RuntimeWarning: coroutine 'sleep' was never awaited
await asyncio.sleep(5).change_presence(activity=discord.Streaming(name="Type !help in Chat!", url="/yoschi_der_allerfalsche"))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Task exception was never retrieved
future: <Task finished name='Task-97' coro=<status_task() done, defined at /data/user/0/ru.iiec.pydroid3/files/temp_iiec_codefile.py:19> exception=AttributeError("'coroutine' object has no attribute 'change_presence'")>
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/temp_iiec_codefile.py", line 22, in status_task
await asyncio.sleep(5).change_presence(activity=discord.Streaming(name="Type !help in Chat!", url=""))
AttributeError: 'coroutine' object has no attribute 'change_presence'
Idk lol
How can I remove an element from a Set by value?
sleep returns coroutine, which makes sense that it doesn't have change_presence attribute
Ok
js or py?
:/ damn i feel hopeless bc i never got that error
yes, JS (I hate Python)
That doesn't make sense unless you deleted some parts of code by mistake
hmmmmm yes python is sad
h
Not this bullshit again lmfaooo
hmmmmmmm we can get into an argument but i chill
Always gotta have someone hating indentation
ok cool i just like JS better

Lets not start another discussion 
ok
Maybe
hmmm
agree
I want to say "python is depressing 😨 ". But I'll not, because I don't want to start a war.
no i dont but i dont wana get into an argument
sadly the war has already started but we can end it lol
Imay get a solution imma try it out
ok
The solution is to learn python kekw
hmmmmmmmmmmmmmmmmmmmmmmmmm true i guess
I would disagree about that dpy part
but still in my opinion js is better and u cant change it lol
Ive seen some interesting people not knowing the definition of the basic data types trying to make mee6 clones
Python is not best language for beginners. It won't let you understand the core principles of a programming language.
Lie
It is
Ah yea not the dashboard buts its core functions
He tells me that "$ {mentions}" is not defined, what is my fault?
Python:
if x is True:
JavaScript:
if(x === true){}
hmmmmmt thats debatable tho
or if x to be implicit kekw
dude
That is highly biased
lol
Ye in theory
Just wanted to prove a point
make it select a user of ur choice
But explicit is better than implicit so
Haha
u have to define it like let mentions = ...
import this moment
Bru
im gonna pretend i didnt see that
let works too
lol
dude, you shouldnt argue about something you dont know about
Wha-
Big oof, what you don’t use doesn’t have to be wrong
name isn't mention 
but you talking about js
it's a for author and no for mention , no?
lol
u did
^
What
What are you on, Z1
message.mentions.members.first() to mention a user in a guild u are in
Good
so e
what exactly do you need?
and if u want it to not show an error when u dont use it i suggest puttin this: || message.author;
this and
and if u want it to not show an error when u dont use it i suggest puttin this: || message.author;
arent the same
members.first() returns a member or undefined
author is a user
completely different things
dont use different things in your code
I don't know how to tell you
message.mentions.users.first() || message.author
message.mentions.members.first()?.user || message.author
message.mentions.members.first() || message.member
all those are valid, but the ones you suggested arent @halcyon kite
try to explain as best as you can
yes ik but it makes it to where u dont have to mention urself and it wont say undefined, it still works.
wrong
member isnt the same as user
if you set that to a vairable, that variable now can be a member or a user
and they dont overlap
Hey how can i get a server invite link with the bot?
example: !serverlink message.channel.send(`message.guild.<invitelink>`)
they are completely different things
a member is a member, part of guild
a user is a user
all 3 examples i sent above are valid
Can we ask the mods to create distinct channels for js-development and py-development. To get everything organised and sorted.
yes but it still works.
Nah
hmmmmmmmmmmm
true
wdym still works? adding 50 event emitters to your code also works, doesnt excuse it being shit code
Please help, how can i get a server invite link with the bot?
example: !serverlink message.channel.send(`message.guild.<invitelink>`)
true
a mentions after a command to display the avatar and user ID afterwards
It's unclear
so like !avatar @terse swallow ?
no user info
.-. help please?
example : /user-info @terse swallow
do you have a prefix already?
yes
do you have a command handler?
i assume you dont know what that is
do you have any working commands?
Where are all the commands marked?
Please help, how can i get a server invite link with the bot?
example: !serverlink message.channel.send(`message.guild.<invitelink>`)
i saw it, i'll answer as soon as i finish helping juke
okay thanks
actually urs is easy
<guild>.fetchInvites()
its a promise, so either await it or chain it
its the invite link of the server?
@terse swallow okay so you using content, its all good
yes
do a let user = msg.mentions.users.first() || msg.author
now replace msg.author on the embed with user
yes but else is in problems
ok
ok
thats it, it should work just fine
just send that
msg.send(helpuserinfo)
also
move this to the top of your code
dont require discord multiple times
it's just below
that shouldnt affect the code though
just performance
now restart the bot and try the command
yes i say but is copie coller
if you @ someone it should get their avatar and id
also
remember that you got a typoe on your command
typo*
Its not working for me
the command you need to use is /help user(info @thick lake
show code
yes i say i corrige this
then its fine, give it a try
holy shit, this is getting quite big quite quickly
14k presences parsed per minute
thats for me?
oh i see
let user = msg.mentions.users.first() || msg.author
^[it's no defined ]
@opal plank Thanks working!
np dude
yes i change
here it is and excuse me but I am French so quite difficult to understand
no problem
so, i make it easy
i understand a bit of french
so i can understand some words if you are confused
omelette au fromage
ok thank
in canada i learned a bit of french
let user = msg.mentions.users.first() || msg.author
mets ca lá dedans
au desssus de ca
compris?
yes
aight
remplacer ceci
avec user
jesus christ, i should go to google translate
i dont remember almost anything from french
how bad was that french? xD
spoken french is alright, but written french is hell
specially bcause we know portuguese, ti helps a lot with pronunciation and similarity
0 you speak very good french
makes english look like a walk by the park
xD
ty
nono
It's the truth
i didnt both
i mean them separated
spoken portuguese has some quirks that helps with french
meanwhile my native language is slovenian, where everything is literally pronounced the way you write it (except for the letter J for some reason)
same for written, apart from the crap ton of ç à è an shit sprinkled around, the roots are from latin, which is similar
same for spanish
kinda
I can confirm that French is the most difficult language in the world
how to you write the word "design" in spanish?
i disagree, portuguses and mandarin are worse
diseño
cantonese is probably the bitchiest of the languages
i'm afk 10 minute , escuse
okie
aight

but i can kinda see the connections
its a literal transcription of the way it sounds like in english
why did i read it as broken english
the good thing abuot portuguese is that its almost a 1 to 1 translation
the structure is so similar that you can translate the words individually and make a readable sentence
we getting carried away a bit in here lol, its dev chat
imma go code more, and drink more, of course

dude, 55 servers in 2 days
jesus christ
sounds epic
wait a few more days, then i'll send you this c++ lib with 90 functions for you to type/doc for me :^)
at first i put everything in a single cpp file, was over 3.5k lines long
barely ever touched cpp, its going to be a new thing
now im slowly splitting it into 90 files, one per function
ye
well, like i said, as long as you got js i can make docs
i know its cpp, but i need some sort of js base to work from
i cant interpret cpp code
i need to change a few funcs
remember what i talked about before? some funcs return arrays with attaches props lmao
yeah i'll need to have a look at that
but like i said, as long as its js i should be able to pull it off without much effort
its just repetitive
an object with a data prop for the array






