#development
1 messages · Page 349 of 1
guildCreate is when the bot joins a new server
@quiet bobcat ```js
const guilds = bot.guilds.map(x => x.name).join('\n');
@wise nexus yes I know
ok
.send() works with bot.channels.get('id')
but it still the same
client.on('guildMemberAdd', member => {
let guild = member.guild;
client.channels.get('383355658705305620').send(`Please welcome ${member.user.username} to the server!`);
});```
thats the coding i have
for discord.js?
{
"name": "BotTuber",
"version": "0.0.1",
"description": "Bot by GurTuber",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "GurTuber",
"license": "MIT",
"dependencies": {
"chalk": "^2.3.0",
"discord.js": "^10.0.1",
"return-deep-diff": "^0.2.7"
}
}
here is all the info
Upgrade your Discord.js
"discord.js": "^11.2.1"
It's a different version
that's why
use 11.2.1
use the js docs for discord js
how do i upgrade it?
and the anidiotsguild // cant spell
@elfin depot ```json
"discord.js": "^11.2.1"
k
edit the package.json
@vital lark any way to get member count aswell?
https://anidiots.guide/ @elfin depot
It worked btw, thanks
should the code work now
it should work now @vital lark
@elfin depot yes
k
ok
hey
client.on("guildMemberAdd", (member) => {
const guild = member.guild;
newUsers.set(member.id, member.user);
if (newUsers.size > 10) {
const defaultChannel = guild.channels.find(c=> c.permissionsFor(guild.me).has("SEND_MESSAGES"));
const userlist = newUsers.map(u => u.toString()).join(" ");
defaultChannel.send("Welcome our new users!\n" + userlist);
newUsers.clear();
}
});```
ReferenceError: newUsers isn't defined
let me see your code
thats from the guide
client.on('guildMemberAdd', member => {
let guild = member.guild;
client.channels.get('383355658705305620').send(`Please welcome ${member.user.username} to the server!`);
});
client.on('guildMemberRemove', member => {
let guild = member.guild;
client.channels.get('383355658705305620').send(`Please say goodbye to ${member.user.username} we will miss you!`);
});```
there
im gonna eat
use another bot
i'm making a collab on a new discord.js bot, someone wanna join?
@earnest phoenix no
Wait @vital lark how do I make that into the guild list?
@quiet bobcat Never tried
ok, you don't
ok
I'm gonna do JDA for now on.
@vital lark so whats wrong
Don't know
@earnest phoenix no
ok
I don't know what to do now..
CS1503 Argument 1: cannot convert from 'System.Reflection.Assembly' to 'System.Type' [SHIBE] C:\Users\Void Omni Breaker\source\repos\[SHIBE]\[SHIBE]\Program.cs 49 Active
It's for await _commands.AddModuleAsync(Assembly.GetEntryAssembly());
and its to process a task but it won't convert and now I am confused
let src = `2 8 8 5 4 2 3 1 5 5 1 2 15 13 5 14`;
let cycles = 0;
const banks = src.split(' ').map(Number);
const passed = [];
while (true) {
let biggestBank = 0;
for (const bank of banks) {
if (bank > biggestBank) {
biggestBank = bank;
}
}
let startIndex = banks.indexOf(biggestBank);
banks[startIndex] = 0;
startIndex = startIndex + 1;
for (let i = 0; biggestBank > 0; biggestBank--) {
if (startIndex >= banks.length) {
startIndex = 0;
}
banks[startIndex]++;
startIndex++;
}
cycles++;
let FuckJavaScript;
for (const arr of passed) {
if (arr.every((e, i) => e === banks[i])) {
FuckJavaScript = true;
break;
}
}
if (FuckJavaScript) {
break;
} else {
const copy = [];
banks.map(r => copy.push(r));
passed.push(copy);
}
}
console.log(cycles);
val v = ({
var streamA: Stream[((Int, Int), (Int, Int), Set[(Int, Int)])] = null
streamA = ((0, 0), (0, -1), Set((0, 0))) #:: streamA.map(e => {
val (position, direction, set) = e
val turn = direction match {
case (1, 0) => (0, 1)
case (0, 1) => (-1, 0)
case (-1, 0) => (0, -1)
case (0, -1) => (1, 0)
}
if(set.contains((position._1 + turn._1, position._2 + turn._2)))
((position._1 + direction._1, position._2 + direction._2), direction, set + ((position._1 + direction._1, position._2 + direction._2)))
else
((position._1 + turn._1, position._2 + turn._2), turn, set + ((position._1 + turn._1, position._2 + turn._2)))
})
streamA
})(n-1)._1.productIterator.map(_.asInstanceOf[Int].abs).sum```day 3 part 1
wew
day 3 took ~5s here
man I didn't even fucking try day 3
f
6 took me the longest so far because JS is a fucking meme /tableflip
lmao, rip
I don't understand day 6 part 2 🤔
aren't they asking you to literally just re-run it 🤔
this one is gonna be hard to one line thonk
2 line would be ez
but i can't modify the array unless i
👀
okay i'll do an ugly hack
and 99% of the people will kill me
Seq(string.split("\n").map(_.toInt)).map(myArrayThatICanAccessNow=>{
solve it here
})```

[getTheArray].map(array=>{
})```
^ js equivalent
@uncut slate cancercode for one lining
hmmmmmmmmmmm
I'm not even worrying about good / impressive code tbh
just trying to get the solutions in the first place, lul
day 6 pt 2 is ez tbh
explanation is confusing
GG
val v = Seq(string.split("\n").map(_.trim).filter(_ != "").map(_.toInt)).map(array=>{
var count = 0
var index = 0
while(index >= 0 && index < array.length) {
val off = array(index)
array(index) += 1
count += 1
index += off
}
count
}).head
println(v)```
i
fucking
did
it
one lined again
hot damn
val v2 = Seq(string.split("\n").map(_.trim).filter(_ != "").map(_.toInt)).map(array=>{
var count = 0
var index = 0
while(index >= 0 && index < array.length) {
val off = array(index)
array(index) += (if(off >= 3) -1 else 1)
count += 1
index += off
}
count
}).head
println(v2)```day 5 part 2
var count = 0
day 6 part 1
Why are you guys doing this day thing
val v = Seq(string.split("\\s").map(_.toInt).toSeq).map(new ArrayBuffer()++_).map(seq=>{
val set = new mutable.HashSet[Seq[Int]]()
var count = 0
while(!set.contains(seq)) {
var max = seq.max
val idx = seq.indexOf(max)
set += seq.clone()
seq(idx) = 0
var i = (idx + 1) % seq.size
while(max > 0) {
seq(i) += 1
i = (i + 1) % seq.size
max -= 1
}
count += 1
}
count
}).head```day 6 part 1
val v2 = Seq(string.split("\\s").map(_.toInt).toSeq).map(new ArrayBuffer()++_).map(seq=>{
val set = new mutable.HashMap[Seq[Int], Int]()
var count = 0
while(!set.contains(seq)) {
var max = seq.max
val idx = seq.indexOf(max)
set += seq.clone()->count
seq(idx) = 0
var i = (idx + 1) % seq.size
while(max > 0) {
seq(i) += 1
i = (i + 1) % seq.size
max -= 1
}
count += 1
}
count - set(seq)
}).head
println(v2)```day 6 part 2
static void TryCreateTable()
{
using (SqlConnection con = new SqlConnection(
ConsoleApplication1.Properties.Settings.Default.masterConnectionString))
{
con.Open();
try
{
using (SqlCommand command = new SqlCommand(
"CREATE TABLE Dogs1 (Weight INT, Name TEXT, Breed TEXT)", con))
{
command.ExecuteNonQuery();
}
}
catch
{
Console.WriteLine("Table not created.");
}
}
}```
hmmmm
static void AddDog(int weight, string name, string breed)
{
using (SqlConnection con = new SqlConnection(
ConsoleApplication1.Properties.Settings.Default.masterConnectionString))
{
con.Open();
try
{
using (SqlCommand command = new SqlCommand(
"INSERT INTO Dogs1 VALUES(@Weight, @Name, @Breed)", con))
{
command.Parameters.Add(new SqlParameter("Weight", weight));
command.Parameters.Add(new SqlParameter("Name", name));
command.Parameters.Add(new SqlParameter("Breed", breed));
command.ExecuteNonQuery();
}
}
catch
{
Console.WriteLine("Count not insert.");
}
}
}```
public class Dog
{
public int Weight { get; set; }
public string Name { get; set; }
public string Breed { get; set; }
public override string ToString()
{
return string.Format("Weight: {0}, Name: {1}, Breed: {2}",
Weight, Name, Breed);
}
}```
did i do it right?
why not slowly fade it to yellow and have you know who there XD
its litterally mee6 but patric star
more cancer and less features 
^
Succ a ducc
Why do you want Ken demoted?
He succs
ok
Ken is the best mod fuck off
@low niche in c# how can i send a message to a certain channel?
Wew
hi how do i make my bot react to a specific message it sends in a channel
message.channel.send("dsadsadsa").then(e => e.react("THEFUCKINGUNICODE"))
@neat falcon
That is d.js
how to add it into my embed?
message.channel.send({embed: dhsajdhksahdsa}).then(e => e.react("THEFUCKINGUNICODE"))
message.channel.send({embed: dhsajdhksahdsa}).then(e => e.react("THEFUCKINGUNICODE"))
how do i react more than one emoji?
Add more e.reacts() @neat falcon
so message.channel.send({embed: dhsajdhksahdsa}).then(e => e.react("THEFUCKINGUNICODE") e.react("owo"))
?
No

message.channel.send({embed: dhsajdhksahdsa}).then(e =>{ e.react("THEFUCKINGUNICODE") e.react("THEUNICODEAGAIN") })
@earnest phoenix Mee6 2.0?
If it's about the thing you asked before I do know how to only send messages in specific channels I do know how to do that but in the way I do it you have to manually add the server and what's send in the code
No i was going to ask something else lmao
How can the bot
find the channel id
and send a message xD
i can figure out the rest
But thats what im needing to figure out
Hmm you mean send a message in a channel with a certain ID? I'm pretty sure ik how to get the channel's ID but how to send a message to it
¯_(ツ)_/¯
Do you know js?
Nope
Well I don't know any exect stuff out of my head so I'll have to start up my server to take a look
Wew
ok I give up, dafuq is this shit https://jeff-kaplan.needs-to-stop-following.me/2e4a7f.png
nothing, in the whole project has that goddamn version
nothing, in the whole project has that goddamn version
everything is set to 1.8
also, not any time soon kek
I'm still pretty bad at jda
and java in general
gitGud™
we had java in school last year, and this year we're taking the AP exam xdddddddddddddddddd
mfw eclipse runs it perfectly fine
smfh
[Command("channelid")]
public async Task ChannelID(ITextChannel channel = null)
{
var ch = channel ?? (ITextChannel)Context.Channel;
if (ch == null)
return;
var embed = new EmbedBuilder()
.WithTitle(ch.Name)
.WithDescription(ch.Topic?.SanitizeMentions())
.AddField(fb => fb.WithName(GetText("id")).WithValue(ch.Id.ToString()).WithIsInline(true));
await Context.Channel.EmbedAsync(embed);
}
@sinful meadow is how you get the current channel's ID
i can easy get that
ok me am smart and found the trash error yes
I'm trying to send a message with the guild owners name and I use this code message.channel.send(message.guild.owner); but I get this error javascript (node:6164) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send an empty message
Np
guild.owner is an object, objects can't be sent
Ok
objects can be sent 🤔
hi
Is a bot with 10 sec downtime/day eligible for certification?
@neon pasture website inspired by mee6
it says it on the button but i guess the screenshot 2 small
It's almost the same boi
ik
you give atleast credits, didn't saw that.
Is there any way to remove this? https://gyazo.com/3cddb7336420fc8cc728bf49f87b9c24
This is the code javascript message.guild.createdAt
why
DISCORD IS MY CITY
Yes
new logging system, create tables based on userid, i think its nice
now who can help me get the colums?
@wise nexus is the data encrypted
no
1 sec
@wise nexus
Dont remember which one it is but its inbetween 2.1 and 2.7 https://discordapp.com/developers/docs/legal
Found it @wise nexus
Np
@uncut slate day 10 solved scala val v = Seq(string.split(",").map(_.toInt)).map(array=>{ val list = (0 to 255).toBuffer var pos = 0 var skipSize = 0 array.foreach(length=>{ val v = list ++ list var i = pos v.slice(pos, pos + length).reverseIterator.foreach(element=>{ if(i >= list.size) i = 0 list(i) = element i += 1 }) pos = (pos + length + skipSize) % list.size skipSize += 1 }) (list.head, list(1)) }).head.productIterator.map(_.asInstanceOf[Int]).product
i'm going to put in a repo by itself day 10's algorithm
for the lulz
let's hash all our important stuff with knothash!!!11!1!11
@fervent goblet Advent of Code, you don't know it? Where have you been.
lol
reee
let g = message.guild.members.random()
g.send("Lol")
Is there any way to remove this? https://gyazo.com/3cddb7336420fc8cc728bf49f87b9c24
This is the code
message.guild.createdAt
I mean the (W. Europe Standard Time)
just parse it out of the thingy?
@earnest phoenix https://github.com/natanbc/AoC-2017/blob/master/src/main/scala/com/github/natanbc/aoc/Day9.scala
sql.run(`DELETE FROM queues WHERE rowid = (SELECT rowid FROM queues WHERE guild = "${msg.channel.guild.id}" LIMIT 1)`);
sql.get(`SELECT * FROM queues WHERE guild = "${msg.channel.guild.id}" LIMIT 1`).then(endRow => {
var stream2 = ytdl(endRow.link, { filter: 'audioonly' });
connection.play(stream2);
});
});```
I get the error that .link is undefined. But I did define it or not?
Never mind, I didn't reloaded my bot. #JeffreyIsNoob.
nothing wrong?
But there is 0 ping
that is not supposed to happen
I don't think it is even possible
How can I get rid of that? The code is message.guild.createdAt
replace it
ok
Can somone help me pls?
yes?
Hi
Hi.
I want to say i want upload my bot in Github
i try that yesterday and i go ddos my wifi was of
sry my english is bad hope you still understand me
IF I understand you correctly, you want to upload your bot's source code on github?
Make a github account, make a new repository, create all the files that are needed (example: index.js) and you're done
i am scared upload this in Github
i creat now account and more
do you have Teamviewer?
nope
type in what are you interested in
name it whatever you want
then create the files
btw, what lib and language are you coding this in?
No, the coding language, java/javascript/etc.
js
what library? discord.js?
i think ye
Which Discription means that? Bot Discription
ok now create the files you have
Now whatever that main file is and the package.json
aswell as don't forget to delete your token
i have Sublime 3
what ever your coding software is, copy index.js's code and name the github file index.js aswell
then paste the code
yes
ah ok
but remove the bot.login(<yourtoken>); part
w8...
@pearl schooner delete that last image....
ok
It fucking includes your bot token ;p
yes
Now copy all and paste
yes
k
aswell as the package.json and other stuff
and name the file index.js
commit new file and you're done greate then do the same for package.json
Should i do the same again?
but the files name is then package.json?
sry if don't understand ;---;
ehm wait
to speed this up, you should use sublime to push all your files in
i have Sublime 3
also don't put your token in your main bot file tbh
yes i remove it
you could use a text file and .gitignore it
yesterday i put and next 3 mins i got ddos
f
oof
You guys more helpful then other servers
yeah we try our best
😉
What i need more?
I am scared thats why i ask always cuz yesterday wifi ddos i don't wanna get today too
you see in your bot
you have dependencies
discord.js, etc
package.json file manages that all
yeah
who can help me with sequelize
What kind of bot does graphic designs and Server designs?


???
none
a bot that does graphics designs? impossible
@tawdry rock I can help setup a server though
DM me @fervent goblet
lol
l0l
if (!msg.guild)
return msg.say('You must be in a guild to use this command');
if (!msg.member.voiceChanne) {
return msg.say('You must be in a voice channel to use this command, silly');
}
if (!msg.member.voiceChannel.joinable)
return msg.say('I cannot join the voice channe you are in because of the permissions settings for me, to have me join please make sure I have the permissions to join :(');
if(msg.member.voiceChannel){
msg.member.voiceChannel.join().then(connection => {
const stream = yt(url, {audioonly: true});
yt.getInfo(user, function(err, info) {
let title = info.title;
msg.say(`I am now playing, ${title}`)
})
const dispatcher = connection.playStream(stream);
dispatcher.on('end', () => {
msg.member.voiceChannel.leave();
}).catch(e => {
console.error(e);
})
});
}``` This keeps spitting out a error ```
});
^
SyntaxError: Unexpected token )
``` when its there, wtf
don't know and don't care
🤔
@weak parrot you should know this
but how can i grab or log all the messages into the console on c#?
That should be easy
You mean like commands that are used?
No
Wait which messages?
Like any
that someone types in chat
for example
SHIT
and that would log in the console
Like all messages
Wait why the hell would you want to log all messages into a console?
await Context.Channel.GetMessagesAsync(cnt).ForEachAsync(dled => msgs.AddRange(dled))```
Wew
wait you might know this @stone kiln
why doesnt this work
var channelName = Client.GetChannel(385971556393811969);
channelName.SendMessage();
Doesnt work?
hmmm
why doesnt that work?
saem
You can also check with if for the channel name and then only make it able to send a message in that one channel but idk if that would work with your current method
public async Task Send(string where, [Remainder] string msg = null)
{
if (string.IsNullOrWhiteSpace(msg))
return;
var ids = where.Split('|');
if (ids.Length != 2)
return;
var sid = ulong.Parse(ids[0]);
var server = _client.Guilds.FirstOrDefault(s => s.Id == sid);
if (server == null)
return;
if (ids[1].ToUpperInvariant().StartsWith("C:"))
{
var cid = ulong.Parse(ids[1].Substring(2));
var ch = server.TextChannels.FirstOrDefault(c => c.Id == cid);
if (ch == null)
{
return;
}
await ch.SendMessageAsync(msg).ConfigureAwait(false);
}
else if (ids[1].ToUpperInvariant().StartsWith("U:"))
{
var uid = ulong.Parse(ids[1].Substring(2));
var user = server.Users.FirstOrDefault(u => u.Id == uid);
if (user == null)
{
return;
}
await user.SendMessageAsync(msg).ConfigureAwait(false);
}
else
{
await ReplyErrorLocalized("invalid_format").ConfigureAwait(false);
return;
}
await ReplyConfirmLocalized("message_sent").ConfigureAwait(false);
}```
is a better way to do that
¯_(ツ)_/¯
To me it never matters how big it is as long as it works 😏
var cid = ulong.Parse(ids[1].Substring(2));
var ch = server.TextChannels.FirstOrDefault(c => c.Id == cid);
if (ch == null)
{
return;
}
await ch.SendMessageAsync(msg).ConfigureAwait(false);```
@sinful meadow try that
if (Context.Guild.Name == "Name")
if (Context.Channel.Name == "channel")
{
await ReplyAsync("nose long like garden hose");
}
Is how I always do it
¯_(ツ)_/¯
lol
@sinful meadow do this to define server
var sid = ulong.Parse(ids[0]);
var server = _client.Guilds.FirstOrDefault(s => s.Id == sid);
Ill let ya know if it works
👌
AYYYYYY thanks mate @stone kiln
np
takes the first arg you put after the initial command
well and then the first server it can find with that id
Yea
sorry used to using that
@stone kiln this is what im working on
Now i just need to get the id
of my thing 😛
1 sec
😛
sql.run(`DELETE FROM queues WHERE rowid = (SELECT rowid FROM queues WHERE guild = "${msg.channel.guild.id}" LIMIT 1)`);
sql.get(`SELECT * FROM queues WHERE guild = "${msg.channel.guild.id}" LIMIT 1`).then(endRow => {
if (endRow === undefined) {
return;
}
var stream2 = ytdl(endRow.link, { filter: 'audioonly' });
connection.play(stream2);
bot.createMessage(msg.channel.id, {
embed: {
color: 0x2a62c9,
fields: [
{
name: `:notes: Now Playing!`,
value: `**${endRow.title}**\nAdded by: **${endRow.person}** / Length: **${(endRow.length / 60).toFixed(2).replace(".", ":")}**`
}
]
}
}).then((message)=> {
setTimeout(function(){
bot.deleteMessage(msg.channel.id, message.id);
}, 60000);
});
});
});```
why is this looping?
setTimeout 
👀
I asked for help, not for shots in my face.
i think it's because of the setTimeout feature not ending properly XD
to check something inside the database
because on message setTimeout
it does.
It will go like a i++
^
eww.
lmfao
so I need to block it then
¯_(ツ)_/¯
cooldown is better then timeout
@stone kiln could you help me make my control panel thing lmao
Timeout is just to delete the message after 1 minute @stone kiln
why do that
when you can do
message.channel.send("e").then(e => e.delete(60000))
Kappa
^
boi
way easier XD
hahahhahahahah
those tips, thanks
Np
a control panel in C#
Yea @stone kiln
I don't know why I ever got 8K guilds boi, when i'm so noob
xDDDDDD
Lol
int x = 4;
int y = 4;
foreach(PhysicianData pd in listPhysicians)
{
x = 4;
y = panPhysicians.Controls.Count * 30;
RadioButton rb = new RadioButton();
rb.CheckedChanged += new System.EventHandler(rbPhysician_CheckedChanged);
rb.Text = pd.name;
rb.Visible = true;
rb.Location = new Point(x, y);
rb.Height = 40;
rb.Width = 200;
rb.BackColor = SystemColors.Control;
rb.ForeColor = Color.Black;
rb.Font = new Font("Microsoft Sans Serif", 10);
rb.Show();
rb.Name = "rb" + panPhysicians.Controls.Count;
panPhysicians.Controls.Add(rb);
}
XD
tf is dat
;p
It still fucking loops... going to use json then.
~facepalms~
Its not just that easy lmao @fervent goblet
i want to find the server
and get the id
xD
xD
will talk later have to work
Alright
lel
Zythorox 2.0 in Java™
kappa
[Command("list guild ids")]
public async Task GuildIDS(int page = 1)
{
page -= 1;
if (page < 0)
return;
var guilds = await Task.Run(() => _client.Guilds.OrderBy(g => g.Name).Skip((page) * 15).Take(15)).ConfigureAwait(false);
await Context.Channel.EmbedAsync(guilds.Aggregate(new EmbedBuilder().WithOkColor(),
(embed, g) => embed.AddField(efb => efb.WithName(g.Name).WithValue((g.Id)).WithIsInline(false)))).ConfigureAwait(false);
}
@sinful meadow
However using pages is hard when in a lot of servers xD
can some one help me out? I wanna make a command like @(name) prefix or only a mention
discord.js
Okey thx for your time
because js is ez for noobs
haha I have no idea
try looking in the documentation
@pearl schooner http://lizardsuc.cf/google
also
if you want something active 24/7
you wont find a free VPS

uhm
heroku works
Flytix I can host it for you but not for free ofc
and I'm pretty sure heroku isn't 24/7
it goes off when there has been any activity for the last 30 or so minutes
lol
Aswell as there's a 550 hour limit per month unless you add a credit card to your account
Hey guys! Do you know why lavplayer throws this exception when I try to load video from youtube?
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: This video is unavailable.
Means the video is unavailable, as the error says
some1
ok so like
client.on('message', message => {
if (message.content === 'ping'){
msg.reply(:ping_pong: Pong!\n***Time: ${client.ping} ms***);
}
};
i need to fix
right so client.on() is a function that takes a string and a function
I saw the error in you code.
The picture you sent showed an extra ')' after client.on('ready')
you've passed it a string and function but you didn't close the parentheses?
they're... not going to learn anything if you just give them a mechanical answer
Why would i copy from the site?
because then you did not have these mistakes, and that saved you a few minutes
No ) after 'ready'.
kid.
how do you know my age?
why are you even a consultant
You can not guess someones age just because of how they type or what they do or do not know.
all you do is insult people and tell them to copy-paste solutions
It's just that someone is telling him that already for 4 times.
And the only thing he says, I got this error. and don't even read.
I'm sorry I don't always understand stuff like you
we tell you, and you don't read. that's the problem.
when someone (@native palm) is helping you, just listen to him.
You pinged me... How dare you?
make a screenshot
you have to save it.
now it works
cool
the question is whether or not you understand why it didn't work before and why it works now
thank you for insulting me on not knowing how to read.
I understand
The xtra ( was the problem
or )
last one
Good. Good. Seems like you learned from this ordeal.
well, yeah the problem is that you had an extra closing parentheses
but there must have been a reason you put it there in the first place
and it's misunderstandings of the syntax like that that are important to iron out
oh
you've named your variable "message" but referred to it as "msg" lol
my bad
it's message.reply.
also, consider installing the js linting plugin for vscode
it'll catch problems like that while you're programming
No ing, iirc.
I think the plugin's just called eslint?
yeah probably
yup
How can I add a permission in the permission tab of a channel?
I'm using discord.js
It doesn't say there?
if(message.member.permissions.has('SEND_MESSAGES'))
stoopid https://i.imgur.com/PKaG9e3.png
see ur error now?
wait
holy shit
my discord lagged hard
oof
oof indeed
been playing with electron
its pretty neet
bootstrap is terrifying on the map https://i.imgur.com/ZH2fNhA.png
ahhahahhaahahh
I has a question
How would I stop a setInterval function after a set amount of time
Is there any straightforward way to use colored text in embeds?
So uh
Is there any way to do it? I know i've seen bots used colored text in embeds
odds are you've seen bots either embed an image of coloured text
or you're talking about blue link text
oh that' s a code block
what you're seeing is syntax highlighting for diff
+This text is green
-This text is red
How would I use a forEach statement?
For example
I want to get a list of all users in a server
How would I do that?
You need to use fs.
fs.readdir(path, (err, files) => {
if (err) throw new Error;
files.forEach((f) => {
// code
});
});```
??????
fs module
Why would I need dat tho
ommg
Nonono I get what your saying
Well
If I was to use forEach
How would?
my discord is behind af
const arr = ['a', 'b', 'c'];
arr.forEach(function(element) {
console.log(element);
});
// a
// b
// c
I got this off the MDN
why not use map
It doesnt look at all like what you showed me ._.
@earnest phoenix Im talking as an example
Im not making a command dat gets all users in a server
ohohoh examples ok
What im trying to do is get all mentioned users in a message(I know how to do that) and do something to each of them
madness
like
get all mentioned users in a single msg?
Well I know how to do that
But like do a function to each
not clear what you are trying to do
oh
Which would require a forEach statement
not necissarily
?
if you split the args into an array slice 1 off the front (your execute cmd) and then for blank in blank u could achieve that
like um
I've done that
why does this not work then?
Because I dont know how to use forEach statements ._.
here
let array = []; //obv input an argument array with all the mentions
array.map((mention)=>{
//mention is the item in array execute function here
})
do you want to use foreach?
i recommend map
obv
forEach would be preferrable
Just so I know how to use it in the future
why
oh
ok
let array = []; //obv input an argument array with all the mentions
array.forEach((mention)=>{
//mention is the item and execute a func on it in here
})
i would seriously recommend map instead though if u can
Okaayy
Wait
So is mention left alone?
?

lmao
im guna map the usernames on a bot of mine with 40k + users
👀
.map > .forEach > for @earnest phoenix
.map pretty much is written same exact way as foreach
but is better
doesnt map only work with maps and collections 👀 nvm i googled it
and arrays
lol
How would-
?
Okay, how would I reference the user in the function
wha
That the thing would be done to
in foreach?
Yes
let array = []; //obv input an argument array with all the mentions
array.map((mention)=>{
//mention is the item in array execute function here
})
?
like um
you want to mention each user in that array?
what are you asking for exactly?
A method
let array = [] //input an argument array of mentions
array.forEach((user)=>{
console.log(user)
})
user would be t he current item in the array
Ahhhh okay

its an array full of mentions
let mentionedusers = [message.mentions.members]
and if he wants the user object
thats not a tutorial on how to get mentions.
sassy
mentions return as a collection i believe
you can grab members / users / roles etc from the mentions
so if you want every member, if you use a foreach or .map() you will get a member object for every mention
ya
Lemme try it
bored af rn
thinking about getting into electron ect
Its not a function
._.
Okay hold on
well not into electron
mentionedusers.forEach((member) => {
moreso into react
wa
let mentionedusers = [message.mentions.members]
Okay
message.mentions.members returns a collection
why do you need to turn it into an array? 
you can use .forEach on the collection 
ded
OHHH
ass
Wait
So member.method
what
mentionedusers.forEach((member) => {
Hello... I have a question. What level of programming experience would you say is needed to create a discord bot?
https://discord.js.org/#/docs/main/stable/class/Collection
http://lizardsuc.cf/26ef—323
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
http://lizardsuc.cf/ab87—324
none to lots
@long moon Basic javascript understanding
i started programming with scripts like reddit bots ect
its a great way to learn as you a having fun
ect
Basic understanding of any programming language will do fine, as long as you know how to read & google
:^)
pretty much
if you know how to read docs you can do any language and any li brary
Cool. I have been programming for many years in C# and Java.
Java:
https://github.com/DV8FromTheWorld/JDA
C#:
https://github.com/suicvne/DiscordSharp
https://github.com/RogueException/Discord.Net
JDA - Java wrapper for the popular chat & VOIP service: Discord https://discordapp.com
Discord.Net - An unofficial .Net wrapper for the Discord API (http://discordapp.com)
its really not
node.js is only scratching the surface
ik :(
i just like to be enthusiastic
about the wounders of javascript paired with tools like react, electron, ect ect
YES IT WORKED
Because I started with C# and felt that it would be fine to figure out the logic of programming before trying to learn new languages. My father (also a programmer) says that C# is very versatile and powerful.
C# is a wonderful platform to learn on
^
i actually started off with javascript and learned C# pretty fast
Java is so similar to C# in a lot of ways
i learnt Java FROM C#
its interesting
i was thinking about picking up c# or java
a lot of the concept is the same
im at a divide rn
just slightly different in a lotta ways
Java is more widely supported
C# works best on windows only
in my experience
either delve into advanced node using things such as handlebars, express, and the whole mean stack, or go into c# or java
Yea, my father said that they were similar. I was already really good with C# and picked up java to try and make an Minecraft mod for fun and I barely noticed a difference.
yeah its pretty neat
what do you think moonbot
Plus, modding for Minecraft has taught me a lot about server-client interaction and events.
:/
Ive learnt a lot 
you dont have to stop with one area of programming
I've got a fair knowledge of PHP even
if i get into express, handlebars, react, electron, sockets, and blah b lah blah it would be better
i actually used to make huge PHP templates
since knowing a language super well > knowing many ok ish
hello yes if anybody's used discordinjections before, tengo una pregunta
?
is there a way to load local assets from a plugin's stylesheet?
Two quick questions. What library would you reccomend (one with the most versatility), and any advice on the prefix?
what language
prefix's are often . or ! ect so make yours semi unique so you dont share one with another bot
so like
dont do ! / . / / / ? / - as a prefix
Alright. Thanks!
honestly if you're trying out Java
i suggest JDA
thats the only java one i sent over
as for C#
someone needs to make a jsfuck library
http://www.jsfuck.com/ someone make a library for this and i will write my entire bot in it
So... can you do it without a library? It would just be from scratch?
lol just copy and paste the eris library in it and convert the whole think hah
or have the interpreter interprit it back to javascript and send it to eris
you: *uses an existing js library*
me, an intellectual: *runs a C library through emscripten*
if you're an experienced coder you could do it 100% from scratch and skip the API wrappers
heh
Hmmm... Ill just pick one from here (https://discordapi.com/unofficial/comparison.html). Im not gonna be doing too much yet. 😛
Yes, good idea
And I am pretty experienced. I have written the engine for a text based game.... Just the engine. None of the content. xD
but.... what
nicee
Well, I look forward to seeing your bot in the queue :^)
We will see how it goes. 😄
Can I change the prefix later on?
https://i.imgur.com/DdvMlNW.png what even is this
of course
its a string, its 100% changable
you could make an external config etc
i mean a lot of people store "per-server" prefixes in a database
yea just import a json file that contains token and prefix
also > that is my old homepage lmao
oml

