#development
1 messages · Page 1134 of 1
incels gon be incels
if(bioStatus > 3) return message.channel.send("To much words")```
First of all Engrish. Second of all that's not how it works
I have the bot takes the args, but I want it that if the args has more than 3 words, it will return
any help
Does VS have a compiler?
It's not a number
VS is an IDE
That code hurts md
huh
that'll be 50 dollars

let bioStatus = args.slice(2);
if(bioStatus.length > 3) return message.channel.send("To much words")
https://plorany.please-fuck.me/AcDxq7.png
quick.db oh f..
Thank you @golden condor
You needed to check the lebgth of the array
@earnest phoenix your not funny, to let you know.
npm install --global --production --vs2015 --add-python-to-path windows-build-tools
npm install --global --production --add-python-to-path windows-build-tools node-gyp
I've tried these commands
I didn't explain how to join them tho lmao
YeAh vErY fUnNy
not to brag but yeah im funny im on the starboard 😎
Same
@earnest phoenix npm i -g windows-build-tools
@earnest phoenix integer 1.0.7 is very old and outdated
you're trying to use an old version of something which is not supported anymore and not compatible with current node versions
most likely an old version of quick.db, enmap or sqlite
what version are you installing? sounds like an old version
I don't know what version I have installed, I am just doing what I am told. I'm a little newbie
lmfao
install npm packages on system32 to make your windows faster :^)
help i dont know why but it cant get the guildID it says udefined but it is clearly there
code: https://hastebin.com/liqenadego.js
schema: https://hastebin.com/higatefula.js
https://imgur.com/a/8E46ixQ
Await queries
Gay xd
oh tim i stopped clearing reactions and re-applying them in my reaction menus like you said, and its been a great success so far!
i reduced the restTimeoutMs value by like 300ms and havent gotten ratelimited since
It's null
code?
Not enough trace back
so i have this code, if the guild is in a blacklist no commands work but if guild is not blacklisted i want everything to work fine but i get this error
code: js await Blacklist.findOne({ guildID: message.guild.id, }, (blist) => { if(message.guild.id === blist.guildID) return; console.log(blist.guildID); });
error: TypeError: Cannot read property 'guildID' of null
TypeError: Cannot read property 'then' of null
at Client.<anonymous> (C:\Users\Muslum\Desktop\app\bot.js:390:39)
at Client.emit (events.js:327:22)
at MessageCreateHandler.handle (C:\Users\Muslum\Desktop\app\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\Muslum\Desktop\app\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:108:65)
at WebSocketConnection.onPacket (C:\Users\Muslum\Desktop\app\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:336:35)
at WebSocketConnection.onMessage (C:\Users\Muslum\Desktop\app\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:299:17)
at WebSocket.onMessage (C:\Users\Muslum\Desktop\app\node_modules\discord.js\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\Muslum\Desktop\app\node_modules\discord.js\node_modules\ws\lib\websocket.js:789:20)
at Receiver.emit (events.js:315:20)
my bot is not starting
@lusty spade you never finish the Query and already want data from it
wdym?
@earnest phoenix send the code not the error stack
blist is not defined and you call a if function inside your mongoose query
do something like
all commands :/
What he's trying to say is
const blist = await Blacklist.findOne({guildID: message.guild.id})
if(message.guild.id === blist.guildID) return;
Mongoose slow, use async
ok
no specific code from where the error comes from
@pure lion no he was using a If statement inside the query -> doesnt work. also it was async
two findOne?
Oh
two?
does anyone have a code for bee command?
Oh the most recen-
no
What???
look at the code u send
🥣
send line 390 from bot.js plorany
and i get a new error (node:3468) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guildID' of null
You need to check if it exists or not
@lusty spade log blist before the if statement
ima make a code that lets my token escape the eval cmd
If (no thingy) create new docc
also you probably want to add a way to have a fallback incase there is no Blacklist Document for the guild
Or you can upsert if you're editing
Yeah
does a document exist?
also you dont need to compare the Blacklist id with the guild id since it only returns a document if the Guild is blacklisted
either add a Boolean value to check or just check if the query returns something or not
Btw is the python syntax "if not foo" or "if foo not"?
ok
i need help setting up bots :(
i need help with my bot
SyntaxError: Unexpected end of input
[90m at wrapSafe (internal/modules/cjs/loader.js:1054:16)[39m
[90m at Module._compile (internal/modules/cjs/loader.js:1102:27)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:986:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:879:14)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)[39m
[90m at internal/main/run_main_module.js:17:47[39m
What is (square char)
it look like a ? in a box
You evaling?
no

your console font can't display the character
use windows terminal
it's so much better than using raw cmd
WSL2 support, proper font rendering and tabs
How to send message then embed?
now that you fixed rendering issues
you more than likely have a syntax error in your code
can we host unlimited bots if we upgrade to glitch pro???? PING ME ON ANSWER
i dont think you get how bots work
i mean there is no such thing as unlimited, you have to get a host and pay for how many resources you'll need
https://www.galaxygate.net/hosting/vps/ would be an example
you get access to an ssh where you can setup your bot hosting space
how many bots can we run??
depends
what is ssh?
secure shell
1
really??
a very small one
oh
how many you can host all depends on the amount of servers, channels and members your bot has
can anyone explain me how can I send timed messages??
forever
any ideas ^ @misty sigil @split hazel
What programming language are you using?
yes
when i added the code in the white oval the error showed up
he did I guess @earnest phoenix
they do? or am I just dumb
oh yeah they are
lol
that code is a copypaste mess
is that not the issue
changed it to client but still the same error
not the only thing
lmao
no they aren’t
i followed a tutorial
at least I think they aint
i followed a tutorial from CodeLyon
..
what’s codelyon
@open nymph In your code extra "," after "PLAYING"
no
don't help if you don't know how to or if you're inexperienced
you're doing the opposite of helping
yea there’s an extra ,
they said it was after the activity type string anyways
lol
oh nvm
dumb
yeah what steven said
https://oliy.is-just-a.dev/br4bs_5518.png Even the syntax tries to make this obvious

ah
They missing their }) for setActivity
no that's just what happens when you get a sixpack on your fingers from pressing ctrl c ctrl v too much 
You dont even need to define the type in that case
client.user.setActivity('with my code') will make the activity "Playing with my code"
pls add my bot xd
How to add message then embed?
someone need music bot ? :b
How to add message then embed?
@viral iris just .send("message", embed)
Thx
RichEmbed() still exists?
const embed = new discord.MessageEmbed()
Discord.js v12
oh srry
is there any discord.Bot attribute in dpy
const embed = new RichEmbed()
@pastel mural but i can use that?
That's because you're using v11 instead of v12.
oky thx
And if you're smart, you'd upgrade to v12.
Is there a way to edit a msg and remove the embed sent in it?
So for example const m = await msg.channel.send('text', embed); m.edit('text2');
hi
So for example
const m = await msg.channel.send('text', embed);m.edit('text2');
@earnest phoenix Try iirc it'll work
it doesnt work
but i was wondering if it is even possible to do
no?!
You can edit the embed itself but I don't think that you can remove it, or you can use the Message#supressEmbeds
what
You need to send it to their api
you can remove the embed
set the embed to null and it should work
if it doesn't work, well, that's d.js' fault
I said Message#supressEmbed will work
But with null I don't know if it'll work
yes but the embed is still going to be there in the message
suppression only tells the client not to display ot
it*
Yes but there's a supressed property
you can remove the embed by editing the message and setting the embed to null, don't know if it works with djs
Hey guys, Quick question, how can i verify my identity to discord? i'm uploaded and it said We are unable to verify your identity because the back of one or more of the documents you provided were missing. Please try again.
And now i want to verify again, the stripe page will say: Verification submitted
What should i do?
go ask in their developer guild
Stripe is the first check, discord does it own check
discord. gg/discord-developers
ask in there
cant send the invite since im a whitename
I can lol
How can i fix that?
It's working on eval but not working in a file.
how many bots can we run at a time in non-pro glitch
ANYone?
just asking lol
say if anyone know
how many bots can we run at a time in non-pro glitch
@wanton anvil
oh ok thanks
don’t run bots on glitch
at a time?? @honest perch
glitch is bad for bots
don’t run bots on glitch
@misty sigil this
Anyone???
@honest perch can we run as many as we want at a time??
no?
glitch doesn’t like bots
@wanton anvil depends on the resources
glitch offers very little resources, and a library like discord.js costs quite a lot of resources
oh thanks
I wouldn’t use glitch tbh
I use dpy
for anything rly
Does glitch support py
@quartz kindle can you help me 😖
Swift ruby a bunch lmao
glitch free gives you 512mb ram right? that should be enough for about 10 bots with 1 server each, or 1 bot with about 1000-2000 servers
well glitch blocked pinging services
Yeah
so you cant really run them 24/7 anymore
But they also allowed you to enable projects to stay up
No
You get 1000 hours a month now
That's for premium
aye
And you can keep some online
But only static sites can stay up
still dinnae recommend it
say can I use heroku??
it’s better than glitch ig
For py
how many bots can I run in heroku
same as glitch
Yes basically
can someone help me?
i need help to make like an invite in embed
like ,ivnite
,invite
and then it shows up in embed form
I assume you are using discord.py from your avatar
@earnest phoenix are you using py??
you're misunderstanding how bots work, a bot is just an account and hosting one means just logging in with the account and keeping the connection alive
how many bots you can host on a single machine varies from library, to language, to the bot stats
no, lol, i just thought the pfp was cool.
manoj^^
i use discord.ks
js*
Use MessageEmbed
i did but for inviting?
What
like
like this.
@golden condor
those are markdown hyperlinks
google how to use them
${client.commands.map(c => `${ayarlar.prefix}${c.help.name}${' '.repeat(longest - c.help.name.length)} :: ${c.conf.aliases}`)``` Is there a way to limit maping? Ex: Just 10 commands.
Yes
theoretically
And how please?
actually that's a collection isnt it
idk for that
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map I know with map on regular arrays you can get the index
slice(0, 10) ?
oh yeah that exists lol
Val? Or var?
var
Can you give an example of one of these commands?
wait
let scount = client.guilds.cache.size
message.channel.send('I am actually in ' + scount + ' servers.')```
here @solemn latch
Just making sure, you dont have a prefix on your bots commands?
wait
lmao 
You should really change to switch cases if your doing it like this.
or a proper command handler
i like how my script is rn
for maximum unspaghettifying
Thats fine, just know small errors like this will be more common
wait let me test the command
With no error messages
Yup
in discord.js embed objects how do i change the size which image :{} displays?
f
well it still don't work
aaa my chat is looking so messy
ah
also is there any way you can change the size images display in embed objects?
this is the embed:
let embed = {
title: "e",
description: "e"
image: {
url: "e",
width: 1024,
height: 1024
}
}
But the width and height properties don't do anything
i use MessageEmbeds rarely
bruh really
?
This is offtopic @jolly wave
is it even possible to change the width
or height
of images in embed objects
welp I can reblock you
just don't mind me if u want
Go to #general if you dont want to talk about development
yep
@earnest phoenix one of your bots in your github has 1.5k lines
smh not following rules is not being a kid
you cannot modify the size
Anyway I'm out
you cannot modify the size
f
you can't modify how anything is displayed to the end user
wtf
so
i need to change the size of the original image then?
sure but it wont matter that much
the client resizes the elements according to the windows width and height
and large images get scaled down
sure but it wont matter much
nothing is worse than your pikachu looking smol
@earnest phoenix one of your bots in your github has 1.5k lines
@earnest phoenix it is my only bot
and it is now 2k lines
im gonna backup my code tomy github
you can increase the size of the original image and it will be a bit bigger in this case
but there is a size limit above which discord will simply resize it
consider using waifu2x for that
upscaling normally, you would lose quality
i am using an API so i can't resize anyways ðŸ˜
download all of the images, resize them, upload them to discord
:wesmart:
^ i use discord as my cdn
because i update them from time to time
the bot automatically will get the new set at the next startup
well you need to paste them in there right? Wouldn't that be the same as... pasting them into a config file?
discord is the cdn, id have to go back and get the link for each one
then save it to the config file
But you can't save them to the drive?
Do you use d.js?
yeah
do you just send the link or put it in an embed
i put the link in an embed
then it's downloading and uploading...
???
yeah, double checking
Wait, I have it backwards I think 
Simple check would be to send the image and see if the url is the same 
I wonder what I'm thinking of then 
if it did that, i actually would have been excited.
each file is rather large(roulette is actually my least efficient command file size wise, even with huge amounts of compression)
it would have meant my vps is faster than it should be

the internet on my vps*
Imagine that :P
I must've been thinking of local files being converted to streams or something
tim says the djs code is sometimes really wtf.
so i actually believed they might have done that
so, yes, i even checked the github.
lol
.setImage('attachment://sample.png'); something like this I'm guessing is where my mind was going

That's old code though no idea if it works lol
🤔
looks like it does
client.on("message", message => {
const thisWord = "Hey";
if(message.content.includes(thisWord))
if(message.author.bot)return
message.channel.send("Hey whats up")
})```
Why it is replying to all messages
.includes
?
also your not doing anything
With the top if statement
if () {
code
}
UnhandledPromiseRejectionWarning: ReferenceError: RichEmbed is not defined, i don't understand...
is it defined
?
is it defined
@sudden geyser const Embed = new RichEmbed(), i think yes
okay so where did you define RichEmbed
const {Client, RickEmbed} = require('discord.js')
RickEmbed =/= RichEmbed
ah lol
pretty much woo
ah ok got something messed up myself then
It is MessageEmbed in v12 borb
ohok
https://i.callumdev.pw/uddh5.png
https://i.callumdev.pw/bozdh.png
https://i.callumdev.pw/t8rcz.png
dk why this returns false, as I have voted!
dont you need to authenticate to use that endpoint?
^ yes
why am I so dumb lmao, thanks
How am I supposed to check if a user has server dms on or off?
hmm
yeah, im not seeing where you can see that
how should i do a bot with a automated request/buy system?
Well you'd get a missing permissioms error if you cant send
thebeast can you show your code
Otherwise, there'd be no error
i thought it would be a missing access error for not being able to dm a user
no wait, thats not right.
missing permission for attempting to dm a user you cant
const allcmdshelp = new Discord.MessageEmbed()
.setColor('RANDOM')
.setTitle('All commands')
.setDescription('Ok, Dmed all commands to prevent clutter in chat')
.setFooter(client.user.username,client.user.avatarURL());
let a = await message.channel.send(allcmdshelp);
try {
message.author.send(moderation);
message.author.send(general);
message.author.send(fun);
message.author.send(actions);
message.author.send(music)
} catch (err) {
message.channel.send(`It seems I couldn't DM you, Do you have server messages on?`)
}```
missing access for getting a user you dont have access to
do you really need to dm the author 5 times
and you need to await those .send() calls
as they're async
..
js handles numbers like booleans tho
👀
more like... 0 is not a truthy value, so it's false
"" is also not a truthy value and so "" == false is true
yeah but in this case scenario they're handled in the same way as booleans
in practice, it acts as a boolean
he question is, are they the ones who are setting it to 0/1? or they receiving that data from somewhere?
it makes more sense to set them to true or false, but a lot of API's work with 0/1 too
as long as its 0 or 1 it should be fine then
if he has to match 0,1,2,3 specifically might run into issues

@earnest phoenix you should probably concat those if they are strings or merge the object properties
^
yeah it completely fine then
fuck me, gonna have to type 5 essays worth of text now to update my docs -.-
o?
@earnest phoenix you should probably concat those if they are strings or merge the object properties
@opal plank Like message.channel.send([moderation, general, fun, actions, music]) ?
Are those embeds or strings?
im assuming its an embed
then you'd need to either loop them or make a single one
let obj = new embed;
for ( keys in object) {
obj.push(key)
}
something along those lines
just to get a gist
either way i gotta move now, got a lot of stuff to do
you're up feud!
You could make a reaction menu or have a command like help moderation and send a specific embed. I don't think sending 5+ embeds is a good idea
You could use a single embed, but you are then limited to only 25 fields
can any1 help?
Depends on how you are structuring your help command
im making a welcome thing
async def on_member_join(member):
channel.send(wc)
await discord.utils.get(member.guild.text_channels, name=welcomemsg)```
on_member_join
channel.send(welcomemsg)
NameError: name 'channel' is not defined
thats the error
it should be pulling from a json file
await?
yes
You could use a single embed, but you are then limited to only 25 fields
@cinder patio and i need to add 101 feilds
await
?
@earnest phoenix you're doing if NO author.id EQUALS id
async def on_member_join(member):
with open('welcome.json', 'r') as f:
welcome = json.load(f)
channel.send(wc)
await discord.utils.get(member.guild.text_channels, name=741482536961835009)```
await channel.send
i tried
instead of if author.id NOT EQUALS id
name... not id
for example
{
"740715653295767562": "#741482536961835009",
"666016790140157992": "#724813075320143964"
}
I think
this is what it is
ok Idk xD
!= lmfao
!=
Please help me, how to use edit in discord.py?
!= for loose
!== for strict
you dont need tim for that give some of us the questions 
the docs are pretty good
@earnest phoenix , then I suggest using a reaction menu, where you have to react to certain emojis to change the embed in the message, or a help command which takes one argument like moderation or fun and you show the moderation or fun embed
like this is it now
async def on_member_join(member):
with open('welcome.json', 'r') as f:
welcome = json.load(f)
channel.send(wc)
channel = {wc}
await channel.send('welcomemsg')
im really confused\
what about the menu thing? it is in discord.ext
@earnest phoenix , then I suggest using a reaction menu, where you have to react to certain emojis to change the embed in the message, or a
helpcommand which takes one argument likemoderationorfunand you show themoderationorfunembed
@cinder patio YA
I might
https://discordpy.readthedocs.io/en/latest/api.html?highlight=edit#discord.Message.edit
@solemn latch yes but
i neeed programming of customisable prefix
can you can give
nein
i am doing with discord development
?!
how i can make economy bot
@drifting wedge
- You didn't define
wc - You didn't define
channel - You didn't await the .send part
quick.db is easy though
@misty sigil is there an alternative for python
sqlite3
yes
ah
@slender thistle
then @client.event async def on_member_join(member): await client.get_channel(wc).send(f"{welcomemsg}")
would this work?
What is it defined as?
@spare robin you need persistent data storage, such as a database. there are some pretty easy ones to get started with such as quick.db (https://www.npmjs.com/package/quick.db) and it is as simple as setting and retrieving values
you didn't open the file
Show your full code please
you have to open, then get the info, then close
@client.event
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
await client.get_channel(wc).send(f"{welcomemsg}")
then this is what i have
wc isn't the same as wchannel
What's welcomemsg
How exactly do you get it in the code
@client.event
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
with open('welcome.json', 'r') as f:
welcome = json.load(f)
await client.get_channel(wc).send(f"{welcomemsg}")
?
How do I make a guild specific thing happen? Like if someone said !logs (channel) then logs would appear for that channel for that guild
welcomemsg won't be defined in that snippet
@karmic compass what lib?
Disc.js
@sinful belfry i am making from this application
You have wchannel and welcome defined, but in that code, you don't define welcomemsg
you can get the guild id from the message object and work from there @karmic compass
oh
identify the guild like that
Where do I store the data?
ummm
@spare robin never used that before, so im not entirely sure
json file @karmic compass
ooh no
more anyone
same thing
welcome = ... and wchannel = ...
quick.db got it
please tell me
wait wut
@sinful belfry i am making from this application
@spare robin
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
with open('welcome.json', 'r') as f:
welcome = json.load(f)
await client.get_channel(wc).send(f"{welcomemsg}")```
i ddint define anything
i jsut opened the jsons
@spare robin i have honestly never used that before
@drifting wedge i can used programming in my mobile
idk lol
i suggest to ask in their support server, if they have one
You are parsing the file content as JSON twice. I suggest you make a data variable value of which is json.load(f) and then just use data[x] to get the welcome message
Hi.
can i can do in mobile programming
How could I push data into an array mongodb?
you can use the $push operator
updateOne with
@slender thistle
ffs Starman
lmao
welcome json is the welcome msg
pleae
Both welcome and wchannel are literally same JSONs (dictionaries)
They don't contain a specific guild's settings
sounds like a json DB.
1 sec
Wait, so like
const Guild = require('../../blah/blah'):
Guild.updateOne({ id: message.author.id }, { $push: { warns: {userid: message.author.id, reason: args.join(" ") }});
wchannel: { "740715653295767562": "[#741482536961835009](/guild/264445053596991498/channel/741482536961835009/)", "666016790140157992": "[#724813075320143964](/guild/264445053596991498/channel/724813075320143964/)" }
Shivaco smthg like this? ^^
welcome: { "740715653295767562": "welcome (user)", "666016790140157992": "welcome (user)" }
and it can be set to whatervwe
Wait, so like
const Guild = require('../../blah/blah'): Guild.updateOne({ id: message.author.id }, { $push: { warns: {userid: message.author.id, reason: args.join(" ") }});
@pine aspen that looks fine, give it a go i guess
the welcome message can be whateve
but the (user) thing is bugged
why are channels mentions instead of ids
How's it bugged?
yourstring.replace("(user)", member.mention)
some other guys said it has to be a int
It gets converted into a string in the end anyway
A mention is a string, an ID in d.py is an integer
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
with open('welcome.json', 'r') as f:
welcome = json.load(f)
{welcomemsg}.replace("(user)", member.mention)
await client.get_channel(wc).send(f'{welcomemsg}')```
so this?
it pulls both jsons
Again, welcomemsg doesn't exist
?
you have welcome that loads the welcome messages but you don't have a single variable named welcomemsg
.replace returns a new string, so you'll need to re-assign a value to it
MongoError: '$set' is empty. You must specify a field like so: {$set: {<field>: ...}}
def changewelcomemsg(client, message):
with open('welcome.json', 'r') as f:
welcome = json.load(f)
return welcome[str(message.guild.id)]
@client.event
async def on_guild_join(guild):
with open('welcome.json', 'r') as f:
welcome = json.load(f)
welcome[str(guild.id)] = '.'
with open ('welcome.json', 'w') as f:
json.dump(welcome, f, indent=4)
@client.event
async def on_guild_remove(guild):
with open('welcome.json', 'r') as f:
welcome = json.load(f)
welcome.pop(str(guild.id))
with open('welcome.json', 'w') as f:
json.dump(welcome, f, indent=4)
@client.command()
@commands.has_permissions(manage_messages=True)
@commands.has_any_role('welcomeperms', 'adminperms')
async def changewelcomemsg(ctx, welcomemsg):
with open('welcome.json', 'r') as f:
welcome = json.load(f)
welcome[str(ctx.guild.id)] = welcomemsg
with open('welcome.json', 'w') as f:
json.dump(welcome, f,indent=4)
await ctx.send(f'welcome message changed to: {welcomemsg}')```
welcomemsg is the message set by the user
and welcome is the json file

MongoError: '$set' is empty. You must specify a field like so: {$set: {<field>: ...}}
@pine aspen
Can't see welcomemsg defined anywhere still
@pine aspen can you send your code please?
{welcomemsg}.replace("(user)", member.mention)
NameError: name 'welcomemsg' is not defined```
yep you were right
const Guilds = require('../../models/guilds');
Guilds.updateOne({
id: message.channel.guild.id
}, {
$push: {
userID: message.author.id,
reason: "test"
}
}
);
@client.event
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
with open('welcome.json', 'r') as f:
welcome = json.load(f)
channel = wc
await channel.send('welcomemsg')
'{welcomemsg}'.replace("(user)", member.mention)
@pine aspen where are you trying to push that to?
json db#?
theyre .json files
To an array
can you send an image of the database document?
Sure
no syn lol
Easy 
{
"_id": {
"$oid": ""
},
"id": "",
"prefix": "",
"premium": ,
"__v": ,
"autoRole": [],
"warns": [],
"blacklist":
}
To prevent any data leak
soz
Client mods 

client mods 
ok you need to do { $push: { warns: {authorID: aaa, reason: aaa } } }
because you're pushing to 'warns'
yep
:o
official mongodb too afaik
^
Sexyyyyyyy
look this is what i have
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
with open('welcome.json', 'r') as f:
welcome = json.load(f)
channel = wc
await channel.send('welcomemsg')
'{welcomemsg}'.replace("(user)", member.mention)```
const Guilds = require('../../models/guilds');
Guilds.updateOne({
id: message.channel.guild.id
}, {
$push: {
warns: [
{
userID: message.author.id,
reason: "test"
}
]
}
}
);
so this?
it's an array?
Pushing array into array
also how can i make it so the user can turn off welcome messages?
a database
json databases are the worst
MongoError: '$set' is empty. You must specify a field like so: {$set: {<field>: ...}}
back at this though
Json "databases"
which are good then?
what are good database options?
i'm getting errors trying to install quick.db
it has some dependancies, check the troubleshooting guide
ok
constructor(client) {
super(client, {
name: 'level-off',
aliases: ['loff, levelsystem-off'],
group: 'guild',
memberName: 'level-off',
description: 'Disable the level system',
guildOnly: true,
userPermissions: ['MANAGE_CHANNELS', 'MANAGE_MESSAGES']
});
}
Why users with no permissions can still use it?
Where else are you using userPermissions
what libs are you using?
@solemn latch d.js v12 and Commando
Where else are you using userPermissions
@pure lion just in this
just someone pls help
how can i define welcomemsg
?
its pulling from a json file
Code?
pretty sure thats a basic thing you do in python
async def on_member_join(member):
with open('wchannel.json', 'r') as f:
wchannel = json.load(f)
with open('welcome.json', 'r') as f:
welcome = json.load(f)
channel = wc
await channel.send('welcomemsg')
'{welcomemsg}'.replace("(user)", member.mention)```
Python, I'm out.
Learn basic python first
But why are you making a Discord bot without knowing basic Python?
^
But why are you making a Discord bot without knowing basic Python?
@slender thistle idk
learn python first
i will but i wanna do my bot first
good luck
ill do html first tho
lmao
i have a vr class
??
Then code bot after learning basic py
That's not exactly a valid reason, you'll be struggling a lot more if you maintain a Discord bot without basic knowledge of Python
@fringe axle im really not sure why anyone would be able to use it
whats the error
the problem is what your using .id on is undefined
whats your code?
const { Command } = require('discord.js-commando');
const { prefix } = require('../../config.json');
const { MessageEmbed } = require('discord.js');
const fs = require('fs');
const Discord = require('discord.js');
const Canvacord = require("canvacord");
const db = require('quick.db');
const canvas = new Canvacord()
module.exports = class HelpCommand extends Command {
constructor(client) {
super(client, {
name: 'level-off',
aliases: ['loff, levelsystem-off'],
group: 'guild',
memberName: 'level-off',
description: 'Disable the level system',
guildOnly: true,
userPermissions: ['MANAGE_CHANNELS', 'MANAGE_MESSAGES']
});
}
async run(client, message, args, [target]) {
const user = message.mentions.members.last() || message.guild.members.cache.get(target) || message.member;
let levelsystem = await db.fetch(`levelsystem_${message.guild.id}`);
db.set(`levelsystem_${message.guild.id}`, 'off')
const userFlags = member.user.flags.toArray();
const embed = new MessageEmbed()
.setDescription('The level-system turned off')
.setColor('#ea6ef1')
.setAuthor('| Level System', 'https://cdn.discordapp.com/avatars/714745136122429491/e16289a6de8bd22fb433b1e029fe98e1.png?size=2048')
.setTimestamp()
.setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`);
message.channel.send(embed)
}
}
AttributeError: 'dict' object has no attribute 'send'```
Woo it's above xD
what does this mean?
learn python before making bots 🤔
xD
heya
Any idea why it's not working Woo?
Plis give mi credt
!givewoobux @livid plover
Plisss🥺🥺🥺
Yooo!
Did you read this channel's topic?
My game engine does||nt|| work
just making sure, is your quick.db usage correct?
Yes
Worked before.
Before I added permissions. xD
Any idea?
Wait
I'll try an if statement
you have a lot of unused dependancies
const canvas = new Canvacord()
const fs = require('fs');
const Discord = require('discord.js');
const { prefix } = require('../../config.json');
all are unused
and
const user = message.mentions.members.last() || message.guild.members.cache.get(target) || message.member;
let levelsystem = await db.fetch(`levelsystem_${message.guild.id}`);
const userFlags = member.user.flags.toArray();
are also unused
which, if levelsystem is unused, that means quick.db is also unused
Mentions.last, why?
.last lmao
Don't you wanna either do forEach() or first()
not like the order matters
a database
and getting/setting by userid
depends on the database you use
we cant choose your database for ya, its something you should do research on and make your own choice imo
🤔
async run(message, args, [target]) {
const member = message.mentions.members.last() || message.guild.members.cache.get(target) || message.member;
if(!message.member.hasPermissions("ADMINISTRATOR")) {
return message.channel.send("You don't have the permissions to use this command!")
}
let levelsystem = await db.fetch(`levelsystem_${message.guild.id}`);
db.set(`levelsystem_${message.guild.id}`, 'off')
const userFlags = member.user.flags.toArray();
const embed = new MessageEmbed()
.setDescription('The level-system turned off')
.setColor('#ea6ef1')
.setAuthor('| Level System')
.setTimestamp()
.setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`);
message.channel.send(embed)
}
}
does commando stop you from getting full errors?
that really is annoying
thats just a code editor
thats like saying, how can i draw a picture on paper
you need a database
preferably a database would be hosted
like i said, you should really do research on this
quick.db is a good sqlite3 wrapper
very simple
just db.set(message.guild.id, "prefix")
Lol
database
how to choose a database?
both Database Architectures have Pros and Cons.

usb's are extremely unreliable
i never tought i find something more stupid than a Json DB
LOOL
https://www.cs.rochester.edu/courses/261/fall2017/termpaper/submissions/06/Paper.pdf here's a non-bias comparative study between mongo (nosql) and mysql (sql) and some other db no one's heard about called BerkeleyDB
to be fair some OS only run of a USB drive. Unraid is a example.
hi
did you want to have the bot running locally all the time?
did you want to ahve the bot Running locally all the time?
SSD's are fine, probably should get a proper host tho
if you google, and do your own research, itll help a lot
and clarify a lot
Anyone?
async run(message, args, [target]) {
let levelsystem = await db.fetch(`levelsystem_${message.guild.id}`);
db.set(`levelsystem_${message.guild.id}`, 'off')
const member = message.mentions.members.last() || message.guild.members.cache.get(target) || message.member;
const userFlags = member.user.flags.toArray();
if(!member.hasPermission("MANAGE_MESSAGES")) {
return message.channel.send("You don't have the permissions to use this command!")
}
const embed = new MessageEmbed()
.setDescription('The level-system turned off')
.setColor('#ea6ef1')
.setAuthor('| Level System')
.setTimestamp()
.setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`);
message.channel.send(embed)
}
}
normally id be able to spot the issue pretty quickly, but because you dont have the full error, im not sure.
nice you broke your DB
Vale, are you using discord.js?
it expects a positive value but you get a negative one
I don't see <User>.flags anywhere in the docs https://discord.js.org/#/docs/main/stable/class/User
f rip db
overwrite all levels to be 0 and prevent negative levels
Unless you added that in
I only wanted to add permissions...
map them
You aren't even using the userFlags variable in the first place, why not remove it?
hes using commando tho
rip
yeah, i mentioned all the unused things
like half the lines in this code snippet are unused
user.flags exists, no idea why its not documented
Okay
That's weird
Do they have it ignored in their doc builder script?
https://oliy.is-just-a.dev/utyibr_5522.png fetchFlags exists