#development
1 messages · Page 168 of 1
see, this is why I dont recommend taking a bot template and attempting to work on it without previous knowledge
your issue is that the command file you're trying to read doesn't have a help property on it
so you cannot do props.help.name because props.help doesn't exist
you're missing the issue
the issue is not the line, it's the abscence of that property
please start a bot from scratch while following a guide
you can't just belly push projects like this
yes, I know
this is why I'm telling you to start from the ground
i am trying my best sorry bout everything
I dont mean scratch, I mean starting from scratch
as in, start from zero
well, doesn't work like this
you cant make a bot if you don't know what you're doing
even if you manage to get the bot online you wont be able to make any command that works
Templates are no good if you don't understand any of it. If let's say something doesn't work or something breaks in the future when they change the discord API you won't even know how to fix it like in this case
Start with a simple bot, text commands first, some simple embeds first, then maybe something more advanced. Don't jump into big templates from github right away because you will lose all your enthusiasm for programming
Hi everyone, I listen to the votes my bot receives on Top.gg by listening via webhook, it happens that once every 2-3 days my bot goes into heap memory limit due to a 504 Gateway Time-out error ..how can I avoid it?
What exactly do you want to avoid?
Is that bad?
ye
heap memory limit after getting one 504 error from top.gg api
That doesn’t sound like it’s your issue
You’re doing something else wrong
I don’t know what you need help with
Post it here
at C:\Users\Administrator\Desktop\discordJS-V14-main\events\ready.js:17:27
at Array.forEach (<anonymous>)
at C:\Users\Administrator\Desktop\discordJS-V14-main\events\ready.js:14:7
at FSReqCallback.oncomplete (node:fs:188:23)
C:\Users\Administrator\Desktop\discordJS-V14-main>```
anyone can help?
I would recommend learning javascript as a start
We have already instructed you to write the bot yourself using the guide
It's unlikely that anyone here will fix your every template error
your commands dont have a "help" property
wym
in that code you have props.help.name
props is the content of the command file you are loading
then .help is looking for a help part, inside that command. but it did not find it.
so open your command files, and check if they are missing a help property
how do i fix it?
i cant find any help file
its not a help file
Yoy need tk export it
yeah
module.exports.help
that's what you need to do
It's looking for a file being exported as module.exports.help
I'm not gonna help you any more than that, I suggest you learn javascript before making a bot
I suggest you learn how to export things in js
If I update the name of the bot in the developer portal, will that automatically happen in top.gg?
No, you need to "tell" top.gg that you have changed the bot name. This is what the "refresh data" button is for
Then click "edit" and "save"
Right, thanks
why don't you just
export = {
help: ...
}
tip: you will need to learn about js's module system and object property access
i dont think it would work since they are probably in a CommonJS environment
in that case,
module.exports = {
help: ...
}
they were probably following a youtube tutorial
I think they simply downloaded the template from the Internet and tried to run the bot
safe to say they have zero idea what they're doing
lmao
wouldn't that just do the same thing tho
it is, but why would you make multiple assignments to the same thing
it's just preferences
^
Anybody knows how I can do cron notation for every 136 hours?
* */16 */5 * * doesn't work because it runs twice per 5 days and
* */136 * * * is invalid
how do I edit where the votes go through
because I thought it was somewhere like webhook url
try 0 */136 * * *
in your bot's top.gg edit page
thats where you set your webhook url
I didn’t see it so I had to look it up but I figured it out thanks though
Thats it thank you
Can anyone help me with the answer to verify the discord bot?
Just answer it
Since yesterday I submitted a request but it was always rejected, maybe because my answer was not significant enough
what was the reason for rejection?
and what was the question and the answer you gave?
he said my bot didn't meet his criteria even though I had explained that it was a music bot, and he said my bot wasn't interesting enough
I suggest using https://crontab-generator.org/ to understand when your crontabs run
Generate your crontab line easily.
something I always use lol
did you ask for the message content intent?
@earnest phoenix @neon leaf i love overengineering my projects 
i answered and i explained the contents of the message and about my bot
no, im talking about the INTENT
Are you writing pseudo code as to how your code works?
I don't think that deviates from it being pseudo code
What you wrote entirely is pseudo code, but in the form of data binary structure
Anyway why are you writing that though?
yes i asked
so i can keep track of things
then thats why, you cant ask for it
because i am planning to add (almost) the entire Unicode bidirectional class dictionary to the binary
you need to use slash commands
To handle RTL stuff?
My bot already uses slash commands
yes
I thought you said you weren't gonna support that
i'm basically just going to copy integrate https://github.com/servo/unicode-bidi into my library
if i support that i can support arabic and hebrew characters
We do a little yoinking implementing
the project's primarily missing arabic and hebrew
also most if not all homoglyph-clearing libraries don't even have unicode bidi support
so they translate things based on the characters being stored on memory, not how it's rendered 
Good luck implementing that, I'm here to help if you need any
then you dont need the message content intent... dont ask for it
probably will take several months
too much effort for a project with such low following 
Why would it take that long?
takes me time to understand the algorithm and integrate it to my project
I mean... #development message
have you seen its code
Yeah?
You can simply integrate it, you don't need to reimplement it nor understand the entire thing
As long as its license permits it and is compatible with yours
i dont want to be the average bot developer copying things they dont understand to their project
it'll bite them in their asses if they do
That's not how it works, you don't have to entirely understand the inner workings of a project to integrate it to your own project
You just have to use what the project provides
you can optimize things if you do
i can vouch i be importing the entire npm website and do the typey typey and click clack and woooshhh booommm everything works 🤷
got no clue wtf i’m doing 👍 😁
Doesn't change my point, you don't have to when it's already very optimized
this
they call me the programmer 😎😎
woahhh y’all are library developers thats actually rly cool :o
whats so cool about that
That's the importance of simplicity, you don't have to entirely know how the inner workings of a project works to integrate it or work with it, that's like saying you have to know how the inner workings of a TV works to buy and put it in your house and use it
i too have uhhh not made a library but i do this funny lil thing where i have these function thingie bois that i use in a lot of projects so i always just paste those into new projects i start
volt its much more complicated than that
two projects dont combine together by just copying and pasting
It isn't, not at all
You integrate it by using the APIs the other project provides to accomplish something in your own, as simple as that, it's like a dependency
You're not reinventing the wheel, you're using it
i am not using it as a dependency
For example, we use the V8 JavaScript engine in our runtime called Node.js, do we entirely know how its inner workings are and how it exactly works? No (well I do because I'm a maintainer of it, but that's besides the point as I'm talking collectively), we only use its APIs that it provides, integrating it, and making the runtime work, flying the turtle to the moon!
Then how else are you using it exactly?
some right-to-left characters can be translated to left-to-right characters
And how does that change my point?
i want for that to be handled in some way
You can use the APIs the project provides as I already said, the project provides APIs to detect what characters can be translated (actually it's called mirroring, not translating)
It's part of the Unicode Bidirectional Algorithm specification to provide it
im referring to translating as in my library's definition of translating
unicode bidirectional algorithm specification.
that’s my favourite thing in the whole world…
yall are such nerd emojis im going back to scratch
skill issue
I already know that, you can use the APIs it provides to know which characters to translate
It provides multiple APIs that allow you to accomplish your exact goal
kinda praying my bot doesn’t actually get checked any time soon because i’m fucked if they somehow find a way to crash it. i’m currently like 3 hours away from my home and i won’t be back anytime soon
i’ve spent the last few days doing minimal programming and just bug testing and i think i have everything worked out but 👀
Don't worry they'll go to lengths to find your exact location through the bot
😔
But jokes aside, if you've vigorously tested everything as much as you can, then you're most likely fine
Just make sure your bot meets the guidelines outlined here
uhhhhh, yes…
this is my bots current logo, it’s so epic and slay
i’m thinking about changing it to just a 2x2 board
like what sm people do with connect4 bots/games/apps
Nice logo
Incarnation of evil
Hopefully it's not yet another kitchen sink bot 
uh translate
i live under a roque
when i hear kitchen sink i think of a kitchen sink
my bot is indeed not a sink
that you wash dishes in
Hey guys would you be interested in a product that lets you like monitor all your running servers across providers? Like an all in one platform where you can see what services are running, for example ec2, lambda, s3, etc. so that way you can track what services are idle or running and see configurations. It’s easy to lose track Of all the servers and might simply lose money. https://www.figma.com/proto/4IONcuznXdLKCL1AQ8pnD7/cloudview?type=design&node-id=102-5&t=cC1CiADuPu8I9VU5-0&scaling=scale-down&page-id=0%3A1&starting-point-node-id=102%3A5
I have a prototype I can show and was looking for some feedback 
that would be crazy bagaizy
A kitchen sink bot is a bot where its developer(s) try to shove as many features to it as they possibly can
oh what’s wrong with those? my bot has like 5 commands..
And 99% of the time it's features that many other bots already have, no uniqueness
o
yea my tictactoe bot can purge channels 😎
that makes me atleast 3.6% cooler right
That's cool feature
Can it make me a sandwich?
can it make me bitches?
you will never believe me when i saw this
but it can make you the best sandwich you’ve ever had
oh no sorry that’s impossible
0/10 bot not cool
it can help you with your plans on world domination however
Yes because you're the bitches
i take that back
10/10
Wow I must invest in this bot
connect4 bot* eh hem
it makes beese churgers
Does the bot contact its owner to make the sandwich? 😉
no way
uhhh i know how to make some killer deviled eggs that’s about as far as my cooking skills go


standwich
i personally like wichsands
instead of bread stuff bread it’s stuff bread stuff
Damn so secrets of this channel were to develop new sandwiches
m e a t
sometimes i’ll cut 3 slices of pork and make a meatwich where it’s just meat meat meat no bread
you ever had french toast but instead of the yolk cooked with the bread its just the egg whites
mayo french toast
The ban hammer is about to sandwich us
not again!
my twelfth alt account 😭
i prolly actually shouldn’t say things like that, can’t let them know i’m ban evadi-
/j /j /j (don’t hurt me)
anyway
french toast but just mayo
i have a crippling mayo addiction. i’ve been going to mayoholics anonymous meetings but i fear they aren’t helping 😢
Damn that's so sad, Alexa play Despacito
Sure
can it provide birthday cake recipes? 🤨
i self host everything with my trusty 10 yr old laptop
how risky is it running a 2tb hdd with important data without raid
crazy
depending on raid configuration obv
Raid10 
I mean with raid 1 if both fail at the same time I guess some force doesnt like me
yeah with raid 0, both failing is rip
but very unlikely both will
at the same time
raid 1*

raid 10 not too crazy if ur using hdds from a dumpster
yeah you just have to balance between cost and redundancy
depends on how important that data is
and how you otherwise protect against loss (such as a backup system)
looks like aws to me
Looks pretty good
would it be useful for devs?
would you use a product like that is the question
imo it makes devs life easier
That would be useful yes
nice thanks
somehow my level system managed to give out negative xp to users
This is something you don't see every day
Do you need help fixing it?
nah it turns out when a user sends "aeifjas" it gets detected as 0 words because I split by spaces, and I always subtract 1 from word count so it ended up being -1 and that got multiplied by more stuff
I just set word count to 1 if its 0 now
Why do you always subtract 1?
Lmao
That reminds me of those comments thatre like "I don't know why I did this but everything breaks if i remove it"
Lmao
swag
does it support cidr notation?
does it support shortening the ip (such as ::1 for 0000:0001)
yes
that was the main pain
but turned out easier than expected
but it needs cidr 
the subnet length
ipv6 is pain, one of the reasons all my internal shit is still ipv4
yes but if im gonna do that ill have to do subnet parsing too is my perspective
like an iterator maybe
to iterate over subnet
how horrible is this code https://github.com/0x7d8/rjweb-utils/commit/5c65bfa229b2fe7548b795e632c64670dc15f53b
wtf
I somehow managed to break mariadb
without touching its folder
??
how even does this make sense
global-mariadb_db | 2023-10-08 0:08:56 0 [Note] InnoDB: Number of transaction pools: 1
global-mariadb_db | 2023-10-08 0:08:56 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
global-mariadb_db | 2023-10-08 0:08:56 0 [ERROR] mariadbd: Can't create/write to file '/tmp/ib8EiVBX' (Errcode: 13 "Permission denied")
global-mariadb_db | 2023-10-08 0:08:56 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
global-mariadb_db | 2023-10-08 0:08:56 0 [ERROR] mariadbd: Can't create/write to file '/tmp/ibFhemtd' (Errcode: 13 "Permission denied")
global-mariadb_db | 2023-10-08 0:08:56 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
global-mariadb_db | 2023-10-08 0:08:56 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
It looks like it couldn't make a file cause it didn't have permissions
well I fixed it by mounting the hosts tmp to the container
in this pseudocode there isn't a deadlock possible right?
I went through all the cases, and the first 2 always acquire atleast 1 variable, where the last acquires 0 and must wait on both functions to finish.
Its for ?
wym?
What you mean
i mean what do you mean
Your script is for a bot discord ?
no.
Is for ?
operating systems, but ig it would just be applicable to all coding domains?
what do the f functions refer to?
f are semaphores
and those P functions are gonna be used at the same time in multithreading?
yup, ran parralel
is that signal in there the only way to release those locks or can they be released elsewhere?
nope semahpores in c++ only have wait to acquire a lock and signal to unlock it.
isnt that basically a mutex
ah i was misunderstanding the purpose of the wait method
i thought it would wait for the signal first, not acquire the lock first
yeah same purpose iirc
yes
it must wait indee at first. How the wait works is as long as the sempahore is bigger than 0, it will decrease it and run the code, but that means that others that are waiting must wait till the semahpore is 1 again (as if it's 0 it will just stop the execution and wait).
like, when you run f0.wait() for the first time, it does not wait right? it acquires the lock and proceeds
The signal increments it
only if you call f0.wait() again it will wait until the previous signal is used
yeah i made an assumption that f1, f0 and f2 are all three 1 at the begin.
for some reason my word doens't allow text to be copied without copying an image, so here's what i came up with.
that paragraph destroyed my brain
lmao
basically i concluded that there couldn't be a deadlock because 1 thread acquires 1 lock, the other acquires 2 while the last lock will not acquire any locks as it must wait on the rest.
i mean, its hard to wrap your head around it in detail, but in a less detailed way it makes sense and sounds good
i see, thanks for the confirmation!
now add some apple cider
why
ye ip parsing is ez
I got
1 = 1.0.0.0
1.1 = 1.0.0.1
1.1.1 = 1.1.1.0
1.1.1.1 = 1.1.1.1
for ipv4
and ipv6 just the official ways
do u use regex
no
so you iterate character by character
kinda
I store it in uint8arrays (ipv4) and uint16arrays (ipv6) so regex wouldnt help at all
o nice
what 100mb problem
this
oh icic
im prob just gonna make a script that downloads a prebuilt binary
I can also move those off of github since I now have a dedi with proxmox
idk what to do about arm yet though
look at the example
cant you just use typescript's built in things?
yes
but its sometimes very annoying
like
as<{ ok: string }>(something).ok
;(something as { ok: string }).ok
you can also do this tho:
(<{ ok: string }>something).ok
typescript is weird
indeed
do u approve of this though tim
3 complex 5 me
cant really say much because idk the details of whats going on, but look good
then what is not complex for you
1 + 1 = 2
3 complex 5 me
:3
im working on a chrome extension for google meet
reminds me how much i dislike frontend
why
and what does that chrome extension do
ie, how much they talk on mic, on cam, emojis, texts
nope, they dont
the closest thing i found is this
but this only records time spent in meeting
it doesnt record what people do in it
they do, at least not publicly 
for my job we need to record how much our students actively participate in the classes, how much they talk, interact, etc
:^)

Why do you need guild presence intent?
does your bot need presences?
We need the 'guild presence' intent in our music bot to provide a better music experience to our users on the Discord server. With this intent, our bot can recognize which server is requesting music playback, ensure that only authorized server members can control playback, and provide finer control over the music experience tailored to user preferences within that server. This allows our music bot to provide better and more interactive entertainment within various Discord communities.
thats... not really a valid use case

you can get guild members and permissions WITHOUT the intent
you dont need presences for any of that
do you use presenceUpdate in your bot?
thats for other people, not your bot
why do you need other peoples statuses?
oh nvm, wrong ping, i thought he posted that not you lmao
how horrible will this run https://fs.rjns.de/v/JIWOksUcLsNieLTHuP
dedi without dedicated graphics card 💯
it wont start
some dedis have a simple integrated graphics card
I did think about getting a gpu dedi ngl
if your intention is to play, use sunshine/moonlight
and proxmox it
geforce now was built on top of them
I wanna see if it even loads
cloud gaming server/client
Moonlight allows you to play your PC games remotely on almost any device.
geforce now (the cloud gaming thing) uses this
it does work pretty well from the times I tested it, tho the network bandwidth does matter a lot
ohhh thats something selfhosted?
nvidia
kind of sounds like this will only work with nvidia graphics cards
works with amd too
also doesnt give me linux vibes 
well, geforce now runs on linux
but moonlight doesn't
i meant sunshine yeah
because moon reflects the sun's light 
no fucking way https://fs.rjns.de/v/ukzzvwVxWgyUdciYVT
I think the vm needs more ram
8gb is a bit tight
@earnest phoenix
Hm?
Good job
Congrats
Next step - discord verification
Does mariadb (mysql I guess) have an easier way to update all values besides like 3 for an "Enable all" type of command without having to specify each column?
Something like UPDATE * IN <thing> WHERE NOT something something something
Idm typing it all out if needed but I would think there could be a quicker way. It's like 15 things being changed to the same value which is just "1" since "0" is off.
It doesn't have a way to update all of them
Thanks for quick response. Typing it all out it is.
I mean, you could write an script to write the whole SQL transaction for you
await client.database(`UPDATE logs SET channel_Create = ?, channel_Delete = ?, channel_Pins_Update = ?, channel_Update = ?, guild_Ban_Add = ?, guild_Ban_Remove = ?, guild_Update = ?, member_Add = ?, member_Remove = ?, member_Update = ?, message_Delete = ?, message_Update = ?, role_Create = ?, role_Delete = ?, role_Update = ? WHERE guildid = ${interaction.guild.id}`, ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"], false)
I probably could instead of =? just do =1 thinking about it.
Just in case you need to do that in the future
It's only a "Disable all" and "Enable all" log command. Idm just typing it out since its only ever used twice.
Oh alright
But am I right about using =1 instead of =?
Yes you can do that, the database driver you're using only changes ?s to the values you provided in the second argument
Correct, its just what I am use too. The false at the end is just to tell my function to return it or not.
Like if I were to store it into a variable.
But thanks, I can cut some of it down then
You're welcome
any tips on how to make this more beautiful
i mean there's a LOT of text
and the image looks idk kinda strange in contrast to the text
split that text in two
put the second part with a different picture down below
and switch their sides
ie:
text1 pic1
pic2 text2
if it still feels like too much text, split it into 4
1 pic for each paragraph
always stiwching sides
shit looks ugly af
still too much text
also, try colder colors
a whiter gray backgound
There is something disturbing when the margin of the image does not match the margin of the text
also you have to balance the alignment of the text with the images
ye
for example
see how the text and the image is always aligned
hmm i see
a very easy way to do that is using flexbox
and here's the alternating design i mentioned
dont be afraid of spacing things too much
large spacing improves readability and makes things less overwhelming to look at
also try simplifying your text
yeah, i've been so busy with work i barely turn on my pc 😭
rip
how have you been
lots of work as well, not well paid tho xD
in IT? that is heresy
ah
im also in Portugal rn, in a sort of part time job arangement with a friend
helping them with their entrepreneurships
i'd love to do a project in my free time like that but honestly, turning my hobby into my job slowly killed my passion for programming
ikr
its rare for me to find motivation to do stuff
i only like working on very nieche stuff
which rarely comes by
xd
i see this is really cool
yeah, i've been dipping my toes into NLPs a bit since machine learning is still the unknown for me
same, i was at a google conference and listened to a speech from a guy who is actively working in the AI field, it was pretty cool and peeked my interest
needs more rounded corners
oh cool
lmao
working on this project renewed my hatred for frontend
i had someone else offer to do the UI for me
i let them
but i didnt like what they did
so i did it myself anyway
lmao
would this look any better
maybe bit of shadows on the image to make it pop a bit
i looked into the meet html, found all the things that change when stuff happens
set up a bunch of mutationObservers on them
so i get events when stuff changes on the html level
tbf this frontend shi is way too creative for me
much better ye
awesome thank you!
still a bit too much text
if you can split that text more would be better
and make the text a bit bigger
😵💫 basically the same process when you do scraping
ye
is the html hard to read
it was annoying af
could've guessed
its easy to find stuff via inspector
but there are very few usable anchor points
its all autogenerated ids and classes
that can change at any time
probably
so basically a lot of mutations
i had to do a lot of shit like this
navigating through parents and children
xD
lmfao
yeah
xpaths are a no go?
idk what those are lmao
i don't know the textbook definition but basically it represents the path to a html element via xml
weird
or something like that
im using querySelector on things that have something usable, then from there i just navigate
so you don't have to traverse the node tree, just slap the xpath into your query
/html/body/div[4]/div[2]/form/div[1]/div[1]/div[1]/a/img
i don't know if querySelector supports it though
yeah fair
the way i did it, i tried to find the things that are more unlikely to change
and go relative to that
for example for some parts i use querySelector to find an svg element
and get to the place where certain icons are shown
and from there navigate to the surrounding text
i hope so
but it remains to be seen xD
im pretty sure im fucked anyway if they decide to update anything
also, some stuff i didnt found a way to go around
for example if there are too many people in the call, the UI starts grouping them up into a block that says "and N more"
i cannot get camera status from anyone thats inside there
because its removed from the html
theres a lot of things that are dynamically added and removed
that calls for reverse engineering the JS and injecting your own 🙃 /s
yeah, it's heavily obfuscated and minified right?
yup
i looked at other extensions
and found they do basically the same thing, html scraping xD
lmfao
if you can't beat them join them
a lot of development is just copying each others ideas
ye
i got the idea of mutatinoObserver from them
i didnt even know mutationObserver was a thing
before i was running an interval and checking the state of everyting xd
get with the times old man, it's not the 2000s anymore we have ✨ reactive programming ✨
xDDDD
(i also dont know what mutationObserver is)
hahaha
which manifest ver is the extension on
ye i dont really know much
i know v3 blocks all third party scripts
so you cant use libs via cdn, you have to download and bundle
V3 forces extension developers to use a different system — referred to as the declarativeNetRequest API — in which extensions must create a blocklist of predetermined addresses to block. Why is that a problem? Because Manivest V3 only allows extensions to run 30,000 rules and most ad block extensions would need the capacity to run at least 300,000 rules to work effectively. In this context, a “rule” would be a mechanism that blocks a specific HTTP address.
doesn't affect you at least xd
ah
ye i dont use that api
but i did see it in the docs, a way to intercept network requests
is there a way to listen for the requests the web page makes? this is just a blind guess but if meet makes any API requests for meet participants, surely you could listen in on that
if it's over webrtc you can kiss that idea goodbye
ye
i cant see shit in the network tab
not even websocket
so im pretty sure its some obscure shit like wrtc and service workers
I did resolve the issue on my own but I wanted to know if anyone had an understanding as to why creating a message with the gif library can trigger the messageUpdate event even though it's not really updating anything but just creating the message? I have an assumption that it's because the gif doesn't fully load by the time the message is sent and when it does it's considered an update.
So my bot is supposed to watching another bot of mine to see if it goes offline. Instead its giving the wrong status and I don't know why, ive tried everything and I can't get it to work.
Code:
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => res.send('System Online'));
app.listen(port, () =>
console.log(`Your app is listening at http://localhost:${port}`)
);
const botToken = process.env['TOKEN'];
const targetBotId = '1159916872234455080'
const channelId = process.env['CHANNEL_ID'];
const pingUserId = '824650638532411392'; // Replace with the user's ID to ping
const { Client, IntentsBitField } = require('discord.js');
const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent
],
});
let lastStatus = null;
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
checkBotStatus();
setInterval(checkBotStatus, 5000); // Check every 5 seconds
});
async function checkBotStatus() {
try {
const targetBot = await client.user.fetch(targetBotId);
console.log(`${targetBot.presence.status}`)
if (targetBot && targetBot.presence.status !== 'online') {
// Bot is offline
if (lastStatus !== 'offline') {
// Send a message if the bot was online previously
const channel = client.channels.cache.get(channelId);
if (channel) {
channel.send(`<@${pingUserId}> Bot <@${targetBotId}> is offline.`);
}
lastStatus = 'offline';
}
} else {
// Bot is online
lastStatus = 'online';
}
} catch (error) {
console.error('Error fetching bot status:', error);
}
}
client.login(botToken); // Replace with your bot's token
wdym
When you declare a Client, you add the intents to which your bot has access
There is no intent responsible for the status of users
Which is presence intent
yes, this is according to the discord api, file uploads are considered message updates
the file is loaded asynchronously and then added to the message afterwards
Makes sense. I just ended up checking if the message content changes then do the log. Seemed to resolve it
How do I 'forget' a commit in git to remove the commit but keep the changes?
I want to switch branches and the commits with it
been workin in the wrong silly lil branch
made a backup*
thats why dont use branches, i push everything to main
:^)
i also test in prod :^)
real
time to grow some legs mate
its a bitch cuz vercel deploys from the prod branch
which in your case would also be main
guess git push origin main
that dont work lol
i dont use vercel so /shrug
xD
shame that /shrug is now a slash command, so it doesnt work in the middle of the message anymore
¯_(ツ)_/¯
revert to previous commit, keep left
then u rebase to remove the head
i followed some funny stackoverflow thingie
moved to branch main
rebase later after i confirmed everything works :3
GitHub > Discord webhooks seem to be dead for me
literally used them 2 minutes ago
working fine for me
type application/json?
weird
let me try in a diff guild
diff guild
same result
I did a funny express server test
And made gh send me a ping message to that
And I received it
maybe delete and recreate the webhook on the discord side?
i guess you already did that when you changed guilds
yup
How would one create a pull request on their own repository?
Wouldn't you have to push it somewhere? If yes, where would most devs do?
Make a branch, create merge request
Ignore pushing rules? 😅
Branch name such as?
Anything
Nightly, working, indev, unstable, etc
Is there any way to get the "position" of a row in postgres?
I mean hard to explain what I mean
But basically go through all users of serverId 1
Find the position of userId 5 in that
theres a ROW_NUMBER() function
but i think it generates numbers for the returned rows, rather than get some internal row id value
rowid is the physical location of the row. It has nothing to do with the order of insertion and cannot be used to identify the most recently inserted record. The closest equivalent in PostgreSQL would be the ctid. In Oracle the rownum is the position of the row in the result set, which can be emulated in PostgreSQL using the row_number() function
ok so what the fuck rq
this silly warning
telling that im being useless
however
if i remove that, my entire shit breaks
socket.io custom marshal and that little question mark is the bottom brick
A quantifier following a lookaround serves no purpose, and can safely be removed from the regex, I don't know how your stuff breaks without it
hi i've been rebasing my stuff but github likes to show This branch is 3 commits ahead, 3 commits behind main. which i resolve with resetting HEAD and force pushing
but what's the right way? what is the right way to make a pr, and merge in a way that This branch is 3 commits ahead, 3 commits behind main. doesn't show up?
Good job
last case scenario delete the branch and make a new branch/fork
one question, can you host a website in github if so how?
Why would you host a website on github?
just a simple website for public purposes
Using GitHub pages
vercel is free 
whats that?
looking it up rq
is it not vercel.app anymore?
yea
One major limitation I see in Vercel free tier is that you can't deploy from private organisation owned github repos
Doesn't it make the lookahead 0-1 instead?
Like, find if it's followed by that part, else find whatever matches without it
Nope
It has absolutely no effect
there is no socketio error
idk what it is
idk what is making it happen either
all i know is: no question mark: no worky
JSON parser in javascript with support for json objects that don't have quotation marks?
eval(`(${theJson})`);``` works ig but not really safe
Why would a json object not have quotation marks? That’s not a valid json?
they already said the solution
I use this myself, it's really nifty for user input
Would you call it a DDoS when:
- Nginx proxy is functional and quick
- Page content loads quickly
- Page websocket connects quickly (but isn't functioning as expected)
I mean DDoS is a denial of service attack so if anything is working properly then they failed
well a ddos attempt its still an attempt
i guess you would call it a "ddos attack"
Yea
what's no work
like what actually happened
the program crashes or something something
no idea
little monkeys that dont know anything about infrastructure keep saying it's a ddos

buy a nintendo switch and destroy it
'hack' it fr
is it called hacking when it's unprotected? 
🤯
i can see the router login page, but admin admin doesnt work
have u tried password123
these routers are preconfigured with a randomized login password
it comes written in their box
real.
then how would you know it didn't work?
oh
oops
thought u were talkin about something different
i knew that it didnt work, because group 1 from the regex was undefined
ok i just realized that a portion of the regex
is useless
goal was to get the numbers at the start of a string
/^\d+/gi
whatever i did was useless
fixed anyways
crazy stuff
who tf measures download speed in fps lmao
also, isnt that super inefficient since you need to decode the video chunks to identify frames?
well technically
you have internet frames
soo
A frame is a digital data transmission unit in computer networking and telecommunication. In packet switched systems, a frame is a simple container for a single network packet. In other telecommunications systems, a frame is a repeating structure supporting time-division multiplexing.
A frame typically includes frame synchronization features con...
literal fps
video
fps
ffmpeg fps
fps fps fps
i mean
that makes sense if youre measuring transcoding
which looks like what youre doing in that code
so its download plus transcoding
rah
just to see if it's doing anything
since most movies run around 30 fps
57 fps is kinda slow 
its typical transcoding speeds
if you only dowload the m3u8 files without ffmpeg its gonna be faster probably
that is definitely true
but concatting it
having all the file names in one cmd
eww
well, just auto generate file names, then join them in the script
you have all names in memory already
anyway streaming it like youre doing is probably better anyway
yea
hey
-threads <num>
fuckin hell
I think that works mate
jesus
2 hour movie downloaded in 30 sec
😭
its gonna run ffmpeg with threads
upgraded internet today anyways
silly 150 mbps o 1gig
ok that sounds a bit toi fast, verify the file if it works correcty
xd
lmao
it works just fine
- wintard 10
good old windows xp black edition
there are still some decent modded windowses out there
oh yeah
like ghost spectre's editions
silly performance win 11 editions
windowski leviosa
what could I even make as vote rewards
like I dont have a global economy so def not money
cat pic
You can extend some functionality with additional things if someone votes
I don't know what your bot does, but there will definitely be something like that, and if not, you have to think about it this way
Bc it was in queue?
ikr
its too long
god the brs are slacking again
🙄
6 hours is good time, in the past you had to wait 3-14 days for verification
Hey guys ,
Im wondering if its possible at all to create a bot that keeps a tally. Say if only a select few people has permission to add or subtract from this number with a simple command / add *amount or / minus *amount
Does something like this already exist I wonder
No but last time I verified it took 5 days, are not many bots being submitted anymore?
that, and also there are lots of brs now
nah mate
a month>
very possible & easy
is any one here able to help with a problem im having with my code?
neither me or my friend have been able to fix it
the attached image is the error
this is the code:
def __init__(self, ctx, channels):
super().__init__()
self.ctx = ctx
self.bot = bot
options = [
discord.SelectOption(label=channel.name, value=str(channel.id))
for channel in channels
]
print('1')
self.select = Select(options=options, placeholder="Select a channel")
self.select.callback = self.callback
self.add_item(self.select)
async def interaction_check(self, interaction):
print('2')
print(interaction.user,'\n',self.ctx.author)
print(interaction.user.id,'\n',self.ctx.author.id)
user1 = interaction.user.id
user2 = self.ctx.author.id
if user1 == user2:
print('yes')
return True
else:
print('no')
return False
async def callback(self, interaction: discord.Interaction):
print('4')
selected_channel_id = int(self.select.children[0].value)
selected_channel = bot.get_channel(selected_channel_id)
print('5')
response_message = f"You selected channel: {selected_channel.name} (ID: {selected_channel.id})"
await interaction.response.send_message(response_message, ephemeral=True)
print('heres the selected stuff -'+selected_channel_id,'-'+ selected_channel)
@bot.slash_command()
@blacklist()
async def lists(ctx):
guild = ctx.guild
channels = guild.channels
view = ChannelDropdown(ctx, channels)
await ctx.send("Select a channel:", view=view)
*im just trying to have a drop down menu to choose a channel for my bot to send messages on *
any help would be greatly appreciated (:
I may be wrong because I don't quite understand python, but what does for channel in channels do inside the options array?
And did you write this code?
i got a bit from examples and put it together with some other things to get what i was looking for
Okay, logically. Should channels be listed before or after adding them to options?
I'm also not entirely sure if it's possible to do a for loop inside an array, but someone who knows Python would have to comment on that
sorry probably should have included this earlier but, i have that much working just fine it sends the message in discord shows the channels in the list but once a channel has been selected it goes to the interaction_check which works fine and returns True when its supposed to. the line I think i am having a problem with is selected_channel_id = int(self.select.children[0].value) as 'select has no attribute channel'
maybe print out self.select to see if its what youre expecting it to be
tysm for helping :D
turns out the problem was self.select.children[0].value in selected_channel_id = int(self.select.children[0].value) the fix was changing it to self.select.value[0] this now works perfecly.
class FromJson a where
fromJson :: Json -> Maybe a
instance FromJson () where
fromJson JSNull = Just ()
romJson _ = Nothing
instance FromJson Bool where
fromJson (JSTrue) = Just True
fromJson (JSFalse) = Just False
fromJson _ = Nothing```
hey, in haskell why is this giving me an error that True, False and () are not compatible for a.
Isn't a used for polymorpishm... so that it can be used for multiple types?
Couldn't match expected type ‘a’ with actual type ‘Bool’
‘a’ is a rigid type variable bound by
the type signature for:
fromJson :: forall a. Json -> Maybe a
at Json.hs:80:1-27
• In the first argument of ‘Just’, namely ‘True’
await wb({
webhook: isCopyChannel,
data: {
content: message.message === "" ? "** **" : message.message,
username: user.username ?? user.firstName,
attachments: files,
},
});
its a function that sends webhook (data as it is)
{
name: "file.png",
attachment: Buffer.from(ImageBuffer)
}
]
the error is that its not sending image
which library?
im using axios to send webhook by url
nope it just sends data as data
module.exports = async (data = {}) => {
return axios({
method: "POST",
url: data.webhook,
headers: {
"Content-Type": "application/json",
},
data: JSON.stringify(data.data),
})
.then((e) => {
return e;
})
.catch((e) => e);
};
its a discord webhook btw
yeah so thats wrong
the content type must be multipart/formdata, not json
and you have to use a FormData builder
node should have it built in
this is how the raw request should look like:
--boundary
Content-Disposition: form-data; name="payload_json"
Content-Type: application/json
{
"content": "Hello, World!",
"embeds": [{
"title": "Hello, Embed!",
"description": "This is an embedded message.",
"thumbnail": {
"url": "attachment://myfilename.png"
},
"image": {
"url": "attachment://mygif.gif"
}
}],
"message_reference": {
"message_id": "233648473390448641"
},
"attachments": [{
"id": 0,
"description": "Image of a cute little cat",
"filename": "myfilename.png"
}, {
"id": 1,
"description": "Rickroll gif",
"filename": "mygif.gif"
}]
}
--boundary
Content-Disposition: form-data; name="files[0]"; filename="myfilename.png"
Content-Type: image/png
[image bytes]
--boundary
Content-Disposition: form-data; name="files[1]"; filename="mygif.gif"
Content-Type: image/gif
[image bytes]
--boundary--
the data type is multipart/formdata, then inside the formdata you have a payload_json which is the stringified json you're sending, then a files[n] containing the actual file content
inside the json, the attachments array does not contain any data, only a reference to the correct file id
like this:
"attachments": [{
"id": 0,
"description": "Image of a cute little cat",
"filename": "myfilename.png"
}]
How can I get git to delete a branch? I had a development branch that I merged with master, and then deleted the branch on GitHub. However, I cannot do git checkout-b development because it thinks that it still exists. I already tried git remote prune origin to no avail
Ah I did git branch -d development and it worked
bold question
does anything amazon try to force you to use more of their services?
such as amazon echo skills wanting you to use aws
Never had that issue
i don't think they do that
or its keeping me the fuck away from even trying to develop anything on their shit


