#development
1 messages · Page 87 of 1
the main thing you have to think about is "if i run my app twice, and split the load evenly between the two, will it still work correctly?"
sure, you can also do that
but at some point, one of those microarchitecture components will require horizontal scaling
that is a very importain step too, I think the both apps are working seperated, so they won't have issue
so you will also have to answer the same question
but should I build a microarchitecture from beginning, or I should just build a normal app?
if you think your app will grow that much, you can start with microarchitecture from the beginning, otherwise dont bother
its simpler to just make your app horizontally scalable
Well I think, if you build an app that uses microarchitecture, it would be good + in your cv :>
i guess
how would that work?
ahh
lets say your app does a lot of things, involving routing, database read/write, authentication, and such
but I still don't know, if you can host 2 different app that uses the same url
a microarchitecture design would have different processes handle different things, but that also means lots of data being send across your internal network, which also introduces a strain
a "normal" design would have all of those things happen inside the same process, receive request, access db, authenticate, write something, respond
yes, that is correct
a horizontal scalable model would do exactly the same thing, but in a way that if you run that same process multiple times, it will still work
"if you run that same process multiple times, it will still work", what do you mean by that?
like having 2 auth microservice? and it will still work?
having 2 "normal" designed processes
they have the same function
but do not interfere with each other, and both work standalone
thats basically what you need if you want to use kubernetes in the future for example
oh, yeah makes sense
so you can add/remove processes according to load without breaking anything
the main thing to take care of is, is your app stateful or stateless?
for example, if 1 user makes 2 requests
and each of those 2 requests end up in 2 different processes
are both processes able to fully respond without the knowledge of each other or the user's previous requests?
I think kubernetes will handle the request to the correct service, by using "load balancer", if I remembered correctly
and let say if user use login function, it will call
load balancer -> login service -> database service
yes, but that is still vertical scaling
mhmm
imagine you reach a point where you need load balancer -> 2 login services -> 2 database services
it will works the same
if designed correctly yes
microarchitecture is good, but by itself it does not solve the problem of scalability
to actually solve scalability, the answer is horizontal design, both for microarchitecture or not
but all those microservices has a different ports right?
yes if they use the network stack
there are other ways of communicating
2 database services
and this is the worst part to make
So im using await interaction.guild.members.ban(user);
How do I add a reason to the ban?
by adding the reason parameter to the function
how do i add the reason in ban(user, [reason]?
.ban(user, { reason: "abc" })
expected ,
huh
fixed
why would that possibly make sense
docs aren't hard to understand, ur code editor will also show u what ur supposed to add
unless he is using notepad ++
in most docs, [abc] means abc is optional
im using visual studios
code, don't forget the word "code"
thank you it works now
u didn't ask anything
do u know invite tracker bot
and giveaways
@lyric mountain
this server is for help with coding bots, not help with using existing bots
why does it show the id on my laptop but mentions the user on my ipad?
im using const user = interaction.options.getUser("user");
titles cant have markdown
yes, mention is markdown too
you can display user's name, instead mention them
fixed just add .tag to the ${user}
i used css
how do i get a users status?
and add it into an embed
.setDescription(`${user} Joined ${interaction.guild.name} on ${user.joinedAt}. Account Created on ${user.createdAt}. User status: Soon...`)```
i want to replace soon... with the status of user
Have you looked at the discord.js docs
😱
thanks
Why did they move something like that to the guild member object
it makes more sense to put it on the user
undefined
user.presence.status
Do you have an intent for presence?
Don't forget if you dont have the presence intent you wont get any presence data
Also this intent is a priv intent so you gotta enable it in the bot dashboard
what is the Name for the presence intent?
https://discord-api-types.dev/api/discord-api-types-v10/enum/GatewayIntentBits#GuildPresences
IntentBitField.Flags.GuildPresences
thanls
i added it and still TypeError: Cannot read properties of undefined (reading 'status')
Show how you are doing it
this is my intents btw const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences] });
ok how are you doing the other thing tho
and the Line
js .setDescription(`${user} Joined ${interaction.guild.name} on ${user.joinedAt}. Account Created on ${user.createdAt}. User status: ${user.presence.status}`)
We mainly care about who this user is, how you get him
module.exports = {
data: new SlashCommandBuilder()
.setName("user")
.setDescription("User Info")
.addUserOption(option =>
option
.setName("user")
.setDescription("User to get info of")
.setRequired(true)),
async execute(interaction) {
const user = interaction.options.getUser("user");
So in the terms of discord.js presence is not a valid thing on user
you will have to convert that into a member object
import { Client, ClientOptions } from 'discord.js';
interface IAtomClientOptions {}
declare module 'discord.js' {
interface Client {
options: IAtomClientOptions | ClientOptions;
}
}
export class AtomClient extends Client {}
So I was trying to find a way to just make the options prop that djs client normally has and merge my own option interface into it but I still run into an error of a type mismatch
is it not possible to do this?
I swear I did it at one point
I also tried using & instead of | same thing
Yeah I know, I think if you force fetch the user the presence will appear but it doesn’t show on the docs
Thats cause when you force fetch you essentially just get the raw user data
they dont parse it into a their own user object
type AtomClientOptions = ClientOptions & IAtomClientOptions works iirc
Something like that
ye already tried that
constructor(token: string, options: IAtomClientOptions, djsOptions?: ClientOptions) {
super(djsOptions ?? {} as ClientOptions);
this.atomOptions = options
}
this works yes

Well you can do something like this:
import * as Discord from 'discord.js';
interface Foo { foo: string; }
declare module 'discord.js' {
interface Client {
options: Discord.ClientOptions & Foo;
}
}
Or just
import * as Discord from 'discord.js';
interface Foo { foo: string; }
declare module 'discord.js' {
interface ClientOptions extends Foo {};
}
As you're just changing the options
The reason you have to import everything from discord.js is because if you don't, then it won't declare everything else that already exists in the module
I see, also I don't really remember how to make something optional while the djs client also accepting it being optional
cause by default if I pass options?: ClientOptions to super then it will complain that it could possibly be undefined
but I also don't wanna make it required to have to supply options to the client
Actually wait, they require you to supply intents now dont they, so this doesn't matter
[class TestCommand extends Command]
if (importedCommand instanceof Command)
Yet this equates to false?
or am I misunderstanding
Does inheritance not mean it is an instanceof?
ye idk why its equating to false
just to check real quick
public async addMultipleIn(path: string, options: { subdirectories?: boolean } = {}) {
options = Object.assign({ subdirectories: true }, options);
const files: Array<string> = await this._getFiles(path, options.subdirectories);
for (let file of files) {
if (!['js', 'ts'].includes(file.split('.')[1])) continue;
const filepath = resolve(path, file);
try {
let importedCommand = require(filepath).default;
console.log(importedCommand);
if (importedCommand instanceof Command) {
this.components.set(importedCommand.id, importedCommand);
console.log(this.components);
}
} catch (e: any) {
throw new Error(e);
}
}
}
but cause of that this isn't being added to the collection
yep
half a second to eval. Yikes
ah
gets much faster with subsequent runs
That’s weird it doesn’t act the same for me
Perhaps it's some js peculiarity
show me what you're doing
I'm like 90% sure it's because what you're importing cannot be used with instanceof because you're comparing the class definition instead of an actual object instantiation
importing a file doesn't mean you instantiated an object of it yet
The instanceof operator will only return true if the value's prototype chain has that class anywhere, so there's a high chance you've done something that made it lose that prototype
The "prototype chain" may seem a bit vague here but this may be able to explain it:
class Foo {}
class Bar extends Foo {}
const bar = new Bar();
console.log(bar instanceof Bar); // true
console.log(bar instanceof Foo); // true, because class `Bar` extends class `Foo`
console.log(bar instanceof Object); // true, because classes have a prototype of Object internally
That's more vague lul
Right I need to use new on the import to check
I’m so fucking dumb thank you
is it a good idea to go refresh my slash commands everytime i start my index.js?
if your bot gets restarted a lot youll possibly get ratelimited
ok thanks
ValidationError: bans validation failed: Active: Cast to Boolean failed for value "[Function: Boolean]" (type function) at path "Active" because of "CastError"
Command Saving Data
data = new db({Guild: String, Channel: String, Active: Boolean})
data.save()```
Schema
```js
const { Schema, model } = require("mongoose");
module.exports = model("bans", new Schema({ Guild: String, Channel: String, Active: Boolean }));
I'd suggest refreshing your command explicitly / when they actually change e.g. via script
I'm not experienced in ts, but that doesn't look right
Ah wait, that's a model declaration
yeah
What does ur editor says?
Like, it should tell you the proper syntax no?
If all else fails, check the docs
no syntax errors
I highly doubt that this is the only code related to your issue
you're giving something a function when it expects a boolean
where do you use this model @hidden gorge
in my ban command

Yeah, reminds me a little of some users who join a support server, say "I need help", with no context and dissapear into the void
This relates back to the fact that being a programmer isn't knowing how to write, but knowing how to write proper questions
Actually, programming is surprisingly close to linguistics
Collection(0) [Map] {} the collection is still empty despite the if statement now evaluating true
But it is only empty when accessing it outside the scope of where I am setting it
try {
let importedCommand = new (require(filepath).default)();
if (importedCommand instanceof Command) {
this.components.set(importedCommand.id, importedCommand);
console.log(this.components);
}
} catch (e: any) {
throw new Error(e);
}
here it isn't empty, but if I make an instance of CommandManager and call .addMultipleIn where this code is at and then check <CommandManager>.components it is empty
So the issue apparently was cause I wasn't awaiting the addMultipleIn and logging it in that async func
on(eventName: 'commandsLoaded', listener: (loaded: boolean) => { loaded: boolean }) {} is this not how I would make my own definition for an event name with specific "callback" props
fixed this as well
but now I am running into the issue of the emitter either not emitting, or it is emitting but it isn't being caught cause
cmdManager.on('commandsLoaded', (loaded) => {
console.log(loaded);
if (loaded) console.log('Loaded Commands Successfully!');
});
this doesn't seem to be working
unreachable code probably
omg
you are available
help
I solved the issue but I dont know if this is a viable solution
it was a race condition
the emitter was firing before the listener was attached and this is the solution I came up with
For instant things, use setImmediate
Is this the best solution?
If stuff needs to be on a tick later than the current tick then yes
😔
it looks so ugly
Should I make a system of just auto detecting commands or should I leave it how I have it.
don't fix a working system
unless you like pain
which is probably the case since you code

What does declare module do in typescript?
Declares to intellisense that it should also read those typings and either override or extend existing typings already exported by that module
some modules do not have typings which you can make by doing such a thing
how could i solve this issue with modals in mobile
I'm currently following this documentation, but I'm unsure how to change the port once I do start it: https://umami.is/docs/install .
how do i make an embed say how many channels a server has in js v14?
<Guild>.channels.[...]: https://discord.js.org/#/docs/discord.js/main/class/GuildChannelManager
Whenever i try adding a background banner to the bot it gives me an error. How do i do this? i am using imgur
This is the banner:
it gives you an error hmmm I wonder what the error is?
it says "the image you are uploading no longer exists or is unavailable"
here is the link i am putting in: https://imgur.com/gallery/zReJYpE
try with https://i.imgur.com/AQgvdPs.jpeg
Thanks
how do i get that link?
Is there any way to test dbl webhook on my local machine?
yes, but you will likely need to port forward your router/modem
@earnest phoenix i has question
consider the following code:
let myFunction1 = function() {
setTimeout(() => console.log("timeout"), 0);
setImmediate(() => console.log("immediate"));
process.nextTick(() => console.log("nextTick"));
}
let myFunction2 = function() {
process.nextTick(() => console.log("nextTick"));
setTimeout(() => console.log("timeout"), 0);
setImmediate(() => console.log("immediate"));
}
let myFunction3 = function() {
setImmediate(() => console.log("immediate"));
process.nextTick(() => console.log("nextTick"));
setTimeout(() => console.log("timeout"), 0);
}
myFunction1();
myFunction2();
myFunction3();
i get 3 different outputs depending on where i run it
lmao
nwjs/node-webkit:
node with js file
node repl
from what i know, the correct output should be the third one, but when the code is run from a js file, for some reason the timeouts are executed before the immediates
im assuming nwjs has some weird shit going on, because timeouts should not run on the current event loop even when set to 0
(also nwjs is running node 17, the other two are running node 19)
what prompted you to test this out

guess :^)
Do you know much about the EventEmitter?
enough to answer most questions
How do you make your own event emitter /s
But nah, serious question
I am making a class that wraps around an event emitter right. But I have a question regarding how the events actually work
its a simple "store function and run it later"
So say I have a class that extends an event emitter, and I have another class extending an event emitter, we will call these classes A & B
Class A emits an event, is class B able to then listen to that event or is it specific only to class A?
or are events accessible no matter what as long as its the same process?
class B would need to register an event listener on class A
How would that look?
class A extends EventEmitter {
}
class B extends EventEmitter {
constructor() {
this.A = new A();
this.A.on("something", this.run.bind(this));
}
run() {}
}
const thing = new B();
``` one example
another way is to pass an instance of A into the constructor of B
all instances of EventEmitter are self contained
if you want to "merge" two different emitters, the correct way is to add a listener to their events and re-emit them
there are other more hacky ways to do it tho
Yea cause what I am trying to do is allow my listener class to listen to custom events emitted by the CMD Handler and Listener Handler, while also listening on discord.js events
That looks like it could get very annoying quickly going that route
for example
this is a typical shard manager for discord shards
the manager listens to events from all shards and re-emits them
and adds the shard id
mmmm
Is there no easier way to just merge all the emitters together so I can just listen to them on one base class
What is the easiest to implement
I believe I know what you're trying to do misty, you made a custom client class and you want it to emit all of the same events (plus some of your own) that a djs client does because you extended it
am I right
if I am, that might help tim with your solution
I did indeed make a custom client class
class A extends EventEmitter {
on(...args) {
this.B.on(...args);
this.C.on(...args);
}
}
``` that would be one way i guess ```js
class A extends EventEmitter {
constructor() {
super();
this.B = new B();
this._events = this.B._events;
}
}
``` that would be another hacky way i guess
I also have a Command Handler and ListenerHandler class that emit their own events
this makes me appreciate the relative simplicity of java in a way
been using it for the past few days, been pretty refreshing
😔
this actually looks less hacky than I expected
So in this case A would be my Listener Class
and that just grabs the events from all the other classes that can emit them
yeah sort of
the second method would be easier to do
you just override the object that holds the functions for each emitter
yeah for some reason I'm actually leaning towards the 2nd method even though it's arguably hackier
the first method you would also need to override all other event listener methods such as removeListener
this would be the best method i can think of ```js
class A extends EventEmitter {
constructor() {
super();
this.B = new B();
this.C = new C();
this.events = {};
this._events = this.B._events = this.C._events = this.events;
}
}
basically the event list of all listeners is shared
this._events is a thing?
yes, its where the listener stores the events
You sure?
yes
Cause ts doesn't seem to think so
because its private
jeez
I will be frowned upon by ts enthusiasts but fuck it
since it's compiled to js and there's no such thing as private in js, you should be able to tell ts to just ignore it and it'll work
I'd leave a comment on top of it explaining your logic on the ts-ignore though, just so you're not confused if you forget about it in the future
import { EventEmitter } from 'events';
import { AtomClient, CommandManager, ListenerManager } from '../structures';
export class Listener extends EventEmitter {
#CommandManager: CommandManager;
#ListenerManager: ListenerManager;
#AtomClient: AtomClient;
#events: any;
constructor() {
super();
this.#CommandManager = new CommandManager();
this.#ListenerManager = new ListenerManager();
this.#AtomClient = new AtomClient('', { intents: [] });
this.#events = {};
// @ts-expect-error _events is private
this._events = this.#CommandManager._events = this.#ListenerManager._events = this.#AtomClient._events = this.#events;
}
}
So something like this?
as for your props, I'd use camelCase and just use the private modifier instead of a #
as for the other thing, tim will have to say if it's right or not
I dislike camalCase
yes, if you're using ts, better use the private keyword instead of #
voltrex told me to use # over private so I have been ever since 
you can also type your events object as Record<string, Function | Function[]>
alright then
Voltrex said the compiler doesn't really make shit private if you use private but # does
because private doesnt exist in older js versions
so ts renames it to _
which is the common way to say something is private
but depending on your tsconfig, the privte keyword should be able to compile to # just as well
This is what he said
yes, starting from some js version it denotes a private property
couldn't they just use the standard private keyword?
or go the c# route and use _
yes, but once compiled it will lose the privacy
oh no
the # character actually enforces the privacy even on pure js
I think I may of fucked up

None of the events are listening anymore
well I fucked something up
might have something to do with it being private
try making this.events public
Still nothing
console.log listener._events
Just tried that doesn'tseem to even log it
[Object: null prototype] {}
I also tried it outside the class to make sure and ye its empty
if its null proto thta means the object was not overriden
because {} is not null proto
So that means I am doing smth wrong
Same thing
i found one issue, but even with that issue it still works for me lol
the _eventCount property of the other listeners is not updated
but the event still emits for me
🤔
Why it no work for me then
Maybe it has something to do with the emitters themselves?
2nd year in a row no birthday role. Kinda whack
Issues with node itself are few and far between
I am only asking cause
AtomClient extends Client (DJS) which extends BaseClient (DJS) which extends EventEmitter
I doubt this could cause issues but idk
then look in the djs src to see what they do since Client does not directly extend eventemitter
console.log this._events before overriding it
and console.log it again after overriding it
import { EventEmitter } from 'events';
import { AtomClient, CommandManager, ListenerManager } from '../structures';
import { MergedEvents } from '../util';
export declare interface Listener {
on<U extends keyof MergedEvents>(event: U, listener: MergedEvents[U]): this;
}
export class Listener extends EventEmitter {
private CommandManager: CommandManager;
private ListenerManager: ListenerManager;
private AtomClient: AtomClient;
public events: Record<string, Function | Function[]>;
constructor() {
super();
this.CommandManager = new CommandManager();
this.ListenerManager = new ListenerManager();
this.AtomClient = new AtomClient('', { intents: [] });
this.events = {};
// @ts-ignore
console.log(this._events);
// @ts-expect-error _events is private
this._events = this.CommandManager._events = this.ListenerManager._events = this.AtomClient._events = this.events;
}
}```
are you actually running the listener?
const bla = new Listener()
one momento
classic misty
also, for the _eventsCount issue, you can do ```js
Object.defineProperty(this.A, "_eventsCount", {
get: _ => this._eventsCount,
set: x => this._eventsCount = x
});
gotta love js's hackability
lets just redefine everything
also, just found out something else
removeAllListeners resets the _events object back to default
so that would also need to be overriden
lmao
thats why its preferable to do it the normal way lmao
How would I even override removeAllListeners?
What would it need to look like so it doesn't result it back to default just the same as what I am doingin the constructor or?
something like this i guess (untested): ```js
class A extends EventEmitter {
constructor() {
super();
this.B = new B();
this.C = new C();
this.events = {};
this._events = this.B._events = this.C._events = this.events;
Object.defineProperty(this.B, "_eventsCount", {
get: _ => this._eventsCount,
set: x => this._eventsCount = x
});
Object.defineProperty(this.C, "_eventsCount", {
get: _ => this._eventsCount,
set: x => this._eventsCount = x
});
Object.defineProperty(this.B, "removeAllListeners", {
value: this.removeAllListeners.bind(this)
});
Object.defineProperty(this.C, "removeAllListeners", {
value: this.removeAllListeners.bind(this)
});
}
removeAllListeners() {
this.events = {};
this._events = this.B._events = this.C._events = this.events;
this._eventsCount = 0;
}
}
Also I have a question
I saw this old djs framework that had an event listener setup where the listener was l like this
class ReadyListener<'Ready'> extends Listener {
constructor() {
super({
emitter = "client",
event = "ready",
type = 'on'
})
}
exec(client: Client) {
console.log('client is ready')
}
}
and later to actually listen on this event they register it in the handler itself like
class ListenerManager extends EventEmitter {
register() {
// they grab the emitter in the Listener Classes
(emitter as EventEmitter)[type](event, exec)
}
}
My question is, that is cool and all, but they also allow doing the same thing but for the command handler as well
so instead of the emitter being clientthey would put command but how does it recognize command.on?
Matter of fact just found some old code that does just this, it was a project I forked to help a friend out, but I don't quite get it
(emitter as EventEmitter)[type](event, exec)
=
emitter["on"](event, exec)
yes I know that
but emitter could be anything
client, command, or listener
but that still doesn't help me understand how it knows what to actually listen on
yes but I asking
how does it client is a valid emitter
or is it just a classification
the code for Listener should have the answer
import { IEventOptions, UnionEvents } from '..';
// ! Won't import via barrel so I'm just doing it like this. Same holds true for handlers.
import { BaseModule } from '../extendable';
import { IntersectedEvents } from '../Types';
export abstract class Event<T extends UnionEvents> extends BaseModule {
public readonly options: IEventOptions;
public constructor(identifier: string, { emitter, category = 'default', event, type = 'on' }: IEventOptions) {
super(identifier, { category });
this.options = {
emitter,
category,
event,
type,
};
}
public abstract exec(...args: IntersectedEvents[T]): any;
}
from that old code this is all it is
I still don't get how that works just by looking at this
what the fuck lmfao
This is very cursed code indeed
but I actually like its functionality so ima use it

that project is split into so many parts that its indeed confusing
you need to start somewhere and follow the code
that Event class is meant to be extended by the user
myEvent extends Event
and the user should give it his own exec method
then the user should give this extended Event to the Event handler
EventHandler.register() expects an Event as the first argument
should be working then
its supposed to be empty?
console.log it after doing .on()
also, you could always give this a try lol
https://www.npmjs.com/package/events-merge
7 years ago, but oh well
also, just thought of another way of overriding
class MyClass extends EventEmitter {
constructor() {
super();
this.A = new EventEmitter();
const emitter1 = this.emit;
const emitter2 = this.A.emit;
this.A.emit = function(...args) {
emitter1(...args);
return emitter2(...args);
}
}
}
``` something like this lol
(untested)
ye the events aren't being listened to wtf
I have a test ready event and it doesn't log what I have
console.log this._events before and after using .on
[Object: null prototype] {}
[Object: null prototype] {}
😔
I can't work on this anymore right now I got work soon
Ima just push it to the repo and touch it later
atNull
https://github.com/Atom-TS/atom if anyone wants to be a gem and try and take a crack at it for me go for it if not thats also completely fine <3
well one thing that is very wrong is that you defined the constructor as accepting the arguments event and type
which suggests you want it to be used like this ```js
new Listener("ready", "once")
new Listener("messageCreate", "on")
...
but if you want it to be used like that, then the Listener class cannot create new clients inside it
otherwise you will have a bunch of different clients around for each listener you create
So this is a question that probably answers itself but is there anyway to cerconvent the whole "Discord wont verify youtube music bots" by for instance maybe having the bot call an external thing to then maybe download a .mp3 of a youtube video once and store it into a folder then play it. That way if a user tries to play a song it can lookup if the mp3 exists first before attempting to download one. I know the data size could become rather large quick but would that possibly get around their terms and conditions since the bot is playing a .mp3 and not a direct youtube video.
That won't change anything because downloading the video or audio of a YouTube video goes against their terms of service regardless
Yeah I assumed so.
I can do what everyone else does and simply do soundcloud, but it really dwindles the amount of options users will receive.
I think theres other issues too.
Like just because its downloaded doesnt mean its not content off of youtube.
but they wouldnt ever figure it out lol
I mean thats what my mindset was. Like Discord won't know where I'm getting the mp3's from
That's true, as long as you don't reveal it yourself
I mean also...
As it stands, I do list / tell in multiple commands and messages where the song came from, if I simply removed it all, would discord care? I mean I could be theoretically doing it off of soundcloud...

but they probably have ways to tell
if they really want to figure it out, they can just pick a very specific video off youtube and try to run it on your bot, and check if it works and if the content is exactly the same
Yeah exactly. lol
Is a shame. I listen to a lot of music atleast through my bot that normally wouldn't be found via soundcloud or spotify and I'm sure a large amount of users do aswell
Yeah, YouTube contains almost every track users would ever want but unfortunately there's the YouTube ToS, but SoundCloud and similar aren't that bad though
The other platforms definitely contain 75% or so of all the tracks the users would want to listen to
I'd honestly be fine if there was a way to directly play spotify
However I don't believe or atleast haven't found a way to do spotify
Spotify has a private API to do that but you'd have to get in contact with them and pay to do so
I bet it's rather expensive.
It is
And probably wouldn't get approved for the case of what I'm trying to do.
I mean, then it wouldn't rely on YouTube which is so far the only banned source to play music from
There definitely are other sources who forbid playing their tracks outside of their platform but I don't think Discord cares about those, and you wouldn't be breaking Spotify's ToS either
I'll have to look into it but funds is not an option if it's too high
I think it's more expensive than OpenAI's APIs
https://developer.spotify.com/documentation/web-playback-sdk/quick-start/ Id also think this wouldn't be possible either because it requires a token / secret and I'd expect it likely needing one per music session
That's possibly the case
Le sigh. Well I'll keep it YouTube until my bot gets closer to its 100 limit then I'll likely do soundcloud as the new primary. But because I allow creation of playlists through database, I'll definitely have to purge it.
Oh well, good luck with integrating a different source to play from and hoping it to go well
Yeah only reason I decided to do this project even with the TOS in place was because I did start it before it was, learned more about JS and got better, then decided to finish it
Understandable, have fun with that
my bot is now almost three weeks in verify. Is that normal?
i added my bot on the second of January
That's 2 weeks then
@lyric mountain do you know of any good ways to call a function every x milliseconds in java? I'm making a mini game engine and I need to be able to call update(float dt) on a regular basis (about every 16ms), so I need it to be fast and lightweight
I tried using a swing timer but I believe that doesn't work unless I extend some sort of swing class
ScheduledExecutorService is the class ur looking for
Is it fast enough to handle something like that?
Pretty much, it's the main and official method of making periodic executions
I don't remember the name of the function, just type Executors. and press ctrl space
Should be newScheduled something
Executors.newScheduledThreadPool(1)
Yes that
Save the executor service onto a final variable and use .schedule() to add tasks
Or submit, idk
Been a while since I used scheduled executor
It doesn't seem to be running more than once
public abstract class Game implements Runnable {
public static final int DEFAULT_MAX_ENTITIES = 5000;
private static final int UPDATE_DELAY_MS = 16;
private ScheduledExecutorService timer = Executors.newScheduledThreadPool(1);
protected Window window;
protected World world;
protected RenderSystem renderSystem;
protected PhysicsSystem physicsSystem;
public Game() {
this(DEFAULT_MAX_ENTITIES);
}
public Game(int maxEntities) {
// ...
timer.scheduleAtFixedRate(this, 0, UPDATE_DELAY_MS, TimeUnit.MILLISECONDS);
}
@Override
public void run() {
this.update(1.0f / (UPDATE_DELAY_MS * 1000));
}
public void update(float dt) {
// Update other systems here
System.out.println("dt: " + dt);
physicsSystem.update(dt);
window.repaint();
}
}
that's what I'm doing
can't seem to get it to run more than once
Is the task finishing?
I don't see why it wouldn't
Cuz since u created a single thread pool, it won't execute the next task until the current finishes
there's no infinite loops in there
so it should be finished long before the next one even runs in theory
Hm, weird, it should work
Try following with the debugger to see what's happening
and the systems are only running over 1 entity, so if it's THAT slow then there's a massive problem lol
It isn't, ExecutorService is by far the most optimized thread manager in java
U could also try to use the old infinite loop method
the infinite loop method doesn't work too well for what I'm doing unfortunately
Why not?
well actually I guess why not
definitely running now
I have a bug to fix rq before I can determine if everything is working tho hold on
Weird, executor method should've worked too, I wonder why it didn't
Btw, make sure to create a new thread for that loop
Else u might hang the whole thread
how would I do that
Either with executors (make a global thread pool) or new Thread(() -> ...)
Just remember to kill the thread when u stop using it, if going the raw route
Alright I'm doing this now, it's running in a loop properly ```java
public void run() {
new Thread(() -> {
while(true) {
this.update(1.0f / (UPDATE_DELAY_MS * 1000));
try {
Thread.sleep(UPDATE_DELAY_MS);
} catch(InterruptedException ignored) {}
}
}).start();
}
problem is that now my ECS isn't updating the positions of the transform components for some reason, super annoying
but I'll have to fix that later because I have to leave
Transform? U using graphics2d?
Yeah
Remember g2d isn't thread-safe
I’m using swing as the base unfortunately
Yes, just make sure ur passing the update to the render thread properly
The window paint method calls my render system update method with some double buffering enabled
Like, don't update the g2d directly, instead defer to the render thread
I’ll have to explain more in a little bit, gtg for like 45 mins
Hmmm what do you recommend doing then?
the other project you linked requires registering the listener
like this
const listener = new Listener("ready", "once");
someManager.register(listener)
or you can do it like this ```js
const listener = new Listener("ready", "once", someManager);
in both cases someManager would contain the actual clients and emitters, not Listener
How i can delete a conversation?
U don't
No, you see, conversations are permanent
You can't delete the other side's messages
You can close a conversation tho, but it'll still exist
no idea
Wait what
cant you just delete the messages or is this something entirely different from messages in a channel?
is this in a dm?
Yes i can't delete other side but how to delete my side ?
Yes dm messages
you can retrieve the message history and delete every message u sent, but why even bother?
you'll be spamming the api for no apparent reason
unless u sent mass ads and is trying to cover up your tracks
No ! It's conversation with girlfriend. 😂
through a bot?
No just talking here in dms and want to delete now .
So if any idea how to delete it please tell me ...it's annoying me .
so u mean your own dm
same thing, go over every message deleting every single message
or just close the convo, it wont delete the messages but it'll remove it from the list
Yes
Yes that i know...
So there is no option to select all types?
no
There is alot of messages so i guess it's better to close dm 😂
I'm not going to delete one by one .. it'll take years to erase completely 😂
if u don't mind the other side still being able to read them there's no reason to delete 'em
Sus
Incriminating evidence from online “girlfriend” 
ok so @lyric mountain I fixed my bug, turns out it was just moving the point so little that it wasn't showing up lol
Also, the issue with the scheduledexecutorservice was because I was getting an exception
I guess it started everything faster than then window could be created so it was null and then it stopped the task entirely after that
My next question: how do I clear the canvas each frame to draw everything again? Currently it never clears the frame despite me calling super.paintComponent(window) in my canvas class
public void paintComponent(Graphics window) {
super.paintComponent(window); // I thought this was supposed to clear the window, no?
Graphics2D graph = (Graphics2D) window;
if(back == null) {
back = (BufferedImage)(createImage(getWidth(),getHeight()));
}
Graphics graphToBack = back.createGraphics();
renderSystem.update(graphToBack);
graph.drawImage(back, null, 0, 0);
}
nvm got it, I don't need the if(back == null) block, no idea why I added that in the first place
The bot needs its own bmw to respond, so it did not respond, which is proof that it is running at the same time as the bot message
bmw?
bot needs its own bmw
I have a bmw too
but it is remote controlled

does localhost internet speed is actually depens on your internet cable or internet adapter?
it can goes up to 100gb if you have good equipments
It depends on the slowest point of the system.
so, if I have 100gbps to my router I can send stuff at 100gbps to the router.
If I have 100gbps to the router, and the router has 100gbps to another local computer i can send stuff at 100gbps to that computer.
But, both computers and the router would need to support those speeds.
if lets say the router supported 1gbps, but both computers could do 100gbps then Id be capped at 1gbps.
mhm ok, thank you
ah, yes, forgot to tell u runnables don't automatically throw the exception to the parent
it's annoying cuz sometimes shit happens and u wont know unless u put try-catches in the correct places
there's a way around it tho, I made a throwing functional interface, feel free to copy it if u want```java
@FunctionalInterface
public interface ThrowingConsumer<A> extends Consumer<A> {
void acceptThrows(A a) throws RuntimeException;
@Override
default void accept(A a) {
try {
acceptThrows(a);
} catch (final Exception e) {
// print the exception here
throw new RuntimeException(e);
}
}
}
you'll just need to make it a runnable instead of a consumer
localhost does not actually reach the physical network adapter, it is processed by the loopback module of the operating system
therefore its performance is mostly cpu/ram dependent, not network, and usually reaches speeds of 20+ gbps
I trying to remote control a mac from my personal pc
for ios development
I tried teamviewer, but they still communicate to third-party server
so it is really slow
I want it to be resposive, but still haven't found any solution for that
tried AnyDesk? might be third party server too though, i'm unsure
that wouldn't be localhost though btw
That is
It’s inside the same network
how's that work?
Everything’s routed inside the local network
It’s inside your local network and not going outside
router: gives IPs to devices, how would you use localhost between those?
no, thats lan
localhost/127.0.0.1 is inside the same machine, more specifically its the address of the loopback adapter/interface
💀
other computers on the same network are LAN (local area network)
btw guys my router counts LAN as WAN, any fix?
summary:
LAN connections: 1 Gbps, confirmed with file transfers etc
I had 100/10 Mbps (now 250/100) broadband bandwidth (WAN)
When above 100 Mbps LAN usage WAN would be unavailable (LAN would not be unavailable for clarity)
uhh what
if I sent more than 100 Mbps via scp for example (easiest way), WAN connections would stop working while that bandwidth was taken
router: Asus RT-AC58U
| |
pc1 pc2
have had that issue for 2 years now 💀 (aka ever since started testing it)
you mean you lose internet access if you transfer a large file from one pc to another via lan?
WAN access yes
via wifi or cable?
cable ofc
and in case i wasn't clear how it's not any cables or anything doing it
just sending 12 MBps (100 Mbps, which was my WAN bandwidth) would make WAN inaccessible
but I could transfer up to ~300 MBps or something like that (LAN, aka within the cables and machines)
(using 1 Gbps ethernet cables)
sending files from pc1 to pc2 or vice versa is not affected by your wan speed, if both pcs are synched at 1gbps then the router should be able to deliver 1gbps between both pcs.
now if either pcs lose internet access while transferring (for example, ping google.com starts timing out while the transfer happens), could be that the router is being overloaded, or the pc's network interface is overloaded
well no no, whole WAN stops working/freezes
and the router as said can handle 200+ MBps in LAN but WAN stops working at 12 MBps so (router should be able to handle 1700+ Mbps)
yes
when I transfer files using LAN connections, WAN stops working when LAN exceeds the WAN bandwidth
thats what i said
if either pcs lose internet access while transferring (for example, ping google.com starts timing out while the transfer happens), could be that the router is being overloaded
its not the pcs that lose access, its the router itself, so any device within the router doesn't have WAN access at that moment
so the router is overloaded
but that can't be, because it stops working when WAN bandwidth is filled by LAN
also now I got 250/100 Mbps bandwidth so I could test it now with 2.5x the transfer to see if it freezes WAN , which would also prove that it is not any overloading issue
i've never heard of an issue like that
💀
major skill issue
real
how is your router configured?
default pretty much
does window screen mirror use third-party server?
they have some thing that used to control windows server
forgot the name
ah but it is not for mac
source code from the dutch government
top tier coding right there.
this kinda stuff right here gives me confidence
isnt that how everyone does their percentage calculations?

Hello,
I created a bot with the Discord API. I am using Javascript (discord.js). I need to modify this bot by adding code that allows me to know (for users of a Discord server of a mobile game)
the date they joined the Discord
the duration of the period when they are online
the number of messages sent
the time frame of presence on the Discord
I was able to see what a potential code looks like but I know nothing about it.
I don't know the steps to take from A to Z. I am lost.
(i've Visual Studio Code, Node.js.)
You likely want to play around with a GuildMember object
Which has properties like .joinedAt (a date representing when they joined the server)
Some things you want to implement (e.g. how long they've been online) are stateful things you'd need to track yourself. For example, listening to the presenceUpdate event and recording when a user's presence turns offline or not.
For your map, it would likely map from a guild member ID to a map recording when they were first considered online and the last time they were, in which you could just compute the difference
Of course, this information is in memory, which will be cleared on restart, but I don't know if that matters for your use case @idle yarrow
Im currently developing the site of my bot https://nota.bot.
Any ideas on how to improve it?
Also there seems to sometimes be a problem with adding and removing snap behaviour (how-to-section), anyone having the same experience/know why adding snap sometimes lags you to a different part of the Page?
this is very hard to read
oh boy your right, on other screen sizes it looked way better...
it looks like the 90s ads
yeah apart from that i'd say it looks awesome & very professional, just that very first initial view
okay thank you i will look into how we can improve on thath
the disc bot will
last ord you add 
oh noooo xD
tbh, I'd drop most of it and keep only ur logo + name
r/crappydesign moment 
so like the only
and "NotABot"?
readable honestly
but it gives me that early 95' graphics
if you pixelate it
but i think you can put the text logo out
and the title below it
okay so just change the logo to a plain coloured version?
if the bg is dark color
then logo text and title can be white-ish (85% white) to prevent some discomfort
but keep the "Kill the mayhem" red
for its badass vibe
yeah
but, at the end you do you
try and see what you like the best
we already have a nice white color as bg on lightmode something like that?
ofc but thanks for the ideas
gotta be honest, make the eyes a little bigger
kuu look at hypergryph logo
by little I mean like double the size
the eyes are smol
hypergryph?
btw, intellij got a vscode-like theme 💀
I kinda like it
did you do the website from your profile?
it's pretty neat, I just dont like the color scheme
tho I can edit it
orange-grey-purple looks better imo
you can view source to confirm
but yes i made it
i can't stack two tabs in a panel anymore 
I think u still can
i tried in new ui beta
I'll enable it later, still reading what's new in this version
just saw that, pretty sick

which doesn't format the source code but allows u to read however u like it
apparently u can also work full on cloud with ij
hm, not so bad ig
tho the "run" button stands out like a sore thumb
but people should now stop calling jetbrains ides "visually outdated"
isense also looks cleaner
is nsfw content such as images and videos are allowed in discord bot?
Yes but only in NSFW channels, but why make your question bold?
cause he's a bold man
Hello
Is there a way to lock admin commands for a bot to only specific server/user?
Same way you can with permissions on slash commands I can't find the docs for it.
Here is for discord.js
https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands
https://discordjs.guide/slash-commands/permissions.html#member-permissions
Am using canva package for making a profile card in a command in djs. I can add the user profile pic inside the image but how can I make it in a circle? It's taking the default square
canvas in node js?
it's not "default" square, it's just that images are rectangular
if u want different shapes you need to clip the image
yes
well kuu gave you the answer.
What I do is I keep the image square, but have transparency infront of the image to make it look circular.
did u draw the onigiri shape with paths?
ah, u simply overlaid the rest on top of the avatar
I have a queerie
How can you use:
client.users.send('id', 'content');
To send a message to the DM (An embed to the target of the moderation command), as well as sending the embed in the server?
that's definitely not how it works
Idk, I've never sent DM messages and that's what coming up in the guide on search
I bet it isn't, cuz client.users returns a collection, not a single user
use find to get the user u want, then use send
the rest is the same as sending a message to a normal channel
Thanks, am I okay to send the thing here if it returns an error?
try to solve it first
the only error that might happen is that the user blocked ur bot (or doesn't exist)
so use .catch
Thanks! Can I use catch like this?
catch(e) {
console.error();
}
no because it's a promise
noooooo
Use .get
Please
(If you have the ID)
Ok well Dm works now (Thanks!!!) just need to make an improvement.
It was .fetch btw
Will get work with .getUser?
What
Nothing it works now anyways!!!
.find() returned an error so i used .fetch()
it returned an error because client.users doesn't have the actual users
either fetch or use .cache
I am no longer using that, I tried this way.
member.send({embeds [warnEmbed]})```
Im still trying to do catch
wont work, fetch expects a param
It's working for me?
Unless it's because member is defined with options.getUser() so it already has the user.
Nvm
Is there a large response type field for slash commands
so it can have several lines
u could use a modal
is there a simpler way to turn a local loaded file into a url path while removing .html if enabled and using index.html as root?
let fileName = file.replace(folder, '').replace('/', '')
let pathName = path + folder.replace(fileName, '').replace(folder, '').slice(0, -1)
if (pathName.startsWith('.')) pathName = pathName.slice(-1)
if (remHTML && fileName === 'index.html') fileName = ''
else if (remHTML && fileName.endsWith('.html')) fileName = fileName.slice(0, -5)
else if (remHTML && fileName.endsWith('.htm')) fileName = fileName.slice(0, -4)
const urlName = `${pathName}/${fileName}`.endsWith('/')
? `${pathName}`
: `${pathName}` === '/'
? `/${fileName}`
: `${pathName}/${fileName}` ```
ig
const pathParser = (path: string) => {
path = path.replace(/\/{2,}/g, '/')
if (path.endsWith('/') && path !== '/') return path.slice(0, -1)
if (!path.startsWith('/') && path !== '/') return `/${path}`
return path
}
// ...
let fileName = file.replace(folder, '').replace('/', '')
const pathName = path + folder.replace(fileName, '').replace(folder, '').slice(0, -1)
if (remHTML && fileName === 'index.html') fileName = ''
else if (remHTML && fileName.endsWith('.html')) fileName.slice(0, -5)
else if (remHTML && fileName.endsWith('.htm')) fileName.slice(0, -4)
const urlName = pathParser(`${pathName}/${fileName}`)```
you mean this?
let pathInfos = path.parse(file.replace(folder, ''))
if (pathInfos.base === 'index.html') pathInfos.base = ''
else if (pathInfos.ext === '.html') pathInfos.base = pathInfos.base.slice(0, -5)
else if (pathInfos.ext === '.htm') pathInfos.base = pathInfos.base.slice(0, -4)
const pathName = path.join(pathInfos.dir, pathInfos.base)```
now guys how do i solve something like this
Type 'undefined' is not assignable to type 'string'.
The error ^
url = req.query.url?.toString()
It looks like .toString() cant be used on an undefined object
aka .url
could be wrong.
nope that's not it
ik it has to do with the type of req.query.url
cuz it takes a few types
not sure how i am supposed to limit it only to string
url? means url can be undefined
bruh
had to use triple equals
now the only issue i have is the
No overload matches this call.
await pipeline(response.body, res);
error is for the response.body
I'll get back to it tomorrow Tim, thank you tho
hello, good evening, someone who handles js to ask you a question?
I'm making a bot, but I'm having trouble with a command that I want it to respond differently
ex: command 'hello' and 'hello Juan' that are answered differently, the problem I have is that when I write 'hello Juan' it responds as 'hello'
case "hola":
reply(hola desconocido);
break;
case "hola":
if (command.includes("juan")) {
reply(hola juan!);
} else {
reply(que hola estas diciendo ?);
}
break;```
Because you have case "hola" twice
so it matches the first one and breaks.
ah wait
case "hello":{
if (body.includes("juan")) {
reply(`hello juan`);
} else {
reply(`hello who are you?`);
}
break;
// Otros casos ...
}
Then yeah that should fix your issue.
i have 2 swtich ```js
const command = isCmd ? body.slice(0).trim().split(/ +/).shift().toLocaleLowerCase() : null
const task = isCmd ? body.slice(0).trim().split(/ +/).shift().toLocaleLowerCase() : null
You shouldn't have more than 1 switch reading your command
The problem is that I get the same thing 😦
switch(what's in here?) {
case:
break
}
Just a headsup, move away from switch/if-else asap
em
Commands are better done with a proper handler
I mean, also true.
Else you'll get pasta al dente
It is that the bot that I am, is the base like this of case break 😦
i tried but i got so confused :/
are you new to coding?
somenthing u.u
I'd recommend attempting an easier project before starting a bot
CA is nice because they give you actual projects to solve urself
credit card 👌
I'll take yours ty ver much
they always ignore advices don't they?
no no, that's not it 😦
const isCmd = body.startsWith('');
const task = isCmd ? body.slice(0).trim().split(/ +/).shift().toLocaleLowerCase() : null
he had the startsWith

const circle = {
x: canvas.width / 2,
y: canvas.height / 2,
radius: 70,
}
// x = canvas.width / 2 - pfp.width / 2
// y = 20
// ctx.drawImage(pfp, x, y)
ctx.beginPath();
ctx.arc(circle.x, circle.y, circle.radius, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage(interaction.user.displayAvatarURL({ extension: 'jpg' }))
console.log(avatar.height, avatar.width);
// Compute aspectration
const aspect = avatar.height / avatar.width;
// Math.max is ued to have cover effect use Math.min for contain
const hsx = circle.radius * Math.max(1.0 / aspect, 1.0);
const hsy = circle.radius * Math.max(aspect, 1.0);
// x - hsl and y - hsy centers the image
ctx.drawImage(avatar,circle.x - hsx,circle.y - hsy,hsx * 2,hsy * 2);
this is an balance command and i am trying to resize the image im using canvas npm
can you tell me how i can resize?
const { MessageEmbed } = require('discord.js');
const samp = require('samp-query');
module.exports = {
name: 'server',
aliases: [],
description: 'Displays informations about SA:MP Server',
run: async (client, message, args) => {
const color = await message.guild?.members.fetch(message.client.user.id).then(color => color.displayHexColor) || '#000000';
const ip = "123.456.789".split(':');
const options = {
host: ip[0],
port: ip[1] || 7777
};
await samp(options, (error, query) => {
if(error){
const embed = new MessageEmbed()
.setColor(color)
.setTitle(`${options.host}:${options.port}`)
.setDescription('Server is offline');
return message.channel.send({ embeds: [embed] });
}
else{
const cutomembed = new MessageEmbed()
.setAuthor("APEX ROLEPLAY | SERVER STATUS")
.addFields(
{name: '__Server Status__', value: `Online`, inline: true},
{name: '__Players__', value: `${query['online'] || 0}/${query['maxplayers'] || 0}`, inline: true},
{name: '__In-game Time__', value: query['rules']['worldtime'], inline: true},
{name: '__Server-ip__', value:`play.apexroleplay.in:5555`, inline: true},
{name: '__Language__', value: `Malayalam`, inline: true},
{name: '__Conecting Issue__', value: `[#966354834443886622](/guild/264445053596991498/channel/966354834443886622/)`, inline: true},
)
.setColor("#36393e")
.setThumbnail("")
.setImage("")
.setFooter("Anandhu#1096 | Server Status")
return message.channel.send({ embeds: [cutomembed], content : "**APEX ROLEPLAY | SERVER STATUS <@&1065600394723602515>**"});
}
});
}
}```
Any one please help i want to change this code like automatically edit this embed when any change in player value oru ingametime value any know how to do this please ping me
Whenever I try to build it gets stuck here. Can you help me?
ur not stuck, some things take time
you need to make an interval in that command to fetch the data and edit the message if there's a difference in the value. and ofc clear the interval if the message is deleted or after a specific timeout
more than 1 hours?
When I had to compile opencl I had to wait a whole day
But well, depends on what ur trying to compile
only 2 lines of code...
Do u have many modules? Why are u compiling it?
Suppose am making a command like this using canvas nodejs package, how can I make the avatar image smaller in size?
Resize it
5head
Like, literally, there's not much to answer
When ur drawing an image there are 4 params
The last 2 are the size
😬 how can I do it that's what I wanted to ask, like any function for it or divide the width & length of the image.
Ohk leme see
And i get this error when i compile with pkg. I using nexe-natives-fix and win-dpapi
...you have no idea about what ur doing do you?
What you mean? lol
Simply run node index.js
This bot compiles the code entered by the users and sends it to the user as an exe.
Why?
Because why not, it is my project.
That's a great way to either crash ur bot or get yourself banned
Besides, users wouldn't use that, or even know how to
Perhaps 5-10 users would ever touch that feature
If u still want to, don't use js, use a compiled language instead
Js can't compile to exe (without electron, which is...well, electron)
Even electron doesn't compile anything, it just wraps the project into something executable (u can unpack them easily)
This is not against discord tos
ngl it would be a small target audience but make a JS to C++/ASM converter + compile and it'll be lit
sup, does anybody know if my bot creates an invite and sends it to me if it joins a new server is agains tos?
issue isn't being agains't tos, but sending .exe to people
it's known that executables sent on public servers are often scam attempts, people might report your bot even if it isn't
Still not against dıscord tos
...did u even read what I said?
all it takes is enough people to report your bot and it'll be taken down in no time
pkg
make a JS -> C++ transpiler and you'd be one heck of a famous guy
😏
It is not working..
Pkg is a shit
works for me and its not shit
yes it is
how would you mitigate "botting server count" then? 💀
what?
discord denies verification if bot is "botting server count" (obviously without actually "botting server count")
gets bot banned from verification as well
you don’t need to create an invite link to mitigate that though
personally we made a thing that just autoleaves servers below 9 membercount 💯 that method worked out, though that was too late for the first bot my friend tried to verify since it gets banned 💀
yeah you don’t need to create an invite and give yourself access to the server to do that
yup
so what’s your point with the above? 💀
ruins the experience for tiny server owners but i suppose thats just another flaw with discord 🤷♂️
what
did you know that that caused it to not work on windows
it's an object
the built in path works only on linux?
it works on windows but uses \ instead of /
so In my case where im parsing paths to urls it breaks
i mean, the ts type, what does it show when you hover over it
how do you get servers so fast :0
You can all the time
Maybe the server is not cached
I tried to console.log the ids, it works
Then you should normally be able to access the server name
Or you'll have to fetch those servers
wait if the bot is in servers with under 9members you cant get verification?
idk how strict it is we just wanted to be sure lol
not exactly, it just cant be in many servers with many common member
or join too many servers in a small timeframe
theres a lot of ways to get flagged from what discord has hinted at yeah
if you're doing one check it doesn't really help imo. Its possible your second bot would have been flagged if it was in the circumstance the first one was in.
you can, a large majority of my bots guilds had less than 10 members
and it was verified with no issues
Hi
I forgot how to do if(user has role) {
is it ```js
if(interaction.user.id.hasroles('role') {
//command
}
.user is a user, which doesnt contain roles either.
ah, that too
I tried searching the guide but I might be in the wrong bit :D.
So
if(interaction.user.id.roles.include('role') {
No
ohhh
Anyone knows what its called to have a big field of names or numbers or something like that and you highlight a ton of them to form another word?
or how to do it?
Don’t use the guide use the docs please 😭
Can i have the docs please?
Brotha just look up “discord js documentation”
Also I tried:
if(interaction.member.roles.include('1065733315849617528')) {
Well once again .include is not a method, it’s .includes
ahhhh
roles.cache.has() is probably what you’re looking for anyways
Or something like that, not entirely sure what you’re trying to do
just look up the docs
^^
Yeah i was looking for that one, and tried it but i forgot cache so that explains it all
Thanks Waffle!
The what?
A big field of names is what I would call that
An anagram?
Nah never mind I got an idea on how to do it
but I can't seem to get the function to work
I don't even know what ur talking abt
is there any way to trick nodejs into thinking im on a different platform? so that for example the path package works like it would on windows with \ instead of linux /
essentially I have a list of prime numbers now what I want to do is get a string of a certain width with an arbitrary amount of random prime numbers eg a string of length 7 would look like: "11 13 2" or "101 499" or a prime number of 7 long could also work for example for example but I can't seem to get it to work
No because that's beyond node
Yeah that’s the OS itself
There's a platform-agnostic way tho
By using Path
Which will convert your input to the proper format
(As I said to him earlier but I was turned down)
I 'member
Well, I wouldn't call it a flaw. I would call it requirements. A server with less than 30 people shouldn't need a bot.





