#development
1 messages · Page 1919 of 1
for example i would to <meta property="og:image" content="https://sadburbur.xyz/bun/sadbun.png" />
https://sadburbur.xyz/bun/sadbun.png with that being a working and accessible image

i woudnt if i where u
i fixed
or how do i make like if on google i searched Tryhard it show my website
how to?
@spark flint
ok tysm for everything
What Are Meta Keywords? Meta keywords are a <meta> tag option that could be used to give more information to search engines on what a page is about. A <meta> tag defines what different types of metadata are about in an HTML document.9 Jul 2020
np
so if i added like ZEIN_TRY as a keyword when i search ZEIN_TRY on google it will shoe the website?
oh hi FakE
Friendly reminder to watch the previous answers:
#development message
^
As the examples written below my answer showed it.
i puted the tags in the head part
just anwser my question
if i added like ZEIN_TRY as a keyword when i search ZEIN_TRY on google it will show the website?
Not really as it doesn’t mean to be indexed yet anyways
so how do i do this^^
Without optimizing how you can be found in search engines the result of being found is poorly
wdym?
This poor result increase over time if lots of people visiting your site and if your site map got uploaded to Google Sense as well as if links of your site being shared on already popular indexed (top) sites on Google
That’s actually a complicated process to be found in the net
ouf
SEO analytics and optimization is not as easy as you might think
But defining keywords will help when it’s getting indexed
where else i can get user if it not in cache
fetch an user by his ID
Hey hey! When deploying my slash commands, i get this error that says Package subpath './v9' is not defined by "exports"
And that error comes from this: const { Routes } = require('discord-api-types/v9');
I've followed the guide, and done this on my other bot (there it works fine), but here it doesnt seem to.
Does anyone know why?
Not that hard to make an exponential equation, it’s just y = ab^x
Had on message event been renamed?
in v13 it’s messageCreate
ty
Never mind, had the wrong version of discord-api-types xP
Simple math…
Increase the amount of XP each time by a few percent

For example by 5%
XP * 1,05
Or go further and include the level as percentage of 1000
Adding it to the new XP
Not really difficult
You might want to be careful with numbers in JS since commas don't count as valid float identifiers iirc
Well then * 105 / 100
1.05

Eww ads everywhere
Error: Expected an ad to be shown in this chat, but none was found
Wait wait
I got a good one somewhere
Haa!
FakE modern boy posting memes
In the wrong channel of course
To fight the system and it’s rules!
thats what i like to see :^)

Hey I am reacting to certain messages using my bot made in v12. The reaction emojis are custom ones. However, the custom emojis change every day in terms of if which makes the bot not work.
Why is that?
Never worked with emojis but why should their ID change every day?
Don’t you specify an emoji ID and name when using custom ones?
i think they're referring to the name changing
Even tho why should the name be changed?
You can use the id and a random name. The name does not has to be identical when reacting
Thinking about that makes me wonder why you even need an emoji name if you need to provide an ID anyways
nvm then
No sorry I actually found out that the command which sends out an embed with the reaction emojis, stop working after one day, so you will have to use the command again for the new embed to work.
I honestly have no idea why. And sorry for referring wrong. I will send a little code snippet soon
would be good
i have enable client intents but same error
/home/runner/jhgfrftgyhzujidkolcvfdjheduhdnjyioqsminfbqheinjsbdiquhiznjd/node_modules/aoi.js/node_modules/discord.js/src/client/Client.js:544
throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
depends on how you built the command. if you're using reaction collectors, they will stop working if the bot is restarted for example
the only way to make reactions work forever is to use the messageReactionAdd and messageReactionRemove events, with some code to check if the message is valid
anyway, using reactions for functionality is not a good idea now that we have buttons
did you do this?
I am using a reactionevent
So it shouldn’t matter
But after a day the bot says invalid emoji
In the logs
then youre doing something wrong
I read this as intents: "yall"
Been in Texas all my life and I’m ashamed to say that I read it the same way
all yall
I never even say y’all, I just hear it so much that it becomes natural
I use yall instead of guys now, still hasn't started feeling natural but we're getting there
const filter = m => m.author.id === message.author.id;
let DM = await message.author.send({ embeds: [q1] })
let plannedtime = await DM.channel.awaitMessages({ filter, max: 1, time: 180000
})
console.log(plannedtime.first())
if (!plannedtime.size) {
return message.author.send({ embeds: [timeout] });
}```
This doesn't work despite having message content intent turned on, the console.log part returns undefined and the only thing the bot does is return a timeout msg, its supposed to go onto the next part (send another DM) which doesnt work
nvm ^
do u have direct_messages intent specified?
guild_messages and direct_messages are seperated into two different intents, you need to specify it while u are creating an instance of your client
Read the message below
lmao
Y does this unban command not work?
@has_permissions(ban_members = True)
async def unban(self, ctx, member:discord.Member):
banned_users = await ctx.guild.bans()
member_name, member_discriminator = member.split("#")
for ban_entry in banned_users:
user = ban_entry.user
if (user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
await ctx.send(f'**UNBANNED {user.mention}**')
return```
This is in a cog
Error:-
```raise MemberNotFound(argument)
discord.ext.commands.errors.MemberNotFound: Member "295499172994351105" not found.```
the user is banned
Um..... Anyone?
Yep I fixed that I noticed it right after sending xD ty though
It's 7:30 am here xD so cant help right now
what causes this error?
HTTPError [AbortError]: The user aborted a request.
which command where u using?
just anything
If your network isn't good enough or if Discord takes too long to respond, the request will be aborted. (I think default abort timeout is 15sec.
oh okay, ty!
The member isn't cached. You need to use ID based method overloads and take that into account
i am rewriting it
anyways ty
what does visual studio build tools 2017 do
tools for building
;-;
the message can't be sent after your code ran 
anyone know how an equip command would work for a discord economy bot?
anyone?
if (user has space in inventory) {
add the item to their inventory
} else {
bro you cant pick up more stuff
}
well f
wait
my code be bilt differently
I gave you code for pick up
built*
lmao
by equip you mean take an item from their inventory and put it in their hand right?
yes
but 1max
i havent built the hand system yet only inv. thats why i came here
if (user has the item in their inventory) {
change the currently equipped item to the new item
}
you're welcome
well....
that still wont help
because
thats not what im asking abt.
i want to make a system for the equipped item
like i have the items, and inventory but nothing associated to equip
its just a command like t!equip eurotodayzoom1
ik how to make the conditions, just not how to make them equipped/unequipped
anyway thx for trying to help
Just use discord's timestamps
Here i want to directly assing @urban moon to m : discord.Member in 2nd argument insted of taking it from user
what should i do?
@b.command()
async def yayy(ctx, m : discord.Member):
as it is a class
i can't just do m : discord.Member = @urban moon
so.... need help
What am i doing wrong here?
You imported something called threadCreate and you have variable called threadCreate
is there a way to trigger a discord command remotely from a file? Lets say i have a bat file on my second computer, when i run it, a discord bot runs the specified command in that file
Honestly, I have been thinking about that, too. I am unsure how.
thx
I would write a recursive decent parser for it ,to directly evulate or too create expression of it
someone?
help
exactly what u wrote
let y = Math.sqrt(x / (5 ** 2 + 1))
nope
that'll result wrong
u missed bodmas at the end
it'll divide first before adding
but ur latex adds before dividing
I mean this
it is resulting right bcuz u rounds after calc
but it'll miss by 1 every 30 levels or so
lul
u can just floor it
since it should complete a level after or at 100%, nothing less
u can round any amount of decimals, but the last decimal must be floored
else it'll push up the total value
like, 5.999999, if u round the last value it'll push everything else to 6
but if u floor it'll stay at 5.999999
just do this val = Math.floor(val * precision) / precision
although if u go above a certain precision js will round it
floor it
flooring will remove the decimal
5 in this case?
ah
decimals = val - Math.floor(val)
decimals = 5.12348425059 - 5 -> decimals = 0.12348425059
lul
just don't round it after sqrt
btw, this might come in handy https://www.desmos.com/scientific
eh
yw bruh
sure
message.createdAt iirc
for my bot I store a "last earned xp" timestamp, then check how far it is from the next xp instance
if it is below 1 second, I multiply it by a value between 0 and 1
always having error "cannot find module"
huh
you want to check if the difference between the two timestamps is 60 seconds?
there's no layout
they're numbers
it's ms
so it would be 1000
correct
yes
I just assign zero as default value
I recommend using a promise-based driver for whatever db you're using (probably mysql) so you don't have to do the ugly golang approach of
if (err) {
console.log(err)
return;
}
and can just await the thing you need and have one error handler that wraps the command take care of that instead
better-sqlite does everything synchronously from what I understand
Unrelated but
why do you have soooo many function parameters
also why do you have args twice
there's a pretty good explanation on the readme
sqlite itself cannot write concurrently, everything is serialized
so even if you use async, 10 async writes at the same time will still be ordered and executed one at a time by the sqlite engine itself
so using async for sqlite is basically useless, thats the main point of better-sqlite3
Does this look better than constantly doing string.replace() over and over again at the end of the code
sure
both ways wack but oh well
const replacements = {
'{page}': `https://top.gg/blah blah`
}
for(const key of Object.keys(replacements)) {
string.replace(key, replacements[key])
}
```I think this would be much better if this actually works. Im not sure about this tho, TIm? Your opinion?
I think it should
sure, thats fine too
😂
does a given string always have the same replacements?
or do you have different strings, each with different replacements?
diff strings with diff replacements
oh
wait
no same string has the same replacements
the string value always goes through the same ones
if so, you could tweak it a little to accept a global replacement list that works on any string
as long as the placeholders are unique
for example
globalList = {
"{a}": "...",
"{b}": "...",
...
}
for(const key of Object.keys(globalList)) {
if(string.includes(key)) {
string.replaceAll(key, globalList[key])
}
}
client.on('messageCreate', async message => {
console.log(db.get(`counterGameNumber`))
if(db.get(`counterGameNumber`) == null){ db.set(`counterGameNumber`, 0)}
if(message.channel.id != "908384000610025554") return
if(message == db.get(`counterGameNumber`) + 1){
console.log('number')
db.add(`counterGameNumber`, 1)
message.react("✅")
}
})``` why won't it work. it won't print `number` or react with ✅
first of all, message can never be equal to a number
message is the full message object with all the message properties, not the actual content of the message
you're looking for message.content
second, dont call the database multiple times like that, its extremely slow
database should always be used as few times as possible
store the results in a variable then use the variable
Here i want to directly assing @urban moon to m : discord.Member in 2nd argument instead of taking it from user
what should i do?
@b.command()
async def yayy(ctx, m : discord.Member):
btw discord.py
Anyone know best replacement for this v12 structure in v13?
Slightly better version, should do the job 
client.on('messageCreate', async message => {
console.log(db.get(`counterGameNumber`));
if (db.get(`counterGameNumber`) === null) db.set(`counterGameNumber`, 0);
if (message.channel.id !== "908384000610025554") return;
if(parseInt(message.content) === db.get(`counterGameNumber`) + 1) {
console.log('number');
db.add(`counterGameNumber`, 1);
message.react("✅");
}
})
i need this so badly

someone answer pls
I see 3 db queries 

Won't fix everything for them, but yeah, can be shorten by making a variable for it
get the game number and save it in a var wtf
thats what i said lmao
how much gigs is in it?
Uuuh.. quick question.. when i start my bot with its Token.. it starts really slow and i get undefined warnings..
But when i start it with the Token of my Test-Bot.. it starts almost instantly and doesnt throw any warnings
Btw.. im referencing this "Undefined"
https://i.imgur.com/tbfJ3yS.png
It starts slowly because it receives the READY event which contains all guilds, missed messages etc.
Take can sometimes take seconds/minutes depending on the size of data
Guilds can sometimes be unavailable becasuse of whatever reason
They may cause this issue
Alright.. i was wondering if there was an issue with the bot.. if it got shadow banned or something like that.
That's why I told you a few weeks/months ago to check if a guild is available in your event IN THE FIRST PLACE
It started with Server Outage warnings, then it randomly crashed. Thats all i know.
Check if a guild is available? Doesnt the discord api do it by itself?
So.. i may have Servers listed in my Guild cache that doesnt exist?
<guild>.available
Nope they aren't in the cache
Since the whole guild obj is undefined but the ID still exists
Now im actually confused.
Okay.. so.
In my event handler.. i have an Event for when a Guild becomes Unavailable
But all i do is log it do the console.
In your event you will receive the guilds from Discord, djs caches them in a collection, collections are using the guild ID as key, and the data as value
You still receive the unavailable guild ID from Discord, but no data
If i understood you correctly.. i should remove that server from the client.guilds.cache
Okay
The ID always exists but no more data about the guild
Thats also for when the Bot gets removed from a guild, right?
In any event you use/need the guild object, check once if the guild is available if(!guild.available) return;
No.
That's for guild being unavailable
For whatever reason
Okay
The guilds are unavailable BY Discord not your code
Oh okay
But.. if the guild is not avail.. it cant interact with the Bot.. so it shouldn't matter right?
If a guild is unavailable, there's no data you can get other than the ID and nothing you can do with the guild, yeah
me dying without extends
So its only.. right now... for what i use the data... a "Displaying and Analytical" issue
Sorreeeeey c:
Guilds can be unavailable and available a few minutes later, that's how it is
If you check if a guild is available before logging stuff in the associated event, you won't get undefined results
As I wrote
if(!guild.available) return;
for example in your message_create event, guild_create, guild_delete etc
Yup. Thats right.
I'm fucking nervous
Why tho?
I mean.. i work with Enterprise Stuff.. but ASP?
Oh
long time
that ASP
Those things a fucking amazing
Yes
...and the network died
I own a TX120 S3... Really nice for the Formfactor
Upgraded the CPU to an E3-1260L.. Installed ESXI 7... Extra NIC, LSI Megaraid Controller.
Its a beast
In the format of a Folder
Yeah
Reg DIMMS?
ecc yeah damn expensive
Expensive? I can only Put UDIMMS ECC into my Server
Thats the most expensive ram
ffs
Reg ECC? Nah..
Non ECC? Nah
Maybe i will decom. the Server next year and Upgrade to a newer TX..
Or maybe i will downsize my Network and Move to a powerfull NAS
Phew… BIOS update worked without issues
Did you got an IRMC Advanced License with your Server?
why update bios
unless there is a very compelling feature available youd be risking it for nothing
spectre and latest hardware support
sussy
"dont interrupt this installation process"
proceeds to highlight close button
isnt spectra a cpu vulnerability
Not sure about the license, but yeah I'm using iRMC
IRMC Advanced = KVM Access
how could i make a timer command with djs that keeps updating to show how much time is left?
hmm good question, next question, probably not
Not sure where the license shows up

Could? Yes
Should? Hell no
Finally got power backup unit for my RAID controller in cases the PSU fails or my electricity provider
who is raid
he/she/it raid
BBU is for people who are afraid of Dataloss
Aye
Dude the drives are so fucking expensive and my data is important, too
As I'm moving my centralized database from my root server, home into my local server
Running for 7 Years.. still being strong
Yeah Fujitsu servers are damn good hardware
But anyway, got a extra hardware for any case
3 more hot plug PSUs
1 more RAID controller
(my old) CPUs since before the upgrade
2 RAM modules
etc
Guess it will last the next 10 years
Maybe get one or two spare fans
Yeah it got 3 and already one extra
Even if the RAM is expensive, most expensive shit are good drives
RAID0 - Seagate IronWolf Pros
RAID0 - Samsung 970 EVO Plus (mounted on PCIE cards)
RAID0 - Fujitsu SAS 15k RPM
RAID0 - Samsung 870 QVO
and two small SSDs via SATA for what so ever
Yes and while I wrote RAID0 I mean RAID1 lol
Nice
That's the price of getting old, too old
raido
so running 7 years without any restarts?
No just power on cycle
ah okay
Phew all drives back in and the controller could save import the old setup
GOD THANKS
Yeah i know.. i also have an LSI Megaraid xD
You can have emergency generators 🙃
You just don’t know how complex that setup is combined with your houses electric system and how expensive
Not worth in my case
But yeah you could theoretically
how to i find the name of a category with djs
so i can do .addField(`Channel Category`, `${channel.category || "None"}`, true)
u still need to get the name of it
so then just add .name?
yeah generators cost much .Imagine in Asia servers from small company restarting every day due temporary outage 
channel.category returns undefined
.parent actually
oh ok
That depends… I’m not speaking about Diesel engines but gas engines as I got gas at home
Those generators start at about 2000
And yes the installation to even be a redundant device is fucking expensive, too
Close to be ready
Proxmox is close to be installed
Let’s hope the ZFS raid doesn’t kill my drives too fast
how do i list all the perms a channel has on it for the @ everyone role
<guild_channel>.permissionsFor(…)
Ideally, you should calc xp first then calc level then only do 1 update of xp and level if applicable to update level, else just update xp
(good on you for using prepared statements btw)
ah, for that
do it in the same place you're adding the exp
you're not doing the sum directly on database are you?
where u get this?
there u have it
const toLvl = x => Math.floor(Math.sqrt(x / (5 ** 2 + 1)));
let expUpdate = row.exp + rand;
if (toLvl(expUpdate) > toLvl(row.exp)) {
// Notify lvl up
}
mutation rears it's ugly head
no problem, the value will only be updated after u rerun SELECT
don't worry, that's normal
why dose this not work? \`\`\`\n${channel.permissions.toArray().join(", \n")}\n\`\`\
ah yeah
oh yeah, it's not a string
or use ORDER BY
give more info
HOW doesn't it work? what's the expected result vs the actual result
also u don't need to use .toArray() if it's already a collection
i want to list all the perms a channel has in an embed
ok, what's the actual result?
Cannot read properties of undefined (reading 'toArray')
this is it in an embed,
.addField(`Channel Permissions`, `\`\`\`\n${channel.permissions.toArray().join(", \n")}\n\`\`\``)
cant find anything,
search harder
@slow ibex Turns out the installation of the hardware has its downsides
Tried to install Proxmox on the PCIE NVMEs but they aren’t bootable
Need to check the BIOS for CSM Settings tomorrow but I assume it’s basically unsupported
Which would be less than unfortunate
Who else keeps their bots code clean for the first 1 or 2 updates and just stops trying to keep it clean?
Lol
ui: MariaDB database PHPMYADMIN user interface NODE.JS```
There’s no difference loading the commands from a database or directly from the file system
What does this mean? Can someone help me fix this please?
can you send the first line of code for the messageUpdate function
it looks like you havent specified all of the parameters it requires
import Discord from 'discord.js'
import { client } from '../index'
let message: Discord.Message
export async function messageUpdate(oldMessage: Discord.Message | Discord.PartialMessage, newMessage: Discord.Message) {
const j2embed = new Discord.MessageEmbed()
.setColor("ORANGE")
.setAuthor('Message Updated')
.setDescription(`${newMessage.author} edited their message in ${newMessage.channel}`)
.addField('Jump to Message', `[Click Me](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${newMessage.id})`)
.addField(`Old Message`, `${oldMessage.content}`, true)
.addField('New Message', `${newMessage.content}`, true)
.setTimestamp()
let channel = client.channels.cache.get("875064682434691078") as Discord.TextBasedChannels
channel.send({ embeds: [j2embed]})
}
yes
you're lacking | PartialMessage on the newMessage param
such a typescript moment
any 😎
PartialMessage shouldn't be there?
doesnt discordjs just have a global type specifically for message params
to avoid a mess like this
caught lacking
if you're talking about relational databases the best way would probably either be bitfields or a lot of columns
yes bitfields
1. creating 50 servers and 50000 lines to check the commands when they type it in
2. 1 board has all the command names, a tiny intel and the sid associated```
1 solution with a picture
https://cdn.discordapp.com/attachments/272764566411149314/908450790920818738/unknown.png
2 solution with a picture
https://cdn.discordapp.com/attachments/272764566411149314/908450847309049866/unknown.png
no need to
think of bitfields as " boolean slots"
0000 0000 here I have 8 slots
let's say I want to enable slot 2
though you'll run out of bits quickly lol
0000 0010
so youd need to store them across multiple columns
or use some kind of bigint type
well in a for example 32 bit environment the most individual bits you can set is well 32
so 32 commands
why this gives error?
DiscordAPIError: Invalid Form Body
at RequestHandler.execute (C:\Users\User\Desktop\Kek\node_modules\discord.js\src\rest\RequestHandler.js:349:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Users\User\Desktop\Kek\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
at async TextChannel.send (C:\Users\User\Desktop\Kek\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:172:15)
at async Help.run (C:\Users\User\Desktop\Kek\Commands\General\help.js:113:28) {
method: 'post',
path: '/channels/864902366952554556/messages',
code: 50035,
httpStatus: 400,
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: [Array],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
},
files: [ [Object] ]
val |= 1 << index
there, I forgor how to turn specific bits
had to look at my code
to turn off specific bits just use val &= ~(1 << index)
1. creating 50 servers and 50000 lines to check the commands when they type it in
2. 1 board has all the command names, a tiny intel and the sid associated```
1 solution with a picture
https://cdn.discordapp.com/attachments/272764566411149314/908450790920818738/unknown.png
2 solution with a picture
https://cdn.discordapp.com/attachments/272764566411149314/908450847309049866/unknown.png
{"345138133429649408":{"id":["trTJQT6o3"],"name":[["Sehun"]],"group":[["EXO"]],"number":[["#006"]],"condition":["5"],"concept":[["Universe"]],"file":["./cards/6.PNG"],"print":[1]},"367251020914491392":{"id":["lNcOqyE3B"],"name":[["D.O."]],"group":[["EXO"]]```hey how would i change the key? In this example, the user id?
for (const key in userdatabase){
if(key == message.author.id && userdatabase[key].id === test[0][2]){
key = m.id
let gift = Number(currency[message.author.id].gift + 1)
currency[message.author.id].gift = Number(gift)
}
}```i tried this
So change the user id to what?
How do we check if a user has a role in discord.jsv13, member.roles.has doesn't work
do you get it?
member.roles.cache.some(role => role.name === 'role name')
if (member.roles.cache.some(role => role.id === myRole)) {
console.log("has role")
}```
I tried this but it doesn't console.log
Yeah I tried that
Does it work with IDs?
it should work or it still works for me
what?
what exactly u want to do?
What's an easy way to have an api call and display the number of servers the bot is in without showing my API key in the client side. I'm having a hard time finding a solution
I would like to store the commands that server id brings and can be switched on and since there are many commands / servers I want to create a simple but easy to use table structure that is not loaded and easily accessible in MARIADB
sorry for my english
have a public endpoint that specifically only shows that data
anyone?
depends on the amount of commands
if it's a low count just use bitflags
50+ command/server
50+ commands then, not /server
use an array of disabled command names
like, lets say you have
!!doritos
!!nachos
!!ping
!!help
I want to disable nachos
just save on database as ["nachos"]
then when running the command check if it is in disabled commands list
cmd list
disabled cmd
?
so you think that
now the test2 comand on the xy server is turned off
just make an array of blacklisted commands ids then
like [1,2,3]
so commands 1, 2 and 3 are disabled
do note tho, the command names are already ids (no 2 commands with the same name)
u don't need a numeric id column
thank you very much for your help a lot with this
yw
for (const key in userdatabase){
if(key === message.author.id && userdatabase[key].id === test[0][2]){
console.log("yess")
key = m.id
let gift = Number(currency[message.author.id].gift + 1)
currency[message.author.id].gift = Number(gift)
}
}```how would i change the key to a different id?
if that's sql, use UPDATE <table> SET <column> = <new value> WHERE <column> = <old value>
Can anyone tell me what a good perm requirement would be for a warn command? Maybe MANAGE_MESSAGES or?
True enough, thanks ❤️
i would do manage roles reasons people warn and if keep going they mute and to mute u require manage roles
See I’m a little confused on what to use cause my bot has a rep system based on the infractions a user has…
So for example if a user gets warned that reduces how trustworthy they are.
This is obviously not a feature I want abused.
ok
True
how do i send an embed then put a reaction collector on that embed
I vote for MANAGE_ROLES too, warns are usually linked to how users behave
Yeah I was thinking maybe MANAGE_ROLES would be best. Thanks again everyone ❤️
how do i check the collected response
k
bre
[emojis].includes(reaction.emoji.name)
for(var i = 0; i < 3; i++){
}``` timer ? 0 (delay 5 seconde) ... 1 (delay 5 seconde) etc etc how to do ?
{"345138133429649408":{"id":["trTJQT6o3"],"name":[["Sehun"]],"group":[["EXO"]],"number":[["#006"]],"condition":["5"],"concept":[["Universe"]],"file":["./cards/6.PNG"],"print":[1]},"367251020914491392":{"id":["lNcOqyE3B"],"name":[["D.O."]],"group":[["EXO"]]```how do i change the 324513342964.... entry?
var
but well, you can just use setInterval(() => { what to do }, 5000)
I need the "for" otherwise I will have done like that
why u need it?
u can also use a promise-based sleep to delay next pass
and please, forget var exists
for(var i = 0; i < 180; i++){
SendRequest(i*100)
}```
sendRequest = request to an API
that's why i need a delay to not spam the api
for(var i = 0; i < 180; i++){
setTimeout(function(){
SendRequest((i*100))
}, (i*5000))
}```how good that would not it?
no good
that'd actually DOS the api
either use setInteval or use promise-based sleep to delay next pass
setInteval ? how do you want to do it ? knowing that I need the "i"
it works thank you
what is the best cheap cdn
i can't use cloudflare as it doesn't really fit into my use case
Gone for a hetzner storage box
Do they have static file storage?
I cancelled my storage box because it’s not right for my use case
Epic ty
And as I said, discord is always a fallback option kekw
Cf for u then
Yep
Hetzner storage is really slowly
As it’s not designed as cdn
Also a cdn is a network of content delivery means not only one server/region
It’s like a server mesh delivering the same content which makes it redundant in the first place and due regional cdns fast accessible for users around the globe
ight
that's ur bot's invite
this 1?
A tool I recommend is Discord permissions calculator
Look that up on google
It generates an invite with the permissions you want for the bot
eh
ye
hey is this where i get my bot's inv url?
if it makes you feel any better I have to google how to find my bot's invite url every single time too
...
Permissions 8 
Or just use discord dashboard built-in calculator
yes
ok
@earnest phoenix look
just send me an image of your code
and let me see what lang it is
then why are you asking
ohhh
wait
oh
xD
This isn’t a channel for help with bots you didn’t program
It’s for development
Hence the name
Hello guys
I have everything setup on a gh repo say username/x
I want to move all the data including branches and codes to a diff repo username/y
I don't want to rename x to y because y already exists and has over 50 stars
But x was supposed to be a temp repository for me to work on
How can I shift?
you'd have to move manually instead of the conventional transfer
hey guys can i ask u something. i was made a discord bot , its on the site repl.it but when i made it i dont know how to do it online can someone help me ?
press the green "play" button
Wheres it
I mean set online discord bot , not mine profile
On the application?
yeah
their asking for the repl itr
i said the replit
Ohh
yes
its so blurry
But i had a problem because i can connect the bot with discord
wym you can connect your bot
I mean connect the bot token with replit
Any good hosting services?
replit + uptime is just too slow
delete the "env" file and create a replit secret
add it as env
I have that one
Contabo is cheap
delete it
only free
5 eur for 4 cores 8 GB
https://docs.replit.com/programming-ide/storing-sensitive-information-environment-variables @azure current read this
Do i need to create ".env"file?
Okay
Oh, will I have to setup all configurations there again?

@earnest phoenix hey man im again.
What is the code for connect? Its on the site?
Hi again
Same
my bot joining and instantly leaving a server ?
help me pls
pls
2 peopleinvited my bot
and not event 1 second
it left
how is it possible ?
if someone dont likes it would take some time to remove
but
Probably an automated system removed it or the guild went into an outage at a coincidental time and GUILD_DELETE was fired. You should be checking guild.available for if the guild went into an outage or if it was actually removed
list_num = numbers.split()
list1 = []
for n in list_num:
list1.append(int(n))
multiply = 1
for x in list1:
multiply *= x
print(multiply)```
i am using this as to make list and give multiply those
any other short trick?
Making list is compulsory
multiply = 1
for x in list1:
sum *= x
print(multiply)```
I don't get this part
You're not doing anything with multiply
hey
how do i get the user id who reacted to an embed with message.awaitReactions?
thanks
someone would have to be really stupid to give away computer processing power with unlimited internet bandwidth for free
I think you meant to do multiply *= x because there is no variable named sum
except maybe codesandbox + vercel
lol sorry
async def foo(x):
# code
return foo(x)
I keep getting the error TypeError: 'NoneType' object is not callable, also testing different types of things, it's still not working, so I am pretty sure I am just doing it wrong. How do I call an async def function inside of itself in python?
google is of no help either
does it work with sync functions?
try awaiting before returning
I've tried awaiting
with await, I just get NameError: <Javascript ReferenceError>: await is not defined
I didn't make this part of the project
I just have to fix it
looks like python has a different keyword for awaiting
for some reason I can't call an async def without await but I can't use await without an async
like what
and def keyword for functions
rust is so much more fun
yep, that's how you build up a tree of async calls
you can't wait for an async thing to finish if your caller isn't in turn waiting for you
every other lang be like: 👀
every other language also does this
this is definitely unrelated tho lol
hey so, i tried this and it has a cache with all the users reacting but the cache is cleared after a while, because i'm passing that as client options.
any workaround for this?
do i need to check the cache to get the user who reacts to the embed>?
no
It wouldn't be gone straight away
if i wait 30secs and react, its empty
actually its gone after 5secs
maybe i'll try createReactionCollector
How long did you set it to run for and what's the reaction limit/filter?
You don't really need to use the collector if you'll be collecting one reaction
filter is !user.bot and [emoji].includes
time limit is 30sec
msg.awaitReactions(filter, {
max: 1,
time: 60000,
errors: [ "time" ]
}).then(async (collected) => {
const reaction = collected.first();
const { name } = reaction.emoji;
if (name == check) {
const claimer = reaction.users.cache.filter((u) => !u.bot);
console.log(claimer);
channel.send("claimed");
}
});```
claimer is empty after 10sec
filter is in the options part
msg.awaitReactions({ filter, /* etc*/
i've been using it that way for a long time and it works
well i mean, filter doesnt mean the "claimer" would be empty after 5secs
i tested it
if i react before 5secs, I get the user
v12 or v13?
how do i use ftp in node.js
i'm using express-formidable to get the files sent in a post request and i need to then upload it to ftp
server and commands_settings and plugins_settings saved
ahhhh
con.query(`INSERT INTO servers (sid,server_name,prefix,lang) VALUES (?,?,?,?)`, [guild.id, guild.name, '-', 'en']);
con.query(`SELECT * FROM plugin_list`, (err, plugin_row) => {
plugin_row.forEach(plugins => {
con.query(`INSERT INTO server_settings_plugin (sid,plugin_id,type,prenium) VALUES (?,?,?,?)`, [guild.id, plugins.plugin_id, plugins.plugin_def, plguins.plugin_prenium]);
});
})
con.query(`SELECT * FROM cmd_list`, (err, cmd_row) => {
cmd_row.forEach(cmd => {
con.query(`INSERT INTO server_settings_cmd (sid,cmd_id,plugin_id,type,prenium) VALUES (?,?,?,?,?)`, [guild.id, cmd.cmd_id, cmd.plugin_id, cmd.cmd_def, cmd.cmd_prenium]);
});
})
why don't u just do a batch insert?
because new commands or plugins and
there is a default setting eg to be on or off by default and to be a premium or not
and I can expand the list at any time as it will keep coming with a + command or plugin
what I mean is, instead of god-knows-how-many inserts you can just convert into a single batch insert
actually
you don't even need that much code
INSERT INTO server_settings_plugin (sid, plugin_id, type, prenium)
SELECT ?, plugin_id, plugin_def, plugin_premium FROM plugin_list
for first part
INSERT INTO server_settings_cmd (sid, cmd_id, plugin_id, type, prenium)
SELECT ?, cmd_id, plugin_id, cmd_def, cmd_prenium FROM cmd_list
for second
I fail to see what kind of data you're storing there or what is represents
but it can be boiled down into that
also "prenium"
Fine ?
con.query(`INSERT INTO server_settings_plugin (sid, plugin_id, type, prenium) SELECT ?, plugin_id, plugin_def, plugin_premium FROM plugin_list`, [guild.id]);
ye
okey one minit testing
before you continue, would you mind explaining what those SQLs I sent are doing?
I'm making a meme command how do i add a "Next" button using discord-components which just gets another meme from my api.Here's my code
@commands.command()
async def meme(self , ctx):
r = requests.get(os.getenv("api"))
res = r.json()
title = res["title"]
image = res["image"]
up = res["ups"]
do = res["downs"]
meme = discord.Embed(title = title,color = 0xED4245)
meme.set_image(url = image)
meme.set_footer(text = f"👍 {up} | 👎 {do}")
await ctx.send(embed = meme)
```
pretty go working
anyone know a good program to backup programs/registry/program configurations on windows? I want to downgrade to 10 but I can't downgrade officially via the "windows old" thing
i got a very nice error message re you guild join have a tip ??
Message event 11 row
con.query(`SELECT * FROM servers WHERE sid=?`, [message.guild.id], (err, srow) => {```
oo shit
bot send private massege welcome
I think I missed that
if(message.author.bot) return;
if(message.channel.type === 'DM') return;
^
else I refuse to assist you anymore
I'm already showing
server setting CMD
save the command settings to the server
or did I misinterpret the question?
nono, I mean the SQL itself not the result
what ```sql
INSERT INTO ...
SELECT * FROM some_table
are you testing his sql knowledge lmao
indeed
creates a row in the specified table in which the data from another table will be queried
correct
I just gotta make sure you understand what you're copying before doing it
so since i'm pretty lame in english i'll have to interpret code to know what it's all about
since I have to use this
Google translator
and well, i'm not a professional but at least I can filter the point out of most things
I didn't know many things like what you're showing now I at least know a simpler measure than what I wrote
so thank you for taking the time to help me with my project ❤️ 😉
that's good, learning from codes is a great way of improving
you're welcome
bump
I see so many people here who just grab the first solution and simply disappear without even knowing what they copied
i learn to code and even my english is evolving
fs maybe?
I would imagine fs supports ftp
whats fs
the file system module for node
ah
since i like to program sometimes i enjoy that it only sucks for 4-5 hours but i still enjoy why i do what and i try to figure out if i don't know
hey guys can someone help me to connect my bot with set it online please ?
i need some help please
because im new with this information
ftp is a protocol, just like http
you need a library for it, since node doesnt have it built in
or build your own with tcp sockets
honestly node shouldnt even have http
they should have stuck with tcp only, and have people write http libraries
because now we have this situation where node's built in http library is bad
and most alternatives are better lol
like undici
most libraries just use the node http
ye and those are bad too
pretty sure all of them use http
except undici
node has this weird mix of low level and high level modules built in
yeah both use http
though axios is a bit more low level
would be cool if there was a native http module
native as in a c++ library
pretty sure there are several
does node have an opengl wrapper lol
there are many libs for that too
mostly webgl
does node have a library to write drivers in nodejs
hey can someone help me ? dm me please i need help
with coding a bot
for set it online
You should just ask here
now all i have to do is figure out if a new command or plugin will be added to the servers
okay then
i was made discord bot
and i dont know how to set it online status
because
then
i watched a video tutorial
but
its older version
and now when i tries
Do you get errors?
What’s the error?
i will send it to private message
Just send it here
On replit, I’m not sure. Other people know how to do it, so I suggest looking up “How to update node in replit”
which one did u use ?
I don’t use replit
okay but which one u use ?
I don’t know what you mean by that
anyway, only i have been experiencing lately that it is not possible to put canvas on windows?
(npm)
u dont use replit site ?
I don’t
do u have any files for online bot ?
upgrade your node
I program locally on my computer and then I push those files to a GitHub repository, then I clone that GitHub repository on my VPS
how
npm install n -g
For the latest stable version:
n stable
For the latest version:
n latest
whats nix ?
absolutely
on dm ?
We need to have a guide to update node on replit pinned in this channel lmao
in here
so true
bere ?
soo do i call u on private ?
not just the command line
nah bro dont call me, just create .replit file first
ok
dude use commands updaeted node
npm cache clean -f
npm install -g n
n stable
by python ?
my man replit doesn't accept those
oh then sorry
without any extension
im making it
take your time
It works on my pc but not my phone though?
yep
and there is nothing wrong with the link
that was my first tip
you may have your phone locked to something you are trying on another device
then put:
run="npm start"``` @azure current dont start it yet just put that only
in .replit
i think im done
@azure current execute this on your console:
npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH```
wheres the console



