SyntaxError: Invalid or unexpected token at new Script (vm.js:79:7) at createScript (vm.js:251:10) at Object.runInThisContext (vm.js:303:10) at Module._compile (internal/modules/cjs/loader.js:657:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19)
#development
1 messages · Page 567 of 1
obviously its a problem with your code then
vscode has no issues detected
did you save the file
yes
vscode by itself doesnt run javascript files, so run active file doesnt work
you have to run it using node
ok
you can do that in vcs's own terminal if you have node installed proiperly, i sent you a link yesterday about it, did you read it?
is that where your file is saved?
yes
if so, type node yourfilehere.js
so like node server.js
yeah
(function (exports, require, module, __filename, __dirname) { ��
(function (exports, require, module, __filename, __dirname) { ��
^
SyntaxError: Invalid or unexpected token
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)```
thats the full thing
your file is corrupted
or file encoding is wrong
you may have a zws or something at the beginning
its UTF-16 BE
try creating a new file, doing something simple like console.log("test")
try utf-8
different error
with normal code now
thanks for help
its just already declared, so a regular code error
could someone tell me what I am doing wrong here:
if (guildSettings.leaveEnabled === 'true') {
if (client.user.bot) {
return;
} else {
const leaveembed = new Discord.RichEmbed()
leaveembed.setColor('RED')
leaveembed.setAuthor('Member Left', member.user.displayAvatarURL)
leaveembed.setThumbnail(member.user.displayAvatarURL)
leaveembed.setDescription(leaveMessage)
leaveembed.setTimestamp()
leaveembed.setFooter(`Member Count: ${member.guild.members.size}`, client.user.displayAvatarURL);
if (member.guild.channels.find('name', guildSettings.leaveChannel)) {
member.guild.channels.find('name', guildSettings.leaveChannel).send({embed: leaveembed}).catch((e) => client.log('log', `Unable to send message to leaveChannel (${guildSettings.leaveChannel}) on ${member.guild.name} (${member.guild.id}): \n ${e}`, 'Error'));
}
}
}
I am trying to make my bot not reconize when another bot joins or leaves the server.
tip: color your code by adding js at the beginning of the code block for easier readability
How can I make a command that shows me a list of the servers that my bot is in
what language
Discord.js
I can't check right now, but the client object should have a collection of cached server objects
I cant find anything online
google discord.js documentation
I can't open my browser and check it for you cause I'm installing a VM with my poor CPU that can't handle basic multitasking
Ty I updated the code
what is the error you are getting
not getting any
I read on servers but gave me info on how to catch data from a server and not catch all servers
it either disables the messages for everyone or doesn't detect the bot
so it doesn't startup?
yes it starts fine and runs
er, ok
the way I have it in the code right now. I invite a bot it doesnt send the message. But if a non bot user joins it doesnt send the message
B
Why?
depends, why you need it for
It looks more professional to me
A then
yeah I agree, thanks
heh I thought it was for a footer or something else
they're header links
that way looks better then. matches the other links
@dusky steeple if (client.user.bot) {
you're checking if your own bot is a bot
instead of the user who joined
hmm lol
Thank you @quartz kindle can't believe it was something that stupid I was over looking.
👍
How send message in gmail through node.js module, emailnode?
I'm very very noob
)
link? i cant find any module called emailnode
Do you mean nodemailer?
Yes
@daring trellis this? https://www.npmjs.com/package/nodemailer
How to remove all the reactions of a message? it is possible ?
is that a yes?
lmao
have you read their documentation? https://nodemailer.com/about/
Nodemailer is a module for Node.js to send emails
Me ? @quartz kindle
So I use a command handler for different files
Main is server.js
One I need is commands/eval.js
Is it possible to eval something into an array in serverjs?
@lofty hamlet yes, Tim sent the link to the docs for it
I read but i do not understand
@wide ruin its possible yes, but its kind of a hacky way to do it. its better to use module.exports
is wUser actually a user
discriminator is the numbers after the username
If your lib doesn’t have a designated ‚tag‘ string you can just combine the username with a # and their discriminator, gets you the same thing
eris is the only one without it, but you can add it easily
const { User } = require('eris');
Object.defineProperty(User.prototype, 'tag', {
get() { return `${this.username}#${this.discriminator}` }
});
Why is my bot showing this status
because your code is wrong
ok
this is my code
what wrong with it ?
guilds is a collection of guilds, not a single one
Can you even make that possible? I thought that a discord user only has 1 status message
client.users.size
That is in a SSH terminal
what can you make possible
Coo!
With codez
@golden raven what language
js
use canvas
https://www.npmjs.com/package/canvas
or something similar
@earnest phoenix just wanted to say that it's a really bad idea to update the presence on every guildCreate event
you should use a set delay
Hey!
Quick question, I am using discord.py and I have seen some people allow commands to fall back on the help command i cant seem to use this in my bots does anyone have suggestions or a direction to run in?
@hushed berry why ?
@celest latch what do you mean fall back
like if they dont use the command properly. rn the command just fails and says nothing
ideally id like it to fall back to the help of that command
@earnest phoenix If you join servers too quick, it'll violate the limit
Also, it's fairly common for Discord to send guild create events
like
really common
for guilds that you're already in
all at once
right, do I need to personally write each help command out or is there a simpler way to do it?
depends on your system
all my help and stuff is in one file and i just query it from there, but you can do other
gotcha. Lastly how do I get the bot developer role?
submit a bot and successfully get it verified ^^
you seem competent so i dont think youll have any trouble doing that 😊
ERROR: (gcloud.compute.scp) Source(s) must be remote when destination is local. Got sources: [C:\Users\Aj\Desktop\Link], destination: dr-anderson-011929
Can someone explain this? I am using google cloud
what
I need help making a list of all the commands I have for my bot
What
How to get my dbl bot's token
how to I make a command list pop up when I put in. my prefix and then help
Like I just need to look at some coding in discord.js
ik this isnt the appropiate channel
but can someone just tell me how to see how many servers my bot is in
im in js
have no idea how api works at all
so confused
You want to post your bots guild count on the website?
Same
Right so you did it in DBM
well not that far
Correct?
yes.....
@hushed berry dont mean to be rude or sound like a smartass but, popular libraries need to enforce/maintain ratelimits, you shouldn't violate any limits even if you do try to do the same thing really fast many times. But yeah its not a good idea to either way. Just wanted to clarify that it wont actually "violate a limit" if you're using a proper library
I suggest you ask in the servers as there should be someone there to help you
theyre dead
Well thats kind of the only place you will be able to get help
We can't really help you here, we kinda program here :<
You'll have better luck in the dbm server, even if it takes them a while to respond.
Which server are you in 
the main one
Last time I was there, There were about 6000 members or smth
Eh thats just the community 
yep
Can you invite me to the main guild in DM's please
majority actually have attention span and can sit down and learn a language
wait
huh?
To the DBM official server
I see, I'll find one somewhere
@quartz kindle i'm back so you can help me for .clearReactions() (plz) ?
what didnt you understand from the docs?
yeah but what part didnt you understand?
I just want to remove all the reactions of an embed how should I do?
the docs say it lol
.... but i do not understand
what dont you understand?
https://hastebin.com/desaxaxaco.js this is my command when the reaction was added how i can clear all reactions ?
...
?
message.clearReactions()
you need to get the correct message
🤔
?
newembed is not a message, its just an embed
message is a message
then you edit it, and the .then() creates a new name for the message
how to add halpo and halpie in my server?
you named it newMsg
Hum okayyy so newMsg.clearReactions()
so newMsg is the message after it was edited
I go test thanks
how to invite halpo and halpie in my server
@burnt birch go to the website, and click invite
then they are not on this website
i ts say no bots found
yeah they are not on the website. where did you find these bots?
then go there
@quartz kindle he not work
this server is for discordbots.org
I not understand this clearreactions
guys how to make a shop
yeah i searched there only
like, I have a coin system if they react on this, they will have this and their coins will be deducted
do you have a database?
im talking to phonetic
oh sorry
if you cant find them in discordbots.org that means they are not there
you need to look for them elsewhere
oh ok
try other websites or ask servers who have them
Tim I have json file
do u know how to make a dyno a welcomer and a leaver
where i can add this clearReactions() @quartz kindle ? oO
@burnt birch at their own website
you mean using the dyno bot?
yes
check their website, they have all the instructions there
Quick stupid question. Can guild, user, channel or role ids match?
Ok epic thanks
Tim can you help me out??
you have a json database right? so you can just use it
ye
@quartz kindle where is the website
nebulus show the code you tried
@burnt birch https://dyno.gg
@rustic walrus what part of your shop have you already done? is the coin system working? is the reaction working?
@quartz kindle :https://hastebin.com/desaxaxaco.js my code and i add newMsg.clearReactions() below line 39
below line 39? 🤔
there is no newMsg there
newMsg exists only inside the .then() block you created
🙀
Hum yes but...
@quartz kindle i didnt got much from that website
Where i can added this line ? tim
inside the .then() block
Yes but where ...
anywhere...
Is not work
Where in r.message.edit(newEmbed) .then(newMsg => console.log(`new embed added`)) .catch(console.log); });
inside the then() block
....
show me what you tried
It work xuse me i'm so stupid oO
@_@
😂
@quartz kindle for includ is for example : if (Dresseur.BDDTitre.content("Adorateur de Pokémons")) and for not include what is it ? : if (!Dresseur.BDDTitre.content("Adorateur de Pokémons")) ?
Array
so its .includes("")
for include if (Dresseur.BDDTitre.content("Adorateur de Pokémons")) works but for not include if (Dresseur.BDDTitre.content("Adorateur de Pokémons")) not works
yes but for not include just add ! ? but is not works
yes
.... strange
Ok thanks Even if it does not work strange 🤔
show code
I go searsh
My code is true ...
if (!Dresseur.BDDTitre.content("Adorateur de Pokémons")) {
Dresseur.GradeG = "Adorateur de Pokémons"
Dresseur.BDDTitre.push("Adorateur de Pokémons")
message.channel.send('__Vous avez capturé 100 Pokémons et vous avez terminé la quête unique 1, vous gagnez le titre : Adorateur de Pokémons__ (?settitre | Pour définir un de vos titres)')
}
}```
show code >.>
@_@
In my serverinfo when there are more than 20 roles I would like it to mark "too many roles" how to do it?
Because right now I have a 1024 characters error in my console
check if there are more than 20 roles
But in the embed I don't know how to do it
d.js?
Yes
if you want to check it inside the embed generator, you can use a ternary operator
(roles.size > 20 ? "too many roles" : roles)
its the same as an if, but returns the result
Thx
how would one use .permissionOverwrites?
setTimeout(() => {
let channel = split[1]
channel.permissionOverwrites
channel.send('<@&522791520533741596>')
}, ms(split[0]))```
its a channel id
.addField("Nombre de roles", message.guild.roles.size + "\n" + message.guild.roles.map((r) => r).join(' '))
(messages.guild.roles.size > 20 ? "Trop de rôles" : roles)```
?
.addField("Nombre de roles", (question ? result-if-true : result-if-false))```
Thx
how is channel.permissionOverwrites used?
permissionOverwrites returns the list of overwrites
so, if i want @everyone to read messages
if you want to create a new overwrite, you can use .replacePermissionOverwrites()
ok
im not sure if you can replace the everyone role tho
would that be the default?
is it alright if i put a picture of my code here?
yes its alright
because the fucking plugin crashed an i give up
this is to check if permission exists
ah ok
this is the problem i'm recieving
channel.replacePermissionOverwrites({
overwrites: [
{
id: message.author.id,
denied: ['VIEW_CHANNEL'],
},
],
reason: 'Needed to change permissions'
});```
would i change denied for allowed?
yes, you can check the docs for more details
also
that will replace all permissions
if you want to add only one permission, and not remove anything, use https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=overwritePermissions
@grim aspen i've never used repl.it so i wouldnt know
you're trying to run index.js right?
can i see its contents?
no🇩ejs
Can you host on repl?
i mean
you have two files in there
index.js and server.js
which one are you running?
well its either a problem with repl.it or your code is causing a crash
thats why show code
Hi
hi
setTimeout(() => {
let channel = split[1]
channel.replacePermissionOverwrites({
overwrites: [
{
id: message.author.id,
allowed: ['VIEW_CHANNEL'],
},
],
reason: 'Released puzzle'
});
channel.send('<@&522791520533741596>')
}, ms(split[0])) ```
TypeError: channel.replacePermissionOverwrites is not a function
at Timeout.setTimeout [as _onTimeout] (C:\Users\\Downloads\INFINITYHelper\commands\release.js:16:21)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)```
yes
so you must get the channel object
you do >release time|channel id
client.channels.get(id)
yes
thanks
screw nodejs, i'm going to use python
Why
repl isnt really a host tho
@quartz kindle
TypeError: Cannot read property 'replacePermissionOverwrites' of undefined
let channel = client.channels.get(split[1])
channel.replacePermissionOverwrites({
overwrites: [
{
id: message.author.id,
allowed: ['VIEW_CHANNEL'],
},
],
reason: 'Released puzzle'
});
channel.send('<@&522791520533741596>')```
Since when can we do embed?
🤦
?
we cant afaik
ages
Selfbot?
thats probably a self bot
nvm the server's being shitty on the website
oh, didnt realise its a normal account
Okay
@wide ruin channel id is wrong
i see
youre not in the server
Yes
I use await for things like that
Or Moderator?
Okay
If there is a moderator, I would like him to come in privately
Thats something that you should report to discord staff aswell
I don't know how to tell them because on Twitter they don't answer
@wide ruin try this js let channel = client.channels.get(split[1]); console.log(channel)
and see what comes up in your console
Yea selfbot
iirc when deleting messages sent by someone else you can auto report to t&s cant you?
I actually wonder how that thing works
Because they usually tell you that once a message is deleted, it's gone forever
Thats literally what they say on the report
Yep
Well, messages have a tag called “deleted”. I think if you copied the I’d they can still get it
Reported. Message IDs included. Same thing
Ye
a while ago when ddevs was still active, they told me that they keep deleted objects for the next 90 days
Cool
That explains it, thanks
@quartz kindle undefined
"let channel = client.channels.get(split[1]);
console.log(channel)"
i did eval on that
with a channel id instead of split[1]
as a string
well, undefined means the channel was not found
its copied from the channel
the bot has access
so, to start the bot i type node server.js
is there a way to add a command that restarts it for me?
use a process manager such as pm2, or a script that auto-restarts it if it quits
then you can just make a command that shuts it down, and it will be auto-restarted
or make the bot call an external restart script
What would be the simplest way to combine messages sent within like a minute of each other or something and then combine them to one string idk
messageA + "\n" + messageB
@wide ruin to quit the process, you can use process.exit()
if you have a process manager, it will restart it automatically, you dont need to do anything else
how do i get a process manager?
if you dont want to use a process manager, then you need to create a script that kills the process and restarts it
which is easier?
Yasmin I mean receiving messages from other users
Like 5 or something separate messages sent by another user then combine them into one string
use fetchMessages() ?
But like I wanna receive them in time I guess?
Is there a way to make a message collector like how reactionCollector is
then use a message collector
Is that a thing?
assuming you're using d.js
@wide ruin http://pm2.keymetrics.io/
Oh I was looking at guildchannel lol
I’m smart 
So and filter I would do like filter: {author: Author} ?
Oh wait nvrm the collector thing
söyle
bir vakit gelicek ki
buralar
bir sessiz olacak
ama
ne zaman
inş ben öldükten sonradır
turkish in #memes-and-media
Is there a way to break the collector? Like on('collect',a=>{if(a.whatever Boolean) break;})
Obviously that doesn’t work but can I break the rest of the collection if something
.stop()?
^
can someone tel me how to start the bot in heroku i dont have the worker addon and i cant find it and it dosent want to start and for some reasosn someone keeps entering my bot and sending and mentioning everyone and sending in dms stuff cz i put it on github or heroku am not sure
thats because you made your token public
your token is your bot's password, you have to keep it safe
@quartz kindle ol
just so you know, heroku is not as free as paying for a virtual private server, you pay them with your nerves and precious time
ik and i keep doing it
also, put it in a file and make github ignore that file
and go into your heroku settings and make your project private
i just refreshed it
i want other people to use it
will they be able to use it after that ?
they don't need access to your files
tru
they just need to be able to add it to their servers
I don't dm with randoms
oh ok
so i should upload a file not like that ?
also how do i make github ignore it
heroku is just not a good place in general, it will be a lot easier to just pay $3 per month for a real server
hard for me broosky :d
ignoring a file means putting the file's path inside the .gitignore file
@earnest phoenix https://anidiots.guide/first-bot/adding-a-config-file
read the warning block right at the beginning of that guide
i did
git is a software that needs to be installed in your system
do you speak english? "Choosing the default editor used by Git"
there is use visual studio code thought it would be this one
😃
and yea i do speak english as my second language i mean u understand me
u dont need to act smart fam
just chose notepad and be done with it
and understand it
ight
okay bro
http://prntscr.com/mhibud which one again :d
i dont want to miss up smth
doesnt matter tbh, you can use the second option
js =/= java
i use javascript
http://prntscr.com/mhidlx explain this part plz
there are always alternatives
no i mean
but if you're using commando, just keep using the way its supposed t
to make timer bot and other commands for fun
if you're new to the language and want to understand what you're doing, its much better do not use commando
you can make your own command handler, its much simpler to understand
ok could u send me a link to a video ?
cz am trying t omake my bot better and learn js
https://www.youtube.com/watch?v=D2uvLKWt1cY&list=PLS6sInD7ThM0qwEsz_M7nx952pILYztzF&index=2 m watching this guy
Help to support the channel if you are feeling super kind: https://www.patreon.com/dapperdino Join our Discord: https://discord.gg/sn9xXK4 https://nodejs.org...
lel
he uses commando so idk
this one's a command handler based on module.exports https://anidiots.guide/first-bot/a-basic-command-handler
its still a bit advanced tho, you could start with something even simpler
like a single file bot
discord.py
I have an issue with "discord.on_reaction_remove(reaction, user)":
Parameters:
reaction – A Reaction showing the current state of the reaction.
user – A User or Member of the user who removed the reaction.
However, for me, if the bot (client) removes a reaction, the user parameter will not be the client.user but the reaction.message.author (the user who originally added the reaction).
Is this behaviour intended? And is there a way to get the user who actually removed the reaction?
@quartz kindle http://prntscr.com/mhii0a he added this do i have to add it or stick with my code that i wrote
@earnest phoenix please learn javascript properly first
before jumping into this
sololearn.com and w3schools.com are great resources, but there are some other good node.js tutorials on yt as well
there are also other resources pinned in this channel
thats a very basic example of a discord.js bot
you can start there and elaborate on it
A case switch would be less cluttered
yes but a bunch of ifs are easier to understand for beginners
True
okay
@empty steppe no idea, it seems like a bug
Well anyways gl with your coding
if anyone could send me a video of a tutorial an easy one to make my bot
:p
that dosent use commando since its hard
Just google
@quartz kindle okay, i think I will open an issue. Do you know of a way to determine if a user or the bot deleted a reaction?
I dont know of a discord.py discord, but ill check
i dont know much about discord.py but the user object should contain the user of whoever deleted the reaction
yeah then its definitely a bug, thanks!
@harsh nova okay but i was watching this guy but he uses commando apparently its advanced
so ill see someone else and ill see how to secure my thing
@earnest phoenix if you only care about securing your token:
- make a json file containing the token
- do not fucking share that file
i have never used heroku, does it work with private repos
i think no i never tried
it needs to be payed
and its expensive i think
llol
http://prntscr.com/mhioqy so i do a new json file like this ?
and i dont upload hten how its goign to work 😄
without the token
That is valid json yes
solution: dont use heroku as its dumb as fuck
ill make the github ignore the file
and it will work
give me another free hot then
host
glitch.com is free but all free hosts are shit
idc
ill just do it for now bro
if glitch is better than heroku
ok
http://prntscr.com/mhisad if i did this will people still be able to use my bot ?
???
it will make it private haha
no need to make it private
yess ty
you shouldn't ever add tokens, keys, passwords, etc to a git repo
the post literally tells you yo
ok
@earnest phoenix
- upload your bot to github, but dont upload the token file.
- upload to heroku from github
- manually add the token file to heroku, but not to github
simple enough
so i dont type the token to index.js
ok
so i remove the bot.login with the token from index.js and put it in the config.json
Is there a way to tell how many messages are there in a channel without fetching all messages?
http://prntscr.com/mhiwy2 after i added it now this error came
http://prntscr.com/mhixge i fixed the error but this is still here
json file: ```js
{
"token":"your token here"
}
index.js file: ```js
const jsonfile = require("./jsonfile.json")
client.login(jsonfile.token)
http://prntscr.com/mhiz6r i add this what u sent instead of require ?
the last one i mean
no, its just an example
just make sure you're not putting anything else in the json file besides the token
or the prefix
ok
client.login(jsonfile.token) i add this ?
isnt it supposed to be
bot.login
🤔
yea i guess
something.login()
the something is whatever you named it in something = new Discord.Client()
bot = new Discord.Client() -> bot.login()
client = new Discord.Client() -> client.login()
etc...
same with the json file
jsonfile = require(./config.json) -> jsonfile.token
config = require(./config.json) -> config.token
^ you decide what to name it
its bot then
;d
client i mean
lmao
@quartz kindle http://prntscr.com/mhj2yb like this ?
oh
the guy i watched did bot.on
so i didnt know
lol
i thought its permenant
because he did bot = new Discord...
the name you give it, is the name you have to use everywhere in the code
yes
now another thing: .sendMessage() is deprecated/outated
you should change it to .send()
ok
this guy is rly out dated
am gonna see anoter one
and i deleted the commando thing ill use another easy thing since u said for beginners
use another thing
if you focus on understanding the language, you wont need any tutorials
there is a huge documentation website for discord.js
understand the rules and you wont need anyone to show you
okay ill see
could someone tell me how to upload my token to heroku
or send me guide
doesnt heroku have an option to create/upload a new file?
amazon and google are free for 12 months
but require a credit card to create an account
no free hosts are nice
Is there a way to have a max character or 100 character? Discord.js
what do you mean
I'm trying to add a command (trumptweet) and I want users to be limited to 100characters or it will be too big.
check if the message is bigger than 100
and if it is, return an error or something
That will be messages, I know how to check that but I want characters
like "hi" = 1 word; 2characters
@earnest phoenix I'm pretty sure heroku git repos are private
If not you could always use environment variables
I think it's called config vars
its paid
In the settings
You can access them in your code with process.env.whatEverYouNamedTheConfigVar
@earnest phoenix thats what i said, check if the message is bigger than 100
message.content.length returns the size of the message, ie: the number of characters it has
👍
fam
i dont have a code for sending stuff like this
whenever i put it to heroku
it does that
lol
hmm, is the GitHub private?
Cause someone prob got ur token
👀
@earnest phoenix you already leaked your token, gg
What's the link?
then what's it on?
bro your token is fucking public on your github

reset your token
And make the GitHub private
i was testing the bot
and i forgot to change it
:d
B4 changing
please learn proper js smfh
be sure to reset your token
previous commits (including your token) are still visible
✓
who puts their token in the mainfile
can you help me with a code?
what is the code
what library?
lul
js
node
oh no
I did a charge system for reactions, but it's giving error
do you use discord.js
what's it saying for the error?
whats the code and whats the error
.?
send it here
ok
bad bot
if(message.content.startsWith('!lol'))
var embedlol = new Discord.RichEmbed()
.setColor('#11ABDD')
.setTitle("**Adicionar o Cargo de jogador do LoL**")
.setDescription("Para entrar nos canais de LoL clique nessa reação: ✅\n teste teste teste: ❌")
.setFooter("mensagem", client.user.avatarURL);
message.channel.send(embed).then(msg => {
msg.react('✅')
msg.react('❌')
const embedlol = (reaction, user) => reaction.emoji.name === `✅` && user.id === message.author.id;
const r1 = msg.createReactionCollector(embedlol, {time: 60000 });
r1.on('collect', r => {
r.remove(message.author.id);
message.member.addRole('League of Legends')
})
const embedlol2 = (reaction, user) => reaction.emoji.name === `❌` && user.id === message.author.id;
const r2 = msg.createReactionCollector(embedlol2, {time: 60000 });
r2.on('collect', r => {
r.remove(message.author.id);
message.member.addRole('League of Legends')
})
});```
it blocked me from sending the photo
@knotty steeple what is error ?
wat
wait which program for the library are you using?
visual studio code
ur missing {} around the code
where
a r o u n d t h e c o d e
Does the youtube API allow for "listening" for a new video posted so it will automatically post in a channel or should I just put it on a timer
it should
@grim aspen what can I do ?
That means I actually have to figure out how to use the api then 
Is there a charge id in discord?

um id para cargo "addrole" role
R O L E
give context
Cargo
ISSO
literally no one knows what you're on about
isso cargo
Sounds like drug dealing
-.-
stop speaking caveman
it's brazilian
i just got wooooshed didn't i?
yes
@knotty steeple i have memory hole for avatar of guild it is : guild.avatarURL ?
i would like that you dont randomly ping me
xuse me guy
In the following js function I want to check that in all the comianations it produces it has to contain "a" for exsample ```js
let array = ["a", "b", "c", "d", "e", "f", "g"];
function getCombinations(input) {
var result = [];
var f = function(prefix, input) {
for (var i = 0; i < input.length; i++) {
result.push(prefix + input[i]);
f(prefix + input[i], input.slice(i + 1));
}
}
f('', input);
return result;
}
var combo = getCombinations(array);
So I am trying to use patreon to allow users that have bought the subscription to use patron only commands. I have been told I need a webserver in my bot. Anything else I need to know
I think they meant that you need a database, not a web server. @earnest phoenix
Well I have a Database
Ok...
I just dont know how to get the user id and stuff into the bot whenever they purchase it
You mean you don't know how to use a database?
no
I don't know how to make patreon write the users info whenever they buy the patron thing
it would be a pull not a push unless you are using webhooks
so you would have to request it
you want all possible combinations with all possible lengths?
from a until ggggggg?
you can use patreon webhooks
as long as the users link discord with patreon you can get their id
@quartz kindle basicly but like i think i said i want it to require "a" in each possibility
should the "a" be hardcoded or a parameter?
it should be a parameter containing "a"
hmm alright let me think
ok thank you
I need help making so that the bot grabs a random guild from the list of joined guilds.
then returning the name or logs it in the console so I can further develop the feature
what is that feature
send a paper plane to a random server
like those weird apps you find on the app/play store
could be interesting /shrug
paper plane?
explain what it actually does
and do you have explicit permission to do so
would the users name be attached, or is it anonymous
like?
permissions, api tos agreement, channels
for channels, just find one with the name general or bot-commands, if they're not found. send it to the first channel
also, what api tos
found it
what if that first channel is #announcements or #rules-and-info in another channel
you'll annoy users and defeat your bots purpose
hm
maybe a set command for a specific channel
client.on("guildJoin or whatever") {
await message. channel. send("Thanks for inviting me. First, we need to setup some stuff. where would you like to receive paperplanes?")
collect the channel
save it somehow
then done
thats got issues of its own
hm?
just add a setup command that can be run
o
on join>message("Thanks for inviting me! to make this bot run properly on your server, please execute the -setup command.")
ok
just put it in your help command
you can send a message on join
those are a pain though natan
you not liking them != them not being allowed/possible
@formal agate that was an interesting challenge
var param = "a";
var array = ["a","b","c","e","f"];
function getCombinations(a,p) {
let res = [];
let test = new Array(a.length).fill(a[0])
function loop() {
if(test.includes(p)) { res.push(test.join()); }
for(l = 0; l < a.length; l++) {
let i = a.indexOf(test[l]);
if(i++ === a.length-1) {
if(l === a.length-1) { return }
i = 0;
test[l] = a[i];
} else {
test[l] = a[i];
break;
}
}
loop();
}
loop()
return res;
}
getCombinations(array,param)```
well thank you because i had no idea on how to do it
you saved the day again @quartz kindle
its not something easy to do, specially if you need to consider arbitrary lengths and values in it
also, there's probably a gazillion ways to do it
what is that supposed to do?
^
im using it for user flags
to determine what hype squad house people are in
wait what
because f the userflags
use the bitwise ops
