#development
1 messages · Page 490 of 1
It will play, run the command, then stops, run the command again, and it starts back fine
No error in console
still trying to find a good way to deep fry images using imagemagick
anyone know how i can make a command for my bot so if i do --setstatus dnd test watching then it would set the status to say watching test and it would be do not disturb
Have a variable
Look up how to set presence in d.js (assuming you are using that)
And have the command set the variable to whatever comes after the command
Easy
im noob, will it say how to make it come after variable on the wesite?
i dunnp
as i daid
said
noob
anyone know how i can make a command for my bot so if i do --setstatus dnd test watching then it would set the status to say watching test and it would be do not disturb
So how do i put a pause between two messages (eg first message sends, then 5seconds later the second one sends)
settimeout
And how exactly do i use that
do you have to make that in bold
stop
k
@quartz kindle keeping variables in memory is not an option if you want to keep your application stateless
I need help with something. It keeps saying I need a role but I have that role
ok
if(!message.channel.nsfw) return message.reply(`Sorry, NSFW Commands can only be used in NSFW Marked channels only`)
let gRole = message.guild.roles.find(`name`, "18+")
if(!message.member.roles.has(gRole)) return message.reply(`Sorry you need the ${gRole.name} role to use this command`)
That is my code
@lusty dew ok?
but
even though I do
do you have the role
What's wrong @lusty dew ?
It is saying I don't have a role when i have it
How did you define it
if(!message.member.roles.has(gRole)) return message.reply(`Sorry you need ${gRole.name} to use this command`)
Ummmm
?
Oh also
It may be a problem with this
let gRole = message.guild.roles.find(`name`, "18+")
Is there no error?
Nah
It just keeps sending the
message.reply(Sorry you need ${gRole.name} to use this command)
That
Keeps sending that
Ummmmm....and your console is clear?
(node:832) DeprecationWarning: Collection#find: pass a function instead
I showed that to someone this morning, they didn't say anything about it
so I thought it was fine :/
That's your problem
.find(this => this === this)
use a function instead of "name", "value"
Your making find into a function
im lazy
Lol
😭
woah
It is burning
there
So nice
Woah
Nicest people on the planet
hold up
Not you but like America is burning cause of Trump
Thank you
We almost got into world war 3 cause of Trump
no
How?
Yes
Take that somewhere else, not in here
like
Thank you
ok
They did exactly what I did
That's what I said
Oh ok
let gRole = message.guild.roles.get("492821208924946452")
if(!message.member.roles.has(gRole.id)) return message.reply(`Sorry you need the ${gRole.name} role to use this command`)
So like that?
``find("name", "<role name>");` is decrepited
Ah ok
decrepited
If your looking by name you have to do .find("name" => r === "<role name>"); right?
How would one log when messages are deleted and then send them out in an embed?
It would be a event
Ok
Anything that happens with out a command line is basically a event
Ah ok
Yes
Yes
why dont this work?
member.ban(reason)
await new Promise(resolve => { setTimeout(resolve, 5000) })
bandel.delete()```
it dont send a message and theres no error
await new Promise(resolve => { setTimeout(resolve, 5000) })```
what is the purpose of this?
Why do you need this?
to wait 5 seconds them delete the ban message
client.on("messageDelete", msg => {
let embed = new Discord.RichEmbed()
.addField("Message Deleted:", msg)
.addField("Time:", msg.createdAt.toDateString)
msg.channel.send(embed)
});
Would this work?
Blacklists
msg.channel.send({embed})
@lusty dew
I guess but it gets very annoying @dusk skiff
Yeah
@lusty dew make sure to disable it or move it to #265156361791209475 for this server or ur bot will get muted
let embed = new Discord.RichEmbed()
.addField("Message Deleted:", msg)
.addField("Time:", msg.createdAt.toDateString)
modchannel = msg.guild.channel.find(`name`, "mod-logs")
if(!modchannel) return msg.channel.send("Couldn't find mod-logs channel");
modchannel.send({embed})
Would this work better?
Also this is a private bot
if its private you can just search for it using the chat id incase you change the chat name @lusty dew
makes no differance
With the curly brackets it can sometimes throw an error
ive never got an error
Hence "sometimes"
any error?
Nope
Is it in curly brackets?
i doubt it @smoky spire
Change that guild.channel.find to guild.channels.find
They're finding by name
you could do
const chat = client.channels.find("id", "chat id")
Using find on client.channels doesn't confirm guild
It is still doing nothing
Being deprecated doesn't mean it doesn't work
im just weird
regardless, he said its a private bot, meaning used in only one server, meaning better have a static id
in case of channel name change
True
Yea
its up
but im pretty sure you cant add the entire message object to the field
client.on("messageDelete", message => {
if(neko == undefined || addict == undefined){
neko = client.users.find("id", "479603748382179329"),
addict = client.users.find("id", "337808716172886017")
}
let embed = new Discord.RichEmbed()
.addField("Message Deleted:", message)
.addField("Time:", message.createdAt.toDateString)
.setTimestamp()
.setFooter(`Owner's of the bot: ${neko.tag} ${addict.tag}`)
modchannel = message.channels.get("492835442354552844")
if(!modchannel) return message.channel.send("Couldn't find mod-logs channel");
modchannel.send(embed)
});
?
oof
addField message.content
@earnest phoenix .delete() for messages you can have a timeout before deleting without actually making a timeout (ie. message.delete(5000))
Ah ok
but wouldnt it delete the recent message @west raptor
also, if you're matching against undefined
what
message.delete(5000) would delete the most recent message
isnt typeof() @quartz kindle
nope
what
if (papi == undefined || sanae == undefined) {
papi = bot.users.find("id", "479603748382179329");
sanae = bot.users.find("id", "201745963394531328")
}
I was going off of an earlier bot I did and it works
That is from the other bot I used it from
Yes it would delete the message
or you know, you can simply do !papi || !sanae
@earnest phoenix is it in a command?
No this is a event
Honestly
I don't even need that
I just wanted it lol.
It is supposed to tell the names of the owners
no matter if they change it or not
let mute = await msg.channel.send({embed}) mute.delete(5000) @west raptor ?
if you have a variable and you need to know if its empty or not, you do if(!variable) (if NOT variable, matches with false, undefined, "", 0, null)
that would work?
idk
if(!neko || !addict){
neko = client.users.find("id", "479603748382179329"),
addict = client.users.find("id", "337808716172886017")
}
SO like that?
So*
yes
Ok
sad
oof I need to do get lol sorry
its not find(arg1,arg2) its find(variable => return match)
regardless
if you have the ID
dont use find
use get
client.users.get(id)
Only use find if you don't have an id
Yeye
back to the previous subject
if you absolutely need to match against "undefined" only, and not ""/0/false/null
neko is not defined
do if(typeof variable === "undefined")
define neko?
That was no help
Lmfao sorry
if(!neko || !addict){
neko = client.users.get("479603748382179329"),
addict = client.users.get("337808716172886017")
}
@quartz kindle why it not send message?
mute.delete(5000)```
No is Neko defined
It's not {embed} it's ${embed}
oof
that wouldnt work either
dont use ${} unless you need string concatenation
But you don't need ${}
${} is only to mix variables with strings
Yes
an embed built with the embed builder should not need {}
mute.delete(5000)```
dont send the message
are you using a embed builder, @earnest phoenix
Why not do
message.channel.send({embed}).then(msg => {
msg.delete(5000)
}
kayo what is not sending?
^
So I am switching from async to rewrite with discord.py
I know why
code?
Your doing let mute = await embed, not just a standard message.channel.send(embed)
it would be ```py
@bot.command()
async def meme(ctx):
await bot.send(newurl("meme"));
So I keep getting the error
Traceback (most recent call last):
File "C:\Users\jlpat\source\repos\Reddit Bots\Meme Bot (R-D)\test.py", line 16, in <module>
ctx = bot.ctx
AttributeError: 'Bot' object has no attribute 'ctx'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000027FF38BACF8>
Time:
function toDateString() { [native code] }
This popped up in the embed
When you're copy and pasting
OwO
And you forget
oof ok
Fixed it
I needed to do
message.createdAt.toDateString()
lol I forgot the ()
Thank you @west raptor
np
how do I do a memberUpdate event?
isn't it
client.on("messageUpdate", oldMessage, newMessage => {
})
also its (oldMessage, newMessage) =>
^
Also how would I define message in it?
Cause I want it to display the author
would I just do
(oldMessage, newMessage, message)
no
Ok
you can use either oldMessage or newMessage
since they're both message objects
and have the same author
@earnest phoenix i see the issue
@lusty dew full code?
https://owopup-pls.cease-and-desisted.me/i/2vl2.png bot.ctx is nothing, try ctx.bot
also is there an error
.addField("Original Message:", oldMessage.content)
.addField("Edited Message:", newMessage.content)
the full code
Ok
I don't get code completion in VS with ctx
https://www.hastebin.com/lerogugeku.coffeescript <---Full Code
@west raptor https://owopup-pls.cease-and-desisted.me/i/f6ff.png NO BAD
ok
- we don't use semicolons in py
- thats not how you send in rewrite
Ok I understand what it says
any error?
but it has said stuff like that before and have been wrong
@trim saddle I'm sorry for semicolons
tHat Was iN The PateBin
and @west raptor thats just hastebin's language detection being dumb
try putting console.log('Message Edited') at the top of the thing
before let neko, addict
@bot.command()
async def hewwo(ctx):
await ctx.send("gimme the big s u c c")
hewwo
this is how furries code
@trim saddle I mean at least do
@bot.command()
async def hewwo(ctx):
await ctx.send("gimme the big **S U C C**")
Yesss
lol
Also
Luca I got nothing
https://www.hastebin.com/bazuzixowi.css <---Error
I had to fix the Console log
lol
well yeah thats the issue @lusty dew
you're using message
the error is pretty clear
newMessage.createdAt.toDateString()?
oh ok
you can use .editedAt instead of .createdAt
oh?
yeah
py™
editedAt is not defined
🤦🏾 its newMessage.editedAt
I need help again
So I keep getting the error
Ignoring exception in command kick:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 61, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\jlpat\source\repos\Reddit Bots\Meme Bot (R-D)\memes.py", line 214, in kick
await discord.Guild.kick(username, reason = kreason);
TypeError: kick() missing 1 required positional argument: 'user'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\bot.py", line 898, in invoke
await ctx.command.invoke(ctx)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 550, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 70, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: kick() missing 1 required positional argument: 'user'
My code is here: https://pastebin.com/CzyfrxjZ
I am sorry for the semicolons
It's the command $kick which is causing the problem
Does anyone know what the problem is?
Thanks!
@earnest phoenix
yes
rewrite or async?
rewrite
await member.kick(reason=kreason)
https://owopup-pls.cease-and-desisted.me/i/vex2.png i forgot i did this
@lusty dew hm try just new Date().toDateString()
@earnest phoenix you summon a discord.Member object
# bad example
wew = ctx.guild.get_member(id_here)
await wew.kick()
What about discord.User
user is global
yes
Can I have a good example
cause
thats not a command
@bright spear That worked thanks :3
yw
@trim saddle This is what I did
@commands.has_permissions(kick_members = True)
@bot.command(brief="Kicks user. Mod's only", description="Usage: $kick [@user] [reason]")
async def kick(ctx, username: discord.Member, *, kreason = None):
mem = ctx.guild.get_member(username);
await mem.kick(reason = kreason);
await ctx.send("Successfully kicked " + str(username));
print("Kicked " + str(username));
It still isn't working
you want to call kick on a discord.Member object
so
show me
I don't understand
like
@commands.has_permissions(kick_members = True)
@bot.command(brief="Kicks user. Mod's only", description="Usage: $kick [@user] [reason]")
async def kick(ctx, username: discord.Member, *, kreason = None):
await discord.Member.kick(username, reason = kreason);
await ctx.send("Successfully kicked " + str(username));
print("Kicked " + str(username));
I don't get it
you should learn python
I just figured it out
Thank you for your help
@commands.has_permissions(kick_members = True)
@bot.command(brief="Kicks user. Mod's only", description="Usage: $kick [@user] [reason]")
async def kick(ctx, username: discord.Member, *, kreason = None):
await discord.Member.kick(username, reason = kreason);
await ctx.send("Successfully kicked " + str(username));
print("Kicked " + str(username));
This worked
How do I make the bot's icon appear on an embed?
np
uh huh
getting data from a json shouldnt be an issue
👍
im about to waste hours making a json file
im making a command that gets data about a stand from JoJo's bizzare adventure
ok
code
@earnest phoenix Yes, but not when the thing it says is empty really isn't
Author:
@Neko Ali
Original Message:
lol
Edited Message:
Testing
Time:
Fri Sep 21 2018
Owner's of the bot: Neko Ali#0674 and The ADDict#5196•Today at 5:40 PM
This is what it sends
So it isn't empty
is that what is sending
🤦
or supposed to be sending
ok
Javascript Errors can be complexed
true
Errors can occur without it showing up in the console
What is it supposed to happen?
oof
comment out one of the fields at a time
@inner jewel It is not useless to me
to find which one is the culprit
:/
Ok
you declare those variables right above it with no value
so the if will always be executed
Yes
Ok
and discord returns empty strings for content of messages
when they're eg just an embed
Huh?
also, you instead of getting the bot's owners every time, just set them once at startup. you can set them in some unused client namespace for example client.botowners = users.get etc
ok
Yes
So how am I to fix the error? I did not understand anything Natan said
What is the error?
do something like oldMessage.content || "no content"
We cant automatically know what it is, if we don't see it
I wasn't here for that
do what tim said
i already told you, comment out the addfields
and test one at a time
to see which one is the culprit
if that message always appears
oldMessage.content == "" or newMessage.content == ""
and as natan said, add a fallback to message.content
those are the only cases that error can happen
That's not a error
Well
yeah thats not an error
That's data
Ok
yeah, probably something you console.logged
It's a json formatted
thats an entire message object/collection
anyways you can see
that inside that long ass collection
there is content: ''
so that message had an empty content
which is the cause of your error
hence why .content || "no content found"
if the original message is nothing but an image, or an embed
the content is empty
because these are stored in other parts of the message
Oh
Would [{}] in a Json formatting affect anything Tim?
Not for me
its valid json, but you have to know when to use object keys and array keys to access it correctly
It's in nekos console
Ok
objects do not have a defined order
did you test it?
And?
It just spams the channel
with the embede
Author:
@No Name
Original Message:
no content
Edited Message:
no content
Time:
Fri Sep 21 2018
It spams that
That's because it's a run-time error, you made of made a forever loop
Lol
If I edit a message it spams that
weird
remove everything
and try
client.on("messageUpdate", (oldMessage, newMessage) => {
console.log("message updated")
}```
see if it still happens multiple times with a single edit
client.on("messageUpdate", (oldMessage, newMessage) => {
console.log("message updated")
}
Full code^^
Like that?
yes
good
now try console.log(oldMessage.content,newMessage.content)
to see if it shows up correctly
never?
old message is always empty?
if you try editing more times in more ways
with different contents everytime
Oh wait
It does
I just thought it would send it like
Old message
New message
not
Old message new message
alright so everything seems to be working
Yes
Ok
try first an embed with only author
then only one message
etc
also, dont add back this if(!modchannel) return message.channel.send("Couldn't find mod-logs channel");
there is no message here
and its better to keep those kind of errors in the console only, instead of making them public
oof
i just did
Ok
Removed it
Hmm
It won't send anything
Lol
Does it not work when you edit a message you already edited?
It didn't
So i just sent a new message and edited it
seems like
.addField("Author:", newMessage.author)
This is making it spam?
It does spam with just that
try newMessage.author.username
Still spams
screenshot?
i have no idea how that makes any sense
what luca said
Also it sends the name of the bot
You asked for a screenshot there you go
It just spams it
the message the bot is sending is being caught in the messageUpdate event
no idea why
try just doing console.log(newMessage.author.username)
it shouldnt
Ok
Neko Ali
No Name
No Name
No Name
No Name
No Name
No Name
No Name
No Name
No Name
No Name
Says my name once
then Spams No Name(Name of the bot)
thats with nothing in the command besides the console.log?
then try oldMessage instead lol
Still spams :/
hold on lemme test
Ok
it seemed to spam my console aswell https://i.imgur.com/E9Jtqxe.png
Yea
I don't understand it lol
is there another way of getting the person who sent the message?
edited*
try asking about it in the d.js server first
anyway, try doing the rest of the command
without author
to make sure everything works
and then figure out the author later
Ok
So I was wondering
RangeError: RichEmbed field values may not be empty.
at RichEmbed.addField (C:\Users\User\Desktop\No name\node_modules\discord.js\src\structures\RichEmbed.js:165:34)
at Client.client.on (C:\Users\User\Desktop\No name\index.js:59:6)
at Client.emit (events.js:182:13)
at MessageUpdateAction.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\actions\MessageUpdate.js:13:16)
at MessageUpdateHandler.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\handlers\MessageUpdate.js:7:34)
at WebSocketPacketManager.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\User\Desktop\No name\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
This is with oldMessage^
How do you make a purge command in rewrite? I've made on in async but I'm switching over. The lib is discord.py.
@quartz kindle I get the same error with oldMessage as before
is it repeating again?
Not spam
the Author thing caused the spam
RangeError: RichEmbed field values may not be empty.
at RichEmbed.addField (C:\Users\User\Desktop\No name\node_modules\discord.js\src\structures\RichEmbed.js:165:34)
at Client.client.on (C:\Users\User\Desktop\No name\index.js:59:6)
at Client.emit (events.js:182:13)
at MessageUpdateAction.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\actions\MessageUpdate.js:13:16)
at MessageUpdateHandler.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\handlers\MessageUpdate.js:7:34)
at WebSocketPacketManager.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\User\Desktop\No name\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
This is the error
but in the console it worked
it correctly showed the message content
right?
so try doing it without an embed
just do channel.send(oldMessage.content)
Ok
channel.send("Original Message:", oldMessage.content)
^
ReferenceError: channel is not defined
at Client.client.on (C:\Users\User\Desktop\No name\index.js:57:5)
at Client.emit (events.js:182:13)
at MessageUpdateAction.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\actions\MessageUpdate.js:13:16)
at MessageUpdateHandler.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\handlers\MessageUpdate.js:7:34)
at WebSocketPacketManager.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\User\Desktop\No name\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
at Receiver._receiver.onmessage (C:\Users\User\Desktop\No name\node_modules\ws\lib\websocket.js:137:47)
obviously channel is not defined
Yes
try
Any ideas on how to split a message that is too long (over the 2000 limit) without messing up with the umm markdown.
oldMessage.channel.send() maybe? @lusty dew
that'll send in the channel where the message is
It's however you defined the channel
@lusty dew just use the same channel thing you were using before
how were you sending it before
Ok it sends the old message
msg = [msg[i:i+2000] for i in range(0, len(msg), 2000)]
``` I use this to separate long messages but i'm not sure how to make it so it doesn't split the markdown.
Nevermind, I'll just add some code to separate the long message if it over exceeds the 2k limit
@floral stone d.js has a built in split function
How can I put it into an embed though?
How do I do that o.O
embed = {
embed:{
author: "bla",
field: {
title: "etc",
value: "duh"
}
}
}```
something like that
Ah ok
What is the Author for?
author lets you make a title with an image next to it
What does inline do?
Ah ok
"embed": {
"timestamp": "2018-09-22T02:05:01.078Z",
"footer": {
"icon_url": "client.users.displayAvatarURL",
"text": "footer text"
},
"thumbnail": {
"url": "client.users.displayAvatarURL"
},
"fields": [
{
"name": "OriginalMessage",
"value": "oldMessage.content"
},
{
"name": "Edited Message",
"value": "newMessage.content"
}
]
}
So like this?
client.users.displayAvatarURL isnt a thing
you're using strings instead of values
but you can test it like that to make sure it works first

can someone help me my kick command wont read back when it doesnt have permissions ``` if(command === "kick") {
let member = message.mentions.members.first();
let reason = args.slice(1).join(" ");
if (!message.guild.me.hasPermission("KICK_MEMBERS"))
return message.reply("You or I dont have perms to kick.");
member.kick(reason);
}```
and also remove the name
What do you mean it doesn't have permissions? @earnest phoenix
how do I use a userUpdate event?
Like to get the old username
adn the new username?
i went on my computer and followed the thing excactal made a folder got discord on computer but when i am in node.js and i press enter it fails
@earnest phoenix so what's your question ?
dont worry about it my computer just died and wont charge 
@quartz kindle how i can delete this white line?
on my DBL page
beacause the backgroundcolor is transparent for img
@earnest phoenix use this css
#bot-details-page .bot-img {
box-shadow: none !important;
}```
@earnest phoenix why do you have <html> <head> etc
just remove all the html head body stuff
Then you need to visit https://www.w3schools.com
ooh now
it's working
thank's man
Beginners should take a look at the CSS tutorial
yw
I already looked at that site
@earnest phoenix
@bright spear
how i can change the buttons stile
like
@earnest phoenix Hey
?
#bot-details-page .bot-img {
box-shadow: none !important;
}```
Should definitly work
ik
Oh i see remove the <style> </style> out of the <html> and put it at the bottom
See if that fixes it
The html parsing is a bit picky on DBL
But it works
Mkay lol
@earnest phoenix to change style, as I said, learn CSS
How do I show the servers count on dbl
I’m using python @earnest phoenix
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
You need to google then
@earnest phoenix
Cool
I just want to change the color of these buttons. And if I search on the site in which category?
Learn css @earnest phoenix
oof
Will help you do more customizations
You will need to be more specific for the css
It won’t be like coding a new page
Yes, dude, it's obvious af
It will be like working inside an existing page
I do not understand a fucking thing. Where do I find the location of the buttons?
if(!tempVars("test")[2]) {
msg.channel.send({embed: {
color: C11515,
title: ":ERROR: Error",
fields: [{
name: "Invalid Or Missing argument",
value: "Ussage: ${server.tag}embed (Title, Color, Description)"
}]}
} else {
msg.channel.send({embed: {
color: tempVars("test")[1],
title: "${tempVars("test")[0]}",
description: "${tempVars("test")[2]}"
}
})
}
HAve I done anything wrong?
bot.guilds.forEach(guild => {
const invite = bot.channels.first().createInvite({ maxAge: 0 })
string += `**Server Name** : ${guild.name} --- **Server ID** : ${guild.id} --- **Invite** : ${invite}`;
})
I don't know JS, but you're sending an object, that object probably has an attribute you're looking for.
how do i fix this
this is code
client.user.setPresence({ game: { name: args[0], type: args[1] } });
client.user.setStatus(args[2])
.then(message.channel.send("Bot Status Has Been Set To:" + "Name: ``" + args[0] + "`` Type: ``" + args[1] + "`` Status: ``" + args[3] + "``"))
.then(console.log)
.catch(console.error);
owo
why not just use the current status 
If the promise is resolved, then the one you set will be the one that the client currenly is
const discord = require('discord.js')
const ownerID = '274284493043531776';
exports.run = async (client, message, args) => {
if (message.author.id !== ownerID) return message.channel.send("You are not authorized to use this command.");
client.user.setPresence({ game: { name: args[0], type: args[1] }, status: args[2] })
.then(message.channel.send("Bot Status Has Been Set To:" + "Name: ``" + args[0] + "`` Type: ``" + args[1] + "`` Status: ``" + args[2] + "``"))
.then(console.log)
.catch(console.error);
}
this is new code, doesnt work at all, but the part where it responds with sending a message does work
oof
okay im wrong, does work but the status part doesnt set it to dnd when u use dnd as args
i use --set test watching dnd
and it sets it to test watching but not dnd
can I just add,
.then(message.channel.send("Bot Status Has Been Set To:" + "Name: ``" + args[0] + "`` Type: ``" + args[1] + "`` Status: ``" + args[2] + "``"))```
Makes no sense?
if the promise is resolved, then you can use the presence of the current client user.
How do you make an eval command?
@earnest phoenix u tell the button where to be
.catch(error => message.reply(`Couldn't delete messages because of: ${error}`));
^
SyntaxError: Unexpected token .
Who codes in .js and wanna help me make a bot? 😃
wahts ur problem?
I wanna team with someone to make a bot
no
lol
I code in js but well
I don't really like pressure
anyways
I'm bored so
For some reason this code doesnt work ${mentionedUser}
you need to define mentionedUser ofc
I know
you dont understand
oki sowwy
what are you trying to do?
Im creating a mute command i already made the part with you need to mention a user and now when i use the ${mentionedUser} code in the bot when its muting the mentioned user the code doesnt work
ouh
i did something to my library because of something wrong and now that stopped working
Oh
wait
got it working now
lool ok
gg
what exactly is mentionedUser
How do you make an eval command?
I know js has a eval() thing in it
but idk how to use it
well first you need to get what you type after the command
if you do a command I mean
anyone know how i can catch an error on my kick command
and have it send it to the channeö
l
what lang?
js
.catch(error => message.channel.send(`Sorry ${message.author} I couldn't kick because of: ${error}`));
should work aswell
const discord = require('discord.js')
const owner = ['274284493043531776'];
exports.run = async (client, message, args) => {
const first = undefined;
const memberr = message.mentions.users.first();
if(!memberr) return message.channel.send(`Mention a user!`)
if (!message.member.hasPermission("KICK_MEMBERS") && message.author.id !== owner[0])
return message.channel.send("You Do Not Have Permssions To Kick Members!");
if(!message.guild.me.hasPermission("KICK_MEMBERS"))
if (!message.member.hasPermission("KICK_MEMBERS") && message.author.id === owner[0])
return memberr.kick().then((member) => {
message.channel.send(":wave: " + member.user.username + " has been successfully kicked :point_right: ");
.catch(error => message.channel.send(`Sorry ${message.author} I couldn't kick because of: ${error}`));
});
};
owo you need to have the catch thing on the kick thing
that ;
return memberr.kick().then((member) => {
message.channel.send(":wave: " + member.user.username + " has been successfully kicked :point_right: ")
take out the ;
all you do is eval(code)
Ok
@lusty dew theres another problem, when i run the command it doesnt get to the kick user part, something is stopping it, so it doesnt send the error
Hmm
it could be
that it is mentions.users so you have to change it to memberr.member.kick?
idek
your IFs are not doing anything
dont use IFs like that, its confusing and its probably breaking your code
Hmm
//right
if(condition) {
//code
}
//wrong
if(condition)
//code```
Also shouldn't you use let instead of const?
oof
Since const declares a variable that can't be changed?
i didnt use let anywhere...??
I know
doesnt matter how you declare
I said shouldn't you use let instead of const
why does he have to use let instead of const
i always use var
its not needed
Ah ok
var is bad
Someone told me not to use var
i read a thing about it wew
its not bad





