#development

1 messages · Page 264 of 1

earnest phoenix
#

Depending on the library you use you can use hybrid/bridged commands

#

Though prefix commands are old school and slash commands honestly are more powerful

wheat mesa
#

Tech debt piles up, you should eliminate it when possible

tacit estuary
#

https://trycatchdebug.net/news/1438629/discord-py-bot-cog-slash-commands

That website was the most I seen on how to use slash commands in cog files stuff but the stuff listed there is wrong since it shows errors for me. I copied everything on there exactly since I need example code that works as the main thing. This how it looks.

This article provides a guide on how to create slash commands for Discord.py bot cogs, building upon the knowledge of normal text commands.

#
intents = discord.Intents.default()
intents.typing = False
intents.presences = False

bot = commands.Bot(command_prefix="!", intents=intents)
bot.add_cog(SlashCommandCog(bot))

bot.run("BOT TOKEN")
#
import discord
from discord.ext import commands

class SlashCommandCog(commands.Cog):
    __name__ = "slash_command"

    def __init__(self, bot):
        super().__init__(bot)

@commands.slash(name="hello", description="Say hello to someone")
async def hello(interaction: discord.Interaction):
    await interaction.response.send_message(f"Hello, {interaction.user.mention}!")
earnest phoenix
#

Because indents matter

long marsh
#

For folks that implement cooldowns for their slash commands, what is your preferred method? I've been using a redis cache with a TTL expiry (which works fine), but just curious if other folks do anything different. I thought about using the database as the source of truth, but felt that it would be wasteful.

frosty gale
#

the only annoying part is automatically clearing out old keys so they dont just sit around and collect

#

theres libraries that implement hashmaps with key expiry though so id use those

#

but they probably all just iterate over the entire map in an interval and check for expiry which can scale badly

long marsh
quartz kindle
#

but with slash commands it doesnt matter much because discord has their own cooldown for them

#

unless its something that is part of your bot, like game/currency stuff that the user can only do it once every X time

long marsh
earnest brook
#

how do i make the embed colorless or invisible? Like apollo

long marsh
earnest brook
amber quiver
deft wolf
#

If you don't specify any color, it will automatically be black afaik

#

They probably specified the background color of the embed as the color, which makes it look as if the color bar was not there

earnest brook
#

well still the same with no color assigned to the embed

tacit estuary
#

I'm still trying to find example code of how slash command with cog files work. I got the regular cog file for regular prefix command.

digital swan
tacit estuary
lament rock
#

It appears as though the default Discord dark mode background color has changed since I last checked. I use a nitro theme typically

#

I will have to get the hex codes again :(

lyric mountain
#

This way you don't need a second database and guarantee unexpected shutdowns don't affect it

lament rock
#

redis is ephemeral data anyways

tacit estuary
#

Anybody knows how to make a slash requirement optional for a str based answer?

For example.

"Enter your question."

But have it be where they don't have to ask a question.

tacit estuary
#

Good news I figured it out.

long marsh
tacit estuary
#

It takes one hour for slash commands to appear on other servers, right?

#

I used a direct thing to make them appear in my server right away for testing and just want to be sure.

earnest phoenix
tacit estuary
#

Really? Cause it only appeared in my test server.

lament rock
#

If you're posting to a guilded commands endpoint then that will be the case.
Global commands will appear within 10 seconds or less typically

#

Guild commands are also instant

#

It was only during the initial release of slash commands that they took an hour to appear in all servers

tacit estuary
#
self.tree.copy_global_to(guild=MY_GUILD)
await self.tree.sync(guild=MY_GUILD)

I think that might be reason.

#

I'm new to slash commands so don't curse me out.

tacit estuary
#

Just gonna copy/paste here and keep looking online and hope I get lucky.

#

Here is the current code that works perfectly, but it ONLY works in my test server with the test server "MY_GUILD" id number I use. Does not work in the other servers the bot is in. How do I make it work for all servers? I am new to slash commands. I have it set up where both prefix and slash commands can be used in both main file and cog files and want to keep it that way.

import discord
from discord.ext import commands

MY_GUILD = discord.Object(id=123123123123123123)  # replace with your guild id

class DiscordBot(commands.Bot):
    def __init__(self):
        super().__init__(
            command_prefix = '?',
            intents = discord.Intents.all()
        )

    async def setup_hook(self):
        await self.load_extension('cogs.Weather2')
        await self.load_extension('cogs.Fraction')
        self.tree.copy_global_to(guild=MY_GUILD)
        await self.tree.sync(guild=MY_GUILD)

client = DiscordBot()

client.run('Token')
tacit estuary
#

I got it figured out.

sharp geyser
#

Cause with dpy it is rather easy to use slash commands with cogs from what I recall

tacit estuary
tacit estuary
#

I got headache from discord buttons. That stuff is hard to my surprise. Sure making a simple button is easy enough, but you can't use it in a while loop since it ends in a def function with no escape. I checked and the code ends when it gets stuck in the REQUIRED def function for the callback of the button.

lyric mountain
#

you're just using the wrong approach for the problem

#

there aren't any limitations of what you can do with buttons, it's just that you need to develop your own solution if you want to go fancy

prime cliff
#

Hey anyone want to help test or try out Dev Space 👀 DM me for instructions.

Dev Space is a going to be a tool for other developers with server/project/website/logging/status management tools, dev tools like image gen/edit and bunch of other tools inspired from stuff like Sentry/Portainer/Pterodactyl/HetrixTools

You will need to already have nginx setup, 2GB ram minimum server and optionally MongoDB (Automatic install may work)

Demo version: https://devspace-demo.fluxpoint.dev
Changelogs: https://docs.fluxpoint.dev/devspace/changelogs
Source: https://github.com/FluxpointDev/DevSpace

stark abyss
#
server.js
app.post('/api/institution/studentRoster', (req, res) => {
  const { institution } = req.query;
  console.log("Request body:", req.query); 
  if (!institution) {
    return res.status(400).json({ error: "Institution name is required." });
  }

  const institutionData = institutionlist.find(inst => inst.name === institution);
  if (!institutionData) {
    return res.status(404).json({ error: "Institution not found." });
  }

  const students = studentList.filter(student => student.institution === institution);
  res.json(students);
});
#
api calls.js
export const fetchInstitutionStudents = async (institutionName) => {
  try {
    const response = await fetch(`http://localhost:3080/api/institution/studentRoster?institution=${institutionName}`);

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    return data;
  } catch (error) {
    console.error("Error fetching institution students:", error);
    return [];
  }
};
let s = await fetchInstitutionStudents("red");
console.log(s);
#

I dont understand why req.query is empty

wheat mesa
#

Are you sure the query is automatically parsed?

#

What does your console log show

stark abyss
#

Warning: Module type of file:///C:/Users/x/Desktop/ReactProject/ReactProject/src/apiCalls.js is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to

wheat mesa
#

What?

#

That doesn’t have anything to do with what I asked

stark abyss
#

the request body: {}

wheat mesa
#

Are you sure that your API framework’s object name is req.query

stark abyss
#

no i am not sure what i am doing

wheat mesa
#

Also, do you have it backwards? Isn’t it (res, req) not (req, res)

#

The order matters, if I am not mistaken the first argument is the response and the second is the request object

#

But I’m not sure, never used that framework

#

Ohhhh I see the issue

stark abyss
#

i am sure its req res

wheat mesa
#

Your endpoint is set up as a POST endpoint but your fetch call is by default a GET request

#

Your endpoint should be a GET endpoint

stark abyss
#
  const response = await fetch("http://localhost:3080/api/institution/studentRoster", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ institution: institutionName }),
    });

this isnt working either

wheat mesa
#

Because that’s not right

#

Make your endpoint a GET on your API

#

You are requesting information, you should not be using POST

stark abyss
#

oh

sharp geyser
#

This is starting to look like shit

#

@radiant kraken @civic scroll

#

🙏

#

Out here looking like Steam's default page for profiles

#

😭

civic scroll
#

calm down

radiant kraken
#

why not design the main page first

civic scroll
#

just put all the information on there first

sharp geyser
#

Cause idk what to put on the main page

civic scroll
#

this is too early to make a verdict

radiant kraken
#

you should plan out though figma first

civic scroll
radiant kraken
#

it's an e-commerce

#

same project we were working on before

sharp geyser
#

figma sucks for me

#

I hate it

radiant kraken
#

why?

sharp geyser
#

Cause I dont know how to use it

#

nor do I have the patience to learn

radiant kraken
#

but it's better to plan things out ahead first

sharp geyser
#

Not through figma tho

pearl trail
#

designing on the way is the best sunglas

radiant kraken
#

so pro

pearl trail
#

wdym

radiant kraken
#

i could never improvise on my design

#

it always look ugly

pearl trail
#

well same

#

like this for example, too basic

#

“simplicity” but no “creativity” 😭

radiant kraken
#

nahh

#

what about that social media

#

not basic 😔

pearl trail
#

but the design

#

is meh

radiant kraken
#

what about your website

#

not meh

#

but pro

civic scroll
civic scroll
#

but as far as things go it's already pretty well for a quest board

pearl trail
civic scroll
#

anything other than a rect is not my thing

#

@pearl trail oh yeah

#

you can also reference other quest screens in other UIs for inspiration

pearl trail
#

looks so 🔥 🔥 🔥

#

wish i got designing skill 😔

radiant kraken
#

look at ur website

pearl trail
#

does changing the white background from paypal's smart button make a trouble for me?

#

like legal stuff that i dont understand

fierce topaz
#

ummm

limpid onyx
pearl trail
#

okii thanks

surreal sage
#

nameserver propogation im gonna cry

#

millions must wait

frosty gale
surreal sage
#

celebrating my yummy isp ipv4 subnet in new year

frosty gale
pearl trail
#

didn't know AI can change their mind in the middle of generation 💀

lament rock
#

If this is gpt o then not surprising as it has so much more time to think and fact checking steps

prime crescent
rocky ocean
#

anyway to get my bot's status on topgg?

sharp geyser
#

Using a grid system, how do I center it on the page? I tried wrapping the grid in a flex box and aligning it on the center but that messes with the headline

#

I dislike the gap differences between the right and left

queen needle
#

Messes with the headline how so?

sharp geyser
#

It puts it next to it

#

Despite me using a different flex direction

#

I managed to get a desirable outcome

#

Except the title is not lined up

queen needle
#

How do you want the title lined up?

#

i came up with this

#

but it yields the same

sharp geyser
#
<div>
    <h1 class="text-6xl underline pb-4 ">Products</h1>
    <div class="flex flex-col w-full items-center">
        <div class="grid grid-cols-4 gap-4">
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
            <RadzenCard Variant="Variant.Filled" class="w-96 h-96">
                <RadzenText>Hello</RadzenText>
            </RadzenCard>
        </div>
    </div>
</div>
#

This is my html & css

#

I want the title lined up with the card on the left

queen needle
#

ohh

#

okay

sharp geyser
#

Similar to my first image

#

but I want the cards centered properly

queen needle
#

As in you want the title moved too? or like the left side of the card is in line with the end of the underline of the title

sharp geyser
#

Right

#

Idk how to explain it more clearly

#

See how in this first image I posted, it is lined up with the first card?

queen needle
#

yes

sharp geyser
#

I want the title to stay aligned JUST like that when the cards are centered

#

Although I think after playing around more I got my desired result anyway

#

I just modified the size of the cards as they did seem rather small, and then increased the gap between them

#

Still looks a little off, but tbf I dont think ima get it to look appropriately without sacraficing something

queen needle
#

like that?

sharp geyser
#

Similar to what I did yea

queen needle
#

stays aligned as it changes too

sharp geyser
#

Neat

#

The only thing not responsive on my page is the very top card

#

cause that one is annoying asf

#

💀

queen needle
#

do you need help making it responsive

sharp geyser
#

Im moving some things around right now to clean the code up

#

and I ended up fucking the layout up KEKW

#

Alright fixed the layout

#

making it responsive is too annoying tho so thats for a future project

queen needle
#

if you send it to me i can try and make it responsive and then just give it back

sharp geyser
#

I use a ui lib

#

so I dont think it will really work that well

queen needle
#

well as long as they accept classnames it would still be possible

dire bluff
sharp geyser
#

Which is the annoying part

#

I have to hope the children will inherit from the parent element and wrap it in a div

queen needle
#

oh that's stupid lmao

#

could you use another component library?

sharp geyser
#

Not really, its deeply rooted already

queen needle
sharp geyser
#

It'd be more work than its worth

#

Maybe in the future™️

queen needle
#

shadcn/ui if you ever change

sharp geyser
#

Yea I dont know why I didnt think to use shadcn

queen needle
#

what are you using?

sharp geyser
#

I use blazor so I just used whatever was easiest

#

and radzen is rather easy to setup

#

I know shadcn is node tho

#

so I dont know if it will work actually

small tangle
#

Im using MudBlazor which seems good so far pikathink

stone pilot
#

Hi guys

serene vault
sharp geyser
lament rock
#

Added a daily command for my bot that I'm rather proud of the effect. Had an artist draw the background

sharp geyser
#

Pog

small tangle
sharp geyser
#

Hello C# / Asp.net users / blazor users.

Since I am still fairly new to C# I am trying my best to make my code work. I have run into the issue where I have 2 sources of user information. One from my auth server that stores all the important information, and then my own database that stores other information like settings, what organization they belong to, and other important information. I am wondering how I can merge these two pieces of data into one class. Right now I parse it in an extension method on ClaimsPrincipal, which parses the claims from the OIDC request into a class

public static class ClaimsPrincipalExtensions
{
    public static AuthedUser ToAuthedUser(this ClaimsPrincipal principal)
    {
        var roleString = principal.Claims
            .FirstOrDefault(c => c.Type == "urn:zitadel:iam:org:project:297838639419752450:roles")?.Value ?? "{}";
        
        var jsonObject = JObject.Parse(roleString);
        
        var roles = jsonObject.Properties().Select(property => property.Name).ToList();

        return new AuthedUser
        {
            Id = principal.FindFirst("sub")?.Value,
            Email = principal.FindFirst("email")?.Value,
            EmailVerified = bool.TryParse(principal.FindFirst("email_verified")?.Value, out var emailVerified) && emailVerified,
            Expires = int.TryParse(principal.FindFirst("exp")?.Value, out var exp) ? exp : 0,
            FamilyName = principal.FindFirst("family_name")?.Value,
            GivenName = principal.FindFirst("given_name")?.Value,
            Name = principal.FindFirst("name")?.Value,
            Locale = principal.FindFirst("locale")?.Value,
            Roles = roles,
            Avatar = principal.FindFirst("picture")?.Value,
        };
    }
}

public struct AuthedUser
{
    public string? Id { get; set; }
    public string? Email { get; set; }
    public bool? EmailVerified { get; set; }
    public int? Expires { get; set; }
    public string? FamilyName { get; set; }
    public string? GivenName { get; set; }
    public string? Name { get; set; }
    public string? Locale { get; set; } 
    public List<string> Roles { get; set; }   
    public string? Avatar { get; set; }
}

Now i need to somehow add the data from my database. What do you guys recommend?

#

I thought about passing in the database context to this method, but then i'd be injecting the DB context in tons of pages

prime cliff
#

@sharp geyser you can use a static db cache tied to the users id or you can create a scoped service that will fetch and keep that info cached until the blazor session ends

sharp geyser
#

Im not quite sure I follow how that relates to what I asked.

prime cliff
#

Well you already have a user id you can tie to or at least the email

sharp geyser
#

Right, but what I was trying to ask was a way to merge these two sets of data into one.

#

Parse the data from the claims gotten from OIDC, and then grab data about that user from the db as well

prime cliff
#

You don't need to merge them entirely.
Also claims stuff is stored in the cookie which has limits and can be cleared so only good for temp data.
The scoped service itself is per-session aka each browser tab which can cache info for that session.

#

You can also just create a static db cache that can dictonary the id to user data and keep track of that.

#

Some databases can also join data based on the id from 2 tables instead of merging them completely.

#

Depends what you really want to do tbh there's a few choices to do either and C#/blazor can be flexible.

#

The OIDC handler can also be used to create user data or create claims on login too.

#

Cookie stuff can't be modified in blazor but you can trigger api controller routes that can modify or add cookies and claims.

small tangle
#

In my project im using JWT tokens for auth and implemented a custom AuthenticationStateProvider to determine if a user is authenticated, because i was running in the same issue of ending up with two different sources of information. (and because that was the only way i could make authentication work with interactiveserver rendermode since the identity stuff requires static ssr for their pages .-.)

prime cliff
#

You could do that too yea but i bit more complex

radiant kraken
#

@pearl trail can i ask u something about css grids

pearl trail
#

ask em and i'll try my best

radiant kraken
# pearl trail ask em and i'll try my best

so i have dis (ignore the fact that everything is ugly, im doing this for an assignment so aesthetics doesnt really matter)

the html:

<html lang="en">
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <main>
      <div id="content">
        <article>
          <h1>Test</h1>
          <p>This is an article text.</p>
          <img alt="The photo" src="https://picsum.photos/250/170">
        </article>
        <article>
          <h1>Test</h1>
          <p>This is an article text.</p>
          <img alt="The photo" src="https://picsum.photos/250/170">
        </article>
        ...

the css:

      main {
        padding: 2em 3em;
      }

      main #content {
        display: grid;
        grid-template-columns: repeat(4, calc(250px + 2em)); // ?????
        gap: 0.75em;
      }

      main #content article {
        background-color: green;
        display: inline-block;
        padding: 1em;
      }
``` how do i properly make a grid out of this? where every column adapts to browser's width

like if i shrink the browser's width, the column goes from 4, to 3, to 2, etc
#

i'm very new to grids so don't roast me

#

resources online suggest to use a media query but that's just stupid

pearl trail
#

that's almost right

#

just change the repeat, with repeat(auto-fill, minmax(min width, max width))

radiant kraken
#

oh really?

pearl trail
#

yep

radiant kraken
#

i dont know what im doing lmfao

#

idk what repeat or minmax is

#

😔

pearl trail
#

repeat is like how much cols you want and assign it's size

radiant kraken
#

OH MY GOD grid-template-columns: repeat(auto-fill, calc(250px + 2em)); WORKS

#

okay lemme see if i can try to center this

pearl trail
#

nice, but that'll have fixed size, so the contents wont be stretched based on the viewport's width

#

but it's up to you

radiant kraken
#

idrc because its for an assignment lol but how would a minmax work?

#

like the min width would be the width of each element right

#

and what about the max width?

#

100%?

pearl trail
#

nope, the max width each content will have. like minmax(200px, 300px), the grid will try to fill the whole width with the content able to stretch between 200px and 300px

#

so there's no gap on the left and right

radiant kraken
#

oooo interesting

radiant kraken
#

adding align-items: center; justify-items: center; to main #content didn't really work

pearl trail
#

you need display: flex for that to work

radiant kraken
#

oh a stackoverflow thread showed that it worked for grids too

pearl trail
#

oh, it basically a way how to center anything inside the parent

radiant kraken
#

can flexboxes have grid properties?

#

i may sound dumb ik

pearl trail
#

neko_think sorry idk about that

#

i rarely use grid because flex-wrap <3

radiant kraken
#

i thought since you're the css pro you would know about grids

pearl trail
#

not really 😔

#

haven't got into a case where i really need complex grid

radiant kraken
#

@pearl trail okay so i ran into another problem after switching to display: flex;

pearl trail
#

what is that

radiant kraken
#

the entire thing would become like after the images loaded

#

trying width: calc(250px + 2em); on each element didn't work

pearl trail
#

put that to main, not the #content, all the flex, justify, align

radiant kraken
#

huh

#

but wouldn't that make not much of a difference? since ```html
<main>
<div id="content">
<article></article>
</div>
</main>

pearl trail
#

where did you put the flex?

radiant kraken
#

main #content

#

after main #content there was supposed to be an aside but fuck it

pearl trail
#

if you use the translate method to center, then you do that on #content

radiant kraken
#

OH OH I FIXED IT WITH flex-wrap: wrap;

radiant kraken
pearl trail
#

nothing happens, but the #content wont be grid, it'll be like this

radiant kraken
#

it looks like this now ```css
main #content {
display: flex;
flex-wrap: wrap;
gap: 0.75em;
align-items: center;
justify-content: center;
}

#

now let's see if i can get the aside to work

pearl trail
#

flex-wrap can do basic grid works sometimes

radiant kraken
#

thanks <3

pearl trail
#

your welcome <3

frosty gale
#

i like how in css you can do the same thing in 20 different ways

radiant kraken
#

@pearl trail heya are you still awake

pearl trail
#

always

radiant kraken
#

<3

radiant kraken
#

uh how do i wrap the text in each element here so that instead of looking like this

#

it looks like this?

#

i tried text-wrap: wrap; but to no avail

pearl trail
#

huh, i don't get what you want

#

like, make the text
like this?

radiant kraken
pearl trail
#

if using text-wrap: wrap; and it's not working, try set the width

radiant kraken
#

set the width?

#
      main #content article {
        background-color: green;
        padding: 1em;
        min-width: 250px;
        flex-grow: 1;
      }
#

WAIT

pearl trail
#

ye, try set the width first

radiant kraken
#

YEAH THAT FIXES IT

#

💀

#

i am so dumb in css i swear

pearl trail
#

because the node doesn't know when to wrap the text, so you need to set the width to tell em

pearl trail
radiant kraken
#

i tried max-width no wonder it looked ugly lol

pearl trail
#

neko_think but it works right, the text-wrap

radiant kraken
#

this is max-width

#

ugly space 🤢

#

this is width

pearl trail
#

if you use min and max, set the width to 100%

#
min-width: 200px;
max-width: 300px;
width: 100%;
#

that should work

radiant kraken
#

alright i think i'm done :D it looks ugly but at least i got the layout to work!

pearl trail
#

good job!!

radiant kraken
#

how much do you know about css grids?

civic scroll
radiant kraken
#

i've also read about 1 / 5 span

civic scroll
radiant kraken
#

what about attributes like auto and auto-fill?

civic scroll
#

auto is size

#

auto-fill means to automatically fill the remaining space

#

minmax is to maintain grid cell size

radiant kraken
civic scroll
#

yes

#

auto is size

radiant kraken
wheat mesa
#

css is awful

radiant kraken
#

now i get you waffle

civic scroll
#

so say you want a column to take 100px, and the other to take the remaining space

wheat mesa
civic scroll
#

you'd say 100px auto

civic scroll
wheat mesa
#

my job is fullstack rn

radiant kraken
#

css is fun until grids

wheat mesa
#

and the css is a fucking mess

civic scroll
#

that's the same as saying "svg is hell"

wheat mesa
#

no grids are the only thing usable about css

civic scroll
#

anyhow

radiant kraken
#

i switched to flexboxes and it worked for me

wheat mesa
#

trying to do everything with flexbox will make you quit

radiant kraken
wheat mesa
#

use grid for layout, flex for alignment

civic scroll
civic scroll
#

you declare a size range for your grid cells (how small / large it can get)

radiant kraken
#

what is the fr unit again

wheat mesa
#

the french language pack

radiant kraken
#

thanks waffle

wheat mesa
#

you're welcome

radiant kraken
#

OH

#

so minmax() just guarantees min <= x <= max

#

just realized the css rabbit hole is way deeper than i expected

clear field
#

Tommorow my english exam cant accept that English and chemistry is thougt in it

viral rain
frosty gale
#

is it just me or did npm stop outputting a verbose output to operations by default now?

#

now all i see is a spinning bar when you used to see some verbose output

#

and you have no idea if its actually stuck or doing something

sharp geyser
#

They gotta keep you guessing

real rose
#

the output was different to normal

#

and it turns out my install was failing

frosty gale
real rose
#

I meant different to a normal fail KEKW It wasn't spitting errors out the wazoo

#

I've a feeling it was the terminal I was using

prime crescent
#

why is it so stressfull applying for privledged intents, i get its probably 90% a formality but i felt like i was at an FBI interview.

#

😆

neon leaf
#

wdym apply

solemn latch
#

Lmao

prime crescent
neon leaf
#

ah right 100+ servers

prime crescent
#

just hit 75 servers and got the most passive aggressive

"congrats! but if you dont apply were gonna block your bot lololol"

solemn latch
#

What privileged intents do you need?
The way you've described your bot it doesn't sound like it needs any 👀

prime crescent
#

server members for some custom role handling and welcome messages for the community server

message contents for all the commands, im not using slash lmao

solemn latch
#

Message perms are typically not given for not using slash commands.

prime crescent
#

hmmm, yes i see from this email i just got as well.

solemn latch
#

I don't remember if members is needed for welcome messages either.

prime crescent
#

why are they trying to force slash commands, theyre ugly and not used.

neon leaf
#

they are amazing

solemn latch
#

👀 I'm not even aware of bots not using slash commands.

neon leaf
#

^

proven lantern
solemn latch
#

Webhooks are indeed the way to go

prime crescent
#

i just like prefix better

#

might be nostalgia

solemn latch
#

Even small bots

#

I'd say 95% of submissions are slash

prime crescent
#

idk i just think / is clunky

#

takes up half the screen just to write a command.

solemn latch
#

Tbh, I don't even allow bots in my server that have message content intents.

#

Unsafe

prime crescent
#

i mean i guess, but its not really a problem on public servers. bot is not meant for private use servers.

#

If youre posting sensetive information on a public server 😆

solemn latch
#

It doesn't have to be sensitive info, just private conversations

#

Which happens all the time on larger private servers

#

Or even public servers

prime crescent
#

yeah but still, without prefixes what if you have two of the same bot that use the same name for a command?

solemn latch
#

Anyway, slash commands are good.

#

We have that happen all the time on the VC and it's never an issue 👀

prime crescent
#

yeah, i mean no reason to complain i gotta do it either way

proven lantern
solemn latch
#

You can also click on the bots name and it only shows commands from that bot

#

They've done a good job improving it since release

proven lantern
#

what happens if a bunch of bots have the same prefix now(back then)?

solemn latch
prime crescent
solemn latch
#

Noooo

prime crescent
#

lol

#

what are we not seeing

solemn latch
#

Back when we invited all approved bots to this server

#

When prefixes were normal

#

g!help
Was fun to run, and you know crash the discord server

prime crescent
#

😆

#

i see

proven lantern
solemn latch
#

You'd not be able to send a message in this server for a minute and just know someone ran a help command

solemn latch
proven lantern
solemn latch
#

Yeah

#

One large server join and you suddenly have 10% extra CPU usage and gotta upgrade.

#

Now it's not nearly as much of an issue

prime crescent
#

hmmm

solemn latch
#

When intents were added it was such a good time.

prime crescent
#

wdym

solemn latch
#

Before intents you had to receive every event(no matter what), so your CPU and memory usage were awful.

prime crescent
#

Hahaha i see

solemn latch
#

Large bots got cheaper servers pretty much instantly 😄

prime crescent
#

I got lots of work ahead of me, switch to a vps, switch to and refactor for a database, refactor for slash commands weirdsip

prime crescent
#

Wdym serverless

proven lantern
#

webhooks let you do it

solemn latch
#

Still using cloud flare workers ben?

proven lantern
#

never tried workers

solemn latch
#

Has it gotten expensive yet?

prime crescent
solemn latch
#

Thats right, someone else was doing workers.

proven lantern
solemn latch
#

How many events? 👀

prime crescent
solemn latch
#

I wish I knew how to explain serverless well

#

It's like putting your code globally, so there is no one server

prime crescent
#

Ooor

solemn latch
#

When it's done right it can't go down without some major outages.
It's really cool

#

Discord doesn't, you can use Amazon web services, cloud flare workers, whatever really.

#

My webhook site once to run on cf workers

prime crescent
#

So much API stuff, i dont know any of this 😂😂😂

solemn latch
#

Really cool workflow. But I wouldnt recommend it for you yet. You're on the right track right now

#

You'll learn serverless when you need it ^-^

prime crescent
#

Thank god for context clues

solemn latch
#

At least in software we don't name stuff like engineers do 😄

prime crescent
#

Haha yeah, but im getting the feeling that the more i learn and more “advanced” services and libraries i need. The more their names are from some brainstorm thinktank “how can we get the angel investor to dump their wallet on us”

proven lantern
prime crescent
#

MongoDB has DB, which at least half explains it. But before i got told it was mongo for humongous data loads or whatever, all i could think off was mongoloid 😭

proven lantern
#

cloud watch is annoying to use

solemn latch
#

I wish discord would focus more on webhooks for bots, would be cool to see.

proven lantern
#

and they need to tell us what quests are

solemn latch
#

Yeah that would be nice.

prime crescent
proven lantern
prime crescent
#

Just theorizing

proven lantern
prime crescent
#

Yeah, could allow for "user progression" beyond the scope of a bot message.

#

Seems like theyre more and more taking design tips from the chinese super apps

#

Discord gonna become the wests “everything” app

#

Not long before someone makes a ubereats ai agent so when youre gaming with ur friends you just say “bot order me a pizza” and it does so

#

Actually AI vc companion bot isnt a bad idea at all

#

Giving yall all my 300 iq brainstorms here

proven lantern
#

and then paint it red

prime crescent
#

😂

#

“Yeah this bot will order you a diet coke, just give us your adress, legal name and credit card information”

#

Dont even want to think about the data security needed for that

proven lantern
#

$5 convience fee added. plus tip

prime crescent
#

-# minimum tip of 20%
-# plus 15% service surcharge

proven lantern
#

Driver doesn't receive the tip either so you need some cash on you to tip them too.

prime crescent
#

Yeah and a monthly fee of $5 for “other”

proven lantern
#

inactive account fee of $30 per month

prime crescent
#

Account deletion fee of $100

#

I think weve got a good idea for a bot here, lets find an angel investor to scam

proven lantern
#

my website api gets a lot of requests. i didn't know it was that high.

lament rock
prime crescent
#

Thats cool, hope it comes to fruition

lament rock
#

Uncertain. It might be horribly limited since either the bot would have to know everything the client is doing or Discord would have pre-defined actions which could limit creativity with quests

#

Stuff like message content is already behind privileged access so it's unlikely that the bot would be the authority for quest completion

clear field
#

usually initiating a react app takes min 30mins on my pc even on 5G internet

earnest phoenix
#

Hi, I made a bot long time ago and I want to make it online again. So I followed the steps in Discloud but it says my requirement.txt is not correct. Then I reintalled my python application but it still doesnt work

#

ERROR: No matching distribution found for discord.py==24.3.1
This is error but i already reinstalled

earnest phoenix
#

or i change it in the requirement.txt?

earnest phoenix
#

nvm i just uploaded it

#

it says there's a code error but idk where specifically

#

how do i check?

solemn latch
#

Python typically will tell you the file location and line the error occurred on.

earnest phoenix
#

No module named 'discord' Does this mean i dont have discord.py?

earnest phoenix
#

i have this error but i have already got the discloud config in my project

earnest phoenix
#

but i have everything in my bot folder including the discloud config but it still doesn't online

clear field
#

or I think discloud doesn't accept python bots

earnest phoenix
earnest phoenix
clear field
#

did you added the main.py in discloud.config

earnest phoenix
#

like do i add the code in discloud.config?

#

or the file?

clear field
#

can you share the screenshot of discloud.config

earnest phoenix
clear field
#

no problem

wooden flame
#

كيف اجني عملات ديسكورد

#

الكريديت

clear field
#

لأنه بقدر ما أعلم، لا يوجد لدى Discord أي نظام ائتماني أو نظام كسب رسمي

wooden flame
#

المكافاة اليومية لااتسطيع اخدها ؟؟

#

يكتب لي هده الميزة معطلة

clear field
#

ولكن لأي بوت محدد؟

wooden flame
#

pro bot

clear field
#

هل لديك أي اسم بوت

wooden flame
#

اضن انه pro bot

clear field
#

ثم يجب عليك محاولة الاتصال بالمطورين

wooden flame
#

راح اصورها وارسلهالك فالخاص

clear field
#

نعم

wooden flame
#

رسلتلك خاص

pearl trail
deft wolf
#

The only thing I understand is pro bot

pearl trail
#

LMAO

quartz kindle
#

what language is that lmao

small tangle
#

I assume arabic

frosty gale
#

they have so many dependencies it might as well be an operating system from the complexity

sage bobcat
clear field
earnest phoenix
#

@clear field my code for discloud.config

clear field
earnest phoenix
clear field
#

yes but make a new folder

earnest phoenix
clear field
#

i mean move your bot files to a new folder

earnest phoenix
#

i just moved to a new folder

spark flint
#

why are good date pickers hard to come across for react NOOO

#

this one from Adobe is good but its so hard to adapt

#

or you get an outdated looking one like this

#

and what is this

solemn latch
spark flint
#

lol

prime crescent
#

After conversations with “bertha” from discord i was told i could have both slash and prefix commands

But then after asking if i could get the intents since she confirmed i could have both, she just ghosted me.

Bertha from discord is a cold woman

#

Bertha has taken the weekend off

pearl trail
#

yes you can have both, but not if only message command iirc, in summary, your bot need at least to implement slash command

prime crescent
#

gotchu, ive decided to prioritize slash commands either way.

just gotta refactor into cogs first as it will make everything easier, pain awaits. Should have used cogs from the start just didnt know what they were 😭

deft wolf
#

For Discord text commands (aka prefix commands) are not a sufficient reason for you to receive this intent

#

You must have any feature that actually needs this intent to function

prime crescent
#

So what youre telling me is to make a command that needs it beyond the suffix so i can use the intents, smart

deft wolf
#

Not really, I personally wouldn't do it just to use text commands

#

The less unnecessary events you get the better

prime crescent
#

Hmmm, my users are very accustomed to prefix commands though. But maybe its better to rip the plaster of right now rather than later

frosty gale
#

they have to be joking with that name

frosty gale
limpid onyx
prime cliff
#

Not twice the code or less intuitive if you know how to use it right Lul

prime crescent
#

But ive been pretty good at modularising so its not gonna be that much of a hassle to refactor into cogs and slash commands than i initially thought

prime crescent
warped summit
#

Any anime utility app name ideas? 😭

quartz kindle
warped summit
quartz kindle
#

rip

deft wolf
quartz kindle
#

that was actually the name of a thing i was working on many years ago

#

and i never finished

quartz kindle
#

degozaru-yo

warped summit
quartz kindle
#

lmfao

warped summit
#

😭

#

Peppy? Yasmine?

quartz kindle
#

kakoii

warped summit
#

Ayanna

warped summit
prime cliff
deft wolf
#

Name it after your favorite anime character

warped summit
prime cliff
#

crawnz blobwaitwhat

warped summit
#

Crawny

#

Omg your profile is so rainbow 🥹

#

Anyways imma try

prime cliff
#

Woof

sharp geyser
#

So I know KYC is about knowing your customer and collecting personal information to "prevent" fraud, but how exactly do you stay KYC compliant? What does it entail if anyone knows.

#

The articles i've read are just about collecting basic user information.

warped summit
#

Which is best to make it stay updating this webhook message every 5min or delete and send new boards?

deft wolf
#

I don't know if it makes sense to refresh them all every 5 minutes + this system makes it impossible to check last month's statistics if messages are deleted or replaced

#

Also why is there no second user in the month's statistics but there is one in the week's statistics

frosty gale
#

it also depends on the type of service like cryptocurrency, finance, etc

sharp geyser
#

Yea, I was looking at stripe and determining how I want to use them

#

I'd love to use my own UI but that means I have to keep up with my own KYC compliance

#

and as a small time dev I can't do that 💀

sharp geyser
#

I officially hate css

#

Why is the width and height so fucked

#

I am telling this div to take the full width and height of the parent div, but its just refusing to do so

frosty gale
#

static sizing being used somewhere in the dependency chain instead of responsive sizing type deficiency in skill (skill issue)

sharp geyser
quartz kindle
sharp geyser
#

The problem is

#

I have no idea what parent is influcing what

#

Since i use layouts the final resulting html is a div, inside a div, inside another div

#

💀

quartz kindle
#

well if neither of them have a fixed height, a percent height will not work

sharp geyser
#

I've tried changing the height and width of each but no dice

quartz kindle
#

a div with height: non-percentage-value

sharp geyser
#

Well I have this

#
    <MudMainContent Class="min-h-screen min-w-screen">
        <div class="p-4">
            @Body
        </div>
    </MudMainContent>
#

I then tried setting the inner div to have w-full and h-full so its as big as the parent

#

but that does nothing

quartz kindle
#

what css does that generate?

#

also why is Class capitalized

sharp geyser
#

min-height: 100vh and min-width: 100wh

quartz kindle
#

try without the min

#

i think height percentage doesnt work on a parent with min-height

sharp geyser
#

Wth

#

It works now weird

#

I tried it without min before and it caused overflow issues

#

Now it doesnt

quartz kindle
#

exdee

sharp geyser
#

This is why I hate css

#

I swear its black magic

quartz kindle
#

css > css frameworks

#

you only hate it because you use frameworks

#

:^)

sharp geyser
#

brotha I don't have the patience not to use a css framework

#

💀

quartz kindle
#

:^^^^^^)

sharp geyser
#

Im already building an entire marketplace

#

last thing I need is writing my own css all the time

quartz kindle
#

xD

sharp geyser
#

I might actually off myself (in game)

#

Anyway

#

Back to toiling away at this bullshit

quartz kindle
#

huehuehue

lament rock
#

HSV hue?

sharp geyser
#

I cry every day at how messy my aspnet code base is

#

then I wonder, is anyones code base not messy when doing stuff with asp net

#

💀

#

Like it seems impossible to make it truly organized

prime cliff
#

lmao skill issue

sharp geyser
#

man

#

thats not nice :c

prime cliff
#

The thing about c# is that your code can be stored pretty much anywhere in your project folder, you don't need to set modules, init functions or worry about node packages breaking stuff.

My code is always messy anyway 🙂
So worrying about how messy your code base is can just be easily improved with folder structures and minor namespace changes, you're really worrying about nothing compared to other langs.

sharp geyser
#

What the fuck does this mean

#

I am confusion

#

Not seen this error before

#

More context, right above it, it states the ws connection succeeded

#

Seems to be a dotnet watch thing

wheat mesa
#

SignalR is a wonderful thing isn’t it

sharp geyser
#

No fucking clue what signalR is tbf

#

but it seems annoying

wheat mesa
#

It’s the websocket that a lot of ASP.NET APIs use

sharp geyser
#

Also

wheat mesa
#

I believe blazor server uses it by default

sharp geyser
#

Please explain to me how the fuck a class is null

wheat mesa
#

Wdym

sharp geyser
#

I am instantiating a class and getting an Object reference not set to an instance of an object error

wheat mesa
#

Constructor is expecting something that isn’t null?

sharp geyser
#

Thats the thing im giving it everything it is asking for

#

and i made sure none of it is null

wheat mesa
#

Show

sharp geyser
#
var options = new AccountCreateOptions()
        { 
            Type = "express", 
            Email = _zitadelUser.Email, 
            Capabilities = new AccountCapabilitiesOptions
            {
                Transfers =
                {
                    Requested = true
                },
                TaxReportingUs1099K =
                {
                    Requested = true
                },
                CardPayments =
                {
                    Requested = true
                },
            },
            BusinessType = "individual",
            Controller =
            {
                Fees =
                {
                    Payer = "application"
                },
                Losses =
                {
                    Payments = "application"
                },
                StripeDashboard =
                {
                    Type = "none"
                },
                RequirementCollection = "stripe"
            },
            Individual =
            {
                Email = _zitadelUser.Email,
                FirstName = _zitadelUser.FamilyName,
                LastName = _zitadelUser.GivenName,
            },
        };
#

_zitadeluser isn't null, neither is email, family name or given name

wheat mesa
#

What’s the full error

sharp geyser
#
MercatusWeb.Components.Pages.Users.Onboarding.CreateStripeAccount() in Onboarding.razor
+
        var options = new AccountCreateOptions()
MercatusWeb.Components.Pages.Users.Onboarding.OnInitializedAsync() in Onboarding.razor
+
        await CreateStripeAccount();
Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.<WaitForNonStreamingPendingTasks>g__Execute|43_0()
Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.WaitForResultReady(bool waitForQuiescence, PrerenderedComponentHtmlContent result)
Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.RenderEndpointComponent(HttpContext httpContext, Type rootComponentType, ParameterView parameters, bool waitForQuiescence)
System.Runtime.CompilerServices.ValueTaskAwaiter<TResult>.GetResult()
Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext+<>c+<<InvokeAsync>b__10_0>d.MoveNext()
Microsoft.AspNetCore.Builder.ServerRazorComponentsEndpointConventionBuilderExtensions+<>c__DisplayClass1_1+<<AddInteractiveServerRenderMode>b__1>d.MoveNext()
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
#

It is saying line 40 which is var options = new AccountCreateOptions()

#

checking the stripe docs i've provided every required property

wheat mesa
sharp geyser
#

You technically don't need to use new here

#

since it already knows what it is supposed to be you can just do {}

#

I can try it with new and see if thats the issue though

#

yknow what

#

you are right

#

that was the issue

wheat mesa
#

I was gonna say

#

I didn’t think that was a valid way to initialize things

#

I’m surprised it wasn’t a syntax error tbh

sharp geyser
#

Im shocked to

prime cliff
#

@sharp geyser how are you setting the options part?
If you're running OnInitializedAsync then it would be fine but OnAfterRender and OnParameterSet means that the page is being loaded first which will be null until it fully renders and then sets it.

eternal osprey
#

hey guys, i currently have a sqlite table setup, and my column was actually setup to be a datetime.
However, am i able to transform it to text instead, without having to remove all the data in the .db file?

#

i don't think so tbf, but figured to ask..

compact condor
#

also dont forget to rename the new table to the name of the old after the transfer and dropping the old one

frosty gale
#

keeping it as datetime is extremely flexible

#

and you can convert it into a string at any time

sage bobcat
#

One message removed from a suspended account.

lavish drift
#

Does anyone know what the syntax is for a command that creates a "private" thread? I only want the user that creates the thread (the user that sends the command) and the bot to be able to see / reply in the thread

deft wolf
#

Depends on the language and/or library if you are using any

lavish drift
deft wolf
#

Unfortunately, I don't know much about python so I can't help you with this one 😔

lavish drift
solemn latch
solemn latch
#

Channel#create_thread
type must be set to private

prime crescent
#

Hi, anyone that can help me with discord.py?

im converting to cogs, which worked fine for me when testing. but now when i try to introduce it to my main script its not working:

i believe the issue is that i sort my cogs inside the cogs file, and that im not handling that properly. But im pretty useless with cogs so if anyone can assist that would be great.

#

it says theres no package specified for AuraCog but i have the setup function in the script.

prime crescent
#

guys nvm im just stupid

#

fixed it

radiant kraken
#

@civic scroll @pearl trail when you write a search box, do you guys make the search button inside the <input> element or outside?

#

if i do the latter it's so hard to write hover rules without using javascript 😭

radiant kraken
#

sorry for asking such a superficial css question

civic scroll
#

idk how it behaves if you put that inside

radiant kraken
#

that every app has

#

😭

#

i really wanna add it but that would mean i need to write some js

sharp geyser
#

erm

#

hun

#

make the input type search

#

it comes with it

#

You can then style it afaik

civic scroll
sharp geyser
#

Doesn't the default "search" input come with the x

#

it is also styleable as far as I know

radiant kraken
#

it's just

#

when you type something you couldn't go past it

#

which means the <input>'s width decreases

#

on focus

civic scroll
radiant kraken
#

@pearl trail teach me pro

pearl trail
#

sayuri more pro

civic scroll
pearl trail
#

but anyways, that parent div is used to make em flex and be "1 component"

civic scroll
#

you don't have to remove the x button

radiant kraken
#

i make the button transparent?

civic scroll
#

rather make it 0 opacity

#

and unclickable

clear field
civic scroll
#

or yk, disable the button and make it 0 opacity

radiant kraken
#

then what if i wanted to type something in the search box

civic scroll
radiant kraken
#

but my cursor is on the invisible button

#

so it couldnt click it

civic scroll
#

that would make the input underneath capture the mouse click instead

radiant kraken
#

WAIT

#

YOU CAN DO THAT??

#

i am so noob ngl

civic scroll
#

you are so learning

sharp geyser
#

Im confused on whats happening

radiant kraken
#

oh my god i hate this x so much

pearl trail
#

x

radiant kraken
pearl trail
#

hm, i prefer rem

radiant kraken
#

like is this ok

#

cc @civic scroll

pearl trail
#

rem is based on root, em is based on parent

radiant kraken
#

hm

#

lemme see if i replace every em with rem

pearl trail
#

just like tailwind, it use rem everywhere

radiant kraken
#

oh it broke my website

solemn latch
#

Itll do that

civic scroll
#

otherwise no

#

em is affected by local font size

#

while rem uses the font size used by the :root element

radiant kraken
#

i used em for everything because if i used px that would be bad

#

thats what i thought at least

civic scroll
#

so 2.5rem by default is just calc(2.5 * 16px)

solemn latch
#

I think one of the benefits of rem is devices can change it.

For example someone who has their device configured to show larger text it will scale with it.

civic scroll
#

yeah

solemn latch
#

You can use em in places you dont want to allow scaling

radiant kraken
#

like what?

solemn latch
#

Things that cant scale

#

Like a box that has a hard coded width.

radiant kraken
#

aw

#

bummer

sharp geyser
#

Stuff like product cards

#

I assume anyway

#

Since typically you set the widths based off breakpoints

#

and scaling can fuck those widths

#

Though im not entirely sure 💀

#

frontend is not my mojo

solemn latch
#

I'm still awful at it 😄

mystic matrix
#

hi

green kestrel
#

cant wait until dpp 10.1 is ready to release... running it on a test bot and im like 😮

#

this memory consumption isnt really going to increase on that bot

#

we removed the need for a crapton of threads, seems the threads were adding a fair bit to memory use (same bot was 65mb before)

pearl trail
#

anyone know how to "force" these selections to appear on top? i tried finding on internet and mostly they said make selection from scratch

clear field
#

hey i want to add russian roulette to my discord casino bot Dyse please give suggestions on what i can do i have never played it before just have a little knowledge of what happens

#

but i dont want anyone to be kicked or banned

#

just a harmless cute little bot😘🥰

solemn latch
#

😠 come on discord. ratelimits on oauth?

sharp geyser
#

Makes sense

solemn latch
#

Probably ratelimited per account, right?

sharp geyser
#

Probably the app itself requesting them

solemn latch
#

I spammed sign in button on my site. Trying to redirect banned users.

prime cliff
#

You're meant to store the tokens until they expire too so makes sense to ratelimit it

solemn latch
#

But it was only like 5 requests, so its oddly low

green kestrel
#

from the same IP?

prime cliff
#

That says requesting many tokens though

solemn latch
#

ye

green kestrel
#

and for the same account?

solemn latch
#

yep

#

I'm assuming its per account

green kestrel
#

I think the limit is on tokens per min per account

solemn latch
#

yeah

prime cliff
#

I think you're doing something wrong maybe log the requests you're doing

green kestrel
#

you shouldn't need more than one as it should cache success

solemn latch
#

I mean, I was signing out and back in. Which the correct thing to do is get new tokens right?

#

each one was a fresh signin

prime cliff
#

Normally you would not be spaming logout and login though

solemn latch
#

yeah, its not an issue at scale. Just seems oddly low

#

if its per account* which it should be

clear field
solemn latch
#

I store the refresh token, but the oauth spec I think wants you to request a new one on each fresh signin

prime cliff
#

Hmm lets try something

solemn latch
clear field
#

hmm

#

seems interesting

#

i'd try to do more reasearch on this

#

Thanks😘❤️

solemn latch
#

Thankfully its a really simple game to program and should only take a couple hours to do.

prime cliff
#

Hu that's strange the token endpoint dosen't have ratelimit response headers ThinkOwO

prime crescent
#

all of these have 1-4 user commands that i have to change into cogs and slash commands

30 commands, in addition to having to change everything from ctx to interaction

😆 🔫

this is to the point of writing a script to do it for me.

prime cliff
#

Uh oh i just broke Discords oauth

spark flint
#

lol

prime cliff
#

@solemn latch yea not getting any ratelimit headers or ratelimits in general on /oauth2/token either that or you're hitting some kind of spam limit that shouldn't normally be hit.
Your oauth might be spamming or duplicating oauth token requests for a single user.

solemn latch
#

Its not oauth spam, my logs showed 10 requests in a couple minutes(due to me manually hitting sign in)

#

just was going a little too fast 😄

prime cliff
#

Hitting sign in multiple times shouldn't cause multiple requests either

solemn latch
#

👀 wdym, discord has to validate it.

lament rock
#

I think the main issue Builderb is trying to get across is that the logs should only show one attempt being made at either signing in or signing out. Any other amount is a bug

delicate wigeon
#

Does top.gg test bots in this server or another server?

real rose
#

Another server

delicate wigeon
# real rose Another server

Could I potentially get the id of that server so I can exclude it in my join guild leave clause?
I can share the code with you if that would be better too as to not breach any security, I just dont want it in any servers besides my os and the test server for you guys ^^

digital swan
#

Why would you want it on top.gg if you don’t want it in servers

delicate wigeon
#

Plus top.gg is good for getting bots out there, its trusted, known, and widely available

#

(And I would like to have my message intents remain on my bot since I use it as a moderation service in its OS too, and use prefix based commands there since that should remain the only server my bot is in)

gilded plankBOT
#

@delicate wigeon

The only guilds we might invite your bot to regarding Top.gg-related things such as verification or polls are:

  • 333949691962195969 - Top.gg Verification Center
  • 264445053596991498 - Top.gg
  • any guild owned by a user with the role <@&767389896133443625> in this server.

Any other guild claiming to be affiliated with Top.gg's verification is very likely false.

earnest phoenix
#

Is there any sort of algorithm on top.gg?

rugged dawn
earnest phoenix
#

like do bots get an initial push when they are verified?

#

like in search terms

hardy coyote
#

hi

prime cliff
#

Lol that's crazy Microsoft updated their store policy and my rpc app cant use "discord" in the description 001_NK_XD

surreal sage
#

ndsuiysdngdx

sharp geyser
#

I have this h1 on my page, and for some reason its auto focused and scrolled to. Anyway to prevent this behaviour?

pearl trail
#

is there tabindex=-1 on the h1?

sharp geyser
#

no

#

but i'd rather not put tabindex on every element

#

because if it isn't that one its another one it focuses on

pearl trail
#

think like once the page loaded, it immediately focus and scroll to that h1?

sharp geyser
#

yes

prime cliff
#

@sharp geyser blazor has a component tag that does that check your App/Routes part, the box thing on focus shouldn't be doing that unless you have an accessibilty option or you tabbed to it or some css is doing that

sharp geyser
#

Why is this a fucking thing

#

💀

pearl trail
#

💀

sharp geyser
#

And enabled by default

pearl trail
#

is that vue?

sharp geyser
#

Blazor

#

C# thang

pearl trail
#

oh

prime cliff
#

Accessibility ✨
Idk why tbh its in the template

sharp geyser
#

It is a stupid accessiblity option

#

and to be enabled by default in a template

#

💀

pearl trail
#

h1 by default is not focusable tho, or it should be not focusable

sharp geyser
#

You solved me a lot of headache

prime cliff
#

Press tab a few times and you can see

sharp geyser
#

Ion see nothing

pearl trail
#

hmm yeah i can see that

sharp geyser
#

Maybe mine is broken

pearl trail
#

there's no this thing?

#

the blue box

wheat mesa
#

I had to write a tab navigation system in my work project

#

But in raw razor with jquery MVC

#

It was awful

prime cliff
#

Yea the blue thing is the selector

sharp geyser
tacit estuary
#

Why is there two of them and why do neither of them go away when the test bot is offline?

deft wolf
#

One is registered globally and second one is probably registered on this specific guild

#

And the status of your bot has no influence on whether commands are displayed or not. Commands are registered and Discord stores them. Your bot does not have to be online for them to appear in the client

tacit estuary
#

Oh. So what happens if one command is no longer needed?! Is it forever stuck there?

deft wolf
#

You can delete it using the API

hidden gorge
#

could there be a reason why my site on NGINX randomly died last night for no reason everything is running

#

i made 0 changes it just stopped...

#

NGINX Proxy setup:

hidden gorge
solemn latch
hidden gorge
solemn latch
#

I'd look at error first. but both

hidden gorge
deft wolf
#

Leaked ip 😔

delicate wigeon
#

He tried to hide it but hiding it doesn't matter, can reverse domain search too usually

hidden gorge
#

Just found the issue

#

weirdly last night it was working on port 8000 but NGINX was set to 8080 just changed the port on the server.js and it works now

#

idk how it was running

delicate wigeon
#

Curiosity kills me here bc I have nginx setup too, do you not serve https? Or is the ssl cert and stuff setup in another file

delicate wigeon
#

||I think activities force you to use https for their connection, which is why I ask, and usually you reverse proxy for either load balancing or multiple domains across a single ip adress||

hidden gorge
#

tbh i just followed an article on how to Reverse Proxy a domain with NGINX so idk

#

im very new to NGINX

hidden gorge
solemn latch
#

Their https comes from cloudflare then

delicate wigeon
#

Bidoofbutt alright! Like I said, I was just curious. Ive done quite a bit with it now, so had to ask
I self sign certs with certbot with use my https

#

Ah

#

Okay

hidden gorge
#

learned something new today

deft wolf
#

Cloudflare my beloved

hidden gorge
#

used it with Firebase a while ago 💀

#

pain

delicate wigeon
#

I avoid it bc Ive never used it Psy2Hie
I went through the process of setting up nginx and then went from there, and then figured out you can use nginx to server multiple domains/subdomains sooooooo

#

After I had already bought a second IP address for my server ofc

delicate wigeon
solemn latch
#

Just make sure you have ddos protection using a setup like that.