#development
1 messages Β· Page 1172 of 1
π
i want to make a reason thing for my warn command, the reason incluxdes the user mention, how do i remove it?
@cinder sandal still unanswered
yeah because the member is not in a voice channel
Send ur code
So check it before
ok
if (command === ('warn')) {
const user = message.mentions.users.first();
if(!message.mentions.members.first()) return message.reply('You must tag a user.');
const WarnEmbed = new Discord.MessageEmbed()
.setTitle('Warned Successfully')
.setDescription(`${user} Was Warned.`)
.addField('Reason', `${args.join(' ')}`)
.setTimestamp()
message.channel.send(WarnEmbed)
}```
It shows the user mention is the Reason how do it remove it?
You should exclude the first argument by using .slice(1) on args
Also don't check for message.mentions.users.first() as it won't check for the first argument
then how it would check?
You'd need to parse it manually.
Aka grab args[0] and try searching for a guild member with that.
i grabbed the message.mention.users.first() from the kick/ban command.
so should i stop using message.mentions.users.first()?
should i let it turn on full night
it is taking so much fucking time
one hour ago it said 21 mib left
and even now 19
top worst hosting services
- Heroku
- Glitch (the most bad)
If you read what Glitch is for
meh heroku's ok i suppose
i use heroku
who asked tho
it's not intended for hosting Discord bots
that's why glitch is bad for discord bots ^
??????
now that's the better way to put it
Then again, most free services won't give you the best experience hosting a Discord bot
so should i stop using
message.mentions.users.first()?
@cinder sandal the reason I recommend you don't use it is because it's not reliable in all case scenarios, and because you can do more than just look for a mention. For example, if I write?ban They were rude to @Lite#0001, it would grab@Lite#0001as the target and punish them. That's not ideal and it's not valid syntax usually unless that's what you're aiming for (?ban Target> <Reason>preferrable)
It's easier to use message.mentions.users.first(), but it's not always ideal. If you wanted to use something else, I'd make a utility method like function findMember(guild, input). If you don't want to worry about it for now, you could stick with the mentions check first.
Ask away
I want my bot to log message delete etc
https://discordpy.readthedocs.io/en/latest/api.html#event-reference
But how can I make a command by which bot will send the logs to the scelected channel
You'd need to save those logs
i don't use a command handler, is that weird?
Well I also don't use
If you have a lot of commands it is
my command handlers doesn't work because i host on heroku, F
my command handlers doesn't work
because i host on heroku, F
@cinder sandal
Exact same
How do I send like success message?
@cinder sandal
Exact same
@safe kelp π¦ F i have many command that's a pain
How do I send like success message?
@drifting wedge what exactly is a "success message" to you
message.channel.send("Success!") 
The way I do it is following:
On event, check if channel is selected. Selected channel can be stored in a dictionary attached to your client where key is guild ID and value is channel ID. (something like client.user_channels)
When a command to change the channel is executed, I do client.user_channels[message.guild.id] = channel.id where channel is a TextChannel object. (Preferably use a database and write to it as well.)
Now, when an event occurs, use .get on client.user_channels (e.g. client.user_channels.get(guild_id)) and check if returned result is None.
If result from .get is None, I just use return. If there's actual data, I use client.get_channel to get the channel, make sure it doesn't return None, and send a message.
how can you make command handlers, if u host on heroku?
whats a bot that can change name
Your host doesn't matter. A command handler is simply a snippet of code that supports dynamic edits of commands either by rotating through files in a folder or file contents
my code basically ignores it, and doesn't run the command like it doesn't exist (no errors)
Now, as to how to make one in JS... I'm out, since I don't know JS. :p
@slender thistle well I don't understood properly
whats a bot that can change name
what
change name as in nickname?
You described properly
yes
Which part is unclear for you?
ye
I am a starter that's why
Do you use the commands extension or on_message for commands?
No
which
that wasn't a yes/no question btw
commands extension, then.
Yeah whatever it is
how to check for permission in discord.js and stop the command to be executed and say a message?
YouTuber called it class decorator method
@client.command() being the decorator
Γh
does discord.js and discord.py have a diffrence? (what can this one do and what can this one do)
one is for JS, the other is for Python
both have slight differences in naming methods mostly
but do they have diffrences in what they can do?
and different ways of utilizing properties
Not really, both are supposed to be full wrappers for Discord API
Pseudocode for your case:
@client.command()
async def setchannel(ctx, channel: discord.TextChannel):
client.user_channels[ctx.guild.id] = channel.id
# reply to the user
@client.event
async def on_message_delete(message):
# `message` is a discord.Message object, we can get its .content property.
content = message.content
# generate an embed probably here
# now we get the channel
channel = client.user_channels.get(message.guild.id)
# check if channel was received
if channel:
# send the message
else:
# probably return or ignore the "else" branch if it's not needed
Okay
vs code shows me errors that doesn't even exist/don't affect the command/bot
like Expression expected.
vs code is weird
Not really
// do stuff here
let a = 10;
a; // this line should say "Expression expected"
``` it happens because your statement doesn't do anything
fixes while adding an {
}
Hello my music bot was working very well but when I came back I checked the logs and I got this error (which is repeated every time I tried to play a music), I restarted it and it works fine but what could have triggered that?
here is the part
not always
and i have a try and catch block if not
search like ksnvdbdksbbsbxj from youtube, and boom no results
You're re-throwing the error in the catch block
and what should I do?
use it as a nothing found ?
the thing that worry me is that every normal music after this throw that error
Try checking if result.videos.length is equal to 0. If it is, no videos were found. You could also show us line 37 as that's where the error is originating
^ do that in try catch block if result is undefined
that's the line 37 so i'll try ton check the result.videos.length and throw a message if it's = 0 thanks
y
one more question in the catch block if the result is = 0 i throw an error or smth like that ? otherwise he'll execute the rest of the script and get an error. @sudden geyser @restive furnace
Any js one?
what do you need
there is example here
Thank you
so weird question how does my bot become seen on top.gg? like you can search for it?
How can I install module in js in terminal
@drowsy vector #support
How can I install module in js in terminal
@safe kelp @misty sigil
oh ty
@wanton iron the idea behind try/catch is because something threw an exception and you are going to catch it. Throwing it back out again intentionally defeats the purpose.
y i just saw that mb π
does someone know if Postman reacts to status codes send with express.js? ```js
.then(data =>{
res.status(201),
console.log("Succsessfull")
console.log(data)
})
.catch(err =>{
res.status(500)
console.error([Riven Post] ${err})
})
nvm added send and it does what is should
winston outputs like this why?
formatter: function (options) {
var message = "";
if (options.message !== undefined) {
message = options.message;
}
var level = options.level.toUpperCase();
switch (level) {
case "INFO":
level = chalk.bgBlue(level);
break;
case "WARN":
level = chalk.black.bgYellow(level);
break;
case "ERROR":
level = chalk.bgRed(level);
break;
case "DEBUG":
level = chalk.green(level);
break;
case "CMD":
level = chalk.black.bgWhite(level);
break;
case "READY":
level = chalk.black.bgGreen(level);
break;
default:
throw new TypeError("Logger type must be either warn, debug, log, ready, cmd or error.");
}
return (log => `${timestamp} [${level}] - ${message}`);
how does one customise the help command in cs
i wanna do some message embeds
how to change the undefined message
like in a ban command reason no reason specified or something
message ? message : "no reason"
a text instead of just undefined
what is the text defined as?
What music stuff does and doesnβt work with heroku ?
how does one customise the help command in cs
i wanna do some message embeds
@thin tapir can someone help with this, im using d#plus btw
what is the text defined as?
@misty sigil as an argument a.k.a <ban [user] <reason>
i want the bot send the yellow message in the channel invitescounter-lgos when the bot create him
channel.send is not defined
help me please
replase thaht for whatr
define channel
how do you have the bot dev role
how define it
client.channels.cache.get(channelid) as example
note: channel id is a string (a snowflake to be precise)
how to put cooldown in command handler
luckily discord.js is simple. client.commands.cooldown({t:5000}) just kidding
Wait what
how much the rate limit for feild in embed ?
hello
i need help
when ever i type node index.js it says :
const client = new Discord.client();
^
TypeError: Discord.client is not a constructor
at Object.<anonymous> (C:\Users\Owner\Desktop\Bots\index.js:3:16)
[90m at Module._compile (internal/modules/cjs/loader.js:1138:30)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:986:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:879:14)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)[39m
[90m at internal/main/run_main_module.js:17:47[39m
const Discord = require('discord.js');
const client = new Discord.Client();
client.on("ready", () => {
console.log(Logged in as ${client.user.tag}!);
});
client.on("message", message => {
if (message.content === "-test") {
message.channel.send("Hi I am Awake π ");
message.channel.sendFile("");
}
});
tysm
Noice
i tried to test the code but it says
message.channel.sendFile("");
^
TypeError: message.channel.sendFile is not a function
Now, attachments are made in a different way
const attach = new Discord.MessageAttachment("./path/to/image.png", "name.png")
message.channel.send("stuff", attach)
I think
ty
const embed = new Discord.RichEmbed() is not working
hey anyone know good vps?
const embed = new Discord.RichEmbed() is not working
@green bison Discord.MessageEmbed()
ty
@gaunt spear read pins in here
can someone help fix
const client = new Discord.Client();
const snekfetch = require('snekfetch');
var prefix = "$";
client.login("");
client.on("ready", () => {
console.log("shit is ready.");
});
client.on("message", async message => {
if (message.content.startsWith(prefix + "dm")) {
var args = message.content.split(" ").slice(1);
var msge = args.join(" ");
if (!message.guild.member(message.author).hasPermission("ADMINISTRATOR"))
return message.channel.send(
":x: You are not allowed to use this command!"
);
if (!msge) return message.channel.send("**Add A Message Pls**");
message.delete();
message.guild.members.map(m => m.send(msge));
}
if (message.content === prefix + "dm") {
var help_embed = new Discord.RichEmbed()
.setTitle("Please clarify your message.")
.addField(
"Infractions and errors:",
"`No value was showed.`"
)
.setImage(
)
.setColor("#ffa31a");
message.channel.send(help_embed);
}
});
@earnest phoenix looks like you copy pasted code!
yep

im not tryna get it verified
Never ever use YouTube tutorials for programming. Only watch videos like "RegExp Explained" "I coded x in y time" "Secret console features" etc. Nothing with the word "guide" or "tutorial" in the title. The same goes for writen guides/tutorials on websites like medium.com
The only guides you should use, is the library/language's official guides and docs.
The following websites may also be taken in use as they're always up to date, meant to help programmers, sufficient, and/or has a good explanation of what the certain things means, what they do, what they return, where to use them, where you can use them, etc.
https://www.w3schools.com/
https://developer.mozilla.org/en-US/
https://stackoverflow.com/
why do you even want a bot, when you just copy paste a command/code?
not exactly that but still applies
lol
still UHM

actually i have evidence now 
:banhammer:
@misty sigil what he did
good work

you just revealed you wanna make a dm all bot
is anyone gonna help me smh
The same goes for writen guides/tutorials on websites like medium.com
I find those very useful for explaining.
not with a dm all bot
@earnest phoenix we wont help you making mass dm command
what about for money
thats even worse
kk
and no looking for developers here either ty
-needdev
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
i dont think any dev in their right mind are gonna make a mass dm command ngl
don't ask for a mass DM command tho please
@sinful belfry @earnest phoenix dm'd me for help i said no he send >purge 40 and all of his messages were deleted and now he blocked me
lol what?
wheres my notification center for proof
https://hastebin-plus.herokuapp.com/SUswBuqbE3
why does cooldowns not work?
could be fake
@tight plinth would you mind DM'ing me anything else you have
otherwise, this isn't the channel to continue it
unfortunately thats all i have
Mass DM big wack
how long does it take to get the bot approval? Just for know.
π thank you soo much
can anyone help me fix this
TypeError: message.channel.MessageEmbed is not a function
yes it is not a function
hey guys
how do i let a command only work on people with admin rights?
discord.js
<guildmember>.hasPermission()
just send embed class with send() function
just send embed class with send() function
@summer torrent
like this? message.channel.send(embed)
yes
https://hastebin-plus.herokuapp.com/SUswBuqbE3
why does cooldowns not work?
that hastebin is js
i still have a nameerror
async def info_error(ctx, error):
if isinstance(error, commands.BadArgument):
await ctx.send('I could not find that member...')```
info not defined
help would be appreciated :)
any idea why this may be?
https://hastebin-plus.herokuapp.com/SUswBuqbE3
why does cooldowns not work?
@earnest phoenix Why don't you make a global cooldown?
that looks like the djs guide command handler cool down without handler on cooldown
Not development related @earnest phoenix
starman plz
I
@earnest phoenix no begging for nitro, and please keep this channel on topic thank you
I can't give you nitro no
sigh it really isnt a good idea to continue it
@sinful belfry ok you are intelgent for meππ’
@earnest phoenix You better start talking about development real quick if you're gonna keep posting here
@faint prism aa ok
For example, did you know that & and && represent similar but very different aspects in conditionals?
@faint prism yeah
can someone help me? @earnest phoenix.error() returns name error name is not defined. Code: @info.error() async def info_error(ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send('I did not recognize that command. You may be missing a parameter.')
@earnest phoenix What's different about them?
oops
oops
@lone coyote Can you post full error message?
sure
Ignoring exception in command tip:
Traceback (most recent call last):
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 847, in invoke
await self.prepare(ctx)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 784, in prepare
await self._parse_arguments(ctx)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 690, in _parse_arguments
transformed = await self.transform(ctx, param)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 535, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: amount is a required argument that is missing.
sure
Traceback (most recent call last):
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 847, in invoke
await self.prepare(ctx)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 784, in prepare
await self._parse_arguments(ctx)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 690, in _parse_arguments
transformed = await self.transform(ctx, param)
File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 535, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: amount is a required argument that is missing.
im trying to error handle that
- what ?
amount is a required argument that is missing
-@faint prism yeah
auger im trying to handle the errors
@lone coyote Actually there might be a relevant stackoverflow question
https://stackoverflow.com/questions/51214915/discord-py-missing-required-argument
Are you using the async branch of discord.py?
i believe so
From a few google results, it seems that there is a few differences in branches regarding that area
https://www.reddit.com/r/discordapp/comments/97cb5h/basic_command_in_a_discord_bot_doesnt_work/
although, I don't use discord.py so I don't know much more, sorry
thank you for helping regardless
I do recommend googling that last error msg though, might lead to some relevant forums
https://www.google.com/search?q=discord.ext.commands.errors.MissingRequiredArgument%3A+amount+is+a+required+argument+that+is+missing
my main concern is that @earnest phoenix.error() gives me a name error info not defined
i tried using client.command() to see if that would circumvent it
the other errors are irrelevant
For example, did you know that
&and&&represent similar but very different aspects in conditionals?
@faint prism lmao nice response
did you know && and ||...I forgot what to say
I was just trying to stay on topic somewhat lol
I know lol
A single | or & are bitwise operators and will evaluate the conditional after it. Adversely || and && no short circuit if the previous condition was true and will not evaluate the following conditional, which can save some devs from null references
I'm sure you know that though
Might as well finish what I was saying earlier though
may main concern is that @earnest phoenix.error() says info is name 'info' is not defined
.
you dont have info defined
how should i define it?
idk I dont know your code
i can copy past it
Turk varmi
from discord.ext import commands
client = commands.Bot(command_prefix="*")
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
await client.process_commands(message)
@client.command()
async def tip(ctx, member: discord.Member, amount: float, reason: str):
ctx.author = str(ctx.author)
member = str(member)
amount = str(amount)
await ctx.send(F"{ctx.author} tipped {member} {amount} for reason: '{reason}'")
@info.error()
async def info_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('I did not recognize that command. You may be missing a parameter.')
client.run('MYTOKEN')```
oh its .py
idk py xD
oh ok
yo
i do not think it is that hard and thats why im so confused. I cant figure it out
hello
for what OS?
oh using a library?
idk what you mean
idk what you mean
Are you talking about this? https://ffmpeg.org/
yes
And you're trying to use it within your bot's code?
havent gotten there
i was watching a vid
and it said to intall ffmpeg
and it didnt show how
and all other videos are soo hard
do you mean the ones that do show you how are too hard?
Is there a way to check if a player blocked another player on Discodd? Or do I need to make my own block system?
for which language?
english
coding
discodd
coding language
?
lmaoo
..........
ik thats what im saying
which coding language will the bot be in
how do i get the client ID with eris
do you have an ide?
You're out of your depth here
idk what that means :[
do you have an ide?
@lone coyote Not sure he knows what that means
fair enough
im new
idk what that means :[
@hard pumice What are you trying to do frfr
is this your first ever coding project?
I'd recommend doing a Hello World project first
Do you know what an API is?
That is how you ask Discord for data and interact with Discord
oh
VSC - an IDE (integrated development environment)
NodeJS - Used for running Javascript as a standalone (from a browser) program
check for the user's role before executing the command
so back to my first question can anyone teach me how to install ffmpeg
theres so many youtube videos on that
@hard pumice You need to learn how to use APIs and other project's libraries before approaching a discord bot project
@earnest phoenix ik but when i try to do ffmpeg in the command prompt it says directory not fpund
Just tell the man how to install ffmpeg
@hard pumice This probably isn't what you want but:
- Download https://ffmpeg.org/download.html
- Run setup file
- Follow instructions on screen
waht
go to site
Download FFmpeg builds for Windows or macOS, available as LGPL or GPL.
oh
the heck is zeranoe
click download build
sure
all i did
you have to add ffmpeg
go to vc
To your path
Or cd to the directory and run the binary file there
well i dont have it in a certain thing
its in my c drive
just there
can you cd to that?
yes
cd is a command prompt command for changing directories
VSC - an IDE (integrated development environment)
@faint prism vsc isn't really an IDE
ik
@faint prism vsc isn't really an IDE
@sudden geyser bro I'll fight you on that

shit
@sudden geyser you win
It's a glorified notepad with plugins that compile for it 
mk
C: is just the drive letter
well i dont need to see the files
ik the name
thats more complicated in looks than it actually is
what is? cd C:\ ?
type dir
my files dont say exe
it lists all files in your current folder
like ffmpeg.exe
ik
ill try
wait
tf
now it says exe when i say dir
but not in the folder
C:\ffmpeg\bin\ffmpeg.exe <-- This
π
i lost hope
but i now regained it
imma drink some water to celebrate
then why in the vid does the guy type ffmpeg
and this comes up
but i have to do ffmpeg.exe
i had everything right this entire time
just i wasnt saying .exe
Yuppp
You should do this @hard pumice
how can i get info to not give me a name error
async def info_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('I did not recognize that command. You may be missing a parameter.')```
@faint prism is there something im doing wrong
the token is my bots token so idk how thats wrong
and the code is the same on the other thing Β―_(γ)_/Β―
@sinful belfry token leak
hm?
@hard pumice Please go to discord dev and regen your token immediatly
comm after "Client"
ill dm you
you missed a comma
yes
whre
after Client
After "Client"
bruh
it just made 2 more problems
bruh
wait
i got it
but theres still something else
thats wrong
1 more
const { Client, Attachment } = require('discord.js')
bruh
so dont worry
stop leaking your token
k den
Change Let to let
oh
Mate you will need some js knowledge to code a discord bot
also ^
w3schools
Or read the js docs
If you don't know JS but would like to learn about it, here are a few links to help get you started:
CodeCademy's interactive JavaScript course
Eloquent JavaScript, a free online book
Nodeschool, for both JavaScript and Node.js lessons
MDN's JavaScript guide and full documentation
Google, your best friend
Take your pick, learn some JS, and once you feel like you're confident enough to make a bot, come back and get started!
yall are recomending me 3 differnent things
It's the same language wherever you go
aight
its saying my token is invalid when i try to run my bot
but its right
is there a reason why?
its the bots token
And doube make sure it's not the client secret
@glossy elk
what is that?
Press copy.
Put it in your text editor.
is that my constant token ?
yes
mk
unless you regenerate
yup
doesnt say u did
did it right before i typed that
ctrl s right?
file => autosave
your client's token is invalid
?
ok
Is it though
idk
but it's invalid
I see an error
where
Did you accidently put a extra letter or copied something wrong
In the thumbnail-sized screenshot you posted
huh
regen it and see
"no biggie" ok
what
can u be serious
did you mess up the login of it
login?
regen the token and paste it back
you have to log the bot in bot.login(token) at the bottom of the code
^
ok nice
i had that before, just waited a few hours and it worked π€
How can I fetch application info via a token
yes.
i see
i was dumb
and didnt know
that
eris is literally so similar' to djs
anyways
How can I fetch application info via a token
@glossy elk
what token?
any token
yup
well the least you can do is get the client id
yeah, how can i fetch tho
fetch what?
the id is the only thing you can get
ik
what do you mean by fetching the application?
do you know how to get the id?
okay let me try to rephrase this
I am trying to fetch a discord client application via a discord bot token
mmm
well if you were to login
and you did client.appINfo or something
not sure what it was
you can see the info of it
ClientApplication#
that's oauth
it uses @me
i mean
just do a GET request from the REST api with the token as authorization and access @me
how do i fetch messages in v11
what are you doing
can i use __cfduid cloudflare cookie as a unique user identifier for rate limtis?
why does
this show when i try to use &gay to overlay and image over the command author
my bot went down just recently because of a storm will anything happen to it if thereβs 20 minutes of downtime?
@swift umbra no?
Hey i think there's something wrong with my userinfo command. Whenever i run the command, it shows today's date for the joined date and idk why.
What's joineddate
Wait I didn't sent it
const Discord = require('discord.js')
const moment = require('moment');
const { utc } = require('moment');
module.exports = {
name: 'userinfo',
description: "This is a userinfo command",
async execute(message, args) {
let userArray = message.content.split(" ");
let userArgs = userArray.slice(1);
let member = message.mentions.members.first() || message.guild.members.cache.get(userArgs[0]) || message.guild.members.cache.find(x => x.user.username.toLowerCase() === userArgs.slice(0).join(" ") ||
x.user.username === userArgs[0]) || message.member;
if (member.presence.status === 'dnd') member.presence.status = 'Do Not Disturb'
if (member.presence.status === 'online') member.presence.status = 'online'
if (member.presence.status === 'idle') member.presence.status = 'Idle'
if (member.presence.status === 'Offline') member.presence.status = 'Offline'
let x = Date.now() - member.createdAt
let y = Date.now() - message.guild.members.cache.get(member.id).joinedAt
const created = Math.floor(x / 86400000)
const joined = Math.floor(y / 86400000)
const joineddate = moment.utc(member.joinedAt).format("DD-MM-YYYY, HH:mm:ss")
const createddate = moment.utc(member.createdAt).format("dddd, MMMM Do YYYY, HH:mm:ss")
let status = member.presence.status```
.setAuthor(member.user.tag, member.user.displayAvatarURL())
.setTimestamp()
.setColor('RANDOM')
//.setImage(member.user.displayAvatarURL())
.setImage(member.user.displayAvatarURL())
.setThumbnail(member.user.avatarURL({ format: "gif" }))
.addField("Member ID", member.id)
.addField('Roles', `<@&${member._roles.join('> <@&')}>`)
.addField("Account Created on: ", `${createddate}`)
.addField('Joined the server on', `${joineddate} \n> ${joined} day(s) ago`)
.addField("Status", status)
message.channel.send(userEmbed)
}
}```
Joined date is the date you joined the server
what happens if you copied the id of a emoji in a server and its used somewhere by your bot but you delete that emoji from your server
when i do: @info.error() async def info_error(ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send('I did not recognize that command. You may be missing a parameter.'): it gives me name error 'info' is not defined
please help
discord py btw
please ping me if you can help
:)
if i use this command to get an emoji what happens if theres multiple servers with the same name for emoji?
you're checking for emojis from the message's guild
it won't find emojis from other servers
gotcha
can someone help with my code as i havent figured it out for over a week?
the problem is when i do @info.error async def info_error(ctx, error): if isinstance(error, commands.BadArgument): await ctx.send('I could not find that member...') copied from the documentation it says name error info is not defined
does anyone know how to make a meme command ?
Literally everyone does
i think i am the only one that don't know how anymore ;-;
let channel = client.guilds.channels.cache.find((x) => (x.id === "739469830343753778"))
why this is not working
:/
idk
Are you using v12?
Are you using v12?
who ?
@weak rain
Yes
@weak rain if u didn't,go in the terminal and put after the last word npm install discord.js if u didn't do that
did you downloaded node.js ?
did you put the token where it's supposed to be ?
Yes
@weak rain try
let channel = client.channels.cache.get("739469830343753778")```
is 1gb ram sufficient for hosting 2 bots?
Can I get the bot's member object? like client.user is a thing i think, but client.member?
wait nvm im dumb
docs are thing
kek
`const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('token');`
that might work
@delicate shore if they are small my bot only has 512 mb of ram
and name the main folder "main.js"
what is a small bot
<500 servers imo
@weak rain try
let channel = client.channels.cache.get("739469830343753778")```
@heavy anchor mm
kk
ty
after that its kinda medium sized
my bot is in 618 servrs
but it really depends
I have 80 guilds and 200k + users
my bot is in 2 server causse idk how to make it go on the discord bot list rn
Oof ok idk then
It worked thanks @heavy anchor
No problem glad it worked
guys,just for ask what the code for meme command ?
what
no spoonfeeding here
Very easy find a meme api make a request and send the link in an embed
https://hasteb.in/afacetuq.js my bot is not playing music but why?

is that meme command for the one who know ?
https://gyazo.com/83c536ac9baedef16e6d86db29fdcaee
Discord.MessageEmbed
@thick gull i am not sure it's the code so i am waiting
uh who know how to make a BOT public ?
How can I send HTML form data to a Discord webhook?
With the website
I designed the website but how
@swift void the easiest way that I know of is with google forms following this tutorial https://github.com/JLDENSMORE/Google-Forms-to-Discord
Aw man, so I have to use a google forM?
Thatβs the only way I know how to do it
Oof
You know you can embed google forms into your website
BRUH
Please don't copy n paste
STOP POSTING THAT IN EVERY CHANNEL
but there's Invite Manager
I told you to be patient
Shiv. Mute him pls? #topgg-api
Yeah just mute lol
The any off-topic conversations will be deleted and muted rule
Oof no need to tell a mod how to do their job
exports.commands = new Discord.Collection();
exports.aliases = new Discord.Collection();
exports.info = new Discord.Collection();
why does exports show up undefined
Why not export it as an array instead of multiple exports?
How do I add a Login to Discord function?
i need a bot dev!
@sudden lily dm
ok
@sudden lily it's not hard to dev a bot
Says the person asking how to make a meme command...
let rNew = await message.guild.roles.create({
^^^^^
SyntaxError: await is only valid in async function
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at E:\Thunder\handlers\command.js:19:24
at Array.forEach (<anonymous>)
at module.exports (E:\Thunder\handlers\command.js:11:32)
E:\Thunder>```
done
yeah finnaly it worked
at Object.run (E:\Thunder\commands\logs\setup.js:36:30)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:7156) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection,
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7156) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
why erro
let rNew = await message.guild.roles.create({
data: {
name: rName,
color: 0xFAC200,
permissions: []
},
})
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});
console.log(`ID: ${rNew.id}`)
let cName = "thunder-modlogs"
let cNew = await message.guild.channels.create(cName)
console.log(`ID: ${cNew.id}`)
let hgembed = new Discord.MessageEmbed()
.setColor("0x14DF73")
.setDescription("β
***Sucessfully completed my setup***")
.addField("Things I created:", `${rName} role & ${cName} modlog channel`)
.addField("Things you have to do now:", "setup the permissons for the muted role and modlog channel & then i will be fully set and ready to do my work")
message.channel.send(hgembed)
}
}
}```
@weak rain read error : (node:7156) UnhandledPromiseRejectionWarning: TypeError: message.guild.channels.forEach is not a function
so what should i do?
kinda related more to the topgg advert page, but how would I go about adding a css animation to the bot icon
i have the code I want to add
Any1 know canvas here?
but whatever I try dont work
how to track someone with his phone number
Lmfao
Any1 know canvas here?
@viral iris https://dontasktoask.com
How do I edit the CSS styling of an element through JavaScript? I am not really that good at CSS (I only use style tags in HTML webpages)
I tried:
<p id="yo" style="color: yellow;">yo make me green</p>
<script>
var theElement = document.getElementByID("yo");
theElement.style("color: green;");
</script>
of course it won't work theElement.style is a property not a function
i really need help on this - how to track someone with his phone number
wut
we won't help with hacking and privacy breaches
how do I sent HTML form data to a discord webhook,
tracking someone is a privacy breach
how do I sent HTML form data to a discord webhook,
@swift void bruh
how can I implement oAauth in a site,
the discord webhook gives you a url right
how can I create a web page for every click of a buton
button*
I'm trying to make my own bot list
how do you NOT ask for spoonfeeding
how do I sent HTML form data to a discord webhook,
@swift void send the form data to the discord webhook url
those were jokes I know how to do each and every one
How do I edit the CSS styling of an element through JavaScript? I am not really that good at CSS (I only use style tags in HTML webpages)
I tried:
<p id="yo" style="color: yellow;">yo make me green</p>
<script>
var theElement = document.getElementByID("yo");
theElement.style("color: green;");
</script>
e
tracking someone is a privacy breach
@earnest phoenix i wanna find my brother's location
that's not a breach
;-;
the way you asked us
by a phone number?
Try GPS location or contacting your local law enforcement agency
Second option
How do I enable sever bot status ?
Yes
@viral iris https://dontasktoask.com
@earnest phoenix if u know it I need help with something
@earnest phoenix if u know it I need help with something
@viral iris the way you worded it
-ask2ask
Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
Please read https://dontasktoask.com/ for an explanation on why this is an issue.
Try GPS location or contacting your local law enforcement agency
@slender thistle what do u mean exactly
With gps
Code how do I ?
how caan i track him
Go for the second option please
Code how do I ?
@shy cairn one second I'm typing
<client>.guilds.cache.size
guilds.cache.size
"server count:" + client.guilds.cache.size
WhTs that
The sercer count

How do I look
??
Why is v11 going to be removed
Why is v11 going to be removed
@glossy elk because of the api url changing iirc
So if we modify it
thats not the main thing
We can still use it
intents is not implemented in v11


