#development

1 messages · Page 1860 of 1

quartz kindle
#

because like

#

primitives are immutable, but objects are not

#

so if they have X object, with property Y which is a string, if you change the property Y with a new value, the X object will contain the new value, as long as they always access it via the X object

lament rock
#

file1

module.exports = "poggers";

file2

const file1 = sync.require("./file1")
console.log(file1) // "poggers"
quartz kindle
#

yes

earnest phoenix
#

sync.require?

lament rock
#

yes. But, if the mod was updated, it would not reflect the update

earnest phoenix
#

What is sync.require

lament rock
#

if the mod and the updated mod returned an object, it would

#

That's sync.require

earnest phoenix
#

cool

quartz kindle
#

what code do they write?

lament rock
#

file 2 is their code

#

it's the return value of the require method

tidal aurora
#

Need your maneger primium

boreal iron
#

Wut?

clever agate
#

exists Discord-Oauth in react.js?

earnest phoenix
#

What

clever agate
#

I was researching about, but I didn't find anything.

#

about DiscordOauth2 with react.js

earnest phoenix
#

Well, you'd implement oauth2 in your backend

#

and just simply have your frontend be able to interact with it

#

Such as making a button that takes you to the oauth2 authorization page for your application and then redirect to a callback url that exchanges the code for an access token which you use to request their information and then display whatever you want on the frontend

quartz kindle
#

since primitives dont have references

clever agate
quartz kindle
#

the only way to solve this would be to make the require always return an object

#

and to put the result of the required file inside an object

clever agate
#

Okay, isn't it?

lament rock
#

Pain. Figured there would be

tulip ledge
#

Alright, what do u guys do when you get burnt out?

earnest phoenix
#

light the fire again

tulip ledge
#

how

earnest phoenix
#

with your mind

tulip ledge
#

how

earnest phoenix
#

concentrating real real hard

tulip ledge
#

concentrating on what?

earnest phoenix
#

fire

tulip ledge
#

huh?

earnest phoenix
#

anyway

#

burnt out on what?

tulip ledge
#

my project I was working on

#

I have like 0 motivation and the moment I open visual studio code I just phyiscally freeze

earnest phoenix
#

Take a break, do something else to clear your mind and go back to it later. Watch yt, a movie, or a tv show, or sleep

sudden geyser
#

that's not what you're currently doing

#

aka stop developing and go do something else

#

like watch a show

earnest phoenix
#

I usually have two projects

sudden geyser
#

then come back the next day

earnest phoenix
#

My main and a side if i get bored of the main

tulip ledge
#

And I still have no motivation at all

earnest phoenix
#

impossible

tulip ledge
earnest phoenix
#

lol

tulip ledge
#

you get the deal

sudden geyser
#

then maybe you've lost the motivation to program

earnest phoenix
#

career ending stuff right there

tulip ledge
#

well how do I get it back?

earnest phoenix
#

Honestly just take a break man

tulip ledge
earnest phoenix
#

over working yourself aint fun

sudden geyser
#

ask yourself why you're programming

#

and ask what you want to be doing

tulip ledge
#

Cuz I enjoyed it

earnest phoenix
#

enjoyed

tulip ledge
#

I enjoyed learning new stuff

earnest phoenix
#

past tense

tulip ledge
#

now I just open vsc

#

and I just freeze

sudden geyser
#

have you been learning too much?

earnest phoenix
#

I advise taking a break tbh

tulip ledge
#

idk

earnest phoenix
#

its what I did

tulip ledge
#

I've already taken a break of like 5 days

earnest phoenix
#

Not what I mean

#

Do something else another hobby

tulip ledge
#

And I rlly wanna start working again cuz I wanna finish my project but I physically can't

earnest phoenix
#

eventually you will start to do it again

#

I played video games for months and suddenly just started programming again

sudden geyser
#

Anyway, it's up to you to find that motivation to develop software. Like misty has said, you can continue to take a break even if you haven't developed in a while. There have been days where I don't know what I want to develop then come back the next day with an idea to solve a problem.

tulip ledge
#

mmmh, alright

sudden geyser
#

For me, it's been taking a few days off my ClojureScript project to think about design while watching shows

tulip ledge
#

it's just annoying I rlly wanna finish this project I've been working on it for a year now

earnest phoenix
#

You probably just burn yourself out on that one project

#

if you wanna program still try and work on something else for a bit

#

you can always go back to it

tulip ledge
#

Alright, time to pick up react again then

boreal iron
#

You could go outside and call the police if somebody committed are parking violation

sudden geyser
#

parking violation spotted

boreal iron
#

lmao thought the same tho

tulip ledge
#

that account got suspended

#

is what itsais

boreal iron
#

That’s what happens if parents allow children to visit the internet

boreal iron
#

They should fucking work on the rice fields, then this wouldn’t happen KEKW

tulip ledge
#

is this some weird grown up metafore?

boreal iron
#

lmao

#

Was referring to the youtube kiddo

vagrant sedge
#

i have a bot using a mlm to do stuff, i've it already written in python but im thinking of rewriting it for speed, since the model takes a solid second to do its thing. is there a language that would be good for such a thing or is this not a language thing?

pale vessel
#

a what

#

multi level marketing?

quartz kindle
#

lmao

vagrant sedge
#

machine learning model

pale vessel
#

oh sorry

quartz kindle
#

i dont think language is that much of a factor, it depends how the libraries you're using work and what language they use

rose warren
#

I also thought that at first

quartz kindle
#

if you want maximum performance, the only way is to go lower level, like C/C++/Rust

vagrant sedge
#

hm

quartz kindle
#

but if the library you are using is already made in C, then it wont make much of a difference

tulip ledge
#

or assembly

vagrant sedge
#

so yeah i think i need to find a c/c++ lib for ml

quartz kindle
vagrant sedge
#

👍

proven lantern
#

im trying to register my fist slash command and im getting a 400 error. any idea what's wrong with my request?

earnest phoenix
#

does it have the application.commands scope ?

#

iirc it needs that

quartz kindle
#

it would be 403 if that was the issue no?

#

400 is usually a malformed request

earnest phoenix
#

I can't remember

#

Also

#

isn't it supposed to be a post req

#

or can a get req work as well?

#

I think it would be a 403 actually ye tim

quartz kindle
#

it has to be post

#

pretty sure

sudden geyser
earnest phoenix
proven lantern
proven lantern
#

i registered a slash command successfully, but it's not showing up in my guild. do i need to reinvite it?

quartz kindle
#

try reloading the client

proven lantern
#

mmkay, brb

#

still no luck

boreal iron
#

You're sure it was successful?

#

Names can not contain capital letters or spaces

proven lantern
boreal iron
#

The description can't be empty, too

proven lantern
#

silent errors are the best

#

their example is using that json

pale vessel
#

anything other than type 1 can't have descriptions

#

the description is "" when you fetch the command though

proven lantern
#

it didn't register

pale vessel
#

you registered a guild command

#

use the same endpoint

proven lantern
#

good call

boreal iron
#

uh nvm then

quartz kindle
#

isnt type 2 one of those that you have to left click a user and go to App?

proven lantern
#

maybe

#

thanks!

quartz kindle
#

xD

split hazel
#

high five

boreal iron
#

thought it's a slash command, too

#

that's the price of not reading carefully, tho

pale vessel
#

they should have known

#

the command name is "High Five"

#

only type 2 and 3 supports that kind of naming

proven lantern
#

i thought i could use the user one for my record command. doesn't look like it'll work
!record [#PLACEMENT PLAYERS...]... GAME_NAME
!record #1 @player1 @player2 #2 @player3 @player4 Counter Strike

pale vessel
#

user commands only provide you the user you click the command on

#

that's all, no other arguments at all

#

same goes to message commands

proven lantern
pale vessel
#

not sure, but it's pretty simple

#

it's just that you don't need options for type 2 and 3

#

they provide you the full user/message object under interaction.data.resolved

proven lantern
#

should i just create a type:1 option that allows free text and then make it use the same syntax for my command?

pale vessel
#

Yeah

#

You don't need to provide type: 1 by the way, since it defaults to that

proven lantern
#

gotcha

pale vessel
#

otherwise the new update would have broken lots of bots

#

probably not, maybe just that 1 bot that uses slash commands /s

proven lantern
#

is there a way to support array input?

pale vessel
#

nope, you have to explicitly make an option for each one

#

or use type 3/string and parse them manually

proven lantern
#

dang

#

im sure they'll improve that in the future

quartz kindle
#

thats what we're all waiting/hoping for

proven lantern
#

is there someway to tell the slash command to call an endpoint? do i still need a socket connection for slash commands?

#

is this where i register the endpoint for the slash commands to invoke?

sudden geyser
#

If you want to handle slash commands through HTTP rather than the gateway

#

If I had to assume, it'll hit just that endpoint with the data in the body.

#

So there's no routing.

proven lantern
sudden geyser
#

probably not

#

don't know

proven lantern
#

i'll give it a test

#

hopefully i dont break my bot

quartz kindle
#

if you add an interaction endpoint they will be sent to that endpoint instead of the gateway

#

so your gateway will no longer receive InteractionCreate events

#

other events are not affected

#

also, if you're gonna implement the endpoint yourself, it needs to be https and it needs to conform to all the security stuff, like responding to pings and returning 401 on invalid signature

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
sage bobcat
quartz kindle
plucky fossil
#

sup

slender thistle
#

Ceiling

quartz kindle
#

sky

serene frost
#

h

#

o

#

o

#

h

blissful coral
#

why?

long marsh
#

Does anyone here have an example of a decent project structure in NodeJS? I'm thinking about entirely changing my Discord bot's structure soon 🤷‍♂️

sudden geyser
#

Assuming you're referring to files and folders, it doesn't really matter. Just pick whatever suits your needs/feels right.

long marsh
sudden geyser
#

But refactors are a good thing

lyric mountain
#

Ye, refactoring mean you're improving your knowledge

#

Bcuz you're seeing the difference between your old self and present

#

Nonetheless, I do recommend categorized file structure, it somewhat feels more organized

sudden geyser
#

I don't have a concrete structure myself, but I choose to split files and folders based on namespaces (aka what section of work they're responsible for) and preferring single, large files rather than a bunch of isolated files in nested folders. For example,

src
|_ assistant
  |_ client.clj
  |_ client
  | |_ commands.clj ; All commands are in here
  |   |_ wikipedia.clj ; Subcommands of wikipedia command
  |_ db.clj ; most database operations in here
    |_ something.clj
lyric mountain
#

Like, a folder for models, a folder for controllers, a folder for utility stuff, etc

#

Also I prefer one file for each thing, mainly because it's very easy to find where everything is

lament rock
#

@quartz kindle remember our discussion earlier about memory references and such? What if instead, I pass the user a getter to get the current value on the Object? Can that even be done?

quartz kindle
#

same as giving them an object

#

they have to call the getter from somewhere

#

what you could do tho, is tell them to always use require

#

everywhere in their code

#

and not assign it to any variable

#

lol

lament rock
quartz kindle
#

or simply wrap it in a object or class

#

and have the user use that

lament rock
#

The return value would break expectations

#

That would suck

split hazel
#

I don't get getters

#

why not just leave it as a function call

#

it is more "convenient"

lament rock
#

they're a method without using the parenthesis

split hazel
#

I know

#

but what's the point just saving two characters

quartz kindle
#

get gud

lament rock
#

private values

lyric mountain
#

git gud --hard

lament rock
#

Wonder if I could pass the user a Proxy

#

fake the value

quartz kindle
#

still needs objects

#

lel

#

well

#

you could do something like

#

eh nvm wouldnt work

lament rock
#

This problem is melting my brain

#

Does the engine call anything specifically to get the value of something? Like I can make my own Object to pass to the user, but the user would have no way to know that it's an Object and thinks it could be a string

quartz kindle
#

another possibility is to give them an object with custom coercing methods

#

but thats not as transparent, the user will still see it as an object

lament rock
#

damn

quartz kindle
lament rock
#

but stuff like typeof a would still show "object"?

quartz kindle
#

yes

lament rock
#

fuck

simple stump
#

I'm trying to set an user's nickname, but guild.members isn't defined. How would I do this?
guild.members.fetch(id).then(user => user.setNickname('[' + elo + '] ' + p1));

sudden geyser
#

It shouldn't be undefined.

#

So guild is probably not the right value.

#

And I hope there's a better way to set the member's nickname because you're making one request for the guild member and another to set their nickname when that should really be one

simple stump
lyric mountain
#

You could retrieve the member from cache

#

If u have it enabled

simple stump
lyric mountain
#

Both in code and intents

simple stump
#

alr

simple stump
#

ive tried client.members and guild.members. both dont seem to work

#

as in .fetch is always undefined

lyric mountain
#

guild.members.cache

#

Show how u defined guild

simple stump
lyric mountain
#

Well, u need to define what the variable is

#

Simply saying guild ain't gonna make the code understand what it is supposed to be

simple stump
#

yeah i kinda messed up there lol

shell crest
#

can someone help me with this error please?

#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/Server-Shield-Bot-Code/cogs\\..\\json\\data.json'
lyric mountain
#

Your file path is heavily messed up

shell crest
#

yea... I've been trying to switch to cogs from client.command

lyric mountain
#

cogs\\..\\json

#

You mixed \ with /

#

And idk what .. is supposed to do there

shell crest
#

wait so i think this is the code:

#
    @commands.Cog.listener()
    async def on_message(self, message):
        with open(os.path.dirname(__file__) + f'\\..\\json\\data.json','r+') as f:
            data=json.load(f)
            if message.content in data[str(message.guild.id)]:
                await message.delete()
#

i have to remove the .. right

lyric mountain
#

You have to use /

shell crest
#

replace \ with /

#

right?

lyric mountain
#

os.path.dirname is returning path with /, so you gotta use it

#

And you can't have .. there

shell crest
#

alright

#

do I replace all of the \ with /

#

like this?

f'//json//data.json','r+') as f:

lyric mountain
#

...idk how to explain it but...you're new to IO ain't u?

shell crest
#

yes...

#

sorry

lyric mountain
#

Search examples on how to access a file on python

shell crest
#

alright

lyric mountain
#

And DON'T carbon-copy it

shell crest
#

alright!

#

thank you!

lyric mountain
#

Np, and btw u don't need double /

earnest phoenix
#

how do i make a calculator that can multiply in my bot

#

in node.js

#

const math = require('math-expression-evaluator');
const stripIndents = require('common-tags').stripIndents;
const config = require("../../config.json")
module.exports = {
  name: "calc",
  aliases: ["calculate"],
  category: "📋 School Commands",
  description: "Calculates a math equation",
  usage: "[command | input]",
  run: async (client, message, args) => {
  //command
  
  if(args.length < 1)
  return message.reply(`You must provide a equation to be solved on the calculator`);

const question = args.join(' ');

let answer;
if(question.indexOf('9 + 10') > -1) {
  answer = '21';
} else {
  try {
      answer = math.eval(question);
  } catch (err) {
      message.channel.send(`Invalid math equation: ${err}`);
  }
}

message.channel.send({
  embed: utils.embed('', stripIndents`
  **Equation:**\n\`\`\`\n${question}\n\`\`\`
  **Answer:**\n\`\`\`\n${answer}\n\`\`\`
  `)
});
  }
  };
#

it can solve simple addition problems

#

nothing more

lyric mountain
#

A * B = C

#

9 + 10 = 21?

#

Wtf

lament rock
#

make your own expression parser

earnest phoenix
#

lol

#

hm

#

maybe...

#

yea ill do that

keen anvil
#

m

wheat mesa
errant flax
#

how do i get a user's about me?

blissful coral
#

Depends on the language

errant flax
#

nodejs

wheat mesa
#

use the api

#

4Head

errant flax
#

whats the url?

wheat mesa
#

You have to find information about the user using the API, depends on what your "about me" command is supposed to do

blissful coral
errant flax
#

dont think djs tells someone's about me monkaHmm

#

but its djs

blissful coral
#

Pull the contents off the GuildMember and User classes then

#

hi million

crimson vapor
#

having a strange issue with djs
if I drag a bot from one voice channel to another, it doesn't update the voice state
It does, however, update on voice channel join

#

hi extreme

blissful coral
#

um

#

weird

#

does it not send anything on the voice state update event? @crimson vapor

crimson vapor
#
  client.on('raw', (p) => {
    if (p.t === 'VOICE_STATE_UPDATE') console.log(p)
  })

  client.on('voiceStateUpdate', (o, n) => {
    console.log(o.channelId, n.channelId)
  })``` this is what im doing
#

you can see the raw event above the two channel ids

blissful coral
#

hm

sage bobcat
#

One message removed from a suspended account.

blissful coral
#

did you try logging without checking the type

#

to see what it shows

crimson vapor
#

p.t?

blissful coral
#

p

crimson vapor
#

it'll just be message stuff

blissful coral
#

ah

#

hmmm

#

Weird

crimson vapor
#

@pale vessel any ideas

shell crest
#

can someone help me with this error...

#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: '809186279077314590'

#

im not sure what this is

#

please ping me if you know

slender thistle
shell crest
#

ohhh

#

thank you

timid heron
#

can someone help me getting the soundcloud client id im not able to find that for my bot

pale vessel
#

Doesn't that need the official API, which is closed for signups?

earnest phoenix
#

what's the difference between SlashCommandClient and InteractionCommandClient in detritus

pale vessel
#

maybe InteractionCommandClient is for more than just slash commands

#

it's just a theory

#

a detritus theory

earnest phoenix
#

detritus theory nice

#

i have another question
for slash commands when I run commandClient.add and there is already a slash command registered with the exact same name description etc does it republish the command or just let it stay like it is

#

@pale vessel can ye help me

pale vessel
#

no cuz I don't use the thing

#

you can TIAS

#

won't hurt

#

unless it does

#

then someone else needs to help

earnest phoenix
#
const user = message.mentions.users.first() || message.guild.members.cache.get(args[0]) || message.author
#

I wanna cache user with id but itsnt working

#

you are mixing up members and users

#

message.guild.MEMBERS.get

#

Members not working on v13

#

On mention

#

they changed something

#

try reading the v13 upgrade docs

#

Couldnt find something about it

#

My problem is that if bot cache member with mention i can use user.username but if it cache with id i must use user.user.username

#

change members to users

#

then you wont need to do user.user.id it will always be user.id

#

oh wait

#

i just realized users doesn't exist

#

Yes it does

#

On the mentions prop it exists

#

add an if statement that checks if the user is a member and if it set the variable to user

earnest phoenix
#

The mentions part is fine

#

Oh I thought you were talking about mentions lawl

#

lawl

#

Well, you might not even get a member if they aren't cached

#

@earnest phoenix don't change anything just add an if statement checking if the user variable is a member

#

and sometimes the GUILD_MEMBERS intent doesn't cache them

#

so you typically have to fetch dont ya?

earnest phoenix
#

Well yes I am just saying it might never work no?

earnest phoenix
#

because you're not dealing with user objects

#

mmm

#

djs confuses me sometimes

#

I use detritus

#

Working while banning

pale vessel
#

do not tell me that is a repl.it bot and you're coding on your phone

earnest phoenix
#

But not working while try to getting avatar

earnest phoenix
#

well you told em not to

#

Actually i am using dcoder

#

Bc replit is hard on phone

#

And thats not the problem discord js to weird

Working while banning
But not working while try to getting avatar

earnest phoenix
earnest phoenix
earnest phoenix
earnest phoenix
#

<Member>.user.displayAvatarURL()

#

every ide sucks on my phone

#

Everything sucks on phone

earnest phoenix
earnest phoenix
earnest phoenix
#

Hmm

#

Since you're using message.author at the end it makes sense to do by user

#

Else do message.member

#
const user = smh;

if (user.user) { user = user.user }

user is now definitely a user object
earnest phoenix
#

look at me not using // for comments

earnest phoenix
#

bruh

#

You'll have to use a check for guild member cache anyways

#

Well do they want a guild members or a user I'm confused

#

They want a user

#

They are doing message.author if none of it works

#

But they also want to use ID to get a member

#

You see what's going on here right

#

yeah

#

From their code it shows them using message.author at the end of the user variable declarations

#
const user = message.mentions.users.first() || message.guild.members.cache.get(args[0]) || message.author 

if (user.user) { user = user.user }
#

I mean I guess that would work I just don't see the point in doing it that way

#

🤷

#

because

#

message.guild.users doesn't exist and doesn't need to exist

#

Well of course it doesn't exist

earnest phoenix
#

i guess user discord user means a member that is not inside the server but member is inside the server

#

At least in my language there is a difference like this between user and member

feral aspen
#
if (!args[0]) {
    var user = message.author;
} else {
    var user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);

    const embedError = new MessageEmbed()
    .setColor(red)

    if (!user) {
        embedError.setDescription("❌ Invalid User");
        return await message.channel.send({ embeds: [embedError] });
    };
};
earnest phoenix
#
const Discord = require('discord.js')
module.exports = {
  name: "avatar",
  async run (client, message, args) {
    
    const ment = message.mentions.members.first()
    const id = message.guild.members.cache.get(args[0])
    const auth = message.author
    if(ment) {
      const embed = new Discord.MessageEmbed()
      .setTitle('User Avatar')
      .setImage(user.displayAvatarURL({ dynamic: true, size:2048 }))
      message.channel.send({embeds: [embed] })
    } else if(id) {
      const embed = new Discord.MessageEmbed()
      .setTitle('User Avatar')
      .setImage(user.user.displayAvatarURL({ dynamic: true, size:2048 }))
      message.channel.send({embeds: [embed] })
    } else(auth) {
      const embed = new Discord.MessageEmbed()
      .setTitle('User Avatar')
      .setImage(user.displayAvatarURL({ dynamic: true, size:2048 }))
      message.channel.send({embeds: [embed] })
    }
  }
}

earnest phoenix
#

because i'm tired of silly errors

feral aspen
#

.. by complicating yourself?

#

User is not defined, too.

#

Here.

earnest phoenix
#

Ill change them

#

But I was lazy

#

I sent it to question the possibility of it working

#

Nwm ill try it my self

feral aspen
#
if (!args[0]) {
    var user = message.author;
} else {
    var user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);

    const embedError = new MessageEmbed()
    .setColor("RED")

    if (!user) {
        embedError.setDescription("❌ Invalid User");
        return await message.channel.send({ embeds: [embedError] });
    };
};

const embed = new Discord.MessageEmbed()
.setTitle(`${user.user.username} Avatar`)
.setImage(user.user.displayAvatarURL({ dynamic: true, size: 2048 }))

return message.channel.send({ embeds: [embed] })
#

Do that.

earnest phoenix
#

Hmm okay

feral aspen
#

Works?

earnest phoenix
feral aspen
#

Oh my god.. not that client.

#

.. and how is it of undefined.

earnest phoenix
#

Cause i cache myself

#

And i am already user

#

Not user.user

feral aspen
#

Change message.author to message.member

earnest phoenix
#

Okay it worked thanks

feral aspen
#

Hey.

#
const { dependencies: { "discord.js" } } = require("../../../package.json");
#

Did I do something wrong here since it's giving me red dashing lines.

#

I want to get the value of discord.js

#

':' expected

#

What can I do instead, then?

#

Should I use fs?

#

What do you mean?

earnest phoenix
#
const Discord = require('discord.js')
module.exports = {
  name: "avatar",
  async run (client, message, args) {
    
    let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member

    const embed = new Discord.MessageEmbed()
    .setTitle(`${user.user.username} Avatar`)
    .setImage(user.user.displayAvatarURL({ dynamic: true, size: 2048 }))
    return message.channel.send({ embeds: [embed] }) 
  }
} 
#

i think this is easier

feral aspen
#

Doesn't work...

#

discord.js error with .

lament rock
#

just do require("package.json").dependencies["discord.js"];
but obviously change the path to the package

feral aspen
#

👍

drifting shell
#

Ok, does anyone know how to disable the weird but annoying thing with vscode where it auto completes for the method you want but it ends up eating the characters next to it on the line. It keeps doing it and it's annoying

#

does anyone know an actually good linter for java in vscode

#

i have an eslint extension but it only works for js

#

its linter kinda stinky tho

#

what the fuck is that cable

#

seems like some kind of proprietary shit

earnest phoenix
#

usb yellow square from a charger

feral aspen
#

Yo.

#

I have a string, example..

let string = "This is the rest of the sentence. Where one two three.."
#

I want it whereas after the sentence., instead of continuing the string.. it replaces them all with ...

#

Is that possible.. and should I do like .slice(beginning, string.length)?

lament rock
#

For that string specifically, you can say

string = `${string.slice(0, string.indexOf("."))}..`; // I think this leaves 3 dots at end
feral aspen
#
let string = "oofmynme is the best human in the world";
console.log(string.slice(0, 22) + `...`)
#

I did this.

#

After h of human it leaves the rest as ...

rose warren
#

You need to use backticks

#

`

lament rock
#

Basic js question. ${variable} only works in template strings ``

rose warren
#

Template literals need backticks

lament rock
#

that matches all characters in the string

#

That's not what they want

#

oh whoops. \.

#

That wouldn't work either because of the g flag.

#

Well. Maybe it would

#

but you shouldn't include it

#

it's unnecessary

#

you have no clue what g does

#

"thing 1. thing2. thing3.." > "thing 1... thing2... thing3......"

#

That's your regex

quartz kindle
#

doesnt the + match any number of consecutive characters?

#

yeah

#

so .. would be ... not ......

lament rock
#

oh right mb

#

Either way, your regex isn't what they needed

#

they wanted everything after the . to be replaced with ...

feral aspen
#

What happened to <guild>.region?

lament rock
#

removed. It's now voice channel rtcRegion

feral aspen
#

Oh god.

lament rock
#

It is indeed a pain

quartz kindle
#

bread

pale vessel
rose warren
feral aspen
#

Example, looping through the roles of a guild.

boreal iron
#

Looks wrong somehow.

pale vessel
lament rock
#

You could just map the roles by the name and pass the name through that fn

boreal iron
pale vessel
#

Blasphemy

boreal iron
pale vessel
boreal iron
pale vessel
#

You have correct intents?

#

Nice

boreal iron
#

channel.send() ?

#

There’s no channel defined

last tapir
#

Hey.

#
bot.users.fetch(sServer.ownerId).toString()
#

Returns [object Promise]

lament rock
#

await the promise

boreal iron
#

That would be the code you need, not the code you have

last tapir
#

done.. still same output

rose warren
#

Show more code

last tapir
#

await bot.users.fetch(sServer.ownerId).toString()

pale vessel
#

(await func())

last tapir
#

OH

pale vessel
#

toString() doesn't return a promise, users.fetch() does

boreal iron
#

And the ownerId is a string anyways

pale vessel
#

Btw you can use (await guild.fetchOwner()).toString()

last tapir
#

wait.. that works too?

pale vessel
#

Yes

#

I'm assuming sServer is an instance of Guild

lament rock
#

fetching the user and calling to string is not necessary since it just returns <@${ownerID}>

rose warren
boreal iron
#

smh

boreal iron
#

Going back into my bed

lament rock
#

what does v13 have to do with anything

boreal iron
last tapir
#
- message.channel.send(user);
+ message.channel.send(user.toString());
pale vessel
#

No, that's unrelated

lament rock
#

Just send <@${ownerID}>

pale vessel
#

He's saying you can just use <@ownerId> without fetching the full object

rose warren
#

It doesn't change in v13

#

It still returns the same as <@${ownerId}>

stable eagle
#

Does a bot's speed depend on guild member size?

#

i feel like its my vps

tired panther
#

Its dependent on the latency and the specs of your vps

stable eagle
#

1 CPU
1 GB
1 TB Bandwitdh

boreal iron
#

1 TB Bandwitdh
KEKW

stable eagle
#

is something wrong about it?

boreal iron
#

Yes

stable eagle
#

What is it

boreal iron
boreal iron
#

Maybe you saw 1 TB traffic not bandwidth

stable eagle
#

Is transfer and traffic the same

boreal iron
#

Well transfer is a weird term for it but probably

#

There’s no other term for traffic than traffic oldEyes

quartz kindle
#

bandwidth is how fast you can download/upload, traffic is how much you can download/upload

stable eagle
#

my bot became pretty slow after i switched to vultr

boreal iron
#

What’s vultr? Your provider?
If so did u monitor your process usage?

boreal iron
#

"Usage" is the key word, yeah also explains it’s the traffic

#

If so did u monitor your process usage?

stable eagle
#

Yeah I did

boreal iron
#

Is the system usage at its limits already?

stable eagle
#

No

quartz kindle
#

what is the slowness?

#

high ping?

stable eagle
#

My ws ping is 80ms

quartz kindle
#

and the rest ping?

stable eagle
quartz kindle
#

ye

stable eagle
#

:/

quartz kindle
#

and this started after you moved to vultr?

#

no code changes?

stable eagle
#

I didn’t change code.

stable eagle
stable eagle
quartz kindle
#

ah

#

then it looks fine?

#

what exactly is slow about it?

stable eagle
#

Well, the command response time is slow

quartz kindle
#

measure it

stable eagle
#

took like 3s to respond

lament rock
#

That's when it's locally evaluating the expression which should be 0ms. The latency you're experiencing is lag between you <-> Discord <-> your bot

earnest phoenix
#

you'd wanna measure the ws latency no?

lament rock
#

rest

earnest phoenix
#

ah ye

#

is it a good idea to host a bot on vercel's serverless functions

pale vessel
#

no

earnest phoenix
#

ok

signal estuary
#

I want to pass an object to the event

for (const file of eventFiles) {
    const event = require(`./events/${file}`);
    if (event.once) {
        client.once(event.name, (...args) => event.execute(...args));
    } else {

        client.on(event.name, (...args) => event.execute(...args));

    }
}

event file:

module.exports = {
    name: 'messageCreate',
    async execute(message) {
    }
}

So I want to pass the object for example logChannel, I got from my databank so I can use it in my event file.
I defined the log channel under:
for (const file of eventFiles) {
And I am trying to access it in the event file:

async execute(message, logChannel) {

Any Idea how I can do that?

earnest phoenix
#

First slash command!

#

Nice

#

how do you set intents though

#

Normal way?

#

im using detritus

#

not djs

#

Oh

#

Easy

eternal osprey
#
const resolveID = async () => (await tiktok.getUserProfileInfo(accountshouldbehere)).user.id```hey this is my little code i have made. How would i get each guilds[message.autthor.id].tiktokname value to loop each one through the above function?( and what if each user has multiple accounts set!)
earnest phoenix
#

You grab the intents from the socket package that gets installed alongside detritus

#

the docs are generated with typedoc and im just flicking through random links

#

and just define the intents in the client

#

there is the detritus-client-socket

#

You can grab the intents from it

earnest phoenix
earnest phoenix
#

Why you need log channel on message event then

#

i found gateway.intents property

#

how do i generate intents now

#

Mmm not entirely sure on that one tbh

#

I just grabbed GatewayIntents from the socket package and just loaded them in an array fashion iirc

#

ok

#

still dont get how to set intents

#

plus the fact typescript intellisense is absolute shit on replit

#

lawl

#

Cause you can't send an embed like that anymore

pallid jungle
plucky harness
#

Since Discord.py is stopping development what should the best bet for people who were using it? Change to different language or use some fork versions of it?

Also if we're to change language which do you prefer should be nice with slash functions working properly

earnest phoenix
signal estuary
#
ReferenceError: Intents is not defined
const client = new Discord.Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGE_REACTIONS],
    partials: ['MESSAGE', 'CHANNEL', 'REACTION']
})
earnest phoenix
#

self explanatory

plucky harness
earnest phoenix
signal estuary
earnest phoenix
#

tf no

signal estuary
#

Never imported sth

#

In my whole life

earnest phoenix
#
const { Intents } = require('discord.js')
pallid jungle
#

@earnest phoenix

    if (typeof data !== 'string') throw new error(errorMessage);
                                        ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
earnest phoenix
#

Well what exactly are you doing

#

and dont ping me please

pallid jungle
earnest phoenix
#

Does it again

#

bruh

eternal osprey
#
for(const key in guilds){
    console.log(guilds[key].account)
}```Hey guys, this gives me an array of the accounts as users can have multiple. How would i eventually get each account name that are available>
pallid jungle
#

Lol

earnest phoenix
#

Well ofc

rose warren
#

Don't repost please

pallid jungle
#
    const embed = new MessageEmbed()
    .setColor('738ADB')
    .addField(`**General**`, [
        `![Bot](https://cdn.discordapp.com/emojis/841711382739157043.webp?size=128 "Bot") **Username:** ${client.user.username}`,
        `![pp224](https://cdn.discordapp.com/emojis/853495450111967253.webp?size=128 "pp224") **Tag:** ${client.user.tag}`, 
    ])
    .addField(`**Stats**`,[ 
        `⌨️ **Channels:**\n \`\`\`${client.channels.cache.size}\`\`\``,
        ])
        message.channel.send({ embeds: [embed] })
    if (typeof data !== 'string') throw new error(errorMessage);
                                        ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
earnest phoenix
#

Well

#

What does the error say

pallid jungle
earnest phoenix
#

No I am asking you what it says

#

Read it

pallid jungle
#

It's not empty ._.

earnest phoenix
#

Well its not a string either

#

lmfao

eternal osprey
#

how would i loop through this json file to get each account property of each user? Ping me when you have the answer please.

pallid jungle
#

._.

earnest phoenix
#

Key note

#

typeof data !== 'string'

#

means what you are giving it isn't a string

#

array != string

#

If you wanna use an array use the join method on the array

pallid jungle
#

ok

earnest phoenix
pallid jungle
#

I am trying to fix it but yea you can tell me more if u want

#
    if (typeof data !== 'string') throw new error(errorMessage);
                                        ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
#
    const embed = new MessageEmbed()
    .setColor('738ADB')
    .addField(`**General**`, [
        `![Bot](https://cdn.discordapp.com/emojis/841711382739157043.webp?size=128 "Bot") **Username:** ${client.user.username}`,
        `![pp224](https://cdn.discordapp.com/emojis/853495450111967253.webp?size=128 "pp224") **Tag:** ${client.user.tag}`, 
    ])
    .addField(`**Stats**`,[ 
        `⌨️ **Channels:**\n \`\`\`${client.channels.cache.size}\`\`\``,
        ])
        message.channel.send({ embeds: [embed] })
#

Wait

#

ok

#

Nope

#

Wait should i type \n in spaces ?

#

Full code

    const embed = new MessageEmbed()
    .addField(`**General**`, [ 
        `![Bot](https://cdn.discordapp.com/emojis/841711382739157043.webp?size=128 "Bot") **Username:** ${client.user.username}`,
        `![pp224](https://cdn.discordapp.com/emojis/853495450111967253.webp?size=128 "pp224") **Tag:** ${client.user.tag}`,
        `![pp198](https://cdn.discordapp.com/emojis/853494893439352842.webp?size=128 "pp198") **ID:** ${client.user.id}`,
        `📆 **Created At:** ${moment(client.user.createdAt).format("DD-MM-YYYY [at] HH:mm")}`,
        `![Developer](https://cdn.discordapp.com/emojis/841321892060201021.webp?size=128 "Developer") **Developer:** @pallid jungle`,
        `![LightUp](https://cdn.discordapp.com/emojis/776670894126006302.webp?size=128 "LightUp") **Bot Website:** https://Wolfy.yoyojoe.repl.co`,
        `Version: ${version}`,
        `━━━━━━━━━━━━━━━━━━`,
        `![Settings](https://cdn.discordapp.com/emojis/841321893750505533.webp?size=128 "Settings") **System**`,
        '\n',
        `Memory Total:\n\n**${client.commands.size}**`,
        `Memory Used (*heap*):\n\n[**\` ${(heapUsed / 1024 / 1024).toFixed(0)} MB \`**]`,
        `OS:\n\n**${process.platform} ${release}**`,
        `DiscordJS:\n\n**v${discord_version}**`,
        `Node:\n\n**${process.version}**`,
        `CPU:\n\n**${cpus()[0].model}**`,
        '\n'
    ])
    .addField(`**Stats**`,[ 
        `![pp594](https://cdn.discordapp.com/emojis/768866151827767386.webp?size=128 "pp594") **Servers:**\n \`\`\`${client.guilds.cache.size}\`\`\``,
        `⌨️ **Channels:**\n \`\`\`${client.channels.cache.size}\`\`\``,
        `![pp833](https://cdn.discordapp.com/emojis/853495153280155668.webp?size=128 "pp833") **Users:**\n \`\`\`${client.users.cache.size}\`\`\``,
        ])
        message.channel.send({ embeds: [embed] })
hybrid cargo
sacred aurora
#

and you still don't get it

pallid jungle
#

kk

sacred aurora
#

you can use the join method to join all those string

#

just like ```js
<Array>.join("\n")

hybrid cargo
#

Also the first field's value string could potentially be over 1024 characters which might throw an error

sacred aurora
#

yeah

#

also that

pallid jungle
sacred aurora
#

not the first

#

all fields

pallid jungle
hybrid cargo
pallid jungle
#

oh

hybrid cargo
#

Description was 2k but now its increased to 4k

#

That would throw so many errors

sacred aurora
#

lol

hybrid cargo
#

Quick tip: If you wanna write multi lined string but dont want to use \n and make a very loooong line. Test out NPM common-tags. Should be very helpful

#

To anyone :D

sacred aurora
#

uwu this seems nice

lament rock
#

or just

"1\n\
2\n\
3\n\
4";
sacred aurora
#

off wrong reply

#

and the second field?

hybrid cargo
pallid jungle
#

where

lament rock
#

You can

sacred aurora
#

and ur joining the add field function?? wutt

pallid jungle
#

I am thinking in that

hybrid cargo
# lament rock

You split your arguments with " " at your message event / handler. And then at the eval command you join it with " " again. Thats the reason you can eval it. If u were to code it in vsc u would face this error

earnest phoenix
hybrid cargo
#

Also your whole input including the " are interpreted as a string

lament rock
hybrid cargo
#

As u can see that the " are also displayed in your reply content

lament rock
#

the " are added as part of a custom stringify method

#

I do everything sanely.

hybrid cargo
#

In your eval command the " are the part of the string and not the syntax of representing a string. Just try doing your method on VSC and you'll see

#

Try it, and see it.

slender thistle
#

JS fuckery?

#

Oh well y'all sort this beef out yourselves 💀

lament rock
#

The runtime allows it. Vsc bitches about stuff even if it works at runtime

sacred aurora
#

it works if i use \n\

#

and not \n

lament rock
#

the \ at the end of a line while inside of a string means to continue the string on the next line

hybrid cargo
#

Oh wait, I did not notice that, blame my vision ye

sacred aurora
#

hehe

lament rock
#

I tried to tell you

hybrid cargo
#

ye yea now as i scrolled up i see that

#

mb

lament rock
#

all g

eternal osprey
#
for(const key in guilds){
        console.log(...guilds[key].account)
        g += `USER ID: ${key}:`+"\n"+ [...guilds[key].account]+"\n\n" 
        p = g.replace(/,/g, "\n")
        console.log(g)
        }
        const embed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setTimestamp()
        .setDescription(p)
        .setFooter("Your tiktok notifier!")
        message.channel.send(embed)
        
    }``` why is there an undefined in the embed>
tough agate
#

Hey I have simple question regarding that Flickr emoji

Can I use these the down one is animated and it moves left to right

quartz kindle
#

show where you created the g and p variables

eternal osprey
#

all the way at the top

#

i have found out that the issue lays in the g+=

#

but i am no sure why

quartz kindle
#

if g starts with undefined, then that value is being added to g somewhere

#

before the code you showed

#

you have to initialize the variable to an empty string, but anyway you should rewrite that entire code, because its doing a lot of unneeded things and repeating them for no reason

cosmic forum
#

Hello! Anyone know the best resource to get an array of almost all english words?

quartz kindle
cosmic forum
#

thanks!

earnest phoenix
#

that must of been fun to compile

hybrid cargo
quartz kindle
hybrid cargo
#

Lol

quartz kindle
#

WHEA_UNRECOVERABLE_ERROR

#

never had that one before

#

really weird

earnest phoenix
#

y'all have amazing pcs that can't handle that shit but my potato pc can smh grind through

crimson pike
#
console log "test"
``` guys what's wrong here?
pale vessel
#

Missing a few symbols here and there, but it looks okay! 👍

boreal iron
#

Maybe it's a magical lagnuage we don't know, don't require all these symbols

inner fulcrum
#

if i am not wrong lol

earnest phoenix
#

you are wrong

inner fulcrum
#

ok

earnest phoenix
#

its print("test")

inner fulcrum
#

i think we are using js

earnest phoenix
#

not anymore

inner fulcrum
#

;-;

earnest phoenix
#

also if you are using js

boreal iron
earnest phoenix
#

and double quotes

inner fulcrum
#

am pro

earnest phoenix
#

just why

#

single quotes are better

inner fulcrum
#

its easier to press lol

earnest phoenix
#

use prettier

inner fulcrum
#

hm

earnest phoenix
#

it can convert " to '

#

looks cleaner

hybrid cargo
#

Or just dont hold shift while trying to type "

inner fulcrum
#

""

#

ok

earnest phoenix
#

double quotes are ugly

inner fulcrum
#

monke doe

earnest phoenix
#

oo oo ah ah

solemn latch
#

I use double quotes to make it easier to tell the diffrence between ` and "
which is really dumb reasoning but shrug

cinder patio
#

it's personal preference...

#

though whoever isn't using double quotes is getting the electric chair

rose warren
#

Hook me up then

#

I use double or single depending on my mood when I start the file KEKW but i'll always stick to one or the other once I start.

shy tapir
#

Anyone know a bot that is like Members+?

hybrid cargo
rose warren
livid jackalBOT
#

@shy tapir

To find a bot that you need, please try searching the main feature you need on our website. You may have to refine your search term, but with just a little effort, you can find the bot you need. If you still haven't found a bot that suits your needs, then try searching Google for it.

earnest phoenix
#

ez Mac

#

just use prettier

#

you tell it what to do

inner fulcrum
#

mac are u epic gamer

crimson pike
#

10 PRINT "HELLO :3"

#

like that

#

but idk how to run the code

cinder patio
craggy brook
#

hey any one can help me?

earnest phoenix
#

no

#

cause you haven't stated your issue

craggy brook
#

ok sorry

#

i am using replit it and i have done all the thing and now when i press run it showing exit status 1

#

@earnest phoenix

#

anyone?

earnest phoenix
#

Please dont ping me for support

#

just wait patiently someone who can help will eventually help

craggy brook
#

+____+

sage bobcat
#

One message removed from a suspended account.

solemn latch
sage bobcat
#

One message removed from a suspended account.

solemn latch
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

Probably an already defined string, just replace 0 and 1 by something else?!

sage bobcat
#

One message removed from a suspended account.

worn sonnet
#

So i need some socks5 proxies and want to bypass captcha

craggy brook
solemn latch
boreal iron
#

(run)

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

save the arrow as string, then create a function and use it's parameters to replace either 1 or both symbols

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

the function?
I would void something like that, unless you need it to return the string

sage bobcat
#

One message removed from a suspended account.

solemn latch
#

If you have a function just for making the string, and want to send it from the function youd make it a string.
if you are doing everything in the function and dont need anything returned void

earnest phoenix
#

So basically you have an array of words you want to remove from an array of words?

#

Well, I could think of one way though I don't know if its the most efficient way

boreal iron
#

Loops through the array you wanna clean, check if the element is included in your filter array, if so splice the element using indexOf() (it's key).

#

1 loop, 1 line

solemn latch
#

I would just use a filter

earnest phoenix
#

I would try looping over the array of words you have, and then check if the word in that array is included in the array of words you dont want, if so remove that word else continue

solemn latch
#

filter and use includes shrug

boreal iron
earnest phoenix
#

That wouldn't work though

#

you'd still have to use a loop no?

solemn latch
#

why?
arr.filter(item => item.includes(otherArr));
should do it right? or am i being silly

#

op backwards, but you get the idea

earnest phoenix
#

🤔

#

Maybe it would

solemn latch
#

might not be the fastest, would have to try a few methods to find the fastest

earnest phoenix
#

Wait what tf

#

How does that work

#

Ah wait

#

I see now

boreal iron
#

and vise versa

earnest phoenix
#

Yea

boreal iron
#

doesn't return the original array

#

but a new one

earnest phoenix
#

I wonder what the source code for the filter method is

#

I can't be bothered to check tbh

solemn latch
#

its probably just a loop kek

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

I wonder if it loops through the array

#

lmfao

solemn latch
#

invert it

#

!

quartz kindle
#

what the fuck

solemn latch
#

ah yes, the right person to answer this

sage bobcat
quartz kindle
#

i aint answering this

#

whatever it is

boreal iron
#

lol

sage bobcat
#

One message removed from a suspended account.

boreal iron
earnest phoenix
#

ur welcome

#

I am now woo

#

:)

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

whats the input supposed to do? replace the 0/1's?
or like add text to the right of the arrow?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

can you just replace the 0s and 1s with 3s and 4s?

sage bobcat
#

One message removed from a suspended account.

boreal iron
#

Then replace all 0 by the first passed argument and the 1 by the second passed argument

sage bobcat
#

One message removed from a suspended account.

boreal iron
#

If one's passed only, it will of course replace the 0 only

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

Then replace all 0 by the first passed argument and the 1 by the second passed argument

#

?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

If one's passed only, it will of course replace the 0 only

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

👍

solemn latch
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

isn't there a method for replacing all instances of something with something else?

solemn latch
#

Console.WriteLine(" {0}", b);
Console.WriteLine(" {0}{0}", b);
etc etc

quartz kindle
#

put your reading glasses on so you can see sharp

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

yes overused joke i know

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

rose warren
quartz kindle
#

inb4 muted for overusing jokes

rose warren
#

lmao

#

Nom loves dad jokes

hybrid cargo
quartz kindle
#

lmao

hybrid cargo
#

imma get blocked

boreal iron
earnest phoenix
boreal iron
#

jost go on...

#

lol how did an o got into this lmao

solemn latch
earnest phoenix
#

ye

#

that seems easier then doing a format for each write line

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

you can just use a singular write line then

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

I assume anyways

#

Mmm

sage bobcat
#

One message removed from a suspended account.

solemn latch
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

That looks messy

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

Nah all good

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

pfft

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

same here tbh

solemn latch
earnest phoenix
#

again same here lawl

#

so true

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

nah

#

dont do that

#

giving up isnt the thing to do

slender thistle
#

@sage bobcat pat