#development
1 messages Β· Page 1366 of 1
Ah a collection
@cunning timber maybe I can help
@lyric mountain I'm using gradle, java 11, jda4.2.0_209
I found a workaround, because the exception is just thrown sometimes. I do encounter it while downloading an attachment of a message.
@quartz kindle this is what i've been doing for 2 hours
my code has been
perfected
lmao nice
Aw would recommend him to press it if I could... darn
lmao
How can I set a constant for all my files through one file?
@blissful coral well ik everyone will hate me for saying this but global.<variable name> = 'something'
please don't do that
Bruh yeah not doing that
LMAO
I already know about that not going to use that bull
How can I get the photo posted on the channel
i remember something
MessageAttachment.first like this
help guys pls
if you have subdocuments in a mongoose schema, will virtual getters and setters still work?
what is on line 255
ok so if you read the error
you would know that roleName is undefined
so go and see where you are getting it
ok so that is undefined
so try to fix it
sure
how is this related to development
My command system is malfunctioning, I will do !ping and it will not respond, if I do it again it will respond with pong twice and if I do it again its 3x and then 4x and so on and so on, I have pasted the code, please let me know if there's anything obvious you see π
bot.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('pong!');
}
thats actually amazing
how
do you have a message event inside a message event
π€
or like creating a new instance somewhere
@earnest phoenix can you share more of your source code.
Notice how you didn't include }) at the end, which would close the scope of the bot.on(...) emitter function.
the fuck is that guide
holy shit
Read the real guide @covert gale
Yeah you have a shitty guide
Yes.
That guide is shit
Just read the discord.js guide
Notice how you didn't include
})at the end, which would close the scope of thebot.on(...)emitter function.
@sudden geyser It's there, I had a couple more commands setup so that's why there's no }) included,
const Discord = require('discord.js');
const random = require('random');
const fs = require('fs');
const jsonfile = require('jsonfile');
const bot = new Discord.Client();
const prefix = '!';
bot.on("ready", () => {
console.log('Bot is online.')
})
bot.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('pong!'); //ping command
};
})
});
bot.login('SupersSecretCode')
Why is it nested inside the ready event? It's unlikely that's the source of your error, but it's still something to question.
The ready event is just there I included everything but my XP system, some embeds, and a kick command.
const collector = await msg.createReactionCollector({ time: 60000})
UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is a object and not a function
what
de
fuc
nvm
fuck
in the directory you did the command in
whatever that current directory may be
any npm command you do will be the current directory
excluding global flags and whatnot
const Discord = require('discord.js');
const random = require('random');
const fs = require('fs');
const jsonfile = require('jsonfile');
const bot = new Discord.Client();
const prefix = '!';
bot.on("ready", () => {
console.log('Bot is online.')
})
bot.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('pong!'); //ping command
};
})
});
bot.login('SupersSecretCode')
const Discord = require('discord.js');
const random = require('random');
const fs = require('fs');
const jsonfile = require('jsonfile');
const bot = new Discord.Client();
const prefix = '!';
bot.on("ready", () => {
console.log('Bot is online.')
})
bot.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
message.channel.send('pong!'); //ping command
};
})
});
bot.login('SupersSecretCode')
Login twice?
Oh double post
Is this the example code from d.js with some extra packages?
What is a shard
a shard is a connection to discord
"sharding" a bot means splitting a bot into multiple connections
discord requires sharding when you reach 2500 guilds
regen that token my man
its also in the screenshot
well, you require config but never use it
prefix is not defined
and your code isnt formatted the same as your linter is configured
what cant you understand
these are plain English things.
if you require something, use it rather than just requiring it and not using it
if you use something define it first.
replace prefix with nothing, define it
Simple Meme Command
const { MessageEmbed } = require('discord.js')
const randomPuppy = require('random-puppy')
module.exports = {
commands: ['meme', 'memes', 'dankmemes', 'comedy', 'comedyheaven'],
description: 'Shows a meme',
usage: null,
minArgs: null,
maxArgs: 0,
permissions: [],
requiredRoles: [],
callback: async message => {
const subReddits = ["dankmemes", "meme", "memes", "comedyheaven"]
const random = subReddits[Math.floor(Math.random() * subReddits.length)]
const image = await randomPuppy(random)
const memeEmbed = new MessageEmbed()
.setTitle(`Here's your meme!`)
.setImage(image)
.setColor('RANDOM')
.setURL(`https://reddit.com/r/${random}`)
.setFooter('Click on the title to visit the subreddit!')
.addFields(
{ name: 'Meme From:', value: `${random}`, inline: true }
)
message.channel.send(memeEmbed)
}
}```
**THIS IS MY CODe AND IF YOU ASK ME TO DEBUG I WILL NOT RESPOND DO NOT COMPLAIN TO ME THE COMMAND DOES NOT WORK**
**LANG: NODEJS**
what>
My eyes...
what?
q js
DJS
im glad I switched to dpy
Why in the world do you have a js minArgs: '', maxArgs: '', requiredRoles: [], //and nesting it in a callback
you copied it from somewhere else right
Simple Meme Command
const { MessageEmbed } = require('discord.js')
const randomPuppy = require('random-puppy')
module.exports = {
commands: ['meme', 'memes', 'dankmemes', 'comedy', 'comedyheaven'],
description: 'Shows a meme',
usage: null,
minArgs: null,
maxArgs: 0,
permissions: [],
requiredRoles: [],
callback: async message => {
const subReddits = ["dankmemes", "meme", "memes", "comedyheaven"]
const random = subReddits[Math.floor(Math.random() * subReddits.length)]
const image = await randomPuppy(random)
const memeEmbed = new MessageEmbed()
.setTitle(`Here's your meme!`)
.setImage(image)
.setColor('RANDOM')
.setURL(`https://reddit.com/r/${random}`)
.setFooter('Click on the title to visit the subreddit!')
.addFields(
{ name: 'Meme From:', value: `${random}`, inline: true }
)
message.channel.send(memeEmbed)
}
}```
**THIS IS MY CODe AND IF YOU ASK ME TO DEBUG I WILL NOT RESPOND DO NOT COMPLAIN TO ME THE COMMAND DOES NOT WORK**
**LANG: NODEJS**
That command can be done in less then half the amount of lines
Nobody wants the command lol
Kids Like it
im sad that no-one mentions py 
THEY DO
They have to understand the code to use it in the slightest bit
and know the npm packages to have
Bro
wait wtf a npm package for a dog?
I Already Have it
why not just connect to reddit lol
Random-Puppy
BRUH
is random puppy a random subreddit picker?
CONST SUBREDDIT
is random puppy a random subreddit picker?
@quartz hawk ITS A RANDOM GENERATOR BRUH
oh
CallMeGat, can we chill?
is this a meme cmd or a "meme dog cmd"
NO COMPLAINING
ok thank you
Chill tf out dude
CallMeGat, can we chill?
@opal plank IM CALL ME GRAY NOT GAY
looks like aliases
oh my god gray chill out

can we chill dude? you're asking for help and being rude at the same time
it's literally text
Chill out
NO COMPLAINING MY CODE DOESNT WORK
we are not complaining about your code
@opal plank No he isn't, he is just sending his command we asked him why he had certain things
npm i random-puppy
you code the way you want
Though what exactly are you asking for CallMeGray

You're acting like the world owes you something.
npm i random-puppt
Sent twice now, what are you getting at
Can you explain what issue you're having
will randomize subreddits and send the randomized meme
What?
No idea
It has to be able to allow you to opt out @calm valley
Elaborate
some friend of mine told me that
What if its like a help command and it dms you the cmds lol
is this true, if your bot dms it doesnt get into top.gg?
@calm valley like dm advertises or just normal dms?
Should be fine, dhillon
@calm valley the rules, basically are. No unsolicited DM's
^
ye'
Now
?
I Will send my
Ah i'll keep it safe and just do channel send.
PETS COMMAND
ok
Plz no
as long as there's no DM on somsones behalf, the bot doesnt dm without the user who USED the command want it, or if it mass DM's. Those are the rules, to put it very easily
Don't post your code in this channel if you don't want to get constructive criticism FYI
Ah i'll keep it safe and just do channel send.
@calm valley your bot can dm people as long as its not something inappropriate like dm advertises, inappropriate images, etc
ah okay.
the key is unsolicited
if the user gave consent, its fine
if not, well, thats an issue
can i use neko-love api ?
I suggest a --nodm feature at the end so if they do !help --nodm it sends in the channel
@neon heart Bad idea
It can show loli images
i think neko-life is the only one thats blacklisted isnt it?
yeah
bruh
@fathom nymph why are you sharing your code in the first place? You share it without stating what it's for, then you write in bold for no one to criticize you. You must be leaning towards something but none of us get it.
i know
call him gay
^^
i have no idea why he even posted it tbh
dunno if it was flexing, sharing, or simply poorly asking for help while having a massive attitute
Whatever it was he was pissed off at the response he got
play stupid games, win stupid prizes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
yessir
Hey
You mean type shit up and not understand why it works?
Yep
Hey
@fathom nymph boo
play stupid games, win stupid prizes
@quartz kindle are you saying Python games are bad? /s
i think neko-life is the only one thats blacklisted isnt it?
@opal plank it's different api, i want to use neko-love.xyz what about it?
@slender thistle Come to the TS gang
call Me GAY?!?!!?!?
python seems like a good idea of language to learn fast but i am lazy to learn it honestly
Said games
CALLMEGAY??!???!?!?!?!??
What are you talking about @fathom nymph
call him gay
@quartz kindle
@opal plank nop BF gang
@neon heart thats the thing, im not familiar with them, as far as im concerned, nekos-life is blacklisted, you'd prob wanna see with a mod or wait for someone thats more familiar with that than me
@slender thistle you gonna ditch me here? : (
#TIMISNOTPOG
lmfao
homie trying to start a hashtag?
homie trying to start a hashtag?
@blissful coral ye
#TIMISPOG
hate life
whos tim again
ok thankyou
nekos.life's neko, wallpaper, and some other SFW endpoint is not allowed. NSFW endpoints on top of that
#callhimgay
#callhimgay
@quartz kindle lol imagine they know who i am
@tame kestrel mind confirming my last message?
we know you?
nekos.life's neko, wallpaper, and some other SFW endpoint is not allowed. NSFW endpoints on top of that
@slender thistle different api
#PythonIsNotPog
si
nvm i Hate PY

are you famous on twitter?
nvm i Hate PY
@fathom nymph
no nekos life stuff unless it's like the hug, kiss enpoints I think
nekos-love is allowed as long as I'm aware
im starting to assume gray is a troll, not even kidding
#PythonIsNotPog
To be specific, it's just not prohibited
what!>>!>!
i mean common sense applies
im starting to assume gray is a troll, not even kidding
@opal plank same
can you stop with your hashtags guy
how old are you gaygray?
pick what your bot does carefully and with common sense
how old are you
gaygray?
@quartz kindle 26
there
That is the most bullshit I have ever heard
hes 26 / 2?
by the way be behaves and he say hes 26 hes lying
no
Nah 12 years old @quartz kindle
does anyone here play jackbox
@normal sage no one does
To be specific, it's just not prohibited
@slender thistle ok
@calm valley Try fetching, like, 100-200 images from that api. manually see them to see if theres any provocative minors, anything on that regard with sexualizing lolis/nekos. If anything of the sort comes up, dont do it. Its a crude method, since you may not get anything out of luck while the api still gives bad stuff, but should be a decent way of checking
No like I was trying to do a help cmd
Am I the only one who can forsee mods getting involved?
so you would say (prefix)help and it would dm you the cmds
yeah
LMAO
its good idm
whut?
lmao
what im suggesting is basically sampling
if you dont know if the api results in NSFW stuff, sample it
thx
yeah, I've done that a few times to punch and slap and it's safe
then it SHOULD, keyword, SHOULD be fine
ok thanks for your advice
imagine being 26 in 2020
26 in 2020, why
Hii i have a embed named lbembed
.setAuthor("Jet's Dream World",guild.iconURL())
.setDescription(`Our top 20 most active members win nitro! \n \n Messages must be non-spam, or they wonβt be counted. You must follow all rules.
If you are seen trying to cheat, you will be disqualified. \n \n The most active user receives the @Most Active role! \n \n **Prizes** \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **Prizes** \n **#1**:$10 Nitro \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **#11**: 5$ Nitro `)
message.channel.send(lbembed);``` and then its supposed to delete itself but when i putin ```lbembed.delete()``` it says ```lbembed.delete is not a function```
please help
hold on lemme read
kk thanks
How do I get data from wtforms flask into the python backend?
Ping with responses pls
well i want my embed to be in like a particular format to make those space's i need those \xao 's :π
lol
ah.
it pulls in data from my quick.db and with SetInterval it repeats every 10 secs
@ivory seal what exactly is the problem
ah
i see the issue
i get this error
im pretty sure its because the embed isnt a function?
im not sure i quite understand?
the thing is it's trying to delete the message but the function doesnt exist
but the thing is, the lbembed is a constant
lbembed.delete is a function, javascript doesnt know what to do with it
ah ok so can u advise me what steps i should do to prevent this?
you need to await the message send
i dont code in js alot, so i really couldnt tell you
ah ok
thanks @dusk wyvern and @proper bolt
antiSpam.message(message);
if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if it contains an invite link
message.delete() //delete the message
.then(message.channel.send('Link Deleted:\n**Invite links are not permitted on this server**'))
}
if (message.content.includes('bruh'||'abs23')) { //if it contains an invite link
message.delete() //delete the message
.then(message.channel.send(`${message.author} **Do not swear!**`))
}
setInterval(() => {
const all = db.all();
let resp =all.filter(e => e.ID.startsWith('messages-'))
resp.length=20;
let finalOutput="**Leaderboard** \n \n";
let winner1 =resp[0].ID.split("-");
console.log(resp[0])
let winner1id = winner1[1]
let winner1userobj = client.users.cache.get(`${winner1id}`);
let guild = message.guild;
const lbembed = new MessageEmbed()
.setAuthor("Jet's Dream World",guild.iconURL())
.setDescription(`Our top 20 most active members win nitro! \n \n Messages must be non-spam, or they wonβt be counted. You must follow all rules.
If you are seen trying to cheat, you will be disqualified. \n \n The most active user receives the @Most Active role! \n \n **Prizes** \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **Prizes** \n **#1**:$10 Nitro \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **#11**: 5$ Nitro `)
await message.channel.send(lbembed);
}, 10000);
}); ```
another question
even though its async message
await gives me this
np
const {MessageEmbed}=require('discord.js');
const ms = require('ms');
const mscon = require('milliseconds')
const db = require('quick.db');
exports.run = async (client, message, args) => {
setInterval(async() => {
const all = db.all();
let resp =all.filter(e => e.ID.startsWith('messages-'))
resp.length=20;
let finalOutput="**Leaderboard** \n \n";
let winner1 =resp[0].ID.split("-");
console.log(resp[0])
let winner1id = winner1[1]
let winner1userobj = client.users.cache.get(`${winner1id}`);
let guild = message.guild;
const lbembed = new MessageEmbed()
.setAuthor("Jet's Dream World",guild.iconURL())
.setDescription(`Our top 20 most active members win nitro! \n \n Messages must be non-spam, or they wonβt be counted. You must follow all rules.
If you are seen trying to cheat, you will be disqualified. \n \n The most active user receives the @Most Active role! \n \n **Prizes** \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **Prizes** \n **#1**:$10 Nitro \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 **#11**: 5$ Nitro `)
message.channel.send(lbembed);
setTimeout(async function(){
lbembed.delete();
},10000);
}, 10000);``` it still returns the same error 
await the message.channel.send(lbembed);:
const message = await message.channel.send(lbembed);
then you can call message.delete()
thank u soo much
it seems like ur trying to delete the same msg, is 10sec
Here is the one line code
message.channel.send(lbembed).then(msg => msg.delete({timeout: 10000, reason: 'Just Like Thaat'}))
@ivory seal
yee i got it to work thanks a ton
how can i get a member of other shard using id?
i tryed client.shard.broadcastEval(this.users.cache.get(args[0]))
bur its not work
So...
This is gonna be a very dumb question...
But...
What is the best way to handle all errors that are unexpected that do not have a catch on them?
Any sort of event to do it?
is using a try catch a better option
You can set up a handler for all unhandled promise rejections for example
circular dependencies
bcoz its a circular reference loop
and its a very common practice in the world of programming
Very useful
Wherever you are, whatever you have you can get what you need with practically no effort
no it doesn't take extra memory
only message, guild, members is taking up space, rest is all referencing each other
^
efficiency
how much time did it took?
Copy pasta
I'm keep getting this
same
lol
I'm keep getting this
@rocky hearth umm we can't solve it without the code. If ur sharing it.. share it without the token
text
@clever vector????
Embed ?
Wait is it python ?
they directed me over here
what
So idk what is shards
yeah
A shard is a thread with an instance of your bot that is assigned to manage a part of the guilds your bot is in
why does topgg display the number of shards on bot pages then?
there approx 1shard = 1000 guilds managed by client
swag, ig
@rocky hearth umm we can't solve it without the code. If ur sharing it.. share it without the token
@amber sedge Any guesses, what might be wrong? Actually my project is very large
It says unknown message... My guess is u may made it like || message.channel.send(Hello) without " "
Send me the line 154 of the code
Not the whole
Naa, I'm using ts. That can be caught in ide itself
why, the file is in the node_modules
last night, I updated discord.js
Oh
So I think, something might got broke
nah, na... v12.2 to v12.4
who else runs their bot on a ti84
On my SmartFridge
How do I force upgrade a package, to the latest version in yarn??
probs clear yarn cache and then yarn upgrade
how to downgrade node version in glitch.com
@rocky hearth name-of-package@latest
Can anyone tell me why my music bots won't play any more? I'm not sure if they require more intents or what
intent means??
My bot cant fetch the channel name
1 sec grabbing another ss
Its supposed to post a embed in the suggestions channel
i can send the code line too
i think it'll help people helping you
Thats the code
message.guild.channels.cache.get("channel_id")```
Thank you :)
np
shouldn't it be embed = new Discord.MessageEmbed()?
yeah that too
Discord.RichEmbed is the old one
@harsh blade do you use discord.js v12 or v11
oh
Like this?
get rid of .cache
yeah you should update to v12
You must update because it's not maintained
@earnest phoenix Will my code break?
u'll need to fix some stuff, yeah
No, you will just have to update a few property names
i also have a question
my bot breaks every time i text him on dm's, how can i make it ignore dm?
With one line of code
if (<message>.channel.type === "dm") return;```
kk
but where am i suppose to put this line?
before my command list?
At the start of the message event
so like this right?
Yes
thanks
Uhhhhhh
did you update js?
nope
then type js <client>.channels.get("id")
is there supposed to be guild?
guild is for discord servers, so i don't think you should put it in there
Like this?
π€¦ββοΈ
DynamicBot ?
@harsh blade Please review these resources #development message
show me the line where it says js new Discord.Client()
From suggest.js?
Inb4 doesnt pass client to the comnand folder

cant find it
Lmao
ughh
bruh, where your main file?
@harsh blade show me your module.exports.run line in suggest.js
then use bot.channels.get
use js bot.channels.get("id") then
i swear its the last error
this happens when i react to the suggestion to make it "accepted" or "implemented"
show the code
@harsh blade you're doing it wrong with promisses
message.guild.roles.get("id")```
message.guild.roles.get("id")```
@crisp fable roles.cache
ohh, then I should stay away from here
message.guild.roles.get("id")```
@crisp fable Whose id?
role id
v11 is pissing me off
show how you get the member
member variable where? main or the commands file
main
Idk
Show how you defined the member variable
@crisp fablewhat does the line start with so i could find it easier?
i found this
what the heck
Hello, there is strange thing happened with me... My bot is not starting
That's all
When I starting Development account (the same code, but only 1 server).. It is working
what the heck
@crisp fable ?
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)```
if you have subdocuments in a mongoose schema, will virtual getters and setters still work?
@harsh blade ```js
const member = message.guild.members.get(user.ud)
@crisp fable do i replace anythinbg in the user.id?
nope
catch block ?
i did
and after that nothing?
:d
dunno what it is or how it works 
Ok so now, when i react. nothing in console and no changes anywhere
i think it killed the code
gimme a sec
let role = message.guild.roles.get("765885271861624843");
if (member.roles.sort((a, b) => b.calculatedPosition - a.calculatedPosition).first().calculatedPosition < role.calculatedPosition) return;
if (channel.name.toLowerCase() == config.Suggestions_Channel.toLowerCase()) {
if (message.embeds.length > 0) {
let oldEmbed = message.embeds[0];
let embed = new Discord.RichEmbed()
.setDescription(oldEmbed.description)
if (emojiKey == ":lock:") {
if (oldEmbed.title.endsWith(`**- DENIED**`)) return;
message.reactions.get(":lock:").remove();
let containsaccepted = `${oldEmbed.title} `
let replace = `${containsaccepted.replace(" **- ACCEPTED**", "")} **- DENIED**`
let finished = replace.replace(/\s+/g,' ').trim();
embed.setColor("#e50220");
embed.setTitle(finished)
embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
embed.setTimestamp()
message.edit(embed);
} else if (emojiKey == ":star:") {
if (oldEmbed.title.endsWith(`**- ACCEPTED**`)) return;
message.reactions.get(":star:").remove();
let containsdenied = `${oldEmbed.title} `
let replace = `${containsdenied.replace(" **- DENIED**", "")} **- ACCEPTED**`
let finished = replace.replace(/\s+/g,' ').trim();
embed.setTitle(finished);
embed.setColor("#08d80f");
embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
embed.setTimestamp()
message.edit(embed);
}
}
}
thats the code for the reactions
i know why
please before you have the if (emojiKey == "π") check, console.log the emojiKey
basically
add console.log(emojiKey) before that check
then try again and send the output
no ouitputs when reacting
show me where you put the console.log
it doesn't show anything in the console?
that's somewhere else
Also, thank u sm for having time to help me :p
Usually i just get ignored :d
@crisp fable
try to change the emojiKey variable to emoji.name
and remove the ::'s in if (emojiKey == 'π')
so basically only lock
so. if (emojikey ':lock:')
Dosent work
no errors
I Think its with the line we changed
const members
stopped giving errors after that
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!hello'):
msg = 'Hello {0.author.mention}'.format(message)
await message.channel.send(msg)
if message.content.startswith('!howareyou'):
msg = 'I am fine What about you? {0.author.mention}'.format(message)
await message.channel.send(msg)
if message.content.startswith('!amongus'):
msg = 'Use appropriate channel @maiden inlet\nFor Among Us code: [#770936765392748563](/guild/264445053596991498/channel/770936765392748563/)\nFor Among Us Memes: [#773047085686849536](/guild/264445053596991498/channel/773047085686849536/)\nRequested by: {0.author.mention}'.format(message)
await message.channel.send(msg)
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
client.run(TOKEN)```
Hey someone help me
unicode emojis are detected by discord, you dont need to provide any id/name
now the problem is that the if statement isn't getting triggered
also, they share the same emoji ID
I am trying to get the user id mentioned while typed the command but i have no idea how do i get it?
example !amongus @someone
means that nothing is stored in the emojiKey variable
The mentioned user is to displayed by the bot
if console.log isnt shown is cuz isnt being triggered
you can check for mentions under message.mentions
console.log gives output even when the argument is empty
I have problem (javascript)
I have code:
client.dbl.hasVoted(message.author.id).then(voted => {
if(!voted) return message.reply('vote on top.gg')
});
// command
why command is running?
https://smth.is-inside.me/jepksCfT.png
it's a list of mentioned members
so you can check for message.mentions[0]
if it exists, the author mentioned a member
and that would be the first member (from the api)
Ok I will try
so, any ideas?
When i react to an suggestion with β It should edit the embed to "accepted"
But now when i react, nothing happens, no errors.
what happens when you react with π ?
Nothing
I have problem (javascript)
I have code:client.dbl.hasVoted(message.author.id).then(voted => { if(!voted) return message.reply('vote on top.gg') }); // commandwhy command is running?
https://smth.is-inside.me/jepksCfT.png
yes it's example code
no idea why it is running
client.dbl.hasVoted(message.author.id).then(voted => {
if(!voted && message.author.id !== client.config.ownerID) {
return message.channel.send(`${client.config.emoji.error} This commands is for **voters only**. <https://antialt.xyz/vote>`);
}
});
// command
try to put the command into an else statement after that check
hey wb my issue
try to put the command into an else statement after that check
@crisp fable i can't because I'm usingawait
what happens when you react with π ?
@crisp fable Nothing
can I get the reaction, the user has last reacted to?
can I get the
reaction, theuserhas last reacted to?
@rocky hearth ?
can I get the
reaction, theuserhas last reacted to?
@rocky hearth ye
how
the pic makes me blind
do you want to do it as the user react or after someone else reacts
I have a <User>, I want the reaction, the user has reacted to if any??
to any message?
yes
in the guild or globally?
@radiant dome
but I have only <User>, not <Member>
user can be resolved to a member
do you want their latest message reaction of the guild? channel?
any
actually, in the guild... yes
ah, guild
@knotty basin
you can get all channels of the guild and map them by reactions by the member
hai
after that, get the last reaction
@knotty basin The shout command you want to make, can be created easily.
They have used the MessageEmbed to create that type of fancy message
When i react to my suggestion nothing happens, it should mark it as accepted but nothing, no errors in console eighter
@rocky hearth Can you make it?
ofcourse, I can go in more advance
Great
after that, get the last reaction
Lemme try
@rocky hearth DMs.
why my bot is offline?
i have 2 bots in diferent hosts, the two run the same code, but one of then have more hardware than the other, how its possible the bot with more hardware lag and the bot with less hardware no lag?
i think youre using something like this
var playingMessage = msg.channel.send("My message")
first verify if you typed right
if theres typed right then try move the react command for inside a then
so you code will be like this
msg.channel.send("My message").then(playingMessage => {
playingMessage.react("Your emoji");
//rest of your code
});
playingMessage isn't a message, maybe
wait what
var playingMessage = await new MessageEmbed()
.setTitle(` [ ΩΫΩΪ© Ω
ΩΨ²ΫΪ© | Music Link ] `)
.setURL(`${song.url}`)
.setDescription('')
.setColor("#fc0000")
.setAuthor(`${song.title}`, 'https://cdn.discordapp.com/emojis/773176911706194001.gif?v=1')
.setFooter('IR Music Player' , 'https://cdn.discordapp.com/attachments/773543050256318484/773678746044596224/IRANIMUSICS.png')
message.channel.send(playingMessage);
await playingMessage.react("");
await playingMessage.react("");
await playingMessage.react("");
await playingMessage.react("");
await playingMessage.react("π");
await playingMessage.react("π");
await playingMessage.react("π");
} catch (error) {
console.error(error);
}
you don't await the MessageEmbed()
that's an embed
you await the message.channel.send()
assign it to a variable
var embed = await new MessageEmbed()
.setTitle(` [ ΩΫΩΪ© Ω
ΩΨ²ΫΪ© | Music Link ] :play512:`)
.setURL(`${song.url}`)
.setDescription('')
.setColor("#fc0000")
.setAuthor(`${song.title}`, 'https://cdn.discordapp.com/emojis/773176911706194001.gif?v=1')
.setFooter('IR Music Player' , 'https://cdn.discordapp.com/attachments/773543050256318484/773678746044596224/IRANIMUSICS.png')
var playingMessage = message.channel.send(embed);
await playingMessage.react(":mediaskipforward512:");
await playingMessage.react(":pause512:");
await playingMessage.react(":loop512:");
await playingMessage.react(":stopicon14256:");
await playingMessage.react("π");
await playingMessage.react("π");
await playingMessage.react("π");
} catch (error) {
console.error(error);
}
theres it
@quaint hornet @pale vessel
Thanks

`const Discord = require("discord.js");
const moment = require("moment");
require("moment-duration-format");
exports.run = (client, msg) => {
const duration = moment.duration(client.uptime).format(" D [gΓΌn], H [saat], m [dakika], s [saniye]");
msg.channel.sendCode("asciidoc", = π Δ°STATΔ°STΔ°KLER = β’ π₯οΈ Bellek kullanΔ±mΔ± :: ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB β’ π· ΓalΔ±Εma sΓΌresi :: ${duration} β’ π₯ KullanΔ±cΔ±lar :: ${3564} β’ π Sunucular :: ${102} β’ πΊ Kanallar :: ${5897} β’ π Discord.JS sΓΌrΓΌm :: v${Discord.version} β’ β²οΈ Ping :: ${client.ping});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['botbilgi'],
permLevel: 0
};
exports.help = {
name: 'botbilgi',
description: 'c',
usage: 'botbilgi'
};`
help
pls
insteaf of "`" you should use "```" for code
New Error 
also, whats the error
Pls Help
var embed = await new MessageEmbed() .setTitle(` [ ΩΫΩΪ© Ω ΩΨ²ΫΪ© | Music Link ] :play512:`) .setURL(`${song.url}`) .setDescription('') .setColor("#fc0000") .setAuthor(`${song.title}`, 'https://cdn.discordapp.com/emojis/773176911706194001.gif?v=1') .setFooter('IR Music Player' , 'https://cdn.discordapp.com/attachments/773543050256318484/773678746044596224/IRANIMUSICS.png') var playingMessage = message.channel.send(embed); await playingMessage.react(":mediaskipforward512:"); await playingMessage.react(":pause512:"); await playingMessage.react(":loop512:"); await playingMessage.react(":stopicon14256:"); await playingMessage.react("π"); await playingMessage.react("π"); await playingMessage.react("π"); } catch (error) { console.error(error); }
ik nothing about message collectors but it says that the function you used doesn't exist
pls wait
const filter = (reaction, user) => user.id !== message.client.user.id;
var collector = playingMessage.createReactionCollector(filter, {
time: song.duration > 0 ? song.duration * 1000 : 600000
});
change var playingMessage = message.channel.send(embed); to var playingMessage = await message.channel.send(embed);
message.channel.send() returns a promise so you need to use either await or .then @earnest phoenix
why my bot is offline?
you never made a bot before? so you dont know how bots work?
so you need to create a program and run the program
inb4 they show javascript instead
the bot will only be online while your program is running
what program shall i make?
your program should connect to discord and login using your bot token
i personally use javascript and the discord.js library
btw java and javascript are two completely different things
which one do you actually use?
java script
then you should always say "javascript" and never "java"
"java" is a very different language
i know java is easier
java is not easier
actually i am new for this that s why i don't know much
yes, its very common for new people to be confused, thats why im explaining to you that javascript and java are VERY different
java is more similar to C languages, while javascript is actually not even its real name, javascript's real name is ECMAScript and has nothing to do with java
i am a student but your information is so important for me actually i was learning Html but i planned to study java CSS and html. I was planning to make discord bots at first Your information helped me alot thank you very much
javascript/ecmascript is a language for browsers, yes, its used together with html and css
java has no connection to browsers or the web, java does not use html and css
my goal was html but i tried to learn different languages about it so glad that you helped me
no problem, just dont say "java" again or people will likely misunderstand you
you can also use java do make a discord bot, but its a very different process, you would need to download java from oracle.com
minecraft is made with java for example
java is also used for banking
but in the internet, for websites and etc, you use ecmascript/javascript/js, not java
do make a bot with javascript, you need to download node.js from nodejs.org
glad to talk with you yea i downloaded it thanks
yeah java is more structured and has more rules to follow than js
i see that's why it didn t run
@quartz kindle do you know how to register a js.org domain ?
cuz i don't understand it
idk never made one
how can i get a member of other shard using id?
i tryed client.shard.broadcastEval(this.users.cache.get("${args[0]}"))
bur its not work
anyone know of a system for discord.py that can get a member's past usernames?
im pretty sure you aren't allowed to do that
the only way to do that is to track their changes and save them in a database
hmm alright. I've seen a different bot do it, but I won't mess around with it.
When i react to my suggestion nothing happens, it should mark it as accepted but nothing, no errors in console eighter
does anyone know how to avoid this error Error: Status code: 429
429 = you're hitting the rate limits
When i react to my suggestion nothing happens, it should mark it as accepted but nothing, no errors in console eighter
please help its urgent :c
We can't help without code
420 = you're high btw
let role = message.guild.roles.get("765885271861624843");
if (member.roles.sort((a, b) => b.calculatedPosition - a.calculatedPosition).first().calculatedPosition < role.calculatedPosition) return;
if (channel.name.toLowerCase() == config.Suggestions_Channel.toLowerCase()) {
if (message.embeds.length > 0) {
let oldEmbed = message.embeds[0];
let embed = new Discord.RichEmbed()
.setDescription(oldEmbed.description)
console.log(emojiKey)
if (emojiKey == ':lock:') {
if (oldEmbed.title.endsWith(`**- DENIED**`)) return;
message.reactions.get(":lock:").remove();
let containsaccepted = `${oldEmbed.title} `
let replace = `${containsaccepted.replace(" **- ACCEPTED**", "")} **- DENIED**`
let finished = replace.replace(/\s+/g,' ').trim();
embed.setColor("#e50220");
embed.setTitle(finished)
embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
embed.setTimestamp()
message.edit(embed);
} else if (emojiKey == ':star:') {
if (oldEmbed.title.endsWith(`**- ACCEPTED**`)) return;
message.reactions.get(":star:").remove();
let containsdenied = `${oldEmbed.title} `
let replace = `${containsdenied.replace(" **- DENIED**", "")} **- ACCEPTED**`
let finished = replace.replace(/\s+/g,' ').trim();
embed.setTitle(finished);
embed.setColor("#08d80f");
embed.setFooter(oldEmbed.footer.text, oldEmbed.footer.iconURL);
embed.setTimestamp()
message.edit(embed);
I Think theres something wrong with this code
theres nothing in there that is listening for reactions
Oh what
unless there is code that you're not showing before that part
for example where you define emojiKey
Previous code before that one is for the role addition
Yeah thats the code
oh wait
@quartz kindle i there any way to avoid getting rate limited?
I can't have a music bot if it's gonna get rate limited every few minutes
I can't have a music bot if it's gonna get rate limited every few minutes
@ancient nova don't make a music bot just listen with your friend(s) on spookify
I wanna make the bot anyway
I think so
youtube doesn't like music bots
I'm not sure if it's ytdl, since I switched from ytdl-core to ytdl-core-discord and I still got the same error, I'm pretty sure it's youtube then
you're using data fetched from them without permission or even giving them their ad revenue
I mean I do have permission if they gave me the key themselves right?
I have the key so I can grab that data
the key is so you can get yt video info, you need ytdl to download them
some1 help me pls
wdym
client.on("guildMemberAdd", async (member) => {
const channel = member.guild.channels.cache.find((x) => x.id === "0000")
if(!channel) {
return console.log(member.guild.name + " Please Create channel with name verify")
}
const vrole = member.guild.roles.cache.find((x) => x.name === "Member")
if(!vrole) {
return console.log(member.guild.name + " Please Create role with name 'Member'")
}
const verifycode = await channel.send(":inbox_tray:" + `${member.user} ` + ' **[VERIFY]** `React βοΈ for Verify and access to other Channels` ')
await verifycode.react(':heavy_check_mark:')
client.on('messageReactionAdd', async (reaction, user) => {
if (reaction.emoji.name === ":heavy_check_mark:") {
const guildMember = reaction.message.guild.members.cache.get(user.id);
if (!guildMember) throw 'Couldn\'t get guildMember!'
const roleToAssign = reaction.message.guild.roles.cache.find(r => r.name === 'Member')
if (!roleToAssign) throw 'Couldn\'t get roleToAssign!'
let collector = channel.createMessageCollector(m => m.author.id === member.id)
guildMember.roles.add(roleToAssign)
// await reaction.message.delete();
}
})
})```
when some1 join server not send message
look
I mean I do have permission if they gave me the key themselves right?
@ancient nova you don't have permission for playback of copyrighted music videos iirc
@earnest phoenix then how doesn't all the popular music bot's don't get rate limited?
simple. youtube hasn't caught them yet
and stuff like mee6 and rhythm actually take permission from song artists and youtube for playback of their songs
they count mine after playing few songs, but hasn't caught theirs where thousands of people play music at the same time
what is the logic in that
@ancient nova why do you think those bots don't get rate limited? simple. they have permission
then..? how do I get that permission?
then..? how do I get that permission?
@ancient novaidk
how do I make something like that
yes but youtube hates moozic bots don't they
technically streaming music from youtube without permission is illegal
is it still, If we use googleapis youtube v3??
the bots who do it most likely do it by using proxies and rotating IPs, so youtube doesnt know its all coming from the same place
does google api even allow streaming? afaik it only has access to metadata
technically streaming music from youtube without permission is illegal
@quartz kindle Music bots be like: Processing to search for fucks to give...
damn
isn't there anything else I can do
maybe a different package to stream music from
I mean, lavalink has that rotation to prevent from getting IP banned from youtube
But this is also coming to ytdl-core
just stop trying to make a music bot and listen directly on spookify
Spotify more like ad dungeon
or literally just go into a vc and sing like fuck
no need for spookify
we have vocal cords
better yet, I'll record me singing and put that in my bot instead
that's actually allowed
And then you hear the result
since you own the copyright to your own voice
does spotify have an npm package
I could use that
it doesn't have a reate limit I'm pretty sure
Spotify's ratelimit is heavier than YouTube
does spotify have an npm package
@ancient nova ...why? *leaves chat* *door slams shut*
I mean if error 21...whatever blocks my IP for few days then I'm
I use ytdl-core-discord
that's the same thing basically
but optimized for d.js bots amirite
yes
Not exactly the same thing because they use dependencies
And it's not always updated
well I just started using that few minutes ago to try
but yeah
I use that now
if it's needed I'll switch back
just help me
what do I have to do to get un-rate limited or avoid it next time, or switch IP's whatever
@ancient nova I know package called, discord-player which doesn't ever require API_KEYs to play music form, youtube, spotify etc
It's author is the guy who made discord.js
@earnest phoenix are you fucking telling me the owner of d.js made smth that allows people to do smth that's technically illegal if done wrong
can anyone help me
You heard it correctly
actually you *read it correctly

he didnt make an illegal thing lol
You don't, ytdl-core has a PR that will be fixing the issue and it'll be almost impossible to get banned
ytdl-core-discord is just a wrapper around ytdl-core, which is made by someone else
@earnest phoenix but I'm rate limited for few days I can't just have the bot stop working like that
people will start surely kicking it after a while
Well i can't help you at that point unless you wait it out, sorry
@ancient nova the only thing you can do to lift your ban is to change vps lol
oh god
or change your vps's ip address if they allow you to
are you kidding
Yea, changing the IP address will most likely resolve it
ytdl-core has examples for using proxies
how do I change that IP adress
but you need to obtain your proxies yourself
there are no free and reliable proxies tho
upload them to an image hosting service or base64 them
@earnest phoenix I wanna die at this point

do you not know what "image hosting" is?
@earnest phoenix I wanna die at this point
@ancient nova You may rest in pepperonis
No
π¦
do you know what "hosting" is?
The ban does not depend on the key
but................. with a vpn 
It depends on the IP
You don't need a new key
I don't get why people spend this much effort trying to make a music bot when they can directly use the service they are fetching data from
because people are using it
everyone and their grandmother want music bots
They just do this to fucking cut out ads they get while listening to them
@earnest phoenix Why you Hate, music bots ?? There're cool, when finally gets work
Ads 
music bots are overrated
imagine getting an error on a catch error event
Literally everything is overrated
@quartz kindle i got so now i have to past the link?
ok
They just do this to fucking cut out ads they get while listening to them
@earnest phoenix they literally won't even pay the service themselves at least. I give out all my BAT tokens to sites like Wikipedia and Minecraft Wiki because I'm not like I want them to die for giving me shit ads and stuff for money. If you don't like ads just fucking stop using that service (not talking about you btw)
Tim if i show you 2 functions that does the same thing but with different codes, can you guess which is the fastest
well i can try
yes, paste it in an html <img> tag
@quartz kindle or just do![]()in markdown
^ or that
How do I know if a object is empty?
Object.keys(myobj).length
is there a way to prevent sql injection attacks




idk
