#development
1 messages · Page 1957 of 1
I'll log message and check
I exported client even when i'm not using it and works
I don't know what client's relevance to your issue is.
and now.. args[0].some is not a function
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.
ok
yeah I did it wrong
My bot is not responding but the repl is on whats the issue ?
you using replit?
do you see any errors in the concle?
no
try running a command see if an error apears
sometimes It responds after 10-20 minutes later
what kind of bot is it?
Music and moderation
could you invite me i could look into it if you want
So it went back in time
how to link vote weebhooks??
https://stackoverflow.com/questions/70643407/next-js-styled-components-weird-behaviour Could someone help me with this?
Lib page has many examples regarding it
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
That looks kinda like a base64 string
i have no idea what i can do
What is items[0] and what are you trying to accomplish from this
and I noticed this; When I use the function, the value it returns returns before the value it logs while the function is running.
Oh wait the output isn’t the problem is it
Are you just not getting the right return value?
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
yes i deleted "await"
I don’t really know what the problem is because I’ve only seen 3 lines of code
line 34 output: UCzqMhk6yyb74PbpnvZ2gLgw
line 39 output: undefined
videoer is undefined?
videoer = url
if videoer was undefined I wouldn't be able to output UCzqMhk6yyb74PbpnvZ2gLgw either
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 
the structure is fine, the problem is not understanding how async and promises work
Promise { <pending> } :)
Await your function call too
what did you do? show code
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
my main goal is to make a notification system for certain youtube channels
youtube video notifications
user can save same channel in 2 ways;
https://www.youtube.com/channel/channelid
or
https://www.youtube.com/c/channelname
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?
thats not returning anything
Not the function body itself
getYoutubeChannelId has no return
that return is inside the .then() its a separate function
to be more specific, you need to return the fetch, and you need to await getYoutubeChannelId
function getYoutubeChannelId() {
return fetch(...)...
}
console.log(await getYouTubeChannelId(...))
(Also would highly recommend using async/await instead of chaining .then callbacks)
Up to you to decide your design though
https://capy-cdn.xyz/iPS2vqH1.png just noticed that chrome now shows this, even if the site is not currently blacklisted
let fetc = await fetch({})
let json = fetc.json()
```like this?
Yes
Is there a performance difference?
Not that I know of, but it’s way more organized
you have to await json() too
thanks
🧡
ops on json web tokens?
don't use them for sessions
they're nice for one-time use operations
what do you want to use them for
I'm not planning to use them just gathering opinions
like for example using them instead of cookies
I wouldn't
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
i dont understand them that well tbh
they feel like overcomplicating something simple
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
yep
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
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
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
why is it always undefined? replit
with and without dotenv.config() its undefined
you dont need dotenv.config, or the module at all. its just process.env['key']
Uncaught SyntaxError: Unexpected token 'else'
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
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
you got any message from Discord in your email?
Nope
Not even any ticket opened
Ticket is only opened on their reply
Yes, they didn't replied
any fix? users are reporting this "bug" and I don't know how to fix it lol
the code for it is above of the image
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?
because eval is still a promise, it's just been fulfilled
to get the actual value you use await
lol yeah I’m stupid, of course you’re right
ty
yaay ping

hey in d.py how would i check the time a user joined and check if it's under 5 minutes
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.
probably a date instance
Yeah we have a datetime (https://discordpy.readthedocs.io/en/stable/api.html?highlight=joined#discord.Member.joined_at)
and then it's just playing around with time (https://stackoverflow.com/a/8142411/14695788) @eternal osprey
Thank klay cutie 🙂
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
sounds like you want an animation
You would need to animate each style setting you change
Not really an issue for backgrounds, but lots of work
These are the datetime.now() and user joindate: 2022-01-07T11:25:16.854000+00:00
2022-01-10 00:14:46.562061
How can i ever subtract them from each other
how 
You could use subtraction and timedelta: https://stackoverflow.com/a/4541668/14695788
then you just compare it with < or >
Or simply creating a timestamp of your time string
ah so basically: py var1 = datetime.now - datetime.timedelta(joinedatvar) if var1 < 5: print("yes")
nope
dang
How wouldn't that be correct
because timedelta substracts
wait, can't we just if datetime.timedelta(joinedatvar) < 5
Not by hand lol… not sure if there’s yet a CSS3 key frame based animation to fade backgrounds but a JS framework should cover things like that
As it takes the current and subscrtracts it by using timedelta directly
Fading backgrounds is just ew tbh
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
Yeah, couldn't we get the join date and minus it on our current time and calculate if it's less than 5 minutes
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
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
Not exactly
how can i put the button on the bot of add to the server?
In the discord dev portal
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
datetime.datetime … my gosh
What that does is create a datetime set to 5 minutes
where
Then you'll minus that to get your datetime 5 minutes in the past
And compare it like you would.
@eternal osprey I'd suggest you read up on dates and times since they're useful: https://realpython.com/python-datetime/
it worked
python imports are messy
why is it so hard to subtract time in python 👀
it's not
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>
Left menu > OAUTH > In App auth
in fact I'd argue it's more flexible than a lot of langs
ok thx
but they're hard for new users to understand
Well I mean you could create two timestamp if mktime or strtotime exists or something similar
I like Java and Swift's way of handling dates and time
not that java.util.Date clusterfuck, but the java.time module
Well it’s up to you, I don’t like background fading 
isn't the use of vendor prefixes bad practice
dose anyone know how to use the github api to create a file on a github repo
I would be surprised if github allowed that on their api, would require the api to be able to push commits.
maybe its possible? can take a look in a second
they do allow it, there is this on their api:
owner: 'octocat',
repo: 'hello-world',
path: 'path',
message: 'message',
content: 'content'
})```
but if i add text into the content it gets changed into LD� or something like that.
for just testing you can just use an online encoder
https://www.base64encode.org/
do i just replace it with the encoded thing, like; content: 'dGVzdA=='
yeah
it's probably expecting something else
maybe buffer?
I doubt they'd allow a very specific text file with content
found this from november and i feel like the dev community needs to feel the pain
yeah but does the interpreter work on any platform
so that was the person
by that I mean the binary running on every os
I think not
so be quiet before I interpret your mother
I know what you mean wtf 
will you just ignore my violation to you
yeah but what if you're on a limited data plan in zimbabwe
I usually only read 50% of what people write

anyone can help?
idk
is that fucking brainfuck lang
lmao
is your bot just reading random memory
and printing it to the screen
I have lots of experience with that sadly
what can i do
what are you logging?
Somehow looks like some injected code fucking you up
anything
that is not helpful
listen
anything sums it up quite well
I wouldn't expect a node program to do something like this
open the project
open the terminal
put npm update
then node .
show your package.json
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?
> npx tsc
error TS2304: Cannot find name 'this'.
``` 
{
"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"
}```
why do u use discord-buttons when djs already supports buttons(in v13)
i dont use djs 13

why not?
i dont have time to learn it
djs v12 will get deprecated
ik
rip for ur bot when message intent is out 

why eris is installed
lol
lemme see 


be careful with that discord-nsfw package. it breaks discord tos iirc
@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)```
My gosh… that’s the result relying on thousands of dependencies 
uninstall more
wait how (i dont use the package)
module.exports = () => {
return "testing"
}
module.exports.test = () => {
}
i want to access the module.exports function inside module.exports.test how do i do that?
that's the least of his worries right now
adds sussy commands to bots
why do all devs add 100 dependencies to their project when first starting out
when I was new I actually wanted to
helpp
theres only hundreds of nsfw api's 👀

I think it's simple as module.exports
but I'm not sure how javascript reacts with imports like that
you have all the sites in the world and you choose discord for porn
would it overwrite the default function no idea
soo
module.exports.test = () => {
return module.expoets()
}
you can give it a try
basically yes, but that code is weird af
what are you trying to do?
> npx tsc
error TS2304: Cannot find name 'this'.
``` why
who knows

First thing I read when searching that package is a bit fat DEPRECATED text
ohh
typeof this['resolved'];
We discussed it but got to a mutual "fuck it"
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 });
what is interaction?
~/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'
]
}
that file was not found
where do you have this code? require('./commands/moderation/addrole.js')
in command_handler.js?
try logging their lengths
or if you wanna dig deeper, log their buffer representations
console.log(Buffer.from(Reaction.emoji.name), Buffer.from(Settings.StarboardEmoji))
<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
The weird thing is tho when I log the name it provides a name
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
the lengths?
Yeah
That gave me this error
weird
Yeah, I am completely lost here
its saying its undefined
wait
what if
you're in a guild that has a custom star emoji
what is this??
that looks exactly the same
Nope, there isn't one
welp, was worth a shot
an error
ohk are u coding that BOt??
nah im just helping
I am yes, and everything else is working so far but the damn starboard is having issues
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
on what ?? are u coding it?
I am reacting with the right reaction
VSC using JS
WDYM by this? Everything before the emoji call works
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
console.log(Reaction.emoji, Settings)
I did it personally just to get me a replacement replacement but there isn't anyone I could remember when we talked about it
<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
i copy pasted both stars from the logs above, and they are indeed different
looks like a surrogate code point
let me look it up
You know what, reaction emojis have fewer properties
I forgot about that 🤣
Now, time to figure out how to fix that....
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
Yeah, I see that and fixed it. Thank you!
👍
@quartz kindle Can u help. me
with what?
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?
yeah
idk
If you don't know what you need help with, chances are you need prayers too
Amen
idk some problem with my web i guess!
Cya o/
hello are you mister john smith certified microsoft windows technician?
Yes
i have a pop up that says i have a virus and said to call you, can you help me fix the problem?
Yes please pay 209 dolar and we help
When you code and you don't know what you're coding.
(dw, I understood it all in the end)
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
why its undefine?
okay
how toh field name as a hyperlink?.....discord.js
Mmm, seems legit
When you accidentally create a session on top of a session, so now it doesn't know which session to actually use.
wrong reply but f

Question is there a way a website can steal your discord token when u open it or inject scripts
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.
]
what are >> and << binary operators used for?
.setDescription instead of .addField
would be better for ur use
tim you lost control
its to improve the performance of an extrenely edge case that will likely never happen
serializing bigints bigger than that is faster by converting to string
until then, bitwising chunks of 64bits is faster
lmao
dont worry i found it, it was on my keyboard all along
not micro-optimizing js 😭
too late
you should see what im doing for converting strings to buffer
@_@
@split hazel now colors.js is broken 
what is wrong with marak
People low key making dude seem like some horrible evil human for removing HIS OWN PROJECT
he begs for github sponsors and claims big companies use his stuff without paying
literally change the fucking license like elasticsearch did
also he has a controversial history with oss
check reddit
i suggest you watch fireship's video on this
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
this malware is my code, i can do what i want
iirc faker wasn't even made by marak
Marak was the original creator
owo tomorrow is aaran swartz's death anniversary
There is a reason why your License specifically says there is no warrenty or liability to the author for the code you are using.
did the dpy author delete the entire thing tho
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
again, he holds no liability if he chooses not to
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(' | 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(' | Suggestion')
.setDescription(`${lolmessage}`)
.setColor("F599E9");
const sendchannel = data.channel
sendchannel.send({ embeds: [suggestEmbed] })
}
}
am pain
const { client }
Client should be capitalized
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
why are you even importing Client
I thought doing so would fix the send error

what
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
mine is like that wuuttt
hey how do i stop a setInterval?
eee
no bot = Client

you mean bot = new Client();
yeah
you messed up your command parameters
a-
show your command handler
pple

const interval = setInterval
clearInterval(interval); // stops the interval
thx
var interavalActif = true
setInterval(function(){
if(interavalActif == false)return
//code
}, 1)
interavalActif = false```
as in my slash handler or my interaction create
what
slash handler
dont thing thatll work
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)
}
}

itll just run and return etc
""
@modest maple that last part is what im trying to say
show interaction create stuff instead
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);
}
})
it would work but the interval would keep running and not doing anything resulting in performance issues
||my god discord.js users have to do all this manually|| ||thank god i use detritus||
cmd.run(client, interaction, args); change your command params to run = async (client, interaction, args) => {}
run = async (client, interaction, args) => {} in the command?
like replace the old params
lmfao
yes
skill issue
this guy lost control as well
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
hire tim instead
i think downloading discord sealed my fate
or learning javascript
or using discord.js
i hate json in c#
json isn't great for anything other than JavaScript, JavaScript and most importantly JavaScript
setting should be as simple as setting the property and then serializing it again
what about xml
one sec
var weatherForecast = new WeatherForecast
{
Date = DateTime.Parse("2019-08-01"),
TemperatureCelsius = 25,
Summary = "Hot"
};
string jsonString = JsonSerializer.Serialize(weatherForecast);
does erlpack work for .net
so before that you could do weatherForecast['Date'] = xyz i believe
yo there's a var keyword in c#
this is all with built in serializers
or use dot notation
this aint javascript my man
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
One message removed from a suspended account.
isn't json bad for anything other than js
i think you need to make a separate class
One message removed from a suspended account.
One message removed from a suspended account.
that can be said for anything once you google it
why it'd be bad? It's just a format. Only thing that ties it to JS is the syntax
One message removed from a suspended account.
One message removed from a suspended account.
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
there are technically better formats for transfer out there
but JSON became the main because Web
i think when you access the element jsondata.d you can deserialize that specific thing
What about xml
that is SOAP
i like soap. yum
Oh
since its only shallowly deserialized and you need to do so manually with nested objects
god i hate spelling the word deserialized
say parse instead 
XML seems great until you have a lot of data and then it’s annoying to look at
it has its uses still
xml looks cool
xml is easier to read than json
its like html but used to store data
literally HTML and every modern JS framework for the frontend ever depends on it
Meh I don’t think so
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
you start to see the difference once you work with thicc data
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
why does json require that
because the parse state machine requires that you have a matching container closing off each opening
that's the same for xml, unlike html where half the tags don't need to be closed
i.e {"foo": {"bar": 123} isn't valid but {"foo": {"bar": 123}} is
the same rules of XML apply to HTML
var hbObject = JsonSerializer.Deserialize<HelloResponse>(jsonString);
var dataObject = JsonSerializer.Deserialize<HelloResponseData>(hbObject.d);
dataObject.heartbeat_interval // -> 41250
and yes, the format does technically require it, however, like HTML the parsers are forgiving and the DOM walkers are even more so
you do need to adjust your original object though
what the fuck did i just read
is this C#?
context
oofies C# moment
skill issue
also doesn't your lib do the gateway stuff for you
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
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
same
bet @quartz kindle is an expert tho
tim is an expert at anything
yep
because 256px is too large for mobile
so i used a media query to overwrite the size on big screens
css overwrites elements based on order if thats what you're looking for
hot reload moment
hot stuff
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
he ain't using a lib
why does c# have such long names
i thought System.out.print was too long for java
that looks disgusting to use
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"
why is your workspace named Project Discord thingie lmao
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
chonky buffer
@carmine topaz are you trying to make your own websockets?
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
the websocket interface in c# isnt as abstracted as other languages
set a new border on hover
element:hover {
border: xyz;
}```
focus through tab
i saw a few stackoverflow answers for that
what.
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
Can someone tell me how make bot check it's own permission
.me
how do i modify this so that it includes message deletion?
await interaction.guild.members.ban(user.id)```
i know the ban options, but not sure how to actually set it inside the ()
You can include an object as well
(user.id, {object of ban options})
oh okay ty
await interaction.guild.members.ban(user.id, {7})```
@wheat mesa
oops that isnt right
days: 7
Yes the second one
What can you do with a bot token
What
you can do any action the bot can with a bot token
Don’t give your bot token to people you don’t trust
never give that to someone you dont 110% trust
Or even people you trust tbh
The only person that should know your bot token is you
It’s supposed to be kept secret
Can they get my discord account
I have the bot on a test server
So what could they do really
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
ok
once again you seem to not trust this person. I would not give them your token if i were you
but be warned discord support is not known to be very fair

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.
try to console log numPlayer @simple stump
numPlayer returns 0
addPlayer returns 1
aight
doesnt log anything
when checking the log for qChannel, the name returns "Queue [0/2]" so ik that im getting the right channel
try to do
however, i waited a bit, restarted the bot, and the name changed to Queue [-1/2]
const qChannel = message.guild.channels.cache.get("ID")
:))
Unfortunately it doesn't change the channel name
idk if discord just takes a while or smth
huh
after a bit it changes the name
but it takes a while
which is annoying
how do you call the function ? @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
im looking at https://github.com/discordjs/discord.js/issues/4327 which is related to the issue
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
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 :))
👍
Still doesn't seem to work unfortunately
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]");
what does it show?
does your bot have permission to manage channels?
yes
it has all permissions
and if it didnt i think it would say, "invalid permissions"
ah. all g
when was the last time you changed the name?
wdym?
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
because channel names can only be edited 2 times every 10 minutes
ohh
i see
if you already changed it twice in the last 10 minutes, then thats why you're not seeing any more changes
is it for vc channels/old channels, or does this apply for all channels?
ah
all channels
interesting
this didnt seem to apply for newly created channels
i was able to set their name without problem
well ty this is helpful
the limit is per channel
is there a rate limit for editing emssages to?
the limit for editing messages is the same limit for sending messages
5 per 5 per channel
Hello! Tims saving the world again? 
if you send 3 messages, you can only edit 2 times in the same 5 seconds
are you driving again?
Unfortunately the whole day, night and tomorrow morning
Eww
Some days suck
That’s the price of not saying no.
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
xD
we all have our jobs, you drive and i save the world
:^)

add it to the user profile?
sure
on debian i added it to .bash_profile
im switching jobs because sitting at the tills all day is very boring
i'll give that a shot
oh i already tried it
did i do it correctly
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
could the fact im using zsh cause problems?
zsh possibly uses a different config file
i'll have a look around
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.
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.
How can I check if the oldState of the user was a specific channel?
it supports ints as well
SSE used only a single data type for XMM registers:
four 32-bit single-precision floating-point numbersSSE2 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.
always :^)
how do i encode something with Base64.strict_encode with javascript
Can someone give me a documentation of discord.py shards
you can use Buffer.from
@boreal iron @quartz kindle this is how my os is going so far if y'all interested
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
Are there any examples for topggpy v2.0.0a?
I don't really get how to recieve the votes in that version
this doesn't work anymore
https://mystb.in/CommunicationBasketballPosting.python
why cant i add my bot to my server ? it says i cant. Im new to making bots so i dont really understand yet.
How did you try adding it?
hahah nice
invite
im new to making bots so idk how else to add it to my server
Yes, but what invite link specifically
You'd create an invite link through the developer portal for your new bot
Has to be oauth
Like this?
I think
With your invite link being below
It's bad practice, but, for the most part, it's fine.
especially for demonstration purposes
No capital E at the end of my name… what a shame
Totally broken OS

_god thanks I’m not into OS development _
cant you use same width characters
npm i node@16
npx node index

its replit
you can't change it
since when
^
i've tried before
i tried it
i got errors
there are many ways to do it
you need to start the bot in a nix environment, then set the node requirement
also yes there are other ways
thats probs easiest
permanent?
sort of
> 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```
whats the difference
basically we make node as a npm module
but then the text won't look nice
1984
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

const and let are block scoped:
{
const a = 10
}
console.log(a) // undefined
i used var
lol
const result = await fetch(...)
result.body.pipe(res)
if you wanna make your life easier
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.
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)
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
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
Even multipurpose bots have their limits
Generate a random number between 1 and 10? Google. Generate 5 numbers between 1 and 10? A command.
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
Those usually don't work in practice
But you're free to do what you want with your bot.
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
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
I’m aiming for roughly 200-250 commands so I don’t know if that’s too much or not
That’s... a lot
That’s too many lol
Slash commands only allow 100 correct?
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
200 is too much and users probably wont use 70% of those commands
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
Better known as "Jack of all trades, master of none"
I've seen bots with like 600-700 commands
The dev was aiming for 1000 but quit the project
rip c# dead language
always bet on javascript
💵 💵
php devs can't keep up






