#development
1 messages · Page 1299 of 1
oh wait nvm there wasn't an ID
sorry my brain isn't working
using reaction.emoji should work
I guess it was due to the message.reaction part
yea that's what I was confused about
which caused the message to not get fetched
and the if condition will not be ===
my bad
anyways your problem should be fixed, do test it
yea I checked the "Updating from v11 to v12" page on discord.js.org and that's how they have it
👍
anyways your problem should be fixed, do test it
yea it is fixed, thank you :)
welcome

today i did:
ps aux | grep "./bot" | grep -v grep | awk -F ' ' '{ print $3 }' | paste -sd+ | bc -l```
it sums up the cpu total of multiple processes called 'bot' and returns a single value 😄
nice
2020-10-06 10:48:10.886 [I] [th#15599] : Websocket[s] connecting
2020-10-06 10:48:10.886 [I] [th#15599] : Starting bot with 8 shards (cluster ID 1, max clusters: 2)
2020-10-06 10:48:10.986 [D] [th#15603] : Shards to connect : 4
2020-10-06 10:48:10.986 [D] [th#15603] : Shard#1: connecting
starting to get a bit complex now lol
im splitting my bot into clusters, where each cluster is a process responsible for an equal subset of all the shards
right now just two clusters of 4 shards each
any thoughts on what might go wrong? 😛
What's the difference between const { thing } = stuff... and const thing = stuff...
const object = { foo: "bar" };
const baz = object; // { foo: "bar" }
baz.foo; // "bar"
// or
const {foo} = object; // "bar"```
umm how can i do !avatar ?
if (message.content.toLowerCase() === prefix + 'avatar') {
message.channel.send(message.author.avatarURL)
}
and how can i do it embed?
make an embed and do .setImage(message.author.avatarURL())
function newFunction() {
if (message.content.toLowerCase() === prefix + 'avatar') {
const embed = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Avatar');
message.channel.send(embed)
.setImage(message.author.avatarURL());
};
}
@silver lintel
is this right?
Erm no, add the setimage before the send
oh okay
function newFunction() {
if (message.content.toLowerCase() === prefix + 'avatar') {
const embed = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Avatar');
.setImage(message.author.avatarURL());
message.channel.send(embed)
};
now?
i am new about this
sry
@silver lintel
Make sure you dont have a semicolon on the end of the setadescription
if (message.content.toLowerCase() === prefix + 'avatar')?
prefix should be the prefix
So at the top you would do const prefix = '!';
Code from lines 20-26 should be in the client.on("message".....
After the first if statement
Okok, also you're mixing up Discord and discord.
my bot prefix is !
but he respond to anything else (?,@,% etc)
how do i fix that?
just add js if(!message.content.startsWith(prefix)){return} above the let args = ....
ty
Do: if (!message.content.startsWith(prefix) || message.author.bot) return;
Above the args
go on
that's inline (on embed field)
Set the colors to false, funny to true, object to false, moving true and reactions false
idk how lol
Send the code you are using for that embed
case 'emojis':
const helpEmbed3 = new Discord.MessageEmbed()
.setColor('33EC0A')
.addField('**colors**', 'normal among us colors emojis', true)
.addField('**funny**', 'funny among us emojis', true)
.addField('**objects**', 'objects in among us emojis', true)
.addField('**moving**', 'moving among us emojis', true)
.addField('**reactions**', 'reactions among us emojis', true)
message.channel.send(helpEmbed3)
break;
case 'emojis':
const helpEmbed3 = new Discord.MessageEmbed()
.setColor('33EC0A')
.addField('**colors**', 'normal among us colors emojis', false)
.addField('**funny**', 'funny among us emojis', true)
.addField('**objects**', 'objects in among us emojis', false)
.addField('**moving**', 'moving among us emojis', true)
.addField('**reactions**', 'reactions among us emojis', false)
message.channel.send(helpEmbed3)
break;
Is it possible to access a message from other server?
nah nah, not like that
for accessing message without bot, you can only use announcement channel, that's all I know
I mean by url or something. I want to fetch a message from another server.
fetch message by declaring guild's id, probably yes
any hints?
Discord list plzzzz
-faq 1 @fathom bobcat
:/
What does it log @ console.log(spotify)?
nothing
@fickle sapphire
Lilpeep
what should be the name of my discord c# api wrapper thing
Why dont you json stringify spotify
cuz its undefined, probably
Code from lines 20-26 should be in the
client.on("message".....
@silver lintel
if (message.content.toLowerCase() === prefix + 'avatar') {
const embed =new Discord.MessageEmbed()
.setColor('Blue')
.setDescription('Kendi Avatarın burada!')
.setImage(message.author.avatarURL());
message.channel.send(embed)
}
where do i add?
after the if?
client.on("message") const embed =new Discord.MessageEmbed()
this?
wtf
client.on("message", message => {
const embed =new Discord.MessageEmbed()
.setColor('Blue')
.setDescription('Kendi Avatarın burada!')
.setImage(message.author.avatarURL());
message.channel.send(embed)
})
this is the worst help vampire I've seen in a while lol
What’s the problem?
you closed the event without put your code in it
You closed your message event
Having more than one of the same event is bad practice
client.on("message", message => {
if( .... ) {
const embed =new Discord.MessageEmbed()
.setColor('Blue')
.setDescription('Kendi Avatarın burada!')
.setImage(message.author.avatarURL());
message.channel.send(embed)
}
})
so i need help
The if statement is outside of the message event
And have one event
Don’t spoon feed him
I will soon explain the code
so, it won't be spoon feed
@stiff walrus well, you have to put your code into the event listener which is "client.on()"
and add some code inside it
Learn Javascript.
You're closing out the your event handler, and referencing a message object which doesn't exist outside of the event's scope
^
okay...
now this
@stiff walrus That means you have a syntax error somewhere. Syntax is a programming language's "grammer". It has to be written without a syntax mistake to work
yes
@faint prism come on async stuff
How to create your own welcome bot or giveaway bot
selam
as
sohbet değil
önerceğin bit site
sorular için
var
KAYIZER bilişim
min ne kadar
keyubuda 2gb 20 tl sağlam firma
discord botlarından para kazanılmıyor değil mi
What
geliştirici tagı filan alınca
english only (in this channel)
parayla bot yapabilirsin geliştirici rozeti alırsan
#general-int for non-english
isteyen gişilere
auger
Can you please tell me a free bot site like glitch
general 2 de konuşalım
burdanda kovdular
@faint prism what a good person painting that code 
parayla bot yapabilirsin geliştirici rozeti alırsan
@summer blade They don't give out badges anymore btw
hey peeps
how would i actually show the contents of a json file into an embed?
i do have a json file with 1 channel id in it.
just... read the contents and put it as the description lol
if you read the contents it's already a string
that's not valid json
it is.
no it isn't lol
well it works lmao.
it doesn't
How in the god's name is that a valid json
{
"id": 5495495495352
}
is valid
because you're overwriting the file contents 
it literally works:
but not what you did
you're overwriting the file contents
your code doesn't care about what was in the file
the extension does not matter
you do not parse the json so it works
you don't read it properly
yeah and i am checking if (message.channel.id === channel1)
and i am defining the channel1.
by ereading the data1.json
Storing text in a json file
Just make it a .txt
because, again, you're not parsing the json
because it isn't
proper
json
formatting
Just rename it to a .txt and read it like any other file
plz don't spam
you're just reading the file contents and it works because you're just feeding the channel id without parsing the json
also avoid file collation databases in the first place
look at the begin of the json file
it only has [].
after i use !setchannel
it changes and the code works properly
I see no array in the image
anyways, how would i put the contents of the json file into an embed.
i told you
yeah because it got erased
just read the file
for the message.channel.id
anyways, how would i put the contents of the json file into an embed.
@eternal osprey https://discordapp.com/channels/264445053596991498/272764566411149314/763021970119327764
get a proper database
then use it lol
but i am just using json as it is easier
and it only has to store 1 channel.
nothing that can go wrong.
but what is the string name?
that's the question.
"i can use plastic instead of metal for this chair because it's just easier lol nothing can go wrong"
@earnest phoenix you are damn right! There are millions of chairs being made of plastics.
in my experience, i have never seen a metal chair.
too ROUGH for the job it needs to do.
uh
same goes for mongodb
school chairs
office chairs
i should stop helping help vampires altogether i'm losing my sanity
MongoDB is a proper database whereas JSON files are bleh
it is just my opinion, nothing to blame me on. Thanks for your help tho!
i know shivaco.
it only stores 1 channel.
there is nothing much to go wrong.
i am not saving all my users in the server or whatever. Just a few codes.
Unless you're constantly rewriting to it
once every week
Eh good enough then
I mean, I'd still suggest using Mongo but that's my preference
I use JSON file as my database for my C# project lmfao
yeah i know. MongoDB is one of the easiest and best databases to use.
I just thought that there couldn't be something wrong with using a json file for only 1 line of code.
mysql still better
ef core is super easy
that's arguable lol
mysql is so limiting and it's made by oracle
they're also not really comparable per se
one is a local db one is a server db
Entity Framework?
yup
btw, can i actually upgrade the plan of an existing cluster?
entity framework core*
as i already have info on that database.
Got any easy-to-understand resources handy?
Microsoft docs do be helpful
there are samples on there that can get you ready in like 5 minutes
I still need to look into EF core. I just end up making my own classes from scratch
i love ef core because how smart it internally is
deciding what to cache and what not to etc
there's also a really great async querying api
yeah
super easy
there's also an advantage when you're working with asp.net core since ef core is ready for web use
So I have 4 arrays, each with about 4 values, I'm tryna get all possible combinations how would I do that?
let combos = []
for (let i = 0; i < tnineArray.length; i++) {
for (let j = 0; j < necroArray.length; j++) {
let combo = [];
combo.push(tnineArray[i])
combo.push(necroArray[j])
combos.push(combo)
}
}
I did this
But it only works for 2
isnt it just O(n^k)
wtf is that
big O notation
Notation
you were on the right track with the nested for loops
I don't think that's necessary
well maybe since it's 4 arrays
hm
(Haven't had my coffee yet)
I guess so
Since they are objects wich I turned into an array
Then I need to find every possible combination
And then filter it so if it is: apple + apple + pear this one doesn't get included since it has 2 of the same things
Isn't it (4^4) = 256
No no
I need to generate the combination
not how many there are
I need every single possible combination

ah
then yeah, nested for loops
what 2d javascript physics engine would you guys recommend for a game in HTML
heym
this seems to be working @tulip ledge
the indentation is a bit fucked
you might have to adapt it to your use case
what 2d javascript physics engine would you guys recommend for a game in HTML
matter.js or phaser or smth else?
i have a command that suppose to react with couple of reactions, and that's what happened:
only 1 is getting added
thats the code:
hey how do i deteect if a variable is a tagged role
no

so... a string
a string can't be a mentioned role, it can contain a mentioned role
@mild flower MessageMentions.roles
if(lmao === messagementions.roles) return poop
this work?
wtf no
wtf am i looking at
¯_(ツ)_/¯
there's a slight issue when you're using messagementions though, the order of your arguments won't be consistent.
see: https://discordapp.com/channels/264445053596991498/272764566411149314/728865810910674944
does this work then
i mean
basically
making a role command where the role can be either the role name or the tagged role
nvm i worked things out
Is there a way to make a JavaScript eval in python ? 
?
I want a JavaScript eval in a python bot not a python eval I already made python eval in python bot 
ik in js you could spawn a child process of python and do something like that idk if theres a pip package in python that allows you to make a child process in js

all of the libs seem to be EOL'd
or abandoned
i presume one way would be to spawn a node process and feed your eval contents through stdin
then let node eval it
and output it through stdout

then from python read the stdout content
Ok thanks 
i found this https://github.com/sqreen/PyMiniRacer
it runs on google's V8 engine
it's probably what you're looking for
hi i have a question
client.on('guildMemberNicknameUpdate', (member) => {
console.log(`${member.user.tag} updated nickname to ${member.user.tag}!`);
});
i have this logging section in my discord js script
how do i get the nickname instead of the user tag
I might be dumb
but i couldnt find in docs
did that event even trigger
ye
// Load modules
const logs = require('discord-logs');
const Discord = require("discord.js"),
backup = require("discord-backup"),
client = new Discord.Client(),
settings = {
prefix: "b!",
token: "t"
};
logs(client);
//logging
client.on('guildMemberNicknameUpdate', (member) => {
console.log(`${member.user.tag} updated nickname to ${member.user.tag}!`);
});
client.on("ready", () => {
console.log("I'm ready !");
});
it did
i can show a ss
now with clusters 😄 not the same as breakfast cereal.
check if the old member's nickname and the new member's nickname are different and log them if so
what are .ejs files?
How can I find the API token of my bot?
How can I find the API token of my bot?
@sharp swift in the discord developer panel
https://discord.com/developers/applications
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
hi can you help me when i have create the bot on discord developers the how i do
please help me idont know how i bring the bot online
how where i host
Discord just gives you the bot ACCOUNT .
On ur pc
On a vps xDDDD
hey how do i check if a variable is the name of a role or the id of a role of that guild?
here a link for the beginners 🙂
hey how do i check if a variable is the name of a role or the id of a role of that guild?
@mild flower do u want to male a info command?
no
i want to make a ;role add command
where i want to get input
and check if that is a role name or an id
and then add that role to the user
but i have now createt bot in developer portal then when i go on visualstudio code or other apps
@midnight quarry bruh just watch a youtube video
is very hard to see on yt
how where i host
@midnight quarry on a dedicated server. So either buy a VPS, or host it yourself and never turn off the PC
what
@midnight quarry on a dedicated server. So either buy a VPS, or host it yourself and never turn off the PC
@faint prism I told xD. Yes Pc will get fried
You mention first
It won't "get fried"
how to add json to a js file
where json would have all bot's replies
Require it
He said replies, and as long as he's not updating the values, it's a fine use for JSON
yes Indeed.
yeah, there would only be a text
ie static data is fine to store in JSON
yeah, there would only be a text
@earnest phoenix google how to serialize JSON in JavaScript.
Don't worry, it's pretty easy.
alright then
👍
let rrole = args[1]
if(rrole = message.member.roles.cache.some(r => r.name == rrole))
im trying to detect if the string is a name of a role in a guild and this doesnt seem to be working
some?
becuase the args has <@&>
@mild flower
you have to split it
make an if condition
If it has the things it splits
i think u should use .find instead of .some
yeah
oh maybe do like this:
if (message.member.roles.cache.has(r => r.name === "rolename") {
the args had nothing to do with it
@earnest phoenix doesnt that detect if the user already has that role?
oh wait nvm
yeh but u want to get the role? or check
@earnest phoenix no bro
read the docs
i want to get the role
i read the docs pretty well
there are no .has()
where we can add roles using the role name
nice read
wait let me try
: /
let roleName = message.guild.roles.cache.find(r => r.name === "roleName")
message.member.roles.add(roleName)
whenever I try to write to file it says cannot access "variable" before initialization
what's your code
your probably trying to do something like
console.log(myVar)
let myVar = 5;
// Not exactly this code, but along the lines of
np
bot.on("message", message => {
if (message.channel instanceof Discord.DMChannel) return;
if (message.author.bot) return;
const PREFIX = "m-"
let level = JSON.parse(fs.readFileSync("./level.json", "utf8"));
if (!level[message.author.id])
level[message.author.id] = {
age: 0,
};
let userData = level[message.author.id];
fs.writeFile("./level.json", JSON.stringify(level), err => {
if (err) console.error(err);
});
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0].toLowerCase()) {
case "test":
userData.age++;
fs.writeFile("./level.json", JSON.stringify(level), err => {
if (err) console.error(err);
});
break;
})```
@earnest phoenix well u used it wrong
i just googled
@errant perch dude how u are even vertified, when ur bot doesn't have events handlers
yikes, don't use json as a database
huh
and using Json database
yikes, don't use json as a database
THIS
: /
whats wrong with json
lemme corrupt my data in peace
Bad
Lmao
see: <#development message>
as long as u r not storing terabytes per ms u'll be fine
not this
but what about actually helping him instead of bashing him about json
but what about actually helping him instead of bashing him about json
but what about actually helping him instead of bashing him about json
json db is such a shit choice
correcting horrible code is helping
its just a few numbers
for that it's ok
if(rrole == message.mentions.roles.first())
this not working
as long as there is no errors it wont corrupt
but if you save even a bit of more data it is horrible
In case you didn’t got it by now: I strongly discourage you from adding JSON fields in a relational database. The only situation in which you should consider it is when you don’t have to query the JSON data with SQL (which is a pity). The JSON type will guarantee that the data inserted is correct (from a syntactic point of view) but you should not aim for more. Finally, it’s worth noting that the arguments I present in this post are applicable to other types: XML fields, Array fields (to some extend), etc. So be careful when you use fancy types, and make sure you use them for the right reason.
as long as there is no errors it wont corrupt
not true
you're using it for levels 
from https://www.thomascerqueus.fr/json-fields-relational-databases-postgresql/
one sec
bot.on("message", message => {
if (message.channel instanceof Discord.DMChannel) return;
if (message.author.bot) return;
const PREFIX = "m-"
let level = JSON.parse(fs.readFileSync("./level.json", "utf8"));
if (!level[message.author.id])
level[message.author.id] = {
age: 0,
};
let userData = level[message.author.id];
fs.writeFile("./level.json", JSON.stringify(level), err => {
if (err) console.error(err);
});
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0].toLowerCase()) {
case "test":
userData.age++;
fs.writeFile("./level.json", JSON.stringify(level), err => {
if (err) console.error(err);
});
break;
})``` whenever i run the test command it says cannot access "level" before initialization
lol
dude
@errant perch why use fs.readFileSync, you could try importing it directly
Ok
how would i do that lol
can u pin this
We'd rather help than judge people for their choices
[{"name":"John","age":"17"},{"name":"Jack","age":"36"},{"name":"Rick","age":"76"}]
//in js
const list = require( 'list.json' );
console.log(list);
The jsondbbad pin is there only as a guidance
think you gonna do ./list.json
i'll try this out
not just list.json
ok
require has caching behaviour
@errant perch that looks like mutable data. And would therefore be more applicable in a database
bro
auger with da facts
do it before it's too late, you're going to regret not doing it later lol
my brain
also once you have a db setup, you can use it for other things
it's easier now than later
im currently learning german and why json will get you trashed
its funny how you guys have spent the last 10 minutes just bashing him about json instead that helping
It might seem easy to just serialize a collection. But doing that continuously will result in file access issues and eventually mess up the tokenization process corrupting your JSON database
lol
i didnt watch a youtuber for this
As long as you aren't rewriting contents to the file on a constant basis, it's alright
Yeah
i think the people that criticize people who take time out of their day to teach beginners developing are bad
Static data, like config, or predetermined replies are fine and JSON files
Caching for life
i use mongodb, and am currently migrating to psql??
static data (token, prefix) better use .env
can't cache my heroku instAncE gIves mE 5 mb Of Ram :(((((((((((((((( helpP LS
i just want to help the poor dude rather than waste his time talking about json
I sometimes feel like muting anyone who can't stand JSON databases here
You can, but I honestly don't think it matters
I should setup a redis server
redis yuck
for caching lul
redis is fire watchu mean 😔
it is super fast caching but as a db :P
overengineering your code
postgresql for life
redis can be boiled down to a simple dictionary/list in your code, if you want to share data there's always IPC and named pipes
so like
to me it's just overengineering and bloating
imma move to heroku :))
if you have kubernetes, it is required
seems a bit hypocritical
like you can't cache stuff in a dictionary when user multiple clusters/nodes
#Things not to mention in dbl
- json
- @mods
jsondb*
lol
I wonder why people can't mention jsondb
scroll up
I luv json but jsondb >:(
and if getting shat on for using one is really the user's issue
they dont know how to help the person so they just resort to bashing users about json to think they're doing something productive 
and if getting shat on for using one is really the user's issue
they had the chance to not use it so now we make them >:)
it's preventing an issue that's granted to happen; corruption and access violations
and then they're going to complain how it doesn't work and how it got messed up
lol
it's better to make their bot not tilt
Let users suffer the consequences of their choices
than to fix a small bug
its understandable if you just said "I'd reccomend db over json", and then proceeded to assist him. But yall didnt even do that
Almost every time I see users being judged for jsondb ends up in literal violation of rule 1
try it with more than 10 people using your bot per hour
i use json to store my token, api keys and shit, etc
they're concern is that it won't work as well at a more higher use case
once you put stress on a json database it's going to fall flat and die
I serialized directly to bytes 
i use json to store my token, api keys and shit, etc
different thing
that's just a config :P
I use .env but same idea
same
it is data not being constantly saved
I serialized directly to bytes
i write binary on a piece of paper then OCR it and send pulses to the cpu
OCR it
Reeeeeeeeee
Enjoy the corrupted data
Just require it
o
thats what i said
oh
lol
require has caching behaviour
lMao
your data literally won't be up to date lol
dude require uses json wtf
if you don't like help don't ask
shut the fuck up oh my god
delete code and install fortnite
require caches the thing you require, even though you write new data to the file the required file won't be up to date because, well, it's cached
development channel go brrrrrrrrr
I must have tripped and fallen into #general-int
you have a recursive call somewhere that looped so much it errored out
try googling the error and attaching mongodb to it
hmmm
there's an SO thread from 2015 if that helps whatsoever https://stackoverflow.com/questions/24466366/mongoose-rangeerror-maximum-call-stack-size-exceeded
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
})```
ok
:__:
is there a video where i can learn image generation with canvas?
anything you guys recommend that is
@earnest phoenix it won't if the perms are cached by ur bot
I'm trying to make an emoji info, but when the user sends the emoji ready it gives as invalid, so I made an expression to remove the "<" and ">" you can tell me if it's right?
in most cases, they are cached
message.guild.emojis.cache.get(args[0].slice("<", ">")) || message.guild.emojis.cache.find(emoji => emoji.name === args.join("_")) || message.guild.emojis.cache.find(emoji => emoji.id === args.join("_")) || message.guild.emojis.cache.find(emoji => emoji.url === args.join("_")) || message.guild.emojis.cache.find(emoji => emoji.identifier === args.join("_"))```
emojis can look like <:name:id> and <a:name:id> for animated emojis. Your best bet is to use a regular expression to parse the emoji for the name & ID.
I wanted him to take months <> to be able to recognize the name or id
incase someone knows, what causes this?
quick aiohttp (Python) question, when handling a request I have some code like this for example:
return web.json_response({"error": "invalid_auth_header"}
this returns a 200 OK response, which I don't want since it's an error. so, I tried this:
return web.json_response({"error": "invalid_auth_header"}).set_status(400) # Bad Request
but now, cURL tells me that the server returns an empty response. why?
Does anyone have the code to give charge for the badge?
what?
The code for autorole by badge
@clever beacon Tried using web.Response yet?
- we have no idea what language you're using
- we're just here to help, not make everything for you
@clever beacon Tried using web.Response yet?
@slender thistle i'll try that and just add a content-type header
👍
i just don't understand why this wouldn't work since it's just a pre-configured web.Response
ig that's the exact reason
why do you want json with curl anyway?
try return web.json_response({data}, status = 400)
const puppeteer = require('puppeteer');
fs = require('fs');
exports.run = async(client, msg, args) => {
var names = args.splice(0).join(' ');
var configs = JSON.parse(fs.readFileSync("./warinfo.json"));
configs["status"] = "idle";
const json = JSON.stringify(configs);
fs.writeFile("./warinfo.json", json, (err) => {
if (err) {
console.log(err);
}
});
}
it doesnt do anything why?
Do anything by what means. Does it write anything? Have you tried debugging to see if the callback was successful?
any idea how to put own emojis there, (i have my emoji and i don't know how to put him there like in the picture )
start each line with an emoji?
@earnest phoenix it won't if the perms are cached by ur bot
@sinful belfry probably, I check the perms for the client in the message.channel
d.js?
yes
any idea why my ws.ping increases with 15k when i use my stats command
it just fetches values from the shards
wtf 15k?
yes
is it adding them up or something
it only happens when i use my stats command
its possible ur just adding the ws ping up 👀
otherwise im not entirely sure why that would be happening, sorry
wdym?
are you just adding the client.ws.ping of each shard?
also does this happen all the time?
might just be a blip/discord being slow briefly
my stats command uses fetchClientValues and broadcastEval to count the members etc.
but when i use that
and i eval the ping of the bot on the shard im using
it's +15k
after a minute or so
it goes down
blip?
is html and ejs the same?
basically just a spike in the ping
so can i like rename ejs files to .html?
no, you cannot
it basically puts html together to form a html document as its output
not too sure, sorry
there are probably great guides online, or people who can help u out here but i dont do python :(
Anyway to fix this?
define client?
Well yes
I have the package and stuff
but it says error
idk im still new to this
isnt it supposed to be
client = discord.Client()
``` or something 🤔
Use documentation and look it up. We can't give you all the code.
Okay.
You should know the basics of coding before you do major projects.
bots are often major projects
mines 6 months in or so, just took a month and a half break, still got much more work to do 🤷♂️
How do I fix this: `Application run failed
java.lang.UnsupportedClassVersionError: lavalink/server/info/AppInfo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0`
Does anyone have examples for Detailed description ?
any bots page, the long description @vital flax
Don't copy and paste it though.
^ ez rejection
Anything about your bot basically, explain it. It's what people look at when they think of what they wish to invite.
Hi just got here, how do I invite the bot I made? I am also looking to post it :)
or else every time u start bot it sends MY PREFIX IS .....
not when it joins a guild
@frail ocean i mean the theme
@honest inlet invite it here? dont think they add new bots here
to submit a bot for the website
https://top.gg/newbot
CSS
I meant to my server lol
or else every time u start bot it sends MY PREFIX IS .....
@drifting wedge oof
oh, you need to generate an invite link
Ah
Idk how
@honest inlet https://discordapi.com/permissions.html#0
i need to make lunch, will be back in about 30 min.
and also, how can use python as backend?
@drifting wedge Use a webserver framework
like Flask, Sanic, Django, or aiohttp.web
alr alr
i have someone working with me who knows what theyre doing
its for the dashboard
I wish I had someone who knows their shit work with me...
Just the command handler? Or including the commands
including the command
Thats normal
ok good
lol the bot im working on is like becoming something big lol
what is it
I'm bored
ping meh if you need help with JavaScript
then dm me im curious
It's not advertising if the guy deliberately asks for info about the bot
@green kestrel trivia bot dashboard optimized for mobile when?
you should make a seperate whole version for novile users
everything is same except the HTML layout
there's a heckload of ways you can check what device the user is using (please HTTPS only)
why separate version
I always make my site optimized for pc and mobile, with the same stylesheet and backend/framework
why separate version
@compact oriole how the fuck would you change the HTML layout on the same page using js
that'll slow down the website a snol amount
and by seperate version i meant basically a full copy of the dashboard except the HTML layout is optimised for mobile
anybody else change their bots name recently on discord discord dev portal and it just take abnormally long?
pfp changes fine but i changed my bots name over 10 hours ago and it still hasn't changed
You sure you didn't change the application's avatar instead?
@compact oriole @earnest phoenix its already mobile friendly except for some tables, it uses bootstrap 4
if you find something you cant work with on mobile ping me, i'll fix it
@primal oar you verified? you cant change the name of a verified bot
nah im not verified
i have a command that i want it to ask them if they want to do it or not and if they type "yes" it will do the command.
someone know?
the thing is the name changes on the application page itself and the role it creates when the bot joins a server changed but the bots actual name doesnt change
@tardy hornet message collectors
idk how to make it
yeah so i figured it out, didnt know the bot had a whole username page
Docs for your library will tell you
@compact oriole how the fuck would you change the HTML layout on the same page using js
that'll slow down the website a snol amount
and by seperate version i meant basically a full copy of the dashboard except the HTML layout is optimised for mobile
you have then never made a site mobile in mind with a modern framework
I can make it mobile friendly with 99.9% css
it doesn't need js to make it mobile friendly
I only uses js to polyfill request libs
well of course the site is primarily made with js/ts, but it has nothing to do with compatibility
Pretty sure with just media in css you can do mostly anything you need to make a desktop site mobile compatible
and most frameworks do it for you
Oo thats nice 🤔
The
jsondbbadpin is there only as a guidance
@slender thistle its pinned?
last time i checked it was the free hosting thingy
idk, I get fairly exhausted throughout the day with my studies
well then pin it
const nodes = [
{
id: "main",
host: "localhost",
port: 2333,
password: "youshallnotpass",
},
];
const manager = new Manager(nodes, {
shards: 1,
send(id, data) {
const guild = client.guilds.cache.get(id);
if (guild) guild.shard.send(data);
return;
}
});
manager.use(new QueuePlugin());
module.exports = manager;
how do i call client from a separate file so i can use it here?
you can create a class and take in the client from the constructor
at least that's what i'd do
tbh i have never used classes before
You can also export a function which takes the client as a parameter and returns the manager instance
youshallnotpass
I almost think that is a legit pass
I have some pretty goofy passwords for my internal stuff
its not goofy enough to be real
!addmembers
My guest wifi password is: fourwordsalluppercase
So when I go to say it, its: "four words all uppercase, one word all lowercase"
!addmembers
!addmembers
@ripe quest no
it doesnt do anything
@compact oriole @earnest phoenix its already mobile friendly except for some tables, it uses bootstrap 4
@green kestrel basically the whole website except individual server dashboards aren't optimized
I dont even have a bot here
still shouldnt attempt commands in dev channels
ok
goto #commands if your bot is already invited to this server
(we don't invite any more bots btw)
Sorry
is there a way to split a string by each character
so ```js
"Cool!"
```js
["C", "o", "o", "l"]
@karmic compass just pass an empty string in the split function
String.split("");
that's it
it'll split at every character because there is nothing between each character and we're passing nothing (by nothing i mean empty string)
There's also Array.from("Cool");
message.channel.send("B").then(m => {
setTimeout(() => {
m.delete()
}, 10000)
})
ty
message.delete(10000) is also a thing but alright
Buut I think you need to provide an object with a timeout property {timeout: 10000} for example
@cinder patio you can also just pass message.delete into .then without the parenthesis and it'll work but you can't do the timeout
Why are you telling me this? I know, and also you can pass the function itself with the timeout parameter with the bind function
Why are you telling me this? I know, and also you can pass the function itself with the timeout parameter with the bind function
@cinder patio this channel is all aboud madness
https://github.com/discordjs/discord.js/blob/stable/src/structures/Message.js#L536-L548
seems like the lib is just using setTimeout anyway
does the webhook link have /github at the end?

lol im dumb
Do you have administrator perms?
yes
Are you the server owner, or someone with a role?
Look at your if statement again... if the message member HAS the ADMINISTRATOR permission, you send the "you don't have permissions" error
Your if statement is wrong,
if(
you need
if(!
Check if the member doesn't have the admin permission, aka if hasPermission returns false
there are several ways to check
Your method is checking if you have the administrator permission, And you do, But you've set it to return false even if you do, Try it like
if (!message.member.hasPermission
yes
for storing peoples school classes should i do
a) different entry's for all the classes in one big db, with ids attached to them so i'd have to do
classes.find({
user: 'jpbberry'
})```
or
b) one user entry with an array of class data like
```js
.findOne({ id: 'jpbberry' }).classes```
idk which is better practice
thats the part that is not working:
case 'setup':
message.delete()
if (!message.guild.me.hasPermission("ADMINISTRATOR")){
return message.channel.send("I don't have permission to that.");
}
if(!message.member.hasPermission('ADMINISTRATOR')){
message.reply('you dont have the premissions to use this command!');
return;
}
My bot gives such an error even though the command is not used, what do you recommend me to do?
means the bot doesnt have permission to do what you have it doing
Something what?
I'm filling out the form to submit a bot and it says I need to write my commands. Where do I put that?
write your commands?
Yeah where
🤷♂️ lemme open the page, they musta changed it
Kk
@solemn latch ı didn’t use a command but it is saying this error
is your bot public?
Yeah
then someone else did
Bu ı can see when the command used
thats the part that is not working:
case 'setup':
message.delete()
if (!message.guild.me.hasPermission("ADMINISTRATOR")){
return message.channel.send("I don't have permission to that.");
}
if(!message.member.hasPermission('ADMINISTRATOR')){
message.reply('you dont have the premissions to use this command!');
return;
}
no, thats why you need to check perms before every api request
:/
i dont see what your seeing on the submit page @honest inlet
Lemme send a pic
generally youd write commands in the long description
and is there an error anywhere when you submit?
Yes, it says the long desc is too short and that I need to write my commands
ah, this channel once again
IT WORKED!
someone can answer me?
so i have some css on my site thats not allowing me to select fields on a text box
someone?
but when a certain element is deleted i can then select everything i need
someone can please answer me?
whats not working 🤔
asking me?
ye
ty






