#development
1 messages · Page 1773 of 1
const app = express();
const webhook = new Topgg.Webhook(process.env.WEBHOOK_TOKEN);
app.post('/dblwebhook', webhook.listener(vote => {
// vote will be your vote object, e.g
console.log(vote.user); // 395526710101278721 < user who voted\
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}));
app.listen(80);
I currently have this code running on my bot bot when i test it there is no output.
the secret is the same on server and website
i currently have http://xx.xx.xxx.xx:80/dblwebhook as the ip
go to your bot's page, there should be an estimate to when your bot's gonna get approved
ok thanks a lot!
and the process.env.WEBHOOK_TOKEN is the same on both the site and the env var?
yes
and the IP is public?
where are you testing this at? on a home network? vps/replit?
from my home pc atm
that's why it's not working
youll need to port forward
it wont work on local device you need a public ip
you need to setup port forwarding
ah ok sad, i used the old dbl webhook system before and it worked fine but apparently its deprecated rn
thx
can i still use the old dbl api or not anymore?
for the time being
the api hasnt had any major reworks for quite awhile.
How do I check for ghost ping in discord.py(I am using discord.ext)
Oh no someone deleted a message which has user mentions in it
That must mean I should cache it in my bot object as a dictionary
And using on_message_delete probably store the message itself or its contents
Yeah that I know but how do I check if the message has a mention?
what do these errors mean?
The alias hit is already an existing command or alias
ok
Two commands with same name
i thought i removed it
That or you are setting a command alias which is the same as another command's name
Which... ironically, the error says pretty clearly
i had to remove the hit alias
And yeah message.mentions
How would I make a random joke generator?
there are apis for that, you should search it up
Scrap reddit
or make an ai to generate jokes
or steal 1000's of jokes and randomly select one
^^ Why start from scratch when others have done it?
@wheat sun@solemn latch both of u missed an important part
and do it like a 8ball command
nani?
the part where they write 1000's of jokes in pain, agony and tears
true
lmao
Just like history, we forget about the unimportant parts
i'll sleep better at night knowing someone wrote 1000's of jokes by hand

lol
@opal plank your code stinks
thank you
np
if you can even call that thing code
me when I almost commit my token
thats what i got off my original bot and stripped off
well its all fucked up
got verified, pog
ok but like
got a cool badge next to my pfp now
speaking of verification, did u push the changes?
YOU KOW YOU CAN ADD LINES TO INCREASE READABLITY, RIGHT? https://img.terano.dev/VkbCP-Cm
I DID
THE REST IS FOR SCRUBS
the moment i hit ctrl + s it'll all be gone, just letting you know
wtf why
when a programmer that doesn't care about code appearance meets one that does
it lints it on ctrl+s
im using your linter
one sec
"More lines = need to scroll more, and that's no good"
no
fuck adding newlines every line
thats not how it works
not every line
smh
just for this im going to push a light theme in the .vscode/settings.json
you can clearly see where each thing belongs
cuz i add spacing on fucking different sections
make them better then
add a spcae and start with a capatilized letter

good
imagine
fast™️
big yikes
yea
oh btw i finished my slashcommands framework for buttons and dropdowns
i should be able to effortlessly port my normal commands to have their slash commands counterparts
probably
eeew rewriting
i should be able to legit just copy paste the code from the normal command onto the slashcommands and change 2 lines, boom, done
thats nice
40%
@opal plank whats all this shit for? https://img.terano.dev/G9rIjD8_
you only use cc once
and thats when you check if it exists
stupid shit
I remove useless shit
dont u dare
then they need commandClient, those fucks will legit try passing it on the function like client

its there to be as example
even if its unused
HENCE WHY ITS IN THE FUCKING EXAMPLE FOLDER
U DORK
same shit
admin*
the only 2 commands there are examples
added source https://img.terano.dev/xVmAzoZm
this line is longer than I want tho https://img.terano.dev/J9pH5_u4
bet u didnt add a catch block
@opal plank happy? https://img.terano.dev/F64670or
you said detritus beginner not total beginner
its an example million, people need to know the structure at which the payload comes
async run(payload: Context, __args: ParsedArgs): Promise<any> {
await payload.message
.reply('Repo: <https://github.com/erwin1234777/detritus-example>\nLibrary: <https://detritusjs.com/>')
.catch(async err => {
await payload.message.react('❎').catch(() => {
/* Voided */
});
console.error(err);
});
}```
that works, yes
I hate your eslint rn
you welcome
im not linting
this shit is stupid
cant find plugin
installs plugin
cant find plugin
bruh, this is a first
what
the person goes and thinks: "Oh, i should probably use the standardized method of chores/bugs and shit to make it all pretty"
meanwhile the commit names:
made some changes

no shit sherlock
i thought you could commit without changing anything
still easier to read, according to your own mindset
and easier for a new user to know what an object is, rather than this
specially cuz its a class extension
so theres no this.commandClient seen in there
how is js const cc = payload.message.commandClient if (!cc) return better than js this.commandClient
found it https://img.terano.dev/xKmNbby8
wheres is the property commandClient in there?
i dont see it in the file
I see
you never learned about extending classes then
bro thats like the first thing people learn
the whole point of it is being user friendly, by using this. keyword, you force the user to first know what this does, where this.commandClient is, and have them figure out where the extended class is coming from
if they know how to code
next whitename you see here asking questions about d.js, ask them if they know what a class extension is miullion

erwin momento
@earnest phoenix finished reading the rust docs 😎
ok
Yea how was it
Boring, but I needed to do it to basically see the cool stuff it can do
Indeed
I like rust as well
Dont use it though personally
Mainly cause it is boring to code in
Yea it is, I have to agree with that. But it is still useful to learn
I plan on either learning Python next, or going in more depth with C++
why not learn kotlin
pretty sexy
and I feel if you know any type safe language kotlin would be easy to grasp
I have to look at that. But I believe I have heard of it before
I forget who mentioned it in a video
Its syntax is similar to that of typescript
but also a lot of other languages as well
It is pretty nice to code in I've been using it for the past two weeks
Yea prolly learn it down the line somewhere. Play around with rust a bit more.
I believe there is a repo for Rust, in web development that it out performing everything as of right now
Rust can be used for web dev with web assembly or smth iirc
ok so hi, ive recently been working on a banking system and now i have a buy command, im working on a work command however when ever you check to see how many more minutes till u can work again, it is always on 5 and it doesnt send any messages besides the "we cant work right now wait 5 mins" and i use repl.it and code everything before in vsc. then copy everything to repl.it.
main.js: https://hastebin.com/ipatonobaf.js
bank.json(the db): https://hastebin.com/oxulubexog.json
Haven't you already been answered how to solve this?
or is it a different issue now
different
this is a work command not buy
wrong main.js
Maybe you should try and figure it out yourself, nothing personal either. Just better for learning
ive been trying for 3 h
also that was the wrong code XD wrong one in hastebin
Damn, maybe you do need some help lol
Yeah thats why i came here, this is my last resort, djs couldnt help :C
so can u help
I dont work in JS so not likely
You may be referring to the actix-web framework.
maybe? It had a few controversies with the dev.
Yeah because he was using a lot of unsafe {...}
I've only written the routing and structuring for a few endpoints but it's nice to use right now
I'm using SQLx as well but haven't gotten far
Postgres and immutable data doesn't play well
and I sadly can't find any popular database based around immutability
actix is so good
why do you need an immutable db
I'm designing a wiki-based project and things shouldn't be disappearing/changing out of no where.
But I've also chosen it because it's nice to always have a record of what's happened throughout the history of some data
For example, when a user's account was published, modified (and what changed), deletions, etc.
I mean you can just set rbac rules on the db you're using and only login with a writeonly user
can someone help me with this???
a database choice also brings a lot of tooling and ecosystem with it. I don't see the point in giving up the maturity of something like postgres just to not have pages deleted
nvm about that
you might want to read up on something called event sourcing for Wikipedia clones
I like to experiment and seek out alternatives to see if something else is able to solve a problem I'm having and how it may benefit me to use it (e.g. TimescaleDB though I ended up scrapping it). At the same time, I'm very stubborn about solutions trying to get "in your way", growing attached.
I'm a bit confused on the definition of event sourcing (https://martinfowler.com/eaaDev/EventSourcing.html), but it's very similar to my current implementation. For example, say I have an articles table.
- The
articlestable has anidfield and that's it. - An
articles_assetstable stores the history of all articles. I'd like to improve the current implementation, but alternatives are a bit difficult since it may become too rigid. - The
articles_publicationstable is for setting the public version of an article. An article can exist without a publication (in draft) and an article asset can appear multiple times in it (e.g. a rollback). It's just the asset ID, so it's cheap. - The
articles_deletionstable for if an article is deleted. An article can be republished viaarticles_publications.
how do i check if an object list includes a certain text
a list of objects?
* check for text *```
?
I would just iterate through all objects and check each one
so what i wanna do is basically
i'll check for the key
and if the key exists i'll get the value from it
If you have it all as a dictionary, there is Object.keys() that makes a list of the keys
Then can check if the key is in that list
You could do ofobj.find((obj) => obj.key === "...")
You'll get the object if it's found.
So you can just pluck out the value from there.
oh oki
what does defo mean
Give us context
some one said "do all the files defo exist in commands"
It's a slang for definitely
ok
that worked thanks a bunch!
@sudden geyser sorry to bother ```js
if (ofobj.find((obj) => obj.key === window.location.hostname)){
}
how can i access the same obj inside the function
cuz i want to get its value
Save it to a variable beforehand
Then check if it's undefined (not found)
If it is do magic
else don't
so basically all i want to get is the obj ```js
ofobj.find((obj) => obj.key === window.location.hostname
i want to get this obj and the proceed to get its value
inside the function
nvmmm
i did it
E
i am getting the error of "embed is not named" which, im assuming means that it isnt identified, but i did.
Is there someone that can help me to count all messages from 10 seconds and dont ask me why
here is the code its connected to
I mean like how can i do it what should i use
embed is not defined at that scope yeah
ty that fixed it
Dunno if this is valid though
yeah imma change it
Why did you str() the method
How do I let a bot join a channel and stay in it? (asking because all the bots I know just leave the channel if there aren't any ppl in the vc)
client.on('message', async message => {
if (message.member.voice.channel) {
const connection = await message.member.voice.channel.join();
}
});

i just don't realize obvious things
like when i forget to add the bot token 
it sounds like you jumped into making bots without really understanding how to use python. If you've spent time looking over classes and functions you'd at least have a vague idea that
variable = str(...)(...)
makes no sense
so you're just trying random shit hoping it works like I said
which isn't necessarily a bad way to go about things but if other people have to do the learning for you it's not cool
I think a more respectful way to go about this would be to ask for what concepts you might be lacking with the code you've tried and try to go back and learn those before moving forward
ok
so if you ask me you probably need a refresher on classes and functions. Also look up keyword arguments (kwargs) if you don't know what they are because you're using it a lot here
Uh, okay, I guess.
from ..userprofile import createUser how can i import a function from a file?
in py
Excuse me a question, I entered an array in the config index server database, which immediately has an object called "No Changes Recorded.", but which when it receives a new timestamp, that "No Changes Recorded." the timestamp is deleted and inserted so that only 1 object remains in the Array. I wanted to ask you if I had done well
@drifting wedge Could you fix your CSS issue?
css sucks
Could anyone give me an answer pls
html sucks
🤦♂️
the web sucks
is it done well?
... at least one normal person in here
who?
Nope
I got really mad
So took a break
Uhh I'm without my pc rn
But like this entire issue doesn't even make sense
Cuz like why is it going down?
I think it might be the height
Lemme try that...
I'm at my PC for the next few minutes... lemme know if you can't get it running
alr ty
omfg i hate life
@boreal iron its working
AHHH
fml
totally didnt waste all day yesterday
Okay, but does it function
Small suggestion: indent the inner list in server management
it does
alright lemme try
thanks
5px
may be too small tho
8px now
its ok ig
but i dont think it even matters all that much
doesnt look all that great
You look bad
Its possible to have a different bot logo for every server?
a guide or something?
Uh, sorry, I don't know any guides xd
Just know there is an entry in the discord.py socs
can you trade multiple characters at once in mudae
No
Best ask in mudae server or see their documention, this isn't really the server to ask about a specific bot
how can I ignore this error in ts Could not find a declaration file for module "blah blah"
4|vib | at Vibely.<anonymous> (/root/vibely-2/src/base/Util.js:57:68)
4|vib | at Vibely.emit (node:events:365:28)
4|vib | at GuildDeleteAction.handle (/root/vibely-2/node_modules/discord.js/src/client/actions/GuildDelete.js:51:14)
4|vib | at Object.module.exports [as GUILD_DELETE] (/root/vibely-2/node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js:4:30)
4|vib | at WebSocketManager.handlePacket (/root/vibely-2/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
4|vib | at WebSocketShard.onPacket (/root/vibely-2/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
4|vib | at WebSocketShard.onMessage (/root/vibely-2/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
4|vib | at WebSocket.onMessage (/root/vibely-2/node_modules/ws/lib/event-target.js:132:16)
4|vib | at WebSocket.emit (node:events:365:28)
4|vib | at Receiver.receiverOnMessage (/root/vibely-2/node_modules/ws/lib/websocket.js:835:20)
4|vib | at Receiver.emit (node:events:365:28)
4|vib | at Receiver.dataMessage (/root/vibely-2/node_modules/ws/lib/receiver.js:437:14)
4|vib | at Receiver.getData (/root/vibely-2/node_modules/ws/lib/receiver.js:367:17)
4|vib | at Receiver.startLoop (/root/vibely-2/node_modules/ws/lib/receiver.js:143:22)
4|vib | at Receiver._write (/root/vibely-2/node_modules/ws/lib/receiver.js:78:10)
Could anyone guide me
just so you know, you cut off the top part of the error
One message removed from a suspended account.
One message removed from a suspended account.
true
Use require()
um I mean permission-
It is related to GUILD_DELETE which mean, related to guildDelete event, and I'm a god now?
Anyone know how to send embed with normal msg attached
Like
Here msg
here embed
message.send(embed, msg);
I am right?
message.channel.send("message string", embed)
y Im getting this error?
read the error
what would that do?
Because you are assigning it in a conditional.
its literally saying its undefined
You will need to explicitly set the variable to undefined when you declare it
you can do let pos!: Positon but thats stupid
Just do let pos: Position | undefined = undefined
Ooh, I thought unintialised variables are already undefined. So ts should pick that too
Well, TS is just trying to prevent you from doing something stupid :)
ts is a nightmare. i use it now for about 2 weeks and had so many stupid errors
even some stuff that makes 0 sense
ive not had any issues with ts tbh
any issues were just fucked up settings or something
at least for me
Where to play Rpg???
If you refer to a specific bot, you are in the wrong server xd
Ohh sorry 😔
read what my issue where on the detritus discord, like erwin told me to just use the bot ive already made bcs he dont know either why i cant run his repo
could you link me to the message?
was it giving you an error?
there is no error, it just wont load the events
all i know is that the websocket connection state is non existant
oh?
yea, digged quite deep into what happens, and at the last time the websocket state where just ''
yea
idk why typescript would have that issue, were you using ts-node?
tried ts-node but mostly i run it with the debugger
so i can easy attach breakpoints
and dig deeper in wtf just happened
using his things?
could be issues with that
not really, i run the same scripts on a different bot written in TS with detritus and it just works
also running with ts-node gives me the same issue
what about tsc and node .?
node wont work bcs in how its coded
i dont care about it anymore tbh, i just build off the Frankenstein ive made out of the notsobot repo
so its only that repo being stupid?
it looks like it, like ive tried to run it inside a new VM with the same result
alright well I blame erwin's code
it worked for you, Erwin and Evie
but it worked with the debugger right?
yes
so it worked
well its already further than i went
ah
<Box backgroundColor="#fff5fd" h="100%" mt={-2}>
<Navbar props={data.getUser}/>
<Header/>
<Session/>
</Box>
How I can fix this shit?
docs about customized status with the discord bot and in how much servers is it and how much users?
It should be in the discord.py/discord.js documentation?
@opal plank
how do I use detritus for slash commands?

@crimson vapor https://detritusjs.com/#slashcommand-client-sample
Documentation for Detritus Client
the Number of members matters for verification?
Discord verification? As long as your growth isn't inorganic or suspicious, it should be fine
container@DBH~ Server marked as starting...
[Pterodactyl Daemon]: Pulling Docker container image, this could take a few minutes to complete...
[Pterodactyl Daemon]: Finished pulling Docker container image
:/home/container$ /usr/local/bin/npm i && /usr/local/bin/node /home/container/${BOT_JS_FILE}
container@DBH~ Server marked as running...
npm WARN Invalid name: "IsmailZ 2.0"
npm WARN container No description
npm WARN container No repository field.
npm WARN container No README data
npm WARN container No license field.
up to date in 5.215s
found 0 vulnerabilities
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'discord.js'
Require stack:
- /home/container/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/container/index.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/container/index.js' ]
}
container@DBH~ Server marked as offline...
[Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon]: Exit code: 1
[Pterodactyl Daemon]: Out of memory: false
[Pterodactyl Daemon]: Aborting automatic restart, last crash occurred less than 60 seconds ago.
I can't use npm install discord.js in my panel...
why?
<Box backgroundColor="#fdfdfd" p={6}>
<Flex
justifyContent="center"
alignItems="center"
w="100%"
mt={5}
>
<Heading textAlign="center" fontSize="1.5rem" mb={5} display="block">
Những cán bộ của chúng tôi
</Heading>
{Data.map(userData => <UserInfo key={userData.id} data={userData} />)}
</Flex>
</Box>
How I can make the Heading to not be in-line ?
anyone any idea :<?
bot verification, my bot now Is in 20 server, and for example some are about 100 members, another One Is 35. This counts for bot verification?
idk
I have to put modules in my package.json they say
{
"name": "IsmailZ",
"version": "1.0.0",
"description": "A Discord bot!",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "IsmailZ",
"license": "ISC"
}
How to put modules in this^^
This is on sale
@ripe prairie
@rustic nova

It doesn't matter, all you need is 75 servers
@paper wren dont advertise referral links, thanks
also unrelated to this channel aswell
#WHAT THE HELL
help me 
Just install discord.js lol
uh
Panel?
console I meant

Use requirements.txt if it's online oof
And how?? I'm new to this lol
What do I have to type in that file
So python uses the CDM
pip install requirements.txt
But i guess you gotta find out how it works on js
"dependencies": {
"discord.js": "12.5.3"
}
Thanksss
how?
read my other message under that
I have a JSON string and I want the browser to save it as a file. How do I do that?
I can use an anchor with the download attribute but what will i put in the href?
reload
Bruh
HaHa
Today I try to make a more decent command handler
Save the JSON string locally as file and put its path into the href attribute
Save the JSON string locally as file
download the file so i can download the file???????
🤦♂️put the string into a file on your webserver temporarily
Many roads lead to Rome
you cant dotpost
looks fine
kekw
@lusty quest Hate myself
Forgot to supply the GUILD_MESSAGES intent
me big brian
If I try to list all roles of server
It gives me error description is too long
In embed
Can I do if embed is too long then it sends that in second embed automatically
Like dyno!
Ping me if you got it
But in dyno its not paginated
Idk how dyno does it
But if your roles exceed the character limit discord has for embeds then nothing you can do but paginate it or show a few
or split the embeds
There's something wrong with my bot's status... "streaming in undefined servers"
client.user.setActivity(`in ${client.guilds.size} servers! :tada:`, { url: 'https://www.twitch.tv/ItsIsmailZ', type: 'STREAMING' });
don't you have to access the cache now for the size or nah
@wide wharf You're using v12 of discord.js right?
How can I split?
then you have to access the cache first
How?
client.guilds.cache.size ...
var guildsButArray = [];
for (var guild of client.guilds.cache) {
if (guild[1]) {
if (guild[1].id) {
guildsButArray.push(guild[1].id);
}
} else {}; // void
}
client.user.setActivity(`in ${guildsButArray.length - 1 + 1} servers! :tada:`, { url: 'https://www.twitch.tv/ItsIsmailZ', type: 'STREAMING' });```
Why
my code
huh
I don't understand you flazepe
:o
can I ask why go through all that
yeah
10/10 answer
they say for loops are fast
thanks
Ooo
hello and im having some trouble with my work command on my bank bot, ive been trying to figure this out and i just dont understand, everything was coded correctly to me.
Code: https://hastebin.com/olevoxisex.js (if u need it)
my whole code: https://hastebin.com/mumejilise.js
not related probably but shouldn't it be discord.MessageEmbed()
note the ()
yes if item is an array
item = Example1, Examble2 etc...
you mean
item = [ Example1, Examble2 ] ?
no, it's an array
item is the content of the array
[] this is array \🙄
and [ Example1, Example2 ] is not an array ?
im confused, anyway, the content of the array has function .join() ?
(Example1, Example2)
let bot = ["https", "://", "top", ".", "gg"]
console.log(bot.join())
this would return https://top.gg
in arrays we don't use () we use []
so it shouldn't be (ex1, ex2) rather [ex1, ex2]
yeah, so [] has function .join()
oooh, the content (https, ://, top) is a String so i've to check String functions
not it works for number, strings , objects .... etc
just weirdly
I would like to list (\ n) all items by removing [] how do I do?
ex:
Item1
Item2
Item3
.join("\n")
.join('\n')
lol
@near stratus wow your pfp 
.join(`\n`)
imma buy a Samsung Device soon
fuck
Me too lol
wait if nobody then ok right?
?

🚪 🚶♂️ samsung girl
@sudden geyser Wow your badge is cool 
early supporter bad
Why
because people ask to buy your account for $800
lmao
I wish I had my account with that badge
$700 = 5600 ₺
got locked out of it

Why im turk

my friend got offered like 3600$ worth of shit just cause he had the early developer badge
mmlol
the offerers are probably scammers or flippers
buy for 3.6k then sell for 4k
usually children
watch a 2 year old on discord be like that
I knew some guy who bought some account for maybe 1k because it had that golden badge thing
so? does that do anything
yes
bug hunter
ah.
no
what
() is important for MessageEmbed
It was HypeSquad Events
ohhhhh the gold hypesquad
Just wondering, but has anyone tried using graph databases
oh
also where is that channel?
it.... fixed it
ok
thats my own server
ok what?? i fixed the ()
Here is the code im so mad rn: IF U NEED IT DONT LOOK IF U CANT HELP: https://hastebin.com/zoverozifi.js
do you know what line the error is coming from
because it means you're trying to access 0 on an undefined property
e.g. const array = undefined; array[0]
this is the code its happeing in:
if(args[0] == 'work'){ let MoneyJSON = JSON.parse(fs.readFileSync("./DB/bank.json")) if(!MoneyJSON[message.author.id]){ let ErrorEmbed = new Discord.MessageEmbed() ErrorEmbed.setTitle("Nope!") ErrorEmbed.setDescription("You do not have a bank account created!") message.channel.send(ErrorEmbed) return } let deltatime = Math.floor((new Date(). getTime() - MoneyJSON[message.author.id].lastwork) / (300000)) if(deltatime < 5){ let Erorr = new Discord.MessageEmbed() Erorr.setTitle("Nope!") Erorr.setDescription(We are on break! You can have us work again in ${5 - deltatime} minutes!`)
message.channel.send(Erorr)
return
}
MoneyJSON[message.author.id].bal += (MoneyJSON[message.author.id].worker) * 3
MoneyJSON[message.author.id].lastwork = new Date().getTime()
fs.writeFileSync("./DB/bank.json", JSON.stringify(MoneyJSON))
let WorkerEmbed = new Discord.MessageEmbed()
WorkerEmbed.setTitle("Off to work we go!")
WorkerEmbed.addFields('Coins Earned:', $(MoneyJSON[message.author.id].worker) * 3)
WorkerEmbed.addFields('You Now Have:', $(MoneyJSON[message.author.id].bal) * 3)
message.channel.send(WorkerEmbed)
}
})
`
what would make your life 100x easier is if you had a stacktrace
what is that
what is stacktrace
oh
it would be easier to see the problem if your code was properly indented/formatted
you have an extra closing bracket
welp i just um
errors
your code is doing this essentially:
if (message.content.startsWith(activator)) {
var args = message.content.substring(activator.length).toLocaleLowerCase().split(" ")
// lots of commands here
// broken command that accidentally closes the top "if"
} // if accidentally closed
// args doesnt exist here
if (args[0] == 'buy') {
// more commands
}
still its only created if the if passes
if the message does not start with activator, then there is no args
ah fair
const activator = "!"
sounds like you didnt lol
thats not the problem
your code will error anytime someone sends a message that does not start with your prefix
oh it does
cool i did it
Yay! My bot is approved#
congrats
Congrats mate
Congratulations
congobongo
🎉 congrats
One message removed from a suspended account.
One message removed from a suspended account.
wdym BROKEN command
seems one of your commands closes the top if
make a baby
Why
One message removed from a suspended account.
Is it possible to get the form data from the SubmitEvent directly in the onSubmit prop of a react form element?
Yes its of topgg
Figures
Is anything wrong in that ?
im not much of a CSS dev so im not sure how much I could help you
Well what issues are you having
but have you included some HTML as well?
Why would they need to include html
for some of the css
top.gg already has all the html
they are just overriding the classes with new values
oh ok
like wut
One message removed from a suspended account.
all i have is a giant backlog of unfinished stuff
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
sa
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
how about finishing my hash benchmarks
lmao
i need to work on my api, and have 3 websites to work on as well >.>
plus a couple pieces of software i didnt even start yet
Why am I getting a syntax error at the end? I don't see why I am getting an error.
What's the error
fast
that ain't right
hmm
hello
What's not right
syntax
why hello there
wht / this prefix command name
The ]) at the end does not make sense
i see it in groovy
A slash
oh
Are you looking for slash commands?
oh I see
why?
Oh wait I see now
look closely
It was just wrapped
It's not wrapped
It seems like it is
i still dont see it
@hot sage Close that embed.add_field()
ok
The line is wrapped by their editor so it appears on the next line, but the real issue was the add_field bit like you said
i am blind
me 3
helo someone code me a botum
can someone help
Seems like Data is undefined.
ik but the guy never showed me how to define it but his works
i18n is so confusing
localization is confusing in general
does anyone know, are buttons supported in the newest discord.js?
in v13 yea
v13 which is master right now
so if i clone from github I should have it?
that would be cloning
which you clone
i meant using git clone or npm install... :v
yarn add discordjs/discord.js or npm i discordjs/discord.js
will install the master branch from github
So, I am trying to do error handlers, and I am trying to have it so there can be a missing argument error handler, and a missing permissions handler for one command, but only the missing permissions handler is working
python ^
Show code
idk why but i did each one away from each other
top image's code is above bottom image's
Yeah well sherlock
You see
When you do @x.error, it overwrites whatever was put before
You use ONE error handler for ALL exceptions
Not TWO SEPARATE events for different exceptions
is editing a message is slower than editing a interaction?
huh?
sory I meant interaction
they're probably about the same
the difference isn't something to care about though
internet speed, cpu speed, whether the api is crowded etc.
are many of the factors when doing REST requests
so it genuinely does not matter
do whatever looks the best in your eyes
to me responding to an interaction with type 7 instead of directly editing the message looks cleaner
because it's the "proper" way to do it
and it just looks consistent
what's type 7
I'm not sure
It's worded a little weird in the docs but I guess it edits the interaction response
UPDATE_MESSAGE
or CHANNEL
depending if u looking at callback response types or application types
are the /commands out officially?
with the docs and stuff
cool
In some languages yea
discord.js doesn't "officially" support it.
Its in the master branch
still being developed
ah i see cheers
why my embed doesn't have a thumbnail?
are you doing the .send({embed}) thing
message.channel.send(embed)?
yes
i did
oh
it's not working too
whats your code
const embed = new MessageEmbed({
author: {
name: 'Partnership Stats for - ' + guild.name,
icon_url: guild.iconURL({ dynamic: true })
},
thumbnail: {
url: guild.iconURL({ dynamic: true })
},
color: '#9D37C6',
fields: [
{
name: `${client.emojis.cache.get('850732067876241418').toString()} Total Partner Managers`,
value: `**${Guild.totalPartnerManagers} ${client.emojis.cache.get('851006300883779594').toString()}**`
},
{
name: `${client.emojis.cache.get('851076208904634378').toString()} Last Five Timestamps`,
value: Guild.PartnerManagerTimestamp.join('\n')
}
]
});
no thumbnail and author icon too
This is a error handler for a user info command, i have an alias for it as user-info, and thats what i want people to use instead of user, but it isn't showing the error message that it is supposed to
it also isn't showing when using the user command
and i copied it from another error handler that worked
@zenith terrace
try removing the dynamic, idk if it changes anything
client.on('message', message => {
console.log('hi1')
if(!message.content.startsWith(prefix) || message.author.bot) return;
console.log('hi2')
const args = message.content.slice(prefix.length).split(/ +/);
console.log('hi3')
const command = args.shift().toLowerCase();
console.log('hi4')
if(command === 'staffMsg'){
client.commands.get('staffMsg').execute(message, args);
console.log('hi5')
}
if(command === 'openTicketMsg'){
client.commands.get('openTicketMsg').execute(message, args);
}
})```
hi1
hi2
hi3
hi4``` For some reason, this would usually work. But it seems like the if statements aren't working.
ok it dont make a different the dynamic
what do you have guild defined as
can two buttons have same custom_id?
probs not
anyone?
message.guild
client.on('message', message => {
console.log('hi1')
if(!message.content.startsWith(prefix) || message.author.bot) return;
console.log('hi2')
const args = message.content.slice(prefix.length).split(/ +/);
console.log('hi3')
const command = args.shift().toLowerCase();
console.log('hi4')
if(command === 'staffMsg'){
client.commands.get('staffMsg').execute(message, args);
console.log('hi5')
}
if(command === 'openTicketMsg'){
client.commands.get('openTicketMsg').execute(message, args);
}
})```
hi1
hi2
hi3
hi4``` For some reason, this would usually work. But it seems like the if statements aren't working.
not sure as it should work
Also those if statements completely defeat the point of storing your commands in a map
ok.
you dont need an emoji, pretty sure you need a label
button, with emoji and no label works fine
I want to align 4 buttons in a plus shape
i checked out my old project, i did message.guild.iconURL() and it showed it the embed, why here it doesn't work?
sorry for my english
You can have 3 rows with 3 buttons on each row, and disable the ones that won't be needed
otherwise it's not possible
not sure why cause guild.iconURL() still should work
that what Im trying to do.
but on disabled buttons, it is not accepting without any label or emoji
because you need either one
ah
thats like saying you are adding a title to an embed with nothing in it
i'll try to do a console.log to check if it fetch the server icon
maybe a zero-width space if discord trims the input
yea try that
fk, it worked with a space
whats the full code
why you don't do
if(!message.content.startsWith(prefix) || message.author.bot) return;
const [cmd, ...args] = message.content
.slice(prefix.length)
.trim()
.split(/ +/g);
const command = client.commands.get(cmd)
if(command) command.execute(message, args);
here the full command code
const Partnerchannel = require('../../database/schemas/PartnershipChannel');
const GuildConfig = require('../../database/schemas/GuildConfig');
const error = require('../../utils/embeds/ErrorEmbed');
const { MessageEmbed } = require('discord.js');
module.exports = {
name: 'partner-stats',
desc: 'Check all stats and details about Partnership module.',
run: async (client, message, args) => {
const guild = message.guild
const channel = await Partnerchannel.findOne({
serverID: guild.id,
serverName: guild.name
}).channelID;
const Guild = await GuildConfig.findOne({
serverID: guild.id,
serverName: guild.name
});
if(!Guild) {
return error(`Something went wrong while executing the command.`, message, message.channel, client);
} else {
console.log(guild.iconURL({ dynamic: true }));
const embed = new MessageEmbed({
author: {
name: 'Partnership Stats for - ' + guild.name,
icon_url: guild.iconURL({ dynamic: true })
},
thumbnail: {
url: guild.iconURL({ dynamic: true })
},
color: '#9D37C6',
fields: [
{
name: `${client.emojis.cache.get('850732067876241418').toString()} Total Partner Managers`,
value: `**${Guild.totalPartnerManagers} ${client.emojis.cache.get('851006300883779594').toString()}**`
},
{
name: `${client.emojis.cache.get('851076208904634378').toString()} Last Five Timestamps`,
value: Guild.PartnerManagerTimestamp.join('\n')
}
]
});
message.channel.send(embed);
}
}
}
try message.guild.iconURL(), probably wont make a different but worth a shot
having fun with detritus? lol
YUP 😆

im slowly but surely taking over
curious, brain, feud, evie, everyone starting to use detritus
lol
detritus is blessing for ts haters
has buttons been added to d.js yet?
its on master branch, not yet stable







