#development

1 messages · Page 91 of 1

boreal iron
#

Absolutely normal when using virtual/cloud servers

#

Those IPs have been going through many providers and users already

#

When trying to use this IP and building a positive rep then you will have let your IP unblock by any service it has been blocked from

#

Or use a smtp relay service by google or Amazon etc

#

Which I wouldn't do but just to say

rustic nova
#

Love how my contabo IP is blacklisted on one literally 2002 lookin-ass website that requires you to pay to whitelist

#

Literally no other flags

#

There's 3 levels on these checks though: level 1 being the email provider, level 2 the IP, level 3 the whole Provider (ASP or smth)

#

So if your IP is blacklisted on 3, most providers do ignore it, you can easily get your IP whitelisted on Level 1s and 2s for free if you're able to prove its not malicious

#

Though they can check when the IP was last used to abuse so thats probably not going to be needed, some blacklists also expire until a new report comes in

boreal iron
#

The issue are usually not the public whitelisting services but the private ones the toolbox doesn't show and list

#

And there's also a lot of them used by different companies

#

Being blocked on many public listing services already is a good hint to change the IP in the first place

rustic nova
#

Change my mind: blacklist providers providing publicly accessible blacklists should allow whitelisting for free

#

Aka if you're blacklisted, unblacklist with a proper reason given

boreal iron
#

That's mostly the case and usually an automatic process where you just have to fill out a form

rustic nova
#

Good

#

Spamhaus is nice

sharp geyser
neon leaf
rustic nova
sharp geyser
rustic nova
#

good

frosty field
#

hello! sorry if this is the wrong place friends, but i see that a lot of bots get declined for verification with the reason being "The long description on your bot's page is filled out with spam/junk to reach the 200 character minimum requirement. Please rewrite your description to include more useful information about your bot." does someone have an example of what's considered spam or junk? i.e. does it mean it has to be just a list of features or is like descriptive sentences considered as filler/spam/junk? thanks!

dense flame
frosty field
dense flame
#

i've also encountered bots that has a lyrics of a song on their description. That would also fall under junk

frosty field
#

that is wild, lol sorry you have to go through that

dense flame
frosty field
#

haha

#

can I ask on average, how many bots get requested for verification each day?

dense flame
#

I dont have the exact numbers but my estimate is 50-100 bots

#

around that range

frosty field
#

oh i understand. just trying to get a understanding of the process. just one more question if you don't mind!

dense flame
#

yea sure go ahead

frosty field
#

i can imagine that the reviewers have a lot of requests and can spend only so much time for each bot. if the bot is very big, is the review split between multiple reviewers?

dense flame
frosty field
#

that makes a lot of sense to me. thank you for answering my questions, you've been super nice! thank you for all the amazing work you're doing!

dense flame
#

No problem at all! :>

spark flint
#

Not able to update a button on click

#

djs v13.10.0

rustic nova
#

.component is read only

#

setDisabled is not a thing

#

theres disabled, but thats read only too

deft wolf
#

You need to define a new button and edit the message

rustic nova
#

actually nvm, setDisabled exists, but yeha you cant edit it, you need to re-define it

deft wolf
#

At least that's what I would do

spark flint
#

on another bot

rustic nova
#

same versions?

spark flint
#

yeah

rustic nova
#

is that a buttonInteraction too?

spark flint
#

yeah

rustic nova
#

shrug

#

thats at least what the docs are telling me on 13.10.x

spark flint
rustic nova
#

why does this shit have so many versions istg

spark flint
#

literally

eternal osprey
#

Hey, in java we must name the methods Word1Word2 right instead of word1Word2?

rustic nova
#

No numbers in class names

#

OnlyPascalCase

#

MainController
PluginManager

eternal osprey
#

Ah i see, thanks aurel

#
 public void addStudent (Student name, int place) {

        all[place] = name;
    }
```my teacher made everything like this
#

shouldn't it become AddStudent tho?

lyric mountain
#

all methods are camelCase

#

all classes PascalCase

eternal osprey
#

owhhh

lyric mountain
#

all constants SCREAMING_SNAKE_CASE

eternal osprey
#

And variables?

lyric mountain
#

camel

eternal osprey
#

i know they are mixed conventions but not sure what that is

eternal osprey
#

thanks

#

So imagine for a method i got 3 words: askinloop, it would become askInLoop?

lyric mountain
#

no, you'd rename that thing

#

processLoop or smth

#

depends on what it does

#

depending on what it does you don't even need to create a method

eternal osprey
#

I am trying to keep my main as empty as possible

#

according to my teachers that's a good practice in java

#

so i divided all the coded into classes

lyric mountain
#

not in the way u think

eternal osprey
#

and added some general methods outside the actual public void main

lyric mountain
#

yes, you're supposed to make self-contained classes, but u don't need to make a method for every single action

eternal osprey
#

Owh

lyric mountain
#

for example

eternal osprey
#
public class Main {

    public static void main(String[] args) {
        welcome();
    }

    public static void createUser(String[] array, Group group, int place) {

       int studentNumber = Integer.parseInt(array[0]);
       String studentFirstName = array[1];
       String studentLastName = array[2];
       Student newStudent = new Student(studentFirstName, studentLastName, studentNumber);
       group.addStudent(newStudent, place);

    }
    public static void processLoop(input Getter, Group group, int size) {
        Boolean errorFound = false;
        while (!errorFound) {
            errorFound = Getter.finishChanges(group, size);
        }
    }
    public static void welcome() {
        input Getter = new input();
        int size = Getter.getGroupSize();
        Group group = new Group(size);
        for(int i = 0; i < size; i++) {
            String array[] = Getter.studentCreationInput();
            createUser(array, group, i);
        }
        Getter.createOutput(group);
        processLoop(Getter, group, size);
}
}
``` this is what i've done right now
#

I found it pretty clean

lyric mountain
#

see, ur using that method in a single place

#

also, u still need to learn proper formatting

#

and dont use capital primitives except for generics

eternal osprey
lyric mountain
#

Boolean

#

use boolean

#

they're different things

#

the former is a boxed primitive, the latter is the actual primitive

eternal osprey
eternal osprey
lyric mountain
#

you only make methods for 2 scenarios:
A - it's a class-specific action (getters, setters, renderers, etc etc)
B - it's a commonly repeated code block

#

else you get a lot of small functions, forcing the viewer to jump around to see what each is doing

eternal osprey
#

Owh that's strange

lyric mountain
#

for example ```java
while (!finishedStuff()) {
doThis();
theOtherThing();
thenDoThis();
ohAndDontForgetThis();
finishWithThis();
}

#

it's small? yes it is, but you have virtually no reference code in that block

#

to see what it's doing you'd have to ctrl + click each line and see what each step is doing

#

when your teach said that about the main() block they meant that you should keep only initialization stuff inside it

sudden geyser
#

having a small main method is good imo

lyric mountain
#

this is my Main for example ```java
public class Main {
private static final OperatingSystemMXBean info = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
protected static final StopWatch boot = new StopWatch();

private static final CacheManager cacheManager = new CacheManager();
private static final CommandManager commandManager = new CommandManager();
private static final ScheduleManager scheduleManager;

static {
    ScheduleManager sm;
    try {
        sm = new ScheduleManager();
    } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) {
        Constants.LOGGER.error("Failed to start scheduler: " + e, e);
        sm = null;
    }
    scheduleManager = sm;
}

private static Application app;

public static void main(String[] args) {
    boot.start();

    ImageIO.setUseCache(false);
    Thread.setDefaultUncaughtExceptionHandler(app = new Application());
}

public static CacheManager getCacheManager() {
    return cacheManager;
}

public static CommandManager getCommandManager() {
    return commandManager;
}

@Nonnull
public static Application getApp() {
    return app;
}

}

sudden geyser
#

main is really only responsible for initialization, not figuring out how your program runs

lyric mountain
#

yes, that's what I meant

eternal osprey
#

owh yeah you are right

#

they told me to keep the public static void main as reduced as possible

#

but the main class itself can indeed contain other methods etc

spark flint
#

I am probably doing something wrong but here i am

bot is not getting dm messages, logging message.content

intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES, Intents.FLAGS.MESSAGE_CONTENT]

version: v13.12.0

lyric mountain
#

yes, but that's not the actual point

#

main() is what initializes your application, like, anything it needs to do before starting the actual app

#

it shouldn't contain any business logic or database transactions

#

just the essential for a successful start

spark flint
#

yees

#

a lot

lyric mountain
#

the Main class (can be called anything) usually hold values or methods that will be accessed from the rest of the code, and that are related to the runtime

eternal osprey
#

ah i see', yeah i already figured that the main class is used to make sure that those values can be used for all the other classes and methods (by providing them as a parameter for example)

lyric mountain
#

for example, there I have
OperatingSystemMXBean = returns info about the system
StopWatch = to time how much it took to start
CacheManager = my cache manager (stores frequently used values)
CommandManager = loads the classes related to commands
ScheduleManager = loads periodic CRON tasks
Application = the bot

#

the managers are self-contained loaders, they need to be online before starting the bot so that's why they're there

spark flint
#

ok i did more logging

#

it is logging not all messages in guilds

#

and it is just not logging dms at all

rustic nova
#

solution: wait for a bug fix on v50

lyric mountain
#

did u include partials?

hushed robin
#

upgrade to v14

spark flint
spark flint
lyric mountain
spark flint
#

how do i listen to raw events

#

i am stupid

lyric mountain
#

^

#

there are probably more messages from tim

#

whenever something isn't firing, he always say to listen to raw events

spark flint
#

ok

#

yeah it worked

lyric mountain
#

well, then it is indeed firing

#

somethind down the pipe is preventing it from reaching the event listener

spark flint
#

yeah

lyric mountain
#

ask tim if he pops in this channel, he's got more knowledge about djs event piping than I do

spark flint
#

alrighty ty

quartz kindle
#

wazzap

crystal wigeon
#

hey anyone used python flask with lambda?

#

im not able to deploy using zappa, i keep running into "lib" not found error for some reason but the app runs as expected locally.

    "dev": {
        "app_function": "lib.server.app",
        "profile_name": "default",
        "project_name": "backend",
        "runtime": "python3.9",
        "s3_bucket": "zappa-app",
        "aws_region": "us-west-2",
        "slim_handler": true,
        "cors": true,
    }
}```
#

this my zappa config

#

when i run deploy, and use zappa tail it just shows this error. and says deploy failed

#

i tried creating a boilerplate app with same settings and that worked

lyric mountain
#

jokes aside, u need to install lib

#

whatever that is

#

did u try pip i lib?

eternal osprey
#

hey, is it possible to create a graphical-interface with java?

#

I am trying to create a calendar, and ofcourse in native java it's easy but i am trying to take a step ahead and create an actual graphical representation of the calendar

#

i've heard that java swing is a good package for handling such gui creations

sudden geyser
#

don't bother

#

it's not great

#

guis in java are notoriously awful

warm surge
#

Hm?>

wheat mesa
#

You can create GUIs in Java @eternal osprey but it is pretty annoying to make it look good

#

Swing is the built in standard but there are other GUI libs out there

rustic nova
#

fuck swing

#

was tasked to use it in work

#

fuck it

#

like

#

actually fuck it

eternal osprey
#

just like the apple calendar planner app

#

it needs to be functional and that's it actually

#

I wanted to use java as that's my current programming language goal to learn, and i really like the language so far

lyric mountain
#

java is...not the best language for UI

#

like, you could definitely create gorgeous apps (jetbrains IDEs are made purely in swing afterall)

#

but it's a hard task

eternal osprey
#

I will try, thanks for all the suggestions tho guys!

opaque seal
wheat mesa
#

Kotlin is like the syntactically sugary version of Java, with some nice features and QOL stuff. Java itself is still a really great language to start off OOP with though, definitely stick with it

lyric mountain
#

I love java yet hate kotlin

wheat mesa
#

I haven’t tried Kotlin but almost everyone I know that uses it likes it pretty much universally

#

Depends on your style really

#

Java is set in stone and really easy to read, I love Java primarily because there’s not so many fancy tricks and 10 billion and 1 ways to do things

#

It’s the simplicity that makes it elegant

sudden geyser
#

think you're being too harsh on kotlin

#

a lot of kotlin is syntactic sugar, but there are many features kotlin provides which java doesn't or makes very difficult

#

higher order functions being the most basic example, as java's function interface thing is just yucky

eternal osprey
wheat mesa
#

to be fair java's indentation does not affect the langauge, and scope is the same as it is in C++

eternal osprey
#

yeah but the static, public, methods etc hit me like a truck tho

#

but i kinda got the hang of it already

#

Does anyone know how i can make this button smaller?

ImageIcon image = new ImageIcon(new ImageIcon("C:\\Users\\\Desktop\\foto-3.png").getImage().getScaledInstance(400, 400, Image.SCALE_DEFAULT));
    private JLabel label = new JLabel(image);
    private JFrame frame = new JFrame();


 label.setBounds(10, 10, 400, 400);
        label.setVisible(true);
        label.setLayout(new FlowLayout());
lyric mountain
lyric mountain
#
private JLabel label = new JLabel(image) {{
  setBounds(10, 10, 400, 400);
  setLayout(new FlowLayout());
  setVisible(true);
}};
#

also, always call setVisible as last

#

to make it smaller simply use setSize

wheat mesa
#

Swing has a lot of stuff with layouts that I don't understand

#

It's quite annoying

lyric mountain
#

it didn't age well indeed

wheat mesa
#

Programmatically generating UIs just does not work as well as they had hoped

#

Markup langs hit this one on the nose pretty much perfectly

lyric mountain
#

I mean, it'd be a great framework, the issue is that they overcomplicated things

#

like making grids (and filling with data)

wheat mesa
#

If it were easier to position components then it would be so much better

#

But to get a layout you want you have to know what all the stupid layouts do and how to use them

#

It's very complex and honestly I just stay far away

lyric mountain
#

I really wish someone made a better UI framework for java

#

javafx just doesn't cut it

wheat mesa
#

Something like tauri for java would be excellent

#

Or a more modern WPF equivalent

sudden geyser
#

swing itself is just not great

#

like, if you use react jsx, you're already doing a weak version of that

lyric mountain
#

My issue with swing is that it's overly verbose

wheat mesa
#

It requires SO MUCH BOILERPLATE

#

It's terrible

lyric mountain
#

That too

#

Like, I'm all in for java-level of verbosity, it's fine

#

But swing goes too overboard

sudden geyser
#

imperative uis are awful to work with

wheat mesa
#

The pipeline is complex too, doesn't offer much wiggle room for customizability

lyric mountain
#

Most of the time I end up making my own extensions to make it more practical

wheat mesa
#

I'm rewriting my engine to use opengl + imgui instead of swing, I have no idea why I even tried to use swing for it

#

(It's sketchy if I'm actually going to be able to write this engine by the time I need it though, I'm not very good at this whole advanced data structures for game engines thing)

lyric mountain
#

You could try making an opengl wrapper that extends graphics2d

#

You'd instantly become one of the most popular lib devs

quaint rampart
#

yo guys what is the equivalent to this but using import? im trying to make a reload all commands on my bot

delete require.cache[require.resolve('./my_module')]
#

before my rewrite i would use this to unload all my commands and then require it again but im not able to figure it out in any documentation, is it even possible?

wheat mesa
#

Unfortunately this is not possible with ESM

#

It's my #1 complaint about import, everything else is great

lament rock
wheat mesa
#

it's possible if you want to rewrite the file with fs and then reimport it KEKW

lament rock
#

full disclaimer, I am the author

wheat mesa
#

You actually got it to work?

#

I thought you gave up on it months ago

lament rock
#

No lol

#

I got it working fine

#

I said no lol to giving up

#

most of my issues at the time was my backtracker module

#

Native like imports are important to me

wheat mesa
#

also on the off chance anybody here knows how to get the java compiler to shut the fuck up, how do I tell it that this is safe: ```java
Class<?> c = f.getType();
System.out.println(c.getTypeName());
if(IComponent.class.isAssignableFrom(c)) {
System.out.println("Yes");
Object instance = c.getDeclaredConstructor().newInstance();
f.set(gameObj, instance);

                addComponent(objID, instance);
            }

```since addComponent's 2nd param takes a <T extends IComponent> but it won't accept Object

#

But I know that the class is compatible because of the if statement

lament rock
#

cant you cast it to a type

wheat mesa
#

Problem is that I don't know the type at compile time

#

I'm using reflection

#

Otherwise I would cast it

lament rock
#

Cast it to IComponent?

wheat mesa
#

Doesn't work because that's casting upwards and losing information

#

This checks if the type implements IComponent

#

and if it does, instantiate it and add it to the entity's components

lament rock
#

is there something similar in java like in js:
if (item instanceof SomeClass) item.someClassSpecificMethod();

wheat mesa
#

unfortunately no

#

instanceof is the closest you can get but the compiler doesn't extract any info from it

lament rock
#

Intellisense's JS type system is smarter than Java's wtf

wheat mesa
#

yeah it's really bugging me

#

it's the one thing I need to complete this and test it

#

but the compiler is being stupid

lament rock
#

Object does extend IComponent though?

wheat mesa
#

No

#

IComponent extends Object technically

lament rock
#

Flawed system imo

wheat mesa
#

Java compiler or my system

lament rock
#

Quick google searches says there is no way to ignore other than to fix

#

system

wheat mesa
#

I don't technically HAVE to have it like this, but it certainly is convenient for the user

lament rock
#

even if the class doesn't add any new members from its base class, its base class isn't compatible with its type

#

or has the possibility of not being

wheat mesa
#

I suppose I could have the precondition of the user having to instantiate the components themselves

#

Let me try that and see how it goes

#

Actually no that still presents the same issue

#

Because I don't know how to get the actual type of the components at runtime even if they're already instantiated

#

My only other idea is to have a list of components in the gameobject that the user has to add to

#

Which is kind of lame

wheat mesa
#

I got it to work

#

Turns out I'm a dummy

#

I forgot to register the component in the ECS

#

I blame gradle, it was hiding the error from me

stiff dust
#

Linux VPS (Just SSH)
Linux VPS (with GUI)
Windows VPS

Which one would you rather?

neon leaf
#

just ssh

stiff dust
#

I change my VPS os from Windows to Linux

#

but its really confusing and weird

#

I'm not sure about what I've done and I'm feeling I have to change it to Windows again

earnest phoenix
#

SSH is literally just connecting you to the remote machine (your VPS in this case), and you just work with the terminal

stiff dust
#

yup and I don't have direct access to files & folders and its little weird and new for me

earnest phoenix
#

Using any type of GUI for a server is a terrible idea, and you shouldn't use a Windows VPS unless it's purely for building/compiling programs for Windows

neon leaf
#

or sftp

stiff dust
#

hmmm

#

OK, so I'm trying to get used to it

eternal osprey
#
 JLabel label = new JLabel(image);
        JFrame frame = new JFrame();
        JPanel panel = new JPanel();
        JProgressBar name = new JProgressBar(0, 100);
        name.setBounds(40,40,160,30);
        name.setValue(0);
        name.setStringPainted(true);
        name.setVisible(true);
        panel.setLayout(new GridLayout(0, 1));
        panel.add(label);
        label.add(name);
        label.setLayout( null );
        label.setBounds(10, 10, 50, 50);
        label.setVisible(true);
        frame.add(panel, BorderLayout.CENTER);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setTitle("Zorgzaam - Planning & Administratie");
        frame.pack();
        frame.setVisible(true);```does anyone know why my progressbar is not showing up?
#

Only thing it's showing is just a blank white page

#

it's only showing up once it's done lmao

stiff dust
#

is there any way to connect to the Linux SSH from phone?

sick agate
#

yup

#

you can use termux if you need it

#

it's little overkill but eh

stiff dust
#

I just want to do pm2 restart or something like that if onetime my bot turned off and I didn't have access to my PC

sick agate
#

it works i guess

deft wolf
#

Termius on android is kinda good

sick agate
#

yeah

#

you can use connectbot

#

i don't know about it tho

#

i just saw i

lyric mountain
#

I recommend juicessh

lyric mountain
#

Which you should anyway

#

What is it supposed to do?

bright thorn
#

can we set dynamic time in the button

spark flint
#

How can I make the chakra colour mode change be a transition?

lyric mountain
#

Try it, but I think you can't

#

The same way u can't ping people in buttons

bright thorn
#

umm

#

we can by moment

#

as string

lyric mountain
#

What?

quartz kindle
#

ig you mean by spamming the api and updating the button every second lol

lyric mountain
#

Limão

spark flint
#

lol

stiff dust
#

is there any way to login into my VPS (Linux SSH) without enter IP/username/password each time?

rustic nova
#

A bookmark and ssh key 4head

sudden geyser
#

and an ssh agent likely

#

so you don't need to enter your password always

eternal osprey
#

Hey guys i recently started a course processors. We recently got introduced to the concept of a multi-level machine. I tink that i got it, but i am not sure whether it's 100% correct, so could anyone correct me?

-Level 5 = high-level language (js, java, c++, c#) -> easy for humans, hard for machine
compiler translates to assembly language:
-level 4 = assembly (2nd lowest language), understandable for humans, already a bit lighter for the machine
assembler translates to machine code
-level 3 = Operating system architecture level:
OS already interprets and executes some data when it's complete, else if it still needs to be modified it will go on to level 2:
-level 2 = Instruction set architecture level:
sets the paths between the registers and the alu
-level 1 = so registers get the data from the OS level, then send it over to the ALU, which performs some logical functions and eventually the data goes from the alu back to the registers for storage using a bus, using the paths sets in level 2
-level 0 = handle I/O

quartz kindle
#

5 seconds of google

eternal osprey
#

yeah i got that same picture in my lecture but i didn't understand it

quartz kindle
#

which part are you having trouble understanding?

eternal osprey
#

especially the different between the digital logic level and the Microarchitecuter

#

microarch level

quartz kindle
#

digital logic is nand gates

#

transistors that alter the flow of electric signals

#

microarchitecture is cpu level, what happens inside a cpu

#

as well as other microchips

eternal osprey
#

Ooowh so that's just basically handling the actual output?

eternal osprey
#

So the last level is basically just handling the electric signals, the data gates and eventually just the I/O overall?

quartz kindle
#

basically yeah, like logic gates and transistors without any specific bigger picture going on

eternal osprey
#

I love you

quartz kindle
#

microarchitecture would be taking the hardware and designing some bigger picture, some actual operations like math and i/o

eternal osprey
#

ahhh i see

#

thank you so much!

#

I see, it's basically just going from:
surface -> internal -> output

lyric mountain
#

jokes aside, yeah, that's pretty right

eternal osprey
eternal osprey
open spire
craggy pine
#

Okay, I don't seem to be understanding how to create a discord attachment using canvas and discord js v14.50. I've copy pasta'd working code I had once made before, and changed up all necessary things that discord changed since 13 -> 14 and I simply can't figure out how / why it's not displaying the image even tho testing it outside of an embed, does indeed create the image correctly.

//an array w/ 10 of these
tenCards.push({
  name: animeFromDB[i].name,
  url: animeFromDB[i].url,
  anime: animeFromDB[i].anime_name,
  anime_url: animeFromDB[i].anime_url,
  img_url: animeFromDB[i].img_url,
  rarity: rarity
})

//create the images, and store it in the array above
let results = await client.createCards(tenCards)

  client.createCards = async (cardArray) => {

    //deleted irrelavent code for discords character limit
    
    for(i=0;i<cardArray.length;i++) {
      
      //deleted more code not needed to see
    
      const canvas = createCanvas(245, 370)

      const ctx = canvas.getContext('2d')
    
      const image = await loadImage(cardArray[i].img_url)
    
      ctx.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight, 19, 30, 210, 325)
    
      const fullCard = await loadImage(border)
      
      ctx.drawImage(fullCard, 0, 0)
  
      cardArray[i].finalCard = new AttachmentBuilder(canvas.toBuffer(), {name: `image.png`}) //create the image, store it into the array and return it.
    }
    return cardArray
  }
#
        //build my embeds for pagination
        for(i=0;i<results.length;i++) {
            let newEmbed = client.quickEmbed(`${results[i].name}`,`Rarity: ${results[i].rarity}\nAnime: [${results[i].anime}](${results[i].anime_url})`)
            newEmbed.setImage(`attachment://image.png`)
            if(results.length <= 1) {
                newEmbed.setFooter({text: `${interaction.user.tag}`, icon_url: interaction.user.avatarURL()})
            } else {
                newEmbed.setFooter({text: `${interaction.user.tag} - Page: ${i+1} / ${results.length}`, icon_url: interaction.user.avatarURL()})
            }
            pages.push(newEmbed)
          }


    //during the pagination code, I do send the file. 
    //[page].finalCard = current page (for index) and .finalCard is the buffered canvas image
    await interaction.editReply({embeds: [pages[page]], components: [row], files: [pages[page].finalCard], ephemeral: true})
open spire
craggy pine
#

Eh, no I shouldn't in this case but ty for the suggestion

#
  • I do actually.
#

client.quickEmbed is the embed builder but my own function

craggy pine
#
AttachmentBuilder {
  attachment: <Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 f5 00 00 01 72 08 06 00 00 00 2d 73 9c b1 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ... 127857 more bytes>,  name: 'image.png',
  description: undefined
}
EmbedBuilder {
  data: {
    color: 15277667,
    title: 'Yuki',
    description: 'Rarity: Common\n' +
      'Anime: [One Piece](https://myanimelist.net/anime/21/One_Piece)',
    image: { url: 'attachment://image.png' },
    footer: { text: 'Miyuka#0425 - Page: 1 / 10', icon_url: undefined }
  }
}

Another note is that console logging results[0].finalCard and my first embed both show image data, just not displaying it within the message itself.

earnest phoenix
craggy pine
#

I could name them using i in the loop then

#

see if that works.

earnest phoenix
#

Also for the <EmbedBuilder>.setFooter() method, it's supposed to be iconURL, not icon_url

craggy pine
#

yeah forgot about dat

craggy pine
earnest phoenix
#

Discord gives embeds access to the files that are currently uploaded to the message/response, that's how it's able to see it

#

This is some weird inconsistency, and I don't see an actual difference between those options

craggy pine
#

I figured it out. Everything was correct. I was editing code for a different menu unknowingly and did a major 5Head

#

anyhoo, ty for helping 😛

#

Note: attachments didn't work, files did

earnest phoenix
#

Very nice

eternal osprey
#

Hey guys, the xor is like: either a or b, but not both right? But if we negate this xor, wouldnt we have to use the the demorgan law? So it would become: both a and b but not only one (so either a or b)?

rustic nova
#

exclusive or

true + true = false
true + false = true
false + false = false iirc
false + true = true

#

Also i hate demorgan law

eternal osprey
#

Yeha i know

#

but now we negate the xor

#

so it would become exactly the opposite

rustic nova
#

!

#

!xor

eternal osprey
#

yeye

rustic nova
#

There's probably a more scientific symbol for it

#

Dunno what you mean otherwise

eternal osprey
#

yeah ~

#

~xor

#

i thought about using the demorgan law: so ~(a xor b) = ~(A and B) but not ~A or ~B

rustic nova
#

Yeahhh that was the only topic i stopped paying attention in after 5 minutes lmaoo

eternal osprey
#

ahh no problem

#

I think that i did it worng

#

the correct answer would be negation xor = (a and b) or not a and not b

#

makes sense because xor means, either one of both true.

gleaming bolt
#
const express = require("express");
const bodyParser = require("body-parser");
const fs = require("fs");
const path = require("path");

const VerificAccessModule = require("./modules/MiddlewareModule/VerificAccessModule");
const app = express();

    app.use(bodyParser.urlencoded({ extended: false }));
    app.use(bodyParser.json());

    const folders = fs.readdirSync(path.join(__dirname, "routers"));

    for (const folder of folders) {
        const folderInFolders = fs.readdirSync(path.join(__dirname, "routers", folder));

        for (const file of folderInFolders) {
            const router = require(path.join(__dirname, "routers", folder, file));

            app.use('/verific/access/:id', VerificAccessModule, router)
        }
    }

    app.listen(1234)

return Cannot GET /verific/access/1326419047847/teste

#

I'm creating an api, and it returns a "cannot get"

#

what could i be doing wrong?

#

VerificAccessModule:

module.exports = async (req, res, next) => {
    next()
}
earnest phoenix
#

we cant read your code magically

rustic nova
#

Cannot get means that you're trying to access an endpoint (presumably through your browser) that doesn't have GET in its settings

gleaming bolt
#

c.c

rustic nova
#

But exactly we cant read your code magically

#

That looks weird to understand

gleaming bolt
#

c.c

#

I just forgot the / at the beginning of the route

#

lol

torpid crystal
#

so i was making an Afk system,

in my schema i save them as given below

const mongoose = require("mongoose");
const User = mongoose.Schema({
  userId: { type: String, unique: true },
 afk: {
   message: { type: String },
   stamp: { type: Number, default: 0 },
 },
});

module.exports = mongoose.model("user", User);

i have a afk command which saves the message and Date.now() for the stamp.

now i want when an user who is afk gets mentioned the bot sends an reply that they are afk.

so i trying this in my messageCreate:

  if (message.mentions.users.size) {
    let mentionedUsers = message.mentions.users.array();
    for (let i = 0; i < mentionedUsers.length; i++) {
      const afkuser = await User.findOne({ userId: mentionedUsers[i].id })
      if (afkuser.afk.message != null && afkuser.afk.stamp > 1) {
        await message.reply({
          embeds: [
            new EmbedBuilder()
              .setColor(client.config.embedColor)
              .setDescription(
                `**${afkuser.tag}** went AFK <t:${Math.floor(
                  afkuser.afk.stamp / 1000
                )}:R> for: **${afkuser.afk.message}**`
              ),
          ],
        });
      }
    }
  }

but this doesnt seem to work / give any errors. any suggestions what should i do?

Any way where i can know if the user who is afk gets mentions in a message?

earnest phoenix
# gleaming bolt I just forgot the / at the beginning of the route

Btw consider moving from Express to something more actively maintained

  1. Express determines the behavior of your callbacks by their number of arguments
  2. Express does not support HTTP/2.0
  3. async/await isn't fully supported either: Express will not handle async route errors
  4. Express uses some deprecated/abandoned dependencies from a long time ago
    A very close alternative is https://fastify.io/ , which is also generally faster too

Fast and low overhead web framework, for Node.js

#

voltrex maintains fastify confirmined

earnest phoenix
torpid crystal
#

i kinda mixed it up with chat gpt's codes so probably messed up cuz it gave v12 code i guess ☠️☠️

earnest phoenix
#

The <Collection>.array() method no longer exists, you can just use the keys() method to get the IDs of the users mentioned, and use it accordingly

#

Basically

for (const userId of message.mentions.users.keys()) {
  ...
}
torpid crystal
#

oh thanks alot. I'll try it

earnest phoenix
gleaming bolt
#

difference in writing, performance, way of creating an instance, that stuff

earnest phoenix
gleaming bolt
#

("/router/:id")

#
fastify.route({
  method: 'GET',
  url: '/',
  schema: {
    // request needs to have a querystring with a `name` parameter
    querystring: {
      name: { type: 'string' }
    },
    // the response needs to be an object with an `hello` property of type 'string'
    response: {
      200: {
        type: 'object',
        properties: {
          hello: { type: 'string' }
        }
      }
    }
  },
  // this function is executed for every request before the handler is executed
  preHandler: async (request, reply) => {
    // E.g. check authentication
  },
  handler: async (request, reply) => {
    return { hello: 'world' }
  }
})
#

seems to be better to work with than the express

earnest phoenix
gleaming bolt
#

hm...

#

okay

#

I will take a look

viral badge
#

imagine not using net or Stream 😏

lyric mountain
#

Express is no longer maintained?

sudden geyser
#

it still is

latent rapids
#

a

earnest phoenix
stiff dust
#

I am using PM2 in Linux VPS to host my Discord Bot is there any way to do something that when files updated/deleted/added PM2 restart the process?

charred prism
#

i'm not sure if this is the right place, but I wanted to take a moment to thank the bot review team for making the verification experience such a great one, thank you!

lyric mountain
lyric mountain
#

it can easily snowball your bot into ratelimit

#

every single file change will make it restart

quartz kindle
#

just dont make more than 1000 changes per day :^)

lyric mountain
#

or 250 if you have 4 shards

stiff dust
maiden dagger
#

Hi

tardy tapir
#

Could someone give me a quick guide to markdown in top.gg bot descriptions (like bold text and stuff)?

quartz kindle
#

should be more or less the same as on discord

#

** for bold

#

_ for italic

#

for headers

sudden geyser
#

should look into commonmark examples as it should practically be the same

tardy tapir
#

Ah, I didn't realise how to do headers. I thought that was just bold. Ok thanks

#

Yeah headers still aren't working unless I did it wrong

craggy pine
#

You could style the text instead of markdown

tardy tapir
#

how?

craggy pine
tardy tapir
#

oh right, thanks

#

It just appears like normal text on my bot's page, same when using **

#

Like no bold or anything

quartz kindle
#
# works
#doesnt
tardy tapir
#

Oh right

#

I'm just stupid and didn't pick up on that, thanks

lyric mountain
#

really, how many commits does discord make for codeblock highlighting

quartz kindle
#

lmao

sudden geyser
#
(+ "oi?")
#

wtf

#

typing and sending code blocks looks completely different in colors

quartz kindle
#

oi bruv

wheat mesa
#

maybe they changed the syntax highlighting colors for the chat but forgot to do it for the preview

craggy pine
#
(node:internal/stream_base_commons:190:23) {
    text: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'character, character_url, anime, anime_url, image_url, rarity) VALUES ('Miyuk...' at line 1",
    sql: "INSERT INTO collection (user, user_id, character, character_url, anime, anime_url, image_url, rarity) VALUES (?, ?, ?, ?, ?, ?, ?, ?) - parameters:['Miyuka','160679942319767552','Takeuchi','https://myanimelist.net/character/105721/Takeuchi','Koe no Katachi...]",
    fatal: false,
    errno: 1064,
    sqlState: '42000',
    code: 'ER_PARSE_ERROR'
  }
craggy pine
#

Resolved. Appearently it's not a good idea to use "character" as a name for a column

lyric mountain
#

same for all other keywords

#

u need to use "quotes" for calling them otherwise

sudden geyser
#

what is db

#

cause whatever data is doesn't have an ID key

supple quail
#

I'd console log data to check if it has "ID"

wheat mesa
#

This also seems like a terrifically inefficient way to store data

#

Columns exist for a reason

supple quail
#

I'd rather focus on why this error is happening instead of critiquing his code lol

lyric mountain
#

Btw, don't think that'll work at all unless js somehow manages to subtract two non-numbers

sterile lantern
#

i was following this tutorial to play around with cf workers but how come nothing happens when i do this

#

npm run ngrok is just ngrok http 8787

sterile lantern
#

nvm got it

round cove
#

What's the api URL I need to hit to get basic guild info like roles/emojis?

#

I thought it was https://discordapp.com/api/guilds/ with the users access token, am I wrong?

sudden geyser
#

If you want a guild in general, it's https://discord.com/api/v.../guilds/... where the second ... is the guild ID

round cove
#

Ah is it just me missing the version?

sudden geyser
#

the first ... represents whatever version you're using for the api

#

e.g. 10

round cove
#

But does it take more than just the users access token for the bearer token?

#

Since I was getting 401 this whole time so I assume I probably need to pass the client secret or something.

sudden geyser
#

yeah you'll need to exchange it for some access token

round cove
#

I already have the users access token, they already logged in.

sudden geyser
#

you shouldn't be getting a 401 then

#

can you show your code / what you're doing

round cove
#

I can show a postman unless you understand C#.

sudden geyser
#

try writing Bearer instead of Token

round cove
#

That's just it's preview, it's already bearer

#

I'm going to try bot, I think that may be why.

#

Damn all 401. HMMMMMM

sudden geyser
#

I just tried the equivalent and I also got 401, but when hitting /users/@me, I get data. Maybe you don't have the right scopes?

round cove
#

What scope would be required to grab specific guild info? Hmm

sudden geyser
#

I think just guilds, though I'm about to check

#

hm, I still don't get any data

#

my guess would be that /guilds/... is not available on user oauth. there's /users/@me/guilds, but that doesn't include stuff like roles or emojis

round cove
#

Right.

round cove
#

Which can be nasty on the api if it request a lot... hmm

#

So need to do hella caching.

crystal wigeon
#

Hey quick question, how is it that a bot that has no privacy policy is allowed on app directory?

#

but then when i dont have it they take it down and send me an email asking me to add one? i still havent received a response

#

their TOS and privacy policy just literally takes you to their official server

rustic nova
#

Or the bot removing the privacy policy

rustic nova
#

If they're referring to a channel with the tos/privacy policy

crystal wigeon
#

Hmm well it just takes you to general chat

#

In their server but anyway any updates on how long they might take to respond ?

rustic nova
#

If they have a channel for the tos/privacy policy

crystal wigeon
#

It’s been 2 months since I fixed and reapplied for app dir

#

Still no reply from them

crystal wigeon
#

Just asking ig hahaAEMJ_kid_run

sharp geyser
earnest phoenix
#

What’s the best paid javascript obfuscator? I preferably want something that takes place in the United States?

I’ll pay any amount but I’m not sure which paid ones are good

wheat mesa
#

Don’t help this kid, he’s obfuscating a clearly illegal and unethical script for stealing user data

#

He will claim it’s not but it’s the only reason he wants to obfuscate anything

sudden geyser
#

then why aren't they banned yet

wheat mesa
#

No ide

#

Idea

sudden geyser
#

did you try reporting them

wheat mesa
#

Nope

#

A while back he had this project advertised on his portfolio website, it was a bookmark script or some shit that stole people’s information

#

And he was advertising it as a paid software

#

I take it that he got some morons to pay for it and now he wants to use that to obfuscate it

#

Seems he took down his portfolio, still in his GitHub description though:

opaque seal
lyric mountain
#

also people love to call themselves "full stack developer", but in my case that's the last thing I want to be called

#

please let me stay on backend only 😭

#

having to be a fullstack dev at work sucks

wheat mesa
#

Fr

oblique sky
#

basically you already a full-stack engineer if you are using frameworks like next.js or svelte kit xD

wheat mesa
#

Yeah apparently

sudden geyser
#

anyone who genuinely calls themselves a fullstack dev is just saying they're willing to work more for the same wage

wheat mesa
#

Fullstack dev is just a way to make yourself sound more accomplished tbh

sudden geyser
#

Software developer > all titles

wheat mesa
#

I don’t even call myself a software developer

#

I haven’t earned that title

#

I just say I’m a computer science student

sudden geyser
#

bud you write software

wheat mesa
#

Yeah but something about the connotation of software developer makes me sound much smarter than I am

#

Feels misleading

oblique sky
#

Made a todo app -> Software developer

sick agate
#

i call myself programmer

sudden geyser
#

coder

oblique sky
#

I was a Java dev before, and now I think I am a web dev

wheat mesa
#

Most of my experience is with Java

#

Definitely one of my preferred languages

oblique sky
#

I am migrating to kotlin nowadays

lyric mountain
#

You'll still work as fullstack nonetheless

wooden ember
#

any reason why my bot cant capture audio from my server any more?

#

did something on discords end change recently is what I mean

#

never mind it was just windows screwing my audio settings again

earnest phoenix
#

Help find the error
After I added bot.event on message the bot stopped responding to commands

rustic nova
#

What the fuck are these comments

#

Also your code contains some bots.gg api key

#

@earnest phoenix

earnest phoenix
earnest phoenix
earnest phoenix
#

I fixed

lyric mountain
#

u didn't

earnest phoenix
#

And reset token

lyric mountain
#

ah ok

#

anyway, I don't refer to the comments or the token, I referred to this

#

if something is taking more than 3 if clauses you seriously need to consider whether there isn't a better option

#

please use a command handler and don't keep everything inside a single file

sudden geyser
#

holy shit

wheat mesa
stable eagle
#

MongoServerError: E11000 duplicate key error collection: test.mewoprofilemodels index: parentOneID_1 dup key: { parentOneID: null }

What does this mean? parentOneID isn't even a key in my schema

eternal osprey
#

is there conditional chaining in java?

#

so expression ? true : false

quartz kindle
#

thats ternary

#

and yes it should exist

eternal osprey
#

owh my bad

#
  gameMode.isEmpty() ? System.out.println("yes") : System.out.println("no");```why is this throwing a: not a statement error?
quartz kindle
#

well, ternary is usually used for assignment: var a = b ? c : d, im not sure if java enforces this or allows it to be free floating like js does

rustic nova
#

yeah its mainly for assignments

#

or return values

#

well yes

eternal osprey
#

owh really interesting, js and c++ did allow the ternary to be used like the thing i sent

lyric mountain
#

using it for anything else is code stink tbh

sudden geyser
#

println doesn't return anything, which is why it can't be used to my knowledge

quartz kindle
#

indeed it appears that java does enforce it

rustic nova
lyric mountain
#

java blocks a lot of things that c++ allows u to do

rustic nova
#

otherwise no

quartz kindle
lyric mountain
#

mostly because u end up shooting urself in the foot

sudden geyser
#

because this works: System.out.println(true ? "yeah" : "no")

quartz kindle
#

so java must have a thing that says a ternary type cannot return void

lyric mountain
#

void

quartz kindle
#

yes

eternal osprey
#

Ah i see, so it's only for assingment and returning of values! Noted, thanks guys 🙂

sudden geyser
#

it has to be used in some expression

lyric mountain
#

use ternaries sparsely, if u abuse it you'll end up with an unreadable mess

wheat mesa
#

Yeah

quartz kindle
lyric mountain
#

lmao

wheat mesa
#

I’ve seen it before

#

It’s terrifying

#

And usually only done as a joke

eternal osprey
#

I also had a quick question, is it possible to change the behaviour of a method based on parameters provided or not? So for example Method1() = random word gets logged in console, Method1(String word) = word gets logged in console?

wheat mesa
#

Somebody in my class claimed that they’re “faster” but if you compare the resulting bytecode they’re the same instructions

sudden geyser
#

how about this

true
? true
  ? true
    ? "yeah"
    : "no"
  : "ew no"
: "NO"
eternal osprey
#

Huhh

wheat mesa
#

That’s called method overloading

#

They have to have unique type signatures in their parameter list though

eternal osprey
#

Is it like a interface? I just got that in the lecture

wheat mesa
eternal osprey
#

Owh no my bad i am stupid

#

lmao

#

sorry, Thanks for the response i will read into overloading.

lyric mountain
#
public void doShit(String in) {
  System.out.println(in);
}

public void doShit() {
  System.out.println("You forgot the param");
}

public boolean doShit(int a, int b) {
  return a > b;
}
eternal osprey
sudden geyser
#

alright who wrote that

quartz kindle
#

idk xD

lyric mountain
#
public void doShit(String in) {
  ...
}

public void doShit(String in) {
  ...
}
#

for example

quartz kindle
#

?

lyric mountain
#

you're in the wrong server I thing

#

and please, stop spamming

quartz kindle
#

if you need help with a specific bot, you need to ask in that bot's server

eternal osprey
#

did you know that

lyric mountain
#

🤨

quartz kindle
#

ghey

rustic nova
#

why does fucking java need a library for everything

#

or have to make multiple lines just to convert one thing to another

#

ah yes want this string in hex? sure add these 5 million lines that probably wont work

#

fucking good that I left that shithole

lyric mountain
#

the latter also allows padding

#

anyway, it doesn't need a lib for everything, far from that actually

#

contrary to js for example

lyric mountain
#

well...it's stackoverflow KEKW

#

that site went to shit in the last decade

rustic nova
#

smh

#

been dealing with a situation regarding verifying someones email

#

like

#

why

#

is java just shit

#

I wanna port that shit bot over to python so I can finally rest in peace

lyric mountain
#

why dont u use regex?

rustic nova
#

lemme get you an example

#

yourmom@example.com ‍‎‌‎‌‎‎‎‎‎‎‎‎‎‌‎‌​​​​​​‌​​​​​​‌‍

#

see this shit?

lyric mountain
#

yes?

rustic nova
#

shit regex of replaceAll("[^\\x20-\\x7E]", ""); doesnt do anything

lyric mountain
#

replaceAll("(?<=\\.[A-Za-z]+)\\W.+$", "")

#

actually, \W

#

forgot uppercase wildcards are the inverse of the regular version

sudden geyser
#

you'd probably want a library for that though

lyric mountain
#

but anyway, java isn't that bad, you just got overcomplicated SO answers

rustic nova
#

fucking finally

lyric mountain
sudden geyser
#

are you using quickdb

#

pro what

#

try mapping while removing the prefix in the string

#

though you'd probably be better off using it structurally how it should be

#

given it has get and set methods (so you could set a points key which has an array/map of the points directly)

tepid flax
#

how would i make it so someone can edit my bots top.gg page

sudden geyser
#

maybe a team? do they have those?

tepid flax
#

oh yeah true mb

open spire
#

Hey can anyone give me the top.gg logo in svg format

sudden geyser
#

go inspect element on the site and copy the svg tag

tawdry surge
#

Does anyone know if theres any events for mongoose for when there is data modified, added or removed from a schema

slender wagon
#

question

#

can i use fetch in localhost

#

trying to test my api before release

#

if not what is the best way to test it

tawdry surge
slender wagon
#

i am

quartz kindle
#

yes you can

slender wagon
#

yup figured it out

#

was using slash commands on my bot but i had put different names on the options and diffferent when i was executing them

earnest phoenix
#

I’ve got a shit ton of projects I would love to securely obfuscate

earnest phoenix
sudden geyser
#

if you're writing malicious software and asking for help here, that is a net negative here

lyric mountain
earnest phoenix
earnest phoenix
#

That I found something in that interests me for the time being?

sudden geyser
#

so it's malicious

earnest phoenix
#

It bypasses browser functions and does shit

sudden geyser
#

but it's malicious

earnest phoenix
#

Meh

#

Ip grabbers exist but they aren’t considered malicious

sudden geyser
#

yes they are

#

seriously it's not hard to say "yeah I write malicious software so what" unless you're like 6 years old

earnest phoenix
#

I’m not tryna be banned off of discord skoll skoll

sudden geyser
#

then why are you asking here

earnest phoenix
#

I asked about a paid JavaScript obfuscator, not for a script to steal someone’s ip

#

God is reading that difficult

sudden geyser
#

you asked for it while having a relationship with writing malicious software

#

that's. like arguing that you want weed while having a history of smoking it 24/7 and saying it's for something else

deft wolf
#

For a friend

sudden geyser
#

"yeah what's your social security number? I forgot mine :("

#

"oh and give me your credit card number as well"

deft wolf
#

And seriously, I don't know if it makes sense to explain it to him. He will keep doing what he does until he gets bored of it or gets banned from discord

#

It's probably best to just ignore him and that's it

earnest phoenix
# sudden geyser you asked for it while having a relationship with writing malicious software

Ion know what you want with me but at the same time I’m not wasting my time talking to you.

Yes, I have the script which can do that stuff. It mainly bypasses browser functions and does other stuff like crash sites and browsers.

I’m asking for a paid JavaScript obfuscator where I can obfuscate my current and new projects. Me asking for something doesn’t mean it had to do with my bookmarklet..

sudden geyser
#

shut up kid

earnest phoenix
#

That’s the thing, this is my last message of the day because I’m not wasting my time with you lol

  • I plan on not getting muted from the chat
    Bye bye
sudden geyser
#

I thought you said you wouldn't waste time talking with me yet you replied again lul

deft wolf
#

I hope you don't come here too soon

wheat mesa
lyric mountain
#

who would guess karma exists :SurprisedPikachu:

wheat mesa
#

average 14 year old script kiddie

eternal osprey
#

hey, i have defined an array like this; char arr[] = new char[5];

#

How do i check if this array is empty tho

lyric mountain
#

array.length

eternal osprey
#

would display 5

#

I thought about looping throught the whole array and checking whether all values are 0

#

but maybe there's a faster way?

lyric mountain
#

an array filled with 0 isn't empty

#

it's filled with 0

wheat mesa
#

You can’t check if the array is empty really. Once you initialize the array, everything inside is filled with the default value for that type

eternal osprey
#

I know, but that's the way it's defined using new char[5]

#

the default type is set to 0

lyric mountain
#

yes, but it's not empty

eternal osprey
#

Okay yeah there you got me

wheat mesa
#

An allocated array will never be empty (unless you make the size 0 for some reason)

eternal osprey
#

I see. I maybe will just loop over the file and see whether all values are 0

lyric mountain
#

that's an option

#

just don't call it an empty array else you'll get reproved

cursive musk
#

@slim heart you created the Easy Applications bot? I thought it got discontinued since it was offline for months.

slim heart
cursive musk
slender wagon
#

so ik this might sound stupid but is using a json file as a small db for a side project ok?
I am always making backup for it too
like the db stores very basic stuff

lyric mountain
#

no

slender wagon
#

😭

lyric mountain
#

it's fine for read-only data, only

slender wagon
#

but a database takes so much space

oblique sky
#

SQLite

lyric mountain
slender wagon
#

hhhhh

oblique sky
#

Yeah

slender wagon
#

never tried

#

may as well use it now

#

does sqlite autoinsert ID's like mongo?

lyric mountain
#

yes

#

all but firebird does it

slender wagon
#

oh good to know

lyric mountain
#

tho it all depends on how you create your table

#

if you create a table with no id it wont add an id

slender wagon
#

I'll make sure to do a little research before creating it then

lyric mountain
#

play around with sqlite, if u mess anything up simply create another file

rocky dagger
#

i have a bot that gets media files from reddit but a lot of them end up as a gifv file and doesnt get displayed in an embed but it does outside an embed in a message by itself, any way to fix this

deft wolf
#

Of course you do, you need access to the imgur api

rocky dagger
#

thanks

winged linden
#

Can anyone help with that? 🙂

{"name":"DiscordAPIError","stack":"DiscordAPIError: Missing Access\n at RequestHandler.execute (/root/home/ufomain/node_modules/discord.js/src/rest/RequestHandler.js:350:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async RequestHandler.push (/root/home/ufomain/node_modules/discord.js/src/rest/RequestHandler.js:51:14)\n at async MessageManager._fetchId (/root/home/ufomain/node_modules/discord.js/src/managers/MessageManager.js:221:18)","message":"Missing Access"}

deft wolf
#

The bot has no access, the error itself says so

winged linden
#

yeah ik sir! i mean how can i prevent that?

  1. it isnt a command so i cant check each time a command is run, basically its a bot where it updates stats so how can i check if the bot has access in a specific channel before executing what should be done?
rocky dagger
deft wolf
#

You can also do so that first your bot sends the embed and then in the next message it will send the link itself, thanks to which this gifv link will turn into a gif right under the embed

rocky dagger
#

i guess i can do that

#

thanks

deft wolf
# winged linden <@743419662125236254> any idea?

You can probably use this to check your bot's permissions on a given channel but keep in mind that i checked it on discord.js v13 and based on message event. You'd have to tweak it in a way that suits what you want to do

message.guild.me.permissionsIn(message.channel).has("BAN_MEMBERS")
#

If you are using discord.js v14 then you will have to use something like this

quartz kindle
#

missing access means the bot cannot access something because its out of reach

#

for example a message in a channel that the bot does not have view permissions, so it cannot see it at all

#

or anything in a guild that the bot is not in anymore

#

maybe you have some message id stored in your database that is from a guild that the bot was kicked from

deft wolf
#

Bots can edit messages that are older than 2 weeks or does it only apply to deleting them?

quartz kindle
#

i believe the 2 week rule only applies to bulk delete

deft wolf
#

Okay, good to know

quartz kindle
#

but the bot needs read message history permission to access them anyway

winged linden
#

question

#

client.guilds.cache.get(serverid)

what does this return if it didnt find the guild?

winged linden
plush dirge
#

@plush dirge

winged linden
#

need some help please

          b.forEach(async (z) => {
            const channelid = z.Top3_ID;
            const msgid = z.Msg_Top3_ID;
            const serverid = z.Server_ID;
            if (channelid != "?") {
              var topguild = client.guilds.cache.get(serverid);
              if (topguild != undefined) {
                var mess = topguild.channels.cache?.get(channelid);
                if (
                  mess != undefined &&
                  topguild.me.permissionsIn(mess.id).has("SEND_MESSAGES")
                ) {
                  var edit = mess.messages
                    .fetch(msgid)
                    ?.then((msg) => msg?.edit({ embeds: [embed] }));
                }
              }
            }
          });
        });```

i have that, but i am still getting that

```{"name":"DiscordAPIError","stack":"DiscordAPIError: Missing Access\n    at RequestHandler.execute (/root/home/ufomain/node_modules/discord.js/src/rest/RequestHandler.js:350:13)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async RequestHandler.push (/root/home/ufomain/node_modules/discord.js/src/rest/RequestHandler.js:51:14)\n    at async MessageManager._fetchId (/root/home/ufomain/node_modules/discord.js/src/managers/MessageManager.js:221:18)","message":"Missing Access"}```
humble wharf
#

why my id was banned? i wont understand

spark flint
#

drake_nope ping mod
drake_dope ping top of the member list

humble wharf
#

anyone help me

spark flint
#

it was banned for being an alt

humble wharf
spark flint
#

and your other was banned for raiding servers

#

@solemn latch can you do the appeals tag

#

i forgot the link

humble wharf
spark flint
#

just wait for a mod

#

i can't do anything

humble wharf
#

@spark flint help me pls to be unbanned

spark flint
#

i can't

#

im not staff

hushed robin
#

☠️

humble wharf
spark flint
spark flint
#

just wait for them

humble wharf
spark flint
#

don;t ping anyone

#

i already pinged a mod for you

next storm
#

no one, he already pinged a moderator

spark flint
#

no one can help apart from moderators

#

if you wish to view your ban reason, you can search it in #mod-logs

humble wharf
spark flint
solemn latch
#

-appeals

#

-appeal

gilded plankBOT
#

If someone you know has been banned here, then direct them to open a support ticket (select Account/Login issues and then Ban Appeals).

Here's more resources to read through regarding appeals: Ban Appeals

shell echoBOT
#

If someone you know has been banned here, then direct them to open a support ticket (select Account/Login issues and then Ban Appeals).

Here's more resources to read through regarding appeals: Ban Appeals

winged linden
earnest phoenix
winged linden
#

What perms does the bot need to edit his own messages?

earnest phoenix
#

And refer to my 3rd question

winged linden
#

I have been hitting my head for the last couple of days tryin to figure out whats wrong😹

earnest phoenix
#

You're checking for the Send Messages permission, that's not the same as the View Channel permission, and update to v14

winged linden
earnest phoenix
#

The bot can get all the channels even if it doesn't have the permission to see the contents of that channel, that's how it works

winged linden
#

Ohhhhh gonna try and do the view channel then, thanks alot 🐐

quartz kindle
#

you also need to account for the possibility that someone with mod powers could have deleted the bot message

#

although if that happened the error would be different

#

but still a good idea to prevent it from possibly happening by adding a catch to the fetch

#
const msg = await mess.messages.fetch(msgid).catch(() => null);
if(!msg) {
  console.log("failed to fetch message")
  return
}
await msg.edit({ embeds: [embed] }).catch(() => console.log("failed to edit message"))
``` for example
winged linden
winged linden
quartz kindle
#

only for undefined and null

#

fetch throws an error if it doesnt find the message

winged linden
#

hmmm i tested it though? It worked for me, i tried deleting it and it didnt send an error

quartz kindle
#

but you can do this (await messages.fetch().catch(() => null))?.edit(...) or this messages.fetch().then(...).catch(...)

quartz kindle
#

the ?. didnt work, you still got the missing access error

winged linden
#

I will check and let u know 🤝 thanks though🤝

compact pier
#

I just made so much, by just making a website and sell rose (valentine day) to people from my school

#

im so happy!!

maiden gazelle
#

hello does somebody know how i can define user on line 6 after interaction.

rustic nova
#

let user = interaction.user

maiden gazelle
#

still didn't work

deft wolf
#

U mean ping him?

#

Like this @deft wolf

maiden gazelle
#

no

rustic nova
#

Be more descriptive

#

On what you mean

maiden gazelle
compact pier
#

yes

deft wolf
#

Yea so what do you want to do

compact pier
#

damm now it is called EmbedBuider?

#

not MessageEmbed()

maiden gazelle
#

when somebody does >afk (reasonhere) that the bot would reply with the username that triggered the command

compact pier
#

you mean ephemeral reply?

maiden gazelle
#

oh wait i already got it it was ${message.user.username} sorry

quartz kindle
deft wolf
#

Interactions and messages are two different things

quartz kindle
#

otherwise you need to show the actual error you're getting

maiden gazelle
quartz kindle
maiden gazelle
#

Alr I will do that next time it's fixed thanks for being so helpfull

eternal osprey
#

hey

#
 while(stringConcat(guessedLetters) == toGuess) {```toGuess here is a string
#

the method stringconcat gives me a string as well

#

but it's an empty string so it concats to values: nullnullnullnull

#

it always returns me true, even when i update the guessedLetters array so that each entry in the array contains a real non-null value

#

i've logged them, i literally found that guessedLetters had exact the same value as toGuess, it still logged false when using == or equals()

wheat mesa
#

Always use .equals for comparing value, use == for comparing references

wheat mesa
#

Also I don’t know what the method stringConcat does

eternal osprey
#

Yeah pretty sure. Uhmm wait i will get back to you in a minute, i might be on the good track

rustic nova
#

guessedLetters is probably an array

#

and just puts them together using stringConcat

quartz kindle
#

concat and procat

#

and noobcat

rustic nova
#

timcat

quartz kindle
#

aurcatel

rustic nova
#

if your code is broken, just add the timcat() method to your broken section

#

if your code works, use aurelcat() to break it

#

if you wanna split atoms and break the universe how we know it, use both at the same time

quartz kindle
#

lmao

eternal osprey
#

I fixed it tho

#

I just looped over the string and compared chars

lyric mountain
#

just use .equals

#

looping over individual chars is pretty inefficient (which is why that's the last check in String.equals method)

lyric mountain
#

concatting strings in a loop is terrible for performance

#

if you must do it then use StringBuilder

eternal osprey
#

Owh

#

thank you for telling me! Will change it

#
while(stringConcat(correctGuessed)){```also, i made this function that Stringconcat that returns a boolean value yeh
#

but the while loop iterates one extra cycle after the bool was true

#

any suggestions on how to fix this

wheat mesa
#

I wouldn’t be looping like that in the first place

eternal osprey
#

I might have fixed it by checking the value before initializing the while loop

wheat mesa
#

Not sure what you’re doing but it seems wrong

eternal osprey
#

while that condition runs

wheat mesa
#

It doesn’t feel like the right condition

#

Nor does it feel like that function should be returning a boolean

eternal osprey
#

It should, in that strinconcat i am checking whether the guessed letters form the correct word, if that's the case it returns true else it's false.

#

I changed the while already, added a ! obv

wheat mesa
#

Why not just build a string from the guessed letters…?

#

I suppose I’m confused on the design choices you’ve made

eternal osprey
#

because they can be guessed in any order

quartz kindle
#

that better not be an implementation of bogosort or something similar

eternal osprey
#

it's a hangman game

#

everything works fine, right now it's just not quitting the loop as you can see, it always waits one cycle extra

wheat mesa
#

I still don’t see why you need to concat the individual letters of the word if you can already tell when the user has won without doing that

eternal osprey
#

how?

wheat mesa
#

Once there is no more . left in the word you’re printing then the game is over

eternal osprey
#

goddayum

#

i am so stupid sometimes

quartz kindle
#

you're not stupid, youre a genious with a J, a jenious

#

:^)

eternal osprey
#

But wouldn't that still make the while loop enter 1 cycle extra

wheat mesa
#

There’s probably even better conditions but I can’t think of them right now

humble wharf
#

Anyones Best Dpy Programmer Here?

wheat mesa
eternal osprey
#

I am the best programmer fr fr

humble wharf
quartz kindle
#

cant you do something like while(word.contains("."))

wheat mesa
#

Yeah

quartz kindle
#

yeah

eternal osprey
#

Hehehhe

#

I got one simple dimple super simple question about my designing tho

#

this is my second week learning java right

#

I have created 4 seperate classes to handle my code, but one class that holds my actual game has still quite some methods and lines, is that okay?

#

The class only holds methods regarding it's class object tho, so no other bogus from other classes appear there

#

And they are methods that are really needed, just helper methods basically

quartz kindle
#

i mean, the actual code is what matters

#

you can organize it in any way you see fit

eternal osprey
#

Yeah i see

#

but my teacher once explained that too much code, too much methods etc are a bad practice

#

but like, wtf should i else do lmao

#

I kept my main clean asf tho

#

made my own class for input/output, game handling etc

#

so yeah

quartz kindle
#

if we talk about logic and semantics, there are 2 main reasons to split a code into multiple functions/methods

#

1 is the code being reusable, if a piece of code is gonna be used in more than one place or is usable as a standalone function
2 the code has different parts and sections that are relatively easy to distinguish

#

those are the two main reasons to separate the code into more than one method/function

eternal osprey
#

Ah i see, thank you very much!

real oriole
#

How does the api sent the Web hook auth token set on the account. I dont see it in my request under anything header, body, or query... any one know what I'm doing wrong

#

Or does it just not sent it at all

#

I mean the Web hooks section of a bot page, where it says url and token to use to auth the request.

neon leaf
#

is there any simple way of making a writable that does nothing with the data that gets passed? literally just outputs it on the data event? (nodejs)

neon leaf
#

yes

quartz kindle
neon leaf
#

thanks! I was doing new Writable() lol

#

this should be good code, right?

quartz kindle
#

yeah that should be fine

#

inflate is decompression tho

#

gzip and brotlicompress is compression