#development
1 messages Β· Page 1697 of 1
cuz there are not much server it joined
but nvm that's not the big problem i have right now
i have to rethink my code structure again

it's having circular imports haha
how do you change a channel's position in discord.py
when you delete your own message, there is no audit log
so if you fetch the most recent audit log like you are doing, it will be the audit log for the wrong thing
await channel.move(message.channel.position)
AttributeError: 'TextChannel' object has no attribute 'move'
can someone help
Does anyone know much about discord receiving audio because i know discord doesn't support it but the library does, but it always breaks when audio packets are received from web discord clients, not program or app, if anyone knows how i could make it accept both that would be great
Are you using Python or TS
python
For specific positions you wanna use edit instead of move.
await channel.edit(position=1)
Guys do u know how i can get the "general/default" channel of a guild with discord.py?
Like when you invite a bot and it says "thanks for inviting me"...
how does the bot get the welcome channel?
and is there a solution for this ??
no there is not
the solution is check the message id of the audit log
if the message id is not correct, then there is no audit log for the message
and if there is no audit log for the message, it means it was not deleted by someone else
damnit
I just spent ages trying to get zlib stream compression to work on discord api
it kept throwing data errror
turned out I was applying zlib compression at the websocket layer rather than at the json layer
smh
rip
still had the 00 00 FF FF on the end of the frame so was detected as a compressed frame, but had the websocket header uncompressed on the start lol
where did that happen ?
oh now i see
you wrote ur own api manager @green kestrel
?
and other solutions that are not audit logs
oh hiiii @green kestrel
you da boi who wrote on my PR on top.gg/docs
I have several questions for you then
TypeError: this.isServerAdmin is not a function js /** * Passthrough method to check if user is server admin * @param {Member} member Guild member object * @param {Channel} channel Channel object * @returns {Boolean} */ isServerAdmin(member, channel) { return this.client.permissions.isServerAdmin(member, channel); }
im handling permissions by extending base, and isServerAdmin is in base
that would work, if it wasnt looking for admins inside of the config file, the database and server
ok
await bot.change_presence(status=discord.Status.idle, activity=game) why does the bot still show as online
and not idle
handlePermissions(context, args) {
return this.permissions ? Permissions.handle(context, this.permissions, args) : true
}``` handling like this?
Try #commands maybe
does a docker do the same thing as PM2
no, pm2 just manages processes
docker creates fully self-contained machine environments which is sandboxed
and docker is pog
oh i should read more about dockers then
shit I can't even imagine any discord lib requiring the use of docker. That would filter out so many noobs
not really
I'm using model.watch to receive insert, update, delete operation events from MongoDB. Mongodb some times returns something like tags.3: { name: 'a tag' }. I want to parse it and convert it into: tags: [..., ..., { name: 'a tag' }]. I have been assigning the updated fields to a cloned a object and using new model(cloned_object). But mongoose has issues with it, some times it adds the value and some times it doesn't. Is there any other way to parse something like that? Without writing a custom parser?
Docker is for containerizing which is more about security and distribution than it is about process management
oh alrightys thanks π
So if I get, say, a docker image for PostgreSQL, I know it's gonna be self-contained and it can't access anything outside the docker container - so even if I make a mistake and let SQL injection through someone can't just go ahead and format my drive, because the "code" runs inside the container.
aha i get it
And if I make a service and I want to distribute it real quickly and easily I can just create a docker image and share it, even if it depends on other docker images or custom code
I assume youβd use volumes for databases though
instead of just running a container
Probably but I was trying to explain it in simpler terms for beginners ^_^

channel.overwritePermissions([{
id: message.guild.id,
deny: ['VIEW_CHANNEL'],
}, {
id: message.author.id,
allow: ['VIEW_CHANNEL'],
}, {
id: "183978195551387649",
allow: ['VIEW_CHANNEL'],
}, {
id: "259776081316282368",
allow: ['VIEW_CHANNEL'],
}]);
TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
I have no clue wwhich one is not a snowflake
no it is
well they're all valid then
what about 259776081316282368
thatsc my id
I think
it's the message.guild.id
cuz it doesn't change anything
is that possible?
I'm 90% certain that would just be the everyone role
aka "no one can see this by default"
it should
i think you actually have to make a GuildMember object or a role object
not just a string with the id
Ok so I put in the guildid manually
the code looks perfect
and now it worked
well that's weird
it is the message.guild.id
were you on the right guild? 
yes
how do you define run?
uhhh const run = 'something'; ?
facts
It says error bad request
send code
'use strict';
const Base = requireReload(require)('./Base');
/**
* @class Permission
* @extends Base
*/
class Permission extends Base {``` this would extend base correctly?
hereee'
Hey guys
4|index | MongoError: E11000 duplicate key error collection: Cluster0.api keys index: password_1 dup key: { password: "yes" }
4|index | at Function.create (/var/www/oauth/node_modules/mongodb/lib/core/error.js:57:12)
4|index | at toError (/var/www/oauth/node_modules/mongodb/lib/utils.js:123:22)
4|index | at /var/www/oauth/node_modules/mongodb/lib/operations/common_functions.js:258:39
4|index | at handler (/var/www/oauth/node_modules/mongodb/lib/core/sdam/topology.js:944:24)
4|index | at /var/www/oauth/node_modules/mongodb/lib/cmap/connection_pool.js:350:13
4|index | at handleOperationResult (/var/www/oauth/node_modules/mongodb/lib/core/sdam/server.js:558:5)
4|index | at MessageStream.messageHandler (/var/www/oauth/node_modules/mongodb/lib/cmap/connection.js:277:5)
4|index | at MessageStream.emit (events.js:315:20)
4|index | at processIncomingData (/var/www/oauth/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
4|index | at MessageStream._write (/var/www/oauth/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
4|index | at writeOrBuffer (internal/streams/writable.js:358:12)
4|index | at MessageStream.Writable.write (internal/streams/writable.js:303:10)
4|index | at TLSSocket.ondata (internal/streams/readable.js:719:22)
4|index | at TLSSocket.emit (events.js:315:20)
4|index | at addChunk (internal/streams/readable.js:309:12)
4|index | at readableAddChunk (internal/streams/readable.js:284:9) {
4|index | driver: true,
4|index | index: 0,
4|index | code: 11000,
4|index | keyPattern: { password: 1 },
4|index | keyValue: { password: 'yes' }
4|index | }
Problem is, I want to use same Collection in 2 different NodeJS products
:C
you have duplicated keys, make sure you enforce that keys are unique
which keys?
password_1
password_1 dup key: { password: "yes" }
password is duplicate
but I want to only keep one record with all the api keys
:C
if someone doesnt have a nickname what does display_name return
then design it in a way that you have unique keys
can you elaborate?
you store all keys in a array inside the document right?
This
yep
why not making documents for each api-key?
well you could still save it,
how?
make a schema for having a document for each API-key. then write a little migration script to get the API key out of the array and inside its own document
I can do first part
then you just have to fix the rest of your code to use the new structure
second is a bit tricky
ive wrote myself a script to migrate from mysql to MongoDB, and transfered almost 200 Datasets over, so you will manage to do it with 50
one way or a for in loop
for loop is better
yes
if(answer1.first().content.toLowerCase() === "buying") {
type = "buying"
}
else if(answer1.first().content.toLowerCase() === "selling") {
type = "selling"
}
i wanna set type
but then i cant use it at the end
where did you define type?
type is defined as ""
outside of this?
yep
did you tried to return the value? or use promises?
i mean i just want to set it as either
but the issue is
if(answer1.first().content.toLowerCase() === "buying") {
type = "buying"
}
else if(answer1.first().content.toLowerCase() === "selling") {
type = "selling"
}```
with this, i cant get type at the bottom
because its in that snippet only
it returns undefined or " "?
undefined
i would wrap this stuff then inside a promise, bcs the code runs further without waiting for the type to be assigned
I haven't used the module you're using but it seems to me you've already sent off your get request with .get() and the .query() after it will do nothing at that point
wrap it inside a promise
you can literally use await in a for loop if it's in an async function
like for..in and for...of and for...i loops. - NOT forEach
how do I catch an error?
Wrap it in a try catch block
try/catch or .catch on a promise
so what should i do to make it work?
Should this work?
Probably query first before the get
try (error) {
message.channel.send(`Bro I just got an error! \n **Error: ${e}**`)
}``` how
already.length*
?
try{
message.channel.send("lets catch an error")
}catch(error){console.log(error)}
```this will catch the error resulting from not being able to send the message
this is only an example, since send() returns a promise you can also do send().catch(error=>console.log(error))
o... interesting.
is already the Array?
it will not because you're not awaiting it
its just an example to show him how try/catch blocks work, roughtly
I mean yeah but that example literally will not work 
you cant spoonfeed if the code doesnt work
your spoonfed code example is wrong dawg wdym
well they will still have to use braincells to find the error
so copy/paste wont work
make sure to force unique keys, or you get this error again if you have for some reason duplicated keys.
why even bother sending the example then, it's more misleading than anything
@steep drum did that didnt work
its not entirely miss leading, it just needs to run async
@lusty quest @woeful pike can u guys help with this?
also just out of my head i wanted some simple stuff to tell him how it works, and i think he understood what i ment
intellij just got built-in html preview
you get rejected by whatever you call
bad request = read docs to find proper request params
yeah i got that
did you need to send some sort of authentification header?
Again, I don't know the module you're using, you need to set your query parameters before sending the get request
it'd be unauthorized if that was the case
i used APIs that just returned 400 or 404 when you didnt authenticated
where a pain in the ass to figure out whats wrong
bad request is specifically related to not enough params/headers or wrong data types
that's awful
but returning 404 is kinda clever
The api they're using doesn't need an authentication header
like, you can't force-access a service if you don't know there's a service
what do they require for headers?
i'll check the docs
Standard get, they're just not setting the query parameters before sending it off
just send the user object
someone else
send(`${user}`)```
that didnt send the message
like my ping
for example someone runs a command
and the command then pings ME
just do send(user)
also works
in this case the way you wanted to use work, if you want that the bot Pings you all the time. if you want to ping the author just send the member object
anyone here knows spanish?
better than sending user objects because they depend on the library's toString() behavior
which you never know
he said he uses d.js
yes but you never know
true
true
@lusty quest solved that error now got another one xd
wasnt it changed from v11 to v12 or something?
nop
one of the params was wrong
yeah
im using that currently
i remember at some point concatenating a user object would give you something else instead of the mention
after the stage update
@lyric mountain Thanks!! one parameter was wrong! a small typo
it works now!!
MessageEmbed { is being logged without anywhere logging it?
maybe it's logged in another file? That only searches the one you're viewing
fixed thx
it doesnt work..
you can't mention on footer, author or title
nor use emote
why
yeah sure! fire em at me! π
actually, the rule is: if you gotta type <something> it wont work
yeah im making my own lib... heres some of the docs: https://dpp.brainbox.cc
so I have been trying to create a slash command, after many debugging, there was an error saying "404 Not Found"
client.on("ready", () => {
client.api.applications(client.user.id).guilds("514197172250476548").commands.post({
data: {
name: "",
description: "",
options: [
{
name: "amount",
description: "",
type: 4,
required: true
}
]
}
});
})
client.ws.on("INTERACTION_CREATE", async interaction => {
const command = interaction.data.name.toLowerCase();
const args = interaction.data.options;
if (command == '') {
const description = args.find(arg => arg.name.toLowerCase() == "").value;
const Embed = new Discord.MessageEmbed()
client.api.interaction(interaction.id, interaction.token).callback.post({
data: {
type: 4,
data: {
content: await createAPIMessage(interaction, Embed)
}
}
});
}
})
async function createAPIMessage(interaction, content) {
const apiMessage = await Discord.APIMessage.create(client.channels.resolve(interaction.channel_id), content)
.resolveData()
.resolveFiles()
return { ...apiMessage.data, files: apiMessage.files };
}```
and the thing i should do is...check the server ID
its valid. server ID is in place and valid
const discord = require('discord.js')
module.exports = {
name: 'quiz',
run: async (message, args) => {
const quiz = require('./quiz.json');
const item = quiz[Math.floor(Math.random() * quiz.length)];
const filter = response => {
return item.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
};
Do I add
`${collected.first().author}`
To the embed cause I want to make it embed
p.s. ping me if you have a solution
how can I get access to a user's private email address
oauth2
then you cant
request email?
not enough info
or maybe I can do Google Oauth
what is "collected"? where are you putting that last line?
that works too
ight
sus
||also suckers discord disabled my account (im appealing...) so i used my moms phone to verify||
shhhhh
π€«
i understand
I wanted to make a command to delete msgs for a single user. is it possible
i have been trying
await user.message.purge(limit=amount)
and also
await ctx.user.channel.purge(limit=amount)
but none worked, any idea
isnt it channel.purge?
no no msg of only one single user
idk have u checked the docs
could not find for a single user
lemme try
I'm pretty sure you can't do that
This is just loop
not very efficient but maybe theres no other way
await channel.purge(limit=amount, check=lambda message: message.author == ctx.author)
this would be better ^^
hm
in js we dont have a lamboda (callback), we just gotta fetch the messages, filter, then pass back to bulkdelete
delyeet
discord.js
I'm pretty sure discord.py just loops over the user's cached messages and deletes them
it doesn't loop through you can specify the messages IDs to delete*
guys my bot have much ping what should i buy a vds (my vds is free) or vps?
Thank you for the help broo @silk wadi just onr more thing in that code from stackoverflow whta does this mean
break```
can anyone help?
u hosting the bot where??
sweplox
try heroku i m hosting there and i m getting very quick responces (fast as F boi π )
can send site link from DM?
tbh i dont really know xD
i will send you a vid link that will explain how to host, but the free hosting only gives us 550 hrs thats 23 days, for the rest 7 days of month make a second acc on that same hosting, easy cheating... ππ
check i DMed
k
if the size of the array is equal to the limit, exit the loop
send :D
ohhh thanks sir...
was about to say that.
how would i make it so it checks for either and not both conditions
if(answer4.first().content.toLowerCase() !== "buying" || !== "selling") {```
() => {}
just use an or
they're both lambdas
yes thats a callback, but we dont have that in the bulkdelete discord.js
same diffrence
a callback can be any function you want
you should've specified that you were talking about the callback in the bulkdelete method
cuz just saying "js doesn't have lambdas" could lead to a long conversation with some person whose name I won't mention
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=bulkDelete
our best bet is to fetch, filter, then pass in an array of mgs
repeat twice
if(answer1.first().content.toLowerCase() !== "buying" || answer1.first().content.toLowerCase() !== "selling") {
return message.author.send("Prompt cancelled!")
}```
that
that's always true
omg
o
because you're using !==
if it's not buying it will be selling so the first will be true, if it's not selling it will be buying so the second will be true
if any of those it's true the if statement will execute
also transforming the content twice
this is what leads to memory issues and performance drops
that's basic logic
just change the or to and
o yeah
assuming what you're trying to check is that the input is one of those two options
lemme tell you a secret:
public static boolean equalsAny(String string, String... compareWith) {
for (String s : compareWith) {
if (string.equalsIgnoreCase(s)) return true;
}
return false;
}
ik it's java
but it's 101% handy to have something like that
then instead of, say:
if (someVar === "abc" || someVar === "def" || someVar" === "ghi")
you just do:
if (equalsAny(someVar, "abc", "def", "ghi"))
if ([var1, var2, var3].includes("word"));
Alright i learned a bit and finally made the bot online, can someone give me a small javascript with the command "ping"? i want it as embed and would like someone from here rather than picking from random dudes at the internet
Feeling gud
console.log("ping")
that'll show "ping"
I mean a response

like
Human: k!ping
Bot: Pong! (if possible i would like to show ms too)
im gonna start giving obfuscated code snippets whenever someone asks to be spoonfed
console.log("Human: k!ping\nBot: Pong! (if possible i would like to show ms too)")

is it possible to check for a number for part of a content
e.g: i say 5 USD, it checks if it includes a number or not

oh yeah i can check like that
call Number on every element and see if it returns a number or NaN
they just want you to figure out the ping command yourself
yeah just noticed lol
i mean, like other bots do
you say !ping and then they answers with the ping and ms
we want you to at least try to attempt it first
just isNaN(number) instead

instead of isNaN(Number(number))
gonna give u a tip: ping = current time - starting time
or console.time()
nvm im too lazy to explain and it's a pain on my phone
Now ill go have an headache trying to discover how to make it lol
aight ill try that too
Bai
Oh wait i'm not over yet
About the commands
i do them as a different file or add them to the main file?

diff files
Oh nice ty
the discordjs tutorial goes over all this
don't clutter your index file for the sake of your sanity
ideally you would create a command handler system that has different files, that way you can dynamically alter your things
Discord + Chrome in my pc means death
like https://discord.com
({ data: { name, color: hexCode, hoist }})``` how do i make hoist? if hoist is a boolean?
i want an electron alternative that doesnt run on chromium :(
hm?
cross platform support sucks ass though
last time i used react-native-windows it was horrid
wdym
what is "collected"? where are you putting that last line?
you only gave two meaningless fragments, can't help much with only that
....
in the embed at the. addField section
Aight i'm having a problem with the tutorial lol, can someone fix this? It answers if i saw k!prune 1, saying that i have to choose between 2 and 100, but if i do it right as "k!prune 2" it don't delete the messages
code below totally not copied from the tutorial π
else if (command === 'prune') {
const amount = parseInt(args[0]);
if (isNaN(amount)) {
return message.reply('that doesn\'t seem to be a valid number.');
}
if (isNaN(amount)) {
return message.reply('that doesn\'t seem to be a valid number.');
} else if (amount < 2 || amount > 100) {
return message.reply('you need to input a number between 2 and 100.');
message.channel.bulkDelete(amount, true);
}

first of all you can remove the first if as its duplicate
the way you have it set, if its out of range it will error then delete, and if its in range it wont do anything
you have the code running alongside the error
put the bulkdelete in a else at the end of that if
np
ah srry by bothering
nono its fine
but when i make the files with commands thing
also, it doesn't matter but the delete doesn't run because you're returning first
i can make them in a folder or inside of the index.js folder?

i dont see a return in there
Any recommended one?
but thats on the error
so its fine
its in the if
Erm well, my pc actually dont want me to install more thing on it
I mean this, beware
I wonder how you even plan to code without space
also, I hope you're not using SSD
else you're RIP'ed
i'm just saying, ignoring that the logic is incorrect, you shouldn't have code after a return
hd
28 GB HDD?
ah vtnc
i use eslint, the one mentioned in the tutorial
else if (command === 'prune') {
const amount = parseInt(args[0]);
if (isNaN(amount)) { //duplicate
return message.reply('that doesn't seem to be a valid number.');
}
if (isNaN(amount)) { //fine
return message.reply('that doesn't seem to be a valid number.');
} else if (amount < 2 || amount > 100) { //only happens when out of range
return message.reply('you need to input a number between 2 and 100.'); //fine
message.channel.bulkDelete(amount, true);//put in an else so it only happens when in range
}``` @neat beacon @steep drum
I am a little noob in nodejs, but i want to make this a async fucntion
https.createServer(options, function (req, res) {})
where should i put "async"
Ok so i replace the current one with that?

https.createServer(options, async (req, res) => {
//code
})```
remove the function word?
AnΒ async functionΒ is a function declared with theΒ async keyword, andΒ the await keyword is permitted within them.Β The async and await keywordsΒ enableΒ asynchronous, promise-based behavior to be written in a cleanerΒ style,Β avoidingΒ the need to explicitly configure promiseΒ chains.
ok
you dont need the function word, its instead do those like js (input) => {code}
the => indicates a function
its literally doing the same thing
hes defining a function and putting it in as a variable
aka arrow function
ignore the folder name just throwed the project in a random folder
what is line 58
well, lambdas are slightly different from plain functions
"this" for example
but they do the same thing
oh use " instead of '
when you did the contraction it thought it was completing your string
ah i see
also remove the first if
and put the bulkdelete in a else {} at the end
when wont it do the same thing hm?
no?
functions dont have those either.
they do
prove it
https://medium.com/frontend-quest/arrow-functions-vs-functions-9048ec12b5c6
https://levelup.gitconnected.com/arrow-function-vs-regular-function-in-javascript-b6337fb87032
https://dmitripavlutin.com/differences-between-arrow-and-regular-functions/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
Classes before ES6:
if you want I can get more sources
Does anyone know how to get the first emoji stated in a message? I know theres like message.mentions.user.first() and stuff, I tried that with emoji and (obviously?) it didnt work.. Thanks (Discord js)
you know what i dont give a fuck
your right
you win
happy?
yes, very

you wanted me to prove it, so I did
i admit i was wrong about the this
custom emojis or normal emojis?
but they obviously arent at a level to know the diffrence
thank ya
custom ones
Would that thing work with it?
yeah ik, but who knows whether they're using or not those stuff
thx
iirc it happened once here, don't recall the context tho
changing from lambda to function solved it
(I'll call lambda, arrow function is too long)
4chan function
I hate when I need to get this.getClass().getName() but it's inside a lambda
this.doThis().doThat().getThis().getThat().clearThis().clearThat().doneThis().doneThat();
In the terminal type:
pip install six
thx
Npπ
hey. this is a very long shot, but is there any chance anyone here known how reactjs works? i need help to set it up with my discord bot. i dont want anyone to do it for me, i just need help to get started
let a = this;
for(let x of ["doThi","doThat","getThis","getThat","clearThis","clearThat","doneThis","doneThat"]) {
a = a[x]();
}
let r = ["doThi","doThat","getThis","getThat","clearThis","clearThat","doneThis","doneThat"];
for(let i = 0; a = this; i < r.length; a = a[r[i++]]()) {}
improvised, adapt
empty for loops are fun
you can do a lot of stuff using only the loop parameters
without any code in the body
in your opinions what lib has the best documentation (i mean documentation written by the devs not third party)
i want to get some inspirations for ideas from it
likely discord.js or discord.py
have you looked at the sidebar, or clicked on the button on the bottom right hand corner if on mobile?
everything is documented and they have guides that tell you what you should do :thinking:
yes i blody have
dsharpplus
i read thru it all
you clearly didnt
this page has a step by step lol https://reactjs.org/docs/create-a-new-react-app.html
why what?
you don't do that clientside
see. i obviously dont know waht im doing
ye
anything that has sensitive data is done in the backend and then the processed data (DTOs) is sent to the client
i swear to god. if people keep bringing me docs im just gonna pay someone to do it
bye
Lol
I was just thinking, one time i saw the owner of a bot talking about clusters, "The (number that i forgot) clusters of the bot went down." So if i want to make more clusters on my bot, i just have to make more node.js running index.js?
it's more complicated than that but yes, you would need more processes
Oh nice
hugeee bots also split those clusters to separate servers
just use ; then
no need to even open brackets
sup kuuh π
you are...?

}, {
id: "829785240658378752",
deny: ['VIEW_CHANNEL'],
},{
I have this in my channel.overwritePermissions but it doesn't put it to deny, it puts it to neutral anyone knows why?
is it ok to use json as a database for small text config, not for mass usage
no
there's still a chance your code will attempt a concurrent read/write which obviously you can't do - it leads to corruption
max will be like 8 objects
use sqlite
never used it before
quickdb if you're lazy and using node
all i know is mongodb
quickdb runs on sqlite but it's dumbified
oh i get it
anyone here uses Flask?
Anyone know if imgur provides a api for uploading images?
Yeah it has an upload endpoint
I see it
One message removed from a suspended account.
One message removed from a suspended account.
guys help me do someone host his web on 000webhost
I need help with hosting my Flask website
My hosting provider uses Nginx
hmmm
I heard it is possible with Nginx
Yeah didn't know if the upload endpoint existed tho 
Well, do you have a way?
wait i think i have a code for you
Hmm okay
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "always alive"
def run():
app.run(host = "0.0.0.0", port=8000)
def keep_alive():
server = Thread(target=run)
server.start()
@solemn elk
will that make it public?
?
and how do i connect it to my domain?
wait
i want to host it publicly
same
go to freenom
pick your html domain name
like
and pick it
after it go to 000webhost
host it there
in the ftp
oh
and it uses only my domain
?

okk
nginx or apache tbh
nginx
i also need host
nginx in my opinion
thats the hosting service i use
however, server creation is disabled currently lol
nodes are full
ok
i totally did not create 21 servers on the same node
ok
000webhost is dodgy af. They had a massive security breach a few years ago where over 13 million accounts got compromised.
I had an old test account with them and it was in the breach
With web hosting you get what you pay for.
lol
Which is why you get a really dodgy solution
Your account data is important though
oh
And potentially any user data you might be storing
lol
You'd be putting them at risk too
Tbh if I had to make a site for free I'd rather use Wix or smth than host on 000webhost π
stop
And that's coming from someone who's been making websites on a commercial basis for the past 10 years
i just sayed pls giv eme smthng to host on
Buy your own hosting
i dont have money
You can host on so many other platforms like github, heroku etc. I just wouldn't trust 000webhost with my data if I were you. They've always been kinda shady.
netifly?
spotify x netflix
hey! i was just wondering, how would i be able to make a Guild set prefix / custom prefix for my bot, please dm me if you know how (im using discord.js)
There are lots of good tutorials online. Find some good resources in the pins here. I recommend https://anidiots.guide
no spoon feeding
High level is store their choice in a database, modify your command handler to check against it
netlify? i think thats for hosting sites and stuff (iirc). and i am unsure about bots without dashboards even, since i have not used it for such...
What are you using to host your bot @earnest phoenix ? Can't you host a website there too?
nop i host only a web
so you want a site to host (Html/php)? or is it a nodeJS (ejs/pug/handlebars...)
if its a static html, theres github pages
What's the website for?
nah
hosting
i host html,js,css,php
okay so you want a website?
yea
nop
yea yea
i want a web to host my web
No hosting's for the website π what does your website do?
If it's just static pages I'd agree with moonlight and say use github as I mentioned earlier
What's wrong with that?
ill finish code after it ill see if something will goes wrong
okay... Do you need a custom domain or something??
ignore that reply, but not the message^
Well github > 000webhost anyway π
^ And you can get a (not great idea but it helps) .tk, .ga, .ml, or .cf domain free and set it so you dont need <username>.github.io/<repo>
stop
freenom i think it is?
yea
@earnest phoenix
@rose warren
pls give me lin to sign in to github coz he gives me an impossible enigme
you said you're using php, you can't use php on github pages
you're asking how to sign into github? go to github.com and register an account and then sign in
it gives me an impossible enigme to solve
a captcha?
and what does it want you to do with those number?
nvm wait
find what cube have number 14
total of 5 cubes is 14
in 30 secs???
with 10 questions
what are you on about lol
?
i don't know wtf you're talking about, send a screenshot
i don't know the language but i'm guessing it just wants you to click all the images that have a total value of 14 on the dice
which is only the bottom left
it takes like 5 seconds to do the math in your head per image π
you're over exaggerating
bro there are 6 images
and ten questions like this
also there doesn't seem to be a timer at all
unless he's a bot
remember, bots cant solve captchas
im human
you sure?
what im i an animmal or what
humans are animals
bots can talk too
oh you're talking abt your mom
stop
What do y'all think of loading a database into an object instead of querying the database for every single message thats sent? Is there a more efficient way?
Using a key system object_var[guild_id] to get the specific guild of the messages' value. Dont know if thats efficient
you want to cache all the database data in memory for quicker access?
that should be fine as long as your database isn't huge
Yeah, so for now it just loads servers with server vars into cache. What would you categorize as huge?
well, that kinds depends on how much RAM you're running
But I also have a task table which could have potentially have tens of thousands of entries but rn only has around 700
16gb on my PC, but hosting is like 2gb
well, however big your database is, that's how much RAM you'll need to use
you'll want to leave some leeway of course, for everything else that needs to run
it sounds like guild data, maybe guild preferences or something that they're storing
you're probably fine storing several thousand rows of data in memory, as long as those rows aren't huge
it's actually a very common pattern, acts like a second/third level cache
how do per-server economy bots manage all that data? assuming they use a DB do they make a new table for each guild?
want to do something similar but not economy
this allows you to access and update your data super quickly and let the database update as a side effect
nah, it's just a new row in the table
they add a column with the guild id and user id
No, getting data from database to tell it what to do with the message
Storing messages is a but sus 
Imagine using a db to store info. I use discord channels 
you're required to let your users know what you store and if you apply for verification you have to tell discord what you store
buuuuuut most people don't do either
can't get caught if no one knows about it
Uh well, how do i add cooldowns for commands?
( js btw )
Store the time and user ID when they call the command, check it if they try to call the command again later on
k thx
There's an example of it in the tutorial
Uh, not shown to me then?
Mind if i ask other question?
Use a Discord Collection for cooldowns

You can ask all the questions you want
So, how do i kick users in the style of the tutorial thing?
By style i mean this text below
module.exports = {
name: 'kick',
description: 'Tag a member and kick them (but not really).',
execute(message) {
if (!message.mentions.users.size) {
return message.reply('you need to tag a user in order to kick them!');
}
const taggedUser = message.mentions.users.first();
message.channel.send(`You wanted to kick: ${taggedUser.username}`);
},
};
but i want it to kick, not to say i wanted to
That's a good basic starting point but remember to let your users know they have to wait for the cooldown with an error message in the channel, but only make it send once otherwise it defeats the purpose.
That I don't know, I haven't done admin stuff, it should be in the official documentation
I tried with the example in the discord.js tutorial but it don't work, just throw me tons of errors

Ah ty
it will be easier
now i will close discord to open chrome before my pc gives me the blue screen
leaves
... wtf computer you running
Copy and paste is easier for sure
I recommend not looking at specs
btw i managed to do it, but had to put the command inside of index.js
That shouldn't be necessary but at least it works
Ok ill just tell you the specs of my pc cause im a bad person >:)
Windows 10, Intel Celeron, 4GB Ram DDR3, Intel HD Graphics 500.
Also other question, how do i make a bot play an audio file? Want it to play a local file. Tried with tutorial but can't make the addons for the code work. If you know how to make the code correctly it would help me a lot
I already managed to do it :>
(node:3067) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'music' of undefined
How to define property of music π
Set a property when you begin instantiating your bot instance or extend Discord.Client and create a property on it.

I did a rather lousy amount of work today ):
That error message is always about the object before the property, not the property itself
are people allowed to spoonfeed
Is it so ??
people can do whatever they want? most people don't like to spoonfeed
ok
Is there any problems in discord api ??
If someone know
Because when we use any commands like<prefix>mute @--- then we will not get any error and the command also will not work
This error is with all that command where need to ping like ban kick tempmute connect4 etc
This is with other bots also ???
In my servers it's with some more bots
Is it so ???
```if(message.content === /invites){
var user = message.author;
message.guild.fetchInvites()
.then
(invites =>
{
const userInvites = invites.array().filter(o => o.inviter.id === user.id);
var userInviteCount = 0;
for(var i=0; i < userInvites.length; i++)
{
var invite = userInvites[i];
userInviteCount += invite['uses'];
}
message.reply(`You have ${userInviteCount} invites!`);
}
)
}``` how do i put that in a embed
...
Rules state you're not allowed to
π€·
oh, ok, didn't know it was an official thing
does this count as spoonfeed
the standard way you do any embed? your issue is not clear, are you asking how to do an embed in general? or are you asking how to do an embed in a .then? if the former, look at the tutorial, if the latter, there's nothing special about doing it in the .then, create and send the embed in the .then
ok
how do i fix this ```if(message.content === /invites){
var user = message.author;
message.guild.fetchInvites()
.then
(invites =>
{
const userInvites = invites.array().filter(o => o.inviter.id === user.id);
var userInviteCount = 0;
for(var i=0; i < userInvites.length; i++)
{
var invite = userInvites[i];
userInviteCount += invite['uses'];
}
let Invitesembed = new Discord.MessageEmbed()
.setTitle(`${message.author.username}`)
.setThumbnail(member.user.displayAvatarURL())
.setDescription(`You have ${userInviteCount}`)
.setColor('#f02016')
.setTimestamp()
.setThumbnail(member.user.displayAvatarURL())
.setFooter(`Member left`)
channel.send(Invitesembed)
}
)
}```
what's wrong with it?
theres an error when i use the cmd
How can I set my bots status on mobile
what's the error?
Any bot devs on mobile?
on Discord.Client
Ok thanks
you need to edit the ws properties
in the parΓ©ntesis write this code
{ partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'USER', 'GUILD_MEMBER'], ws: { properties: { $browser: "Discord iOS" }}}```
not usual
partials is unnecessary
Ok
Oh
Is it a website?
const client = new Discord.Client(
{ partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'USER', 'GUILD_MEMBER'], ws: { properties: { $browser: "Discord iOS" }}})```
thatβs how you make that @earnest phoenix
Ok
Thanks
youβre welcome
how do i fix this ```if(message.content === /invites){
var user = message.author;
message.guild.fetchInvites()
.then
(invites =>
{
const userInvites = invites.array().filter(o => o.inviter.id === user.id);
var userInviteCount = 0;
for(var i=0; i < userInvites.length; i++)
{
var invite = userInvites[i];
userInviteCount += invite['uses'];
}
let Invitesembed = new Discord.MessageEmbed()
.setTitle(`${message.author.username}`)
.setThumbnail(message.author.displayAvatarURL())
.setDescription(`You have ${userInviteCount}`)
.setColor('#f02016')
.setTimestamp()
.setThumbnail(message.author.displayAvatarURL())
.setFooter(`Member left`)
channel.send(Invitesembed)
}
)
}```
What is the error?
it said message.author.username isnt a function ```if(message.content === /invites){
var user = message.author;
message.guild.fetchInvites()
.then
(invites =>
{
const userInvites = invites.array().filter(o => o.inviter.id === user.id);
var userInviteCount = 0;
for(var i=0; i < userInvites.length; i++)
{
var invite = userInvites[i];
userInviteCount += invite['uses'];
}
let Invitesembed = new Discord.MessageEmbed()
.setTitle(`Invites`)
.setThumbnail(message.author.displayAvatarURL())
.setDescription(`${message.author.username}, You have `` ${userInviteCount} `` invites`)
.setColor('#f02016')
.setTimestamp()
.setFooter(`invites`)
message.channel.send(Invitesembed)
}
)
}```
Then you are calling it as a function somewhere
ok
My phone wonβt support it. Doesnβt matter tho
What?
Sorry, scroll up
like in that code or somewhere else
the stack trace should tell you what line number it errored on
Wherever you do <message>.author.username()
it said message.author.username isnt a function ```if(message.content === /invites){
var user = message.author;
message.guild.fetchInvites()
.then
(invites =>
{
const userInvites = invites.array().filter(o => o.inviter.id === user.id);
var userInviteCount = 0;
for(var i=0; i < userInvites.length; i++)
{
var invite = userInvites[i];
userInviteCount += invite['uses'];
}
let Invitesembed = new Discord.MessageEmbed()
.setTitle(`Invites`)
.setThumbnail(message.author.displayAvatarURL())
.setDescription(`${message.author.username}, You have \`${userInviteCount}\` invites`)
.setColor('#f02016')
.setTimestamp()
.setFooter(`invites`)
message.channel.send(Invitesembed)
}
)
}```
try with that @stray birch
ok
Do not spoonfeed @earnest phoenix
ty it worked
i just didnt know how to put the ``
Don't spoonfeed code
ok
the slash
?>
and then that
\`
yeah
No no
hi Extreme
\ not /
hahahaa
Hi nom is short
ok
hi
You are short
idk if I am
\`hello world\`
like this
if it is inside of this ``
How do yβall keep your bots online. (I donβt need help. Just wondering)
Just got a working economy on my bot in the first time in a year
Congrats
Does anyone know how I can open files with "mv.db" extension?
The db file likely has its own format inside the file. So you probably need to know the kind of database you're using (probably SQLite)
Does anyone know how to safe search esp for search commands
is there a plan to stop supporting <@!ID> for user mentions in the future?
and is there any difference between mentioning someone with <@!ID> and <@ID>?
The opposite
<@> is being deprecated
but it's still available on mobile clients
<@!> used to be for member with nickname but now they use it for all user mentions
does discord document this somewhere?
how to add filters in a bot ?
What filter ?
image or audio or command-filter ?
Can you provide more details?
Like for YouTube search command Google search command
at Object.i18nSetLocale [as setLocale] (/home/runner/evobot/node_modules/i18n/i18n.js:491:25)
at Object.<anonymous> (/home/runner/evobot/commands/clip.js:3:6)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/evobot/index.js:60:19)
at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! evobot@0.10.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the evobot@0.10.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-04-10T06_14_35_592Z-debug.log```
what does it mean
wt the error
my brain exploded
show the rest of the error
When using an online service, you may be able to apply metadata or receive data to filter unsafe results.

