#development
1 messages · Page 678 of 1
Yes.
Shouldn’t it tho
If(!util.uptime() >= 30) {
Blah
}
{else
Blah
}
@quartz kindle tbh should stop it
that doesnt stop it
look at the code flow
the ready event fires only once
once the ready event fires, your code proceeds, until it reaches the if
at that point, if the uptime is bigger than 30, it fires one of the intervals, else, it fires the other interval
then the interval proceeds to run forever
the code never goes back to the if
and intervals always run forever unless you stop them
also, checking for the uptime is redundant, because the ready event only fires once the bot is fully booted

@dapper glade how? If you use split options, the message will automatically split with a new line or a custom character if specified if it’s over 6000 characters
Unless you’re having the problem with embeds, there’s no split options for an embed
@abstract crow is the error during ejs processing or after? if its after, then it would show in the browser console, not in the server
Oh I’m using embeds.
embed fields have a max of 1024 chars each if im not mistaken
and embed description should be 2048
@quartz kindle How do I tell? I can't even load the page as it just hangs with the error
Sentry detects it though
Like if I go through my sentry account I can most of the time see the error but no one wants to do that.
I get nothing on the website console
are you using express?
you can try using the express error handler, or you can test a try/catch block in some places to see if they do anything
@hollow saddle Thank you
@quartz kindle yeah. I want it to go to the else
So the flow is perfect it just isn’t working
@pine aspen thats not how it works, i told you the way it works
so you have to change your code to make it work
a ready event will always fire only once, so an if statement inside a ready event will also only run once, so one of the options inside the if will always run, and the other will never run
K
Just dont spam your long description with nonsense
Yes except that the first time I put it at 15:51 he answered at 16:41 and I put it at 17:45 he still not answered 😭 @cursive dagger
Just wait
ily faq 2
Click the link to get more information on the question:
2) How long is approval?
And why are you sending this in 2 channels
How could I get info on a user/change their nick with their username
Also a mod may want to change my name so it’s easier to read/ping
i n
w h i c h
l i b r a r y
D.js
have you checked the documentation
Or whatever
what's your code
I know some bots do it idk if they use username or current nickname in the server
you can access their username, and then use it to change their nickname
what's your code
and what's the stacktrace
take a look at the docs, specifically guildmember and user
users have usernames, guildmembers have nicknames
they are two different things
msg.author: User#username
msg.member: GuildMember#nickname
or
msg.member: GuildMember.user#username
¯_(ツ)_/¯
Okay thanks
error404 module not found please try again later xD
error 500 internal brain error please try again later
RFJ Bot ranked A on Codacy
Can some people look at my code and tell me if its efficient or not?
if you pay me
no u
@tight heath I will give you nothing but happiness if you give me a compliment
thats a good deal
you're a cool person
thats pretty ok
:)
c:
I cri
@tight heath Here it is: https://github.com/RFJ56/RFJ
@tight heath I wanna read you for free
@mossy fjord have you ever used a .gitgnore
yeah I through that together real quick thougj
so you're asking for a QA review
but also
"I through that together real quick"
that totally makes sense
@unique nimbus I should make a bot that runs your code through a randomly picked eslint config
and sends you a dm on every error or warning

@tight heath do you not like eris?
You should just add me as 2nd owner and friends privilege smh
i do not like eris indeed
i would add you to the team but that'd require me actually coding that bot
instead of goodboy aero
lmao
i use eris cause discord.js is heavy asf
yes eris is not heavy
it doesn't at all still contain selfbot classes

anyways
i think imma add a lint command
which just runs against my eslint config

you don't use eris I thought.
yes that is infact the reason I don't
but yeah that command could be useful
maybe for beginners 
see anything else wrong with my code though?
and in remembrence of RFJ I'll add a gitignore generator
@mossy fjord npm i -g eslint nekiono/eslint-config-raven
run it against my eslint config
:p
lmao
that way i dont have to read it
i can tell you the first error except indents:
global-require
that it?
can be concatenated
and for the other errors you gotta pay me
tyvm

because why would I do a code review for you
if there's people working in QA
which get paid 5 grand per month to do just that
QA?
@tight heath Pay me 5 bucks and I pay you 4.99 bucks
Quality Assurance
what tf is qa?
where can I get a code review for free lmao?6
nowhere cuz that's not how life works
🤣
why would anyone voluntarily look at your scrambled egg code without anything in return
why do you need a code review
just write tests if you need it that badly
im sure hes looking for more than just synthax and tabs vs spaces review
optimally my config cuz it's the one and only best
i mean his syntax is suboptimal so might wanna start there
which is never gonna happen for free
¯_(ツ)_/¯
how u know?
ahh
meh 404
lmfao
anyways
for actual QA
yikes
either pay
or enslave someone
for aero.bot, I have stitch@aero.bot

like aero is the most dope project for me
neither do i code
because rxsto does most
nor do I QA
I'm currently just paying the bills and doing PR
even though I could code
🤔
I need to move to typescript anyway
Typescript good
Why should I switch though?
If your project is complex and has many classes it's worth it
It doesn't bring much performance improvements, it's typescript, not fastafscript
But it makes everything more structured, shorter, and easier to maintain
would it help when moving to a class based setup.
Not gonna explain the concept of object oriented programming 
JavaScript is pretty limited in things like that
But why not read a blog bout it 
https://itnext.io/why-use-typescript-good-and-bad-reasons-ccd807b292fb
oop langs 👅
how can I delete more than just one message on python ?
How i can delete 1 word :/
on quick.db
i pushed blacklisted words
Alright I got my soundboard working, what other cool features do your bots have I can try and code?
@GoLdEnDrAg#1979 bulkDelete
i want to remove T3DY throw a command if is posible
"T3DY": {
"bot_name": "eu",
"commands": "dau",
"status": "salut"
},
"ѕcη HitMan 240fps": {
"bot_name": "sa",
"commands": "imi",
"status": "bag"
}
}```
It's a json
Command like => .done name invite_link
hi
Pardon me if this is a dumb question but is it suggested if I use a database if I want to make an economy system? I'm unsure where to start and would like a few resources.
You should use a database
You could use for example SQL, SQLITE, MongoDB etc
I don't recommend JSON as it can corrupt
mongodb seems a lot more comfortable for me
I was kind of nervous asking because I don't want to seem like I'm asking for too much
There should be tutorials for it online
bulkDelete is alright but it doesn't give you the ability to delete messages only from certain types of users, so say you want to delete newmember messages but want to leave moderator and trusted mesages it's not a good command to use, it literally deletes everything
¯_(ツ)_/¯
thank you for the suggestion tho
np
You're calling browser on something that doesn't exist or is already undefined
tf??
@stark obsidian what?
can you not read lol
I have solved it, thanks.
https://hatebin.com/mhbwzcoemo I keep getting that error when someone who’s lower role then me/me being the server owner tries to change my nickname
But it says they have successfully changed my name
on what are you calling setNickname
nMember.setNickname
what is nMember defined as
let nMember = message.mentions.members.first() || message.guild.members.find(member => member.user.username === input)
That’s not the problem here
I can tell you that
Cause I’m able to change their nicknames
do you know what the error means
no
Yea?
You're calling setNickname on something that doesn't exist or is undefined
How so
args[1]
let nickname = args[1]
let nMember = message.mentions.members.first() || message.guild.members.find(member => member.user.username === input)
if(!nickname){
message.reply('You need to give me a nickname to name this user')
}
if(!message.member.hasPermission('MANAGE_NICKNAMES'){
message.channel.send('You do not have the proper perms')
}
nMember.setNickname(nickname)
I don’t think I’m doing anything wrong
When i put my bot into a docker, am i correct that i have to let docker start pm2, let pm2 start shardmanager, let shardmanager start bots?
You're not defining input in that code snippet
I forgot to add it
But it’s defined
Input is defined as args[0] btw my bad
I’m telling you it’s not that
The error states permission problems
the hastebin you send is your error right
Yes
There is two things
One of em doesn’t make sense it doesn’t error when I change nicknames
And the other is missing permissions
nobody can change the server owner nickname
if the bot is under the persons name you are trying to change it will throw that error as well
The bot is at the Top
does your bot have the correct perms in the server?
Yes.
does it have admin perms?
Yes.
Im not sure then.. those are the only things I can think of that would stop you from doing this
User doesn’t have perms 
unless the || statement is interfering somehow
Like he said member can’t change server owner nickname
That’s what I’m trying to add a check for
So it won’t send 403 errors
then you would check it by your ID
.
so you want it to only be you that does it right? or the server owner?
if(message.author.hasPermissions("PERMISSION_TAG"){ YOUR CODE HERE }
This what you are looking for?
no you are doing message.member
I'm confused. So I'm using kurasuta to shard my bot into clusters.
So i set my cluster count to 2 (2 shards per cluster) and then evaled client.shard.broadcastEval("this.ws.ping") But it only returned results from the current cluster the shard was on
and in the docs it says broadcastEval will contact all clusters
@earnest phoenix that’s not a thing
whats not a thing?
Users don’t have a permission object
Message.author is a user collection
Users don’t have permissions
Members do
It's not a collection
it's just a User, hi. Im here to make your day hard. :+1:
If you use that tag it wont work
Users dont have a hasPermission method
Because, well, theu dont have permissions
GuildMembers do.
oof
it is message.member not members
you are right.. sorry I have a lot of code
if (!message.member.hasPermission("ADMINISTRATOR"))
there you could use that then
hmm sorry bud then I am not sure.. I was having missing perms problems as well just recently but it was something completely different
if (!nMember) return
nMember.setNickname(nickname)```
Not what I’m trying to do
setNickname is the issue
Hm?
not you sorry I was talking to chakung
try this
let nickname = args[1]
let nMember = message.mentions.members.first() || message.guild.members.find(member => member.user.username === input)
if(!nickname){
message.reply('You need to give me a nickname to name this user')
}
if(!message.member.hasPermission('MANAGE_NICKNAMES'){
message.channel.send('You do not have the proper perms')
}
if (!nMember) return;
nMember.setNickname(nickname)```
I saw you had an error for setNickname though in your hastebin
Yea that error no longer happens
does anyone know how to define the lng and lat in this tree? (random location) I've tried doing variations of body.results.geometry.location.lat but it doesnt seem to work.
body.results[0].geometry.location.lat
You're welcome
new error: Cannot read property '0' of undefined
i dont know why that wouldnt work though since its pulling from the tree
unless im not understanding right its finding it in the aaray
array
@south lantern
let longitude = body.results[0].geometry.location.lng```
returns that tree
or well the code above does
and im trying to pull the lat and lng from it
nevermind I got it
I just wasnt parsing it
🤦
for (let result of body.results) {
let latitude = result.geometry.location.lat;
let longitude = result.geometry.location.lng;
console.log(latitude, longitude )
}```
@gritty bolt
{
"T3DY": {
"bot_name": "eu",
"commands": "dau",
"status": "salut"
},
"NAME2": {
"bot_name": "sa",
"commands": "imi",
"status": "bag"
},
"NAME3": {
"bot_name": "443214",
"commands": "4566534",
"status": "12dfsdf"
}
}
i want to remove the name3 with a command , like .donebot @name3#1414 TEXT
I just want to remove the name i mention
what i wave now if(msg.content.startsWith(prefix + "donebot")) { msg.delete() const player = msg.mentions.members.first(); const args = msg.content.slice(prefix + "donebot").split(' '); const invite = args[2]; player.send(invite); delete all[player] fs.writeFile("./lol.json", JSON.stringify(all, null, 4), err=> { if(err) console.log(err); }) }
what would cause a DISCORDAPI ERROR Unknown Message?
ok , i'll try it
or maybe delete all[player.username]
When i put my bot into a docker, am i correct that i have to let docker start pm2, let pm2 start shardmanager, let shardmanager start bots?
@south lantern it works with [player.user.username] so thx very very much
👌
discord api error of unknown message means you're trying to operate on a message that doesn't exist/wasn't seen by your bot
yeah
@valid frigate do you know how I can prevent that from restarting my bot exactly?
i thought it was a promise rejection, it wont crash your bot
but
assuming you have a message handler, you can just use .catch after it to catch all errors
Its crashing it
messageHandler.dostuff(message).catch((e) => {
// all errors will be caught, you can handle them here
})
It a DM feature
No its one of the features we have. I made a Pokemon bot and its a raid reminder for raid bosses
ah
if your bot is in js take a look at try/catch or promise catching
that's how you prevent your bot from crashing, since the only way it can is being thrown errors by djs/the node process itself
I still have a problem on my command because if he has 0 gem he can sell and his -1 when he should not
case "s":
// Content available in args[0]
const test = [
'money', 'gem', 'prayer',
'gun', 'chains', 'leaves', 'nothing'
];
// Return message if the user dont enter a item
if (test == null || args.length == 0) return message.reply('You must specify an item to sell.');
// If user have amount of this item (gem)
if (test.includes(args[0]) && parseInt(args[1]) > 0) {
if (args[0] === test[1] && args[1] >= 1) {
let gemMoneyWon = 50;
data[message.author.id].gem -= args[1];
data[message.author.id].money += gemMoneyWon * args[1];
message.channel.send(`[PNG]**Thanks** ${message.author.tag} **the gem can serve me to create beautiful thing!**`);
write();
} else {
message.channel.send(`**Sorry** ${message.author.tag} **you havent this amount!**`);
console.log('nop')
}
}
function write() {
fs.writeFile('./data.json', JSON.stringify(data), function(err) {
if (err) console.log(err);
});
}
break;
There's nothing in your code that checks the users current gem balance
That's the problem you're having
Other than that, it would be a great idea to use a database rather than a json file
Your test == null check is redundant as you're setting it right before
For now I'm doing tests in the future I'm counting on using mysql
And you parseInt() in one of the checks but then remain to use the unparsed data
Which works in javascript but I wouldn't do that
You'd be better of storing the parsed int in a variable and then using that
like js let parse = parseInt(args[1]);
Yes
And make sure you check if the value is an actual number
Actually the check you have will already do that
Any condition with NaN returns false afaik
Ok so i can do
if (args[0] === test[1] && args[1] >= 1 && data[message.author.id].gem >= 1) {
let gemMoneyWon = 50;
data[message.author.id].gem -= args[1];
data[message.author.id].money += gemMoneyWon * args[1];
message.channel.send(`[PNG]**Thanks** ${message.author.tag} **the gem can serve me to create beautiful thing!**`);
write();
}
Still isn't parsed
Combine it with your previous line of code
And use parse instead of args[1]
case "s":
// Content available in args[0]
const test = [
'money', 'gem', 'prayer',
'gun', 'chains', 'leaves', 'nothing'
];
// Return message if the user dont enter a item
if (test == null || args.length == 0) return message.reply('You must specify an item to sell.');
// If user have amount of this item (gem)
let parseAmount = parseInt(args[1]);
if (test.includes(args[0]) && parseAmount > 0 && data.[message.author.id].gem >= 1) {
if (args[0] === test[1] && parseAmount >= 1) {
let gemMoneyWon = 50;
data[message.author.id].gem -= parseAmount;
data[message.author.id].money += gemMoneyWon * parseAmount;
message.channel.send(`[PNG]**Thanks** ${message.author.tag} **the gem can serve me to create beautiful thing!**`);
write();
} else {
message.channel.send(`**Sorry** ${message.author.tag} **you havent this amount!**`);
console.log('nop')
}
}
function write() {
fs.writeFile('./data.json', JSON.stringify(data), function(err) {
if (err) console.log(err);
});
}
break;
Why do I need to implement my own iterator function when this.levels is an array?```js
import { Message, TextChannel } from "eris";
import { CustomClient, settings } from "..";
type LevelCheck = (msg: Message, client: CustomClient) => boolean;
export default class {
public levels: LevelCheck[] = [
// LEVEL 0, BOT OWNER
(msg, client) => msg.author.id === client.owner.id,
// LEVEL 1, BOT STAFF
(msg, client) => {
const SUPPORT = client.guilds.get(settings.support.guild);
if (!SUPPORT) return false;
const member = SUPPORT.members.get(msg.author.id);
if (!member) return false;
return member.roles.includes(settings.support["staff-role"]);
},
// LEVEL 2, GUILD OWNER
msg => msg.channel instanceof TextChannel && msg.author.id === msg.channel.guild.ownerID,
// LEVEL X, ANYONE
() => true,
];
checkLevel(message: Message): number {
for (const [i, level] of this.levels) {
}
}
}```
wait nvm
nvm the nvm
I made LevelCheck itself an array, still no luck... ts type LevelCheck = ((msg: Message, client: CustomClient) => boolean)[];
Why i can't join in lithium server
how to make something like that u only can run an command every 60min
You could do something like
If (time.now-time.then = 60 min)
@opaque eagle js
discord.js is not a language
save when the user last ran the command in a database, when they run the command again check if 60 minutes have passed, if yes, add new value into database
In discord.js is : ``` const cooldown = new Set();
if(message.member.hasCooldown) {
//code
message.author.add(Cooldown)
setTimeout(() =>{
colldown.delete(message.author.id}, //time} ;```
@stray garnet
the code you posted also has many issues
Doesn't mean it's a good or scalable solution
Im in mobile
Also that code isn't even real
(node:15711) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
what does error mean
Incorrect token
@stray garnet the token is not valid
Maybe your bot got banned, or the token has been regen
YO wzf my token regened randomly
Firstly my Discrim Changed and now the Bot Token wtf?
Contact discord, if the token doesn't work after regen
Did you upload it to GitHub?
Token change if the bot is api banned or something like that
Cause discord has been automatically regening tokens that were
Token only change if the bot got banned by discord or if the user regen it
Try put the new token @stray garnet
I've noticed my tokens get regen too but the old still works despite being different
If it doesn't work contact discord
my PC just died
Reminds me of that time I uploaded my token to github and someone made it into a sub 2 pewdiepie bot
Lmao
Hello, I have a problem with ffmpeg, as my bot joins a lounge he leaves directly without leaving a mistake (bot music)
you need to put the ffmpeg folder in your C:/
Its a little bit hard to install
Look on youtube how to install it
@stuck ravine
@stray garnet when u restart the bot 1000 times the token regen automatically
What no
Yeh
i... don't think that's how that works
you would have to regen it manually
that's not how it works
glitch is bad tho
And yes that's not how it works
Omg
http://prntscr.com/ov34lp unless you're talking about the discord api websocket
@earnest phoenix btw my bot works again
Cool 
@grim aspen this is what im talking about
That's just the websocket
Like if a bot edit a channel 1000 time in a day
He can get api banned for 1h
Hi there! How can I make my bot rejoin DBL? It has not been kicked or anything, I made it leave by accident ... shame on me
contact a mod
allright thanks
lmao might have happen with my bot, had a bug that created an infinite loop of my bot quoting itself
Making a chatbot be like
Anyone know where I can contact suggestion bot's support server? Checked Google but I can't find anything
is that bot in dbl?
474240839900725249 I googled the ID as well, I only find it's invite link
It's like it completely vanished from the internet
But I'm sure I found it from disbordbotlist
-botinfo 474240839900725249
That bot wasn't found
not on dbl
it was
Did something happen?
It doesn't seem to have a support server
it's probably abandoned
Ah shame
I've been using it for a while and just noticed the ban function doesn't work and banned users are still spamming suggestions
Any alternative?
bruh
bruh
Why were votes reset in the middle of the month?
Good question
So, no official statements?
general pin
can somebody tell me how to await messages correctly in dc.js v12?
because i am too stupid for dis
Look for discord.py @earnest phoenix
MySQL question
Okay so i'm selecting every distinct value in a column, now i want to count the number of rows for each of those values how should i do it?
a couple questions: can you do this on mac
and how do download discord.py instead of discord.js
what kind of question is that
install it
as long as you can write text you can code
not download it
I have python on my computer
run pip install discord.py
(on the terminal)
if you ask what a terminal is I'm done
I know what a terminal is.
nice
smh zsnails be constructive
break the cycle
anybody here wanna help this poor soul
alright
i asked the question above
oh okay
imma bout to run out of wifi signal
i may answer later today
(by later I mean 4 mins)
@copper cradle don't worry i found the solution after fiddling around
SELECT guild, COUNT(*) FROM `Emojis` WHERE guild IN (SELECT DISTINCT guild FROM `Emojis`) GROUP BY guild
thanks by the way 🙂
np
how can i collect multiple messages in one message collector so if someone types "1" that event will be triggered and when somebody types "2" annother event will be triggered. how can i do that with one message collector?
guise how to write discord bot in html
Javascript
can i write in json
TypeError: Discord.Richembed is not a constructor
``` ```js
const Discord = require("discord.js")
module.exports = {
function: function() {
console.log("lol")
},
testa: function() {
console.log("that is a normal function")
},
testn: async function() {
console.warn("That is a async function example")
},
onlybotowner: function(message, bot) {
let noperm = new Discord.RichEmbed()
.setTitle("Zugriff verweigert")
.setDescription("Nur der Bot Owner kann diesen Behfehl benutzen!")
.setcolor("#ff1100");
message.channel.send(noperm);
console.log(`-----Zugriff für einen User verweigert-----\nUser: ${message.author.tag} (${message.author.id})\nGuild: ${message.guild.name} (${message.guild.id})\n------------------------------`);
},
onlyservermod: function(message, bot) {
let noperm = new Discord.RichEmbed()
.setTitle("Zugriff verweigert")
.setDescription("Dieser Befehl ist nur für Server Moderatoren.")
.setcolor("#ff1100");
message.channel.send(noperm);
console.log(`-----Zugriff für einen User verweigert-----\nUser: ${message.author.tag} (${message.author.id})\nGuild: ${message.guild.name} (${message.guild.id})\n------------------------------`);
},
}```

are you on v12 or v11.5
require('discord.js').version
@earnest phoenix make the filter a logical or (content === '1' || content === '2')
ooooooh
ok
thanks
wait
ok so
i wrote a little testing script here but
my question was how can i handle multiple responses
this is my code:
else if (command === 'game') {
message.channel.send('What is your favorite game? Fortnite or Minecraft?')
const filter = m => m.content.includes('fortnite', 'minecraft', 'bruh');
const collector = message.channel.createMessageCollector(filter, { time: 7000 });
collector.on('collect', m => {
if (m.content == 'fortnite') {
message.channel.send('i hate u')
}
else return;
});
collector.on('collect', m => {
if (m.content == 'minecraft') {
message.channel.send('<3')
}
else return;
});
collector.on('collect', m => {
if (m.content == 'bruh') {
message.channel.send('**BRUH**')
}
else return;
});
collector.on('end', m => {});
}
just a example
call me a noob
but
idk how to implement your code there
or where
:/
ik but idk how it worked so i tried it like that
The reason your code won't work as intended is because you're misusing String#includes()
You can't just pass more arguments to it like that
im noob in coding ik
You could use an array with the options and then use .contains(m.content)
Which can still be done on one line if you'd like
["a", "b"].contains(m.content)```
thanks :)
Do note that the message content will have to be exactly what's specified in the option
ik
Dicord.js has a good documentation on implementing aliases
so idk if im just stupid or you all dont understand me,
i asked how can i do it like
i reply to the bot with 1 and he does that one thing
and if i reply with 2 he does the other thing idk how what you @late hill can help me with that
what i have here currently just makes it like that 2 answers do the same thing and i know how to do that
Your code should work if you changed the includes() thing
it doesnt :)
Send your current code
i actually didnt change anything because that what you said me i tried before and well
it didnt worked at all
So basically
You're asking for advice and not actually listening
Then wondering why it still doesn't work

im asking for a way to make a listener event listening to 2 answers, if the one occurs it does the one thing and if the other appears it does the other
Yes
I don't think you did
i did before i even asked here
im at a point where i just want to yeet my pc out of a window
Lol
doubt
fine
It'll work
It's just still dumb to have 3 listeners for it
You should change that too
But just changing the filter should do
ok so aigan
i tried it
i tried it with annother format
currently it looks like this:
else if (command === 'game') {
message.channel.send('What is your favorite game? Fortnite or Minecraft?')
const filter = m => m.content.includes('fortnite', 'minecraft', 'bruh');
const collector = message.channel.createMessageCollector(filter, { time: 7000 });
collector.on('collect', m => {
let collectedmessage = m.content
if (collectedmessage == 'fortnite') message.channel.send('why bro')
else if (collectedmessage == 'minecraft') message.channel.send(':)')
else if (collectedmessage == 'bruh') message.channel.send('bruh')
});
collector.on('end', m => {
message.channel.send('collector ended')
});
}
WHY DOESNT IT WORK
hi team! how do i correctly post the Total Server count using the dbl api when sharded? right now the website only shows the server count of one shard and i use discord.js
Or you know
ok
where exactly do i put them because i am so salty i cant even think normal anymore
I explained the issue
includes only accepts one argument
It doesn't care what you put beyond that
You have to use a different approach
Such as an array with the option and then using .contains() on that array
As I previously explained
ill explain aigan: i want to know why only the answer „fortnite“ works and if i respond with „minecraft“ or „bruh“ nothing happens. why?
yes
includes accepts 1 argument
It checks if the first argument is in there
Whatever you've put beyond that has no effect on the outcome
im just stupid oof
aren't we all
sorry for being stupid
lul
Q: how to keep bot active while your computer is not running
A: by not hosting it on your computer
hi, is there a module like named anti raid?
for example, 10 people entered my server in 15 seconds. i want to prevent this, i think discord-anti-spam doesn't have this.
@west spoke Do you remember when i said i had problems with my vote lock shit thing? yea i fixed it
@tight forum use https://altdentifier.com
@tight forum @urban igloo
however if you want tips on how to write this, we're here for you
Lockdown lets you lock and unlock channels and set mod channels
do you not read
i read
they want to make a bot themselves, not use a public one
how is that relevant again
the message under it confirms they want to write a bot
This just confuses me
then you shouldn't help if you're confused
dude, i think you dont understand me. I don't want written code, i just want to know if there is a npm package/module to prevent x many users to join in 15 seconds @earnest phoenix
there isn't, and that is written code lol
Why wouldnt you let members join within 15 seconds each time?
raids
Can we focus on the question instead
@earnest phoenix then every single npm packages/modules are written?
yes...?
then I ask for a npm package/module that prevents for example 15 users to join at once.
i doubt something like that exists
what cyber said is all you had to say at first...
Tbh tho who cares about how many people join in a spend look at how old the account is mainly when getting raided they use accounts under the age of 7 
@tight forum I get what you mean. I haven't heard of a module which does this but you can store a Map (I think) in the client which temporarily stores the joined members there and clears them after an X amount of time.
https://plexi-development.sucks-hairy-balls.xyz/7cj7i.png
People sell tokens of accounts that are old, that's how alot of these raiding programs work, you have to have a list of tokens.
hey, so i would like to download all images (in img tags) found on a website. can i do this with a script running in chromes console, and if so, how?
@mossy vine I know you can list them
not sure if you can download them
but you can use the list to download from a separate script
how would i download them
Well I download using https://www.npmjs.com/package/image-downloader
like if you have an array
you could just process all of them
var images = $$('img', document.querySelector('.devsite-header-background'));
for (each in images) {
console.log(images[each].src);
}```
https://oliy.is-just-a.dev/301kk6_981.png
it's in their dev docs
okay, figured it out with some help
Anyone has any idea of how to have the bot also publish post into an announcements text channel?
Excuse me but
How can I check for the last letter in a string
"hello"[0] returns h
But I want the last letter, can be any word without me knowing its number of chars
JavaScript please xD
In Ruby you can just use [-1] 😕
slice(-1)
@cry then every single npm packages/modules are written?

lol
Hi there, I'm trying to create a command using Discord.py and I'm getting an error with images.extend
import discord
from redbot.core import commands, Config
from random import randint
import aiohttp
import logging
import nekos
log = logging.getLogger("Interaction") # Thanks to Sinbad for the example code for logging
log.setLevel(logging.DEBUG)
console = logging.StreamHandler()
if logging.getLogger("red").isEnabledFor(logging.DEBUG):
console.setLevel(logging.DEBUG)
else:
console.setLevel(logging.INFO)
log.addHandler(console)
BaseCog = getattr(commands, "Cog", object)
class Interaction(BaseCog):
"""Interact with people!"""
def __init__(self):
self.config = Config.get_conf(self, identifier=842364413)
default_global = {
"hugs": [
"https://img2.gelbooru.com/images/ff/63/ff63a3c4329fda2bf1e9704d4e150fea.gif",
#Snipped some image URLs
],
}
self.config.register_global(**default_global)
@commands.command()
@commands.cooldown(1, 3, commands.BucketType.user)
@commands.bot_has_permissions(embed_links=True)
async def hug(self, ctx, *, user: discord.Member):
"""Hugs a user!"""
author = ctx.message.author
images = await self.config.hugs()
hugs = await (nekos.cat("meow")
images.extend(hugs)
mn = len(images)
i = randint(0, mn - 1)
# Build Embed
embed = discord.Embed()
embed.description = f":aqsuccess: | *{author.name} hugs {user.name}*"
embed.set_footer(text="Made with the help of nekos.life")
embed.set_image(url=images[i])
await ctx.send(embed=embed)```
My bot is using a lot of RAM (500mb) for around 21 servers. Is this normal, and is there any way I can reduce this large memory usage?
Any starting points you would look at? If it helps, I use discord.js with a MYSQL DB
i would optimize all your MySQL queries and make sure that you're not calling the database unnecessarily for tiny requests
i would also check all your events and make sure you're not overloading events
also check what you're caching, DJS caches a lot so it's possible your bot is just in REALLY big servers
Yeah, I know it's in this one. Is it possible to stop it from caching say users?
discord.js has multiple options to lower memory usage too, like disabling the TYPING_START event and clearing the message cache if you don't use it
And which function would do that?
Client.sweepMessages()
like disabling the TYPING_START eventthat won't change memory usage
from the ws code: js if (packet && !this.client.options.disabledEvents.includes(packet.t) && PacketHandlers[packet.t]) { PacketHandlers[packet.t](this.client, packet, shard); }
PacketHandlers["TYPING_START"]:```js
module.exports = (client, { d: data }) => {
const channel = client.channels.get(data.channel_id);
const user = client.users.get(data.user_id);
if (channel && user) {
/**
- Emitted whenever a user starts typing in a channel.
- @event Client#typingStart
- @param {Channel} channel The channel the user started typing in
- @param {User} user The user that started typing
*/
client.emit(Events.TYPING_START, channel, user);
}
};```
so it'll still parse the payload anyway
and even then the memory that gets allocated is just temporary and the next gc cycle will clean it
Hey I have an idea for the Action system, currently we get emails if we are out bid. Any way we could get a discord dm as well or instead? This would make bidding faster and allow for bids to happen back and forth.
<@&304313580025544704>
why
- not the channel for it
- you don't need to ping every moderator
i see a few issues here
- anything related to auctions belongs in #auctions-general or #557980762675085333
@west raptor sometimes I don't get the notification that I've been out bid till a hour or two later as email on a phone has to sync up, discord though would be an instant mobile notification
hey boss
@languid dragon my bad, ty
toLocaleString does it
@earnest phoenix don't ping mods to try get help faster, wait for a response patiently
How do you display a welcome message?
@plucky solstice that's a ouch.
They already have a auction system, also why the @Moderator ping
When your bot joins a server or when a user joins a server your bot is in? @zenith fulcrum
on_server_join for py (bot joining server)
on_member_join for py (user joining server)
@opaque eagle when a user
What language and library do you use
Java and I don’t know? I think node?
Ok do you know how you do client.on(“message”, msg => ...etc?
Yes
Same thing but instead of message, you do guildMemberAdd, and instead of getting a message in the function, you’ll get a member
client.on(‘guildMemberAdd’, member => {
// welcome here
})```
You can view a full list of events in the docs
yeet
try
'HELLO'.toLowerCase()
or
'HELLO'.toString().toLowerCase()
It's strange cause both toUpper and toLower are methods of string.
maybe ken overwrote them before?
Maybe try String(“hello”).toUpperCase()
but i dont see why that would cause an issue tho
node -v?
huh


it wont work 

i need it 
can you try in node cli
effort

pls help, i don't understand why none of my string methods work :(

people asking for development help be like
@languid dragon why do you need to use a defined sting method?
what's preventing you from doing
aStr = "hello";
aStr = aStr.toUpperCase();
i tried

isnt it supposed to set everything of String.prototype to null
yes
name.endsWith wont work because you're setting endsWith to null
it's literally setting every string method to null

what's between line 1 and line 90 in your code example there
just a bunch of test nonsense
im trying to understand what you've done to change that interaction
that loop destroys the standard String object?
ya
but, you desire it to work correctly?
no
haha maybe your question is outside of my realm of understanding
I'm just a hobby guy
it's a joke
i was making fun of people who somehow fuck their code but still ask here for help even though it's obvious what the issue is

oh you went a long way to do that
😄
I was gonna say, you seem like an accomplished person based off your roles
yet intentionally setting value to null and expecting a method to work
yes, that was the meme
meme complete
thanks for explaining that though, I was working through what your code was doing lol
the only help i need is a fix for boredom
I've asked a lot of stupid questions in here
mostly answered by "what does x(y) do?"
imagine an FAQ
"my variable is undefined"
"my object doesn't have its methods"
"I copy and pasted code and it doesnt work"
it seems like a lot of times the question itself is the answer

how to check if message.author has voted?
ok
no, author of the message
What library?
It's if(dbl.hasVoted(message.author.id))
np ;)
xD i have another problem xD
dbl.on("vote", vote => {
bot.guilds.get("605725395752452115").channels.get("611467524747296789").send(new Discord.RichEmbed().setDescription(`**${vote.user.username}** just voted!`));
console.log(`> User with ID ${vote.user} just voted!`);
});
I voted and the bot did not react!
Hmm
Try without bot.guilds.get(''), put just console.log(vote.user) to see if it's working
@earnest phoenix, it does not work
Hello! How to make the message "member connected" to the text channel when member connected to a voice channel?
what library
stable or master?
stable
listen to the voiceStateUpdate event https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-voiceStateUpdate
Thx
@tight heath console.log(JSON.stringify(vote, null, 2)) does not work.
const dbl = new DBL('Your discordbots.org token', client);
``` copy paste this on the top of your index file
just
Remplace the first string by your dbl token
You can found it here
@brazen ocean ^
what was email again?
thx
WAIT WAIT
i got an email
Discord bot token has been reset for potential abuse
Cmon discord
What Cmon mean??
@stray garnet maybe your bot abuse of the api
Like changing status too fast
Edit a channel/send message too fast
@earnest phoenix come on
@earnest phoenix No cause it reconnects every tiny change i make
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Yes it's for that
I hate glitch sometimes....
Hm, it's for that i prefeer self hosting than free hosting services




