#development
1 messages ยท Page 1141 of 1
Defining stuff looks like this
let args = "something";
the user's message
@solemn latch can I ask?
I'm not at my desk, so I can't really help with anything too complex
i read all of it.
I'm not at my desk, so I can't really help with anything too complex
No u can help I guess it just a question
Mky
Look u know file handler?
Yeah
Ok
I did 3 code in same file with prefixnews
Can I put message.channel.send(embed1, embed2,ebmbed3)?
hey there - i'd like some help on working out the oauth2 spec for my app. i'm following https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ to implement it to allow my users to log in, which seems to work fine. however it specifies the following:
Client Authentication (required)
The client needs to authenticate themselves for this request. Typically the service will allow either additional request parameters client_id and client_secret, or accept the client ID and secret in the HTTP Basic auth header.
now, i only have a user's email and password, would i be able to replace the secret and id with those or do i have to use those? in such case, how would i get access the user's secret and if i only have their email and password, with no access token
all help is appreciated, thank you
You can only send one embed per message
So how to make them 1 by1
Did you define args?
omfg idk
Defining things is the most basic part of javascript.
its not my fault im dumb.
Its stuff you learn about the first hour of programming
?
It's all about assigning values to variables
what
these guides dont help
ughh
And it gives a handful of resources for learning
All of them
Goodnight guys. Hope you endure the #development
I wont
F
Gn
its gonnna take too longgggiggggg
Have fun
Programming and development is mostly learning
im too lazy and its probably boring af
I've been programming on and off for years and I spend a large portion of my development time learning
and im gonna forget what i learnt in the next hour or so
If anything, its primarily reading
Lmfao wtf did you think youโll magically start making a bot without needing to know even a little bit of programming
research, learning, reading, looking for libs
no
I mean that's pretty much everyone that comes asking for help here
nah i just wanted to create a cool bot
and i thought it would be easier
didnt think it was gonna be this hard
but still im gonna forget everyting i learned in a hour or more
Bots are not really a first project kind of thing
Was for me 
is ther something wrong
colour = discord.colour=blue.()
)```
its giving me an error
What's the error
colour = discord.colour=blue.()
^
SyntaxError: invalid syntax
ohok
I never knew why I didn't like python, now I know its because the way python spells color
I like python
it should show like this but it didn't
one min
put it in a div and set max-width for the div
i did
position is irrelevant
oh
you did not xeinostorm, otherwise it would widen out
ok
uhh it got deleted
i did like that
but when i added it to top.gg
it didnt show like what i want
ok thx
it didn't fix

lol
because the position is absolute
yes
i took 2 years in web development
lol
it's because the position is absolute
i did
huh
they just didn't do what i said
put it in a div and set max-width for the div
@earnest phoenix
it's because the position is absolute
@earnest phoenix
i took 2 years in web development
lol
it's because the position is absolute
@earnest phoenix
@torn ravine Tfw I never updated the help command to show the lastest two sorting commands I just added
I noticed
but i need hight
๐ good thing it reads from a text file. EZ fix
lol
lmao
yea
gets out of hand really easily and it's messy
but its not for everything
best to use own classes
uhh its gone
it would be easier to assist you if you showed what you have yeah ^
the code for it
What
how do i check if a message contains a mention in discord.js?
<Message>.mentions
It's a class instance: https://discord.js.org/#/docs/main/stable/class/MessageMentions
ok
case "play":
if (!message.member.voice.channel) return message.channel.send('Please connect to a voice channel.')
if (message.guild.me.voice.channel) return message.channel.send('I am already connected')
if(!args[1]) return message.channel.send('Please input a YouTube URL after the command.')
let validate = ytdl.validateURL(args[1])
if (!validate) return message.channel.send("This isn't a valid YouTube URL.")
let info = ytdl.getInfo(args[1])
let connection = message.member.voice.channel.join();
let dispatcher = connection.play(ytdl(args[1], { filter: 'audioonly'}));
message.channel.send(`Now playing ${info.title}`);
break;```
i keep getting this error
TypeError: connection.play is not a function```
im using the mysql wrapper to get data from a mysql db, but in my mysql i have item names with different capitalization and I'm making it so that users can find items case-insensitive. but when i do .find(i => i.name.toLowerCase() === args[1].toLowerCase()) it doesnt return anything
I want to customize my discord server listing on top gg but it is my first time using css and I dont want to screw things up
one of the things I want to do is change the entire background picture and have a floating icon like what some bots pages have. (for example: @573958899582107653 bot top gg page).
Does anyone have the code or know a tutorial video to have a customized background image and have a floating icon? (You can DM me the code - My DMs are open)
@errant perch .join() returns a promise.
You need to resolve it first, then call .play(...)
this is pretty cool
guess your bot's description now shows up in discord itself too
love it
that's hot
discord has a botlist?
OR what library
jsj
Discord.js or Eris
disjs
currently blank for me
lmao
mobile bad
@sudden geyser discord.js
OR You can use <User>.fetchFlags(...) which returns a promise (I think)
Which returns this class https://discord.js.org/#/docs/main/stable/class/UserFlags
is it possible to make a text link in python?
like Invite Me and when you click it it redirects to the bots invite link
You can use markdown for that ([text here](url here)) which often requires the text be sent as an embed
Try it out and see
Though you don't need the () around the whole thing. It can just be [text here](url here)
forgot to mention you can't use markdown in some fields in an embed
you can't use it in the footer but you can use it in the description
You could also set a title field and set the title url
How can I make it so that my bot's embed description can have something where is simulates an enter key?
or you can add a new line in your code
I cant explain it
(โ
$$
&&
โ)
Can i do .setDescription twice?
a
I attempted to try an edit my background for my discord server but I cant get it to work. what am I doing wrong?
@commands.has_any_role('Founders', 'Head Staff', 'Junior Staff', 'Senior Staff')
async def clear(ctx, amount=100):
await ctx.channel.purge(limit=amount)
await ctx.send(f'I Have Cleared **{amount}** Messages :)', delete_after=5)``` how do i make it say the amount of messages it cleared? per say i type ``.clear 500`` and there is only 50 messages in the channel, it will delete all messages and say ``I Have Cleared 500 Messages`` but i want it to say the exact amount.
@earnest phoenix
Halo
Tempat promosi di mana ?
@earnest phoenix
@autumn summit ?
@earnest phoenix I think .purge(...) returns a list of message objects
count = 0
for x in or ctx.channel.history(limit=None):
count += 1```
that should do it
So you should be able to check the size of it to see how many were deleted.
@autumn summit How do I have a embed description look like someone pressed an enter key, creating a text like this?
Some took ehej
But iDK
uh waht
@autumn summit How do I have a embed description look like someone pressed an enter key, creating a text like this?
Some took ehej
But iDK
@earnest phoenix you can add a new line (\n)
i told you
count = 0 for x in or ctx.channel.history(limit=None): count += 1```
@autumn summit where
anywhere @earnest phoenix
if you mean diffeeent fields like titles and then value
just add another fielkd
@autumn summit that's not very efficient though. That would fetch every single message sent in the channel, and that does not even count how many messages were actually deleted
@thick gull Thanks, I can code an advanced bot but i cant edit a description lol
@sudden geyser
ahok
He says
@autumn summit that's not very efficient though. That would fetch every single message sent in the channel, and that does not even count how many messages were actually deleted
@sudden geyser ye can u help then
if he purges 500 messages in a channel
but 500 > than the amount of messages in a channel
i want it to say how much it actually cleared
then he can use that
i want it to say how much it actually cleared
oh
I already explained above a different method that is also not wasteful: https://canary.discordapp.com/channels/264445053596991498/272764566411149314/742570032105521267
Fixed url*
for me, none of the CSS tutorials for me to work with top gg is not working for me. I would appreciate it if someone sends me the code template to have a custom picture background and with the icon moving
error with the "or"
@autumn summit
remove or
still doesnt work
says the amount i typed
Is there a way to see exact data bot was made
account created
If you want to do it dynamically aka at runtime just check the bot user's account creation date
.createdAt()? (Canโt remember if this was the right thing)
@thick gull user.created_at.strftime(date_format)
i use djs
Same
module.exports = {
name: "say",
description: "Get the bot to say what ever you want!",
usage: "<msg>",
run: async (bot, message, args) => {
if (!message.member.permissions.has("ADMINISTRATOR")) return;
let MSG = message.content.split(`${bot.prefix}say `).join("");
if (!MSG)
return message.channel.send(`You did not specify your message to send!`);
message.channel.send(MSG);
message.delete();
},
};```
output *
ik its the problem of args but how to fix it
is args not formatted already
^^
why are you trying to parse the raw message content again
args.join(โ โ)
^ this
@sudden geyser you can tell me again how to do the badges ?
<User>.fetchFlags() returns a UserFlags instance. You can then use .has() on it to see if the user has one of the specified flags (or any method that suits your needs).
You can find the documentation on the link I sent you.
okay fetch flags
https://cdn.discordapp.com/attachments/720488806746423389/742579393662025808/unknown.png
can i ask how this looks
i don't know what's your app about but I like it
@paper cliff do you know what onenote is
it's basically my own onenote, but way better & free
never got help yet so ima repost
when i clear messages it sends i have cleared x messages but it returns the amount i typed in, how do i make it say the actual amount of cleared messages
does anyone know anything about CSS
cause I am a stupid idiot when it comes to CSS
just ask
@earnest phoenix the cleared messages are returned
so len(cleared)
or something like that
just ask
I TRIED asking and no one is responding to me.
I was figuring out how to have a custom background for my discord server on top gg but it is not working for me. the tutorial videos dont work for me with top gg
give me a page that exists that have a custom backgroung
didn't know there was a feature like that in top.gg
but I am pretty sure I am not allowed to send links here
screenshots will do
ok give me a minute
this is actually from a bot page
and here is a server example with custom background
c s s
top.gg is just (probably) looking for the custom invite splash background thing or whatever they call it
so how do I do it for a bot?
ok. I wonder if I should try and release some bots on top gg
why not, it's free?
lets hope people dont make fun of my bots
it's up to you to 'secure' your bots
what do you mean my "secure" my bots
i don't know, what do you mean by "don't make fun of my bots"
what I mean is that people would possible hate my bot because of how it is.
how do i add permissions to a command? (py)
@cobalt pasture ah lol, just make a cool bot
@earnest phoenix did you read the documentation?
nah, send
@cobalt pasture ah lol, just make a cool bot
I want to make cool bot but I feel like people will hate it
dab on em haters i guess
^
also, what is a good solution to keep my bots hosted 24/7 (I am publishing a bot made in node.js or discord bot maker)
@earnest phoenix
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.has_permissions
@commands.command()
@commands.has_permissions(manage_guild=True)
async def my_super_command(ctx):
pass```
it's an example ^ but look the doc
@cobalt pasture Discord Bot Maker, the thing on Steam?
yep.
yep. apperently
then just run it on a 24/7 server
what is a proper 24/7 server?
cry where did you used to host your bot?
ok. I will keep the discord bot maker program open until I get it hosted to a server
aws ec2 since i had some lambda integrations but then migrated over to DO
I have a memory leak in my bot, but can't find it ๐, can anyone help me to compare 2 heap snapshots? (one at bot startup, and the other a few hours later, when it uses about 0.7GB more). I can send you the snapshots by DM
Yep
i don't know if we can do anything interesting with the snapshots
and it probably contains sensitive information
so you should keep them for you?
Yeah I thought about that
Maybe I can tell someone the differences I find
And see if they have an idea of where an issue like that can be, not sure
Look in your code again, there is something you're missing probably
how many guilds your bot have?
2k
@gilded dawn i don't know if you ever got your error fixed but you need to upgrade d.py
wait how do you host your bot??
linux vps
@crystal socket thanks!!
be more specific
@midnight sorrel The documentation is there if you need: https://discordpy.readthedocs.io/en/latest/index.html
Look for the on_member_joined event and add a role?
it's on_member_join my bad
hey guys
how do i host my bot for free without watermark
???
you don't
wdym
watermark?
pay for resources you spend - welcome to capitalism
how do you get a watermark in a bot lol
lmao
WTF
i hosted my bot using botghost
i feel bad
even Discord bot designer bots don't have a shitty watermark
anyways, you should rent a vps
lol
someone has got to pay for the resources that are being spent, "good" and "free" don't go hand in hand very well
hopefully the staff here are patient about bots that are in this server. cause right now, I am attempting to restart my bot right now
@earnest phoenix pay
thats the only way
botghost doesn't allow you to export your code
so you will have to recreate your bot :')
I wonder if my discord bot magically appeared on this server
bots are on approval first
ok.
how would i do this for my bot? discord.py, ik how to add roles but not mention and stuff.
Im having a bot in 154 servers, written in discord.js, and the problam is its taking like 2-3 minutes to emit the "ready" event, how can i fkx this?
DiD yOu ChEcK tHe DoCuMeNtAtIoN @earnest phoenix
lies
send again
The documentation is there if you need: https://discordpy.readthedocs.io/en/latest/index.html
@paper cliff
literally scroll up
@earnest phoenix Hey, is it your internet connection?
this poor man
like, did you try on other computers?
@paper cliff idk, i tried on glitch, my computer, and even my VPS
I was having that issue earlier, it went away later
it's the same result?
its the same
then you have something going wrong on your code
instantly?
oh wow
emitted*
did you try another bot token?
and also "client.user" accessable just after 3 minutes
do you have the last discord.js version?
11.6.4
oh well
im finding time to update it lol
maybe something is going bad in the background then
it's an old version
try it on a new version?
yes i will, i wil update my bot today and hope for it to work
you can also try runnning only a file containning bot.login just to see if you have the same result
if you have the same result, it's likely a library issue on 11.6.4
ok thanks
i'll try
@client.command()
async def role(ctx, member, role):
userrole = discord.utils.get(member.server.roles, name=f'{role}')
await client.add_roles(member, userrole)
await ctx.send(f"{member} Was Given {role}")
how do i fix this
istg every yt tut is outdated af
DiD yOu ChEcK tHe DoCuMeNtAtIoN @earnest phoenix
I was about to say that
member.guild.add_roles I guess?
member.add_roles should work just fine @earnest phoenix
Of course there's still some more things wrong inside of that I suggest checking the documentation
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'server'
hire a developer, it's easier in your case I guess
Mate you really need to check the documentation it says it inside of it server is no longer a thing
I am attempting to figure out how to host a discord bot (specifically node.js) for free
i thought that Discord Bot Maker was Python bots?
no. they are .js bots. Python is .py
๐ค
well, hosting for free is difficult
cause hosting is what it is
it's something running 24/7
well, I actually found a tutorial video that might help
I think the tutorial video I found is doing Heroku
but they are generally slow
Does anybody know the time limit inbetween channel name changes?
and Heroku is not 24/7 free unless you give them your credit card info
@stable nimbus i'm not sure but isn't it 1 / 5 seconds?
and Heroku is not 24/7 free unless you give them your credit card info
@paper cliff but I am going to see how well it goes anyway.
A friend said stuff like channel topics and other things is like 2/5min
Twice in a 5 min period
wtf
Idk if that applies to channel name or not.
lemme check
I'll ask in DJS
Heroku is not 24/7 free unless you give them your credit card info
@earnest phoenix i know
Glitch might be better but you're limited to 1k hours a month I think.
Glitch is specific to JS
A little more than double.
where Heroku have multiple build packs
but whatever the best is to pay for a vps
that's it
or buy a Raspberry Pi
and host it yourself :')
or host it on your phone or whatever
they're plenty of things you can do if you don't wanna pay monthly
I think I am getting closer to being able to host my bot online HOPEFULLY 24/7
I prefer IcedHostLLC personally, its nice.
yo, is it possible to add command via eval?
idk i tried editing a json with fs but didnt work it just doesnt reply
JSON is not good with that.

FS is not meant to edit files, but view them.
Can't do that.
you can delete, write, append, or recreate
@earnest phoenix what's your lang
AH.
what are you using the json file for
@buoyant sigil what hoster
Okay.
NodeJS
what
discord.js
idk i use it XD
if it's something like server prefixes, you should switch to a real db
Best not to then.
@buoyant sigil what hoster
wut u mean
@sonic lodge Is right.
hi fuzzy
Using a legit DB is always nicer than nothing.
ye
Hey mate.
but idk how to use one i will add it when i learn it
@earnest phoenix yes easily it dpends on your command handler implementation
eval("bot.commands.set('lmao', ...)") should do the trick
again it depends on how it works for you
What DB are you using? Cause I use SQL
ic
you have lots of options for dbs and there's plenty of guides for each online
one day I used Mongodb for an another bot
you could use quick.db to learn
^
no
I use SQL cause its just englush.
lol
Literally a dumbed down english once you get the hang of it.
RowDataPacket {
chance_of_success: 0,
}
]```
Lets hope the website managers would not mind my bot being offline for a bit because IDK how long it will take for the Heroku to reconize my bot files
Is your bot in the approval process?
If so you might wanna get it started now.
[
RowDataPacket {
chance_of_happiness: -25,
}
]```
what?
lmao is it a windows VPS?
yo
How can I reset the modules I downloaded?
btw your project doesnt have a package.json file
npm init -y
creates the package.json file
npm i discord.js
and add discord.js as a dependency
Wdym
i don't know how do you start your bot
which command resets modules?
delete node_modules folder
I think I am going to remove my bot from bot approval queue right now

SO im makin a bot and it wont do a command but if i do a on_message it will get all the messages
Power Shell Not Released?
What do i need?
you probably need a Linux vps
it's simpler and cheap
but it works too on a Windows vps
npm install installs all dependencies listed in the package.json file
then you can start your bot
@marble salmon use discord.ext.commands extension
it's an extension built in discord.py
really useful
here is how it works
Kk
free providers are not recommended as they are slow and they are really limited
but there is Heroku or Glitch as free providers
Is there a way to clear/empty client cache?
A lot of ram is being used over time, I thought that there was a way of clearing cache at intervals it would help, instead of restarting the entire bot
the cache is necessary for the bot to work actually
Oh hey again danny :p
If you think your bot shouldn't take more than 0.7 Gb, try running your bot with only a bot.run/bot.login statement to see if that happens there too
I've been analyzing my memory snapshots and all extra consumed memory are discord.js cache arrays
then it seems necessary
Are you using intents already?
Those helped me cut my mem usage significantly since my bot stopped caching what I dont use
Nope, not using intents
10/10 recommend.
ah yes forgot this thing existed, it allows you to say to Discord: i don't want that and that, stop sending me them
I will look into it
I also use discord.js-light if you want to look into that
It cuts back discord.js's caching but otherwise is exactly the same
lol I have just opened that npm page 1 minute ago
so you should setup that right now :)
Try using intents and see If that helps ur mem
I'm looking into intents right now
By the way @oak cliff, you are using both discord.js-light and intents?
Yep
My bot is not in a lot of servers tho so I couldn't really give you a good estimate of usage
Do you mind if I dm you to clear some doubts? all good if you do not have time
hey
I cant right now as I'm trying to get my daughter to sleep, sorry
i just got a vps
and i am new to o t
it*
i did all the code there
like package.json index.js server.js
no problem, thanks Xyuh and Danny for the tips
[Pterodactyl Daemon] Exit Code: 1
[Pterodactyl Daemon] Out of Memory: false
[Pterodactyl Daemon] Error Response:
[Pterodactyl Daemon] Aborting automatic reboot due to crash within the last 60 seconds.```
but it says this
alr nvm
alr nvming
i installed npm
it was problem
@crisp geyser look into D.js-light
yes
That is d.js v12 right?
yes
almost everything is the same. but by default only Guilds are cached
So I just need to use fetch instead of cache for the few functions I have using cache
yep
but fetch will cache the stuff you fetched (add false to the query to disable it)
.fetch(id,false)
Good to know, don't mind if it caches tho
the Author of the package is also here on the Discord
some stuff is less intuitive if you want to use permissions you need to cache some stuff
(roles and overrites)
Only things I'm using permissions for is to check if I can react and a few more things with message.channel.permissionsFor(message.guild.me).has(ele)
also the sweep methods could be interestening for you
i think you only need to cache roles and overrites if you check permissions for members not the bot itself
What is swap for?
on your system?
Oh sorry, you said sweep lmao
sweep will clear the cache.
For what I have seen the only cache I need is Guilds
I don't use any other type of cache
the package is nice. got my Bot from about 200MB ram usage down to 90MB ram usage
That's really cool, how many guilds is your bot in?
240
sure
im developing a dashboard for my bot, and i built it first using Glitch, then after finishing it i downloaded the files to my Windows VPS, and after starting the dashboard on port 80 using a domain + cloudflare, im having those errors in console
https://prnt.sc/txk266
and its not loading imgaes and stuff, how to fix?
and its not loading images and stuff
how can i fix that
your security Policy doesnt allow it.
i heard about the mate tag
but i dont use Windows VPS so idk
bot i dont understand how to use this meta tag to make this works
idk im not a web dev. also i prefer to use Linux over windows on Server.
in discord py how can i take channel as input from user to send message to that channel??
channel: discord.channel
i think he wants the channel object from the message
message.channel then?
how to download all my files from vsc
Wdym @surreal notch
Arenโt vsc files stored locally
Taking color argument as channel and then saying channel not found
async def embed(c: discord.Colour, channel : discord.TextChannel, t, *, args=None):
embedVar = discord.Embed(title = t, description=args, color=c)
await channel.send(embed=embedVar)```
You just said it like 30 seconds ago
Hmm, i got something in my mind tho, show the code please
The "setwelcome"?
async run(message, args) {
let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
if (!args[0]) {
return message.channel.send("No id provided");
}
if (!message.guild.channels.cache.get(args[0])) {
return message.channel.send("This channel aren\'t a part of this server");
}
await db.set(`wchannel_${message.guild.id}`, args[0]);
const embed = new MessageEmbed()
.setDescription(`The welcome channel was set to ${message.client.channels.cache.get(args[0])}`)
.setColor('#ea6ef1')
.setAuthor('| Welcome Channel', 'https://cdn.discordapp.com/avatars/714745136122429491/e16289a6de8bd22fb433b1e029fe98e1.png?size=2048')
.setTimestamp()
.setFooter(`Requested by ${message.author.tag}`);
message.channel.send(embed);
}
}
async run(message, args) {
let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
if (!args[0]) {
return message.channel.send("No id provided");
}
console.log(args[0]);
if (!message.guild.channels.cache.get(args[0])) {
return message.channel.send("This channel aren\'t a part of this server");
}
await db.set(`wchannel_${message.guild.id}`, args[0]);
const embed = new MessageEmbed()
.setDescription(`The welcome channel was set to ${message.client.channels.cache.get(args[0])}`)
.setColor('#ea6ef1')
.setAuthor('| Welcome Channel', 'https://cdn.discordapp.com/avatars/714745136122429491/e16289a6de8bd22fb433b1e029fe98e1.png?size=2048')
.setTimestamp()
.setFooter(`Requested by ${message.author.tag}`);
message.channel.send(embed);
}
}```
@crisp geyser you can save a load of memory with intents
you dont technically need djs-light
try sending <#channelid> in the server
Can you try this and see what it logs into the console? @fringe axle
I'll try
it'll help but so will intents
Tf

My man, how did you define args
Not that
What then?
The part that has
let args = //whatever here in your main file
Uh
If it's index.js or whatever you named it
Don't have that
thats your problem
im developing a dashboard for my bot, and i built it first using Glitch, then after finishing it i downloaded the files to my Windows VPS, and after starting the dashboard on port 80 using a domain + cloudflare, im having those errors in console
https://prnt.sc/txk266
and its not loading imgaes and stuff, how to fix?
your using args when they donโt exist
Means?
Do you have an events folder?
@fringe axle ```js
async run(message, args) {
let argsC = message.content.split(" ").slice(1);
let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
if (!argsC[0]) {
return message.channel.send("No id provided");
}
if (!message.guild.channels.cache.get(argsC[0])) {
return message.channel.send("This channel aren't a part of this server");
}
await db.set(`wchannel_${message.guild.id}`, argsC[0]);
const embed = new MessageEmbed()
.setDescription(`The welcome channel was set to ${message.client.channels.cache.get(argsC[0])}`)
.setColor('#ea6ef1')
.setAuthor('| Welcome Channel', 'https://cdn.discordapp.com/avatars/714745136122429491/e16289a6de8bd22fb433b1e029fe98e1.png?size=2048')
.setTimestamp()
.setFooter(`Requested by ${message.author.tag}`);
message.channel.send(embed);
}
}```
Try this mate
Thanks
you canโt use args[0] without defining args
you can try message.mentions.channels.first()
but thatโs only like #265156361791209475
ok so
Not your bad Master
i am using a npm package
client.moderator.warn(message.guild.members.get(message.mentions.users.first().id), {
reason: args.slice(1).join(" "),
author: message.member
}).then((warnData) => {
console.log(warnData); // {...} (id, type, author, reason and more)
});
}```
Looks good
this is the code
Yea
it says client.moderator.warn(message.guild.members.get(message.mentions.users.first().id), { is not a func
Now I need to wait till someone joins 
ok
console.log(client.moderator.warn);```
yeh
Did it log anything
it just says
OMG
message.guild.members.get is not a function
Yea
@earnest phoenix THANKS SOOOO MUCH!
Np
Great help!
it isn't?
@delicate shore did you forget cache
lol
@earnest phoenix client.moderator.ban(message.guild.members.cahce.get(message.mentions.users.first.id), { ^ TypeError: Cannot read property 'get' of undefined
cache not cahce
;-;
Databases
Then... Why do it the second time?
@earnest phoenix my next mission: Message edited/Deleted logs.
First happens in messageUpdate event and second in messageDelete event
@delicate shore Show code of where that happens
k
if(!args[0]) return message.reply(`Correct usage is sptempban @user time reason For eg- sptempban @roblox 1d playinf roblox`)
if(!args[1]) return message.reply(`Correct usage is sptempban @user time reason For eg- sptempban @roblox 1d playinf roblox`)
if(!args[2]) return message.reply(`Correct usage is sptempban @user time reason For eg- sptempban @roblox 1d playing roblox`)
if(!message.member.hasPermission("BAN_MEMBERS")) return message.reply(`You Don't have permission to use this XD`)
client.moderator.ban(message.guild.members.cache.get(message.mentions.users.first.id), {
time: ms(args[1]),
reason: args.slice(2).join(" "),
author: message.member
}).then((banData) => {
message.channel.send(banData)
console.log(client.moderator.ban)
console.log(banData); // {...} (id, type, author, reason and more)
});
}
Easy but not that much
Hmm
Yea
i am so stopid
But check if there's a mention exists tho
op
@earnest phoenix I need help... xD
What do you need help in, I'm here
async run(message, args) {
try {
if (message.author.bot) return;
const snipes = message.client.snipes.get(message.channel.id) || [];
snipes.unshift({
content: message.content,
author: message.author,
image: message.attachments.first()
? message.attachments.first().proxyURL
: null,
date: new Date().toLocaleString("en-GB", {
dataStyle: "full",
timeStyle: "short",
}),
});
snipes.splice(10);
message.client.snipes.set(message.channel.id, snipes);
let embed = new MessageEmbed()
.setTitle(`Message deleted!`)
.setDescription(
`**The user ${message.author.tag} has deleted a message in <#${message.channel.id}>**`
)
.addField(`Content`, message.content, true)
.setColor(`RED`);
let channel = message.guild.channels.cache.find(
(ch) => ch.name === "member-log"
);
if (!channel) return;
channel.send(embed);
} catch (e) {}
}
};
IDk what I use in the CommandHandler
const { Command } = require('discord.js-commando');
const { prefix } = require('../../config.json');
const { MessageEmbed } = require('discord.js');
const fs = require('fs');
const Discord = require('discord.js');
const Canvacord = require("canvacord");
const db = require('quick.db');
const canvas = new Canvacord()
module.exports = class HelpCommand extends Command {
constructor(client) {
super(client, {
name: 'level-on',
aliases: ['on, levelsystem-on'],
group: 'guild',
memberName: 'levelon',
description: 'Enable the level system',
});
}
``` My CommandHandler in every command looks like this ^^^^^^
how to make my folder into zip
Wait
I have a better idea
client.on("messageDelete", async (message) => {
require("./commands/guild/messagedelete")(message);
try {
if (message.author.bot) return;
const snipes = message.client.snipes.get(message.channel.id) || [];
snipes.unshift({
content: message.content,
author: message.author,
image: message.attachments.first()
? message.attachments.first().proxyURL
: null,
date: new Date().toLocaleString("en-GB", {
dataStyle: "full",
timeStyle: "short",
}),
});
snipes.splice(10);
message.client.snipes.set(message.channel.id, snipes);
let embed = new MessageEmbed()
.setTitle(`Message deleted!`)
.setDescription(
`**The user ${message.author.tag} has deleted a message in <#${message.channel.id}>**`
)
.addField(`Content`, message.content, true)
.setColor(`RED`);
let channel = message.guild.channels.cache.find(
(ch) => ch.name === "member-log"
);
if (!channel) return;
channel.send(embed);
} catch (e) {}
}
);
@earnest phoenix can this work?
No, It doesn't. xD
Of course it wouldn't, client.snipes is not a property of client natively
means?
Also unshift() is not even a thing
uh
message.client.snipes = new Discord.Collection();```
I don't see that request.charAt anywhere in the code you showed
It's in the index.js in the 102nd line
Hmm then idk where that is
Search for that i guess
Lol
Anyone know the rate-limits of webhooks?
Ok
try const { MessageEmbed } = require ('discord.js') at the top
how to make my folder into zip
Wot
make a zip file
i need help
how
put stuff in zip file
@delicate shore help in
you can do it in the right click menu afaik
as u can see here
in this pic
it should be banData.id
only
i use that
but it says cannot read property id of undefoned
undefined
ok i got it
banData is undefined
no
well itโs kinda obvious banData is undefined
rest everything is cool
rest everyhting works
reason
user id
author id
eveyrhting
Uhh, what has banData.id has to offer
User who was banned?
why not get the id of the user in a different way? You really need to use banData.id for that?
@earnest phoenix I need to define member and message in here client.on("messageDelete", async message => { but how?
I see, interesting 
const member = message.member
Okay
IT WORKED! Thanks!
@earnest phoenix
client.on("messageUpdate", async (oldMessage, newMessage) => {
const member = message.member
let embed = new MessageEmbed()
.setTitle(`New message edited`)
.setColor(`GREEN`)
.setDescription(
`**The user ${oldMessage.author.tag} has edited a message in <#${oldMessage.channel.id}>**`
)
.addField(`Old Content`, oldMessage.content, true)
.addField(`New Content`, newMessage.content, true);
client.channels.cache.get(lchannel).send(embed);
const message = message
});
why do you have that
Okay
like, message IS message
Wait
After I deleted it
client.on("messageUpdate", async (oldMessage, newMessage) => {
const member = message.member
let embed = new MessageEmbed()
.setTitle(`New message edited`)
.setColor(`GREEN`)
.setDescription(
`**The user ${oldMessage.author.tag} has edited a message in <#${oldMessage.channel.id}>**`
)
.addField(`Old Content`, oldMessage.content, true)
.addField(`New Content`, newMessage.content, true);
client.channels.cache.get(lchannel).send(embed);
});
Both
what
@pale vessel I see people using this oldMessage, newMessage wrong xd
const member = oldMessage.member;```
what's message for anyway
Okay?
where's line 133
And then I delete "oldMessage"?
No
uh?
line 133
const member = oldMessage.member;
client.on("messageUpdate", async (oldMessage, newMessage) => {
const member = oldMessage.member;
const embed = new MessageEmbed()
.setTitle(`New message edited`)
.setColor(`GREEN`)
.setDescription(
`**The user ${oldMessage.author.tag} has edited a message in <#${oldMessage.channel.id}>**`
)
.addField(`Old Content`, oldMessage.content, true)
.addField(`New Content`, newMessage.content, true);
client.channels.cache.get(lchannel).send(embed);
});
restart your bot?
Just change
const member = message.member;```
To
```js
const member = oldMessage.member;```
Yea

Worked, thanks!
No shit?



