#development
1 messages · Page 2023 of 1
you can give the user a list of sessions and let them invalidate them themselves for example
cant do that with jwts
you can give a jwt an epxiration date
yes but you cant invalidate them manually
the thing that fb/google/etc do
that they show you all your logged in devices
and you can make specifict devices logout
its done with normal sessions
aight^^ thanks alot
How do I sent JSON data in an aiohttp get request?
get requests are not supposed to send any data in the first place
oh
aye, which requires the client to query the database each request
That will also allow you to deauthorize other devices, like in my example
aye aye captain
Which also allows you to disable accounts
And one query per site request isn't something you should worry about
nothing caching wouldnt solve anyway
or a stupid fast db that doesnt need caching
(sqlite :^))
yeah but what I want to point out is, it has to be requested on each request
some account you block, shouldn't have access anymore even for the next request
I mean the database has the request cached anyways as long as the table doesn't change
but you still have to do that database request
And an external centralized database, like mine, can have an impact on that response time
local caching and eventual consistency then
nah I don't see any issue here in my case
the common response time is about 100ms until the entire page and code is rendered
@quartz kindle How’s your API doing? :P I worked very hard the last weeks to finish my 3rd version and the website and I’ve done very good progress
nice
i keep refarctoring it instead of adding the missing stuff
lmao
what are you building it with?
me? nodejs
i think i finally got a somewhat acceptable scaling design, with multiprocess lmdb cache pre-filled with all the ~700k planet ids
Yeah I’m keep doing that too
rewrote my updating scripts like 3 times
trying to get them to be able to update the data without interrupting the running processes
separated two monolithic files into two folders of small functions
im still not sure about my grep-based full text search
but its the only way i can get the results i want, token-based seach indexers always give me lackluster search results
and i dont feel like installing something huge like elasticsearch
Yeah and the risk of a library in use dropping its support or does major changes seems to be high in the world of JavaScript
I noticed as well
yeah, i used to rely on moment-timezone
but i wrote something to replace it
since its basically in maintenance mode only now
Yeah and I was running into the same issue the past years when using and relying on something I had to found out at a certain point the library doesn’t scale well for me or doesn’t do it’s job anymore under certain circumstances
And rewriting the entire to get it ruined on the next update sucks as well
Doing anything from ground up yourself costs a lot of time but still seems the best way for me if you wanna create something that can last for some years
Even if you have redo like thousands of things
yeah
im still worried about some things but its too troublesome to change them
still, my dependencies are not too bad
geo-tz might be a problem in the future, its tied to the iana timezone database which is updated multiple times per year
if geo-tz stops updating accordingly it will be troublesome
and geo-tz in turn depends on this https://github.com/evansiroky/timezone-boundary-builder
which if its stops being updated, will also screw a lot of people
I wonder about adjustments in time zones or new ones
I mean how often does that happen…?!
Probably rarely
300Mb/s up and down
@quartz kindle Intl module is no help for yourr timezone needs?
The speed isn't necessarily the issue, it's a matter of reliability
Intl.DateTimeFormat().resolvedOptions();
nop

What is a good D.js framework to use? Is it worth using a d.js framework? Or are there not any that exist that speed up development time and simplofy the process?
not worth
Why not?
I've used frameworks before and iwl they just slowed me down
Akario being one of my least favourites
djs by itself is already very easy to use, besides djs is not exactly very efficient to begin with
using a framework will not give you much advantages and will contribute to increasing the bloat
i agree
I wanted to make a lib that just only includes some helper classes like Embeds and Buttons and such and wrap that around raw gateway/rest libs in my own code.
I find it impossible to maintain a cacheless version of Discord.js I made because it's just me, so might as well
same
ignore the context
you see the box inside of the box right
i wonder what colour i should make it
What's the context? 
But well, in my opinion, the buttons are too contrasting and they being differently sized gives a weird feeling
i changed a bunch up and its looking a lot better
right not sure if this is illegal but-
ok enough suspense
i'll be tricking scammers with this
thats not the illegal part tho
jim browning is that you
lol yeah im planning to jim browning the scammers
if you know what i mean
overwhelm them with a fake wallet containing 5k+ bitcoin
give them login details
and conveniently place the transfer to wallet button
which will make you install "secure interception-proof wallet protection software"
:)
I'm doing Tabs on my bot's website, it's coming out like this:
however, I wanted it like this:
if anyone can help with this :)
oh yeah
i forgor the code
you'll need an extra div
hmmmmmm
instead of using borders, you add an extra floating div on top of the line, and control it via width and margin (or translateX)
anybuddy using hybrid sharding
Are you mean discord hybrid sharding package
Yea i am using
then how can we get shard uptime and more...
Since discord.js is one with sharding manager, you can use it like client.cluster.broadcastEval() or fetchClientValues()
i will try
Same with discord.js sharding manager 
better for system

Hello! I'm trying to install git but when I try, I got this error, I've also tested all commands suggested by apt (like apt --fix-broken install) but nothing work
sudo apt install git?
He's using root
my bad
yep
If your package manager can't find dependencies on it's own you usually have big problems
:/
Try an apt update first
it doesn't work
idk that's not my vps
or maybe try installing one of the unmet dependency, run apt install git again, and check if the unmet dependencies decreased
His last screenshot looks more like inaccessible apt repositories
Alright 20.10, one second
oh wait
20.10
That is old
lmao
Do you have backups or that machine?
I would recommend just trying to upgrade it to a newer version
Yeah
Ubuntu 20.10, oh my
there is some issues with my host provider, backups doesnt work
😐
lets go :/
Then download important configs
Your bot config with your token etc.
Either reinstall the machine completely, or try to upgrade it:
https://askubuntu.com/a/1391751
Just upgrade to a newer Ubuntu version I guess?
oh my
Actually
Ubuntu 18.04.4 will no longer receive (standard) support after April 2023
thank you for the information
i will
ah ok
you learn this lesson once but I have to stress do not install any other version of a Linux distro other than LTS on a server
on a computer, fine but on a server it will go EOL very quickly
lts is always even number and .04 minor version
for some reason
.10 is like prerelease, odd number is non-lts release
apparently their versioning is based on release dates
18.04 released april 2018
they always make a new release exactly every 6 months, and a new lts exactly every 2 years
what abt 20.10?
Extended Security Maintenance (ESM) provides security updates on Ubuntu LTS releases for additional 5 years. It is available with the Ubuntu Advantage subscription or a Free subscription.
xx.04 is a LTS as Tim mentioned
20.10 not
okay thank you all for the information
that I get, what I mean is, what would the 20.xx represent?
2020 i guess
The first number is always based on the first release year
but 18.04 was released in 2018
Of the mandatory version
You have to fetch the guildmember
They're calling their major version name by the year of the release

it stays like this

Did you wrap the html code in code tags?

and I thought battlefield release numbers were confusing
like, 20.04 > 18.04 > 20.10
By naming the release number by the year of it's release
No wtf
18.04 isnt > than 20.10
never knew Ubuntu was released in 1804
20.10 just does NOT have the ESM
great, that answers the question
Because it's not a LTS version
<li>Botun Komutlarını Görmek İçin /yardım veya !!yardım</li>
----------------------------------------------
<table id="komuttlarr">
<tbody><tr class="header">
<th style="width:15%;">Komut İsmi</th>
<th style="width:60%;">Açıklama</th>
<th style="width:25%;">Kullanım Şekli</th>
</tr>
<tr>
<td>
Kullanıcı
</td>
<td>
Kullanıcı Komutlarını Gösterir.
</td>
<td>
/kullanıcı veya !!kullanıcı
</td>
</tr>
<tr>
<td>
Moderasyon
</td>
<td>
Moderasyon Komutlarını Gösterir.
</td>
<td>
/moderasyon veya !!moderasyon
</td>
</tr>
<tr>
<td>Aboneyardım</td>
<td>
Aboneyardım Komutlarını Gösterir.
</td>
<td>
/aboneyardım veya !!aboneyardım </td>
</tr>
<tr>
<td> Eğlence </td>
<td>
Eğlence Komutlarınız Gösterir.
</td>
<td>
/eğlence veya !!eğlence
</td>
</tr>
<tr>
<td>
Müzik
</td>
<td>
Müzik Komutlarını Gösterir. </td>
<td>/müzik veya !!müzik </td>
</tr>
</tbody></table>
<style>
.columns .bot-img {
border-radius: 4px !important;
overflow: visible !important;
box-shadow: none !important;
background: none !important;
box-shadow: none !important;
}
</style>
tf
lol that interruption :D
Botun Komutlarını Görmek İçin /yardım veya !!yardım
yes
that tittleless i is cursed
preview never worked correctly
Amazing how they manage to fuck up each feature of site day by day
looks like member is an id,
id.timeout wont work, it needs to be a member
https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=timeout
To get the member from the mentions, you can use the first() method on <Message>.mentions.members instead of users, since the timeout() method only exists on a guild member instance
guildus memberus
So true
Show code
Have you checked what the message parameter actually is?
That error seems to occur because an actual message instance is not being passed as the message parameter
Try logging the message parameter
show where you use .run()
await command.run(client, message, args);
function arguments are passed by order, not by name
async (client, member, message, args) => {
client is client, member is message, message is args, and args is undefined
Is there a big difference to consider when choosing between Vue and React for a project?
what changes did you make?
🤔 that still doesnt seem right.
(client, message, args)
as thats what you are passing in here
function arguments are sorted the same way every time.
so
if you run
someFunction(a, b, c)
and your function is defined as
function someFunction(b, c, d) {
console.log(b) // logs a
console.log(c) // logs b
console.log(d) // logs c
}
js function arguments go by order, not by name.
its probably easier to fix it here
function arguments are passed in order, not by name, as i said
if you do .run("test")
no matter what you write in async run(a, c, b, etc)
the first name will always be "test"
since you are doing await command.run(client, message, args);
the first thing is always client
the second thing is always message
the third thing is always args
does not matter what names you write in your run functions
run: async (client, member, message, args) => { it does not matter what names you write here
the second one is always gonna be a message
the third one is always gonna be args
the fourth one is always gonna be undefined because it doesnt exist
(Also you don’t really need a parameter for client, you can access it through basically any structure)
Same with member
You do like let time = args.pop()
Then you do let user = args.shift()
Then let reason = args.join(“ “)
I have a domain and a VPS as my hoster, and am using Express and NodeJS. How do I expose the web server publicly to the domain?
Using nginx as a reverse proxy would be the easiest way to do it
.setFooter({ text:``, iconURL:`` })```
you go to your domain configuration in whatever service you bought the domain from
and setup your dns records to point to your vps's ip address
then in your vps you need to run a webserver on port 80 for http and port 443 for https
could be nginx with a reverse proxy to node, or node itself, but since ports < 1000 are protected you need to either run node as root or configure your system to give it permission for those ports
me when i forgor .gitignore and repo is "node_modules" content only:
https://c.tenor.com/B59ThrIfKQkAAAAC/skeleton-berserk.gif
fortunately, filezilla have filters
Anyone have any recommendations for where to host a postgres database, ideally as cheaply as possible
I have seen the free tier on AWS RDS which looks tempting, but I'm gonna have to pay for it eventually and I want to minimise that cost
I want it to be managed with automatic backups
why are managed databases so expensive 👀
you know, that makes sense.
i'd imagine its more work, they handle scaling for you automatically, optimise your database based on your data and performance etc
gives them an excuse to charge more even if its automated
I wonder if heroku's postgres is any good.
https://elements.heroku.com/addons/heroku-postgresql
seems a bit cheaper
what are some projects you guys are currently working on?
This tbh
is there a reason you need managed?
I feel like managed doesnt make sense until very high usage.
if shit hits the fan they'll handle it for u
hmm
database-related, not data-related
yum
@solemn latch your site is broken on mobile
like, they're responsible for ensuring everything runs smooth for ur usage
since safari stinky 😄
sad
most
of mysites dont work with safari
FTFY
I have no access to safari, so I cant really fix it 😔
One message removed from a suspended account.
or well, refuse to
One message removed from a suspended account.
i don’t disagree with you but i wouldn’t use samsung cuz of their os
android <
👀 I found out yesterday you cannot lower the res of a video on ios
huh wym
my sister needed to send a video for work and cant because of its size.
took like 3 hours to do because ios 😔
ended up uploading it to one of my sites and downloading it then lowering the res 👀
apple support couldn’t help me with 2 of their own products
haven’t been able to pair my apple watch to my phone
for a year now
support said nothing they can do ab it
i've heard thats common, refusing to help fix things.
after making me screenshare 7736363 times
their “resolution” to everuthing is
“update your phone”
😐
its really sad, they make some awesome stuff.
🤔 would a cluster make more sense at a smaller scale.
😔
obviously much more setup work, but dramatically cheaper at a small scale and includes redundancy.
Well basically I just want a postgres databse where a) I don't lose data if something goes wrong and b) it's not my fault if I do lose data
have u heard of our lord savior Backup?
One message removed from a suspended account.
Well yes but I don't want to be responsible for it
I mean, no service will make u 100% not responsible if u lose data
after all, as long as you have access to queries you could always do DROP DATABASE db;
yeah fr
just setup a cronjob on root user to make periodic backups to the cloud
I would not be surprised if thats how even topgg does backups
I do that, pretty easy to setup and reliable enough
just dont store the backup on the same server
literally can’t make this shit up bro 🤦♂️
forgor the device
joke of a company bro
support can’t even help with their own products
oh also a couple weeks ago
all my reminders got cleared from my phone
for no reason
100+ birthday reminders gone
that's just d.js team with additional steps
Personally I always recommend COBOL to new developers
Got to make sure their skills are not relevant so they cant take our jobs 
every bank in existence: "We will watch their career with great interest"
The one industry I am not going back into is banking/finance
It is fun until you realise all the compliance requirements, outdated tech stack and the lack of freedom
go back to filling up excel sheets
Not saying every company is like that, but my sample set of 7 banks, just no
To be fair that’s a lot of responses in here because there’s a lot of “new coders” in here that choose to start with a discord bot
Which generally isn’t the way to do things
the problem is not exactly starting with a bot, its fine to start with a bot, but like, at least put some effort into learning along the way instead of blindly typing random stuff until it works by sheer luck
Yeah
I guess this is another instance of “correlation != causation” with what I said, but still
Generally speaking people want their bots to be complex from the very beginning but lack the knowledge to do so, and end up getting spoonfed instead of learning on their own
what did u input?
like, the message
well, why not isn't a valid duration
for that lib, u probably need to capture the duration string
Enjoy doing that btw
you could also use my method, but idk up to you
Either use a regex or prefix it with a flag like -
ur not inputting 5m
ur inputting why not 5m
no
because 5m why not also isn't 5m
you need to isolate the duration arguments
well, process each word separately
and add to a final sum
const words = args[0].split(" ")
for (const word of words)
as you'd imagine
do you even understand what this regex does?
what does it do?
hm, that's right
but anyway, I already told u what u need to do here
if it errors, go to next word
OR use the method I said before (?:(?<day>\d+)d)? (for days only)
you'd add one named group for each desired unit
then loop over each group multiplying the captured value by its millis amount
this doesn't need input formatting at all, it captures anywhere in a string
no
simply .join("") instead of toString()
.map(...).join("")
better yet, remove the trailling \n and use .join("\n")
actually joining by 2 newlines would be better because the last entry would have a newline
true
I'm attempting to use nginx and ExpressJS together, but for some reason nginx doesn't forward to my domain (eltik.net). For express, I'm listening on port 3000:
let port = 3000;
app.listen(port, () => {
console.log('Listening to port ' + port);
})
And for nginx, I'm using the default config but modified (based on some tutorials I looked up).
https://sourceb.in/KRApiE3OBd
I'm using Namecheap for my domain service and am not quite sure whether I set it up correctly, but I've attached the DNS record thing that I set up.
http://localhost:3000 works perfectly fine, it's just the domain that I'm having issue with. What's difficult is that for ExpressJS, I can connect to localhost fine without nginx, some I'm not sure whether it's a domain or nginx issue.
does http://localhost:80 also work?
if 3000 works but 80 doesnt, the problem is nginx
if both work, the problem is the domain
if both work, try you domain with and without www.
Oh I see. Thanks! That’s super helpful. I’ll need to change :80 to :3000.
let DM = await message.author.send({ embeds: [q2] })
const filter = m => m.author.id === message.author.id
let sure = await DM.channel.awaitMessages({
filter,
max: 1,
time: 120000
})
How come the awaitMessages isn't working here?
this is what it's supposed to do:
if (!sure.size) {
return message.author.send({ embeds: [timeout] });
}
if (sure.first().content.toLowerCase() == "cancel") {
return message.author.send("Prompt cancelled!")
}
if (sure.first().content.toLowerCase() == "no") {
return message.author.send("Prompt has been cancelled since you responded with no.")
}
if (sure.first().content.toLowerCase() !== "yes" && sure.first().content.toLowerCase() !== "no") {
return message.author.send("Did not recieve a yes or no response. Prompt has been cancelled.")
}```
do you have the direct messages intent?
oh.. completely forgot about that. thanks!
anyone know how to wait for a forEach loop? i tried everything (javascript)
Depends on how you want to wait.
If it's async/await, consider using a for of loop instead.
you could also use map to convert each item to a Promise and then do ```js
const allTheThings = await Promise.all(array.map(someAsyncFunc))
hello, i am using discord.js and have the problem that my customId field is too long. DiscordAPIError: Invalid Form Body data.components[0].components[3].custom_id: Must be 100 or fewer in length.
I have a lot of information to pass here, f.e.:
Execute function
r[0].setCustomId(`commandsSlash/config-channel.js ${i.member.id} ${id} ${type} noXp`);
r[1].setCustomId(`commandsSlash/config-channel.js ${i.member.id} ${id} ${type} noCommand`);
Component function
const [, memberId, channelId, channelType, type] = i.customId.split(' ');
Do you have any ideas how i could solve this issue?
find a way to reduce the data you need to have there, and optimize it to be more efficient
please, ```js
switch (sure.first().content.toLowerCase()) {
case "yes": break
case "no": return message.author.send("Prompt has been cancelled since you responded with no.")
case "cancel": return message.author.send("Prompt cancelled!")
default: return message.author.send("Did not recieve a yes or no response. Prompt has been cancelled.")
}
im pretty sure you're trying to put data there that doesnt really need to be there
like evaluating the channel type in the component function? not passing it down
for example, you can use numbers for types, onstead of strings
you can use numbers to represent other things as well
and just have a map to translate them back
oh i see, that sounds good
or better yet:
let str
switch (sure.first().content.toLowerCase()) {
case "yes": break
case "no": str = "Prompt has been cancelled since you responded with no."; break
case "cancel": str = "Prompt cancelled!"; break
default: str = "Did not recieve a yes or no response. Prompt has been cancelled."
}
if (str) return message.author.send(str)
interesting enough, this can become even smaller on java
thank you very much, that should solve it for now. but that doesnt work for discord snowflakes?
or could i make temporary mappings between interaction id and the customObject?
you can convert slowflakes to binary strings for example
via bigint
even hex is more efficient
ah okey!
would it be bad implementation to completely put the mapping in a new module scoped variable, mapping the interactionId to my custom object? then i would not even need the customId field at all?
you can try doing that as well yes
ok thanks very much
Anyone got a way to better protect your token? My bot got a nuker on it somehow and nuked a server, 100% certain no one could've gotten the token in any way, just bad luck? any way to protect against it?
Do you know how your token got exposed?
¯_(ツ)_/¯
Never have sent it to anyone, never screenshared anything, no screenshots of code, hosted on a vm on my own private server,
I am clueless as to how
These lads claim they did it apparentlu
did you download/run any suspicious software? like some dude asking you to test a game they made, or something claiming to give you free nitro
I was thinking what data i can leave out completely (aside from making it more compact/efficient)... the channelType i do not need, as i can also determine it within the component function.
but how about the memberId of the member thats triggering the interaction? Is the check for "it being the same member" triggering the interaction in the first place and sending the answer in the component function necessary? My mate tells me another user can otherwise answer the interaction.
await emschannel.permissionsOverwrites.edit('868664428831309855', { VIEW_CHANNEL: true, SEND_MESSAGES: true });```
this doesn't work, getting error one sec
im giving a role id btw ^
not sure why it isnt working
nvm im just being dumb
@quartz kindle really just bought a .org domain for the bait website for £6 💀
bet the scammers will feel good about themselves
i made a similar website before
scammers are more tight about their money than millionaires are
but it was just a time waster
i said "i have money on here" and told them to sign up to the website
but the sign up website had a queue of people that lasted 12 hours lmao
and at the end it just errors
lmao
i told a scammer once i couldnt send bitcoins to him because of "my company's security system" that only allows me to send to wallets from which i have received something at least once
he accused me of trying to scam him
lmao
i made him do it twice lmao
no but i should
i did ask to send bank account though
i contacted the bank to report them they didnt care
Just want to point this out that this is wildly more popular than anything I have ever made https://github.com/Noxiuam/Bitches
+ 18 just safeguarding
lmfao

why is femboy not used
too hot
xD
is it possible to add stickers with Discord.js
guild.stickers.create?
that exists?
in v13 yes
i checked docs before, i think i'm stupid
wtf
I never saw it
Tim is chad
So not fatherless nor degenerate
hey uh, my bot got declined for having multiple instances. however, when i tested it out, it only sent one message so i am confused
Trying to make a simple library for the discord api in C#, how do I connect to the gateway? I keep getting a 401 Unauthorized whenever I request https://discord.com/api/v9/gateway/bot even when providing Authorization: Bearer myTokenHere as a header
Nevermind, turns out I needed to do Bot myToken
f
Duh
stupid
smh
and you call yourself a pro programmer
never called myself that but yeah definitely
or an Application secret
or an Uvuvwevwevwe Onyetenyevwe Ugwemubwem Ossas
agreed
Refactoring >/< Rebuild?
It's not a too big application and it does work but the code is damn ugly and for others (imo) unmaintainable. I could refactor the whole code and make it better or just rebuild the whole because there are also some things I would have to rebuild anyways because it's done bad and since I found new technolgies etc. I need to make it better/easier.
keep a variable of when it was started and use that ¯_(ツ)_/¯
I have a GitHub repo with some commits and pushes. How can I now get my repo back to a specific commit on github.com itself???
rewinding history is either very difficult or impossible without just remaking the repo
ye
hm oof…
what‘s the prupose of them then?
You can rebase the whole GitHub commit history to remove all the commits after a specific commit, or select the ones beyond the one wanted and move them to a separate branch
But be careful as rebasing rewrites the history, so you would lose all the commits you've made if you don't know how to work with rebases
I'm trying to forward my express server to my domain (eltik.net) using nginx, but for some reason I just get a 522 error from CloudFlare.
nginx config: https://sourceb.in/dtRoDZw1AR
Express:
let port = 3000;
app.listen(port, () => {
console.log('Listening to port ' + port);
})
Extra info:
- Going to
localhost:3000works fine. - Going to
localhost:80works fine. - I bought the domain originally with Namecheap and switched over to CloudFlare.
use 80 port
run in local host
then check its running or not
local host mean in vps local host by screen
once if it running add cname with www and your ip on cloudflare
Do I need the manage webhooks permission to fetch a webhook?
Probably an obvious answer yet im still not sure lol
You have fetch from node-fetch
yeah you want i am also doing same thing
?
If you have the webhook's URL with it's corresponding token you don't need the Manage Webhooks permission to fetch it nor it's data, but if you don't have the URL then you need the permission
Well I just use the fetchWebhook function on a message of a webhook
so idk if that requires the perm or not
but probably since I don't have the token
Then yeah
i mean to say yes
Please dont slap your vhost configs into nginx.conf, that's the first thing I would recommend to you (There are folders called sites-available and sites-enabled for that)
Is port 80 even accessible with your VPS'ses public IP? (https://www.yougetsignal.com/tools/open-ports/)
const jsonData = require("../hints.json");
let uniqueRandoms = Object.values(jsonData)
let numRandoms = 5;
async function hint(guildData){
// refill the array if needed
if (!uniqueRandoms.length) {
for (var i = 0; i < numRandoms; i++) {
uniqueRandoms.push(i);
}
}
var index = Math.floor(Math.random() * uniqueRandoms.length);
var val = uniqueRandoms[index];
let prefix = guildData.prefix
// now remove that value from the array
uniqueRandoms.splice(index, 1);
return val;
}
How can i change prefix value from json object
Goodness, which one of these is an array since there aren't any.
so for some reason the test webhook button causes spam in my console, postman doesnt do this
are u replying with 200?
yes
[HttpPost("/topggwebhook")]
[Authorize(Policy = Policies.TOPGG_AUTH)]
public async Task<IActionResult> TopggWebhook([FromBody] TopggVoteWebhookModel data)
{
_logger.LogInformation("User {UserId} has voted for Bot {BotId} on {Platform}",
data.User,
data.Bot,
"top.gg");
await _votesCache.AddNewTopggVote(data.User);
await Events.InvokeTopGg(data);
await SendWebhook(ulong.Parse(data.User), "Top.GG");
return Ok();
}
its possible the webhook part is hanging it somehow
lemme try wrapping it in a task run
what lang is that?
c#
yeah but its not format strict
at all
object.
Property;
Is valid c#
just complains its not assigned lol
TopGg 
thats proper method naming
ocd 
file = message.attachments
await message.channel.send(content = 'something', files=file)
'Attachment' object has no attribute 'fp'
anyone know this error
?
show the entire context
Ah I see. No 80 isn’t accessible to the VPS’s IP.
Thank you for the suggestion. I’ll look into sites-available and sites-enabled 👍 How can I make the port public? Would I have to port forward? Sorry I’m not very familiar with web hosting
EDIT: Fixed I just opened the port publicly haha
This snippet doesn't make sense in regards to the error
whats good folks?
wtf github copilot
probably scanned yanderedev's private repos
lmao

you know what sucks ~ when you go to make something 'better' and spend 3 days with everything broke af 😐
insult to injury if you did it on the main/master branch

i guess that depends if you count the master as my github backup, or my actual project 😄
wait
why is the general voice chat 'playing a game'
how can voice channels use rpc?
wtaf?
or is that only cause of the user in the channel?
yea thats messed up, really looks like the channel has the activity
yeah
"General is playing a game"
i wonder, if i join, does my rpc overpower their rpc...
o i think it shows both
General is now playing 2 games
ew
pokmon
whats this error pls help me i have to present the code some where and here i get the error in a part of code which i havn't even edited
heres the code
Nvm solved it 😌
Just need to put
monkey.patch_all()
After
from gevent import monkey
User activity by custom rpc file but it displays in vc's
interaction.connect(interaction.member.voice.channel) = channel.join() ???
I'm trying to use express-subdomain to get anify.eltik.net and eltik.net. However, when visiting anify.eltik.net, I receive the error "Cannot get /".
const app = express();
app.anify = express.Router();
app.use(subdomain('anify', app.anify));
// For eltik.net
app.all('/', function(req, res) {
res.write("a");
res.end();
});
// For anify.eltik.net
app.anify.get('/', function(req, res){
res.redirect('/home');
// Redirect anify.eltik.net/home for testing
});
honestly i wouldnt even bother using a module for this you can remake the module in 10 seconds
well not 10 seconds but you get the point lmao
might be a nginx thing
app.use((req, res, next) => {
if (!req.subdomains.length || req.subdomains[0] !== 'anify') return res.status(404);
else next();
});```
something like that i forgot how the middleware api works
Can you write to me who can help me apply for Message Content Intent and Presence Intent?
i will root as much as i want
what do you need help with
stupid hardcore bull headed linux users
I am just too lazy not to use root lmao
I know I shouldn't do it
but I just do
:)
i use root too lol
icba creating a separate account
just use ssh keys instead of password and it should be virtually unhackable anyway
nicre
i installed the bleeding edge version of node just to use experimental fetch
i do not wish to use node-fetch anymore
i do not wish to be horny anymore
sure
btw you can always install undici on any node version
you dont need bleeding edge
I mean node 18 is LTS. So should be fine
Yet to try it out tho. Hyped for their new built in test runner
Not gonna lie, I've been suffering with the complexity of ASP.NET for the past few days so much that I just tried next.js and this is so fucking easy it's heavenly
damn didnt know v18 is already out, just read the changelog
they went straight into v8 10.1 which is not even released yet
i mean, technically they already have branches up to 10.3 but their latest blog post was about 9.9
yeah i know but its too exciting to wait for
besides on my phone it works fine so it has to be some local issue
so my isps dns propagation is fine
linux
idk then
on windows you could do ipconfig /flushdns
there should be something similar on linux
going to setup https in the meantime
i'll try a few things
Make sure to configure the TTLs right as well as the zone properties
btw just to confirm this works for you guys? https://transfers.remmacs.org
yeah subdomain works for me just not main domain
Brb
subdomain is the one i'll be using anyways so i can wait for the cache to propagate on the main one
Great new updates
Not only I have to scroll down to development each time
Also I can’t hide the commands and music channels anymore
And the read only channel start board has been moved to hangout
🤦♂️
Yeah this new structure sucks balls
Literally have to collapse and mute a ton of channels to have a half decent experience
Yeah
hostile plump takeover
Like, the old structure already sucked, but I could at least leave general open. Now I can't even without it becoming too long
True
Would have been easier to attach a getting started channel at the top without category
To “improve” the usability for new users
Instead of fucking it up for 200k others
I don’t like the present and future
Boosters is under gen2 now
Scratching API v3 off the list and adding time machine to it
Which sucks
Locally modified channel positions please

YES! Thank you
I may would consider to think about to buy nitro then
just joking
Now it takes like 3-4s to scroll down the channel list and find this and the api channel somewhere
Fuck it, no free support anymore

Would deter a lot of people who don't know what they're talking about
for some reason my python script wont work can someone help?
CODE
pritn("hello world")
pain
tired
Sad
good
if you go there that frequently, use the favorites feature/experiment
you can put anything in any position
channels, categories, users
Don’t even know how to do that tbh
Can’t find anything regarding favorites in any context menu
But feel free to tell me 
what is the error?

it's an experiment
I better be quiet with the whole staff channels etc
if (
cooldown(client, message.member.id, command) &&
!client.ownerids.includes(message.member.id)
) {
let timeLeft = cooldown(client, message.member.id, command);
return message.channel.send({
embeds: [
new MessageEmbed()
.setColor(client.settings.bot.embed_color)
.setDescription(
`${emojis.cross} Please wait for ${timeLeft} before reusing the \`${command.name}\` command!`
),
],
});
}
I want to send this message only one time
how can i
set a value saying that the client sent the message recently and then set a timeout for a desired amount of time for when the value resets. If the client sent a message recently, return or wait for the value to be set back before proceeding
pls tell me you are joking
Speedy not so speedy
lol
wait is that the toneh who signed up for my website even tho its very far from done 
How can I make a button work only for the first interaction?
capyhost?
LMFAO fr
@earnest phoenix I have a dillema.
In order to provide reloadable modules, modules have to export an object in order to abuse Object.assign so that the end user can just reference the old Object which could have all its old props deleted and then populated with new props and there's no problems there. My problem is "What about non objects?"
I thought about returning the user an Object I can assign new props to later, but the problem is they didn't export an Object, so it won't be like how they may want it.
In my example, I will say that a user has set module.exports as a boolean. Can I use a Proxy to "fake" the boolean and still internally use an Object or is there a better approach to this?
Well yes you can indeed use a proxy to mimic the value passed and use something else entirely internally, another approach would be to deep copy the value passed in a way that all the properties and methods are also present in the new ones including non-enumerable properties and methods and also symbols, the best approach here would be using proxies
So, say you proxy all calls to the internal object member that holds the original reference, you can do this?
typeof proxiedBoolean === "boolean"
Absolutely
Holy shit
Proxies are ✨ magic ✨
okay. Now, regarding this
deep copy the value passed in a way that all the properties and methods are also present in the new ones including non-enumerable properties and methods and also symbols
How would I do this
You can check the type of the value and return the value or a new value based on the type, for example booleans and numbers have no reference to each other whatsoever, so if you return the same value, it should be fine as they're marked as non-referencable, if you encounter an array or an object, you can use something like Reflect.ownKeys() to extract all properties and assign them to a new object, the same thing for arrays but iterating through all the elements to accurately deep copy them
But this can be inefficient, so I'd recommend using proxies, unless you want to test out both of them
I'll probably have a generic handler to store the old reference in an object and return a Proxy to the user which references the member
Thanks a ton. I've been racking my brain over this for years
You're welcome, always here to help
@earnest phoenix One more thing. I don't expect you to know as you may not be SUPER deep into typescript, but I'm trying to also provide typings to the user for a module they require through my module. NodeJS.Require() is kinda weird as the typings in @types/node don't seem to do any magic, but when applying the type signature of NodeJS.Require() to my module's require method, nothing really pops up. I tried dynamic import types, but import does not like that and expects a string literal.
I don't think I exactly understood what you're trying to do, are you trying to export typings through modules and let the user import them using the global require() function?
no. For example:
const mod = myModule.require("./path/to/mod") // Would just return any
Hmm, the way you do it returns the type as any when requiring that module? If so, and if that's what you meant then either the path resolver in your IDE wasn't able to resolve that to return the type correctly, or if that actually occurs when passing it into TypeScript, then I'm unsure why that could be happening, it's either because the typings given by @types/node declared by DefinitelyTyped causes it to think that the exported moduls always return an any type in this case, or it's clashing with the value's type
In my experience, I've never seen that occur, it has always returned the type correctly
meant to put typeof import(T), but that doesn't fix anything
the return value is dynamic, but I suppose TypeScript just does not like dynamic imports
What in the seven gates of hell, yeah that's a TypeScript issue, I don't think there's a way to fix that
Always, anytime
anyone know how regex works? cuz I made a bot that saves yt videos but i name the file the name of the video
however i need a way of removing all non alphanumeric chars
string.replace(/[^a-zA-Z]/g, "")
this would probably work for you
str.replace(/[^a-z0-9]/gi, '')
You also need A-Z
ah cool
“i” makes it case insensitive
what does the g mean?
I'd rather not use flags not necessary
global
matches the entire string
without it, it would just match 1 char
yes exactly
nice
Hi, I had a doubt that if I will reduce the permissions my bot requires right now, it will affect my future plans so is it actually necessary to reduce the permissions?
well, you are supposed to request only permissions that are necessary now
let guild = await client.guilds.cache.get("827300553045573682")
guild.set(arrayOfSlashCommands);
Am sending this because i want to use slash only for one guild
i think its guild.commands.set
ye, guild.set wouldn't make much sense
Got it
this guild will now only be slash commands
Use await when you need some async function call to finish before going to other code, or if you need the return value of a promise
can some one point me in the right direction of how to get a bot to download a file send to a chat?
like those image bots that have the edit image commands
get the url from the message and download it with any http lib
message.attachments
.filter() should do .filter(a => a) by default
what would be the point of that
you're just making a shallow clone of the array
there are numerous other and more obvious ways to do it
i want to remove falsey values
but i guess they could only remove undefined. that might be better
.filter(a => typeof a !=="undefined")
.filter(Boolean)
well unfortunatelly its not gonna happen
xD
well you can make it yourself
just override the prototype
or create an extended array
i'm showing up at the next ecma conference
overriding the prototype is fine by me in this case. A little less readable but still ok
https://i.imgur.com/xXNpz4Q.png
https://i.imgur.com/54FkCRM.png
Does anyone know if discord removed the nitro perms or something from bots? For some reason my bot only shows it on the server where the emojis are
Are you using the emoji ID variant?
If you don't provide the emoji ID Discord does not know where to look for the emoji, as multiple servers your bot is in may have the same emoji name
So it defaults to the emoji name in the server the command ran
Yup, also everything worked before. Just an hour ago it stopped working
And does the bot have permission to use emojis from other servers?
Yeah, it has Admin perms
is the bot in the server where those emojis come from?
Humm, weird
embed1.add_field(name="Special acknowledgements", value=f"{admine} - LateNight Administrator")
Maybe somehow in here is the problem, "{admine}" is a defined emoji
admine = ":LateNightAdministration:"
why does admine not have the emoji id?
idk then, if it worked an hour ago but now it doesnt, and you didnt change anything, then it might be a discord problem, possibly with caching
try using different devices to view the message and see if they show the emoji
pc, mobile, browser
I just tested it out with another command, and it worked for some reason
¯_(ツ)_/¯
are you testing in the same channel?
yup
Well, on the server where the emojis are, it obviously works, I tried that test command on another server, and it worked, but the userinfo still doesn't show the emojis/it still only shows the name
https://i.imgur.com/HhTXnPx.png
https://i.imgur.com/HqxNtwR.png
Tried it with the same method that I used in the test command, doesn't work
so it works if its not in an embed?
That could be, lemme see
Hm, let me try a test command in the same cog
It looks like the cog isn't the problem
Ok, so
@commands.command()
async def test2(self, ctx):
e = discord.Embed(description=":LateNightBugHunter:")
await ctx.reply(":LateNightBugHunter:", embed=e)
This works for some reason
Okay, wait, for some reason, it does work in some channels, and in some it doesn't
Random but
Nodejs v18 is now out
incase u missed it
was released yesterday lol
Also as far as im aware this version should allow you to use native fetch without the experimental flag
Might still stay experimental for now though
My bots invite isn't working and idk why
Your permission integer isn't a valid number.
Ok then
What do I do to fix it?
make it valid
Don’t provide nonexistent permissions
Like which ones?
I think there's infinite possibilities of invalid permissions.
I find using this site easiest to make urls.
A small calculator that generates Discord OAuth invite links
I mean there's one already existing in the developer portal
^
Anyone with experience in github pages... is there a way to make other folders public? For example I've set the pages source to the folder ./docs, but I want to be able to make other files public which are outside that folder, I'm guessing this is not possible? :/
Never made that work before. Everything is just in a root folder on my end
What you could or probably should do is host the files externally and link back to them
alternatively, move them to the root
o yeah I could do that
A little less clean but that'd do it
Do you test your workflows on github or is there some software which tests them?
I run my gh pages through travis ci
oh okay
You can remove the optional chaining
Oh I see
I mean you could remove the first condition too
but you'd be checking if message.channel is null twice essentially instead of doing it once
it's up to you
either remove the optional chaining or the first condition (!message.channel)
I see
I'd remove the optional chaining
whichever you find more readable
If it's an automated discord message then yes I think
ok
Not specifically related to development, but this is my first time putting together a real webpage with react + nextjs, and my goal is a nice minimal design (I need to choose an accent color though). Any thoughts or suggestions?
(ignore the shit at the bottom and the activate windows)
activate windows
hello
const { Client, Intents, Message, MessageEmbed, MessageActionRow, MessageButton, Collection } = require('discord.js');
const config = require("../settings.json")
const Data = require("../models/taglıal")
exports.execute = async (client, message, args) => {
if (!message.member.roles.cache.has(config.registery) && !message.member.permissions.has("ADMINISTRATOR")) return message.channel.send("Yetkiniz Yeterli Değil")
let Db = await Data.findOne({ GuildId: message.guild.id })
let tag = new RegExp(config.tag)
let x = Db && Db.tagalanlar ? Db.tagalanlar : []
if (tag.test(member.user.id)) {
if (Db && Db.tagalanlar.includes(member.user.id)) {
message.reply("Bu Kişi Zaten Biri Tarafidan Tag Almış").then(msg => {setTimeout(() => msg.delete(), 5000);});
} else {
await Data.findOneAndUpdate({ GuildId: message.guild.id, Member: message.member.id }, {
$push: {
tagalanlar:
member.user.id,
},
$inc: { TotalTag: 1 }
}, {
upsert: true
})
message.reply(`${member} Başariyla Tag Aldi`).then(msg => {setTimeout(() => msg.delete(), 5000);});
}
} else {
message.reply("Kullancıda Tag Yok").then(msg => {setTimeout(() => msg.delete(), 5000);});
}
}
exports.conf = {
command: "tagaldır",
description: "",
aliases: []
}
```how do I adapt this command to v13
define member :troll:
that's not even valid v12 code
how
you never defined member
Also: adding on https://gyazo.com/e113ba841d8c4f8300900f5ab725f9bf
oo
react + mantine + tabler icons + typescript = 🤤
react epico
Have you tried looking at the docs?
yes, but I don't understand
embed.setAuthor({name: 'something', url: 'url here', iconURL: 'iconURL here'})
something like that
Why would you still use that stupid builder method when passing the options as object anyways and not as parameters anymore?
embed.author = { … };
no assignment operator needed
Oof
That justifies to write even more chars?

And to use a method which might be deprecated in the future, too or not or yes
Who knows what djs fucks up at next
Idk I think it’s just weird to me given that I mostly am used to Java where modifying a property directly is usually a mistake
So the getters/setters look more natural for me
That’s just my preference
java users when they realise object.getThing().getThingTwo().getThingThree().getThingFour().setThing() is just not practical in other languages
But.. but.. but it looks more natural!!1!
Ok enough trolling for today
Back to my shitty website
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I like builders bcuz u can put them inside a loop or have conditions on them
Also useful to have modular objects
continuing this
I wonder if java has any optimisations in place for this
I suppose it does since its basically how everyone accesses nested objects
I mean you can probably add new variables for stuff you access multiple times
Though otherwise no
hey, how can I show on the topgg webpage my bots server count?
calling a function has overhead, especially in an object language like java which adds an additional overhead
in languages like c/c++/rust etc it doesnt really matter since the overhead is basically just an extra element on the stack which is likely to not even be on the stack in the first place because of cpu cache
ah i missed being in an environment with an actual operating system screaming at me when i access a page that does not belong to me
actual segmentation
people complain about it but its great because you actually know when youre accessing something youre not supposed to access instead of the program silently running
@quartz kindle i think arrays on the stack have their limitations
- low level prorgamming language *
tried passing the dynamically allocated stack to another function and got a segmentation fault
no warnings or errors whatsoever at compile time
-servercount
@storm belfry
To have your bot's server count displayed on Top.gg, please read the documentation on server/shard posting.
ty
$('#myModal').modal('show');```
how do i do this with vanilla js
document.getElementById('staticBackdrop').modal("show")
tried this but doesn't seem to work
is #myModal hidden
yeah i think so
to showjs document.getElementById("myModal").style.display = "block"
to hide js document.getElementById("myModal").style.display = "none"
so basically what i am trying to do is this
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
Launch static backdrop modal
</button>
the current modal shows with a button
i just wanna change this and make it so when the page loads up it will show the modal
its bootstrap btw
staticBackdrop is not an id
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Understood</button>
</div>
</div>
</div>
</div>
you want to make like a generic button loader that uses the data-bs attributes right?
no i wanna get rid of that button
and just load it all up with this function
<script>document.addEventListener("DOMContentLoaded", function() {
document.getElementById('modal').modal("show")
});
</script>
basically trying to get rid of this
what is the original css at page load for .modal?
juat open it on dev tools...
what do u exactly mean
ohhh
1 sec
the only reason i am not using jquerry is cuz i am not a big fan of it



