#development

1 messages ยท Page 342 of 1

tawny lava
earnest phoenix
#

Okay >.>

#

Thank you

#

Nope

#

@tawny lava

#

Still nothing

#

Not even an error

tawny lava
#

what did you put

earnest phoenix
#

message.guild.me.hasPermission('BAN_MEMBERS')

#

Im so confused

#

@tawny lava Pls help ;-;

#

Orrrrr noott

pale light
#

hi

earnest phoenix
#

Pls

#

Help me... ;-;

pale light
#

ok

earnest phoenix
#

I've tried everything

#

Its not working

pale light
#

whats not working

earnest phoenix
#
const Discord = require('discord.js');
const client = new Discord.Client();

client.on("message", (message) => {
    let args = [message.content]
if(message.member.hasPermission("BAN_MEMBERS") && message.guild.me.hasPermission("BAN_MEMBERS")){
    if (message.content.startsWith('---ban')) {
        if(!message.guild) return;
        if(message.mentions.users.size === 0) {
        return;
        }
        message.channel.send(`${message.mentions.members.first().user.username} has been banned!`)
        message.mentions.members.first().ban(args[1]);
        console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
} else if (!message.member.hasPermission("BAN_MEMBERS") && message.content.startsWith('---ban')) {
    message.channel.send('You do not have permission to run this command!')
} else if (!message.guild.me.hasPermission('BAN_MEMBERS' && message.content.startsWith('---ban'))) {
    message.channel.send('The bot does not have the required permissions to do this!')
}
});
#

This comes up silent

#

No errors

#

No logs

#

And it doesnt work

pale light
#

its

#

hasPermissions

earnest phoenix
#

No

#

That got deprecated

pale light
#

yeah

earnest phoenix
#

Its hasPermission now

pale light
#

but merp

#

fine

earnest phoenix
#

ยฏ_(ใƒ„)_/ยฏ

pale light
#

where are you running it

earnest phoenix
#

VCS

pale light
#

like which server are you testing on

earnest phoenix
#

A random one

pale light
#

which one

earnest phoenix
#

Why

pale light
#

do you have ban perms on it?

earnest phoenix
#

Yes

#

I am one of them

#

But

#

Even when others ran it

#

Nothing

#

It just comes up nothing all the time

pale light
#

does your bot have ban perms

earnest phoenix
#

No

#

I made a thing for that

pale light
#

then if it doesn't why would it run

earnest phoenix
#

The whole else if statement

#

Because I made a checker for that

pale light
#

if(message.member.hasPermission("BAN_MEMBERS") && message.guild.me.hasPermission("BAN_MEMBERS")){

earnest phoenix
#

No

pale light
#

it doesn't have ban perms?

earnest phoenix
#
else if (!message.member.hasPermission("BAN_MEMBERS") && message.content.startsWith('---ban')) {
    message.channel.send('You do not have permission to run this command!')
} else if (!message.guild.me.hasPermission('BAN_MEMBERS' && message.content.startsWith('---ban'))) {
    message.channel.send('The bot does not have the required permissions to do this!')
}
#

It does not

#

Which is why I made this

#

Which also doesnt work

#

๐Ÿค”

pale light
#

why are you checking for ban perms and the command at the same time

earnest phoenix
#

Because it glitched

#

And spammed messages

pale light
#

check for command and check for perms inside of it

earnest phoenix
#

Alright ยฏ_(ใƒ„)_/ยฏ

#
const Discord = require('discord.js');
const client = new Discord.Client();

client.on("message", (message) => {
    let args = [message.content]
    if (message.content.startsWith('---ban')) {
        if(message.member.hasPermission("BAN_MEMBERS") && message.guild.me.hasPermission("BAN_MEMBERS")){
        if(!message.guild) return;
        if(message.mentions.users.size === 0) {
        return;
        }
        message.channel.send(`${message.mentions.members.first().user.username} has been banned!`)
        message.mentions.members.first().ban(args[1]);
        console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    if (!message.member.hasPermission("BAN_MEMBERS") && message.content.startsWith('---ban')) {
    message.channel.send('You do not have permission to run this command!')
}  
    if (!message.guild.me.hasPermission('BAN_MEMBERS' && message.content.startsWith('---ban'))) {
    message.channel.send('The bot does not have the required permissions to do this!')
}  
}
    }
});
#

@pale light

#

I put everything inside

pale light
#

ok

earnest phoenix
#

Im gonna try it

pale light
#

what is that

earnest phoenix
#

Its my code

pale light
#

why are you checking for command name still

earnest phoenix
#

I fixed that

pale light
#

ok

earnest phoenix
#

As I thought

#

Still comes up silent

#

@pale light Boi

#

.>

pale light
#

lets args = [message.content] >.>

#

what is that

earnest phoenix
#

Thats for getting the ban mention

pale light
#

nononono

earnest phoenix
#

It works

pale light
#

nono

earnest phoenix
#

It does lel

pale light
#

don't use that

earnest phoenix
#

Why :/

pale light
#

cause its bad

#

:/

#

"\

earnest phoenix
#

But it works :/

pale light
#

doesn't matter

earnest phoenix
#

Boi im not changing it

#

Its working :/

#

Bro please help solve this

#

Orrrr not

pale light
#

you might want to restructure the entire command

earnest phoenix
#

._.

pale light
#

its very uh spotty photoblobs

earnest phoenix
#

Bro look doesnt matter

#

:/

#

I just wanna be able to fix this command

#
const Discord = require('discord.js');
const client = new Discord.Client();

client.on("message", (message) => {
    let args = [message.content]
    if (message.content.startsWith('---ban')) {
        if(message.member.hasPermission("BAN_MEMBERS") && message.guild.me.hasPermission("BAN_MEMBERS")){
             if(!message.guild) return;
                if(message.mentions.users.size === 0) {
                return;
             }
        message.channel.send(`${message.mentions.members.first().user.username} has been banned!`)
        message.mentions.members.first().ban(args[1]);
        console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
}  else if (!message.member.hasPermission("BAN_MEMBERS")) {
    message.channel.send('You do not have permission to run this command!')
} else if (!message.guild.me.hasPermission('BAN_MEMBERS')) {
    message.channel.send('The bot does not have the required permissions to do this!')
    }
}  
});
#

I honestly dont get why its doing this

pale light
#

i gtg

#

sry

earnest phoenix
#

It should be working

#

Eh its fine bro

#

Cya!

neon pasture
#

Just use the else statement

vale orbit
#

'[message.content]'

#

lol

#

@The Darkness Soldier#1418 he was giving you a tip

#

So you could try to do something more on that message.content

neon pasture
#

Do I need to have FFMPEG installed to use .play? Using eris

languid dragon
#

you need ffmpeg for any audio stuff in node

#

and node-opus or something like that?

#

i think

neon pasture
#

Thank you ken :P

languid dragon
#

no problem

bitter sundial
#

if you only play mp3 files there is another option afaikยจ

neon pasture
#

What about a .m3u file?

stone kiln
#

he wants to play streams

neon pasture
stone kiln
#

make it like i said a stream

neon pasture
#

Doing that right now

stone kiln
#

๐Ÿ‘Œ

bitter sundial
#

ffmpeg is good for playing the stream

neon pasture
#

I got it installed, or atleast I hope

#

He is joining the channel

#

But not playing anything.

tawny lava
#

check console for errors

neon pasture
#
  bot.createMessage(msg.channel.id, "Error joining voice channel: " + err.message);
  console.log(err);
}).then((connection) => {
  connection.play('http://listen.moe/stream.m3u'), {format: 'm3u'};
});```
#

I don't got any errors.

jagged plume
#

i can see a syntax error alrady

neon pasture
#

Already got it ๐Ÿ˜›

quiet bobcat
#

How do I make my bot not respond if its in dms?

neon pasture
#

When some run a command you first check if he's in a guild

quiet bobcat
#

Ok

#

How do I check that? GWcfcThonk

viscid delta
#

Could I get someone to develope a bot for me?

stone kiln
#

no

earnest phoenix
#

no

#

@Lord Trash#5161 make one yourself

#

rip

umbral pelican
rain swift
#

@viscid delta sure

sinful meadow
#

@quiet bobcat lib?

#

if its d.js

#

use if(!message.guild) return;

#

simple af

quiet bobcat
#

Thanks

neon pasture
#

or

fervent goblet
#

or: don't do it

#

why let cmds only work in dms

#

well, my open source bot has that feature but SSH

#

YOU DON'T KNOW THAT

#

lol

quiet bobcat
#

I dont want them to work in dms Thonk

neon pasture
#

never mind, forgot how to send a message with d.js

quiet bobcat
#

or atleast the music commands

fervent goblet
#

oh so NOT in dms

#

oops

#

I'm dumb

neon pasture
#

ik

quiet bobcat
#

haha

#

we know

fervent goblet
#

๐Ÿ‘€

quiet bobcat
fervent goblet
#

"TAKE THAT BACK OR I'M GONNA COME DOWN THERE AND KICK EVERY SQUARE INCH OF YOUR ASS!"

#

XD

earnest phoenix
#

@umbral pelican why did you post a Luke?

umbral pelican
#

lol ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

Nop

agile lake
#

hmm is there an npm that allows me to put text on gifs? (node js)

sand fulcrum
#

probably not

agile lake
#

i crie

earnest phoenix
#

Is there anyway I can force my bot to leave a specified guild with a command?
Maybe, they are using my bot for the wrong purposes and I do not like it

inner jewel
#

depends on the library

earnest phoenix
#

d.js

#

Or I can make a blacklisted guild array and i can paste the guild ID into the array? Maybe

sinful meadow
#

@earnest phoenix

#

client.guilds.get("ID").leave()

#

simple

thorny hinge
#

Or

#

client.guilds.leave()

#

:^)

sinful meadow
#

lmfao

#

That would not work btw

thorny hinge
#

Yeah u would have to forEach the guilds

sinful meadow
#

client.guilds.map(e => e.leave())

#

kappa

vale orbit
#

Lol

#

Yep

#

map em all

thorny hinge
#

Or that

vale orbit
#

If yours isnt client then its what you use for <client>.on

umbral pelican
vale orbit
#

Is there a way to send a msg to every guild general channel without getting their id(s)?

#

lmao

#

d.js

umbral pelican
#

yes, but don't thonkHang

vale orbit
#

I'm just wondering bc I found out about it on c#

sinful meadow
#

@vale orbit ```js
client.guilds.map(e =>{
let f = e.channels.find("name","general")
f.send("SUP BITCH MASSIVE SPAM")
})

#

ยฏ_(ใƒ„)_/ยฏ

vale orbit
#

I think it's prob something like that but eh xD

#

I'll test on my test bot

sinful meadow
#

Im not joking

vale orbit
#

anyway

sinful meadow
#

that would work

earnest phoenix
#

Agh

#

My code still isnt working

umbral pelican
#

ripperoni

earnest phoenix
#

Pls help ;-;

#

No errors, nothing

#

Yet it doesnt work

umbral pelican
#

yep, can totally help with that... :|

earnest phoenix
#

Sarcastic?

umbral pelican
#

very

earnest phoenix
#

๐Ÿคฆ

#

Do you know someone who can help me?

umbral pelican
#

not if you don't say even in the slightest what your issue is thonkHang

prime cliff
#

^

#

Do you need mental help?

weary crescent
#

He just said he can't use his code

#

He needs help with using his code

#

Geez

prime cliff
#

Oh

weary crescent
#

Yea

prime cliff
#

He diddnt tell us or show us any code :/

weary crescent
#

He still said he couldn't use it

#

That should have said something

prime cliff
#

@earnest phoenix which language are you using and/or library

vale orbit
#

@sinful meadow fyi the code doesnt work xd

#

I tried other meths

#

^ methods

umbral pelican
#

meth

weary crescent
#

Lol

vale orbit
#

im lazy to type some words lol

weary crescent
#

Same

lethal hamlet
#

What is Visual Studios used for?

#

in making bots.

shy rose
#

the editor?

lethal hamlet
#

Nvm... I just realized

earnest phoenix
#

@prime cliff d.js

#

@prime cliff ```javascript
const Discord = require('discord.js');
const client = new Discord.Client();

client.on("message", (message) => {
let args = [message.content]
if (message.content.startsWith('---ban')) {
if(message.member.hasPermission("BAN_MEMBERS") && message.guild.me.hasPermission("BAN_MEMBERS")){
if(!message.guild) return;
if(message.mentions.users.size === 0) {
return;
}
message.channel.send(${message.mentions.members.first().user.username} has been banned!)
message.mentions.members.first().ban(args[1]);
console.log(Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username})
} else if (!message.member.hasPermission("BAN_MEMBERS")) {
message.channel.send('You do not have permission to run this command!')
} else if (!message.guild.me.hasPermission('BAN_MEMBERS')) {
message.channel.send('The bot does not have the required permissions to do this!')
}
}
});

#

This comes up empty

#

Nothing

#

No error

prime cliff
#

Wait why is the args message.contents?

earnest phoenix
#

Someone asked that too

#

Its to convert the mention into a string

prime cliff
#

You need to split that

earnest phoenix
#

So it can be used-

#

?

#

Ah

#

.split(", ")

#

I shall try it

prime cliff
#

Yea

earnest phoenix
#

I did that

#

Was dat the error ;-;

#

Nope

#

Still nothing

#

;-;

#

It seems like theres some big error here

#

Thats not being caught

#

Aaaaaaa this is impossible

#

Nobody knows what the problem is

#

And theres no error so it cant be found out

#

Even the debugger cant find anything

prime cliff
#

Debug your code by logging to console with the arguments and see which parts are being executed

earnest phoenix
#

Okay

#

Wtf

#

Nothing

#

No console imput

prime cliff
#

Btw this part here will cause errors because you are checking for guilds after guild.me.hasperm

earnest phoenix
#
 console.log(args)
#

Oh whoops

#

Fixing that

#

Done

#

But thats odd

#

The console didnt get any logs

#

Somethings wrong with args

prime cliff
#

Put the console.log at the start and keep moving it down to see where its failing

earnest phoenix
#

Okay

#

What the hell

#

Its not even-

#

.

#

HOLD ON A SECOND!

prime cliff
#

I spy user mistakes

earnest phoenix
#

.

#

Wow

#

๐Ÿ‘

#

Gfg me

#

It was the variable system

#

It messed up the eventChecker

#

Aaaaaaa

#

Wait

#

How would I reference the client as a member

#

Because I needed that variable

prime cliff
#

Use whatever you set your client var as?

earnest phoenix
#

But I did that

#

And It messed up the code

#

And also failed

#

;-;

prime cliff
#

You are doing something really wrong then

earnest phoenix
#

Okay, just how would the client get referenced as a member

#

Because I tried everything

#

and client.member isnt a method

#

And when I try other things

#

It comes up undefined

#

TypeError: Cannot read property 'hasPermission' of undefined

prime cliff
#

hasPermission is not valid then

earnest phoenix
#

How tho ๐Ÿ˜

#

client.member.hasPermission("BAN_MEMBERS"))

prime cliff
earnest phoenix
#

I did

#

Many many times

umbral pelican
#

client.member is not a thing...

earnest phoenix
#

I know that

#

Yet

#

People keep telling me different things

#

So im not sure who or what is right

#

So I defaulted back to this

#

Hey another example

earnest phoenix
#

I did

#

Thats user

prime cliff
#

Its right there...

earnest phoenix
#

User and emmber are different

prime cliff
#

client.user

earnest phoenix
#

*member

#

:/

#

User is the bot's user

#

The guild member has the permissions

#

I mean, I can try it

#

But I dont think it would work

#

Yup

#

Bot crashed with a "not valid function" error

prime cliff
#

Oh

earnest phoenix
#

:/

#

Im at wits end

#

I've tried everything

#

Well

#

Everything to the best of my knowledge

prime cliff
#

Rip you

earnest phoenix
#

Yep

#

All I legit need to know

#

Is how to reference the bot guild member

#

Yet apparently nobody knows how

prime cliff
earnest phoenix
#

Then it says "me" is undefined

#

TypeError: Cannot read property 'me' of undefined

#

Got it

#

Woooooooooow

#

And now the else if system isnt working

#

bangs head against wall

trim steppe
#

Is your old nickname Deni by any chance

earnest phoenix
#

Not mine

languid dragon
#

thats 100% not deni LMFAO

#

Deni thought JSON wasn't JS ;]

prime cliff
#

Lol

earnest phoenix
#

LOL

#

@earnest phoenix give me the code

#

@earnest phoenix Why

#

I has fixed it

#

o

earnest phoenix
#

@earnest phoenix help me with image manipulation

#

reeeeeeeee

#

ok

#

just saying, graphicsmagick is poorly documented

#

the js lib anyways, not the CLI

#

uh oh

#

i just need to add text on top of an image

#

Oh

#

you may want to use JIMP

#

or something like that

#

how do I use that?

#

lol

#

Lol

languid dragon
earnest phoenix
#

k

languid dragon
#

If you want anymore help i can lend ya a hand

earnest phoenix
#

ok

languid dragon
#

๐Ÿ’”

earnest phoenix
#

lol

#

fanclub is back

#

lmao @languid dragon

languid dragon
#

Henlo, whats up? ping me again when u return

earnest phoenix
#

kek @languid dragon

languid dragon
#

what

earnest phoenix
#

trying to make this work

#
const Jimp = require('jimp');
Jimp.read('./potato.jpg', function (err, image) {
    Jimp.loadFont(Jimp.FONT_SANS_32_BLACK, function (font) {
        image.print(font, 10, 10, "Hello world!");
    });
    image.write("./newpot.jpg");
});```
#

that should work

languid dragon
#

do you want a working example?

earnest phoenix
#

it creates the new file

#

but doens't put the text onit

#

sure

languid dragon
#

lemme write one up real quick

earnest phoenix
#

ok

languid dragon
#

@earnest phoenix

#
const Jimp = require('jimp');

Jimp.read("tt.png").then((image)=>{

  Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then((font)=>{
      image.print(font, 10, 10, "Hello world!");
      image.write("newTT.png");
  });

}).catch(function (err) {
    console.error(err);
});

#

this worked

#

you didnt do .then((font)=>{})

#

put image.write() after you load the font

earnest phoenix
#

yay

#

cool thanks

languid dragon
#

otherwise it wont save the text :-]

#

no problem โค

#

here if you need anymore help :]

gilded plankBOT
#
Rainbowdashboygamer#2846
Bots

@edgy dew

prime cliff
earnest phoenix
#

Oh.

earnest phoenix
#

Anyone knows a good way to fetch images from a site like letโ€™s say danbooru in js? Having some troubles with it.

neon pasture
#

With a embed, that's pretty easy to do.

stone kiln
#

without i know how to do it

#

i think

#

i can't get to my code

earnest phoenix
#

Yeah, i have no issues creating the embed for it, i just need to know a way to fetch the images, is there an api for it?

stone kiln
#

nope

#

1 sec

earnest phoenix
#

hm okay

neon pasture
#

danbooru has a API, if you didn't knew that

earnest phoenix
#

oh, i'll check it out in a sec

neon pasture
earnest phoenix
#

Thank you!

stone kiln
#

or you can be like me

var url = function GetDanbooruImageLink(callback) {
        var https = require('https');
        var parseString = require('xml2js').parseString;
        var reqOptions = {
            host: 'danbooru.donmai.us',
            path: '/posts.xml?limit=20',
            method: 'GET',
            headers: {
                'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1',
                'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
            }
        }

        https.get(reqOptions, resp => {
            var body = '';

            resp.on('data', p => {
                body += p;
            });

            resp.on('end', function () {
                parseString(body, function (err, res) {
                    // Math.floor(Math.random() * body.length);
                    var imgUrl = res.posts.post[Math.floor(Math.random() * res.posts.post.length)]['file-url'][0];
                    callback("https://danbooru.donmai.us/" + imgUrl);
                });
            });
        });
    };```
#

that is my old function XD

#

never used

#

well only a test

sinful meadow
stone kiln
#

that was on my selfboat as one command XD

#

never used it ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

that's js not json

weak parrot
#

You asked for js Thonk

earnest phoenix
#

i wrote wrong i'm tired

weak parrot
#

Oh well it happens

earnest phoenix
#

yeah lol

stone kiln
#

๐Ÿ‘€

earnest phoenix
#

Hello

#

Is there anybody?

tawny lava
#

No

earnest phoenix
#

@tawny lava lol

tawny lava
#

No need to ping me

earnest phoenix
#

Okay

#

I wanted to ask about WebView library, what may you say about it? I mean it's good choice for web-app?) I mean to integrate websites into android/ios app.

languid dragon
#

how to message.channel.send({files:{imageToUpload}}); pls

sinful meadow
#

attachments

#

sendFile

#
message.reply('Cunts', {
                           file: buffer
                           });
languid dragon
neon pasture
#

message.channel.send(new Discord.Attachment('./images/confused.gif/'));

#

That's for d.js

stone kiln
#
message.channel.send("something", { files: [ "thing to file" ] });```
#

arrays ftw

sinful meadow
#

nah

neon pasture
#

Someone said to me that .Attachment was better

stone kiln
#

no just no

neon pasture
#

O you are using Eris @languid dragon

languid dragon
#

no

stone kiln
#

d.js

sinful meadow
#

No

neon pasture
#

but that are the docs from eris?

sinful meadow
#

@neon pasture Jeff you succ a bigg ducc

stone kiln
#

no they aren't XD

neon pasture
#

o lol

weak parrot
#

Wow

neon pasture
#

rip me

weak parrot
#

S stands for succ

sinful meadow
#

U Stands for uck

neon pasture
#

What d.js has blue text too

weak parrot
#

lol

sinful meadow
#

C stands for cock

#

C stands for cat

#

xD

languid dragon
earnest phoenix
#

same

earnest phoenix
#

how do I push to an array?

languid dragon
#

then why keep the question here, and/or why bother asking in the first place Thonk

earnest phoenix
#

when you already know how to and you have crossed out in the text and people are giving you the answer when you already know the answer

earnest phoenix
#

hey kids

#

nice to meet ya

#

who is ready for some forked bot pizza?

sinful meadow
#

@earnest phoenix ```js
let a = ["",""]
a.push("!;/รท;;ร—;,!;!;,!;!")

earnest phoenix
#

reeee

languid dragon
#
const Discord = require('discord.js');
const _client = new Discord.Client();

_client.on('ready', ()=>{
  console.log("Discord client ready.");
});

_client.on('message', (message)=>{
  if(message.author.bot) return; // if message owner = bot, return
  if(message.content.indexOf("!!") !== 0) return; // if not prefix, return
    let args = message.content.slice(2).trim().split(/ +/g);
    let command = args.shift().toLowerCase();

if(command == "ping"){
    return message.channel.send("Pong!");
}
  // do stuff
});

_client.login('token here');
#

@earnest phoenix

earnest phoenix
#

okeh

#

thanx

languid dragon
#

welc

earnest phoenix
#

only need that?

#

@languid dragon

languid dragon
#

pretty much

#

you need to install Node.js

earnest phoenix
#

crashes when i run

#

i have node

languid dragon
#

have you installed Discord.js?

#

and put the token in?

earnest phoenix
#

how do i install discord.js

#

what is command

#

in nodejs

languid dragon
#

npm install discord.js

earnest phoenix
#

thnx

#

@languid dragon how do i add a command

languid dragon
#
if(command == "ping"){
    return message.channel.send("Pong!");
}
#
if(command == "ping"){
    return message.channel.send("Pong!");
}
if(command == "yes"){
    return message.channel.send("No!");
}
#

u literally

#

just leaked your token

#

GG

earnest phoenix
#

shit

languid dragon
prime cliff
#

@earnest phoenix nice token

languid dragon
#

note how the if(command == "ping")

#

is INSIDE

earnest phoenix
#

reseted token

#

lol

languid dragon
#

the message event

earnest phoenix
#

i saw

#

it crashed when i do the command

#

@languid dragon

languid dragon
#

show error?

earnest phoenix
#

lemme see

languid dragon
#

or show code

earnest phoenix
#

@languid dragon

#

woops

languid dragon
#

llmfao

uncut slate
#

Why are you prefixing client

languid dragon
#

add ```JS

let args = message.content.slice(2).trim().split(/ +/g);
let command = args.shift().toLowerCase();
earnest phoenix
#

above the command?

languid dragon
#

after the prefix check thing

#

also aeth, cos its just a habit of mine

uncut slate
#

wat

earnest phoenix
languid dragon
#

ye

#

see

#

now "command" is defined

#

LOL

earnest phoenix
#

?

languid dragon
#

let command = ....

#

before

#

it wasn't

#

defined

earnest phoenix
#

wa

languid dragon
#

working now?

earnest phoenix
#

i dont get ou

#

lol

languid dragon
#

sigh

#

    let args = message.content.slice(2).trim().split(/ +/g);
    let command = args.shift().toLowerCase();
#

THESE

#

WERE NOT DEFINED BEFORE

#

thats why it wouldn't work

#

/?!?!?!?

earnest phoenix
#

ok

languid dragon
#

yep, should do

#

!!ping should do that

earnest phoenix
#

nop

languid dragon
#

!!ping not work?

earnest phoenix
#

nop

languid dragon
#

errors?

earnest phoenix
#

no

languid dragon
#

nothing?

earnest phoenix
#

yup

languid dragon
#

inv me to your test server

#

or w/e

#

IN DM's

#

FUCK SAKE

#

SERIOUSLY

#

LOOOL

earnest phoenix
glossy oracle
#

And ?

languid dragon
#

put console.log("message received") after the message event

earnest phoenix
#

did

#

still doesnt work

languid dragon
#

uh

#

i mean

#

does it log anything?

earnest phoenix
#

@languid dragon fix pls

#

nop

languid dragon
#

show code again

earnest phoenix
languid dragon
#

okay

#

what i meant

#

was

#

put console.log after _client.on("message")

#

also

glossy oracle
#

Just a little question, why does your client variable have an underscore ? Thonk

languid dragon
#

habit

#

open command console in your folders directory

tawny lava
earnest phoenix
#

@languid dragon can you make a example bot and send me files ._.

languid dragon
#

i literally

#

sent you

#

an example bot

#

do me a favour

#

and open command prompt in your folders directory

earnest phoenix
#

open it using cmd?

#

nodejs

languid dragon
#

just open cmd.exe yeah

#

and then do

#

node boat.js

#

and see what happens then

earnest phoenix
#

still doesnt work

languid dragon
#

console show anything?

earnest phoenix
#

โ˜น ๐Ÿ”ซ

#

nop

wispy jolt
#

your return is above the console.log

#

wait nvm

#

ignore me

languid dragon
#

i honestly

#

cant find anything wrong with it

#

i swear you're doing something wrong

#

or something is outdated

neon pasture
#

Close your if statement

languid dragon
#

it is

#

lmfao

earnest phoenix
#

._.

languid dragon
neon pasture
#

Didn't saw that lel

languid dragon
#

i used the same code for my bot lmfao

#

its just i parse my commands with my handler

neon pasture
#

Why did you hide your token?

languid dragon
tawny lava
#

yes show your token pls Thonk

cosmic plover
#

yes show your token pls Thonk

#

"yeet.js" lmfao

low niche
#

rip

earnest phoenix
#

oh

#

discord.js

coral horizon
#

:Thonk:

#

:Thonk:

#

Eh nani

umbral pelican
smoky rampart
thorny hinge
clear kernel
#

okay so im just using python (eww) to make something
now in javascript I can do this:

if(this !== that) return;
//code is here

how would I do that in python, if possible? (instead of putting all the code inside the if)

uncut slate
#
if this != that:
  return
clear kernel
#

i forgot the colon, just realized and wow that timing

abstract mango
#

or

#
if this is not that:
    return
inner jewel
#
if selfbot is not banned:
    selfbot.ban()```
earnest phoenix
#

same

topaz fjord
#

can someone help me with making the divs responsive

earnest phoenix
#

use media classes or % instead of px on width's

topaz fjord
#

i dont even use px on width

earnest phoenix
#

what do you use?

topaz fjord
#

i didnt even set anything for the boxes

#

there normal size

#

when the brower is full

#

screen

#

any idea?

umbral pelican
#

Sid thonkangEyes

#

my bearded dragon is called Sid

topaz fjord
#

...

#

thats my nickname

#

any idea @umbral pelican tho?

umbral pelican
#

ยฏ_(ใƒ„)_/ยฏ

topaz fjord
#

oh.

#

making things responsive is pissing me off

agile lake
#

there a way for make vps detect all my npms? npm install didn't work as well as npm cache clearring then reinstallation

earnest phoenix
#

magic

agile lake
#

modules under node_module*

#

it's probably my pathing

floral stone
#

I have a question about the rate limit for deleting messages. How much is it and is it only for the channel i'm in or the server or the bot?

smoky rampart
#

I believe there's a per channel rate limit and a global rate limit

floral stone
#

I have a bot that delete message in a loop game....

#

How often should i pause before delete?

#

@smoky rampart

smoky rampart
#

dunno being who I am I usually just run tests on what I am curious about

#

but maybe it's somewhere in the discord docs?

earnest phoenix
#

@agile lake npm list?

#

Idk what u mean

cosmic plover
#

should be channel and 5/5s @floral stone

#

I'm 70% sure

agile lake
#

a lot of unmet dependencies when i type npm list hmm

#

i'mma go npm install all the missing peer deps

#

although it keeps failing

earnest phoenix
#

@lethal hamlet so, here's an example

...
e = discord.Embed(title='Title', description='desc')
await ctx.send(embed=e)```
#

if you're using rewrite

lethal hamlet
#

Rewrite, isn't that a program?

#

@earnest phoenix

earnest phoenix
#

no.

smoky rampart
earnest phoenix
#
client.on('guildMemberAdd', member => {
  let guild = member.guild;
  const embed = new Discord.RichEmbed()
  .setColor(0x00AE86)
  .setTimestamp()
  .addField('User Update',
    `${member.user} has joined! :white_check_mark: `)
  guild.defaultChannel.sendEmbed(embed);
});
``` what is wrong with this  ? ๐Ÿ˜
vale orbit
#

defaultChannel does not exist anymore.

#

@earnest phoenix

earnest phoenix
#

ok i change it in ```
message.channel.send({ embed })

#

message is not defined

#

is @earnest phoenix

#

tis not

#

message is not defined in that event

#
client.on('guildMemberAdd', member => {
  let guild = member.guild;
  const embed = new Discord.RichEmbed()
  .setColor(0x00AE86)
  .setTimestamp()
  .addField('User Update',
    `${member.user} has joined! :white_check_mark: `)
  guild.channels.first().send({embed});
});
#

if it was not. I received an error that was not defined. but I do not get any error.

#

@earnest phoenix yeah sure k

languid dragon
#

what the heck

agile lake
pale light
#

heh he

earnest phoenix
#

Hey guys?

#

How do I check if an arry is empty

#
.length === 0
#

?

agile lake
#

isEmpty()?

earnest phoenix
#

d.js?

#

Not a function

wooden shoal
#

if (array == []){} I think...

earnest phoenix
#

Ill try it

wooden shoal
#

ok

earnest phoenix
#

Nope

wooden shoal
#

hm

#

are ypu sure the array is empty?

earnest phoenix
#

Yes

#

Im getting a "Cannot send empty message" error

#

Plus if it was full the code would move past it

wooden shoal
#

ok.. hm. can I see what the context of your code is in?

#

so just what are you trying to do?

earnest phoenix
#
const Discord = require('discord.js');


client.on("message", (message) => {
    
    if(!message.guild) return;
    if (message.content.startsWith('---alert')) {
        if(message.member.hasPermission("MANAGE_GUILD") || message.author.id === '376147022660632587'){
                if(message.mentions.users.size === 0) {
                return message.channel.send('You didnt provide a mention silly!');
                }
                const args = message.content.slice(`---alert <@${message.mentions.members.first().user.id}>>`.length).trim().split(/ + /g)      
                if (args) {
                return message.channel.send('You didnt put a message to alert silly!');
                }
        message.delete();
        message.guild.fetchMember(message.mentions.members.first().user.id).then(e => e.send(args));
        console.log(`Command run: Alert in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
        message.channel.send(`**${message.mentions.members.first().user.username} has been alerted by ${message.author.username}**`)
} else if (!message.member.hasPermission("MANAGE_GUILD")) {
        message.channel.send('You must have the MANAGE_SERVER permission to run this command!')
}
}  
});
#

Trying to create an alert system

wooden shoal
#

ok..

earnest phoenix
#

Basically

#

If theres no text to alert

#

End the code

#

Which is return;

#

But im not sure how to reference an empty arry

wooden shoal
#

probably ```javascript
if (args.length == 0)

earnest phoenix
#

I tried that

wooden shoal
#

oh

earnest phoenix
#

Btw its ===

wooden shoal
#

ya but whatever lol

earnest phoenix
#

Lmao

wooden shoal
#

you know what I mean

earnest phoenix
#

I do

#

Yep doesnt work

wooden shoal
#

ok..

earnest phoenix
#

WAIT

#

I can check if its truthy

#

๐Ÿคฆ

#

Lemme try that

wooden shoal
#

k

earnest phoenix
#

Okay that worked

#

Thank you anyways sir!

wooden shoal
#

oh ok good

#

no problem

earnest phoenix
#

Okay wot

#

Now its saying

#

Wait

#

.split() was messing it up lol

wooden shoal
#

oh lol

sinful meadow
#

@The Darkness Soldier#1418 did you fix the array thing

#

fuk

low niche
fervent goblet
#

then dont use js

languid dragon
#

to start with

    if(!msg.content.startsWith(client.config.prefix)) return;
    if (msg.content.startsWith(client.config.prefix)) {

is probably the most unncessary thing i've ever seen

#

you really not ned that second if statement at all

low niche
#

Ok

#

@fervent goblet js ain't my main lang anyway

languid dragon
#
// A better idea of doing it

let commandToExecute = null;
try{
    commandToExecute = require('./commands/'+command+'.js');
    commandToExecute.run();
}catch(e){
    console.log("no command");
}

obviously this isn't the entirrty of the "idea"
but from this you would expand

fervent goblet
#

then use py

bitter sundial
#

if thing in array is not a thing in js Thonk

low niche
#

Ok

languid dragon
#

    let args = message.content.slice(2).trim().split(/ +/g);
    let command = args.shift().toLowerCase();
bitter sundial
#

and

#

are you

low niche
#

Thanks

bitter sundial
#

your array client.commands is in form [commands.command, commands, commands.command, commands]

#

is that what you want

low niche
#

No, I don't see why I would

#

I will head to fix it

#

Thanks again

thorny hinge
#

Anyone know how to write a prepared sqlite statement >_>

#

js

unreal tusk
#

Hey guys! How can I repeat tracks using JDA. I tried to use many ways of it, but bot doesn't repeat tracks.
private List<AudioInfo> queue;
@Override
public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) {
AudioInfo a = queue.get(0);
queue.remove(0);
queue(a.getTrack(), a.getAuthor());
if(!queue.isEmpty())
player.playTrack(queue.get(0).getTrack());
}

public void queue(AudioTrack track, Member author) {
AudioInfo info = new AudioInfo(track, author);
queue.add(info);
if (PLAYER.getPlayingTrack() == null) {
PLAYER.playTrack(track);
}
}

fervent goblet
#
while(true){
    play the track here
}```
unreal tusk
#

How can I use it?

Now I created the list of tracks and on the end of the track I remove it from start and put on the end of the list.. But bot plays tracks loaded from discord chat.

sinful meadow
#

Its not js @fervent goblet

fervent goblet
#

the code I sent was java

sinful meadow
#

didnt know you could use while in java @fervent goblet

fervent goblet
#

I think yo ucan

#

you*

#

its been a while since I've used java

unreal tusk
thorny hinge
#

so is there no way to make a sqlite prepared statement

stone kiln
#

wait in JS @thorny hinge

sinful meadow
#

Mate @unreal tusk Your token is on your source

#

Delete it

#

-bots @unreal tusk

gilded plankBOT
#
artemgafarov#2917
Bots

@mossy talon

thorny hinge
#

Yes @stone kiln

fervent goblet
#

Mzc5OTk4NDExMDA2NTQxODI0.DOyOxg.5UPxViMOw_0PpGzzmzxJeyrnizQ

#

is ur token

thorny hinge
#

Nice token

stone kiln
sinful meadow
#

Why post it jackass @fervent goblet

fervent goblet
#

KEEP. IT. SECRET. AT. ALL. COSTS.

#

why not post it?

#

its on his github anyway

sinful meadow
#

Because its called not being a dick

fervent goblet
#

lol

inner jewel
#

@unreal tusk use AudioTrack#makeClone

#

before adding it back to the queue

unreal tusk
#

Thanks. I'll try it

inner jewel
#

also don't save JDA objects

#

eg Member, User, Message

#

store user ids

earnest phoenix
#

umm

#

XD

earnest phoenix
#

@languid dragon don't ever use that script again

#

It's vulnerable

sinful meadow
#

what script? @earnest phoenix

fervent goblet
#

wot skript

earnest phoenix
fervent goblet
#

y

#

whats wrong

earnest phoenix
#

!../bot

sinful meadow
#

oh

fervent goblet
#

?

neon pasture
#

Hi

earnest phoenix
#

Yeah

#

that's a problem

#

Use a proper command handler like my bot

#

It loads commands on start

fervent goblet
#

what boat

earnest phoenix
#

ok

#

@pulsar spade

fervent goblet
#

s0urc3?

neon pasture
#

-bots mbl master -

gilded plankBOT
#

User not found

earnest phoenix
neon pasture
#

-bots PassTheMayo

gilded plankBOT
#
PassTheMayo#1281
Bots <:certifieddev:308880841382297610>

@pulsar spade certifiedbot
@errant apex certifiedbot
@proper drift certifiedbot
@terse jasper

neon pasture
#

3/4 bots certified...

earnest phoenix
#

Look at the index.js file under src folder

#

That is the proper way

#

Assigning commands to an array

#

Then check upon message

neon pasture
#

You made it in Eris, cool

earnest phoenix
#

ya

#

then d.js

#

Then Eris

#

be

#

brb*

neon pasture
#

You still have to edit that

tawny lava
#

@earnest phoenix you need more spaces in your code smfh

fervent goblet
#

?

earnest phoenix
#

nah

#

It's 4 space tabbed

#

it's gud

#

@neon pasture fixed

neon pasture
#

Cool

tawny lava
#

that's not 4 wtf

earnest phoenix
#

GitHub makes it look funky af @tawny lava

tawny lava
#

hmm

uncut slate
#

yeah it does

#

github makes tabs have the width of 8 normal chars / 8 spaces

#

over 4

earnest phoenix
#

i need help making music commands with commands handlers (discord.js) (javascript)

earnest phoenix
#

anyone knows a way to grab music from a stream like listen.moe to a bot?

earnest phoenix
#

๐Ÿ˜‰

smoky rampart
#

(python with discord.py) anyone know anyways to create an irc connection alongside the bot, googling doesn't help me, or rather if it did I couldn't comprehend it :^)

fervent goblet
#

irc connection?

#

its 2k17

#

skype replaced irc

#

discord replaced skype

smoky rampart
#

well

#

my bot is an osu! bot and osu! uses irc for in game chat

#

I was trying to attempt to get the bot to also login to the irc and provide a few of it's commands for in game use

thorny hinge
#
function getCase(){
let a = "0";
sql.get(`SELECT * FROM cases WHERE guildId = ${msg.guild.id}`).then(row => {
a = row.number;
});
return a;
}
ย ย  ```
The variable a does not update, and when I return, it just returns 0..
sqlite, nodejs
topaz fjord
#

Just use await

#

And async

#

Please

open otter
#

Hello, can someone help me please

#

I need to create a service request channel that allows people to post something but then no one can read it except me

smoky rampart
#

I recommend having your bot forward the message to a channel only you see and deleting the original message

open otter
#

Great do you have a not you can recommend?

#

Thanks

#

I have Lina Verse now but not sure if she can do it

amber snow
#

-bots AzyIsCool

gilded plankBOT
#
AzyIsCool#0933
Bots

@restive crescent

shy rose
#

@fossil oxide so would just copying your in discord help into a website qualify?

fossil oxide
#

Sure

shy rose
#

is it just so if your bot down or something?

livid mango
#

sure

fossil oxide
#

Because some users can't figure out the starting commands so they search "yourbotname help"

livid mango
#

which is literally a page that iframes a github gist

shy rose
#

but if they cant figure out the start then to google it would imply youve got a good seo ranking (or one at all)

#

would that be a wrong thing to think?

livid mango
#

i once posted my server list to various looking-scammy seo sites

#

which pushed my server list to the top of google search

#

for a while

shy rose
#

like if i search my bot name this bot list website comes up then on page ~60 is my website

livid mango
#

until 1 month after i abandoned it in march

#

i guess just google "increase search rank" mmLol

#

register your website on a bunch of websites

shy rose
#

google already hates me :/

livid mango
#

then u get higher rank mmLol

#

no google hates no one

#

fb hates me tho, fb banned me

shy rose
#

bs

livid mango
#

and discord

shy rose
livid mango
#

no don't use adwords

#

i use sketchy services

#

that looks sketchy

shy rose
#

i do now to ๐Ÿ˜›

#

oh thats a legit email

#

they want me to enrol in a $200 capain first then i get that

livid mango
#

by using sketchy services i basically opened a offshore bank account for myself

#

perfect for hiding money

shy rose
#

0-0

livid mango
#

i also wrote a discord bot using S K Y P E S D K

shy rose
#

my bot was a skype bot ๐Ÿ˜›

#

then i riped out skype cause it was shit

livid mango
#

oh so u used bot framework too?

#

oh ok

shy rose
#

and crashed every 24 hours

#

no user bot

livid mango
#

ok

shy rose
#

cause the real bot on skype are crap

livid mango
#

i use skype's official thing

shy rose
#

they cant do passive listening

livid mango
#

and i have a bot on it

#

but it is still "in review"

#

u can try

#

skype://metagon

shy rose
#

mine approved ๐Ÿ˜›

livid mango
#

shit

#

how long

shy rose
#

and its shit

#

~48 hours

#

i think

#

from memory

#

wasent long

livid mango
#

it has been more than 2 weeks for me

#

close to 3

shy rose
#

i was in when they were first out so probably before there was a big q

#

day 3 i think

livid mango
#

my bot is just featureful

#

they probably hates me

shy rose
#

mine reply ping pong

livid mango
shy rose
#

then i left it cause it didnt passive listen

livid mango
#

mine replies cat images and imgur memes and bitly and stuff

shy rose
#

and the "sense" seystem broke and theres no way to clear the sense so it was unusable on all servers

livid mango
#

do u manually update bot list lol

shy rose
#

no but i think i only left the update bot lists on the on ready not when you join a new server

livid mango
#

same

#

but i use pm2 which auto restarts

shy rose
livid mango
#

ew

#

that avatar

#

m i c r o s o f t

shy rose
#

its the skype one ๐Ÿ˜›

livid mango
#

yes

shy rose
#

i need to change it but dont know what to and i think its also copyright to skype

livid mango
#

i don't rly think so

#

does material design copyright to google?

shy rose
#

is it cheating if i add that update bots list to on join server but foget to add it to on leave server

livid mango
#

no

#

no one cares

frail panther
#

how am i in development even though i aint no devloper เฒ _เฒ 

shy rose
#

bot.serverCount=999999999999999999999999999999999999999

livid mango
#

ew roblox avatar

shy rose
#

cause you mis click general

livid mango
#

reeee

frail panther
#

ok

livid mango
#

understandable

visual surge
#

testing testing124

#

hmm

cerulean zinc
#

test clear

earnest phoenix
#

@fervent gazelle

earnest phoenix
#

hm

upper roost
#

Sup peeps, I'm tryna update my bots server counter so that I can use the new widgets and I had a question. Should I have a separate process update the server stats or should this logic be part of the bot itself?

#

As I type this, I think I know the answer, but I'll defer to more knowledgable bot makers.