#development
1 messages ยท Page 843 of 1
whoa that's like the gold standard for beginner djs code
How can I make it so I can make the bot go offline, dnd, idle or online
read docs
You set its status
How can I make it work?
Should be under the bot user object
read docs.
hint: setStatus
@raven urchin read the discord.js.org docs
how are you a green name if you don't know how to do this
hi so im probably really retarded by it says thta a , is expected here and I'm confused cause like why would a comma be needed and i think i messed it up and i need help
?
',' expected.
...
at 63, 5
pls snipe
and 63 5 is this
send the code
we're not wizards to know where u fucked up if we don't know what the code looks like
its over 2000 messages long
you just sent it
and i cant send it like ``` ````
was that not it?
send that portion
send that
alright
// Stop if there is no queue on the server
if (!queue) return;
}
}
}```
thats a little bit of it
show the code above
the second } is where the error is
try {
var playingMessage = await queue.textChannel.send(`๐ถ Started playing: **${song.title}** ${song.url}`);
} finally {}
const filter = (reaction, user) => user.id !== message.client.user.id;
const collector = playingMessage.createReactionCollector(filter, { time: 1800000 });
collector.on("collect", (reaction, user) => {
// Stop if there is no queue on the server
if (!queue) return;
}
}
}```
what a bowl of spaghetti
you need to send full code man
that finally is closed {} a the top so the code below isn't actually inside the finally
remove that }
not the one at the bottom
can you fetch a channel in djsv11?
send the error log
remove the } at the bottom
where's your catch?
also that
try catch finally
you need a catch block iirc
ye
so like catch finally?
ok me fix ty
nah
it's optional if you have a finally blocl
block*
what's happening here is that you fucked up somewhere else
send the error log so I can see where
is it normal that
(node:3852) UnhandledPromiseRejectionWarning: TypeError: Discord.RichEmbed is not a constructor happens
when i'm just trying to js message.channel.send({embed: new Discord.RichEmbed() .addField('hi', 'hi2') })
I have a problem with
if(!message.member.roles.some(r=>["Administrator"].includes(r.name)) )
'some' is undefined
it means that there is no variable or constant called some
@quartz hawk they changed it to MessageEmbed
oof
if (message.content.startsWith("-admintest")
let allowedRole = message.guild.roles.find("name", "Admin");
if (message.member.roles.has(allowedRole.id) {
message.channel.send("Hi")
} else {
message.channel.send("No permission.")
}
}
like that
im going to testi t
latest
Could someone help me with my userphone command? I have it working on my old bot but the code is extemely messy, I was thinking of updating it, but ive been getting bugs. for example this one:
I was wondering if I could get help if I showed the code
Its small and messy so bare with me please, (uploading it on hastebin)
https://hastebin.com/awocahudog.js (this was the old version that worked)
I need to add a @client.listen on a client object. How would i go about doing that in discord.py
Are you sure you need a listen
yes
is putting an array inside a mysqlite table acceptable
performance and accessibility?
I want to store a changing table so that it can hold new columns whenever I want to add them. My direction with this is to make a code redeemer that tracks if the code has been used
@meager fossilnt overrides all other @meager fossilnts.
client doesn't provide anything for .listen, cool
Use commands.Bot without using the entire extension
@slender thistle i need to use base .Client
What's the case where you would onlu need the base client
other than resources limitations
how do file paths work in JavaScript
const {help} = require('/config.json');
I need to access config.js inside the commands folder
./ means current path
/ means the base path
maybe ../config.json
since the command is inside commands folder
unless there's categories and stuff
../ means the parent directory
so you can do ../../ endlessly until you get to the destination
or use base path, of course
I used member.roles.cache.some
k thx
code: http://hastebin.tk/durasaluwe.js
error: only reacting with the "x" works, reacting with the "tick" does not.
[discord.js]
use .find, it's easier
client.on('message', msg => {
if (msg.content.startsWith("ping")) {
if (member.roles.cache.some(role => role.name === 'Server Administrator')) {
msg.channel.send("Pong")
}
});
not sure what im missing
unexpected token ')
some.find?
close ping
"Pong");
they r closed
no
its the end line
or I am being blind
member is undefined lul
yeah but that's out of the question
not the error
add a } after the first }
client.on('message', msg => {
if (msg.content.startsWith("ping")) {
if (member.roles.cache.some(role => role.name === 'Server Administrator')) {
msg.channel.send("Pong")
}
}
});```
like dat
you need to explain him
look
he'll say "oh I fixed it" and call it a day
^
uh
all the )s are correct
client.on('message', msg => {
if (msg.content.startsWith("ping")) {
if (member.roles.cache.some(role => role.name === 'Server Administrator')) {
msg.channel.send("Pong");
}
});```
see
makes no sense when formated
if you are using VSC you can change the settings so it formats on paste and save
@heavy anchor or make config global so you can do config.
client.on('message', msg => {
if (msg.content.startsWith("ping") {
if (member.roles.cache.some(role => role.name === 'Server Administrator')) {
msg.channel.send("Pong");
}
});
how do i do that @earnest phoenix
in the index
Made a pretty powerful mute command.
thats unneccesary
make config with global.config instead of config
More like a nuke command
its giving me errors
ohhhh
let guildCreateChannel = client.users.get("418347988092583947");
const invite = await guild.channels.find(c => c.type !== "category" && c.position === 0).createInvite({ maxAge: 0 });
guildCreateChannel.send("Je viens de rejoindre le serveur ("+guild.name+") avec "+guild.memberCount+" membres ! Invitation: "+invite.url+"");
});```
if you see, it doesnt work because you forgot to close one
if your index is in the same path as your config
There is a problem ?
it will work
Pizza what are you trying to do and what is the error
No error i would like the bot mp me when he join a serveur
client.on('message', msg => {
if (msg.content.startsWith("ping") {
if (member.roles.cache.some(role => role.name === 'Server Administrator')) {
msg.channel.send("Pong");
}
});
smh
missing )
i'm done
after argument list
this thing is so simple
then dont hand him the code
Blox you see where is says 'Server Administrator')) {? well make it 'Server Administrator'))
learn javascript
and your problem will be gone
Pizza there is no point in storing objects after a GET request into a variable if you use it once.
true
n1c
because some
its a starboard
^
code: http://hastebin.tk/durasaluwe.js
error: only reacting with the "x" works, reacting with the "tick" does not.
any ideas?
Blox the only way you would be getting these errors is if you were using notepad for editing code
whats with most ppl sending hastebins these days
you should see a red underline on a problem
@earnest phoenix looks better than a txt file
its actually really nice when people use hastebin
most people === glitch
ew
hm
glitch editor is actually not that bad
I've been trying to fix my error for 5 hours straight
at least you get a formater with glitch
no shit
glitch.hasFunction(writeFile('hastbin'))
DUH
grab member from message ๐
member => msg.member bc like member is the message member make sense
@earnest phoenix you already say that
@earnest phoenix โ
honestly, not knowing JS was one of the reasons my code is so shit
I've had the same problem, Discord uses different emojis.
really?
is*
never knew not knowing a language would make it worse
thing is Desu
I use these same ones for my other commands?
a
and it reacts to the message correctly, however when I react to it, nothing...
not knowing a language will make it worse in every possible way
The bot allows me to use the command even though I don't have the role
wut ingles?
Well your check must fail then.
im not sure but I think you need to use an await with your promises somewhere
can't you do like toString and compare it or something?
toString is a god
client.on('message', msg => {
if (msg.content.startsWith("ping")) {
if (msg.member.roles.cache.some)(role => role.name === 'Server Administrator')
msg.channel.send("Pong");
}
});
did it work?
the hell
how can i get attachment url from collector?
lmfaooo
everyone sees it?
rip
because if not, i highly recommend you learn it first
subjective
no
they're equal
custom library > any other fucking lib
=== is better
no
yes
=== means same type
message#attachments collection then you can use first() and get the url
message.attachments.first().url
message being whatever variable you named your message object
js !== py
can someone make a short code reallly reallllyy long and pointless for me rq?
no
d:
message#attachments collection then you can use first() and get the url
message.attachments.first().url
@earnest phoenix wait i'll try it
i need imagination
if it doesn't work i'll tell you
just add a bunch of await statments for useless things
like add a reaction and remove one
client.on('message', msg => {
if (msg.content.startsWith("ping")) {
if (msg.member.roles.cache.some)(role => role.name === 'Server Administrator')
msg.channel.send("Pong");
}
});
do i need { at the end of somethin
no
await await await message.channel.send()
Ill need that for the future
I was on reading files using fs on my 4th day of doing d.js
^
and it has been only a month since I 1st looked at java script
and I already know better than people who are doing it for months
if you just read this chat daily, you learn what not to do
like: ask a question you can search up
I do thattbh
and: forget to add the () to the end of a function
still can't do it
thats my favorite
and: {} hell
bruh
I only use {} when I must
I hardly asked anyone
I try to do one line if then statements
I just read the console
@earnest phoenix
my code is:
const filter = m => m.author.id === message.author.id;;
const collector = message.channel.createMessageCollector(filter, { time: 15000 });
message.channel.send("Please insert an attachment image.").then(() => {
message.channel.awaitMessages(filter, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
console.log(collected.attachments.first().url)
})
.catch(collected => {
console.log(collected)
});
});```
It gives me:
TypeError: Cannot read property 'first' of undefined
docs
js is an easy language
that's why so many people pick it up
I even learned some of it
and there are multiple ways to put it to use and for everyone that's different
imagine not using {} for multi-lines
i said message as in your message variable
collected is a collection right
so you'll have to use first() for that
ye
isnt awaitMessages() deprecated?
no
no
oh
but luca is
It still doesn't work
I mean
it takes me 2 hours

Can someone help me with this. I made a command that runs a huge for loop that takes like 30 sec to finish and while thatโs processing if someone runs another command, it ques it up and doesnโt run until the for loop is finished basically causing higher ms response times. Does anyone know how to work around this?
So in discord.js I wanna keep track of 1 channel for every server
Like
channels = {
guild:channel
guild2:channel2
...
}
How do I best do this?
Like a command to designate a certain channel for something
database
But how do I specifically implement it
Like how do I actually get the guild and channel objects into a thing that I can save
Wait what do you mean by database
He should def use a json lol
I thought that was an abstract thing
a medium to store data
I did it in Python by just making a dict and saving to json
But how do I do that in js
i guess you need to use JSON
keep in mind that it would be a bad idea since the file could get big and every time you assign something to it, it'll bound to crash your bot
How do you mean it would crash?
generally people don't use json as a database because it's subject to corruption
when you have synchronous read and writes on your json file it could cause it to corrupt
Hmm cringe
Anyway how do I write it to json anyway
The only solution I found online is trash
Just writes "[object Object]" to the file every time
Come on, there's no way this is easy in Python but impossible in js
Yhea I'm doing that
But I only just found out how to do it, you gotta stringify it before writing
code: http://hastebin.tk/durasaluwe.js
error: only reacting with the "x" works, reacting with the "tick" does not.
[discordjs]
Because it's entirely possible that none of your if conditions resolve to "true" meaning nothing gets executed
I'm also questioning if you're aware that the "hit" is always going to be the same as the first card
How can I wait for the function to finish before console.logging
const currentArray = []
currentArray = []
getPlayers(758071,4586727)
console.log(currentArray[1])
currentArray = []
getPlayers(7677467,746577654)
console.log(currentArray[1])
function getPlayers(group, roleId) {```
add async to it
Literally.
That alone won't do
Just return the data instead of setting the array.
You'll have to make sure that function awaits whatever happens to be async
async function fml() {
currentArray = []
await getPlayers(758071,4586727)
console.log(currentArray[1])
}
async function getPlayers(group, roleId) {```
Unless you updated the getPlayers function, that still won't do
is that rust what I see Dream?
wait run() async function run() { await console.log(getPlayers(758071,4586727)) }
that still just returns Promise { [] }
wtf
The async keyword lets javascript know that the function may contain async code, allowing you to use "await"
oh
You'll have to make sure that function awaits whatever happens to be async
ok ๐
^^inside the getPlayers function
ok so i awaited it
and now its just Promise { <pending> }
hol on ill send function code
if you awaited it, it wouldnt return that
Maybe you could show us the getPlayers function
run()
async function run() {
await console.log(getPlayers(758071,4586727))
}
async function getPlayers(group, roleId) {
let currentArray = []
let url = `i removed url to hide my key but still not needed`;
let options = {json: true};
request(url, options, (error, res, body) => {
if (error) {
return console.log(error)
};
if (!error && res.statusCode == 200) {
body.data.forEach(element => {
var pushTo = element.username + "(" + element.userId + ")"
currentArray.push(pushTo);
});
};
});
return await currentArray
}
still promise pending when i run it
๐
run()
async function run() {
await console.log(getPlayers(758071,4586727))
}
async function getPlayers(group, roleId) {
let currentArray = []
let url = `i removed url to hide my key but still not needed`;
let options = {json: true};
await request(url, options, (error, res, body) => {
if (error) {
return console.log(error)
};
if (!error && res.statusCode == 200) {
body.data.forEach(element => {
var pushTo = element.username + "(" + element.userId + ")"
currentArray.push(pushTo);
});
};
});
return await currentArray
}
const filter = m => m.author.id === message.author.id;;
const collector = message.channel.createMessageCollector(filter, { time: 15000 });
message.channel.send("Please insert an attachment image.").then(() => {
message.channel.awaitMessages(filter, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
console.log(collected.attachments.first().url)
})
.catch(collected => {
console.log(collected)
});
});```
it gives me this error:
`TypeError: Cannot read property 'first' of undefined`
please help me
have you tried reading the error
yes
what does it say
but i don't understand how can i fix it
i trying to get attachment url
jesus christ
.attachments[0] @earnest phoenix
maybe
ok i'm trying
please stop
you're suggesting a fix without knowing what the problem is
You're still awaiting an array in the code you posted above @earnest phoenix
don't talk to cry if you don't want to hear harsh truths
An array is just an array it won't ever resolve to anything
even when i dont await the array it still does Promise { <pending> }
another issue is that in your attempt to log the resolved promise, you're awaiting the log instead of the function
you're suggesting a fix without knowing what the problem is
@earnest phoenix i know the problem
but i don't understand why you're so agressive?
im not
i just go straight to the point which some people find agressive because I don't sugar coat what i say lol
and i always force people to think with their own brain instead of using someone else's to fix a problem, which is also what often people don't like
@late hill how to await the function then
didn't he just-
async
OH
i know
oml
im dumb
thx
wait maybe not
fuck
indeed ยฏ_(ใ)_/ยฏ
coose enough
run()
async function run() {
const res = await getPlayers(758071,4585176)
console.log(res)
}
function getPlayers(group, roleId) {
let currentArray = []
let url = `[url hidden]`;
let options = {json: true};
request(url, options, (error, res, body) => {
if (error) {
return console.log(error)
};
if (!error && res.statusCode == 200) {
body.data.forEach(element => {
var pushTo = element.username + "(" + element.userId + ")"
currentArray.push(pushTo);
});
};
});
return new Promise(resolve => {
setTimeout(function() {
resolve(currentArray)
}, 1000)
})
}
it only works right if it finishes in the timeout
๐
can i suggest not using request
why
It's deprecated
what would u recommend
node-fetch
lmao what
node-fetch would suffice
ok ill try
Yeah I generally use node-fetch its very simple to use
If you want speed i'd go for axios, however a little more complicated design
@knotty steeple hey
run()
async function run() {
const res = await getPlayers(758071,4585176)
console.log(res)
}
function getPlayers(group, roleId) {
let currentArray = []
let url = `[url hidden]`;
fetch(url)
.then(res => res.json())
.then(jsonData => {
jsonData.data.forEach(element => {
var pushTo = element.username + "(" + element.userId + ")"
currentArray.push(pushTo);
});
});
return new Promise(resolve => {
setTimeout(function() {
resolve(currentArray)
}, 1000)
})
}
ok still doesnt help tho
if the timeout is 0
then the currentArray return is empty
because it hasnt finished
@knotty steeple can u help meh
no
i dont know about async/await because i rarely use it
wait i got it
im a god
wait no i didnt
im dumb
wow
function getPlayers(group, roleId) {
let currentArray = []
let url = `[url hidden]`;
fetch(url)
.then(res => res.json())
.then(jsonData => {
jsonData.data.forEach(element => {
var pushTo = element.username + "(" + element.userId + ")"
currentArray.push(pushTo);
});
});
return new Promise(resolve => {
resolve(currentArray)
})
}
getPlayers(758071,4585176).then(function(results){
console.log(results)
});```
u tried the .then
๐
Can someone help me with this. I made a command that runs a huge for loop that takes like 30 sec to finish and while thatโs processing if someone runs another command, it ques it up and doesnโt run until the for loop is finished basically causing higher ms response times. Does anyone know how to work around this?
I would like to move my bot from repl.it to another more reliabe host, Aws, digital ocean or azure? I am looking for something user-friendly like replit
I'm struggling on making a warns log on discord. Py DM me if you can help
@neat gazelle what in the world requires 30s loop to finish
@earnest phoenix AWS has hidden costs, I've never used azure, and digital ocean was very good in my experience
a loop that goes and performs a bunch of writing to a .txt file based off data that it pulls
ic
@earnest phoenix nothing's gonna be as 'user friendly' as a website not designed for bots like repl, digital ocean have fairly steep pricing but provide reliable and in most cases good servers with good support
how to create a discord bot please help
#502193464054644737 if you have no idea what you're doing
Digital ocean is still a bit pricy even if they have good support and network
Digital ocean
Server cheap
Galaxy gate
soo good
$5 a month for 1GB and 1 cpu is just bad
Also managed databases which don't require much resources except space for $15 dollars like what i could just easily put that on a $5 vps
It even has 15GB less storage than the $5 vps
10 gb disk

Some of digital oceans plans are just rigged to people that don't even know how to setup a simple database
Also they scale backups with the cost of your current vps like wtf is this
The pricing for backups is 20% of the cost of your virtual machine. So, for example, if you want to enable backups for a $5 per month Droplet, the cost of the backup will be $1 per month.
@earnest phoenix I work for a hosting service that does really well and has a 24/7 uptime unless a mass maintenance is required. The support team is always there and we offer pretty good prices.
Here is one of our discord bot plans:
RAM - 128MB
CPU - 6x 3.90 GHz (Fully Unlocked)
Disk - SSD 1 GB
LOCAT - France
NODE - donator.eu
Database - YES
Extra Port - YES
Support : Dedicated
128MB ram would only be able to run a C# at best
I didn't make the stuff. I just work there
Nope i use servercheap with an offer for an 8GB vps $14.40 a month
Digital Ocean prices that at $40 which is almost 3 times the cost
Dosen't take a money with a brain to know that even that is just bad
Nice
raid
๐คก
when you feel like you got muted but turns out everyone did
(Also don't use this channel to bypass locks)
Also development isn't the place to talk about it ๐ฉ
Oof
yep cool
not getting anything in dbl.py so like, from what i gather from https://ptb.discordapp.com/channels/336642139381301249/564950631455129636/693908059021377598 (if anyone is in dbl.py) then the same error object is passed to all handlers?
they never specifed if it was just multiple clones of the error object or the exact same object
(@ me)
Nice channel link btw
oh wait nvm
i literally said
if somoene is in the dbl.py server
but all the info in my question is in the question
i just put the link in the off chance that someone is there
oh
;p
but yea, i was just curious if i could do something like error.handled = True to check if an error was handled
Whats a coding language ?
whats discord?
The language of the Cod
sighs
I need someone who can make me a few bots dm me if interested willing to pay up to 300
SGD 150 pounds
ยฃ150 for a custom bot is a bit much imo lol
just send the file 3 times
๐คฆ
free money
(node:1691) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
ยฟ?
can you show your code?
Make sure Node.js is at least v12.
@!Francesco#9078 update node js
oho tanks
its work
One thing, the setPrefence of the ready event
Does it change at 12?
Why doesn't the state send in my bot
it changed yep
What is the change?
check the docs: https://discord.js.org/#/docs/main/stable/typedef/PresenceData
thanks โค๏ธ
dbl.webhook.on("vote", async vote => {
console.log(vote.user, "ok boomer")
manager.broadcastEval(`this.handleVote(${vote.user})`);
});
``` The console.log in the vote event logs the ID correctly but it returns a rounded ID when in the handleVote even tho the console.log is on the first line of the function. How do I make it so it returns the original ID instead when in the handleVote function?
try surrounding it in quotes like this.handleVote("${vote.user}")
@sudden geyser It worked thanks! ๐
You used the wrong quotes but yeah
Can someone show me what the issue is here?
(function (exports, require, module, __filename, __dirname) { const fs = require("fs"));
This is what the debugger said the issue is
But, my code is this
const fs = require("fs")
require("dotenv").config();
const Discord = require("discord.js");
const client = new Discord.Client();
const config = require("./config.json");
```I don't see these line anywhere? What should I do?
This is the debug console log :
);
^
SyntaxError: Unexpected token )
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
Yes
send your code
ok
Can someone give me a hand with creating roles with certain permissions overrides in all channels
This is the top section of it entirely
const fs = require("fs")
require("dotenv").config();
const Discord = require("discord.js");
const client = new Discord.Client();
const config = require("./config.json");
const other = require("./other.json");
const currency = new Discord.Collection();
const eco = require("discord-economy");
client.on("ready", () => {
console.log(
`Bot ${client.user.tag} Online! There are ${
client.users.size
} users and/or bots online. In these guilds: ${client.guilds
.map(g => g.name)
.join("\n")}`
);
client.user.setStatus("online");
client.user.setActivity(
`on ${client.guilds.size} servers | )help | ${client.users.size} total users`
);
});
client.on("guildCreate", guild => {
console.log(
`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`
);
client.user.setActivity(
`on ${client.guilds.size} servers | )help | ${client.users.size} total users`
);
});
client.on("guildDelete", guild => {
console.log(`I have been removed from: ${guild.name} (id: ${guild.id})`);
client.user.setActivity(
`on ${client.guilds.size} servers | )help | ${client.users.size} total users`
);
});
```Here's the error location
```js
/app/index.js:2
And here is the console debugger log
);
^
SyntaxError: Unexpected token )
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
```With
```js
(function (exports, require, module, __filename, __dirname) { const fs = require("fs"));
^
SyntaxError: Unexpected token )
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at ```js
/app/index.js:1
ok the error clearly isn't this
Thats what i thought
which is where i come to wonder, what exactly is this?
(function (exports, require, module, __filename, __dirname) { const fs = require("fs"));
```that showed up on the debugger console log, but not the code itself
lemme do something real quick
Kk
I tink I know what the error is
If you need the entire code i can share it personally
https://sourceb.in/550acaf1dd
error: creates the role but doesnt deny those permissions in all channels
i tried, it didn't work
hmm
I've seen people getting an error like the one you're getting
but that happened when they were using ES6 imports
All it turns into is this :
(function (exports, require, module, __filename, __dirname) { );
^
SyntaxError: Unexpected token )
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
remove require('dotenv')
and try again
try that just in case
I don't think that'll fix it
The same error
hmm
that's odd
maybe tim could help
but he isn't online atm
holy crap
lemme do some research
I really don't know at all xd i've only been working on it for a month like 1 hour a day
wait
remove the extra space that you have at the end of that require fs
that shouldn't be a problem
https://sourceb.in/550acaf1dd
error: creates role but doesnt deny those permissions
but it's odd how you left that there, and the fact that you decided not to add a ; at the end, even tho you add it on every other line
Did u try const config =require('' dotenv'').config();
umm... no
Did u try
const config =require('' dotenv'').config();
@earnest phoenix It gave unexpected token 'dotenv'
yes
mine Jessy?
require('dotenv').config()
Try that
Lol
@copper cradle that's what I was thinking
XD
It sorta crashed with my ```js
const config = require("./config.json");
and it didn't help
I removed the ```js
const config = require("./config.json");
nonono
wait
there, see those?
those are single quotes
'
but there are 4 of them
' ' ' '
I know, i fixed that crap alrdy
Is it like this rn require('dotenv').config()
wait a sec
for the sake of luigi add a ; at the end of the very first line so it looks cleaner

const fs = require("fs")
const Discord = require("discord.js");
const client = new Discord.Client();
const config = require('dotenv').config();
const other = require("./other.json");
const currency = new Discord.Collection();
const eco = require("discord-economy");
that doesn't matter lmao
Jesus, it's the format function from glitch

And my copy pasting didn't work that well either
doing this works
Yah
message . channel . send ()
that works
add a ; at the end of the very first line
so it looks cleaner
yeah sure thing
I just can't read this
What do you mean?
const fs = require("fs");
const Discord = require("discord.js");
const client = new Discord.Client();
require("dotenv").config();
const config = require("./config.json");
const other = require("./other.json");
const currency = new Discord.Collection();
const eco = require("discord-economy");
why are you defining config twice lol
ikr
Didn't help at all tho...
XDD lol

My bot's dead xd
require('dotenv').config();
cuz idk why you decided it'd be a good idea to add ; at the end of almost every line and leave the first one without it
I actually fixed it
I deleted the entire code and created a new file
"SyntaxError: Unexpected token )" this normally happens when you have an extra "})" or "}"
Ik
and pasted the entire code
Just remove the require('dotenv').config()

Problem sloved
yeah
remove that shit
sloved
you dont need it
"SyntaxError: Unexpected token )" this normally happens when you have an extra "})" or "}"
@earnest phoenix The issue was i got this
(function (exports, require, module, __filename, __dirname) { const fs = require("fs"));
Just remove the require('dotenv').config()
@earnest phoenix that actually didnt help

It's not even in the code bruh, how do i edit?
simple answer: remove the error
@earnest phoenix
12
that's node's code
i think it was an internal root code error, so i recreated the file again
yes

that's internal code
@high bough or reinstall node
Oh, i basically created a different index.js and deleted the old one xd
just do
using copy + paste
sudo rm -rf /*

if you're on linux
if you're on linux
@copper cradle I'm on Glitch.com
s i

well guess what

@high bough that's an bad idea
glitch is a free web-hosting service
don't ever use glitch nor heroku
just get a vps smh
or a dedicated machine 
@high bough you're running your stuff on a website ?
@earnest phoenix Yeah it is
or a dedicated machine
@copper cradle Dude i'm poor
imagine using a separate package for a module of your bot which you could code yourself
glitch is extremely buggy and breaks often, i recommend you spend 3 dollars a month on hosting

Try Google cloud
It's basically free just keep on making alt accounts every year
glitch allows you to upgrade your projects soon
but yes get a vps

soonโข๏ธ
soon
#soon
#soonโข
XD
and don't use any of their extra services
those ar my words
bc they'll charge you off of the $300 they give you
There is a pin

i use vultr, iirc pricing is same as DO

it wasn't actually free
Never heard of it
I was staff on a minecraft server and they gave me access to their vps when they moved the server to a dedi
for no reason, I only use 2-3 
so I got freeโข๏ธ hosting for making a fucking discord bot lmao
I used it to host my music bot
yes
Too less
Microsoft and Google ar give 300
I think Amazon to
Ik
I don't know how that works
smh
That's the basic one
Even Amazon has an 1cpu
Yah discord bot don't take too much resources
why not
if you're just setting up a vps you don't need the most expensive option
but do go with a reliable company even if it means paying a little more
reason being you can't guarantee the reliability of companies that aren't already well known
i assume somebody already mentioned vultr/digitalocean/contabo
5g net an your own rig u will not need an vps
ah yes
let's go buy a $1200 server rack and expect it to be online even through power outages

:lul:
Or an raspberry pi 4 4g though it might not be enough an pi cluster will do
And 5g net ofc
i don't trust myself to put my bot on a pi tbh 
Why tho
server rack
also dont try to run your bot on your pc if you want it to be on other servers lmao
how do you just unplug a pi
by being iara
ok well
duh 
how about we be an average person and not unplug a pi yeah
rood 
lmao

run -bots
-bots @user
-bots @spare goblet
how is performance running bots on a rpi anyway
not in this channel ty :^)
whats rpi
Oh

idk
what
My sqlite doesn't work
actually when my bot was like at

@earnest phoenix can you actually stop
700? servers i considered putting it up on a pi and testing it out
Actually no databases work properly
but never did
ehhhh yeah you can just slip by probably
so back then i was already at like 2gb
there is a slim chance memory will leak
unless you're doing something say recursive
rn im at 9k-10k and it's at 2.5gb after 4 days cuz memory leak fixed 

because unless you tampered with node's gc memory leaks aren't that common
your bot is economy
running settimeout anywhere?
i mean there are these things called worker threads but ok
ken said "you shouldn't be using so many set timeouts issa bad
"
wasnt node always single threaded for asynchronous reasons or
so it got removed 
how
yes hello
Lol let's stop
pls don't send images here that aint related and stuff
you can chat about development and code
that makes uhh
that makes your computer do stuff
so nobody's gonna address this
ok
well guys i need a new vps provider, can anyone provide recommendations
Minecraft
right now i'm on digital ocean and looking to switch anywhere else
*Microsoft
WHat's ur location?
Which kind of services?
Do you plan to host games, websites, apps





