#development

1 messages · Page 1957 of 1

sudden geyser
#

So given .author is clearly returning undefined, you should look into what message is

earnest phoenix
#

I'll log message and check

earnest phoenix
sudden geyser
#

I don't know what client's relevance to your issue is.

earnest phoenix
#

and now.. args[0].some is not a function

sudden geyser
#

You'll need to check the value of args[0] and what methods it supports yourself

#

We don't know what it is and it would be faster for you to verify anyway.

earnest phoenix
#

ok

earnest phoenix
#

yeah I did it wrong

cunning gust
#

My bot is not responding but the repl is on whats the issue ?

earnest phoenix
#

do you see any errors in the concle?

cunning gust
#

no

earnest phoenix
#

try running a command see if an error apears

cunning gust
#

sometimes It responds after 10-20 minutes later

earnest phoenix
#

what kind of bot is it?

cunning gust
#

Music and moderation

earnest phoenix
#

could you invite me i could look into it if you want

cunning gust
#

see time

#

of response

sudden geyser
#

So it went back in time

bronze socket
#

how to link vote weebhooks??

lament stump
lyric mountain
rigid maple
#

When I log "getStatistics.items[0].id.channelId" in the function it gives the output
I return this and when I use the function outside of function it returns undefined to me

wheat mesa
#

That looks kinda like a base64 string

rigid maple
#

i have no idea what i can do

wheat mesa
#

What is items[0] and what are you trying to accomplish from this

rigid maple
#

and I noticed this; When I use the function, the value it returns returns before the value it logs while the function is running.

wheat mesa
#

Oh wait the output isn’t the problem is it

#

Are you just not getting the right return value?

rigid maple
#

While coding the function, I log the output to the console to learn the result.

#

this value is right

#

but when using this function it returns me undefined value

wheat mesa
#

Well first off you should await a function that doesn’t require it

#

Shouldn’t*

rigid maple
#

yes i deleted "await"

wheat mesa
#

I don’t really know what the problem is because I’ve only seen 3 lines of code

rigid maple
#

line 34 output: UCzqMhk6yyb74PbpnvZ2gLgw
line 39 output: undefined

quartz kindle
#

videoer is undefined?

rigid maple
#

videoer = url

#

if videoer was undefined I wouldn't be able to output UCzqMhk6yyb74PbpnvZ2gLgw either

quartz kindle
#

ah i see

#

you are not returning anything from inside the function

wheat mesa
#

Stupid idea, maybe try changing the overall function to async and await the fetch call

#

Since one of your .thens has an async function inside of it

#

That’s a shot in the dark but if that doesn’t work I’m sure Tim probably knows mmulu

quartz kindle
#

the structure is fine, the problem is not understanding how async and promises work

wheat mesa
#

Await your function call too

rigid maple
#

undefined

#

😐

wheat mesa
#

Yeah I didn’t think it would work

#

Was just an idea

quartz kindle
#

what did you do? show code

wheat mesa
#

Personally I’d convert that structure inside your function to async/await since it’s much easier to manage than nesting .then with async functions inside of them

rigid maple
#

youtube video notifications

quartz kindle
#

yes thats fine, i told you you were not returning anything, where did you add the return? show what you did

#

so you did nothing after i said that?

rigid maple
#

line 35

#

return channelID

wheat mesa
#

I just realized that I’m blind

#

You’re returning from inside your .then function

quartz kindle
#

thats not returning anything

wheat mesa
#

Not the function body itself

quartz kindle
#

getYoutubeChannelId has no return

#

that return is inside the .then() its a separate function

rigid maple
#

oh

#

i think i understand

quartz kindle
#

to be more specific, you need to return the fetch, and you need to await getYoutubeChannelId

#
function getYoutubeChannelId() {
  return fetch(...)...
}

console.log(await getYouTubeChannelId(...))
rigid maple
#

yes

#

yes i understand it thanks

#

really thank you so much

wheat mesa
#

(Also would highly recommend using async/await instead of chaining .then callbacks)

#

Up to you to decide your design though

spark flint
rigid maple
#
    let fetc = await fetch({})
    let json = fetc.json()
```like this?
wheat mesa
#

Yes

rigid maple
#

Is there a performance difference?

wheat mesa
#

Not that I know of, but it’s way more organized

quartz kindle
#

you have to await json() too

rigid maple
#

thanks

wheat mesa
#

My brain is fried

#

I apologize

rigid maple
#

🧡

split hazel
#

ops on json web tokens?

sudden geyser
#

don't use them for sessions

#

they're nice for one-time use operations

#

what do you want to use them for

split hazel
#

I'm not planning to use them just gathering opinions

#

like for example using them instead of cookies

cinder patio
#

I wouldn't

sudden geyser
#

Ah

#

I'd suggest preferring other technologies, like sessions and cookies

#

A lot of people try to use them for sessions, for example, but it often doesn't work since JWTs are hard to invalidate

#

and those solutions usually take away from jwt's selling point

#

but I like that they're simple

#

but sessions with cookies are simpler

quartz kindle
#

i dont understand them that well tbh

#

they feel like overcomplicating something simple

split hazel
#

I like the fact you can store data with a signature in them without the need for storing a copy on the database for authentication

#

but if someone snatches the token you're done

sudden geyser
#

yep

spark flint
#

is a vds better

#

than a vps

quartz kindle
#

depends, vds is not exactly a commonly used name

#

virtual dedicated server

#

because like, the words virtual and dedicated are usually mutually exclusive

#

so it depends on what such companies mean by that

#

could be a virtual server with guaranteed resources for example

spark flint
#

KVM Ryzen VDS - KVM Ryzen 8GB -VDS
Ryzen 9 5950X (2 Dedicated vCores)
8GB DDR4 ECC Memory
120GB RAID1 NVMe SSD
4TB Bandwidth (1 Gbps)
Located in Dallas, TX
DDoS Mitigation (Up to 10 Gbps)

#

that

quartz kindle
#

yeah, its a regular vps with 2 dedicated cores

#

meaning its not shared with other clients based on load

#

which is pretty much the standard for KVM servers

#

so its not much different from a regular vps

earnest phoenix
#

why is it always undefined? replit

#

with and without dotenv.config() its undefined

uneven tartan
earnest phoenix
#

its still undefined for some reason

uneven tartan
#

odd

#

not sure how to help otherwise

earnest phoenix
#

it switched back to v12 for some reason

#

lol

#

wut

#

wtf

spark flint
#

Uncaught SyntaxError: Unexpected token 'else'

earnest phoenix
#

what is happening with replit lmao

#

it works now

#
 if (wins <= 5) {
arena = training;
next = "Next arena in 5 wins";
arenms = "`Training Camp`";
  } else if (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 (..) {
....
...
} same...
#

can I do this in a few lines?

#

and what's wrong with it

#

I have 2000 trophies and it says i'm in arena 2

#

@wet dove oh shit

exotic hull
#

Hey i this is my bot, i am developer of a verified bot too so my this new bot grew very fast, due to this growth i got message for inorganic growth, i waited a bit amd then applied for verification after 7 days and it's been 3-4 months its still showing this, will it get verified or is there anything that can i do

earnest phoenix
exotic hull
#

Not even any ticket opened

spark flint
#

Ticket is only opened on their reply

exotic hull
#

Yes, they didn't replied

earnest phoenix
#

the code for it is above of the image

boreal iron
#

Why does the nodejs inspect util return Promise { … } after awaiting some evaluated code?

eval = eval(…);
await eval;
inspect = …inspect(eval);
#

Shouldn’t it be the type of var it really is after awaiting it?

cinder patio
#

because eval is still a promise, it's just been fulfilled

#

to get the actual value you use await

boreal iron
#

yaay ping

eternal osprey
#

hey in d.py how would i check the time a user joined and check if it's under 5 minutes

boreal iron
#

By creating a timestamp (date time) and subtracting the join time of the user from it

#

Check if the result is larger than 5 minutes

#

Whatever py timestamps are in… s, ms etc.

sudden geyser
#

probably a date instance

eternal osprey
#

Thank klay cutie 🙂

spark flint
#

I'm using JS to change my website's theme

#

Is there any way to make it transition between themes

#

instead of just switching, a quick fade to make it look smother etc

sudden geyser
#

sounds like you want an animation

boreal iron
#

You would need to animate each style setting you change

spark flint
#

atm

boreal iron
#

Not really an issue for backgrounds, but lots of work

eternal osprey
#

How can i ever subtract them from each other

sudden geyser
#

then you just compare it with < or >

boreal iron
#

Or simply creating a timestamp of your time string

eternal osprey
#

ah so basically: py var1 = datetime.now - datetime.timedelta(joinedatvar) if var1 < 5: print("yes")

sudden geyser
#

nope

eternal osprey
#

dang

#

How wouldn't that be correct

#

because timedelta substracts

#

wait, can't we just if datetime.timedelta(joinedatvar) < 5

boreal iron
eternal osprey
#

As it takes the current and subscrtracts it by using timedelta directly

boreal iron
#

Fading backgrounds is just ew tbh

sudden geyser
#

Keep in mind the example shown is how to minus minutes on the current time.

#

So it shouldn't be concerned about the user's join date

eternal osprey
#

Yeah, couldn't we get the join date and minus it on our current time and calculate if it's less than 5 minutes

sudden geyser
#

You should review it since it has everyone you need there: the current time (now), minus, and deltas setting the minutes (15, but should be 5 in your case)

#

After that, you'll have the time 5 minutes before, which you can then compare with joinedatvar

eternal osprey
#

Owhhhh

#

Okay i tried your approach

#
 present = datetime.now()
    k = timedelta(2)
    joinedatvar = k + present
print(joinedatvar)```
#

and this actually logs me 2022-01-12 00:28:12.691056

#

and now i would do present - joinedatvar < 5 right

sudden geyser
#

Not exactly

opaque acorn
#

how can i put the button on the bot of add to the server?

boreal iron
#

In the discord dev portal

sudden geyser
#

A correct solution would've been:

t = datetime.datetime.now() - datetime.timedelta(minutes=5)

if t > joinedatvar:
  pass # ...
#

Notice how we're grabbing the current datetime with .now()

#

But we minus it with the timedelta of 5 minutes

boreal iron
#

datetime.datetime … my gosh

sudden geyser
#

What that does is create a datetime set to 5 minutes

opaque acorn
sudden geyser
#

Then you'll minus that to get your datetime 5 minutes in the past

#

And compare it like you would.

sudden geyser
solemn latch
#

why is it so hard to subtract time in python 👀

sudden geyser
#

it's not

spark flint
#

just did html <style> body { -moz-transition: background 0.3s ease-in; -o-transition: background 0.3s ease-in; -webkit-transition: background 0.3s ease-in; } </style>

boreal iron
sudden geyser
#

in fact I'd argue it's more flexible than a lot of langs

opaque acorn
#

ok thx

sudden geyser
#

but they're hard for new users to understand

boreal iron
sudden geyser
#

I like Java and Swift's way of handling dates and time

#

not that java.util.Date clusterfuck, but the java.time module

boreal iron
spark flint
#

its just so its not so sudden

#

and the person who I'm making it for requested it dance

sudden geyser
#

isn't the use of vendor prefixes bad practice

azure lark
#

dose anyone know how to use the github api to create a file on a github repo

opaque acorn
#

what the duck

solemn latch
azure lark
solemn latch
#

are you encoding it properly?

#

content needs to be base64 encoded

azure lark
#

uhm, how do i do that

#

im just change the 'content' to 'test'

solemn latch
azure lark
#

do i just replace it with the encoded thing, like; content: 'dGVzdA=='

solemn latch
#

yeah

azure lark
#

still gave me LD�

#

dose the file name need to be like that

split hazel
#

it's probably expecting something else

#

maybe buffer?

#

I doubt they'd allow a very specific text file with content

spark flint
#

found this from november and i feel like the dev community needs to feel the pain

split hazel
#

assuming c++ is their language of choice

#

either visual studio or uh

#

no idea

boreal iron
#

Well php works on any platform

split hazel
#

yeah but does the interpreter work on any platform

boreal iron
#

lol of course

#

It’s older than you and me

sudden geyser
#

so that was the person

split hazel
#

I think not

#

so be quiet before I interpret your mother

boreal iron
split hazel
#

will you just ignore my violation to you

boreal iron
#

It’s available for any damn platform

#

Yes!

split hazel
#

yeah but what if you're on a limited data plan in zimbabwe

boreal iron
opaque acorn
#

anyone can help?

spark flint
#

what the fuck

#

is that

opaque acorn
#

idk

spark flint
#

is that fucking brainfuck lang

opaque acorn
#

nono

#

that is my bot terminal

split hazel
#

lmao

crimson vapor
#

brainfuck is actually really cool

#

you guys ever attempted to learn it?

split hazel
#

is your bot just reading random memory

#

and printing it to the screen

#

I have lots of experience with that sadly

opaque acorn
crimson vapor
#

what are you logging?

boreal iron
#

Somehow looks like some injected code fucking you up

opaque acorn
quartz kindle
opaque acorn
#

listen

split hazel
#

anything sums it up quite well

opaque acorn
#

i did a npm update

#

then this happened

split hazel
#

I wouldn't expect a node program to do something like this

quartz kindle
#

what exactly do you mean "i did a npm update"

#

describe the steps you took

opaque acorn
#

open the terminal

#

put npm update

#

then node .

quartz kindle
#

show your package.json

errant flax
#

so i have a code like:

module.exports = () => {
return "testing"
}
module.exports.test = () => {

}

i want to access the module.exports function inside module.exports.test how do i do that?

earnest phoenix
#
> npx tsc
error TS2304: Cannot find name 'this'.
``` ![MegaThonk](https://cdn.discordapp.com/emojis/585884192361938960.webp?size=128 "MegaThonk")
opaque acorn
#
{
  "name": "railban",
  "version": "2.1",
  "description": "Bot para todo. Desde moderacion hasta reacciones de anime.",
  "main": "index.ts",
  "dependencies": {
    "@discordjs/opus": "^0.7.0",
    "@discordjs/voice": "^0.7.5",
    "@distube/soundcloud": "^1.0.0",
    "@distube/spotify": "^1.0.0",
    "better-sqlite3": "^7.4.6",
    "booru": "^2.5.0",
    "canvas": "^2.8.0",
    "child_process": "^1.0.2",
    "colors": "^1.4.0",
    "discord-buttons": "^4.0.0",
    "discord-math": "^1.0.5",
    "discord-nsfw": "^1.3.0",
    "discord.js": "^12.5.3",
    "discord.js-pagination": "^1.0.3",
    "distube": "^3.0.5",
    "enmap": "^5.8.7",
    "eris-additions": "^1.4.1",
    "ffmpeg-static": "^4.4.1",
    "fs": "^0.0.2",
    "generate-password": "^1.7.0",
    "glob": "^7.2.0",
    "lint": "^1.1.2",
    "megadb": "^3.4.0",
    "moment": "^2.29.1",
    "mongoose": "^6.1.4",
    "node-gyp": "^8.4.1",
    "nodemon": "^2.0.15",
    "opusscript": "^0.0.8",
    "quick.db": "^7.1.3",
    "reconlx": "^2.5.2",
    "youtube-search": "^1.1.6",
    "ytdl-core": "^4.9.2",
    "@distube/ytdl-core": "^4.9.4",
    "mal-scraper": "^2.11.4",
    "isgd": "^1.1.3",
    "ms": "^2.1.3"
  },
  "engines": {
    "node": "16.12.0"
  },
  "scripts": {
    "test": "nodemon .",
    "start": "node ."
  },
  "keywords": [
    "node.js",
    "anime",
    "railgun",
    "raildex"
  ],
  "author": "TOUMAsenpai"
}```
errant flax
#

why do u use discord-buttons when djs already supports buttons(in v13)

split hazel
#

what if its a native package bugging out

#

unlikely but maybe

errant flax
opaque acorn
errant flax
#

djs v12 will get deprecated

opaque acorn
errant flax
#

rip for ur bot when message intent is out zoomeyes

quartz kindle
#

you have a lot of packages you likely dont use

#

remove them

earnest phoenix
#

lol

split hazel
#

dont bully beginners for their package json

#

you don't wanna see mine

errant flax
solemn latch
opaque acorn
#

@quartz kindle

npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN tarball tarball data for prism-media@https://codeload.github.com/distubejs/prism-media/tar.gz/main (sha512-nLwwM6M/qz+VZ0LNzfcKrEwojdgEH5lGZDPaBpXp75gNeTEQ95ysj1QHbCUWHTLoC+fPJJ5Io13pe4RtQBmyTw==) seems to be corrupted. Trying again.
npm WARN tarball tarball data for prism-media@https://codeload.github.com/distubejs/prism-media/tar.gz/main (sha512-nLwwM6M/qz+VZ0LNzfcKrEwojdgEH5lGZDPaBpXp75gNeTEQ95ysj1QHbCUWHTLoC+fPJJ5Io13pe4RtQBmyTw==) seems to be corrupted. Trying again.
npm WARN deprecated discord.js@12.5.3: no longer supported
npm ERR! code EINTEGRITY
npm ERR! sha512-nLwwM6M/qz+VZ0LNzfcKrEwojdgEH5lGZDPaBpXp75gNeTEQ95ysj1QHbCUWHTLoC+fPJJ5Io13pe4RtQBmyTw== integrity checksum failed when using sha512: wanted sha512-nLwwM6M/qz+VZ0LNzfcKrEwojdgEH5lGZDPaBpXp75gNeTEQ95ysj1QHbCUWHTLoC+fPJJ5Io13pe4RtQBmyTw== but got sha512-2a/62b86i60OksrnliRwG7IGMHjFHM0KiRYk6YBi43IZpCZCf/ZLjXIbMGtzzeTZhEJy1Fi6Ke6kKtn2ObNjPw==. (9773 bytes)```
boreal iron
quartz kindle
#

uninstall more

errant flax
#
module.exports = () => {
return "testing"
}
module.exports.test = () => {

}

i want to access the module.exports function inside module.exports.test how do i do that?

split hazel
#

adds sussy commands to bots

errant flax
#

oh u can play among us in discord

#

nice

sudden geyser
#

why do all devs add 100 dependencies to their project when first starting out

split hazel
#

when I was new I actually wanted to

split hazel
#

but I couldn't find any nsfw apis

#

or packages

solemn latch
#

theres only hundreds of nsfw api's 👀

boreal iron
split hazel
#

but I'm not sure how javascript reacts with imports like that

sudden geyser
#

you have all the sites in the world and you choose discord for porn

split hazel
#

would it overwrite the default function no idea

errant flax
split hazel
quartz kindle
#

what are you trying to do?

errant flax
quartz kindle
#

then yes it should work

#

if its in the same file

earnest phoenix
#
> npx tsc
error TS2304: Cannot find name 'this'.
``` why
quartz kindle
#

who knows

earnest phoenix
boreal iron
#

First thing I read when searching that package is a bit fat DEPRECATED text

earnest phoenix
#

ohh

earnest phoenix
earnest phoenix
#

colors.js is borked

slender thistle
#

We discussed it but got to a mutual "fuck it"

earnest phoenix
#

Hey i need help with publish slash commands since i keep getting error while starting my bot:
error:

TypeError: Do not know how to serialize a BigInt

from this line

const res = new REST({ version: '9' }).setToken(token);
            res.put(Routes.applicationGuildCommands('444850390765273108', '444689151225495563'), { body: interaction });

quartz kindle
#

what is interaction?

opaque acorn
#
~/railban-bot$ node .
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './commands/moderation/addrole.js'
Require stack:
- /home/runner/railban-bot/handlers/command_handler.js
- /home/runner/railban-bot/index.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at module.exports (/home/runner/railban-bot/handlers/command_handler.js:35:25)
    at /home/runner/railban-bot/index.ts:25:35
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/runner/railban-bot/index.ts:24:38)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/railban-bot/handlers/command_handler.js',
    '/home/runner/railban-bot/index.ts'
  ]
}
quartz kindle
#

that file was not found

#

where do you have this code? require('./commands/moderation/addrole.js')

#

in command_handler.js?

astral iris
#

What is the issue with this?

#

They both equal ⭐️?

quartz kindle
#

try logging their lengths

#

or if you wanna dig deeper, log their buffer representations

astral iris
#
<rejected> TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
      at new NodeError (node:internal/errors:371:5)
      at Function.from (node:buffer:322:9)
      at starboardHandler (/Users/jterrell1202/Desktop/DuckBot 2.0/handlers.js:170:21)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async Client.<anonymous> (/Users/jterrell1202/Desktop/DuckBot 2.0/bot.js:73:2) {
    code: 'ERR_INVALID_ARG_TYPE'
  }
} reason: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at Function.from (node:buffer:322:9)
    at starboardHandler (/Users/jterrell1202/Desktop/DuckBot 2.0/handlers.js:170:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Client.<anonymous> (/Users/jterrell1202/Desktop/DuckBot 2.0/bot.js:73:2) {
  code: 'ERR_INVALID_ARG_TYPE'
}
#
    console.log(Reaction.emoji.length);
``` gives me Undefined while the other gives me 2
quartz kindle
#

so one of those is actually undefined

#

oh wait

astral iris
#

The weird thing is tho when I log the name it provides a name

quartz kindle
#

Reaction.emoji is an object

#

you forgot .name

astral iris
#

Shit, you right

#

First gives me 1 other gives me 2 but there isn't a space or anything in the 2nd one, I just verified in the DB

quartz kindle
#

the lengths?

astral iris
#

Yeah

quartz kindle
#

try the buffer representation

#

its probably a unicode modifier

quartz kindle
#

weird

astral iris
#

Yeah, I am completely lost here

quartz kindle
#

its saying its undefined

#

wait

#

what if

#

you're in a guild that has a custom star emoji

quartz kindle
#

that looks exactly the same

astral iris
#

Nope, there isn't one

quartz kindle
#

welp, was worth a shot

astral iris
quartz kindle
harsh rock
quartz kindle
quartz kindle
astral iris
quartz kindle
#

there is no reason for the buffer to claim its undefined unless its really undefined for some reason or in some specific situation

#

try logging the parent objects then

astral iris
#

I am reacting with the right reaction

astral iris
astral iris
slender thistle
#

Also it's not really any of our business anymore but Top.gg's. We both resigned with notices to the team and did our part at least

quartz kindle
#

console.log(Reaction.emoji, Settings)

slender thistle
#

I did it personally just to get me a replacement replacement but there isn't anyone I could remember when we talked about it

astral iris
# quartz kindle console.log(Reaction.emoji, Settings)
<ref *2> ReactionEmoji {
  animated: null,
  name: '⭐',
  id: null,
  reaction: <ref *1> MessageReaction {
    message: Message {
      channelId: '921068091750899712',
      guildId: '841777101157957642',
      id: '929951328610951199',
      createdTimestamp: 1641788074401,
      type: 'DEFAULT',
      system: false,
      content: 'Test #18',
      author: [User],
      pinned: false,
      tts: false,
      nonce: '929951328031997952',
      embeds: [],
      components: [],
      attachments: Collection(0) [Map] {},
      stickers: Collection(0) [Map] {},
      editedTimestamp: null,
      reactions: [ReactionManager],
      mentions: [MessageMentions],
      webhookId: null,
      groupActivityApplication: null,
      applicationId: null,
      activity: null,
      flags: [MessageFlags],
      reference: null,
      interaction: null
    },
    me: false,
    users: ReactionUserManager { reaction: [Circular *1] },
    _emoji: [Circular *2],
    count: 1
  }
}
{
  Blacklist: [],
  Decisions: '0',
  Logs: '0',
  StarboardChannel: 929940181899956200,
  StarboardCount: 1,
  StarboardEmoji: '⭐️',
  Suggestion: '0',
  Welcome: '0',
  WhitelistRole: [],
  WhitelistChannel: [],
  WhitelistUser: [],
  _id: 61dba0010c3e890848dcd0b0,
  GuildID: '841777101157957642',
  __v: 0
}```
#

I am still not seeing an issue

quartz kindle
#

looks like a surrogate code point

#

let me look it up

astral iris
#

You know what, reaction emojis have fewer properties

#

I forgot about that 🤣

#

Now, time to figure out how to fix that....

quartz kindle
#

your StarboardEmoji has an extra character

#

65039

#

VARIATION SELECTOR-16

#

An invisible codepoint which specifies that the preceding character should be displayed with emoji presentation. Only required if the preceding character defaults to text presentation.

Often used in Emoji ZWJ Sequences, where one or more characters in the sequence have text and emoji presentation, but otherwise default to text (black and white) display.

Examples
Snowman as text: ☃. Snowman as Emoji: ☃️

Black Heart as text: ❤. Black Heart as Emoji: ❤️ (not so black)

#

so you have to edit your Settings.StarboardEmoji to fix that

astral iris
#

Yeah, I see that and fixed it. Thank you!

quartz kindle
#

👍

harsh rock
#

@quartz kindle Can u help. me

quartz kindle
harsh rock
quartz kindle
#

what is it? website broken or something?

#

cant help with that, you have to ask the staff

#

are you trying to add a server to top.gg or what?

harsh rock
slender thistle
#

If you don't know what you need help with, chances are you need prayers too

#

Amen

quartz kindle
#

works fine for me

harsh rock
astral iris
slender thistle
#

Hello I fix problem with computer

#

Ok I'm outta here bye

astral iris
#

Cya o/

quartz kindle
slender thistle
#

Yes

quartz kindle
#

i have a pop up that says i have a virus and said to call you, can you help me fix the problem?

slender thistle
#

Yes please pay 209 dolar and we help

feral aspen
#

When you code and you don't know what you're coding. robo_bruhKitty (dw, I understood it all in the end)

quartz kindle
#

when you forget what you're doing in the middle of doing it

#

when you accidentally write brainfuck

#

when you care too much about performance

quartz kindle
#

because thats not how you use addField

bronze socket
#

okay

bronze socket
#

how toh field name as a hyperlink?.....discord.js

earnest phoenix
earnest phoenix
#

wrong reply but f

slender wagon
#

Question is there a way a website can steal your discord token when u open it or inject scripts

timber fractal
#

so i have this Array, and I want to change that to a different Array with js but i dont know how to do that, can anyone help?

//I have this Array.
[
  j {
    options: [ [I] ],
    name: 'help',
    description: 'Receive an interactive menu with commands, and receive help and more details on specific commands.',
    defaultPermission: undefined
  },
  j {
    options: [ [I], [W] ],
    name: 'joke',
    description: 'Replies with an unfunny joke!',
    defaultPermission: undefined
  },
  { name: 'joke', type: 'USER' },
  j {
    options: [],
    name: 'ping',
    description: 'Pings the bot and API.',
    defaultPermission: undefined
  }
]

//I want an Array like this.

[
  {name: 'help', value: 'help'},
  {name: 'joke', value: 'joke'},
  {name: 'ping', value: 'ping'} //Yes, all the values are the same as the names.
]
pale vessel
#

Use Array.prototype.map()

old cliff
#

what are >> and << binary operators used for?

cinder patio
#

those are bitwise operators

#

left and right shift

uneven tartan
#

would be better for ur use

split hazel
quartz kindle
#

serializing bigints bigger than that is faster by converting to string

#

until then, bitwising chunks of 64bits is faster

#

lmao

quartz kindle
cinder patio
#

not micro-optimizing js 😭

quartz kindle
#

you should see what im doing for converting strings to buffer

#

@_@

earnest phoenix
modest maple
#

People low key making dude seem like some horrible evil human for removing HIS OWN PROJECT

earnest phoenix
#

also he has a controversial history with oss

#

check reddit

modest maple
#

yes

#

how ever, it's his project, he had every right to remove it should he so wish

earnest phoenix
#

i suggest you watch fireship's video on this

modest maple
#

It's his project, he can do as he wishes for it

#

i have

#

and for the same reason, he can do what ever he wants to it

#

he has no responsibility to maintain it

earnest phoenix
#

iirc faker wasn't even made by marak

modest maple
#

Marak was the original creator

earnest phoenix
#

owo tomorrow is aaran swartz's death anniversary

modest maple
#

There is a reason why your License specifically says there is no warrenty or liability to the author for the code you are using.

earnest phoenix
#

did the dpy author delete the entire thing tho

modest maple
#

Im not saying he was right or wrong to do what he did, or some of his other sketchy stuff outside of it. But ultimately he can do as he pleases with his project

modest maple
supple oriole
#
const { client, CommandInteraction, MessageEmbed } = require("discord.js");
const Schema = require("../../Schemas/suggestDB");

module.exports = {
    name: "suggest",
    description: "🚪 | Start's Kumi's Suggesting System.",
    permissions: "MANAGE_GUILD",
    options: [
        {
            name: "message",
            description: "❓ | Select a message to be sent in the Suggestions.",
            type: "STRING",
            required: true
        },
    ],
    /**
     *
     * @param {Client} client
     * @param {CommandInteraction} interaction
     * @param {String[]} args
     */
    run: async (channel, interaction) => {
             const data = Schema.findOne({
            guild: interaction.guild.id
        })
        if (!data){
          return interaction.followUp({ embeds: [errorEmbed] })
        };

          const errorEmbed = new MessageEmbed()
        .setTitle('![no_no_square](https://cdn.discordapp.com/emojis/803560694346809375.webp?size=128 "no_no_square") | Error')
        .setDescription(`Suggestions Channel has not been set for ${interaction.guild.name} yet.`)
        .setColor("F599E9");

       const { options } = interaction
        const lolmessage = options.getString("message");

          const suggestEmbed = new MessageEmbed()
        .setTitle('![no_no_square](https://cdn.discordapp.com/emojis/803560694346809375.webp?size=128 "no_no_square") | Suggestion')
        .setDescription(`${lolmessage}`)
        .setColor("F599E9");
        const sendchannel = data.channel
  sendchannel.send({ embeds: [suggestEmbed] })
    }
 }
#

am pain

earnest phoenix
modest maple
#

Your trade-off by getting everything for free and all this software for free is that the original creator is free to do as they so wish with their software

earnest phoenix
#

why are you even importing Client

supple oriole
earnest phoenix
#

what

supple oriole
#

yea idfk myself tbh.

#

removing it doesnt fix it too sooo

earnest phoenix
#

you need client as the first parameter to the run function

#

then your command handler should do run(client, channel, interaction)

#

wait

#

the params should be like this

supple oriole
#

mine is like that wuuttt

errant flax
#

hey how do i stop a setInterval?

supple oriole
#

also adding client on run fixed it but now I get this

errant flax
#

bot is underined then

#

undefined*

supple oriole
#

eee

wicked pivot
#

no bot = Client

errant flax
earnest phoenix
wicked pivot
#

yeah

earnest phoenix
supple oriole
#

a-

earnest phoenix
#

show your command handler

earnest phoenix
errant flax
earnest phoenix
errant flax
#

thx

wicked pivot
supple oriole
earnest phoenix
supple oriole
#
const { Client } = require('discord.js');
const fs = require('fs');

/**
   *
   * @param {Client} client
   */

module.exports = (client) => {
    try {
        let command = 0;
        const arrayOfSlashCommands = [];
        fs.readdirSync("./slscommands").forEach(cmd => {
            let commands = fs.readdirSync(`./slscommands/${cmd}/`).filter((file) => file.endsWith(".js"));
            for (cmds of commands) {
                let pull = require(`../slscommands/${cmd}/${cmds}`);
                if (pull.name) {
                    client.slashCommands.set(pull.name, pull);
                    arrayOfSlashCommands.push(pull)
                    command++
                } else {
                    console.log(`${cmds} Command is not Ready`);
                    continue;
                }
                if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));

            }
            client.on("ready", async () => {
                client.guilds.cache.forEach(async (g) => {
                    await client.guilds.cache.get(g.id).commands.set(arrayOfSlashCommands);
                });


            });

        })
        console.log(`${command} | Slash Commands Loaded!`);
    } catch(e) {
      console.log(e)
    }
}
errant flax
#

itll just run and return etc

wicked pivot
#

""

supple oriole
#

i fr think it's my params

#

lol

earnest phoenix
#

@modest maple that last part is what im trying to say

earnest phoenix
supple oriole
#
const { MessageEmbed } = require("discord.js");
const client = require("..");
var config = require("../settings/config.json");
var ee = require("../settings/embed.json");

client.on('interactionCreate', async interaction => {
    // Slash Command Handling
    if (interaction.isCommand()) {
        await interaction.deferReply({ ephemeral: false }).catch(() => { });

        const cmd = client.slashCommands.get(interaction.commandName);
        if (!cmd)
            return interaction.followUp({ content: "An error has occured " });

        const args = [];

        for (let option of interaction.options.data) {
            if (option.type === "SUB_COMMAND") {
                if (option.name) args.push(option.name);
                option.options?.forEach((x) => {
                    if (x.value) args.push(x.value);
                });
            } else if (option.value) args.push(option.value);
        }
        interaction.member = interaction.guild.members.cache.get(interaction.user.id);

        if (cmd) {
            // checking user perms
            if (!interaction.member.permissions.has(cmd.permissions || [])) {
                return interaction.followUp({
                    embeds: [
                          new MessageEmbed()
                            .setTitle(':no_no_square: | Invalid Permissions')
                            .setColor(ee.embed_color)
                            .setDescription(`You need the ${cmd.permissions} to use this command.`)
                            .setTimestamp()
                    ]
                })
            }
            cmd.run(client, interaction, args);

        }
    }

    // Context Menu Handling
    if (interaction.isContextMenu()) {
        await interaction.deferReply({ ephemeral: false });
        const command = client.slashCommands.get(interaction.commandName);
        if (command) command.run(client, interaction);
    }
})
earnest phoenix
earnest phoenix
supple oriole
#

like replace the old params

earnest phoenix
supple oriole
#

i did and boom the command doesnt show up when I do /

supple oriole
#

ok now it showed up

#

but the error reappeared. ".send" error thing

earnest phoenix
#

skill issue

earnest phoenix
#

just another day in nyc

split hazel
#

he aint doing himself good

#

i wouldnt want to hire him in a position where he handles code because if he has history of having tantrums and deleting/corrupting code over it why wont he do it again

earnest phoenix
#

hire tim instead

split hazel
#

he'd be the first person

#

that guy is hard as a rock

earnest phoenix
#

the rock agrees

#

what about hiring me blush_hands

split hazel
#

dont know about you bro

#

i think this sealed your fate

earnest phoenix
#

i think downloading discord sealed my fate

#

or learning javascript

#

or using discord.js

split hazel
#

i hate json in c#

earnest phoenix
#

json isn't great for anything other than JavaScript, JavaScript and most importantly JavaScript

split hazel
#

setting should be as simple as setting the property and then serializing it again

earnest phoenix
#

what about xml

split hazel
#

one sec

supple oriole
#

i fixed it

#

im too good

split hazel
#
var weatherForecast = new WeatherForecast
            {
                Date = DateTime.Parse("2019-08-01"),
                TemperatureCelsius = 25,
                Summary = "Hot"
            };

            string jsonString = JsonSerializer.Serialize(weatherForecast);
earnest phoenix
#

does erlpack work for .net

split hazel
#

so before that you could do weatherForecast['Date'] = xyz i believe

earnest phoenix
split hazel
#

this is all with built in serializers

earnest phoenix
split hazel
#

it infers the type without having to type a long ass name each time

#

so then deserialize it

#

ah you mean a nested object

#

i did that before i dont remember how i solved it

earnest phoenix
#

let's ping tim

#

human stackoverflow

sage bobcat
earnest phoenix
split hazel
#

i think you need to make a separate class

sage bobcat
#

One message removed from a suspended account.

split hazel
#

and then deserialize it

#

the element

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
cinder patio
sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

It’s just the format

#

JSON isn’t specific to js and it’s still a very popular method of representing data in many languages

modest maple
#

there are technically better formats for transfer out there

#

but JSON became the main because Web

split hazel
#

i think when you access the element jsondata.d you can deserialize that specific thing

modest maple
#

and also at the time the only other alternative was SOAP

#

and no one likes SOAP

wheat mesa
#

What about xml

modest maple
#

that is SOAP

earnest phoenix
wheat mesa
#

Oh

split hazel
#

since its only shallowly deserialized and you need to do so manually with nested objects

#

god i hate spelling the word deserialized

earnest phoenix
wheat mesa
#

XML seems great until you have a lot of data and then it’s annoying to look at

modest maple
#

it has its uses still

split hazel
#

xml looks cool

earnest phoenix
split hazel
#

its like html but used to store data

modest maple
#

literally HTML and every modern JS framework for the frontend ever depends on it

wheat mesa
#

Meh I don’t think so

modest maple
#

but err, as a transfer format? No not really, which is why it didnt take much for JSON to become the favourite with REST

#

parsing is less annoying, easier to read on big sets, systems are hyper optimised for it now

earnest phoenix
split hazel
#

literally like that

#

jsondata.d

#

i'll show you a demo

modest maple
#

the upside is XML parsers generally dont need to read all the data into memory and parse all at once to ensure the format is valid. VS JSON that requires the whole thing to be together for better or for worse

earnest phoenix
modest maple
#

because the parse state machine requires that you have a matching container closing off each opening

earnest phoenix
modest maple
#

i.e {"foo": {"bar": 123} isn't valid but {"foo": {"bar": 123}} is

#

the same rules of XML apply to HTML

split hazel
#
var hbObject = JsonSerializer.Deserialize<HelloResponse>(jsonString);
var dataObject = JsonSerializer.Deserialize<HelloResponseData>(hbObject.d);

dataObject.heartbeat_interval // -> 41250
modest maple
#

and yes, the format does technically require it, however, like HTML the parsers are forgiving and the DOM walkers are even more so

split hazel
#

you do need to adjust your original object though

earnest phoenix
modest maple
#

is this C#?

split hazel
#

context

modest maple
#

oofies C# moment

earnest phoenix
#

skill issue

split hazel
#

what

#

no you just need to adjust the template

earnest phoenix
#

also doesn't your lib do the gateway stuff for you

split hazel
#
public class HelloResponse
{
  public string t { get; set; }
  public string s { get; set; }
  public int op { get; set; }
}
#

i think you just need to add a string parameter for d

#

what happens when you try read it

#

if that doesnt work then nesting objects will work

#

create another object for the data and make another parameter

#

i'll show you

#
public class HelloResponseData
{
  public int heartbeat_interval { get; set; }
  // not sure about the array but I assume you can just create an array type
}

public class HelloResponse
{
  public string t { get; set; }
  public string s { get; set; }
  public int op { get; set; }
  
  // add the object
  public HelloResponseData d { get; set; }
}
#

like this

#

and then it should not error anymore

earnest phoenix
#

css question:
if i have html like this:

<!-- vercel's work of art. love next/image -->
<div style="display:inline-block;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;margin:0"><div style="box-sizing:border-box;display:block;max-width:100%"><img style="max-width:100%;display:block;margin:0;border:none;padding:0" alt="" aria-hidden="true" src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4="></div><img alt="Profile picture" src="a really long list of urls" decoding="async" data-nimg="intrinsic" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" class="is-rounded mb-4" loading="lazy"/></noscript></div>

and i want to style the img tag with css to change its width and height
can css overwrite style attributes

split hazel
#

the only thing i struggle with is css

#

just not built for web development

earnest phoenix
split hazel
#

bet @quartz kindle is an expert tho

earnest phoenix
#

tim is an expert at anything

split hazel
#

oh wait what do you mean by overwrite style attributes

#

nice

earnest phoenix
#

because 256px is too large for mobile

#

so i used a media query to overwrite the size on big screens

split hazel
#

css overwrites elements based on order if thats what you're looking for

earnest phoenix
#

wtf it already works

#

i hadn't refreshed the page

#

thanks anyways

split hazel
#

hot reload moment

earnest phoenix
#

hot stuff

split hazel
#

do you really have to do this

#

like receive it

#

going down to low level the size of the buffer should already be known upon being received

#

its sent with the data itself

#

doesnt the library automatically create the buffer for you

#

what library do you use

#

for websockets

earnest phoenix
split hazel
#

so built in

#

never used it before

earnest phoenix
#

why does c# have such long names

#

i thought System.out.print was too long for java

split hazel
#

that looks disgusting to use

earnest phoenix
#

but JsonSerializer.Serialize<Template>(); boohoo

#

indeed

split hazel
#

from what i can infer from examples it seems the general practise seems to be just "allocate a big enough buffer to store anything thats going to come"

earnest phoenix
#

why is your workspace named Project Discord thingie lmao

split hazel
#

bad practise ngl there must be a better way

#

i see

#

it gets a bit complicated

#

the buffer gets sent in chunks

#

you have to figure out yourself when it ends

#

lots of bad examples just all in general use a big buffer to store everything

earnest phoenix
#

chonky buffer

quartz kindle
#

@carmine topaz are you trying to make your own websockets?

earnest phoenix
#

yo tim

#

how do i change the border around the element when you use tab to focus it

#

because bulma's default borders are... horrible

split hazel
quartz kindle
#
element:hover {
  border: xyz;
}```
earnest phoenix
#

focus through tab

quartz kindle
#

i saw a few stackoverflow answers for that

earnest phoenix
#

what.

quartz kindle
#

afaik you're supposed to use .endOfMessage to check

#

yes, discord messages are never fragmented, not via the websocket protocol

#

at least i've never seen a fragmented one

earnest phoenix
#

ty tim

pulsar bone
#

Can someone tell me how make bot check it's own permission

uneven tartan
#

.me

#

how do i modify this so that it includes message deletion?

await interaction.guild.members.ban(user.id)```
wheat mesa
uneven tartan
earnest phoenix
wheat mesa
#

(user.id, {object of ban options})

uneven tartan
#

oh okay ty

#
await interaction.guild.members.ban(user.id, {7})```
#

@wheat mesa

#

oops that isnt right

#

days: 7

wheat mesa
#

Yes the second one

uneven tartan
#
                await interaction.guild.members.ban(user.id, {
                    days: 7
                })```
#

pogy

warm merlin
#

Someone wants my discord bot token

#

To help run my bot

#

Cause I’m clueless

warm merlin
wheat mesa
#

What

harsh nova
#

you can do any action the bot can with a bot token

wheat mesa
#

Don’t give your bot token to people you don’t trust

harsh nova
#

never give that to someone you dont 110% trust

wheat mesa
#

Or even people you trust tbh

#

The only person that should know your bot token is you

#

It’s supposed to be kept secret

warm merlin
#

I have the bot on a test server

#

So what could they do really

harsh nova
#

no they cannot get your discord account through a bot token but if they break any serious guidelines with your bot it might end with your account getting suspended

warm merlin
#

Could I get my account back

#

If they do some HOW

wheat mesa
#

They can’t get your account with your bot token

#

That’s not how it works

warm merlin
#

ok

harsh nova
#

once again you seem to not trust this person. I would not give them your token if i were you

wheat mesa
#

^^

#

If you’re even questioning it then the answer is no

split hazel
#

but be warned discord support is not known to be very fair

compact pier
simple stump
#

I'm trying to set the name of a channel by fetching it, but for some reason it doesn't change the name.

let queueChannel = newState.member.guild.channels.fetch(mainChannel).then((qChannel) => {
                  let cName = qChannel.name;
                let nameSplit = cName.split("/");
                let channelThing = nameSplit[0];
                let channelSplit = channelThing.split("[");
                let numPlayers = parseInt(channelSplit[1]);
                let addPlayers = numPlayers += 1;
                qChannel.setName("Queue [" + addPlayers + "/2]");
}).catch(() => null);

I logged addPlayers, numPlayers, and qChannel. They all return the correct value, however setting the name doesn't seem to do anything.

compact pier
#

try to console log numPlayer @simple stump

simple stump
#

addPlayer returns 1

compact pier
#

set .catch() to .catch(e => console.log(e))

#

and run again, maybe it says something

simple stump
#

aight

simple stump
#

when checking the log for qChannel, the name returns "Queue [0/2]" so ik that im getting the right channel

compact pier
#

try to do

simple stump
#

however, i waited a bit, restarted the bot, and the name changed to Queue [-1/2]

compact pier
#

const qChannel = message.guild.channels.cache.get("ID")

simple stump
#

aight

#

yea i was gonna say that haha

#

thx ill try that 👍

compact pier
#

:))

simple stump
#

Unfortunately it doesn't change the channel name

#

idk if discord just takes a while or smth

#

after a bit it changes the name

#

but it takes a while

#

which is annoying

compact pier
#

how do you call the function ? @simple stump

simple stump
#

on voiceStateUpdate

#

for adding an user (aka Queue [1/2]) its called within a SQL statement

#

but all the code works fine

#

just that setting the channel name takes ages

#

but i doubt its a rate limit thing

#

ive set the names of text channels in other parts of my code and it works fine

#

just that this for some reason takes forever

compact pier
#
const qChannel = member.voice.channel;
const number = qChannel.name.split(" ")[1].split("/")[0][1];
const newNum = parseInt(number) + 1;
qChannel.setName(newNum);

@simple stump

#

maybe this one will work :))

simple stump
#

👍

simple stump
#
                const number = qChannel.name.split(" ")[1].split("/")[0][1];
                console.log(number);
                const newNum = parseInt(number) + 1;
                console.log(newNum);
                qChannel.setName("Queue [" + newNum + "/2]");
compact pier
#

what does it show?

simple stump
#

number returns 0, newNum returns 1

#

doesnt change the name tho

compact pier
#

does your bot have permission to manage channels?

simple stump
#

yes

#

it has all permissions

#

and if it didnt i think it would say, "invalid permissions"

compact pier
#

hmmm

#

I have no clue then

#

if the name doesn't change

simple stump
#

ah. all g

quartz kindle
#

when was the last time you changed the name?

simple stump
#

theres a point where the bot changes the name but it usually takes 10 seconds to 5 mins

#

ish

#
qChannel.setName("Queue [" + newNum + "/2]").then((newChannel) => console.log(`The channel's new name is ${newChannel.name}`)).catch(console.error);
                

I also added a .then statement, which just triggered about 2 minutes after i joined the vc

quartz kindle
quartz kindle
#

if you already changed it twice in the last 10 minutes, then thats why you're not seeing any more changes

simple stump
quartz kindle
#

all channels

simple stump
#

interesting

#

this didnt seem to apply for newly created channels

#

i was able to set their name without problem

#

well ty this is helpful

quartz kindle
#

the limit is per channel

simple stump
#

is there a rate limit for editing emssages to?

simple stump
#

ty

quartz kindle
#

the limit for editing messages is the same limit for sending messages

#

5 per 5 per channel

boreal iron
#

Hello! Tims saving the world again? zoomeyes

quartz kindle
#

if you send 3 messages, you can only edit 2 times in the same 5 seconds

simple stump
#

aight. tysm this was helpful

quartz kindle
boreal iron
#

Unfortunately the whole day, night and tomorrow morning

#

Eww

#

Some days suck

#

That’s the price of not saying no.

split hazel
#

lmao

#

anyone know how to add something to path on boot in linux/arch/manjaro ?

#

i'm trying to add my cross compiler to path but i constantly have to do it manually via export PATH="$HOME/opt/cross/bin:$PATH" because idk how

quartz kindle
#

we all have our jobs, you drive and i save the world

#

:^)

boreal iron
boreal iron
#

That’s what I’m trying to do when I’m driving

#

At least trying

split hazel
quartz kindle
#

on debian i added it to .bash_profile

split hazel
#

i'll give that a shot

#

oh i already tried it

#

did i do it correctly

boreal iron
#

Is there anything planned to interact with a button or generally component you can collect as text input after April?
Without mentioning the bot or using slash commands

quartz kindle
split hazel
#

could the fact im using zsh cause problems?

quartz kindle
#

zsh possibly uses a different config file

split hazel
#

i'll have a look around

quartz kindle
split hazel
#

woa

#

that looks promising

#

thanks

#

it works

#

big thanks

quartz kindle
#

bash will either use .bash_profile for login shells, or .bashrc for interactive shells. That means, when you want to centralize configuration for all use cases, you need to source your .bashrc from .bash_profile or vice versa.

zsh behaves differently. zsh will run all of these files in the appropriate context (login shell, interactive shell) when they exist.

zsh will start with /etc/zshenv, then the user’s .zshenv. The zshenv files are always used when they exist, even for scripts with the #!/bin/zsh shebang. Since changes applied in the zshenv will affect zsh behavior in all contexts, you should you should be very cautious about changes applied here.

Next, when the shell is a login shell, zsh will run /etc/zprofile and .zprofile. Then for interactive shells (and login shells) /etc/zshrc and .zshrc. Then, again, for login shells /etc/zlogin and .zlogin. Why are there two files for login shells? The zprofile exists as an analog for bash’s and sh’s profile files, and zlogin as an analog for ksh login files.

split hazel
#

nice

#

also do you happen to know what SSE does

#

the instruction set

quartz kindle
#

just the stuff from wikipedia lol

#

SSE contains 70 new instructions, most of which work on single precision floating-point data. SIMD instructions can greatly increase performance when exactly the same operations are to be performed on multiple data objects. Typical applications are digital signal processing and graphics processing.

split hazel
#

so if i dont use floats

#

its kinda pointless

#

got it

simple stump
#

How can I check if the oldState of the user was a specific channel?

quartz kindle
#

SSE used only a single data type for XMM registers:
four 32-bit single-precision floating-point numbers

SSE2 would later expand the usage of the XMM registers to include:
two 64-bit double-precision floating-point numbers or
two 64-bit integers or
four 32-bit integers or
eight 16-bit short integers or
sixteen 8-bit bytes or characters.

boreal iron
#

My gosh

#

Tim quoting the ‘net again

quartz kindle
#

always :^)

azure lark
#

how do i encode something with Base64.strict_encode with javascript

hexed garnet
#

Can someone give me a documentation of discord.py shards

compact pier
split hazel
#

when i made a typo in "speedy" i forgot i didnt add a backspace option

#

tricky to add one considering each character can have a different width

#

so i'd have to keep track of characters on screen and their widths

swift cradle
dense finch
#

why cant i add my bot to my server ? it says i cant. Im new to making bots so i dont really understand yet.

sudden geyser
#

How did you try adding it?

dense finch
#

im new to making bots so idk how else to add it to my server

sudden geyser
#

Yes, but what invite link specifically

#

You'd create an invite link through the developer portal for your new bot

hexed garnet
sudden geyser
#

Like this?

hexed garnet
#

I think

sudden geyser
#

With your invite link being below

compact pier
#

it is bad to grant admin perms

#

just use those perms that u need

sudden geyser
#

It's bad practice, but, for the most part, it's fine.

#

especially for demonstration purposes

boreal iron
#

_god thanks I’m not into OS development _

uneven tartan
opaque acorn
#

hello xd

#

how can i update npm and node on replit?

spark flint
#

nope

#

replit set their node version

pearl trail
#

npm i node@16
npx node index
VeryCool

spark flint
#

you can't change it

uneven tartan
#

actually

#

you can

spark flint
#

since when

pearl trail
#

^

spark flint
#

i've tried before

pearl trail
#

i tried it

spark flint
#

i got errors

quartz kindle
#

there are many ways to do it

uneven tartan
#

you need to start the bot in a nix environment, then set the node requirement

#

also yes there are other ways

#

thats probs easiest

opaque acorn
quartz kindle
#

sort of

opaque acorn
# pearl trail `npm i node@16` `npx node index` <:VeryCool:585580174750253057>

> node@16.13.1 preinstall /home/runner/railban-bot/node_modules/node
> node installArchSpecificPackage


added 2 packages, and audited 3 packages in 4s

found 0 vulnerabilities
+ node@16.13.1
updated 1 package and audited 648 packages in 10.517s

54 packages are looking for funding
  run `npm fund` for details

found 8 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
~/railban-bot$ node -v
v12.22.6```
pearl trail
#

not node -v

#

npx node -v

opaque acorn
uneven tartan
#

two completely different things

#

kek

pearl trail
#

basically we make node as a npm module

opaque acorn
#

ok

#

thx

split hazel
boreal iron
#

Make sure your OS supports PHP

sudden geyser
#

1984

boreal iron
#

Shhh

#

You just don’t know what’s good and what’s not

spark flint
#

don't shame me

#
app.get('/:id', async (req, res) => {
    try {
        await bot.users.fetch(req.params.id).then(async user => {
            if (req.query.size) {
                if (req.query.size == "1") {
                    const size = "256" 
                } 
                
                else if (req.query.size == "2") {
                    const size = "512" 
                } 
                
                else if (req.query.size == "3") {
                    const size = "1024" 
                } 
                
                else if (req.query.size == "4") {
                    const size = "2048" 
                } 
                
                else {
                    const size = "512"
                }
                
            }
            
            else {
                const size = "512"
            }
            
            await fetch(`${user.avatarURL()}?size=${size}`).then(res => res.buffer()).then(buffer => {
                res.type('png');
                res.send(buffer)
        })
    })
    }
    catch (err) {
        res.send(`An error occured: ${err}`)
    }
});```
#

i feel really stupid

quartz kindle
#

huehuehue

#

laughs at stupid

spark flint
quartz kindle
spark flint
#

ah

#

as a pro js user, i knew that

quartz kindle
#

you probably want this:

let size;
if(...) {
  size = 512;
}
#

or

#

use var

#

:^)

spark flint
#

i used var

uneven tartan
#

pls dont use var

#

😭

spark flint
#

lol

woeful pike
mortal snow
#

Hey guys I am having a full rewrite done in a few months and I need people to DM me commands they usually use on a bot as I want to make sure it has everything,

Music is against discords TOS so I will not be adding it.

sudden geyser
#

I'd advise against blindly accepting user feedback for commands.

#

Although you'll receive more ideas for commands, there's a good likelihood those commands will not be very relevant to your bot or what it should have.

#

And the feedback you'd be getting here is from users who haven't used your bot.

#

Rather, I'd suggest looking at commands from other bots and cherrypicking the commands that matter to your bot.

#

Or taking the time to brainstorm what you want out of your commands.

#

If you'd like one regardless, how about a scheduler?

#

I may set a time for an event to occur (e.g. a week from now dress up sharp) or have a periodic event (e.g. criticize top.gg's new logo every monday)

quartz kindle
#

i wanted to make a bot that shows realtime earthquake info but i never got to do it

#

so feel free to use that idea

mortal snow
#

Might have that underneath the info category because the full rewrite is for a multi-purpose bot so most things would relevant to it but yeah

sudden geyser
#

Even multipurpose bots have their limits

#

Generate a random number between 1 and 10? Google. Generate 5 numbers between 1 and 10? A command.

mortal snow
#

Well the idea with the bot is to be an all in 1 making it be the only bot a server would require for verifying, Reaction roles, Embed makers, Moderation, Anime, Fun, Misc, Info- and the list continues

sudden geyser
#

Those usually don't work in practice

#

But you're free to do what you want with your bot.

mortal snow
#

I’d like to give it a solid try considering it will be re-written from scratch fully interactive commands and each feature treated as its only feature

wheat mesa
#

A lot of features can be a good thing but too many features is a bad thing. There’s a ton of multipurpose bots out there and there’s no real demand for more, so more focused bots tend to perform better since they have one general concept in mind instead of lots of feature sets

#

But it’s all up to you and how you think your bot would perform

mortal snow
#

I’m aiming for roughly 200-250 commands so I don’t know if that’s too much or not

wheat mesa
#

That’s... a lot

spark flint
#

That’s too many lol

solemn latch
#

Slash commands only allow 100 correct?

spark flint
#

IIRC yeah

#

100 limit

#

And 200-250 commands is just extremely unnecessary

#

Id rather go with a bot that is good in a certain field rather than another multi purpose one with mediocre commands

dry imp
spark flint
#

Backblaze just refuses to upload randomly every 24 hours so I have to ssh in and restart it, is there an easier way to do this?

#

I’m using PM2

#

It’s an Express.js server, which gets the file from the post request and uploads it to Backblaze

sudden geyser
#

I've seen bots with like 600-700 commands

#

The dev was aiming for 1000 but quit the project

spark flint
#

Christ

#

Too many

quartz kindle
#

rip c# dead language

sudden geyser
#

always bet on javascript

boreal iron
sudden geyser
#

php devs can't keep up