#development
1 messages · Page 66 of 1
a paid user is worth so much more than an ad supported user
There are also the trackers, that yt sells to partners for profile building
On the scale yt is on, that isn't feasible for maintaining themselves
why wont you work!
Well, then tell me why yt allows upload with no clear max limit
If it was hurting their pockets they wouldn't allow it
Cuz i don't want to
It has to be a very specific version string
daddy google pays for them
i keep trying others and it doesnt work
packet sniff loading up Discord on your device
Daddy google would ask them to charge their users if youtube was costing their pockets
Which returns to my original point
thats what theyre doing with 4k video
Never said anything abt 4k
im just saying
Yes, but that's an edge case
would this work?
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
]
});```
I was talking about hosting videos on youtube
4k are edge cases, they aren't nowhere near the majority of all videos
where's the try it and see video link when you need it
still broke
then theres your answer
like i dont get it https://hastebin.com/uqagaxibaw.typescript
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Show the error u got
my friend
Discord.Intents.resolve
i mainly use 32767
how?

im sorry i have never used Discord.Intents.resolve
Have you never used the require("discord.js").Intents class
huh
???!
im confused
Ok so, intents aren't a number
They're actually a bitfield value
woo i tried the intents from there still get the error
So, if u convert that number to binary, you'll get something akin to an array, but as a number
Each bit represents an intent
Ur number is probably outside their range
will
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })```
work?
ok it did but i got a bitfielf
Don't ask if something will work
try this
const client = new Client({ intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates
] }); client.login(config.client.token)```
still broke
whats the error
missing intents
What djs versuon?
enable the intents on discord dev panel
14.6
i did
show screenshot of the error
Did u save the file?
yes
seems you havent removed old code somewhere
because it works for me on 14.6
and make sure you are using the correct token
https://hastebin.com/fuheyibogi.typescript this is my code
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
{
"token": "token here"
}```
thats my config.json
your code says config.client.token, aka
{
"client": {
"token": "xyz"
}
}```
i removed my token
try this
https://hastebin.com/eyeteluner.js
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
GatewayIntentBits.Guilds etc. doesn’t exist
No
Either import GatewayIntentFlags or select the right properties
GatewayIntentBits.Flags.Guilds
For example
look at the screenshot
or GatewayIntentFlags.Guilds
well... looks like the static GatewayIntentFlags has been removed again, lol
guess I need to update my version then
It has been deprecated in v13
nope
the constant exists in v14
watch previous versions of v14
and got removed and renamed again
has been the same constant like permission flags https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/util/PermissionsBitField.js#L19
but not for the gatewayintentflags anymore
I love the non-existing consistency of djs
there u go
@pliant gorge
who needs backwards compat, right?
yeah for real
might make sense to ask you which version of djs that is?
new tc39 proposal for type annotations that are ignored by the runtime
"Hey, I already saw that one"
"What do you mean? It's brand new!"
- apple
steve jobs would be so pissed if he saw apple today
I would think so
Does anyone know if I can make a github action run when my package.json updates to a new version?
u can, just watch for the specific file (package.json in this case) commit action
What do you mean? We changed the screen size by a millimeter from the last one, its totally brand new!
true
14.6
You need to provide intents inside the client initialiser
This might help https://discordjs.guide/popular-topics/intents.html#privileged-intents
can't see any wrong, may remove the djs package completelly and reinstall the latest one#
any change to see the position of the own bot in the verification queue?
Ok guess have to wait 
1-2 weeks iirc
I am actually going insane, I transferred my api from pterodactyl to raw docker and it got 8x slower, what. both are docker but raw docker is slower, the only difference id know is that I assigned the raw container an internal ip. does anyone know how to fix this?
Slower, like processing time, or ping?
I dont know, webrequests are 8x slower
Diffrent hardware? Diffrent location?
nop
it just went from 100ms waiting time to 800ms, this is what I used to create my internal network that nginx reverse proxies:
docker network create Internal --driver=bridge --gateway=172.22.0.1 --subnet=172.22.0.0/16 --label=Internal
ok, confirmed its not the database ping, even for an html file it took 1.2sec
Ight so you know an object e.g { "a": 1, "b": 2 }
And you could do let { a } = object to get specific values
Would it be possible to do let {...} = object?
identifier expected hmm
Any other way to get a result that I'd want (Get 'variables' for all keys in an object)
why not just do
...```
I want to get a variable for all keys in an object
const {...} = {"a":1,"b":2} //Incorrect syntax but so you might understand what I want
a //1
b //2
not possible, you need to know the keys
damn, thanks tho.
speaking from experience lol
in any case, you are manually specifying that you want to use a and b in your code, so you already know the keys anyway
yeah I want to have auto-fill (the functionality that shows all variables & functions etc)
in your code editor?
built in feature of vsc
vsc has a built in interpreter, but you still have to put it in your code so vsc can find it and display it
some things it can automatically assume
others you need to help it
hey guys i have a question
Length operator+ (const Length& a, const Length& b)
{// Precondition:
assert (0 <= a.minutes && 0 <= a.seconds && a.seconds < 60 && 0 <= b.minutes && 0 <= b.seconds && b.seconds < 60) ;
/* Postcondition:
Result is the sum of a and b.
*/
// implement this function
int total_seconds = a.seconds + b.seconds;
int total_minutes = a.minutes + b.minutes;
while(total_seconds % 60 == 0){
total_seconds = total_seconds - 60;
total_minutes++;
}
Length sum = {total_seconds, total_minutes};
return sum;
}
```How would i ever call this function?
I mean, it doesn't even have a fucking name to call??
It’s an operator
It gets called when the operator is used on that class
Look up “c++ operator overloading”
It’ll have a million resources that explain it better than I can lol
owhhh operator overloading right? So if i use a + b it will automatically perform this function?
where a and b are Length variables?
Yes
How would i log the new values tho?
nvm i am stupide
Like in the above code ```c++
Length p1 = {1,2};
Length p2 = {5,6};
cout << p1 + p2; ; ```How would this not work if i want to see the output of sum that i am returning?
Because Length probably doesn’t have an ostream& operator<<
async function getBrowser() {
return new Promise(async (resolve, reject) => {
if (!session.browser) {
try {
const browser = await puppeteer.launch({
...puppeteerOptions,
});
resolve(browser);
session.browser = browser;
} catch (err) {
reject(err);
}
} else {
resolve(session.browser);
}
});
}```
This lovely code, just keep it here
Another piece of code making use of the code above
```js
return new Promise(async (resolve, reject) => {
const browser = await getBrowser();
});```
I don't see where I made await having no effect
well, await doesn't make much sense inside a promise
I'm guessing I can remove ... from ...puppeteerOptions too
use then instead
Yeah so that aint showin up
a
(above async function getBrowser())
I think that'd be better
oh wow what a surprise
How could I have it detect it as browserClass?
No, I mean, not like that
resolve the promise with puppeteer launch
then await it
async function getBrowser() {
return session.browser = await new Promise(async (resolve, reject) => {
if (!session.browser) {
try {
resolve(puppeteer.launch({
...puppeteerOptions,
}));
} catch (err) {
reject(err);
}
} else {
resolve(session.browser);
}
});
}
or just
Welcome to the world to coding ig
that way u dont need to use then
gon type it out for the "hand feels"
great start
/**
* Launch a puppeteer window with settings from config.json
* Returns the browser and sets session.browser to it
* @returns {Promise} Browser (Vanilla)
*/
async function getBrowser() {
return (session.browser = await new Promise(async (resolve, reject) => {
if (!session.browser) {
try {
resolve(
puppeteer.launch({
...puppeteerOptions,
})
);
} catch (err) {
reject(err);
}
} else {
resolve(session.browser);
}
}));
}```
thats still redundant
a function that returns a promise does not need to be async, nor do you need to await the promise
function getBrowser() {
return new Promise(...)
}
if puppeteer.launch returns a promise, you dont need to create a promise either
/**
* Launch a puppeteer window with settings from config.json
* Returns the browser and sets session.browser to it
* @returns {browserClass} Browser (Vanilla)
*/
function getBrowser() {
return (session.browser = new Promise(async (resolve, reject) => {
if (session.browser) return resolve(session.browser);
resolve(
puppeteer.launch({
...puppeteerOptions,
})
);
}));
}```
function getBrowser() {
if(session.browser) {
return Promise.resolve(session.browser);
}
return puppeteer.launch(puppeteerOptions).then(result => session.browser = result);
}
still
return new Promise(async (resolve, reject) => {
const browser = await getBrowser();
});```
return new Promise(async (resolve, reject) => {
const browser = getBrowser();
const page = await browser.newPage()
page.goto("google.com")
});```
return getBrowser().then(browser => browser.newpage()).then(page => page.goto("google.com"))
or make the containing function async
The function where this promise is in is planned to resolve on completion*
well I can't since I'm getting different errors now 😃
where do you return this promise to?
The function is supposed to be a task, it'd repeat itself continuously but only 1 task at a time
See it as a for loop with just 1 line of code in it
Shouldn't u use interval then?
Interval would start the "task" even if there is one active wouldn't it
Well, yes but u can just start the interval where you'd first call that function
Ayo tf
I would use this but I don't want to 😅
fun fact, some people prefer an infinite for over an infinite while because its shorter to write
while(true) vs for(;;)
for (;;) errored last time I tried to but now it doesn't 
exdee
I just use forever { ... }
didn't know
could be a parameter 
what lang is that
Groovy ofc
😒
f it, moving the code to check for the browser inside the functions where it would getBrowser()
lel
🖕 you dirty 1996 or whatever javascript devs
Anyone who writes for(;;) should be barred from programming
async function startLoop() {
while(true) {
const browser = await getBrowser();
const page = await browser.newPage();
await page.goto("google.com");
// optionally await some timeout to add a delay before the next loop
}
}
ostream& operator<< (ostream& out, Length& length)
{// Precondition:
/* Postcondition:
the value of length has been read from in: first minutes, then ':', then seconds
*/
out << length.minutes << ':' << length.seconds;
// implement this function
return out;
}
Length operator+ (const Length& a, const Length& b)
{// Precondition:
int total_seconds = a.seconds + b.seconds;
int total_minutes = a.minutes + b.minutes;
while(total_seconds % 60 == 0){
total_seconds = total_seconds - 60;
total_minutes++;
}
Length sum = {total_seconds, total_minutes};
return sum;
}
int main()
{
Length p1 = {44,55};
Length p2 = {4,1};
cout << p1 + p1;
return 0;
}
```I honestly have no idea why it is not outputting this shit?
let browser = new browserClass();
if (!session.browserCreated)
(browser = await puppeteer.launch({ ...puppeteerOptions })),
(session.browserCreated = true),
(session.browser = browser);```
shorten this 😉
(new browserClass() just so I can read off docs)
why do you do { ...puppeteerOptions } tho
i mean, sure, if you like duplicating the object every time

dafuq is that cursed if
> me trying to shorten it
Use brackets peps, brackets save lives
you a if () { or if ()\n{ guy
first one
Of the former
Ignore the Java dude
lol
First one unless it’s c#
Jokes on you, I force my formatter to use inline bracket
Time travel and point a gun to the head of one of the developers to change it
Idk, automatic formatting standard for C# is to have brackets on new lines
Right way
ew
In this house we believe in inline brackets, C# can move out if it wants newline brackets
You get used to seeing it
how about this
Pass the bleach already yk
if(...) return x;
if(...) { return x; }
if(...) {
return x;
}
if(...)
return x;
Nvm
Ew
Thought he was gonna put all of the brackets on the right side aligned 
chose your 1-line if style
i usually use 2 or 3
switch (...) {
...: return x;
...: return x;
...: return x;
...: return x;
}
winnie the pooh meme
thats not a 1-line if
exdee
It can be if you try hard enough
switch(...) {
case ...: return x;
}
... ? (return x) : null;
thats probably not even valid
lmao
Tf iOS seems to convert three dots to a special char …
eye os
my bot uses double dash for command arguments, and i had to add additional logic because a bunch of devices auto convert double dash to some form of long dash lol
Yeah mine does that, too
annoyiong
At least on iOS you can disable smart punctuation
But nobody does that or even know that
most people know nothing about their own devices
dont even know how to change ringtones
the amount of people using default ringtones is insane
Does anyone know the answer? It's about c++ operator overloading
switch (true) {
case ... ? true : false: return x
}
#include <iostream>
using namespace std;
struct Length
{
int minutes; // # minutes
int seconds; // # seconds
};
ostream& operator<< (ostream& out, Length& length)
{// Precondition:
/* Postcondition:
the value of length has been read from in: first minutes, then ':', then seconds
*/
out << length.minutes << ':' << length.seconds;
// implement this function
return out;
}
Length operator+ (const Length& a, const Length& b)
{// Precondition:
int total_seconds = a.seconds + b.seconds;
int total_minutes = a.minutes + b.minutes;
while(total_seconds % 60 == 0){
total_seconds = total_seconds - 60;
total_minutes++;
}
Length sum = {total_seconds, total_minutes};
return sum;
}
int main()
{
Length p1 = {44,55};
Length p2 = {4,1};
Length p3 = p1 + p2;
cout << p3;
return 0;
}
The problem was that there was no operator for the math in the cout statement. The solution was to create a new instance of the structure Length and then output the result of the operation.
Owhhh so p1 + p2 obviously returns a sum, we then need to copy it over to p3 to cout it?
Tf you change ringtones on smartphones

mhm
i like groovy operator overriding
u can return something completely unrelated to the containing class
yup.
madness
why would you hardcode that
"because I can"
lmao
<option value="2022">2022</option><option value="2021">2021</option><option value="2020">2020</option><option value="2019">2019</option><option value="2018">2018</option><option value="2017">2017</option><option value="2016">2016</option><option value="2015">2015</option><option value="2014">2014</option><option value="2013">2013</option><option value="2012">2012</option><option value="2011">2011</option><option value="2010">2010</option><option value="2009">2009</option><option value="2008">2008</option><option value="2007">2007</option><option value="2006">2006</option><option value="2005">2005</option><option value="2004">2004</option><option value="2003">2003</option><option value="2002">2002</option><option value="2001">2001</option><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option><option value="1923">1923</option>``` somebody help me out 😉
yeah nah def not going to do that shit
Guy never heard of loops
I have lol
html select menus are bs
Should add a few more options for people over 100 
how about remove the html and replace it with js
dynamic element loading, switching and deleting
How about text input
😃
min/max length 4
input of type number
had min < max instead of min > max
since years
slay.
huehuehue
Hey guys, i had another quick question. The ostream basically contains all output streams right? From ofstreams, to couts. However, how would i switch through them in a function? c++ void Function(ostream& os){ ostream << "test"; }Like, would this even work?
not js im out
Yeah that would work technically
If you want an example of how to overload the << operator for cout I can show you an example
What would i pass as the parameter?
shameless plug
Owh that's okay i've covered that already!
A reference to an ostream
For example, std::cout is an ostream object
i see. I don't understand the questioning of my assignment
The ostream& parameter specifies where the track should be printed to. This could be to
the console by providing cout, but also to a file or string stream.
I never understand what the fuck they expet from me
ostream is just an object with some methods on it. std::cout is the standard output of C++, but there's other ostreams like std::cerr for standard error, and you can create your own output streams to files and other sources
This works.
The operator<< is overloaded for ostreams.
I see, thanks guys. Really helping me through c++!
It's a confusing language in all fairness
There's lots of ways to do things in C++ but many are outdated and only exist for legacy compatibility
Glad you're learning the newer stuff 🙂
Yeah exactly, props to my uni i guess whahaha
if(lt.showArtist){
os << track.artist;
}
if(lt.showYear){
os << track.year;
}
if(lt.showTrack){
os << track.track;
}
if(lt.showTitle){
os << track.title;
}
if(lt.showTags){
os << track.tags;
}
if(lt.showLength){
os << track.time;
}
if(lt.showCountry){
os << track.country;
}
if(lt.showArtist){
os << track.artist;
}
```would there be no efficienter way of doing this?
I am basically checking each value of the lt struct and if the value is true log it
I mean, you could use a bitset for the booleans but I can't think of a better way to do it without it being overly complex
Ah i see, keeping it simple then!
struct Length {
int minutes;
int seconds;
};
struct Track
{
string artist; // name of artist
string cd; // cd title
int year; // year of appearance (if known)
int track; // track number
string title; // track title
string tags; // tags
Length time; // playing time
string country; // main countr(y/ies) of artist
};
```Another little question, as you can see i now have a length structure inside a track structure
Would i now have to use Track.Length.time and then access either seconds or minutes?
No
Length is the type of the field
Not the name
It would be <Track>.time then access mins or secs
how do i remove a webhook url and not replace? because i want to move my bot to vs and not repl so webhooks wont work
You can't
The site is just horrible to use non offensive words
For example, yeah
Doesn't really matter, I guess it still tries to send a webhook to the url anyways
ok thanks
Working with vanilla puppeteer rn.
I have an iframe and there's another iframe in that one.
I need to access the second one
(Code to get the first iframe)
await page.waitForSelector("#fc-iframe-wrap");
let upper_iframe = await page.$("#fc-iframe-wrap");
if (!upper_iframe) return reject("iframe_invalid_0");
upper_iframe = await upper_iframe.contentFrame();
await wait(1500);```
(Code to get the second iframe)
```js
await upper_iframe.waitForSelector("#CaptchaFrame")
let iframe = await upper_iframe.$("#CaptchaFrame");
if (!iframe) return reject("iframe_invalid_1");
iframe = await iframe.contentFrame();
await wait(1500);```
I have **f**ile**s**ystem write a html file with the contents of the first iframe, the second iframe's content is empty
I'm launching with js args: ["--disable-web-security", "--disable-features=IsolateOrigins,site-per-process", "--no-sandbox", "--disable-setuid-sandbox"],
an iframe within an iframe? dafuq is this, inception?
Roblox 
you need to access the iframe execution context
and run a querySelector in there
Well creating the command object is probably the easiest part of application commands tbh
How to deal with em using the appropriate event, how to get the options, how to respond accordingly is mostly what people struggle with
At least I feel like that's the most common reason we see here
what about for just overall organization, viewing all the commands, deleting them, etc
Sure... nice I guess for people who wanna visualize it
Yeah i guess, i just know i had to delete a few commands and i was thinking if there was something like this, would be way easier.
less tedious i guess
So I guess you're aiming to create a package that fetches the commands and shows em
At least that's what would make sense if you wanna do it
prob gonna be open source then just host a website where people can do it if they dont feel like running locally
maybe a package i guess
Small webserver, passing the client to your package, then let the user add/edit/delete commands
In the browser
essentially, yes.
Not a bad idea tho
i mean, even if no one uses it, i will, haha

I mean your code should actually handle all of that automatically tbh if you aim to do it efficiently
Your command handler and modules should automatically add/edit/remove commands at least once on a startup
And your entire structure should be meant to build like to support that
But yeah
Right, I agree. In my older bots, I don't add the commands via the code. I manually add them with POST calls, lol, which I bet you other people are also doing, so this would be a nice improvement.
Especially for my bot with 62 commands lol
um my slash commands for some reason are me and not my bot
Uhm, errr...no, we add through code
it used to show the app but now if the app dies is shows yourself
Ur the first person I see to do raw post requests to add em
I don't manually add anything...
The command handler fetches the app commands, loads the local command files and add/edit/removes app commands on a startup automatically as well as handles the command module execution
i do with my new bots, cba to add them all to older bots
Looks like an issue of your modded client
The default client doesn't have that issue
Ask discord why that's happening 
i only changed the css
what
Thank you for submitting your request. Within 24h we will respond with the appropriate code for free, to implement it into your code (ready to use).
hmmm
a sensible conclusion we can draw here is that users who use the app directory are more likely to use slash commands
a week ago it was about 50/50 app command vs message command
now it's 75% slash commands
that makes sense though
cause you're literally advertising slash commands via the app directory
Somehow also like the fact you can mention slash commands now like anywhere
Which makes things even easier and faster especially on mobile
yeah
yea true </this:1> is super neat
If only.. if only we could get a few more related features instead of badges 
Wait 24 H
One message removed from a suspended account.
pretty sure theres a setting you have to change to specify that this is the bot's support server
and thats how it filters
if you already did that, then wait I guess
Hey guys
almost done with my c++ project
I get these warnings
how would i solve them?
Owh actually i can try to static cast it to an integer
how would i do something like this in v14? ```java
require('dotenv').config()
const { Client, Intents, MessageAttachment, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds,] });
client.once('ready', () => {
client.api.applications(client.user.id).commands.post({data: {
name: 'image',
description: 'sends an image'
}})
});
client.login(process.env.TOKEN)```
I don't think its recommended to post your commands every time your client is ready.
A registration is a one time process, yes
Djs's guide doesnt cover it due to that reason, but you can infer how to do it from here.
https://discordjs.guide/creating-your-bot/command-deployment.html#registering-slash-commands
That guide is absolutely bullshit
ABSOLUTELY BULLSHIT
For real
yeah ^_^ but its easy to recommend.
No it's absolutely nothing you should recommend
There are inbuilt methods
Also this guide doesn't specify exactly it's a one time registration process
It's just stupid bullshit
That crap really makes me angry
👀 I noticed
lemao
Saw something on stackoverflow, var rand = myArray[(Math.random() * myArray.length) | 0]
Can somebody link me the "definition" of |?
Also any tips on this? (Beside the fact I'm hardcoding the arrays)
The indexes always include a 4 somewhere
Example on how it'd be used?
like any OR
the only difference between | and || is that the latter will stop at the first TRUE condition
unless u use it for bitwise, but that's another matter entirely
(And | is a bitwise op)
Yeah
Take two numbers, like 5 and 3,
5 in binary is 101
3 in binary is 011
Doing 5 | 3 will result in the bits
111 and therefore 6
Because the result will be each binary place ORed with the other, if one or more of them is a 1, then the result is 1
no need to worry abt it if u don't have a genuine use-case
else u might introduce unseen bugs from trying to "techyfy" ur code
Generally speaking there are not too many reasons to use it
ye, it's very niche
(Permissions and bitflags are very useful though)
as a non-SC OR I mean
bitwise is bae
You can look at this and know what it's for and by looking at my activity you can see what it's for.
You can probably tell that there can be duplicates (same row & column gets set twice)
What would be the best way to place a customizable amount of 💎's in the rowsFinished array?
mongi bongi
wdym?
seems unnecessary
theres a way to push into it i just dont know what it is
what exactly is { id: 1}
the user id?
oh ok that makes sense actually
adding | 0 has no effect really
im still unsure of what it does
this doesnt make sense either
what do the subjects have anything to do with anything else
its just another array
this is confusing
https://github.com/LIPDProductionsInc/Redwood_Automation/blob/main/cogs/redwood-automation-context.py#L7-L44
Is there a way to get the option variable in Line 20 passed on down to either Line 35 or Line 39? Or any examples that do something similar?
So far, everything I have tried (self.option, global option, self.shared) have all came up with the same AttributeError: Object has no attribute 'option'
fuck mongo
piece of shit
i genuinely cant mentally handle this
fucker thinks something exists inside an empty collection
like fuck off
if anyones experienced with mongo and is willing to deal with my fuckery please let me know
im actually struggling with this
👀 I dont know mongo but I helped someone with it today
it actually has me
beyond upset
im looking at an empty collection and it has the audacity to tell me something is there that isnt
what happens if you delete the document
This is what I have now: https://mystb.in/FinestCopyrightsComplicated
There’s a lot of grammatical errors just saying
I'll fix those. I'm not a native English speaker
I figured, no worries
I fixed some issues, other that then it's ok right?
Can anyone plz explain me how to use this api to generate anime images?
Because I can't understand the docs. Plz!!
Weeb.sh is a service for bot developers that wants to simplify the development and continued hosting of difficult features
you need to request for access
and your bot have to be in at least 1k servers
oh, interesting. they have sign ups now
this was the response I got three years ago
whih one is tim
@quartz kindle tim i was redirected by mac to ask you how tf to post an slash command to the api
cuz i did kinda do something
are you trying to go for the active developer badge
of course i am
Everyone trying to get the active dev badge
cuz why not
Everyone try to Developing bot is good right?
Can anyone tell me that is it correct to use this intent-
const client = new Client({ intents: 65535});
I mean is the number correct?
plz tell!
Try it and see, you didn't even say what intent you want so how are we supposed to know if that's the right number. Use the documentation as well:
surely
indeed
I never said it wasn't :D
honestly the more people that develop, the more people I can skid from. joke
i feel like the purpose is good but the approach is incorrect
This
Most people literally would never look back at the bot
they just want the super cool new badge
Most people aren’t even gonna look at the code and follow a YouTube video
Fr
When i run my bot, it says Started refreshing application (/) commands
Successfully reloaded application (/) commands
But it doesn't say bot is online and my bot also don't come online.
Plz help!!
Show code
Worthy to note, not all slash apps are bots
Perhaps the code u cloned is a botless app
In which case it doesn't need to be online
Can setTimeout's take up a lot of hardware when there are e.g 10,000 of them?
I see no use for using setTimeout 10000 times
According to https://stackoverflow.com/questions/19578446/does-settimeout-affects-performance it does not as long as I make a callback for all of them timeouts (small callbacks)
e.g "Pending balance"
Could just check every 5 minutes (What I have done before but I want to try something else out
)
Hello

👀 in what context?
pending balance you only really need to check if the user checks it right?
how do you run a .exe file for js
you want to run an exe from your js code?
Or make an exe from your code?
Diff question before I continue on this
In what cases can invite rewards be allowed on Discord?
Cause I'm planning on doing e.g every invite 1k bot cash
tbh, that's more of a question for discord.
discords not super clear on it
(child process).spawn('"(exe location"')
should do it
i put that in the index file?
Well you cant copy paste what I typed (syntax error 😒)
Every invite = 1k bot cash
That bot cash is pending for .. many days
If the person that got invited left before .. many days it'd remove that 1k from the pending
cant you just use events for that?
Well there aren't a good amount of events I can use
Really just 3
- Member Join
- Member Leave
- "/balance" ran
And I don't want to use the last one since it'd have to get an object from my db, iterate over it and change things (before the balance is shown)
most invite trackers on any bot of decent scale use events.
I do use the GuildMemberAdded events
Pending balance isn't common on most invite trackers
Ideally, you'd be calculating it based on stats you have stored in the database at the time the command is run.
Which should be faster than creating thousands of timers and would scale way better too.

Balance is checked in more commands/features so I rather check the pends every 5 minutes lol
Could someone help me write a JSON file?
hi
Just use double quotes for keys and values and don't add trailing commas anywhere
And you should be fine
And for something like this?
I know
or raw data
I'm asking how do I get it grouped like "current", "minutely", etc...
It looks like an array inside the object
Just click raw data and you can see the structure
it be a lot of data with tiny, non-colored words...
{
...,
"minutely": [...],
"hourly": [...],
...
}
K
The entire structure is literally just an object
Just use double quotes for keys and values and don't add trailing commas anywhere
i got a prototype up.. idk if itll be used, but im definitely gonna use it. if you wanna check it out, https://discordcmds.com
Discord Command Manager gives you a visual of all of your application's commands and allows you to add new commands and delete commands with ease!
Now, I'm trying to figure out how to read in Python. I want to use aiohttp.ClientSession since I'm most familiar with it
ello, i try to avoid using this channel as much as possible but fetching user from vote id is putting me in a chokehold 
javascript, djs v14 ;
my webhook server & voting works perfectly, however i cannot fetch the user who voted so the bot can message them. i’ve tried:
const user = await client.users.fetch(vote.user)
&
const user = await client.users.send(${vote.user}, “message here”) as per v14 docs to dm a specific user
each time, i get cannot read properties of undefined (reading ‘fetch’) but i’m not sure how to resolve as i’ve done what i know and have exhausted every web resource i have 
client is defined btw ^
Imagine i have a basic message collector and a setTimeout in a while loop, would it initialize the next loop before finishing the timeout?
yes
is the client actually logged in?
yes
i wait for all shards to come up -> send test vote -> get type err
i know i’m getting the vote user because console.log(vote.user) properly gives the ID
Owh that's fucked up
how can i make sure my while loop only runs when the timeouts are done etc
So interesting, client.users shouldn't be undefined. 🤔
Personally, I would console.log(client) inside the vote event just to double check.
i logged this on top of my while loop
and it didn't exeute any code
it only was looping till my console.log("yes")
the while loop is probably blocking the thousands of timers
👀 what are you trying to do?
I'm getting XY vibes
xy?
Asking about your attempted solution rather than your actual problem
where a user can react to a button, and it will then perform a timeout and return a certain result
I can bin a the part of the code with the while loop
why do you need a while loop for that?
It's a soccer game, it must rerun the game till someone wins
gives my client information, but just realized it’s logging in every shard 
So this is what i have (for only the sudden death part): https://hatebin.com/llwdjqbqjy
I am basically trying to rerun the code in the while loop AFTER the previous loop is completely wrapped up (so all timeouts and collectors)
Couldn't you just use a single interval?
Or maybe even no timer/interval at all.
Looks like you have events for when a round ends.
collector#.on("end")
^ this should accurately tell you when a round ends/starts.
hmm yeah
so if i use a collector it won't intervene the while?
You shouldn't need a while at all
why wouldn't i>?
Because i want to keep on performing that code till one of the users wins
You should have a callback to start it again, unless someone wins.
Theres no need for a while loop at all
You can check for a win condition in the end event.
If someone won, execute a function to finish the game, otherwise run it again.
any reason why client.shard.ids[0] would return ‘cannot read properties of null (reading ‘ids’)?
i have a feeling client isn’t being passed through properly 
shard is null
We haven’t been shown any other code though so can’t tell you what’s wrong for sure
one sec sorry
Lovely Number('0') or parseInt('0') comes out as NaN
That’s just not true
alright it does come out as 0
in index.js
but 0 == false
Yes
"How not"
Because 0 is a falsey value
webserver is just vote webhook which works but since im sharding i have to listen on one
function setCountdownContent(int) {
const array = `${int.toLocaleString()}`.split("").filter((f) => f != "");
container.innerHTML = "";
for (const string of array) {
const el = document.createElement("div");
el.innerText = string;
console.log(string, typeof string, Number(string))
if (Number(string)) {
el.setAttribute("class", "outer");
} else {
el.setAttribute("class", "inner");
}
container.appendChild(el);
}
}
setCountdownContent(50000);```
Use === if you want strict comparison
yeah in the way I'm doing it it aint work like that
f tabs
if (Number('0')) {} else {falsey}
parseInt(string) !== nan?
nopus
Then parse it and save it to a variable
but 0 is a number but falsey
Then check if that isn’t NaN
nah normal characters are not nan somehow
hold on
console.log(string, typeof string, Number(string));
el.setAttribute("class", "inner");
console.log(string, "nan")```
That console.log doesn't fire
yeah no it's doing some weird shit
Number() does the same (for result)
It returns null if it fails
I'm working in a no-cache expirement*
Check if it’s null
I'm using Number()
Strip the number of its commas first
what would be the best way to check/send the vote info to only one shard? since the below doesn't work anymore (haven't touched this code since pre v12)
string.replace(",", "")
*.replaceAll
really lovely undocumented function
no
It’s not undocumented
Not eslinted*
replace(",", "") only replaces the first occurrence of a , iirc
Fact
if it doesn't work then you can use a regex, like .replace(/,/g, '')
What would the appropriate way to fix certain characters showing in Discord text like so https://scs.twilightgamez.net/d9weQ.png
js btw
Pro tip: the internet has documentation for basically everything in the javascript stdlib
If your editor doesn’t pick it up then you can search for it online
I don't know the word but this
Not documented in that way
It is, it’s probably just bugging out or an older version or something
parse it
Just look it up
or I could've just done this
like .replace(/&#(\d+)/g, (_, n) => String.fromCodePoint(Number(n)))
ah yes, the classic unreadable condition
I'll see what I can do. Thank you. 🙂
though you can use parsers online
"it works"
It's just grabbing a song title via MariaDB and throwing it into the embed.
Technical debt
https://scs.twilightgamez.net/OUXWh.png seems some of the songs are stored that way so it was probably the api as you said ya.
bec that's my db
you can tell the 039 one is a '
you can use libraries like
assuming you have experience with this lib. Could I use decode on the entire string or does it specifically have to be the characters themselves
I could try obviously. Figured it would be faster than me coding it first.
i'm sure you can
Cool. I'll give it a try. Thanks for helping.
no prob, glad to help!
https://scs.twilightgamez.net/hMVHy.png ya that did the trick ty.

People still making music bots sadge
Uh what’s the issue? Is it cause it’s not inserting or is something else the problem
i figured it out, took a braincell and a half tho and help of voltrex
not only is warned not a boolean there were a bunch of other things wrong with this
Obviously warned is not a Boolean it’s going to be null it whatever it found
hi
can i have your font thanks
A lot of music bots being made are garbage and just bank off of third party software
ffmpeg being the go to
performance graph of said music bots over time: 📉
discord.js + express + react + command framework bots be like
memory usage: yes
cpu usage: yes
user experience: no
buy bigger and badder VPS' 
I wish stuff that has cool and lightweight tech behind it exists more often
I used to be literally crying how discord.js' import size made my bot's memory usage double (not logged in yet)
I still work on my music bot and put in probably too much r&d trying to remake LavaLink in my native language of js
I mean, it works, but it still uses ffmpeg for audio processing or converting to opus from an unknown format. No native solutions available yet. Although I can feel myself getting exhausted trying to vertically integrate myself as nothing comparable exists yet
performance being my main target nobody can seem to provide
now i see why you were trying to learn how opus works and even try to make use of node.js' C++ addons
so I have an application in docker, it was running fine until right now where it randomly couldnt connect to postgres with ssl anymore, this is the relevant part of the error:
code: 'ERR_TLS_CERT_ALTNAME_INVALID'
postgres is running and when running the app outside docker it works too
youre sounding like me lmao
if you're going for performance use Rust because it's blazingly fast!!!!11111 🚀💪🔥
minecraft regular 
I am insane enough
Yeah except you know how to fuck with node internals
How can I end the discordjsopus stream?
discordjsopus steam will stop when user stops speaking
@solemn latch can you help me pls ?
with?
My bot is in your site but not in the server why ?
just rewrite your bot in dpp at this point
we dont invite bots here
Discord has a cap of 50 bots, we have thousands
ok sorry for the inconvenience ^^
👀 this is cool
https://i.imgur.com/9HVuhzC.png
https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
webhooks can create threads
cool
By discordjsopus do you mean @discordjs/opus?
yes
How to leave beta test in discord
What exactly is the value of the audioStream variable there?
On what operating system?
i genuinely cant figure out how to get vsc's font to actually change correctly
You're still using discord.js v13?
file -> preferences -> settings -> under commonly used is editor font family -> don’t delete everything, just arrow to the beginning, type “Minecraft Regular,” w/o quotes or whatever font you downloaded -> restart vsc
v12
Um why?
this project has been standing for a long time and I was using v12 at that time
Then update it, shouldn't take much time
restart and use v14. iirc v12 has some broken api stuff
ok but is there no way to destroy the opus stream?
v12 will keep crashing because it doesn't know how to handle newer API responses
doesnt opus have a destroy function
Anyway, I'll switch to v14 and try again.
thats youre best bet
due to a function i use, i am creating 3 stream (not at the same time, but in a row) so it has to destroy it after one is finished.
sorry if not understood i use translator
Remember that you'll also have to use @discordjs/voice as voice support is moved out of discord.js itself
yes it occurred to me i will use it to join the audio channel
Android
Go to play store, scroll a bit and leave the beta program
You just have to open the Google Play Store, search for Discord and tap on it, and then just tap on the "Leave beta" button
Then either uninstall and reinstall after some time or wait for a stable update
So you already left the beta program on the Google Play Store?
Yes
Does it say "Join the beta" or does it say it's still leaving it?
Join the beta
Then uninstall Discord, and reinstall it from the Google Play Store, it should provide a build with the "Release Channel" of "googleRelease"
I reinstalled
It's says
You probably reinstalled it when it was still trying to leave the beta program
Can be
Try it now
Your bot needs global slash commands
That worked
Are you on pc?
When we will be able to seed "active developer" badge on Android?
Dec.?
In early December

You know how to fix "signal 9 (process completed)" problem in termux?
While hosting os with vnc player?
Termux doesn't work properly with Android 12 and higher due to their auto process cleaning services
just to add, "signal X (something)" isn't a problem, it's a termination code
wow
Well its just a problem in my case, as I don't want it to be completed
There's nothing you can do other than running commands over ADB/root to disable the phantom process killer
https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md
This repository provides documentation for random stuff related to the Android operating system. - Android-Docs/phantom-cached-and-empty-processes.md at master · agnostic-apollo/Android-Docs
Root? Samsung?
It's not hard to root Samsung phones, all you need is Magisk; although I wouldn't recommend rooting just for this
What if I can just local host gui and access with browser
any python coder ?
Just ask your question
how can i change my bot server count with request by jsk
Ideally you'd use a task and not use jsk at all
Make a normal POST request to the API endpoint
No need of jsk for that
for shards?
but i want to try with jsk
You should not do that
using req
tasks are made for that
oh ok 
so can code example how to make task and send post request to the API endpoint
It's a simple POST request
There are countless examples on Google or similar you can search for and find example code
Can I have help how to create a bot because when I do it sends to me the external safety and it’s saying Bake a cake, Paint a Tree, Microwave Kombucha, Solve a mystery with Scooby doo, Read a bedtime story how do I do those thighs or get pass those things?
Can I have some help?
lmfao

that'll utterly destroy your log btw
sorry
your stream event prints whenever someone starts and stops talking
but those stuff fire waaaay too often
in a few hours, you might get a gigabyte-sized log file
plus the performance usage from writing to the file/logging constantly
still, people often stop talking for a few ms
if i can create stream of course 😃
which will fire the event again
I can not I can't start stream about voice receiver
I still haven't been able to properly start and record audio
interesting question.
ive got an array mapped like this
const newArr=await memm.guild.infractions[mem.user.id].map(x => ({name: `${ x.type||"N/A" }`, value: `Reason: ${ x.reason }\nTime: <t:${ x.time }:f>`, inline: false})).slice(0, 10)
every third object want to set inline to true. how would i achieve this?
This website uses biscuits to improve your experience 🍵
map gives you other arguments besides the current item
for example the current item's index
which you can use % 3 on
for example ```js
.map((item, index) => index % 3 === 2 ? "third" : "not third")
in your case it would be simply inline: index % 3 === 2
since when? i thought that feature was never implemented
wasn't it just a request from a discord staff
Since slash commands got released.
I think you can invite more than 50, but no interactions will be created.
oh ic
This website uses biscuits to improve our ads i mean your experience

:biscuit:
🍪
this is literally anti-British
I prefer the term "baked bread-sugar mixture with choco chips"
how can i create stream in @Discordjs/voice and write in a pcm file
So you call these things "Chips"? Instead of Crispity Cruncy Munchie Crackerjack Snacker Nibbler Snap Crack N Pop Westpoolchestershireshire Queen's Lovely Jubily Delight?
that's a rather bit cringe innit bruv?
oh surely bruv, that be the proper definition eh?
naturally
This application will take advantage of your Crispity Crunchy Munchie Crackerjack Snacker Nibbler Snap Crack N Pop to analyze logic patterns and make operations smoother
No memes in development
No otters in development
Shut up

public void Movement(InputAction.CallbackContext context)
{
if (context.performed)
{
switch (context.control.name)
{
case "w":
Debug.Log("I am moving forward");
Player.velocity = new Vector3(1,0,0) * Speed * Time.deltaTime;
break;
case "a":
Debug.Log("I am moving left");
Player.velocity = new Vector3(0, 0, -1) * Speed * Time.deltaTime;
break;
case "s":
Debug.Log("I am moving backward");
Player.velocity = new Vector3(-1, 0, 0) * Speed * Time.deltaTime;
break;
case "d":
Debug.Log("I am moving right");
Player.velocity = new Vector3(0, 0, 1) * Speed * Time.deltaTime;
break;
}
}
}
Why my code no work
@earnest phoenix help
now
You get no errors
In what way does it not work though?
Nothing changes
The velocity literally changes for a split second and goes back to 0
Doesn't even matter if I hold it down
Maybe you're setting it back to 0 in some update method?
// Update is called once per frame
void Update()
{
}
}
Nope
Ignore the curly bracket at the end
end of the class def
Is this Unity or something?
Maybe your Unity version has something to do with it?
I am using the LTS
Same one everyone else uses
Looks like unity scripting aint for me
I think it's better to ask in their official support server
discord.gg/unity
Funny you say this I asked in there no one responded
Thrice
Damn
how to create stream for specific user and write to pcm file
discordjs/voice
not working
Is there a way to make my bot's long description scale with screen size? Looks normal on pc and looks like this on mobile
it is with proper CSS yeah
210~ ping is ok?
depends on the context
for league of legends its horrible
for a website its very good
tarzan mfs running lol in the jungle with 340ms ping
lmao
use cosine to calculate player vector
else u get the strafe issue
use cousine to calculate player food, else you get starvation
lul
but really, if u use simple coodinate addition players can simply exploit that to move faster by walking in diagonals
that's uhh...why doom/quake/hl1 speedrunners move so fast
Look up some game physics tutorials, there’s a mathematical way to do that properly
Generally speaking I would avoid trig at all costs
I want a code. When a person votes, he receives a private message telling him “thank you.” I want the code to be Discord.js
that's not how it works
we don't "give code", we just point you to the correct direction
in which case you need to use top.gg webhooks to listen to voting events
cc #topgg-api
Hello
check your dms
Doin' some nice lovely Discord.js@14.0.3 work and for some fun and lovely reason it loves to ignore the last permission overwrite!
Can you run more then one bot on vs code on a computer at a time?
Yes just open again
or login multiple bots in the same code
I NEED A BOT THAT CAN KICK PEOPLE WITH A CERTAIN ROLE
for some reason this is not adding the command did i do this wrong? ```java
const { SlashCommandBuilder } = require('@discordjs/builders');
console.log("NodeJS Version: " + process.version)
require('dotenv').config()
const { Client, Intents, MessageAttachment, GatewayIntentBits, ActivityType } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once('ready', () => {
client.user.setPresence({
activities: [{ name: Adding commands..., type: ActivityType.Playing }],
status: 'online',
});
var guildCommand = new SlashCommandBuilder();
guildCommand.setName('ping')
guildCommand.setDescription('The uptime and other information about the bot.')
console.log("New slash command has been made!!!")
});
client.login('...')```
Yes, you aren't registering the command.
Your constructor SlashCommandBuilder will just create the command structure for u
oh what do i need to add (i was copying code from my other bot and must have deleted the part)




