#development
1 messages · Page 1256 of 1
Hello?
Hell
stop
ive even narrowed down the methods you'll need to use
fucking
Hello
saying hello
Ok

Hi
NO MORE GREETING WORDS
Ok
Ok ok ok, on topic mode
Ahhhhh wrong place, but is the right place to ask
idk how this works, I am just here to eat the bamboo that grows here.
Hey, somebody have a bot to delete messange?
?????????????? Why?
len = this.buf.write(err);
I need delete a conversation with a girl
closer
no?

right click message and delete @junior sun
Can’t help you fix that mess
bots cant access Direct messages either
@junior sun
^^^^
Damm
delete the dm
😦
delete 1 by 1
its an X
and its gone until you open it again
Shit, okay
You can only delete your messages
Thanks guys
Np
erwinnnn
no
un confusedd
What?
how
JAJAJA
it imports
Erwin is drunk, its best to do what he says, or someone is asking for an angry cat with a gun to come to your house
it doent
lmao imagine this as import
Erwin throw mdn at the man

i threw them the node, which is way more complicated than mdn
i threw aki at the lions and laughed at it

I like your thinking
thats literally the last bit he hwas to figure out
Yes

see u guys
o/
it was a pleasure
I have come to this channel again. What if client.guilds is empty? The bot belongs to two servers
client.guilds.cache.forEath(guild=>{})
return this.utf8Write(string, 0, this.length);
^
TypeError: argument must be a string
at Buffer.write (buffer.js:1038:17)
at process.<anonymous> (C:\\\\\index.js:52:15)
at process.emit (events.js:321:20)
at process._fatalException (internal/process/execution.js:165:25) {
}
PS C:\Users\Owner\Desktop\discordjs2> node .
C:\Users\Owner\Desktop\discordjs2\index.js:52
len = this.buf.write(err);
^
TypeError: Cannot read property 'write' of undefined
at process.<anonymous> (C:\\\\\index.js:52:20)
at process.emit (events.js:321:20)
at process._fatalException (internal/process/execution.js:165:25)
PS C:\\r\\discordjs2> node .
throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
^
RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 2. Received 6000
Foreath?
Your cache might be fucked if your bot is in two servers but you get none in cache
Oh for each
or they disabled caching
Aah. I have a Problem
If you print out the guilds object, will it display the object object bs or not?
So I basically want bot the permissions that only those members who have permission to ban and kick members Can use it.
ok
But?
bad dev
Bruh
if you quit at every reoadblock you wont get anywhere
I really don't know js
client.guilds.cache.array() //=>[]
Except this following code
console.log("Hello world");
read this, at LEAST
what Erwin said, or YouTube’s
hmmmm then idk
JavaScript fucks my brain up
O<o
😦
Why didn’t you start with that?
Why didn’t you start with that?
@vernal rivet I find Py easy
Nah, I was going to throw the disgusting discord.py docs at them
var buf = new Buffer(10)
length = buf.length(0, 1000)
len = buf.write(err, 'ascii')
stop using var
ok
Var is not needed here
const
neither

Nah, I was going to throw the disgusting discord.py docs at them
@vernal rivet lmao
erwinn removed
||I was trying to save my butt from Erwin||
Am I any closer
var buf = new Buffer(10)
length = buf.length(0, 1000)
len = buf.write(err, 'ascii')
@solemn leaf bro I can't understand this thing 🥺
¯_(ツ)_/¯
why

8%
the fuck
I only know python 😦
did you have to ping
You should learn more languages its fun to do
man I was about to remove the thing I did 🥺
last 8% dude, figure it out, we already gave you all the rest of the code
try and error
DUDE
ive even narrowed down the methods you should be looking at with that link
I DONT FUCKING UNDERSTAND THE DAM ERROR

You should learn more languages its fun to do
@vernal rivet I am fucking my brain up with python 😂😂. Then I will go on to the next languages
Lol
I started with cpp, so idk what its like to take the easy way out
THTA ISNT HELPING
WELCOME TO DEVELOPMENT

After all, what should I do?
Ok ok ok, what Erwin is trying to say, is that there is something that you have to do on your own, this is one of those things. We gave you everything to do this, all you need to do is read, and try and understand it. Try testing things and see what it does, that’s what we did.
You can do it. Programming isn’t a skill, its the understanding of the language. So I shouldn’t be hearing you say you can’t do it
wdym attacks? i provided you with 90% of the code you needed, the events, the cache, the way to attach the buffer onto the message attachments, the ONLY thing you need to do is convert the error to a buffer. and even on that ive given you a link with the only 7 methods listed in it. Simply read them. If i go any further i'll be spoonfeeding you the whole code. In development you gotta break your own legs dude, you wont always have someone to babysit you everytime you get stuck, its part of the challenge
those are the 7 methods listed
is it THAT hard to click each one and see what they do until you find the one that does what you looking for?
And now we stay calm, and hope for success
im calm, just drunk
what i get angry about is that even after ive linked them the docs they went onto stack overflow to get that this. . they clearly didnt even bother reading it
Calm your drunken side
unless that’s your not drunken side then I should run

Can someone please explain what's the meaning of Inline and where it is used?
If No, then ima head off to google
Inline:
field1 field2
Not inline:
field1
field2
In-one-line fields
A
B
I have error while instaling quick.db
Yeah
if (!channel) return console.error('Invalid ID or missing channel.');
how to fetch channel id when bot start
I sended it to u.
@pale vessel maybe use the fourth parameter maxWidth in ctx.fillText() so the whole text is filled in the smol box
im making something like this ;d
@blazing ravine what the hell is that emoticon
also are you using GLITCH!?

heyyy!
can anyone tell me how to do bot online?
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'discord token';
bot.on('ready', () =>{)
console.log('This bot is online!');
})
bot.login(token);
i put this code but it dosent work
in which place i have to put my bot token
@shut trellis https://discordjs.guide/ read this
thats the guide on how to make ur bot
it needs to be in a string
Make it an object uwu
i got a question
yeah?
so lets say
help command is in utility folder
and everythings in a command folder
how would i get the economy folder
did you put the path corrrectly?
send the code
but then const commands = readdirSync(`../economy`) dosent
you can just... loop through all of the subfolders of the commands folder
smh
instead of hardcoding it all
read from here, <#development message>
Anyone knows why when someone is entering it doesnt display?
} else if (message.type === 'GUILD_MEMBER_JOIN') {
message.channel
.send(MESSAGE_PREFIX + "Send '!verify' to access other channels")
.catch(reason => console.log(reason))
}
hey
if someone joins the guild theres no message.channel defined
@tight flame message.type is not a thing
message.channel.id === CONFIG.WELCOME_CHANNEL_ID
how can i make my bot that it autojoins the voice channel
@astral yoke use the guildMemberAdd event
just do channel = ... then channel.send
that i seted through quick.db
if (message.channel.id === CONFIG.WELCOME_CHANNEL_ID) {
if (message.content === '!verify') {
message.author
.createDM()
.then(dmchannel =>
dmchannel.send('Reply with your email for verification').catch(reason => console.log(reason))
)
.catch(reason => console.log(reason))
} else if (message.type === 'GUILD_MEMBER_JOIN') {
message.channel
.send(MESSAGE_PREFIX + "Send '!verify' to access other channels")
.catch(reason => console.log(reason))
}
let getChannel = await <quick.db>.fetch(<query>);
<client>.channels.cache.get(getChannel).join();``` @next flax
ok
what just use OAuth
i dont know how
first programming project?
tfw you copy paste from 4 different sources and wonder why it doesnt work
If you want to collect messages, create a message collector
that's the raw event and the message event handling glued together
it doesnt work again
wtf
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'discord token';
bot.on('ready', () =>{)
console.log('This bot is online!');
})
bot.login(token);
where i have to put my token
plzzz help me
did you run it
In that string
the const token = '' one
also that code is so copy pasted I swear I’ve seen it around 100 times now
i put the bot token on the const token but still it is not going to online
@shut trellis do you know actually how to program stuff
did you copy paste that code
some mod pin this messsage:
LEARN ACTUAL FREAKING PROGRAMMING BEFORE TRYING TO MAKE A DISCORD BOT
s m h
ok I’m gonna give you a quiz
- What is an array
- What number does an array start at
- What is an object
@shut trellis
i m new i m learning
alright ill teach you.
go and learn base JS please
this is how to make a full bot exactly like mee6.
base JS will make almost everything
you have to run it lol, see https://cdn.discordapp.com/attachments/272764566411149314/751193207479468223/20200118_183329-1-1.png
aRrayS stArt aT 1
do console.log('this is a bot!!!');
like 100% easier
do that and it works.
that makes a bot.
console.log('MEE6');
makes you a mee6 bot.
no it doesn’t
stop trolling
yes
and feeding useless information to a beginner who’ll believe it
@shut trellis please learn actual programming before trying to make a discord bot
https://grasshopper.app
https://developer.mozilla.org
https://w3schools.com
Grasshopper is the coding app for beginners. With fun, quick lessons on your phone, the app teaches adult learners to write real JavaScript.
okay

Why is there a bracket before setPresence
bin your code instead of taking your screenshot
and yes the error is correct, that isn't valid js syntax
and one after it
Curious I pulled file offset/game offset but not sure what to do now. When I try to readbyte it is blank for file-offset?
this code almost made me laugh to death
https://cdn.discordapp.com/attachments/272764566411149314/757162088937291847/unknown.png
an arrow function with only one line
with a guild parameter

:KEK:
@misty sigil GIB SERVER INVITE GIB SERVER INVITE GIB SERVER INVITE
shouldn't that be receivedMessage?
ok
looks really wrong D:
@next flax god do you seriously know anything about programming
give context to your question
hm
Did a search for a string, found in the heap an offset, compared with the parser by noexe
and got a gameoffset a nd file offset but nothing showing up when I call them
don't think they're pointers either, static search both times,different strings.
and yes the error is correct, that isn't valid js syntax
@earnest phoenixso how should i make it ok
as its wrong
so how should i make it ok
as its wrong
learn javascript =============== error fixed
just
;-;
WHY DO PEOPLE THINK THEY CAN MAKE THE BEST BOT IN THE WHOLE WORLD BY SPAMMING THE KEYBOARD AND CALLING IT A DAY
pls help boi
how can i remove that syntax error
How's this possible inside an array?
@earnest phoenix hey Voltrex help boi
What's the issue
You code has way too many syntax errors, you may brush up your javascript knowledge with the resources provided around internet
I spotted like 5 syntax errors in that single image
so please help to fix them
this is not the place to learn basics
hire a tutor or follow a course for that
this channel is rather for assistance with logic problems
@next flax
hey guys
how do i input these returns into an embed:
endGame(user);
return `\`Dealer stands with\` ${newTotal}\`; **It's a tie**.\``;```
this is one of the 10 returns i have
https://hastebin.com/oqifagakew.http my whole blackjack.js file
i have tried to create an embed
but it didn't work
let mootRole = await message.guild.roles.create({
data: {
name: "Muted",
color: "#FF0000"
}
});
``` how do i loop through all channels in a server and overide permissions so anyone with this role cant type?
what doesnt work in the embed?
anyone know why this doesn't work inside a while loop?
let test = toTimeUntil((await axios('https://url.private.com')).estimate)axios is an unexpected identifier
nvm
forgot async
lol
axios?
anyone that could please
help
because i am losing my mind right now
if (roll1 == 1 && roll2 == 1) {
amount = amount * 2;
ls.set(message.author.id + "profile", Number(ls.get(message.author.id + "profile")) + amount);
return "\`You rolled snake eyes (1 and 1) and gained **2 times your original bet!**\`";
}
else if (roll1 == roll2) {
amount = amount * 3;
ls.set(message.author.id + "profile", Number(ls.get(message.author.id + "profile")) + amount);
return "\`It's a match,\` " + message.author.username + "\`! You rolled double \`" + roll1 + "\`s and gained **3 times your original bet!**\`";
}
else {
ls.set(message.author.id + "profile", Number(ls.get(message.author.id + "profile")) - amount);
return "\`Unlucky\` " + message.author.username + "\`, you lost $\`" + amount + "\`.\`";``` how do i return these return messages as embed???????
i know how to make an embed you twat
so, var returns = return?
owh
i have done that
but it was giving me user and message not defined error
as my code looks like this:
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('Some title')
.setURL('https://discord.js.org/')
.setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
.setDescription('Some description here')
.setThumbnail('https://i.imgur.com/wSTFkRM.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)
.addField('Inline field title', 'Some value here', true)
.setImage('https://i.imgur.com/wSTFkRM.png')
.setTimestamp()
.setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
return exampleEmbed
try this
look
i have like a lot of files inside my folder
all gambling files.
this is one of them
congratz
now i wanna learn that how to add commands in my bot
but cwick you see what i am doing?
Promise {
User {
id: '545490362568015873',
username: '4ce',
bot: false,
discriminator: '6485',
avatar: '3c630dfa02a6fbc742972d93462521e5',
flags: UserFlags { bitfield: 64 },
lastMessageID: '757179554279194674',
lastMessageChannelID: '707523130423509013'
}
}
(node:10622) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'username' of undefined
at Object.execute (/home/thinh/Programming/judger-djs/commands/tags/tagInfo.js:22:79)
.addField("Author",`${client.users.fetch(tag.userId).user.username}`, true)
Bruh why
you need to put await infront of promise
let filter = m => m.author.id === message.author.id;
message.channel.send(firstEmbed);
message.channel.awaitMessages(filter, { max: 1, time: 15000, errors: ["time"] })
.then(async collected => {
let userInput = collected.first().content;
let perms = message.channel.permissionsFor(message.member);
const channelExists = message.guild.channels.cache.has(userInput.replace(/<#([0-9]{2,})>/mi, "$1"));
if (channelExists) {
//channel exists
let checkPerms = userInput.permissionsFor(message.member).has("SEND_MESSAGES", false);
userInput.permissionsFor(message.member).serialize(false)
} else {
return message.channel.send(invalidEmbed);
}
}).catch(collected => {
return message.channel.send("time out");
});
``` it just sends time out, whats wrong here?
i want to ask that all the bots that are being made using javascript are made on node.js?
yes
well there are other nodejs clones like deno but we don't talk about those bootleg clones
pure nodejs is king and always will be 😎
and node.js syntax is exactly same as of js editors?
and node.js syntax is exactly same as of js editors?
@silk chasm @earnest phoenix @split hazel
.setThumbnail(message.guild.iconURL())
ive got this but its not working
Guys Do Anyone Has An Account In Brainshop.ai ?? Pls Ping Me
and this is related to development how
Why this error ._.XD
It literally says that
I have to create a file called index.html?
in /views/ yes
Ok
???!?!?!?!?!???!?!??????????????????!!!!
Says me the same error ._.
have you tried reading the error
???
I've got an array
var array = [{"a": "🇦, "b": "🇧" and so on, how do I like loop through a message and replace every letter with that?
why an array tho
I have no idea, how should I approach this command?
you have an object: {a:A,b:B,c:C} etc
adding an array around it doesnt help with anything
just use the object directly
you can loop over the object using Object.keys() or Object.entries()
Okay I'll try
Says me the same error ._.
.
suggestion for a logging future
@commands.command(name="unban")
@commands.has_guild_permissions(ban_members=True)
@commands.bot_has_guild_permissions(ban_members=True)
@commands.cooldown(1, 3, commands.BucketType.user)
async def unban(self, ctx, member: discord.Member, reason):
"""
Unbans a user
"""
banned_users = await ctx.guild.bans()
member_name, member_discriminator = member.split('#')
for ban_entry in banned_users:
member = ban_entry.member
if (member_name, member_discriminator) == (member_name, member_discriminator):
await member.unban()
embed = discord.Embed(title=f"{member} was unbanned; {reason}")
await ctx.send(embed=embed)
channel = await member.create_dm()
await channel.send(f'You were unbanned in {ctx.guild.name} for {reason}.')
elif member == None:
embed = discord.Embed(title=":x: You need to sepcify a user!")
await ctx.send(embed=embed) ```
How do I make it so this command is able to unban a user if the author uses an ID?
idk
Someone knows how to get the number of commands in a group (discord.js-commando)
Someone can help me with this? I created the file 'index.html' but says the same error (See right)
Is glitch.com ?
@near drift
maybe click on something else than assets
you're trying to look at the assets folder and you have none. this isn't an error.
oh you mean at the complete right, sorry
index.html is not the same as /app/views/index.html
you need to make /app/views/index.html
Cool gars
Ok
a
Like this?
yes precisely
Same error 
ok ¯_(ツ)_/¯
for long time like 24 hours which timing function u use , setInterval ?
setTimeout and setInterval are based on "milliseconds". So, 1000 is 1 second. 60000 is 60 seconds.
I'm sure you've learned a long time ago how time works, you can do simple multiplication math can you?
yes
oh sorry that wasn't your question.
either I misread or you edited that for clarity
setTimeout and setInterval still can be used in long periods, however, they'll reset if the bot shuts down. You'll need to use a database that stores time, as well as something like node-schedule or cron, to keep those things alive.
yeah but it can still be reset, if it has an error or if you update the code
so not sure my bot will 24/7
i must need to use a database
and how u guys handle multiple servers schedule ?
timestamps stored in database ^_^
guild id + channel id + timestamps ?
something like that, yeah
👍 thanks
hm k
How can i get the bot deaf it self? (discord.js)
@earnest phoenix
https://discord.js.org/#/docs/main/stable/class/VoiceConnection?scrollTo=voice
https://discord.js.org/#/docs/main/stable/class/VoiceState?scrollTo=deaf
btw ,which Database service u guys use ?
MongoDB
is tha best
it isn't
you choose a database based on what you need
every database has its pros and cons
well MongoDB is the most easiest
MySQL is for such of big data
and anothers idk
.addField("Roles:", member.roles.map(roles => ${roles}).join(', '), true)
console: member.roles.map is not a function
mysql is completely trash
should've left it in the 2010s
yes
but big company still use it
cuz their data
.addField("Roles:", member.roles.map(roles =>${roles}).join(', '), true)
console: member.roles.map is not a function
@silver lintel see what type the roles prop is
. . .
.addField("Roles:", `${member.roles.cache.map(roles => roles.name).join(', ')}`, true)
@silver lintel
:))
Tyy
is there a way i can connect my google analytics for my website with my discord bot? like a api or something
MySQL is bad
uh
if (command == 'eval') {
if (message.author.id != 487511010886942720) return message.channel.send('You don\'t have permission to run this command')
let code = args.slice(0).join(' ')
message.channel.send(await eval(code))
}
```Doesn't seem to work
plz help
ids are not numbers
well, they are, just not in djs because snowflakes are too big for js numbers
yeah just treat them as strings.

if you wanna use MySQL, use MariaDB.
what doesn't work
and big companies uses nowdays uses MariaDB, Cassandra, PostgreSQL or MongoDB. (those are most used)
also eval isn't async, why are you awaiting it
I just thought it wont work as
discord tryna send it
but it hasnt been processed
rtfd
Bruh
Await is waiting for a specified thing to happen before that line of code can be executed
take a look at https://anidiots.guide/examples/making-an-eval-command
Since you don't have anything specified to happen that's why your getting the error
Actually no, that's not true, using await on a normal value works perfectly fine.
Oh?
yeah. I use it for values that might be promises. all the time.
Ah makes sense
in my eval, actually.
js will act as if it isn't there if the return value isn't a promise
no, that's false.
oh?
const thing = await 'This is a string'; will make thing equal to that string.
Ooh ok
so, it acts as if it isn't there?
well it acts as if it's a promise but it's resolved instantaneously.
I think JS actually does try to wait until 'This is a string' to "resolve" as last time I tested it (which is almost instant) but it was interesting. It didn't feel like JS was just excluding the keyword.
it's slightly less performant because it needs to create a promise and resolve it.
but when you're doing an eval and you don't know what the return is... it's useful.
They're probably keeping the await there in case one of the return values does end up being a Promise. However, they could also just save the eval result to a variable then check if it's an instance of a promise.
the instanceof condition would probably similarly be slow anyway ¯_(ツ)_/¯
at the level of an eval run only by the bot owner, the performance is insignificant.
the operator would do that behind the scenes anyways, no?
You guys are thinking this is an issue but it really isn't. evals are run once and they're run manually, so the nanoseconds it takes aren't affecting anything
If this was a loop of 100k maybe it would matter but not here
I don't think it's an issue. I just think it's interesting how JS would be wrapping it in a promise // other ways of doing it.
im getting 404 discordapierror when attempting oauth2, but its not giving me any info. it worked when i had it in my index.js, but now im getting this error when its in a seperate route file
it's probably less code that way
Well, 404 can only mean you're hitting an endpoint that doesn't exist
maybe you have a wrong ID?
edited for more detail my apologies 
why is eval dangerous???
A BOT CAN'T BE ADD In MORE THAN 100 SERVERS
its not 7th oct yet
indeed.
calm your titties
no need to scream it at us, we're aware.
uh
its not 7th oct yet
@pure lion exactly i want to know about this that what will happen on 7th of oct?
akschually
it can
you just won't be able to use privileged intents without getting verified
cry can you help me?
with
what i mean is
auth fucc
im getting 404 discordapierror when attempting oauth2, but its not giving me any info. it worked when i had it in my index.js, but now im getting this error when its in a seperate route file
im running on a VPS
(node:15084) UnhandledPromiseRejectionWarning: DiscordAPIError: 404: Not Found
at RequestHandler.execute (/root/LJDCnWil/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:15084) DiscordAPIError: 404: Not Found
at RequestHandler.execute (/root/LJDCnWil/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15084) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
here is the full stack
thonk, does it not point to where you called the method
i'm guessing it's because you're using promise pattern with then()
what it meant by this:
Therefore, we are making verification a requirement for bots in 100 or more servers. Until your bot is verified, you will not be able to grow past 100 servers. If your bot is already in more than 100 servers, it will not be able to join any more.
TELL ME MORTALS I DIDN'T GET IT
uhhh do you want us to explain it in, like, simpler english?
oh they changed it
it used to be that you won't be able to use privileged intents
now it's that your bot can't grow at all
that's been like that for quite a while. months even
means we have to make our bot added in 75+ servers to get a check mark and privileges
making a bot just to get a badge doesn't work anymore
it means, when your bot reaches 76 guilds, you need to start the verification process. the verification process means that once it's verified, it is able to go past 100 guilds.
discord does not give badges to verified bot devs anymore
if you don't verify it, it cannot be added to more than 100 guilds (after october 7th. until then the limit isn't applied yet) .
Hey, how do I start with bot developing? (ik Python, JS, Java)
and what if our bots didn't get in 76 server before that time..?
There's no point in trying to grow the bot just to get a checkmark.
find a library for your desired language and follow the lib docs
If you bot doesn't reach 76 servers, why would the verification matter?
it's not 100+ so it's safe.
@earnest phoenix step 1) learn the programming language you intend to use. Step 2) THEN and only then should you attempt to make a bot
they said they already know a few languages
and yes, that's it
I'm programming for about 2 years now
@umbral zealot and if our bot reaches in 76 server that date then can we verify it?
djs has their docs, simply follow that
i'm guessing it's because you're using promise pattern with
then()
am using async
@silk chasm yes. you get a notification about doing the verification process at exactly 76 guilds.
ik Adv. Python and quite well in JS, so I think I should start with Discord.js
and is there a lib. for Python?
yeah discord.py
a few, popular being ^
most devs aren't... like... very original with their library names.
and if our bot reaches in 76 server afterthat date then can we verify it?
fixed it nvm
100 guilds => if you're not verified, that's the limit of guilds.
but why dicord is telling to get it before that date
they need a buffer period for everyone with large bots to verify them
did they will stop verifying it
No, they will not stop verification in the future ,they will continue verification, they started early before limits are in place so that people wouldn't riot and burn them down because bots can't be added anymore
they're suggesting you do it before the date because after it, it'll get restricted
pretty simple concept really
always give a grace period when adding new laws and rules that affect people.
ok
oh, discord.py looks good, i will try that! ty
and why the hell is maker of triviabot @green kestrel here as a mod... lol
why wouldn't they be
ahh means if ur bot goes succesful why be a mod then ...lol.. he would be a mod before and forgot that he
is a mod
loooooooooooooooooooooooooooooooooooooooooooool
because they wanted to be one?
... I don't know why they couldn't be both a mod and a bot owner? 
It's possible to both moderate a server/website and own a rather big bot 🤔
does it look good to be a king of one place and being a simple minister at other...
what
Yeah, it actually looks very good to be able to manage multiple things in your life. It's a sign of a very organized mind 
^ this tbh 😂
oh wait why isn't my profile is showing that i am using vs code rn?
probs because you don't have the discord presence plugin 😉
@umbral zealot = BIG BRAIN
Also also you're offline so...
discord says you were a minute ago but ok
"discord says"?
nvm
probs because you don't have the discord presence plugin 😉
@umbral zealot oh wait to use it we have to install discord?
yes, you need the discord app, and the discord presence plugin
can it work on browser discord?
nope
idk for what reason my discord doesn't launch...
xD
Promise { <pending> }
How do I remove this BS?
by resolving the promise.
Resolve the promise
how
read up on how promises work here: https://js.evie.dev/promises
just did ?eval message.channel.send('some text here')
well, send() returns a promise
because your eval sends the result of your evaluated code to the channel
your normal code does not
@opal plank
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
^
TypeError: Cannot read property 'send' of undefined
new error
me is undefined
let me = bot.users.cache.get("485987127809671168")
let buf = new Buffer(10)
len = buf.write("hi")
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
flaze?
so
let me = await bot.users.fetch("id here")
ok
can someone help me with this: https://stackoverflow.com/questions/63870225/handling-user-inputs-in-parallel-using-discord-bot
no one is responding to me on this 😦
it's an async function which replies to the message
what does it do?
async function handleUserInput(msg) {
try {
const content = msg.content;
if(content.includes(myBotId)){
return;
}
const inputArgs = content.split(" ");
if(inputArgs.length > 0) {
const command = inputArgs[0].toLowerCase();
console.log(`Content: ${JSON.stringify(msg.content)}`);
if (command === COMMAND.PING.command && inputArgs.length === 1) {
msg.reply('pong');
return;
}
why not
first few lines look like this
SyntaxError: await is only valid in async function
but there are commands which are slow and takes 1 minute to run
make the parent function async
yes no other command works
@solemn leaf where is that code? what event?
other commands just wait
its in my index
this console doesn't get print until previous command is processed
console.log(Content: ${JSON.stringify(msg.content)});
show the command
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@solemn leaf can you show me your index code?
bot.login(config.token);
process.on('uncaughtException', (err) => {
let me = bot.users.fetch("485987127809671168")
let buf = new Buffer.from("hi")
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).on('unhandledRejection', (err) => {
let me = bot.users.fetch("485987127809671168")
let buf = new Buffer.from("hi")
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).catch(console.log);
@grand path the command that gets stuck is wittytodo?
async (err)
yes
ok
add async to make the function async
what does it do?
are those computations synchronous?
yes
then that is the problem
the computations themselves are synchronous, making it async doesnt do anything
now my bot wont start
(node:200) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any time
for example, lets say you have this: ```js
function sync() {
for(let i = 0; i < 9999999; i++) {
// do something
}
console.log("a")
}
async function notsync() {
for(let i = 0; i < 9999999; i++) {
// do something
}
console.log("a")
}
it loaded when I removed it
console.log(1)
sync()
console.log(2)
// 1 a 2
console.log(1)
notsync()
console.log(2)
// 1 a 2
in both sync and async cases, the function makes the code get stuck, and console.log(2) only works after the function completes
making a function async by itself doesnt make your code async, but it "allows" you do design async code
for example, you could do something like this
async function actuallyasync() {
for(let i = 0; i < 9999999; i++) {
// do something
if(i % 1000 === 0) {
await new Promise(r => setImmediate(r));
}
}
console.log("a")
}
who you talking to
then you will have ```js
console.log(1)
actuallyasync()
console.log(2)
// 1 2 a
using async functions allows you to design async code and break it down yourself, but it doesnt magically do it for you
im talking to @grand path
oh goood
okay so it sent me hi
but if I switch the hi for err it doesnt send
process.on('uncaughtException', async (err) => {
let me = await bot.users.fetch("485987127809671168")
let buf = new Buffer.from(err)
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).on('unhandledRejection', async (err) => {
let me = await bot.users.fetch("485987127809671168")
let buf = new Buffer.from(err)
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
})
@quartz kindle weird
if you are executing many heavy computations, you have to break them down by inserting some waiting time
this is what setImmediate is designed to do in node.js
to break up sync code into pieces and enable the main thread to be given control back in between these pieces
oh
so I can just insert setImmediate at random places
and it should take parallel inputs?
yes
setImmediate says "ok, now stop and go back to the main thread, and continue in the next loop"
and why the hell is maker of triviabot @green kestrel here as a mod... lol
@silk chasm I was a mod here before I ported triviabot to discord![]()
off-topic^
maybe, unless he enlightens us
If the bot that I posted on top.gg got accepted how can I know that it is accepted?
You get tagged in this discord
Does it dm me?
still stuck @quartz kindle
how did you add it? and where?
How do i get my bot able to let people choose the prefix?
you need a database
I know, but from there what do i do
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what sort of database do you use?
whatToDo is the function that runs too much time
There are different databases? im supposed to be new and this is destroying my brain
Well how do i know what database i use
it should be pretty obvious
Just tell me ;-;
@grand path you made it only work if experience is a multiple of 1000
since usually when you are using a database you either download it or use an online service
@earnest phoenix if your using the thing I gave you
@solemn leaf npm i quick.db
usually*
stuck2
quickdb
what is the heaviest part of your code? is it the triple for loop in what to do?
that last ping command never executed
because it's waiting for previous command
@quartz kindle it's the recursion
the recursion in minDays?
yes
@charred geyser there "npm i quick.db"
remove the if
okay trying..
@earnest phoenix you are using discord js?
Yes
@silk chasm I was a mod here before I ported triviabot to discord :Crab_Rave: :FrogTonguePFF:
@green kestrel ik u were a mod here and then forget about it... Lel by the way nice creation but one day my bot will defeat triviabot...
so you wanna create a guild object for each guild the bot is in
and then store the prefix in that object
im not really sure how quickdb works
@charred geyser do you know any other dbms?
I'd imagine the concepts are the same
and then store the prefix in that object
@charred geyser u mean variable, right?
so id assume you wanna like
memory leak and wrong answer now @quartz kindle
hello
no?
@earnest phoenix
db.set(`prefix_${message.guild.id}`, args[0])
prefix = await db.get(`prefix_${message.guild.id}`)
the first would be in the command where you would set the prefix
and the prefix part would be in the index where you set the prefix
would you not wanna create storage per guild
so you can have more than just prefix
@grand path then you will need to refactor your code
because asynchronous programming is very similar to multithreaded programming, you have to think about possible overlapping code, increasing queues, etc...
const { Schema, model } = require("mongoose");
const guildSettingSchema = new Schema({
guildName: { type: String },
guildID: { type: String },
prefix: { type: String, default: "%" },
autoRole: { type: String },
joinMessage: { type: String },
leaveMessage: { type: String },
color: { type: String, default: "#00ff77" },
});
module.exports = model("guild_settings", guildSettingSchema);
you have to be sure 2 calculations at the same time are not interfering with each other accidentally, or you will get wrong results
and if your calculations are really that heavy you need to have rate limits to prevent starting more than you can finish
that's against discord tos
oh oops i forgot what a foggot
also you might be banned from this server for doing that
nvm i do nto fo
check community guidelines
selling ur acc is against tos
lol
Hey, can someone help me please, I can't apply my css to description section. I'm trying to show my website with iframe
show code
<link rel="stylesheet" href="http://mydomain/main.css">
<iframe src="http://mydomain/" class="frame"></iframe>
I tried with localhost and it worked but in top.gg css not works
you need to use <style> i think
the first would be in the command where you would set the prefix
@solemn leaf %prefix [new prefix]
right?
I've been playing with sharding with express and ejs but i keep getting {} and console errors. All guilds is not defined
<center>
<% for (var i = 0, len = guilds.length; i < len; i++) { %>
<% let guild = manager.broadcastEval(`
(async () => {
let guild = this.guilds.cache.get(guilds[${i}].id);
if (guild) {
console.log(guild)
let member = guild.members.cache.get(userinfo.id);
if (member) {
if (member.hasPermission("ADMINISTRATOR")) {
return guild;
}
}
}
return false;
})();
`); %>
<% if (guild) { %>
<p><%= JSON.stringify(guild) %></p>
<% } %>
<% } %>
</center>
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
expires in 10 min
Nice
;-;
message.guild?
(node:6652) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [ChildProcess]. Use emitter.setMaxListeners() to increase limit
i hate this 🙂
How to get a free badge for Android??
what
@shy turret how to fet free badge
??
you cant get fre discord badges
+help
wrong channel
you cant get fre discord badges
@shy turret you have one lol
it doesn't
I mean, you can get the Nitro badge and the Server Boost badge pretty easily 😉
except u need to get money (which is pretty hard)
(not rly)
(it's really easy if u r the age)
you can just answer the hypesquad quiz and get the badge but only on desktop. isn't that what you did?
it used to be harder to get though
discord cucked themselves
@umbral zealot > I mean, you can get the Nitro badge and the Server Boost badge pretty easily 😉
@umbral zealot how pls dm mr
Oh ok ok
I can't even use css to change style things in iframe
I can change iframe properties only
yes. that's how iframes work.
how can I change it or how can I apply css file in it
why would you change the css in an iframe










