#development
1 messages · Page 1771 of 1
thanks hahaha
ok sooo i get this error (node:47208) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body content: Must be 4000 or fewer in length.
so i just need to add a map limit i guess
yup
Or you can split the string and send it in multiple embeds but that's kinda clunky
if its an array and every element is a similar length you could just do arr.length = n
I'd do content.players.slice(0, theAmountOfNamesYouWant).map(...)
I don't think you really want to show hundreds of names in a single messages
or you could make a pagination menu using buttons
i think if i put everyname underneath eachother with \n it could cramp it better
how would that be possible
@rough obsidian hm anyone have some better idea to get the YouTube Tracks for an Spotify Track/Playlist then getting the Tracks with the Spotify Libary and searching on YouTube for each track in the list?
or should i "just" build an api for that?
ok so i finally fixed and it shows the names now BUT it puts them all together how can i make every name a individual
const Discord = require("discord.js");
const got = require("got");
module.exports = {
name: "queuepeek",
aliases: [],
description: "random anime meme",
run (message, args) {
const embed = new Discord.MessageEmbed();
got("https://rebane2001.com/queuepeek/data.json").then((response) => {
let content = JSON.parse(response.body);
let pos = content.queuepos
let est = content.queueest
let player = content.players.slice(0,5).map(players => players.name)
embed.addField("position in queue:", `${pos}`, true)
.addField("Estimated time:", `${est}`, true)
.addField("Players:", `[${player}](https://namemc.com/profile/${player})`, )
message.channel.send(embed);
});
},
};```
as in \n orrr
let player = content.players.slice(0,5).map(players => players.name).join('\n')
Actually will that fuck it up my brain can't process rn
TIAS
Is it okay to have permissions="8192" so -> manage messages in the invite?
In #502193464054644737 it says it will be tested with permissions="0", but then my core functionality would be impacted, am I just worrying for nothing or will this impact my chances of approvement?
or is there another way to request permission during operation without giving full permission to the bot? >.> Since then all management bots would also need to work with perms 0? o.O
ohw if you do that it will look like this
mmmm
figured it would fuck it up
Maybe loop over it instead of maping
slice then loop
unless there is a better way
you can do it with mapping
map(player => `[${player.name}](${player.linkOrWhatever})`)
Does anyone know why I keep getting this error when I do node . or node index.js. (I left this project and came back after a while)
you need to add the node.js executable to your PATH
It's usually added by default when you install node.js
so i should reinstall it?
You could do that, you can also find where the executable is and manually add the path to it to your PATH
maybe
idk how to do that :/
google is your friend
"How to add node.js to PATH"
Or "How to add something to the PATH"
Thoughts from Ryan Hoffman, an experienced team leader, software architect and developer.
- Grab the dir node is installed in (Typically your program files under nodejs)
- Go to your settings and find Edit environmental variables
- Edit your system/user path and add that dir path to nodejs you got in step one to it.
- Save and restart terminal
Ez
do i restart my pc after?
i made a global leaderboard command, and it always tells me or that tag is undefined or that the max is 2048 in length
case 'lb':
let moneylb = db.all().filter(data => data.ID.startsWith(`money`)).sort((a, b) => b.data - a.data)
moneylb.length = 10
var gLB = ""
for(var i in moneylb) {
gLB += `${moneylb.indexOf(moneylb[i])+1}) ${bot.users.cache.get(moneylb[i].ID.slice(6)).tag} : $${moneylb[i].data.toLocaleString()}\n`
}
const globallb = new Discord.MessageEmbed()
.setTitle('__Global Leaderboard__')
.setColor(bsc)
.setDescription(gLB)
message.channel.send(globallb)
break;
Yes
embeds have a max limit of characters that can be sent in em
You are hitting that limit
Try pagination, this way you can scroll through this leaderboard
screw it didn't work, ill work on it tmr
@client.command()
async def test(ctx):
ip = 'PoopIP'
port = 30120
fivem = FiveM(ip=ip, port=port)
players = await fivem.get_players()
playerinfo = []
for player in players:
playerinfo.append(player)
ok = Paginator(query=playerinfo, page=1, per_page=10)
em = discord.Embed()
em.add_field(name='Players', value=ok)
await ctx.send(embed=em)
``` i wanted to use paginator to show all the players info in the server in diff pages, but cant figure it out how to???
could someone expert in mongoose in javascript help me? How do I insert multiple Strings into a single property?
What you did is correct
but the out put is like
Players
<paginator.Paginator object at 0x0000029D1BE7D730>
in embed
so how to fix it??
I forgot how to use it myself
so, can you help??
Give me a second
but can u help??
Use an array
... yeah
>>> pag = P(list(range(100)), per_page=5, page=1)
>>> for item in pag:
... print(item)
...
0
1
2
3
4
oh ok
@rapid wharf You probably want to either convert it to list or join it with some separator
yes yes
Which one? 
You can technically pass list(ok) as the field value but imo that would look ugly
i actually need this
(sending ss)
Ok so im trying to get multiple rows of names next to eachother so that it fits better but how could i add that
ok forget ss, like
Page one:
- <player_name> <player_id>
- <player_name> <player_id>
........
page two: - <player_name> <player_id>
- <player_name> <player_id>
.......
page three:
.....
Ahhhh
inline text fields
\u200b as the title
your list as the value
inline: true
What you might want is is iterate over ok.pages
Ok no, actually...
ohh
range(1, ok.total_pages + 1) specifically
Each element from that range is gonna be a page number. What you can do, ironically, is do ok.page = item, and then work with the ok object itself
>>> list(pag)
[0, 1, 2, 3, 4]
>>> pag.page = 2
>>> list(pag)
[5, 6, 7, 8, 9]
đ
ohhhh
shiv I have a challenge for you
Oh? What kind?
i got someting someting
Sort a list of numbers from highest to lowest with python
Without list.sort()? đ
Yes
Let me restart my IDLE
Okie
it's a description tho because fields can only hold that mutch characters if im correct
You can't in a description
You can't even inline like that in descriptions I don't think
so it wouldnt be possible to lets say every 50 names a new line??
Well yea
@earnest phoenix No advertising here
Switch blade ig
a really butchered google translation
looking at the site name it seems like a cracked game weebsite
More like scam
and ip logger
because its not a writen list of names
so?????
the same way you put it in description, you put it in fields
lol
man this is what happens when you copypaste too much
cant resolve a simple logical problem
@earnest phoenix ty
They also posted in #general
Bruhhhh everything im currently coding is legit 0 copying its just your shitty way of explaining no need to be toxic
if you look up
I should have cleaned it all up
Ah okay good
@earnest phoenix and @cinder patio are legit the ones who helped the most soooo its really your explaining
instead of not using the description, you instead use inline fields
this is the error i get with fields (node:33864) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body embed.fields[0].value: Must be 1024 or fewer in length.
this not only does your desired result but also increases the limit to 5k chars total
yeah
Yeah with description its not a problem
^
You might wanna just loop if ou are going to put it in fields
Else use descriptions with the way you're doing it now
Cant you just loop over the array and make the field inline
so all of them are inline
That would make it so there is a different field per name
Isnt that what they want
it's a very simple algorithm where you loop through the players and keep adding to a string up until the string can't fit no more than 1024 chars
once you hit that point
add the field
wait they said rows, nvm
reset your string, repeat
>>> from random import shuffle
>>> l = list(range(50))
>>> shuffle(l)
>>> def sort():
... for i in range(len(l)):
... for j in range(i + 1, len(l)):
... if l[i] < l[j]:
... elem = l[i]
... l[i] = l[j]
... l[j] = elem
>>> shuffle(l)
>>> l
[46, 31, 43, 5, 49, 44, 25, 15, 30, 36, 10, 40, 9, 17, 42, 41, 34, 22, 28, 4, 19, 11, 18, 26, 33, 48, 45, 14, 39, 7, 20, 12, 21, 0, 2, 3, 23, 37, 6, 37, 13, 47, 16, 27, 24, 1, 29, 8, 35, 32]
>>> sort()
>>> l
[49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 37, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
You also have to account for the length of each name, if the current names in the array take up 1021 characters, and the next name is more than 3 characters long, what'd you do?
I've never seen it done that way
nor do i really understand it
Also I'm still not entirely sure what you want to do Hyporelix
why did you ping me...
because you have a stupid name
xD haha lool xD
something like this but then just longer because this is 54 people but
sry
you can use 5 inline fields max
or rather 5 and a half
the total embed char limit is 6k
oh also you can add padding to the values to make the embed appear wider and with more spacing
but again
that costs you the char limit
ho are you talking about? xD(i made an full implementation of components in discord.py by my own )
Do you know how to do a fuzzy match with python
wth is fuzzy match
how did u do this, i need to do the same, can u tell me plz
How to run a loop in the value of embed (d.py) ??
tldr computer trying to understand a drunk person
basically just tries to find the closest word to a set of words iirc
@earnest phoenix
at least that is what I was told in another server
Ahh
Idk why you pinging me
I never heard of it to this day
pretty much almost any thing that implements searching does fuzzy search
i just used 3 differend fields
yep
Ahhhh, that makes sense
Its useful
https://www.datacamp.com/community/tutorials/fuzzy-string-python well, this is quite fun to read
Yea
Should note it for some day
How to run a loop in the value of embed
I was going to do it for a bot I was making but im too tired to remember which bot
:^)
You dont?
what are you trying to do btw?
You run the loop and set the value
ohhh
val = ""
for _ in ...:
...
embed.add_field(name="...", value=val)
i am making a cmd to fetch players from fivem server so
Nah like
I remember that part
What are you trying to do with the data, again?
Oh, pages
Long embed
Wew
yes, that bot send as many embeds to fit all the players, and i wanted to do the same in pages
I'd suggest fitting around 15-30 players in one page
ya
Your query is a list, correct?
but busy thinking who to do that
its a list of players
@client.command()
async def test(ctx):
ip = ''
port = 30120
fivem = FiveM(ip=ip, port=port)
players = await fivem.get_players()
server = await fivem.get_server_info()
playername = []
for player in players:
playername.append(player)
ok = Paginator(query=playername, page=1, per_page=10)
em = discord.Embed()
await ctx.send(embed=em)
``` This is the code
why not use fivem.get_players() directly?
can be strings if i use playername.append(player.name) and for now its obj Player
hmm, i used it it sends just a list of players
[player.name for player in fivem.get_players()] ftw
you can grab what you want from it like that
Then you can just do something like '\n'.join(ok)
I am confused by how python works my smol brain no comprehend
Hey guys i cant install better-sqlite3
yes did that, it works but still thinking on how to add player id next to the player name, a lot of confusion in brain
Use an f-string in the list comprehension for players
'_'
Example: [f'#{player.id} - {player.name}' for player in await fivem.get_players()]
import { Flex, Heading, Text } from '@chakra-ui/layout';
import React from 'react';
export function Header(){
return(
<>
<Flex justifyContent="center" alignItems="center" h="500px">
<Heading fontSize={{base: "3rem", lg: "4rem"}}>
ChĂșng tĂŽi lĂ Noobs
</Heading>
<Text>
NhĂ vĂŽ Äá»ch nĂ o cĆ©ng từng thua
</Text>
</Flex>
</>
)
}
export default Header
anyone has any idea make the flex to block?
try to create a DMchannel with the user
and then check if the channel exist, if not then return;
Is that a phone?
even if it was, should be able to install just fine (even though its clearly windows)
Its vds server but im using in phone
okey
Hi, I was wondering where I could find the rules for Discord bots
thanks!!
How can I have the div stick to the bottom of the page AFTER scroll, and not just the viewport
https://i.callumdev.xyz/u6v3k.png
https://i.callumdev.xyz/1fhim.png
am I dumb or what the hell comes in the one blank field
How can I make it so it detects if my message contains an exact word that is in an array, like if it contains work, it goes through, but if it is worked then it doesnât go through?
Javascript btw.
message.content.includes
so my friend has a rp bot all the commands are the same, she copied and paste ever command just changed a bit so the outputs are different but its only this one command that is not working there all the same commands but its only thing one that doesnt work
@client.command()
async def kiss(ctx, member: discord.Member):
embed=discord.Embed(title=f"Oh Hmmm thank you", color=discord.Color.purple())
embed.set_image(url=random.choice(kiss))
await ctx.send(embed=embed)
this is the error shes getting
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object of type 'Command' has no len()
Loop through your word array and use includes() as Startgirl suggested
The longer the list gets, the longer your message is, the longer it takes of course
Break the loop if thereâs a match
What developer commands are good to have on a public bot?
Such as eval, reload, restart etc
eval is pretty much all you need
i do everything with eval
Lmao fair enough
real champs write their own evaluation compilers đ
Tim's bot is just a glorified eval command
Yah, but it doesnât make sure the full work matches the thing in the array, like if the array has âworkâ, and I say âworkedâ in the message, it still triggers but I donât want it to trigger.
Ideally, you shouldn't need to invoke a command to reload command files or other required modules. You can watch for file/dir changes specifically then drop cache and re-require the module.
Invoking a command at scale is not ideal
Well then itâs even more time consuming but still no big deal
Split the whole content by whitespaces, loop through your array and create another loop inside looping through your content array
Transform both values to a lower string and check each iteration if they actually match (full match ==)
And again break both loops if a match was found
I mean using find() as one liner is shorter but the same the result
Just one more word about that...
If you actually try to do a bad word list filter then splitting the content by whitespaces isnât a good solution
filter: ass / content: ass bitch
ass match true
filter: ass / content: ass-bitch
ass match false
For that case I would replace ANY non-alphanumeric char in the content by a _ for example and split your content after by _
Then loop through your bad word list as mentioned above and inside through your splitted content array
That will guarantee any possible match
And you could go even further and replace 8 with B, 4 with A etc.
8itch or 4ss wouldnât trigger the list as well
For me, I have a savedata, getdata,deldata commands so I can manipulate data easily
I am using pickle module, so I cant read the data to check the commands are working or not..
I'm more talking about commands in general
A lot of bots just create a bunch of irrelevant commands that aren't important to their bot because it adds more features and ship it out
whats that one cool prebuilt djs command handler that a bunch of people use
^ I used the official discordjs guide struct, easy to understand for beginner and no need to include some other dependancy bloating the project
There's no widely used framework I'm aware of. Most people just stick with the library and write their own handlers.
I had the most success with Klasa but that's crumbled to pieces.
Klasa is deprecated though,
Hello hello
That's what I mean by its crumbled to pieces.
oo
detritus CommandClient 
js, its commando, but its shit
commando is garbage though, but you likely referring to that
im still in the call btw

no i was talking about klasa or akairo
i assumed u were on about Commando
that used to be the big thing for djs's command handling
nah
how to get the developer badge, how many servers do you need? sry ping
Isn't it discontinued?
Time travel đ
my replay encoding api worked!
how to add sequence number in front for player name and id
I want:
1. Aakash - 69
2. Piyush - 68
I have:
Aakash - 69
Piyush - 68
MY code til now:
fivem = FiveM(ip=ip, port=port)
players = await fivem.get_players()
ohh = [f'`. {player.name} - {player.id}`' for player in players]
await ctx.send('\n'.join(ohh))
[... for idx, item in enumerate(items, start=1)], idx will be the thing you're looking for
but where to use it in the code,
You're missing the point. You already got the list comprehension, just make use of enumerate
I did this
ohh = [f'`{enumerate(players, 1)}. {player.name} - {player.id}`' for player in players]
``` and the response is `<enumerate object at 0x000001CA92066500>. devanshtripathi6962 - 29`
`<enumerate object at 0x000001CA92066500>. DIVINE - 20`
how to fix
Look at the code norizon sent and compare it with yours
but i m not getting how to use it
Did you copy-paste someone's code? I assumed you got an understanding of how list comprehension works
Here's another example, ```py
items = ["item1", "item2"]
'\n'.join(f"{idx}. {item}" for idx, item in enumerate(items, start=1))
'1. item1\n2. item2'
ahhh, not copy pasted, but i m learning python now, so come across a lot of problems
I got it, thank you Norizon 
what does the git+ mean in the url here, in package.json file?
anyone know how I can center this shit?
<Flex p={2} display={{base: "none", sm: "flex"}} backgroundColor="blue.800" justifyContent="space-between" alignItems="center">
<Box>
{userData ? <UserData props={userData}/> : <Heading ml={4} color="black">Noobs</Heading>}
</Box>
<Box>
<Button colorScheme="grey">
Home
</Button>
<Button colorScheme="grey">
Lá»ch sá»
</Button>
<Button colorScheme="grey">
ChĂșng tĂŽi
</Button>
</Box>
<Box mr="3rem">
{userData ?
<Button variant="outline" colorScheme="red" onClick={LogOut}>
ThoĂĄt
</Button> :
<Link href="http://localhost:3001/api/auth/discord" _hover={null}>
<Button variant="outline" colorScheme="green">
ÄÄng nháșp
</Button>
</Link>
}
</Box>
</Flex>
const {MessageEmbed} = require("discord.js")
module.exports = {
name: "nowplaying",
aliases: ["np", "song"],
description: "show which song is playing",
async execute(client, message, args){
if(!message.member.voice.channel) return message.channel.send("**You must be in voice channel to use this command**")
const queue = client.distube.getQueue(message)
if (!queue) return message.channel.send(`**There is nothing playing!**`)
const m = new MessageEmbed()
.setTitle("Now Playing !")
.setDescription(`Now Playing: ${queue.songs[0].name}\n\nNext: ${queue.songs[1].name ? "none" : "none"}`)
.setColor("RANDOM")
.setFooter(message.author.username, message.author.displayAvatarURL())
.setTimestamp()
message.channel.send(m)
console.log(queue)
}
}```
I wanna to do like if there 2 song then its name otherwise none
Error: name is not defined
queue.songs[1].name is undefined
use optional chaining, if you are running node 14+
I'm using repl
also what name is undefined?
Song name
you know what you do right? bcs even if the song name is valid it will write none
value ? true : false this is how it works
Hmm I'm first time doing like this
you could try the following:
${queue.songs[1]?.name ? queue.songs[1].name : "none"}
Ok
if it errors out bcs of the ? in the value than you dont have node 14
absolute position ur left and right Boxes
wrong node.js version
like i said only works in V14+
ok I will try
bcs you want to display the name of the song if it exist, otherwise you want to display none
not the center Box, I said
show code
try self center the middle box, and right 0 to right box
Idk what happened, but everytime i use a command it works 2 times
alignSelf="center"?
yes
but keep the position: absolut?
yes. Also add relative to Flex
when I console user.flags
I have this: UserFlags { bitfield: 256 }
but what is it?
use user.flags.toArray()
to convert it to a readable format
wait lemme google it
I think you can't check for it
you can see if the member boosted the server
but not if they own a nitro
oh
which lib u using? djs?
oh sory wrong reply, Im asking Chadoxi
you probably have 2 instances of the bot running
heroku bug I think
because now stopped
possible
When using embed pages i keep getting the error (node:51044) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
var pages = [
Information,
queueplayers,
];
var author = message.author;
message.channel.send(pages[0]).then( async message => {
await message.react('âïž');
await message.react('â¶ïž');
var collector = message.createReactionCollector(
// only collect left and right arrow reactions from the message author
(reaction, user) => ['âïž', 'â¶ïž'].includes(reaction.emoji.name) && user.id === author.id,
// time out after a minute
{ time: 600000 }
)
let currentIndex = 0
collector.on('collect', reaction => {
reaction.users.remove(author.id)
reaction.emoji.name === 'âïž' ? currentIndex -= 1 : currentIndex += 1;
if (currentIndex < 0) {
currentIndex += 1;
}
if (currentIndex + 1 > pages.length) {
currentIndex -= 1;
}
// edit message with new embed
message.edit(pages[currentIndex]);
```
literally
it is says
MISSING PERMISSIONS
...
check if the bot has permission to react emojis
or just simple give the bot ADMINISTRATOR
@rocky hearth stackoverflow is tha best bro
we forgot the right and left attribute
we have to make it to 0
lmaoo
I didnt edited it right now
left 0 is not necessary I think, for left box
ah yeah
nope you need it
either it will appers in center
cause you have to justifContnet to center
ooh, yeah. đ
not space-between
Can I put the customized status of my discord account with my bot?
no
manage messages permission is needed to remove reactions from others
Probably.
check these out
https://pastebin.com/doc_api
https://pastebin.com/doc_scraping_api
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.
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.
thx
BTW were anyone else having problem logging in with Discord's api yesterday ?
I thought it was just me so I regenerated my token 5 times last night
How would I collect a response using a collector?
Like, if they type a response like so:
x/bug
---
Q: What bug have you found?
A: *says ab the bug*
How would I collect the Answer to then put it in a final embed?
in discord.js ?
try using .awaitMessages
Yeah djs, I just want it to show like after they answer the question, it per say, logs the question in the final embed.
Like
const filter = m => m.content.startsWith('a:');
message.channel.send("What bug have you found?").then(() => {
message.channel.awaitMessages(filter, { max: 1, time: 10000, errors: ['time'] })
.then(collected => {
message.channel.send(`${collected.first().author} thanks for reporting the bug`)
}).catch(collected => {
message.channel.send('I can't wait any longer, bye');
});
});
not spoonfeeding btw
this is from the docs
(almost)
@earnest phoenix
heya, I am trying to remove an Object from an Array with Mongoose but havent been able to do so
My current code:
await tickets.updateOne({ Guild: message.guild.id }, {
$pull: {
Info: [{
Message: args[0]
}]
}
});```
What the data looks like:
```json
Guild: "848841943021518848"
Info:
0:
Category: "848841943021518849"
Channel: "848841943021518851"
Role: "849339697431576627"
Message: "850307111170474026"```
hm, well, what I wanted was multiple questions @near stratus , such as the bot asks questions and the user answers them, then at the end the bot will say: Any other information if no, the bot will send a embed with the Questions and Answers.
your path is wrong
info.$.message:
ah, thanks, dont know how i didn't see that
You can make a collector instead
im deciding a layout for my website
is this good?
(and no it doesnt have to be mobile friendly)
/----------------------------------\
| navbar |
\----------------------------------/
/---\ /----------------------------\
| | | main |
| m | | shit |
| e | \----------------------------/
| n | /----------------------------\
| u | | other |
| | | shit |
\---/ \----------------------------/
/----------------------------------\
| footer |
\----------------------------------/
What kind of site are you making?
a visual slash command generator
For a tag bot other then author, description and title what else would I need to store? đ€
?????
on a database?
What is confusing
that should be fine
I know, I am asking how to collect the responses.
With a collector....
The end event gives you a collection with all the collected messages
hello, i am having trouble with switching servers and currently with the code, it says, "App is not defined" but i dont think any app is not defined. Here is the code,
https://hastebin.com/ajiyogoqek.typescript
st!
well, it isn't
Just define app ezpz
wdym
am i missing that app?
oh so i need to define app like this?
const app = require("app")
///or
let app = require("app")
đ€·
your code
however
if you're asking me whether you should use const or let
use const because it doesn't need to change its value or type
also, in general, what are you doing
you haven't used app at all
only for starting the server
heroku and github to repl.it and uptime robot
and thats exactly the same code you had before ?
not exactly, i had to add somethings
it seems like you removed some things tho
or did you add the app part?
did you copy the app code from somewhere?
no i made it all
yes there is app
but now its saying core.require is not a function
ITS NOT EVEN IN MY CODE
if you made it all, then you should know how the app part works, but its missing things in your code
thats why im asking, where did you get this app code from, or where did you learn it from
so i can show you whats missing
Try to fix it
I don't know how
we can try helping you fix it, but we wont give you code
i made it! It is a banking bot, idk if repl.it has different code things
here is my code
i just need to know why this is happening
i had no errors on vsc
your app part is still very wrong
hence i'll keep asking, where did you learn how to do the app part
What is wrong with the app?
it says app was not defined so i defined it
looks fine to me
you defined it very wrong, exactly how a person who has no idea what hes doing would do
thats why im asking
the app variable is being used as an http router, similarly to how express.js apps do. there is no app package
it has to come from express or similar
which is nowhere to be found
very modern
Indeed
lmao
I don't recommend using it
and still using it wrong
but it exists
hence he has no idea what hes doing
yeah, use express and have a look at their guides
he probably did copy the code from an express tutorial or something, but removed the dependency part
Sounds about right tbh
and is refusing to tell us where he got the code from so we can explain whats missing
I mean at this point he just needs to sit down and read a javascript book or tutorial
:^)
Shhh
Don't be rude :^)
Comparing even his skill level to yandere dev is an insult
no, what i did was made all the code, then looked up on yt how to made ur bot online forever, copied the starting then put my coonsts
wrong code
Its the code you sent tho
show us which youtube video
ok
Note: If you're new on my channel and wondering what is server.js here 0:07
Watching these two videos in order-:
https://www.youtube.com/watch?v=k5BspQ9Czek&t=297s
https://www.youtube.com/watch?v=IKg7tX5MeWc&t=75s
yall new year's gift
In this video you will learn how to make your Discord Bot online forever (24/7)
Need help with something? J...
oh boy
so it is using express
you have no express in your code
notice how your code does not have this part at all
boy oh boy, how does a video like this have >50k clicks... I should become a youtuber đ
If you want the most efficient way to keep your bot online then buy a vps and use pm2
kids thinking they can create the next rythm, mee6 and dyno all in one and earn bank
with free hosting obviously
yeah VPS way too expensive đ
No its not
Honestly yeah
it was sarcasm
fair enough đ yes it was sarcasm indeed^^
you could use forever
just use screen/tmux with a cron job
but pm2 is better
i said wrong code
Using a screen can get complicated if you don't know how it works
brb
İf you use node thats easier
then whats the right code?
we cant help you at all if you give us the wrong code lol
which is why pm2 is preferred
pm2 isn't even that bad...
Idk what you mean by bloated
it doesn't effect anything really
all it does is run your project
lmfao
it runs on node
I never heard pm2 was bloated either... But I'm happy to learn, do you have some kind of source for that? đ
Yes it does
you have to install the logrotate module for pm2 or you wonder why you run out of disk space after a week
which obviously costs wayyyyyy more resources than a simple cpp app
What
You legit just run the main file with it
it doesn't effect much of anything.
And the resources it takes is very few
node got a fairly large overhead
I haven't had any issue with resources
like 30mb ram alone for node itself
what superbrain is talking about
I don't even go over like 100mb using my project at a time
yeah but its 30mb for the entire pm2 process, not 30mb per app running
^
still 30mb you cant use for something else
What are you going to use 30mb on
Idk, i guess that's up to preference, I'm happy to "pay" 30mb of ram for easier process management, but if you don't that's fair too
caching stuff
if you're working on an 100mb ram server then yeah dont use pm2
there are plenty of "discord bot hosting" out there that give you 100mb
Seems pointless
the biggest issue is partially js itself, any compiled language can outperform it easly
we should all go back to machine code đ
but the downsite is that most compiled languages are a bit harder to get the hang on than js or py
JS was originally made for the browser
these days its not even js anymore, its v8 that does everything
Until Nodejs came along and brought in a bunch of new stuff on it
so people should really be comparing v8 to other langs
ok
v8 vs py
im back
I prefer TS over normal JS anyway
TS is a nightmare
it is just by far better
so i fixed a couple things i saw wrong (im dumb) and now got rid of most errors
TBone, your new code is different, but the issues Tim described are still exactly the same
i'll always use js//node for UI related stuff (desktop apps, frontend websites, etc)
but other than that
it falls flat in performance
Type safety, decorators, generics, error catching for most situations before run time and a lot of other stuff
sorry didnt mean to ping
js is really good frontend, but if you want performance get a backend that is not js or py
node 16 is almost as fast as java
theres little reason these days to complain about js performance anymore
I don't like how java syntax is
yeah node has improved alot and still does
It is clunky
if js would be able to easy multithread stuff it would be really good
sure there are worker threads but this is some weird middle way
can java even easily multithread shit
JS's performance is almost equivalent to C++, it has improved a lot
doubt it
If java could multithread shit easily
wtf
why are you still doing the wrong thing?
even after i showed you what was wrong
...
I wouldn't say its performance its almost equivalent to c++, but it's definetly catching up
Idk man
its partially down to poor code and optimization.
install the fabric loader and some of the optimisation mods and it will be fine
also
its not really that close to c++
dude... stop...
you're doing everything wrong
Poor Tim
I mean yea, ever heard of Minestom?
so do i or do i NOT need app thats ALL
Cut em loose with the "Learn js"
look at the video you sent again
ok
app is the definition of express()
well someone told me that im not using express anywhere in the code so it was pointless
They stated they copied that part
you are using express's app to clearly you are using express
The rest is apparently theirs
if you remove express, then remove app as well
gotta define app ÂŻ_(ă)_/ÂŻ
What is the point of using express to keep your bot alive
and core.require is not something you install
uptime robot
don't you have to run the express app forever as well?
repl with uptimerobot
(which is against their tos)
if(undefined) define()
isn't doing that against repl tos
it's not
I swore it was
glitch forbid it, replit didnt
add some arrows in there and you got yourself a functional language
ah
shiv you should make a language off of py
$myvariable = isbetter()->than->yours;
Oh God forbid I implement a language in Python
:^)
Interpreted language in an interpreted language
oof
shipy
oooo shipy
ezpz
Do it no balls
omfg im gonna punch that person, the bot just came online because of express, the person who told me i dont need express im gonna KILL!
I'm pretty sure you were told that not using express was the problem...
I will take that as a no to knowing Minestom
why are you blaming other people for your incompetence lol
?
heard of it a while ago, but didnt really looked into it
Its cool
If you like java i'd look into it
and I mean you gotta really like java
:^)
It is a MC server that introduces multi threading but theres a catch
nah I'm lazy
You gotta program everything yourself
Sadge
mc is so tricky because the entirety of the code is trash built on top of more trash
No
it wasn't made with multithreading in mind
They pretty much said fuck mc but ima make a server for it
still though
but thing is you gotta program all the functionality yourself
They give you an inventory system and thats it iirc
you still have to send packets sequentially though ig
Yea
wich feature can be added with a premium version?
don't make a premium version of your bot
because I have no idea
how can I pay the host?
your own funding
Only make premium when you get enough members and the cost of your vps is getting too high
this
nobody will buy premium on your bot because your bot isn't popular and it isn't anything new or special
Never prematurely introduce premium
or use some fair monetisation model, locking stuff behind paywalls will kill your bot
if you really want donations, promote your kofi
I'm just asking đŠ
or somthing in that context
what is a kofi?
Prematurely introducing premium shit will kill your bot off and make it unpopular
kofi is a way to accept donations for creators.
and apparently no fees
I might sign up for it
It gets put into your paypal iirc
i mean
there's only really a conversion fee and a provision fee
and the provision fee has a limit
đ€·ââïž
the people that I know will never pay anything for a discord bot
get a cheap VPS and earn money other ways
add ads đ
do commission work, freelance etc.
most countries allow you to also start working from 15/16
the way to load a discord bot on a vps is the same for everyone?
i don't understand what you mean by that
I'm 21, Monday I'll start doing the waiter lol
you can also find contracts for temp jobs
i had a contract with a software company in my town as a temp job
20hr a week
I saw some video about uploading a discord bot on vps, idk how to explain myself, but upload the bot is the same for every comapny?
where u live?
I live in Italy
but yes, the gist of it is the same
here u have to do the university for not getting exploited
and I hate this
because I love coding, but idk why I'm obliged to do something
like exams in how a computer is made, yes, is very interesting, but it's a trash cours
bcs in coding they teach you how to do sums
what are those buttons? :o
they added buttons to interactions
is there any documentation to it already?
depends on the library you're using
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
That was supposed to be a reference for you to make your own
I wasn't gonna spoonfeed you the whole code. That'd be hella weird. You should be able to do what you want with the code I've given
Yeah, it worked, thanks.
b r u h
Not that specific code lmao.
But the general concept of what you were explaining.
https://github.com/discordjs/discord.js/pull/5692
what are these supposed to be? dropdowns?
mhm
DiscordAPIError: 405: Method Not AllowedWhat is this?
The request method you sent is not supported by the server
I've seen people do somethnig like bot.ok.sheesh.whatever.. idk, some function they created, is that possible?
Do I do something like ```js
bot.hi = () => { console.log("Oof") };
that does create a function yes
You can as much properties to your client/bot var as you want.
Make sure to not overwrite existing ones by choosing an already existign property name.
I add those functions to my index.js, right?
You can add them anywhere as long as you pass the client/bot var, too
Creating a new client in any other file for example will of course not store the property
It's the same like creating a whole new var.
I had just created a npm account and trying to publish a package with yarn.
which is giving me this error
do I hv to wait, 1day, before publishing?
anyone got any idea what this is? https://elele.team/upload/EtgMyQ.png
not seen it before, just randomly started
your lib is outdated. thats likely permission regarding staging channels REQUEST_TO_SPEAK
ahh right oke
that was the last implemented permission flag that i recall
I updated it, still getting same 
this channel = dead
Can I use Slash commands in a non verified bot?
Because I can't make mine work
Hello, so i have a synax error (i think thats how u say it) with logging in to the bot. The error says its an unexpected end of input and this is what i put
client.login(process.env.token)
i made a secret because im using repl.it and the value was my bot token the name was token. i was making a purge/clear command.
posting the error wou;d be really appreciated
*of py devs only
tru
to update a readme for a package on npm, do I hv to publish a new version?
or can i jusst update the readme file?
new version
hmm, y though. That's not good imo
That's how commits work
The same goes for versioning
Once you commit, consider it sealed and immutable
So if you want to release a new version, just bump the minor or patch version
If you could, it would compromise the integrity of a commit. Even something as harmless as a plain text file
I want make logs
why is this showing as a syntax error?
oh wait
nvm
how can i make it so that only people with specific permissions can run a command?
python btw
detect if the user has the permissions and only run the command if they have it
yeah but how, im new to coding
i dont know python
Check the user's roles, their should be something in DiscordMember that allows you to get their roles.
ok
Also use google/read the docs.
ok
I dont know python, but all wrappers seem to follow the same layout.
true
how do you set the icon of the website (the little globe) i forgot how 2 do that
serve a favicon.png
ic
The HTML element specifies relationships between the current document and an external resource. This element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
read a bit down
there's a sample for a favicon
i found the thing i needed
Use the commands.has_permissions decorator
No spaces and wtf are those indents
commands.has_permissions not commands. has_permissions
ok
member typehint is discord.Member not discord.member
Dedent your keep_alive function
os.getenv("TOKEN") returned None
i forgot to add the token 
Kekw
ok
i'm not too big on typescript so is there a way to import a typescript definition file in jsdoc?
Ik I'm an idiot 
switch to typescript and save yourself the headache
import('library') should work in jsdoc tho
^
for djs, in what cases, message.member would be null?
DMs
One message removed from a suspended account.
Code : https://srcb.in/8EbEWDKv4o
member intent not enabled (iirc)
hmm, ok thanks
One message removed from a suspended account.
@lavish bramble
Square up bottom bitch you are about to receive violent headpats
One message removed from a suspended account.
One message removed from a suspended account.
How can I fix this
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you are trying to change const variable
oh nvm thats prince's question
how to use owo?
how do i make these allign (the headers)
import owo from owo
owo.owo(text).then(OwO => {
console.owo(OwO)
}).catch(console.owo)
align where ?
left/right/center ?
use text-align I guess
owo
i want 'Social Media' to align with 'Contact Emails'
so basically the S and C are in the same position
aka center
well tbh idk if its considered center
nvm probably is
what are the current styles for Social Media ?
nvm
for reactioncollector, when dispose event is fired?
You want to align them at center but the left must be same ?
<div class="container">
<div class="section-heading">```
i want
the words to move over there
so like the C and S are in the same place
also what are the cause of these lines? i dont see anything that cause them
create another div inside the container (which will hold section-heading) and then put text-align: left;
If that doesn't work no need to ping me. I wish someone else will help. (I'm going to sleep now good night)
alr
if anyone can answer this ^
I Fixed the socialmedia and contact thing i just needed <div class="row">
but how do i remove those annoying lines??
nd why do i have so many of them
đ©
whats the diiferents between a api and a fetch data .json file
like are they the same thing?? because they do have the same perpose (some of them tho)
api is a remote endpoint that do/return something
fetching data from a json is just a simple local file access
for example, I have a reaction api, I can call it anytime I want to get a random reaction gif
while this could be possible using a json file, I would be constrained by where I am accessing from
what if the .json file updates itself
a json file is just a normal text file
it can't do anything on itself besides being there
ive tried removing a lot of thestuffbut nothing works i think its probs the css but đ©
@lyric mountain https://rebane2001.com/queuepeek/data.json
that's because it returns json as a file instead of a request body
but in both cases it ain't a json that updates itself, it's a content returned by the server itself
for example, https://api.shirojbot.site/reaction?type=pat
the value gets changed everytime you hit refresh
to keep it simple:
- if it's data returned by a remote server = it's an API endpoint
- if it's an static file somewhere in your own machine = it's a JSON file
former can be dynamic, latter can't
in what cases client.user would be null?
imo, it shouldn't be, coz the client should always be in the cache
whenever i use the <p> element, i get a little line under this. any ideas why? im thinking its probs from the css
client.user will ofc be null
hmm k
how can i make this work
i have a good feeling you don't know how to write discord.py
whatâs python anyway
I'm new to coding, but I want it to send an embed, saying User banned after it bans them
You didnât even close off the thing


