#development
1 messages · Page 1011 of 1
Nvm it doesn't work
Is erlpack worth all this hassle?
I just wanted to use it since it was a recommended package of discord.js light lol
how to make an automatic channel synchronize bot permisiion .in js
Unexpected token c in JSON at position 0
at parse (<anonymous>)
[90m at Object.Module._extensions..json (internal/modules/cjs/loader.js:1172:22)[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
for node main.js
what erlpack does is that it sets the websocket connection to ETF format instead of json
ETF is a portable binary data file, it does the same job as json does, of carrying data between processes and over the network, but since its in binary format, its more efficient, for example it can represent numbers as actual numbers instead of converting them to text
however since discord.js primarily uses json data for everything, using ETF doesnt really give you a big advantage
it helps with bandwidth usage, but not much with cpu usage, possibly costs more cpu
Then I will just leave it as is my bot is not that big anyway
Just want to make sure my bot doesn't eat all the ram
So I googled how to turn off discord.js cache and then I got discord.js light as a result which recommended a bunch of packages
All those other packages work fine
thanks for using my lib :^)
Yeah I noticed it on the github page that your picture was the same but could not really place where I saw it before
hahah
nice
I was worried I would get compatibility issues
yeah it depends on what each bot does, some bots will have compatibility issues and require workarounds
Mine only uses server cache and that one is cached by default I saw in the docs
yup
btw you need to go into the v2 branch for the current docs
the v3 branch is not released yet
xD
We serve fast and scalable informational images as badges
for GitHub, Travis CI, Jenkins, WordPress and many more services. Use them to
track the state of your projects, or for promotional purposes.
Nice time to give my readme a make over
whats wrong?
Unexpected token c in JSON at position 0
at parse (<anonymous>)
[90m at Object.Module._extensions..json (internal/modules/cjs/loader.js:1172:22)[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
for node main.js
show your main.js file (without your discord token)
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
});
client.login('Token');
did I do the haha thing
'
"
show your package.json file
{
"name": "asinglecelledbot",
"version": "1.0.0",
"description": "An interesting description",
"main": "main.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "aSingleCelledOrganism",
"license": "UNLICENSED"
}
did you run npm install discord.js? if not, do it now
yes
mm same error
are you on windows?
ye
is your main.js named anything else?
lmao
I'm dead
but
what
I got the same error ;-;
internal/modules/cjs/loader.js:1175
throw err;
^
found this right above it
main.json
its main.js
gotta start somewhere :3
What's error 416?
where's that coming from?
what stream?
ah
Error: input stream: Status code: 416
at ClientRequest.<anonymous> (C:\Users\Rin\Desktop\Shigeru\node_modules\miniget\dist\index.js:147:27)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:596:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at HTTPParser.execute (<anonymous>)
at TLSSocket.socketOnData (_http_client.js:469:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
416 means "range not satisfiable" lol
its a lib thats using the miniget lib
something like a youtube api im guessing?
i've never used youtube apis and libs so idk
would anyone know an opensource express discord bot dashboard that i could use for an example ?
what ?
Learn full stack before even thinking about a dashboard
The HyperText Transfer Protocol (HTTP) 416 Range Not Satisfiable error response code indicates that a server cannot serve the requested ranges. The most likely reason is that the document doesn't contain such ranges, or that the Range header value, though syntactically correct, doesn't make sense.
The 416 response message contains a Content-Range indicating an unsatisfied range (that is a '*') followed by a '/' and the current length of the resource. E.g. Content-Range: bytes */12777
Faced with this error, browsers usually either abort the operation (for example, a download will be considered as non-resumable) or ask for the whole document again.
Sooooo rate limit?
rate limit should be 429
O
this just looks like a broken stream lol
any one know why my bot's status keeps disappearing
bot.on("ready", () => {
console.log(`Logged in as ${bot.user.tag}!`);
bot.user.setActivity(`for heresy`,{ type: "WATCHING" });
});
``` this is the code
when it starts the status is there
but it just randomly disappears after like a day
statuses may be lost when your bot disconnects and reconnects
if you dont need a dynamic status, such as a status that shows guild count or any kind of status that requires the ready event, add the status as a client option, its the best way to preserve it
I do have bad internet so that is probably it
Also ratelimits exist for some cases
?
But not this case
new Discord.Client({
presence: {
activity: {
type: "WATCHING",
name: "huehuehue"
}
}
})
Should i use array.push or array.splice to add items to the end of an array?
splice is for removing items
could you just use && or is that for logic only
So I should use push then
sounds like a lot more work than using push
And array.push(item) adds to the end?
yes
ok so im confused its not showing a status at all now but it hasn't crashed
idk what to do
show full code
the entire code or just the bit that does the status?
require('dotenv').config();
const Discord = require('discord.js');
const bot = new Discord.Client();
const TOKEN = process.env.BOT_TOKEN;
bot.login(TOKEN);
bot.on("ready", () => {
console.log(`Logged in as ${bot.user.tag}!`);
});
new Discord.Client({
presence: {
activity: {
type: "WATCHING",
name: "for heresy"
}
}
});
``` this good?
it is a file to store the token in
Is it better than JSON?
Wondering if it is worth switching to dotenv
I mean it works and ive had no problems with it
id do some reserch first if you are unsure as ive never used JSON
i was just following a "how to make a discord bot " tutorial and it said to use it
I am reading up on dotenv now I had seen it before in examples so just curious
ah fair enough
Hello
i have some question about creating bot
mm?
That is your package and package-lock not your confit
Coming
Config
Again hate autocorrect
But it’s json yeah
same mine cant spell any more tho cuz its lernt all the words I type wrong
Nice
also what do those files do...
I set th bot up ages ago but never did the actual coding until now and i cant remember what they are for
They define ur project's libs
I say "they" but it's actually only package.json
The other one is a simple lockfile
meaning?
Literally a lock
im a noob
To prevent two npm instances changing the same package.json file
package-lock is also used to define the exact versions of dependencies used in a project
for example, if you publish your project with the package-lock, people will use it exactly as you use it with everything in the same version, if you dont include package-lock, people who use it will automatically get the latest versions of all dependencies and requirements
i see
sometimes depending on the situation, you dont want people to be geting the latest versions, because you didnt test them beforehand
TL;DR: it also locks the dependencies' version
It would be quite a problem if your bot still uses Discord.js 11 but someone tries to run it on Discord.js 12
major versions are protected by default
depends on how much was changed
even without package-lock, npm will refuse to update a major version
Can I make my bot go offline? and if so what commands would I add to make that happen
Oof I thought I had a smart input to the conversation for the moment
Don’t mind me lol
oh wait if I close cmd
yeah
it doesn't respond
Just ctrl + C
it takes a while
That's cache, it'll be offline soon
gotcha. Thanks
Good to know npm refuses major versions updates though
there is a 30 second delay give or take
ty for your help guys
i made a bot
with botghost.com
YALL THOUGHt i coded it
sad
huh?
well
Okay
if you cant get your bot online
i used botghost.com
to boot it onlline
but not i need help
so im rtrying to make a command called
!Whoasked
but when the image shows up
I have my bot hosted on a 12 y/o pc with linux using code I got off of stack overflow
it doesnt show
Nice configuration
indeed
Better than glitch 
@wooden ember why does the imagine do the loading thing
?
what immage
what is that
a bot command
its helping for development here
where to find the line of code to delete a channel
but you aren't developing anything, @timber linden
i do not speak harry potter spells
i used botghost to boot the bot online
What is happening
Dude...
i juar uaws vorfhoar ro voor rhw vor onlinw
@timber linden are you having a stroke
Botghost is a cheap bot maker. Period
botghost is a bot maker, we don't support those because you aren't developing anything
You didn't "made it online", you literally used a bot maker to make a whole bot
if you have an issue with a bot maker go complain to the developer of said maker
Listen to me.
im still learning how to develope
my server is in need of bot makers
im still learning discord.js from the guide
im editing my bot in 2 days or something soon
when im done learning how to make ots
Alright, please come back then.
So if I pull channel.statistics.subscriberCount, what should I use to make it store in a local directory (plain .txt)?
using Eris atm
someone can help me?
(node:8220) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channels' of undefined
@marble geode whats your code
Is anyone familiar with the npm package canvas constructor and the path package that could help me resolve an issue of using a custom font? Please ping or DM me 🙂
whats your issue with your custom font?
Well I am not sure what I need to do to add it
Canvas.registerFont("fontfile", { family: 'fontname' });
Canvas.registerFont(resolve(join(__dirname, "./discord.otf")), "Discord");
Ah so you dont need to do this?
Does the fontfile need to be in your project file?
yeah
ok, and the fontname is that the name of the file?
it can be whatever, its just the name when you use the font
offscreenCtx.font = "20px Pixel";
pixel being the name i set
Oh I see
what are the parameters for a embed on DSharp?
I only know like Title and Description so far
I spent a loong time finding my font, googling around @cunning gorge
ah ok gotcha
awesome much appreciated!
how to set Color on discord embed using DSharp ;-;
tried to use smth like xna framework Color.Red
but seems like doesnt work
did you try the docs?
someone pls help
this is my font in my folder, is the font file ./Azonix.otf? @solemn latch
yeah
ok thanks
what language, what library
they made it against TOS
Oh yess the font thing worked
i have glitch premium
thanks soo much woo
thats like $10 a month
yes
but
anyway, im not sure how to help with that issue, glitch doesnt like giving clear error messages for some reason
Oh
429 is too many requests
you hit the ratelimit
the daily limit on the gateway is like 1000 requests
how tf did you make 1k IDENTIFY requests
glitch has a query limit? lol
ooo
although glitch started cracking down on projects using things like uptimer bots to keep their projects alive (e.g. discord bots)
which is just another sign for "get a proper host"
a day
I have glitch premium
And it says unlimited requests
glitch is unrelated to discord
you can manually make the request and see what the headers return
How would I check if a parameter is missing on a command? So like if the command is made improperly it just doesnt do anything but send a message of how to use it
using DSharp btw
if the arg doesnt exist, its not properly formed
if the arg isnt the right type(not a number or something) its not properly formed
for example, on my poll command i have the parameters string title, string description, TimeSpan duration, params DiscordEmoji[] eOptions, if at least one of those is missing I'd like to send a message like $"{parameter} is missing! To use the poll command do +poll <parameters...>"
public event AsyncEventHandler<CommandErrorEventArgs> CommandErrored
``` Found this on the docs but honestly? I have no idea on how to use it
subscribe to the event and see what the argument gives you
@earnest phoenix should I remix my project
remix?
Yes
That duplicates
Project and create a new copy. Of it except env
remix?
@earnest phoenix
i already told you that glitch is unrelated to discord
you got ratelimited from discord because you used up your 1k IDENTIFY daily limit
i don't even know how you managed to do that
@earnest phoenix is VPS a sol to it
jesus fucking christ can you read
you got ratelimited from discord because you used up your 1k IDENTIFY daily limit
ok
so you
said
@earnest phoenix how to solve it
like rythm and other bots?????
rythm doesn't hit the limit and they have their limit raised
subscribe to the event and see what the argument gives you
Sir idk how this works ;-;
how to do that
Im coding on C# for like 6 months but I just started making bots on DSharp
how to do that
have a bot in over 250k guilds
Im coding on C# for like 6 months but I just started making bots on DSharp
events are c# fundamentals
yes
guild is developer speak for server
it is in 77
only 249 923 to go
discord only increases limits for massive bots
you can't do anything but to sit and wait out the ratelimit
the ratelimit probably passed by the time you did that
considering you hit it 10 minutes ago
في احد عربي
english only
and especially using the latin script because pretty much nobody can read anything else
check the pins, good providers are pinned
check pins
galaxygate ;p
Lol
@solemn latch no that its now work ty
module.exports = {
name: 'mute',
description: "this is a moderation command. it mutes members.",
execute(message){
var person = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[1]));
if(!person) return message.reply("I CANT FIND THE USER " + person)
const mainrole = message.guild.roles.cache.find(role => role.name === "Members");
const role = message.guild.roles.cache.find(role => role.name === "Muted");
if(!role) return message.reply("Couldn't find the mute role.")
const time = args[2];
if(!time){
return message.reply("You didnt specify a time!");
}
person.roles.remove(Members)
person.roles.add(Muted);
message.channel.send(`@${person.user.tag} has now been muted for ${ms(ms(time))}`)
setTimeout(function(){
person.roles.add(mainrole.id)
person.roles.remove(role.id);
console.log(role.id)
message.channel.send(`@${person.user.tag} has been unmuted.`)
}, ms(time));
}
}
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.find(ch => ch.name === '🖤︱chat'); // change this to the channel name you want to send the greeting to
if (!channel) return;
channel.send(`Welcome to **Equinox™** ${member} I hope you enjoy your stay here!`);
channel.send(`Make sure to check out [#727922552466571304](/guild/264445053596991498/channel/727922552466571304/) and [#727922424062017566](/guild/264445053596991498/channel/727922424062017566/)!`);
});```
How can I make that an Embed?
@hazy sparrow you never define args
in the main file or mute.js
in mute
oh
@earnest phoenix
https://discordjs.guide/popular-topics/embeds.html#embeds
note, dont help that guy :p doesn't like people helping him
seems like it
What @restive pebble ?
u were in djs
<html>
<title>Flantic</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<style>
body,h1 {font-family: "Raleway", sans-serif}
body, html {height: 100%}
.bgimg {
background-image: url('https://cdn.discordapp.com/attachments/716839263320145974/728104493144604742/forestbridge.jpg');
min-height: 100%;
background-position: center;
background-size: cover;
}
</style>
<body>
<div class="bgimg w3-display-container w3-animate-opacity w3-text-white">
<div class="w3-display-topleft w3-padding-large w3-xlarge">
Flantic
</div>
<div class="w3-display-middle">
<h1 class="w3-jumbo w3-animate-top">COMING SOON</h1>
<hr class="w3-border-grey" style="margin:auto;width:40%">
</div>
<div class="w3-display-bottomleft w3-padding-large">
</div>
</div>
</body>
</html>
hm?
@earnest phoenix What ya need help with?
?docs html
Rip
lol
and?
Oof.
hm
it should come like this but coming like that
Did you scale it?
l0l
nah
Along with insert the backround.
idk how to
lol
There
DMs @earnest phoenix
I will send you it.
alr
let me log into top.gg to get mine @earnest phoenix
You can use it.
alr
@restive pebble ?
it dosent load the image
yh
what is canvas l0l
canvas is for making or editing images
poop
what
is good......
@earnest phoenix https://vinniehat-1.gitbook.io/guide-to-making-your-own-discord-bot/
can anyone give me an template for my bot description
Did you click the link
Xev just write about your commands
huh
you dont need actual html or css, writing normal desc is sufficient
i need a css or html template
you dont need any css or html
it looks good
or any way i can add an image in it
you can also use markup to add images
how
Full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.
mark down
whatever
🤔

When my console gets flooded with:
Discord API Error: Missing Permissions```
```CSS
Discord API Error: Missing Permissions```
```CSS
Discord API Error: Missing Permissions```
```CSS
Discord API Error: Missing Permissions```
- 10,000 More
lol
how do i use it lmao
how to make a giveaway command in node.js?
the question's a bit too abstract
its not only a command, there is more running in the background (if its proper made)
there is missing some stuff i guess. also i think your aproach is not the best. if the bot restarts the giveaway is bricked
oof
i would make a command for just creating the Starting Giveaway embed and adding the reaction.
store somewhere the message.id.
what superbrain said, you need to store the message id in some sort of a database
yeah
like an array or json?
Like a database
then get a timer running that checks like very 5 minutes if a giveaway is done or loads a timeout with the remaining time
if the timer ends select a winner from the array of users that reacted
ok thanks, ill work on it :))
i'd personally have a single timer/interval that just constantly checks whether a giveaway had expired
it saves me memory
^
i suggest u to use giveawaysmanager
what is a good free online hoster?
what is a good free online hoster?
there aren't any
if you want hosting, pay for it
There are no good free online hosts
free hardware has always a drawback
^
Someone has to pay for the equipment, the maintenance, power, internet
For those free platforms
yes
then what is the best reliable hoster that isnt too costly?
and they earn from ur isp
Galaxygate is what I use. $3 a month is their cheapest plan
i use digitalocean and im fine with them
yeah
(5$/month)
i host vmware
my friend recommended me digital ocean
currently i have 5 VPS there for my Ecosystem and im fine with it
No backups, limited bandwidth.
But it works
there are backups
Gotta pay for em
Free on gg 🤔
other hoster want money per 10GB of storage
🤔
its possible that they inceased it (wasnt there for almost 8 years)
Is it possible to add a video to an embed?
im using 'discord-giveaway' but there isnt actually anything that sends the giveaway embed. or im just dumb
client.giveawaysManager.start(message.channel, {
time: ms(args[0]),
prize: args.slice(2).join(" "),
winnerCount: parseInt(args[1]),
messages: {
giveaway: "@everyone\n\n🎉🎉 **GIVEAWAY** 🎉🎉",
giveawayEnded: "@everyone\n\n🎉🎉 **GIVEAWAY ENDED** 🎉🎉",
timeRemaining: "Time remaining: **{duration}**!",
inviteToParticipate: "React with 🎉 to participate!",
winMessage: "Congratulations, {winners}! You won **{prize}**!",
embedFooter: "Giveaways",
noWinner: "Giveaway cancelled, no valid participations.",
hostedBy: "Hosted by: {user}",
winners: "winner(s)",
endedAt: "Ended at",
units: {
seconds: "seconds",
minutes: "minutes",
hours: "hours",
days: "days",
pluralS: false // Not needed, because units end with a S so it will automatically removed if the unit value is lower than 2
}
}
});
this thing?
i think you miss a DB or did you use a external DB?
im using a json file
i think you need to define it in the manager
const manager = new GiveawaysManager(bot, {
storage: "./giveaways.json",
updateCountdownEvery: 10000,
default: {
botsCanWin: false,
exemptPermissions: [ "MANAGE_MESSAGES", "ADMINISTRATOR" ],
embedColor: "#FF0000",
reaction: "🎉"
}
});
if i see it correctly it should work. the manager itself sends the message
Yes
the documents you send them where not usable
they need a picture of the front side and backside of your ID
if they cant read it it fails
this.client.GiveawayManager.start(channel, { time: ms(time), winnerCount: winners, prize: prize, hostedBy: message.author, messages: { giveaway: `${emoji} **Giveaway** ${emoji}`, giveawayEnded: `${emoji} **Giveaway Ended!** ${emoji}`, timeRemaining: "Time left: **{duration}**!", inviteToParticipate: "React with \"🎉\" to participate!", winMessage: ":ship_tada: Congrats, {winners} for winning **{prize}**!", embedFooter: `${this.client.user.tag}`, noWinner: "Nobody won because of the invalid participations!", hostedBy: "Hosted by: {user}", winners: "winner(s)", endedAt: "Ended at", units: { seconds: "seconds", minutes: "minutes", hours: "hours", days: "days" } } });
Like this
and where do i define that?
In ur command
I suggest u to take a look at a bot
thhanks so much
(node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined
2020-07-02T06:47:19.114234+00:00 app[worker.1]: at Client.<anonymous> (/app/Index.js:53:27)
2020-07-02T06:47:19.114234+00:00 app[worker.1]: at Client.emit (events.js:315:20)
2020-07-02T06:47:19.114235+00:00 app[worker.1]: at MessageCreateAction.handle (/app/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
2020-07-02T06:47:19.114235+00:00 app[worker.1]: at Object.module.exports [as MESSAGE_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
2020-07-02T06:47:19.114236+00:00 app[worker.1]: at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
2020-07-02T06:47:19.114236+00:00 app[worker.1]: at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
2020-07-02T06:47:19.114237+00:00 app[worker.1]: at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
2020-07-02T06:47:19.114237+00:00 app[worker.1]: at WebSocket.onMessage (/app/node_modules/discord.js/node_modules/ws/lib/event-target.js:125:16)
2020-07-02T06:47:19.114237+00:00 app[worker.1]: at WebSocket.emit (events.js:315:20)
2020-07-02T06:47:19.114238+00:00 app[worker.1]: at Receiver.receiverOnMessage (/app/node_modules/discord.js/node_modules/ws/lib/websocket.js:800:20)
2020-07-02T06:47:19.114296+00:00 app[worker.1]: (node:4) 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: 141)
i need help
define the username of a certain user
like message.author.username or bot.user.username
how do i define my name
only
Uh
@earnest phoenix show code /app/Index.js:53:27
k
const find = await bot.db.collection("Deku-DB").findOne({"g_id":message.guild.id});
Search through client.users to find your ID
your property db is undefined, look where you defined it
No
then what
bot.on("ready", async () => {
let mongoDB = await MongoClient.connect(`MY URL`).catch(console.error)
console.log("Connected to Mongo")
bot.db = await mongoDB.db("Deku-DB")
});
``` there is where i define it
client.users.cache.get(owner).username
@digital wagon
Don't ping
k
Just a tip
there is no error when connecting to the database ?
It can make someone feel annoying
U using MongoDB
yes
It works with heroku?
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'username' of undefined
im getting this
error
send code
fetch owner?
It works with heroku?
@restive pebble yes it does i think it should ppls said
Ok
const owner = 394320584089010179
.setFooter(`Bot developed by
${message.client.users.cache.get(owner).username}`, "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-512.png")
boeing what db are you using
i skipped the whole code
im only sending the important stuff
is it fast
why did snowflake add me
he's cool though
Yes
Ok
boomah

.setFooter(`Bot developed by
${client.users.cache.get(owner).username}`, "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-512.png")```
const find = await bot.db.collection("Deku-DB").findOne({"g_id":message.guild.id});
@earnest phoenix is it in another event?
How u defined client
@earnest phoenix is it in another event?
@digital wagon wdym
both are okay i guess
sql bruh 
Yes
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'username' of undefined
getting this again
fetch the owner
https://ascencia.is-inside.me/bxaQlVgS.png
@digital wagon huh
wat
Wait
.setFooter(`Bot developed by
${bot.users.cache.get(owner).username}`, "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-512.png")```
const find = await bot.db.collection("Deku-DB").findOne({"g_id":message.guild.id});
@earnest phoenix is that code there and run it in another event for your client ?
?
mongoose for the win @digital wagon xD
.setFooter(`Bot developed by ${bot.users.cache.get(owner).username}`, "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-512.png")```
@restive pebble thats what i typed
you were missing quotes
Yes
IDs are strings because they can exceed the maximum safe integer
should i put in message event?
@digital wagon
i would store IDs as string in MongoDB if you use mongoose. if you use the offical client i would use 64-bit int
?
Sql
he has no idea
ohh sql
then use bigint
no, they use mongo
I use local db lol
what db
quickdb?
:o
ouch
interesting
:d
jsons dont work with heroku
Becuz sometimes I make changes to sqlite dbs
this is the problem, if the event "ready" and execute first and the connection hasn't been made to the database yet, if another event executes and exploits the variable <client>.db then what's empty this could be the problem. xD
this is the problem, if the event "ready" and execute first and the connection hasn't been made to the database yet, if another event executes and exploits the variable <client>.db then what's empty this could be the problem. xD
@digital wagon ?
BRUH
bruh
Bruh
you cant use sqlite with heroku since it overrites it every time you rebuild the bot
he meant that you need to wait until the bot has established a connection to the database before you can do anything yet
Await
?
i have no issue for some reason

i think you make something wrong
MangoDB?
euh event 'ready' first > connection db slow > variable db still empty > other event trigger when db is empty > ERROR
MariaDB?
i think you make something wrong
@lusty quest ok soo what does ur code look like?
MongoDB
i load my db inside of my main file
same
i load my db inside of my main file
@lusty quest same
Is it mongo or mango
so it should load before every other file
mongo
mongo
manga
so it should load before every other file
@lusty quest ok ik that but what does ur code look like as of i may be 1000000% wrong
perhaps
MongoDB free?
@restive pebble oui
you can get a free Instance
google MongDB atlas
m0 cluster ay

@earnest phoenix attend fr ?
its fine for small to medium bots. but large bots maybe should use a larger system
yes
as of i may be wrong
wat a good async function for it?
eh
i tried ready
and nope
didnt work
if you only store prefixes, it's more than enough for a big bot
but yeah most big bots have more stuff to store
then its enought
especially economy data
but if you start with storing user profiles it will get annoying
thats true, ive build myself a cluster
@pale vessel I store the prefixes with mongodb

very nice pedro
it works great
so uhh can somone HELP?
kek urgh

mongo is nice. i switched from mysql to Mongo
same
:kekw:

just did it today actually

it's relatively easy to use
now i have a DB cluster with Fallback
so can simine1 HeLp Me?
W
what is your issue @earnest phoenix
No lol
what is your issue @earnest phoenix
@lusty quest i need help with mongo
i need it in an async function
more infos?
but uhh i dont know which
what did you want to do?
connect to my database
?
i did ready function and didnt work
i got errors
like uhh collection not defined
and uhh
yeah
let mongoDB = await MongoClient.connect(`URL`).catch(console.error)
console.log("Connected to Mongo")
bot.db = await mongoDB.db("Deku-DB")
``` what would be a good async function here?
ok
@earnest phoenix euh db() ?
.fetch is promise right?
And my internet is lagging gg
@earnest phoenix euh db() ?
@digital wagon huh?
your url include db
?
what client did you use? mongoose or mongo?
here
#1
and what does this mean

@delicate shore read the error
4th line says you exaclty what is missing
100%lol
Ok I'll help
did you understand what is there in the error?
Now describe
thnx
Send error
how to fix a missing module=
i made a reddit command
Install node fetch lol
@earnest phoenix your url must include the name of the database and https://mongoosejs.com/docs/api.html#connection_Connection-db function db ??
Install node fetch lol
how to do that
@earnest phoenix your url must include the name of the database, https://mongoosejs.com/docs/api.html#connection_Connection-db function db ??
@digital wagon i did include name
Go to package.json
glich dont support node-fetch iirc
Yes
oh
Supports
@earnest phoenix but function db ??
@lusty quest yeah it does
U got to package.json
glitch supports pretty much most node modules
there was someone a while ago here who had the issue and where unable to install it
where did you see this?
even native ones
It's heroku that doesn't support all things
Yeah
U got to package.json
@restive pebble ?
i was able to get puppeteer to work on glitch
@earnest phoenix but function db ??
@digital wagon what?
no problem whatsoever
@earnest phoenix https://ascencia.is-inside.me/TuUQLtte.png
Enter name
of
Node fetch
And add package
why does it says / giphy
Idk
@earnest phoenix https://ascencia.is-inside.me/TuUQLtte.png
@digital wagon what the-
same pedro xD
im getiting collection undefined now
euh the docs dude xD read the docs

im getting collection undefined

the collection is undefined bcs your code is probably wrong
or you cant connect to the DB
@restive pebble there are 3
what is mongoose?
of them
All this money and pain made me heartless
node fetch or node fetch npm?
??
1rst
which i have to add
One
mongoose is a client for acessing mongodb
o
mongoose is a client for acessing mongodb
@lusty quest ok can you help then?
Read the docs
and so is mongodb no?
Docs
mongodb is one too
Read
i ran enable npm
there's both mongodb and mongoose. mongoose utilizes models and schemas while mongodb is just barebones
docs
Read the docs
@restive pebble me?
im being confused from 100 eyes rn
okokokokokokokookokko
@earnest phoenix what package ?
mongodb
mongodb or mongoose ?
i am
@earnest phoenix i litterally send you yesterday a entire YT series for making a Discord bot and there is even stuff about how to use mongoDB
then how are you going to understand us when there is a visual video that you don't understand lol
boeing?
Screenshot

Stop using glitch
add it to your package.json

@earnest phoenix don't include the name of the db in your url
Glitch has that error
@earnest phoenix don't include the name of the db in your url
@digital wagon k
