#development
1 messages Β· Page 884 of 1
ok
and then show the output
also, what is bot, it looks like the property guilds doesn't exist in bot
wdym
I told you to run the code and see what you get
did you do that @jovial nexus
there's a null value somewhere in your code which is getting passed to a function that converts it into an int
also
use connection.playStream()
does that work in v12?
...
bot is client
Returns undefined
are you creating a new instance for that command?
show me where you defined bot
huh
lemme see something
const bot = new Discord.Client();
now it dont even log the console.log(args)
put it back to play
lemme see what happened to playStream
ok it was removed
@heavy anchor hmm
show your command file
I think I know what's happening
show the entire thing
what are you even trying to do
omg
that's the issue
that's not how exporting and importing works
show your bot.js file
@copper cradle Are you sure that playStream works in v12?
@heavy anchor this is your problem
for exporting something you gotta use the exports object, so at the bottom of your bot.js file put the following exports.bot = bot;
THEN you can use bot in your other file, but import it like this
const { bot } = require('../bot.js');
don't use == always ALWAYS use ===
@copper cradle why?
add this flag to the node command you're running --trace-uncaught
== is used for comparison between two variables irrespective of the datatype of variable. === is used for comparision between two variables but this will check strict type, which means it will check datatype and compare two values
@earnest phoenix you should know this c'mon
So basically not always, use === where you want it to match the same type
Which will mostly be the case
yeah but I doubt anyone here will ever need that
doing this is ok 1 == '1';
but this isn't 1 === '1';
I am having some trouble with discord OAuth, is there anyone that could help me?
I have implemented OAuth login for a web interface with discord a couple of times before, so I know how it's done, but I am stuck on a weird problem.
My setup as it is now works perfectly fine for the first user, however whenever a second user authorizes the OAuth request and I make a request to /users/@me with the access token of the second user the discord API returns the details of the first user.
I think this has something to do with caching on either my end, or discord's end. Has anyone ever had this problem before, or knows a potential cause?
@heavy anchor did you do it?
where do you store the access or refresh token?
?
to Stan
trying it
ah
TypeError: Cannot read property 'guilds' of undefined
@tulip bobcat I don't store it, I am just using the OAuth for a login system to a web interface. So the flow of my login process is:
1. direct user to discord OAuth page, with only the 'identify' scope
2. redirect from discord comes in with the 'code' parameter
3. I make a request to /api/oauth2/token with the given 'code' value
4. I retrieve the access_token and make a request to /users/@me with the access token
5. I get the discord ID that's associated with the account and check it for values within my database to search a user to log in```
So this works fine for the first user.
But then the second user get's logged in as the first user because the /users/@me request returns the information for the first user.
3 and 4 are made from the browser right?
No, from my server backend
@copper cradle can we talk in md? about my error
because here is a conversation
it doesn't matter
okok
bot.js: https://pastebin.com/PVxbUmQn
bugreport.js: https://pastebin.com/hQj5MZxd
I'm guessing it's a bug in your code then, @green marsh the chance of discord breaking is super low
i changued it to args[1] and now it donest have any error, and it console.log the link, but it doesnt sound anything
I said
I doubt that discord is broken aswell, however it also has not much to do with my code, if I make the same request from Postman or something similar it also happens.
It returns the wrong user for the access token.
It has to be something with caching probably.
yes
what do they mean then
how do you store the users tokens then? I'm assuming in some sort of object right? @green marsh
if you know then you wouldn't even consider changing args[0] to args[1]
this is the error with args[0] @copper cradle
@tulip bobcat
I literally just take it immediately of the response from the /oauth2/token request
I found a stackoverflow question with the same problem, but it does not have an answer https://stackoverflow.com/questions/45699310/discord-api-users-me-always-returns-same-user-object-even-when-logged-into-anot
@jovial nexus did you do what I told you
show the entire error log
pls
it isn't that hard
thats the entire error log
let's do something
clear the console
run the bot and make the error happen
then copy everything
okok
that's not the entire error
I want to do 2 shard on my discord bot, but how can I get the total number of servers in my bot?
(d.js)
and run the bot like this node --trace-uncaught <the file>
what language is that btw? @green marsh
PHP
I still get the same error:
TypeError: Cannot read property 'guilds' of undefined
The entire console @copper cradle
I think this is the problem
comment out that line and run the thing
why are you even doing 5 / 5???
volume command?
idk why they're doing that
why are they doing 5/5 if that'll always be 0
just remove the line
and see what happens
yh there would be no point if it's 5/5
no ti wasnt
i made it
did you change your os at some point in development?
nope
wait ill do it
@green marsh yea idk php, and after looking around I can't find much odd (except you are using $response and $res)
hm sure
there's a problem with opusscript
Isn't 5 / 5 equal to 1
it says me Welcome to Node.js v12.16.1. Type ".help" for more information.
Okay, so all I am doing right now is taking the code paramater from the request and making the request to /oauth2/token with that
that
And look what I get
how
node --trace-uncaught
yes
u sure?
yup
u shouldve censored more
show your console
Nah I don't really care, the only scope it has is 'identify' haha
lol
You can get just as much information from that token as you can from being in this server with me
yeah
@tulip bobcat
hm that's very odd, it shouldn't cache on your server either
ok Ender let's take this to dms
what you could try, cuz i can't help much more, is go to the discord-api server
and to their #topgg-api channel (not here)
okok
Thanks, I'll try
do u have the invite
@copper cradle when your done helping him i am still having that issue...
lemme see
show your code
then instead of exports.bot = bot; do module.exports.bot = bot;
tht shouldn't make a diff
but may help
or even better
just do exports = bot
and then in your command just do const bot = require('../bot.js')
or even better
pass bot as an argument to your command
so you don't have to be exporting crap
dude
did you move exports to the very bottom of the file
@heavy anchor
yes
show
Can some one help me with this. I am trying to get information from one of my files and send them like b!play <Number> and it plays it
https://pastebin.com/ZQj8xz7N - discord.js v12.2.0
pass bot as an argument to your command
I don't know how to do that...
.addField(`**Verification Level**`, `${verificationLevels[msg.guild.verificationLevel]}`)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions read that @heavy anchor
this doesn't work for some reason
undefined
well then guild has no property called verificationLevel
hmmmm
now I get TypeError: Cannot read property 'send' of undefined
kk
yep i have verificationLevel
"None",
"Low",
"Medium",
"(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»",
"β»ββ» οΎγ½(ΰ² ηΰ² )γ彑β»ββ»"
];```
u should get an msg for discord
I didn't
It should be in https://discordapp.com/developers/applications/
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
where?
atom dragon what are you trying to do
it doesnt
const Discord = require("discord.js");
bot = require('../bot.js')
const {
PREFIX
} = require('../config.json');
module.exports = {
name: 'bugreport',
aliases: ['bugr', 'br'],
description: `Users can report bugs useing this command. \`\`${PREFIX}bugreport [A detailed description of the bug you're experiencing and what causes it]\`\``,
execute(msg, args, bot) {
const userAvatar = (msg.author.displayAvatarURL({
dynamic: true,
format: "png"
}));
let argsresult;
if (!args[0]) {
return msg.channel.send(`You did not describe the bug.`)
}
argsresult = args.join(" ");
var myGuild = bot.guilds.cache.find(g => g.id === '694557723978891344');
var logChannel = myGuild.channels.cache.find(c => c.id === '701924697289523291')
const bugReport = new Discord.MessageEmbed()
.setTitle("Bug report")
.setDescription(`<@${msg.author.id}> reported\n${argsresult}`)
.setColor('#FF0000')
.setTimestamp()
.setFooter(msg.author.username, userAvatar)
logChannel.send(bugReport);
},
};```
@royal portal it will take a while if u just reached 75
Then you might not be eligible yet
oh
@copper cradle well get the server verification level
because I just did
so yeah
@earnest phoenix I guess you're right
I just reached 75
but what if the bot is in some of the servers you own?
@heavy anchor remove bot from the top of the file too
does it count?
yep
like if you own 2 servers will it count
yes
atom dragon
yah
or do servers you own and your bot is in dont count?
<Message>#<Guild>#verificationLevel returns a string
not a number
omg
Yes I did, I get the same error
that's verif lvl

why did you define your own tho
well the way you're doing it won't work
you can just modify that in the library tho
discord.js/src/structures/Guild.js Line: 259
thx
you should know
no
Only if you need them
I tried that before I came here for help and I get error TypeError: Cannot read property 'send' of undefined
ahhhh mine is like this this.verificationLevel = VerificationLevels[data.verification_level]; no wonder its not working
Too long to send here
k
well that was line 259
ahhh
src/util/Constants line 449
498 in js 12
I got the line from their github repo
I got a quick Question.
Why does he keep saying, that First() is not defined here?
let userToModify = message.mentions.members.first();
I looked at the discordjs-bot guide from GitHub and he says this should get me the member.
fetchMessage returns a promise of a message
You resolve the promise and edit it like editing any other message by calling <message>.edit("content")
@surreal wind what do you mean it's saying it's not defined? Can you show the actual error message and/or your code?
How do i mark it as code?
!edit <messageid> <new message>
like send the code here?
yeah+
either markdown embed code or upload it to a site like hastebin.
```language
<code here>```
just the part that's failing
message.member.send('Thank you for signing up for the event - good luck to you..');
// let role = message.members.roles.find("700849600973766667");
//guild.member.addRole("700849600973766667");
let userToModify = message.mentions.members.first();
let roleToAdd = message.mentions.roles.first();
//message.member.addRole(roleRoAdd);
console.log(message.member.addRole());```
and the error is this
let userToModify = message.mentions.member.first().displayName;
^
TypeError: Cannot read property 'first' of undefined
I think someone said this last time to you: member is not a property of MessageMentions.
If you want the member, use members instead.
@surreal wind discord.js?
are you using v12
Yeah 12.02 or something let me check
alright
"discord.js": "^12.2.0" this one
try message.members.cache.roles.find
Ty
and message.mentions.cache.roles.first
I guess thats the problem
because in v12 or higher its cache
With or without the (), So the guide i use are on versiosn 10 and 11 and htose are some changes inv 12?
Ahh
did it work?
@royal portal Sadly not says cache is undefined now
let userToModify = message.members.cache.roles.find()
try it without cache
well it's not message.members
has anyone got an open github repo of sharding with discord.py?
You put cache after roles
message.member.roles.cache
oh yeah
That only changed it to roles now being undefined
is it that hard to look up the docs and follow the flow of the properties
yes very hard
im also still waiting for discord to send me a system message
for verification
im at 75 servers
its been like an hour
Okay now i get something complete different, at a line, i don't even reached yet Oo
π #memes-and-media
@split hazel wait am i not allowed to talk about verification
because I need help with it
This isn't the channel really #memes-and-media or #general
so i get this error now:
D:\Discord Bot\DiscordBot\Lumi\node_modules@discordjs\collection\dist\index.js:160
if (fn(val, key, this))
^
TypeError: fn is not a function
But i don't have a line 160 or does the 160 not mean the coding line?
update your node version to v12
160 does mean line 160 but in a different file, look at the path
Hi, I'm having some trouble with checking for the number of players with a role
return (message.guild.roles.find(r => r.id === shootRole).members.length > 0);```
I want this to return true if at least one player has the role that has id shootRole
This is so hard man
@vernal basin collections do not have a length property
update your node version to v12
@mossy vine updated it to latest version, still got the same error
However they do have size
ah it's size okay
@surreal wind you most likely provided something invalid in some .find could we see some code?
yeah i couldn't find it in the docs anywhere 
@vernal basin and do note it will only show the cached members
?
like
If the server is big enough, not all members will be cached and counted
@surreal wind you most likely provided something invalid in some
.findcould we see some code?
@split hazel sure,
message.member.send('Thank you for signing up for the event - good luck.');
// let role = message.members.roles.find("700849600973766667");
//guild.member.addRole("700849600973766667");
let userToModify = message.member.roles.cache.find();
let roleToAdd = message.mentions.cache.roles.first();
//message.member.addRole(roleRoAdd);
console.log(message.member.addRole());
}```
let prefix = "ushsjsj"
message.channel.send(prefix.length)
You'd need to fetch all members beforehand
ok
it's the size of a single object
.get
And what's the point of userToModify
Unless you're planning to use it for something else later
I'm going by a guide how to find the member, I'm totally new to this so I'm using the Guide i got recommended here, that's what they say i should do
All i want to do, is to give the Member who send this !player a specific role within the server
and usertomodify is finding roles not user
@surreal wind ok so
1st tell me what did u understand from the guide
it's ok if it's only a little
i have the milliseconds elapsed since January 1970
how do i convert that back to a date?
essentially the reverse of new Date() (in node js)
hmm I am not a very "pro" in node.js but ig math flooring the same number again and again
Well i understood the whole concept of how to send out the messages and what the change between, as example, Channel or member means. But apparently the code example there is made for an older version so i didn't know about the cache in there. As for my original Problem, I don't get, why a message.members.addRole(RoleId) wont work.
You have to fetch the role first
why fetch role?
would that be the name, as example?
and who said that?
You can get a role object in your case by message.guild.roles.get(ID)
I tested it myself
@surreal wind it should work, can I see ur whole code?
and maybe specify ur discord.js version
My apologies, I was testing on master
its ok
On master you need to provide a role object, on v11 you may provide either
never tried so I will not disagree
@surreal wind it should work, can I see ur whole code?
@finite bough Sure, but a lot what i tried i just commented it out for now in case one of them worked so i didn't have to rewrite.
message.member.send('Thank you for signing up for the event - good luck.');
// let role = message.members.roles.find("700849600973766667");
//guild.member.addRole("700849600973766667");
//let userToModify = message.member.roles.cache.get();
//let roleToAdd = message.mentions.roles.cache.first();
message.member.addRole('700849600973766667');
console.log(message.member.addRole());
}```
So that's the part i want to add, but i get the message
message.member.addRole('700849600973766667');
^
TypeError: message.member.addRole is not a function
as for my ``` "discord.js": "^12.2.0"```
okay but even then he keeps saying role is undefined.
that's what i don't understand. i give him the ID but it keeps saying its undefined
"discord.js": "^12.2.0"
and i changed it to add.role(roleId)
But tells me role is undefined
yea
scroll up and check what speedg said earlier
You can get a role object in your case by
message.guild.roles.get(ID)
tho
as its 12.2
guild.roles.cache.get(...)
Oh but i remember now, within the Message I'm in i cant use guild so can i got with members instead?
member.guild
well message contains guild object
as u said u want to give someone who says !text
so message.member
agreed with speedy
Ah okay, sorry earlier today someone said guild isn't part of it
Okay one step further. The get works now, as it seems. now the message.member.add.role() doesn't work. he keeps saying its undefined
roles.add()
roles.add()
@summer torrent OH My God Thank you all
It works xD finally. Thank you all now ill look deeper into it how and why xD
I rlly need to get a look on 12v docs ngl
Still thank you all @split hazel @finite bough and @summer torrent ^^
np
anyone good with PayPal/Stripe subscriptions and assigning Discord roles?
I mean anyone can be good if you can read the docs and able to make an api request
But I have dealt with paypal requests before
true haha, Just not really my area of expertise. I was hoping to post in #434058442764714002 but can't seem to get anyone to message me back about it π¦
I'll forward it on for you
that'd be quite awesome, thank you. I assume it'll be a quick little project if someone's familiar with PayPal or Stripe's API
You can DM Tonkku about it (as Oliy's DMs are disabled as far as I know)
@earnest phoenix if you have something you'd like to post in verified jobs you'll have to contact Oliy directly with a request
If not then poke Tonkku
Yes
@spare goblet I contacted Tonkku directly, never heard back, and Oliy doesn't accept messages from people who aren't his friend on Discord π¦
@earnest phoenix what did you send to Tonkku? :,)
Try not to ask to ask or something, just get right to the point that you'd like to post in verified jobs
And you'll most likely get a response
this lol π€·
hi is it possible to tell what text channels a user can or can't see based on their permissions?
@earnest phoenix you'll have to poke again, if he still forgets to respond let me know in Dms
kk, thank you π
@sonic lodge yes you can, what language
discordjs
Check all the cached channels in the guild and check the member permissions of a channel
And filter it
uhm would you mind giving me a start
say the role "jeb" gives the user access to a channel called "jeb-only"
owo would this work
bot.guilds.cache.forEach(function(guild) {
if (guild.members.includes(user) { // user is of type GuildMember
// they see it yey
}
});```
u can do it manually also
this has been going for a while, but no idea of someone ever told about. When in dark theme, the vote is still white
you should get experienced with web developing first
make button make request
check out this really useful roadmap https://github.com/kamranahmedse/developer-roadmap
jesus that diagram
nodejs is somehow not a part of it https://img.thaun.dev/cyx28.png
cuz node aint strictly related to web??
unless its not a webserver
express.js?
sure lets just express, fastify, flask, django, every shitty framework there
thats a web framework
just say what u want
webservers are often used in combination with web frameworks to accomplish load balancing and reverse proxying
they're often the ones actually carrying the SSL certs too
what are those gray/red checkmarks on nginx?
purple
i have f.lux on, i cant see colors
what color is this? π£ ?
dude its gray
its gay
anyways, i can see the colors if i disable f.lux
otherwise im functionally colorblind
it's purple
from top to bottom it's:
- Purple with white checkmark
- Green with white checkmark
- Gray with white checkmark
- Gray
π΅ this is purple
no, this is blue π’
What is the possible reason that a bot could go offline without an error? Iβm using discord.js
hi
Hello does anyone know how to DM a person with a bot when a person says+help ???
What library?
discord.js
https://anidiots.guide/first-bot/your-first-bot
I suggest following this.
this thaun dude sayin' node.js is a web server
umm sorry?
oh
Does anyone know if it possible to make a GUI with python or java?
There's also AWT, but it's a bit more confuse than swing
With py idk
Probably there's some lib
Well, kinda
Awt/swing works by creating windows
So it'd be like making UI with delphi for example
I'd recommend IDEs with a gui builder for that, like intellij/netbeans
Im not a python dev, so i cant speak for the quality of these libraries, but the ones i always see from my python dev friends are kivy and tkinter
I've built a ui with pyqt5 before, it's always an option
I can't see anywhere on the discord.py docs how to get specific shard info?
Like the guilds in shard 2 out of the rest
is it not something like?
self.bot.Shard_id[2].guilds
This is discord.py btw ^ If hopefully someone knows the answer.
although for commercial use QT costs loads of money to license
which is unfortunate
very much so, it's amazing to work with
especially since there's the qt designer
makes designing windows a breeze
yeah qt itself is great, but as all great things fall, the licensing thing sucks
-donatebot @earnest phoenix
@earnest phoenix
This is not the support server for Donate Bot. If you require assistance with Donate Bot, click here to join their support server.
next time ask in #memes-and-media or #general
How did this person make the widgets red and get an animated profile picture? https://top.gg/bot/681376963356524558
CSS
HTML/CSS/Markdown are supported in the long description to play around with your bot page
Oh, alright, thanks! :0
But the widgets are red?
i want edit a message of my bot, but this dont work.
if(command === "probando"){
message.channel.send("1, 2, 3 probando");
let canal = client.channels.get("645463565813284868");
canal.fetchMessage(args[0]).then(msg => {
canal.edit(args.slice(0).join(" "))
});
}
How do I say when this user gets offline send a webhook or to a channel a message
You're trying to edit the channel instead of the message?
You're trying to edit the channel instead of the message?
@sudden geyser me?
i'm trying edit a message of the bot
yeah well how are you sure the bot was the one who sent that message? also cancel is a guild channel.
so?
Is this a proper way to await for 2 reactions but only pass 1 of the 2 ?
const filter = (reaction, user) => {
return reaction.emoji.id == "701801368490475521" && user.id !== client.user.id || reaction.emoji.id == "701801396181139527" && user.id !== client.user.id;
}
m.createReactionCollector(filter, {
time: 5 * 60 * 1000,
max: 1,
maxUsers: 1
})
.on("collect", r => {
console.log(r)
})
also identation pls
wdym so?
youre trying to edit the message?
and youre calling edit on the channel?
you fetchd the message yet you're not even doing anything with it
@earnest phoenix
replace canal.edit with msg.edit
thx @queen violet @valid holly
np
@queen violet i can remove the channel id?
wow dep knows js /s
wdym
what is wdym?
What do you mean
Hi
how to add the custom background in my bot page
Css injection
In long description
@knotty steeple so wanna help me
will tryβ’οΈ
why does this happen when i try call a method in my class
if i console log channel/guild in the constructor, it's fine
but when i do this in the constructor
this.guild = oguild;
this.channel = ochannel;
doesnt save?

it
really doesnt
maybe for some dum reason u have to exclusively define it on this
idk my brain doesnt work either 
oh what is it
smfh
With software?
Or just record output sound with some software like obs
@sick cloud log this.guild after you assign it
hello
i already fixed it
say if i want to store objects like this, ```js
{
required: 3,
requiredremove: 2,
blacklisted: ["171823917291871929", "89191029380108273819", "..."],
whitelisted: ["829199192837371819", "99281928101818372891", "..."],
roles: [
{id: "19292891901038191", stars: 25},
[Object],
//...
],
filterbots: false,
starself: false,
prefix: "star ",
linked: false,
clean: false,
downvote: false,
botsonlb: false,
imagesonly: false,
visible: true,
emoji: "β",
stars: {
first: "β",
second: "π",
third: "π«",
fourth: "β¨"
},
lbdata: {
//...
"738817387173727738": {
stars: 237,
downvotes: 7,
global: 21,
starboarded: 79
},
"828271873871738830": [Object],
"372636191038371910": [Object],
//...
}
}
...for every guild, what database would best suit or would it even matter?
consider replacing those booleans with enum flags
that way you can flatten every single bool property into one
Does anyone know how I can take an array like this
{ dummy: 'yes', '177188299943837696': 'yes' }```
And do something like,
```js
array.forEach(u => {
msg.channel.send('hi')
})
in js?
So could I do
Object.keys(u => {
msg.channel.send(`${obj} - hi`)
})```
Or is it a different setup?
I also pull the 'array' with client.userss.get('1')
yup
oh okay that would make more sense seeing as they can pnly be true or false
lets say i do do that, then what would be the answer to my initial question?
if(message.content.startsWith(PREFIX + 'red')){
var role= member.guild.roles.cache.find(role => role.name === "role name");
member.roles.add(role).then(message.channel.send("Role was added"))
}``` why doesnt this add the role?
@queen needle discord.js version?
11.5.1
message.member.addRole
u dont use managers (.cache stuff) in v11
oh okay
remove .cache from your var. Then, insert a real role name in "role name"
if(message.content.startsWith(PREFIX + 'red')){
var role= member.guild.roles.find(role => role.name === "role name");
if(!role) return message.reply("Role does not exist")
member.roles.add(role).then(message.channel.send("Role was added"))
}
so that
better be safe than sorry π€·ββοΈ
still doesnt work
@queen needle show us the error
ok is there an actual reason why this error occurrs? ```js
Error: Client network socket disconnected before secure TLS connection was established
ok is there an actual reason why this error occurrs?
Error: Client network socket disconnected before secure TLS connection was established
@grizzled raven Possibly because an error occured before the client was ready?
bruh
@grizzled raven that's discord api fluctuation
well i know its not any of those
find is not a function
Happens sometimes
@vestal crystal find is not a function
Just ignore it, it's just you bot losing connection to discord then reconnecting again
how?
Here, a sec
Search "discord bots list api"
lol
anyone know why it says find is not a function
Because it's not
true
@queen needle try message.guild.roles.find()
const DBL = require('dblapi.js');
const dbl = new DBL("<dbltoken>", { webhookPort: 5000, webhookAuth: '<password>' });
try {
setInterval(() => {
dbl.postStats(client.guilds.cache.size);
}, 900000); //I recommend once per 30 mins
} catch (error) {
console.log(error.stack) //check this if error
}
replace the dlbtoken and password with the actual token and password
ohh thank you
You can check in the edit page
oh wow
thats what im using
Do it on your client's on ready
password?
But you need to do npm i -s dblapi.js first
password?
@earnest phoenix Set it in the DBL Bot's edit page
You can check
use the webhook feature
http://www.top.gg/bot/<your bot's id>/edit
yeap
At the very bottom of it
password where?
At the very bottom of it, read the webhooks section
the authorization, fill it with some random numbers and texts, then paste is as <password>
The URL, just put your bot's IP adress
My bot ip adress?
yes
The authorization field is quite important tho
Yup^^
But if you want it easy, just fill in a random string
Like, sdbgaoiw984tvnw984ytq98w4tvwtmg or something
Just make sure to never leak it
@earnest phoenix you'll need a webhook server
If you're not sure what's your url then you most likely don't have one
In my place, my IP adress is this external one.
Google vm, stinky
lmao
I dropped my first project already because some random eval error
Google vm, stinky
@lyric mountain It's $24 a month lol 3.75 RAM and 10GB storage
But I got the $300 free tier
And I'm using my parent's CC,5 of them
Lmao, bannable
is it possible to give a role a permision that displays it differently from users or no
How do I make sure that my bot can be online 24/7 without downtimes that doesn't even have errors?
My bot just sometimes goes offline and there's no errors
what are you using
no errors sounds unlikely if you're running it on a machine that's running 24/7
being ratelimited in d.js isn't fatal
those aren't fatal either (althoufhr you should have checks and try catches)
i have an error catcher for all commands
randomly
huh
sometimes its fine and is online the entire day and sometimes it goes offline like every 10 minutes
seems like it could be a certain command or event?
great now my ftp freezed
is it possible to create a role with the permison that it displays differently from users
.createRole({
name: "Special Muffin Role",
color: "#8cecd8",
permissions: ['DISPLAY_ROLE_MEMBERS_SEPARATELY_FROM_ONLINE_MEMBERS']
})```
discord.js is it possible to add that though
yes there is
just add an option hoist: true
How do I handle Discord API errors?
catch
no
There are plenty of tutorials online π
Why
Also, I issued the certificate using certonly
I tried to chmod 755 /etc/letsencrypt/live/..............ro/ but no luck
let PREFIX = "^";
client.on("message", message =>{
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0]) {
case "react":
message.channel.send("").then(message.react(args[1]));
break;
}
})```why does this react to anything that is before react ex sreact π’ works
but it should
shouldny
How to use animated pfp in dbl Website and color bg
Cinniamon try hard defining the emoji fisrt then work on getting it so it works with a user input
i got it
cool
so I have a sharex upload server hosted on glitch.com, and I need to find an algorithm who can :
-check the number of files with the same extension
-if there is more than 100, delete the oldest one
but I cant find any way of doing this. I use php
why don't you use php itself and check the files
the problematic part is about
-deleting the oldest one
-be sure that the algorithm executes once per upload
I do
use filectime() to check the date maybe
hmm
why my bot is not on the list? My friend does not see it.
its not accepted
I tied doing this, it returns 500
what have to be approved with who?
I advanced, now I'm getting "unexcepted token }" just fater the unlink function
after
i have to paste my code to the bigger description?
@main jacinth no
why not? it's like learning js
I was thinking about something else
approve my @arctic oracle please.
@main jacinth this is not the place for that kind of discussion. Also you're going to have to wait just like everyone else does. Take any other convo to #memes-and-media
what i will do when they will decline my bot?
check reason, fix it, resubmit
read docs
mute gives me this
that is not how you find roles
How can I stop running setInterval in same command ????
clearInterval()
Ok
is member.system to get the users device
there is no member.system in discord.js
ok is there an way to get it then
<User>.presence.clientStatus
kk thx
If statement not working
Tried .equals?
i made mute/ban/kick commands and only kick and ban work
@NikXSimulations#5617 switch role and find around
what's inside Heartbeat.js?
i'll give that a go and hope it works
gotta wait a fair while to test it as its the resume func
but ty
if i don't come back screaming in a couple hours, assume it worked
could also be a require loop
as gateway requires heartbeat which requires gateway which requires heartbeat...
@drowsy sentinel
i'm not really sure how to solve it then @quartz kindle tbh
@sick cloud fuck
@sick cloud are you requiring gateway in heartbeat
heartbeat has to close the gateway then rerun it to resume
um ye
it's a bad system i guess
but i don't know how else to redo it
you should initialize the gateway and pass it as an instance to everything else i guess
p much
because heartbeat needs to re run gateway with true to do the resume gateway and all
how should i do that, just a class?
yeah
alright will do
speaking of websocket, is there any benefit on running ETF encoding in node?
at /app/commands/anti/antlinks.js:81:22
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/helpers/promiseOrCallback.js:24:16
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4872:21
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/query.js:4379:11
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/kareem/2.3.1/node_modules/kareem/index.js:135:16
at processTicksAndRejections (internal/process/task_queues.js:81:9)
(node:12740) 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(). (rejection id: 1)
(node:12740) [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.```
help :\
since you'd need to convert it to json anyway
i don't use it myself
im experimenting with zlib-stream
let msg = args[1];
if (!msg) return message.channel.send("Please select a link");
let msg2 = guild.antilinks.links;
wlcm.links.push(msg);
model.updateOne(
{ guild: message.guild.id },
{ antilinks: { status: guild.antilinks.status, links: msg2 } },
(err, res) => {
if (err) console.log(err);
}
);
message.channel.send(`Successfully add ${msg} to denylinks list`);
}```
maybe i'll test ETF later
whats wlcm
(node:12936) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of null
at /app/commands/anti/antlinks.js:81:33
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/helpers/promiseOrCallback.js:24:16
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4872:21
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/query.js:4379:11
at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/kareem/2.3.1/node_modules/kareem/index.js:135:16
at processTicksAndRejections (internal/process/task_queues.js:81:9)
(node:12936) 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(). (rejection id: 1)
(node:12936) [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.```
@torpid juniper @quartz kindle
i delete the wlcm
now guild.antilinks.links.push(msg);
and use css to style
how ?
oke thanks
@earnest phoenix it just puts your bot's avatar in the dbl website and it only shows the first frame of the gif avatar if it's avatar is a gif
can bots even have animated avatars?
Hmm can't they?
dont think so
(I remember seeing a bot with an animated avatar idk)
If statement not working
if (args[0] == "stop") {
clearInterval(m);
return message.channel.send("interval stop");
}
m = setInterval(async () => {
let embed = new discord.MessageEmbed()
.setColor("RANDOM")
.setAuthor(
"Coronavirus Global Stats",
"https://media.giphy.com/media/UUsOy6IWmzw6mmeOpQ/giphy.gif"
)
.setDescription(
"Latest info about the novel coronavirus\nUse cov!regioninfo to get more specific information."
)
.addField("π Total Infected", `β \`${data.confirmed.value}\``)
.addField("π Total Recovered", `β \`${data.recovered.value}\``)
.addField("π Total Dead", `β \`${data.deaths.value}\``)
.setFooter("[!] Data might be from yesterday");
message.channel.send(embed);
}, 5000);```
you need to define m outside of your function
else you will just create a new m and a new iterval everytime the command is run
the interval has to be stored somewhere outside, that you can access from other instances of the command




