#development
1 messages ¡ Page 1772 of 1
One of the parentheses?
Mhm
Is it at the end of the embed part?
sendembed isn't even a useable method in the discord.ext.commands.Context object
and even if you're declaring it as a variable, you formatted the discord.Embed and are missing a ,
you have an indent error where member.ban(...) is and it will break the script
This is why fl0w is here to be smurt
you're declaring an embed description incorrectly, you would just do a kwarg description="..."
you aren't actually sending anything with the embed, you're only declaring a coroutine method to create a discord.Embed object
you're missing a ) for the end of it all
Ok
there are plenty of other issues, but those should be the first set of them to fix
Alr
https://i.callumdev.xyz/7qi6d.png
https://i.callumdev.xyz/5r6q2.png
Why is the message not showing when I hover on notice?
@lusty quest it might be worth for now using ur old repo instead of mine
and slowly building up to what i wrote instead
@opal plank are you still working on the example bot?
ye, wanna help?
lol
@crimson vapor just overall improving it with comments n shit
o
its suppose to be a noob-friendly example
easily deployable
im playing with the slashClient
this is pog im not gonna lie
slash commands are epic
pog
i've played with slash commands before , but this is a command handler for slash commands
o?
I wanna create one that can parse through Enums and such
The one I use as of right now cannot do that
everything in this world is an enum
@opal plank you wrote this code for the reload command?
its super hard to read at first glance
not confusing or anything
clear() to remove all commands
and addMultipleIn() to scan the folder
yea, isnt prettier supposed to make code readable?
ooo sooo pretty :)
:(
where is the spacing
its ur shitty colors that make it non redable
erwin is using good colors
^^
That is basically what I use honestly
"beginner friendly"
thats what the comments are for
you gotta also add spacing smh
agreed

i only add spacing with stuff thats not related
so i bulk the by relativity
theres no need to turn a single function into 500 lines when its only 100
beginner dev or beginner to detritus? or both?
detritus
evie is the one writing an idiot's guide for detritus
im just doing a very basic, well commented example that can be used
I never comment my code lol
cake's is the only one with a decent repo, but his syntax will absolutely destroy your brain
advanced wise
yw
ill remove it for you dw
I only give summaries when my IDE tells me about it lol
this color scheme is hotter
ehh
debatable
i personally dislike backgrounds like that
I dont like those backgrounds either
it looks better when there's totally not a selfbot running
Any javascript developers here that could tell me why the code that I commented out makes the function return undefined? Also yes I know this code is horrid but dont make fun of me.
cuz 100iq users come from djs screeching "but where is my message and args? reeeee"
hmmm
the parsedArgs are different than d.js
i added the message and args there so people have a reference
i even did a solid and did Promise<any> on the returns so they dont have to worry about types
probably, but between shit from d.js and bad habits once, im on the latter
wait
did that actually pass?
yes
oopsie
im removing it smh

i feel bad for the people who will come in here and think "oohw, what a cute girl". Yall dont know the verocius and vile anime yall looking at
good code, simply
ok so thats a mistake ig
this maybe?
Not too sure, I dont really program in java
@opal plank why did you duplicate code wtf
I made my bot from BDFD will i get help?
where?
where? the entire switch case
prob not, you should ask in their support server
you duplicated the command part
where?
I got banned
in the switch case for the reload
I like the way you make fun of Erwin's code :))
nothing we can do
its default or commands?
:/ ok
it had different stuff in my code
the switch is for specific ones
the default one reloads all
do you have stages changes?
effort
im cool
I think your issue may be your intent on returning from the function.
fetch(...) returns a Promise and you're using .then twice to manipulate the return type and value. However, in your second .then call, you're returning from the anonymous function passed, but not using the value from the overall promise.
So, return the value of calling fetch(...).then(...).then(...). You'll also need to await it since calling .then on a promise will always return another promise, even if the return value from the function passed isn't a promise.
yucko
@opal plank how can a message not have a channel?
yes
it was a type thing in detritus a while back
i think that was it
what do you mean yucko?
u yucko for not using gitKraken for versioning control and conflict fixing

Why would I use git kraken when things like VSCode or Rider have built in conflict managing.
VSCode doesn't have great support for Git built-in (unless you're using an extension but ew)
dude this shit always hurts to see
classes? yes
now that I think of it, its kinda annoying to have commands as classes
im trying to see a good alternative for the options
oh no :(
there is no intellisense for the functions
I don't see what's wrong with commands as classes.
cuz i want it to super() from the baseCommand
once upon a time I was trying to make my own command framework but I gave up because it wasn't interesting. This is what the interface looked like https://github.com/moedevs/discord-ahagon
Oh no
zero deps :^)
check detritus's command handling
its top notch shit
why do you need deps for a djs command handler
everyone knows bloat is a completely meaningless word you can safely throw around
@slim heart
kekw
Why?
It's a meme
Ok
stay in the immutable game
bloat is less about performance issues and just throwing shit in youâll never use making things scattered and complicated
people that use create-react-app ^
I quite liked this
const commmand = {
// ...
effect: (ctx, args) => {
const start = new Date();
console.log(`${ctx.message.member} used ban`);
return (bannedMember) => {
const time = new Date() - start;
console.log(`Banned ${bannedMember.user.username} in ${time}ms.`);
analyticsLibrary.send(time, { command: ctx.command.name });
}
},
run: (ctx, args) => args.target.ban(args.reason)
}
the same way React.useEffect works
what
except they're never reused
ok fair enough
you create a new class for every command lol
^
i can't argue that part
also they donât need to be classes to be reused either lmao
i think command classes are good if you use like numerous prefixes
huh
or need a bot that works with both slash commands and its own prefix
const cleanup = await effect()
const data = await run()
await cleanup(data)
discord-rose only has object commands and u can add slash commands in with the same func as message commands
prob not TS or JS though
thereâs no diff and shouldnât be really
berry I didn't bring you here to talk about discord-rose smh
what's the point of creating a new class for every command lol the whole point of classes is that you instantiate a class to represent a command
too late
to prevent having to re-write code and stop repetition
you have one command class and you create an instance of it to represent a command
thats why its extending it
Since I started doing discord bots I've followed a weird command thingy
who wanna trash me
but a class already does that
thats the whole point
instead of rewriting functions for the handler over and over, its easier to just pull it from one place with super() and extend
ye
creating a new command context esc instance is fine for example but creating a class for a static command is dumb
A class is useful for many activities, one of them being state. A lot of users don't need state with their classes or have other methods of holding state (varies across languages), but the best way to learn when to use classes is to program in another language (e.g. functional).
import { Message } from 'discord.js';
export const command = {
desc: '',
name: '',
args: '',
alias: [],
type: '',
run: (message: Message, args: string[], client: InsertBotClientClassNameHere) => {},
};
đ
master class + extending is a very organized way of doing stuff
^^
why even pass client? just use message.client
if you're really obsessed with OOP though yeah sure
You're joking right million
but most of the devs in here are functional programmers
export class Meme extends Command {
constructor() {
super(commandData)
}
run(data) {
f(data)
}
}
vs
export new Command({ ...commandData, run: f })
yes
why would he
yes
No, they're not.
rather than re-writing the handlers for each of the commandHandlers function, just extend them
weary
oh yeah thats a thing iirc
i just
export default {
command: 'ping',
exec: (ctx) => ctx.reply('pong')
} as CommandOptions```
client is everywhere
and the way detritus works is by importing whatever default object/class u give it
yes lol
all of these could just be object parameters
no you don't just have one function that spreads an object into a default object
its much easier to just extend it and pass the run()
export default { ...baseCommand, ...customCommand }
all the behavior is still there
Xet's got a point
you could, yes
ofc in practice it would be more like
export default makeCommand({ ...baseCommand, ...customCommand })
so you can add custom behavior to how commands are constructed
but then again, extend it would work just as fine
I just hate classes lol this is the worst thing added to js and classes are so verbose
write in php instead
I just arrived, but...
If you want to update your bot or disable a command/section, do you prefer it to all go down and restart or just the one command/section?
classes should be used when youâre making many of something that needs different instances. commands are things you define once and use so why class
so much
write in C++ isntead
what's wrong with normalizing classes apart of your code?
how has the class syntax made working with this easier?
arrow functions yes but class doesn't change the way this works
i mean it feels really preferential at that point to use classes or not
it's a way of organizing code
cuz you dont have to re-bind that shit everywhere, as long as you're inside of a class, you know it refers to the class itself
and it stops there nowadays
before used to be a pain to rebind it
Until you have to build your TS code into JS and can get variable sized files based on using functions or classes.
you already didn't have to do that with the prototype syntax. Binding this depends on how you call the function from the outside
compile moment
well yeah, you right
const func = classInstance.method;
func()
is gonna blow up whether you have class or not
not a class issue then @round cove
but factory functions on the other hand
const func = regularObject.function;
func()

friendship with this ended, now makeThing is my best friend
how does it blow up
if you're still able to call it the same way then it should be fine no?
i mean, i guess i could, but then again, delcarations doing it that way would be a pain imo
having the classes already provides ts with the declarations of the types
why do you have to declare slash contextualized parameters through an interaction dict
that's cringe
because u dont have to change existing message commands
rather than coding the same thing twice
its just an easy drop in to support them
aren't you still having to change how the class is exported though
interaction is just the raw interaction data
to recognize interaction creation
hm?
how would i add an embed to this, like it sends an embed saying that they have been banned
oops
either way, how would i add it, since i want a kick message too
Yea, I told him earlier that checking docs/google are the best things to use.
Different question I believe
he did this earlier with the ban command

Yo bois
???
const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
client.request('SET_ACTIVITY', {
pid: process.pid,
activity : {
details : DESCRIPTION,
assets : {
large_image : "image-1",
large_text : LARGE_TEXT
},
buttons : [
{
label : LABEL,
url : URL
},
{
label : LABEL,
url : URL
}
]
}
})
})
client.login({ clientId : CLIENT_ID }).catch(console.error);
This is giving me this error (I replaced the values with placeholders here)
Error: connection closed
at IPCTransport.<anonymous> (/node_modules/discord-rpc/src/client.js:118:16)
at Object.onceWrapper (events.js:418:26)
at IPCTransport.emit (events.js:311:20)
at /node_modules/discord-rpc/src/transports/ipc.js:141:18
at decode (/node_modules/discord-rpc/src/transports/ipc.js:92:5)
at Socket.<anonymous> (/node_modules/discord-rpc/src/transports/ipc.js:120:7)
at Socket.emit (events.js:311:20)
at emitReadable_ (_stream_readable.js:562:12)
at processTicksAndRejections (internal/process/task_queues.js:83:21)```
word of advice, rpc is deprecated
What are we supposed to use instead?
sdk
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
Got it đ thanks
??????
How to make a leaderboard with a quick.db database ?
let votes = db.fetch(`vote_${member.user.id}`);
To make a top of the people with the most votes
they shall take #general , but #development is forever mine and @quartz kindle's
cough
you'd need to use an aggregator or a group by clause, check quick.db docs on that
Oh ok
I'm 99% sure quick.db doesn't have that capability.
then return everything and parse in code
A solution would be to fetch all entries and sort, but that isn't a great solution.
give me an immutable database or give me death
let keys = ['2hundred of these', 'it is just too long to show']
if (window.location.hostname === keys[0]) value="yourcodehere";
if (window.location.hostname === keys[1]) value="yourcodehere1";
hi so i am trying to do something since i got like 200 domain names. I want to do the if check 200 times but it is just stupid to do it like that and there should be something else.
Meanwhile each value will be different for each of these i might make a array list of values with the same number as keys
what could be an easy way of going through this
hmmm
this file will be hosted as a cdn
and 200 sites will have this
but each site should have a different value
keys are basically the domain names
Just remove the protocol from the hostname since it can be SSL or non SSL
Before searching for the value
the values will be random numbers needed for something else in the page

{
{
key: bla,
value: Erwin sucks
},
{
...
}
}
yep i understand
im in this picture and i dont like it

For discord.py, is there any considerable difference in terms of efficiency or latency, in having multiple commands in a few cogs vs multiple cogs with one command each?
Alright.... gonna prepare my bill real quick
E
that'll be $876.73 sire, how would you like to pay?
Huh... cheap bitch
@boreal iron ayo any idea where i can turn a 200 lines text into a javascript object
is there like a converter
||shut up, i'll split with you later if we get it||
let obj = {};
for(let item of Array) {
obj[item] = item;
}

oh
Sounds funny but I would use my editor to replace the chars with what I need
But Erwins cheat works, too of course
You would need to benchmark it yourself to see how the two perform, but I believe you should consider optimizing for the developer before optimizing for the program. The difference between the two in performance should ideally be the least of your concern and more about how the two differ in features and functionality.
For example, cogs are useful for classifying a set of commands under a parent. If you're making one cog for each command, you've made this feature useless.
Okay, thanks, I've basically optimized all other things, just was missing this part basically
for(let item of keys) {
obj[item] = item;
}
how could i get a different item for each of the objects
u get what i mean?
same way
obj['testing.com']
testing.com is part of a very long array
same size with keys
cuz every domain name will have a different key
doesn't obj[key] return the value?
so basically keys is an array
now i want to make the obj[item] = item something else basically keyvaluehere: "myotherarrayhere"
dictionaries can have dictionaries and arrays as values, and if you have obj['a'] = 1 and then do obj['a'] = 2 it'll change the value, if it works similar to python xd
Could you rewrite? I understood almost nothing, and request what?
I had stroke
anybody know an npm package to allow me to give youtube subscribers a role on discord?
So I want to setup a logs channel like mee6 or really any bot has I know how to do it in console but how would I link it to a channel
If someone can help that will be cool
depends on the stuff
uhh idk how to explain it
like its being pushed up?
is there like a margin-bottom:auto?
that works*
Instead of console.log, just send messages to a channel....
Either make it a setting, or try to automatically create the channel with the API. Will depend on permissions etc
Iâm still kind of new to coding what roughly will I have to put
console.log(stuff)
like scroll position?
uhh
I want to do like to create a truth or dare team and people can join team by typing $join and so how to get list of team members and the player are in team can only play
db: old-wio.db
position: absolute;
top: 0;
left: 0;
this is normal
when i make the server management this invis
it just flops down lmao
Yeah thereâs a reason why you can inspect in your browser for example
you think i havent tried that?
Have you? Who knows.
i wouldnt be asking for help if it had worked
Okay since youâre arguing like that...
Do you think we got a magic glass ball to see the code?
yes
i think you do
so tell my my issues pls and thank you
jk
so like is there a thing to push it up?
Because of the line break I would guess thereâs a wrong display argument value set for the 1st child or the menu header
It should probably be display: block or inline-block
Make a list and if they join, add them to the list?
Well the display property value can be table, table-cell, -row, row-group etc. as well
But since I donât know what you wanna do exactly and since Iâm not able to use a web inspector I wonât really be able to help
Can I create a list with quick.db?
but it looks weird
Block actually transforms your element to a div
And how can I get the playes list
Name.
it was a div already
dude im super confused
ok so using block or inline works
but then all the elements look weird
divs*
If so just add the following to your style sheet
div { border: 1px solid; }
And gimme a screenshot
kk
Without display block
Not sure how quick.db works, but could create a table which is a match, joining is adding people to that table, leaving is removing them from table, and ending/finishing game is deleting the table. As for user info, the User object has the properties that can find in documentation
Click it now to move it down again with another screenshot
Yes
One sec
alright
Okay what does your click actually change in your style sheet or which style does it add to the elements?
ok
it makes the content in the container of the groups invisible
so like u see the server management "group"
the "moderation" div is inside it
so when u click it, that goes invis
I wonder about the div border we set
Change it to div { border: 1px solid yellow !important; } please to see the impact
The selector needs to be global
Well it would be 120% easier with a web inspector tool
Yes all
cuz i was just doing it for the class
im dumb
i added the rest to groups to make it easier
Ok now click it again please
ok
ok so
for some reason
the first "group"
is fine
the rest still move the thingy down
Pic?
What I can see is the div around server selector is the parent of all divs inside
Sure
Alright looks better
AHHH
it didnt work
i hate frontend đŚ
@boreal iron
ill try to send code?
cuz its complicated af
If itâs not urgent we can go on in a few hours
idk why it was workign when i had so many
uhh itll be too late for me
its fine
dw
thanks tho
what WAS working tho was using block or inline
the only issue with that was that the individual elements werent aligned
which can be fixed
block*
inline doesnt work
Well the inspector tool in Firefox has a layout section for the selected element to see the outer and inner paddings/margins
No inline will basically transform the into a span element
Anyways need some sleep unfortunately until the work begins
Letâs talk later that day
wait what? Is it possible to make this kind of button?
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
This will make a fine addition to my collection
it is indeed
im playing with it rn
I assume it replaces the on_reaction do this ?
it doesnt replace, but it sure does a good job at it
you save on a lot of requests doing it that way
Ooo
sorry, got busy
so, heres the thing
you just send everything under components
rather than having to await react() on every message
rather than a request for the message itself PLUS 1 request per reaction, you bulk everything into 1
since you can create the message WITH all reactions along with it
Seems like embed menus and stuff are getting an upgrade
you havent heard of them cuz they are in private testing
only staff and big lib devs have access to it
One message removed from a suspended account.
yes
One message removed from a suspended account.
hug?
Ah
One message removed from a suspended account.

i got access to it, had acess to other stuff like buttons too
got to use it about 2 months prior its release
i still got access to threads and dropdowns
even though they arent out yet
Then I'll be waiting xd More options and things to do cool stuff are always welcome lol
What's cool about buttons is that you can put anything in the custom_id, so you can easily parse out database IDs etc
i dont think d.js has buttons yet
i think they pushed it to v13
which god knows when it'll come out
oh then u fine, just check the docs if they have it already
Ye, been reading them xd

@crimson vapor you seeing this shit?
the python users read the docs
why the fuck the js ones dont?
@pallid heart It'll be easier to get help with development if ask in English. Not sure how many can understand what you are saying xd
what are docs?
abbreviation for doctors 
very cool xD
what is message.reactions.holds? There is no doc for it
where the plan anyways, trying to fix the other shit gives me just headache. like why tf does the gateway state of the shard is non existant
where got it from?
Sorry, I don't know about RPG maker xd
Who knows the deep inner mysteries of d.js? It traps developers with "easy OOP based code", then stings you with its complexity.
if(!message.guild.me.hasPermissionFor(message.member.voice.channel)) return message.channel.send("I need Connect permission to connect your vc!")```
Error :- message.guild.me... is not a function
Not sure which language, but could do a try except (py), try catch (js?)
Try to connect, if get an error, catch/except it and send the message that need perms?
try:
*something something*
except command.MissingPermissions:
*sends message that dont have permission*
its js
Then the js try...catch
haspermissionfor is a thing? cant find it in the docs
try permissionIn
I think mean the hasPermission
https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=hasPermission
has permission is for permissions like ADMINISTRATOR
permissionsin is for channel permission
also haspermission is deprecated
permissions.has is the new way
is there a way to check if someone actually voted for your bot?
#topgg-api and check the top.gg webhook documentation
Aight
they're just being normal js users
that's aml you could expect from someone using js
How do you make the browser download the requested file instead of displaying to the user?
you mean as in videos?
no
any file
like:
GET /file.pngoranyotherfiletype
i want the browser to download the file instead of display it as a png image
how does whatsapp web do it then
you click on the download button and it just works
there's probably some hacky solution in approaching this
like downloading it via js and saving it somehow
i once tried to send a file with an invalid mime type so express changed it to application/octet-stream and the browser downloaded it
@split hazel @vivid fulcrum yeah application/octet-stream works
the browser literally saved the file as download
nvm content-disposition exists
I use discord.js and my bot is for economy how can I make it when someone vote my bot it's give him coins? How can I do it 
Like dank memer or other bots

I sent them here bc I felt that wasn't completely related to the top.gg api
I mean they only need the api for the vote part
Hello
which im pretty sure is what they're asking about (or both)

How do I get/make a webhook to use for tracking voting? Do I have to make a flask webserver? Or is there an easier way?
how do i verify my bot?
there is a library for interacting with the top.gg api
Yea but you need a webhook for it?
hi cuties
the library handles it for you
yeah, the url to your webhook and the auth
Where do i get the webhook?
So I should be making a flask web server?
In the example code the url to the webhook would be:
yourdomain:5000/dblwebhook
no the library already creates the server for you
the domain would be the IP of your vps
Local IP or public?
public
Thanks a bunch dude ^ Sorry about all the questions ;p
uh.. do vps' providers even give you a local IP address
Not sure, I just host it on my pi
that'll make stuff a lot harder for you tho
A
Why?
Also should it look something like this?
client.dblpy = dbl.DBLClient(client, dbl_token, webhook_path="86.25.###.###:5000/dblwebhook", webhook_auth="password", webhook_port=5000)
a stupid question, should I make a nGinx server for a React front end app?
dbl_token = "tokenhere" # set this to your bot's top.gg token
client.dblpy = dbl.DBLClient(client, dbl_token,
webhook_path="86.25.###.###:5000/dblwebhook",
webhook_auth="password", webhook_port=5000)
I don't seem to be getting any response when I use the test webhook button on the topgg website.
The webhook_path should just be "/dblwebhook" and start the Webhook URL with http://
http://ip:port/dblwebhook
Don't seem to be getting anything back from it
Did you save it?
client.dblpy = dbl.DBLClient(client, dbl_token,
webhook_path="/dblwebhook",
webhook_auth="password", webhook_port=5000)
Yea saved it
Try accessing it through your browser, it should show 405: Method Not Allowed
Doesn't load
You leak the IP btw
ooops xD
Make sure port 5000 is open
it's a raspberry pi that's connected to their home network
you need to setup port forwarding
Ah, then yeah ^
Go onto my router settings?
Hello, so ive been working on a buy command for my econimy bot and as most know i use repl.it to keep it online and well when i tried to get it on it did go online but whenever you run the command to join the bank it doesnt send the embed, doesnt give me an error and doesnt write in bank.json
My code:
https://hastebin.com/narabunifi.js
I myself haven't tried doing it, so can't really help with that
one sec I think i can do it i've done it once before
Ok
Sorry not you tbone
so what?
also you run 2 message events, why?
What? Where?
I just did a command to check ports and 5000 seems to be listening?
line 31 and 60
Nop
can someone just help me not critisize me
That's heroku
Ah
So you can actually use JSON there
yeah thats to define args
yes i do otherwise replit says args is not defined
so the main commands dont work because of the buy system
as ive tested the !join command mainly
and yes i have a folder called DB then bank.json in it
you have a few embeds in the join command
with {} in the folder
also does the "db" contain any data?
yes most are errors
It is a folder
yes, but does it contain data?
ok so you expect to get the first error then?
so it is getting the message.author.id and putting it there with there bal, worker, and lastclaim
ok so the thing doesnt contain data
yes but no error shows, it just doesnt work
it does
fs.writeFileSync
to write into it
no it does not the json file is empty
but looks like your first check if the user exist in the database causes your issue
yes, but its still empty there is no data in it
yes but its supposed to write there id and then the lastclaim etc
yes, it doesnt write anything bcs it never reaches the part of the code
where did you close the stuff from line 65?
in best case after the return
but i dont see the bracket there
line 76
line 76 is for the json
oh i think i forgot to close the code there
i used vsc to code in cause its easier, than copied it into repl.it
ok did you have the nice stuff linter installed?
wtf is linter
did you know how to install modules in VSC?
npm i ESLint
ok but what does it do
You can install it globally since it doesn't have anything to do with the project other than during its development phase (and can be used in other projects).
it helps you with syntax errors
this??
yes
XD
yea then everything is fine
it doesnt say you if your code is written in a way that it cant work
are u sure
it just tells you about syntax errors
its not working my ENITER code besides !help
join doesnt work bcs your code blocks the entire code
eslint does much more
what line
you also need to generate an eslintrc.json file otherwise eslint wont work
you open a bracket at line 65 but never close it properly
this prevents you from saving stuff
would this work
if(MoneyJSON[message.author.id]){
let AlreadyCreated = new Discord.MessageEmbed
AlreadyCreated.setTitle("Already Created")
AlreadyCreated.setDescription("You Have Already Created An Account")
message.channel.send(AlreadyCreated)
return;
}
try and see
one sec
it tells you the error
pls stop spamming links
lol
Why does this not work?
members = 0
bots = 0
for i in ctx.guild.members:
if i.bot:
bots += 1
else:
members += 1
print(members)
print(bots)
he sends you links to solve your issues
im giving them to u my man
oh
Prints no errors just has the wrong count
google ur errors my man
that worked
What's the expected and actual ouput?
but i got GUESS WHAT another error one sec..
told you. if you want i have a few suggestions, to make your life maybe a bit easier
ok
it's expected to give me the that there are (number) bots and (number) members but it just shows 1 bot and 0 members
You're probably missing server member intents.
u got ur bot verifyed???
nice
the d.js-guide has an really good guide in how to break down your bot into mutiple files, this makes managing the commands / events way easier
You'll need to enable the intent on the developer dashboard and in your source code.
ok but why did i get that error
Wait lemme see something
what error?
there is probably some blocking code too
so it writes, but doesnt substract and send the message
Isn't that how to enable it?
client = commands.Bot(command_prefix="<", discord.Intents.all())
yeah but it went into negitives its not supposed to
wait it does, but you dont check if the sum is smaller than 0 after the transaction
to make it NOT go to the negitives
it did it AGAIN
into the negitives
yes bcs you probably dont prevent it
where do i not, i did it
Whats the fastest way to check through a mongodb collection if a value contains X letter/string? Using regex would just give me every value/data that includes X? Let me know if you need better explaination
using mongoose
- If I remember correctly, you aren't allowed to add positioned arguments (
discord.Intents.all()) after named arguments (command_prefix=...). - Replace it for
intents=.... - You probably don't need all intents, but I'm unsure how to specify specific ones. So after step 2 it should work.
why does it say it cant read it
you tried to access the property 0 of something that is not defined
you try to use the balance of the user to query the database, this probably errors out
lol
if(10 * parseInt(amount) > MoneyJSON[message.author.id.bal]){
where/??? line 217???
just had to lol
lel
hold on im looking
whats wrong with that
you're trying to access "bal" of "message.author.id"
discord ids dont have a "bal" property
.bal its in the args at the top with lastclaim
you want to add it at the end
i dont have your code so idk what you're saying
https://hastebin.com/narabunifi.js his code
you did it right everywhere except here if(10 * parseInt(amount) > MoneyJSON[message.author.id.bal]){
just check how you did it in other places and do the same
did what
use MoneyJSON correctly
Wait
if(10 * parseInt(amount) > MoneyJSON[message.author.id],bal)
i mean
if(10 * parseInt(amount) > MoneyJSON[message.author.id],bal){
let Error = new Discord.MessageEmbed
Error.setTitle("Nope!")
Error.setDescription(`You do not have enough money! Each worker costs $10\nYou have $${MoneyJSON[message.author.id].bal}`)
message.channel.send(Error)
return
lokk at the other one
is this one right'
if(10 * parseInt(amount) > MoneyJSON[message.author.id].bal){
let Error = new Discord.MessageEmbed
Error.setTitle("Nope!")
Error.setDescription(You do not have enough money! Each worker costs $10\nYou have $${MoneyJSON[message.author.id].bal})
message.channel.send(Error)
return
not anymore is that good?
is that one good???
yes looks better
try and see
So, i couldnt figure out port forwarding for my webhook. So im now using a third partty service which will send a discord webhook to a channel, and then i do some funky stuff to gather the userID of the person who voted within the message of the discord webhook đ¤Ł
1 piece of coe doewsnt work the thing saying u did successfully get it
Hello, who wants to buy a free fire account?
@round cove
how do you "sell" something for free
its in the game name
yeah
hmm
since woo is away, how about @drowsy crag ?
where who what huh
@ember estuary not the place to ask
i still cant figure it out
does it finish the rest of the code after the file write?
um
this piece doesnt work
but the one above does
add a console.log("some random message") to it to see if it passes, or learn how to use the debugger
preferably the latter
where? at the beggining?
of the MoneyJSON
the log usually where you want to check if the code runs throu
you see the linter already told you what is wrong
brb
learn about semicolons
tim stinks of bot dev colour

hi
const user = message.mentions.members.first();
const userID = user.id;
Why does user.id not work?
;
How does it not work exactly? Any errors?
đ
is there any way to view the highest permission an user has? node.js btw
member.roles.highest
members.first() returns a member not a user
<GuildMember>.id is also a thing
i cant find the webhooks tab under settings. Could someone help me out?
do you want to add vote webhook it is under votes
where is the webhook tab?
Isn't it under bot info
its not thr
not there, thats what the problem seems to be
It's probs not there cause your bot hasn't been approved, then
yeah
under the edit tab
gotta be approved to use webhooks
ok ill check with that
it will look like this if you bot is approved
you can try
https://top.gg/bot/YOURBOTIDHERE/webhooks
but it doesnt really do anything until approved
how do i check whether my bot is approved or not?
if it was you'd have the bot developer role, also you'd get a DM by Luca
how do i check queue
queue is confidential.





