#development
1 messages · Page 1686 of 1
Not my website. It's a partner's and the link is a 302
You can log it from where the command is executed/run. For example like mine is executed from message event js try { const time = moment().format('YYYY MM DD HH:mm:ss'); command.run(message, args); console.log(`${time}: ${message.author.id} used command: ${command.name}`); //Log what command used } catch (error) { console.error(error); }
This of course the simpleton to check who run the command and what command. You will need to replace the console.log line with your own db/json or whatever you prefer. This is what it look like :
I'm saying used on a user not how many time it's been used
My ram usage is way too high due to cached presences omegalul

hi
With?
anti-spam automod,
I tried to follow a tutorial on youtube but it doesnt work
i understand how you do it but i dont know how
Don't follow outdated YouTube tutorials
do it your self :C
its from march
//----------------cus----------------
bot.on("message", message=>
{
if(message.content.startsWith("help customembed"))
{
let customembedhelp = new Discord.MessageEmbed()
.setDescription("customembed <thing you want to embed>")
message.reply(customembedhelp);
}
if(message.content.startsWith("customembed"))
{
let args = message.content.split(" ")
if(!args[1])
{
message.channel.send("please enter Something to embed");
}
else
{
let customembed = new Discord.MessageEmbed()
.setDescription(`${customembed}`)
message.reply(customembed);
}
}
});
those are two conflicting statements
`<Message> have all the information you need.
whats wrong
You tell us
its from 16 march
idk i am coding on mobile terminal doesn't show anything on error
i dont think it's outdated
It doesn't matter, just think of a logic and implement it
wait what is this
Have you tried logging anything in the ready event to check if the bot even connects to the gateway?
you are trying to put an embed as itself's description?
What do they mean by The only guaranteed properties are code, channel, and url. Other properties can be missing.
https://discord.js.org/#/docs/main/stable/class/Invite?scrollTo=code
gdfzhgf
since you need perms for it
Meaning anything other than those properties can be null or undefined
like manage invite
Alright!
Question.
Instead of using .toString(), can't I just use invite and finish?
Or should I really use invite.toString()
invite? The invite object?
The parameter invite
Yes.
Example, in the channel object, I send the channel without toString() and it doesn't send the channel object.
Instead it sends the mention of the channel
Can't it be same for the invite where it sends the link?
i could make a bot shutdown command by just making it run objects that dont exist so that there is an error and it stops working
Yea then you don't need to cast it to string since its automatically casted to a string in that method @feral aspen
use process.exit();
Ohh, alright!
yes that would work too, but im on replit
and that isnt my target rn
that works on every platform
im doing like 3 researches at the same moment
anyone know discord.py
i want the write a music bot with discord.py
but i dont know youtube_dl
library
Welp
I made a chat bot
It's returning this...
.. and whenever I try to set a channel in the mongodb database, it won't work.
It stays null...
// Invite Create Event
if (server.inviteCreate === null) {
modlogs.addField("**Invite Create**", `:offgray: - Disabled\n\`ID: invitecreate\``, true);
} else {
modlogs.addField("**Invite Create**", `:onblurple: - Enabled, set as <#${server.inviteCreate}>\n\`ID: invitecreate\``, true);
};
// Invite Delete Event
if (server.inviteDelete === null) {
modlogs.addField("**Invite Delete**", `:offgray: - Disabled\n\`ID: invitedelete\``, true);
} else {
modlogs.addField("**Invite Delete**", `:onblurple: - Enabled, set as <#${server.inviteDelete}>\n\`ID: invitedelete\``, true);
};
.. and yes I do use the save() to save the channel, but it doesn't work, idk why.
server.inviteCreate is a method, isn't it
{
_id: 603be640f73d0e283025be0d,
name: "Alright, Don't Ask",
serverID: '737011108954505267',
prefix: 'ok!',
description: 'Welcome to my server.',
mutedRole: '776710562821570560',
guildMemberAdd: '758978182807420938',
guildMemberRemove: '758978182807420938',
messageDelete: '758978182807420938',
messageDeleteBulk: null,
messageUpdate: '758978182807420938',
leaveMessage: '**{member_name}** left the server.',
__v: 0,
joinMessage: 'Welcome **{member_name}** to **{server}**.',
autoRole: '776710533130223626',
embed: true,
dmJoinMessage: 'Welcome to our server, **{server}**.',
dmLeaveMessage: "It's sad to have you leave our server, **{server}**.",
dmEmbed: true,
roleCreate: '758978182807420938',
roleDelete: '758978182807420938',
roleUpdate: '758978182807420938',
channelCreate: '758978182807420938',
channelDelete: '758978182807420938',
channelUpdate: '758978182807420938',
inviteCreate: null,
inviteDelete: null
}
Returns this.
Oh it's custom data
let invite = `click the emoji to invite me => [💋](link)`
message.reply(invite);
i used the above code but it isn't getting sending as hyperlink it sends it as normal text
hyperlinks only work in embeds
only webhooks can send hyperlinks in a normal message content
ok
imagine sending a non blue hyperlink because the hyperlink text is a emoji
there's a few creative uses
hyperlink custom emojis that make up a button picture for example
but it doesn't show up well on mobile because parsing breaks lol
Is it possible to have a clickable link in a Embed, in the Description. And if it is possible, how can I do that.
guilds.forEach((item, i) => {`Guild ${i + 1}: ${item.name} ${item.id}`})
i wanted to add this on a embed description should i map it or something?
the subtle art of slapping await in every syntactically valid position
I think you missed a few awaits in there
await guilds.forEach(
await (async (item, i) => {
await `Guild ${(await i) + await 1}: ${await item.name} ${await item.id}`;
})
);
await will have no effect on that expression
that should fix it hopefully
therefor, unnecessary
oh thanks oop
yo
lmao
no more awaits
i just want to add it into an embed
no jokes this time
not enough awaits
need more awaits

I am using quick.db how do I define it
To answer your question, you should use map instead of forEach. map returns an Array<string> which you can .join("\n") or some other character other than \n
const db = require('quick.db');
Also, that's incorrect
oh alright
Wouldn't that be more inefficient?
db is defined but if there is this in the database, I want it to send the specified message.
Is that a blacklist command
Compared to using forEach, yes. Their goal is to cast all their guild names and ids to a string into an embed description
yes
so i don't need a foreach function
Could it be replaced with a for instead?
replace forEach with map
if (x, true)
this is gonna be a fun bug for you to figure out lol
KEKW
not you
not you I was talking to the zmod person
oh lol
anyone know what database I should use that doesn't take a year to learn and use properly

what would the for keyword be for? for is for iterating over an Iterable, but they'd be concatenating strings together manually which is more work than just casting all of the guild Objects to an Array<string> in the format of ${item.name} ${item.id}
and then joining the Array together then passing that to the embed description
Which is what map is for
just pick any it doesn't matter
This could technically be done in just one loop with a for, though bear with me since I'm pretty much tired by now
sqlite is alright
what if my answer is mongodb
I don't care you can use mongodb
if things can be done in one loop, then a for is not necessary
But yeah to be fair I see why map would be used instead
ok
quickdb best db
How would a map exactly be done here?
it's not my project so it makes absolutely no difference to me
I mean all I store is guild settings
for a discord bot
but will my bot be approved if its using postgres? 
https://fauna.com is a fun one you can try
my bot actually runs on a dedi using docker lol
i legit had someone dm me sking that
oh I tried that before
but I prefer having the database not serverless
why does that make any difference to you
I don't wanna pay thier pricing stuff
also you have a dedicated server + docker but you're sitting here twiddling your thumbs over a hard database? lmao
guilds.map((item, i) => {item.name, item.id}).join("\n")
would this be a thing or am i horribly wrong once again?
that dedicated server isn't managed by me
that's not even valid syntax
the fuck am i looking at
just go look up what map does and don't guess
template literals do be hard
ight
lookup template literals while u at it
guessing with 0 programming intuition is like the most painful thing ever... for both parties involved
yes
for:
const guilds: Map<string, Guild>;
let string = "";
for (const g of guilds.values()) {
string += `${g.name} ${g.id}\n`
}
embed.setDescription(string.trim())
map:
const guilds: Map<string, Guild>;
const string = guilds.map(g => `${g.name} ${g.id}`).join("\n");
embed.setDescription(string);
welcome to #development
it's ok I have plenty of experience helping randoms
the worst part is when you have to help someone with 0 Programming knowledge
With map it's technically two loops, right?
not my first rodeo https://simp.pics/image/UCKK4fHUG_fiS2lp
map once, and what about .join?
I mean 2 loops is basically the same thing as 1 loop
there's no difference in time complexity
Array<T>.join(string); joins all entries of the Array to a string joined by the string passed to join
jesus christ
why do I think of binary trees when I think of time complexity
Oh, don't mind my sleepy me's curiosity
lol
Ya anyhoo thanks for the explanation
TS is a lot of effort for what it's worth. Just be type safe in JS with VSCode and CheckJS
well in all fairness im not too far off either
im lovin it ||not sponsored by mcdonalds||
its not
its literally annotating types
if you are REALLY tired of ts

Not a huge effort to where it's unbearable, but if your project is already JS, don't bother unless you absolutely need TypeScript
just slap //@ts-nocheck ontop and just enjoy the intellisence from it
lol
coULd NOt finD A DEcLaraTIon FILE FOr MoDULE 'moDULe-NamE'.
Also this
just slap //@ts-nocheck ontop and just enjoy the intellisence from it if you really that bothered
or require()
its not like ts ONLY offers types btw
just change require to import
theres a shitton other features you can use from ts
interfaces
the map seems to be working fine for me, thanks. Now i need to create a paginator and all done
TS is mainly just type safe JS, but offers compilation to lower versions of es standards
cool 
this barely scratches it btw
That emote is so cute
if I said that on twitter I would have been cancelled by the python devs
i just felt like there was no point rewriting a bot in ts but i did it anyway and now i feel like i regret it
now i have to cope with it
Twitter is breeding ground for narcissists and adult toddlers who only cry and never listen
I have a ts branch for my bot and it was painful beyond compare
yes
twitter is just a toxic wasteland
sounds like yall are not used to ts, thats about it

literally the only people i hear complaning about ts is people who havent used it for more than a couple weeks

Hey Erwin I'm used to TS
lies and deceit
wow excuse me i am used to transport stream

I have and didn't complain
lol
April Fools!
tis the third u dork
just say anything controversial on twitter on april 1st and say it was april fools
i will slap you with a chair
wish I had a chair in my room
ik it compiles to js
i mean cmon
but still
am i on the wrong shiv ? 
Why you gotta do me like that, man
Typing annotations gang
imma bring all my ts shit to it
fuck calling crap ctx
fuck calling bots self
fuck calling shit snake case
Every program that can be written in JavaScript will eventually be written in JavaScript
For what it's worth, if I'm writing something new, I'll use TS because I love type safety, but for old projects, I won't bother converting. I'm proficient enough in JSDoc to do just about whatever I need to
fuck all that crap
what
imma add whatever i want
NO ERWIN
I'LL BLOCK YOU
NO BALLS
NO BALLS?
NO
YOUR MAMA IS PASCAL CASE
I SHANT YIELD
YOUR MAMA BOUTTA LOSE HER TYPING ANNOTATIONS
YOUR MOMMA BOUTTA GET A TYPE ANNOTATION OF BIGINT
that hurts
YO MAMA CAUSE AN INTEGER OVERFLOW IN PYTHON
Shitposting in dev. Kinda weird
It's dev shitpost
indeed
discord is just one giant shitpost

Exactly!
always has been
and thats precisely why we should recommend devs detritus, so we improve the future of our developers
why are you visiting that site doe if you're not a beginner
so I can copy paste code ofc
*this meme was made by intellisense gang*
true
hence why we should foward people to detritus
so they are forced to learn to use intellisense
since theres barely any docs

lol
do it for the future of development. Detritus for president # 2024
erwin why are roles in collection<role> nullable in detritus
i really liked channel.can() though
no need for long permissionsFor() or permissionsIn()
theres quite a few other handy methods like that
channel.canReadHistory
import discord as discord_chan
lol
CAN
@slender thistle
if (message.author.username === 'Shivaco') hugs.request('Shivaco')
🥺
and guild permissions
@marble juniper 
check admin => check guild role perm => check overrides
if any of those come, it returns true
i think username comes with whole thing
if you mean with discriminator
hmmmm let me check that rq
i wanna compile es2020 code with babel but their docs is bs so i cant find a way to configure that with .babelrc
man i want that
*import * as discord_chan from "discord";
@pale vessel
what the fuck
also what i said
that doesn't sound too good
if u change names i think it gets pushed into that array
i hope it doesn't
changes name 999 times
well duh of course it probably has expiration
i c
also discord ratelimits on changing nickanmes
same
just checked
like unironically I want a keyboard like that
goooooooood
where can i buy it?
lol
yes
@opal plank are you still working on your "epic" discord api lib
but an array for names is kind of odd though
no need to make a discord lib when detritus is around


❓
yes
I expected detritus to have more memory usage than discord.js
Im ||dissappointed||
lol
detritus pog
Guys, i just finished coding a rps command, how is it possible that it has OVER 90 LINES.
it literally is more long than moderation commands

lol
the heck is an rps command
rock paper scissors
Rock paper sci-
Science
didnt i make one before in here?
what
no.
i spent 1 hour+ of my life coding a rock paper scissors command...
how
how
how can you spend an hour on a rock paper scissors command
I would only need 10 minutes at max
lol
with embeds, 10 possible events, reactions, etc
1 hour ain't bad
for 10 possible events i mean that the bot could win in 3 possible ways, same for the player, it could end in a tie in 3 ways, and the user could not answer in 30 seconds
:DD
fun fact: i did this command because i couldn't do the anti-spam automod thing and i felt bad
i needed to do something
function gr() {
return ['rock', 'paper', 'scissors'][Math.floor(Math.random() * 3)]
}
switch(args[0]) {
case 'rock': {
let gr = gr();
message.reply(`You played ${args[0]}, i played ${gr} and ${gr === 'rock' ? 'we tie' : gr === 'scissors' ? 'you lose' : 'you win'}`);
}
case 'scissors': {
let gr = gr();
message.reply(`You played ${args[0]}, i played ${gr} and ${gr === 'scissors' ? 'we tie' : gr === 'paper' ? 'you lose' : 'you win'}`);
}
case 'paper': {
let gr = gr();
message.reply(`You played ${args[0]}, i played ${gr} and ${gr === 'paper' ? 'we tie' : gr === 'rock' ? 'you lose' : 'you win'}`);
}
}
@solemn quartz done
let me actually try that
oh
imagine not using modulo to calculate the result of rock paper scissors
oh x2
h
mfw fallthrough case
pog trough pain
8 minutes
function gR(): string {
return ['rock', 'paper', 'scissors'][Math.floor(Math.random() * 3)];
}
switch (args[0]) {
case 'rock': {
let gr = gR();
message.reply(
`You played ${args[0]}, i played ${gr} and ${
gr === 'rock' ? 'we tie' : gr === 'scissors' ? 'you lose' : 'you win'
}`,
);
break;
}
case 'scissors': {
let gr: string = gR();
message.reply(
`You played ${args[0]}, i played ${gr} and ${
gr === 'scissors' ? 'we tie' : gr === 'paper' ? 'you lose' : 'you win'
}`,
);
break;
}
case 'paper': {
let gr = gR();
message.reply(
`You played ${args[0]}, i played ${gr} and ${
gr === 'paper' ? 'we tie' : gr === 'rock' ? 'you lose' : 'you win'
}`,
);
break;
}
default:
message.reply('invalid input');
}```
what's your point
HA ERROR
they're starting out plus they have much more stuff to add
your typo sounds like nickanimes
it should have said you lose >:)
whats wrong with nickanimes?
@crimson vapor weeb
ok how did that line break happen
how would i make for example us1.node.solarhost.club:2020 go to mystik.dev with no port
I opted for this monster
i couldn't even send it here
why is everyone silent now?
lmao
can someone help me pls
what
what
yes
me too
this was when es5 was new
but dude
we have es2020
and further
lol
es5 is from 2009
esIndentation Beyond
1st rule of programming:
If it works, DONT TOUCH IT.
what no
you cant possibly argue bad code is okay just cuz it works
performance is something to account in coding too
too much code
here's a shorter one:
// copyright code913 do not copy 
const rps = ["rock","paper","scissors"];
let c = rps[Math.round(Math.random() * 3)];
let p = rps.includes(args[0].toLowerCase()) ? args[0].toLowerCase() : null;
if (!p) return message.reply("dude are you dumb that's not a valid choice");
message.reply(`you chose ${p} i chose ${c} ${rps.indexOf(p) > rps.indexOf(c) ? "ye won :sob:" : rps.indexOf(p) == rps.indexOf(c) ? "draw :angry:" : "i won"}`);
oh shit forgot to reply to the message
code is code
and if its horrible its hard to maintain
lewd'ly if possible
or add new code to it
yes
just in case you need it, here's a one liner:
// copyright code913 do not copy 
const rps=["rock","paper","scissors"];let c=rps[Math.round(Math.random()*3)];let p=rps.includes(args[0].toLowerCase())?args[0].toLowerCase():null;if(!p)return message.reply("dude are you dumb that's not a valid choice");message.reply(`you chose ${p} i chose ${c} ${rps.indexOf(p)>rps.indexOf(c)?"ye won :sob:":rps.indexOf(p)==rps.indexOf(c)?"draw :angry:":"i won"}`);
it's literally just the whole code without line breaks and spaces
that means : dont copy it, cuz you likely dont understand what it does
break your brian?
noo brian is my best friend :C
let me make ur life a lot easier
using this code
const SELECTIONS = [
{
name: 'rock',
emoji: '✊',
beats: 'scissors',
},
{
name: 'paper',
emoji: '✋',
beats: 'rock',
},
{
name: 'scissors',
emoji: '✌',
beats: 'paper',
},
]
function isWinner(selection, opponentSelection) {
return selection.beats === opponentSelection.name
}
fuck discord
there
its that easy
doesn't need a million if statements
too clean for me
too easy on the eyes for you
There's never too clean unless your code is literally unoptimized
yes but it works :))
yes but its shit
no
completely fucking dog shit
no u
its horror
no u
its worse than any horror game or horror movie that I have ever seen
no u
I reverse all no u's
i reverse this message
no
no u
you'll legit need this in a couple days by doing that spaguetti fuck you're doing rn
do you even know whats going on, in all honesty?
it feels like you just copy/pasted everything over and over
like its some sort of lego building
i did
well thats why
hey erwin
i like legos
its coding not tetris
i wanna tell you smth
I think your code deserves this
but you have to promise not to yell
cannot promise if its about embed builders
take this badge
its not
Descriptive variable names count as comments.
you are hurting my code's feelings
we're trying to get you to stop being stubborn and fix ur code
this_variable_contains_my_response_body_rendered_in_json
this_other_variable_contains_the_parsed_response_body_rendered_in_json
this_fucking_variable_that_took_me_an_hour_to_figure_out_that_contains_my_data_that_i_store_and_use_globally
about to create fibonacci's pyramid with that shit

I laughed at that harder than I should have
lmaooooo
the numbers inside contains the amount of spaces from the margin
reminds me of what react had

but look how good it looks :))

w3schools has the most cancer variable names
myShit myVar myFunction myAss myMy
how about you start adding each command in its own client.on('message') too?
actually
wait a second
chotto matte
that is pog
why should i?
except the emojis
what
i would not doubt they are actually doing a listener per command

scary
never have 2 listeners for one event
thats a rule I follow
let's go for three then
and btw im italian and im making the bot in english, so coding is actually more difficult for me
they mean dont have more than one client.on("thighpics")
no shit
you are using the least human readable language in existence so it doesnt matter
i think i'll just go to sleep, best decision i can take rn
gasp me too
correct, only have listeners inside your commands
i just finished my total cancer frontend on my multiplayer repl and left my friend to do the other shit
time to go back to FBI memes
NOOOOOOOOOOOOOOOOOOOOOOO
oh btw i have an exposed .env because it's in a different folder and repl doesnt care
i'll slap you with a chair
dafuq going on here
hi timmy
wdym nothing, you guys are trashing my home and wrecking my chairs
best way to teach someone to fix their code
and i will continue to bully you into being a good dev
yes
const predictions = await model.predict(img_tensor).dataSync()
for (let i = 0; i < predictions.length; i++) {
const label = labels[i]
const probability = predictions[i]
const percentage = Math.round(probability * 100)
if (label === 'thighs' && percentage > 80) client.emit('thighpics', attachments[0].url)
console.log(`${label}: ${percentage}`)
}
we will booli untill you learn how to write good code
code that is not hell
code that a dev can read
other than you
if nobody else can read your code it reduces impostors 😎
lol
IoI
there are bugs among us
guys
Line 420 wasn't a bug
2 bugs are remaining
1 thing
IoI
2 thing
whats sqlit
sqlite is a database
hm
and i used the quick.db package to use it
so can someone suggest me a free simple to use database and what i should try to do with it so that i can understand db s ?
@flat pelican do you think i am able to run a flask server in a cog?
read the message right above
in a cog?
what lang
yes
you mean with a Discord bot?
shiv gave me a aiohttp thing
yes
but i want to try flask
if not aiohttp works
but flask > aiohttp
run it async
basically
🤔
local
d.js
flask isn't supporting async btw
Try quart probably
but whatever
or Sanic
but you can run flask inside a cog technically with threading
but like do i just run it?
or do i need to do some weird shit?
Quarrt?
yes
Since it's async you don't really need to worry about threading it
do i need to do the aiohttp thingy u did
help pls
or just normally runing it?
im getting started with threejs and im getting this error
var scene = new THREE.Scene();```
reference threejs from a cdn
@pale vessel you think nested code is bad? try using deno
reminds me of java
i mean its supposed to not be touched but
@pale vessel DUDE I THINK I FOUND A WAY TO GET V14 NODEJS ON REPL
Make a deno repl then change the run command in .replit to run="node yourfile.js"
for some fucking reason they have node v14 loaded on node's younger bro but not on it's own one
why don't they just update node on thier node.js repl's to v14
like just why
v12 isn't even lts anymore
Wtf
what is wrong with this code?
<p style="color:white;font-size:150px;">IMPORTANT:</p>
<p style="color:white;font-size:50px;text-align:center">The bot should be always online, but if it is not, then it crashed. (if it is offline, please PM 𝐄𝐥𝐢𝐬𝐨#4303 because it most likely crashed)</p>
this is ur queue to ping shiv, voltrex or some other weeb
it won't load on the website
read your style tag again, but slowly
color: white;
css doesn't care about whitespaces
i don't think that's it
hold up, "won't load the website"?
css can't prevent a website from loading
or that HTML either
How do I check how many roles are in a server?
in which lib
check the docs
guild.roles.cache.length
on top.gg, my html won't load
just that part
guild
<p style="color:white;font-size:150px;">IMPORTANT:</p>
<p style="color:white;font-size:50px;text-align:center">The bot should be always online, but if it is not, then it crashed. (if it is offline, please PM 𝐄𝐥𝐢𝐬𝐨#4303 because it most likely crashed)</p>
your color is white and your background is white 5head
i copied the latest one from the cdn https://cdnjs.cloudflare.com/ajax/libs/three.js/r127/three.js but im getting errors still
what if you try another color
ive been following the tutorial on the site
css is fun
nope
second problem is your text is so big (150px) your computer displayed it off screen
bro just use <h1> instead of styling your font size
i want it specific
hey did you know by the way there's a PREVIEW feature in the edit page? lol
explain this https://pls-hug.me
look at it on mobile
lol
@mighty ember does it work on preview or not? Cuz it works here
Ey LTT gang
crazy how they actually made an OF account and uploaded uncensored version of their April Fool's video
not me planning to open one when i turn 18
is it possible to import nodejs builtin modules in deno
2 more months lol
amazing
uh
Why?
i don't think so
damn you're young
just use node, perhaps
^
no
tell me why deno is better
deno has its own version of the built in modules, no?
I don't think so.
Yes, it does.
you have to use the deno versions
deno supports typescript or something idk
boring!
deno is a fanatic idea that'll never live up to its expectations
What makes you say?
its just not that necessary
just found that deno has their own library for importing commonjs modules
not sure if it works for node builtin modules
no it cant import builtin ones
time to use the deno ones
you're doing var time = something(time) , how do you expect time to be defined before it's defined?
node can't magically know what the second time is.
¯_(ツ)_/¯
(technically the first one)
if you're not in strict mode the second time would be undefined iirc
emphasis on iirc
let captchaChannel = database.query(`SELECT channel FROM captcha WHERE guild_id = ${server}`);
let captchaLogs = database.query(`SELECT logs FROM captcha WHERE guild_id = ${server}`);
let captchaRole = database.query(`SELECT role FROM captcha WHERE guild_id = ${server}`);
const embed = new Discord.MessageEmbed()
.setColor("#24B2E4")
.setDescription("*If you ever see `#deleted-channel` and/or `@deleted-role` and/or `undefined`, please edit the configuration with the `s.edit` command.*")
.setFooter(`Command requested by ${message.author.username}#${message.author.discriminator}`)
.setTitle("🛠 | Captcha - Panel:")
.addField("📨 | Verification channel:", `<#${captchaChannel.values}> (**${captchaChannel.values}**)`)
.addField("🏅 | Role given when the user has successfully completed the captcha:", `<@&${captchaRole.values}> (**${captchaRole.values}**)`)
.addField("📩 | Logs channel:", `<#${captchaLogs.values}> (**${captchaLogs.values}**)`)
//.addField("⏰ | Verification time:", `${time} seconds`)
message.channel.send(embed)```
In my database, there are identifiant (check picture), but my bot return « undefined » for `captchaChannel`, `captchaLogs` and `captchaRole`, why??
Can you not do SELECT * instead of doing 3 different queries for each values
like, why 3 separate queries
Also, you should learn about asynchronous code. Guaranteed 100% your database queries aren't sync, so you need either a promise resolve or a callback for each of your queries.
No because there will be several servers in this table
are you sure database.query is not async?
there will definitely be several servers
that's why oyu have a WHERE clause
SELECT * means "get all the columns" not all the rows.
module.exports.run = async (client, message, args, emojis, database) => {
i have this on the top of my command
Or, I mean, you could do SELECT role, channel, logs FROM captcha WHERE guild_id = ${server};
Ok and what's database
await database.query()
in my message.js event: let database = mysql.createConnection({ host: login.host, user: login.user, password: login.password, database: login.database });
Ok so mysql being which npm module
message***.js***
the require part
@delicate zephyr @modern sable weeb
wait it was mysql2 you were using, wasn't it?
which uses callbacks, not promises
like this ```js
connection.query(
'SELECT * FROM table WHERE name = "Page" AND age > 45',
function(err, results, fields) {
console.log(results); // results contains rows returned by server
console.log(fields); // fields contains extra meta data about results, if available
}
);
everytime use function() ? @umbral zealot
you need to have a callback, yes.
Ok, thx u for your help 😉
read all about 'em here https://js.evie.dev/functions#callbacks
you could also use arrow functions
yeha but let's not confuse the solution with more data that's not relevant
they'll figure it out
arrow functions are hot
i mean i think they literally look nicer
and for this, i defined this with x (example) and for get info, i do x.channel?

yes
but only in the callback
Ye
I'm a professional stake.overflow search coder lol
is there a bot where i can ban members with similar names?
gasp me too
but which
try em and see which works
or make your own
¯_(ツ)_/¯
no
I'm bot in the stage of adding my bot yet lol
or raid protection, or alt protection.
or dbl weeb protection
That is 99% of dbl
100%. The remaining 1% just doesn't accept it or know it yet
or they are not weeb
ez, if you've ever watched anything that's animated and drawn on a tv screen you're a weeb so it's fine we're all weebs by definition.
is Tsubasa anime
Transformers? That's as good as watching Gundam Wing, you damn weeb 😛
😳
Issue? @blissful coral
one sec
@blissful coral lol
Bruh
ok so i have this
if(message.content.startsWith('$claim')) {
let voted = await topgg.hasVoted(message.author.id)
if(!voted) {
message.reply("You havent voted yet. Use $vote to vote on top.gg")
} else {
message.reply('Thanks for voting and supporting us as we grow! You have been awarded 25k bobux')
this.economy.addBal(message.author.id, 25000)
}
but people can keep spamming $claim
and get infinite
Use a database to check that they Already used the command
const Discord = require('discord.js')
module.exports = {
name: 'createchannel'
aliases: ['c'],
run: async (message, args) => {
const createChannel = message.guild.createChannel(name, "text")
message.channel.send("i have created channel")
}
}
It's a code that let's your bot create but it doesn't work at all pls help :(
ok
but i have 300 users
so i have to create a new thing when they vote i guess
You only need to use a time stamp for when they use the command properly
Idk what dB you use so I can’t help Past this
Fuck phones amirite
mongodb (mongoose)
the webhooks are confusing for me
i dont understand them
Just create a model for it, or add it to the user model, then set it to a time stamp when they use the command. Then check if the time stamp is less than 1 day away and they voted
const Discord = require('discord.js')
module.exports = {
name: 'createchannel'
aliases: ['c'],
run: async (message, args) => {
const createChannel = message.guild.createChannel(name, "text")
message.channel.send("i have created channel")
}
}
It's a code that let's your bot create but it doesn't work at all pls help :(
banned 106 tesla acc
Right
You got raided
yea :C
For me I love getting raided
with 106 accs
why?
Even tho they no active they still members
And makes you server count look good
what my server has 1k members and happy with them
Same but I'm stuck at 1k
Pls someone help
me too lol
whats the max number of characters in a message
what version r u using
im pretty sure u use message.guild.channels.create
2000
1048 in add field
mfa_enabled: false,
what does mfa mean in discord user accounts
ohh right
so why does the user response from the discord api give info on that part
wheres the docs for <client>.generateInvite()
What library are you using?
If you're using Discord.js, see https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=generateInvite
what is wrong in this it is not reponding nor giving any error py @client.command() async def randomnum(ctx, num1,num3): if num3 > num1: await ctx.send('2nd number should me smaller than the other ') else: num2 = randint(1, num1) await ctx.send(f'the number is {num2}') if num2 == num3: await ctx.send('you won !!!') else: await ctx.send('you lost ...')
One issue is you aren't setting the type of num1 or num3
it will be int right ?
yah
How do I make my embed line up like these
should work without it
It'll default to string.
Oh wdym?
The description of the command just seems to be short.
My previous message wasn't directed to you.
So my description must be short?
Depends. What exactly do you want to line up about the embed?
sir now ?? py @client.command() async def randomnum(ctx, num1,num3): if int(num3) > int(num1): await ctx.send('2nd number should me smaller than the other ') else: num2 = randint(1, int(num1)) await ctx.send(f'the number is {int(num2)}') if int(num2) == int(num3): await ctx.send('you won !!!') else: await ctx.send('you lost ...') this is also not working
Interesting. Could you try testing if the command is even dispatching (like commenting out the code and just printing to see if it works)?
ok thank u will try and let u know sir
what language
is there a way to listen to new reactions of a message sent after the bot has been restarted?
Store the message ID somewhere, and load it when your bot starts
thanks
sup ppls
or use your library's raw event
@opal plank does detritus have message collectors built in?
no
How are they made then?
just good ol client.on()
Listen for messages, run your processor, do something if it passes
Does d.js have to check if its a stage channel
let VC = message.member.voice.channel || Need to have it here
Discord.js does not support stage channels, but a pull request is currently active implementing it. https://github.com/discordjs/discord.js/pull/5456
ooh ok
you never told me you were a book
how do you sync a channels permissions with its category in discord.js
or does it do it automatically when you make a channel with a parent
it should sync automatically when created
ok thanks!
Hi
ello
Please keep this channel English only
Also this is not a codeshare server so if you need any development questions feel free to ask in here.
Anyone have a banned script command without voting in top.gg?
I just wanted to ask like how can I do it
hi
Cannot POST /submitdata
@crimson vapor any idea why I would be getting this?
nvm my dist just didn't update
does anybody know how to get values from mongo in descending order using python
can someone help me with an error










