#development
1 messages · Page 691 of 1
is there a way to set background image with a link
using canvas constructor ?
atm i can only set Images using path const image = await fsn.readFile('./profile/profile.png');
you need to download the image
you can use node's http, or a package like node-fetch and request
Have you considered swapping to html and then using a headless browser to render the image?
you dont need a headless browser, you can download it directly into node's memory
oh thats not what I meant
I mean bail on canvas entirely
and just write your stuff in html
and then use a headless browser to render that to whatever format you need
isnt that like, adding a whole new layer of complexity for something very simple?
hmm depends
but yea if It can be done in canvas then its better
- i feel like people are more comfortable writing html than drawing in canvas
so you'd rather write an html element, style it with css, add an img element with a remote url, then snapshot the rendered page, and return it to node?
yea ...
maybe I just suck at using canvas lmao
but i feel like I can do much more using css idk
lmao
canvas can do a lot more than css, but yes, its harder to use
its worth the effort to learn it tho
my bot uses it to generate complex images from user data
so i had to learn it pretty well
my bot does something similar so I'll look into it
can you show a sample image?
lmao true
Faker is more washed up
I dont think faker plays team fight tactics Kappa
so washed up that he just won another lck title, also this should probably move to #memes-and-media
is there a way
to like make the triangle
a solid
?
so no sides
like a circle ish
what triangle?
like round edges
a triangle with round corners?
hm
It sends it multiple times, and when I write to the bot it sends it once again but only one time...
help
dont use sendMessage
also, that message shouldnt even send
you make the entire message lower case, then you check if it starts with prefix+"Rules" which contains an uppercase
you made msg a global variable
its being interfered with other messages all the time
I just took and wrote rules really fast bc what it actually send is another thingy
@quartz kindle But if it works for me, what could be wrong then.
ok
using send is recommended
@hidden cargo your problem is that you made msg a global variable
In what version does it stop working? @topaz fjord , @quartz kindle But it WORKS for me...
ok
just because it works, doesnt mean you should use it
and even then, why use two different ones?
ok, bc I did, and I asked what the problem was by making msg a global variable...
the problem is that on every single message you get, they turn msg into something different
Can you give an example?
Using "But it WORKS for me" as an excuse it just dumb
person 1 uses command: msg becomes what person1 said
person2 uses command: msg becomes what person2 said
if person1's command did not complete yet, person1's msg is now what person2 said
yes @topaz fjord, but it felt like he missed that I said it works... for me atleast. @quartz kindle Soo you say that person 2's command is what person 1 used if it isn't done when he writes it?
the opposite
a global variable only exists once, if you have multiple people using commands at the same time, they will keep changing each other's variable
ok, are gonna test that now
const client = new Discord.Client(); const ayarlar = require('./ayarlar.json'); var prefix = ayarlar.json, client.on('ready', () => { console.log(Julia is online); }); client.on('message', msg => { if (msg.content.toLowerCase() === 'Julia') { msg.channel.sendMessage('yes?'); } if(!msg.contest.startsWith(prefix)) { return; } if (msg.content.toLowerCase() === prefix + 'help' ) { msg.reply('I will get new commands!') } }); client.login('token');
Indentifier 'client' has already been declared<<
meaning? @quartz kindle what should I change it too
asd
nice changed name on us ;D
so "var msg = message.content.toLowerCase();"?
@restive light do you set ```js
const client = ...
yes
for example yes, but i'd recommend using const or let
var is very old and has some issues
const client = new Discord.Client();
no I mean anywhere else than that
Is that all the code
yes
so like this ??
in another file "ayarlar.json"
no
@hidden cargo yes
var is gey
Isnt Asus chinese
taiwanese i believe
exports.run = async(bot, message, args) => {
const discord = require("discord.js")
const db = require("quick.db")
const resp = db.all();
resp.sort((a, b) => (a.data < b.data) ? 1 : -1);
let paginatedItems = resp.slice(0, 10);
let lbEmbed = new discord.RichEmbed()
.setTitle('Leaderboard')
.setColor('RANDOM')
let i = 1
paginatedItems.forEach(paginatedItem => {
let user = (paginatedItem.ID.charAt(8) + paginatedItem.ID.substr(9)).toString();
lbEmbed.addField(i++, `${bot.users.get(user).tag} | ${paginatedItem.data} Rupees.`);
});
message.channel.send(lbEmbed)
}
exports.help = {
name: 'leaderboard',
aliases: ['lb']
}``` I also have this in my ready event;
```js
module.exports = bot => {
bot.guilds.forEach(guild => {
guild.fetchMembers();
});
}```
the error is:
You misspelled require in require("quick.db")
Also what Steven said
mute?
Besides that
why is the tag undefined
since I fetched the users
are you sure
also it could be that the user left the guild
didn't i already tell you to use fetchUser
and you didn't know how to implement it because you don't know how to work with promises
does the db object have the property .tag
Hey, how its named: That you drop images and they go on your server like YOURDOMAIN.COM/img/01 and you can access them by the link?
an image server?
like this? https://oliy.is-just-a.dev/pqdyvi_1191.png
Yes @amber fractal
Or this
a CDN
Yes, but...?
what
How
how what
i can't read your mind
How do you create it?
I mean...
If I have an VPS
Can I create an own one in html, js?
buy a vps, buy a domain, link domain dns with vps, put images on your vps, place a webserver (nginx or apache or whatever you prefer) on your vps to serve image content
@earnest phoenix I got it linked
just send image data back when you request the url
@earnest phoenix but I wanna create an thing that if I upload an image it goes to the server
And gives me an link
Quick google search got me here: https://github.com/JoeGandy/ShareX-Custom-Upload
an actual uploader or a server for sharex?
I think it's an actual uploader
Ok thanls
Thanks
i don't even want to bother with explaining on how to do that because chances are they wont understand half of it
oh wait
that exists? lol
I made my own

oh wait
that is way more complicated than what I have for no reason 
@urban maple #memes-and-media
this is the development channel...
So
off-topic is for other dicussions
Why not
1 v 1 me bitch
-m @urban maple I dont like that attitude | 1 day
That member is already muted...
dream

Hi dream
I was gonna mute them
Mute dream for punishment
nah
i support this action
Also why spend time monitoring this server like a hawk
like dream wasn't even talking here when that happened
oh nvm didnt see that
I make a highlight bot DM me when certain trending words show up... words that attract stars and mutes...
what markdown 
it's slightly more dark
ye ye I know
change 'RANDOM' to that color
I didnt know it was an embed
it is
because no side bar, guess it's just the same color of the embed tho :P
Lol but on light mode that looks dumb
but who uses that
yep that's the downside

no code
It is gonna be null
I already know this
I cleared the db before testing it
And checked what res was already
https://i-was-scammed-by.dabbot.org/9573QoE.png res is never null
at least on that if
How so?
you already used res
it may return an empty object
Isn’t empty the same thing as saying null though?
no
Smh really.
also use Date.now() instead of message.createdTimestamp
also
remain = daily_tstamp + daily_cd - message.createdTimestamp
1- don't use global values
2- if daily_tstamp or daily_cd are undefined it'll send the 00 message
Okay...
constructive criticism is an unintended side effect of asking for help 
also
if(eco.length && user.length === 0){...}
wouldn't ```js
User.update({balance: 25}, {where: {user_id: message.author.id, guild_id: message.guild.id}})
just check res.length
But I have two things
and if its zero execute the code in the iff statement
User and Economy
And I need both to not be empty objects
So if they are I create them
Ah I can use the increment method
Duh.
Hm?
No
await user.increment('balance', {by: 25})
You can tell it how much to increment by
I think I did that right kek
@topaz fjord it does return null though
uh
but you already used res
so it wouldnt matter what it was at the if
you used it twice
so it would error before it ever reached the if
Yea.
I’m trying to fix that
I got the create entry for the tables down
Now I need to fix that
If I have code on GitHub, how would I make my bot use it?
Ping with response please.
the worst way is to use heroku
Get a server lol
not helping
@floral bloom You mean like host it or make it run
Well did the owner have any documentation on it/how to set it up
No, I want to know if it's possible?
It depends on your knowledge of that specific language it's written in, how their code is structured and if you are capable of incorporating it into your code
I don't think you understand.
I am making my code on GitHub. I want to run the code that is on GitHub so that my bot does what the code says.
many options
@floral bloom Hey, whats up bro! Long time not see :D...you probably don't remember me tho
Nope, I don't.
uhhh how long were u muted.....?
Who?
Unicode.
@floral bloom Maybe you remember me as Bowtieman? FireBobb? God?
Bowtieman, yes.
Thats me :)
You were in BB-8s Debugging server, right?
Also, for anyone who can help:
I have a test help command that uses reactions to navigate through it, but the inly thing working atm is deleting the message, im not able to remove reactions or edit the message it would seem...
Link to code:
https://hastebin.com/tiforemode.js
No Errors.
Hello
anyone wanna help me with some js backend, my brain be fucked atm lol
i followed berrys tutorial of makin a dashboard, i got like the basics of it workin, now idk how to make pages for the users guilds using express lol
don't you use Discord's OAuth API?
ye i do
its basically like dis: {name: "guildname", icon: "yeah", so: "on"}
just check if icon == null
i did do dat
instead of checking if the url is /null.whatever
and it replaces that with a hat
yea natan u take care of this
oh yeah
var url = a
if(url == "https://..." + ... + "/null.png) url = b```
->
var url = icon == null ? b : a;```
Anyone wanna make a polling bot with me
It'll be for polls directly on discord with extra features
What language?
Why won't this work? It says Cannot read property 'something' of undefined. 'something' is anything after the third . in the code. So message.author.id gives error Cannot reas property 'id' of undefined.. Whatever is first is the error.
exports.run = async(client, message, args) => {
if (message.author.id !== "370381633305575426") {
return;
}
await message.channel.send({embed: {
color: client.color,
title: "Bot restarting...",
timestamp: new Date()
}});
client.config.restart.server = message.guild.id; // Set the restart server
client.config.restart.channel = message.channel.id; // Set the restart channel
client.fs.writeFile("./config.json", JSON.stringify(client.config), (err) => console.error); // Save the config.json file
client.destroy();
process.exit();
};
Ping with response, please.
console.log client, message, and args @floral bloom
Maybe you're passing them in the wrong order.
Also, ```js
client.fs.writeFile("./config.json", JSON.stringify(client.config), console.error);
@warm marsh Thank you! I forgot to put one thing in the list of things to export.
How in the heck do i change the status on python discord. (presence). Ive looked everywere.
@unique wagon I don't know Python, but maybe try this: https://stackoverflow.com/questions/49968002/discord-py-change-presence
Ok thanks!
pymongo: when attempting to connect to database with pymongo.MongoClient(url), returns error: The DNS operation timed out after 20 seconds
pings are welcome.
what db are u using
Thought so, And is it on the same device?
mongodb is a web database and does not require any installations.
I tried putting incorrect passwords and it returns same error.
prob another thing causing error?
Hmmm not from my experiences.
It works fine on pc, but does not work on mobile (with python installed)
I mean yes mongodb is a web database, but I am sure to use pymongo u need software
oh....
hmmm...
Mobile, you mean android?
Hmm.......
its not my wifi, its pretty fast
yes but is it connected?
network is good, I even tried using vpns like 8.8.8.8
it is connected
not a wifi issue.
8.8.8.8 isnt a vpn
the google one
And DNS is network related.
whatever its called
yes google dns
hmm
Did you type one thing wrong incorrectly?
hmm...
I made sure everything was perfect.
I use the connection string with usename:password format, are there any alts in connecting?
3.7
and is pymongo installed?
Ok that is strange. Two seconds.
ok
Have you messed around with any DNS settings?
on the phone?
nope
its using the default DHCP connection
I whitelisted all ips..
One person said they had the same problem with the ip 8.8.8.8
it has to do with the string or connection... i dont see anything wrong..
Is that related?
I mean I tried like 100 times without dns, and I tried using dns which didnt work either
I can only thing of ur vpn.
- think
A DNS timeout is probably the result of a networking issue. It could either be transient ( just a passing thing ) or either your machine running the code needs a configuration check that DNS protocols are allowed, or the Atlas instance is not running. Please also ensure you added your client application host address to the whitelist of allowed Atlas clients, or similarly allowed access from that machine. – Neil Lunn
you're sure the password is correct
yes
ok
the user is also correct
assuming it's just on your phone
id try turning off anything that changes your dns, etc
interesting
Yes it is,
ikr, ive been trying to get this to work for like hours
hmm, do you have another phoneto test it on without vpn?
not that its avaiable...
my phone doesnt have vpn
I even tried using mobile data to connect
wait, let me try something
nope
didnt work
I tried using 3 wifi networks
no vpns set up
oh I thought u said it did
using spectrum wifi + router that makes fake 5G wifi and 2.4G
bandwith
Ill show you the string formatting
it works on my pc so...
mongodb+srv://{username here}:{password here}@techcon-bot-p6ssu.mongodb.net/techcon-bot?retryWrites=true
the collection/database is techcon-bot i think
this format works on my pc so there shouldnt be any reason not to work on another device...
@unique wagon, is the formatting right? is there an alternate?
oof
I am not sure, maybe someone will work out a solution, I'll keep looking but maybe try researching the problem?
I tried researching for a long time, none of the solutions worked...
do you know if there is any other form of authencation for pymongo?
like this is using MongoClient
I think its using mongomotor
mongomotor?

I did lol. it looks really complicated
cmon. I have like so many lines of code... dont want to migrate connecting format... lol
http://mongomotor.poraodojuca.net/tutorial_asyncio.html just watching the intro and wow
ill research some more on MongoClient
Hey, do you know how to save an drag to upload file in HTML?
how can i add music commands on a system bot
Dragging a file to your browser triggers a redirect so maybe you could catch the redirect, use regex to check if the location is a filename and if so cancel the redirect and upload the file? I’ve never looked into it so I may be way off but that’d be my first instinct @earnest phoenix
<input type="file">
</input>
@earnest phoenix
For further info: https://css-tricks.com/drag-and-drop-file-uploading/
Hello! I wanted to add a server infomation for discord python.
Showing like how much ram is used on the server and a graph of drive speeds and stuff. How can i do that?
message.member.nickname ? message.member.nickname : message.author.username is true?
how can i add music commands on a system bot
@earnest phoenix do u even know coding?
no
TNX
how can i cover the whole screen with that background??
hi have 0 money why this don't return?
it will return the promise coming from .send
either put the message.channel.send on a new line, or put a semicolon after return
still don't return
why?
Is the value 0
Or NaN/undefined
Because NaN < 25 would be false
If it is actually 0 then that part of code probably isn't being executed
Which we can't help you with unless you provide more of your code
Try logging money right above that line
if (!isNaN(money) && money < 25)
basically if money is a number, it will check the money if its less than 25
if its not a number then instant return
the bug continues idk why
what is your current code rn
Because it's probably undefined then
It’s your css likely doing whatever it is
ok 😄
how do i kill all bot instances lol d.js node.js
Like shards?
Turn off auto-restart and run a restart command so that both processes are killed
found it
Then start it back up after a few seconds
@late hill isNaN fixes the undefined
isNaN(undefined) //true
since I included ! on it
this will instantly return
o
uhh
what do you mean?
can i not just load stuff immediately to use later so i have a reason to use a loading screen 
you want a loading screen where? in your bot?
or are you working on a desktop app?
cli
what are you loading? images/files?
files yes
you can load them whenever you want, doesnt need to be at the beginning
ill just do a settimeout loading screen for looks
hey, is it easy to make a discord bot that allow me to type !timeleft and it will show me how many days/hours to a weekly event?
yes
it's fairly easy
^
so a reminder bot but do it every week
Where and when exactly do i put the code when developing a bot? followed 3 tutorial articles and i still dont know how.
what code
of the bot i want
lmao
what you do is dependent on language
i use js
where do i put the code
in a js file if youre using js
oh the bot will include a command to provide countdown timer before the weekly event started
@mossy vine aight
python has more complicated stuff than js wym
Easier to use and define variables
import discord.ext.command thing thing
from my experience
const discord = require("discord.js")
is "const discord = require("discord.js")" something node.js?
ok
require doesnt exist in browser
hey I haven't done a bot in js yet reeeee
what do you use in browser
any suggestion on how to develop this bot to solve my problem 🤣
first step
so i don't get lost
script src
@buoyant lake google "simple discord bot <language>" and try to find one that shows it in detail
start with the basics
programming language*
english
"what language do you use"
"english"
english is a programming language
lmao


what do you call a bot that shows the time left before an event if you type a command
countdown bot?
there are reminder bots
which are similar, idk if they show you the time left, some might do
you can try looking for reminder bots, countdown bots, schedule bots or something like that
i believe a few already exist
well, tbh i only want one function not the extras..
maybe i'll try to develop myself
a simple that set timezone, weekly event and the time left before the weekly event started, just 3 commands
but i'm just afraid that it's costly to develop a bot like this
depends if you self host or buy a vps
if you do everything yourself its mostly free
except the hosting, if you chose to go for a good vps
self-hosting, glitch, heroku, and some other weird shit are free
google and amazon are free for 12 months
an entry level vps (better than all of the above) you can find for $3 a month
@fiery birch
and other hilarious jokes

i like had no ban ever lmao
i change change tahat for youho jk me not funny
For anyone who can help:
I have a test help command that uses reactions to navigate through it, but the inly thing working atm is deleting the message, im not able to remove reactions or edit the message it would seem...
Link to code:
https://hastebin.com/tiforemode.js
No Errors.
Please Ping or DM me, as this chat fills up quick 
idk where to put this 😦
which bot counts msgs without premium
Unicode, that link is invalid
+2
const authorizationKey = '',
webhookID = '',
webhookToken = '';
const express = require('express'), //
app = express(), //
bodyParser = require('body-parser'), //
morgan = require('morgan'), //
{ RichEmbed } = require('discord.js'), //
{ WebhookClient } = require('discord.js'), //
hook = new WebhookClient(webhookID, webhookToken);
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(morgan('combined'));
app.post('/vote', (req, res) => {
var authorization = req.headers.authorization;
var bot = req.body.bot;
var user = req.body.user;
var type = req.body.type;
if (!bot || !user || !type || !authorization) {
res.setHeader('Content-Type', 'text/plain');
res.statusCode = 403;
return res.end('MISSING_PARAMS');
};
if (authorization != authorizationKey) {
res.setHeader('Content-Type', 'text/plain');
res.statusCode = 403;
return res.end('WRONG_SECRET');
};
if (type === 'upvote') {
var embed = new RichEmbed({
color: 3447003,
title: `Yeni bir oy alındı!`,
description: `<@${user}> bota DBL üzerinde bir oy verdi!`,
timestamp: new Date()
});
hook.send({ embeds: [embed] });
res.statusCode = 200;
return res.end('OK');
} else if (type === 'test') {
var embed = new RichEmbed({
color: 3447003,
title: `Başarılı!`,
description: `DBL test başarılı Votehook düzgün şekilde çalışıyor!`,
timestamp: new Date()
});
hook.send({ embeds: [embed] });
res.statusCode = 200;
return res.end('OK');
}
})
Vote.
@earnest phoenix
🤦
lol?
WTF? LOL
sadasdasdas
No
@earnest phoenix i eat your name
what I'm trying to do is to vote with webhook @earnest phoenix
@earnest phoenix d:
Other languages in #memes-and-media
Does default guild icons have a hash ?
no
Which one looks better?
2nd one @earnest phoenix
^
is 1/4 red better?
actually no that looks like garbage
oh shit
lmao wrong chat
sorry bout that
Here's the final version.
@tawny oar not minimodding..
why does it need tts
TTS is inherent in that server
It's a private server so basically everyone has permissions
`- bots @user* Shows all bots of that user, includes bots in the queue.
- owner / -owners @bot`
how to do this?
Do what exactly
Any idea why this is happening
All I’m doing is:
moment(member.joinedAt).format('DD [days ago]')
`- bots @user* Shows all bots of that user, includes bots in the queue.
- owner / -owners @bot`
How to recreate these orders?
Which should be way more then 30 days
@earnest phoenix use an api
He’s probably trying to do what Luca does maybe?
I know that, but I can't find anything on it. @mossy vine
Where you can get the bots the owner has
@lusty dew
No, I'd like to redo these two orders.
Why the random ping
I've already looked at this.
moment.utc(member.joinedAt).format('DD [days ago]')
np
Didn’t work though
Yo im getting a discord bot made any1 now any good things or features I can add to it anything
You don't have to spam the same message
- you might get either muted or kicked for spamming idk
How can I make a reload command?
Like if I do:
-reload eventName
Or
-reload commandName
It’d reload the command or event specified
unpopular opinion: pm2 is a piece of shit jesus effin christ
That is unpopular
@quartz kindle other times i see you talking about how great pm2 is, what happened lol
its great for simple things, but once you want to interact with its api and do shit with it, then oh my god
like
pm2 has cluster mode, and vancy funcions for scaling, like pm scale process +1 to add a new instance
except the scaling doesnt update process.env, not even in the new process
so then you have x processes running an outdated process.env that shows the old process count
and my lib requires knowing how many processes are running lol
process 1: instance 0, processes 2;
process 2: instance 1, processes 2;
scale +1;
process 1: instance 2, processes 2;
process 2: instance 2, processes 2;
process 3: instance 2, processes 2;```
like wtf
Were you talking to me?
no lol
reloading a command is easy, if you use separate files for each command
Anyone need js help?
if someone needs help they'll ask
what do when your bot restarts but doesn't have any crash errors/issues
@quartz kindle I got that part done I think
Now I’m just trying to figure out how to tell if I’m reloading a command or an event
if(client.settings.bot_dev.includes(message.author.id)) {
const input = args[0]
switch(input){
case 'Event'.toLowerCase():
try{
delete require.cache[require.resolve(`../events/${args[1]}.js`)]
message.channel.send(`Sucessfully reloaded event: ${args[1]}`)
}catch (err) {
message.channel.send(`Unable to reload: ${args[1]}`)
}
case 'Command'.toLowerCase():
try{
delete require.cache[require.resolve(`./${args[1]}.js`)]
message.channel.send(`Sucessfully reloaded: ${args[1]}`)
}catch (err){
message.channel.send(`Unable to reload: ${args[1]}`)
}
}
Any idea why this
Sends both and doesn’t reload the event specified
because it fails, but also runs the send
try {
delete
} catch {
send 'error'
}
send 'success'
Ah okay
Okay well it says it successfully reloaded the event but it didn’t output the change I made in the file when I made the event run
did you re-require it?
how can I make a bot that makes an animated channel
?
what
Joe do I hire bot
@inner jewel wdym?
Can I pass a server so you understand what I say?
no
i already told you that you don't create ""animated channels""
it's API abuse
okay
Hey cry is that discord or some other platform in the ss?
discord
Canary?
and that the state changes every time?
stable with beautifuldiscord
what
Oh cool
a okay but the api abuse is reportable
can you report me for api abuse, i'm new to this
yes
well
no
each endpoint has it's own ratelimits
the endpoint to change your presence is generally set at x requests/y seconds
I have not understood very well because I speak little English
so people calculate the minimum amount that's allowed before you get ratelimited
I have not understood everything very well
ok
@shut rose Yo hablo espanol 
esque necessito ayuda
que no entiendes
porque quiero hacer un bot que canvie el nombre de un canal cada unos ms
ah
y me han dicho que eso es api abuse
que tienen que ser 15k ms
es pidiendo mucho informacion cada uno ms y eso crea lag
y te pueden banear de discord para cosas asi
porque es considerado como
"DDoS"
aaa
:(
sip
y que veas claramente de lo que hablo
you're providing false information
it isn't considered as a ddos
that's not even what a ddos is
client.loadCommands = (callback) => {
client.commands = {};
fs.readdir('./commands/', (err, files) => {
if (err) {
client.log(`Error loading commands : ${err}`);
return;
}
files.forEach(file => {
require(`../commands/${file}`).load(client);
});
// console.log(Object.values(client.commands))
callback();
});
};
client.loadEvents = (callback) => {
fs.readdir('./events/', (err, files) => {
if(err){
client.log(`Error loading events: ${err}`)
return;
}
files.forEach(file => {
if(!file.endsWith('.js')) return;
require(`../events/${file}`).load(client)
})
callback()
})
}```
*Btw for anyone who can help me with my reload command this is my cmd & event handler and if needed I’ll resend my reload cmd code*
With my code or his?
@lusty dew
oh :(
Mk
Well it’s not reloading the event or cmd properly
It says it has but ofc it hasn’t outputted the new changes
For anyone who can help:
I have a test help command that uses reactions to navigate through it, but the inly thing working atm is deleting the message, im not able to remove reactions or edit the message it would seem...
Link to code:
https://pastebin.com/RK9MGZbM
No Errors.
else if (message.content.toLowerCase === 'fuck'){
message.delete(1000)
message.channel.send(`Please watch your language, ${message.author}`)
}```
why wont this command work
what about it doesnt work
Just saying "I get an error" doesn't give us enough information on your problem
the bot does not reply to it
or deete the message
it just doesnt do what it is supposed to
because you're using toLowerCase as a property, not a function
oh
how do i fix that
you should probably backtrack and learn js first
im sorry.. im a beginner
else if (message.content.toLowerCase() === 'fuck'){ like this?
yes like that
thanks. finally a nice person 🙂
yep that looks good
else if (message.content.toLowerCase() === 'fuck'){
message.delete(1000)
message.channel.send(`Please watch your language, ${message.author}`)
}
else if (message.content.toLowerCase() === 'shit'){
message.delete(1000)
message.channel.send(`Please watch your language, ${message.author}`)
}```
it only works if message starts with it
also you can get syntax highlighting if you write ```<language>
code
```
that problem originates from a different part of your code
so like ```csharp
bool e() {return false;}
```
would look like
bool e() {return false;}
btw a cool trick is ['word1, 'word2'].includes(message.content.toLowerCase() so you can just make an array of words instead of a ton of repeated code
if (['word1', 'word2'].includes(message.content.toLowerCase())){
message.delete(1000)
message.channel.send(`Please watch your language, ${message.author}`)
}```would look like this
and you just add words to the array instead of making a new else if every time
not to discourage you or anything, but youd need a much more sophisticated system to implement a strong chat filter
also, before you waste too much time, word filters are useless and you shouldn't spend your time and effort on them
they'll always be bypassed no matter how hard you try
i just said that but in a nice way 🌚
Wasn’t there always limitations with making swear filters because people could bypass it numerous ways?
ye its way too easy to get around them
I’ve only thought of a few ways out of the many problems there are
you can use an overcomplicated regex to match different joiner chars
its just too much effort for a negligible reward though
basic chat filter is enough for most people
['fuck', 'shit'].includes(message.content.toLowerCase() {
message.delete(1000)
message.channel.send(`Please watch your language, ${message.author}`)
}```
it says it is a property
if (...)
- Delete spaces when reading the content (if possible) so they can’t do F U C K to bypass it
- When the bot reads the content make it all lowercase with toLowerCase() (if possible)
np youre new youll learn all this stuff
cant just delete spaces because what if their sentence is something like "i went to the car wash it was great"
that would ban sh it from wash it
youd need to check if there are letters around
else if (['fuck', 'shit'].includes(message.content.toLowerCase() {
message.delete(1000)
message.channel.send(`Please watch your language, ${message.author}`)
}```
you forgot two closing parens
I mean washit isn’t a word though?
Eh true
if you delete all the spaces youd be left with giant strings
i assume youd look for the "bad words" within it
True.
where is closing parens
That’s true.
Didn’t think that far ahead 😂
you forgot to close includes( and if (
so youre missing two parenthesis after toLowerCase()
install this tool called a linter. it will help you find syntax errors like these
yea
linter is taking a long time to download
Yea
its a complicated program
Sometimes they do
it has to read all of your code and search for all kinds of errors
what does linter do
now im worried that you just installed some random shit called "linter"
Helps you point out erroring lines
That actually helps you setup eslint didn’t know that
best case scenario is that there'll be 1,114,112^1990 ways to bypass the word filter
djs.guide is op
I used another source
i cant even remember what i used
no i did npm install eslint
sorry english is not my first language
It took mine 2-3 minutes to install
ok. linter is installed what now
Though I had shitty internet
read the thing i linked like 3 times now haha
Read the guide
ok
It will help you setup the things you need
Okay now to go finish the billion things I need to do to finally push my new update
😂
so i just did the maths
this is the amount of ways that can be used to bypass a word filter on discord
on a best case scenario
Uhm
that number could be doubled with three letter words
That’s a lot of numbers
yeah
unicode has a possible 1,114,112 characters, power that by an estimate of the character limit
most calculators will overflow on that because it's so huge
it's why making a word filter on discord is useless
there is

some bots have that
Really
im just going to fix it later
it's reasonable for example in minecraft as the charset is limited and the character limit is 256
i think most of the apis are paid though
Not like I want to add it to my bot cause it’s basically pure nsfw
you can always make your own image recognition tool
But it was just a thought
but yes that kind of thing does exist
making your own recognition tool by yourself would take ages
even if you used an AI service like tensorflow
100%

