#development

1 messages · Page 1904 of 1

earnest phoenix
#
const somePromise = new Promise(/* ... */);
somePromise.then(() => { somePromise.pending = false });
somePromise.pending = true;

// somewhere else
if (somePromise.pending) console.log("still pending bruh");
#

*yro'ue

#

*your

deft citrus
#

i am adding a amazing thing to the bot

#

pls help me

#

if a person types ^news add heloo

#

it should be added

#

in a command called ^news

#

and it should be seen if anyone types

#

^news

#

@feral aspen

#

can you help

#

@spark flint

#

hello

spark flint
#

hi??

#

yeah please

pine nova
deft citrus
#

i am adding a amazing thing to the bot
pls help me
if a person types ^news add heloo
it should be added
in a command called ^news
and it should be seen if anyone types
^news

feral aspen
spark flint
#

lmao

feral aspen
deft citrus
pine nova
feral aspen
spark flint
deft citrus
#

i am adding a amazing thing to the bot

if a person types ^news add heloo
it should be added
in a command called ^news
and it should be seen if anyone types
^news

feral aspen
#

Saying help me won't benefit me or you.

pine nova
#

lmfao

deft citrus
#

read

feral aspen
#

.. and it made no sense.

#

Could you explain it.

deft citrus
#

ok

#

if you type ^news add hi

#

hi will be added

#

to news

feral aspen
#

Okay..

deft citrus
#

and if i type ^news

#

it will be shown

feral aspen
#

Show me your base command, for now.

deft citrus
lament stump
#

just store the text in a database with the guild id

pine nova
feral aspen
lament stump
#

nothing probably

deft citrus
#

ok

feral aspen
deft citrus
#

client.command()
async def news(ctx):
await ctx.send('** Todays News Headlines**'+' '+"--------------------------------------------"+' '+'Marshadow is getting High demand')

pine nova
pine nova
#

o python

deft citrus
#

yea

feral aspen
#

Oh, I'm no use. lmao

deft citrus
#

😢

feral aspen
#

Sorry, dude. :/

#

I don't know Python.

spark flint
#

I do

deft citrus
#

then

#

pls

spark flint
#

i'm only doing this to shut him up

deft citrus
spark flint
#
@client.command()
async def news(ctx, *, news):
  channel = client.get_channel(CHANNELID)
  await ctx.send(f"News: {news}")```
#

now work on that

deft citrus
#

ok

#

ty very much

spark flint
#

@pale vessel only gave him basic code

#

it needs to be able to get a servers news channel, send a better message etc

#

just sent that code which is a base for him to get started from

#

also as he kept pinging people for it

slender thistle
#

🥄

#

Spoonfeed almost never helps here

pine nova
slender thistle
#

2 years of experience

sterile brook
#

imagine doing work for some 13 y.o. guy, that just continues being annoying with his silly questions, who for a long time could find everything he needs on the Internet, maybe not even in the best possible way, but no, he just keeps asking the same thing here to press the long-awaited Ctrl+C Ctrl+V

native walrus
#

no problem if you get paid for it

feral aspen
#

Quick question.

#

How can you handle the if (!response)? I can't edit the embed in any shope or way, possible.

slender thistle
#

For a few minutes/hours

#

Then they come back expecting to be spoonfed more

boreal iron
#

hmm?

native walrus
#

that error literally could not be more clear

earnest phoenix
#

slash commands name cant be uppercase or empty string

#

No need actually

wheat mesa
#

Discordjs moment

boreal iron
wheat mesa
#

But I love my high memory usage

boreal iron
earnest phoenix
#

My bot just using 50mb ram

#

But yes this is better way ill check it out

#

Thanks

wheat mesa
#

arent you using discordjs?

#

50mb with djs damn 🥵

earnest phoenix
#

Yes

boreal iron
#

Depends on the amount of servers of course

earnest phoenix
#

37 servers

#

3500 users

#

Low

boreal iron
#

wow 50 MB is way too much then

wheat mesa
#

My bot out here using 160mb rss for 25 guilds and 10.5k users

earnest phoenix
#

But my code can run bot with 90 server and 250k users with 300mb ram

boreal iron
lyric mountain
earnest phoenix
#

Define commandFolders

lyric mountain
#

since most of them will not be cached at all times

earnest phoenix
#

Yes its so gay

#

It shows 2.7k

wheat mesa
#

My bot runs pretty high on ram usage considering what I cache

earnest phoenix
#

When i restart bot it shows 2.3k

wooden kindle
#

ello

#

boomers

lyric mountain
earnest phoenix
#

You lowered where is your purple

earnest phoenix
wheat mesa
#

I only cache guilds and channels

#

Actually I don’t even think I cache channels anymore

#

Still using 160mb rss freerealestate

boreal iron
earnest phoenix
#

But my uptime is better lol

wheat mesa
#

I’ve been thinking about rewriting my bot with D++

#

Just for better ram usage

earnest phoenix
#

Js always been more faster

boreal iron
#

lol who tf cares about a bot status io page

wheat mesa
#

Granted I don’t really care about my ram usage all that much

boreal iron
wheat mesa
earnest phoenix
#

Am i wrong?

wheat mesa
#

Very

#

C++ is incredibly fast compared to js

#

Js is one of the slower languages in the modern world

earnest phoenix
#

Than why all indian youtubers say that

wheat mesa
#

Because it’s interpreted

#

C++ is compiled

lyric mountain
boreal iron
#

indian youtubers

#

lol

lyric mountain
#

python is so interpreted it has to interpret the interpreter

wheat mesa
#

From what I’m reading C++ is 10 times faster than js across the board

earnest phoenix
wheat mesa
#

But for more complex things I have a feeling C++ is likely hundreds of times faster

earnest phoenix
#

Than go with it

#

Is there any libary for run discord bots with c++?

wheat mesa
#

D++

boreal iron
#

If somebody ever mentions an Indian and tech together in any way, I always think about Indian "tech support"

#

Very serious thing of course

wheat mesa
#

Plus I’ve just been loving C++ recently and a discord bot might be a fun little project for it

lyric mountain
boreal iron
lyric mountain
#

if stackoverflow fails, it's guaranteed there's an indian guy solving it on youtube

earnest phoenix
#

Stackerflow never fails

brittle oyster
#

sometimes it does

earnest phoenix
#

I didnt get any on my js fails

lyric mountain
#

ack your ints

wheat mesa
#

Because everyone using djs has asked the same question a billion times on stackoverflow

#

“Discord bot no work pls help”

earnest phoenix
#

Wait untill some try again if it still fails start to cry or fix code

earnest phoenix
wheat mesa
#

“SyntaxError: ';' expected” HOW FIX GUYSSSS

brittle oyster
earnest phoenix
#

I am asking
Could not found 'discord.js' module
What should i do

lyric mountain
brittle oyster
#

that should help

wheat mesa
sterile brook
earnest phoenix
rustic nova
#

Watch me solve this whole thread

#

Learn javascript

lyric mountain
earnest phoenix
#

I really made a msg event listener for each command

rustic nova
earnest phoenix
sterile brook
wheat mesa
#

Pretty funny how many people have spaghetti code with djs

#

Mainly because djs promotes spaghetti code

rustic nova
#

Glad I'm never asking on the internet on help about something, either look up already given answers, check the docs or give up entirely

earnest phoenix
#

djs are so confusing they could make it easier

wheat mesa
#

Literally saw a guy make an event listener for the message event for every command

rustic nova
lyric mountain
wheat mesa
#

You’ll almost never find a detailed solution to an obscure problem though

#

(On the internet)

earnest phoenix
#

Check docs => guides => github examples => stackerflow => discord-> top.gg> Development hey fake can you help me about my slash commands

lyric mountain
#

like, sometimes you got 5-6 levels deep during searchm but for sure the answer is somewhere there

#

when I was making my GP I had to find out how to calculate texture normals in real time on android

#

most answers were in other prog langs, but I could extract useful info out of it

boreal iron
#

God… I remember the times when searching the 'net wasn’t actually a way to go

#

Had to try the shit yourself

earnest phoenix
#

And learnt it byself

wheat mesa
#

fake is a boomer laugh at him

sterile brook
#

learning is gud

earnest phoenix
#

Actually better but it can be cause by losing much time

wheat mesa
#

Why bother learning when you can have some random person on a discord server write your code for you

boreal iron
wheat mesa
#

That’s the djs mindset

oak stream
#

Hello!

wheat mesa
#

Hello

oak stream
wooden kindle
earnest phoenix
oak stream
sterile brook
#

please no "how to make ping command"

#

for this time

earnest phoenix
#

client.ws.ping

#

I am solved this problem in 3 ms

oak stream
#

lol

earnest phoenix
#

Because i am op

sterile brook
#

imagine calling urself op

earnest phoenix
#

Why wouldnt ?

brittle oyster
oak stream
#

Tyrone, you should change the css for your website to make the edges smooth.

earnest phoenix
#

Nah it will logout of Client

sterile brook
#

are u rly

#

bruh moment

spark flint
#

pls help PepeHands

#

i geniunely can't figure this out

oak stream
#

we may need some code...

wheat mesa
#

Solution

#

Don’t use python

oak stream
#

no... python op

sterile brook
#

phahahah

wheat mesa
#

no

earnest phoenix
#

Python is for girls

spark flint
boreal iron
wheat mesa
#

Python looks funny

#

I haven’t used Java in a while!

oak stream
#

python does look funny

spark flint
#

thats the code

oak stream
#

ahh

wheat mesa
#

The last time I used Java was for that webhook dogshit I made a few weeks ago

oak stream
#

try json.loads

#

and print it

sterile brook
#

yes, u need use Fortran

#

be man

#

use Fortran

spark flint
boreal iron
wheat mesa
#

C++ with SDL on top

oak stream
#

did you print it?

#

what is file

#

...

earnest phoenix
wheat mesa
spark flint
oak stream
#

what is in that file

spark flint
#

i know the variations are the same

#

and ignore the cringe file contents

wheat mesa
#

80f rn actually good weather

sterile brook
spark flint
#

ah fuck ignore my variation1 duplicate error

oak stream
#

aight

boreal iron
oak stream
#

uhh

spark flint
#

that was just me quickly copying it over to see if it worked

oak stream
#

u send me file i fix it

#

...

wheat mesa
#

Spoonfeed moment

oak stream
#

i cant think as errors

spark flint
#

its not json that the issue

earnest phoenix
#

Did you google your problem?

spark flint
# oak stream i cant think as errors
@app.route("/santavariations")
@route_cors(**CORS_SETTINGS, provide_automatic_options=False)
async def variations():
    with open("assets/variations.json") as file:
        allvariation = json.load(file)

    variation = random.choice(allvariation)

    return(variation)
    title1 = allvariation[variation]["title1"]
    title2 = allvariation[variation]["title2"]
    title3 = allvariation[variation]["title3"]
    desc1 = allvariation[variation]["desc1"]
    desc2 = allvariation[variation]["desc2"]
    desc3 = allvariation[variation]["desc3"]
    
    return jsonify({"title1":title1, "title2":title2, "title3":title3, "desc1":desc1, "desc2":desc2, "desc3":desc3})```
oak stream
#

maybe .append it and read it thru there? thats what i use

#

oh damn

#

flask

#

❤️

spark flint
brittle oyster
oak stream
#

ur returning two things

spark flint
#

quart is a production version of Flask

wheat mesa
#

Ikr

oak stream
#

?

spark flint
wheat mesa
#

SDL is great

earnest phoenix
#

Pastebin isnt working for me

sterile brook
#

i see great pastbin here

wheat mesa
#

Just started learning it recently

earnest phoenix
#

Probably country error

spark flint
#

i was returning variation to see what the response was

sterile brook
#

with wonderful error

wheat mesa
#

Got a 404 on the pastebin link

sterile brook
wheat mesa
#

You didnt send a valid link

sterile brook
#

No code = No problems

#

ez

#

solution

oak stream
#

true

#

this guy has a massive brain

spark flint
#

he does

earnest phoenix
#

Or code correct = no problem

wheat mesa
#

No

#

No code and you’ll never have problems

earnest phoenix
#

And dont breathe and you will never be sick

spark flint
#

no breathing = no covid

#

i failed

earnest phoenix
#

Are you pretty sure close of your Nose?

wheat mesa
#

Someone that sits next to me in class got covid

#

And I feel a little sick

#

Might be ggs

sterile brook
#

then u are on right way

earnest phoenix
#

Is it than or then?

brittle oyster
#

someone in my class also had covid

#

what

sterile brook
#

to hell

wheat mesa
earnest phoenix
wheat mesa
#

But they won’t say who it is

rustic nova
#

start debugging

brittle oyster
#

same

boreal iron
brittle oyster
#

"omg some one got covid in ur class guess who it is"

rustic nova
#

yes

earnest phoenix
#
brittle oyster
#

are we in the same school or what

#

/j

earnest phoenix
#

With who?

brittle oyster
#

waffle

hard dust
#

Do I need an intent to use getUser?

#

from an id

rustic nova
#

are you even sending the commands to discord to actually create these slash commands on a server?

#

because according to your code, doesn't seem like it

earnest phoenix
hard dust
rustic nova
#

implement that in the start of your bot instead

earnest phoenix
#

ohh

hard dust
#

because i always get null, and I read somewhere that you need them

#

but wanted to verify

earnest phoenix
#

You need this intent for like message.author client.user things

hard dust
#

I can do message.author

brittle oyster
#

guys help discord bot no work

import discord
discord.make_bot_for_me_pls()
earnest phoenix
#

getUser probably wont inside in it

sterile brook
earnest phoenix
#

Bc their destination remove to acses of bots private things

hard dust
#

would that be the member intent?

brittle oyster
#

imagine using message instead of msg

earnest phoenix
#

I am not lazy ass

brittle oyster
#

i am lazy ass

wheat mesa
#

message is more clear

sterile brook
#

i like to call my vars as i like to

hard dust
sterile brook
earnest phoenix
#

I call my Interactions as intereactions

brittle oyster
#

my vars are mostly 2 random letters 👍

sterile brook
oak stream
#

same

#

x

#

y

earnest phoenix
#

A

#

B

#

C

#

ab

#

bc

#

bx

#

b1

brittle oyster
#

yes

sterile brook
#

i see some seniors here

earnest phoenix
#

I use them only in math

#

And i dont have math lessons

spark flint
#

thats the python alternative

oak stream
#

what is blacklister?

#

a package?

sterile brook
#

idk about python

oak stream
#

@spark flint

spark flint
#

I made an API for it

#

and python package

oak stream
#

ah ok

#

nice

spark flint
#

ty

oak stream
#

flask i guess?

spark flint
#

the API?

oak stream
#

ye

spark flint
#

It uses Express.js

oak stream
#

dont know it... i j ust use flask

spark flint
#

I use Quart primarily

brittle oyster
#

express.js is so easy and for what

oak stream
#

can i use it spooky?

spark flint
#

Well the API uses a mixture of Quart and Express

spark flint
oak stream
#

need a key 🙂

spark flint
#

Grabbing one now

oak stream
#

cheers

sterile brook
#

i need to make clans system, but i am too lazy

lyric mountain
#

slosh

solemn latch
#

Very sloshy

boreal iron
#

Still registering slash commands on any startup

hard dust
boreal iron
#

I’m trying so hard

sterile brook
#

i just dont want to update on node 16 and v13 dsjs

#

halp

spark flint
#

slush commands better

sterile brook
lyric mountain
oak stream
#

i love em

#

why couldnt i see luca's cornet, now i can?

solemn latch
oak stream
#

ooops iim in dev

proven lantern
#

can we make these messages with our bots?

spark flint
#

r/hadastroke

spark flint
#

wtf

#

Startman

#

Starman

proven lantern
#

maybe it's a hidden feature

#

starman pls tell

brittle oyster
#

wahts the uh assembly decode program thing called

boreal iron
#

At least hidden yet

#

Maybe in test phase

proven lantern
#

im using the api directly so maybe i can use it

spark flint
#

only took like 30mins

#

more than that

oak stream
#

anyone need a website... im bored

#

my mans in downloads

boreal iron
#

You may wanna define bot as your client or simply called it client oldEyes

sterile brook
#

lol

oak stream
#

const discord = require("discord.js")

client = discord.Client()

#

bruh

#

i dont even use js and i know that

#

...

sterile brook
#

for example

boreal iron
#

Wtf is bot exported from discord?

oak stream
#

no

boreal iron
#

That doesn’t exist

oak stream
#

lmao exactly

#

do what i said

#

console.log("test")```
#

ooo

#

o

#

k

sterile brook
oak stream
#

const Discord = require("discord.js")

Client = Discord.Client()

#

...

boreal iron
#

Hold on. Do you actually define multiple clients and instances? I read ready.js

oak stream
#

mongoose

#

bruh

sterile brook
oak stream
#

you are defining bot in discord, but are using mongo?

#

do you even know js?

#

hmmm

#

this says otherwise.

boreal iron
#

DUDE define your client ONCE in your index and PASS it to your modules

#

NO other way

sterile brook
spark flint
#

i lost all braincells trying to fix santas-list

boreal iron
#

I lost a lot in the last 10s

oak stream
#

i lost my braincells trying to make a chat bot in py then ended up it being about 200 lines long xD

sterile brook
oak stream
#

but... you dont understand discord.js

boreal iron
#

You already use the passed argument client in your execute() function
No need to import discord again, creating the var a second time

#

If you pass client as argument then use client.on(…)

#

command.execute(interaction)

#

You’re passing interaction as argument

#

Don’t u ever need the client in your command modules?

#

Also where do you even call your ready event JS file?

#

Am I blind

#

You’re already listening to the ready event in your index

#

Why would you create a second listener?

#

Your event has like 5 lines

#

Reading the file and including it as well as executing it is longer than what you got before

#

Would only make sense if you would move all event listeners to modules

#

Which is like over complicating things but well why not

tulip ledge
#

Anyone knows how to move that topbar so the sidebar doesn't overlap it?

quaint wasp
#

sup everyone

#

I finally verified my bot

oak stream
tulip ledge
#

if I do that the topbar will overlap the sidebar

tulip ledge
boreal iron
#

Is what you need to use on all associated elements

oak stream
#

oh

#

lmao i have no clue what u are doing

tulip ledge
boreal iron
#

Is it an absolute or fixed display already?

tulip ledge
#

wdym?

#

I'm not the best at css

boreal iron
#

If so use the left property then

tulip ledge
#

Left property doesn't work

#

already tried

boreal iron
#

Only if the element being display as absolute or fixed one

#

Let it overlap the sidebar and margin the content in it

#

Same for the sidebar

#

Is easier and more flexible as well as better responsive design if the sidebar for example shouldn’t be shown up on mobile

tulip ledge
#

wait so what do I do

native walrus
#

create an element that contains <navbar/> and <div><sidebar/><content/><div> that is flex column

boreal iron
#

Let the navigation overlap the sidebar and use to push your sidebar element down THE HEIGHT the navigation has

tulip ledge
#

Ohhh

#

ok

#

I just added margin left

#

and it fixed it

native walrus
tulip ledge
#

But it doesn't affect it

native walrus
#

are you trying to copy discord's ui?

tulip ledge
#

Kind of

#

You could say so yeah

#

Even though I'm gonna make it look completely different

#

the skeleton is the same

quaint wasp
native walrus
#

you need to structure your html so it looks like

<body>
  <sidebar />
  <main>
    <navbar />
    <whatever />
  </main>
</body>

make body a flex element that contains a sidebar and the "main" content, and have the main content a column flex

#

html is just rectangles at the end of the day, you have to recognize how to stack them on top of each other

tulip ledge
#

Issue is I'm working with routers

boreal iron
tulip ledge
#

Would that still work?

native walrus
#

wrapper for what? <body> is the main flex element that holds sidebar and main content

boreal iron
#

To keep the hierarchy in place always

native walrus
#

<main> itself can be a router outlet that changes depending on dynamic content

tulip ledge
#

ok

native walrus
#

use whatever wrappers you need on top of that

#

that's just the high level idea behind the html structure, not a copy pastable html example

#

ok buddy that's the 3rd time you're saying that here

spark flint
uncut brook
#

a

tulip ledge
#
    <div className="flex">
      <Sidebar />
      <main className="flex-col">
        <Topbar />
          <Router>
          <Switch>
            <Route exact path="/">
              <Home />
            </Route>
          </Switch>
        </Router>
      </main>
    </div>
tulip ledge
native walrus
#

TopBar should be 100% width

#

and so should main

boreal iron
#

Consider a proper command handler this time in order not to be forced to update it a few days later again

tulip ledge
#
  .top-navigation {
    @apply flex flex-row items-center justify-evenly
    bg-gray-800 bg-opacity-90
    w-full h-24 left-24
    shadow-lg
  }
native walrus
#

if you give main full width the top bar should be stretching with it

tulip ledge
#

it contains w-full

uncut brook
#

Better pass some Dashboard made for repl.it and I fork okno xdd

tulip ledge
#

which is 100%

vivid fulcrum
#

this just popped up on my recommended, thought it was relevant here lmfao; https://www.youtube.com/watch?v=pfaSUYaSgRo

Learn the basics of Tailwind CSS by building a Discord-inspired navbar from scratch. Learn how to leverage utility classes to build responsive animated UI elements faster https://fireship.io/lessons/tailwind-tutorial/

#webdev #css #tutorial

🔗 Resources

Tailwind Docs https://tailwindcss.com/
Tailwind React Setup https://tailwindcss.com/docs/gu...

▶ Play video
uncut brook
tulip ledge
#

oh main

native walrus
#

just mouse over the html elements in inspect element and see what's not taking up enough space

#

can't make websites without devtools

tulip ledge
#

For some reason the main

#

even though I added w-full

native walrus
#

then its parent isn't stretching

#

keep going up one level until you find an element that's not stretching out to its parent

uncut brook
#

@native walrus

#

you are from Spain?

tulip ledge
#
    <div className="flex">
      <Sidebar />
      <main className="flex-col w-full">
        <Topbar />
          <Router>
          <Switch>
            <Route exact path="/">
              <Home />
            </Route>
            {/* <Route exact path="/maaltijden">
              <Meals />
            </Route> */}
          </Switch>
        </Router>
      </main>
    </div>
native walrus
tulip ledge
#

Only parent is the top div

uncut brook
native walrus
#

what did I write wrong?

tulip ledge
#

I mean FakE's solution worked

#

should I just use his?

#

or is this solution better

native walrus
#

I mean the margin thing is a crutch

#

you want to have a proper layout instead of adding margins to things and using absolute positions

tulip ledge
#

ok

#

any idea what's going wrong?

native walrus
#

send a codepen or something idk

tulip ledge
#

cuz adding w-full to the top doesn't fix it

native walrus
#

can't tell without devtools

tulip ledge
#

Can I send a codepen with react stuff?

native walrus
tulip ledge
#

cuz I'm using react and tailwindcss

boreal iron
#

Based on your experience with it use to margin it down

#

Don’t over complicate things

tulip ledge
#

ok

#

but margins won't mess with responsivness?

boreal iron
#

You’re far away from doing a responsive design anyways

native walrus
#

you can do that, but adding a margin to overlapping elements in this case is kind of like seeing that a square peg doesn't fit in a circle hole and grabbing a hammer instead of learning where things are supposed to go

boreal iron
#

The margin has to be adjusted by the screen size easily done by using media queries

solemn latch
#

"Easily" more like annoyingly ^_^

boreal iron
#

Shh shh Mr. Woo

native walrus
#

html is about creating a layout where boxes flow into each other, position:absolute; margin-left: 25px is the nuclear option

tulip ledge
#

Also for some reason my sidebar isn't at 100vh when I scale down the screensize

boreal iron
#

Depends on you design things

tulip ledge
#

And margin makes it overflow on the x axis

boreal iron
#

If I want a static header and static footer responsive and on any browser you will have to use some sort of tricking

#

But nvm is free to do what he wants

#

Why suggesting somebody do use djs without proper knowledge if I can suggest him to create his own library

tulip ledge
boreal iron
#

Not that this would make sense in the first place, but it’s just an example

simple stump
#

I’m trying to get an user by their ID using message.guild.members.cache.get(id) and then add an user permission to the channel, but the user is returning undefined. I compared the ID to the actual user ID, and it all checks out. It’s weird because if an user has Admin, it works fine. But for a regular member, it doesn’t work.

tulip ledge
simple stump
#

Ah. How would I fix it then?

tulip ledge
#

Still confused to why the topbar doesn't wanna get 100% width

tulip ledge
simple stump
#

Oh. So use .fetch instead?

native walrus
#

100% means 100% of the parent. If the parent doesn't stretch across the entire page the child won't either

tulip ledge
simple stump
#

Aight. Thx

tulip ledge
native walrus
#

probably because body doesn't have a 100vw width

tulip ledge
#

doesn't solve

#

Well, I'll try again tomorrow

native walrus
#

make sure you learn flexbox

simple stump
#

If I have an user ID, how would I create a channel where only that user can see the channel?

vivid fulcrum
#

create an overwrite for the @everyone role and disallow viewing the channel

#

create an overwrite for the user id and allow viewing the channel

boreal iron
orchid loom
#

Who know where I can find docs from npm discord-buttons ?

boreal iron
#

Maybe on their npm preview page linked somewhere

#

Most likely

#

Is it even worth to use that library?

orchid loom
grim aspen
#

probably deleted

orchid loom
wheat mesa
#

But why

#

Just update to v13

#

Using v12 is like using var in modern day javascript

#

Except not really because var doesn’t always make life a pain in the ass

wheat mesa
#

var is deprecated, just like v12

orchid loom
sterile brook
#

i just need to change a lot of staff to update on v13

wheat mesa
#

Outclassed by better keywords such as let and const

sterile brook
#

i am too lazy for it

boreal iron
#

I will never understand the motivation to spend time on something you wanna do or you’re interested in but actually being too lazy to do it accurately.

#

I mean the time you invested into it is gone anyways you won’t get it back in your life.
Instead of dealing with your own sloppy done work investing even more time to keep it alive somehow instead of completely overhauling it is even more wasted time.
Life time to mention it once more.

native walrus
#

That's such a strange argument, you gain a ton of experience doing things the wrong way as a beginner

#

being told "var is bad" doesn't really teach you anything, but using var for a loop counter and getting frustrated when it doesn't work after you log it from inside a closure is a lot more instructive

#

(still a relevant analogy even if you weren't talking about var)

boreal iron
#

I guess the critic has nothing to do with skill here, just the fact being too lazy to update deprecated stuff is weird.
The day will come you got actually not time to spend and your shit doesn’t work anymore.
Which could be prevented by doing it accurately in the first place or not being too lazy to maintain or update something.

native walrus
#

I can understand not wanting to constantly maintain your work tho

#

that's not really something you sign up for when you start working on a project

boreal iron
#

Well that’s usually not the case

native walrus
#

the js ecosystem doesn't help that either

#

clone an unmaintained C repo from 1994 and it still compiles on the first try, clone a js repo from 2019 and you get 23 errors trying to run it lol

quartz kindle
#

sometimes youre just unlucky that your project actually took off

#

lmao

boreal iron
#

you’re generally right but in fact Discord is moving forward fast and they always cut the line behind forcing you to do things

native walrus
#

true, that's generally an L you have to take when you're dependent on a 3rd party api

quartz kindle
#

yes discord is screwing over a lot of people, so even if your bot is written in C99 it will still break several times

boreal iron
#

Businesses, apps, huge eco systems, even government environments etc. which are nowadays built for example on XP or PHP 4, generally spoken on old hardware or software etc could be updated since years tho but there’s actually no reason to if you’re not forced to

#

But discord is forcing users to

native walrus
#

I can understand it from their side, it just sucks for the user

boreal iron
#

And that’s what I mean if I say being lazy here if you got some motivation to spend time on something is just wasted time x2

native walrus
#

why upgrade your bot when you could use that time to complain about having to upgrade your bot on discord

boreal iron
#

IT, tech, software is enveloping so fast, you can’t be up to date all the time

#

But if you’re not working with discord, building something or at least trying to which can last a few years or decades, depending on its needs and purpose is worth the time to spend

#

Instead of being lazy

#

But arguing about that is also wasted life time like anything else, too

wooden kindle
#

can someone make me a restart cmd for me thanks

boreal iron
#

Special tonight offer, just 50 bucks

wooden kindle
#

Vbucks

boreal iron
#

50 bitcoins, sry KEKW

wooden kindle
#

jzus fuck

#

might as well just charge me like 3 mill

wooden kindle
native walrus
#

I love how people are still crying about slash commands in discord's github issues

boreal iron
#

Huh just exit your process, handle that exit to logout your client and close database connections or whatever, and create a new process launching your node app after a short timeout

boreal iron
native walrus
#

probably, but slash commands are just a natural evolution of bots on any kind of centralized chat app. It's crazy how long discord let bots just read all messages

boreal iron
#

I have to agree and the fact the increase the usability for the common (dumb) discord user is a good thing as well

native walrus
#

the only thing that seems strange to me is discord trying to crack down on bot accounts when bots run rampant on user accounts

#

but that's like a super super hard problem to fix

boreal iron
#

I mean like idk I’m sure 90% or more of the bots out there actually don’t need more requirements than slash commands already offer, so yeah more complaints are just because people are again too lazy to update stuff or straight too dumb

native walrus
#

I'd probably be angry too if I hadn't killed my only bot a while back

boreal iron
native walrus
#

I work on a fraud detection system for a living and sometimes I really wish it was as easy as some people on discord like to think it is

sterile brook
boreal iron
native walrus
#

well in most cases you don't create things from scratch but yeah, unlike developing a discord bot the goal is not well defined for anti-abuse and the thing you're fighting basically changes every day

boreal iron
#

Well yeah the comparison wasn’t perfect but you got what I mean I guess

native walrus
#

also it's difficult to measure how well you're doing since you can't rely on basically any metric

#

how does discord figure out whether or not some solution they implement for these phishing attacks is working as intended?

boreal iron
#

Well yeah creating something new always be successful or not how the user using it at the end decides

#

Or generally spoken how good it works of course supposed to do what it should do

boreal iron
#

They develop and provide the platform and moving forward to create more possibilities for users to control it

#

And the end the users need to find a way themselves to deal with it like developing addons or in this case bots

#

To do the job the platform creator should actually do

native walrus
#

ok but those bots have the exact same problem

#

you implement a solution for an unknown problem, but have no idea if the thing you're doing is working

#

for example you catch 100k phishing links a day. Is that 90% of all phishing links or 10%? You can't know because if you could identify all possible phishing links you would've solved the problem already

#

the next day the messages you delete drops to 10k. Did the the attacker give up after you added protection or have they started bypassing your checks? Very unpleasant problem to solve when you don't have the data you need to work with

boreal iron
#

That’s why I said discord doesn’t bother, they say they’re creating the possibilities and it’s up to your creativity dealing with the issue
And this keeps them out of all the trouble and possible false positives to deal with

native walrus
#

I highly doubt that's the case

#

letting malware and viruses run rampant on their platform has a serious impact

boreal iron
#

Did they ever stated they will do something about the nitro issue?

#
  • scam issue
native walrus
#

I don't think that's something you would let the people doing the phishing know

boreal iron
#

Hmm might be the case yeah

sterile brook
#

And then phishers will evolve

native walrus
#

if I had to guess Discord just hadn't thought about these things until fairly recently

#

and it's taking a while for them to put something together because they're starting from 0

boreal iron
#

Probably yeah I’m actually not even aware how they steal your account other than fishing the login data

native walrus
#

hi 12 year old kid, run this exe for free nitro

boreal iron
#

But since people talked about stolen token or cookie shit I wonder why they don’t do something

native walrus
#

then the program decrypts your chrome password store for your discord token and other login credentials

boreal iron
#

If they not already doing something

native walrus
#

phishing is the hardest one of these to stop because it bypasses all 2fa and attacks the weakest part of security which is users

boreal iron
#

Don’t they force 2fa nowadays anyways

native walrus
#

if you have someone's discord token there's no 2fa

boreal iron
#

Yeah ik not speaking about that

#

But in order to fix the issue of fishing passwords

#

At least I was forced to use one

native walrus
#

how does 2fa fix that

boreal iron
#

In order to unlock my account

native walrus
#

oh for passwords

#

you can MITM 2fa code too though

#

if you can get a user to fall for a fake login screen, you can get them to fall for an email verification modal too

boreal iron
#

Fishing your password doesn’t matter if 2fa doesn’t allow you to login from a new device

native walrus
#

right, so I ask you to click on approve on the email you got on your email to proceed

boreal iron
#

No matter it’s been filtered by the IP or some sort of hardware ID if you use the app on a PC

#

(like TeamSpeak does)

#

_bad internet connection _

native walrus
#

and you do it because you think it's a genuine discord login page

boreal iron
#

Will probably spam my messages if my connection is back oldEyes

native walrus
#

2fa is good for when there's a login attempt that doesn't involve you

#

but when you're the person trying to do the login and approving 2fa notifications it doesn't help that much

boreal iron
#

Damn my message appear under your name

#

Total chaos

#

Discord with short period of a disconnect on mobile fucks the app hard

#

Let me restart it

boreal iron
#

Unfortunately

#

We’re back to the question what would you do against it

#

And I dislike the idea of needing your fingerprint to access the net to provide your identity at any time

#

Spoken as metaphor

native walrus
#

you already give discord your fingerprint

boreal iron
#

Unfortunately yeah to be able to use it

native walrus
#

they check it on the signup page but I don't think they do for sending messages and such

boreal iron
#

I mean the metaphor wasn’t only about discord

#

Generally people argue if you completely remove the possibility to be anonymous in the net that would solve all the issues

native walrus
#

yeah the fight between privacy and security. Daily struggle

boreal iron
#

Which is bullshit

native walrus
#

I mean for this case in specific it wouldn't do anything because someone is pretending to be you

#

or performing actions on your behalf

#

it might solve some issues, but definitely not all

boreal iron
#

Correct which throws us back again

native walrus
#

I think this is the closest option to getting the benefits of proving your identity and remaining anonymous https://blog.cloudflare.com/introducing-cryptographic-attestation-of-personhood/

The Cloudflare Blog

An experiment that uses hardware security keys (like a YubiKey) to replace CAPTCHAs completely. The idea is rather simple: if a real human is sitting at their keyboard or uses their phone, they can touch their security key’s button or bring it near their phone to demonstrate that they are human.

boreal iron
#

It might be unfair to compare that to terrorism but it will also ever happen no matter what u do and how much you think you can control people

#

At some point you have to live with it and try to be always one step in front of the attackers

#

Just like a cat and mouse game

native walrus
#

a very fun one

#

well for me it's fun but yeah also difficult

#

https://www.youtube.com/watch?v=5gxI-6QmPdE this is a pretty good talk on the topic

Slides and blog posts available at https://elie.net/ai

This talk explains why artificial intelligence (AI) is the key to building anti-abuse defenses that keep up with user expectations and combat increasingly sophisticated attacks. It covers the top 10 anti-abuse specific challenges encountered while applying AI to abuse fighting, and how to ...

▶ Play video
boreal iron
#

At the end it’s something you can’t actually solve or prevent but you should be aware of and try to deal with not like discord atm being far, far behind

#

Can’t watch that atm while driving lol

native walrus
#

the thing is, just like how discord doesn't know how well it's doing in terms of dealing with the problem, you don't know how well they're doing either

#

what if discord is doing a lot of work behind the scenes and this is only 10% of the phishing we would otherwise be seeing

#

considering how bad things are I kind of doubt that but you know, that's a possibility

boreal iron
#

Yeah also true even if I believe it’s not the case, but I could be wrong

native walrus
#

ugh I want to work at google just so I can learn from this guy in the talk lol

boreal iron
#

Finally made it home through all the fog, rain, while eating in my car and texting with you

#

Proves I’m a multithread talent KEKW

#

And yes I said thread intentionally instead of task since we’re in the development room

#

Needs to sounds "techy" and fancy

native walrus
#

isn't consciousness single-threaded

boreal iron
#

Nope some people actually can’t walk and breathe at the same time watching them

native walrus
#

consciously multitasking is just quickly switching between multiple things

quartz kindle
#

humans are async

boreal iron
#

Don’t destroy the fact I praised myself, please

#

I knew it, Tim’s always watching

slender thistle
#

That'll be £70

boreal iron
#

No no I’m always stopping my car if I’m replying, trust me

slender thistle
#

Pulls the e-brake right on the road to reply...

boreal iron
#

Hmm dunno why people always complain if I stop on the highway

#

People are weird, isn’t me

wheat mesa
#

Pause the road

slender thistle
#

Lmaoo

earnest phoenix
#

Hi. can i get help here with my code?

lyric mountain
#

ye

earnest phoenix
#

I'm trying to log all the log to a webhook but idk how. I already use this code.

console.log("Help command has been ran by "+message.author.tag +"["+message.author.id +"]")
lyric mountain
#

that will log to console not webhook

earnest phoenix
#

I want to log it in to webhook.

#

How?

lyric mountain
#

then retrieve the webhook and send a message to it

#

@ripe prairie come here qt

lyric mountain
earnest phoenix
#

Maybe i you can give me example?

lyric mountain
#

there are already examples there

earnest phoenix
#

Ok...

lyric mountain
#

just give it a calm read, don't try to grab the first piece of code your eye sees and chunk into ur code

earnest phoenix
hasty mulch
#

This one has my head scratching:

Code:

@commands.command(name='load', hidden=True)
@commands.is_owner()
async def _load(self, ctx, *, cog: str):
    await ctx.send(f'**`Loading Cog: {cog}...`**')
    """Command which Loads a Module.
    Remember to use dot path. e.g: cogs.owner"""

    try:
        print('Loading cog...')
        await asyncio.sleep(0.1)
        print('Cog name:')
        await asyncio.sleep(0.1)
        print(cog)
        await asyncio.sleep(2)
        self.bot.load_extension(f'cogs.room-sealer-{cog}')
    except Exception as e:
        await ctx.send(f'**`ERROR:`** {type(e).__name__} - {e}')
    else:
        await ctx.send(f'**`Cog: {cog} has loaded successfully`**')
```Python language

Error:
`ERROR:` ExtensionNotFound - Extension 'cogs.room-sealer-gather' could not be loaded.

Local file path: `MainBotFolder/cogs/room-sealer-gather.py`
earnest phoenix
#

And its easier to just get Discord from discord.js

#

And
Discord***.***MessageEmbed()
Discord.MessageButtons()

stark moth
#

is there a way to make your bot 24/7 with steam bot maker

#

?

onyx torrent
#
    if (!interaction.isCommand()) return;

    const command = client.commands.get(interaction.commandName);

    if (!command) return;

    try {
            premiumGuildSchema.findOne({
                User: interaction.user.id
            }, async(err, data) => {
                if(!data){
                  try {
                interaction.deferReply(); 
                await interaction.editReply({content:`This bot is a premium only bot. You can only use \`v!help\` and \`v!vote\` without premium.\nIf you've already voted then use \`v!premium\` to claim your reward.\n\n (To get  24hours of premium vote on top.gg by using the command \`v!vote\` . You can claim premium everyday by voting once every 24 hours.)`, components: [row]});
                }catch (e)
                {
                    console.log(e);
                } 
                }         
                else if(!data.Permanent && Date.now() > data.Expire) {
                data.delete();
              try {
await interaction.author.roles.remove(memberRole);
              } catch(e){
                console.log(e);
              }
                interaction.deferReply();
                await interaction.editReply({content:`Your premium has expired :(
                \`claim again by voting on top.gg\``, components: [row]});
            }
            if(data) await command.execute(interaction);
            });
    } catch (error) {
        console.error(error);
        return interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
    }
});```

The interaction keeps failing if data = null
small tangle
#

what is premiumguildschema? everything is into its () does the findOne method works that way?

small tangle
#

what does the error say?

onyx torrent
#

just the reply is just never sent

#

due to deferReply() the bot keep thinking forever

cold meteor
#

@rustic nova

rustic nova
#

Thanks

cold meteor
#

np

small tangle
#

in the console you should get an error FeelsSmartMan

onyx torrent
blazing gust
#

I made a music bot

small tangle
#

in an example it says you need to await the deferReply()

onyx torrent
onyx torrent
#
    if (!interaction.isCommand()) return;

    const command = client.commands.get(interaction.commandName);

    if (!command) return;

    try {
            premiumGuildSchema.findOne({
                User: interaction.user.id
            }, async(err, data) => {
                if(!data){
                  try {
                await interaction.deferReply(); 
                await interaction.editReply({content:`This bot is a premium only bot. You can only use \`v!help\` and \`v!vote\` without premium.\nIf you've already voted then use \`v!premium\` to claim your reward.\n\n (To get  24hours of premium vote on top.gg by using the command \`v!vote\` . You can claim premium everyday by voting once every 24 hours.)`, components: [row]});
                }catch (e)
                {
                    console.log(e);
                } 
                }         
                else if(!data.Permanent && Date.now() > data.Expire) {
                data.delete();
              try {
await interaction.author.roles.remove(memberRole);
              } catch(e){
                console.log(e);
              }
                await interaction.deferReply();
                await interaction.editReply({content:`Your premium has expired :(
                \`claim again by voting on top.gg\``, components: [row]});
            }
            if(data) await command.execute(interaction);
            });
    } catch (error) {
        console.error(error);
        return interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
    }
});```
small tangle
#

and still fails ig

onyx torrent
#

yes (:

#

but why idk

small tangle
#

but why a you doing deferreply and instant editreply?

onyx torrent
#

then

#

what should i do instead?

small tangle
#

just delete deferreply and change editreply simply to reply

onyx torrent
#

the interaction fails in that case

blazing gust
spark flint
#

The bot runs locally on his PC

#

So that won’t work

deft citrus
#

how to make the bot send a message to a specific channel

#

the channel which i give

spark flint
deft citrus
#

ye

spark flint
#

channel = client.get_channel(ID)
await channel.send(“msg”)

#

Replace msg with anything you want

deft citrus
#

ohk

#

ty

small tangle
#

it only fails if data = null?

#

what package is premiumguildschema?

onyx torrent
onyx torrent
deft citrus
#

how to set the channel is by command like

#

like this

#

?

onyx torrent
deft citrus
small tangle
#

did you tried to reply with a simple text to see if its the message content?

spark flint
spark flint
#

then you can do channel.mention etc and it mentions the channel

small tangle
#
if (!data) {
    try {
        await interaction.reply({
            content: `This bot is a premium only bot. You can only use \`v!help\` and \`v!vote\` without premium.\nIf you've already voted then use \`v!premium\` to claim your reward.\n\n (To get  24hours of premium vote on top.gg by using the command \`v!vote\` . You can claim premium everyday by voting once every 24 hours.)`,
            components: [row]
         });
    } catch (e) {
          console.log(e);
    }
}
#

so you tried this?

onyx torrent
#

yes

#

thats the same

small tangle
#

where did you defined row?

onyx torrent
#

@ripe prairie

small tangle
deft citrus
#

is this correct

#

or wrong

spark flint
#

wrong

#
@client.command()
async def news(ctx, channel:discord.Channel, *, news)
  await channel.send(f"News: {news}")```
deft citrus
#

invalid

#

syntax error

spark flint
#

oh wait

#
@client.command()
async def news(ctx, channel:discord.Channel, *, news):
  await channel.send(f"News: {news}")```
#

there

deft citrus
#

working

spark flint
#

try using an embed for the news

deft citrus
#

Traceback (most recent call last):
File "main.py", line 75, in <module>
async def news(ctx, channel:discord.Channel, *, news):
AttributeError: module 'discord' has no attribute 'Channel'

#

see

#

error

spark flint
#

lemme look

#

oh wait

#

its discord.TextChannel

#
embed = discord.Embed(title="Embed title", description=f"Submitted by **{ctx.author}**")
embed.add_field(name="Put something here", value=news)```
#

something like that

#

work on that code and build from it

stiff lynx
#

let invites = await interaction.guild.fetchInvites();

err: TypeError: interaction.guild.fetchInvites is not a function
How can I fix this?

earnest phoenix
#

hello how make vote require command in djs

spark flint
#

interaction.guild.fetchInvites is not a function

stiff lynx
spark flint
stiff lynx
#

for get the invites from an interaction

earnest phoenix
earnest phoenix
deft citrus
#

just showing News: ""

spark flint
#

yeah you need to send news with it

#

etc

deft citrus
deft citrus
#

but

#

embed

spark flint
#

do await channel.send(embed=embed)

deft citrus
# spark flint do await channel.send(embed=embed)

gnoring exception in command news:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 74, in news
await channel.send(embed=embed)
UnboundLocalError: local variable 'embed' referenced before assignment

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'embed' referenced before assignment

spark flint
#

hmm

#

weird

narrow fractal
#

send the whole command in code

#

doesnt seem right

spark flint
#

yeah

#

you've probably put an embed somewhere else @deft citrus

#

or used the variable "embed" for something else

deft citrus
#

working

#

yes

spark flint
#

ok

deft citrus
#

working

#

wow

#

its nice

spark flint
#

you can add colours etc

#

add colour=0xHEXCODE to discord.Embed()

narrow fractal
#

i was about to send an example lol

spark flint
#

replace Hexcode with a hex code colour

#

I'm trying not to spoonfeed too much

deft citrus
#

ok

#

nice

sterile brook
#

U actually spoonfeeding

spark flint
#

i'm trying not to give fullblocks of code now

#

just tips like adding colours to the embed

#

they still have to figureout how to do it

narrow fractal
#

yea

#

these things arent advanced at all

#

but for a new user it is

deft citrus
#

i just started 3 days before

spark flint
#

its easy for someone with experience to make

#

I always say that you should only code to a level you are comfortable coding at

#

don't make features too advanced if you don't know how to

stiff lynx
#

why not more easily .setColor('exadecimal_color)

spark flint
#

different language

stiff lynx
#

oh

#

rip 🙂

narrow fractal
#

yea dpy

earnest phoenix
#

hello

#
const Topgg = require('@top-gg/sdk');
const topgg = new Topgg.Api("TOP.GG_TOKEN")

   let voted = await topgg.hasVoted(message.author.id);
    if (!voted) {
      return message.reply('not voted')
    }``` still bot command working
#

without vote

#

just bot send message

#

but work command to

deft citrus
#

why cant we leave space in command name

spark flint
#

because then it doesn't work

#

because the bot will pick the command after the space as an input

deft citrus
#

then how can we add space

spark flint
#

!help me
would send !help with me being a variable

spark flint
deft citrus
#

;-;

earnest phoenix
#

ignore

spark flint
#

I don't know discord.js sorry

earnest phoenix
#

oh hmm

deft citrus
#

bro then if i type async def news(ctx,'add', channel:discord.TextChannel, *, news):

#

will it work

spark flint
#

no

narrow fractal
#

wdym with add?

spark flint
#

that won't work at all

deft citrus
#

means ^news add

narrow fractal
#

yea but that doesnt make sense

deft citrus
#

;-;

narrow fractal
#

that's not how it works

spark flint
#

doesn't work like that

deft citrus
#

ooh then how

spark flint
#

could do (ctx, option, channel:discord.TextChannel, *, news)

#

then if option == "yes": ...

#

wait fuck

deft citrus
#

oh

narrow fractal
#

almost

deft citrus
#

wht

spark flint
#

if option == "add": ...

earnest phoenix
#

get this error

spark flint
#

not yes

narrow fractal
#

async def news(ctx, option:str = None, channel:discord.TextChannel, *, news):

#

the none part isnt needed if you dont want it