#development
1 messages · Page 508 of 1
do you see anything in your logs?
Nothing
does it show "ready"?
Nope
ok, how do you detect if theres nsfw in an image?
you have to actually run the bot
the bot is online? so where is it running?
@reef oriole if you're getting the image from a certain place, you can tell that way (ie if your source is reddit, check if the post is marked NSFW), you can also use machine learning but that's not really as reliable
i dont know if your code editor runs it, but usually you have to go to your bot folder, open a command line, and run node botfile.js
that doesnt't help. my bot was denied for showing nsfw content when i check if it's nsfw content coming through
but the api failed to flag it as nsfw
so i can't do that
if its online is running somewhere though
Ok
so how do you do machine learning then?
you have to find where it is running, and restart it
@reef oriole well there ain't nothing else you can do. get a better api or use some library that can detect NSFW stuff
honestly, i can't use another api since my bot is based around this one website
and i don't know any
what website?
I ran the command and this is what I found
not sure how this site works
but if it has a point system, you can make it only accept images over a certain number of points or something
that's what i do for reddit stuff and i've never had a problem
there's nothing else you can do
if you want to avoid the problem completely you can just make it so that you can only use the command in NSFW channels
@drowsy yew i mean... the actual name of your bot file, not literally "botfile.js"
but i'm thinking you'd want to avoid that
any1 know how i can hide bot token in github code?
i'll just go ahead and delete it all, because the majority of the bot is useless anyways
@earnest phoenix gitignore files
Well, a command only working in NSFW channels is better than that command not existing 
but a bot that only works in NSFW channels is silly
the entire bot has 6 commands, 3 meta and 3 api-based. and i'd have to make the 3 api ones nsfw-only
show me your thomasbot folder
there is no thomasbot.js
there is "index.js" and "ThomasBot Code.js"
which one are you coding?
The code
Which file is the code in
ThomasBot Code.js
yea or that
Okay
you renamed your file to index.js?
that's a vscode error I think
i dont use vscode, so idk whats going on
try node . I got same issue and i fixed it by typing this
node . targets the file index file specified in package.json afaik
alright, if its sending "ready" then its working
how do I host my bot with gce
anyone ever tried AWS spot instances for a bot? Thinking about migrating to that to save costs.
ok
How many instances are you running?
huh
is it spamming indefinitely or a limited number of times?
@wheat marten did you set up a google account with a credit card? then go to https://console.cloud.google.com/
create a new project, then go to Compute Engine, and create a new instance. F1 micro is free (on US servers)
shit code then
im gonna guess that you didn't ignore bots
he doesnt, but his code wouldnt match what the bot was senting
Apparently, I made it Loop the message "Hello Dad!"
show your code again
ew taking my prefix
wait what
you didnt change the =, remember when we talked about it?
= is for assigning a value, if you try to assign it inside an IF, it will always be true, because the assignment was successful
^
=== doesn't do type conversion like ==
@quartz kindle it let me in even though I don't have a credit card
ok
wait no
it will ask you to set up a billing account at some point
@topaz fjord I thought it was the other way around?
Any service that doesn't take a credit card?
idk, see if anyone here is offering to share their vps
sometimes people offer in here
DO accepts paypal iirc
I am thinking of using Glitch
show code
I just changed the = to =x3
you need to restart the bot
How do I restart it again?
omg did that picture actually have his token in?
https://media.turtle-bot.com/f/ZQyFM.png honestly I need to fix this
yes jonny, he was ignoring my warnings
how do I make a batch file that starts my bot??
1 shard with 1 vc has 300 megs while the other with 3 vcs has 200
@drowsy yew I'd recommend resetting your token
mem leaks are fun
Wait what
oh god
I did?
that's like a -50IQ move
@queen sentinel take control u wont no balls
yes
Oof, I didn't see it
yes it is 0 iq
Mb
posting your token is dangerous
I know
I forgot
Because I like
I kept sending this
So I thought I still had it copied n shit
@queen sentinel tysm
I literally thought that I forgot something for a min
@drowsy yew forgot a ";" after your token
does d.js not have commands extension or something?
Oh
It's for good code
How do I make a .bat file that starts off my bot???
can someone explain commando to me
you know you can google how to execute a command from a bat file
@queen sentinel literally it has a command framework built in
so
like
oh
for the lazy people
no wonder Oliy was opposed to me using it ages ago lmao
no if statements for commands
so do I do
idek if commando is even updated
yea
you got to put the token in the code
now you replace the token in your bot with the new one and restart it
suggestions for what?
How to get the bot back up
your token is wrong
^
Wdym
I just invented some rad VS code crashing code
ok
everytime a command is used it logs it in the terminal
Hoping it debugs
lol no
it won't debug by itself @drowsy yew
it wont break vscode
still wont
I know
vscode uses command prompt/powershell
I replaced the token
it will break if those break
And it still won't work
UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event
You've put the token in wrong or something
cus it says the "login details" are incorrect
Oh
just remove the token and copy and paste the new one back in
are you sure you're pasting the part that says bot token
Yes
Its const Discord = require('discord.js');
const bot = new Discord.Client();
const TOKEN = (INSERT MY TOKEN HERE)
is your token in quotes?
is the token surrounded by ""
like "" or ''
Yes
throw a ; at the end of the token line, just to be sure idk
try regenerating the token again
Regenerated
and use the regenerated token
Replaced
node . would work right?
yes
Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event
if the main file is in package.json

im p sure node . uses the index file declared in package.json
it does
is there anywhere else where you use your token in your code or something?
which is why i said if the main file is in package.json
const Discord = require('discord.js');
const bot = new Discord.Client();
const TOKEN = 'my token'
bot.on('message', function(message){
console.log("Ready"); if(message.content === 'tb!help')
{
message.reply('Sorry! ThomasBot Content has not been fully completed!');
}
});
bot.on('ready',function(){
console.log("Ready");
})
bot.login(TOKEN);
All the current code
that code triggers me
good
not good
```js
const Discord = require('discord.js');
const bot = new Discord.Client();
const TOKEN = 'my token'
bot.on('message', (message) => {
console.log("Ready");
if (message.content === 'tb!help') {
message.reply('Sorry! ThomasBot Content has not been fully completed!');
}
});
bot.on('ready', () => {
console.log("Ready");
})
bot.login(TOKEN);
``` if you want syntax highlighting
Ok
@queen sentinel literally
Before the ' or after?
no difference
aw
semi-colons are optional in js
I do it cus it just looks nicer to me
its like doing ```js
hi();
// vs
hi()
no
i use import when using ts
this aint python
swear import isn't supported or something 
it isnt jonny, but there are transpilers that compiles es7 into es6
i rather require than import
i use import for react
I give up on my bot, lol
did you save the file 
Lol
never give up :3
or just take a break
i added a block on my random command and a big warning in help
I did
lmao
if it gets denied again i'm not sure what to do :\
lmao
i'll test it
Alright
O
so your token is not the problem
So is it online now?
idk check your server
lmao
but you have to run it yourself
once i close the program it will go offline again
ok thx B pumkin
@quartz kindle chrome dev console 
Should I host my bot with Glitch?
why wont this work
client.on("guildCreate", function(client, message, args) {
module.exports = async (client, guild) => {
const invite = await guild.channels.find(c => c.type !== "category" && c.position === 0).createInvite({
maxAge: 0
});
let guildCreateChannel = client.channels.get('505120663892394015');
guild.createChannel("globe-logs", "text");
let joinEmbed = new Discord.RichEmbed()
.setTitle("Bot joined server!")
.setThumbnail(guild.iconURL)
.addField(`Server Name:`, `${guild.name}`)
.addField(`Server ID:`, `${guild.id}`)
.addField(`Server Owner:`, `${guild.owner}`)
.addField(`Server Invite:`, `${invite.url}`)
.setColor("#4286f4")
.setFooter(`${client.config.botname}`)
.setTimestamp();
guildCreateChannel.send(joinEmbed);
}
});
can you say what doesnt work?
@lost scarab you have a bunch of weird stuff in that code
@knotty steeple the whole thing does nothing when the bot is added to a server
ok please

@lost scarab js message.channel.send({ embed: newembed .then(e => { e.react("1️⃣"); e.react("2️⃣"); e.react("3️⃣"); e.react("4️⃣"); e.react("5️⃣"); e.react("6️⃣"); e.react("7️⃣"); e.react("8️⃣"); e.react("9️⃣"); // 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ }) });
this for example, you're not closing the send() function, so you're basically doing embed: newembed.then(e=> ...)
oh i see
because i do @knotty steeple
I don't recommend creating an invite for each guild
you will run into issues where you don't have perms
the bot isnt huge, im having it there until it grows
to host my bot on glitch do I just put my code on the site
idk, google
making server invite without permission from end user is against tos
if you have some eula stating the bot does that maybe
im just going to lurk here until i can help
how about now ("i can't type ;( ")
know?
Oof don’t forget
("i can't type 😭 ")
😂
@earnest phoenix Please.
A guide made by the community of discord.js for its users.
You don't seem to understand how events work in Discord.js
I am too braindead on deciding what I should most my bot with
I don't want to use github
github cant host bots...
no for like using glitch
I don't know what service to use
for what
bot hosting
i thought you were using glitch?
glitch is pretty good
^
but only if you want small js discord bots
Glitch is shit
Their interface looks like something a preschooler drew in his spare time 
also that
the homepage?
the whole site
not the editor
the design of the site looks cartoonish
If you can afford a cheap Linux server, I highly recommend going with that
i use glitch for some projects, not just because its free
its easy to update and has collaboration
Don't use glitch for hosting unless you absolutely can't be asked to spend like $2 a month on a server that will let you have so much more control
Any reason this would fire multiple end events? (sorry for messy code, im kinda rushing)
function play(client, player, video, msg) {
console.log(client.queues);
if (!client.queues[msg.guild.id]) client.queues[msg.guild.id] = {queue: []};
console.log(client.queues);
client.queues[msg.guild.id].queue.push(video);
console.log(client.queues);
console.log('[ INFO ] Added song to queue');
player.once("end", data => {
console.log(data);
if (data.reason === "REPLACED") return;
msg.channel.send("Song has ended... Going to next song");
console.log(client.queues);
client.queues[msg.guild.id].queue.shift();
console.log(client.queues);
player.play(client.queues[msg.guild.id].queue[0].tracks[0].track)
});
if (player.playing) return;
player.play(video.tracks[0].track);
}```
no errors btw
lots of console logs
wew
i only execute the function once in the entire file

Check, real quick
make sure that you're not executing it twice
What’s happening
Well, that doesn't make much sense, then..
The end event should only fire one time when the stream ends
Oof rip bot
For some reason, embeds are only working if the bot has administrator permissions. Is it possible that they can say embeds if they aren't administrators? (discord.py)
what
i think you mean embed links
I'm not embedding links
what
embed links is what you need to generate embeds
to make an embed you need embed links 
Ok
discord edit pls
Oof
@earnest phoenix could it be because im running the command multiple times?
imma try something
What kind of things are 'popular' for Discord Bots that would be best stored in a SQL db. Trying to get the backbones setup before I start in on commands so I don't have to go back and make edits.
So far I'm storing:
https://i.imgur.com/PNIIlnJ.png
https://i.imgur.com/miuGrcF.png
hey guys
Uh
hey
oh is the image deleted?
There should be this image: https://i.imgur.com/jobG6Cu.png in there
It's not the footer
It's uploaded fine, but it just hasn't put the image in the embed
for comparison:
Same code, rebooted the bot, the image is being generated fine but Discord isn't doing it right
That's my thought too.
wow
did my bot get kicked again 0.o
no nvm
im confused because it just left vc
and i didnt remember applying autoleave to this guild
when you added the alexa meme into ur bot's music feature
Feels Good
@ me if you find anything out
okay so my navbar works fine when small but not open
and when big
but it mucks up when small and open
so how do i fix this 
@sick cloud you using a framework?
help
me
now
import youtube_dl
from discord.ext import commands
TOKEN ='token kid'
client = command.bot(command_prefix='B'
players = []
@client.event
async def on_ready():
print ('bot online')
@client.command(pass_context=True)
async def join(ctx):
channel = ctx.message.author.voice.voice_channel
await client.join_voice_channel(channel)
@client.command(pass_context=True)
async def leave(ctx):
server = ctx.message.server
voice_client = client.voice_in(server)
await voice_client.disconnect()
@client.command(pass_context=True)
async def play(ctx, url):
server = ctx.message.servere
voice_client = client.voice_client_in(server)
player = await voice_client.create_ytdl_player(url)
players[server.id] = player
player.start()
client.run(TOKEN)```
whats wrong with this
yeswhaterror
all
good now its working
i was missing a little space
lol
well
now
nvm
lol
Hello , someone can give me a function in discord.js , when i send a command '!clean' it will delete all messages of my bot pls
get the last 100 messages from the channel
filter the author id to your bots
and then delete
actually thinking they know how to do that 
guys
<@&265158261945270273>
i need to add my bot
its online
but its not responding
pls dont ping us all for a request one person could handle 😩
you add your bot on the website
if it's not responding that's a you problem not us?
@lilac spire there is nothing to do with the website registry
And, to be honest, you need to be more clear
How do I parse json?
@commands.command(name='ai', description='Talk to an AI!', brief='Talk to a robot.', aliases=['talk'])
async def ai(self, ctx, *, talk):
if ctx.author == self.bot.user:
return
if ctx.author.bot:
return
payload = {'input': str(talk)}
url = 'http://ask.pannous.com/api'
r = requests.get(url, data=payload)
data = r.json()
datap = data[0]
send = datap
ctx.send(send)```
wont work
{
"info": {
"apiVersion": "1.1.0",
"clientFeatures": [
"say",
"open-url",
"show-url",
"show-images",
"reminder"
],
"clientTime": "2018-10-26T12:14:49.536Z",
"detectedLanguage": "en",
"emotions": [],
"input": "tell me a joke",
"isNewUser": true,
"locale": "en",
"login": "test-user",
"responseTime": 288
},
"output": [{
"actions": {
"custom": {},
"say": {"text": "What do wizards stop for on the highway?"}
},
"entities": {
"dialoguesInfo": {
"dialog": "wizard",
"dialog_id": "1109",
"forced": false,
"initiative": false,
"match_id": "1166758",
"matchscore": "4.77",
"response_id": "1166765"
},
"input": "tell me a joke",
"locale": "en"
},
"handler": "Dialogues",
"responseTime": 158,
"results": {}
}]
}```
is json
how to make a client command that is a poll command and it reacts with thumps up and thumbs down
I recoded my bot so it was way more effecient but it still has these moments.. http://prntscr.com/laqg8n is there any method in discord.js to reduce memory and cpu usage??
how many servers is it in?
idk like 160 with over 1.5mil users
is it a music bot?
It has music and a neural network
then idk, those are probably the reasons
is it possible to like clear caches of discord.js emoji's or something
double/triple check for possible memory leaks, reuse variables as much as possible instead of creating new ones
Okay
you can clear user and message cache
Is that a option on creating the Client?
there is an option to auto sweep messages, but not users
I also guess I can disable events that aren't needed
okay thanks bro.. I'm getting a better host soon 🙏
neural net and music
yeah theres ur problem
lmao
I disabled a ton of events and stuff and its really working :DDDD
not all events safe to disable
wym
for example channel create/delete, ur bot wont know of new channels and wont work there
really?
yes
oh damn 
http://prntscr.com/laqt9m do you think its because when it starts up it puts the database into a variable for faster access?
Because the database is a good 50MB
Hey guys, does anyone know with discord.js how to get the last message sent by the bot?
(even if the bot restarts)
You'd have to store that externally
hey
Should I have a github acc if I use glitch
I say Yes
anyone knows how to make a battle between 2 people? 
Yggdrasil 😉
how does a library like d.js get the gateway ping?
am very confused
{
"prefix": "!",
"token": "Blured",
"devID": "276364682695278602",
"dbUrl": "mongodb://Mysterious:Password Blured@ip Blured:27017/Suggestions",
"embed": {
Does anyone have an example of making an economy bot with Node?
I'm currently using discord-eco but it sucks.
🤦
@tulip axle get the bot user and look for lastMessage iirc
<Client>.users.get(<Client>.user.id).lastMessage should work
@earnest phoenix get a database, design ur eco, implement it, profit
why people use pre built blows my mind
i swear to god people would use a node module that checks if a boolean is true or false
i should make that
yaes 
lol
l m a o
how to log messages that was deleted
but that it would log even who deleted the message
@earnest phoenix all economy systems requires sql
I know, I am just looking for a tutorial on it. The docs are a bit confusing.
only cert devs
And to this background?
cert only
xD
@bitter sundial when was the bot page css cert only?
css is not cert only
My bot must have over 1k servers to become certified?
@bitter sundial
certification is being reworked and is still closed
ok
how to log messages that was deleted
but that it would log even who deleted the message
message delete event
The deleted message should have a property for getting the author
then you would probs have to check the audit log
its still possible to make
how to log messages that was deleted
but that it would log even who deleted the message
only for those who knows the events
is there a way to clone a channel ?
@raven torrent what lib
@hardy sierra you have to check the audit log to see who deleted the message
hey need help
with message.mentions.channels.first().id;
is it correct or am i doing something wrong?
It's correct
But it returns undefined
As long as message is a proper message object
I do it like this
If it's undefined, you didn't mention a channel
oh... So how do i create a invite to message.channel; and get the code
var invite = message.channel.createInvite();
var code = await invite.code;
but doesnt work
with code = await invite.code?
Don't await the code 
await the createInvite
Ok, so, I'm really quite confused at this point, I've done so much googling I can't stand the logo anymore. I've been trying to change a variable in a json file, just defined at an object in the code. I've tried the .push(), and I've learned that you can't do that because push is for arrays, I get that now, but even when I tried to do the other things I saw like, JSON.parse(obj).push(), it still never seems to actually work.
(js) Im trying to make my bot run a Coin Flip command,
But when I run it, it wont execute.
the run function is outside the class
Can i get some help on mine?
@slim heart look up object methods for your language
I don't think I understand how
@drowsy yew wdym, u just select the async run, then click ctrl+x, then go to the class brackets, and hit ctrl+v
like change a specific part of the json without changing the others
u know what i mean
let object = JSON.parse(json);
object.memes = true;
json = JSON.stringify(object);
``` ?
So like say
{
"hello": 1,
"goodbye": 0
}```
and say I wanted to change hello, yeah i could rewrite the file, but i'd also like to say change "hello" from 0 to 1
yeah
@drowsy yew just a heads up you have MathF.random()
refer to what i posted above then
so you have mathf defined
you can't parse a non-json object
(the same error)
homo
I see
I feel stupid
oh my

ok well
How would I append to that?
same way you would change a value
append?

I think you mean to say something else
works too yes
the fundamental thing to know about JSON is that it's just an object in the end, once parsed you interact with it like an object 
if I have this api
how do I ask for the hex thing?
color.body.colors[0].hex
is not working
fs.writeFile(JSON.stringify(JSON.parse(fs.readFileSync('C:/Users/jpb/Desktop/bot/priv/server_data/' + message.guild.id + '.json')['censor'] = 1)))
Is there something wrong with this or am I just too meta and it won't do it?
wrongly placed parenthesis but it should work
though JSON files for database purposes is strongly not recommended
I'm actually transfering from db to this rn
Idk why I just find it easier and my machine runs fine honestly
you shouldn't
wait transferring from db to json
am I in hell?
No i am
I think I am
I'm the one whos doing it u sure?
it works fine at a very small scale, the difference in performance between an actual database and "this" is just ridiculously big
also databases usually offer more features than what limited objects can do
what db are you switching from
be careful how you handle json files
i just had the file
the slightest error will destroy the entire file
@heady zinc baguette db when
never
I have seperate files per server
wtf
If I did that I would have 2.5k files and I don't want that
If I did the same for users I would have 180k
you're using 2.5mb block size?
the file is 10kb, but its using 2.5mb disk space lmfao
Your a folder
its 32kb allocation size, makes sense
I'm about to live with Ubuntu server 
ok for some reason when i write a file it comes up with this <Buffer 7b 20 22 63 65 6e 73 6f 72 22 3a 20 30 20 7d>
as a return
and in the json its basically the same thing just in json format
that's normal
you need to set utf-8
else it uses buffer as default
("file","encoding",callback)
{ "censor": 0 } :)
Where do I go to get a webhook url?
I've tried the webhooks in channels but it doesnt work.
you have to set up the server that receives the webhook and the url is the url of the webserver
dbl webhooks dont work with discord
ohhh
my alternative for discord is my own bot.
did you send that image with that
Where would I go to setup a server to get the webhooks?
I know this isn't about bots, but I still need coding help.
https://cdn.discordapp.com/attachments/300407204987666432/505524858180993024/unknown.png
I need the yellow and red div at the top. Right now, I'm using Transform: translatey, but I really don't want to use the SIN of CSS.
idk whats your structure
but there are many things you can do
margins, vertical-align, position: absolute...
dont use transform unless you need to, its a waste of resources
I know that much.
My structure:
<div class="info">
<div class="mc healthbox">
<span id="mobname"></span><br>
<span id="mobhealth"></span>/<span id="mobttlhealth"></span> HP<br>
<span id="mobeffects"></span>
</div>
<div class="uc healthbox">
<span id="playername"><?php echo $username; ?></span><br>
<span id="playerhealth">15</span>/<span id="playerttlhealth">15</span> HP<br>
<span id="playereffects"><b><u>No Effects</u></b></span>
</div>
</div>
<div class="brdr">
</div>
<div class="story">
451 Character MAX
</div>
</div>```
It's not a margin issue.
Vertical align works- Thanks, @quartz kindle!
vertical-align is good when you're using inline-blocks
so, I have a bot that should play short audio clips, he does, but with small lags (like playing faster, making very short breaks)
my vps usage is really not high, (cpu under 10% and ram okay too)
tested download/upload speed:
(d.js)
either:
- blocking event loop
- oversold vps
are you reading files with a sync function?
doubt man
I runned a forge server with 20 mods and nothing lagged
do you have a lot of short audio clips? if its not a lot, you could cache them in memory
but idk what you're using for processing audio
voiceChannel.join().then(connection => {
const dispatcher = connection.playFile('./music/airhorn.mp3');
dispatcher.setVolume(volume);
dispatcher.on('end', () => {
voiceChannel.leave();
});
});
dude, how would you explain a mc server with 20 mods & no lag
because music is more noticable to minor lag
or just use lavalink
@earnest phoenix just want to notice I was talking about very small lags, for example having the music playing faster for a short time, or having a really short delay. things like that. I now hosted it on my pc and got the same result
you coult try playStream instead of playFile
you have to create a readable stream first
xd
hey, guys does changing username from discord dev panel change the name of the bot?
or i need to make a command to do it
cause i changed the name and only the roles name got changed not the bot it self.
whats your css like?
then do float:right
@gusty rune you have to change it on the bot page
oh ok
which part? @quartz kindle
i already use mr-auto to push it to the right but it doesnt go all the way
idk if bootstrap has its own css, but mr-auto is the only difference between the left menus and the right ones, so try float:right on .mr-auto
you can right click it and inspect element to see whats the css structure
and experiment on it live
@sick cloud i have
thats why i asked cause the name it self didnt change yet
but the role that the bot has is changed
here?
yes
not that long
we dont need another one
i fixed it, thanks though
damn, this setTimeout timeout parameter, why it uses milliseconds btw? any one know other remedies for this. I'm not too export with javascript
yeah I know man.
my timeout is 3 months
and its overlapped to the maximum value.
bang!
I don't know if javascript supports long values
oh I know now. I will just set the timeout to 2147483647 when it is larger than that.
damn.
so has anyone ever used express and knows how to do a "user online" session type thing?
you can use websocket to show like "x people online" or smth
I am trying to make a command called 8ball, Can anyone help?
make an array of response, use Math.Random to pick a random number from that array
How to make a play command work, Current coding,
if (!args[0]) {
message.reply("Please provide a link or title.");
return;
}
//if(args[0].indexOf("youtube.com") === -1){
// message.reply("only YouTube links are supported at the moment");
// return;
//}
if (!message.member.voiceChannel) {
message.reply("You must be in a voice channel!");
return;
}
let player = Players.get(message.guild, true);
Entry.fromMessage(Client, args.join(" "), message)
.then(data => {
let { entry, msg } = data;
player.addToQueue(entry);
if (msg !== null)
msg.edit(`Added ${entry.getInfo().getTitle()} to the queue`);
else message.reply(`Added ${entry.getInfo().getTitle()} to the queue`);
if (!message.guild.voiceConnection) {
message.member.voiceChannel
.join()
.then(conn => {
player.setConnection(conn);
})
.catch(e => {
player.destroy();
Players.remove(message.guild);
message.reply(`Error joining voice channel: ${e}`);
});
}
})
.catch(console.error);
});
is this eris
discord.js package on glitch
oh
it looks like eris from the command registering (sort of)
I could probably get eris on glitch
yea
ive done it
are you getting an error with that setup?
I don't get errors with the code setup, The command won't work atall.
lol i dont get errors
use something like sentry/raven
so you can get errors
On glitch?
no ill dm you the link
KK
that wasn't even proper js
Can someone make a example on how to make a NSFW command in discord.py (not rewrite)
you can't
im literally just starting out in this
and i tried running it
but after the first line of debug it gave me this error
smells daneeko You smell like my brother
Looks like you're using discord.net; I doubt much people here know it so it would probably be a better idea to ask in the discord.net server
Damn that response sounded clippy like @bright spear
xd
An unofficial .Net wrapper for the Discord API (http://discordapp.com) - RogueException/Discord.Net

whats that
what do you mena
mean
i just need that if my bot throws an error
that it wouldnt go offline
well if you get a connection error with discord thats impossible
just have a process manager restart it on crash
if i write: ~profile @mentionsomeone
then its good
but if i write ~profile name
it throws an error
ok then fix ur code
how
you need to write an exception with if then
if (!message.content === @)
message.send("mention someone please")
else (the whole code)
what lib?
discord.js
you need to check if mention exists
how
yeah but how
i always read docs
how to make that it would check if the message contains mention
it doesnt even say what can i use after .mentions
then you need to test it out ¯_(ツ)_/¯
users is a collection of mentioned users
just get the first one
if (message.mentions.users.first()) {
test it out
that worked
im just a bit dumb
i had the message.mentions.users.first()
in my code
like message.mentions.users.first().tag
and stuff
and i didnt even realise

Why is my nick Hoister no hoisting?
- not a development 1uestion
2.because you had a dumb username starting with ! that puts you at the top of the list
"1uestion" yes i love it
I kinda need help... Basically I have an event firing as many times the command is ran (say I ran the command 5 times, the event; fires 5 times) Play function code: js function play(client, player, msg, song) { if (!client.queues[msg.guild.id]) { client.queues[msg.guild.id] = {queue: []} } const queue = client.queues[msg.guild.id].queue if (player.playing) { queue.push(song); console.log('Added song to queue') } else { queue.push(song); console.log('Added song to queue'); player.play(queue[0].tracks[0].track); } player.once('end', data => { if (data.reason === 'REPLACED') return; console.log('Debug') }); } play command code: js if (!msg.member || !msg.member.voiceChannel) return msg.reply("Must be in a voice channel"); const player = await client.player.join({ guild: msg.guild.id, channel: msg.member.voiceChannel.id, host: util.getIdealHost(client, msg.guild.region) }, { selfdeaf: true }); if (!player) throw "No player found..."; const song = await util.getSong(args.join(' ')) util.play(client, player, msg, song)
does anyone know how remove sqlite points?






didnt read the error at all 

