#development
1 messages · Page 1548 of 1
One message removed from a suspended account.
Well, what does it look like?
on a dedicated pc or just your main?
One message removed from a suspended account.
pog
???
One message removed from a suspended account.
_ _
pog
One message removed from a suspended account.
nothing
One message removed from a suspended account.
One message removed from a suspended account.
it doesn't make sense for me as I need to turn off my pc

One message removed from a suspended account.
good reason
is it ever gonna explode
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
.......
linux doesn't shutdown for updates lul
One message removed from a suspended account.
LOL

can someone help me out??
One message removed from a suspended account.
ik ik
it is getting the thank data
Yes and what does it look like?
I was about to ask you to log it but you already did
const mongoose = require('mongoose')
const reqString = {
type: String,
required: true,
}
const thanksSchema = mongoose.Schema({
userId: reqString,
guildId: reqString,
received: {
type: Number,
default: 0,
},
lastGave: Date,
})
module.exports = mongoose.model('thank', thanksSchema);```
That's the model
it logs "[]"
yes
which is why its an empty array
so will it fix the issuse?
Yes
I'm thankful that you provided the model, even though I didn't really ask for it
k
Yeah?
https://berryspring1.glitch.me why when i click to "Айпи" it is don't redirect me to /
doesn't *
Oh lol
And this cab affect <a>?
can*
@pale vessel
I removed it
<a> still don't redirect me to /
Your a tag is not accessible
Hm
Try using <a href="url"><p>Text</p></a>
what the hell is this?
Check your code
Why do you need that?
inside <p>?
Doesn't matter
Ah I see
🤔
You have two <a> tags, one of them actually redirects you to /, but it doesn't have any text inside of it, so it's invisible. The second one has the text inside but it doesn't redirect to anything
They add the a element to the inner HTML when using up/down keys
why though
At least tried to
still don't work
interesting
🤔🤔🤔🤔
i wanna try remove onmouseover
IT'S WORKS NOW
WHY
oh lol
@pale vessel
i moved it to first <a> tag
now it's work
thanks
now i checked it, it seems fine idk what is the probelm can u tell me what is the problem
one of your embed fields doesn't have a value
there's a third value afaik
it's a boolean, for whether the field should be inline or not
embed.fields[3] is referring to the 4th embed field
do you have more fields?
joinLeaveChannel is not a function
it is a String constant
you gotta fetch the channel object
imagine if discord.js did this
we call that "cúmulo da preguiça" here
String.prototype.send = function(...args) {
if(this.match(/some snowflake regex/)) {
client.channels.cache.get(this).send(...args)
}
}

what?
array.join("\n") ?
lmao this is so useful
yo you guys are good with regex right?
gib a regex for this
message.argument = args.join(" ").replace(/\n/g, " ").replace(/⠀/g, " ").replace(/––/g, "--").replace(/–/g, "--").replace(/——/g, "--").replace(/—/g, "--").replace(/――/g, "--").replace(/―/g, "--").replace(/‒‒/g, "--").replace(/‒/g, "--");
dont ask
lmao
yesn't
no spoonfeeding !!!
im using lexure for this
lmao
https://github.com/1Computer1/lexure it is pretty useful
regex is nice and all but,
what matches regex??

X-Files theme plays in the background
hmm.. let's say I have some regex in a string, how can I match it with regex?
match regex with regex?
\/\/\/\/

big brain time
/\/.*?\// 🤔
fine, im gonna try making my own regex
\/\/\/\/\/
\/\/\/\/
\/\/\/
\/\/
\/
v
with blackjack and hookers
this works i guess
.replace(/\n|⠀/g," ").replace(/––|–|——|—|――|―|‒‒|‒/g,"--")
is | means or
regexr eh?
poggers!
yea
One message removed from a suspended account.
pm2 and dotnet 🤔
pretty sure pm2 runs anything
^
I have updated my asp.net core API over linux server using kestrel, I want to run the core application using pm2. Let me know if any buddy has already done this kind of task.
What I have tried is:...
you can launch quite a lot o' stuff through pm2
pm2 is basically a glorified command line launcher
all hail pm2
feck, i think ye can even launch mongo through it
in pm2's website
ADVANCED, PRODUCTION PROCESS MANAGER FOR NODE.JS
cpu and ram usage?
you know an app is good when you can use it for much more than it was designed to
yeah
discord
anyone here using datadog
not afaik
Why does datadog have a stock price
i tried too but my "variables" didn't show on dashboard
pm2 has such thing iirc 🤔
I think you have to pay though
with aiohttp aiohttp.client_exceptions.ClientOSError: [Errno 32] Broken pipe this happens?
@quartz kindle did you tried this https://pm2.keymetrics.io/docs/usage/process-metrics/
yes i did
ended up removing it because doesnt serve much purpose if you dont have a paid account
because no data retention
but still, it was the easiest to setup metrics system
but the pm2/io package is nice because you can get user-specific data from inside the process
the questions were "anyone used xyz" and "did you try xyz"
what is jlist
can you see this values on app.pm2.io
lmao
yes
if you use the pm2/io package, you can set anything to appear in the pm2 dashboard
cool
hmmm
i used to have that for guilds
I tried using pm2/io once but the things I set didn't appear in the dashboard
idk, for me it worked straight away
maybe am late but congratz on the new role (Notable Member) no worry i turn off ping
lol ty
Is it safe to remove these packages from my react ts project?
only one way to find out :^)
does guild.members.fetch('id') require privileged intents? I didn't think so
No
okie
so node.js 15.6.0 added process.memoryUsage.rss() for some reason
they say its the same as process.memoryUsage().rss but faster
lol
well it might be since it does not return a new object
but if ur going to use all those values anyways, i don't see point of using it then ¯\_(ツ)_/¯
const Keyv = require('keyv');
module.exports = {
name: 'clear',
description: 'Bulk deletes a certain amount of messages.',
usage: 'clear `amount`',
async run(message, args) {
if (!message.guild.me.hasPermission('MANAGE_MESSAGES')) {
let msg = await message.channel.send('I require the `Manage Messages` permission in order to perform this action!');
msg.delete({ timeout: 2000 });
return;
}
const amount = parseInt(args[0]) + 1;
if (isNaN(amount) || amount < 2 || amount > 100) {
let msg = await message.channel.send(`You must enter a number higher than 0 and less than 100.`);
msg.delete({ timeout: 2000 });
return;
}
message.channel.bulkDelete(amount, true).catch(async (err) => {
console.error(err);
let msg = await message.channel.send(`Can't delete messages older than 2 weeks.`);
msg.delete({ timeout: 2000 });
return;
});
const clearEmbed = new Discord.MessageEmbed()
.setColor('#00ffbb')
.setTitle(" succesufully purged the messages")
.setTimestamp(new Date());
message.channel.reply(clearEmbed);
}
}```
For some reason it isn’t replying
It’s working, but not replying
i dont think channel.reply exists
I’ve tried message.channel.send
if you want to use reply its message.reply()
Oh mb...
my bot was verified today 
gz
ty
Congrats 🎉
you can see where the code is copypasted and where their own starts 🙈
thanks 
I got my own but, for some reason it had some problems
It worked
But, sometimes in other servers specially something weird started happening..
I had no choice, so I just copied one sadly...
don't you just do message.reply instead of message.channel.reply?
unsure
Ye, it’s message repl dumb me lol @stark abyss

Lol
.setTimeout(5)
Would this work?
Oh mb, lol dumb me again

const Keyv = require('keyv');
module.exports = {
name: 'purge',
description: 'Bulk deletes a certain amount of messages.',
usage: 'clear `amount`',
async run(message, args) {
if (!message.guild.me.hasPermission('MANAGE_MESSAGES')) {
let msg = await message.channel.send('I require the `Manage Messages` permission in order to perform this action!');
msg.delete({ timeout: 2000 });
return;
}
const amount = parseInt(args[0]) + 1;
if (isNaN(amount) || amount < 2 || amount > 100) {
let msg = await message.channel.send(`You must enter a number higher than 0 and less than 100.`);
msg.delete({ timeout: 2000 });
return;
}
message.channel.bulkDelete(amount, true).catch(async (err) => {
console.error(err);
let msg = await message.channel.send(`Can't delete messages older than 2 weeks.`);
msg.delete({ timeout: 2000 });
return;
});
const clearEmbed = new Discord.MessageEmbed()
.setColor('#00ffbb')
.setTitle("purge")
.setDiscription("succesfully purged the messages")
.setTimestamp(new Date());
message.reply(purgeembed).then(m => m.delete({timeout: 2000}))
}
}```
Dosent reply again lol
i dont see where you define purgeembed
Ohh bruh, dum me again...
the error in the console helps a ton.
both these issues should have given errors in the console which explained the issue.
if the error are so imitating you perhaps use try and catch and console log error if that's helpful

how do u manually call an event
<EventEmitter>.emit('eventName', ...args)
(in python)
anyone?
anyone have any good Discord Dashboard tuts?
I am getting such an error my code is if (!msg.member.hasPermission("BAN_MEMBERS")) {
is this and i am using djs v12
Error: 401 Unauthorized at IncomingMessage.<anonymous> (/home/../../node_modules/dblapi.js/src/index.js:118:25)
me?
obvs
Ok
hi
so I use glitch premium to host my bot and I use the editor for the coding. But the editor is rly crap well not the crap but I mainly use vsc and copy the code into glitch
. So is there a way I can host from vsc? Ore maybe put it on github and host from there?
why not host on a vps?
glitch premium kekw
how to play audio files from a directory (not bot related)
play audio files where?
from the file system
const { client } = require('../index');
app.get('/api/bot/stats', function(req, res) {
res.json(
{
"guilds": client.guilds.cache.size,
"channels": "PLACEHOLDER",
"users": "PLACEHOLDER"
}
)
});
idk what to do :c
on my pc
lol
I want to play the audio file on my pc
at least I found a solution now by myself
ffplay
the others I tried just didn't work
everytime I do a left click it will play a sound effect now
a very satisfying click sound effect
how do I import my bot file (index.js), so I can get the bots server count, and stuff like that. To put on my dashboard
const { client } = require('../index');
dont work
i would recommend passing the client with a function
but the way you're doing it requires exporting the client in your index.js
make sure you're using module.exports
mentions might also be in the format <@![id]>
Note: I’ve tried <@!
o
that doesn't work
<@&
that's for roles
it is a user id
client.user.id is literally the bots ID
maybe you have too many listeners
log the message content to see exactly what you receive
you added the console.log before checking the message right?
is the message.content @botID or is it @botId blah blah blah
might need to do message.content.indexOf("<@!bot id>") === 0
or startsWith
Why in the world Every time I say +
It says I can’t find a channel called verify
Wtf
that captcha doesn't do shit btw
userbots can just read the content of the embed and parse the code
well do you have a channel called verify?
Mhm
It just says it randomly every time I say +
Like, why when I do + @quartz kindle
It can, if you type the code right it will give you a role if not then it won’t
show your command handler
I don’t think somethings wrong with command handler but sure
Damn, I can’t remember where it was and how it looks...
But I think this is it
your prefix code is wrong
you basically accept anything as prefix, as long as its the same length
Huh why?
actually nvm
Lol
Ohh, so what should I change?
probably slice prefix, not default_prefix
Ohhh, so
and you cut of the default prefix size from it
so if someone uses a prefix that is of different size than the default
you're gonna have issues
Damn..
woah, someone made a script that randomly generates 5 chars and puts it in an imgur url, its surprising how often you find actual images.
its because you have "" as an alias, so if you type +, which happens to be the same length as your default prefix, you code slices it off, meaning you're left with "", aka an empty string, and this empty string will match the alias for the verify command
try that with lightshot
you'll find personal information, documents, text messages...
insane
Lol
time to find tims personal info
or some furry pron
so, yeah, have bleach ready
pour abundantly in your eyes in case of cursed images
ah, i didnt think about that.
here found one https://prnt.sc/xoby84
lol
yo @quartz kindle how much more memory efficient is a raw object over an instance of a class?
lmao, i just edited the url a bit and i got a pic of dms talking about bitcoin
not that much
the content matters more
for like message and channel
you could do functions like client.sendMessage() or you could do message.channel.send
let me do a small test
pog ty
makes basically 0 diff
10 million instances of class { constructor() { this.id = "1234567890" } } vs 10 million instances of { id:"1234567890" }
both take about 550mb heap
lets wait a bit for the gc to run
after a few minutes on idle both drop to 450mb
so yeah, which one you use is pretty irrelevant, the contents are much more important
ty tim
its a pitty js doesnt support native long ints
agreed
for browsers i get it
but node can implement it natively
i mean they probably won't
i guess they could, but they have to respect js rfc and shit
yeah
the difference it makes is absurd
for example, ints vs floats
even though js treats all numbers as doubles, under the hood the engine choses which type to give it
js ints are stored as 32bit ints when possible and are about twice as fast and twice as small as js floats which are stored as 64bit doubles
help please
This Error: var embed = new Discord.RichEmbed()
^
TypeError: Discord.RichEmbed is not a constructor
This Code:
let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
if (!message.channel.guild) return;
if (message.author.bot) return;
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
prefix: process.env.PREFIX,
};
var prefix = prefixes[message.guild.id].prefix;
var setp = prefixes[message.guild.id];
if (message.content.startsWith(prefix + 'setp')) {
if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(**:x: Error: You do not have the required permissions: Manage Server.**);
let args = message.content.split(" ").slice(1);
if (!args.join(" ")) return message.reply(`**:x: Error: sdaSay The Prefix Please.**`);
var embed = new Discord.RichEmbed()
.setColor("BLACK")
.setTitle("Prefix Set!")
.setDescription(**Set to ${args[0]}**);
message.channel.send(embed);
setp.prefix = args.join();
}
fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
if (err) console.error(err);
});
});
Try using Discord.MessageEmbed() instead
okay
please use code blocks:
```lang
code here
```
ex:
```js
console.log('a');
```
console.log('a');
been there done that
so i just tested a Map with 1 million entries
no
but didnt work
both key and value are bigints -> 1.3gb
both key and value are strings -> 1.1gb
both key and value are numbers with decimals -> 1gb
both key and value are numbers without decimals -> 710mb
damn
Everytime I Do The Command "-help fun", It Sends Both Help embed And Fun Embed. How Do i Make It Send 1 Only The Fun Embed?
Code -> https://pastebin.com/bqFuRFYL
only send the help embed if there are no args
So How Should I Do It In the Code
check args.length
What
make an if statement to check args.length
add a !
that's it
Ok!
Ill try
it still sends 2
Ill Send Full New Code In Paste bin
@mellow kelp
even for me, without any proper js knowledge, this is not correct https://i.imgur.com/ouKKYv5.png
args.length returns a number
the length of your args
how do i fix this?
that's just a warning, increase your maxlisteners through the method mentioned
where do i put it?
So How Do You make It Return a number
@rustic nova where do i put it?
ok
I Fixed It!
i use that though
returns false for 0, and i find it shorter
but yea it might confuse beginners
@crimson vapor only add the listener if it's not existing already
k
how did I ping million

I think it's because your name is all upper cased so I just assumed you're MILLION
sorry I just woke up
how do i make this variable global?
const commandName = args.join(' ')
const commandAction = args.slice(1).join(' ')```
why
need full code
where do you want to access it?
cuz it says commandName is undefined
i have the variables on create-command.js
and want to access it on main.js
provide them to the function
wdym
Can you show your main.js?
okay
the part where i want to access it
else if(command === db.get(`${message.guild.id}.${commandName}.${commandAction}`)){
message.channel.send(db.get(`${message.guild.id}.${commandName}.${commandAction}.commandAction`))
}```
One message removed from a suspended account.
One message removed from a suspended account.
mhm
One message removed from a suspended account.
kekw
who did you mean to ping?
is that good for custom change prefix
BOULEVARD DEV
let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
if (!message.channel.guild) return;
if (message.author.bot) return;
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
prefix: process.env.PREFIX,
};
var prefix = prefixes[message.guild.id].prefix;
var setp = prefixes[message.guild.id];
if (message.content.startsWith(prefix + 'setp')) {
if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(❌ Error: You do not have the required permissions: Manage Server.);
let args = message.content.split(" ").slice(1);
if (!args.join(" ")) return message.reply(**❌ Error: sdaSay The Prefix Please.**);
var embed = new Discord.RichEmbed()
.setColor("BLACK")
.setTitle("Prefix Set!")
.setDescription(Set to ${args[0]});
message.channel.send(embed);
setp.prefix = args.join();
}
fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
if (err) console.error(err);
});
});
mmm at least use jason.db
let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
if (!message.channel.guild) return;
if (message.author.bot) return;
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
prefix: process.env.PREFIX,
};
var prefix = prefixes[message.guild.id].prefix;
var setp = prefixes[message.guild.id];
if (message.content.startsWith(prefix + 'setp')) {
if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(**:x: Error: You do not have the required permissions: Manage Server.**);
let args = message.content.split(" ").slice(1);
if (!args.join(" ")) return message.reply(**:x: Error: sdaSay The Prefix Please.**);
var embed = new Discord.RichEmbed()
.setColor("BLACK")
.setTitle("Prefix Set!")
.setDescription(**Set to ${args[0]}**);
message.channel.send(embed);
setp.prefix = args.join();
}
fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
if (err) console.error(err);
});
});
yes
good?
memes bro
yea but
i think using JSON as a database is a bad idea
i forgot why
i don't want to hear that from you lmao
flaze
yea it is a bad idea
queues?
a request based db
but that's...
http
JOSH
josh.db
evie made josh
how do I loop audio in the background of a website (it's for my bot)
flaze can you gave my src of custom prefix if you want ples I try my best to make one but didnt work
the <audio> tag has a loop attribute or something
cool thx
np
flaze?
@earnest phoenix you need to make it yourself, we don't spoonfeed
iknow but i make this code but didnt work
let prefixes = JSON.parse(fs.readFileSync("./prefix.json", "utf8"));
client.on("message", message => {
if (!message.channel.guild) return;
if (message.author.bot) return;
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = {
prefix: process.env.PREFIX,
};
var prefix = prefixes[message.guild.id].prefix;
var setp = prefixes[message.guild.id];
if (message.content.startsWith(prefix + 'setp')) {
if (!message.member.hasPermission(MANAGE_GUILD)) return message.reply(**:x: Error: You do not have the required permissions: Manage Server.**);
let args = message.content.split(" ").slice(1);
if (!args.join(" ")) return message.reply(**:x: Error: sdaSay The Prefix Please.**);
var embed = new Discord.RichEmbed()
.setColor("BLACK")
.setTitle("Prefix Set!")
.setDescription(**Set to ${args[0]}**);
message.channel.send(embed);
setp.prefix = args.join();
}
fs.writeFile("./Database/prefix.json", JSON.stringify(prefixes), (err) => {
if (err) console.error(err);
});
});
(**:x: Error: You do not have the required permissions: Manage Server.**);
I'm pretty sure you're missing something on these
how do you know it doesn't work? check your logs etc
i check on logs
it still on old prefix
Missing a lot of something in a lot of places
@earnest phoenix you are missing the ' ' between the MANAGE_GUILD
if (!message.member.hasPermission('MANAGE_GUILD')) return message.reply```
https://sourceb.in/Jt3EjIPV0P Please help I give nitro
bruh
no idea
this is such a mess
not even that
.catch(async () => { ...
whats the best way to clean and sanitize sql queries of prefix commands
but constantly mixing between fetching and getting
you mean sanitize to prevent sql injection?
what's the lib you're using to communicate with your db
your lib should have a built in way to sanitize
yea
dis
yes
this is my first time using sql on my own is there any working open source implementation of it that I could find somewhere?
okay thanks
else if(command === db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`)}.commandName`)){
message.channel.send(db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`)}.commandAction`))
}``` why doen't the messgae send?
? wdym
log command and log the db thing are the same? Debug lines
i did log it
nothing
did you define db?
what are you trying to do
Make custom commadns
db.get(`${message.guild.id}.${db.get(${message.guild.id}.commands)}`)
well
what's the console error?
did you try reading console
theres no error
but it didn't
do you think there is a db.get(`${message.guild.id}.commands`)
i even logged it but it didn't log
did you log the result of get
wdym
... exactly what i said
it didn't log tho
i
then try logging it-
🚶 🦽
console.log(db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`))
k
what
if this doesn't work then your console is bad
also that is
i think it's getting the db of message.guild.id
so many unnecessary db calls
am not sure if there is one
but idk
i actually saw this guy's bot
idk it's pretty nice and reviews are pretty nice
i feel like i wanna check what it can do
......
what did it log
||Red underlines 🆘 ||
what the fuck even is that code
syntax error
that's not even valid syntax
are you serious
you can't just paste that thinking it would work?
code that's not a dumpster fire is such a rarity in this channel
did you set the db
do you have like
db.set(`${message.guild.id}.${db.get(`${message.guild.id}.commands`, something)
?
oh
tell me there's nothing wrong with it
are you goddamn serious
else if(command === 'testasdf'){
console.log(db.get(`${message.guild.id}.${db.get(`${message.guild.id}.commands`)}.commandName`))
}```
i-
u-

....
https://sourceb.in/Jt3EjIPV0P Please help I give nitro
cya
"bot.rolemenu = new db.table('Rolemenu');" in the index
channelid is not a channel id
it is not a snowflake
let channeloui = message.guild.channels.cache.get(channelid)
you really think that's gonna work?
Yes
uhm
message.guild.channels.cache.find((r) => r.id == collected.first().content) ||
collected.first().mentions.channels.first()
if(!channelrole) return message.reply(`${bot.emoji.error} Channel Invalid`)
await bot.rolemenu.set(`Rolemenu : ${message.guild.id}`, {channel: channelrole.id})```
channelid is a channel id
let channelid = await bot.rolemenu.fetch(`Rolemenu : ${message.guild.id}`, {target: '.channel'})
React a message with a reaction
message.react('')
let messagerole = await channeloui.fetch(message.id === messageid).then( messagerole.react(emojirole) )
Cannot read property 'fetch' of undefined
Yes
Ah
let question = await message.channel.send("Veuillez entrer l'ID du message")
const filter = m => message.author.id === m.author.id;
message.channel.awaitMessages(filter, {
max: 1,
time: 60000,
errors: ['time']
}).then(async (collected) => {
collected.first().delete()
question.delete()
let messageoui = await bot.rolemenu.fetch(`Rolemenu : ${message.guild.id}`, {target: '.channel'})
let channeloui = message.guild.channels.cache.get(messageoui)
let messagerole = await channeloui.fetch(message.id === collected.first().content)
if(!messagerole){
let mes = await message.channel.send("Invalid ID")
mes.delete({timeout: 2000})
}
await bot.rolemenu.set(`Rolemenu : ${message.guild.id}`, {message: messagerole.id})
embedbase.fields.find(m => m.name === "**Message**").value = `${collected.first().content}`
msgg.edit(embedbase)
}).catch(async (err) => {
console.log(err)
collected.first().delete()
message.channel.send("Je n'ai pas pu modifier le message").then((mm) => mm.delete({
timeout: 5000
}));
})
}```
(async (collected) => {
collected not defined it is for line 120
For react \🆔
at c:\Users\denis\OneDrive\Bureau\Amnesia Bot\database\commands\Administration\rolemenu.js:110:56
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {stack: 'TypeError: Cannot read property 'fetch' of un…ctions (internal/process/task_queues.js:93:5)', message: 'Cannot read property 'fetch' of undefined'}```
For react \🆔
…denis\OneDrive\Bureau\Amnesia Bot\database…} reason: ReferenceError: collected is not defined
at c:\Users\denis\OneDrive\Bureau\Amnesia Bot\database\commands\Administration\rolemenu.js:120:25
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)```
For react \✅
at c:\Users\denis\OneDrive\Bureau\Amnesia Bot\database\commands\Administration\rolemenu.js:186:56
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {stack: 'TypeError: Cannot read property 'fetch' of un…ctions (internal/process/task_queues.js:93:5)', message: 'Cannot read property 'fetch' of undefined'}```
fetch is not defined.
collected is not defined.
wait im stupid you were answering the question not asking
@commands.command(name='asciify', aliases=["ascii"])
async def asciify(self, ctx, *, message=None):
if message is not None:
if len(message) <= 50:
if message[0] == '<' and (message[1] == '#'):
await ctx.send('im not doing that 😂')
elif message[0] == '<' and message[1] == '@':
await ctx.send('im not doing that 😂')
elif ctx.author.is_on_mobile and len(message) > 8:
await ctx.send('The output might look a bit weird on your phone! 😅\n Landscape mode might make it look Better')
msg = pyfiglet.figlet_format(message)
await ctx.send(f'\n{msg}\n')
else:
msg = pyfiglet.figlet_format(message)
await ctx.send(f'\n{msg}\n')
else:
await ctx.send(f"Your character length ({len(message)}) has exceeded a normal of 50.")
else:
await ctx.send('Whats it you to asciify?')```
please help
hey does anyone know if all guild IDs are the same length
they are not
huh are you sure, from my small sample size of 5 they all seem to be length 18?
older servers have 17
in the next few years there will be ids that are 19 long iirc
the id system isnt incremental
ids contain timestamp, originating server info, number of other ids generated in that second, etc
most id systems these days are non incremental
yes i know that, but they could theoretically normalize/hash the ID to be an available number from 10^18 to 10^19-1
ah well
most numbers are skipped in the discord id system
str(guild.id) + str(channel.id) should still be essentially unique right
unless there is an amazing coincidence
guild id would be unique either way, so guildid+channelid will always be unique.
@commands.command(name='asciify', aliases=["ascii"])
async def asciify(self, ctx, *, message=None):
if message is not None:
if len(message) <= 50:
if message[0] == '<' and (message[1] == '#'):
await ctx.send('im not doing that 😂')
elif message[0] == '<' and message[1] == '@':
await ctx.send('im not doing that 😂')
elif ctx.author.is_on_mobile and len(message) > 8:
await ctx.send('The output might look a bit weird on your phone! 😅\n Landscape mode might make it look Better')
msg = pyfiglet.figlet_format(message)
await ctx.send(f'\n{msg}\n')
else:
msg = pyfiglet.figlet_format(message)
await ctx.send(f'\n{msg}\n')
else:
await ctx.send(f"Your character length ({len(message)}) has exceeded a normal of 50.")
else:
await ctx.send('Whats it you to asciify?')```
please hel
p
is this node.js
python
@solemn latch well, the thing is if there are 17 and 19 digit guild and channel ids, you could theoretically have a collision. if your magic number was "1234" it could be guild.id=123 and channel.id=4 OR guild.id=12 and channel.id=34
for example
that also is impossible for a handful of reasons, a simple one is the id's have a timestamp built in.
thats what i thought
cool
if message.startswith(('<#', '<@')): http://storage.norizon.cloudns.asia/ss/DindiwxWOr.png
though, it doesn't mean the message doesn't contain mentions at all, consider using if ctx.message.mentions or ctx.message.channel_mentions instead
and you now what, is_on_mobile is a method which you need to call it, otherwise it's always True since it's not falsy
and as for the problem, use codeblock.
Is anyone experienced with the eris.js framework here
not a lot of people here use it.
Darn
what is the default setTimeout delay??
One message removed from a suspended account.
so using it without any delay, will cause the callback to be called at the end of the wrapper function right?
function fun() {
setTimeout(() => console.log('1'));
}
fun();
console.log('2');
// '2'
// '1'
I just tried.
And it logged, '2' first
huh interesting, i guess it's adding overhead and putting it to the next event cycle
ill check the docs
hmm, that is what I guessed too. So was wondering, what would be the default delay is set to?
the default value of the delay is 0
however since js is single threaded, it depends on event cycles
that's why it lags behind
that means we can write some instructions in the middle of a function A and get it executed after A has finished executing
hello people, i am trying to add a nitro emoji send function in my bot, but it is showing an error, if you could help it will be helpful
error
(node:4884) UnhandledPromiseRejectionWarning: TypeError: message.split is not a function
code block:
if(emoji && !message.split().find(x => x === emoji.toString()) && !message.content === (`<a${replace}${emoji.id}>`)) message = message.replace(rexreplace, emoji.toString())```
you can't split an object
you can split a string though
you're probably looking for the content property
nah, i have tried message.content it says message.content is not a function
mhm
so what will be the fixed code?
take a guess
is it a bug that you are sending a same message twice?
oh, ok ok, let me guess
can you send me the details of your build and stuff in dm?
i want you to guess because it's a really logical solution and it makes you think instead
brain.exe not working
split is available on a string
message is an object
the content property of the message returns a string
How do you use a property?
isn't property like, eh, like, read only thingy?
i mean, how do i explain
nvm, i will start the code again from start
Just look more into OOP
Why does Discord API allow us to lock emojis to certain roles but we can't do it on our end?
Why do we need bots to do it
const arr = [];
for (let i=0; i < size; i++) {
arr.push(this.stack.pop());
}
arr.reverse();
const arr = new Array(size);
for (--size; size >= 0; size--) {
arr[size] = this.stack.pop();
}
const arr = stack.splice(size + 1, stack.length);
Which one of these three do you think is the fastest?
I'm pretty sure the third one should be faster
Array.splice() is slow though so I'm not sure
This is the first method
hm.. yeah splice is the slowest of the three, am I doing this correctly?
splicing once... 31 ms
But if I do the test with an array of 100 elements, then splice is the fastest, so it's the size of the array that matters
Hello, I need some help.
Basically, my Presence Intent is Declined once again because Userinfo and Serverinfo functionality is not enough for it to work.
Can you please give some valid reasons to use Presence Intent?
If you're asking for valid reasons for the intent, you shouldn't request it in the first place
I want to add something that has to require presence intent to unlock that stuff higher
or you can just remove those commands
Any tips for doing a whois command in Python?
that's not helping
at least send https://discordpy.readthedocs.io/en/latest/api.html#member or something
@pale vessel @tribal siren That’s what it is? Just a customized version of all the Member properties?
what do you mean
wdym
you mean whois command as in user info, right?
you can get those info using ctx.author (it will be a member inside guilds)
or fetch the member, whatever
And use all the things listed in there?
yeah
member.roles, yeah
Hey, I have a question,
how can i display the member count in my bot profil on top.gg
wait
oh yes servers
ok ty
where can i see my dbl token
How can I deafen discord bot in nodejs?
Click "My bots" at the link he sent you, then click the bot you want the token for, and then "Generate token"
ty ❤️
I want to do server defend
?
server defend, new tower defense strategy game
i would guess he wants some sort of Raid protection, but if you have to ask in how to make one i guess you wont understand how to do it either
It's better to try and get started by yourself, and then ask about any issues you run into, rather than asking how to make the entire thing. People are very unlikely to help you create an entire feature.
could be the X / Y Issue
No he wants to deafen lmao
The most powerful of server defenses
I have a code it is expire can anybody help me in updating that
?
Langauge is discord.js
Wdym by expired? Like it doesn't work with new versions of the discord library?
so you run D.js V11?
Yup
code has an expiry date? 😰
I guess technically, yeah xd
😃
It would probably help if you also sent the code that is expired
lol tell this the chinese Train companies, who went offline for 16 hours bcs they relied on Flash
some banks still rely on BASIC
Flash got shutdown on the 31s December last year
and theyre Ticket system relied on it
it costs money to update systems, companies avoid it as much as possible
interesting
there are explanations in the comments
How do I get the array of an array. I want to get the array that ends in R without knowing the first two items.
Table:
[[0,0,W],[0,0,O],[0,0,R],[0,0,D]]
two for loops
You would probably need to loop through them, arrays can't be directly accessed
there's probably a single line solution depending on your language
js
flatMap
like array.find(x => x[x.length - 1] === "R")?
ah yes
bruh this looks like a nuker

What did they define as "maintenance mode" exactly?
And how does deleting all possible roles and channels fall under "maintenance"?
Why would you ever need a feature to wipe an entire guild's channels, if it isn't for destroying it?
To make it new ofc

smh what
new in what sense
Resetting it? 
now I want to get the array but only using the first two items in the array.
@earnest phoenix
basically add one more condition in the find
That's an interesting interpretation of the word maintenance
maintenance: destroy it and fix it to make sure it works now 
So I'm using acorn with typescript, but I don't have access to any specific node types, only the generic Node
how do I get em
check if your definitions are loaded correctly
they are, I looked at acorn's index.ds.ts and they don't create interfaces for the different types of nodes, so I guess I have to do it myself
oh welp
go make an issue for that or something
unless theres already one
might help
this is hell
not sure what you mean, if you wnat node types simply npm i @types/node, as far as accessing something inside, its just path ìmport { thing } from './@types/estree'
but since this is basic, i assume this is not what you were looking for
you can import it from estree iirc
yes
then why repeat it?
i read your message after you told me about this
yeah I figured it out it's just "estree", not @types/estree
but it's still hell
can I use a function inside a function?
for react class component, why should I not use componentWillMount()?
check() => {
check()
}
yes
but this will cause an infinite recursion.
yeah, Im on the same page. But what to use instead of it?
componentDidMount
yeah, use componentDidMount
but, it is called just after, render.
You may call setState() immediately in componentDidMount(). It will trigger an extra rendering, but it will happen before the browser updates the screen. This guarantees that even though the render() will be called twice in this case, the user won’t see the intermediate state. Use this pattern with caution because it often causes performance issues. In most cases, you should be able to assign the initial state in the constructor() instead.








