#development
1 messages ยท Page 1083 of 1
so to set up the server on my host
the console line thingy has a $, is this significant in any way?
eh its probably fineeee
i really need help
so i said
if(message.member.roles.cache.has('736254361541279794')){
message.channel.send('https://youtube.com')
} else{
message.channel.send('You cant use this command.')
}
but it didnt work
people have 736254361541279794 role werent able to use that command
nope
it does have a cache
yeah but why it doesnt work?
im confused
im new to these things
and i was playing around
hmmm
console.log(message.member.roles.cache)
thanks
lemme try
console.log(message.member.roles.cache)
@quartz kindle hm didnt work
or use bre-
what?
nothing
well? what did your console say?
a bunch of things
but i think
UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
this is the main
you are trying to use message where it doesnt exist
and?
and what?
thats the problem
go look in your code and fix it
or if you dont know how, show your code
rest of it
what does Threshold surpassed: 10000 mean on lavalink
The threshold was surpassed.
no shit sherlock
sherlock shat his pants
wth is a Threshold and why was it surpassed
but for real idk
send all of the code bruh
i told you to show your code
bot.once('ready', () => {
console.log(Santas little helper is ready to help!);
bot.user.setActivity('helping santa');
});
bot.on('message', message=>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('i wont ping');
} else if (command == 'mod'){
if(message.member.roles.cache.has('736254361541279794')){
message.channel.send('secret mod command shh')
} else{
message.channel.send('You cant use this command.')
}
```js
code here
```
the error is not coming from that code
if(message.member.roles.cache.has('736254361541279794')){
message.channel.send('secret mod command shh')
} else{
message.channel.send('You cant use this command.')
}
Oof
pieces of code out of context dont help
the error will tell you what line of code is causing the error typically
your error is somewhere in the middle of everything and can only be found by seeing all of it
because its context-dependent
all of the script?
yes
const Discord = require('discord.js');
const bot = new Discord.Client();
const prefix = '!';
const fs = require('fs');
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const commands = require(./commands/${file})
bot.commands.set(command.name, command)
}
bot.once('ready', () => {
console.log(Santas little helper is ready to help!);
bot.user.setActivity('helping santa');
});
bot.on('message', message=>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('i wont ping');
} else if (command == 'mod'){
if(message.member.roles.cache.has('736254361541279794')){
message.channel.send('secret mod command shh')
} else{
message.channel.send('You cant use this command.')
}
}else if (command == 'monkey'){
message.channel.send('dude im a bot, not a monkey');
}else if (command == 'hello')
message.channel.send('hi there human!')
});
bot.login('token');
yikes token leak
yikes token leak
@solemn latch changed it
doesn't matter its already been disabled in the bots in here
token leak owo
you prob wanna delete that
and use a config.json
this is why i dont enter #development
@silver dust can you please delete it, your leaking your token.
json > envs
ITS RESETED
Token is invalid by now anyway
having to add an env for everything is annoying af
not in my opinion
json + require/import
anyway i still dont see the error anywhere, show the full error
Jsons was always better than env...
^^
dotenv?
env variables eew
pretty much just a config at that point ๐ค
if you use pm2 and have multiple projects, you can also use an ecosystem file
and put all your tokens in there
bruh

i mean watcha expect
yeah i posted it on github to reset it aswell
just incase
๐ค
tokens posted on github reset them
iirc, a lot of things are on it
people have 736254361541279794 role werent able to use that command
give the full error plox
UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
full error
yea
Full error would guide us to help you where the error is coming from and close this case
after this im never entering #development again

damn
So... You gonna show the full error or
@twilit rapids do you play from youtube on chip
Yes
(Isn't it frustrating when somebody asks for help but doesn't do what you're saying to help them fix this
)
bot.once('ready', () => {
console.log(`Santas little helper is ready to help!`);
bot.user.setActivity('helping santa');
});
bot.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'ping') {
message.channel.send('i wont ping');
} else if (command == 'mod') {
if (message.member.roles.cache.has('736254361541279794')) {
message.channel.send('secret mod command shh')
} else {
message.channel.send('You cant use this command.')
}
} else if (command == 'monkey') {
message.channel.send('dude im a bot, not a monkey');
} else if (command == 'hello')
message.channel.send('hi there human!')
});
bot.login('token');```
(yes)
@twilit rapids how do you cycle through ips?
nhandledPromiseRejectionWarning: ReferenceError: message is not defined
at Client.<anonymous> (/Users/alitugratasci/Desktop/humpty/index.js:22:15)
at Object.onceWrapper (events.js:421:28)
at Client.emit (events.js:315:20)
at WebSocketManager.triggerClientReady (/Users/alitugratasci/Desktop/humpty/node_modules/discord.js/src/client/websocket/WebSocketManager.js:433:17)
at WebSocketManager.checkShardsReady (/Users/alitugratasci/Desktop/humpty/node_modules/discord.js/src/client/websocket/WebSocketManager.js:417:10)
at WebSocketShard.<anonymous> (/Users/alitugratasci/Desktop/humpty/node_modules/discord.js/src/client/websocket/WebSocketManager.js:199:14)
at WebSocketShard.emit (events.js:315:20)
at WebSocketShard.checkReady (/Users/alitugratasci/Desktop/humpty/node_modules/discord.js/src/client/websocket/WebSocketShard.js:467:12)
at WebSocketShard.onPacket (/Users/alitugratasci/Desktop/humpty/node_modules/discord.js/src/client/websocket/WebSocketShard.js:439:16)
at WebSocketShard.onMessage (/Users/alitugratasci/Desktop/humpty/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
(node:19052) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19052) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code
eh
dawg
message should be on brackets, no?
no
I'm not gonna explain you how IP Rotation works so... Go here instead https://discord.gg/DhydxT
lambda functions with one parameter you dont need brackets
isnt it bot.on not bot.once
once is better for ready event


the ready event should only fire once
^
message is inferred
youre the typescript dude right
iirc you dont need to explicitly define it
ya
@opal plank parameters... If only one, no parentheses needed, but if 2 parameters, parentheses are needed
fair
Like a function call back
wot
one sec
An arrow function expression is a syntactically compactย alternative to aย regularย function expression, although withoutย its own bindings to theย this, arguments, super, or new.targetย keywords. Arrowย function expressions are ill suited asย methods,ย and they cannotย be used as const...
1 const Discord = require('discord.js');
2 const bot = new Discord.Client();
3
4 const prefix = '!';
5
6 const fs = require('fs');
7
8 bot.commands = new Discord.Collection();
9
10 const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
11 for(const file of commandFiles){
12 const commands = require(./commands/${file})
13
14 bot.commands.set(command.name, command)
15 }
16
17
18
19 bot.once('ready', () => {
20 console.log(Santas little helper is ready to help!);
21 bot.user.setActivity('helping santa');
22 });
23
24 bot.on('message', message=>{
25
26
27 if(!message.content.startsWith(prefix) || message.author.bot) return;
28
29 const args = message.content.slice(prefix.length).split(/ +/);
30 const command = args.shift().toLowerCase();
31
32 if(command === 'ping'){
33 message.channel.send('i wont ping');
34
35 } else if (command == 'mod'){
36
37 if(message.member.roles.cache.has('736254361541279794')){
38 message.channel.send('secret mod command shh')
39
40 } else{
41 message.channel.send('You cant use this command.')
42 }
43
44
45
46 }else if (command == 'monkey'){
47 message.channel.send('dude im a bot, not a monkey');
48
49 }else if (command == 'hello')
50 message.channel.send('hi there human!')
51 });
52
53 bot.login('token');
```this is the code with line numbers for debug info
though usually afaik you need parenthesis
for zero parameters yeah
@misty sigil i don't know if that's correct though... It says the error is on line 22
lul
also fyi
i didnt copy the whole code
AND the person who asked isnt here anymore

no >:c
hey man
e >:c
just set a background url
is that on purpose please
makes it easy on the eye
its not shittalk, its feedback
or reduce its effect
it really look some MsPaint type of deal
slap a background and it should improve drastically already
Looks 2005
grammar issues
Yeah, remove the dropshadow and have a background
thiscord
Will look so much better
It looks like one of those 2007 scam websites wtf 
Dice lowkey blocking all of us for shittalking his hard work

Lol
aleBot - The new, revolutionary Discord bot! With image manipulation, advanced XP system, generated rank card images, weather, a QR generator, a translator, polls, ASCII and much more coming soon!
there i fixed some small grammar errors
i swear this aint cyberbullying, we just bullying him in a constructive way
slap this shit on and boom beautiful content
for the record
Poor tim dealing with this stuff everyday
not everyday
hmmmmmmmm
im not that insane
Lol
tim is like the most relied on person ever 
Idk man, i always see you here though
okay for real though
only because i do it for free
THERE HAS TO BE A BETETR WAY
for now
i only know how it feels because some dude just @jeremy clarkson#0001 how do i use embeds in bot ghost
What
someone pls help
for now
@quartz kindleDon't quit, begginers can't continue without you

why are people bullying me for being bad at web design 
we arent bully
we just giving you inspiration
Oh, can't you just generate them in code
?
Python?
nobody is bullying you we are offering help
sorry, i have the bad habit of eating everyday
||while saying its shit though||
nah
i manually types them
thats why i was considering canvas
but equally as much effort
mate you can do that in premiere pro as well
just look at my boy @pale vessel 's avatar, it was my old one
also hassle
Bruh i just made that in a few lines, no need for that many artboards
Canvas is just for this
Oof
ik
i could've used canvas
but a: i dont have cavas installed
b
i hate canvas
c i hate canvas
Why though
canvas without libs is just obnoxiously annoying to learn
I mean it's fun, you get to master it while using it
thats the whole problem
It's not that hard
Oh you on ts?
I see why
whole lot to learn
Canvas on ts is hell
.......canvas?
Oh god, idk like just try to use it... And like creating Optional things and stuff
interfaces with canvas sounds like a whole lot of fun
im already down half way
lmao
When I'm bored i just use canvas to make some things that are fun to work with
That's how i mastered it
tbh i dont regret only starting Ts now
cuz i was being pushed to move to it quite a while ago
and i kept postponing
glad i did it now though
quite a good timing
enough Js knownledge to have a foothold on Ts
So in this switch, do you like js or ts more
Ts is way more strict, though from what i see, its much better than Js
Yea resolves some errors you get that you can't solve and helps but sometimes it's a pain
||Js is looser than a whores cu*t|| it lets everything pass by without errors even though its clearly wrong
Yes
Oh
pg.query => promise.accesspropertyofpromise
its a no go
theres a ton of small stuff that needs to be fixed
js lets you access values of promises without batting an eye
when i ported the code, i was well over 3 digit errors
Yea you should resolve the promise before accessing a property on it so good point, +1 for ts
though to be fair, i have strict-mode on
i think it was over 200 errors
almost at 300

how do i make an image fit the screen size and stay static?
flex?
at RequestHandler.execute (/home/ubuntu/ZSurviveBot/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
at processTicksAndRejections (internal/process/task_queues.js:97:5)```
Anyone knows what can cause this? I got this like 4 times in the morning while I was sleeping...
a
Connection issues mate
But what kind of connection issues?
how do i automatically fit screen size?
isnt % a thing?
oh
I mean, is it my fault or Discord's?
@crisp geyser uhh, connection issue is a connection issue?
fuck its been a while i fucked with css
not sure how to use x)
@crisp geyser where do you host
i worked with css quite a while ago, but it was snippets, not full of development
OVH
Don't think it could be OVH's fault, but idk
aaaaaaaaaaa
I wonder why is the Core [4] line not as perfectly lined as others, why discord... Why
4 is wide
Just like wide putin
nice
Seems like 4 is wider than 1-3 and 5-8
F
I mean since Nice is 0%, you can just remove that
Oof
big oof
22
@opal plank why is 17 and 22 a gif
i just changed em
i use .ts
any other off?
Also 68
I don't see any other
Also yeah 4 is wider of some pixels
now time to slap those badboys somewhere
How tho idk, isn't all has to be exact same pixels or whatever
Mapped and all has the same values
Kinda interesting, very interesting
Code block
Code blocks are cool and all, but any idea of why would discord disable it's colors to mobile discord

they like didabling things on mobile
By looking at the mobile code, the colored block codes feature is not even implemented
afaik its powered by highlight.js
maybe they didnt get it to work on mobile for some reason lmao
pls tell me bots can react with emoji name only
and not id
PLEASE
i dont wanna make a json obj with a emoji id for each gif

How
How could I make it so if a users account isnโt a day old, it sends back a embed saying wait 1 day till you can use this bot

what library, @zealous torrent ?
eeee
discord.js
easy
if (Member.createdTimestamp <= 8.64e+7) return message.channel.send('retard');
Ok thanks lol
yeah
:(
-.-
yo lowkey why VSC does this?
sometimes i can access objects with collapse, sometimes i cant
debugger session
const opts = {
maxResults: 1,
key: process.env.YOUTUBEKEY,
type: "video"
};
const songArg = await search(args.join(' '), opts);
const songURL = songArg.results[0].link;
const songInfo = await ytdl.getInfo(songURL);
let conection = await message.member.voice.channel.join()
let dispacther = conection.play(songURL)
youd likly have to build something for that
how to change the permission of a category
Anyone know of any good very cheap node vps?
very cheap is like contabo or whatever its called
oxide is a terrible name for a company.
cant just google it
oxide.host :)
glitch
how i get "link"?
index the array to get the object
then you just use the appropriate property
quick question does channel.overwritePermissions work on discord.js 12
thx
Anyone know how to make the bot automatically update it's status everytime it joins a new guild?
@earnest phoenix Add the status command to your guild join event
let role = msg.guild.roles.cache.find(r => r.name == 'Muted');
if (!role) {
try {
role = await msg.guild.roles.create({
name: 'Muted',
color: '#FF0000',
permissions: [],
});
msg.guild.channels.cache.forEach(async (channel, id) => {
await channel.overwritePermissions(role, [
{
deny: ['SEND_MESSAGES','ADD_REACTIONS'],
},
],);
});
}
catch (e) {
console.log(e.stack);
}
}```
i am having problems here [Symbol(code)]: 'INVALID_TYPE'
Why do you have the permissions inside an object inside an array?
xD
hmmm i was looking at the doc and see it like this
{
id: message.author.id,
deny: ['VIEW_CHANNEL'],
},
], 'Needed to change permissions');``` so i changed it to that
let role = msg.guild.roles.cache.find(r => r.name == 'Muted');
if (!role) {
try {
role = await msg.guild.roles.create({
name: 'Muted',
color: '#FF0000',
permissions: [],
});
msg.guild.channels.cache.forEach(async (channel, id) => {
await channel.overwritePermissions(role, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
});
});
}
catch (e) {
console.log(e.stack);
}
}``` this is the old code it used to work but it doesn't anymore
You still have the object inside an array
i see so do i just remove it
yes
alr thx
if(member.user.bot){
if(member.user.id !== client.user.id)
return message.channel.send('Bots wont reply. You can\'t play against them')
}
why does it give me this error
even though I check for it
What is member
var member = message.mentions.members.first() || client.user
how i can create a html code for the description
likt this?
is member defaulting to the client user
well the error occured when im pinging someone
a real human
or member
not a bot
so it falls under the message.mentions.members.first() i think
Hmm, could you try logging member to see what you get.
okayy
Mr. P if you're referring to the pink/red text, you could use inline code in markdown.
how i can create a html code for the description
likt this?
https://discordapp.com/channels/264445053596991498/272764566411149314/736345893384618105
this colored descriptions
etc
Mr. P if you're referring to the pink/red text, you could use inline code in markdown.
@sudden geyser yes
can u send me a markdown table pls
@earnest phoenix link of what
hi
anyone know how i can move that logo where the arrow is?
the logo to be inline with "Square"
@digital ibex Lol
?
Yes
@digital ibex so are you trying to make something on a language that uses a canvas?
Have you tried rescaling the icon to fit into the target?
display absolute or float right?
Great!
Oh
how can i move the "Square" back to where it was?
If thisโs the code directly after the previous result, just simply undo it
this is the html: html <div class="header"> <p class="subtitle is-4">Square</p> <img class="logo" src="logo" width="70" height="50" /> </div>
wdym?
float left
Then separate both the text and logo as different classes
nice
Perfect!
thats just gonna make it mesy doe D:
HTML and CSS both need more experiment when trying to get the perfect results
quickkk question
im trying to make this bit smaller,
how can i do this?
what i done
๐ค
put a span
<p class="subtitle is-4 b-name">Square <span class="position">Community Manager</span></p>
yeah
position: {
font-size: a number smaller than the first
}
.position {
font-weight: 200;
}``` doesnt change
font weight is not the same as font size
try font-size
yeah
weight is the boldness iirc
yeah then weight should be what you want if you dont want it as bold
add it as span and make the weight 400 or smaller
only specific levels of weight are supported by browsers, for example bold is 700, normal is 400, but anything between 400 and 700 does nothing
oh you did
font-size works
but thats just smaller
but that's just size
u wanted thinner?
i want it a bit bolder than this lul
oh
any ideas?
maybe use the light version of the font or something if u want it thinner
which part bolder
get a custom font
the "communitu manger"
Tim who did you sell your soul to in order to know the most random developing questions whenever they come up in #development
kk
lol
or <b>
<strong> is html5 iirc
what's the difference between strong and b and em and i
could've sworn b is still supported
In HTML5 there is a difference between bold and strong along with a difference between italics and emphasized.
Someone: I'm a html programmer!
Me:
html is not a programming langauge
and it looks worse than expected :/ any ideas how i can move it under?
they are supported, just mean different things now
community manager inside the h1
yeah ic
it is
or just make it a block
<p class="subtitle is-4 b-name">Square <span class="position"><strong>Community Manager</strong></span></p> ?
<div class="container">
<p> Text </p>
<p> other text </p>
</div>```
so, remove the span?
u can remove the span and instead add it to the p
kk
then use flex-direction: column; and display: flex; in the container
kk
in p?
put back ur classes
<div class="header">
<p class="subtitle is-4 b-name">Square</p>
<p class="position"><strong>Community Manager</strong></p>```
yeah
.header {
flex-direction: column;
display: flex;
text-align: right;
background-color: #8db3f0;
height: 63px;
}```
yea
kk
.header {
justify-content: flex-start;
text-align: right;
background-color: #8db3f0;
height: 63px;
}```
Wy trynna do
move community manager under square
Are they in the same div?
yeah
this is the html
<div class="header">
<p class="subtitle is-4 b-name">Square</p>
<p class="position"><strong>Community Manager</strong></p>```
and flex-direction: cloumn
If they are put this in the css for the div , display: inline-flex; position: relative;
Im on phone one sec j be on pc
did u also add justify content space around
on the container?
.header {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: right;
background-color: #8db3f0;
height: 63px;
}
.b-name {
float: left;
margin-left: 6px;
margin-top: 3px;
font-weight: 600;
}
.position {
font-size: 15px;
font-weight: 200;
}```
ok im back
remove the margin-top:3px from b-name
kk
change display:flex; to display:inline-flex; on header
actually, this is too hard for me lol, its just gonna confused me.
follow @split nova
thanks for the help both of u 2 btw
i can do it for u if u send me html files ill walk u through what i did aswell
because i need to add more stuff, its just gonna confuse me
@digital ibex https://css-tricks.com/snippets/css/a-guide-to-flexbox/
thanks :D, its fine tho
ah ok np then ๐
thank
@digital ibex if u ever need anymore help with css and flexbox this is a really good game to help
that game confuses the shit out of me
lmao
Is there a way to create a category and a channel
And put the channel in that category with one command?
yes?
How
create the category, then create the channel inside the category
I did like that
It didnt detect the id of the category
I need to run the command again
creating a category is typically async.
meaning you have to await it finishing
how od i get rid of this (node:50) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMembersChunk listeners added. Use emitter.setMaxListeners() to increase limit
So is this for VCs?
"11 guildMembersChunk" tf
you only need one
not 11 ffs
you've been twice already
me and some other person
then guildCreate
same logic
cool
๐
wait wtf when did they change fields to make it look decent
can you use discord.js to get the message using a message link?
yes
how? lol
To my knowledge the message URL is like https://discord.com/channels/guild-id/channel-id/message-id
yeah
So you'd just need to get the last part (message-id), which is the message ID.
You can then fetch the message by its ID, but I think you'll also need the channel-id to specify which channel
I think they want to get a message by the url
ah
mhm
Hello!
Is there a way to delete all the channels from a category with a command?
I'm developing my bot in Discord.js ^^
Example of the command: !deletechannels <CategoryID>
What discord.js are you on v12 or v11.5
Yes, but imo that can get spammy if you have a lot of channels. You'd need to use <CategoryChannel>.children to get a collection of text & voice channels under the category to delete, and use a loop to call .delete on it.
What discord.js are you on v12 or v11.5
v12 hehe ^^
No advice from me then ah
You need to send an API request for each channel you want to delete, so if there are a lot of channels under the category (for example, 12), you may hit a rate limit.
huh?
so how come for my visual studio code mongo connection, it works, but then for my vps it errors this (node:36) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connection <monitor> to the_ip closed
I do I get a lobby bot
....
Can somebody answer meh question ๐๐
HOW DO YOU ADD BOTS INTO YOUR SERVER WHEN YOUR ON AN ANDROID PHONE
;-;
I NoObIe In DiScOrD KiNdA Lmaooo
yike
so my bot wont track my id as my id and says its wrong im using discord.py any help
try ctx.message.author.id
mk
you're comparing the id to the object (i think it's called the same in python)
didnt work
show code
isn't it ctx.author.id? @iron breach
i mean you would think if its from a message it would be message.author
@iron breach assuming from my knowledge on nodejs (ik itโs python) it seems that ctx.send = message.channel.send for me so wouldnโt ctx.message.author = message.channel.message.author ?
which obviously wouldnโt work
"message.channel.message.author" 
read the whole thing
yeah
Jesus
what
lmao
your fever got worse
message.channel.message.author
what is wrong with your brain
what is not clicking
thats worse then a syntax error
that's not what they mean
IM EXPLANING SOMETHING NOT GIVING AN ANSWER
exactly
Hear me out here so if ctx.send is message.channel.send to me
using logic
ctx.message.author would = message.channel.message.author
Right?
changing it to ctx.author.id didnt make a difference
so it is supposed to send to a specified guild and channel
but it just dies
const Discord = require('discord.js')
const client = new Discord.Client();
exports.info = {
aliases: []
}
exports.run = (client, message, args, tools) => {
let botmessage = args.join(" ")
client.guilds.channels.cache.get('736417648560046201').send(botmessage);
}```
code^
its based on grabbing the server id
not server id
channel
so for me I would just be able to put message.author.id and it would do the same as what ever youโre trying to do
i dont want it to send to me
that was first i tryed that had error cods
weโre they different to what you have now?
@earnest phoenix why client.guilds.channels you can literally use client.channels.cache.get
tf
i dont have error code now it just wont match my id and my id that i put
Whatโs wrong with your code
im pretty sure === is the same as python ==
@earnest phoenix
idk but in js Iโm pretty sure (donโt quote me on it) == is the same as or similar and === is the same as
== is the same as js ===
in js
ok so in my school school I made a login script sort of thing and yet theyโre still giving me worksheets for printing shit
I fucking know how to print stuff to the console
holy crap
xD
i know more python than java but im trying to learn java
Iโm self teaching myself javascript and learning python in school, I say self teaching but I learn stuff when I fix my code I donโt actually do online courses
I do know how to code in js but I still have to look up some answers to stuff
im more self taught than i learned in school so learning java will be easyer
to self teach
I also know some php
Enough to be able to make a dashboard
Very unoptimised dashboard
Itโs a mess
i knew alittle bit of HTML but forgot it
The only thing thatโs optimised for fast operation is my nodejs bot
Which is
Really ducking fast
btw
when you execute a command it sends a message, pings the database then deletes the message, I kid you not sometimes it deletes it so fast the chat doesnโt update in time and itโs there for less then a second
and then you see the command output
is there any native function in js for extracting the coefficient and exponent from a number given in scientific notation
like convert 1.2e+21 to {coeff: 1.2, exp: 21}
really?
@sonic lodge actually this one might be more related https://stackoverflow.com/questions/4170633/opposite-of-number-toexponential-in-js
that isn't exactly what i'm looking for
i want to get the coefficient and exponent from the number represented in scientific notation
sorry but I actually do not know what those are you might be able to ask in a javascript server or ask on stackoverflow
ยฏ_(ใ)_/ยฏ

anyone discord commando expert here?? plz
You should call him see if he answers
.
kek
official server, invite code??
HE'S AN ALIEN
@rocky hearth https://discord.gg/bRCvFy9
I ducking saw that
ghost pinger
why
@earnest phoenix
@pale vessel i figured out the issue after a hr
anyone know why im getting this
(node:36) UnhandledPromiseRejectionWarning: MongoServerSelectionError: connection timed out
OOF
When i see the name tag on my phone it says welcome @invaliduser and on pc it shows the person's name
that is just discord
Oh
The max message option on my Discord.MessageCollector isn't working. What would be the appropriate way to make sure it closes out cleanly?
!start
rip
lets not
Okay I'm back and my server is back online
depends on what webserver you use i guess
create a file called 404.html
could also be markdown, your preference
should go in the root
can you give me the site url?
I know this is probbably something dumb but I wanna finish before I fall asleep and my brain is turning to mush
setInterval(function (){
let now = Date.now()
for (let i in bot.mutes){
let guild = bot.guilds.cache.get(bot.mutes[i].guild);
let member = guild.members.cache.get(i)
if(bot.mutes[i].end <= now){
console.log("RemovingRole")
let mutedRole = guild.roles.cache.find(role => role.name === "Muted")
console.log(mutedRole)
member.roles.remove(mutedRole)
}
}
}, 5000)
Why wouldnt that remove the role
it's probably for jekyll, i'm not sure
yeh
Theres only one muted role and the console.log shows that its retrieving the role correctly
Why I m getting <property> of null inside constructor
Like
class X {
constructor() {
};
get task () {
this.live();
};
live() {
console.log("hii")
};
};
When I call (new X()).task
It throws cannot read property live of null.
why would member.roles.remove(role) not remove the role and not error
add .catch(console.error) after member.roles.remove(role)
Doesnt say anything
member.removeRole?
It's member.roles.remove or .cache.remove I'm not sure
roles#remove
Ah alright
Thats what I was using tho
It's GuildMemberRoleManager#remove()
yea but GuildMemberRoleManager is called through roles
Yeah
Then we are back to the question of why
setInterval(function (){
let now = Date.now()
for (let i in bot.mutes){
let guild = bot.guilds.cache.get(bot.mutes[i].guild);
let member = guild.members.cache.get(i)
if(bot.mutes[i].end <= now){
console.log("RemovingRole")
let mutedRole = guild.roles.cache.find(role => role.name === "Muted")
console.log(mutedRole)
member.roles.remove(mutedRole)
}
}
}, 5000)
wouldn't remove the role
are you sure mutedRole exists before removing it from the member
Yes thats why I console.log()'ed it
@slate wave if you do in it gives you the number in the array or the name in the object so you need to do bot.mutes[i].member I think
Well bot.mutes is
{"444644760322572297":{"current":1595553014281,"end":1595553014281,"guild":"643323696693510154"}}
so bot.mutes[i].member would return undefined
Welp I just stumped all of us
don't
Wut
Lets say i mute someone for 2m the command will set unmute for 2m using setTimeout. but i unmute using unmute command and mute them for 5m. The 2m timeout will still be running. and it will unmute the user after 2min
how should i resolve this issue?
Cancel the old timeout after unmute
What language
js
Or you could just use a database and check if the person needs to be unmuted every 5s with setInterval
And then the unmute command will remove the person from the database
You do var timeout = your timeout, then when someone unmutes you do clearTimeout(timeout)
there must be a better way
Well if you restart your bot then all ur mutes are kaput
Hmm after 2 mins u will run the unmute command right.. Just check at the start of unmute command if the person is muted or not
for that i have reinit
You do var timeout = your timeout, then when someone unmutes you do clearTimeout(timeout)
^
Lol guess my problems never getting fixed, although at this point I don't think there is a fix
It is probably better to do something like client.mutes[guilddid + userid] and store the timeout there
hmm
Lets say i mute someone for 2m the command will set unmute for 2m using setTimeout. but i unmute using unmute command and mute them for 5m. The 2m timeout will still be running. and it will unmute the user after 2min
@vague imp I mean how is this a problem.. If unmute command at the end of 2 mins checks that user is muted or not ur issue is solved
ItS a WaStE oF rEsOuRcEs
hmm i can do it but the user will be muted for 5min
so the user will be muted
and it will unmute it in 2min
Huh
Or set a cooldown
@fresh hatch you called?
So if I had a server on port 6969 could I use it as a public ejs server?
If so then how?
How do you make the vote bot reward
bot.on("guildMemberAdd", function(member) {
member.guild.fetchInvites().then(guildInvites => {
const ei = invites[member.guild.id];
invites[member.guild.id] = guildInvites;
const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
const inviter = bot.users.get(invite.inviter.id);
})
})``` Returns me that uses is undefines... why ?
consider not using JSON as your database
Mmh
Do you guys now hoe to make it so that if you vote for the bot you will get a reward
Ok
https://top.gg/api/docs and #topgg-api
@restive furnace ...
i already told you...
JSON dbs will corrupt
Yes probably
Epic cool good good
addModeration: function(guildID,userID,type,time){
var mod;
moderations.findOne({
guild:guildID
},(err,result)=>{
if(err) throw err;
result.moderations.push({
user:userID,
modtype:type,
time:time
})
result.save((err,result)=>{
if(err) throw err;
return(result);
})
})
},```
result return undefined

i tried different method
but so far nothing
console.log gives value
but return don't
it's mongoose
i cannot remember bot name tho




Don't quit, begginers can't continue without you


