#development
1 messages Β· Page 1493 of 1
I mean, it was introduced in node 8.9.0 so it's old, but not 0.X old.
That's for the paths option it seems
Oh yeah would you look at that.
what the heck is wrong with dank memer bot why it is hacking permission
i haven't allowed any permission to that bot but it still have permission will joining
whenever i disallow permission on invite it didn't create a role for bot but when i invite dank Memer it create a role which have permissions i dont know Why
You may want to ask in the bot's support server.
they said to type ! accept in invalid channel
Ok great, ask them wtf is wrong with their bot π
Are you talking about the integrated/managed role?
This isn't bot support it's #development help. For programmers.
yes
If you invite a bot with permissions, any permissions, it creates a role with that bot's name
it's how Discord works, has nothing to do with Dank Memer or top.gg.
i cant believe how much mewing has helped me with my jawline
i didn't allow any permission
its been like 6 months but it has really helped
I think you have this channel confused with #general
oh ok
@keen anvil
You probably did have permisisons checked but you forgot
No bot can "hack" permissions or roles.
i tried two times
nothing is unhackable
The only way to create a managed/integrated role is through having Discord do it for you. In this case, the check boxes you enable/disable when inviting the bot. If any of the permissions are enabled, the role is created. If none, no role is created. I doubt Dank Memer is "hacking" Discord into making one.
If someone had found a way to break discord's permission system, trust me, it wouldn't be to create a role for dank memer
That would be a ridiculous application of an exploit.
no permission is enabled
saying it last time
I guarantee you're mistaken π
want screenshot
A video is better.
YEs
Either way, this has nothing to do with development or programming.
If you want to know what's going on, try asking Discord : https://dis.gd/contact
the problem keeps giving me the same error
Did you log require?
everything is fine, it's just that error that gives me trouble
sent the images again?
@sudden geyser
@sudden geyser
what to check in that
nobody knows how i fix this?
You can ask repl.it on their discord: https://repl.it/talk/share/Replit-Discord/2670
There's no way any recent version of nodejs would tell you require.resolve is not a function.
So it must be an issue with their system.
yay well this was worth staying up till 4am for πͺ flex flex... got grapes.js working for stats page editing :D
is this your dashboard?
oh and grapesjs is a massive pain in the ass if you dont want to let it touch the html layout, just sayin'.
yeah MILLION
im wondering if i should make it tabbed or something though
got a lot of content on it now
maybe
you should imo tabbed layouts are better and easier to use
oh
thats true
but that sounds like a problem for them being on mobile
hello
someone help me with this?
css is very fun'nt
what is require.resolve
I have answered you. require.resolve has been a function for as long as nodejs has existed basically. So, this is a problem that you will need to bring up to repl.it support.
is that even needed tho
thats the weirdest event handle ive ever seen
Not really, this person is just copy/pasting from a tutorial
A tutorial that I've written myself, so, I literally know that this has worked for 4 years.
LMAO
lolll
In fact that very line was removed from our tutorial a couple years back oh, actually, wrong, it's still there.
but clearly other people have copied it
that's what you get from cargo culting and noobs not taking the time to learn the language.
I think its funny that I would say im decent at nodejs but know maybe 1/100 of the built in features/abilities
probably close to 1/1000
yea
why? i really don't see a point for that line
There's no point in keeping the cache for an event file, since you can't re-require it anyway
It was a micro-optimisation, not worth very much, to be honest.
yeah
I mean this is literally my tutorial code π
lmao
its kinda amazing
there are people like you who can put this into words and explain why everything works as it does
that just amazes me
and there are people who can't figure out the different theres and yours
no hate for people that cant
its just an easy one
like i understand how the code i write works but its hard to explain it to someone else
agreed
I do have a talent for writing documentation and tutorial. 
thats how you know youre good at what you do is if you can explain it to someone else
makes you a good employee 
"If you can't explain it simply, you don't understand it well enough." - Albert Einstein (slightly paraphrased)
rip me then
Tell that to the company that fired me 2 weeks ago before xmas. 
I don't like black or white quotes like those, its like for the most part they apply, but some times they dont and its kinda just weird
yeah
basically to me it reads: "you're not good enough if you can't explain it"
yeah or "Unless you can explain to someone without the knowledge you don't have that knowledge" thats also basically what its saying
No no it's not about being good enough. You can apply knowledge without being able to explain it. But maybe you don't understand that knowledge at a level that's deep enough to be able to adapt it differently.
Some people are really good at applying knowledge.
Doesn't mean they understand the concepts behind that knowledge.
Aka literally everyone that has ever worked without a diploma/degree
a farmer doesnt need to know about cellulose to be able to take care of his roses
how do i mute someone in a voice channel with discord.js
Can I give bot Adminstrator Perms? I am coding Anti Ping
Itβll have access to every channel
why do you need administrator permission
kinda a privacy concern if you ask me
member.voice.setMute(true)
It gives error when channel is private and no SEND MESSAGE perms
Ok so give the bot SEND_MESSAGE permissions. π
lmao duh
^
What if user doesn't give permission
Just make sure you have the permissions you need. Administrator is never a required permission.
It's not about me
Then tell them "I can't do that, I don't have permissions to send messages"
then they don't want the bot to see the channel
If they don't give your bot perms, they don't want your bot to have the perms.
It's perfectly appropriate for some people to restrict bots in certain channels.
How to send message if don't have send message permission
Lol
Then don't, just fail silently.
π
You laugh but that's literally the proper way to address this situation.
I am thinking to dm
That might become real obnoxious real fast.
Hm
dm the executor of the cmd
if you cant, ouchies
Anti ping is automatic.
No command needed
When I made an anti-mention-spam bot 4 years ago, I just deleted the message if I could, and sent a warning if I could.
no fuss necessary.
yeah lets spam the chat with more messages saying "i dont have permission to do that job i was suppose to" ontop of the spam of pings
I mean, it's possible to catch errors and ignore them, whatever language you're using
Β―_(γ)_/Β―
js iirc
In JS I like to just .catch(o_0 => {})
But only when I know I don't care about the error.
hello
Hehe ok
DISCORD ERROR : Unknown Message
like that, yeah
@client.command()
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
channel = ctx.author.voice.channel
await channel.connect()
server = ctx.message.guild
voice_channel = server.voice_client
async with ctx.typing():
player = await YTDLSource.from_url(loop=client.loop)
voice_channel.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
await ctx.send('**Now playing:** {}'.format(player.title))```
[;ease help
to the voind we go with those
TypeError: from_url() missing 1 required positional argument: 'url'
Ok so give it a url argument. π
You're trying to play a video from a URL, but you're not giving it a URL
I dunno maybe I'm dumb but I don't think "loop" and "url" are the same thing
so i just do url = url in other line
try that
oh
<= doesnt know python, btw
loal
though the error is pretty self explanatory
yeeeeee
How many requests can I make with YouTube API for free per day ?
it works!
yw
lol
you should check the quota limits in the docs, but iirc i was 10000 credits p/d
google says im right
oh thanks
It didn't show me anything when I searched.
you need to calculate based on what requests you do btw
each request uses up an X amount of points
or units, dunno the heck u2b calls them
yeah thats completely unrelated
yeah channel video and playlist take different points
yeah
Just found out that sqlite has in-memory capability..this is epic
but that's not persistent
well that is one reason why people use it. if you dont use a braindead wrapper you have so many options
in memory is not really ment for being persistant over Reboots of the host
You can load a db file into memory
its just for having a cache with fast response times
I think you're confused, a memory sqlite means it's not saved on disk π
I'm not confused..?
It's not a db cache, it's an ephemeral database that goes away when you reboot
Alright sure, sorry, I guess I'm the confused one
I've actually used the memory sqlite to run my jest testing for Enmap
Very useful.
i had my issues with Enmap. mostly bcs sqlite can be pricy on memory if used inefficent
Are you saying Enmap uses sqlite inefficiently?
Now I know you're confused. The issue is that Enmap itself caches everything into memory.
It's meant to be an easy database, not an efficient one.
Enmap used 1GB ram the other day. then i switched to Mysql and then later to MongoDB
Yeah none of these cache data in memory so of course they'd use less of it
Wait those aren't even in memory
Mysql got a Ram Cache?
It's part of the reason I'm creating Josh - it's almost as simple, but doesn't cache anything in RAM.
and MongoDB stores all Indexes in ram
also i have my DB running on a different Server. so it can use Ram as it like without interrupting my Bot(s)
cost the same, but i like to have stuff spread out on more than one Machine.
maybe i switch to a K8 Cluster soon then i have everything handled by the Cluster on 1-2 Nodes
I am trying to run my Quart app and my discord bot in the same file . I am doing so because I think is the only way to send messages with the bot.
The problem here is, just the bot comes online and app doesn't run.
But if I remove the bot.run part, app comes online and works fine
The bot running and the app running are blocking forever
You need to run it on a separate thread
you can use webhook to send message
@orchid cobalt
Does someone know how to get a free custom website domain?
Yeah I got it thanks
most free Domains are getting Blacklisted by Mailservices.
yeah send me a webhook in my DMs
what
but then how can i get a domain?
havent used one in years but i think .tk domains
i generally suggest buying a cheap one than getting a free one
yeah leave it , i meant i can't dm someone with webhooks
oh thanks
buying a domain is always recommended , You can get a domain for a year in 1$ (cheap domain). But if for any reason you can't buy , try freenom
Freenom is a medium way to get a domain, but i highly suggest buying an actual domain as soon as possible
What's the best Lavalink client from here https://github.com/Frederikam/Lavalink#client-libraries (for JavaScript)
Lavacord?
HTTPError [FetchError]: request to https://discord.com/api/v7/gateway/bot failed, reason: getaddrinfo EAI_AGAIN discord.com i get this error when i start my bot
from there?
i'd reckon erela.js
V7 is not a thing, try V8
thats discord.js
does anyone know how to set messageembed color to white?
i already try #FFFFFF and 0xFFFFFF
but still doesn't work
yeah it is
hmmmmm
try FFFFFE
try really light Gray
use f1f1f1
fefefefe for almost complete white
let date = []
let guilds = []
Object.values(Guild).map(r => {
date.push(r.day)
guilds.push(r.guild)
})
let width = 800
let height = 600
let chartCallback = (ChartJS) => {
ChartJS.plugins.register({
beforeDraw: (chartInstance) => {
const { chart } = chartInstance
const {ctx} = chart
ctx.fillStyle = 'black'
ctx.fillRect(0, 0, chart.width, chart.height)
}
})
}
let canvas = new CanvasRenderService(
width,
height,
chartCallback
)
const configuration = {
type: 'bar',
data:{
labels: date,
datasets: [
{
label: 'Guilds Add',
data: guilds,
backgroundColor: 'white'
},
],
},
}```
module use : chartjs-node-canvas
only one of the two values ββis displayed
while there are two
does the color stay after rendering one column?
this is the final rendering
Does erela.js have more features than Lavacord?
@Tony Kun#8496 what
there's two
look in the chart
the second on is at 10 so it's the lowest value
so you can't see the bar
ah I didn't see that I'm stupid
man i gotta start learning how to fucking read
ahh yes chart.js where a pain in the ass to figure out how it works
by any chance not possible to make one so that its starts at 0? and not at 10?
its possible.
need to look at what ive had done for it, probably not the best way but it worked for me
okay
hmm, i use the same data structure as you do, need to research somethign really quick
https://stackoverflow.com/questions/52715393/chart-js-bar-graph-will-not-start-at-zero-as-minimum-value you need to set the zero for the axis. this post is from 2018 ive used min:0 instead of beginAtZero
const ticksOptions = [{ ticks: { fontColor: "white", fontStyle: "bold",min:0 } }];
const options = {
// Hide legend
legend: { display: false },
scales: { yAxes: ticksOptions, xAxes: ticksOptions }
};
``` i pass the options in the configuration
I have to put this where?
after your data bracket in your configuration (i just pass the value)
it works thanks
took me back then a few days to figure this out
the frontColor and Style are not needed, if wanted you can change them also
it is true that chartjs is quite complicated :0
its not that complicated, if you understand how it works
The same could be said about any API
for once I will be satisfied with my little graph that I understand very well and not go too far in the research
exept the Google API, you need to be Insane to understand this stuff.
If you understand how it works, it's not complicated
That's the premise of having an understanding of something
Which one is better- Message to User with Embed or without Embed?
depends
on?
what you send
i would just send a normal message. an Embed would be to much
Why embed be too much?
I am curious to understand
for me Embeds are more something for stuff that needs to look not shit.
and a simple Status message is a bit overkill to use embeds
Gotcha
anyone know how I could optimise my tensorflow.js model
Machine Learning π
where is the issue?
cpu usage
image stuff or text stuff?
image
get a dedicated GPU. Tensorflow on CPU is really taxing
well
easier said than done
lol
I don't have that much money to get one
for a server
I use an image ai in my bot
maybe look into the specalized ML server Amazon, Google and Azure offer
they are fine, not cheap but not that expensive
also I tried stuff like a quantum version of my ai
which is converting it to be smaller and faster
but the accuracy was horrible
only thing i really need is a good cpu
with my pc it was only 14% and I haven't even used the gpu
so yeah
idk about other methods to improve models
the smallest Amazon Sagemaker costs between 0.065- 0.075$ /Hour so yea they are quite expensive
maybe rent a higher powered Root server and run it on there
my Hoster to go offers Servers with Ryzen 3600 for about 40β¬/Month
or you buy a old Server from Ebay, buy a quadro p2000 or something like this together with a matching CPU in the server and then rent into a datacenter with it. (should be not this expensive)
which library? for discord.js, you can get the guild count by counting the length of bot.guilds.cache.array()
bot how do i put it on top,gg (discord.js)
https://top.gg/api/docs It uses a different library @top-gg/sdk for it
https://www.npmjs.com/package/@top-gg/sdk
what is shards
how many shards your bot is running on
500 Shards?
If you are making a small bot, you dont have to worry about shards, but basically, shards are splitting your bot into many parts for faster processing
how do u make something like this?
CSS hackery
i thought we could only use but <embed> is html
Help
here is the part
let levels = db.has(`level_${message.guild.id}`, { sort: '.data' })
let content = levels
It send this
well has returns true or false
how?
use get instead of has
is there a endpoint to get a list of guilds that a user has admin permission
my dashboard is listing out all the guilds that a user is in
no
uh
but is there anyways to do it
there's an endpoint to get all user guilds which returns partial guild objects
you get a permissions field there and you can then filter through that to get ones where they have admin perms
oh
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
imma check out the permissions field
use bitwise fields. i do a check to see if a user got Manage Guild permissions with 0x20
(i get this stuff with oAuth2)
from the message
get the index of the ping and then slice it out
not working
slice or splice?
did you tryed args.shift().toLowerCase()?
ohh you want an optional parameter
Yes
but you dont know what index ping will have right?
it depends upon user where he wants to use
ive used something like this in one of my bots, but i have to search for it
right ive used the minimist npm package
well then you probably have to get the index of the word then shift it and slice after it
args.splice ? change to shift?
wait nvm
will it work?
slice is not needed
since its already split into different segments, you just need to find the index for the ping
try includes("-ping")
i did it with a really stupid way. by running a for loop over the args array and then check on each index if it includes the needed word
its not pretty or efficent but it worked for me
where
in your for loop
okk
kk
it worked but i want to remove it
i dont know how to remove that -ping
slice it with the index of the message
args.splice(i, 1);
try and see
also adding mutiple numbers to slice will remove them from the array
so in your case you remove the 2nd and what ever your index is
hmm try splice(i,0)
kk
still getting that word -ping in message
are you sure you endup with the correct array?
wait leeme show you code
hmm
try ```js
const str= args.indexOf("-ping")
str.splice(str,0)
or something like this
kk
Same -ping
it was inside loop
Outside loop. Return str still not working
Anyway thanks
Ill figure out something
Whats a good interval for changing status of a bot?
every minute
is there a bot which can ask feedback of server from users and then tell the admins what they told
yes, but this channel is for development, we can help you make one, you might wanna go for #general to ask for a specific bot @solemn ocean
i cannot, since i dont know any
though there's likely a ton of them around
just gotta search for it
ok
font-family
didnt work
Can't help you then
im losing braincells
legit
Can anyone tell me how to host my bot 24/7? Btw I use repl.it

use heroku
Can it be used on iPad?
sure use ||and buy a vps||
I donβt wanna buy anything tho lol @marble juniper
Like a free 24/7 hosting website that can be used on iPad
or work for aprixstudios and use their vps /s
lol no
*kitsuyo
Does it has to be bought?
If i did have money lmao
a vps isn't that expensive
depends somewhere between 3-5$/month
@marble juniper lmao Denmark
buy a Samsung Smart Fride. (yes theoretical this works, they run Android)
Lmao
than a simple raspberry pi
but you dont have to explain to your family why this thing is running all the time
@marble juniper **cough cough Samsung fridge 34 thousand kr here
@lusty quest
yall have a fucked currency conversion
Wtf
buy a samsung smart fridge and run my bot on it for it to become a samsung smart stove
Thatβs like 200kr here
what is Samsung fridge?
@neon heart like a huge fridge with a screen
hi
lol
i search in google and i got Samsung refrigerator
lol
a fridge but smarter
How many cores do i need to run the music bot without problems?
1 but a lot of ram
indonesia
2 core maybe?
also you probably want to multi thread your Bot
2GB good?
2 vCPU
4 GB Ram
good?
could work for the beginning. if you know how to code efficent it will work
standart,
nope i still learning with erela now
To the first 100 servers that use my bot you mean
yes

bcs music bots thend to use a lot of ram if not coded efficent
can i use private pc for hosting?
yes but you have to keep it running 24/7
What is the best system to do that?
start the process and never shutdown the pc?
No, I mean an operating system
Linux,Windows,MacOS,ChromeOS
Give me an example of vps
What is the best plan?
the one that fits you?
depends on how much ram your bot Uses, if you code efficent you can probably run a bot with 1000 Guilds on 500MB ram
It now works on 6 servers and consumes 110 mb
You have to see what your bot needs and calculate it
for example if now your bot only consumes - + 200 mb, then 500 - 1gb is the best choice
like this answer
Typescript has tuples implemented with arrays.
Is there anything similar for Maps or Sets??
In other words, I just want to fix the size of the Map
Is there a rule on how fast statusβs can change for bots?
some more informations, errors, language
the minimum safe interval is once per 15s
otherwise you might hit a gateway ratelimit
was <guild>.member.hasPermission removed from discord.js ?
replaced with permissions.has()
<guild>.member.permissions.has("...") ??
yes
thanks
How do I get how much servers my bot is in (Java)
in which library
JDA 4.2.0_168
what do we put on guild ?
https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/JDA.html#getGuilds()
call size() on the returned list
@knotty obsidian
ok thx
what do we put on <guild>?
an instance of a guild
let guild = client.guilds.cache.get(<guild ID>);
for example, there is a lot of ways to get the guild object
ok thank
can anyone tell me why this is not working
if (client.guilds.cache.get('ID HERE').members.cache.get(id))
returns false even tho i tried it with many IDs of people that are in the correct server id
Make sure you have guild member intents enabled.
Else you'll need to make a rest request to ask Discord if the user is in the guild
ohhh i forgot ;-;
@tight plinth
// Modules //
const fs = require('fs');
const Discord = require('discord.js');
const DBL = require('dblapi.js');
const mongoose = require('mongoose');
// Boot Resources //
const Essentials = require("./resources/utils/essentials.js");
const config = require("./resources/data/config.json");
// Starting up Discord Client //
const client = new Discord.Client({
fetchAllMembers: true,
presence: {
activity: {
name: config.client.presence.activity.onBoot.name,
type: config.client.presence.activity.onBoot.type
}
}
});
// Global `client` variable resources //
client.config = config;
client.logins = require("./resources/data/login.json");
client.dev = require("./resources/data/developers.json");
client.color = require("./resources/extensions/colors.json");
client.emoji = require("./resources/extensions/emojis.json");
client.def = require("./resources/extensions/defaults.json");
client.package = require("./package.json");
client.commands = new Discord.Collection();
// Handlers //
var handlers = fs
.readdirSync(`./resources/handlers`)
.filter(file => file.endsWith(".js"));
for (var file of handlers) {
require(`./resources/handlers/${file}`)(client);
}
// Getting other global `client` variables //
client.owner = client.config.admin.owner.id;
client.admin = client.config.admin.id;
client.name = client.config.client.info.name;
client.description = client.package.description;
// Connecting to MongoDB Database //
mongoose.connect(
`mongodb+srv://${client.logins.mongodb.username}:${client.logins.mongodb.password}@${client.logins.mongodb.cluster.url}.mongodb.net/${client.logins.mongodb.cluster.database}?retryWrites=true&w=majority`, {
useUnifiedTopology: true,
useNewUrlParser: true
}
).catch(err => console.log(err));
client.login(client.logins.token);
```Is this compact enough for a Index?
i mean if it works yes
it does
You could structure your index file any way you want, but I recommend using the index/main file as a loader for your modules, then do your stuff elsewhere. In this case, you're doing that.
did i do good?
or should i like
make it so you can do like
~>loop q to loop the queue ect
H but i like the colorrrrrrsssss
makes it look too fat
looks cluttered with a lot of unnecessary informations
H
oki oki i get it
poor github
poor github
@earnest phoenix there that look better
much
time to code a illegall spotify api
looks less cluttered now, i like it
ive been coding this bot
for 4 months

its only taken this long because im lazy tbh
its ok i spend more time staring at my code than actually working on it
lmfao
@young flame at least you know how to code
:(.
lmao
sameee
it could have been done
but i dont wanna do the mod logging stuff
so i decided to add more commands until i was forced to do the mod loggin stuff
Anyone know how i can connect discord bot with Dialogflow ?
uh
you mean the chat api thing?
here
https://github.com/haseemisaac/Dialogflow2Discord this works to
@willow mirage
yes
@young flame they are outdated . . .
π
looks better than mine
maybe it's defined in the wrong scope
If something stops working and nothing's changed, something's changed.
sure why not
well
your problem is
it's not defined when you call it
needs to be defined at the top
you might also wanna fix this error π
Are functions not hoisted?
Though to be fair, I might be a bit wrong - this could be fully caused by the syntax error
actually that might be it
since the script has an error it's not loaded, so, the function isn't defined. 
Discord-giveaways modΓΌlΓΌ yΓΌklenmiyo nasΔ±l yΓΌklicem
directly call the API, worked for me when i played a bit with it
oh ok
Hello, does anyone know how to get an array of values from a quick.db database? Iβm trying to create a leaderboard command that will display the top 10 users with the highest db value, but nothing in the quick.db documentation explains this. Thanks.
M
https://discord.gg/2SUybzb Support server of quick.db
just ask there
lol
Ok, thanks.
how did you execute the event?
No errors
wdym?
require('./handlers/events')(client);
const { readdirSync } = require("fs")
module.exports = (client) => {
try {
const load = dirs => {
const events = readdirSync(`./events/${dirs}/`).filter(d => d.endsWith('.js'));
for (let file of events) {
const evt = require(`../events/${dirs}/${file}`);
let eName = file.split('.')[0];
client.on(eName, evt.bind(null, client));
};
};
readdirSync("./events/").forEach(x => load(x));
} catch (e) {
return require("../tools/functions/error")(e, undefined)
}
};
this points then to your event
how does your ready file looks like?
const mongoose = require('mongoose');
module.exports = (client) => {
try {
await client.user.setActivity(`any messages in DM`, { type: "WATCHING" });
await mongoose.connect(process.env.mongo, {
useNewUrlParser: true,
useUnifiedTopology: true
}, () => {
console.log(`${client.user.tag} has been conencted to database.`)
})
console.log(`${client.user.tag} is ready!`);
} catch (e) {
return require('../../tools/functions/error')(e);
}
}
normal
you dont need to handle the event to get other events
Provided token: Nzk0OTYyNDM2NTAzMzcxNzk2.X_Ccdg.***************************
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 990
[WS => Manager] Spawning shards: 0
[WS => Shard 0] [CONNECT]
Gateway : wss://gateway.discord.gg/
Version : 6
Encoding : json
PS D:\talky-bot> node .
Provided token: Nzk0OTYyNDM2NTAzMzcxNzk2.X_Ccdg.***************************
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 986
[WS => Manager] Spawning shards: 0
[WS => Shard 0] [CONNECT]
Gateway : wss://gateway.discord.gg/
Version : 6
Encoding : json
Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] [CONNECTED] wss://gateway.discord.gg/?v=6&encoding=json in 268ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
this is on the debug
Token
still normal
iti s ok
Is in there
its not the full token
hashed
how
ah
the debug work fine
how old is your d.js version?
bcs it uses the V6 api
it is v12
yea but what version
v12.5.1
bcs the V6 API is deprecated
so?
hmm its the latest
yep
Can someone help me whats going on here i use Repl.it so i can find these path locations watching a yt tutorial and it didnt happen to him
did you get any more stuff after the heartbeat interval?
strange. looks like you dont authenticate to the gateway
wdym?
quick question
?
?
we are not py
does anyone know a css framework which only does checkboxes? kinda a stupid question but was just wondering
discord.js uses a Websocket connection to the Gateway (Discords Websocket server) if you login you get a Hello Event. after this you should authenticate
but don't
did you see any heartbeat events?
@slender thistle Can u help please
been told to ping u
Just the ping of the heartbeat and sending heartbeat
like a normal css framework, does tabs, navbars, buttons etc. but im only looking for form / just checkboxes. any ideas?
hmm so the websocket is connected. did you pass any intends to your client?
wdym?
its possible that you dont send any intend
Wdym passing intends ?
one sec. ive had done this for now on a Websocket level but forgot what to add to the client options
sorry it's off topic but how can you send codes like that (colored)
```js
text
```
thanks
did you call somewhere client.login(token)?
so know one knows whats going on?
in the index.js file
after the client is initilized?
yep
hey so i am trying to make a command that can be reset but i want it to stop doing that part of the command, so how do you do it? i am using quick.db for this on discord.js here is he code for that part
hmm bcs thats the only thing i can think off why you dont get the ready event
nah
what exactly did you want to reset?
so i wanted to reset that part where the pb part is
pb?
yea you run this part of code anyways bcs you check if fw ===1 or if fw === 0 to execute the code after this
it has the same effect as if the check is not there
not the fw1 or fw0
so the collector doesnt work?
or did you want to prevent that the part gets executed at all?
You must be doing something spammy kekw
so when i make a preventer all it does is stop the whole command from doing it
not the part
but you want to prevent this special part?
i would suggest to add a check after if(collected.first().content where you get a value from your db that decides if the thing is locked or not
like a simple boolean would work
and in your admin command you can just switch the boolean to lock or unlock it
ok
hmmmmmm im pretty sure i can check like if(lock === 1) return message.channel.send("test")
after i fetch the lcok
ill try it
just check if (lock== true) return message.channel.send()
but 1 and 0 should also be valid in js
did you fetch the lock from the database?
did you stored it with true or 1?
it locks me out of command compltely not the special part
bcs if you use true you cant use ===
in the db?
then it should be valid
yes but it blocks the whole command not special part
where is your if(lock) check? directly after the pb check?
here
i have no issues with it. are you sure you login?
yes
wait imma restart pc
pb was example
it works as intended
here ill try again
like you ran the command and it locked the entire command
yes
you have somewhere an error show your main file
it worked before?
no it showed that message
callback hell, stop
it showed that you already spawned the thing like in your lock check
hmm
well its fixed

so bye
me want codes
you want learn
from where ?
internet? books? resources?
books
the internet is a fantastic thing to learn stuff (if you search right)
google.com => how to code
ohk
or check the pins in this channel
are u gonna use javascript or something else???
then u can search up how to start a discord bot using node.js for javascript bc i code in JS
true but i was saying for the bot
part after u learned
D.js sux confirmed
show your main file. maybe there is an error
me?
yes
const {Client, Collection} = require("discord.js");
const client = new Client();
require('dotenv').config();
client.start = new Date();
client.chats = 0;
client.aliases = new Collection();
client.commands = new Collection();
client.guild = new Collection();
require('./handlers/commands')(client);
require('./handlers/events')(client);
client.login(process.env.BOT);
thats some dense code
tell me about it
he doesnt get the ready event
Ready event is not working
im not even sure that dotevn is going to work
well i just require it
dotenv.config()?
work or not idc
this is valid
dotenv.js?
gg
noice
d.js just sux
what IS dotenv?
no
well no shit, that i know
dotenv exposes enviroment variables in a .env file as process.env
you requirinjg something that is already on the process
what IS YOUR dotenv
lemme rephrase the question
a .env file?
.env.config() is a thing?
the heck
yea?
BRUH
not alway
well dotenv just exposes the .env file to the entire process in a handy way
ENV is native
BUT CAN YOU FOCUS ON MY READY EVENT
CAN YOU NOT SCREAM
YOU ARE SCREAMING
jesus christ, cancer chat this early in the day
xD
u are BOTH screaming so chill
good luck withy our problem
console.log(process.env.BOT) if it returns undefined your .env file is in a bad spot in your file system
nah it won't
did you checked this?
cuz in debug shows the token is valid
I feel bad for you Erwin
and my bot is online
do any events work?
at least Erwin actually tried to help lol
time to play a game of spot the differences
the events look fine.
const mongoose = require('mongoose');
module.exports = (client) => {
try {
await client.user.setActivity(`any messages in DM`, { type: "WATCHING" });
await mongoose.connect(process.env.mongo, {
useNewUrlParser: true,
useUnifiedTopology: true
}, () => {
console.log(`${client.user.tag} has been conencted to database.`)
})
console.log(`${client.user.tag} is ready!`);
} catch (e) {
return require('../../tools/functions/error')(e);
}
}
what message?
message event
module.exports = (client, message) => {
if (message.author.bot) return;
if (message.channel.type == "dm") {
return require('../../tools/talking/talking.js')(message);
}
}
and you know that works?
chill
i did
you didn't log in
i did . . .
he does
or the event handler didn't work
in his main file
dude i was playing with d.js for a year now, i know what im doing. The problem is just that d.js sux
i use D.js now for 2 years and have no issues
me no
const {Client, Collection} = require("discord.js");
const client = new Client();
require('dotenv').config();
client.start = new Date();
client.chats = 0;
client.aliases = new Collection();
client.commands = new Collection();
client.guild = new Collection();
client.on('ready', () => console.log('Index ready'))
require('./handlers/commands')(client);
require('./handlers/events')(client);
client.login(process.env.BOT); ```
@willow mirage do that and run it
i did
do it again




