Btw since it's your bot how come you have what seems to be a scam link in your bot status https://image.prntscr.com/image/KKHRxLiMQE6JyMk11MiU9Q.png 
#development
1 messages Β· Page 748 of 1
Mkay
but if that link does exist then uh...oops?
No it does not but if people see FREE ROBUX in your bot status then they might just not use your bot
im gonna flip my shit if discord keeps the <@! thing since i need to check for two different prefixes
especially if it's silent since discord doesn't document this shit
anyone know if this is going to be in the next stable update or not
it's discord what do you think
iirc on mobile pings are <@!
honestly why though
never knew it was on desktop
it's not on stable channels at the moment
but still a lot of people use canary
yeah that's why it's frustrating to have to adapt to canary
discord should honestly just leave mentions alone
const Discord = require("discord.js");
const sql = require("sqlite");
const config = require("../assets/config.json");
sql.open(`./assets/${config.dbsqlite}`);
module.exports = async (client, guild, member) => {
if (member.user.bot) return;
sql.get (`SELECT * FROM guildes WHERE guildId ="${guild.id}"`).then(row => {
let modlog = member.guild.channels.find("name", row.logschannel);
if (!modlog) return;
if (row.logsenabled === "disabled") return;
const embed = new Discord.RichEmbed()
.setColor("#36393f")
.setThumbnail(member.user.avatarURL)
.addField("Utilisateur ", `${member.user.tag} (ID: ${member.user.id})`)
.addField("Rejoint: ", `${member.user.tag} a rejoint le serveur!`)
.setTimestamp()
return client.channels.get(modlog.id).send(embed);
})
}
(node:11471) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guild' of undefined
This is this line
let modlog = member.guild.channels.find("name", row.logschannel);
How can I resolve this?
guild doesn't exist
member is not defined or member is something empty
But this happens when the member joins
Okay
maybe it says undefined cause its in a function
Oh
Okay wait
undefined
In the console
module.exports = async (client, guild, member) => {
console.log(member)
how does ur cmd handler handle events
fs.readdir('./events/', (err, files) => {
files = files.filter(f => f.endsWith('.js'));
files.forEach(f => {
const event = require(`./events/${f}`);
client.on(f.split('.')[0], event.bind(null, client));
delete require.cache[require.resolve(`./events/${f}`)];
});
});
In the ready.js i have the commands
client.on(f.split('.')[0], event.bind(null, client)); does it bind the member?
No
client.on('name', event)
should be fine
or
client.on('name', event.bind(client))
will make more sense and lets you access client as this on the event
parameters is automatically passed as well
:/
client.on('event1', event.bind(client))
client.on('event2', event.bind(client))
etc...?
This is weird...
brb
since you bind it
Okay
Ty
sql.get(`SELECT * FROM guildes WHERE guildId ="${guild.id}"`).then(row => {
TypeError: Cannot read property 'id' of undefined
π
did you define guild
client.on('guildMemberAdd', event.bind(client, guild))?
Do I have to define everything one by one like that?
the guild there is redundant
shouldnt this be there too?
event.bind(client) is all you need
Mmmh
I doubt the this is defined on that scope

Basically my problem is module.exports = async (client, guild, member) => {
client is the member there
guild and member is undefined
while client will be this
Wait i log guild
member has a property called guild
if you want access to client, then you can do so by using this on the event file
since that what .bind does
this.member?
this "is your discord.js client"
do discord.js client have a property called member?
The member is only in module.exports = async (client, guild, member) => {
its basically the same of what guildMemberAdd outputs
the reason why guild and member is undefined because the event doesnt even output those
and you mistook member thinking its your client
Mmmh
console.log()
this and client there
you will see where you are wrong
if you have knowledge of js as I think you have ofc
When i console log guild
thats undefined
wait what how do you run your event.bind()?
in reality you only need module.exports = async (member) => {}
cause guildMemberAdd only outputs a single parameter which is member
fs.readdir('./events/', (err, files) => {
files = files.filter(f => f.endsWith('.js'));
files.forEach(f => {
const event = require(`./events/${f}`);
client.on(f.split('.')[0], event.bind(null, client));
//client.on('guildMemberAdd', event.bind(client))
delete require.cache[require.resolve(`./events/${f}`)];
});
});
module.exports = async (client, guild, member) => {
console.log(guild) => defined
console.log(member) => undefined
Mmmh
well ofc guild will be member if you null the first
I think you dont even listen to what I explained to you
I have a very poor level of English
event.bind(null, client) will
- set this as null on your event file
- member is your guild
- member is undefined
event.bind(client) will
- set this as client in your event file
- client as your member prop
- guild and member will be undefined
thats my last explanation
if you dont understand wtf is this, its actually easy. every function have a variable this
its just not utilized, in simple terms
Okay nice
.bind() lets us use the this if its non existent, specially on arrow functions
Mmmh
client.on(f.split('.')[0], event.bind(client));
client.user.username => TypeError: Cannot read property 'user' of undefined
1. set this as client in your event file
How
as simple as changing client to this
Okay
this is a variable
my server count still doesn't show and it has been way over 15 minutes...
what do?
I put the code in and everything https://prnt.sc/qbboe5
how could i add mentions to a role or user in an embed text using magic bot?
Just dm me Iβll walk you through it
Who
INSERT INTO warns (userID, reason, expiresAt, staffID) VALUES ('${member.user.id}', ${reason ? reason : null}, ${expiresAt}, '${msg.author.id}') what the heck is wrong in this sql
INSERT INTO warns (userID, reason, expiresAt, staffID) VALUES (?, ?, ?, ?), [member.user.id, `${reason ? reason : null}`, expiresAt, msg.author.id]
@wheat jolt
π€
I think this is good
Wtf
?
Nope
does anyone knows what this error means:
Error: getaddrinfo ENOTFOUND name.glitch.me name.glitch.me:80 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
can't connect to glitch
@earnest phoenix isn't it () not []
cool
try again later or check the status page for any maintenance?
can i have help
yes
Ask2ask
ok
it doesn't work
i mean it need to only work for me
and other guy
but
it for everyone
u can see in #commands
when lunching the cmd
by //dev
you cant do something === something2, something3
you could do id === id1 || id2
that wont work either iirc
lame
ooof
do you have a website
No
@celest cradle if you dont know what it is, dont put anything there
But it wouldnβt let me submit without it
it does
no
you have an error somewhere else
its dont habe the red star
Okay hold on let me try again
so u can
Do Ur long description then
Oh
is this possible to send dm using bot to whole server member at one time
like to a whole server
yeah i'm pretty sure
i'm also pretty sure that could be api abuse
i'm using this to send a saperate mensioned user
let mn = message.mentions.users.first();
i want to know that how to send to whole server member dm
.forEach works
can i use
client.guilds.forEach
ratelimits
there's also that
don't mass dm
api abuse and you're putting your bot at risk of termination
repeat it multiple times and your account will be terminated
im just brainstorming a way to restart a bot without any loss of messages. because the old instance of the bot would still be running and would start the new instance, i wouldnt be able to use a RESUME, so im thinking:
- old bot instance creates a file at a known location called ".restart"
- new bot instance starts up and identifies to all shards, but doesnt respond to any messages yet. at this point, old bot instance can still respond to messages.
- once all shards are up on the new bot, the new bot removes the ".restart" file
- new bot can now respond to messages
- old bot is watching the ".restart" file, and when it sees its deleted, shuts down.
this way theres no loss of any messages, and no visible downtime at all when i issue a restart of the bot. thoughts?
also doing it this way means if something messes up in the sequence and a .restart file is still left around when one instance is started up outside of a restart, it will just go through normal operations, removing that .restart file once its up and running.
Can someone tell me which MongoDB atomic operators should I use if I want to replace an entire document?
@green kestrel holy shit thats a really smart idea, ill add that to my template
in theory it should
but since im only working with child processes, i dont need watching a file
just pass stuff through an ipc socket
whats the error
show code context
queue[0].voiceChannel
.join()
.then(connection => {
const dispatcher = connection
.play(
ytdl(queue[0].url, {
quality: 'highestaudio',
highWaterMark: 1024 * 1024 * 10
})
)
.on('start', () => {
message.guild.musicData.songDispatcher = dispatcher;
const videoEmbed = new MessageEmbed()
.setThumbnail(queue[0].thumbnail)
.setColor('#e9f931')
.addField('Now Playing:', queue[0].title)
.addField('Duration:', queue[0].duration);
if (queue[1]) videoEmbed.addField('Next Song:', queue[1].title);
message.say(videoEmbed);
message.guild.musicData.nowPlaying = queue[0];
return queue.shift();
})
.on('finish', () => {
if (queue.length >= 1) {
return this.playSong(queue, message);
} else {
message.guild.musicData.isPlaying = false;
message.guild.musicData.nowPlaying = null;
return message.guild.me.voice.channel.leave();
}
})
.on('error', e => {
message.say('Cannot play song');
console.error(e);
return message.guild.me.voice.channel.leave();
});
})
.catch(e => {
console.error(e);
return message.guild.me.voice.channel.leave();
});
}
module.exports.help = {
name: "play"
}
full code ??
what
function playSong
Indeed
Hwy i need help with my +work Command. Its code isnt working at all
Ironic
How to properly ask technical questions, and demonstrate that you've done your research and are willing to learn on your own.
We need code and an error
Ill give it to you from hastebin. Its too lonf
Error
we need an error
before we can help you
just giving us code won't do anything to fix the problem
refer to the link above
The code is 2000 max chars well the error is. The data.etc it has a red mark which my coder is glitch.com which sucks :(
Like data.memberData.workStreak
It doesnt work
Thats the error
is there any specific error in the console
again refer to the link above, learn to ask a proper question because no one has any idea what you're talking about or what you're using
π π

how to make only ids cmd

@prisma lion (on d.js) if (msg.author.id === "urid") add before the commanf script, or in d.py if ctx.author.id == urid
thats assuming javascript
and assuming discord.js iirc
but as you didnt say which language, thats probably a valid assumption to make
oh god
LEARN THE BASICS

chill
It's an arrat
That's basic programming...
CHILL I JUST WOKE UP
omg
Bruh
i jusst deleted the scripttttt.
ok
nice
well i did it in "array" thing but it didnt work everyone can still acces the cmd
its my old problem
(yesterday i said the same)
then you didn't do it right
ok
.
what's your code
a sec
if (!msg.author.id === array) return; heres ur better....
[] this is empty array
@restive furnace don't spoonfeed code, or well don't spoonfeed incorrect code
oh wait a sec
kk
but all code what i already spoonfeeded are only line 1 line or like that "[]"
- every of then should work on the package Mehdi using.
wait
that's still incorrect
you're comparing the id to an array
your goal is to check if the id is inside of the array
ehm?
check it by "includes" key word, not spoonfeeding the code.
no
shut up
meh
const dev = [456532271969730562, 469848488545484800]
if(message.author.id == dev) {
@late latch that's still incorrect, stop spoonfeeding code
....
that's very incorrect
omg
it very much isn't
but worst
my tip what i alr said earlier: check it by "includes" key word.
On python if authorid == array works but i still like js more cuz python isnt so modular as node.js
xd
python is yuck for me
tbh
i dislike the syntax and it's interpreted
but everyone has their prefs
Python went well for me personally despite it being interpreted /shrug
i'm a maniac for performance
understandable
c langs gud for perfonmance
Also some_id == list() won't work
wut
Python == compares values. If you want to check if an object is in a list, use in
what about list in list in list in list?
arr[0][0][0][0] possible xd
Possible but there's no point in doing that imo
yes
ye right
Unless you are doing some really fucky stuff

nest lists into oblivion to the point it crashes on init
list in list sometimes needed

Yes but not a recursive list_x in list_y
what
the code
what
correct one
ok
i gave you a link to a resource which is very helpful
k.
learn how arrays work and then browse https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array a bit
is there a way I can check if a url is a valid audio file
check the extension
does anyone know a good rpg bot?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
check the extension
it isn't reliable enough
you have to check the file header
if you only do extension checking someone can pass a png file as an mp3
or the mimetype
which will error out when you attempt to read it as an audio file
mimetype also depends on the extension of the file
or well whatever the host sets it to
which most set it to the extension
how to add cooldown to cmd that shows you how much time it rest to use the cmd again
use a map
keyed by the user id
and the command as the value
when the command execution finishes add the user id to the map
and setTimeout for whatever your cooldown is to remove the user
One message removed from a suspended account.
dont dotpost
PIL
not like you can find it in JS
isn't nadeko .net
One message removed from a suspended account.
One message removed from a suspended account.
let me check some websites
ty btw
oh wait yeah true@earnest phoenix
should be the latter I think idk
for 1 sec I thought it was py
well I dont use nadeko so
Good alternative to pil is https://p5js.org/
p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.
either ways you can't find those exact libraries in JS
One message removed from a suspended account.
so yuh got to find some alternatives and mess around with that
One message removed from a suspended account.
p5js
One message removed from a suspended account.
magick.net is just a binder for imagemagick which is crossplatform
@compact oriole afaik thats for JS not node
so you can theoretically use imagemagick in js
yeah ofc you can always use wrapper libraries
but the syntax and usage wont exactly be the same
One message removed from a suspended account.
i just want to remake nadeko in javascript
i'd say that is pretty much a suicide mission, js is not as powerful and efficient as c# is
One message removed from a suspended account.
JS is interpreted, isn't it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
no not discord js version
its the engine behind node
Maybe you should search npm
true, there are many options available
though as a webdev I usually use jimp (but slow) or canvas
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
jimp is gonna drain the hell out of whatever you're hosting your bot in
js itself is not a shining paragon of efficiency, add image processing to it and you meet impending doom
well its a good starter choice though
One message removed from a suspended account.
well it indeed is. but it would be a better investment to learn the canvas api
One message removed from a suspended account.
it is a native module so it runs on the underlying C++ binaries instead on the v8 itself
node canvas can be a bit painful to set up, and isn't as intuitive , but it sure is powerful
I'm surprised no one suggested Jimp
One message removed from a suspended account.
One message removed from a suspended account.
oh fucc
we did and immediately told why not to use it 
π©
One message removed from a suspended account.
One message removed from a suspended account.
ram is not exactly your main concern
imagine that JS is single threaded and jimp will do image processing on that one thread every time
One message removed from a suspended account.
One message removed from a suspended account.
well node doesn't care
6 what
One message removed from a suspended account.
One message removed from a suspended account.
it will only use one
Single threaded
One message removed from a suspended account.
cpu-locking
it will wait every image processing task on a queue
as your bot grows that adds up
One message removed from a suspended account.
One message removed from a suspended account.
if you don't have variable images you can go for it. but that just hides the problem. doesn't solve it
@earnest phoenix ok lemme correct myself, nadeko actually uses imagesharp https://i.wilz.cf/XUqHErP6d2.png
if you're going for like. profile cards and such, then u gonna have a hard time
canvas being a native module does exactly that
One message removed from a suspended account.
One message removed from a suspended account.
then caching is pretty useless
One message removed from a suspended account.
Unless you want to kill your system
the problem is not storing or grabbing images, but processing them
since they'll change Everytime, there's no much point in storing the result
How to get the news channel of a guild?
One message removed from a suspended account.
Steam had a security flaw with just that problem actually lol
time to actually write a bot in C++
One message removed from a suspended account.
@fluid basin lmao
not a pure C++ bot ofc
if you want to write a bot in C++ without a library, read this first https://dev.to/timbeaudet/the-discord-bot-that-nearly-killed-me-created-in-c-gb5
maybe with a JS connector
Thet cached someones personal page and gave anyone that accessed it their details
any1 help me?
@earnest phoenix channel.type
does that return a bolean?
read the docs please
what do you need again
Yes
then just filter through the channels to get a list of news channels
i just need the bolean so i can check if it exists
i dont need the names/id's of it
Filter channels by type, if there is at least one result return true
Pseudo code is helpful, think of the problem and solution in words first
Why does discordapp.com refuse my connection if I do it through an iframe?
what? that depends on what you're trying to do
My guess would be that they are trying to block scammers from using iframes to create a fake discord website
I'm trying to add an invite to my discord server
?
Ah i see
Yea intresting looks like Discord does indeed block iframes from loading server invite pages
why though?
is it that hard to add a button that opens the invite in a new tab
yes
if you have popup blocker, yes
does anyone know how to program a musicbot in discord.py rewrite
cause im having issues
@earnest phoenix he wants to have a dynamic name/background and member count too also if it did work it would not open a new tab
That's why he wanted an iframe but discord block that
if you have popup blocker, yes
a popup blocker allows new tabs to opened if it's a voluntary action
which, clicking on a button, is
I have had times when it blocked it
but well, it's working now
Yea it just depends on what popup blocker settings you have enabled also js scripts can just fake click a button so how would it dected that from normal user input 
it happens when sites use anything other than anchor or button tags as buttons
@prime cliff the position of the mouse maybe?
Yea that would be intresting
How i can do this but in json
because i want to now my bot wich user,channel,idserver
wha
What language is that
C++ but isnΒ΄t my is a motor of nadeko
Uhm
But i wonΒ΄t wich command canΒ΄t returns the info of the comands are using and channel id and id of the server
i had a stroke trying to read that
same
I want to create a log style to see which channels the commands are used as in the capture but in json code

either edit the source code or capture the output and parse it
sorry
why do people want to store things in json so much π whats wrong with A db
I already did it but the engine of that exe was badly created.
from what I've figured from here is that people are afraid of learning
Only i wonΒ΄t is like you send a comand of the bot in a channel when he user doing that comand me returns that: user(id), channel(id) mesage(comand)
well that would just be like having a system that just adds that text to a DB every time
then when u need it just calling on the DB
why you would use a JSON for that is just weird
Yes i will take a look because the motor of my bot is from Nadeko Bot. Is in net and C++
c++ and net are not the same

making a functional bot in c++ is granted to give you a trip to a psychologist
So I should reserve one
smh
@earnest phoenix If you saw what I decompressed from the engine of the bot, 70 .dll and 3 json and some .net
im aware that dotnet publish outputs a lot of dlls
and im aware that single file publish exists
so you didn't do it, the dotnet CLI did
its just, a massive pain in the ass
@modest maple yes
choose a better supported language π next time xD
I was talking with the owner and saying way you canΒ΄t do in 2 .dll because is very bad all the code
@modest maple Wich code you use?
you can actually pack everything into one executable
More times i use only Json and Node
ive built a bot in both python and d.js
And net or c++
and yh but you can do it in c# cant u to make it into a EXE
Python is more easy ?
I now now will do one in pascal
easier for people to over estimate their abilities
Yeah now i create some explots for jailbreak
x doubt

lol
well thats one way to get banned both from discord and this server
if your taking tokens that arnt assigned to your account

now because i am not using and he can take a look in my account
i feel like im back in 2010 where kids are cocky talking about hackerman stuff without knowing what it means
because that's what is happening here
Only discord can take a look from my account
I jailbreak Android
@earnest phoenix shut up before i reverse proxy ddos your gpu speed
oh yeah well my dad works for microsoft @mossy vine
- dick move
- get beaned
mine is apple
JAJAJAJ nice try but in mi IP or discord history are nothing
Remember to clear your Discord history
fun fact you actually can though
in compliance with eu's GDPR your data must get deleted once you terminate your account
XD
One message removed from a suspended account.
@loud salmon ily
One message removed from a suspended account.
fucku2 @twilit rapids
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
LL = lavalink
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Wait you don't have a LL server running yet?
One message removed from a suspended account.
Well there's your issue
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Did you create an application.yml file in the same directory?
One message removed from a suspended account.
Go ahead an copy the "code" from this https://github.com/Frederikam/Lavalink/blob/master/LavalinkServer/application.yml.example and paste it in there
Then change it to your likings
port, address, password, sources, bufferduration, youtubeplaylistloadlimit, youtubesearchenabled and soundcloudsearchenabled
One message removed from a suspended account.
One message removed from a suspended account.
then run java -jar Lavalink.jar in terminal in that directory
One message removed from a suspended account.
capital L
One message removed from a suspended account.
One message removed from a suspended account.
are you sure it's in the right directory
One message removed from a suspended account.
and are you sure that there's a Lavalink.jar file in there
Yeah but the jar isn't in the root of that dir
I'm pretty sure you need to build it first
Or you can download the jar from their CI
They said that they already downloaded the lavalink file
Yea you don't need to build it that jar file is the built package
One message removed from a suspended account.
One message removed from a suspended account.
n o
Wait what are you downloading the repo
Download the latset jar file from here. https://github.com/Frederikam/Lavalink/releases
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Download jar file from releases create an application.yml file along with the jar
And see that Example
One message removed from a suspended account.
Move the lavalink.jar file to the directory your application.yml is
Don't open it
Just
let it exist
One message removed from a suspended account.
and run java -jar Lavalink.jar again
One message removed from a suspended account.
One message removed from a suspended account.
I assume you have lavalink-server.json file in your bot's directory
One message removed from a suspended account.
Did you change the default password in application.yml though 
One message removed from a suspended account.
Configure that to whatever you changed the things to in the application.yml file
port, address, password
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
So it connected?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Because YouTube is yeeting IPs, I would suggest to disable YouTube for now until you setup IPv6 on your VPS
One message removed from a suspended account.
One message removed from a suspended account.
Soundcloud
Youtube does not yeet you if you are under a certain limit but disable any playlists from loading

They yeet really often now
in js will having a class that extends a class that extends another class that extends yet another class etc. up to like 6-7 max affect the performance noticably?
w-wha- who DF does that>?
I honestly have no idea if it would
@modest maple me
const DBL = require('dblapi.js');
const dbl = new DBL(settings.dbltoken, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on(`ready`, hook => {
console.log(`Webhook is up and running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on(`vote`, vote => {
var VotedUser = vote.user;
console.log(`User with ID ${vote.user} just voted!`);
try{
client.users.get(VotedUser).send("Thanks for voting!");
client.users.get(settings.owner).send(`${VotedUser} just voted for ${client.username}`);
}
catch(error){
console.log('Uh oh! ' + error);
}
});
When someone votes, the bot doesn't do that.
what does it do
how to get users by username?
what lib
I want to get their IDs as soon as the voters give it over
But it doesn't work
const DBL = require('dblapi.js');
const dbl = new DBL(settings.dbltoken, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on(`ready`, hook => {
console.log(`Webhook is up and running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on(`vote`, vote => {
var VotedUser = vote.user;
console.log(`User with ID ${vote.user} just voted!`);
try{
client.users.get(VotedUser).send("Thanks for voting!");
client.users.get(settings.owner).send(`${VotedUser} just voted for ${client.username}`);
}
catch(error){
console.log('Uh oh! ' + error);
}
});
You don't need to give the code twice
ok
@earnest phoenix find()
if (message.content === prefix + 'count') {
message.guild.createChannel(`${message.guild.member.count}`,{type: 'voice'})
.then(console.log)
.catch(console.error);
}
})```
Why when I try the command the channel is named undefined ?
message.guild.members.find(m => m.user.username === args.join(' ')
? @summer torrent
yes
ok
@lunar crystal message.guild.member.count is wrong
@lunar crystal message.guild.createChannel({name:message.guild.memberCount}, type: "voice")
message.guild.memberCount
Β―_(γ)_/Β―
ok thank you both @summer torrent @earnest phoenix
np
π
i typed no instead of no xD
x)
next_tick.js:68
code:50035
message:"Invalid Form Body\nname: Could not interpret "{'name': 13}" as string."
method:"POST"```
if (message.content === prefix + 'count') {
message.guild.createChannel({name:message.guild.memberCount},{type: "voice"})
.then(console.log)
.catch(console.error);
}
})```
the error is english
the name has to be a string
you could use several things to make it one
such as template literals
toString
the servers need to be guild IDs
and valid on top.gg
which means that the servers need to have the @pliant gorge bot in it
How
Did you put your bot to get tested?
How π
Unless I got confused
with what you said
i Do all Thing in the end say's
Invalid server format
server area is optional
Ok, what will I do?
leave it empty
server must be the ID of the server
I'm using the HTTPS module paired with express to establish SSL with our certificates, GET requests work fine but POST never get through, the server does not connect, when just using standard app.listen(port) with http it gets through fine
ok so my embed wont send but im not getting any errors
What library and show code pls
discord.js if(command === "Help") { let embed = new Discord.RichEmbed() .setColor('#1e5878') .setThumbnail('stuff') .addField('eee', 'field') message.channel.send(embed) };
what is command?
i don't think you put 'stuff' as a thumbnail
there were links
so i just put random stuff
const command = args.shift().toLowerCase();
Help should be help
wants an image right?
How i will enter my bot in this server
@timid dawn did you finish adding it in the website?
my embed is not working still
send code
i just made a new one if(command === 'embed') { let embed = new Discord.RichEmbed() .setDescription('Heyy') message.channel.send(embed) }
is it generally acceptable to send a message unannounced to all servers if the bot is being shut down/restarted by the bot developer?
as opposed to the normal 'respond only when triggered' rule
I don't think that's exactly smart to be sending messages like that
mainly because 1. its unannounced and 2. its annoying
if anything I'd want an opt in
Unannounced like there's no set announcement channel they can speak? Nah. Pretty much what Rico said
Generally bots should only send messages when they are triggered by a user
true, but this isnt every 'X'
its to announce a shutdown, which unless things are really going down the shitter should be like, once every 6 months or less
but yes, there would probably need to be some configured announce channel
it would be abusive to send it to every channel of every guild
just make sure you space out the message for each guild
so one guild might get it at 2:30pm while another gets it at 2:35pm
thats a defininte need. right now, i'd have to send 560 of them or so
chances are nobody cares for the announcement
if you want to announce stuff
create a central guild for it
@earnest phoenix in my experience when i restart the bot nobody even notices
its back within 2 minutes
and tbh i do have a status updates news channel that others could subscribe to if they want that info
probably best sticking with that
I agree with cry honestly
it's general bad practice to send it to every guild instead of posting a note to a central//support guild
from my pov i'd personally get annoyed if a bot would constantly tell me it's shutting down
I mean if it's configured I guess it fine but eh
you just make a channel for it and if people want they can get notifications for the channel or follow the channel and have the webhook send it to a channel in their server
which you dont run the risk of api abuse
come to think of it
even if its configured and opt in, it would become unmanageable to send them
yeah so just let discord handle it really with a channel for it in your support guild or whatever
running the message sending at the proper rate limit, 500 guilds would take 10 minutes(?) to send the notices
and that 500 is only going to get bigger
well that assuming all 500 opt-in
well, if the bot continues to grow at present rate, within 2 more months i'll be at 1000 servers
so that would only be half of servers opted in
etc etc
but right now growth is looking a little less linear
Heyo, I was wondering, I was in the bad habit of having all my code in one main file, so I recently am having all the commands in separate files and stuff.
My problem is that I don't know how to manipulate variables in the main file from the command files.
For examples, if I were to run a command that SHOULD toggle a Boolean variable (in the main file) so that any I can do something with any message sent after the command is run.
I know that you use modules.exports or something to make things available to other files, but it kinda looks like that just makes a new instance? I need the variable IN the main file to change, otherwise my command won't work.
Do you have any resources or links I could take a look at for this?
Put them under client
Like: js // index.js const client = new Discord.Client() client.foo = "bar"``````js // commands/ping.js module.exports = (msg, client, args) => { console.log(client.foo) // bar }
well... idk what commands.js looks like so idk what ur talking about
I assume you read what I wrote above?
no mention of a specific file called "commands.js"
There is no specific file called commands.js
I'm just wondering if that would work with what you've shown me
If you add a property to client after initializing it, and you pass it into every command using your command handler, the property can be manipulated.
if (command === "kick") {
if (message.member.missing('KICK_MEMBERS', false)) {
return message.channel.send('no perm error');
}```
wait
(node:8660) UnhandledPromiseRejectionWarning: TypeError: message.member.missing is not a function
uat hellp
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
message.member.hasPermission() @lapis merlin read the docs
okay
One message removed from a suspended account.
One message removed from a suspended account.
don't use deprecated methods
are you on master or stable
Permissions#has is the way to go
I'm sorry guys, I'm a beginner and I can make some silly mistakes ;-;'
use permissions.has
a
okay
(The google translate tab is open because my english is not very good and I don't want to make any mistakes)
it's fine
lol
uh
link?
no the selector is a#libclick
no can I have the link to your bot page
lmao
lemme hop onto pc
im honestly not sure how css works but doesn't like !important exist
or smth
idk what it does
One message removed from a suspended account.
oh wow i actually helped
hello solver i have a discord bot i run from my own server but i just want to stop or started it on a web interface
if for some reason you stop the bot it can be solved to restart automatically
I have a question regarding discord.py, I'm trying to get to differnt .wav files to play() sequentially with as little delay as possible, but I'm having a bit of trouble. Does anyone know a good way to go about it
?
@earnest phoenix if you are using some pm2 or other process manager, they will restart it if you do process.exit() or shutdown it someway. + i thought that youre on js so i said why its happening on js
@restive furnace Node js





