#development
1 messages · Page 253 of 1
this should answer your question:
https://wiki.shapes.inc/shape-essentials/advanced-customization/ai-engine/ai-engine-models
Thx.
how’s emoji bingo looking?
Ok so i have another question.
Is it normal for 4 BOTS to be in the same channel and not all of them chat in one go?
Bc some do chat and some don't at other times.
Bc IDK if that's normal or not.
Hello?
Is anyone there?
.....
Hello?
someone will answer, i don’t have enough knowledge of what you’re doing to have any input sorry
It's alright.
I'll just be here.
Waiting.
I wonder when someone is going to be here. 🤔
Oh hey your here.
lmao you think people are watching this channel 24/7? sometimes there is no one here for hours
and no, it is not normal for normal bots, but shapes is not really "normal" so idk, i've never used their system
ye looking good
i still think there are too many layers on them lel
i would fix the vertial centering and remove the white layer on the emojis
Hi, look like it dont send anything to the log did i do anything wrong about it?
const axios = require('axios');
const channelID = '1280677846372716674'; // Channel ID for join events
module.exports = (client) => {
client.on("guildMemberAdd", async (member) => {
const guildName = 'Bazaar'; // Hardcoded guild name
try {
// Fetch guild data from Hypixel API
const response = await axios.get('https://api.hypixel.net/guild', {
params: {
key: process.env.HYPIXEL_API_KEY,
name: guildName,
},
});
const guildData = response.data;
if (!guildData.success || !guildData.guild) {
console.error('❌ Guild "Bazaar" not found or an error occurred. Please check the guild name.');
return;
}
const onlineMembers = guildData.guild.members.filter(member => member.online).length;
// Construct message content
const content = `🟢 **${member.user.tag}** has joined the server! \nCurrently, there are ${onlineMembers} members online in the "Bazaar" guild on Hypixel.`;
// Send message to the channel
const channel = client.channels.cache.get(channelID);
if (channel) {
channel.send({
content: content,
username: 'Guild Bot',
avatarURL: 'https://pbs.twimg.com/profile_images/1346968969849171970/DdNypQdN_400x400.png', // Hypixel logo for the avatar
});
console.log(`Member joined: ${member.user.tag}. Message sent to channel ${channelID}.`);
} else {
console.error(`❌ Channel with ID ${channelID} not found.`);
}
} catch (error) {
console.error('Error fetching guild data or sending message:', error);
}
});
};
Does it not work?
yes
I think that's a privileged intent, so you need to add it in the discord dashboard
it fetch user that join the guild
for hypixel
I don't see it being used anywhere in your code
um
anything logged in your console?
no *but the problem with this is they like to get late limited
is there a way to bypass the key throttle
if you're getting limited by hypixel then no
unless you have multiple keys and you swap between them, but that is likely against their tos and can get you ip banned
usally the 429 it last for how long?
you need to use caching for data that is unlikely to change
you'd have to ask them
or check response headers
'retry-after': '35',
make another request and see how the number changes
to see if its seconds, or minutes
why are you fetching always the same guild tho?
i want it show my guild
but is the data going to change?
because if its always the same data, just fetch once and store in a variable
yes it will if there was a new member join
a new member join where? on discord or on hypixel?
hypixel
i set the interval make it find every 5 min
Expires: 9/5/2024, 7:50:43 AM```
yeah so you dont need to check on every discord join
better make it a regular interval
ok
you mean in the status right?
best option is to throttle is yourself
for example, on member join, check last time it was fetched, if over X time ago, fetch again, if not, get the previously fetched data
ok
on a linux based system?
nvm :3 hosts file drivers/etc hehe
are there any freelance nextjs pentesters in here? my web app is due to launch in a few weeks but want to ensure there are no vulnerabilities prior to launch (and fiverr has dreadful results)
how big of a web app is it
Im trying to setup a monorepo with turborepo it contains 2 apps one discord bot and another one is a express server and im using mongodb
I wanted to share the mongo schemas in my whole project hence i tried adding aliases with tsconfig with path and it wont work. There is no inline error shown on vscode but when i run it it says @model/user not found @model/* is in my tsconfig and it is referencing to the correct path too
Lemme know what im doing wrong and if i can do something better
Thank you in advance ☺️
Not use mongo
tailwind mfs when they get this unreadable code
pretty sure you can
you can add lolcathost 127.0.0.1 in your hosts file
oh nvm, you already answered it
:^)
hehehsgh
webdevs will do anything to avoid css, even if it means writing css in classname
Avoid naming things
sx prop is just so convenient imo
indeed, i dont get why people like these css frameworks so much
so it's just me that liked css
pensive
I dont dislike it either
on that case, i'll just make a class to write on css 💀
web devs realising they might as well have wrote the css themselves after adding 20 tailwind/bootstrap classes to one element to do something
hahaha i can relate
i added so many boostrap shit and then realized i had to manually write and override the bootstrap classes i was using for a large part
this is so true 😂 granular control too
tailwind is better than using css

Looks inside tailwind
Css

Is this bad or very bad
very bad
Got suggestions?
which location?
US but could also be EU
Datalix offers a range of hosting solutions from shared hosting to dedicated servers.
for us i dont really know anyone thats cheap except contabo
Thanks
What’s the best to show graphs on discord
Would it be canva
Or is there any lib
Its gonna be usage graphs with numbers daily
Contabos network is very poor performance for latency sensitive apps though like Discord bots
Also wow fk me $10 for 2 GB of ram
most hosts will charge you $5 for that and i use https://cloudfanatic.net/pricing/
View details & pricing for the most popular affordable VPS plans, starting at just $2.99/month with Pure SSD storage and Unmetered bandwidth.
novonode
can we kill the people who decided to put fn left of control on thinkpads
buy your own orange pi for $100 USD 8 core arm chip and 16GB of ram
Wont be breaking any cpu benchmark world records, but your applications shouldn't be CPU intensive anyways
how to add this checkmark thing?
It's css
You can just copy their css from the page or make your own
:o oki ty
HeY ThaT'S sTeALinG!!!! 
and when I am done, do I just put it in description?
You can use any html tag in the description (including the <style> tag but except <script> iirc)
:o ty
except <html> and <body> too
those will make topgg ignore whatever is inside
:o oki ty
vw/vh is safer
that's for the backup yeah
no, I mean, "d" units dont respect the actual window size
so you lose resposiveness if u dont use full screen browser
first vid is with dvh, second is with vh
does anyone have suggestions for tunneling services? I'm looking for something long lived. I want to tunnel my rpi which hosts a web UI for IoT. is cloud flare viable for something like this?
yeah you can use cloudflare tunnels for this
great, thanks
here’s my new emoji with 68 players but the board didn’t want to load 😭
Whenever people submit a modal, the client event sometimes gets fired more than once for the same interaction, is it a problem regarding Discord API?
you get any errors? that sounds like maybe how the listener is being handled
kuduga ai 
d stands for dynamic
it's most used for mobile
vh is 100vh but address bar included. thus overflow-y is shown
idk the wording but that image should explain 💀
huh
just look at here
see the chat input
Thank you for the clarification Now I will create a website 🥲✨
when you want to make a div with 100% height screen
that wont work in some scenario
huh really?
yes

in most cases svh is better, because dvh causes the screen to jank when you scroll on mobile
when the address bar is shown/hidden, the screen height is recalculated and the screen can shift in a janky way
check out this part of the video: https://youtu.be/veEqYQlfNx8?feature=shared&t=235
Conquering Responsive Layouts (free course): https://courses.kevinpowell.co/conquering-responsive-layouts
Join the Discord: https://kevinpowell.co/discord
Viewport units often feel like this cheat code that makes things so much easier when you first discover them, but they actually are problematic for a number of reasons, from creating horizon...
o, thanks for the resource!!
it has some cool stuff in there
nice
second signal?
Yes
what is that?
😐
Badge
ah the badge lol
discord gave those to the people who had verified bots in the first 6 months or so, when verification was released
they dont give those out anymore
nooo 😭😭
Yeeeeeees
Oh, I get it now.

gotta love it when a free api is more profitable than a paid one
after discord stopped giving them, people started buying and selling accounts that had it lmao
i've been offered like 1k+ usd in bitcoin, although it most likely was a scam
lmao
github or docker?
github is trying to pull a docker image
it says to increase your limits at docker.com lel
yeah it wants me to login with the main docker repo site
maybe nodejs has a mirror on ghcr
self host gitlab 
damn rate limited when pulling node
( I reran it rn and it worked fine )
true
:^)
smh only 1 week of logs root@HDE-02:/srv/containers/mcjars-backend# du -sh logs 66M logs
Yes, an error telling me that the interaction was handled already, as interactionCreate event gets fired twice for the same interaction
show code and error
This is the code, however I don't have the logs of the error
if(interaction.customId == "botmodal") {
const botId = interaction.fields.getTextInputValue('botid')
const prefix = interaction.fields.getTextInputValue('botprefix')
const inviteLink = interaction.fields.getTextInputValue('botinvitation')
const botLogChannel = client.channels.cache.find(channel => channel.id == BOT_LOG_CHANNEL)
if(!botLogChannel) return interaction.reply({ content:"I couldn't find the bot log channel, please valid until this issue is fixed.", ephemeral:true })
const currentBots = await botsTable.get("bots") || []
const pendingBots = await pendingBotsTable.get("bots") || []
const blacklist = await blacklistTable.get("blacklist") || []
const botIsAlreadyIn = interaction.guild.members.cache.find(member => member.user.id == botId)
const hasBot = currentBots.find(data => data.ownerId == interaction.user.id)
const hasPendingBot = pendingBots.find(data => data.ownerId == interaction.user.id)
const isBlacklisted = blacklist.find(data => data == interaction.user.id)
if(botIsAlreadyIn) return interaction.reply({ content:"This bot is already apart of our server.", ephemeral:true })
if(hasBot) return interaction.reply({ content:"You already have a bot in the bot list.", ephemeral:true })
if(hasPendingBot) return interaction.reply({ content:"You already have a bot pending.", ephemeral:true })
if(isBlacklisted) return interaction.reply({ content:"You're blacklisted from this server.", ephemeral:true})
let response
try {
response = await axios.get(`https://discord.com/api/v10/users/${botId}`, {
headers: {
Authorization: `Bot ${TOKEN}`
}
});
} catch(e) {
console.log(e)
return interaction.reply({ content:"Please enter a valid bot ID.", ephemeral:true })
}
const botData = response.data
console.log(botData)
if(!botData.bot) return interaction.reply({ content: "This ID does not belong to a bot.", ephemeral:true })
const embed = new EmbedBuilder()
.setTitle("Bot Submission")
.setDescription(`<@${interaction.user.id}> submitted the bot ${botData.username}#${botData.discriminator}.`)
.addFields(
{name:"User", value: `${botData.username}#${botData.discriminator}`, inline:true},
{name:"Prefix", value: `${prefix}`, inline:true},
{name:"Invite Link", value: `${inviteLink}`, inline:true},
)
.setFooter({ text: client.user.username, iconURL: client.user.displayAvatarURL({ dynamic:true, size:1024 })})
.setColor("#ffffff")
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic:true, size:1024 }))
/*
pendingData {
ownerId: userId,
messageId: messageId,
botId: botId,
}
*/
const message = await botLogChannel.send({ embeds:[embed], components:[botLogRow] })
const pendingData = {
ownerId: interaction.user.id,
messageId: message.id,
botId: botId,
}
await pendingBotsTable.push("bots",pendingData)
await interaction.reply({ content:"You've successfuly submitted your bot.", ephemeral:true })
}
}
await interaction.reply({ content:"You've successfuly submitted your bot.", ephemeral:true })
This is the line that throws the error
Okay, I just found that a BaseInteraction has the property method isRepliable(), which I can use to detect if the modal interaction was handled already
the fuck is this quality
lol
The source quality can be anything
why is
wikipedia begging for donations
but when you look at their financials 2022-2023
they are
quite
okay
living
15 million in assets
2023
you need a good impartial middleman for these sorts of transactions
either side can scam each other
they always do this
they apparently do it to make sure they have enough money for the future
wikimedia found. when they find out about the concept of "saving money"
i've donated to wikipedia like twice i think
i've donated to tim iike twice i think
<3
im playing around with the idea of setting up some sort of open source trickle down
One message removed from a suspended account.
like donations i get for XYZ open source project would have a part of it go to the maintainers of its dependencies, if any
I think that would turn into way too little at the end
yeah, its a complicated thing
richest brazilian
its ok, i still like you
:^)
One message removed from a suspended account.
makes absolutely no sense
they call it 5 dollars then they proceed to write it down as $5
dollar 5
... that includes me
so each of the 800 dependencies gets 0.0000625, and then 5% of that, 0.000003125, goes to all of their subdependencies
:^)
One message removed from a suspended account.
i think commercial companies should to that tho
reserve a percentage of their profit to distribute among any open source libs they use
(that will never happen)
unfortunately
difficult thing is open source was quite literally intended to allow for profit organisations to use the software for free
its not truly open source or free if you make exceptions
yeah it wouldnt be by force
but it would be cool of they do it out of their own will
i will do it myself if my shit ever works out
at least to key stuff i use like better-sqlite3 and sqlite itself
One message removed from a suspended account.
makes his own sqlite to reduce dependencies and increase profit margins
not even rust did that for some reason
they all use lib-sqlite or whatever its called
guess rust developers arent brave enough to make their own db from scratch
thats basically what recreating sqlite3 is
lets recreate a js engine in pure js
Me and a few dev friends once planned on writing a bot language with js as a backend which does a lot for you backed by low level api libs and also baked in hot reloading of files :)
(discord bot maker)
it would be much easier but performance would be poopoo
js sucks with handling raw binary which just happens to be a lot of the work databases do
your beautiful columns and rows get converted to disgusting looking binary all squeezed together in one file
depends, js can actually be quite good at it if done propely
i mean, of course not as performant as c/c++/rust
but i dont think it would be orders of magnitude slower
no structs is the biggest issue, compilers optimize structs into offsets from a memory location
correct, it would be orders of universes slower (jk)
you can store persistent arraybuffers of various sizes and read/write to them
I’d imagine you’d have the same level of difficulty as building it in a lower level systems lang. it’s the theory behind making databases efficient that’s hard, not the language you use
i mentioned its easier since you dont have to worry as much when it comes to writing the query interpreter and network stuff
in js that would be a whole lot easier
How?
dynamic data structures mainly
Js doesn’t magically understand SQL by itself :p
Personally I’d say that nothing about it would be easier
ive wrote both versions so i have first hand experience, but sure
you dont need to rely on dynamic data structures, you can make things faster with fixed structures like arrays and arraybuffers that never change sizes
not sql specifically but a query language nevertheless
I’d imagine it would be harder because of no compile time type safety
thats one of it yeah
its difficult to convey into a sentence but its mostly the fact you can be a lot more careless and abstract in something like js
but when it comes to the actual db driver some principles remain the same like the need for structures to remain consistent in files
js cant really help out here
the thing most people dont realize about js, is that its biggest performance hit is instantiating data structures
creating new arrays, new objects, and especially new buffers/arraybuffers
js is often regarded as a slow language because people use it the same way they would do it in a different language
like how in C you define structs and then create instances of them when you need them, if you do that in js its gonna be terribly slow
js works much better then you move data without creating new structues
especially when working with buffers
if only js had in/out params for functions
I hate creating objects for multiple values I want out
well it does if you wrap them in objects
for small objects its not a big deal, js quickly optimizes stuff like return {a,b,c}
but stuff like buffers and uint8arrays are slow to create
thats why you reuse the same 1gb buffer everywhere 🔥🔥
:^)
DataView for example is stupid slow to instantiate
i even asked voltrex about it and he didnt know how to answer lol
its literally faster to copy 10kb from one buffer to another, than create a new DataView on said buffer
i actually did this optimization in my etf lib lmao
oh lawd
if data is smaller than 12kb, copy it to the existing 12kb buffer that already has a DataView attached
lmao
Why 12KB?
i tested it, thats was more or less the breakpoint where the copy is still faster
at 13k+ copy starts getting slower than creating a new DataView
but this can change between engine versions and environment
i tested on both node and chrome/brave
I mean, node is all I care about
aws is so tricky sometimes
4.2 gb. it stores every diff so you can revert back or something
anything to justify your discord library which involves storing data in buffers
get to work on it
lmao
lmao nice
seems like a lag fest tho, especially for people with bad net/phone
oh absolutely
its a cool idea tho
this ended up being 93 players and it completely fucked up 😂😂😂
lmao
hmm, why do you delete the game from the games map when the lobby closes?
judging silently
i need to remove that, it was initially to make sure new players can’t join but then i ended up later just disabling the lobby buttons when the game starts
😭
how do i force a light theme or just change the font to black ?
DiscordAPIError[20012]: You are not authorized to perform this action on this application
what is the problem? i try at my vscode with beta bot account and its working.
same code
give more context
Heh yeah it tiers your storage based on how frequently you access it and how quickly you need to retrieve that data. We have clients who use S3 and even they don't truly understand the voodoo of it all!
cloud providers making their dashboards so complicated they have their own certifications and companies have to hire people specifically to manage them
Sadly true - I work for one of those companies!
@inner tusk
😔
nice way to define infinity lmao
i use CloudFormation and every time i deploy a change it packages all my lambdas and saves them in S3. Even if there is no change to the lambda it still makes a new copy.
To package an AWS SAM application, use the sam package command from the AWS SAM CLI.
the need for huge enuf to be squared for infinity means that its not huge enuf 😔
should be exponent operator instead
1e+300 ** 1e+300
ye
how is it implemented tho? a loop of multiplications? lmao
looks pretty complex https://git.musl-libc.org/cgit/musl/tree/src/math/pow.c
bro what the fuck
💀
anyone with a naïve mind would just go with the loop lmao
can't imagine how they implemented the sin, cos, and tan functions
doing it in loops is the naive way
theres a formula that lets you do it efficiently
im not quite sure myself but i believe its very difficult to get an accurate sin/cos/tan result
so cpu manufacturers have these operations built into the FPU that does it for you and is much more precise + hardware accelerated
C might fall back to approximation algorithms if that fails?
if you dont mind me asking what major do y'all have? I was reviewing some chats earlier and i seen a bug debate on java in a way i did not expect lmfao
💀
any recommendations on books?
fun fact, doing it in loops in js is faster than using the ** operator or Math.pow()
Yeah I am assuming some of yall are advanced computer wizards
🤣
i never finished middle school
YOU NEVER
LIAR
ong
😭😭😭
Yeah I was talking about you bro wtf kind of books are u reading
i read manga
lmao (its true tho)
Is it possible to add choice questions to modals yet?
Or does it only support text inputs yet?
Only text inputs for discord modals
Thanks
i wanted to update my bot version (like add new commands or something) and i tried it in my beta bot, after that i already coded the new version, i uploaded the file to my public bot for updates. but when I want to start there is an error message
DiscordAPIError[20012]: You are not authorized to perform this action on this application
idk why, I tried it on my beta bot and it worked
I’m a computer science major, as for books I’d say most of that is useless for programming
Just pick a language and start learning it by making things with it
Usually trying to convert java to rust is hard bc Java is very OOP and OOP burns in flames with rust
Minecraft is heavily based on inheritance and OOP concepts
You’re not going to have much luck trying to 1:1 convert it
indeed, there is something very cool i learned at some point, you gotta aim past your actual goal, make your goal just a stepping stone onto something else
some martial arts like karate implement this principle as well, for example you dont punch someone, you punch whatever is behind someone, and that someone will be hit way harder because hes in the way
so you dont aim to learn programming, you aim to build something cool, and the learning is just the obstacle in the middle that will be hit harder because its in the way of the actual target
cc@analog narwhal because #relevant
bro im still a college freshman
i dont think so tbh, you can just include the parent class inside the struct, no?
and maybe call some method or impl Deref to retrieve it
anyone here know how to open exported azure disk?
i tried using qemu-nbd and doesnt work
what are you doing
🤫
opening linux vhd yes
whats a vhd
virtual hard drive
damn pro stuff
nah
there is no error when doing qemu-nbd, but when i try to mount, there's error smth like 'invalid fs type .... i saw there are nbd0-nbd21 via lsblk . nbd0 has 30gb size (my vhd size) and others are just 0
right now im trying to re-download the vhd, maybe it's corrupted before? i'll see
Could be, but unlikely. Could be qemu acting up too though. I know the last time I did anything in this area, I actually used the guestmount route for simplicity.
As far as nbd0, I believe that's the default nbd device available.
may i know how to do that?
nvm, i was fix the problem.
rust users wondering why their inheritance doesn't work
I didn't expect much better
Deref:
i tried another way, using guestmount , it's getting somewhere...
ill debug it
ok i got it working. using guestfish
Oh nice. Sorry, I went to bed haha
it's okay :D

hey guys, next to properly aligning the text, any other advice on how to design it better
idk something seems off..
it seems boring or sum
shadows inside shadows is not ideal
the outer box already has drop shadow, so inside the box there shouldnt be any similar drop shadows
also the orange box is too strong
doesnt match well with neither black nor white inner text colors
the basic/premium/standard titles could be a simple header instead of a button/box, the same style as Onze prijzen
the bottom black button could be a background covering the entire width of the box instead of being a button on top the box
the orange box could be darker for white text, or lighter for black text
yup!
like a footer typa thing?
i like it
maynn why is bootstrap teasing me
i am using the grid system and if all breakpoints add up to 12 it cramps everything together
its missing some of the orange now, its too black
the borders can still be orange, as well as the title and/or prices and/or button
xD
the 3rd web developer on earth that still uses cssgrid
whaa
i love you
i didnt know
thank u
if(format === "json") {
return {
signature: {
source: "NASA/JPL Horizons API",
version: "1.0"
},
result: textresult
}
}
im sure that took 2 weeks and 20 meetings to make
This is government work, it took 16 Jira tickets and 7 hours of code review for that
:^)
now lets see if i can use this crap to generate ephemerides that are decent enough
LOL
i will forever make fun of project managers that make use of methodologies
a friend i knew shes going on to become a project manager so im not sure if i can be friends with her anymore
y'all stay safe out there
no longer friends with X
Y is my new best friend
is there something im missing
it's an old project, trying to resurrect, idk something might change
@tough beacon
🤨
Order of the get? Pretty far outside my typical scope, but I usually dump wildcard routes at the end. That usually keeps it as a reliable fallback. Beyond that, nothing else really stands out.
literally the first get. red is the get, yellow is the "Incoming request" log, and green are the other routes that'll be loaded. the red box codes actually are inside the .then function, but it didn't work, so i tried moving it to the very beginning
i'm not expecting this to work but still wondering why
Try changing the order. Put bodyParaer middleware before passport.
Agreed, the order looks a bit off.
Shouldn't the route be /*?
hmm still didn't work
anyways thank you guys for helping me. i don't want to make it run correctly either
speaking of X elon musk is battling against brazil to keep X unblocked
ye lmao
its so dumb
I setup a foreign key reference from one table to another, and on the table its references if I update the value at that key is there anyway I can make it reflect on all the referencees ?
hey guys i am writing a bash that should basically write 99 characters excluding a newline, for exactly 500 lines. However the file in bash tends to always add another line that is empty.
so instead of 500 lines it ends up being 501
reason as to why i have not copied the code is because it is on my vm and mac does not have bidirectional pasting
ON UPDATE CASCADE
Isn’t this called like a cascading update or smth?
Yeah
Didn’t see ben’s thing
it's due to this
oh wait, nvm, you caught that already
well, still, if an empty line is being added it's 99% due to trailing \n
use echo -n -e
Is it this?
X="$X"$'\n'
Mainly the $'\n' part
-- Your SQL goes here
CREATE OR REPLACE FUNCTION update_server_messages()
RETURNS TRIGGER
LANGUAGE PLPGSQL
AS
$$
BEGIN
UPDATE servers SET messages_sent = messages_sent + 1;
end;
$$;
CREATE OR REPLACE FUNCTION update_player_messages()
RETURNS TRIGGER
AS
$$
BEGIN
UPDATE players SET messages_sent = messages_sent + 1;
end;
$$ LANGUAGE PLPGSQL;
CREATE TRIGGER player_messages
AFTER INSERT
ON players
FOR EACH STATEMENT
EXECUTE FUNCTION update_player_messages();
CREATE TRIGGER server_messages
AFTER INSERT
ON servers
FOR EACH STATEMENT
EXECUTE FUNCTION update_server_messages();
Does this look correct? I swear I am doing something wrong cause it wont execute
I fixed it, but the update stuff isn't working too well. I am trying to have it so it updates those fields on those tables, but its doing it for ALL entries in that table
I then tried WHERE player_id = new.player_id and WHERE ip = new.server_ip respectively, but that doesn't seem to work
Fixed
create function update_server_messages() returns trigger
language plpgsql
as
$$
BEGIN
UPDATE servers SET messages_sent = messages_sent + 1 WHERE ip IN (SELECT DISTINCT server_ip FROM messages_sent);
RETURN NULL;
end;
$$;
alter function update_server_messages() owner to chimeralabs;
create function update_player_messages() returns trigger
language plpgsql
as
$$
BEGIN
UPDATE players SET messages_sent = messages_sent + 1 WHERE players.player_id IN (SELECT DISTINCT messages_sent.player_id FROM messages_sent);
RETURN NULL;
end;
$$;
alter function update_player_messages() owner to chimeralabs;
Had to use WHERE x IN
use WHERE exists(SELECT 1 FROM messages_sent WHERE server_ip = ip)
this way you allow using index
also u cant return null unless it's an AFTER DELETE trigger (and even then)
RETURN NEW instead
ok ty
works perfectly
thanks
First time using triggers
postgres triggers are very very powerful
given you can use programming langs like java or js in them, you could even have it send http requests
#triggered
Yo where the discord leaks at
What
well, localhost still uses a network adapter to find yourself
yea
but I can't tell why its happening
Maybe its because im on a mesh wifi system
One message removed from a suspended account.
I said same thing
@quartz kindle Just argued with rossmann in the yt comments lmao
what the fuck lmao
let me see
@lyric mountain seems like my triggers aren't working anymore
create function update_server_messages() returns trigger
language plpgsql
as
$$
BEGIN
UPDATE servers SET message_count = message_count + 1 WHERE exists(SELECT 1 FROM messages WHERE server_ip = ip);
RETURN NEW;
end;
$$;
alter function update_server_messages() owner to chimeralabs;
Its not updating the message_count row
@timid raft
Did you assign it to a table?
Actually, nvm, brb
aight so, you dont need anything of that, just UPDATE servers SET message_count = message_count + 1 WHERE ip = NEW.ip
tho that trigger should be on messages, not on servers since you'll be inserting there
meow
it is to me, are you using any vpn?
also this
hm, what browser are you using?
Google Chrome
weird, but well it's best if you ask in #support so some moderator can help you better
site's working fine, it's probably some problem on your side
outdated browser?
outdated topgg
So which browser you suggest
nono i mean, is your google chrome up to date?
I goofed around on godot for a bit, its too hard ^-^
https://discord.com/developers/docs/resources/user#user-object-user-structure
im not seeing this in the user object
verified? boolean whether the email on this account has been verified email
Used Godot a little bit, also made my own small engine
this is what i get for my user
{
id: '92436985859293184',
username: 'ben2317',
avatar: '2e9616d43db1545d83214e7e8f4e4476',
discriminator: '0',
public_flags: 0,
flags: 0,
banner: null,
accent_color: null,
global_name: 'Ben',
avatar_decoration_data: null,
banner_color: null,
clan: null
}```
I know a little bit about gamedev
Does the ? not imply that the field may or may not be in the response, or is that just meaning it’s nullable?
yeah, but i want to fetch it
i tried making an api call
const response = await fetch(`${URLS.api}/users/${user_id}`, {
headers: {
Authorization: `Bot ${config.discord_bot_token}`,
}
});```
I’d assume that if the field is not present then the value is by default false. Odd way of doing things on discord’s end though
but my email is verified
maybe the bot needs permissions
Required OAuth2 Scope
email
it needs email access
Yeah that was gonna be my other question
damn nice
I see, and also you were the one that told me to do that other thing 
I had ip = NEW.ip before
Yo this my new bot I make it I add some slash commands: mute, kick ,ban ,deafen ,report , warn I'll make more commands and more updates🌹
but you said it wasn't good doing that way since its not using indexing or whatever
yep, misread your intention before
👍
you had WHERE ip IN (SELECT DISTINCT server_ip FROM messages_sent);
in this case it doesnt use index cuz it's doing a full scan
I guess the one i showed you I did that
btw
u can make it even better, no need for update
just NEW.message_count = NEW.message_count + 1
u can modify NEW entry as you wish
google gemini web devs cant even align buttons on their sidebar
site was made using gemini 🔥
suffer


I cant do that
Because New is the messages table, and that doesn't have messages_count
That only exists on the players & servers table
didn't u attach the trigger to players & servers tables?
I attached them on the messages table
because after a message is inserted those fields should update on the servers & players table for the server_ip & player_id of the player & server the message was sent on / by
It was a way for me to track the total number of messages sent on a server & by a player, without doing another query in code
AFTER INSERT ON players
yes I know what that says
I have since changed it though
because it makes no sense to put it there
I attached those triggers to the messages table now
Because of this
I want the message_count fields on the player & servers table to update when a message is inserted
So I had to attach it to the messages table for that trigger to work
ah
helppp
typescript hellppp
im in a browser enviroment
a global object is being created
i want to create types for it
i made an environment.d.ts and added it to my tsconfig.include but it no no worky
nvm got it!!!
Peak UI design, Facebook has a toggle just to enable the search bar
can someone explain to me
why the hell
margin and padding
have
e.g.
margin: 0px 0px
as y then x
instead of x then y
so dumb
bro is doing margin-x and margin-y
its because its the short form of the 4-params rule
4 params = top right bottom left
so the short 2 params form becomes top(bottom) right(left)
and the even shorter 1 param for all of them
starting from top is a crime, LTRB ftw
does anyone know where to find legal counsel that specialise in UGC web apps? I'm building one and want to make sure i'm compliant. I have SOME knowledge of what's required but would rather be safe than sorry.
i know there's obviously places like fiverr and upwork but often they either don't specialise within the actual niche, aren't actually qualified, or just provide low quality services
well, you can hire a lawier even if just as a consultant
is this a good way to do if statements?
if (Settings.ChatBot && Settings.ChatBot.Enabled) {
if (message.channel.id === Settings.ChatBot.Channel) {
if (client.bannedWords.includes(message.content)) {
console.log('IsChatBotChannel true')
console.log('IsMessageBlocked true')
return;
} else {
console.log('IsChatBotChannel true')
console.log('IsMessageBlocked false')
}
} else {
return;
}
}
discord screwed my indenting
Can you put it on a pastebin I’m on mobile
i can do that
when you have a branch where the only statement is return, it's better if you simply use a guard clause instead
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.
i just have it returning for now until i do the rest of the end code
if (Settings.ChatBot && Settings.ChatBot.Enabled) {
if (message.channel.id !== Settings.ChatBot.Channel) return;
if (client.bannedWords.includes(message.content)) {
console.log('IsChatBotChannel true')
console.log('IsMessageBlocked true')
return;
} else {
console.log('IsChatBotChannel true')
console.log('IsMessageBlocked false')
}
}
if the code you'll put in that first return is short enough, u can still use it like that
how do i make a site for my bot? This time i need one for interactions with my bot
similar to Mee6
i'm planning to allow it to make custom templates for characters and characters with custom sheet
await interaction.deferReply({ ephemeral:true })
How does this line throw the error Unknown interaction? 🙏
Okay, I tried out something stupid in order to fix the issue, however it worked
well, start by learning a web framework
like next.js, react, flutter, angular, vue, etc
or just rawdog html + js + css
try making a simple site, one that works
after that you'll need to learn how to make an api, similar to making a bot but not exactly
Oh LOL, so my project had already been running on pm2, however I used node before stopping pm2 so it was kind of replying to the same interaction twice
then at last you make the site send requests to the api
voila, you have a dashboard
kill -9 it
God I will
accurate animated depiction of the kill -9 command between the linux kernel and process:
What is the ComponentType for modals?
I thought it would be possible to create a collector for modal submissions, however I found out that it isn't
submitting a model is an interation. displaying a model is different
displaying is replying to an interaction right?
How can I immediately get when a user has voted on top.gg?
I see on some bots, when I vote for it on top gg, it almost immediately sends the message to confirm I voted. I see that there is an API endpoint to get user vote counts, but I dont understand how the immediate feedback is done
One message removed from a suspended account.
One message removed from a suspended account.
i was wonder about immediate feedback, did some more research. Looks like the answer is just webhooks
One message removed from a suspended account.
I'm using authjs (next-auth v5 beta) and the Discord provider. If someone attempts to login but they click "cancel" how can I redirect them to a 401 page? In extension, using next.js v14 app router, how can I handle error codes such as 500, 403 etc? I tried using an error.tsx and global-error.tsx but these are not getting rendered when I do this in a client component:
setTimeout(() => throw new Error('test'), 5000)```
code that runs inside a timeout is executed in a separate context from where it cannot return to the current context
you need to promisify the timeout and throw the error as a promise rejection
use the websocket
Do you need to make an API request for every single call to your API, or can you store that data on your end via a database?
If you can store the data in your db after, you probably don’t even need a cache unless you’re going overkill or it’s a high hit endpoint
is there a way to see when a user voted for my bot? Like a timestamp of when the user voted. I have a vote system that tracks when a user votes in my database, but im unable to ensure that the user has voted exactly when they voted on topgg
Ah okay, i am doing that already but i was hoping that topgg could give that so its more precise
how are you tracking votes? if you're already using topgg webhooks then thats as precise as you can get afaik
When a user uses a voter only command, the system checks the database for an existing vote entry. If no entry is found, it checks the api to see if the user has voted. If the user has voted, it updates the database with the current timestamp. If the user hasn't voted, it raises an exception.
ive had issues with using the lib for the api so i just do aiohttp requests. i can give you my checks if you wanna see how it works
it shouldn't raise an exception, just return false
simply check the database whether the user has voted, if the timestamp is absent or older than 12h then send a request to topgg to check
if voted return true, else false regardless of why
so you're not using webhooks then?
if so, then webhooks would give you what you want
no
Ill consider setting that up
The exception is just telling the user to go vote
here i'm useing router.push("url") to change lang but its re loading everything fetched from api this vid will show you what happend to me and what i want to happen
anyway this is the exception i was talking about
Are you an Arab?
yes 😔
probably works off a regex
doesnt work wiuthout http://-
yep
hyperlink are blocked here
thanks captain obvious
👀
darn
sftp isnt a hyperlink?!?! wild ;p
Can just add an image and then mask it with css
I want my bot to give coins to users who vote for it, but my code doesn't seem to work. What should I do?
const express = require('express');
const app = express();
app.use(express.json());
const WEBHOOK_SECRET = 'WEBHOOK :O';
const webhookChannelID = '798993508404953098';
app.post('/topgg', async (req, res) => {
console.log('Webhook received: ', req.body);
const auth = req.headers.authorization;
if (auth !== WEBHOOK_SECRET) {
return res.status(403).send('Unauthorized');
}
const { user } = req.body;
if (!user) return res.status(400).send('Bad Request: Missing user information');
const hahacoinAmount = (Math.random() * 1000).toFixed(3);
await db.add(`coin_${user}`, hahacoinAmount);
const channel = await client.channels.fetch(webhookChannelID);
if (channel) {
channel.send(`**${user}** adlı kullanıcı bota oy verdi ve **${hahacoinAmount}** coin ödülü kazandı!`);
}
res.status(200).send('Success');
});
you set the coin value instead of adding it?
its not about setting the value, but the bot also doesn't send a message to the specified channel when a vote is made...
Are you even receiving the request
how*
hi chat
what react library for animating elements being added to the dom
i see framer but animatepresence is only for removal?
in Framer Motion, AnimatePresence is not just for removing elements; it can also be used to animate elements being added to the DOM. AnimatePresence allows you to apply animations when elements are both added to and removed from the DOM, so it can handle both entrance and exit animations.
nvm i've got it
what yall think of my code to reverse a queue using a queue?
Array.prototype.enqueue = function(elem) {
return this.push(elem);
};
Array.prototype.dequeue = function() {
return this.shift();
};
function reverseQueue(Q1, Q2) {
while(!Q2.length == 0){
for (let i = 0; i < Q2.length - 1; i++){
Q2.enqueue(Q2.dequeue());
}
Q1.enqueue(Q2.dequeue());
}
return Q1;
}
let queue1 = [];
let queue2 = [1, 2, 3, 4, 6, 7, 8, 9, 10];
console.log(reverseQueue(queue1, queue2));
i mean the queue is represented as an array, but just like a normal queue it pops from the start and adds at the end
🔥
this is awesome
Making a Friday the 13th themed game
called Camp Blood
and I can't seem to figure out why the rounds won't progress correctly.
maybe it's just time i learn how to use listeners for button interactions instead of collectors..
Do you get your debug print "Webhook received: ..."
No, I'm not getting that error either.
there is another way
please tell me, im listening.
@top-gg/sdk
Official Top.gg Node SDK. Latest version: 3.1.6, last published: a year ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 15 other projects in the npm registry using @top-gg/sdk.
const Topgg = require("@top-gg/sdk");
const app = express(); // Your express app
const webhook = new Topgg.Webhook("topggauth123"); // add your Top.gg webhook authorization (not bot token)
app.post(
"/dblwebhook",
webhook.listener((vote) => {
// vote is your vote object
console.log(vote.user); // 221221226561929217
})
); // attach the middleware
app.listen(3000);```
and add coins part idfk
i want to test it can vote my bot?
bot id?
You can send test vote
1086388009106161745
voted
uh.. its doesnt work...
const express = require("express");
const Topgg = require("@top-gg/sdk");
const app = express(); // Your express app
const webhook = new Topgg.Webhook("SSSSSS");
app.post(
"/dblwebhook",
webhook.listener((vote) => {
console.log(vote.user); //
const webhookChannelID = '798993508404953098';
const hahacoinAmount = (Math.random() * 1000).toFixed(3);
db.add(`hahacoin_${vote.user}`, hahacoinAmount);
if (channel) {
channel.send(`**${vote.user}** adlı kullanıcı bota oy verdi ve **${hahacoinAmount}** Hahacoin ödülü kazandı!`);
}
})
);
app.listen(3000);
How?
Yeah well then there's more of an issue with the reachability of your server than the code itself
Isn't that it?
nope
which one
what should i do?
whats your server ip and port
dm me your server invite
Idk how to translate to turkish
One message removed from a suspended account.
One message removed from a suspended account.
your vds should have a network point of entry, for example if you want to host a website, what do you use? there shoild be something like an ip address or dns address
sir tim
if I set up a localhost on a VDS using XAMPP, would that work?
depends on the host
what company is your vds from?
febzen.com its Turkish company
for example, when you have a vps/vds/dedi, you are usually given an ip address, and when you want to host a website, you run a webserver like nginx or xampp and then set a domain name with a DNS record with your vps/vds ip address
if you have an ip address then you can use your ip address to receive topgg webhooks
you dont need a full xampp system
if you use python or node, you create a webserver using a library like express or flask, and run the server on a port
and then your topgg webhook url is your vds ip address and the server port
good luck!
it's a form of donation like kofi and chargebee
Well can I benefit from creating a future plan for the bot?
well, if you want to receive donations...yes
just be aware that patreon has an awful api
also iirc patreon cut is fairly high
compared to the others I mentioned
its just that patreon is the most popular platform and most people are familiar with it
but yeah, its not really the best
what do you mean with "future plan" exactly?
I mean I want to create my own project ( subscription for my bot ) with features

you can (and pretty much are forced to) use discord's own premium subscription system
but you can have external alternatives like paypal, patreon, kofi and others
or you can do for something more professional like paypal, stripe or chargebee
only catch is that ur also forced to use the same price on discord (u cant factor in their absurd cut)
yeah, if you sell premium for $5 on discord you cannot sell it for less outside of discord
even though discord takes more %
my country does not allow me to use these platforms
This is a bigger problem
Ahemmm
what
🤨

does discord premium system work in your country?
apparently not
what do you mean by (Premium Discord)?
Impossible to appear here
ONLY U.S

lol
Because it was established there
noope just Discord hate World Wide things
thats not the reason lol
international business is not easy, countries have different tax laws, different bank systems, different payment methods

i know
I definitely agree with you
world wide shopping really hard


can you use something that is specific for turkey?
You grow your business with iyzico. Start accepting different payment options from all over the world in 24 hours with iyzico.
Ok?
I don t think so unless he works in Africa
oh i thought you are from turkey
i confused you with the other guy i helped today who is from turkey lol
🙂🙂

apparently this works in iraq
That s right it works
but the site is strange and I don't feel it will work
In my field
i need some advice 👀
even doing this won't render error.tsx or global-error.tsx (im using nextjs v14 app router)
new Promise((_, reject) => {
setTimeout(() => {
reject(new Error('test'));
}, 2500);
});```
this was from 3 years ago, so i dont know if its still valid but there are some suggestiosn here
you need to await that, or include that in your code flow
I have this game CAMP BLOOD that i'm working on. It's basically like a Friday the 13th themed version of my click war game, but it's a little different. Jason is hunting you and what you choose to do determines your outcome. You have 3 medkits, last man standing wins. But I want to add a few embeds to display the results between each round.
but everytime i do, it sends round 1 to the channel a million times
i cant await it because its in a client component which isnt asynchronous however i can do (async () => { await ... })() which doesn't cause the error pages to render either
this is what i was trying to add
it needs to be part of the code flow
for example:
const result = await new Promise((resolve, reject) => {
setTimeout(() => {
reject(new Error("timeout"))
}, 2500);
someOtherAsyncFunction().then(result => {
resolve(result);
})
})
if the component isnt asynchronous then why the 2500ms timer?
what are you waitign for that can take more than 2500?
i was getting ts errors because this code was before i was returning the jsx so wrapping it in a settimeout allowed the page to render
but im trying to handle uncaught errors using next.js error.tsx and/or global-error.tsx
which once an uncaught error occurs, the error page will be rendered
someone also said this:
The error boundary catches only the exceptions thrown by function components, therefore this exception will escape it since it happens in a separate function that is pushed to the call stack after the timeout is expired.
The same happens if you throw an error in an event handler, it will not get handled.
The React error boundary is a safe net only for errors that can break rendering.
I entered and saw the written truth. There are many banks with us, but they do not support electronic defenses. Only MasterCard or Visa. These two cards work with us As for the rest I do not think so

yes, thats basically what i said
but what errors are you expecting to catch?
because there is no such thing as a truly global error handler
there are many different types of errors, and the code needs to be handled corrctly for each type of possible error
any uncaught client side error
client side?
if you want to catch client side errors, then you do that inside client side js
not on the rendering/routing
this is what im trying to do, not just client errors i suppose, any error that could potentially happen that is uncaught
(uncaught exceptions on the 'on this page' nav right side)
yes but to support mastercard and visa online in an app or website you need to use a payment gateway service
if you throw an error without a setTimeout, does it show the error page?
next.js just doesnt compile the code
why not? typescript doesnt let you?
my fault, it logged an error but continued to compile, i thought it cancelled
yeah the page does render now
so the error page renders right?
i tried it page.tsx (server component) which works but i havent yet tried a client component
yeah
alright then it looks good
it renders error.tsx instead of the global one. is the global one only for errors caused in the layout as it requires its own separate html and body tags
afaik the global one is the last resort in routes that do not have any error.tsx
so if i just have an error.tsx file in the root layout which renders a 500 page then global-error is practically useless?
it says in the docs that error handles below root layout, and global-error handles root layout
Also this is a problem but I have a company that is global I am not sure if it is global but I think so and do not mention names now
i didnt know if that meant i should use error.tsx within components or not? only because global-error doesnt inherit the layout from layout.tsx and therefore requires its own layout whereas error.tsx does inherit the layout and i felt that would be the easier option, and i also thought thats what it meant by below root layout as to inherit the layout it needs to be below
i think so, but im not sure either, im not really experienced with nextjs
Wait a minute I remembered the name is Pioneer !!!!

which part exactly causes the issue?
yes payoneer is also an alternative to paypal that works in many countries
but i dont think they support Iraq
Don t worry he works for us




