#development
1 messages ยท Page 83 of 1
๐
It's empty because I don't want to reveal the webhook I'm using, which would open the door to it getting abused
Okay
Question 2
Why are you saving it as an array of strings
Are there more than just one webhook url?
Cause it seems like you are just hardcoding only one
That's besides the point
Just seems inefficient to store a single webhook url to an array
just keep it as a normal string
My friend sent it to me
makes sense
I don't even know what the question is at this point
the original question was answered so idk
there is no question
I was just confused on why the code is the way it is
man the spaghetti here
is it empty arrays or empty strings that are still considered truthy btw
empty arrays
@wheat mesa should i rewrite my Rust project in C
i was originally planning to make a C binding, but then i realised why not make the core in C
or should i not make a C binding, and leave the project as is (the core in Rust, with bindings in JavaScript and Python)
How can I make a command cooldown?
So only one user has to wait xx:xx time before using the command again.
When a user uses a command you could stick their name and command in an array and empty the array every x seconds. If their name is in the array throw a cooldown error message.
I'm so confused lol.

I am going to send what I think might work, if you can check it
mk
//top of script
const talkedRecently = new Set();
//execution details below.
// Your command here.
talkedRecently.add(interaction.user.id);
setTimeout(() => {
talkedRecently.delete(interaction.user.id);
}, 60000);
}
I never worked with Set() before so I wouldn't exactly know how it works. But the bottom part is similar to what I did in regards to my cooldown
Thanks! i'll test it
You still need to check if the user is in this collection
Because you have add and remove
How can i check? Use fetch?
//cooldown check
let coolDownArray = []
let cooldown
command.config.cooldown
? cooldown = command.config.cooldown
: cooldown = 3000
if (coolDownArray.includes(`${command.name} - ${message.guild.id}`)) {
const reply = client.extends.errorEmbed(`${message.author}, \`${client.capitalizeFirstLetter(command.name)}\` was ran too much in a short period of time!\nI need \`${moment.duration(cooldown).asSeconds()}\` seconds inbetween uses!`)
.setFooter(`${message.author.tag}`, message.author.avatarURL())
let msg = await message.channel.send({
embeds: [reply]
})
.catch(e => console.log(e))
setTimeout(() => {if(message.channel.messages.cache.find(m => m.id === msg.id)) msg.delete()}, 5000)
return
}
coolDownArray.push(`${command.name} - ${message.guild.id}`);
setTimeout(() => {
coolDownArray.splice(coolDownArray.indexOf(`${command.name} - ${message.guild.id}`), 1)
}, cooldown);
Is what I did, but your using interactions so my code wouldn't work for you.
yeah
No, just
if(talkedRecently.has(interaction.user.id)) {
//Code when user has active cooldown
} else {
//Command
}
Thank you!
Also, are cooldowns really necessary for slash commands? Like I get it for prefix'd ones but running a slash command can normally take longer to even type out than a single slash
Daily command
I need a 24hr cooldown
Use a database for that
Sometimes they are needed when you use some api and you don't want to get ratelimit
I am linking it to a database.
what I mean is.
put the time they ran the command into the database
and just check it

if(balance[0] && balance[0].daily_time < Date.now() && balance[0].currency <= 2147483647) {}
What I used for mariadb
and I update the time
await client.extends.database(`UPDATE user SET currency = ?, daily_time = ? WHERE userid = ${message.author.id}`, [newBal, new Date(Date.now() + 1 * 24*60*60*1000).getTime()], false)
if the 24hrs is up
Oh ok
Not saying your method won't work.
But I feel like this might be the better solution
I was gonna tie it into the database anyways, so it send the message with a message on how long is left
https://scs.twilightgamez.net/fUw64.png
So like Date.now() is in milis so if their time is not in the database just run a simple database.time < Date.now() and realistically that should always check if it's been 24 hrs.
Ty
new Date(Date.now() + 1 * 24*60*60*1000).getTime() this parts takes the current time and adds an additional 24 hours to it
Ty!
I'm having an issue. Whenever I restart the bot you have to use a command that adds/takes money from your balance. To show up on the leaderboard.
How could I store the leaderboard, without it glitching like this?
const {Op} = require('sequelize');
const {SlashCommandBuilder, Client, Collection, Events, codeBlock, GatewayIntentBits} = require('discord.js');
const {Users, CurrencyShop} = require('../dbObjects.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('leaderboard')
.setDescription('Test'),
async execute(interaction, client) {
return interaction.reply(
client.currency.sort((a, b) => b.balance - a.balance)
.filter(user => client.users.cache.has(user.user_id))
.first(10)
.map((user, position) => `(${position + 1}) ${(client.users.cache.get(user.user_id).tag)}: ${user.balance}๐ฐ`)
.join('\n'),
)
},
};```
const Discord = require("discord.js");
exports.run = async (bot, message) => {
const msg = bot.snipes.get(message.channel.id)
let embed = new Discord.EmbedBuilder()
.setAuthor(msg.author, msg.member.user.displayAvatarURL())
.setDescription(msg.content)
.setFooter('Get Sniped lol')
.setTimestamp();
message.channel.send({ embeds: [embed] });
}
exports.help = {
name: 'snipe',
aliases: []
}
``` does somebody know why the error is saying that author is not defined im new with prefix commands so i dont really know
whats the error exactly?
author isnt undefined, the thing you're using author on is undefined.
which is msg in this case
the 'get' isnt finding a message by that channel id
how can i fix it
assuming bot.snipes is a collection/map
and you're properly setting the message on delete
Then the error is that no deleted messages occurred since the bot started.
Which you'll want to have a check for.
ie, if(msg === undefined) return message.send('nothing to snipe!');
okay
how do i change the person i mentioned nickname
like if i mentioned Mac i want to change his name
so i decompiled an android app, got the dll and everything inside it looks something like this
public static bool pIsMember
{
[Token(Token = "0x60035A0")]
[Address(RVA = "0xCCC174", Offset = "0xCCC174", VA = "0xCCC174")]
get
{
return default(bool);
}
}
anyone has a clue what's happening or how could i go through this
i feel some time
/**
* @param {{ client: import("../../../Structures/Client"), interaction: import("discord.js").CommandInteraction, player: import("poru").Player }}
*/
~```
not working
is we need any extention for that?
Dll?
Also, what are u even trying to do?
.dll file
But Linux doesn't use dlls
Yes
I mean, u can't decompile anything in a way that allows u to see the og source code
Hey I have a question I need a bot that would it deletes invite-link when the discord invite-link are at the maximum because there is a maximum that is very low recently filtered by date of creation and then the second factor is the number of use of this invite
What
here is the version of the pc .dll
public static bool pIsMember
{
get
{
if (SubscriptionInfo.mInstance != null)
{
int? subscriptionTypeID = SubscriptionInfo.mInstance.SubscriptionTypeID;
int num = 1;
if (subscriptionTypeID.GetValueOrDefault() == num & subscriptionTypeID != null)
{
return true;
}
}
return false;
}
}
to revoke invite link
Yes u can
do you think it's possible to make a discord bot?
this is the mobile, which is basically the same but that looks encoded or smthn
Do you think you could?
Already said yes
As I said before, u won't get the original source code from decompiling
๐ค
But I mean could you do it?
A lot of optimization happens, much of the code gets inlined
How many "yes" do you want?
what's a better way to summarize this code or make it shorter
{KEY_SKILLS.map((skill, idx) => {
return (
<li key={idx}>
{htmr(skill, { transform: { a: (props) => <UnderlineLink href={props.href ?? ''}>{props.children}</UnderlineLink> } })}
</li>
);
})}
But I mean could you do it for me?
No, i could but I won't
even if it's against something?
hahahahhaha
probably a bad idea to key by collection index
unless it never changes
omg i need the same
You see, it's not only against the rules of this server but also a terrible habit to have
What do you mean I just believe in capitalism
We can put you on the way, but we'll not give copy-ready code
Capitalism has nothing to do with this
It is people don't want to waste their time doing free things
everything has a prize
Yes, but this isn't the correct place to hire programmers
Ah, sorry then I just couldn't find a place do you know one by any chance
My bad
And everyone who ever offers money like that is seriously underestimating the price of code
-needdev
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
Be aware, coding is expensive, even for simple things
If you don't want money what do you want
Yeah but I do not have time to learn :/
You definitely have
bottom.nogg
2 hours per day won't kill anyone
why are you trying to figure out what decompiled code does anyway
no am really too busy with exams and managing discord-servers adding coding will kill me
Then ^
it's like breaking bad you know
walter white
isn't walter white without saul godman
you see what I mean
I seriously doubt you manage servers THAT actively
Also, if you need to manage a server so actively you'd already have made a management team
Nah am new to this I just came last weeks and made a new server but I didn't knew that discord changed so many things
what even is coding lol
You're not busy, u just want the easy way
Take 1 hour off everyday to study coding, it won't kill anyone
I could but it would take me much longer than 1 hours to do a bot like that
You have 16 hours awake every day
Yes, you won't be making a bot so early
You first need to learn how to program
Also I doubt you know how much maintenance a bot takes
Even if you bought a bot, they usually give the sourcecode as-is, if something ever breaks you'd need to hire someone to fix it for you
program some bitches
I need it asap
so how i do it asap
Well, you hire someone to do it
Which will hurt your wallet a lot
Tho I doubt it's THAT important, u probably just allowed everyone to create invites and people started spamming it
Nah it's something that create the maximum of invites
in 1 days
so it's unmanagable
without a bot
Can't u just remove that "something"?
hi, why is StringSelectMenuBuilder not available DJs 14.6.0
It says it's not a constructor, not that it isn't available
Check docs to see how to properly use it
i copy pasted it from docs lol
Yeah but if Heisenberg learned lawyer to become indepedant he would have losed a lot of money in his process
Buddy, life isn't breaking bad, and ur not walter, ur just someone who's too lazy to take matters in your own hand
Am not walter, am jesse so respect me
Try typing without new and () to see if something pops
it is a metaphor
that is comparable in our life that is why it is a series literally me
Yeah except it isn't, you're just wanting the easy way out
Already told u, either hire someone, learn it yourself or remove the issue entirely
no I'm not lazy I just want to delegate and not do everything myself except that there is a beginning for this and here I am
Make sure ur seeing the correct version of the docs
Rome was not built in a day
Isn't v14 the newest version?
it was build in 2 day
No, it was built over centuries
thats why you are supposed to train every day, so you slowly get there
You're the one wanting it built in 1 day
Yes, but the more you advance the more money you make
exponential curve
so isn't it worth
to all in
like a business who makes loans
Yes, but u don't get to "advanced" without starting at "simple"
Programming is a skill, i can't try to climb the everest in ur first day
I mean, u can, but you'll die
that's why am not trying to program
I already code but it's java
you think it is similar?
Java eh? Mind to explain to me what inheritance is?
if you do a business in marketing
and you start a new one
about informatic
the one that you built in marketing will be useful
Yes yes, but what is inheritance?
Similar code pathern
U said ur in v13, isn't v14 released?
Wrong
Inheritance is when one or multiple classes inherit properties and method from a parent class, like animal and dog
HAHAHA
Am not a dev yet bro ๐ฆ
Which is one of the most basic things u learn when starting java
If u knew how to code in java you'd definitely know it
French, russian, vulkan, doesn't matter
that is not similar as inheritance
Concepts are the same worldwide
is there any reason to learn java in 2022? Instead of something like kotlin, rust, javascript (typescript) or python? (unrelated to convo)
I see
For sure, java won't be dying anytime soon
Despite what people say, it's still a major backbone of corporate world
It really depends on what you want to do with it
Bro I swear am not crazy, we agree that when you manage discord servers it's imperative to have a developer it's like being a businessman without a lawyer right??
I wouldn't compare JS/TS/Rust with Java since they're trying to solve different problems
Hire ๐ one
If you got money for it, simply hire a programmer
but as jesse said
you don't need a criminal lawyer
you need A CRIMINAL LAWYER
so how do I find
my criminal dev
I'd say learning all core languages is important, even if u won't use it
fiverr for example
Java's main use is its wide use, as you're bound to run into large systems developed around it.
saul was also broke and had a big ego
Saul is a true sigma
Well, not really
he wouldn't have started in fiver
I wouldn't say that Java itself is a "good" language (in quotes since it's hard to explain), but it's one you can expect to do a lot with.
Usually the client is much worse than the contractee
he is on fiverr right now
Basically all langs are good in their own domains
If you had to pick between Java and Kotlin, however, choose Java, as Java is the base of Kotlin, and Kotlin is really just trying to be a more tolerable Java.
๐
Yeah
I see
but you see the difference
between
a criminal
lawyer and a CRMINAL LAWYER
It doesn't really change the paradigm
one is saul and the other is also saul
Ah the reference
๐ฟ
Buddy, look, things aren't as easy as portrayed on hollywood, you won't become the major drug dealer from night to day
I did watch the show
do u guys think adding custom commands worth doing
If u want something solved either solve it yourself or hire someone who does
How "custom" are we talking?
define custom command
no drug dealer don't give enough money it's not interesting
crime boss
people can add their own commands to my bot, exclusive to their servers only
yes but what does it do
The hell are these conversations
how does it work

random guy whose been going off about random stuff for an hour
people can write their own js to act as a custom command
Move to offtopic please if ur gonna babble about you being jesse or smth
or will create a custom language
Nah am joking I like you bro
that will translate to js
so a dsl
Someone who wants a fully ready bot without learning or hiring anyone
And has jesse complex
If you think users can benefit from it, go ahead, but I don't see an advantage
I'd just create a command that mimic certain aspects of custom commands, like a snippets command
You'll be taking a LOOOOOOONG rabbit hole to do it
well a friend just asked me to add a command that is exclusive to his server so i thought why not make it a thing
And there's always the chance of ur custom lang cracking your bot open
Small world, you don't have that many opportunities in life
Bro's mistaken general for development
you do if you see them
might be worth a shot
Make sure it's not a public shot
so for example a person will do
Also prepare to halt your bot development for at least 1 month
I hope they're not going towards the bot maker program (BDFD, Bot Designer, etc) rabbit hole at least
that you don't need a criminal lawyer you need a criminal lawyer
okay sorry last sentence am go now
CreateEmbedTitle "Title Here"
and something along these lines will parse it
if (CustomScript.includes("CreateEmbedTitle"))
... etc etc
You'll go the yandev route?
and repeat that for every thing i want to add
i mean that is easy to do and i don't think is risking any leaks you'd think of
At least make a proper parser for it instead of going that route
Except it won't have any sensible order or freedom
A custom language parser
oh no
i will make it divide the command into 2 points.
(Command, Value)
why not make it all regex
Tbh the "simple" way is already complicated lul
not rly tbh
Because u still need to evaluate it
just check the text for command name and get whatever is after as the value
Yes, but how far do u think u can go with predefined blocks?
If you learn something like BNF or EBNF you can build a lot of simple parsers
Anytime someone wants something not possible you'll need to add new blocks
Which snowball quickly
Ye, I meant that even the simple path means a bunch of research for many weeks
What language will you be implementing your parser in anyway?
how do i change the person i mentioned nickname
like if i mentioned Mac i want to change his name
What Discord API library are you using?
JS probably
Yep
Then have fun, if you have no idea how to make a parser, https://pegjs.org/ exists
PEG.js is a parser generator for JavaScript based on the parsing expression grammar formalism.
nice u probably saved me ages lol
pegjs
?
interesting name choice
peg it
Yeah 
what
enjoy learning how to parse languages ๐
waffle arent you supposed to be in school rn
if you want to go down that route, make sure it's a simple syntax for your first lang please
no
what would "this" be called
they aren't making a lang I dont think
does it have a specific name
not many other reasons to be using a parser combinator
Those are query parameters
they are making a regex parser

parsing regex obviously
that can't be right
thats what they said
They're trying to parse a language using regex only
Bad idea
that's what I was thinking
basically my friend asked me to add a custom command for him to my bot so i thought might as well let people add custom commands
you're never going to be able to write a full language parser with ONLY regex, feasibly at least
gotta try every method ๐
but thats all they know how to use
parser combinators make life easier but usually only if you have experience with the raw parsing algorithms first
personally I prefer using the raw algorithms anyways
recursive descent parsers are fun
Parsing is just fun
Until it makes you rip your hair out for missing a single statement that broke the entire parser
yeah lmao
the worst part is when you have a parser that compiles and runs, but gives the wrong result somewhere along the way
very difficult to debug sometimes because it's all intertwined together
Yeah
discord.js
The <Message>.mentions property contains all the mentions in the message, if you want to change the nickname of the member you just mentioned, you can access the <Message>.mentions.members property which is a collection of all the members mentioned, and get the member you want, and use the <GuildMember>.setNickname() method to change their nickname
k
Unclear instructions
bruh remove the <>
Unclear instructions, nuked France
show us the 28 other lines
mhmm a france ip
@real rose
cringe roblox talk
much yes
for (x) {
console.log("something here, e.g fetching an api endpoint");
continue;
console.log("some result");
}```
Would "some result" still log whilst a new 'iteration' started?
No
Continue goes to the next iteration of the loop, it skips everything beneath it

Same functionality as return without "adding parameters"?
What?
Like returning nothing? No
Continue just skips the rest of the iteration of that loop
Any normal IDE would gray out console.log("some result") with the notice
Unreachable code
True
I can't believe it, when I read my old source code
I actually had written a function
and then convert it to string and then save it in database
:0
not if its vscode
It's not an IDE
exactly
it practically is
It's not an IDE
it has all the components of an ide
You can interpret it how you wish, it's not an IDE
that's just dogmatic
Untrue
Its default installation doesn't even have core components of an IDE in the first place
Hence it's already failed to be defined as an IDE
source editor, build automation, testing, even deployment to some extent
That's definitely not what qualifies an IDE at all...
then what counts as an ide
Debugger, proper intellisense, proper preconfigured compilers, etc.
intellij pretty much does the same thing as vsc except bundles a bunch of plugins (extensions) when installing
yeah vsc has all of that
Everything in VSC has to be downloaded via extensions, that's not an IDE
Factually wrong
Again wrong
then prove it
literally open the plugins panel and it's a bunch of pre-installed plugins with intellij
That's not an IDE if you need to download a crap-ton of extensions to get features of an IDE
And IDE has IDE features out of the box
oh so if you have to click a few more buttons when installing it's no longer an ide
that's a bad take
things are defined by attributes, not by names
VSC is a code editor or source code editor, that has IDE-like features.
ergo it's an ide
Leads absolutely no where, no point on continuing.
ergo means therefore
Read VSC's own documentation as well as Wikipedia and other sources, they clearly mention VSC as a code editor.
again, those are namesโnot attributes
vsc has the attributes of an ide
but this is getting no where
so I'm not going to waste more time on this
Hello guys, can I integrate two different commands prefixes in same bot?
Yes
Of course
obvious but wanted to check, thank you guys
<div class="parent">
<div class="child">1</div>
<div class="child">2</div>
<div class="child">3</div>
</div>
.parent {
display: flex;
flex-direction: column;
}
.child {
position: relative
}
how do i display childs in row?
const Discord = require("discord.js");
exports.run = async (bot, message) => {
const embed2 = new Discord.EmbedBuilder()
.setDescription(`nothing to snipe!`)
embed2.setColor("#2E3192")
const msg = bot.snipes.get(message.channel.id)
if(msg === undefined) return message.channel.send({ embeds: [embed2] });
let embed = new Discord.EmbedBuilder()
.setAuthor(msg.author, msg.member.user.displayAvatarURL())
.setDescription(msg.content)
.setFooter('Get Sniped lol')
.setTimestamp();
message.channel.send({ embeds: [embed] });
}
exports.help = {
name: 'snipe',
aliases: []
}
``` does somebody know why it everytime says "there are no messages to snipe" in my snipe command
Maybe because you don't have any messages to snipe? 
no i deleted a message and then i use the command and it always says there are no messages to snipe
Do you save deleted messages somewhere?
yes
how do you save it
I was going to ask about it
Because if you save them wrong, then reading them correctly won't help you
Always try to include all possible necessary information in the question
Okay question
wdym save it
So have you checked to see if msg actuallycontains something
those are two separate things entirely though ๐
He says it keeps telling him there is no messages to snipe
so msg has to be null/undefined
Thats all that matters right now
Cause that is where its stopping
So msg is probably undefined/not what he thinks it is to begin with
Let him just send the code that is used to save these messages
Everything should be clear
Okay, the command doesn't work as it should
yup
How do you save deleted messages?
WE kind of already know that...
There is no way to access deleted messages using the discord api
You need to save them somewhere when they are deleted
And then read them using the command
what do i need to do to fix it
Show us the code that is responsible for saving deleted messages
ok this code definitely isn't yours
If this code is missing, then the entire command is missing
Because you can't read messages out of thin air
Deleted of course
ill look
That's for sure 
Do any of you know a good place to ask for people to translate your app for a fair price
there are plenty of companies that do that
Been browsing and have asked a few friends who were kind enough, but I only have so many friends who may or may not all be imaginary
dunno if anyone went with a specific one and could vouch
Would having a loop weather it being a while loop or a setInterval that goes on indefenitly to keep an eye on members who join via patreon membership be fine on resources? I would assume because the patreon bot that is basically an auto role bot for patreon roles would cause the guildMemberadd event to not always see the role the user joins with correct?
you'd be better using a setInterval as loops block the thread
Fair.
I also would assume I could use for example https://www.npmjs.com/package/@anitrack/patreon-wrapper#installing and on guildMemberAdd fetch all patreons and filter it by their ID and if it matches apply the benefits
discord: {
id: '12345678',
url: 'https://discordapp.com/users/12345678'
}
The best way to do it for free is basically just having the bot in your guild and people join there with their patreon linked to get the benefits that way it's just a filter by members with role.
But if you have people that refuse to join your guild but still expect benefits, then that may be the way. Both ways are limited to if the user has their Discord account linked and they can link/unlink at their own will and I personally find it gross polling an api
Ya. I also considered making a /activate command or something so the user has to atleast send 1 command to recieve benefits.
But to be fair, if I were to limit them always having to have an active subscription I feel like a loop would be needed somewhere to check every for example hour changes in tier status
Like I can do all of this fine, more looking for suggestions in what someone would do ๐
Just having the bot in your guild and filtering by roles
The changes propagate immediately with the bot anyways iirc
I would just feel kind bad forcing them to be in the server if they don't want to be
just be like top.gg and do free labor

IIRC topgg considered using one of these services not using free labor
I might go the setInterval route with idk a 30 minute timer and it just checks active and nonactive users and copaires it to my database and apply changes there.
yes and still chose free labor cause its free
I already have
German, English UK, English US, Spanish, Dutch, Polish, Brazilian Portuguese and Russian.
some from not so free labor
just steal top.gg translators
@ Voltrex
what the fuck
anybody ever had any issues with hosts blocking ports? Been recently experiencing it on hetzner regarding mail ports
hetzner does say they do it to avoid abuse, though seems like contabo does too
also hetzner has a straight forward process on unlocking these by being trusted on them through both paying invoices (which i haven't yet since i used them recently for testing) and case-for-case decisions. How would that work on contabo?
Most VPSs will keep such ports blocked, 25 for mailing for example, you have to contact them for them to open the port for you
You may need to prove that you won't abuse it
me: Contabo, give port 25. Contabo: for sending emails to users?
me: yes. also me: sends unsolicited ads about people's cars' extended warranties like a boss 
At least you don't send emails containing unsolicited ads of your NFTs

Pretty often that VPS close some ports
Usually just sending a support request to open a specific port should work out with no additional costs
is it just mainly on VPS or do they unlock that port directly on dedicated servers
yeah waiting for a response by contabo, they apparently didnt block the port for sending, but receiving
telnet basically times out so im certain its blocked
hell yes
Not sure about that, seen some dedicated server providers block some ports as well - I'd totally imagine that some let you manage them by yourself
Though I doubt there is one that has all ports open, wouldn't make too much sense
But yeah usually just a support ticket and you get it opened
well my mailbox is going to be filled with these until then lol
LMAO
What's the reason to use the insecure protocol at all?
Unless you're in a business for example with a closed network using a mail service for internal communication I don't see any reason nowadays to use it.
Not even for testing purposes
Issue your certificate, configure the mail server and use the secure protocol
Nowadays not even hosters blocking these ports, also ISPs do to prevent spam by compromised PCs of their customers
As well as routers including such options to block outgoing traffic on port 25
Also in order to host a "legitimate" mail server you will have to do a lot of things to prevent your mails being flagged as spam
For example making sure the dns records are valid, rdns does resolve your hostname correctly, SPF, DKIM and DMARC is set up correctly
etc
Even after this it can be a hard process to get your IP whitelisted for any big mail service provider
Or get it removed from any of the existing block lists
etc
FakE out.
@rustic nova
is what I did
they're blocking either 465 and/or 587 lol

or am I actually just dum

can you telnet these ports?
Try to use https://mxtoolbox.com/ to debug
Yeah I have, literally DKIM, DMARC everything setup
I can send emails, just not receive any
As I don't know anything about your setup, configuration, records etc
hostname and rdns set up correctly?
It's google most likely don't wanna send mails to your server
Tried a different mail service?
its just google that times out, the IP is actually the mailserver
the rdns might be set to my main domain, though shouldn't affect delivery as thats related to DMARC/DKIM
though this seems like port blocking from the provider side, since all of these ports are used within a docker container, including 80
but ye
also the SMTP test dies too, just times out
Weird, what u can try is to enable the cloud firewall and set it up to allow incoming connections on these ports or test wise any incoming connection
To see if you can get around that
Im still not aware they block those ports by default
At least I got no issues
Not for dedicated nor cloud server
they have a cloud firewall?
Yes
But you gotta enable it
Or "create" it and assign it to the server of your choice
Oh I didn't check this, was speaking about Hetzner
Just expected them to have one too
hetzner does require unlocking the port by requesting it
contabo doesnt have it noted down anywhere
Which one exactly?
The ones for unencrypted connections?
apparently all of the above now
it did previously work on the sending one
that ones blocked too now lol
so I'm taking a fair guess too that they're blocking that on me
Can't test it atm unfortunately but there shouldn't be any restriction on incoming connections
Outgoing yes, maybe
nah its just incoming
Nah impossible
If you can show me where this is written down please
Because it doesn't seem to apply for me
No according to the docs they block outgoing connections on these ports
Nothing else would make sense tho as restriction
its not written down anywhere, thats the thing
so its only outgoing, not both?
ohhhhhhhhhhhhhhhhhhhh
wait
think I figured it out, I hate docker networking
No just outgoing
either im stupid with setting up my dockers
To prevent compromised systems or bot customers to send spam mail form server using unencrypted connections
Making own mail server, what an awesome idea /s 
I'm taking a fair guess I did forget to properly firewall the ports
now it works
๐
I forgot to fucking route the docker ports to the interface
fml
rip that contabo support ticket lol
contabo's ticket system is wack

Glad I'm not using docker
I am cuz im stupid
but keeps me from bricking my whole server when trying to install something while frustrated
Hi does anyone know how I can fetch users current guilds?
fetch('https://discord.com/api/users/@me/guilds', {
headers: {
'Authorization': `Bearer ${localCode}`,
},
.then(result => result.json())
.then(response => {
//do something with data
})
.catch(
//error handling
)
})
The bearer token is retireved from succesful login with Discord, and if I change it to Bot and use any of my bot's tokens it retrieves their guilds. Trying to get data from specific guild but guilds/${guild_id} is always 403
did you specify the guilds scope on your login flow?
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
/api/v10/guilds/:id
Most api endpoints are functional for clients
Basically all
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
yeah that didn't help in the slightest last few times I read it, but ty
uhh one sec imma check lol
yeah mb I sent fetch guild
yeah it does specify guilds
still returns 401 tho
can anyone help ๐ฟ
trying to change a python script to js
response = requests.post(urls['BAN'], data = {
'type_device': int(random.random() * 15//1),
'id': userid
}).text
if strictEquals(response, chr(32), '1'):
return True
else:
return False
``` this works
this always returns false
even when is supposed to be true
anyone know whats wrong
I tried to craw a web, but it just return some small tag
How can I craw a website, that is ssr?
Looks like a crawler protection for me or to specify it once the client doesn't accept cookies you won't see the site
Actually I don't see any JS file import
Or script except the existing one
I wonder how it checks if the cookie is set then
Probably in the backend
Which might be the reason the site is enforcing a reload
Yeah
Probably setting the cookie then being sent by the browser
Could easily store the cookie and send it
but doing that on arbitrary pages? good luck
Yeah I don't see why this is required at all
Must be unbelievable unique and import content nobody should have access to
really doesn't make sense
just generate the cookie and send it in the response in one go
not generate, give it back, send it back, get stuff
Depends what's been used in the backend
php for example has no access before the site will be reloaded as the headers are already sent
that's weird
Why tho? This code sets the cookies after the header has been sent
How should php notice this client sided change when it's only server sided?
lol
as a person who played around with webserver on socket level I can tell you how headers and cookies work but you probably already know
on my server I just send it in the response headers
and expect the browser to save it
just don't understand why the site would go through the extra ceremony
you didnt solve this?
no i stopped trying hoping that someone helps me
i tried doing post req and sent it as body didn't work
can you send more of the code surrounding this part?
the python code or javascript?
js (the non-working version)
one sec
it seems my host is down for maintenance and i didn't upload the newest build to github yet so i don't have that script
ggrip
but basically fetch is node-fetch and i'm trying to make a command to check if an account is banned in certain game by using their servers open api
but their api is a bit weird
i'm quite sure i need to make a post request with ID ans device type
but i'm not sure why it always returns 0
when in python it works well
well if you dont comment and change method: "GET" to method: "POST" it would be correct according to the docs
(https://www.npmjs.com/package/node-fetch#post-with-json)
yeah i already done that obviously
was just thinking i could try using GET
since POST did nkt work
tried to send it both as body and by itself
welp let's hope somebody knows soon or you'll figure it out ๐
waiting for ^^
yus, just need to wait a sec
apparently my host is down for maintenance cuz someone was abusing their servers or sumn
probably abuse as in used for ddos ๐ common nowadays
most probable ๐
nicovideo's way to prevent people from streaming their content is annoying. This code doesn't work, but they have you recursively fetch m3u8 playlists which all have to be formatted very specifically.
sounds like standard video protection, there are apps that can download that
they do exactly what you said
@wheat mesa @viral badge https://pastebin.com/6yMGBxUG
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.
u guys need anything else?
i can send the python script which works if it helps any
i havent used await x.then() enough to know by head, so i'll need to try it out tomorrow
Its possible that Scrap isn't set by the time you do your check since .then() would normally run async
someone suggested i double then cause if i use .text() it returns 2 promises even though i awaited it
which is weird because it already returns something
but 0
wbich is not valid
also tried, btw i do get the result
just have problem sending in id maybe
What exactly isnโt working?
Hey guys I'm using Discord.js V13, and I stumbled across an issue that popped up really out of nowhere, it was working fine. I didn't change anything with the callback. Anyways, here is the error:
TypeError: feature.run is not a function
at Object.<anonymous> (/home/runner/Gage/index.js:68:13)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
And here is the full code, if you'd like to examine and possibly help/give me an explanation?
client.features = new Collection()
client.featureFiles = walkSync(path.join(__dirname, '/features'))
for (const file of client.featureFiles) {
const feature = require(`${file}`);
client.features.set(feature.name, feature)
feature.run(client);
}
The features folder is basically my modules for commands. Lockdowns, verification, aichat, ect.
Do any files in /features not have a run method?
Yup. Thank you so much. It's always the little things I don't realize!
Working fine!! Thanks!
Sorry to bother AGAIN, yet I got one more issue. I tried using interaction.create, and interaction.defer which basically are the same thing as they both TECHNICALLY mean any. Could someone help me better understand/help me fix this quickly as I cannot use any command on my bot.
await interaction.defer({ ephemeral: true }).catch(() => {});
^
TypeError: interaction.defer is not a function
Well, first off, they are not the same thing, and second off, are you sure interaction is what you think it is?
I think so, but now you're making me think otherwise ๐คฃ
interaction is the callback.
Log it or send your command handler and your command function signature
client.on('interactionCreate', async (interaction) => {
if(interaction.isCommand()) {
await interaction.defer({ ephemeral: true }).catch(() => {});
const cmd = client.slashCommands.get(interaction.commandName);
if(!cmd) return interaction.followUp({ content: 'An error has occured'});
if(!interaction.guild) return
//Permission requirement
if(cmd.reqPerm == "BOT_ADMIN" && !client.ADMINS.find(admin => admin.ID === interaction.user.id)) return interaction.editReply("This command is reserved for bot admins only.")
This is where it's happening.
3rd line.
Oh I see
What do you notice?
interaction is my callback. I used it properly after await and just .defer could be the issue?
.defer doesnโt exist
Thatโs not a real function
deferReply is the function youโre looking for
Make sure to look at the docs for CommandInteraction to see what all of the functions are
Is it deferReply? I'm in the docs.
Oh shoot it is.
Thank you!!
Hello
I've copied the code from https://docs.top.gg/libraries/python/ to automatically post server count, but I can't seem to get it to run in discordpy2.0+
nvm I just had to make the object in in setup_hook
Big w for me
public class CuiButton
{
public CuiButtonComponent Button { get; } = new CuiButtonComponent();
public CuiRectTransformComponent RectTransform { get; } = new CuiRectTransformComponent();
public CuiTextComponent Text { get; } = new CuiTextComponent();
public float FadeOut { get; set; }
}
by default if set is not mentioned it means its a private setter right?
So you can't do it externally?
iirc it has none
such as
CuiButton button = new CuiButton
{
Button = new CuiButtonComponent() {...},
Text = new CuiTextCompoent() {}
}
You'd need private set iirc
So this isn't possible?
I thought C# interpreted as it being a private setter by default
there are readonly attributes so
So what I just did above isn't possible?
beyond just nooping
Believe you need to specify private for that
I am only asking cause I am looking at the source code for something since there is no actual documentation on how shit is
Will then be a private setter
This isn't for me
TypeScript was inspired by C# so I let it slide. Unity is C# and that's fun to dev in
I saw some kid ask a question and wanted to verify if I was correct before helping

I miss unity dev work
but it gets boring looking at a almost finished product with no models
Let them the hassle of finding that one line in a hidden documentation about it 

I'm trying to make a VR version of Dinkum/Animal Crossing in Unity
not 1:1, but my own spin
It is a lot of fun and a learning experience. Trying to figure out procedural terrain manipulation that's optimized and isn't marching cubes
vr is expensive to get into for sure
but its worth it to me (3k+ hours)
Omg I love procedural terrain stuff
perlin noise is such an interesting algo
Generation I have the concept of, but any manipulation sounds egregious and shitty for performance if I just have a non static mesh
Hey I was trying it out ight
I at least know now what I have to do to get it to work
I just don't know how to use terrain in unity
Unity terrain is really cool
I don't get it
I hope they move away from flat billboards at some point for speed trees and foliage and just do what unreal does with nanite LODs
considered trying to get into VR dev more on Unreal since now lumen and nanite are supported in VR
but cpp and the editor are so foreign to me and really difficult to do what I want
I tried it out a bit and did some crude number testing against js and memory and cpu time are very formiddable and almost makes me want to force myself to learn it more
but js is good to me. I love js
i love js
How do you generate terrain in unity?
if they put that much effort into avoiding people to do that, they might do what youtube has done
So I'd say nicovideo isnt future proof
cease n desist?
Hey, I am implementing Oauth atm for the website of my bot.
I do not want to use a IP address with http as a redirect uri.
I tried different things with https and setting up a domain in my server settings but I get the Oauth not work properly.
I already have setup a https website which is accessible and the ports are opened. I tested it with the IP and HTTP redirect and it worked.
Do you have any thoughts are ideas what I need to consider?
did you add the url in your application settings?
yes. But I ended up with that the url is not available (the url defined in the auth.get("/api/auth/discord/redirect", async (req, res) => {)
const auth = express();
const httpsOptions = {
key: fs.readFileSync(
"/etc/letsencrypt/live/test/privkey.pem"
),
cert: fs.readFileSync(
"/etc/letsencrypt/live/test/fullchain.pem"
),
};
const server = https
.createServer(httpsOptions, auth)
.listen(3001)
.on("listening", () => {
console.log(time() + "Auth server listening on port 3001");
});
That is the relevant code. But of course there is much more things causing the problem. Like the apache2 setup or anything else
your https server is running on 3001, so you need to append that to your url
https:// is by default 443, if no port is provided
otherwise, the port needs to be provided aswell, so https://oauth.example.com:3001
format code like this
format code like this
how can we get a boolean value if bot is muted or timeout in a guild
I think they mean muted in general, not just in a voice channel
Not necessarily
You can be muted in a channel without having a role
Though there's https://discord.js.org/#/docs/discord.js/main/class/GuildMember?scrollTo=communicationDisabledUntilTimestamp for timeout
can we update the interaction if the interaction is already replied
yes, there is a InteractionUpdate I believe
but depends on what you mean with update
editing the interaction response is possible, but you cant just say "oh I wanna revert my response to the interaction"
cannot read property of undefined (reading "add') when i try to use target.roles.add(role) any one know how to fix this
no
make sure that target is a GuildMember, so interaction.member instead of interaction.user for example
how would i fix this constraint?
I know that my tables both have a shared isbn that i connected to each other using the primary and foreingn key
However now i am trying to either update or delete the tables but it's always giving me this constraint?
does topgg support autoplay for iframes?
Must i use ALTER TABLE Book DROP CONSTRAINT isbn?
TheALTER TABLE Book DROP CONSTRAINT isbn statement is used to remove the isbn constraint from the Book table in a database.
Whether or not you need to use this statement depends on your specific requirements and the structure of your database. If you have an isbn constraint on the Book table and you want to remove it, then you would use this statement to do so. However, if you do not have an isbn constraint on the Book table, or if you do not want to remove the constraint, then you would not need to use this statement.
It is always a good idea to carefully consider the impact of any database changes before making them, as they can have unintended consequences on the data and the structure of your database.
I hope this helps to clarify the purpose and use of the ALTER TABLE Book DROP CONSTRAINT isbn statement. Let me know if you have any further questions.
It does not directly support the use of autoplay for iframes ig
You need to allow the site to use autoplay, also within iframes
which is dependant on thr Browser
Hello, I'm working on a discord bot I want to make sure it'd ready for public "consumption", I use mysql geting and updating in 99% of commands and this probably isn't a good way to do it for a large bot. Should I create a cache then update the mysql every 5 minutes? How do I make it so the bot can handle having commands run spontaneously. This runs on discord.py.
well every browser allows autoplay basically but some only allow it when it's muted
It may work, it is a good way to create a cache and periodically updating it but also, To make your bot able to handle commands being run spontaneously, you may want to consider implementing a queue system to process commands asynchronously. This can help to prevent commands from being blocked or delayed when there are many requests being made simultaneously.
import asyncio
from discord.ext import commands
from discord.ext.commands import AsyncQueue
bot = commands.Bot(command_prefix='!')
queue = AsyncQueue()
@bot.command()
async def command(ctx):
await queue.put(ctx)
async def process_queue():
while True:
ctx = await queue.get()
# Process the command here
await queue.task_done()
bot.loop.create_task(process_queue())
bot.run('TOKEN')
ou can use the AsyncQueue class to create a queue for processing commands asynchronously. Like this โ๏ธ
Why using bot.loop.create_task
to schedule and run tasks?
from discord.ext import tasks
@tasks.loop(seconds=1)
async def yes():
print("yes")
yes.start()
ยฏ_(ใ)_/ยฏ
๐ simple
This can help to prevent commands from being blocked or delayed when there are many requests being made simultaneously.
Pretty sure discord.py is an asynchronous library by design. Big bots work perfectly fine with the way the library handles the commands by design and by default.
Oh yes. I love putting all of my logic on the main thread and taking as much time as possible in a single tick of the event loop
please give me more synchronized event loops on all threads. Parking a thread is the greatest
Last time I checked, which was a while ago. Emojis are setup like this, right?
It doesn't work.
It's the correct ID and name.
Did bot has access to them?
<a: if its animated, however i've encountered a similar issue with one emoji not showing but it shows in other messages the bot sends
Yeah. They're from my server.
Yeah! Only embeds!
Bot has administrator permission which covers all permissions including access to emojis and stickers.
I don't even think it needs that permission.
Did you have a fix for it?
That's weird then
It's just messages.
I feel as if a toggle doesn't need an embed though.
So I'd like to keep it a message, but is there a way I could fix it? Was there a change?
Just for kicks, laughs and giggles let me add the a in front even though they aren't animated.
Nope.
well the only permission it would need is to use external emojis (which admin includes ofc)
I still have a issue that when my bot edits its message, in some servers, it doesn't turn into the emote
Yeah.
Would the way it's called have something to do with it?
i have no idea
Here is a snippet from one of my commands:
interaction.followUp({ content: `${client.emotes.success} Successfully deleted the alt identifier channel!` })
I exported the .json file as a module in the discord.js client.
So I can call it in any channel.
But I feel like that wouldn't alter the emoji.
(animated emoji) works
When edited, the non-animated emoji doesn't work in this (this = one server it doesn't work in) server
However in the next message (non-interaction though) it shows up
But in one of my other servers, the emoji works in that same place where it didn't in the other server
neither of those servers have the emoji in them
Hm.
Administrator bypasses channel permissions, right?
administrator contains all permissions yes
No like channel overrides
yeah its almost like having ownership i'm pretty sure
Alright thought so.
Because those channels that I'm testing it in don't allow external emoji for @ everyone.
But the bot has an administrator role.
Temporarily I guess I can use default emojis.
I looked into discord role menu and verified that is indeed the case
Maybe it's worth checking and changing this setting for @ everyone?
Alright.
yeeah often worth testing the easy things first ๐ต
Default emojis work ofc.
well yes
The channel already had the permissions on for external emojis.
you got any eval command or some other test command to test it live with?
nice
Just getting the client things, models, handlers and main bot features down first.
Like a captcha system, which is the verification thing you're seeing.
Okay, so a very important question. What you see in the screenshot is interaction.reply() or interaction.followUp()
Hm?
I use interaction.followUp.
Because from what I read on the internet, interaction.followUp() cannot display custom emoticons
What is the difference?
Oh wow huh. Is there a difference between reply and followUp?
Apparently
reply is replying to the original message, followup is a normal message no?
I have embeds sent with followUp
In two commands.
I know.
But I understand from this message you said "followup is a normal message no?"
Nevermind.
by normal I mean a non-reply message
Oh.
i however use reply and the editReply fails the emote in some cases
I don't know if that's the case tho, tim would be able to answer it better
ye
Both editReply() and followUp() use some kind of webhook, most likely it is responsible for these problems
But I'm not 100% sure, it's just a guess
weird
Just because the fact someone else is having the issue aswell using .reply, I'll stick with .followUp. Ping me if anything turns up or anyone else has suggestions please!
well i have the issue on editReply btw
I switched to online for notifs.
Not reply?
nah reply works finee
I current don't use the edit feature right now so I'll switch to .reply.
should I use like fetchReply option or something or just gotta do something else?
Follow up is another webhook replying to the initial response (not to u) or being shown as first response when a follow message has been sent right after deferring an interaction
It's basically your interactively webhook token you can use until it times out
editReply only works after deferring your response
Once you didn't defer it you can't use this method
Also worth to mention that this method can throw an error once the token becomes invalid or the initial response (for example the deferring status) has been deleted
The reply() method makes sense only once you can respond immediately
As the webhook token is valid for 3s only without deferring
Alright so I'm back again with an issue I've been trying to fix since I last spoke here.
This is to do with reloading slash commands as I've globally deleted all of my old slash commands. Now trying to reload my new commands, I am having issues.
Here is my code:
const commands = [];
let commandFiles
let commandsFolders
if (guildId == guildId & clientId == clientId) {
commandsFolders = fs.readdirSync(`./SlashCommands`); // All command folders & files
}
for (const folder of commandsFolders) {
commandFiles = fs.readdirSync(`./SlashCommands/${folder}`).filter(file => file.endsWith('.js'));
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
for (const file of commandFiles) {
const command = require(`./SlashCommands/${folder}/${file}`);
commands.push(command.data.toJSON());
}
}
// Deploying commands
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);
// Use the put method to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationGuildCommands(clientId), // Guild Commands
// Routes.applicationCommands(clientId), // Global Commands
{ body: commands },
);
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
console.error(error);
}
})();
I keep getting this error stating that command.data.toJSON is not a function, what would the cause be?
I didn't have anything with "data", so I had to rewrite my command to look like this:
dont use djs
Since you don't use the slash command builder - thank god - make sure your command structure actually follows the api expectations
The properties cooldown, regPerm or args are not part of the command structure as the api expects it
Also don't import and use the rest methods manually
client.application.commands.set/create/edit() are inbuilt methods in djs
You simply provide the command array as argument



format code like this