#development
1 messages · Page 1678 of 1
there isn't a list
you do research on your topic
and find some information on it
https://pastebin.com/PnF2ipSz how come this sends the same warnings 3 times
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
essentially all i want this to do is split the cases by 5
so if a user has 10 cases,send 2 embeds
well 6 ,but same thing
but now its sending like 9 cases on one embed x3
and one singular case
its weird
God, that isn't working
I can't send what permissions my bot need
In any server
When it join in any server
He doesn't create his own role
any leads to where this could originate from? my whole bot crashes on the same error almost on regular basis like every 30 hours
So weird

Looks like a common disconnect to the gateway.
I would guess your app is crashing because you didn’t handle the error as this was still allowed in older node versions.
Lemme guess you’re using node 15+?
bump
Hello, does anyone here know how I could break a new line (\n) in the description of my embed in broadcast without errors?
message.client.shard.broadcastEval(`
(async () => {
const Discord = require('discord.js')
const a = new Discord.MessageEmbed()
.setColor('#e5b3b5')
.setDescription("Apple \n Bread")
})()`)
huh?
I'm trying to find a way to make a new line, because the code above caused an error coming from \n
Ya in eval
Did not work :(
Was wondering too and took a second view on it
Why are you actually creating an async function?
You’re going to await the message?
What kind of error do you get anyway?
Nevermind, I forgot a quotation mark. Your solution works, thanks :))
My bot won't stay online after I run my code. How do I fix this?
Debug your code and/or provide any error codes since nobody in here owns magical glass balls 
ok thanks 🙂
sounds promising, I think I read something about disconnects and not handling it while trying to find its origin, I'll give it a try, thank you 
and yeah, it's node 15+ 😆
hmm is http://127.0.0.1:4000 wrong?
have you added it to your redirect_uri's on the dev portal?
obviouly you can't point to localhost 
i love how all of these services restrict how your redirect uri can look like
patreon only allows https etc
discord literally doesn't care 
as long as discord sees two slashes in the redirect uri they'll just say "yup, that seems okay to me"
ssh://111.222.33.444 possibly valid either
anyone knows how to fix this problem?
Make it lowercase
Np
Is anyone knows, what's wrong with my code? The bot doesn't reply when I type -kick 😦
just so you know, in coding, 0 means 1, 1 means 2, 2 means 3 and so on
so if you typed -kick @cinder lodge reason1 reason2 reason3
@cinder lodge is args[0], reason1 is args[1], reason2 is args[2] and so on.
Sorry I don't understand what you mean, can you explain what code I have to change?
let me explain better
okay
like this
well, then you need to change args.slice(1) on line 12 to args.slice(0)
done, what's next?
try it now
still doesn't work
check your console
put all of the code in one big try and catch
then check for an error
what do you mean in one big try?
try and catch
try{
all the code here
}catch(error){
console.log(error)
message.channel.send('Sorry, there was an error.')
}
Are you mean I have to put all my code in try { on line 30? Sorry I don't really understand, I just learned to code.
😦
just put everything below line 9 in a try{ statement and then at the end put a
}catch (error) { console.log(error) }
good luck
Like this?
Like this?
better, but you seem to have some errors with the catching part.
catch (error){
console.log(error)
}
^^ move this part down one line
Is it like this?
here
ill give a better example
try{
await mentionedMember.send(kickEmbed)
} catch (err) {
console.log("I was unable to message the member")
}
} catch (error) {
console.log(error)
}
hopefully this helps a little
That is how they meant, but doing that isn't necessary as your code doesn't have any logical errors that would require that large of a try catch block.
Doing that will log an error if your client tries to send a message to a channel they don't have access to which may not be intentional considering that's just unnecessary and there's nothing you can do about it reasonably.
if args is defined as the message content split by a space after the command, then what you have to change is reason = args.slice(1).join(" ") as slice returns an array between two indexes. If only 1 index is provided, then it goes from the index to the end of the Array. Providing a 0 would just be duplicating the Array as index 0 is the first index. What's expected to be at index 0 is a user mention. Not the start of the reason string.
to answer why your bot isn't responding to your message, try putting a console log at the start of the inside of the run function, restart, then try the command. If there is a log, then your command is being called and something is preventing the rest of the function from being run. (this is unlikely since I read the code and everything makes sense logically)
If there is no log, then this might either be that your logic to get a command object might be flawed or your client doesn't have permissions to read messages in the channel you're sending the command in, or it doesn't have permissions to send messages in the channel you're sending the command in.
Or the bot isn't online. Or the bot needs to be restarted depending on how commands are loaded into memory
It says this
message.mentions.member is undefined
how to fix it?
make it message.mentions.members
on line 11 right?
yeah
Also make sure to await the embed sending before kicking the user if not done already
It WORKS! Thank you very much for helping me! I am so happy. @earnest phoenix @quartz saddle @lament rock
If he gets kicked right after the embed is sent he won’t be able to read it anyways
np :)
What line I should put this?
Dunno can’t see your kickembed being sent on your screenshots
Just the line you declare it
You should kick first then send the embed, because if the kick fails, then the bot would look like a clown for sending the message in the member's DMs. Notifying the user shouldn't be a top priority. If the user still shares guilds after being kicked and doesn't have their privacy settings blocking messages from other servers, then the message would probably still send
Hmm it may be a DM...
Didn’t think about that.
But your method wouldn’t work anyways if the client and the bot don’t share the same server anymore the client won’t receive a message anyway
So overall all permission checks etc. in the first place, then awaiting message, then kick
If a DM is necessary needed
Shouldn't matter. Notifying the user directly shouldn't be prioritized because of volatility with permissions to DM someone
And the message needs a catch due the fact lots of people don’t even allow DMs from non friends
I know but he doesn’t
I would not send him a Dm Cause of this fact
water on the screen is horrible
what does coro mean
The error means you're missing some argument in some function.
what is line 614?
wait I'm blind
Remove the parentheses
where? on @open nestar_error?
here
OOP i just pinged someone 😬
ty
Does anyone know how to do slash commands in discord js? I'm not using any command handler or anything like that (I think thats what its called?)
someone help? socket.io ```js
SERVER.JS
const io = require("socket.io")(3285);
console.log("hi");
io.on("connect", socket => {
console.log("user");
socket.emit("chat-message", "Hello World");
})```
SCRIPT.JS
const socket = io("http://localhost:3285");
console.log("on");
socket.on("chat-message", data => {
console.log(data, "hi");
})```
```html
HTML
<html>
<head>
<title>Chat App</title>
<script src="http://localhost:3285/socket.io/socket.io.js"></script>
<script src="script.js"></script>
</head>
<body></body>
</html>```
giving connection refused errors
and Access to XMLHttpRequest at 'http://localhost:3285/socket.io/random stuff' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
how make bot reply to message
What language are you using?
me?
Yes you
python
Oh, ok sorry I'm afraid I cannot help 
I can try though, I see you have the bot dev role. You've made A command right? Where it would respond do something like "!help" (example)
If you have it's basically just that, but you change out that for your word
If you want bot send Message in the channel of the Command executed you can use this.
@client.command()
async def command_name(ctx):
await ctx.send("Your reply Message")```
Else I can't help you sorry ¯\_(ツ)_/¯
wait how do i get the bot developer role?
after your bot got approved
What code should I add if I want to make slowmode 0 / slowmode off?
Hi (: how could I get the guildId inside a commandRun event?
I just have the executed command and does not have reference to the current guild
can you explain better?
if you want the guild id it's
message.guild.id
Edit channel and change ratelimit
Can you give me an example please? I am newbie :(
db.subtract(`gbank_${message.author.id}`, 1000000
Error: Target is not a number...
The stored value needs to be a number if you want to subtract
There already is a number.
Ther error says it isn't
I have 2.5 Million In my balance.
It alr has a number...
It just wont let anything be removed-
I can use my remove, setbal, and add commands fine.
Maybe its a string...
This is the first time I've ever encountered this error over years
Idk then
😩
Use like this
const amount = parseInt(args[1]);
//code
db.subtract(`gbank_${message.author.id}`, amount)```
I think it should work.
It's a buy command, so it needs to be a certain number.
Oh
const amount = 1000;//Example```
Like this^^
Well, it's a target error
I've alr tried that
Target should be a item name right
Along with everything else my years of experience has taught me 😩
Oh
It means it's not a number.
Oh
Whatevers specified in the DB Isnt a number.
Oh
😩 I'll just economy reset, seems as it's my only option at this point.
But every users acc will be deleted 😭
Only their balances.
ohok
djs?
no
Hmm Ok Sorry
I guess google rejected the translate request
no what is it
wait what
oh i saw this
why is javascript so hard
it is not?
So sending files is now better than sending embeds or screenshots 😩
its really complicated for me to understand :l
wait what you can send files in discord
Wait that's a screenshot?
yes?
omg i just found out
you can send everything but there is 8 mb upload limit for non-nitro users
niceee
Hi for anyone that knows Typescript,
I want to pass in a parameter that is basically one of the property names of a given type, is there a way I could select a Type's given properties as a string literal type?
You could do keyof typeof Interface|Class
oh I like that let me poke around and see if that would work
keyof works great
thank you @cinder patio
what
This is neat
i don't see anything
This?
Hello i need help
Oh u wanted me to screenshot it
yes
const sendError = require("../util/error");
module.exports = {
info: {
name: "join",
aliases: ["come", "connect", "hey"],
description: "Join The Voice Channel!",
usage: "Join",
},
run: async function (client, message, args) {
let channel = message.member.voice.channel;
if (!channel) return sendError("I'm sorry but you need to be in a voice channel!", message.channel);
try {
const connection = await channel.join();
queueConstruct.connection = connection;
play(queueConstruct.songs[0]);
} catch (error) {
console.error(`I could not join the voice channel: ${error}`);
}
message.client.queue.delete(message.guild.id);
serverQueue.songs = [];
message.react("👌")
},
};
Well this is a bearable mistake
I made this
but bot isn't reacting to that message
when joined
:/
pls help
@cinder patio
is everything else working?
So like, the bot joins the channel, it's just not reacting
and you're not getting any errors?
Btw, where do you define the play function
the code never gets executed in the first place
I'm not going to give you anything except advice on how to fix your code
so pls tell it once again
why bot not reacting to the message
:(
ok
i fixed
@cinder patio
nice
Is it possible to put a variable in an embed footer? (python)
Yes
(text="Servers:", len(client.guilds)

f-strings worked, thanks!
Aye, np
Yeah
yes why not
does someone know how to get someones nickname in a server with discord js? I've looked through the docs and through many different posts across different platforms, and all have just given me "undefined"
GuildMember#nickname
I've tried like ```js
${message.author.username}
${message.author.displayName}
message.member
How exactly do I say that? I'm not using a command handler or anything like that just normal discord js
wait would you mind like putting it together? i'm kinda confused sorry
Thank you!
Would anyone know how I could get like a mentioned users info? I'm making a userinfo command (why i needed the nickname) and I tried something that had worked before, but the functions like "member.typingDurationIn" isnt working (Before it was message.author.typingDurationIn).
you don't return out of the method @dusky lagoon

very much copypasted vibes
you already do it in your code how tf are you still figuring out how
message.mentions.users
BRUHHHH dont tell me you just said that
useful guide for you https://discordjs.guide @simple zodiac
so like
${message.mentions.users.typingDurationIn(message.channel)}
```?
That's how I have it in my main thing with the author except it isnt the mentions
no
@vivid fulcrum
I'm going off of the discord js docs https://discord.js.org/#/docs/main/stable/class/User, should I not be using this?
message.mentions.users is collection of mentioned users
oh
if you want to get first user just do message.mentions.users.first()
yeah thats what i have var member = message.mentions.members.first();
that is docs
discordjs.guide is guide
discord.js.org is documentation
I've got this and then I'd do ${member.typingDurationIn()} and it would say that (that code) is not a function
it is property then
how would I write it though? Cause i keep getting the same few errors editing that one
remove ()
now it says that it cannot read property ID of undefined (i tried to say member.id somewhere else)
bruhhh that how coding works noob we learn by copying??? white name
😂
good for you, i didnt ask though
cry probably knows better than you, having been active here for a while 😛
Also, why are you bringing nonsense roles into this
ugh nvrmind
"white name" lmfao
i really dont get what is up with people trying to claim code from guides is theirs
And you don't learn by copying. You learn by researching, evaluating found snippets, thinking about how they work, and then using them
🤭
hey NMW idk if you saw this ^
bruhh claiming i have never said claiming
dumbass
rule 1 bro
No but it looks like you're getting offended by someone pointing out that your code is copied

when it is
you were implying it
bruh go @vivid fulcrum in a corner
ok
😂
are you like 11
https://discord.js.org/#/docs/main/stable/class/User?scrollTo=typingDurationIn
that is user which means you should change members to users
so i make it var users = ...
also in code yes
you can better stop now cry
mentions.users
Can we move on
oh ok
thanks
ill tell you how that works
@dusky lagoon you can better stop being dick
This is starting to look like a kindergarten
That's not a bad thing
a?
Stack overflow 🏃♂️
Not many people there who are proficient in Discord bots imo
Okay so it works when I ping someone, but now when I just do "userinfo" it says cannot read property ___ of undefined. (it says that for all the properties like .nickname and stuff) I tried having it like if users === "" but that didnt work, so it only works rn if you ping someone
it's just like any other library, unless you're writing a library, god bless if you are
theres a learning curve because people don't want to take their time to learn and understand what they're doing
programming is not for everyone
Yo mama so fat she couldnt Even stand 😳

I were paid to say that
Guys is there a way to make a bot online 24/7 for free
Okay so I figured out how to make it work if no one is mentioned (if (!message.content.includes(users))), but, when I mention someone, the username says "undefined" (even tho they have a username) The code for that one is "Username: ${users.username}". Users is stated before like with the mentions.users thingy
is it 24/7 or 7/24? i dont even remember
I use repl.it, apparently it isn't the BEST for security, but, my bot is hosted 24/7 for free using that. if you don't use it though, im sorry but I cannot help
I use repl and uptime robot together and its basically 24/7 atleast (really good uptime i dont think ive seen my bot go down)
i can use replit.com yeah
if you do transfer your stuff over to repl there should be a tutorial, I'm going to try and find the one i used
thank you!
Here is the link, and here is the code you'd need to put at the top of your file.
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => res.send('Hello World!'));
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`));
``` (also in the guide). https://dev.to/fizal619/so-you-want-to-make-a-discord-bot-4f0n. The rest is here but yea
I should've said , this is for JS
I'm not sure about other languages exactly
you could probably find something though
i use djs
and since repls are public (at least free ones) you will prolly wanna follow a little more of the guide as it shows how to hide ur token
ok good
wait what? people can access your code?
i have a config file
yes, but only if they know your profile name
If you pay for the premium one of repl you can get free ones
I mean you could make a new profile with an obscure name
but dont worry the TOKEN is hidden if you follow the guide
do i need to do that proces.env.token thing?
if you're doing it on repl, you definitely want it in a .env
cause people can see your config file
so whatever is not in a .env is public
i believe you can have your config code in the .env
or just in your index.js
im not completely sure how that works
my bot is pretty simple so i only have like 3 files lol
oh lol
prefixes.db, .env, and index.js
actually i stopped making bots for 2 years and now im a beginner again
i just dont know what process.env is
oh
I dont really understand that part but
it just takes whats in the .env and then uses that to log in
think of the process env as just the bot logging in maybe
if that helps?
and yea as it says its just logging in
omfg
yes?
i just tried to search for my friend's account
mhm?
lol
& do the env thing
im gonna troll him first, then tell him
really useful thing to know
he has something like 20 repls
probably not the best idea but i cant stop you
i will not change anything
i got quite a few repls too
aight lol
had what?
process.env.token
oh okay
ok so im gonna watch that thing like now
aight
its just an article thing
idk what there is to watch exactly
but i would like to see you try
this in index.js or in a new file?
server.js
can anyone help me
I uploaded bot logo on github
and i take the link
and applied in the code
but
image not showing in embed
index
ok ty
in which language
could someone help me with something? I made a userinfo command using discord js, and, when I ping someone to get their info like "userinfo @simple zodiac " (it'd be someone else but you get the point) it says "nickname: undefined". The code for nickname is Nickname: ${users.nickname}. Also, var users = message.mentions.users.first(); is before that. Anyone know how to make it not be undefined?
@simple zodiac wait so i just create a file at the left called .env?
yeah
js
oh lol
and i just paste what was in the config file?
this is what my sidebar looks like (obv you might not have my other one(s))
The Intl.NumberFormat object enables language-sensitive number formatting.
ok thank you!
thx
Just post whatever's in your thing at discord.com/developers/applications.||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||https://pays.host/SA3wEEwb
just changed token if it was visible behind my epic censoring 😎
wait so just like this?
It's user.username
remove the ""
and i put the things
why?
idk thats just how they work
but my var is users
k
like for my token its just
you got the gist
yes, I have that. it's users.username. but it says undefined still
exact screenshot of my code
send all your code
wait do i need to do DISCORD_TOKEN or i can simply put token?
just to know
you need to change whats in process env in that case
You can use a bin
yeah
I'll just put whats in the else part (where im having issues)
else {
var users = message.mentions.users.first();
const uEmbed = new Discord.MessageEmbed()
.setColor(`RANDOM`)
.setAuthor(`Userinfo for ${users.tag}!`,"https://cdn.discordapp.com/avatars/"+users.id+"/"+users.avatar+".gif")
.setDescription(`\`\`\`yml
Username: ${users.username} \\\\ Tag: #${users.discriminator}
Bot: ${users.bot} \\\\ Creation Date: ${users.createdAt}
Nickname: ${users.nickname} \\\\ Typing Duration in this channel: ${users.typingDurationIn(message.channel)}s \\\\ Flags: ${users.flags.toArray()}
Avatar URL: cdn.discordapp.com/avatars/${users.id}/${users.avatar}.gif\`\`\` `)
message.channel.send(uEmbed)
}
so like this?
the if before the else is if no one is mentioned
yes
Have you tried logging users?
change token with whatever the name of the var is (exact caps)
oo and, what if i have a whole 1,000 lines of code, and i dont want to add anything to every line that should show a number, can i just like add a function at the top of the code? if yes, what/
Have you defined the variable users anywhere else
in that file
and this at the start?
Yes, but it's the exact same definition
sorry if im being annoying i just want to be sure btw
console log it
okay
ight
@vivid fulcrum
Put it after the variable declaration
ok
Then that code block doesn't run
just use <number>.toLocaleString()
Still nothing?
i have no idea what i'm doign wrong
the other code runs
am i stupid
else {
var users = message.mentions.users.first();
console.log(users)
const uEmbed = new Discord.MessageEmbed()
.setColor(`RANDOM`)
.setAuthor(`Userinfo for ${users.tag}!`,"https://cdn.discordapp.com/avatars/"+users.id+"/"+users.avatar+".gif")
.setDescription(`\`\`\`yml
Username: ${users.username} \\\\ Tag: #${users.discriminator}
Bot: ${users.bot} \\\\ Creation Date: ${users.createdAt}
Nickname: ${users.nickname} \\\\ Typing Duration in this channel: ${users.typingDurationIn(message.channel)}s \\\\ Flags: ${users.flags.toArray()}
Avatar URL: cdn.discordapp.com/avatars/${users.id}/${users.avatar}.gif\`\`\` `)
message.channel.send(uEmbed)
}
That block of code doesn't run
We can't tell you much without giving us all the code
Because if it did, it would log users
Codeblocks updated?
wut
send the entire file
a file
thats the whole code for the thing
message.content.includes(users) is always false
because a string cannot include an object
normal feature
how do i turn it on?
oh
What's the point of checking that
so now if i click stop the bot continues to work?
@simple zodiac Just change it to !users at this point
so I check the authors if they dont specify a user
no
will that work..?
what
if you stop it.. it stops
if you just leave it or close the tab whatever it WILL stay up
k
so now it says if (!users) {
<code with message.author>
} else {
<code with users.stuff>
}
Still says undefined for username
but it does log user
Also why would you use if statements for that
You can just do const users = message.mentions.users.first() || message.author
oh ok
You could use the logical OR operator to fallback to author
and get rid of the else?
no
oh
get rid of the code inside the first condition
ok
it says unexpected token || when i did that
it says location.lat is undefiened
referenceError: env is not definied
you're not doing something right then
that part fixed yeah sorry
env -> process.env
so now this is my code for it https://sourceb.in/wg2NhBGcne
is the token in the .env referred to as "token =..."
it has to process the name of the var for your token
Try logging users then
it still is
or
oh sorry it was
ig i delteed it
let state = guild.votes.some(g => g.userid === userid);
console.log(state);
if(state){
let position = guild.votes.indexOf(g => g.userid === userid);
``` having some problems lol
I want to get the position of the user object in the array guild.votes
state gives true
but the position -1 ?
but it exits
this is what it said in console
findIndex(), not indexOf
Users don't have nicknames
it's .username
Only guild members have nicknames
they are in a guild
if you want the nickname then it's GuildMember#nickname
User !== Guild Member
, shame on me, what does indexOf do?
how do i actually say this in code? i have never used anything like that before
do you use getUserFromMention?
im not sure what that is, so thats gonna be a no
indexOf is the same thing except you give it the value not a function that finds it
You can use <Message>.mentions.members.first() to get a member instead
thats what users is..
const users = message.mentions.users.first() || message.author
add const mem = message.guild.member(users),
then for it's nickname do mem.nickname
users !== members
it should be something like that
i want to get the object of the person mentioned tho
not the author
Author is just the fallback
@simple zodiac
Don't
uh ok
<Guild>.member() will be removed
im not sure at all what i do with this since idk where to put it + how to write it
i just want to be able to get someone that i mentions NICKNAME
try how i sent
const member = message.mentions.members.first() || message.member;```
try
Get the guild member object
try
:|
Member properties -> member
User properties -> member.user
wait so do i need to do const env = smth ???
the console says that env module is not definied
???
All of your .env variables are stored in process.env automatically as you're using repl.it
So you can just access them easily
In .env
do
token= <put token here>
then at the bottom
like very last line do
client.login(process.env.token);
whatever the var name is in .env, goes in process.env.___
thats exactly what i did
And the problem?
wait imma send in pastebin all the things i edited today
it could be an issue being lowercase? idk
So in the .env it should look like this (obv ur token)
then this at the very last line
that should work
Should be correct
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i wrote .env and index.js at the start of the files
to make you guys know where i wrote that
That should work, what's the issue tho?
token actually has a value right
To me, all looks fine. Might be good if you provide us a errorcode.
and yeah what IS the issue?
we cant really help unless we know what it is (the errors)
(node:780) UnhandledPromiseRejectionWarning: ReferenceError: env is not defined
define it
this is the first line
uh
im asking from 30 minutes,
show code bro
do i need to do something like const env = bruh
ok
not lowercase token
stop
typing
like
this
try that
You never used env at the start of your main file
im
really
sorry
Is your file really named ".env" only?
The error is not related at all
They're using a variable they never defined
@solemn quartz Can you show us the stacktrace of the error
the variable is IN the .env file
wait a second
no
this is because repls are public, and the token needs to be private
That's not the issue
what is
The error says that they're using a variable they didn't define
Not the variables from the .env file
@solemn quartz make sure your .env is in the same folder your index.js is in.
obv it is
Syntax error? Can you show us the whole error?
ur using the dotenv module with require('dotenv').config() to load the env variables?
no
or atleast i dont think so
we're using the same thing
i dont have that
oh i see
so then ig in a way
why node-fetch return me this thing?
const fetch = require('node-fetch');
module.exports = async (long, lat) => {
const url = `http://dev.virtualearth.net/REST/v1/Locations/${lat},${long}?includeEntityTypes=Postcode1&includeNeighborhood=1&include=ciso2&key=${process.env.bingmap}`
console.log(url);
const data = await fetch(url);
console.log(data)
return data;
}
(node:964) UnhandledPromiseRejectionWarning: ReferenceError: env is not defined
(node:964) 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:964) [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.```
Because its an instance of the Response class, use <Response>.json() to get the json response for example
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is my whole code
and do i need to change the port?
Yo, how would I go about making a top.gg vote command for my bot using discord.js-commando?
I've seen methods for python but not discord.js
doubt the port would matter, i have mine on 6969 lol
You're using env.prefix instead of process.env.prefix, either change every env.prefix to that, or define a variable called env with the value of process.env
ok
for the prefix, you might want a module called discord-prefix. I'll try and find the npm page for it
no
?
I use it & mine works just fine?
is there a problem with it?
why using an extra module when its one codeline?
No need to use bloated npm packages for everything
oh my fucking god it finally works
This part I suggest you to use
https://www.npmjs.com/package/mention-converter
:))))))))
but my prefix works fine 
Bruh
I set if (!value || value > 21600) return message.channel.send('You need to state a number between 0 and 21600, which represents the second the slowmode will be.');
But when I type -slowmode 0 it still says You need to state a number between 0 and 21600, which represents the second the slowmode will be.
Why?
really? theres an extra module for that? xD
lES GOO
it is ads time :))
Because 0 is a falsy value

how can I set -slowmode 0 or even -slowmode off?
Bg did you write all those commands?
if (value <= 0 || value > 21600) { ... } @cinder lodge
i dont understand any of them really (i dont have a commadn thing like that) but they look cool & complex
YEAH BOIIIIIIIIIIIIIII
It still says You need to state a number between 0 and 21600, which represents the second the slowmode will be.
cuz it is cool 😎
I'm only suggesting it because I personally use it. I was recommended it by a friend of mine who also makes bots
It's not cool
It's also easier than however else you do it from what i know
Using bloated shit was never cool
what?! you says my npm package is shit?!
One day people will suggest to use
https://npm.im/to-lower
.l.
lmao
Fuck my life
That's literally what I'm trying to explain, npm registry is ruined with bloated useless npm packages
oh
Lmao
imagine a project that has 100 packages that are useless or it has built in function
to-lower uses to-str
oh my fucking god
Npm registry is just fucked
but i will continue using discord prefix npm 
thats trash

use your own system

I think people should do something like "wait for package approval" ?
there are to lazy to make their own code
Imagine "Use this npm package or ur mama . . . "
Says the one who made a npm library for custom prefixes
LMAO
someone requested it, and its trash too lol
I did not recommanded someone here
if (![prefix, <@${client.user.id}>, <@!${client.user.id}>].find(p => msg.content.startsWith(p))) return
bro, if you need a mention converter use mine
https://www.npmjs.com/package/mention-converter
but its better than the discord-prefix lol
@simple zodiac im stupid

i recommended the thing, sorry if im too stupid for all you lol
i just realised i didnt do the step 3
I seriously get mad over people publishing stupid npm packages
im really new to bot dev
what is step 3
well mine is not stupid
I remember this npm package called isThirteen which literally checked if the input was the number 13
can someone help me please?
Wtf has this registry become
lmaooo
Hey help
or isTrue ig?
I coded embed
Message.cleanContent exists btw
Its absolutely stupid, why would you use that when there's natice methods
pls tell
wait sorry wrong reply
What!?
Omegalul
.setAuthor("Invictus", "https://scontent-del1-2.cdninstagram.com/v/t51.2885-15/sh0.08/e35/s640x640/167222470_497654101239265_1837190606735502418_n.jpg?tp=1&_nc_ht=scontent-del1-2.cdninstagram.com&_nc_cat=101&_nc_ohc=fGs15qi-FV0AX-fKd88&ccb=7-4&oh=3160dd412529b5d0930e196b3187ef18&oe=608A3EE7&_nc_sid=fa978c&ig_cache_key=MjU0MTQyMDEwNTMwMTA3MDM1MQ%3D%3D.2-ccb7-4")
.setTitle("")
.setColor("BLUE")
.setDescription("Invictus is best bot for playing music in your servers . it supports youtube , soundcloud more coming soon !")
.setFooter("My Prefix Is -")```
code
i assume you responded to the wrong person lol but yeah you gotta do that
tell pls
read above message i sent
...
pls
true
the one in the site
to make the bot online
?
hello
pls tell
.setAuthor("Invictus", "https://scontent-del1-2.cdninstagram.com/v/t51.2885-15/sh0.08/e35/s640x640/167222470_497654101239265_1837190606735502418_n.jpg?tp=1&_nc_ht=scontent-del1-2.cdninstagram.com&_nc_cat=101&_nc_ohc=fGs15qi-FV0AX-fKd88&ccb=7-4&oh=3160dd412529b5d0930e196b3187ef18&oe=608A3EE7&_nc_sid=fa978c&ig_cache_key=MjU0MTQyMDEwNTMwMTA3MDM1MQ%3D%3D.2-ccb7-4")
.setTitle("")
.setColor("BLUE")
.setDescription("Invictus is best bot for playing music in your servers . it supports youtube , soundcloud more coming soon !")
.setFooter("My Prefix Is -")```
code
Does it say that when you use -slowmode 0?
@earnest phoenix I hate it when people don't think logically or don't accept help from senior devs
what is the issue?
what is the problem?
then just add it?
Yea, it just irritates me
like this
yeah i dont understand
To get started, join a voice channel and `!play`` a song. You can use song names, video links.```
use \xa0 for spaces
add \n for new line?
what
and \n to break lines
wtf is going on
where
?
"after this or
I am getting error on track while writing this.
const { thumbnail } = track;
I just opened this channel and I'm as confused as I can be
And what's the error
.setDescription("Invictus is best bot for playing music in your servers . it supports youtube , soundcloud more coming soon !")
tell with this
ls
pls
wdym
to give gap
This channel is the source of confusion
how you wanna make it look like?
Invictus is best bot for playing music in your servers .
It supports youtube , soundcloud more coming soon !
like this?
Just use new lines???
yes
then just simple add \n after servers.
To get started, join a voice channel and `!play`` a song. You can use song names, video links.1```
wtf is happening
What the genuine fuck
like this
Invictus is best bot for playing music in your servers . it supports youtube , soundcloud more coming soon !\nTo get started, join a voice channel and `!play`` a song. You can use song names, video links.1
simple
I mean people are just new to discord bots? I understand its confusing for people that are experts with it
lmao
Wow, we're now teaching people how to use new lines?
ig?
Newlines aren't exclusive to Discord
I'm surprised we have to teach Discord bot devs such simple shit
yeah ik
Born in the wrong generation of devs 
lmao
I now understand why Tim would want to retire
LMAOO
yeah, they could simply google but . . .
lmao
global.makeNewLine = () => "\n";
#development? Did you mean #lose-iq?

or credits cards
i also take cash
O
Development has basically become shitpost at this point
The problem is being able to tell who's shitposting and who is genuinely bad
how to set footer description /
I remember 1 year before how I was so happy to make my bot respounce me when I message Ping!
.setFooter("text here")
yeah
@median iris pls read this
https://discordjs.guide/popular-topics/embeds.html
i need description




Why do people here suggest to use npm packages for everything