#development
1 messages · Page 1310 of 1
Is there like a video tot on how to add a bot to dbl
yes @earnest phoenix
Sorry, misunderstood your question. <3
visit the invite link
there should be a dropdown button saying Select a server
Select yours
Then click authorize
Ater you finish the captcha the bot will be in your server
@earnest phoenix Yes, I did all this, but I have an offline
The bot is not offline means you can't use it
hey anyone here discordpy? I need some help with reactions
code:
H = "✅"
S = "❌"
await message.add_reaction(H) #:regional_indicator_h:
await message.add_reaction(S) #:regional_indicator_s:
def check(reaction, user):
return (user == ctx.message.author and str(reaction.emoji) == H or S)
try:
reaction, user = await client.wait_for("reaction_add", timeout = 30.0, check = check)
except asyncio.TimeoutError:
print("Timeout")
if str(reaction.emoji) == H:
await ctx.send("HIT")
if str(reaction.emoji) == S:
await ctx.send("STAND")```
whenever i execute this
it automatically prints "STAND" before i press anything
any help is appreciated
Are you filtering out the bots message
@tawdry heart how would you use an OFFLINE bot
think about it
the bot needs to be online so it can chat with other users
and the bot reacted before it's collecting reactions
@pale vessel okay i get it but how would i go about doing this
should sleep between the if and reaction using asyncio.sleep?
i was talking to extreme
oh
await should do (which is what you're already doing), i think
so i'm not sure
i'm not a python user
How do I start my sharding file when I do client.login()
@blissful coral client.login?
Yeah
waht\
Hm
the guide we reading
is v11
give moment..
its v12
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: 'your-token-goes-here' });
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn();
im looking at the git rn
this is 11v
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: 'your-token-goes-here' });
manager.on('launch', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn();
@blissful coral new Discord.ShardingManager(file,options);
yeah we need that
Yeah
Hello
Hi
and the shard starts the bot?
Yes
Thanks @manic osprey <3
?
client.user.setActivity(`${client.users.cache.size} Users! ${client.shard.id}`, {type: "WATCHING"})
Shouldn't this show shard?
@solemn leaf Sharding is in a different file...
So
Thought so
you funny
What
lmaooo
I just went from 5k to 200...
poor you
Is that because of intents?
Yea

It isn't sharding
I haven't enabled sharding
on my main bot
just my testing bot
How many shards do you have?
1
eval it
Did you use auto shards method?
yeah
Hm...
I don't know how not too rn
i know it shard method
xD
@blissful coral dont recommend
but .. API decline from it.
Ok.
Well I have used that once on my testing bot.
I never used sharding on my main bot lol
you can need after
Yea
Do intents have anything to do with member counts of a guild??
yes i have unlocked.
What 15
@manic osprey which intent is it
from api
oh
GUILD_MEMBERS?
What is server members for
Does it take a second?
Go and enable
is it for like membercount
what did this mean UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'permissionsFor' of null
i cant vote on dbl for bots on mobile bug?
@blissful coral thats is after
Yeah
What mobile bug? @surreal forge
What did this mean UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'permissionsFor' of null
check what
show your code
Do you want to check permissions for role or user? @lucid prawn
how do i make this kind of thing that it detects which ppl had reacted to the message with the reaction and choose a random person from them?
@ me if you have an answer
rip lol
ugh
hi
this isnt bot related but can someone help me
//js
function addTask() {
if (i == 1) {
document.getElementById('task').innerHTML = document.getElementById('input').value; i++
document.getElementById('cancelid').className = 'cancelshow';
}
//css
.cancel {
display: hidden;
}
.cancelshow {
text-align: left;
color: azure;
display: inline;
}
//html
<h1 id="top"> Memo </h1>
<div id="division">
<button class="cancel" id="cancelid" display="hidden"></button> <p id="task"></p>
for some reason the button #cancelid shows up even tho its supposed to be hidden
help
lol
here we go again
lol
@vale garden There's no "display" attribute on any html element as far as I know.
You'll have to do style="display: none"
good job google
And also there's no display: hidden in css, there's visibility: hidden
Use none instead
display: none;
No need for the important
what is important for then?
its common css
common
if you mark it with !important it will override all other classes
What is that @solemn leaf
It looks good to me, unless you want it to look differently
I mean I need help on my commands page
ah
how do u make that aki
wydm
how did u make the website
Omg your so immature
cool its 1am
its 7 am
it thing = timezones retard
@solemn leaf how old are u
hes 5
So rude
hes rude
its 7am I'm tried as f
code
bruh i found the problem
sometimes, my genius, its equal to that of a potato
but a potato could be delicious
true
const Discord = require('weather-js');
const weather = require('weather-js');
module.exports = {
name: 'weather',
description: 'Get the weather of any location',
execute(message, args){
if (!message.guild.me.hasPermission("SEND_MESSAGES")) return message.author.send('Please give me permissions to send messages.');
const Eweather = new Discord.MessageEmbed()
.setTitle('Weather')
.setDescription('**Usage** : ``;weather [location name/zip code]``')
.setColor("RED")
they fixed it
Hey guys.. I was wondering is there some github repo that shows a clustered github bot
That's sharding not clustering
it might have clustering on it lmao
doesnt
No point in linking Bastion it's obfuscated
Anyone who understands clustering.. do I login into my bot in the master only or master & workers
TypeError: ["Click here"] is not a function
b
.setDescription(['Click here']('https://urmom.com'))
Inside ‘click here’
Hey, quick question. Is your DBL token accesible by dbl.token, where dbl is made using new DBL()?
Taken me 5 min to create this it so bad https://chillbot-support.zyrosite.com/
Guys, I just got a notification that my bot had reached a servercount of 75, and I filled in the verification form, but it says unorganic growth.
Is it a common thing that bots that get put in here are serverjoin spammed? If so, why?
That warning means your bot was invited to many guilds with the same owner
I have a loop, there is also an API with multiple pages eg. ?page=0
Is it faster to loop and collaect all the data of all the pages first then run the code, or is it faster to run codes after each page?
Hey, quick question. Is your DBL token accesible by dbl.token, where dbl is made using
new DBL()?
@nocturne grove
That warning means your bot was invited to many guilds with the same owner
@earnest phoenix but is it common that ppl in this server do that? Because I think there is no way to get him verified ever again, even if he does only join legitimate servers
yes but there is average 46 pages
thanks. Just figured it out myself tho but still wasn't sure
Cwick, what is this API for?
@unreal zinc You can verify your bot again, just make it leave the servers that has the exact same owner
search
Reach 75 guilds then try again
searching something
What platform?
Like Google
Why do you need it?
How many pages this shit has
no
Then get the first
That could be api abuse but there's something you can do if you didn't know, request them one by one every 30 seconds or something
To prevent api abuse
Don't recommend automating an API thingy
Automating an api?
not automate
how do I assign a variable name by a variable's value
let i = 1;
(i)content = 'foo'
console.log(1content)
//must return foo
The XY problem is a communication problem encountered in help desk and similar situations in which the person asking for help obscures the real issue, (X), because instead of asking directly about issue X, they ask how to solve a secondary issue, Y, which they believe will all...
right click and select run as administrator
@lost stone right-click on the powershell icon
btw you can't run admin stuff through programs
you gotta do it manually
search it in the start menu
i dont even know what is powershell
i dont even know what is powershell
@lost stone basically command prompt but butter
(not a typo)
If i have string "blah blah ${thing}", is there a way to turn it into `blah blah ${thing}`
What's the difference?
Like message.channel.send("blah blah ${thing}"); and message.channel.send(`blah blah ${thing}`)
The string is the same, the only difference is the quotes you are using. If you use the " quotes, the bot will literally send blah blah ${thing} while if you use the ``` quotes, "thing" will replaced with whatever the variable is holding
or do you mean thing is foo and you want to turn "test ${thing}" to "test foo"?
yes
guess i should use some sort of indexOf?
indexOf?
You can use replace
const serverQueue = message.client.queue.get(message.guild.id);
const songInfo = await ytdl.getInfo(args[0].replace(/<(.+)>/g, '$1'));
const song = {
id: songInfo.videoDetails.video_id,
title: Util.escapeMarkdown(songInfo.videoDetails.title),
url: songInfo.videoDetails.video_url
};
``` I get (node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
is there any difference between .replace() and regex?
yes
why?
client.on("channelCreate", async (kanl, member, guild) => {
let kanal = await db.fetch(`kanalk_${kanl.guild.id}`);
if (kanl.id == kanl.guild.owner.id) return;
if (kanal == "acik") {
kanl.delete();
const embed = new Discord.RichEmbed()
.setDescription(
"Sunucunuzda yeni bir kanal oluşturuludu. Saldırı şüphesiyle geri silindi! \n **Bu sistemi kapatmak için sunucunuza girip bunu yazın:** !!kanal-koruma kapat"
)
.setColor("BLACK");
kanl.guild.owner.send(embed);
return;
} else {
return;
}
});```im make it this code but
Someone came to me and said all channels on the server were deleted
WHAT IS THIS???
ITS A IMPOSSIBLE
by regenerating your fucking token
I DELETE MY BOT
ok

@toxic jolt dm pls
and this is why you dont be stupid with your token, kids
🤦
Discord.js is faulty
I renew tokens every day?
what ?
oh wait
A code like this used to ban hundreds of people
im an idiot
look at the code
kanl.delete();
let me guess
you literally just copy pasted that
into your bot
i think you're just an idiot
in so many bug's
don't put random code into your bot
it must be random code if you just put delete() in there
What do you think this code does? https://discordapp.com/channels/264445053596991498/272764566411149314/764414359434166283
Automatic deletion if the channel opens
I am bored for discord.js
no you're just being dumb
why :c
what did you think channel.delete would do?
For automatic deletion if the channel is created.
for one channel.
NO ALL CHANNEL
ITS A FUCKING IMPOSSIBLE
I'm so angry for discord.js
look this
client.on("channelCreate", async (kanl, member, guild) => {
let kanal = await db.fetch(`kanalk_${kanl.guild.id}`);
if (kanl.id == kanl.guild.owner.id) return;
if (kanal == "true") {```
well
Does anyone have tips on how to decrease a bot’s ping?
that just does it if thats true
@earnest phoenix move it as far away from discord as possible
i mean decrease

move it closer to discord
What am I going to do
I am done....
2 person's server was deleted all channels...
I don't know what happened in other servers yet
What will I do! :c
Contacting the nsa. I’m sure they have a copy of each conversation and channel
don't get it online again until you fix all bugs
@toxic jolt bruh
wait, discord.js’ RichEmbeds are still a thing?
wait, discord.js’ RichEmbeds are still a thing?
@earnest phoenix They are just renamed to MessageEmbeds in v12
He must be using an older version
wait, discord.js’ RichEmbeds are still a thing?
@earnest phoenix i thought you use eris
i do
just asking cuz that person just used RichEmbed
how do i install ffmpeg on windows 7?
Download the codex and install it.
that dont help
there should be a lot of useful resources regarding how to install it on the internet
yes but i cant find the right download link
Than it’s probably not mpeg you need.
oh you mean the download link
https://ffmpeg.org/download.html it should be on this webpage somewhere
Sure... asked Google and I got the right URL as first result
ok
maybe you are not searching with the right keywords if its not showing up tbh
well after i downloaded it now what?
Install it
move it to your C: directory or something?
its a zip file
i extracted it to C and now what?
extract it
@earnest phoenix did you try following the instructions on their website?
instructions? where?
Literally every single project on the web has instructions on their site for using it
Called documentation in this case
instructions? where?
@earnest phoenix https://ffmpeg.org/documentation.html
hope this does not count as spoon feeding
what the
client.on('guildCreate', guild => {
console.log('Bot Eklendi: ' + guild.name + ' ID: ' + guild.id)
// bot added log
})```
Does high ping have anything to do with bad code? cuz my old commands run slower than recently written ones
it isnt

Hi, sorry to disturb! I'm trying to use the broadcastEval() function in place of client.guilds.cache.get since it no longer works if the guild is in a different shard it seems but i cant seem to understand how the script should look like as a parameter.
Any help would be appreciated! 
discord.js adds in every guild and emits the guildCreate event for every new guild on start
iirc
after
lmaoaoaoao
rip pc
its not discord.js's fault
btw if your bot is in a lot of servers, its probably not a bug
what the
@toxic jolt is that mean the bot will show all guilds that your bot in?
winserver 
Does high ping have anything to do with bad code? cuz my old commands run slower than recently written ones
@earnest phoenix Nope. It’s a result of a „bad“ connection to the Discord gateway.
@toxic jolt is that mean the bot will show all guilds that your bot in?
@pearl trail no
What do mean with „high“ btw?
bot added guild show

you'll have to update to v12
How can I quickly and safely update to v12 in my bot
What do mean with „high“ btw?
@boreal iron the bot takes approximately 250ms for it to reach the command handler then execute the command
v11 is not supported anymore due to intents update and new gateway versioning (and the domain change)
i update all discord.js v11 code's
nvm i'm noob in js
to v12
Just update to discord.js v12 build and update your code according to the changes on the documents
okay but so many changing code in v12
No
well, discord.js v12 has so many code updates
is a backup relevant for a v12 update?
my bot is 2 years old!
i mean updating technically doesn’t affect your currently existing code iirc
There's just about 9 changes or a little more in total in d.js v12
There's just about 9 changes or a little more in total in d.js v12
@earnest phoenix 3K LINE IN BOT.JS
Oh okay that’s a different story @earnest phoenix
Writing it like this it is possible your code can cause the delay.
Are there a lot of loops in your code for example?
Bro my bot is 9k lines
ok
nobody cares
my bot has 100+ files and most of them have at least 100 lines
you were given an instruction on how to fix it
wait did you create a file for every event or command which caused you to have 400+ files?
Oh okay that’s a different story @earnest phoenix
Writing it like this it is possible your code can cause the delay.
Are there a lot of loops in your code for example?
@boreal iron there’s no loops but my bot runs 30 required if statements before actually moving onto the command
my bot has 100+ files and most of them have at least 100 lines
@earnest phoenix You should try to start a microtimer at the beginning of your script and one at the end and calculate and log the script time.
i think the ping is most likely caused by the processes
Hmm just try the timer and see how long you script needs to run through anyway.
Just a few lines of code...
100ms
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...Connection to log stream failed. Please try again later.
somewhere at there
What's this?
when i use my wifi to host my bot, it has 500-2000 ping ;-;
oh
Well 250 - 100 = 150ms which is okay in my mind
we can't send it here?
Send what
I look to discord.js website, and it is all .blablabla....etc. this part is OK, so now, my question is, How can i know what I am going to write next while coding, like, for example, message.channel.send, this is a common thing, but how do i know the others.
ah, it counted as spam
It didn't
It included a invite link
@rigid hull consult with docs or switch to TS and use typed code
Or something luca catched with some regex
@rigid hull consult with docs or switch to TS and use typed code
@earnest phoenix TS ?
[WS => Shard 0] [CONNECTED] <actually there is a link here ;-;> in 2726ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] [IDENTIFY] Shard 0/1
[WS => Shard 0] [READY] Session 15ab4673d25d7a4669b9c9278187deaf.
[WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
Cat Chan ready!, 3 servers, 32 members, 112 channels
[WS => Shard 0] Heartbeat acknowledged, latency of 6396ms.
41250ms
That's what happens when Self hostum
yes lmao
TS ?
typescript
Self-hosting is only good if you're testing something and have nowhere else to test it
how to delete glitch.com project
press the delete button
where this button
oh indian
yes
Here

Can I combine 2gb ddr2 ram with 4gb ddr4 ram?
wat
fuse then together
This will throw a memory error and your PC wont boot
what's even the difference between different ddrs
i assume higher is better
lol
different slots, operating voltage and frequency
there's more internally but that's the base difference
so older probably use more power
ddr6 when
also ddr6
bruh
but not for costumer PCs
^
ddr69 when
I would assume never
i'm pretty sure the ps5 is running on ddr6
we'll see when it launches
who even manufacturers the different ddr versions china who else, lel
the entire console is witchcraft
any tec being crafted in china
yeah but is there a base company that produces new ddr versions
oh no, I think it's an industrial standard
i'm guessing IBM cause of the standard yeah
not a company
I see
sadly my motherboard only supports ddr4
"sadly"
ddr4 is good enough
how to check, what ddr version ram my motherboard supports?
google your motherboard
Or open the task manager and take a look
so i have a custom command and want to put variables in it this is like my setup can i use .replace() ?
if (data) return message.channel.send(data.Content);```
data.Content.replace(x, y) sure why not
how do i invite my bot in a server
how do i invite my bot in a server
@hollow goblet You need an invite URL for it
There is an OAuth tab on your bot application page
Go there, click the bot scope, select what permissions your bot needs for servers then copy the ID
A small calculator that generates Discord OAuth invite links
@hollow goblet click the bot scope
I did
https://discordapi.com/permissions.html
@rose warren why the fuck does this exists it only takes one extra click on the bot scope on discord's own page
A small calculator that generates Discord OAuth invite links
@hollow goblet no you haven't
click the checkbox
I know 😂
Now check the perms
Then copy the link
ok what i click in bot perms
Whatever your bot needs to work
Don't take the easy route and click "admin". That's not good practice.
Yeah
If your bot has security bugs and admin many servers will die because of hackers
Only select the permissions it NEEEEEEEEEEEDS
Copy the link it gives you
Click the copy button
i copyed
That's the URL you give to people to invite the bkt
Then paste into your browser 😂
thank you so much.
Call y’all join my server and help me get to 100 people?
no
No
take your shilling elsewhere, incel
and this is development
YALL IS MEAN
@candid sandal You should have asked politely
I did
And we're not being rude here
You called cry a bitch
Bc
It's people's choice to join your server
She or he was rude
im getting unhandled promise rejection errors
UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
let buser = message.guild.members.cache.get(args[0]) || message.mentions.members.first() || args[0]
buser.ban({reason: breason}).catch(err => {
message.channel.send(`I can't ban someone with a role higher than me!`)
})```
even though i have a .catch
Try logging err
at RequestHandler.execute (C:\Users\farah\Elitebot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
method: 'put',
path: '/guilds/710369656262623253/bans/411548232133640203',
code: 50013,
httpStatus: 403
}```
There you go
const colors = require("../../colors.json")
const welcomeChannel = require("../../welcomeChannel.json");
module.exports = async (bot, message, member) => {
const channel = welcomeChannel[message.guild.id].channel
if(channel === null) return;
if(!channel) return;
console.log(message)
const embed = new Discord.MessageEmbed()
.setColor(colors.cyan)
.setTitle(`Welcome ${member.user.username}`)
.setDescription(`Welcome to **${member.guild.name}**, ${member.user.username}.`)
bot.channels.cache.get(channel.id).send(embed)
}``` Cannot read property "user" of undefined.
Cant seem to know why
bruh
im saying
that the .catch is not sending the message but instead giving me an error
message.channel.send(`I can't ban someone with a role higher than me!`)
})```
its not sending the message i have set on for .catch
@feral aspen are you passing member when running the function?
@feral aspen are you passing member when running the function?
@earnest phoenix Yes.
show
const colors = require("../../colors.json")
const welcomeChannel = require("../../welcomeChannel.json");
module.exports = async (bot, message, member) => {
const channel = welcomeChannel[message.guild.id].channel
if(channel === null) return;
if(!channel) return;
console.log(message)
const embed = new Discord.MessageEmbed()
.setColor(colors.cyan)
.setTitle(`Welcome ${member.user.username}`)
.setDescription(`Welcome to **${member.guild.name}**, ${member.user.username}.`)
bot.channels.cache.get(channel.id).send(embed)
}```
Bruh, member.
async (bot, message, member)
idk when I remove the message, it doesnt work
member.user?
something wrong with the code..
What is member
this is for the guildMemerAdd event
@feral aspen bro when the function is called in the command handler are you passing the third argument
not in the declaration
in this:
yourFunction(firstArg, secondArg, thirdArg);
that's called calling
This is my handler..
module.exports = (bot) => {
const load = dirs => {
const events = readdirSync(`./events/${dirs}/`).filter(d => d.endsWith('.js'))
for (let file of events) {
const evt = require(`../events/${dirs}/${file}`)
let eName = file.split(".")[0]
bot.on(eName, evt.bind(null, bot))
}
}
["client", "guild"].forEach(x => load(x))
}```
@feral aspen BRUH
shout I add message in to the .bind()
do you even understand what I'm trying to say
Yes
Show your guildMemberAdd event
Its up
Show the code that does client.on("guildMemberAdd"...
when you're ➡️ ***__CALLING__*** ⬅️ the function are you passing the third argument
In your events directory
bot.on(eName, evt.bind(null, bot))
Yup
Is there something I should add for it to work?
You need to pass a GuildMember object as your function needs it
The third argument
when you're ➡️
***__CALLING__***⬅️ the function are you passing the third argument
@earnest phoenix I'm not that expert into understanding, so can you tell me on what I should do to fix?
spoonfeeding
Yea, I guess. 😐
Learn how functions work lol
bot.on(eName, evt.bind(bot, message, member))
ask in plexidev they have better programmers than us
You cant use member if you don't pass it
You're only passing bot to the function
^ ^ ^ ^ ^
Idk what's up with the null tho
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^^ ^ ^ ^ ^ ^ ^ ^ ^
module.exports = (bot) => {
const load = dirs => {
const events = readdirSync(`./events/${dirs}/`).filter(d => d.endsWith('.js'))
for (let file of events) {
const evt = require(`../events/${dirs}/${file}`)
let eName = file.split(".")[0]
bot.on(eName, evt.bind(null, member, bot))
}
}
["client", "guild"].forEach(x => load(x))
}```
now in module.exports = ()
I should add member as well
and when i did that, it stopped the bot from running.
which is an oof.
because you are refusing to understand what the fuck we're saying
They're not in the right order for a start
member is not defined
that is what I am saying
if I add member, it will error out not being defined
Yes
You need to define it
Why are you binding null? Where does that come from?
someone told me to add it, so i did.
🤦♂️
bruh
function smth(firstArg, secondArg, thirdArg) {
// do smth
}
smth("lol","uwu","fuck");
// Now the function can reference `firstArg` as "lol", `secondArg` as "uwu" and so on
bot.on(eName, evt.bind(bot, message, member))
In module.exports:
module.exports = async (bot, message, member) => {... ```
Also I'd look into why removing null stops the bot from starting. Overall, I wouldn't handle events that way anyway.
But it comes down to the same thing, in order to call those variables in your command function, you have to pass them to the command.
in the bot.on, the member is not defined.
Because it's using the same line of code to call bot.on("ready") and every other event, where member isn't there.
Call your events separately 🤷♂️
You're making life harder for yourself
Call your events directly in your bot.js file
Anything else is just overcomplicating it in my opinion
I call them like this ["console", "command", "event"].forEach(x => require(`./handlers/${x}`)(bot));
should I add the message and member next to the bot?
Try it and see 😂
nah, it doesnt work
Where did you find this code?
the bind function assigns a this value to it as the first argument
so if you do someFunc.bind(bot), then inside someFunc, you can use this.channels for example, because this was defined as being bot
there are 3 functions to assign a this value: bind, call and apply
do you have a bot for fifa ?
bind assigns it to the function and returns a copy of the function with the value assigned, for future use
call and apply assigns it at the moment when you use the function
so @quartz kindle how can I assign member and message to every single event?
cause when i assign member in the guildMemberAdd.js event, member isn't defined
how did you assign it?
module.exports = async (bot, message, member) => {
there is no message in guildMemberAdd
how did you bind it?
it should work if you remove the message
adding message and member inside it makes it undefined
it should work if you remove the message
@quartz kindle nope it doesn't.cannot read property 'message' of undefined
Which section, please?
the guildMemberAdd event
const colors = require("../../colors.json")
const welcomeChannel = require("../../welcomeChannel.json");
module.exports = async (bot, message, member) => {
const channel = welcomeChannel[message.guild.id].channel
if(channel === null) return;
if(!channel) return;
console.log(message)
const embed = new Discord.MessageEmbed()
.setColor(colors.cyan)
.setTitle(`Welcome ${member.user.username}`)
.setDescription(`Welcome to **${member.guild.name}**, ${member.user.username}.`)
bot.channels.cache.get(channel.id).send(embed)
}```
there is no message here
you cannot use message at all
there is no message.guild.id
Well, Ill send the exact error when I remove message
I am using this in it
bot.channels.cache.get(channel.id).send(embed)
??
tim, whats js
there is no message, you cannot use message.guild.id
(node:9076) UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
you're still trying to use message
you have to remove message from EVERYWEHRE in that file
you still have console.log(message)
welp goodluck tim
I am doing like a !setwelcome <channel> thing
I kept the message for the const channel = welcomeChannel[message.guild.id].channel
there is no message
you're trying to get nothing
you need to work with what discord gives you
discord does not send you a message when a member joins a guild
there is no message
discord cant send you what doesnt exist
discord gives you a member, the member that joined
you have to do everything using only that member
nothing else
because nothing else exists in that scenario
Tim why are you even trying xd
https://pixelz.cloud/287164043591024641/b7596527-6d71-40ec-b4e3-c5357b5aa983.png how did this guy get 100 guilds

So trying to make something new is violent, good job! 👏
@feral aspen please learn about js functions
I'm just surprised you got a functional bot with 100 guilds without JS knowledge
And refer to d.js docs
I will refer.
all you really need to do
is replace message with member everywhere
because a member also has guild
so you can do member.guild.id
it wont
you did .bind(null, bot)
which means, this = null, 1st arg = bot, other args = args from the event
therefore (bot, <other aargs>) => {}
guildMemberAdd gives you 1 arg, a member, therefore: (bot,member) => {}
dbl.webhook.on('ready', hook => {
const dbl = new Discord.MessageEmbed()
.setTitle(`Vote Hazır`)
.setTimestamp()
.setColor("BLUE")
client.channels.cache.get("724311993086902338").send(dbl)
});
Why do I get that error?
you did
.bind(null, bot)
which means,this = null,1st arg = bot,other args = args from the event
therefore(bot, <other aargs>) => {}
guildMemberAdd gives you 1 arg, a member, therefore:(bot,member) => {}
@quartz kindle Alright! 👍
Ill do keep that in mind.
@manic flame that means the channel was not found
possibly because the bot was not ready yet
{
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
discordPresence.state = "Playing Solo";
discordPresence.details = "Competitive";
discordPresence.startTimestamp = 1507665886;
discordPresence.endTimestamp = 1507665886;
discordPresence.largeImageText = "Numbani";
discordPresence.smallImageText = "Rogue - Level 100";
discordPresence.partyId = "ae488379-351d-4a4f-ad32-2b9b01c91657";
discordPresence.partySize = 1;
discordPresence.partyMax = 5;
discordPresence.joinSecret = "MTI4NzM0OjFpMmhuZToxMjMxMjM= ";
Discord_UpdatePresence(&discordPresence);
}```
this what language
Anyone know how to do setprefix in commando
ok
Yes
It's a djs library
oh lol
that is not C# it's C or C++
Wdym?
const Discord = require('discord.js')
exports.run = function(bot, message) {
client=bot;
const DBL = require("dblapi.js");
const dbl = new DBL(client.dbl, client);
dbl.hasVoted(message.member.id).then(voted => {
if (voted){
const dblVoteError=new Discord.MessageEmbed()
.setColor('#2F3136')
.setFooter('WİZARD', client.user.avatarURL({ dynamic: true }))
.addField("**Komutu kullanmak için lütfen botumuza oy verin.**", " [Oy Ver](https://top.gg/bot/716723506393382922/vote)")
return message.channel.send(dblVoteError);
}
});
message.channel.send(new Discord.MessageEmbed()
.setColor('#2F3136')
.setTitle('🎲 Zarın: ' + doMagicDiceVoodoo()));
function doMagicDiceVoodoo() {
var rand = ['1', '2', '3', '4', '5', '6'];
return rand[Math.floor(Math.random()*rand.length)];
}
}
exports.conf = {
enabled: true,
aliases: ['zar'],
guildOnly: false,
permLevel: 0
};
exports.help = {
name: 'zarat',
description: 'Zar Atın',
usage: ''
};
why it does not return from first if
discord.js v11?
v12
@pearl trail can u give link
@earnest phoenix brb, i'll search
{
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
discordPresence.state = "24/7";
discordPresence.details = "online";
discordPresence.startTimestamp = 1507665886;
discordPresence.endTimestamp = 1507665886;
discordPresence.largeImageText = "Numbani";
discordPresence.smallImageText = "Rogue - Level 100";
discordPresence.partyId = "ae488379-351d-4a4f-ad32-2b9b01c91657";
discordPresence.partySize = 1;
discordPresence.partyMax = 5;
discordPresence.joinSecret = "MTI4NzM0OjFpMmhuZToxMjMxMjM= ";
Discord_UpdatePresence(&discordPresence);
}``` i need use this status

404
ah yes, private, wait
How many servers per shard should I have?
So I might like just have 2 shards
Just so I can make it bigger easily
It shards automatically
@rose warren wdym
I just use auto shard
@rose warren I’m dpy
I mean can I like make a command
done @earnest phoenix
@pearl trail this use one main id??
That lets me change shard count?
@earnest phoenix yes, the client id
how can i know how much my bot have shard?
@pearl trail You mean how many shards your bot has?
yes
For 90 servers 1 shard is enough
@rose warren is 2 shards overkill / bad?
Total overkill
<client>.shard.count
I’ll just shard it once ig
I use heroku
So performance isn’t too good
But it works great
Keep the sharding setup but use 1 shard
Yep
Also, move away from heroku
@pearl trail can u public all time ??
😂
I started on heroku so I feel your pain
How can I get the total channel count in all the servers?
Shards can only handle 2500 guilds each with no issues
I started on heroku so I feel your pain
@rose warren I mean I haven’t had any issues at all tho
@drifting wedge client.channels.cache.size
Shards can only handle 2500 guilds each with no issues
@earnest phoenix shards are recommended to hold around 1,000 each
no, djs
@earnest phoenix shards are recommended to hold around 1,000 each
@rose warren with heroku, if I still use it, I might do like 2 shards per 500
use
const ( shardManager ) = require('discord.js')?
@pearl trail
const {
ShardManager
} = require("discord.js");```
@pearl trail how to host this heroku??
My bad
@rose warren with heroku, if I still use it, I might do like 2 shards per 500
@drifting wedge That's overkill
@earnest phoenix thanks
@drifting wedge get a cheap VPS plan. It's definitely worth it
1/500
@drifting wedge get a cheap VPS plan. It’s definitely worth it
@rose warren I mean, I want to get my bot a bit bigger
Just don’t wanna go all in, and quit midway
Look at Pulseheberg VPS hosting. They have good deals, cheap plans, and I've been using them for 6 months no problems
Look at Pulseheberg VPS hosting. They have good deals, cheap plans, and I’ve been using them for 6 months no problems
@rose warren imma wait a bit tho
@earnest phoenix upload all your code to github, well i make the repo private so no one can access that. now, create Procfile in the repo and fill it with worker: node <your main file>, after that, create an account in heroku, connect it with github, scroll down, click the automatically deploy, and deploy
Up till like 500 servers?
Yeah
Also, wuts the best way to get donations?
i use heroku to host my bot now
@pearl trail example.py>>






