#development
1 messages Β· Page 1045 of 1
fetch the bans audit
Logs
audit log
Hahahaha
Well it falls under development and the channel topic does say "channel for chatting about (bot) development"
how can the bot check audits
idk
audit log might update slow
check docs
you can fetch ban
so it's not reliable
I don't know.. but that's a way to go probably
or maybe they might have a modlog channel
Mee6 bot does it
mee6 bad
how can the bot check audits
@autumn summit i think thats available in discord.js docs
It stores logs in specific channel for logs
@pure lion actually it's quite good. And you can choose what logs to show..and where.
h
im py and I se it now
Py?
python
yeah
python
Oh. I didn't learn python yet
Python syntax is shit
import
@wheat hornet javascript also uses import and export
And made it a bit more complex for experienced coders to understand
@ebon kelp yup squlize.import
Like it's not good as 1st language.
wait its depricated
I suggest people to go for C language to learn coding.
Like it's not good as 1st language.
@strong fjord It is actually, it's simple. But you don't get the basics of other languages
js was my first lang, no regeats
Python makes everything easy
python was my first language
personally i've found python easier to understand than other languages
It's like it hides background details
Like
Var somename;
U cannot say what variable it is.. by just looking at it
Python is an easy language to learn, but some syntax is really different compared to other common languages
U won't learn difference between basic data types
@ebon kelp it is easy. But C is super easy as well.
debugging in python is hell
Just syntactical sugar is much complicated for newbies to look at.
I mean to say.. they get frustrated when they see all the brackets or possibly every key getting used.. in a language.
πΉπ
Python allows you to code.. without knowing programming.
i mean not really lol
^
TypeScript is basically JavaScript with strong types so
I know it doesn't make sense to you.. but it's true. I believe we all need basic and strong foundation to develop upon
honesty i find debugging in js 100* easy than python
Python allows you to code.. without knowing programming.
@strong fjord It's not like those block codings, python can be complex
well it's easier to work with Excel sheets without having to worry about memory pointers
C language and after that c++ gave me that foundation which allowed me to learn more
π©
@ebon kelp yes. It is a lot complex to read
Because u have to check declaration and assignments
Python command syntax 
And u cannot know datatype in dry run just by looking at declarations.
@ebon kelp I don't like tab logic
They could have used normal {}
even tho c++ and c are strictly typed 
@modest maple they are awesome and powerful
i mean each to their own right
i mean im Rust and Python bases so lol
Rust? damn
C and c++ is much better than python in my opinion.
But python is good for artificial intelligence and Machine learning and Many more things
U can do complex stuff easily in python.
you are comparing two native languages with a high level language tho lol
Python lends itself to rapid developement
I like JavaScript more
they're just not comparable
It's near to java and c++
every language does different things
Actually every programming language does almost the same things.
i mean any program that is turing complete can in theory do the same thing as any other language
@ebon kelp man.. these trends are making me sick. I spent years learning languages and then cotlin is trending
Β―_(γ)_/Β―
I believe JavaScript is the future
people have their preferences
Delphi gang
They all output 0/1
@stuck compass sure u are right. But JavaScript is gonna explode
Try making good games in js
I am not JavaScript developer though.
But with MERN AND MEAN stack .. it says it has a lot of potential
What do u like more? Mean or mern?
JS ain't gonna explode, it's been around and used as a primary common language so long that there is no way for it to "explode" at this point
@stuck compass learning is good. As technology keeps on changing. Worst nightmare for developers
if any lang is gonna explode soon it's gonna be rust
Rust, go, something like these
@pseudo quartz i know. But now u can use nodejs
Because of V8
@pseudo quartz maybe. No one knows.
Vb.net didn't work though. Maybe. πΉ
I have learnt that but I don't even remember it's syntax
It was a bit confusing.
Anyone tried vb.net here?
no but i'm learning it in college
How helpful/useful is it
I think c#.net would be better. Maybe. Still digging upon it.
We are going to learn C# in college this year but never touched VB
i'm jealous honestly
It doesn't matter what primary language you choose for coding. But i still would prefer c++ or java or maybe c#
@stuck compass of what?
If you consider learning PascalABC for 2 years, maybe
of shivaco going to learn C#
I'm also learning c#
I already know some part of it to write simple console applications and I like it so far
C++ has been language of gods uptil now.
It's perfect blend between highs and lows.
I want to learn C++ eventually
Do learn. It gives u control over memory.. unlike java or c#
Maybe c# doesn't let you interact with memory as well
Play with*
Honestly C++ is very confusing to me
same
@slender thistle it's easy if you learnt c language
which I never did 
U must try C language.
Just learn it 4head
It's gonna be as easy as slicing butter
I mean c++ was tough.. until i learnt c language
Which made me believe that c is the best language for beginners
C introduces you to all the basic foundation to learn further.
I started programming with discord.py (yes, not Python itself) and slowly moved to learning other languages 
I am also learning assembly
Because i wanted to write into memory, so i wanted to know the details
Like i wanted to try hacking.
And game hacking
ah who can fix his
this
I could not join the voice channel: Error: FFMPEG not found
ffmpeg not found
Apt install ffmpeg
have you tried npm i ffmpeg idk
I don't know lol. Btw i am new to discord bots coding
I don't know nothing about it
let me try that real quick
If someone can help me learn it would be great
I didn't read anything about it yet. As i didn't get time
i dont know alot also
If you want to learn game hacking or development.. you should learn c++ and/or c# ..
it didnt work
What distro are u using
I could not join the voice channel: Error: FFMPEG not found
@earnest phoenix what were you actually doing
is there a reason why discord.js message collectors are so slow
like idk it takes like 4 or 5 attempts untill it finnally collects my message
@earnest phoenix are you using heroku?
because you need ffmpeg installed on the machine aswell
MessageCollectors are instant for me
Itβs either a bad host or you need ffmpeg for heroku
I am working on a guildMemberUpdate event but only the change nickname part works the other two doesn't work and it doesn't give any errors
code: https://hastebin.com/uyefinijus.js
anyone experienced with mongodb here?
sligthly. I use it for my prefixes (which are now broken)
π
quick.db
mongodb is a database
and idk why everyone hates quick.db probably becuz they are bored and have nothing better to do than complain about people using it
@earnest phoenix
more like
shit
quick.db is just an sqlite wrapper
use sqlite
adds an extra dependency for nothing
quick.db is made for easy use
so people with no experience can also use it
shouldn't be using a db if you don't know how to use it
and you can use mongo or whatever
who cares
they use it anyways
so
what u gonna do
u aint choosing what they choose
ok if you got nothing else to do
basically
thats just pure toxic
like who the fuck cares who uses what db
*wrapper
it isn't toxic if I haven't done it yet
memeing in dbl is fun bc of all the heat that gets generated
convert it to electricity
"I don't like X"
"wHaT tHe FuCk DiD yOu JuSt SaY"
is there a reason why discord.js message collectors are so slow
@marble juniper well no but actually yes: discord.js sucks with message collectors
Ping me if someone can help
help? yes
give code? no
@tight plinth they fucking stole my commands in testing
Wut
can't have shit in detroit π’
how does one even steal a command?
help? yes
give code? no
@lyric mountain okay, wait<p style="color:pink;"><b>Wawa's Commands</b></p>
Its not bold :/
try not using <b> inside a paragraph, or use font-weight: bold inside style
Oh,okay
Like <p style="font-weight: bold;color:pink;">Wawa's Commands</p>
?
@lyric mountain
no need to ping me dude
aye
try putting bold inside ''
hi. can some1 help? I wanna do sth like track Invites. Now i wanna know how i do like on the guildMemberAdd event how i see who invited the person.
Discord.js 12
weird
try using markdown instead
**bold text**
# title
## smaller title
### even smaller title
Hi π I feel like this would be simple, but how do I get it so when a user types !prefix It changes the prefix to their input πIts probably very simple
two * around a text will make it bold
Im a noob in HTML
like, if you want to make Wawa's Commands bold, just use **Wawa's Commands**
I have a statistics bot that tracks the amount of textmessages sent per user per channel in a discord server.
Using mongodb (node.js driver), i have a collection guild, which has an array field members. Each array element member has a textMessageChannels array. Each textMessageChannel has 4 int fields representing the amount of messages sent in the past timeframe: total,yearly,monthly,weekly,daily.
Assume i dont save every textmessage event directly to the database, but cache them within the clients and save only every other minute, all at once. It would be an array of the form:
textMessageChannels: {
bsonType: "array",
required: [ "channelId","alltime","year","month","week","day" ],
properties: {
channelId: { bsonType: "number" },
alltime: { bsonType: "number" },
year: { bsonType: "number" },
month: { bsonType: "number" },
week: { bsonType: "number" },
day: { bsonType: "number" }
}
}
Now i have a lot of textmessage count values that need to be added onto their database counterpart. These counterparts are scattered accross (guild) collections and (members, channels) arrays.
My question is
- Is there a / What is the most efficient way of updating multiple rows with different keys and different values in one query?
- Is there a different sharded database system more fitting for my needs? (Keep in mind the saved values will be used for various statistical calculations, also needing a lot of grouping sums)
if Wawa's Commands should be a title, put # and a space behind it like # Wawa's Commands
if u need a title: <h1>TEXT</h1>
^^^
I know
just use markdown smh
up to <h6> π
== <h1>
Hi π I feel like this would be simple, but how do I get it so when a user types
!prefixIt changes the prefix to their input πIts probably very simple
@gray zealot
<p style="color:pink;">**Wawa's Commands**</p> 
yes...
oof
** ?
no, remove the <p> wrapping else it'd not work
No p only h1
Okay?
ah okay
he ain't making a website
π ok
just writing bot desc
Kuu can you edit my code right and send it? ;-;
then #
Kuu can you edit my code right and send it? ;-;
@fringe axle I could try π
Kuu can you edit my code right and send it? ;-;
@fringe axle absolutely not
D:
^^^^ π¬
@fringe axle I could try π
@gray zealot thanks ^^
rule 7
oop
D:
π Ill walk you through it?
7.a actually
tfw long description is already bold
it can be bolder with **text**
it worked
will font-weight: bolder; be the CSS equivalent?
With a HTML school xD

I guess so
I think so...
**** is <strong> apparently
π
I think I realized what went wrong
Thia channel is off topic now smh.

I'm not actually doing the <b> crap in the HTML tag
still development stuff
π yeeah
i feel like i tested a lot.
bot gets added to a server, and suddenly i got 5 new errors i never had before π€
welcome to development
Hi π I feel like this would be simple, but how do I get it so when a user types
!prefixIt changes the prefix to their input πIts probably very simple
@gray zealot
ty
π
Generally what you would do is have a map with key being the server ID and the value being the actual prefix
on sent message, get the message guild ID and check if it exists in the map
π¬
also, should store that in a database
hi. can some1 help? I wanna do sth like track Invites. Now i wanna know how i do like on the guildMemberAdd event how i see who invited the person.
Discord.js 12
@sterile minnow still need help. if u know sth pls ping
no, just logging info before the error.
wasnt awaiting adding something to the database, so it was running two creates of a user
dumb mistake
How to create a channel? Tell me the syntax please for perm overrides
What is the proper way to get a random voice channel?
yes
message.guild.voice.channels.cache.random() ?
message.guild.voice represents the bot's voice session. You'd need to filter the guild.channels.cache collection for only voice channels, then call the random method.
beat me to it lol
fast fingers
How to create a channel? Tell me the syntax please for perm overrides
@earnest phoenix #ReadTheDocs
how come everytime i try to install quick it comes out with a error
The error likly says whats wrong
bit hypocritical, amazarisf
@earnest phoenix #ReadTheDocs
@still merlin #IAlreadyDidAndMyShitBrainSucksAtUnderstandingStuff
ok
Are you using Discord.js
Look at the docs for guild.channels.create for the structure
Hi
@earnest phoenix did you install node.js and discord.js
You gotta install both
Go to your terminal app and do npm install discord.js
Npm install discord.js-light
help me
discord rigenerate any sec my discord bot token
Npm uninstall discord.js
i don't know why
@earnest phoenix did you use the terminal app to start the code?
does anyone know how i can change the color of these button like this:
using css
i tried but no changes
@opaque bolt css
how exactly did you try?
i tried but no changes
how exactly did you try?
i added a button with html and css
but it is only in the text box
@earnest phoenix ok close vscode and go to terminal and do cd Desktop also make sure to have a folder created on your desktop called the bot name
@earnest phoenix you need a token
he doesn't want it 
I told you that you need one
@earnest phoenix did you use the terminal app?
Yes use cmd and do cd Desktop
@earnest phoenix ok if cmd is in the folder now do code .
Ok do code .
Wait no
Ok nvm do npm init
My bad
@earnest phoenix
Now hit the enter key for all the questions
Now do code .
always quals ture. why?
What file did you put the code in?
package.json???
always quals ture. why?
@hazy jungle what is always true?
what? why
and why aren't u using else if?
yyes...
@earnest phoenix https://discordjs.guide/ that will help
thats not code
@earnest phoenix did you use main.js for the code?
Go to that file and do node .
Bro
Rename main.js to index.js and try it again
Its looking for index.js
He didn't save his package.json, that might be the case why it searched for index.js instead of main.js
I run my bot in 1 file lol
ctrl s
And cntrl q to quit
I run my bot in 1 file lol
@fallow sentinel
Is there a way to check if 2 or more items are the same in an array? Without if stacking
Is there a way to check if 2 or more items are the same in an array? Without if stacking
@tulip ledge https://stackoverflow.com/questions/7376598/in-javascript-how-do-i-check-if-an-array-has-duplicate-values

wdym
Sa
function hasDuplicates(array) {
let amount = 1;
let valuesSoFar = Object.create(null);
for (var i = 0; i < array.length; ++i) {
var value = array[i];
if (value in valuesSoFar) {
amount++
return amount;
}
valuesSoFar[value] = true;
}
return false;
}
This is slow af
It takes like 2 seconds to return a value
Like command trigger on a user reaching a number of invites?
Idk
I'm not exactly a skilled dev
Sa
@tulip ledge try
function hasDuplicates(array) {
return (new Set(array)).size !== array.length;
}
you would need to save every user that invited a user and im not sure how to do that tbh
then you would need to watch every user for passing a certain amount
@earnest phoenix
This might have the amount of joined people from a link
^^^^^^
i believe it does, along with timestamps of the links creation and when they're supposed to expire/weather they're expired or not
Ah oke, never used it
Just look at the link properties
@ebon kelp That is faster but i need to find wich one is duplicate and how many duplicates there are (it's for a slot command)
Just look at the link properties
@strange trout ah yes; .uses or .memberCount
Mhm
hmm
it sends the question but doesnt get the awnser
:/
probably something with the commandhandler
anyone know a fix?
uh
ah ok
You're setting the user answer to a message object
Do message.content
Then slice off what's unneeded
function count(array) {
array.sort();
var current = null;
var cnt = 0;
for (var i = 0; i < array.length; i++) {
if (array[i] != current) {
if (cnt > 0) {
return [current, cnt]
}
current = array[i];
cnt = 1;
} else {
cnt++;
}
}
if (cnt > 0) {
return [current, cnt]
}
else return false;
}
Any idea why this is counting wrong?
it should've said 2 π₯
thats cool but idk
Is there any way to get reaction on message by its emoji name? In d.js
I don't see the issue tim
you have a banana, therefore
cnt is now 1;
array[i] (kiwi) != current (banana)
AND cnt > 0 (true)
{ return current (banana) and cnt (1) }
The thing is
It also needs to return false if there are no duplicates
Wich doesn't work
if(i === 0 || current[0] === array[i]) {
current.push(array[i])
}
after the loop ends, check the length of current
or even better
to account for separated matches
How do I use awaitMessages?
do this
it just doesnt make sense in the docs
Actually it does
// assuming array = [banana,kiwi,kiwi]
result = array.filter(t => array.filter(x => x === t).length > 1)
// result is now [kiwi,kiwi]
@spare mirage ```js
let answer = await channel.awaitMessages(msg => {
msg.author.id === message.author.id
},{
time:10000,
max:1
})
Is there any way to get reaction on message by its emoji name? In d.js
@tulip ledge result will be an empty array []
@fast glen to react or to obtain it?
obtain it, there is already an reaction
message.reactions.cache returns a collection of reactions in a message
@quartz kindle
do I put the code here? ```js
let answer = await channel.awaitMessages(msg => {
msg.author.id === message.author.id
//code here
},{
time:10000,
max:1
})
Ok thanks I didn't knew that
Does anyone else have problems of rate limiting when using ytdl-core?
almost everyone that uses ytdl lol
ffmpeg sexc
am I still able to listen to a voice channel through my bot using discord.js v12?
imma remake this im too dumb
Tim, the stackoverflow guy
let filebin = fs.readFile(attachment.attachment, () => {})
attachment.attachment is the url to the attachment but its not reading, and it says that filebin is a void
can you read a url? I thought you could only do a local file
if (attachment.name.endsWith('.txt')) {
fs.readFile(attachment.attachment, function read(err, data) {
if (err) {
throw err
} else {
bin = data;
}
}
}
it says there needs to be a comma on the last }
attachment.attachmant? wtf
yes
it's attachment.url
no
uwot
they both work
the file protocol is still a local file
just in url form instead of path
readFile cannot read remote data, you need http for that
oh
or https.get()
what does it get?
okay
you can also use any other easier to use http lib
such as node-fetch, got, axios, superagent, etc...
it should
why i get this error ?
(node:10280) UnhandledPromiseRejectionWarning: SqliteError: database disk image is malformed
code :
let default_prefix = "$"
let prefix = await db.get(`Prefix_${message.guild.id}`) || default_prefix; //here
console.log(prefix);
your database is broken
let me test
i deleted it, and i got the same error everytime
urgh
which version of quickdb?
7.1.1
you prob should reinstall it or install an older version
what team
Pm me
Ok, so i solved that error, if i log the prefix i get the correct one but the bot don't run any command
this it the code:
module.exports = async (bot, message) => {
if (!message.guild) return;
let default_prefix = "$"
let prefix = await db.get(`Prefix_${message.guild.id}`) || default_prefix;
if (message.author.bot) return;
if (!message.member) message.member = await message.guild.fetchMember(message);
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
if (cmd.length === 0) return;
let command = bot.commands.get(cmd);
if (message.content.startsWith(prefix)) {
if (!command) command = bot.commands.get(bot.aliases.get(cmd));
if (command)
command.run(bot, message, args);
}
}```
One sec
@wheat jolt i just tested here and its not working for me also, maybe post an issue in the discord.js github or ask in their server
I use discord bot maker and just use the run script command most of the time so here was the code I was using for the server count
${this.getDBM().Bot.bot.guilds.array().length}
is dbm using discord.js?
yes
what version
then you have to use ${this.getDBM().Bot.bot.guilds.cache.size()}
you can also use .array().length
but why would you do that if you have .size()
thx
np
how can i check if the channel have the permission SEND_MESSAGES deny for everyone?
what lib
Can someone setup some webhooks for me n also show how π
If you want to manually create webhooks: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
what kind of webhooks tho
"webhook" is a general term to describe being sent data without asking for it
Basically I need like 5 one or memes another for gifs another for NSFW stuff and last of all animals
wtf why
For my server
hey its me again
you want your server to automatically post memes 24/7?
how would i properly assign something in a .then() block? i log the var and it returns undefined
fetch(attachment.attachment)
.then(res => res.text())
.then(body => bin = body)
it logged the console when i did console.log(body)
If you mean assign a variable outside the .then method, It's executed "later", which is likely undetermined when it'll be called. You could use async/await or have your code to run in the .then function instead.
you can await a chain of promises
var b = await a.then().then().then()
and it will still work
oh
Tim would it be hard to setup one if u have no clue what ur doing?
hovering over then shows 'any'
not hard
you can setup a loop that fetches random memes periodically
and resends them as webhooks
or even have a bot post them directly, but webhooks works too
could it be any bot
you want to make it to be used in more than one bot?
Yooo my bin command works
or even make it public webhooks?
Thanks tim
Clarify what u mean?
If I was to do it by a bot would it have to be one of mine?
yes
Would you mind just setting em up lol n record how u did it n then Iβll know how to
is there a chance that i can manually install quick.db
it is a pain in the ass like literally after an error it will throw another one
let me show u
ffs
npm ERR! errno 1
npm ERR! integer@3.0.1 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@3.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```
discord.gg/plexidev @slender wagon
thats not the error, show more logs
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use```
it does have lots of these
you dont have python installed
i did install it
ye
install windows build tools
i did
npm install -g windows-build-tools
i'll try it again
If that doesn't work try running it in a admin cmd
i always run it on admin
smort
(I reccomend enmap instead of quick.db)
Either is just fine
oh hey two
they're both the same thing, and both rely on better-sqlite3
i think i should switch to mongo
I couldn't find a way to install quick.db lol
Mongo is a better option
is it complicated?
kinda
Not really
ill help
i've just heard it is way better and faster
it is
How to delete some specific data from mongodb?
findOneAndRemove
its not way better nor faster, it depends on the use case
sqlite is...
l i t e
yes sqlite is meant for small stuff, but "small stuff" is still wayyy bigger than the average discord bot
head my shake
sqlite can easily handle databases bigger than 10gb and thousands of queries per second
OVERKILL IS THE BEST KIND OF KILL >:CCCC
lmao
x)
That'll do it
i always closed the terminal thinking that it was finished
Lol
x))))
well, lesson learned
yall wait for this message XD
can someone give me a crash course on xml
ty Tim
idk
aka: you dont
basically i want to learn front end
but jsjsjssj
front end is html+css+js
xml is old and nobody uses it anymore
and xml is more like json
i have β€3 and a learning attitude :D
use it on learning something else
use it on food
i dont need to pay for that
not yet :3
uhm i'm back
always with another error XD
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).```
Yikes
i'm unsure of what i should reinstall
Try removing node_modules and reinstalling
isn't that like the place with all the dependencies
No that's the place with all the node modules
@slender wagon npm rebuild quick.db
did you downgrade node?
no
wats better a normal help command or a page help command
Hey I need some help:
if(!levelColorDat.levelBar){
bar = "#E063FC"
} else {
bar = levelColorDat.levelBar
}
I am trying to check if someone has a certain field with the first if statement, however, it sends an error cannot read levelBar of null since there is no field, but the whole point of the if statement is to check for that. Anyway to check for it differently?
This is a mongodb field*
nvm i found a way around that
I think it is saying that levelColorDat is null and you cannot read property levelBar of null
yea thats why i was trying to check for that with the first if statement
would this work:
const bar = levelColorDat.levelBar.catch(() => {
bar = "#E063FC"
})
rip also didnt work
Sure
const levelColorDat = await levelCardCollection.findOne({ "userId": member.id })
mongodb?
yea
well it is returning null, can you show your model for levelCardCollection?
sure
the only thing I can see that might be an error is the " around userId
Oh thats fine
sorry I should be more clear
I purposely deleted it, basically my goal is if it doesnt exist, so if a user didnt save a levelBar it would set it to a default hex code
Apologize for the confusion
yea I get that, I did a similar thing for my rank card
heroku @earnest phoenix
const levelColorDat = await levelCardCollection.findOne({ "userId": member.id })``` is what is returning `null`
@crimson vapor get rid of the ""
I assume that is because you deleted it so you need to do a js if(levelColorDat) { if(!levelColorDat.levelBar){ bar = "#E063FC" } else { bar = levelColorDat.levelBar } } else { bar = "#E063FC" }
not my code, I do not use "" in objects
Why and how would you make a parameter a string
I do not think it is the most efficient way to do it but it would work
:o
works thanks adorable number
np
Bruj
Yea, well everything else has been working with that
Well the more you know I guess
that format at least
Should I make a normal help command list or help pages?
How many money, a server computer? I wanna host my bot.. now my computer is a shit.
@earnest phoenix heroku for free
Up to you @still badge
@pure lion idk tho
depends on how many commands u have
Iβm aiming for 50+
if you have a lot, probably more efficient to do pages instead of one list
I have like 20-30rn
What's the package everyone uses for npmjs info commands
How can I fix this code?
const users = await message.guild.fetchBans()
for (const user of users.array()) {
await message.guild.members.unban(user, { reason: "reason" })
}
the console error is Uncaught Promise Rejection Error [BAN_RESOLVE_ID]: Couldn't resolve the user ID to unban.
Did you
I'm kind of a noob at these things :/
read
Use a if(!ban)return or smithing
Jeremy what does everyone use for npm commands
idfk
@misty sigil didn't work
btw i'm trying to unban all the users that have been banned in a guild
why would you want to do that?
what why
did you report the person and/or bot that did that?
?wouldnβt that be api abuseΒΏ
i searched it up and uh some other guy did it lmfao
that's where i found the code
and uh idk
ah
oh god, copy paste without understanding yay 
yes 
@earnest phoenix try starting and learning some js first then start slowly building ur dreams bot
i do know some js ;-; but okay
Do you have a token?
@misty sigil do u need an Spotify API
ok
what language and library
thatβs not what I meant by language
And wdym by application bot
js is the language
@misty sigil do u need an Spotify API
For album and song stats
from someoneβs status?
No
no idea on that
probably donβt need canvas
I donβt know @earnest phoenix
and probably yes @still badge
Ok
@misty sigil how can I make it?
@earnest phoenix make a command that dms and then listen to dms in that dm channel I think
@earnest phoenix Can you please not spam?
Also that. Once is enough for us
Is there a header option with message embeds in v12? Wondering as I want to set a header.
wdym header?
Like something that appears at the top of an embed, before the title.
setAuthor
Thanks.
Okay, that works. Now I need it to show the author display name, so how do I do that next lol
message.author.displayName?
Did that with only a undefined to exist in its place.
Ah that might help.
i accidentally put author lmao
and it should work
if there's no nickname it'll just put the member's username in its place
const collection = db.db(config.database).collection(config.collection.levelCard);
await collection.updateMany( {}, { $rename: { "levelColor": "levelBar" } } )
Would this work for renaming levelColor to levelBar in all documents in mongo db?
Yay!!! I just got my first premium subscriber, I'm on cloud nine 
Thanks π
mhm
ayy :D
Now I need to put the author avatar in there, how do I do that? I did member.displayAvatar and member.avatar, but unsure how to add it.
https://gyazo.com/20a7d0e1c75b7eff8626523a36db92ca
data.snipe = `${message.content} |,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,| ${message.author.tag}`;
I use mongodb
idk why the bot save |
i want |,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|
:c
I do that in snipe command:
let separador = data.snipe.split('|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|')
let embed = new Discord.MessageEmbed()
.addField('Mensaje', separador[0])
.addField('Autor', separador[1])
what
wat
you are splitting on it lol
"a@@@@@@@@@@@@@@@@@@@@b".split("@@@@@@@@@@@@@@@@@@@@") = ["a","b"]
if you want to display the separator, dont split
So this is the second time I've encountered this issue (first with Python now with PHP and on two separate machines). Whenever I try and do stuff with Discord (in this case using CURL/PHP to get an avatar url from Discord) I get certificate errors (Error in question: Curl error: SSL certificate problem: unable to get local issuer certificate).
Tried manually installing the certificate as recommended here: https://github.com/Rapptz/discord.py/issues/4159#issuecomment-640107584 but that doesn't help. Tried updating Open SSL (currently have version 1.1.1) as recommended later down in the thread https://github.com/Rapptz/discord.py/issues/4159#issuecomment-650508443 but that doesn't help either. I'm aware the links have to do with d.py rather than PHP but it seems the root issue is the same. I believe I fixed it last time on my server (the other machine I had the issue on) but I really don't remember how. Any ideas?
on windows or on linux?
Windows
dumb question, but is the system date and time correct?
Date from Windows itself? Then yes
just checking, as thats the number one cause of ssl errors lmao
you're making a curl request directly to discord correct?
through php hosted on windows
characters, not counting spaces and new lines afaik
Yes. Just making a request to https://discord.com/api/users/IDHere decode it get the avatar hash and put it into a link to get the avatar.
Openssl is already enabled in the php.ini file. Am using the same script on a different website which runs just fine. As far mod_ssl don't use it on there and am using the PHP Server extension for VSC. Want to try with Xampp to see if it has the same issues but for some reason the entire site won't load when using Xampp
well another thing you can try
//Tell cURL where our certificate bundle is located.
$certificate = "C:\wamp\cacert.pem";
curl_setopt($ch, CURLOPT_CAINFO, $certificate);
curl_setopt($ch, CURLOPT_CAPATH, $certificate);
with the file from https://curl.haxx.se/docs/caextract.html
or add the file path to cainfo in your php.ini
ayy
hi who has small commands for a bot that are cool ?
Still sucks that I have to go this round about way of getting it though.....
I made pseudo custom status:
await bot.change_presence(activity=discord.Game(name="something text"+"β "*100))
β β This Space is very important,It's a braille space.
Braille space is very useful:
- Can delete iphone's folder name.
- Can delete Microsoft's account's family name
what does it look like
braille space
what does it look like
@lost rover
what about the playing part?
What library are you using
I'm discord.py
I'm surprised it didn't just trim the leading whitespace
who would have the command to display someone's profile picture with my discord bot? under discord.js
<user>.displayAvatarURL
If possible to have the complete order, I begin ... @misty sigil
wut
?
I made a Electronic bulletin board
I already have the code to show the profile picture, but I would like to show someone's picture by mentioning it ? @misty sigil
message.users.mentions.first idk
Genuinely curious not intending to advertise plus itβs a 503 page but will someone test how fast this loads for them just got a new host and I wanna see if itβs good and I canβt because I have like 3MB/s internet https://vurighosting.com/
How fast was it
I put the code for the 503 there
Itβs not a response code
@misty sigil
Why I put the 503 is a long story
You from the US?
UK
Huh
Maybe Iβm just trying to find something to explain it when itβs probably just fast
Good to know
It must be good because it hasnβt suspended me yet for overusing my stuff
120ms
d
Basically im trynna add bots to some of my servers but the options are limited what can i do to fix it bcuz i want to add bots to someother server not only about 4
you need to have admin permission in a server to add bots there
I do its my server @sonic lodge
But for some reson top.gg has started limting the server you can add bots to
did you read it
there's a big blue button too

?

