#development

1 messages · Page 1958 of 1

boreal iron
#

Shut up! spongery

#

They always can

earnest phoenix
#

C# not dead

#

All be it if you're not using it for game dev in unity then you really have no other major use for it tbh. At least I cant think of one rn

sudden geyser
#

even with that game dev industry is probably the worst option left

#

you see how those devs get treated with all that crunching

earnest phoenix
#

lol

#

yea a lot of people are starting to use Unreal Engine now

#

which uses C++

sudden geyser
#

I pray for their sanity.

earnest phoenix
#

Unreal is just too much

sudden geyser
#

or hope they use something higher level

earnest phoenix
#

What is higher level ?

quartz kindle
#

pure css3 3d engine

#

:^)

earnest phoenix
#

Also as for ur earthquake idea how would you even get the real time data. No api that I know of gives out that kind of info

quartz kindle
earnest phoenix
#

Lmao

#

What other languages do u know

#

Do you know java?

#

ez make a game in js

quartz kindle
#

c++ looks less complicated than c# lmao

earnest phoenix
#

Just make a game in js

#

I can agree with that

quartz kindle
#

i mean

#

to me its easier to understand simpler stuff than those 10 billion different namespaces and classes that java and c# have

#

literally everything is SomeBIgAssNamespace.SomeClassThing.SomeConstructor.SomeMethod

#

yeah but it can be made simpler lul

#

im kinda tired of oop tbh

#

im starting to like funcional again

earnest phoenix
#

I didn't understand the difference between OOP and functional tbh

sudden geyser
#

There is no escape from the "get this" "get that" philosophy of Java

earnest phoenix
#

never cared enough to look it up

sudden geyser
#

Functional programming is about using functions as much as possible

#

At the highest level

earnest phoenix
#

and OOP?

#

So im an OOP guy then

#

I use classes like a mf

sudden geyser
#

OOP is more about coupling data and code together with objects

quartz kindle
#

classes are good when they fit the use case, but then they dont fit, its a giant mess

sudden geyser
#

It's hard to describe given there are two kinds of OOP

#

The original not being about what we see today

earnest phoenix
#

ok it just doesn't embed

#

I thought I fucked it up

#

Anyway, that library looks rather neat

quartz kindle
#

see people? thats how you make a good website

#

clean, beautiful and above all fast as fuck

sudden geyser
#

well it just has nothing to display

#

I swear 99% of the resources went to those blocks in the background

earnest phoenix
#

lol

#

that is the graphics library minecraft uses

quartz kindle
sudden geyser
#

wait, since when does top.gg use graphql

earnest phoenix
#

for a while now i think

#

Can someone tell me the difference from Set.entries and Set.values

#

Set doesn't have a key,pair relationship so I see no reason to have values and entrieis methods

quartz kindle
#

it doesnt really serve any purpose

#

Set.keys and Set.values return the same thing

earnest phoenix
#

I see

quartz kindle
#

Set.entires returns an array of [key,value], which are both the same thing

slender thistle
#

When a dictionary fan works on your classes

earnest phoenix
#

Yea

#

but not with a Set since it has no keys

#

It just returns an iterator like the rest of those

quartz kindle
#

i dont think i've ever used Set anywhere

#

always felt useless lmao

earnest phoenix
#

I was using set to make a remove duplicates method on Array

quartz kindle
#

ah yes, thats a good usecase

earnest phoenix
#
Array.prototype.removeDuplicates = function () {
  return new Set(this).values()
}
quartz kindle
#

i dont remember if i ever tested performance for that

earnest phoenix
#

lel

quartz kindle
#

lmao

earnest phoenix
#

I also attached a random method to an array

#
Array.prototype.random= function () {
  return this[Math.floor(Math.random() * this.length)]
}
quartz kindle
#

xD

earnest phoenix
#

Cause why not

#

Never know when ima need to get something random from an array

#

I might learn java on the side to mess around with that game library

#

It would be a fun project

earnest phoenix
quartz kindle
#

wait i think im doing something wrong

quartz kindle
#

but if more than 10-20% of them are duplicates, then Set is much faster

earnest phoenix
#

Makes sense

#

So I made something that isn't absolute shit

quartz kindle
#

with 100% uniques, object lookup took 8 seconds, map lookup took 8.6 seconds and Set took 9 seconds

#

with 100% duplicates, object and map took the same time as before, but Set took 1.3 seconds

earnest phoenix
#

So in some situations Set is a obv better choice

quartz kindle
#

yeah the more duplicates the better

mortal snow
#

could I possibly send you my command list in dms and you could tell me what commands are fair to have and what ones arent?

wheat mesa
#

I can’t even come up with ideas for 250+ commands I don’t even know how people manage to do that

earnest phoenix
#

They copy other bots

mortal snow
#

So probs came from memory of me using commands

earnest phoenix
#

so therefor copied other bots

mortal snow
#

Yeah I guess so but techincally every bot is a copy of another one

#

Plus 40% of the commands are probably just the config commands for other commands

#

Plus everything is worth a shot I wanna take where my bot is now and make it much better

earnest phoenix
#

Honest command count above 50 is too much

mortal snow
#

Could I send you the command list in DM’s? Cuz like I wanna make the perfect bot

earnest phoenix
#

No ty

mortal snow
#

Ok

lyric mountain
#

It's like saying tekken copied street fighter because it's a fighting game

mortal snow
#

Yeah true

#

Idk man I am new to this bot thing Shrugs

lyric mountain
#

There are also some bots which are the first of a kind

#

Like Tim's bot (not anymore probably, but was)

#

So all hope is not lost, you just need to find out what people want, and what you're willing to commit your time into

mortal snow
#

Would it be smarter to work on 1 section at a time like first moderation commands then fun commands then mini game commands ect ect..

lyric mountain
#

I can only say for myself, but I like to start with a generalist bot

#

Then specialize it on the go

#

Unless you know what you'll choose for it already

mortal snow
#

I just want to make top quality bot that’s free for everyone to use

lyric mountain
#

There's no top quality

#

It's not something you can be "the best"

mortal snow
#

By that I just mean good quality bot

lyric mountain
#

Starting with a generalist bot helps establishing a stable foundation

#

You'll setup your core structure, the longer you spend on it the bulkier it'll be

mortal snow
#

If I was to do that it’d be smarter to hire a developer instead of just paying one big fee wouldn’t it?

lyric mountain
#

My bot started as a tool for my server, things I missed in other bots or that I thought was badly implemented

#

Over the time it steered toward card collection

earnest phoenix
#

Honestly stop making multi-purpose bots 😩

lyric mountain
#

Now it's major focus is TCG

#

Multi purpose is good for a first project

#

Helps a lot learning fundamentals and improving techniques

earnest phoenix
#

yes but trying to make it successful in todays market is like beating a dead dog

lyric mountain
#

You don't need to be the next mee6

mortal snow
#

I don’t care about it being successful tbh

#

I just want a good bot that’s free to use

earnest phoenix
#

Yea but those who try to be the next mee6 or even more successful are beating a dead dog

lyric mountain
#

Experience is worth more than focusing on breaking the bank on the first try

#

You'll just exhaust yourself and give up to frustration

earnest phoenix
#

mee6 was here before the market was even a thing mmLol

earnest phoenix
#

but tbh I feel like focusing on a specific goal like Moderation or a game bot is a better idea

lyric mountain
#

As I said, start with a multi purpose then specialize over time

earnest phoenix
#

ye

#

Also KuuHaKu ur a java guy right? Where did you first start learning java? Was it like in a class or just on ur own

lyric mountain
#

Well, both I guess

#

Everything started with android studio I guess

#

During university I had to make a graduation project, and I'm kinda like 3d modeling

earnest phoenix
#

oh sick

lyric mountain
#

But finding the exact textures I need is quite exhausting

#

So I had the idea of making a photo-to-texture generator

#

Thing is, I sucked at performance, but I liked the syntax of java

#

Idk

#

That's where discord comes, my bot started as a JS project, but I hate how js is so lenient

#

Then I found out java was valid for making a bot as well, so I began practicing with it to learn new ways of reducing processing time

#

In the end, the project was indeed a success, and I got stuck to java

#

That's how I met java

earnest phoenix
#

Entire plot to "How I met your mother" but java edition

lyric mountain
#

You got the reference yay

earnest phoenix
#

lol

#

I was thinking of learning java or at least tinkering with it but wasnt sure if I should

#

My attention span is 0 and when I cant come up with something to make I just get rid of the idea of using the language

lyric mountain
#

Find what you like

#

And try to make tools for it using the language you're trying

#

Try to make your hobbies easier, or automate tasks

errant flax
#

how do i make my array like has five strings in it how do i do that? weirdsip

lyric mountain
#

What?

earnest phoenix
#

depending on the language

let arr = ['Hello', 'World']
slender thistle
#

cracks fingers

earnest phoenix
#

that is how u make an array of strings

earnest phoenix
errant flax
boreal iron
#

Oh no we’re loosing another one to Java, god save us

errant flax
#

basically it uses the spread syntax

earnest phoenix
boreal iron
#

lol don’t start a comparison between Java and php

earnest phoenix
#

hmph

#

html > php mmLol

lyric mountain
#

Just stay away from jdk 8

boreal iron
earnest phoenix
#

wuts wrong with jdk 8

lyric mountain
#

The reason for hatred against java is due to jdk 8

earnest phoenix
#

icic

lyric mountain
#

It's like playing minecraft beta

#

It's old

#

It's coarse

#

And it gets everywhere

earnest phoenix
#

Ah

lyric mountain
#

Too many leaks, way too verbose, little QoL

earnest phoenix
#

Also wtf, I thought I ordered meatt witth my taco not a fucking shell sad

lyric mountain
#

My recommendation is start with AT LEAST 11, but newer versions are just as fine

#

11 contains many improvements, I can't list them all really

earnest phoenix
#

I think I have the latest jdk version installed cause of mc 1.18

boreal iron
earnest phoenix
#

FakE php user

boreal iron
#

Proud php user

boreal iron
#

Never heard of push?

lyric mountain
#

Errr

#

Why concat an empty array with a newly generated one

earnest phoenix
#

I am not even going to mention how cursed that looks

boreal iron
earnest phoenix
#

dont question it haku

#

let it remain cursed

lyric mountain
#

Welp, I'll begone for now, bye guys

earnest phoenix
#

oof bye haku

boreal iron
#

bei

crystal wigeon
#

hey umm

#

is Interaction.reply not a thing anymore??

pale vessel
#

That's the base Interaction

#

It doesn't have the reply method

crystal wigeon
#

hey so,

#

when i use Math.abs on a 18bit string. its converting the last 2 digits to 00
ex: Math.abs("854250285334112513") -> is converted to 854250285334112500.
Is there a way i can tell it to not to that or something?

boreal iron
#

Calculate with bigints

crystal wigeon
#

how

crystal wigeon
#

will it convert the -123123 to 123123??

#

ig not

boreal iron
#

It will allow you to calculate numbers larger than the max interger

crystal wigeon
#

thanks

woeful pike
errant flax
#

thx

pseudo otter
#

oh it's with you too

#

same with me

#

but maybe i did something wrong

#

yes 15 mins ago

#

yes,

earnest phoenix
#

im connecting to api using websocket but it closes connection after 1 minute

#

no errors, why is it happening?

#

wait

#

i forgot xd it was commented out for some reason

quartz kindle
quartz kindle
#

you can check it by doing number.toString(2).length

crystal wigeon
#

i still didnt understand why Math.abs doesnt take more than 16 digits

quartz kindle
#

because js does not support 64 bit integers

#

all numbers in js are double precision floats, which have a maximum integer space of 53 bits

crystal wigeon
#

i see, so using bitint is an alternative

quartz kindle
#

for anything bigger, you need to use the dedicated BigInt values

slender wagon
#

so i am making a bot that handles purchases on my site, like when u buy something from my site the bot is supposed to send a message

#

what could be the best way to trigger that

crystal wigeon
#

you can have the bot running on your server and just make api calls to backend which sends out messages

uneven tartan
#

thats better than what i was typing

slender wagon
#

they are spereated

crystal wigeon
#

you can still use a server and log your bot in

#

thats what im currently doing. even mine is separated

slender wagon
#

right

uneven tartan
#

imo best way would be this:
use oauth to sign into your site, and get users id, send trigger on purchase, check if in discord server, if yes then send message

crystal wigeon
#

make api calls to the server which has your bot logged in

slender wagon
#

the only problem is the call to the bot to send the message rn

crystal wigeon
#

yeah you can trigger that by using another server to listen to routes then just call the client to send DMs

quartz kindle
#

just send it via http, no need for a client

crystal wigeon
#

^

slender wagon
#

ended up just running the bot on the site server too

#

makes things way easier

earnest phoenix
#
class Manager {

    constructor(options){

        this.ops = options;

    }

    First()
    {
        // Another File

        class first {
            constructor() {}

            FirstSecond() {}

            FirstThird() {}

        }

    }
}

module.exports = Manager;


how can i do that Manager.First.FirstSecond()
wheat mesa
#

Make First a property on Manager

earnest phoenix
#

@rustic nova

earnest phoenix
quartz kindle
quartz kindle
#

also, you want to do this? js manager.First.FirstSecond(); or this? ```js
const first = new manager.First();
first.FirstSecond();

earnest phoenix
#
const Tickets = require("./TicketManager");

class Manager {

    constructor(client, options){

        this.client = client;

        this.ops = options;

        this.Collector = require("./ClientInteractionCollector")(client);

        this.TicketManager = new Tickets(client, options);

    }
}

module.exports = Manager;

Manager.TicketManager.Send(msg, {
            channel: msg.channel
        })
#

This works good

quartz kindle
#

👍

earnest phoenix
#

Idk if it is true

quartz kindle
#

yes that is the correct way to do it

cunning gust
#

any mod?

#

My bot is not responding

pale vessel
#

What bot

cunning gust
#

moderation and music

#

can you help me to fix

#

the issue

#

?

split hazel
#

my bot is responding

#

:)

cunning gust
fringe locust
split hazel
#

my man just violated me

cunning gust
quartz kindle
earnest phoenix
#

replit

blissful falcon
#

Hello, how can i deploy my slash commands globally?

quartz kindle
#

google compute engine, galaxygate, hetzner

earnest phoenix
#

and vercel for nextjs

winter pasture
#

GCP

quartz kindle
#

idk, i paid with paypal

earnest phoenix
#

no but cherryservers does

cunning gust
earnest phoenix
#

they're very highly priced tho

quartz kindle
#

does this happen with all commands or only a specific command?

cunning gust
#

all commands

quartz kindle
#

interactions or message commands?

cunning gust
#

I use 2 repls . one for music , one for moderation

#

both repls are on

#

but the bot not responding

quartz kindle
#

show your index.js

cunning gust
#

wait

#

dm?

quartz kindle
#

here is better

cunning gust
fringe locust
wheat mesa
#

Lmao

#

Send a pastebin of it

cunning gust
#

how

fringe locust
#

@cunning gust dm

wheat mesa
wheat mesa
#

That way everybody can offer advice

#

(And Tim is here, trust me, you want Tim)

fringe locust
#

no i m telling him to make .txt file

#

nvm

wheat mesa
#

But... just use a hastebin...

#

Plus I’m bored and I need a reason to procrastinate mmulu

split hazel
#

you know you're fucked when this happens in your osless environment

cunning gust
quartz kindle
#

yes, the square root of 2 is the square root of

split hazel
#

im hoping its just a simple mistake with the string concat function

#

not with the actual heap allocator

#

it hurts to even think about

quartz kindle
#

xD

#

illegal memory access violation incoming

cunning gust
wheat mesa
#

Why not just say the square root of 2 is the square root of 2 mmLol

split hazel
#

thing is there isnt such a thing in my os yet so if it is happening (which it probably is) i wouldnt know

#

paging isnt set up properly yet

#

not sure how to go about it yet

earnest phoenix
quartz kindle
# cunning gust <@180112943612952577>

dude why do you need all this for?

const request = require("request");
const axios = require("axios");
const snekfetch = require("snekfetch");
const fetch = require("node-fetch");

#

those 4 literally do the same thing

wheat mesa
#

require all of the http libs

cunning gust
quartz kindle
#

and 2 of them are deprecated and out dated

#

and btw

earnest phoenix
#

where phin

quartz kindle
#

what is your discord.js version?

split hazel
near stratus
split hazel
#

wheres my nodejs certification

cunning gust
earnest phoenix
quartz kindle
#

discord.js vwait

earnest phoenix
#

v10.wait.notoutdated

cunning gust
earnest phoenix
#

as expected

#

at this point it's not even a joke that you should switch to detritus

wheat mesa
#

Yes but keep in mind it doesn’t hold your hand as much as djs

quartz kindle
wheat mesa
#

Djs has a massive amount of resources for learning it

cunning gust
#

when the bot is responding that time

#

now it is not responding

quartz kindle
#

show your event handler

cunning gust
#

wait

earnest phoenix
quartz kindle
cunning gust
#

const { PREFIX, LAVA_HOST, LAVA_PASSWORD, LAVA_PORT } = require('../../config');
const { MessageEmbed } = require("discord.js")

module.exports = async bot => {
console.log(${bot.user.username} is available now!)
setInterval(() => bot.user.setActivity(${bot.guilds.cache.size} Servers, { type: "WATCHING"}),5000)
};

quartz kindle
#

show message.js

quartz kindle
#

does the console.log(${bot.user.username} is available now!) work?

cunning gust
earnest phoenix
# wheat mesa Lmao true

actually my command handler is 60 lines long so i don't register invalid commands but yeah it's one line

wheat mesa
#

I have a one line command handler pretty much too

quartz kindle
cunning gust
wheat mesa
earnest phoenix
#

why do you have 3 queues

split hazel
#

i dont think queue and map are a great combination

wheat mesa
#

More queues = better performance of course!

split hazel
#

queue and array sounds great tho

earnest phoenix
wheat mesa
#

I use a Map of queues for my in progress bot that I’ve half given up on

quartz kindle
cunning gust
earnest phoenix
#

maybe they're storing queue as Map<guildId, Array /* queue */>

wheat mesa
#

that’s how I store mine

quartz kindle
wheat mesa
#

Except I just use the standard lightweight queue data structure

#

Instead of bothering with arrays directly

earnest phoenix
#

what about Set

wheat mesa
#

I don’t use Sets for my setup

cunning gust
split hazel
#

sets are depressed maps

quartz kindle
# cunning gust

you dont need to have this ```js
let prefix;
if (message.author.bot || message.channel.type === "dm") return;
try {
let fetched = await db.fetch(prefix_${message.guild.id});
if (fetched == null) {
prefix = PREFIX
} else {
prefix = fetched
}
} catch (e) {
console.log(e)
};

if(message.content.toLowerCase() === ${prefix}help){

}

#

you already do the prefix check and the content check in message.js

cunning gust
#

.

hidden gorge
#

wha does this mean my bot is not responding when i get this

#

I'm helping my friend with his bot and yeah

wheat mesa
#

It means you didn’t await a promise

#

Await it

hidden gorge
hidden gorge
wheat mesa
#

Where are you logging this

#

And what are you logging

hidden gorge
#

?

#

wdym

wheat mesa
hidden gorge
#

no its a bot

wheat mesa
#

You’re logging something as Promise { <pending> }

#

What are you logging

hidden gorge
#

the login i think my friend coded it im helping him

wheat mesa
#

?

hidden gorge
#

let me check his files

wheat mesa
#

I don’t understand

#

I don’t see anything that would log something like that in the code you sent

hidden gorge
#

i see nothing

#

my friend be messing up with coding

severe perch
wheat mesa
#

You only log to the console twice in that code you sent, and neither of them are promises you have to await

spark flint
#

Top tip; don’t try run code you don’t understand

wheat mesa
#

^^

hidden gorge
spark flint
#

Again, code you don’t understand

hidden gorge
#

I was helping him setup the hosting

spark flint
#

If they coded it, get him to ask here

severe perch
#

^^

undone axle
#

...

spark flint
#

…?

raw nest
#

How can I generate unique ID's like the Discord user id's? (532515511863476226)
It should only contain numbers and should be unique ofc

split hazel
#

its encoded dates and some other params

#

but a simple way would be to have a string and attach x random numbers to it

crystal wigeon
#

how do i convert this bitfield to get permissions array or something, the "permissions" obj

cinder patio
raw nest
split hazel
crystal wigeon
#

lol

split hazel
#

tis free real estate

split hazel
winter pasture
earnest phoenix
#
/workspace/commands/box-opening/chest.js:65
        if (chss.rarity == 'Common') chr = Array(19).fill('nada');
                 ^

TypeError: Cannot read properties of undefined (reading 'rarity')
    at Object.run (/workspace/commands/box-opening/chest.js:65:12)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
#

why chss ( character randomized ) is giving undefined

#
let { chh } = require("../../object.js")
let arena = await db.get(`arena_${message.author.id}`)

  if (!arena) arena = 0;

let chs = Object.values(chh).filter(element => element.arena <= arena);

  if (!chs) chs = Object.values(chh).filter(element => element.arena === arena);
        
let chss = chs[Math.floor(Math.random() * chs.length)];
blissful falcon
#

Hello, how can i deploy my slash commands globally?

boreal iron
#

By registering them to the API once

earnest phoenix
#
 if (wins < 5) {
arena = training;
next = "Next arena in 5 wins";
arenms = "`Training Camp`";
  } else if (trophies < 450 && wins >= 5) {
arena = goblin;
next = "Next arena in 450 trophies";
arenms = "**1**, `Goblin Stadium`";
  } else if (trophies > 450) {
arena = bone;
next = "Next arena in 950 trophies";
arenms = "**2**, `Bone Pit`";
  } else if (trophies > 950) {
arena = barbarian;
next = "Next arena in 1,400 trophies";
arenms = "**3**, `Barbarian Bowl`";
  } else if (trophies > 1400) {
arena = pekka;
next = "Next arena in 2,000 trophies";
arenms = "**4**, `P.E.K.K.A's Playhouse`";
  }
```^ and this doesn't work too, it's always saying arena 2 when I have 2000
winter pasture
boreal iron
#

It will take up to an hour until they are available in your guilds

raw nest
winter pasture
#

That is the main benefit of Snowflakes

raw nest
#

I made it more simple I guess I just used 2 times xD

tulip ledge
long herald
#

Guys

#

Anyone here used MongoDB in php ?

split hazel
#

yes

earnest phoenix
#

Does anyone know about sharding?

split hazel
#

yes

split hazel
#

@quartz kindle i fixed the "the square root of x is the square root of" thing

#

it was actually due to the lack of illegal memory access checks

uneven tartan
#

the square root of x is indeed the square root of x

split hazel
#

the smart pointer i made was actually deallocated prematurely by c++ because i transformed it into a normal pointer early which caused the space occupied by the result of the calculation to be freed and overwritten by the string created after it

#

another day of my amazing creations that work as expected firing back against me

sudden geyser
#

that's what c++ is all about

split hazel
#

unfortunately

#

i realised that was the issue when i did something else and it started printing random memory

#

i really need to add a segfault system

#

but idk how

#

the gist of it is that each piece of memory is called a page and you can assign properties and privilege levels to those pages in a page directory

#

idk is this how they work

#

ive had enough of programs randomly reading memory they're not supposed to have access to

#

i'd rather get a segfault and break something than suffer for a couple days finding the issue

modest maple
#

many would argue thats the same thing

lament stump
#

there is no .match

#

(also ignore that i have an "options" object and am not using it, wanted to remove that)

spark flint
#

hello development people

#

i know most of you passionately hate nfts

sudden geyser
#

If I had to guess, it had an issue creating the Mongo client internally

spark flint
#

so i stole one for you

sudden geyser
#

NFTs don't necessarily suck

#

It's just how most people have implemented them that's sucked

spark flint
#

yeah

#

a discord bot tho

sudden geyser
#

I like how Drew Binsky has used them

#

Traveled to all 197 countries and plans to sell NFTs of places he's visited

lament stump
#

But idk what's wrong

sudden geyser
#

It's just a guess, so the implementation may or may not be wrong.

lament stump
#

Maybe it's cuz I'm using Typescript?

#

cuz yk, typescript is picky

#

didn't find anything online about this regarding MongoDB and Typescript

split hazel
#

databases or anything with connections suck with nextjs

#

they're my turn off point for nextjs

#

because the connections dont persist forever

lament stump
#

yeah, they really do, but like

#

tf should i do

#

run it on MySQL

split hazel
#

you probably have an odd typescript issue

lament stump
#

yeah

#

idk how to fix it though

#

i had a similar error with mongoose, so I switched to MongoDB, since that's atleast more supported by Next.js

split hazel
#

maybe its a weird bug

#

did you try completely restarting the server

#

(nextjs dev server)

lament stump
#

yeah i did that

split hazel
#

are you also making sure that the mongo code isnt running on the client side at all

#

i saw that if you make even one little import and dont use it inside of a server props method it gets compiled to the client side

lament stump
#

it's not running on the client side

split hazel
#

how can you be sure

#

are you 100% making all calls to the database inside of a getserversideprops function or something similar

#

and are you making use of the functions not leaving anything unused

lament stump
#

i am making one call to the getserversideprops function

#

i am making use of it, but it still won't work

neat ingot
#

anyone else having the issue of: images your bot sends not showing?

earnest phoenix
boreal iron
#

Happens to me too sometimes

#

If discord has any sort of trouble fetching them

#

Or with caching them… who knows

neat ingot
#

idk, some are sending find, but they all used to send find and just arent atm

#

oh wait its working now wth

#

i literally done nothing 😄

#

^ thats what it was sending less than an hour ago

#

for some reason the attachment just had 0bytes

#

but everything else was processing correctly

boreal iron
#

Yeah sometimes it works sometimes not

neat ingot
#

😓

boreal iron
#

Totally a Discord related issue

#

Lots of people have

neat ingot
#

hmmm, is it frequent?

boreal iron
#

Even if the request was logged as successful in your webserver

neat ingot
#

lol yea everything else was showing correctly

#

strange thing is only some commands were affected

#

others were still showing images properly

boreal iron
#

Yeah it seems to be totally random

neat ingot
#

it is the first ive ever seen it tbf

boreal iron
#

Whatever the issue is in Discord’s backend

#

Nah the issue exists for a long time already - probably almost more than a year

#

At least since I have issues with it

neat ingot
#

you find the issue occurs often?

boreal iron
#

Not often but always with new not already posted and cached images

neat ingot
#

hmm

#

all my images are crafted on request so always new and unccached lol

boreal iron
#

Uhh yeah might happen more often for you then

neat ingot
#

😭

quartz kindle
#

could be limited to interactions? im still using messages

neat ingot
#

hmm, yea it is using slash commands

#

havent noticed the issue with regular messages but i dont listen for those now lol

boreal iron
exotic vigil
#

pls help

TokenError: Invalid "redirect_uri" in request.
    at Strategy.OAuth2Strategy.parseErrorResponse (/home/runner/bot/node_modules/passport-oauth2/lib/strategy.js:358:12)
    at Strategy.OAuth2Strategy._createOAuthError (/home/runner/bot/node_modules/passport-oauth2/lib/strategy.js:405:16)
    at /home/runner/bot/node_modules/passport-oauth2/lib/strategy.js:175:45
    at /home/runner/bot/node_modules/oauth/lib/oauth2.js:191:18
    at passBackControl (/home/runner/bot/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage.<anonymous> (/home/runner/bot/node_modules/oauth/lib/oauth2.js:157:7)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
boreal iron
#

Did you read the error?

#

You entered an invalid value for your redirection URL

boreal iron
#

I doubt OAUTH allows a redirection to non-SSL secured endpoints

exotic vigil
boreal iron
#

Try to use the https protocol/scheme if that’s available for your project domain

#

I don’t know if you got a valid ssl cert in place

exotic vigil
#

Okay thanks

earnest phoenix
sudden geyser
#

does anyone ever pay attention to this

boreal iron
earnest phoenix
boreal iron
#

How tf can discord redirect you to localhost? That would be discord itself

earnest phoenix
#

what

sudden geyser
#

it would hit your localhost

spark flint
#

it does work with localhost:5000

sudden geyser
#

as the redirect

spark flint
#

i test all the time

earnest phoenix
#

yea tf you talking about fake

#

I literally use localhost to test my shit all the time with discord

sudden geyser
#

useful for mobile apps or running local web servers for example

earnest phoenix
spark flint
#

yup

#

iok

#

ik

#

i personally use 5000

earnest phoenix
#

I use 3000 mmost of the time

boreal iron
#

Do even you know what we were talking about and what localhost means as URL redirection target wtf

earnest phoenix
boreal iron
#

I’m close to bonk you all

earnest phoenix
#

You said it doesn't redirect to a non ssl site, which if I am understanding correctly is anything with http. Now I assume it will treat localhost as non ssl

#

which discord does allow redirection to so why not any http site

boreal iron
#

Localhost never has a not self-signed cert

#

And you can not redirect a request to localhost from an external server

earnest phoenix
#

So you are telling me discord can not redirect to your locally hosted web server

boreal iron
#

localhost is just a placeholder for 127.0.0.1 and IPs will not get signed at least not by any CA I know

earnest phoenix
#

well yea

#

But I am trying to understand whether or not you think discord can't redirect to something locally hosted

boreal iron
#

What you’re talking about makes no sense at all
We’re talking about a redirection target URL

#

Not your (local) server requesting Discord’s API

earnest phoenix
#

I am also talking about redirection target url

rancid tulip
#

You can actually redirect a user to localhost using Discord OAuth2. It's how most web devs test their authentication and stuff.

earnest phoenix
#

Yes

#

That is what i've been saying

rancid tulip
#

Discord allowed it for quick testing from local server, as far as I am concerned.

boreal iron
#

For testing purposes maybe

#

I doubt OAUTH allows a redirection to non-SSL secured endpoints

#

Just test it with a non-secured domain and you will get the same error as the guy above

earnest phoenix
#

I've never ran into that issue

split hazel
#

because otherwise hackers will steal your discord account by intercepting the traffic

boreal iron
#

Wouldn’t make sense to allow unsecured endpoints for an authentication process

boreal iron
split hazel
#

they will also find your bank account and hack into it

boreal iron
earnest phoenix
#

I wish I had a bank account

boreal iron
#

And I wish people would have basic knowledge about networking, that would result in less weird discussions

boreal iron
boreal iron
#

I like the consistency of Discord removing access to the guild region for privacy reasons

#

And adding it back for users and guilds with interactions

#

(even if that seems to be useful)

#

And there’s still no fucking sub command nesting in the GUI after so many fucking months

#

ffs

quartz kindle
#

geocoding is fun

#

searching for alto paraiso goias

#

what google returns:
Alto Paraíso de Goiás - State of Goiás, 73770-000, Brazil

#

what locationIQ returns:
Alto Paraíso de Goiás, Região Geográfica Imediata de Flores de Goiás, Região Geográfica Intermediária de Luziânia-Águas Lindas de Goiás, Goiás, Região Centro-Oeste, 73770000, Brasil

#

lmao

quartz kindle
#

how the heck am i supposed to display this in a dropdown menu

#

xDDD

boreal iron
earnest phoenix
quartz kindle
#

xD

boreal iron
#

And you know what… that’s compatible with any browser

#

Not like topgg being compatible with no browser freerealestate

astral iris
#

Um.. What?

            .addField('Date Joined', `${Member.joinedAt}\n<t:${Member.joinedTimestamp}:R>`, true)
#

NVM, joinedTimestamp is in ms I guess

boreal iron
#

Yeah the message format requires a Unix timestamp in seconds not ms

astral iris
#

I didn't realize it was in ms, it doesn't say that in the docs so I was confused

boreal iron
#

Probably because the default timestamp in JS is in ms

#

But yeah a note would be helpful but too much work it seems freerealestate

daring kestrel
manic yarrow
#

hey yall, so about a month ago my bot broke and I'm just getting around to fixing it but essentially the slash command is no longer working properly on mobile

#

The deploy command looks like:

#

and on desktop it works just fine

#

but when I try to do it on mobile it get this

crystal wigeon
#

anyone use postgres as DB? have you ever done partitioning

#

also can we partition a view?

hasty mulch
#
local function getTime()
    local date = os.date("*t") -- this creates a table with {year = 1998, month = 9, day = 16, yday = 259, wday = 4, hour = 23, min = 48, sec = 10, isdst = false}
    return ("%02d:%02d:%02d"):format(((date.hour +1)), date.min,date.sec) -- gets the hour minutes and seconds within that table and formats it 
end

while game:GetService("RunService").RenderStepped:wait() do 
    game:GetService("Lighting").TimeOfDay = getTime() -- set the time
end

L = game:GetService("Lighting")


while true do 
    wait(60)
    T = L:GetMinutesAfterMidnight()
    if T < 300 then --Night time, after midnight.
        game.Lighting.OutdoorAmbient = Color3.new(30/255,30/255,30/255)
    elseif T > 300 and T < 390 then --Dawn, sun rise.
        game.Lighting.OutdoorAmbient = Color3.new((30+(T-300)/1.5)/255,(30+(T-300)/1.5)/255,(30+(T-300)/1.5)/255)
    elseif T > 390 and T < 600 then --Morning.
        game.Lighting.OutdoorAmbient = Color3.new((90+(T-390)/7)/255,(90+(T-390)/7)/255,(90+(T-390)/7)/255)
    elseif T > 600 and T < 840 then --Day time.
        game.Lighting.OutdoorAmbient = Color3.new(120/255,120/255,120/255)
    elseif T > 840 and T < 1050 then --Afternoon.
        game.Lighting.OutdoorAmbient = Color3.new((120-(T-840)/7)/255,(120-(T-840)/7)/255,(120-(T-840)/7)/255)
    elseif T > 1050 and T < 1140 then --Evening, sun set.
        game.Lighting.OutdoorAmbient = Color3.new((90-(T-1050)/1.5)/255,(90-(T-1050)/1.5)/255,(90-(T-1050)/1.5)/255)
    elseif T > 1140 then --Night time, before midnight.
        game.Lighting.OutdoorAmbient = Color3.new(30/255,30/255,30/255)
    end        
end

Syntax check, please

spark flint
#

what language is that?

hasty mulch
#

LUA

hallow compass
#

Can anyone help me for 24/7 in vc music bot

hasty mulch
#

Trying to sync in-game time to IRL time

#

I already am?

boreal iron
# manic yarrow

Delete the registered command and register it once again.
That will probably solve your issue.

#

Make sure after deleting it to check your mobile Discord app if the command is gone

fiery stream
#

can anybody tell me whats wrong with this

#

im pretty new to python

#

nvm i got it

cinder patio
#
        Car car;
        size_t num_name = line_contents.find("-");
        car.number = stoi(line_contents.substr(0, num_name));
        size_t num_brand = line_contents.find("-", num_name + 1);
        car.brand = line_contents.substr(num_name + 1, num_brand);
        size_t num_year = line_contents.find("-", num_brand + 1);
        cout << num_name << " " << num_brand << " " << num_year << endl;

AM I GOING INSANE??

The data: 1234-Honda-2017
And the final result...

number: 1234
brand: Honda-2017
year: 2017

And the logged indexes:
4 10 15

WHY IS -2017 INCLUDED IN THE BRAND IF THE num_brand ENDS AT 10

boreal iron
cinder patio
#

SAME CODE WITH JS AND IT'S CORRECT. C++ IS AT FAULT

cinder patio
boreal iron
#

Not that I know that weird language

#

But who knows

boreal iron
cinder patio
#

It's not, substr is JS' slice and find exactly like indexOf. Works on both the number and the year, but not the brand

boreal iron
#

Haha FakE was right

#

It’s the length not the index (position)

#

The length based on your pos parameter

#

That would explain your issue as "Honda-2017" has exactly 10 characters

#

To make my day please try car.brand = …(num_name + 1, (num_brand - num_name));

cinder patio
#

fuck

#

nah it's (num_year - num_brand) 😃

boreal iron
#

No it has a length of 5, starting it’s position behind num_name + 1

#

Or am I wrong here?

#

brand - name = 5

cinder patio
#

both work

boreal iron
#

That’s not the only fucking language using length as second parameter for substr instead of the position to stop

#

they are all weird

cinder patio
#

Why would it do it like that, there are no benefits to it, only makes it more confusing. And it doesn't make it any more flexible or anything.

#

just a fuck you

#

Should be relative to the starting index

boreal iron
#

Yeah or if negative starting to count from the end of the string

boreal iron
#

At least it got sorted out

fiery stream
#

yoo

#

can anyone help pls

#

idk whats causing this error

quartz kindle
#

key expected bytes or bytearray, but got int

civic scroll
#

trace where that value was originated

#

the stack trace right there is useful

paper raven
#

hello
so im making a discord bot forthe first time and im havind trouble reggistering my commands
im following a guide
its js tho so idk

earnest phoenix
#

"else switch"? or something like ```js
else {
switch (..) {

#

is it possible?

fiery stream
fiery stream
signal estuary
#

I have a problem in the bots description in top.gg:
If I make a "paragraph" (Key: Enter), then it makes 2 paragraphs, so 1 free line. How can I prevent that, so I only starts a new line without a free one?

quartz kindle
#

using markdown or html?

#

using markdown it should be like this:

#
// same line
abc
xyz

// 2 lines
abc  <- two spaces at the end
xyz

// paragraph (3 lines)
abc

xyz
signal estuary
quartz kindle
#

then i guess its just the way top.gg's css is setup

#

you can add your own css to change it

signal estuary
#

Now `text` doesnt work any more 😅
Nvm. Lose-Win-Situation

royal herald
#

how do i R

#

i wanna learn r

signal estuary
#

what is "r"?

royal herald
#

the language

signal estuary
royal herald
#

theres c too

earnest phoenix
signal estuary
earnest phoenix
#

wait a sec

earnest phoenix
signal estuary
#

I just want to reproduce this.
points as a list, no free line and a red inline block

earnest phoenix
#

and you can combine markdown with it

signal estuary
earnest phoenix
#

no problem

#

now check if works for you

signal estuary
#

using unicodes is very clever :P

earnest phoenix
civic scroll
#

if switch is the only thing then you can

earnest phoenix
civic scroll
#

else switch

earnest phoenix
#

ok

earnest phoenix
#

any solution for this? ms edge not loading pages correctly

#

I have to reload it multiple times to get it working

#

all pages are same

civic scroll
earnest phoenix
#

nope

#

i'm next to my router

#

and the online games are working fine in my phone

quartz kindle
#

the page is failing to load css files

#

either something in the connection broke, or the stackoverflow server is broken

#

you can check your dev tools network tab

#

see what happened to the css files

split hazel
tired panther
#

Maybe they copied a code piece from a post and pasted it in there source code and it broke lol /s

feral aspen
#

Hey! My bot went unresponsive, then went offline for about 4 minutes, then came back online but it didn't affect its uptime? (Its ping would reach 25 seconds.)

quartz kindle
#

client.uptime is not affected by disconnects and reconnects

earnest phoenix
#

@quartz kindle

#

how can i get early bot developer badge?

spark flint
boreal iron
#

iirc that's not available anymore

spark flint
#

@rustic nova do the command angery

rustic nova
#

What if I don't

spark flint
rustic nova
#

-verifybot

gilded plankBOT
#

Hi! It seems like you are looking for information on how to get your bot verified.

Once your bot reaches 75 servers or more, you are eligible for bot verification. Since October 7, 2020, bots that reach 100 servers will not be able to be invited to any more servers. You verify your bot on your bot's application page, under the "Bot" section in the sidebar.

If you need more information, check out this article written by Discord about The Future of Bots on Discord and you can ask questions in the Discord Developer Server.

Please note:

  • We cannot provide support on how to get your bot verified.
  • We are not affiliated with discord's bot verification system.
  • Getting your bot verified on top.gg (approved through our queue), does not mean you will also get verified by discord. Top.gg's queue has no correlation to discord's verification system whatsoever.
spark flint
#

then i'll have to find a ss

spark flint
rustic nova
#

-nobadge

gilded plankBOT
spark flint
#

there

#

ty

earnest phoenix
spark flint
#

@earnest phoenix ^^

#

read the image

earnest phoenix
#

ok

#

how can i get 1 more discord badge

#

(easy)

spark flint
#

hypesquad

#

thats about it

boreal iron
#

my gosh... there can't be anything more unnecessary than that

earnest phoenix
#

i have

spark flint
#

then

#

no

#

you can;t

#

and imagine selling owo and dank memer bots angery

fiery stream
#

anyone here who knows python ?

small tangle
spark flint
wheat mesa
celest pine
#

Guys, i need ideas for commands for a discord bot. My head is empty earphonecat

split hazel
#

alright bro hear me out

#

among us bot

spark flint
#

smart

#

amongus api

#

FUCK

split hazel
#

lmao

spark flint
#

there

#

i can't wait to use the amognus api to build apps

split hazel
#

same

boreal iron
#

my gosh

#

smh

#

smh

#

smh

#

Do you remember the time this wasn't required to do every 5 min?

spark flint
#

omg

#

wow

split hazel
#

that api is so goddamn suspicious though dont you agree

spark flint
#

Yeah

#

What do you need from amongus

#

what api even exists

split hazel
#

I want to build an app which shows how suspicious someone is acting on a scale of 1 to 10 inside of a game

#

will even time them doing tasks to see if theyre faking

small tangle
cinder patio
slender thistle
fiery stream
#

finally i thought nobody was interested in helpin

#

so

fiery stream
#

how do you use redis with flask login

#

ion wanna use sqlalchemy

slender thistle
boreal iron
fiery stream
#

n ion wanna use it

slender thistle
#

Flask login requires SQL..?

fiery stream
#

sqlalchemy idk what that is

#

i never used sql n ion wanna use it still

slender thistle
#

Why would you need that for Flask login

spark flint
#

Is it possible to get shard count from discord.py client object

#

for server count i do len(client.guilds)

slender thistle
#

shard_count?

fiery stream
spark flint
#

oh good point

slender thistle
fiery stream
#

yeah

#

n good alternative for flask login ??

slender thistle
#

Manual implementation with raw Flask

spark flint
#

quart-discord for Discord login dance

#

if you use Quart

#

flask-discord works too

fiery stream
#

its not for discord @spark flint thanks for thought

spark flint
#

ah alrighty

#

mb

fiery stream
#

yuhb :/

boreal iron
#

Does the embed char limit (1024) include header and footer?

#

Or just description and fields or just fields?!

slender thistle
#

Description is 2048 chars, iirc field values and their names along with titles are 1024

#

Not sure about footer, but overall char limit on an embed is 6k chars

boreal iron
#

Ah so 1024 per field then

#

ty

earnest phoenix
#

Whenever I try to use db.set it sets them all as null (Quick.db latest @ djs latest)

          db.set(`author_${message.channel.id}`, `${message.author.tag}`)
          db.set(`author2_${message.channel.id}`, `${message.author.id}`)
          db.set(`content_${message.channel.id}`, `- ${message.content}`)```

    let auth1 = db.get(`author_${interaction.channel.id}`)
    let auth = db.get(`author2_${interaction.channel.id}`)
    let cont = db.get(`content_${interaction.channel.id}`)
#

Not sure how or why, but I can't ask in discord.gg/plexidev cause I'm banned? That's new news lol, can't seem to find a ban appeals for them either.

earnest phoenix
#

Its null

compact pier
#

some how

earnest phoenix
#

hm

#

Not sure how they can be o-o

compact pier
#

you need to fix your code

#

there is an error somewhere

#

:/

earnest phoenix
#

It's not erroring.

#

Its just not inputting in the DB.

compact pier
#

read the docs again

#

for your db lib

slender thistle
#

You honestly don't look like you helped much

compact pier
#

i can't do anything tho

hidden gorge
#

oof i have it so it is as playing nothing

#

there we go

woeful pike
sudden geyser
#

Damn it isn't from Berkeley

woeful pike
#

probably wouldn't be able to understand it if it was from berkeley lol

#

college dropout gang

boreal iron
#

why tf am I getting a missing permissions error from Discord when changing the bots nickname?

#

The permission for the bot (& everybody) is set properly

#

doesn't make any sense at all

#

Fetching the guild members permissions of the bot ALSO lists change_nickname as permission

#

wtf

#

ffs

celest pine
#

guys

#

does anyone has some ideas for bots commands?

proven lantern
boreal iron
sudden geyser
wheat mesa
#

Probably null

boreal iron
#

No… it’s null

proven lantern
#

set to null to remove timeout

#

you cant remove it without perms

boreal iron
#

Just the default discord data being send with the request

proven lantern
#

dont use models

#

maps and arrays are all you need

sudden geyser
#

asterisk

boreal iron
#

Not for the simple bot I’m running

#

I guess the API is just trolling me

celest pine
sudden geyser
#

don't forget the bleach

boreal iron
#

said Mr. Trump

compact pier
#

I can't believe there is a patern for uwu language

split hazel
#

everything needs to be standardised

#

please tell that to graphics card manufacturers

timber fractal
#

does anyone know like a simple prebuilt editor, so like an editor similair to google sites or wix or whatever, but with easy, beginner html that you can edit to actually learn something of how those things are built?

spark flint
#

whats causing this

#

am using ejs

wheat mesa
#

Include isnt a function

#

Did you mean require()?

spark flint
#

well

#

it worked like 2 mins ago

#

changed to the main code

#

and no

wheat mesa
#

Odd

#

Haven’t really used ejs all that much

#

Just thought you might’ve meant require lol

proven lantern
#

is the - breaking in in <%-

#

nm

proven lantern
boreal iron
#

it worked like 2 mins ago

That’s what we will hear a lot in here in April

spark flint
#

LMAO

spark flint
#

i'm doing res.render()

#

and it renders an external ejs file

proven lantern
#

mmkay

simple stump
#

How can I make my bot join a voice channel?

rose warren
boreal iron
#

First time I see you writing in development again since your promotion.

#

I thought as a rich employee you don’t need to deal with the “poor” people anymore

wheat mesa
#

It’s true

#

Fight against the top.gg aristocracy

spark flint
#

Lol

quartz kindle
#

so, i always tought brotli was stupidly slow in js and there was soething wrong with it

#

it turns out that node just sets maximum possible compression by default, and you have to manually change the settings to prevent that

#

thats just stupid

#

like, deflate was taking 40ms, and brotli was taking 8000ms

wheat mesa
#

pointer compress C:

quartz kindle
#

but if i set brotli to level 6, then it takes 50ms

#

for some reason the default compression level is 11

boreal iron
wheat mesa
rose warren
#

But I honestly believe (and I said this to a team member earlier) this channel is super super valuable for new bot devs and I know (in my experience at least) the community here was far more helpful than any other dev server dog_Heart

#

Anyone who helps out here is honestly the GOAT and has all my respect

quartz kindle
#

baaaaa

#

headbutts a telephone pole

rose warren
#

🐐 < Tim

spark flint
#

Tim is OP

#

Special role for Tim when

#

Lmao

rose warren
#

Tim needs a nerf

quartz kindle
#

i need a buff, im bronze in league

boreal iron
#

My gosh always the people with their gamer slangs

#

If I would have spend more time playing games I would understand what’s going on

boreal iron
#

at least you’re still here

spark flint
#

How do I center table and set width?

#

It works on mobile, until you add w-1/3 m-auto

#

(Using tailwind)

boreal iron
#

Always depends on the parent elements

#

Generally centering it works with setting margin: 0 auto;

#

As well as for divs

spark flint
#

but when i do that, it fucks up on mobile

#

same with setting width

boreal iron
#

As long as they don’t have a width of 100% of course freerealestate

spark flint
#

2 secs

boreal iron
#

Elements should never be greater than your screen size