#development

1 messages Β· Page 338 of 1

ornate shadow
#

you do realize that I'm using ppl's ID from a SQL database that may or may not be in the respective server, right?

earnest phoenix
#

I did not realise that

#

Okay throw my idea out the window then XD

ornate shadow
#

I don't need to mention them. I need their user

#

so I can get their usernames and tags

earnest phoenix
#

Which part

#

Theres message.author

#

That gets the user

trim steppe
#

hmm

#

there's Promise.all

earnest phoenix
#

Then use a mehtod after it

trim steppe
#

ill try and bodge something for you

ornate shadow
#

ok πŸ˜„

earnest phoenix
#

Lol hes so happy

ornate shadow
#

well, soldier, that only works for getting the author user

#

it's not much use

earnest phoenix
#

"Finally, after a week, I can code my bot!"

ornate shadow
#

again, I need to...

trim steppe
#
Promise.all(rows.map((item) => {
    return bot.fetchUser(item.user_id).then((user) => {
        embed.addField(`${item.rank}. ${user.username} (${user.tag})`, `Level: ${item.level} (${item.xp}/${item.xp_required} XP)`);
    });
})).then(() => {
    message.channel.send(embed);
});
#

eh

ornate shadow
#

SELECT * FROM chat_leveling_system WHERE guild_id = ${message.guild.id} AND rank BETWEEN ${args[1] * 10 - 9} AND ${args[1] * 10} ORDER BY rank

trim steppe
#

i bodged this

#

but i don't know if it works

ornate shadow
#

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

trim steppe
#

if it doesn't work, don't blame me

ornate shadow
#

I won't

#

I will always blame myself for not knowing how to fix my own shit in the first place

earnest phoenix
#

Lol most of the javascript im learning is stuff I self taught myself

#

Aka variables

#

Methods are chill though

ornate shadow
#

this guy is killing me

earnest phoenix
#

XD

#

At least im not using commando for my bot anymore

#

That was what I call the "Dark Ages of my coding"

jagged plume
#

ur still using discord.js

earnest phoenix
#

The horrors

#

Ik

ornate shadow
#

but but

#

I'm using discord.js aswell

earnest phoenix
#

Yes

ornate shadow
#

is that bad?

earnest phoenix
#

πŸ‘

jagged plume
#

kek i was memeing

earnest phoenix
#

No

#

D.js is lit

jagged plume
#

i beg to differ

earnest phoenix
#

.

ornate shadow
#

I just suck at js

#

😐

earnest phoenix
#

Saammeee

#

Its why I took a coding course

#

Boi

ornate shadow
#

boiiiiiiiiiiiii

earnest phoenix
#

BOOOIIIII

ornate shadow
#

@trim steppe I'm gonna save that piece of code somewhere in my computer and try it some other time since it's 3:31 AM right now. I've been bothered by this for too long... I need rest... thanks for the nicely done code specially made for me! ^_^

earnest phoenix
#

Can someone help me with

(node:12285) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Util.escapeMarkdown is not a function
#

But before it said

ornate shadow
#

try adding brackets

earnest phoenix
#
(node:12255) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12): ReferenceError: Util is not defined
ornate shadow
#

()

earnest phoenix
#

AH HA HA!

#

So thats how variables work

#

πŸ‘

jagged plume
#

The utils in discord.js are available in the main class

ornate shadow
#

I have no idea

trim steppe
#

Util isn't defined

#

what are you trying to use?

#

oh wait

earnest phoenix
#

Making a music bot. With the help of my friend.

ornate shadow
#

I should first know this shit before trying to help

trim steppe
#

Discord.Util.escapeMarkdown?

#

no idea

ornate shadow
#

πŸšͺ 🚢

jagged plume
#

na it just discord.escapemarkdown

#

all the utils stuff is there

trim steppe
#

idfkidontusediscordjs

jagged plume
#

yeiusedtouseitsoicanremembersomestuff

#

erisisprettygoodsoimovedtothatinstead

earnest phoenix
#

Fixed it, thanks guys!

#

My music bot works now πŸ˜„

ornate shadow
#

awesome πŸ˜„

earnest phoenix
#
let molecule = 16;
let particle = 18;
let assay = 3;

// Add and assign to molecule below

molecule += 16;
// Multiply and assign to particle below


// Increment assay by 1
#

um

#

what

#

πŸ‘

agile cove
#

how to set role on channel for member?

umbral pelican
earnest phoenix
#

@umbral pelican

#

Hi

#

@umbral pelican

#

Hi

#

Lol

umbral pelican
#

smh

hushed oyster
#

how would I send a message in all channels that the bot is in using discord.py?

#

I have an eval command

#

so I bet I would use it

rich kiln
#

@hushed oyster move to js then do .forEach()

deft peak
#

Sup

hushed oyster
#

n0

rich kiln
#

i cri

thorny tide
#

Π‘Π»ΡΡ‚ΡŒ

#

Π₯уйня

weak parrot
#

English please

quiet bobcat
#

Yeah english

lethal sun
#

English Please

#

@cosmic shoal We need ya

#

@gaunt dune Thanks to StackOverflow i managed to get message.edit working.

#

πŸ˜„

quiet bobcat
#

@lethal sun What did you do?

crystal void
#

:t

#

:t help

#

rip...

#

:t patreon

#

say RIP

earnest phoenix
#

You cant run commands in this channel lol

crystal void
#

oh.. yeah rip

steel shoal
#

hello

earnest phoenix
#

Erm

#

I have a question

languid dragon
#

What's up?

earnest phoenix
#

Im trying to create some discord.js commands

#

But my if statement isnt working

languid dragon
#

show code

earnest phoenix
#
client.on("message", (message) => {
    if (message.content === '---info') {
        message.channel.send(`Starting info giving sequence, <@${message.author.id}>`);
        message.channel.send('Your current ID is: ' + message.author.id);
        message.channel.send('This servers ID is: ' + message.guild.id);
        message.channel.send('This channels ID is: ' + message.channel.id);
        message.channel.send('This channels name is: ' + message.channel.name);
        message.channel.send('This servers name is: ' + message.guild.name);
        message.channel.send('Your client is: ' + message.author.client);
        message.channel.send('Your tag is: ' + message.author.tag);
        message.channel.send('The default avatar is: ' + message.author.defaultAvatarURL);
        message.channel.send('Your avatar is: ' + message.author.avatarURL);
        message.channel.send(`<@${message.author.id}>, if you like me, my invite link is: https://discordapp.com/oauth2/authorize?client_id=359066598494961664&scope=bot&permissions=2080898303`);
                console.log(`Command run: Info in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
  });
languid dragon
#

why are you sending so many messages

earnest phoenix
#

Its an info command

languid dragon
#

do \n

#

to make a new line

earnest phoenix
#

Gives a full list of all info

#

?

languid dragon
#

you'll just get ratelimited that way

#

\n = newline

earnest phoenix
#

Wdym

languid dragon
#
message.channel.send("thing here\n a new line \n another new line");
earnest phoenix
#

Oh

#

Okay

#

Does it matter though?

languid dragon
#

you will get ratelimited that way

#

yes

#

it does

#

other

#

wise

#

your

#

bot

#

will

#

send

#

like

#

this

#

You
want
your
bot
to

earnest phoenix
#

Yep that was what it was doing

languid dragon
#

send like taht

#

yeah

#

\n puts it on a new line

#

and prevents the spam

earnest phoenix
#

πŸ€”

#

Outside the string i presume

languid dragon
#

no

#

inside

#

"here is your string\nhere is a new line"

earnest phoenix
#

Uh okay

#

Quotes needed?

#

Im using ''

languid dragon
#

' or "

#

doesn't matter really

earnest phoenix
#

Okay

umbral pelican
#

what about β€œ bloblul

earnest phoenix
#

Wait

#

I need to use ``

#

Because I have ${}

umbral pelican
#

ok hun

earnest phoenix
#

/n is showing up as part of the string value

languid dragon
#

i

#

said

#

\n

#

?!?!?!?!?!?!

earnest phoenix
#

Okay

#

OH

#

🀦

#

Sorry sir lmao

#

But

languid dragon
#

ignore that

earnest phoenix
#

Okay that fixes the ratelimit

#

But the if statement isnt working still

#

It should be

thorny hinge
#

Whats ur if statement

earnest phoenix
#

Hold on gotta revise my code

#

Gosh this takes so long

#

Done

#

client.on("message", (message) => {
    if (message.content === '---info') {
        message.channel.send(`Starting info giving sequence, <@${message.author.id}> \n Your current ID is: ${message.author.id} \n This servers ID is: ${message.guild.id} \n This channels ID is: ${message.channel.id} \n This channels name is: ${message.channel.name} \n This servers name is: ${message.guild.name} \n Your client is: ${message.author.client} \n Your tag is: ${message.author.tag} \n Your default avatar is: ${message.author.defaultAvatarUrl} \n Your avatar is: ${message.author.avatarUrl} \n <@${message.author.id}>, if you like me, my invite link is: https://discordapp.com/oauth2/authorize?client_id=359066598494961664&scope=bot&permissions=2080898303`);
        console.log(`Command run: Info in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
  });
#

@thorny hinge

thorny hinge
earnest phoenix
#

The if statement just doesnt activate

thorny hinge
#

Hmm

#

It should work

#

Are you sure ur only typing ---info

earnest phoenix
#

Yes

#

---info

#

Wait a minute

#

One of my earlier if statements might be affecting it

#

Oh shit yep

#

Brb

#

Nope

#

Still not working

#

Could it have something to do with it not being in the index file?

languid dragon
#

Uh

earnest phoenix
languid dragon
#

How exactly are you including info.js

earnest phoenix
#

In a folder

#

Thats it tho

languid dragon
#

LOL

#

thats not how it works

earnest phoenix
#

🀦

#

Oh okay

languid dragon
#

you cant just put it in a folder without including it in any way

earnest phoenix
#

How would I include it then

languid dragon
#

thats uh, too complicated to explain in one sitting

slow swan
#

require('./Commands/info.js')

#

very complicated indeed

earnest phoenix
#

XDDDD

#

Rekt

#

But thank you

inner jewel
#
require("./file.js")```in file.js
slow swan
#

In your main file you will probably need to do something like

earnest phoenix
#

Lmao

languid dragon
#

πŸ‘‹

earnest phoenix
#

I put require('./Commands/info.js') in my main file

slow swan
#

global.client = client

#

so every file can access the client class

earnest phoenix
#

Oh, interesting okay

inner jewel
#

ewww globals

earnest phoenix
#
global.client = client
require('./Commands/info.js')
#

This is in my main file

slow swan
#

That should work

earnest phoenix
#

Okie thank you lmao

#

Commando sucked

#

I just realised that

inner jewel
#

prebuilt command frameworks always suck

earnest phoenix
#

True true lmao

#

Also the whole system started to crumble from errors after a while

#

Making it unusable

#

Hey guys

#

I need help again lmao

#

How would I reference a channel in a guild?

#

Not the one the message was sent in

#

Just in general

#

Because I wanna do some sort of logging system

#

Anybody?

languid dragon
#

client.guilds.get("guild_id").channels.get("channel_id")

earnest phoenix
#

Oh thank you

#

Wait

earnest phoenix
#

But im doing an if statement

#

if (channelname === "example")

#

So if I got it

languid dragon
#

client.guilds.get("guild_id").channels.get("channel_id").name

#

LOL

earnest phoenix
#

Just the same?

#

Okay then lol

earnest phoenix
#

Doesnt seem right but ill try it

languid dragon
#

How long have you been coding javascript for?

lethal sun
#

wow

earnest phoenix
#

Eh

#

A bit

#

Kinda

#

All i've learned is if and else statements and the rest is self taught

#

And variables

languid dragon
#

welp

earnest phoenix
#

Agh how would I then send a message in that channel

#

Same code?

#

Also this code doesnt help me

#

Im talking about in general

#

Like all the servers

#

Not just specific ones

lethal sun
#

If you want to get into writing Discord Bots i recommend to watch Evie and Aerity.

slow swan
#

I recommend you don't watch anything and learn the language first

lethal sun
#

^

languid dragon
#

i recommend actually reading documentation and googling :^)

lethal sun
#

that also

earnest phoenix
#

Thing is, I do

faint cedar
#

s>echo Testing

#

s>conf list

#

s>conf list

abstract mango
neon pasture
#

How do I send a image with Eris?

prime cliff
#

SendAttachment or a file option in SendMessage

neon pasture
#

Can you link me the document?

prime cliff
neon pasture
#

bot.createMessage(msg.channel.id, {file: `./images/no.gif`});

#

Doing something wrong, but I don't know what it is.

prime cliff
#

You need to read the file outside createmessage into a data stream then send the stream to it

neon pasture
#

Okay.

#

Does it work with a url too?

prime cliff
#

No you have to download remote images first

#

Only embeds can be used for url images

earnest phoenix
#

Wew

chilly fiber
#

Can someone explain how to use interval?

#

My 'message' is invalid

crystal void
#

Guys! @gritty dirge finally has the music function!

#

wanna test it?

lethal sun
#

yeah

quiet bobcat
#

Sure @crystal void

earnest phoenix
#

Hello. I am looking for a couple people who are interested in working with me on a new site. You must have the following qualifications:

* Knowledge of Node.js, and properly use it
* Can fluently code in HTML, CSS, and JavaScript
* Knowledge of UI Kit v1, and properly use it
* Can properly make thing look "modern"

If you have all of those qualifications, then please Direct Message me.

tawny lava
#

Lol

#

Nice double post

quiet bobcat
#

?

crystal void
#

@lethal sun and @quiet bobcat join Music #2

earnest phoenix
#

@crystal void please don't spam bots in testing channels, go to Shitpost

crystal void
#

wb @lethal sun πŸ˜›

lethal sun
#

ty

quiet bobcat
tawny lava
#

It's a big download iirc

quiet bobcat
#

Yeah but it has been stuck for a while

tawny lava
#

Β―_(ツ)_/Β―

quiet bobcat
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

#

┬─┬ γƒŽ( γ‚œ-γ‚œγƒŽ)

prime cliff
#

It really should not get stuck unless its a connection issue lol

quiet bobcat
#

guess my internet sucks

umbral pelican
tawny lava
#

Same

quiet bobcat
#

Who?

#

Me?

tawny lava
quiet bobcat
umbral pelican
#

pft, you're a shitpost

quiet bobcat
#

Its moving

#

the download ofc

bitter sundial
#

@earnest phoenix is this shit for your list? πŸ‘€

earnest phoenix
#

Just a general project

umbral pelican
#

lol

earnest phoenix
#

πŸ‘€

#

lol

#

You can't assume, I didn't say anything about my list

clear kernel
#

you just said it

earnest phoenix
#

no

clear kernel
#

about my list

earnest phoenix
#

I said that because tonkku said that

clear kernel
#

ik i troll

earnest phoenix
#

kek

bitter sundial
#

@chilly fiber your function is missing message as an argument

umbral pelican
#

it's missing a lot of things tbh

earnest phoenix
#

I have a question

#

If anybody is even online

#

Hi

#

Sup

#

I have a question

#

yes

#

How would I make my bot log the chat from one channel, and post it in another?

#

I know how to get the chat of a channel

#

I just dont know how to get it to post in another

#

what library?

#

d.js

#

bot.channels.get(channelID).send("...")

#

Oh thank you!

#

channelID is the of the channel you want to send that to

#

Understood

#

I can't type today

#

Idea

#

πŸ€”

#

yes

#

I could set the command to a variable

#

Then have the ID written in the variable

#

Then replace the channelid with the variable

#

If a variable is just static (not changing) then why have the variable at all?

#

Its not static

#

Ok then

#

So like

#

The command would be run in the channel

#

And it would get the channel ID

umbral pelican
#

"If a variable is just static (not changing) then why have the variable at all" - Mayo, 2017

earnest phoenix
#

And then be able to send stuff there

#

Lol

#

unless you use the variable like 100 times and it uses the bot (getting channel or user)

#

Wait is channel ID already a variable?

umbral pelican
#

channel.id

earnest phoenix
#

Oh nvm

#

Created a rough code

#
let channelID = ''
client.on("ready", function() {
    if (message.content === '---logs' && message.channel.name === 'logs') {
        channelID = message.channel.id
        bot.channels.get(channelID).send("Testing")
    }
});
scenic crest
#

message content in ready? Thonk

rose tangle
#

y u spoonfeederino

earnest phoenix
#

Wait

#

Not ready function

#

My bad

#

I need to change that

#
let channelID = ''
client.on("message", (message) =>{
    if (message.content === '---logs' && message.channel.name === 'logs') {
        channelID = message.channel.id
        bot.channels.get(channelID).send("Testing")
    } else {
        message.channel.send('You need to be in a log channel to do that!')
    }
});
#

Would this suffice?

#

I can set a changing variable to each message.content

scenic crest
#

--- = prefix?

earnest phoenix
#

Yes

scenic crest
#

why not save it somewhere so you don't need to retype it

earnest phoenix
#

I just prefer this

#

Lol

scenic crest
#

fair enough

earnest phoenix
#

πŸ€”

#
let channelID = ''

client.on("message", (message) =>{
    let logs = message.content
    if (message.content === '---logs' && message.channel.name === 'logs') {
        channelID = message.channel.id
        bot.channels.get(channelID).send(logs)
    } else {
        message.channel.send('You need to be in a log channel to do that!')
    }
});
#

Would this work?

#

Ill try it

#

Nvm

#

Big faliure

#

O shit accidentally created a spam code

rose tangle
prime cliff
#

"spam code" wtf

earnest phoenix
#

It spammed stuff

#

In the channel you sent messages in

#

Which was not the intention

rose tangle
#

I mean if you look at your code

#

that's unsurprising

#

wherever possible a bot should fail silently

#

anyway, first check for the command trigger

#

and then check the channel

#

that way you only get feedback when trying to legitimately use the command

earnest phoenix
#

Aaaaa

#

client.on('message', message => {
    if (message.content === '---logs' && message.channel.name === 'logs') {
        message.channel.send('Logs enabled')
    } else {
        bot.channels.get('351130113120665601').send(message.content)
    }

});
#

Im not sure how I would do-

#

Wait

#
let logs = '';
client.on('message', message => {
    if (message.content === '---logs' && message.channel.name === 'logs') {
        logs = message.channel.id
        message.channel.send('Logs enabled')
    } else {
        bot.channels.get(logs).send(message.content)
    }
});
#

So

#

What I have set up is

#

You need to enable the command first

#

So the varible gets set

#

Then

#

Once it detects a message sent

#

It should send it there

#

Nope

#

Just spams again

#

OH WAIT A MINUTE

#

The code that guy gave me was faulty

#

No this code is wrong

#

How would I get the messages from one channel

#

And post them in another

#

Uhhh anyone?

#

😐

lethal sun
#

How to make so the bot send a message in two or more lines?

Example:

Hello
There.

pale light
#

\n

thorny hinge
#

\n = new line

#

God dammit loris

pale light
#

Heh

#

first to the job

#

:^)

#

b.eval

#

kk

lethal sun
#

@thorny hinge wow ya slower than the Slow Loris

#

wow

#

gg

#

@pale light @thorny hinge thanks

thorny hinge
#

Np

pale light
#

Lol

earnest phoenix
#

πŸ€”

#

Hey guys

#

How would I make my bot trigger a method every time a message is sent?

restive silo
#

call it whenever you sent a message

earnest phoenix
#

And how would I do that

#

Thats basically saying how to peel a potato is to peel a potato

#

Lmao

scenic crest
#

call it in a message event

#

idk

earnest phoenix
#

It is in a message event

#
let logs = '';
let text = '';
client.on('message', message => {
    if (message.content === '---logs' && message.channel.name === 'logs') {
        logs = message.channel.id
        message.channel.send('Logs enabled')
    } if (message.content && !message.channel.name === 'logs') {
        text = message.content
        bot.channels.get(logs).send(text)
    }
});
restive silo
#

you call it after you sent a message

#

thats how you do it

earnest phoenix
#

Ah

#

Okay

#
let logs = '';
let text = '';
client.on('message', message => {
    if (message.content === '---logs' && message.channel.name === 'logs') {
        logs = message.channel.id
        message.channel.send('Logs enabled')
    }
});
client.on('message', message => {
    if (!message.channel.name === 'logs') {
    text = message.content
    bot.channels.get(logs).send(text) 
    }
});
#

So if a message is sent

#

It sets the variable

#

Then posts it in the enabled channel

restive silo
#

you should never have 2 eventlistener for the same event

#

never

earnest phoenix
#

Im so confused

#

How tf would-

#

I need a way to make this persist accross restarts

#

@restive silo don't talk about my selfboat like that lmao

restive silo
#

what

#

@earnest phoenix what did i do

earnest phoenix
#

2 event listeners for same event lol

restive silo
#

thats shit

#

i say it like it is

#

you should never do that

#

you can handle everything in 1 listener

earnest phoenix
#

I know...

restive silo
#

just split in files and require stuff πŸ‘€

inner jewel
#

kek

#

i have iirc 2 message received listeners

trim steppe
#

wtf

#

multiple received listeners

inner jewel
#

yes

trim steppe
#

does anyone have cyanide

inner jewel
#

more organized than having everything in one

scenic crest
#

are jda events async yet

#

^^^

inner jewel
#

mine's async

scenic crest
#

so are mine

inner jewel
#

guava EventBus + cached thread pool

scenic crest
#

wew

#

I'm gonna quickly integrate a chat filter into my main command executor event and make everything 1 file brb

earnest phoenix
#

Guys

#

How would I do a mention if statement

scenic crest
#

if someone's mentioned?

earnest phoenix
#

Yes

inner jewel
#

<@!?id>

earnest phoenix
#

Like

inner jewel
#

the regex

scenic crest
#

natan no

earnest phoenix
#

If someone is mentioned

scenic crest
#

nononon

earnest phoenix
#

Run this code

scenic crest
#

piss off natan

earnest phoenix
#

Basically

inner jewel
#

at least it's not a cancer regex

scenic crest
#

ye you can check if the message contains a user mention

earnest phoenix
#

Im trying to create a ban command

inner jewel
#

:^)

#

i have worse stuff here tbh

earnest phoenix
#
client.on("message", (message) => {
    if (message.content === `---ban <@${message.mentions.members.first().user.id}>`) {
        if (message.guild) {
    message.mentions.members.filter(member => member.id !== message.client.user.id).forEach(member => member.ban());
    } else {
    message.reply('You need to be in a guild to do that!');
    }
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
});
#

This does not work

inner jewel
#

there are 2 types of mentions

#

<@id>

#

and <@!id>

earnest phoenix
#

Okay

scenic crest
#

<@!id> is for nicknames

#

<@id> without

earnest phoenix
#

That doesnt help

scenic crest
#

why not just substring

wooden shoal
#

anybody know how I change the guild count on my bot?

earnest phoenix
#

?

scenic crest
#

get the 1st argument (<@id>)

#

and then work with that

earnest phoenix
#

@wooden shoal client.guilds.size

#

Then

#

You can do some variable math

#

So

scenic crest
#

change guild count

wooden shoal
#

no

scenic crest
#

why do you need to change the guild count

wooden shoal
#

how do I update it on the bot page

scenic crest
#

oh

#

you send a POST request to the API

#

what lib are you using?

wooden shoal
#

d.js

scenic crest
#

there's a bunch of POST request examples

wooden shoal
#

k thanks

scenic crest
#

pick the one that suits you and profit

wooden shoal
#

ok

earnest phoenix
#

Guys guys

#

I need to know how to do this >.>

scenic crest
#

like I said

#

I'd get the first argument

#

and then work with that

earnest phoenix
#

Which is what

scenic crest
#

---ban arg1 arg2 arg3

#

etc

earnest phoenix
#

?

scenic crest
#

that's an example

#

of args

#

args are pretty much the info the user passes in

#

e.g.

#

//ban @scenic crest REEEE

#

my mention would be argument 1

#

REE would be argument 2

wooden shoal
#

show him with an eval command if you have one

surreal peak
#

um guys i've got a problem while installing a newer version of netcore on my vps
basically i uninstalled all the other versions
tried to install 2.0 everything is fine but dotnet --version still says 1.0.1 ;-;
what's the correct way to delete all other versions?
debian 8 jessie

earnest phoenix
#

@scenic crest How does that help

scenic crest
#

@earnest phoenix because argument 1 would JUST be the mention

earnest phoenix
#

?

#

Please show an example

scenic crest
#

what is there to show

earnest phoenix
#

Of the code I would need to use

#

Like

scenic crest
#

you need to split the string using a space

#

that'll give you an array of arguments

earnest phoenix
#

I did

scenic crest
#

alright

earnest phoenix
#

My arg1 is <@${message.mentions.members.first().user.id}>

scenic crest
#

then you need to get the 1st argument (making sure it actually exists, a quick args length check should do it)

earnest phoenix
#

---ban <@${message.mentions.members.first().user.id}>

#

Arg1 is the second part

scenic crest
#

that's not an array of arguments though

earnest phoenix
#

Do I just put arg1?

#

OH WAIT

#

The arg1 will get the mention and store it

#

Am I correct?

scenic crest
#
var command = "---ban @ebon shadow reason"
var args = command.split(" ")
// MAKE SURE THERE IS AN ARGUMENT 1 BEFORE DOING THIS NEXT STATEMENT
var mention = args[1] // should be "@ebon shadow or @ebon shadow"
earnest phoenix
#

Should I set @ebon shadow to my mention code?

#

@scenic crest

scenic crest
#

nah

#

command should be equal to the message raw content

earnest phoenix
#

Wait

#

What do I do after this though

#
if (message.content === command) 
#

?

scenic crest
#

no

earnest phoenix
#

Okay what

#

Im so confused

wooden shoal
#

if (args[2] == "command")

earnest phoenix
#

Ah

#

Okay

scenic crest
#

what no

wooden shoal
#

what

scenic crest
#

command = message.content

earnest phoenix
#

So

wooden shoal
#

command = args[0]

#

actually

earnest phoenix
#
if (command === message.content)
wooden shoal
#

thats what I do

scenic crest
#

no command won't be defined then

earnest phoenix
#

Omg what do I do then

scenic crest
#

do you just wanna ban every user that's mentioned?

earnest phoenix
#

Yes

#

Well

#

The mentioned user

scenic crest
#

well if it was all users that'd be easier

earnest phoenix
#

Why would I want to ban all users

#

Lol

#

That would be bad

#

All I want to do is

wooden shoal
#

wait are you using d.py?

earnest phoenix
#

Make the command ban the person who is mentioned

scenic crest
#

no all mentioned users

earnest phoenix
#

no

#

Oh yes then

scenic crest
#

just check if the message starts with ---ban

#

and if it does

#

iterate through all mentioned member and ban them one by one

#

iterate = loop through

earnest phoenix
#

?

wooden shoal
#

make a for loop looping through every mentioned user (args.length -2 i think) then ban them

earnest phoenix
#

Omg what

#
var command = "---ban @ebon shadow reason"
var args = command.split(" ")
var mention = args[1]

client.on("message", (message) => {
    if (message.content.startsWith('---ban')) {
        if (message.guild) {
    message.mentions.members.filter(member => member.id !== message.client.user.id).forEach(member => member.ban());
    } else {
    message.reply('You need to be in a guild to do that!');
    }
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
});
#

This is my code

wooden shoal
#

k

earnest phoenix
#

I have the ban code

wooden shoal
#

is this javascript?

earnest phoenix
#

🀦

wooden shoal
#

well obviously

earnest phoenix
#

Yes, of course it is

wooden shoal
#

k

#

then u need semicolons on the first variables

earnest phoenix
#

-botinfo @zenith spire

scenic crest
#

MOOSE GO INTO TESTING

earnest phoenix
prime cliff
#

Urm wtf is that website url

earnest phoenix
#

Okay wait

wooden shoal
#

what

prime cliff
#

.ga file

earnest phoenix
#

So how would I do this >.>

#

sorry @scenic crest lmao

scenic crest
#

I just told you an easy way

#

loop through all mentioned users

#

and ban them individually

earnest phoenix
#

Wait

#

I think this would work

#
var command = "---ban @ebon shadow reason";
var args = command.split(" ");
var mention = args[1];

client.on("message", (message) => {
    if (message.content.startsWith('---ban')) {
        if (message.guild) {
    message.mentions.members.filter(member => member.id !== message.client.user.id).forEach(member => member.ban());
    } else {
    message.reply('You need to be in a guild to do that!');
    }
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
});
#

But it requires a mention

scenic crest
#

that's not what I said but ok

#

do it your way

wooden shoal
#
for(i=0;i<args.length-2;i++) {
    *ban command* args[i];
}
scenic crest
#

Β―_(ツ)_/Β―

wooden shoal
#

something like that

#

idk the ban command so...

earnest phoenix
#

No it doesnt work >.>

#

So im trying to fix it

scenic crest
#

nah not even using int for loops

#

even easier

#

just for loop through a collection

earnest phoenix
#

What

wooden shoal
#

ya what lol

#

thats what mine is

earnest phoenix
#

All I want to know

#

Is how to make my system mention someone

wooden shoal
#

just make it say '<@!'+userID+'>'

earnest phoenix
#

Thats what I did

#

Omfg

wooden shoal
#

clearly it isnt

earnest phoenix
#

But then

wooden shoal
earnest phoenix
#

It didnt work

#

It just didnt work

#

Im so confused

#

This isnt helping at all

scenic crest
#
client.on("message", (message) => {
    if (message.content.startsWith('---ban')) {
        if (message.guild) {
    message.mentions.members.filter(member => member.id !== message.client.user.id).forEach(member => member.ban());
    } else {
    message.reply('You need to be in a guild to do that!');
    }
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
});```
#

this should work

#

any exact error you're getting?

earnest phoenix
#

No

#

It just doesnt run

#

Ill try thT THO

#

*That tho

#

Because its my current code

#

Nope

#

Not working

#

It doesnt even log the command being used

wooden shoal
#

wait does ${} work instead of ""++""

#

thats handy

scenic crest
#

yeh in js it should

wooden shoal
#

wow

#

i wish i knew that earlier lol

scenic crest
#

uh

#

@earnest phoenix so if you do ---ban nothing happens?

earnest phoenix
#

Im doing ---ban then a mention

#

Then nothing happens

#

we need to invent new characters for prefixs lmao

scenic crest
#

remove the filter

earnest phoenix
#

if we're at the point where three of a char is needed

scenic crest
#

.filter()

#

that part

#

moose this isn't development

#

go to general smh!!

crystal void
#

I am having some issue with my PC, so @gritty dirge might be down for some time :/

fathom kiln
#

is it possible to make the embed colour a gradient?

clear kernel
#

nope

fathom kiln
#

awh ok

abstract mango
#

gradients would be cool

scenic crest
#

gradients mean more effort for discord

abstract mango
#

tru

fathom kiln
#

they would be cool tho

scenic crest
#

yeah but what use would they be

#

embeds were suppoed to be made for websites

#

and unless those website support gradients it'd be tedious

fathom kiln
#

oh ok

abstract mango
#

yeah

fathom kiln
abstract mango
#

there could be a meta property for a gradient tbh

#

but eh

#

@fathom kiln show code

fathom kiln
#

okay

#
message.guild.createChannel(`ticket-${message.author.id}`, "text").then(c => {
        let role = message.guild.roles.find("name", "Support Team");
        let role2 = message.guild.roles.find("name", "@everyone");
        c.overwritePermissions(role, {
            SEND_MESSAGES: true,
            READ_MESSAGES: true
        });
        c.overwritePermissions(role2, {
            SEND_MESSAGES: false,
            READ_MESSAGES: false
        });
        c.overwritePermissions(message.author, {
            SEND_MESSAGES: true,
            READ_MESSAGES: true
        });
        message.channel.send(`:white_check_mark: Your ticket has been created, #${c.name}.`);
        const embed = new Discord.RichEmbed()
        .setColor(0xCF40FA)
        .addField(`Hey ${message.author.username}!`, `Please try explain why you opened this ticket with as much detail as possible. Our <@&373877951579684866> will be here soon to help.`)
        .setTimestamp();
        c.send({ embed: embed });
    }).catch(console.error);
#

its erroring right at the bottom with c.send embed

#

i think

scenic crest
#

c is null

#

idk what property of send is

#

but if it's that method

#

then c is null

fathom kiln
#

but it cant be since the channel is made???

#

weird

scenic crest
#

hmmmm

#

whats on line 68

fathom kiln
#

c.send({ embed: embed });

#

wait ive fixed it

scenic crest
#

woo

fathom kiln
#

turns out i had a typo on the line below it

#

thanks for the help anyways πŸ˜„

earnest phoenix
#

@fathom kiln

#

Can I have the bot invite link?

#

-bots @fathom kiln

gilded plankBOT
#
RaelynnLilaah#1255
Bots

@humble dagger

earnest phoenix
#

Hmmmm

fathom kiln
#

it hasnt been approved yet

earnest phoenix
#

K

fathom kiln
#

but sure, i can pm you it

earnest phoenix
#

K

#

You have a server I could test it on

fathom kiln
#

yep, i can pm you that too if you want

earnest phoenix
#

K do that

fathom kiln
#

okay

fathom kiln
#

how do you set a channels topic (discord.js stable)?

earnest phoenix
#

find it yourself

pale light
#

ooph

fathom kiln
#

i looked

#

couldnt see anything relating to the topic

umbral pelican
#

voice channel topic Thonk wut

fathom kiln
#

o

#

i was looking at Channel

#

thx lol

earnest phoenix
#

elo

pulsar cairn
earnest phoenix
#

?

#

wdym

pulsar cairn
#

cause

#

xd

earnest phoenix
#

api ping?

#

please

#

what's the api ping

pulsar cairn
#

Latency i meant

earnest phoenix
#

bot.latency

#

if ur using rewrite

#

idk about async

pulsar cairn
#

im not using rewrite

#

im using what ever the normal is

sinful meadow
#

How would i make a command to update things like discord.js in javascript? anyone know

earnest phoenix
#

then get rewrite

sinful meadow
#

did you not read what i just said

#

i said js

#

lmao

earnest phoenix
#

I don't js

#

I'm talking to meme

low niche
#

I quit JS

sinful meadow
#

riiip

earnest phoenix
#

I quit after I saw Khan Academy

sinful meadow
#

Well shite since i wanna make a command to do that

pulsar cairn
low niche
#

I only JS when truly needed

earnest phoenix
#

async2rewrite

low niche
#

What's the diff tbh?

earnest phoenix
#

it's rewritten

#

and better

#

way better

pulsar cairn
#

would it FUCK up my code

earnest phoenix
#

lmao

pulsar cairn
#

?

earnest phoenix
#

read.

pulsar cairn
#

ok?

earnest phoenix
pulsar cairn
#

ima look at this shit on github

#

so it is the same I just install fuckin a better version

earnest phoenix
#

no

#

you have to asycnc2rewrite

#

or manually rewrite ur code

pulsar cairn
#

fuck this

#

i dont need the ping

cosmic plover
#

Gonna leave this here:
Heads up for anyone here, user 188699371532058625 was setting up 50 userbots to farm currency on my bot.
Thing being, nobody is really safe from that, and it that statement looks meaningless, please look at what it could do to your load https://cdn.discordapp.com/attachments/301126889873866752/376597443015344128/unknown.png

And tbh, nobody is really safe:

I'd like to put it as a warning that you all are better off blacklisting this guy from your bots, as it's done plenty damage and doesn't want to stop.

Already reported to abuse@discordapp.com, but better to heads up.

crystal void
#

Hmm... I have restored my PC so @gritty dirge should be up soon.... Hopefully... Btw... Don't ever forget to save important files of yours on a drive, another hard drive or anywhere... Luckily, I've saved @gritty dirge's files on my laptop too, but it's updating :/ And that's why it may take a while to get @gritty dirge back! I hope everyone, including me, will learn something from this what happened to me... Good luck in life! Cya!

tired shuttle
#

Heyo

crystal void
#

hey?

#

lol

lethal sun
#

gg @crystal void

crystal void
#

ikr

lethal sun
#

yeh

tired shuttle
#

@cosmic plover What did he even gain

crystal void
#

Guys! @gritty dirge is finally up, but it's curently running on my laptop which has only a celeron proccesor in it :/ Expect some lag and slow responding until I fix my start button on my PC... Have a nice day! (if you play music with it... it may completely crash or just be laggin' like crazy :/)

vital lark
#

no one gives a fuck I mean what

quiet bobcat
#

August is a prankster

vital lark
#

ikr

earnest phoenix
#

y can't bots write files to github?

crystal void
#

Heii gang! @gritty dirge is finally hosted on my computer again so there shouldn't be any issues πŸ˜‰ If you somehow expirience one, send us an email to support@dbot.chawithus.me

earnest phoenix
#

lolwut

umbral pelican
#

why are you sending messages like that about your bot here ...

earnest phoenix
#

who?

umbral pelican
#

GoN! Plays

earnest phoenix
#

k

#

also do you maybe know how to make the bot write files to a github folder? i have custom commands and a few fs crap

umbral pelican
#

🀷

crystal void
#

maybe @earnest phoenix

earnest phoenix
#

?

slim solar
#

Please ?

#

Can i help me for eval commands ?

earnest phoenix
#

sure

#

just a moment

slim solar
#

Ok;

earnest phoenix
#

this is how i had mine

 if(command === `${prefix}eval`) {
                       if (message.author.id !== "303184720802611200") return message.channel.send("Only the bot owner can use this command")
    
                   const that = message.content.split(" ").slice(1);
                try {
                     const code = args.join(" ");
                let evaled = eval(code);
                if (typeof evaled !== "string")
                evaled = require("util").inspect(evaled); 
                const ss = new Discord.RichEmbed()
                .setDescription("**EVAL**")
                .setColor('GREEN')
                .addField("INPUT", "```" +code + "```")
                .addField("OUTPUT", "```" + (evaled) + "```")
                return message.channel.send(ss)
         
                } catch (e) {
                    console.log(e.stack);
                    const err = new Discord.RichEmbed()
                .setDescription("**ERROR**")
                .setColor('RED')
                .addField("Error:", e)
                return message.channel.send(err)
                }
                }
slim solar
#

thanks !

earnest phoenix
#

thats only for js

slim solar
#

ok

#

@earnest phoenix thanks you

pulsar cairn
#

That is really shit codeβ„’

median lintel
#

spoonfeeding at its finest worst

slow swan
#

@cosmic plover how did you catch him?

quiet bobcat
#
bot.on(guildDelete, guild => {
    ^

TypeError: Cannot read property 'on' of undefined``` What's undefined???
slow swan
#

bot is undefined

quiet bobcat
#

No?

slow swan
#

yes

#

node.js doesn’t lie

quiet bobcat
#

It was under that oops

#

Ok fixed

#

Thank you!

inner jewel
#

@slow swan an user reported him to us

quiet bobcat
#

Reported who?

slow swan
#

not you

quiet bobcat
#

Ok

boreal jasper
#

Discord.js:
if (message.author.id !== "IdOwner") return message.channel.send("**Sorry daddy-o but this command can only be used by the ultimate creator!**");
When using that it wont let me use the command

rose tangle
#

what the fuck is that message

boreal jasper
#

idk

rose tangle
#

also an id is an unsigned long

#

why are you equating that to a string

#

of course that won't work

slow swan
#

in discord.js its a string

rose tangle
#

k

#

@boreal jasper 174990283270782976 is your id

uncut slate
#

in all js libs it's a string because 53bit precision

boreal jasper
#

i know

rose tangle
#

if (message.author.id !== "IdOwner")

#

"IdOwner" is not an id?

#

I've never touched js

#

but that would be my suspicion

boreal jasper
#

const botSettings = require("../config.json");
const IdOwner = botSettings.IdOwner;

rose tangle
#

then why are you putting that const in ""

inner jewel
#

IdOwner != "IdOwner"

#

one is a variable

#

other is a string

delicate zephyr
#

How do you check for a specific permission when Eris gives Permission { allow: 2146958591 } ?

inner jewel
#

(permissions & permission_you_want) == permission_you_want

#

bitwise op

#

idk if there's a built in method for that

delicate zephyr
#

its fine

#

I figured it out

quiet bobcat
#

How?

delicate zephyr
#

What was fetchUser replaced by in Eris?

#

and

quiet bobcat
#

ok

#

Can you help me?

delicate zephyr
#

with?

quiet bobcat
#
                 message.channel.send(":rage:").then((message)=>{
                        message.edit(":angry:")
                            message.edit(":frowning:")
                                message.edit(":neutral_face:")
                                    message.edit(":smiley:")});```
#

Im trying to make timouts inbetween them

#

so first 😑 then like a second after 😠 and so on

#

But I cant figure it out

delicate zephyr
#

use setTimeout

quiet bobcat
#

Yeah

#

I tried that

delicate zephyr
#

how long?

quiet bobcat
#

1000 ms

delicate zephyr
#

ok

quiet bobcat
#

or 1 sec

rose tangle
#

writing bots in js looks like eternal agony

#

wow

delicate zephyr
#

god

#

I hate lambdas

quiet bobcat
#

lambdas?

#

oh

delicate zephyr
#

=>

#

lol

quiet bobcat
#

Me too

knotty cliff
#

BOI

quiet bobcat
#

?

delicate zephyr
#

@quiet bobcat js message.channel.send(":rage:").then((msg)=>{ msg.edit(":angry:").then(msg => { setTimeout(function() { msg.edit(":frowning:").then(msg => { msg.edit(":neutral_face:").then(msg => { setTimeout(function() { msg.edit(":smiley:") }, 1000); }) }) }, 1000); }) });

#

wait

#

I missed a setTimeout

quiet bobcat
#

You cant stack .then Thonk

delicate zephyr
#
    msg.edit(":angry:").then(msg => {
        setTimeout(function () {
            msg.edit(":frowning:").then(msg => {
                setTimeout(function () {
                    msg.edit(":neutral_face:").then(msg => {
                        setTimeout(function () {
                            msg.edit(":smiley:")
                        }, 1000);
                    })
                }, 1000);
            })
        }, 1000);
    })
});```
#

Uh

#

Yea you can

#

lmao

quiet bobcat
#

You can

#

When I tried I couldnt

delicate zephyr
#

one sec

cosmic plover
#

got a report, could confirm it with what I had on @slow swan

quiet bobcat
#

It works

delicate zephyr
#

πŸ˜›

quiet bobcat
#

Thanks @delicate zephyr

delicate zephyr
#

np

quiet bobcat
#

nvm its not Last Updated: 26/08/2017

On Version: 12.3.5

solemn sparrow
#

hm

solemn sparrow
#

does css work on dbl description?

delicate zephyr
#

How do you get the bot to join the same channel as you in voice | Eris

#

thats d.js tho

#

not Eris

quiet bobcat
#

Oh youre using eris

#

didnt see that

#

Idk then

rich kiln
#

@delicate zephyr check their github exampels

delicate zephyr
#

i am

#

lmao

#

I havent found any

rich kiln
#

simple, no?

delicate zephyr
#

thanks

#

I think im blind

prime cliff
#

same for all the other noobs in here *cough *cough deni

topaz fjord
#

Anyone have an idea how to make a timer that resets a value after 24 hours from when the executed the command

earnest phoenix
#

what language?

next wedge
#

C#

#

nobody helps me ?

#

😒

rich kiln
#

try reading docs....

quiet bobcat
#

My eval command isnt working Thonk

rich kiln
#

lang?

quiet bobcat
#

js

#

lib is discord.js

rich kiln
#

eval(args.join(' '))

quiet bobcat
#

Where?

rich kiln
#

🀦

quiet bobcat
#

😦

#
                        if(!message.author.id !== "297433416998191127") return; //LOCK IT TO ME ONLY! DO NOT REMOVE
                        try {
                            var code = args.join(" ");
                            var evaled = eval(code);

                            if (typeof evaled !== "string")
                                evaled = require("util").inspect(evaled);

                        message.channel.sendCode("xl", clean(evaled));
                        } catch(err) {
                            message.channel.sendMessage(`\` ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``)
                        }``` Thats my code so far
#
    if (typeof(text) === "string")
    return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
    else
        return text;
}``` thats the function of clean
rich kiln
#

...

quiet bobcat
#

What's wrong with that?

rich kiln
#

u should try guess it yourself lol