#development
1 messages · Page 1002 of 1
do you know what an id is?
that would be the id of the channel where the message came from
hmmmmmmmmmmm
message.channel.send at that point
yeah
so do i change spawn channel = message.channel.id
depends what you want to do
No problem, I have no interest if the number of servers appears or not @quartz kindle 👆
then yes?
@final gate ok
how do i disable the ability to ping @everyoneand @here with my bot for say cmd
discord.js v12
you need to explain what you want to accomplish
idk how to do it in a json file
speak with respect @quartz kindle
what should spawn channel be? which channel?
the channel the person writes .spawn in
@final gate no, you speak with respect. if you want help, i will help, but i will not do it for you
you dont need a json file to send a message to message.channel
oh lol
you need a database
oh nvm
you dont want a spawn room
you want .spawn
message.channel.send("the content you want to send")
so you want to type .spawn and then save this channel's id so it starts spawning in that channel?
i hate bots that say "a mystery character has spawned"
and you want it to be limited to one channel per guild?
or multiple channels per guild?
or no limit at all?
when they write .spawn a pokemon spawns
you want .spawn to be toggle on / toggle off command?
you want pokemons to spawn randomly accross all servers? or randomly inside each server?
idk how to do that, i am not that good at coding
there are many decisions you need to make before coding
If you have it, I don't want it from you talking about respect and nothing that it knows @quartz kindle 👆
i have what you are trying to do on my bot but i dont think it would show you much if I just gave you it reallyyy
@final gate code is not something you copy and paste. i showed you the link that explains how to do it. even if i send you my code, it will not work for you, because i coded it specifically for my scenario
now one owes you anything here anyway
@long yew is your json file configured to have guild by guild configs?
i think he just wants it to spawn wherever they did the command
so the json has zero point here
Shut up @solemn latch 🖕
i think he wants it so when you do .spawn it saves the channels ID and then randomly spawns it
like pokemon bot
@ember atlas can you tell this guy to not be a meanie 😦
alright this shit stops here
Can we not have stupid arguments in this channel, thank you
ok i'm back
wb
bruh
i dont think you need the json at all sam
Thanks, why didn't you say it that way? @quartz kindle
since your just responding to the message
@quartz kindle i wanted it so when someone writes .spawn, 1 pokemon spawns
@slender thistle Don't see a chat
what chat
@final gate because when i showed you the link, you only said "i dont want explanation, i want code", and that was very rude
if you want it to just spawn one when you type a command isnt that like defeating the purpose of them appearing
I apologize for you hahaha@quartz kindle 
client.channels.cache.get(message.channel.id).send({ embed });``` so i will try this
thank you
@long yew but if you wanted them to randomly appear you'd need a guild by guild config file a bit like this https://cdn.vurighosting.com/u/DaT9ly.png
@long yew theres no reason to do that, your getting a channel you already have
@long yew so you want .spawn to be like a normal command, not a command that saves an option somewhere? then just use message.channel.send()
your using message.channel, to get the message channel again
what you are doing it super over complicating it
interesting guild name https://cdn.vurighosting.com/u/KNxS0w.png
its like you have some icecream, but your trading the icecream you have, to get the exact same tub of icecream
@long yew so you want .spawn to be like a normal command, not a command that saves an option somewhere? then just use message.channel.send()
@quartz kindle ok
What’s the best way to make an item system that’s tracked by numerical IDs
javascript?
Ya
this includes everything about a currency system
yes
your getting a channel
you dont need to do that
message.channel.send
client.channels.cache.get. is unnecessary
you dont need to get what you already have
no
message.channel.send
you already have message
and message already has channel
please learn javascript and read docs
message.channel.send(embed)
to be continued...
probably
No exactly that
Im assuming you mean something like client.on('message', async message => {
cuz that is what defines message
I do not think so, from what I can tell, he created a separate function for spawns, and forgot to define message in the function
ah well idk
im just assuming he is doing something along the lines of```
bot.on('message', async message => {
if (message.content === 'damnit') {
message.channel.send('not again');
}
});
where it says "not again" being the embed
@solemn latch not currency, I’m making a game and there’s different items each with different specs
I want like a simple system to manage it
It covers items
Any idea for make discord music dispatcher clear and quiet?
I mean like without mysql using a json or SQLite
I mean you can set each item to have a value in a parameters file
sqlite and mysql are 99% the same, the difference is that mysql is a program in itself and runs as a server to which your bot connects to, where sqlite is embedded and runs inside your bot
yeah like if you want to have people trading you're gonna have to have some sort of database
is there a good method to use regex to get a good filter out of it? for example to block nsfw material? I tried to work it out, but it didnt work so well.
It's very complicated to make a good filter
const mongoose = require('mongoose')
let Schema = new mongoose.Schema({
Warns: Array,
User: String,
Guild: String
})
module.exports=mongoose.model("warns", Schema)```
(node:1336) UnhandledPromiseRejectionWarning: OverwriteModelError: Cannot overwrite warns model once compiled.
at Mongoose.model (C:\Users\kenra\Desktop\Frosty Rewrite\node_modules\mongoose\lib\index.js:524:13)
at Object.<anonymous> (C:\Users\kenra\Desktop\Frosty Rewrite\src\models\warns.js:7:25)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
i never defined the schema anywhere else tho
so
idk why
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)')]
@hardy vector check if the model exists
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
});
client.login('your-token-goes-here');```
This wont work for some reason
ill screenshot
if anyone can help
@hardy vector check if the model exists
@finite bough how
a..
@earnest phoenix you spelt "on" wrong
see if there is an error by adding a catch
save your index file
once works, it just runs one time
i feel so stupid lmao
does anyone know how to collect a guild name?
name is undefined, or getting name from undefined?
guildMemberAdd
Welp
member goes to user
its in my events folder
np
I know this is gonna be a noob question but what is a guild
It's a server (like Discord Bot List)
servers
?
In the docs: https://discord.com/developers/docs/resources/guild
ah ok
discord decided for developers, servers are called guilds
makes sense cuz I expect the devs say server meaning the discord mainframe
yeah
also because discord was made for the gaming community
and guilds are a common gamer term
nearly all mmorpg's have a guilds system for example
some are even in the game's name, such as guild wars
fair enough
are people here interested in contributing to bot projects or is it just people who have bots and are already volunteering labor to maintain them
this is, if you are stuck on something, and have properly tried to look for an answer, ask for help to get that answer.
however, 99% of the time its just people too lazy to look at docs asking for you to look at the docs for them
ouch
https://stackoverflow.com/questions/19051041/cannot-overwrite-model-once-compiled-mongoose this thing lied to me
it told me instantiate the schema once, and then have a global object call it when it needs it.
const mongoose = require('mongoose')
var Schema = mongoose.Schema;
let warnsSchema = new Schema({
Warns: Array,
User: String,
Guild: String
})
module.exports=mongoose.model("warns", warnsSchema)```
which is what i did
but that still gives me the error its supposed to fix
How do i got id from username?
discord.js
I want like this but its commando
Maybe this?
client.users.cache.get("name", "USERNAMEHERE").id;
@wild mist find(x => x.username === "")
Ill try it
.then(x => x.) maybe?
ok
ty
@coral trellis var response = await fetch(http://api.giphy.com/v1/gifs/search?api_key=[my key here]&limit=1&q=anime_cry)
.then(res => res.json())
.then(res => console.log(res))
.then(data => console.log(data[0].title))
that's what i am doing rn but it's giving me Cannot read property '0' of undefined
perhaps fetching is quite different then what i have in mind
var response = await fetch(http://api.giphy.com/v1/gifs/search?api_key=[my key here]&limit=1&q=anime_cry)
.then(res => res.json())
.then(res => console.log(res[0].title)) ```
If you copy-pasted that just add " around the url
yes ofc
Cannot read property 'title' of undefined it says
i tried everything
there are things i don't know about fetch maybe that's my issue
Is it the same as in xig's example?
yes
If you do console.log(res) what do you get?
Ah, that's because it ain't res[0].title but res.data[0].title
Data is a property of res
i have a feeling i tried that aswell but let me try it again
hey a giveaway bot what tag would it be?
giveaways
A good way of figuring out how to worj with jsons in imagining a folder system
i see
Oi
I'm trying to make my reload command administrative only, meaning select few can use the command, if someone who isn't administrative it errors out and sends an embed, yet I am having difficulties with this, can someone help?
Put allowed ids in an array
Then check if the author's id is in the array
If not = return
Why didn't I think of that. How would I start it?
const allowedids = [
"id1",
"id2",
"id3"
]```
Like this?
Yep
Ayyy!
That or using a db
I don't wanna have to use my database yet, so I'll do this first and see what I can do. Can I put it in a json format any?
Yeah thats true, I'd need help setting that up because I use MySQL for my database.
It'd be better to use a json array tho
J df jfjd
Instead of a normal json
No spam plz
Okie
Plz
My hosting provider gives me MySQL, I understand its interface so I can use it.
He said he doesn't want to use a db
I will if I have to if it makes my life easier.
4MB
For a simple ID list it'd be fine
true ig
I'm only using 3 user ID's
Thats like what, .25 kb?
I know.
Eventually I will but for now I am happy with what I have.
client = commands.Bot(command_prefix = 'b' or 'B')
``` is there a way i can do something similar to this?
My bot already used 10KB of JSON at 25 guilds

Its a reload command is just bot admins typically tho
100+ here.
That's very little actually
I'm at 160 almost.
The real issue about json is the fragility of data and IO speed
Yeah,
For me it was time
How would I array this in json?
okay
And lot of mouth advertising
oof
Mine is because I made something useful.
How would I array this in json?
@stable nimbus just like a common array
[id1, id2, id3]
client = commands.Bot(command_prefix = 'b' or 'B')
is there a way i can do something similar to this?
Oh.
const pat = new Discord.MessageEmbed()
.setColor("#7289DA")
.setAuthor(bot.user.tag, bot.user.displayAvatarURL())
.setDescription("Become a Patreon To Unlock Exclusie perks")
.addFied("Before Becoming Patreon Join Here" , "Link")
.addField("Become A Patreon" , "Link")
.setFooter("Pls Support lol")
msg.channel.send(pat);
};```
client = commands.Bot(command_prefix = 'b' or 'B')
is there a way i can do something similar to this?
@earnest phoenix prefix.toLowerCase()
It says nothing when someone does s!patreon
If you want to make the prefix case-insensitive then all you need to do is make it lowercase or uppercase
:(
Are you using v11 or v12?
V12
RichEmbed i mean.
I read something wrong I be BLIIIIND
just use an object smh
He be reach tho
{embed:{...}}
Rich
So will it be
if(command === "patreon"){
const pat = new Discord.MessageEmbed()
.setColor("#7289DA")
.setAuthor(bot.user.tag, bot.user.displayAvatarURL())
.setDescription("Become a Patreon To Unlock Exclusie perks")
.addFied("Before Becoming Patreon Join Here" , "Link")
.addField("Become A Patreon" , "Link")
.setFooter("Pls Support lol")
msg.channel.send(pat);
};
try it and see
read the error
execute(message, args) {
if(message.author.id = ownerid){
if (!args.length) return message.channel.send(`You didn't pass any command to reload, ${message.author}!`);
const commandName = args[0].toLowerCase();
const command = message.client.commands.get(commandName)
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));```
When seeing if the user ID is useable, is this the correct way to do it or do I need to do something else?
man this is like "spot the difference" but the "difference" is the mistake

anyway, its always cool to double check your code and what you've actually written
= is for assigning, == and === is for checking
Thanks.
Finally it works, thank you @grizzled raven, I don't know why on earth I forgot how many = it was for assigning and checking.
So, we are facing some problems in Shard 1, commands are not working, how to fix that, lib: discord.py
How to make the bot online in 24/7
@dusk sphinx if you hosting in glitch use google script
If i want to add more command what symbol do i have to use
what
uhh is this a bug or is it cursed because im running the bot on this pc?
no, your ping command is not written correctly
is has to be
what do you mean?
yesterday it worked perfect
.setColor('#d29e04')
.setTitle('Ping :banana:')
.setAuthor('Banana')
.setDescription(':ping_pong: Pong!')
.addField("Your ping is `" + `${Date.now() - message.createdTimestamp}` + " ms`", 'bananas')
.addField('ur dinner today', 'bananas', true)
.setTimestamp()
.setFooter('Justii :3')```
im not sure
I send a message then edit it and time how long it takes
no @delicate shore
the negative ping is a bug. Happens usually if you have the Discord Client and the Bot on the same machine
ill try my chromebook
oh, I did not know that
D.js
compared to?
py
Python
more or less equal
ill try my chromebook
still negative
Ok
I do not know python and have not tried it
i started some python bcs i want to get into ML with it
ML?
@spare mirage i never tested it but could also be possible that it affects the same network. did you got a Friend on the discord to run the command?
Machine learning
Ok
can u test?
sure
dms
quick question is using nodemon a good idea?
try pm2
Ill pass.
restarting the bot manually isnt a big deal if u just use it on 1 server
i'd use pm2
nvm found a SO question for it
Hey! How do I make the link not show for my b!image command??
this is a better image ^
Put the image in an embed
s
Python or js
@delicate shore I use python cuz It's easier 🙂
using invite tracker but showing missiong permission error ?
i give all permissions
did the role the bot has got the permission manage Guild?
bot is in 32 guilds
its possible that the bot doesnt got the Permission in certain guilds
make a check that skip those guilds
how do u can help me pls
you know what permission you need for this?
nop
would guess manage guild
for skip guild no
then just check if your bot has the permission in the guild. if no return
oh okay
since you run a Loop it will skip the guilds that dont give the permissions
i understand my english is bad sorry ❤️
if(command === "purge") {
const deleteCount = parseInt(args[0], 10);
if(!deleteCount || deleteCount < 2 || deleteCount > 100)
return msg.reply("Please provide a number between 2 and 100 for the number of messages to delete");
const fetched = await msg.channel.fetchMessages({limit: deleteCount});
msg.channel.bulkDelete(fetched)
.catch(error => msg.reply(`Couldn't delete messages because of: ${error}`));
};```
See code is correct but this happens
im not sure if you need to convert it to a Number.
Wot?
im not sure if you need to convert it to a number
so i dont want fetched?
if u want i can give u mine
?
im using with args xd
if (!args[1])
return msg.channel.send(
"❌"
);
msg.channel.bulkDelete(args[1]).then(() => {
msg.channel.send(`**__Cleared ${args[1]} messages.__**`);
});```
if(command === "purge") {
const deleteCount = parseInt(args[0], 10);
if(!deleteCount || deleteCount < 2 || deleteCount > 100)
return msg.reply("Please provide a number between 2 and 100 for the number of messages to delete");
msg.channel.bulkDelete(deletecount)
.catch(error => msg.reply(`Couldn't delete messages because of: ${error}`));
};```
@regal raven Python is not "easier" its what u started with
Is this correct
is that a purge command?
yes
@lusty quest
@spare mirage I started with javascript 😐
:/
?
how i give perms in bot.on ready
if(command === "purge") {
const deleteCount = parseInt(args[0], 10);
if(!deleteCount || deleteCount < 2 || deleteCount > 100)
return msg.reply("Please provide a number between 2 and 100 for the number of messages to delete");
msg.channel.bulkDelete(deletecount)
.catch(error => msg.reply(`Couldn't delete messages because of: ${error}`));
};```
it this correct
test it
you need to check the guild member not client member
guild.me should return the member object of the bot
if (!guild.me.hasPermission(['MANAGE_CHANNELS'])) return
as example
how does an command holder work?
Greetings Coders.
On the edit page in your bot's page.
I decided to add a picture.. so question! Should I add the picture from my computer or from online?
for example..
?
<img src="thepicture.com" alt="Picture of bot">
it doesnt show a picture, it shows the alt only.
how can I fix this problem?
so?
@feral aspen u can just let the bot send the image link
No.. I dont want to add the picture in the bot.. I want to add it on my bot's top.gg webpage.
Sry cant help you rn that much my internet died
image(message);
.setColor('#0099ff')
.setTitle('Image')
.setDescription('Some description here')
.addField(image(message))', 'Banana', true)```
will the .addField(image(message) work?
my command is image(message)
lol lets just try it
this is spamming images :/
which code
yup
but if in one guild
bot dotn have permission
givign error
my bot is in 32 guild
i need skip the guild wh odont have permission
but idk how to make it in client.on("ready")
its is easy thou
can u help me pls im tryign 2,3 hours and xd didnt make
if client dont have perms manage server then return
else
fetch invites
simmple
const embedimage = new Discord.MessageEmbed()
.setColor('#0099ff')
.setThumbnail(image(message))
.setTimestamp()
if (message.content.startsWith("@silk moat")) message.channel.send(`Hi! My prefix here is **${PREFIX}**`);
else if (message.content.startsWith(PREFIX + "image")) channel.send(embedimage)
}); // commands```
why does this just send the image link?
for make if msg.member.haspermission
the bot doesnt have the permission
thank u very much
?
@spare mirage show me where u defied image
// A pretty useful method to create a delay without blocking the whole script.
const wait = require('util').promisify(setTimeout);
bot.on("ready", async () => {
wait(1000);
// Load all invites for all guilds and save them to the cache.
bot.guilds.cache.forEach(g => {
g.fetchInvites().then(guildInvites => {
invites[g.id] = guildInvites;
});
});``` @earnest phoenix if u want the code
yes now check if the bot had permission to do so
var options = {
url: "http://results.dogpile.com/serp?qc=images&q=" + "bananas",
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};
request(options, function(error, response, responseBody) {
if (error) {
return;
}
$ = cheerio.load(responseBody);
var links = $(".image a.link");
var urls = new Array(links.length).fill(0).map((v, i) => links.eq(i).attr("href"));
console.log(urls);
if (!urls.length) {
return;
}
// Send result
message.channel.send( urls[Math.floor(Math.random() * urls.length)]);
});
``` its an api sooo
ill use hastebin next time lmao
@blazing ravine
do
if (!client.guild.me.hasPermission("MANAGE_SERVER"))
{
console.log(`dont have perms`);
return
}
else {
// Load all invites for all guilds and save them to the cache.
bot.guilds.cache.forEach(g => {
g.fetchInvites().then(guildInvites => {
invites[g.id] = guildInvites;
});
I have never seen a beginner use an api ngl
@earnest phoenix use bot or client
:P
your wish
ok let me try
@earnest phoenix spoon feeding is not allowed :/
u are not helping
^
next time i give hint ok?
any error?
not work xd
if I make the embed use
.setField it will spam
not starting bot.js
@blazing ravine any error?
nop
not givign error
@blazing ravine give ss for terminal
@earnest phoenix lets make like this get the guild in from wchan data base and foreach get invites idk u understand
no*
take the code
@spare mirage when it spams does it have the image?
a
just the link
@earnest phoenix lets make to fetch the invites from database wchan guild id
its possible ?
you cant use database on heroku
well the only reason i can think of is the image is bigger than an embed's parameters
wait
@spare mirage ur 1st code only sends the link
coz it has no embed
yes it does
it has message.channel.send(url...)
uhh
var urls = new Array(links.length).fill(0).map((v, i) => links.eq(i).attr("href"));
console.log(urls);
if (!urls.length) {
return;
}
// Send result
message.channel.send( urls[Math.floor(Math.random() * urls.length)]);```
but you can do the image(message)
in an setThumbnail() right?
do bots have slowmode bypass by default or do they need perms?
@spare mirage do you want to set banana img in embed
scam lol
? wdym legend
@lost herald maybe depend on perms
@lost herald perms
ok
@spare mirage what you want to do with banana img
just give them a role that bypasses that
the thumbnail has to be a url
yes
hmm
Non-verified bots cannot use Js
but can we use an Iframe
to display the java script in the website
So... .setimage(image(message)) will work?
@left delta is there a problem with it?
json format get pull ig

@earnest phoenix its a fuction
Ok
this is code for cheerio api if u want to search images on google
var options = {
url: "http://results.dogpile.com/serp?qc=images&q=" + "bananas",
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};
request(options, function(error, response, responseBody) {
if (error) {
return;
}
$ = cheerio.load(responseBody);
var links = $(".image a.link");
var urls = new Array(links.length).fill(0).map((v, i) => links.eq(i).attr("href"));
console.log(urls);
if (!urls.length) {
return;
}
// Send result
message.channel.send( urls[Math.floor(Math.random() * urls.length)]);
});```
Not my problem when you get IP banned from Google when they detect suspicious activity from your computer
I'lll use bing lmao
the new microsoft edge is kinda good
@finite bough how do I fix this
the code is sending a random url each time
when u are setting the image using a function
it runs the function
so
instead of getting an url
u are getting messages
I understand
so remove message channel send bla bla and return only the link in the function
uhhh
do I delete this // Send result message.channel.send( urls[Math.floor(Math.random() * urls.length)]);
is it a good idea to send a message on server join with some commands? if so how would i know which channel to send it in (python)
Eval cmd @_@
Eval cmd @_@
me?
Yup
@spare mirage if u delete it, it will not do anything
so like eval(guild) lmao
Umm no
Client.channels.chache.get(channelid).send(msg)
what my brain is dying
but like what code do i use to get the best channel id or object
i go through from top to bottom til i find one that works?
Why you want to do this?
Yup
a lot of people kick the bot within minutes cuz no idea how it works
Even if it is hidden from normal users
my bot is only meant to have send messages perm
i guess
hello there my prefix is %
@lost herald what your bot do
BRAH
Rip
so i only ask for send message and embed link perms
so it tends to not work on new servers cuz people have no idea how to use it
@finite bough do I make the embed there? blablbabla.send EMBEDSTUFF
I have made ping help like
If(msg.content === "<@!botid>")
Msg.channelsend(help)
u can do
but will it work
@finite bough how you made ping help
u dont have to make it a separate function and put it inside the message event
@spare mirage
@finite bough like?
or another stupid way is
🤔
getting mentions
Lol
in a message
const embedimage = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle("Look at that banana boi")
.setimage((urls[Math.floor(Math.random() * urls.length)]);)
// Send result
message.channel.send(embedimage);
});
Rip
how bout this?
@spare mirage try
?

did u save?
Why this not sending emebed
send code
I know why its wronng
.setimage((urls[Math.floor(Math.random() * urls.length)]))
i
image
:/
Is you getting problem that it is not sending embed
yes
console.log(urls);
if (!urls.length) {
return;
}
const embedimage = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle("Look at that banana boi")
.setImage((urls[Math.floor(Math.random() * urls.length)]))
// Send results
message.channel.send(embedimage);
});
@finite bough heres the code
u have a code where its sending the link somewhere
??
where is it sending that
I dont recommend it but ok looks good
xd
function image(message){
var options = {
url: "http://results.dogpile.com/serp?qc=images&q=" + "bananas",
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};```
@finite bough do u have an idea on how I can make a command: !image [WHAT IMAGE U WANT TO SEARCH]
that will be more usefull lmao
U have to change "bananas"
what if I want to be able to search everything
like !image cookies
!image patatoes
use some kind of api ig
etc
should be easier that way
who can help me please
ok ill try for another api
@earnest phoenix with?
i will when i say " @knotty oracle " he send to me help message
de-profile
Hey guys.
I have a question. I am currently working on an oauth2 for the webinterface (https://pwi.progen-bot.de) my bot Progen written in JDA. Which I don't quite understand. What exactly is the "code" that needs to be authorised? Can anyone help me?
yes i habe read the docs xD no idea it I have overlooked anything
@finite bough will something like this work?
function image(message, parts) {
var search = parts.slice(1).join(" ");
var options = {
url: "http://results.dogpile.com/serp?qc=images&q=" + search,
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};
request(options, function(error, response, responseBody) {
if (error) {
// handle error
return;
}
lemmy just try
lmao
makes me very happy
xD
its not random though
random was this right?
// Send result
message.channel.send( urls[Math.random(Math.floor() * urls.length)]);
depends
oof
fs.readfile - how to make it read the last 10 characters of a file?
I only want the last 10
uhh then idk
so when i do this.client.channels.cache.get('xxx').send(readfile); it only sends the last 10 characters of the fs.readfile
Do strings support indexing
nah its txt
string.slice(-10)
What does txt have to do with what is returned
"shivaco x epic 12345".slice(-10); // epic 12345```
can someone explain why the bot i am running on my pc is 400ping?
or do I connect to discord and back to my pc?
TypeError: queueContruct.songs.push(...) is not a function:(
what do
yah?
ye
oh
and in the queue construct
contruct
songs: []
oh ok
any ideas or am i ffucked
wait
oki
@SirPandaTV, An error occurred while running the command: TypeError: fields.flat is not a function
You shouldn't ever receive an error like this.
Please contact SirPandaTV#3873.```
I get this error
uh
When running my play command.
uptade ur nodejs version
What / How do I do that?
can i take a look at ur code
@restive pebble play, stop and skip?
under the dependencies object
"node":"12.x"
}```
fo it
do
and it will reinstall all modules
and work
@restive pebble play, stop and skip?
@pure lion only play ol
ok
In package.json?
hyes
ok ill send the function
function play(guild, song) {
const serverQueue = queue.get(guild.id)
if (!song) {
serverQueue.voiceChannel.leave()
queue.delete(guild.id)
return
}
const dispatcher = serverQueue.connection.play(ytdl(song.url))
.on('finish', () => {
serverQueue.songs.shift()
play(guild, serverQueue.songs[0])
})
.on('error', () => {
console.log(error)
})
dispatcher.setVolumeLogarithmic(serverQueue.volume / 5)
}
{
"name": "Beat-Box",
"version": "1.0.0",
"description": "a discord music bot with guild , gifs and misc commands",
"main": "index.js",
"scripts": {
"start": "node .",
"pretest": "eslint --ignore-path .gitignore .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "SirPandaTV",
"license": "ISC",
"dependencies": {
"@discordjs/opus": "^0.3.2",
"cheerio": "^1.0.0-rc.3",
"discord.js": "github:discordjs/discord.js",
"discord.js-commando": "github:discordjs/Commando",
"ffmpeg-static": "^2.7.0",
"iso-639-1": "^2.1.3",
"simple-youtube-api": "^5.2.1",
"ytdl-core": "^2.1.5"
},
"devDependencies": {
"@getify/eslint-plugin-proper-arrows": "^8.0.1",
"@getify/eslint-plugin-proper-ternary": "^3.0.1",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0",
"nodemon": "^1.19.4",
"prettier": "^1.19.1"
}
}
oh ok
@restive pebble
i got it
ooo?
That is my package.json^
ur queuecontruct is empty
As in what?
"name": "Beat-Box",
"version": "1.0.0",
"description": "a discord music bot with guild , gifs and misc commands",
"main": "index.js",
"scripts": {
"start": "node .",
"pretest": "eslint --ignore-path .gitignore .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "SirPandaTV",
"license": "ISC",
"dependencies": {
"@discordjs/opus": "^0.3.2",
"cheerio": "^1.0.0-rc.3",
"discord.js": "github:discordjs/discord.js",
"discord.js-commando": "github:discordjs/Commando",
"ffmpeg-static": "^2.7.0",
"iso-639-1": "^2.1.3",
"simple-youtube-api": "^5.2.1",
"ytdl-core": "^2.1.5"
},
"devDependencies": {
"@getify/eslint-plugin-proper-arrows": "^8.0.1",
"@getify/eslint-plugin-proper-ternary": "^3.0.1",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0",
"nodemon": "^1.19.4",
"prettier": "^1.19.1"
}
},
"engines":{
"node":"12.x"
}```
paste it
Done.
Now what?
"test": "echo "Error: no test specified" && exit 1"
Error right there^
"engines":{
error
Wot?
Confusion...
"name": "Beat-Box",
"version": "1.0.0",
"description": "a discord music bot with guild , gifs and misc commands",
"main": "index.js",
"scripts": {
"start": "node .",
"pretest": "eslint --ignore-path .gitignore .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "SirPandaTV",
"license": "ISC",
"dependencies": {
"@discordjs/opus": "^0.3.2",
"cheerio": "^1.0.0-rc.3",
"discord.js": "github:discordjs/discord.js",
"discord.js-commando": "github:discordjs/Commando",
"ffmpeg-static": "^2.7.0",
"iso-639-1": "^2.1.3",
"simple-youtube-api": "^5.2.1",
"ytdl-core": "^2.1.5"
},
"devDependencies": {
"@getify/eslint-plugin-proper-arrows": "^8.0.1",
"@getify/eslint-plugin-proper-ternary": "^3.0.1",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0",
"nodemon": "^1.19.4",
"prettier": "^1.19.1"
}
},
"engines":{
"node":"12.x"
}}```
do this
:h:
yes
Still an error
what
omg
Pase error
how do I make a custom status like
"currently serving in x servers for x people"
Nvm
string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string string
ted talk^
@restive pebble
parse error: Expected value before ',' at line 31, column 2
how do i put a song into the serverqueue
@pure lion dms
{
"name": "Beat-Box",
"version": "1.0.0",
"description": "a discord music bot with guild , gifs and misc commands",
"main": "index.js",
"scripts": {
"start": "node .",
"pretest": "eslint --ignore-path .gitignore .",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "SirPandaTV",
"license": "ISC",
"dependencies": {
"@discordjs/opus": "^0.3.2",
"cheerio": "^1.0.0-rc.3",
"discord.js": "github:discordjs/discord.js",
"discord.js-commando": "github:discordjs/Commando",
"ffmpeg-static": "^2.7.0",
"iso-639-1": "^2.1.3",
"simple-youtube-api": "^5.2.1",
"ytdl-core": "^2.1.5"
},
"devDependencies": {
"@getify/eslint-plugin-proper-arrows": "^8.0.1",
"@getify/eslint-plugin-proper-ternary": "^3.0.1",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0",
"nodemon": "^1.19.4",
"prettier": "^1.19.1"
},
"engines":{
"node":"12.x"
}}
try this
Check /app/package.json: it has syntax errors, install won't proceed.
parse error: Invalid numeric literal at line 9, column 25
parse error: Invalid numeric literal at line 9, column 25```
oh no
Prolog```
could u remove the test and pretest
Remove the what?
a: aaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaa
@pure lion are u broke or did u forget
Online.
lmao
@pure lion do this
lmaooo
What are you doing
-botcommands
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
if(!serverQueue){
const queueConstruct={
songs:[]
}
serverqueue.set(queueConstruct)
}
try thus
but its fine i sorted it
try that
if(!serverQueue){
const queueConstruct={
songs:[]
}
serverqueue.set(queueConstruct)
}
mkay
i may have typos
spoonfeed time
repair it
:D
if (!serverQueue) {
const queueContruct = {
textChannel: msg.channel,
voiceChannel: voiceChannel,
connection: null,
songs: [],
volume: 5,
playing: true
}
queue.set(msg.guild.id, queueContruct)
this was already in-









