#development
1 messages · Page 1550 of 1
?
is the bot a higher role that you? otherwise the bot doesnt get permissions
Okay
well
why
when I accept it
it timesout
but it does show teh og message
did you handle the await correctly?
did you get any error?
yea i think i see the issue
@earnest phoenix u can set images at 2 places.
thumbnail (right to title) and image above timestamp
you get the message you get only if the user got the role
yup
if(rMember.roles.cache.has(role.id)) { //Returns true if the member got the role
return message.channel.send(`${rMember.displayName}, doesnt have the role!`)
} else { //will execute if member doesnt have the role
Thanks
@earnest phoenix https://discordjs.guide/popular-topics/embeds.html
see this guide, it'll help
Damn, I was in a whole other fake discord.js website @rocky hearth
but for only playing
your code will return the doesnt have the role message if the member got the role. invert the check
discord is dumb
there're 2 websites for djs, one is for guide, and the other is docs
@lusty quest explain how you're supposed to choose a system channel on creating a guild when all you can provide is partial channel objects
struct Handler;
impl EventHandler for Handler {
fn message(&self, ctx: Context, msg: Message) {
if msg.content == "!online" {
ctx.online();
}
}
}
let mut client = Client::new("token", Handler).unwrap();
client.start().unwrap();
if (reaction.emoji.name === '👍') {
const embedcom = new Discord.MessageEmbed()
.setColor("#36393F")
.setAuthor("Comfirmed!")
.setTimestamp()
.setFooter(message.id)
msg.edit(embedcom);
runOrder(message.author.id)
this makes it timeout for some strange reason but removing myfunction to handle the order it works and edits the mesage to say comfirmed
you can get the systemchannel from the guild object
partials send a channel id
fetch the channel?
i'm trying to figure out discords logic behind this
so you want to create a guild with a bot?
iirc by default the first channel is also the system channel
yet discord provides an argument for choosing a system channel by id
which is dumb as hell on creation
if the situation is the same your check is still wrong, if you inverted the check you should get a different outcome
why? ids are always snowflakes, and partials always send the id
is this snipped embeded somewhere?
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '👍') {
const embedcom = new Discord.MessageEmbed()
.setColor("#36393F")
.setAuthor("Comfirmed!")
.setTimestamp()
.setFooter(message.id)
msg.edit(embedcom);
runOrder(message.author.id)
} else {
const embedde = new Discord.MessageEmbed()
.setColor("#36393F")
.setAuthor("Declined!")
.setTimestamp()
.setFooter(message.id)
msg.edit(embedde);
}
})
.catch(collected => {
const embed1 = new Discord.MessageEmbed()
.setColor("#36393F")
.setAuthor("Timed out. Use the command to try again!")
msg.edit(embed1)
message.reactions.removeAll().catch()
return
});
Why when I run the function it times out
is that all you need?
@lusty quest here's the thing
did you got 2 collectors?
?
the channels you provided on creation are structured like this
{
"name": "sb8-has-cute",
"type": 0
}
just invert the check i told you a few minutes ago
did you got 2 .then(collected?
yea bcs the Discord API likes json
Me?
@solemn leaf
.then(async collected => { // Change to this
// and also change this part
await msg.edit(embedcom);
where did you handle then the 👎 ?
correct
that's if-else
@rocky hearth it flashes to comfrimed then it edits it again to timed out
and my function doesnt log
does ur runOrder depends on the msg edit?
it runs after it
yeah, does it use the msg, in runOrder body?
no
it only uses the users id
function handleOrder(UserId) {
const orderembed = new Discord.MessageEmbed()
.setColor("#36393F")
.setTitle(`From ${message.author}`)
.setAuthor(`x${args.pop()} ${x.displayName}`)
.setTimestamp()
.setFooter(message.id)
client.channels.cache.get(804070122401955881).send(orderembed).then((m) => {
db.set(`orders_${message.guild.id}`, { "MessageId": m.id, "UserId": UserId })
})
console.log("hhhhhh")
}
@rocky hearth #development message
Show ur collector.
did you just copy/pasted the code?
@rocky hearth I moved te fucntion above the dit and it dgoes straight to the collector
or the time out
founbd out why
this is undefined @lusty quest
client.channels.cache.get(804070122401955881)
I got it
but
I need help thinking
I need to store message ids of orders
Im using quick.db
Can I just make the b name be orders
then .set
or if many orders were put it
in would it be deleted
if you use .set to set orders using the same key it just changes the value of the key
Okay
you can, tho, store an array in it
so i suggest you to .set with a unique key
db.set(`orders_${UserId}`, { "MessageId": Id})
using db.get you get all data
what should I do to correctly get the language of a code snippet?
you mean this?
yeah so say someone inputs
console.log('') how should I determine, in nodejs, that that language is js
oh hell
how can I type it
^```.+$ for regex
without using regex, get the index of the first space character, then make a substring and replace ```
like, an example:
Are you trying to get the language and the content of a codeblock?
afaik ``` is markdown, so any codeblock written will be detectable
If so that would be really easy
how can I get a message from its id
not just a code block
from like any text input
that'd be impossible then
without any ```
/\`\`\`([\s\S]*)\`\`\`/
that could be:
C
C++
C#
Java
etc
That's an interesting question, but it looks impossible
highlightjs does it decently well
Bruh
but I need it more precise
lang?
cleint.channels.cache.get("804070122401955881").messages.fetch(order.MessageId).then((msg) => {...})
I don't
just make a regex dict
it could be any
is that correct?
that's the issue
oh idk about djs
yes
you can't
this is why
unless the lang has a highly unique syntax, you can't tell what lang it is only by the syntax
Are you trying to highlight the syntax of a given codeblock content?
any text
^
any input
fuck
then u can get the first word to identify
So he trying to determine the syntax of any text to apply something specific to it?
hastebin
yes
it doesn't want to save reeeee
but those make a ton of mistakes
use hatebin
if its some eval (which I think it is) you can use identification
hastebin is bugged af
I am trying
hatebin, not hastebin
It's really Impossible to determine the syntax without false positives, because you gotta have thousands of checks for just a single one of the languages
Time consuming, and already Impossible
yea
I got Unknown Message
ima just live with highlightjs
there are, however, some langs that are readily recognizable
like cobol
but that ain't useful
The node trying to determine brainfuck be like 
Hello I have just had my bot checked on discord I did not have the right to intents, now my bot does not start anymore
you need to request those intents
yes yes I made the request I was not allowed because I have commands a little too basic. but now I have a problem I cannot start the bot
I delete "fetchAllMembers" because suddenly I knew that I could not start my bot if I mention it but that doesn't change anything
fetchAllMembers require GUILD_MEMBERS gateway
so yeah, you need to request it to be able to use
it's delete but my bot doesn't start I don't understand
Does anyone know how I would check if a number is in an Environmental Variable table?
I tried .Includes().
see the console output
what's the error?
there is no error, nothing happens
env variables are stored in a map
so KEY-VALUE
you need to check if it contains the key
@quartz kindle, im trying to compile my stuff with tsc but when it comes to getting all my types i think this
foo.d.ts
foo.js
bar.d.ts
bar.js
index.d.ts
index.js
doesn't look good, is there any other way i can assign my types without sending them to @feral hornets
i don't regret that ping.
I swear my h key is broken-
@lyric mountain I have an error. TypeError: process.env.Admins.map is not a function.
Did I misunderstand you?
Admins is probably undefined
Nope.
then it's not an array
It's an array of numbers.
it probably isn't
Admins="[ EXAMPLENUMBER1, EXAMPLENUMBER2]"This is the ENV.
I know.
Then don't make it a string if you want an array?
???
Nope didn't work.
wdym
it's an empty array
if (process.env.Admins.map(message.author.id)){
return true
}
return false
I removed the IDs so you guys wouldn't see lol
@lyric mountain ^
map doesn't work like that
She said .map. I must have misunderstood her.
I think you wanted to do Array.prototype.includes()
.has & .includes doesn't work
I'll try.
const friends = ["jerry", "jason"]
console.log(friends.map(f => `+${f}`)) // ["+jerry", "+jason"]
that's how you use map
I don't think they wanted to use map
@earnest phoenix TypeError: Cannot read property 'includes' of undefined
Show new code
if (process.env.Admins.prototype.includes(message.author.id)){
return true
}
return false
Array.prototype was for the reference of an array prototype, not to be copied
Admins.includes()
I tried removing .prototype and I got the same error so I thought it was intentional.
Nope.
Command not found
true
Then process.env.Admins.includes(message.author.id) should already work
I still don't have the solution can you help me?, I even tried to run in a simple code but I can't
Nope
Oh
You're probably not even saving and running the code at all @livid lichen
I am.
So what is the error
My program automatically updates it.
A very big one
But mostly just includes is not a function
console.log(typeof process.env.Admins)
I fixed it.
It cannot be a string holding the table.
Idk why I even thought it was right.
Thanks for the help @earnest phoenix.
- <GuildMember>.voiceChannel
+ <GuildMember>.voice.channel```
@earnest phoenix who did that, d.js?
Did wut
You're using discord.js v12, message.member.voiceChannel is v11 not v12
message.member.voice.channel is v12
https://sourceb.in/XBfkbl3ucR
Please help I give nitro for help Ping me
f
no, like, the env is a map
no that you needed to use a map on it
You're trying get a non-existent channel on line 199
https://sourceb.in/YvPgiG4hcE
Why the channel is invalid
"I give nitro" 
when you have to bribe someone to fix your dumpster fire
netro
const BotMessage = await msg.channel.send("Ping!");
BotMessage.edit({
content: "_",
embed: {
title: "Pong!",
description: [
"**Responce time: **: `" +
(BotMessage.createdAt - msg.createdAt) +
"ms`"
].join("\n"),
color: "#0099ff",
timestamp: new Date()
}
})
```This is my code and this is my output `UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body`.
I didn't read much of the message.edit() function on discord.js docs.
dumb question but how do you check if a channel ID is located within a guild? discord.js v12
does it make sense to use redis over a basic object cache in js if you are caching small data like ints?
Miss click
my empty php file gives a 500 error
Lol
Correct my script vs nitro come dm
@drowsy crag ^
?
yes
ohok
@opal plank waht is the diff between ts and js
they are both high level programing lang
and can work with each other
How to put server count on my bot page
@opal plank also that is a dam nice rich presence I might do that
Ts is js with extra features, such as experimental features from node, transpiling to different version of node, type assurance, and a lot other stuff
i would appreciate if you didnt, have your own ideas please
just the add bot
ANd I made m rich presence long before you had one
so you copied off of mine and added things
gottem
TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be successful using it https://angularfirebase.com/typescript-the-basics/
Deep Dive https://github.com/basarat/typescript-book
TypeScript Docs https://www.typescriptlang.org/
also good luck writing in C#, SDK is a bitch to play with because RPC is deprecated
so no node support
ill do it
i would rather people do their own thing rather than copying 
thats how the internet works
you have all this creativety and thinking just for it to be copied
¯_(ツ)_/¯
same for the bots
writing in c# is not my thing so i'd have to be lucky with my keyboard smashes to work
tbh
@opal plank what?
it's just microsoft java
there wasnt a single genshin bot apart from the wiki one, now theres plenty out there
the basics of c# ain't that much
semi related hey remember when discord said they'll make presence REST compatible
well, it's been 3 years now
discord™️

someone by the end of the month will have an exe version so users can do it themselves in a few seconds.
my bots already got an exe 
nothing happened, move along
RPC is deprecated dude
not working !== deprecated
they still deprecated it, the proper way to do presence is SDK
how can I make a discord permission bit field (flags) in readable format on my website? not in a bot using discord.js so no Discord.Permissions but there has to be a separate package or at least a way to achieve it with pure javascript
time to write a js lib to do use that then
make a constant with the perms and their numbers
and use bitwise operators to calculate stuff
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
@solemn leaf
silly question is my status cleared by discord?
i wish i knew what you're talking about lol @mellow kelp
gotta do it in c++
shite.
i just don't get how 1 << 0 would help in my 2146959094 flags to see if it has manage roles or smth
roles use | and &
not really sure why they work that way but it works
sounds like it's a good time to learn how bit masks work
cuz it easier to pass an integer than an array, saves data
reduces packets size
i guess each of those numbers has different bits that don't conflict with the others right?
pls how 
so that they don't get conflicts when using |
yes
that's pog
that's why discord started using strings for permissions iirc, the numbers became too big for json
they did?
in v8 yeah
""
Permissions are stored within a variable-length integer serialized into a string, and are calculated using bitwise operations. For example, the permission value 123 will be serialized as "123". For long-term stability, we recommend deserializing the permissions using your languages' Big Integer libraries
taken from docs
ohh you mean that
yea right
its not used anywhere
o
huh, that's easier than what I expected
well thank you very much, will try this one
bitfield is confusing, but not hard at all
you gotta understand how binary works to decode it
since its all turned into 0's and 1's
.toString(2)
and it cheks that
it's really simple if you ever covered binary in cs
i got to practice binary with the advent of code thing during december
there was this puzzle where you had to apply some bitmasks to some numbers
i need to get my daily rates of bot growth
i shit you not its at a rate of 60 servers a day now

@quartz kindle how long will internal sharding survive for?

i win
im so fucked though, this bot isnt going to be surving a month if it keeps going like that on a single thread, its insanely complex and intricate
uninternally shard it
you make it sound like its easy
i even made my own cluster/spawner for twitch, and im struggling to properly think of a good way to do it in d.js
Traceback (most recent call last):
File "C:\Users\25dch\OneDrive\Desktop\Timer bot\calcybot\calcybot.py", line 182, in <module>
async def cookie(ctx):
File "C:\Python39\lib\site-packages\discord\ext\commands\core.py", line 1257, in decorator
self.add_command(result)
File "C:\Python39\lib\site-packages\discord\ext\commands\core.py", line 1149, in add_command
raise CommandRegistrationError(alias, alias_conflict=True)
discord.ext.commands.errors.CommandRegistrationError: The alias Cookie is already an existing command or alias.
``` im getting this error even tho i only have 1 cookie aliases
i do make it sound easy!
its a complete rewrite though
i'd probably be better off making my own gateway and spawner
rather than using d.js's
The error is exactly as it says
async def cookie()
Something is already called cookie

How to put server count on my bot page
in top.gg?
Yes
which language?
Html I think i have no idea
Bdscript
dont know, Bdscript isnt a proper programming language, maybe they have their own thing
Ok 👍
apparently you can use javascript on bdscript
then you may use the node-sdk @earnest phoenix https://github.com/top-gg/node-sdk
Ty
Connect to websocket and send the message to urself maybe?
Like, self-send the websocket message
not that, an eventEmitter, from node
Oh, idk then
are you extending eventEmitter
i am not, i'd like to make the class itself be able to emit events
should i?
it makes life a lot easier and the events package is build into node
i worked with emitters before, but never in a way to actually make the class itself be an emitter
i usually call the new EventEmitter from node
just extend EventEmitter i guess
maybe you could try implementing it's prototype methods
extending it will give you a lot of flexibility out of the box
https://i.imgur.com/JvCyKP7.png then you can just this.emit()
like EventEmitter.prototype.emit.call(this, 'event')
iirc
yea
yeah, its annoying that i have to call super
I left and rejoined
do you have intent?
what intent?
GUILD_MEMBERS
is it specified in client opts
do I have to enable in portal?
yep
@earnest phoenix @mellow kelp @misty sigil thank you
np erwin't
im used to doing this, which is fine
but in this case i need the class itself to have emitters inside
without adding another variable
pog
did you super()
@misty sigil didnt log it
prove it
oh shit
and i already compiled it
imma restart VSC maybe it picks it up
nope
still triggering
hilp

i think its the declaration
but tsc should've taken care of that

weird
wrong token or trying to access something that you dont have access to
there you have it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
got a really odd error
this happened after i imported something to a module
anyone ever seen anything like this?
hmmmmm im starting to think 16 seconds for a full startup is quite slow
how long do the bot yall' have take to fully startup?
About 1 mins (actually)
are you firing all of that in serial or parallel
me cry?
yeah
pararell
hm, i guess it's not actually that much for that amount
Just done the test
there are some stuff that takes a bit longer to load
but they are not core parts
theres a full minute just there to fetch all buffers
i think theres about 50 requests being made there
correction, 73 requests
73 requests in under a minute isnt that bad either
nvm got it, it was one of my own modules, not sure exactly what caused it but I had to remove some unnecessary code from that module and it worked
possibly a sgfault yea, pretty odd
i love how the property is called chibis
imagine doing this.function instead of defining class methods how they're supposed to be defined
i know how they are done

this case is needed
since i need to assign that value to something without fucking it with a promise failing
@split hazel 
thicc ints save lives
thicc ints steal bits
how do I get the id of this #development
what library you using?
djs
as in in a message get the mentioned channel?
yea
yep so you can just check mentions || message channel's id
mentions.channels.first() || mentions.channels.first().id
no?
it there's no mention, it will just return undefined and not throw an error
or this...
const channel = mentions.channels.first() || message.channel
fucking hell
can I get help with a regex
maybe, whats it for and what have you tried
I havent tried
I want to replace all {username} with message.author.name
would I use \w
I need help,
I'm trying to update a document in my mongo database, but it's giving me the error:
TypeError: Update document requires atomic operators
collection.updateOne({ $push: { "economy.disabledUsers": "420366170428801025" } }, function(err, updated) {
if(err) {
console.error(`[Server][ERROR] ${err}`);
return res.json({ code: 500, data: err });
}
console.log(updated);
return res.json({ code: 200, data: updated });
})
})
I've already googled it but it's not really too helpful, everything looks the same
$push is not right, i've also tried "$push".
$push is not right or something
I've tried it as $push and also "$push"
@solemn leaf use regex
Do a string.replace() and use regex
use /\{username\}/g
^
it's like '{username}', but the g flag makes it global
the \'s are just for escaping the brackets
pog
Any help on my issue? lmao
never used mongo
i use mongoose so i dunno
o
not 100%, but shouldnt the first option be which document to update
❤️
It is indeed
but sometimes a fresh pair of eyes is all you need too.
Especially when tired from working haha
how do I mention a channel again?
.channel
`ping channel: ${message.channel}`
dude
.toString() ?
im ebing trolled
that
to mention a channel
Bro I just told you how to ping a channel
<#${idvariablehere}>
[#development](/guild/264445053596991498/channel/272764566411149314/)
Try enabling privileges, cuz the code should be good
oml not this again
and
how do I end awaitMessages
fairly certain you should be using a collector instead
I need like 3 of them
unless you pass in time or a filter, i dont think they can be ended externally
awaitMessages is just a higher level form of a collection
collectors in the other hand can be removed fairly easily
how do I end it so I can stat another one when its over?
actually doesn't node feature promise cancellation in later versions
cry mentioned something about it
Though you may not need three separate collectors/await messages. You could probably squash it into one.
How lite?
it never actually does anything after this
function startWelcome() {
message.reply("Please tag the channel you want people welcomed in!").then(async (msg) => {
console.log("h")
message.channel.awaitMessages(filter2, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
it never logs after the collected
that is my first filter
what's filter2?
You basically need to create one single filter that allows X number of responses. When a message is collected, do something like validating the message. If it fails the validation, inform the user and cancel it. If it works, continue. You keep doing this and keep record of the data you have and the order you're in, but you may run into race conditions this way.
@sudden geyser
const filter2 = (msg, user) => {
return msg.content && user.id === message.author.id;
}
It's only msg
channel_nsfw = await self.is_nsfw(ctx.message.channel)
it doesn't provide user
is this code correct to check for nsfw?
you use msg.author.id instead @solemn leaf
okay
is this code correct to check for nsfw?
if ctx.channel.nsfw:
code
else:
bruh


how do you handle your timeout?
rip ganyu
.catch
can you show your code
message.channel.awaitMessages(filter2, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
console.log("hh")
const channel = mentions.channels.first().id || message.channel.id
message.reply("Great now please give me what you want it to say!\n{username} for the user's name, {guildname} for the guild's name!").then(async (msg2) => {
message.channel.awaitMessages(filter2, { max: 1, time: 60000, errors: ['time'] })
.then(collected2 => {
})
.catch(collected => {
message.reply('Timed out, please restart.');
return
});
I had to cut stuff out
sorry for being late but awaitMessages is only msg
wdym
hmm
hmm
hmm
that says alot about my question
it doesn't matter, it's the same channel
@client.command()
async def ull(ctx):
await ctx.send("Timer set for 20 secs!")
await asyncio.sleep(20)
await ctx.send(f"{ctx.author.mention}, You can swap now!")
``` this is a part of my code and i already have a code for gb, so when i type gb it sets a timer for 8 secs and this is the same thing but its for fishing so i want it to set a timer for 20 secs but to catch the poke you have to do gb so it also sets a timer for 8 secs..so what should i do?
you should do some cleaning on your code
use await instead of then()
it makes everything look better and easy for you to understand/troubleshoot
I could make a fucntion for each one
and what
dont you do .then for it to do it after?
whats a trobuelshoot
await does that too```js
send("Pick an option");
try {
const firstResponse = await channel.awaitMessages(filter1, options);
firstResponse.first().content;
const secondResponse = await channel.awaitMessages(filter2, options);
secondResponse.first().content;
}
catch { send("Timeout, please try again."); }```
What?
Confusion
Sounds like you want a custom timer?
@client.command()
async def count(ctx, timer: int) -> int:
await ctx.send("")
await asyncio.sleep(timer)
await ctx.send("")```
(Ofc import asyncio)
hh that annotation
IDE support 
but the thing is, you don't return anything 
ok so..you type ;p and then gb to catch it, and then theres a cooldown for the command, for that i want to make a timer which will notify the author that they can spawn a pokemon and i already have a timer bot gb, and now im trying to make a timer for ;fish command which has a 20 sec cooldown but in that you also need to use gb to catch it. So my gb timer is for 8 secs and the fish cooldown is 20 secs, and so when i type gb it sets a timer for 8 secs and 20 secs
gb = greatball
basically trying to make a timer bot for an another pokemon bot which has a cooldown between commands
could you just wait_for a command before actually sleeping for 20 seconds?
@pale vessel it insta timed out
is gb a command or
flaze playing osu great
gb is a thing which you catch the pokemon with, ;p is the command
so ;p is awaiting for gb message?
lmao, I don't really get it
im trying to make a timer for the cooldown so that it notifies the person that they can do ;p again
and so theres another command called ;f which has a 20 sec cooldown but uses the same thing to catch it which is gb
greatball*
Cannot access 'channel' before initialization
uh could you send the p command? Perhaps I can understand what you want to achieve better.
maybe i can show you it by inviting u to the test server
in dms ofc
sure
first().mentions?
const channel = firstResponse.first().mentions.channels.first().id || message.channel.id
`**Members with the Role (${message.guild.members.cache.filter(m => m.roles.cache.some(role.id)).size} / ${message.guild.members.cache.size}):** ${message.guild.members.cache.filter(m => m.roles.cache.some(role.id)).map(r => r.join(", "))}````
something's wrong
i mean i know what's wrong
array.some takes a function
fn is not a function
flaze?
show your code
const firstResponse = await message.channel.awaitMessages(filter2, { max: 1, time: 30000, errors: ['time'] });
const channel = firstResponse.first().mentions.channels.first().id || message.channel.id
message.reply("Great now please give me what you want it to say!\n{username} for the user's name, {guildname} for the guild's name!")
const secondResponse = await message.channel.awaitMessages(filter2, { max: 1, time: 30000, errors: ['time'] });
const welcomemessage = secondResponse.first().content.replace(/\{guildname\}/g, message.guild.name).replace(/\{username\}/g, message.author.displayName);
Collection(0) [Map] {}
TypeError: Cannot read property 'id' of undefined
add console.log(firstResponse.first().mentions.channels) before const channel
oh
you did that
const channela = firstResponse.first().mentions.channels.first() || message.channel
const channel = channela.id```
brace
that is the same as
const channel = firstResponse.first().mentions.channels.first().id || message.channel.id
not quite
that looks more trustworthy
if channels.first() doesn't exist, it will error since it can't read the property id from undefined
yes
ok
(firstResponse.first().mentions.channels.first() || message.channel).id would be safe to use
wot
that is if firstResponse.first() exists (the user responded)
you can do that
epic
seems to have worked
but my username is undefiend
const welcomemessage = secondResponse.first().content.replace(/\{guildname\}/g, message.guild.name).replace(/\{username\}/g, message.author.displayName);
#meeting, undefined ℂ𝕙𝕒𝕟 ℂ𝕦𝕝𝕥𝕤
why not just message.author.tag
what if I want display name
does the user have a nickname?
displayName is for members
does anyone know any spotify api for py?
idk do a google search
app.get("/random/meme", async (req, res, next) => {
try{
new Promise(async (resolve) => {
giveMeAJoke.getRandomDadJoke(function(joke) {
res.json([resolve(joke)])
})
})
}catch(err){
console.log(err)
}
});
Why
oh wait
Do I need to await it?
idk what that is
that joke package is garbage
Yes I know
why not just use node-fetch directly to call the apis
using packages for minimal apis is usually a bad idea
🤔
because if you do it yourself it's easier to optimize
I have never worked with express yk
that way you can just
const r = await fetch(...);
res.json(await r.json());
yes?
yes
that's what that package does
but worse
lol
steal the urls from https://github.com/Saurabh3333/give-me-a-joke/blob/master/index.js
sure
Pog it worked
const evalOutput = [];
if (res.callbackOutput) {
evalOutput.push(
"-[ Eval Output ]---------",
typeof res.callbackOutput === "string" ? res.callbackOutput : inspect(res.callbackOutput)
);
}
if (res.stdout) {
evalOutput.push(
"-[ stdout ]--------------",
typeof res.stdout === "string" ? res.stdout : inspect(res.stdout)
);
}
if (res.stderr) {
evalOutput.push(
"-[ stderr ]--------------",
typeof res.stderr === "string" ? res.stderr : inspect(res.stderr)
);
}
const body = await fetch("https://hastebin.com/documents", {
method: "post",
body: evalOutput.join()
})
.then(async (res) => await res.json());
await msg.edit({ embed: embed.addField(":notepad_spiral: Hastebin", `https://hastebin.com/${body.key}`) });
});
idk why it no workkk
ive tried changing the code altogether but then it instantly gives me a error H
use paste.mod.gg, i use that for my haste
yes
whats thaat
i just use my self-hosted pastebin
just another hastebin server
that works too but i cba, it's for temp data
ya
or do i need the document thing
just change the domain
yea
bet
but it's for an exec command? it might contains sensitive info
so be careful/self host
eval command yes
eval is different
but i already put in failsafes
all right
well execute command lol
1 of them is that every time its ran it calls a function that scans everything for sensitive info
like the bots token ect
so it always gives a heads up
pogpog
like that
@delicate shore u can't use async function in Promise contructor.
would that give a rejection because its calling a function in a promise
wouldn't
@pale vessel tyyyyyy
ah
u no need to do new Promise stuff
before it wouldn't send anything and after id get a error in my console
yeeeee
then what do I do?
well that part of the eval
most of it is just me testing out shit and it working on accident
i would make it embed only but it breaks the bot since it pre loads everything
app.get("/random/meme", async (req, res, next) => {
try{
const val = await fetch('your link to resource')
.then(res => res.json());
}catch(err){
console.log(err)
}
});
@delicate shore
yes, I am doing with that atm
any idea how can I yk
do it with npm packages like that
const val = await (await fetch('your link to resource')).json();
its the saame for, every fetchable link or npm packages
node-superfetch?
yeee
i think xiao uses that
its good lol
it's like superagent
i would use if if my bot isn't a economy bot with decent music commands
also fuck lavalink
i read the docs 4 times when all i had to do was copy someone elses code
IKR
y though?
ytdl core sucks but dang
in .net we have youtubeexplode
super fast
youtubeexplode + ffmpeg is my best combo for music streaming
what the hell that looks so fucking easy
does it explode tho
its fine
r u guyz familiar with Next.js?
hmm I've only tried cra
told you
me yea
at least i've done some small projects
ohh, so I wanted to know, is next.js is similiar to how we used to build sites with php?
hey im 13 and started coding at 12 idk y but when i started it i couldnt stop i do html & css i do bot dev and thats it
you can make dynamic routes for example
with php i think you would need query params or something
tht's also availbale in nextjs right?
php in 2021 
yea ofc
why people troll, php so much.?? 😆
you can get query params in getServerSideProps iirc
so nextjs has nothing to do, with client side rendering.?
plus there's much better and more performant alrernatives to php today
wdym?
oh nvm
well kinda
hey, for some reason I keep getting an empty Permissions bitfield with this in discord.js
let channel = await msg.guild.channels.fetch(msg.channel.id)
return channel.permissionsFor(msg.author)
same goes for msg.member and msg.author.id, am I doing something wrong here?
i think there are a couple of cases which still need client side rendering
ive never understood php, is it like nodejs but no running process and everything is computed on the fly?
we all hate php, but still it runs on majority of the sites today... 🤦♂️
unfortunately, that is
the only people who use it are ones who got scammed by buying a web host where you don't have full access to the server
Especially WP, which is a slow hot piece of garbage
ugh i hate wp
whats wp
Backdoor extensions
wordpress
oh shit no wp
I would rather use something like Ghost
And this is a segway to our sponsor, Squarespace
Can you export the static files from Squarespace?
if we remove wp, from this world. How much php sites would be left behind.?



