#development
1 messages · Page 1147 of 1
No async await?
have you tried a different package?
such as axios
request is deprecated anyway iirc
Try node fetch
nope, uptime robot api docs use request
Yeah but you can still use a different one
I have a big list of fetching packages
Axios, node-fetch, https, http. and many more.
I use alot of them, axios is my main.
i have too: https://npmjs.org/search?q=fetch (6276 total)
How can I check if a bot invite link is valid?
Nah, I use these only.
exports.run = (client, message, args) => {
var Discord = require("discord.js");
var axios = require("axios");
var form = {api_key: 'MY-API-KEY', format: 'json', logs: '1'}
var headers = {'cache-control': 'no-cache',
'content-type': 'application/x-www-form-urlencoded'}
const req = await axios.post(options.url, form, headers)
console.log(req.data)
};```
How can I check if a bot invite link is valid?
@pure lion split it, find the client id, find if that is valid, and if it is, see if it is a bot
How can I check if a bot invite link is valid?
@pure lion Try slicing into the string to first find scope=bot, and find if a bot in the client's list is a match to the client_id from the link.
I can think of a way of doing it in eris
Require stack:
- E:\Thunder\server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (E:\Thunder\server.js:10:12)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'E:\\Thunder\\server.js' ]
}
Oh alright
npm i quick.db
npm i quick.db@latest
doesnt work @golden condor
you can't unless you scrape the website with a driver like selenium, chances are cloudflare is going to stop you
in your console
keep in mind that a valid id does not make a valid invite link
you might need windows build tools
it says cannnot find Python
npm i -g windows-build-tools
xD
you need py then
Also is there a variation of the this keyword in a mongoose schema?
but its a JS code
I have no idea, I dont use schema alot.
nodejs needs py.
what program should i use for making bot online?
@earnest phoenix You need to buy a host.
me
they're cheap as 20 cents/month to as expensive as 1000 usd/month
how do i buy a host?
i cost £1 a month x)
@earnest phoenix
where?
What should i write
@pure lion if you extend it, you can use this
you need to have programming knowledge to make a bot
You need to
A. Code it
B. buy a host for it
but code can without host?
Yes
yes
@golden condor wdym?
But it wont be online 24/7 anyways from that.
const BotSchema = new mongoose.Schema(
{
botID: {
type: String,
index: true,
unique: true
},
botUsername: {
type: String
},
owners: {
type: Array
},
verified: {
type: Boolean,
default: false
},
certified: {
type: Boolean,
default: false
},
date: {
type: Object,
default: {
timestamp: new Date().getTime(),
date: new Date()
}
},
inviteLink: {
type: String,
default: this.botID
}
}
);
```example of my schema
I wish ?bin existed here
it does
what is ?bin
aa!bin
it works on .txt files and messages
A discord.js official tag
Not always virtual pcs but yes
i understand
Which says, That you have to use a virtual bin like hastb.in to post long code snippets.
xD
Eugh
well discord.js isnt really opening
well discord.js isnt really opening
@glad heart Wdym "opening"?
@earnest phoenix im lost
you might need windows build tools
@golden condor what to do then
Btw if you're interested in testing my bot list DM me
how to use build tools
@pallid igloo crashes whenever I try to host
Host or test?
ok
Bruh, Don't use batch or sh files for testing.
what
well discord.js isnt really opening
Friday#7005 What the heck is this supposed to mean, Can anybody understand this except for the dude who posted it?
@pallid igloo wdym
xD
Sorry I didn't mean to do that
Ah, Alright
@pallid igloo wdym about sh files for testing?
@pure lion like this
how do i get this badge?
get verified
-verifybot
from bot right?
hello
Crap, Lemme use tags already.
How embed link send for invite?
?
how can i make a bot verified
wow flameshot lets you upload to imgur?
@earnest phoenix It needs a minimum of 75 non fake servers.
flameshot is a really cool tool
yeah
Fake servers = the ones that you dont own.
Equivalent of sharex on linux I'd say
fake servers
ShareX is slow
what does that mean
@pallid igloo okay then i have to give away my bot invation?
and keeps asking you for updates every time
Yeah.
ooh
it's the bloatware version i should say
and hope that you hit 75 servers.
you'll get messaged by discord when your bot is qualified for verification
great
unbore yourself
let bored = true;
if(bored) bored = false;
if(bored = false) new console.error('Cannot turn boredom to false!')
how to install windows power tool
idk
-support @weak rain
==*
Google can help with that
;-;
True
;_;
I'm gonna go and die.
bye
Not die
~support @weak rain
I mean be super inactive.
People, im ask
ok
Ahh god, Can you show an example where u saw it?
yes
im assuming hyperlink
Or masked link.
client.on(`guildMemberAdd`, member => { const embed = new Discord.MessageEmbed() .setColor(`#ffffff`) .setAuthor(member.user.username) .setDescription(`DobroDosli na **Hi!** server.`) .setTitle(`**Welcome!*`) .setImage(`https://pushalement.pokemon.com) member.guild.channels.cache.get(`720631185688100867`).send(embed); })
never sends the attached link of image with the welcome message
Indent it please, I doubt anybody is going to read that by any chance.
Bruh
what
client.on(`guildMemberAdd`, member => { const embed = new Discord.MessageEmbed() .setColor(`#ffffff`) .setAuthor(member.user.username) .setDescription(`DobroDosli na **Hi!** server.`) .setTitle(`**Welcome!*`) .setImage(`https://pushalement.pokemon.com) member.guild.channels.cache.get(`720631185688100867`).send(embed); })
@glad heart welcome code nice
ok
my message deleted?
@weak rain yes
why
repeated text maybe
Cuz u should stop being a dick
hm ok
Invalid image bro.
wtf
invite link prob because you have no role
wait brb
hm
lol I put a wrong link
const { MessageEmbed } = require("discord.js")
module.exports = {
name: "invite",
usage: "Introduction",
description: "Command Info",
category: "main",
run: (client, message, args) => {
let inviteEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setAuthor(" ")
.setFooter(`Requested by ${message.author.username}`)
.setDescription(` __**Links**__
[Click here to Invite the Bot](invite link of bot`);
message.channel.send(inviteEmbed)
}
}
ok use this
no link
now
thanks@weak rain I ama try
Np
I'm bored.
for (i = 0; i = -1; i++) {
if(FanBoy.exists()) Boredom.Activate();
};
ok
@manic osprey here is invite
I think he needed something else.
sec
idk
im go test.
hm
oof.
for click here links ;-; @winter basalt
yes
basically text
@winter basalt that puts ur link in a blue text
sorry if I sound dumb
i am only 14
basically text
Jly#0941 The full syntax is
[text](link "hover text")
But hover text can be optional.
Phone users have no impact from hover text.
they are optional
.setDescription("text for the mask")
thats not an embed
Like this?
no
i mean for send invite
message.channel.send(link);
discord does that automatically if you post a discord.gg server invite link
no
discord does that automatically if you post a discord.gg server invite link
@quartz kindle discord.com/invite/ links also work.
@quartz kindle i mean for long time invite
same thing
ah god, Just create an infinity invite and simply post it in the channel.
i mean for example
send embed with bot
special tag
bot take send embeds
example !invite , and bot speak to send url
for invite
you literally just send the link
sec
discord does the join server embed automatically
just commit https://discord.gg/dbl
invlink = '';
m = [Message Object]
if(m.content = '!invite') {
m.channel.send(invlink);
};
the bot does need send.
yeah people with no roles aren't allowed to send invites because a lot of the time, they just send ads.
How much time they take for the approval of the bot (ping me with answer pls)
3+ weeks
Hey, how could I increase response times with lavalink?
\
Wow
rn it's taking roughly 2-10 seconds to find 1 song.
v11?
wait
I need help
I have this prefix script
And it’s not working
Idk why
Dm if u can help
@pine aspen the speed of lavalink will be to do with your internet speeds and how long it takes to load youtube as it scrapes youtube's site
Buy a better host.
...
@earnest phoenix you didnt provide anything. we need to atleast know the code you wrote to help
wtf
@earnest phoenix you didnt provide anything. we need to atleast know the code you wrote to help
@winter basalt that’s why DM I said
And it’s JavaScript
post the code here

K 1 sec
const fs = require('fs');
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(Bot's Prefix is changed to ${text})
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
};
code blocks please
unless they're getting paid
@quartz kindle ppl are greedy for money lol
people need to make a living
code blocks please
@quartz kindle ?
```js
code here
```
Making advanced bots is... not something people wish to do for free. It costs nerves, time, and effort
Kk
```js
const fs = require('fs');
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(Bot's Prefix is changed to ${text})
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
};
```
good job
yes
```js code here
```
Oops
```js
const fs = require('fs');
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(Bot's Prefix is changed to ${text})
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
};
```
See
wtf
Idk why
it's because you have ` inside your code
const wolrus = `mmm yes`
Oof
it works for me
js aaa
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(`Bot's Prefix is
changed to ${text}`)
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
}; ```
I delete?
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
Why are you slicing an array BRUH.
Don’t ask I started it and my friend ruined it
the three ` worked for me
LOL he mad
Why are you slicing an array BRUH.
@pallid igloo you can slice an array
Oh rip me
const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const newArray = array.slice(2)
console.log(newArray) //[3, 4, 5, 6, 7, 8, 9, 10]
```^^ How slicing an array works
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(`Bot's Prefix is
changed to ${text}`)
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
}; ```
So?
Omg thank u for ur help 👌
just showing that it works
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(`Bot's Prefix is
changed to ${text}`)
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
}; ```
CAN anyone fix it? If there is any prob?
where is ayarlar defined
where is ayarlar defined
@golden condor wdym
lol a turkish code
I would like to do something, not sure if it is difficult.
I want like to loop throught a folder with files.
the files are named like this: test1_ger.mp3 or test2_fr.mp3
@earnest phoenix you are making a new set on every message event, that's why it isn't working
Put it outside the message event
I would like to do something, not sure if it is difficult.
I want like to loop throught a folder with files.
the files are named like this: test1_ger.mp3 or test2_fr.mp3
@midnight blaze use fs if you are using node.js
One question: how you can set a normal value for quick.db? Like standard value: 0 and you can change it. I only want to know how to set the standard value.
@earnest phoenix has nothing to do with your problem but use msg.content.toLowerCase().includes() so you don't have to check for every possible capitalisation
fs is the built in file system, you don't need to install it, just require it
lol a turkish code
@flat pelican so wut?
fs is the built in file system, you don't need to install it, just require it
@golden condor NpM i Fs : Am I a joke to you?
in one event you mean
send the code
exports.run = async (client, message,args) => {
text = message.content.split(' ').slice(1).join(' ')
if (!text) return message.channel.send("Please write new prefix")
ayarlar.prefix = message.content.split(' ').slice(1).join(' ');
message.channel.send(`Bot's Prefix is
changed to ${text}`)
fs.writeFile('./jsons/ayarlar.json'
, JSON.stringify(ayarlar), err =>
{
if (err) console.log(err);
});
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['prefix'],
permLevel: 4
};
exports.help = {
name: 'prefix', usage: 'prefix'
}; ```
Fixed
Fixed
@golden condor that for me or him
him
Not really
Ah...
Its a very basic part of discordjs
May I suggest to you to learn javascript
@golden condor don’t have time for that
Lol
Callum how do i turn my bot on
Idk
if u dont have time to learn the basics enjoy then
@restive pebble I focus on my study and I wasn’t referring to u pls stay out of it
I don't know how to code
nice
ok so why coding then
me too
if u dont want to learn
i just clone from github
Never coded in my life
@golden condor
lol
Ignore the fact that I have a verified badge, it's a glitch
sup callum
easiest way to learn: explore the language by testing things
harder way to learn: read books and/or ask other ppl for help
ok so why coding then
@restive pebble Bc I already have a full full script my bro made he isn’t here in country and this is the last thing I’m trying to fix
never coded in my life
allright good luck and i applogize for what i said
No worries
never
why tf people use @param and what does that mean
jsdoc
For now 5 ppl I asked none where helpful
i also have to learn those params things
parameter
it's for classes and functions to tell you what to put in there
see
oh

It's basically types without typescript
yes i use ts so no need
eh

i have .d.ts so i dont need that right
You have more possibilities with jsdoc though
jsdoc is very useful, there is also a modified version in ts
yes
if you use vscode, it will automatically fill it for you if you type
/**```
/**OK
VS code is very helpful
oh nice
i dont even comment my code, let alone jsdoc it lmao
/** ok
and then, you get this:
Whats /** for
auto
@return {*}
oh
that indicates that it is jsdoc
below the param?
/** means that it is jsdoc
ok ill read jsdoc ty
I don't think it matters where, not sure
doesn't work without /**
Jsdoc is what shows you what to put in when using say discord.js's client
wHoPingEdMEEEEEE
Vscode should highlight @param
Make it coloured so you can see it
My theme makes it blue and purple
(my theme is community material theme darker high contrast)
I like the purple keywords - blue variables
In my theme?
Hey guys
is their any support server of glitch.com
No
:/
There isn't
lol
(my theme is community material theme darker high contrast)
@pure lion if you were taking about my theme, this is it
@earnest phoenix any idea?:
One question: how you can set a normal value for quick.db? Like standard value: 0 and you can change it. I only want to know how to set the standard value.
db.set("key", 0)
Oh, okay. Thanks!
Nani, what you mean by normal value
db.set("key", 0)
@restive furnace but it will set it, right?
yep, if u want integer
if u want string then use db.set("key", "you string here")
then use db.set("key", "None")
set() can set it to anything you want and update like the exact way you set it before
@golden condor but whats the point of them
Mhm
It's supposed to provide description to functions, classes and parameters needed inside them and intellisense
Yes it does, it provides descriptions to functions and documentation inside the code.
tl;dr: it provides documentation to your code
I finally added a giveaway command 🥳
Documentation
Why does my code need to be documented
Its not a living thing is it
tl;dr: it provides documentation to your code
^ so it can be pulled by IDEs and other text editors, and in case someone else works on the code
you're saying that now
but when you come back to a project after a month you'll forget what your code does lol
not for intellisense
sure but yeah, you use jsdoc so it can be pulled from text editors and IDEs
and if u go oss, then you can just generate docs from them
@earnest phoenix so I made a say command but you can ping roles/everyone and here with it. How to fix it?
permissions
@ me if you know it.
use allowedMentions and disableMentions
in TextChannel#send() options
for example ```js
message.channel.send("@everyone",{disableMentions:"all"})
same like normal message.channel.send
Okay
you dont need to check the text content
yes, if you disable all, it will disable all mentions
Good.
Good, because this is my problem.
ShareX is slow
@paper cliff your pc is slow
it's not
and keeps asking you for updates every time
@paper cliff https://jaex.getsharex.com/2020/08/chrome_XxDm0bNsAC.png
what
what are you even bothering with that lmao
every time I boot into Windows, it keeps asking me to update even if I told him 5000 times to not update
and I feel like it's slower than flameshot, but it's probably Windows that does that anyway
message.channel.send("@everyone",{disableMentions:"all"})
``` @quartz kindle how can I disable role mentions for all roles and user mentions for all users?
^ what you did should works
Okay
I feel disableMentions: "all"
Is pretty descriptive of what happens
u can also use message.cleanContent
Hey, how'd I check if a user has speaking permission in a specific channel. Eris.
@digital ibex No, it's only for receiving messages, it's not for sending them
and cleanContent basically removes any mention where disableMentions directly tells Discord to not mention anybody without modifying the message content itself
Eris, a NodeJS Discord library
I mean, that would also be on the docs
cleanContent doesnt mention
Hmm
Woo, how can i see if the user has a specific permission?
PermissionsOf just gives me all of them in an int
If you follow the docs chain(clicking what it returns)
https://abal.moe/Eris/docs/Permission#function-has
Eris, a NodeJS Discord library
hi i need help
what do u need help with?
i need to access my mysql database with another pc, how can i do that
the bot is not hosted on the same pc as the database
Everything is chainable
I didn't think has would work.
It tells you what it returns and you can click on it to follow the chain to get what you want
They don't really provide examples, but who uses doc examples anyway
They don't really provide examples, but who uses doc examples anyway
@solemn latch People who don't actually write their own code, and hope copy and pasting will result in a fully-functioning bot
(not keeping up with current convo)
Hi guys, I am trying to loop throught a folder with mp3 files.
fs.readdir("./a/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
if (!file.endsWith(".mp3")) return;
let props = require(`./a/${file}`);
let commandName = file.split(".")[0];
console.log(`Attempting to load command ${commandName}`);
});
});
I get this error:
/home/runner/languagebotquiz/a/address_cs.mp3:1
ID3
^
SyntaxError: Invalid or unexpected token
I tried to search it up, but I dont see a soltuion for now, maybe somebody here is experienced with fs.
why are you requiring an mp3 file
you cant require an mp3 file
Confused at what you're trying to do
this ^
By loading it, maybe you can just keep an array of file locations of mp3's
you need to read it with fs and store it as a buffer
ok, store it as a buffer. let me try that out 👀
an array of byte arrays :^)
you could also create a messageAttachment and store the attachment
pretty sure discord.js will do the reading and buffering for you
sounds like the property isn't a string or maybe undefined? idk. Looks like a custom error to me
hm
it is a custom error
From commando?
most likely from a built in command handler
you're using something that requires all commands to have a name field in its help object
and your command doesnt have it
const client = new Discord.Client();
const Canvacord = require("canvacord");
const canva = new Canvacord();
module.exports = {
name: "trigger",
usage: "trigger",
description: "Trigger People",
category: "image",
usage: "trigger <@user>",
run: (client, message, args) => {
let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
let image = await canva.trigger(avatar);
let attachment = new Discord.MessageAttachment(image, "triggered.gif");
return message.channel.send(attachment);
}
}```
this is my code
My GameBot isnt working anyone know why
one sec
fs.readdir("./a/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
file = new Buffer(file, 'binary').toString('base64');
if (!file.endsWith(".mp3")) return;
let props = require(`./a/${file}`);
let commandName = file.split(".")[0];
console.log(`Attempting to load command ${commandName}`);
});
});
hmm, nothing happens. 🤔
const client = new Discord.Client(); const Canvacord = require("canvacord"); const canva = new Canvacord(); module.exports = { name: "trigger", usage: "trigger", description: "Trigger People", category: "image", usage: "trigger <@user>", run: (client, message, args) => { let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' }); let image = await canva.trigger(avatar); let attachment = new Discord.MessageAttachment(image, "triggered.gif"); return message.channel.send(attachment); } }```
tHIS IS MY CODE
whats not working?
;-;
@earnest phoenix do you think I'm a wizzard to magically guess why seomes vode doesn't work before even reading it?
Yes
fs.readdir("./a/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
file = new Buffer.from(file, 'binary').toString('base64');
if (!file.endsWith(".mp3")) return;
let props = require(`./a/${file}`);
let commandName = file.split(".")[0];
console.log(`Attempting to load command ${commandName}`);
});
});
HMM, wth! Why
Looks to me like your command handler is upset @weak rain
@midnight blaze a w a i t
Why
I dont know, depends on command handler
My GameBot isnt working anyone know why
@ShakeandBake99#3390 Nobody can tell you why without an error, stacktrack, or code snippet
He isn't in the server anymore
@weak rain your command handler is requiring your commands to have a help object
export an object called help
and insifr that object add that property
'name'
const waitFor = (ms) => new Promise(r => setTimeout(r, ms));
fs.readdir("./a/",async (err, files) => {
if (err) return console.error(err);
files.forEach(async file => {
await waitFor(50);
file = await new Buffer.from(file, 'binary').toString('base64');
if (!file.endsWith(".mp3")) return;
let props = require(`./a/${file}`);
let commandName = file.split(".")[0];
console.log(`Attempting to load command ${commandName}`);
});
});
I tried it, doesnt work, same result
await waitFor(50)
?
write functions and proper unit tests
@amber fractal aight, good, to know, but it wont solve the problem yet, thanks tho
is their any good place too take a look at some example on discord.py shards implementation?
if(command === "airhorn"){
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has("CONNECT")) {
return msg.channel.send("Sorry, but I need a **`CONNECT`** permission to proceed!");
}
if (!permissions.has("SPEAK")) {
return msg.channel.send("Sorry, but I need a **`SPEAK`** permission to proceed!");
}
const VC = msg.member.voice.channel;
if (!VC) return msg.channel.send("I'm sorry, but you need to be in a voice channel to play a music!");
VC.join()
.then(connection => {
const dispatcher = connection.play('/home/container/airhorn.mp3');
msg.channel.send(`Ok Zoomer`)
dispatcher.on("end", end => {VC.leave()});
})
.catch(console.error);
}```
my bot does not leaves VC
once song is finished
i mean sound
.then?
excuse me
wha--
Why you want a horn command bro xd
Why would i use then when i don't need it
Why you want a horn command bro xd
@dire obsidian SoundBoard
I dont see an end event for dispatcher
Niceeeeeeeeeeeeeeeee
I dont see an end event for dispatcher
@solemn latch it is i saw it on stackoverflow
i use this
oh wait
i think it is finish
i checked docs
hi
oh wait no
can domsone help me
it is end only
-asktoask
@worldly current with ?
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1123)')]``` I am for some reason, getting this error in my python code?
Wot
latest one
🤔 probably shouldn't copy paste code from stackoverflow
@stable eagle Try "curl https://discord.com"?
@worldly current Idk exactly what your issue is
latest one
@stable eaglepip show discord.pyplease
ohh
No?
No
That's for JS, Auric
oh really
CSS and HTML is supposed for non-cert
ohh
well i've heard otherwise
oh yeah mb it is js
¯_(ツ)_/¯
@worldly current so uhh what do you need help with?
how it normally does
How many days takes to get your bot verified?
Wdym
3-4 weeks
Lol
Use inspect Element to get element names and then make rules for them
bruh someone take over, imma eat
lol
I here
Is it normal for yarn workspaces to put a node_modules in every workspace dir?
fs.readdir("./a/",async (err, files) => {
if (err) return console.error(err);
await files.forEach(async file => {
file = await new Buffer.from(file, 'binary').toString("base64");
console.log(file)
});
});
I was able to load the files, but how to make them in normal string?
all I need is the name of the files in strings
you dont need await, nor new
I've never seen it do that @opaque eagle
Then why are you getting the base64 representation of the file buffer?
can Buffer.from even load from a path?
hi pangloss
e
file is a string...
what is the best way to ads a bot ?
file is just a file name
the normal Buffer is deprecated
ok
hi
@midnight blaze you are base64 encoding the file name, not the contents lol
xD
oh
I feel like if I google "JS read file name" I'll have your answer
Are you allowed to customise your bots page with CSS?
const images = [];
fs.readdirSync(dir).forEach(file => {
images.push({
name:file,
buffer:fs.readFileSync(`${dir}/${file}`)
})
})
``` @midnight blaze
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1123)')]``` Can someone help as I got this error when trying to get my bot online, my discord.py version is 1.4.1
can i require files like kek.example.js
@stable eagle I can help
but
ok
anyway^^ thanks for help
no whitespace pls
@stable eagle I have had the exact same error before. Open up internet explorer and go to discord.com and then you can redownload the certificate
Ok I have more info... when I install a regular dependency, like chalk, it installs it in the main node_modules folder and won't create one inside the workspace. When I add a dev dependency like eslint or typescript, it makes a node_modules in the workspace folder... idk why
And I'm doing yarn workspace parser add -D typescript
Guys if one day I got 75 servers using my bot where I have to go to get the tag
-verifybot
Hi! It seems like you are looking for information on how to get your bot verified.
Once your bot reaches 75 servers or more, you are eligible for bot verification. On October 7, 2020, bots with 100 servers or more that are not verified will not be able to be invited to any more servers. You verify your bot on your bot's application page, under the "Bot" section in the sidebar.
If you need more information, check out this article written by Discord about The Future of Bots on Discord and you can ask questions in the Discord Developer Server.
We cannot provide support on how to get your bot verified.
sure
Error: ````info.titlewill be removed in a near future release, useinfo.videoDetails.titleinstead.info.video_urlwill be removed in a near future release, useinfo.videoDetails.video_urlinstead.info.length_secondswill be removed in a near future release, useinfo.videoDetails.lengthSeconds` instead.
Could not join voice channel: Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.```
l hope my bot was approved
what did you use
will be removed in a near future release, use X instead
I don't recommend using depreciated stuff in libraries
what did you use
@zealous torrent I used = API's
const YouTubeAPI = require("simple-youtube-api");
async run(client, message, args) {
client.guilds.cache.map(g => g.name)
}
}
Someone knows why "cache" is undefined?
Looks like you shouldn't use info.title
you trying to make a music bot?
@zealous torrent Yes!
@earnest phoenix are you there?
Ignore the actual music playing, that's simple too
tbh you can probably search how to make music bot on youtube and find tutorials
async run(client, message, args) {
client.guilds.cache.map(g => g.name)
}
}
Do you know why "cache" is undefined?
Guys I'm trying to check my bot I don't know how else it got 76 servers
@sharp tendon hi
Ow thx
Okey
Guys I'm trying to check my bot I don't know how else it got 76 servers
@split goblet Do you suspect your token was leaked?
If so, regenerate and update your bot's script.
You can check the guilds it in via the lib you use
You will need:
A way of storing all of the queues across guilds
A queue system per guild that stores volume, songs, paused status and voicechannels
Ways to trigger this and get info from YouTube
channel = client.get_channel(id=int(result[0]))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
im getting this error
You will need:
A way of storing all of the queues across guilds
A queue system per guild that stores volume, songs, paused status and voicechannels
Ways to trigger this and get info from YouTube
@pure lion How do i start? I need to delete my code?
thats my code
is result[0] null?
no i dont think so
What is it then?
check my code ig
1 sec
it is
but it wasent supposed it
to
its pulling from a db
and its not working
That's what the error is
Databases can return null
You need to handle it being null, and or fix your db query
@sharp tendon you don't need a db
Ok can you help me with it?
I mean, the error was pretty straightforward.
No need to redo your whole code if it works.
Just swap the .title and .video_url
To the non deprecated properties
I mean, the error was pretty straightforward.
No need to redo your whole code if it works.
@solemn latch What must i do,
?
Just swap the .title and .video_url
To the non deprecated properties
@solemn latch
What the error told you to do
It was a plain text error describing exactly how to solve it
What is the non deprecated properties then?
every bot developer ^^
@zealous torrent more like this https://discordapp.com/channels/264445053596991498/385837258768515083/743120855479091220
Sorry iam not so like a pro...
@faint prism 100%
What is the non deprecated properties then?
@solemn latch
i dont think @solemn latch is gonna help you through every step
Do you speak english
It literally describes what you need to do in full
^
Hey @earnest phoenix I have some problems with your package.
this might be easier to read
@fringe axle What's the problem
run(message, args) {
let argsC = message.content.split(" ").slice(1);
let np = new p();
np.scramble(`${argsC[0]}`);
}
}
Do you speak english
@opaque eagle Actualy not.
Not responding. No error, nothing.
either way it explains what to do
@opaque eagle Actualy not.
@sharp tendon Do exactly what the error tells you to do
I don't speak english...
Of course it would not respond, you aren't sending any messages or as such @fringe axle
I speak it now...
cool but read the error
But its all
I send a message after it.
I don't speak english...
@sharp tendon Do what error say do
Idk
@faint prism Show that part of the code too
:reeeeee:
Just swap the .title and .video_url
To the non deprecated properties @sharp tendon
Of course it would not respond, you aren't sending any messages or as such @fringe axle
@earnest phoenix I do...
Not being an English speaker, but being a programmer must suck 
@faint prism Show that part of the code too
@earnest phoenix It's pasted above about 3 times now
Yes ok but what is the non deprecated properties?
Yes ok but what is the non deprecated properties?
@sharp tendon It says what they are 😢
in the error message
@faint prism Wait sorry wrong ping
info.title will be removed in a near future release, use info.videoDetails.title instead.
info.video_url will be removed in a near future release, use info.videoDetails.video_url instead.
info.length_seconds will be removed in a near future release, use info.videoDetails.lengthSeconds instead.
Could not join voice channel: Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
@fringe axle Show that part of the code where you send it as a message
those are the non-deprecated properties
it says it right there
The things inside the boxes are the non deprecated properties
@zealous torrent thx
If you read the error, you would know
change info.title to info.videoDetails.title
@sharp tendon
const { Command } = require('discord.js-commando');
const { MessageEmbed } = require('discord.js');
const fs = require('fs');
const Discord = require('discord.js');
const np = require('string-toolkit')
module.exports = class ScrambleCommand extends Command {
constructor(client) {
super(client, {
name: 'scramble',
aliases: ['scramble-words'],
group: 'fun',
memberName: 'scramble',
description: 'Scramble your text',
});
}
run(message, args) {
let argsC = message.content.split(" ").slice(1);
let np = new p();
np.scramble(`${argsC[0]}`);
}
}
Now "p" is not defined
@earnest phoenix
define it
I dont see you defining p anywhere
const np has to be const p
Okay
np.scramble(`${args[0]}`);``` can just be
```js
np.scramble(args[0]);```
^ that too
Okay
why use string literals when args[0] is already a string
string interpolating a string
@earnest phoenix and how's he responding now?
zzsound_quiz
Just send it as a message?
zzsound_quiz
return message.channel.send(np.scramble(args[0]));```
Wrong channel
zzsound_quiz
Uhh
return message.channel.send(np.scramble(args[0]));```
@earnest phoenix Replace with it?
Still wrong channel
@fringe axle replace it with np.scramble(args[0]);
this is officially spoonfeed city 🥄
Feels bad volt going to have to cover all of how to make a bot

Ok @faint prism But now i have this error = ```js
Could not join voice channel: Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
thats internet problem
That's why if you learned how to work with strings, you wouldn't need some random package to do something as trivial as scrambling a string @fringe axle
Read docs as to what would cause that command to be sure though
<Websocket connection problem or ratelimit of connecting to a voice channel>
zzsound_quiz
Wrong channel x 4
pangloss your in the wrong channel lmao
@earnest phoenix you saw my image above?
I think he is lagging or something idk
you're drunk, go to bed
Lol
@fringe axle Show your current code
run(message, args) {
let argsC = message.content.split(" ").slice(1);
let np = new p();
return message.channel.send(np.scramble(args[0]));
}
}
Oh
message.content.split, right?
Change args[0] to argsC[0]
That's not how commando works
Okay
the point of commando is you don't have to worry about parsing arguments
thats internet problem
@misty sigil How do i make that?
I'd look at the commando docs to see how they want you to define arguments
How do I fix that?*
Working, thanks!
@fringe axle wait
Cool package.
argsC[0] must be argsC.join(" ")
zzsound_quiz
i'd assume you'd just get a better connection, but it could be something to do with ratelimits @sharp tendon
Sorry my bad
argsC[0]must beargsC.join(" ")
@earnest phoenix but it's working... xD
@earnest phoenix doesn't commando parse args for u
Without it what you said.
not for more than one word
Oh

i'd assume you'd just get a better connection, but it could be something to do with ratelimits @sharp tendon
@misty sigil And how do i fix that ratelimits?
By waiting
@opaque eagle Idk i don't use commando
oh ok
Depends on the ratelimit iirc



