#development

1 messages ยท Page 334 of 1

languid dragon
#

Goodluck !

compact scaffold
#

Thanks

earnest phoenix
#

Before i forget, Thanks @languid dragon

languid dragon
#

yo, no problemo my frand, hope ya figure it out

ornate shadow
#

yo guys I have this line of code that I took from somewhere and applied it into my bot let messageArray = message.content.split(/\s+/g); but I wanna learn more about the split function regarding the forward/backward slashes and letters and even plus sign? because I have no idea about that /\s+/g thing... I couldn't find anything

#

(javascript)

languid dragon
#

Well

#

That would be a regex

#

Regex is an expression to match in strings

ornate shadow
#

I mean from what I've deducted, that equals to a space character but it would be faster?

#

oh regex

languid dragon
#

Yes \s+ is any space

#

so if the string has spaces

#

it splits that into an array

ornate shadow
#

man you're recourceful xD

#

thanks!

languid dragon
#

If you need any more help feel free to ping me

#

And no problem :)

ornate shadow
#

โค

#

will do!

languid dragon
ornate shadow
#

ok ^_^ stumbled upon regex a few years ago when I was learning how to break complicated password using that rofl

#

I just used a tool back then

#

didn't actually learn anything

languid dragon
#

lmfao

ornate shadow
#

I know what split does though :3 but damn gotta learn this regex

#

I mean

#

is it even faster than " "?

languid dragon
#

well

#

dont think it matters really?

ornate shadow
#

hmm

#

well it doesn't matter almost at all I guess

languid dragon
#

Regex makes life a lot easier tho

ornate shadow
#

but for perfectionists oh well

#

oh?

#

ok gonna learn it now

languid dragon
#

I do have a few well examples

#

its handy for anti-advertisement

#

removing anything with https:// and .gg

#

stuff like that

#

very practical uses

ornate shadow
#

oh awesome

languid dragon
#

honestly imo i find it really fun to just play around at regexr.com

ornate shadow
#

so I could implement that into my bot

languid dragon
#

Yes

ornate shadow
#

oooh so forward slash is the opening "tag" for regex and forward slash g is the closing tag

#

ok

#

now it makes sense

languid dragon
#

/ /
is a regex

#

its almost the same as " "

#

\s is a whitespace

#
  • adds all spaces as a single thing
#

so if you have <- this

#

it'll be one object

ornate shadow
#

OH!

#

brilliant

languid dragon
ornate shadow
#

so you can have as many spaces between arguments and still work

languid dragon
ornate shadow
#

nice

#

like !command argument1 argument2 argument3

languid dragon
#

hmmm yes

ornate shadow
#

anyway thanks a lot for the info on that

#

man you're helpful

#

so glad I asked in here

languid dragon
#

No problemo dude, glad i can help :-]

ornate shadow
#

I made it so that when mentioning the bot at start with nothing else or with saying help afterwards he will send you the help ^_^

if(message.content.indexOf(message.guild.me.toString()) == 0) {
        let messageArray = message.content.split(/\s+/g);
        let botMention = messageArray[0];
        let args = messageArray.slice(1);

        if(!args[0] || args[0] === `help`)
            module.exports.printHelp(message, prefix);
    }
#

I may aswell think of making it so that mentioning the bot acts like the prefix or something like that

#

I mean if anyone wants to use bot mention instead of prefix

#

lel

#

just thinking...

#

something like

if(message.content.indexOf(message.guild.me.toString()) == 0) {
        let messageArray = message.content.split(/\s+/g);
        let command = messageArray[1];
        let args = messageArray.slice(2);
    }
ornate shadow
#

and so I did ๐Ÿ˜„ it's nice

sleek karma
#

+sa

#

+ping

stone kiln
#

wrong channel

sleek karma
#

wrong channel yeah xd

sinful meadow
#

lol

lethal sun
#

How do i convert a message sending in the console to sending it into a channel?
Expample:

search(args[1], opts, function(err, results) {
  if(err) return console.log(err);
 
  console.dir(results);
});```
#

Im using the youtube-search package

earnest phoenix
#

how can I write a command that makes the bot join the author's voice chat

#

`if (message.content === '!play') {
// Note that this will only work if the message was sent in a guild
// and the author is actually in a voice channel.
// You might want to check for all that stuff first
const channel = message.member.voiceChannel;

channel.join()
.then(connection => console.log('Connected!'))
.catch(console.error);
    
    }`
#

some thing like that

shrewd field
#

hello

#

i need help in this ```js
if(message.content === (prefix + "mute")) {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You dont have MANAGE_MESSAGES permission.");

let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!toMute) return message.channel.send("You didn't specify a user mention or ID!.");

let role = message.guild.roles.find(r => r.name === "SSBOT Muted");
if(!role) {
  try {
    role = message.guild.createRole({
      name: "SSBOT Muted",
      color: "#000000",
      permissions: []
    });

    message.guild.channels.find.forEach(async (channel, id) =>  {
        await channel.overwritePermissions(role, {
            SEND_MESSAGES: false,
            ADD_REACTIONS: false,
            SEND_TTS_MESSAGES: false,
        });
    });
  }  catch(e) {
      console.log(e.stack);
  }

}

    if(toMute.roles.has(role.id)) return messgae.channel.send("This user is already muted!.");

  return;

}```

#

i get Parsing error: Unexpected token => (Fatal)

#

as an error

#

^^

lethal sun
#
if(message.content === (prefix + "mute")) {
    if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You dont have MANAGE_MESSAGES permission.");

    let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
    if(!toMute) return message.channel.send("You didn't specify a user mention or ID!.");

    let role = message.guild.roles.find(r => r.name === "SSBOT Muted");
    if(!role) {
      try {
        role = message.guild.createRole({
          name: "SSBOT Muted",
          color: "#000000",
          permissions: []
        });

        message.guild.channels.find.forEach(async (channel, id) =>  {
            await channel.overwritePermissions(role, {
                SEND_MESSAGES: false,
                ADD_REACTIONS: false,
                SEND_TTS_MESSAGES: false,
            });
        });
      }  catch(e) {
          console.log(e.stack);
      }
    
    }

        if(toMute.roles.has(role.id)) return >messgae<.channel.send("This user is already muted!.");  //GRAMMAR SON!

      return;
  }```
#

@shrewd field

restive silo
#

wat

#
message.guild.channels.find.forEach
``` wont work at all
indigo notch
compact scaffold
#

I need a lil help

ornate shadow
#

what are the most common commands that every bot should have? I know of help and info. what else?

thorny hinge
#

Anyone good at JS and SQLite?

median lintel
#

@ornate shadow ping

ornate shadow
#

ooook I have that one

#

I mean that's too basic xD

#

but it's still a valid answer, thanks

thorny hinge
#
	var prefixargs = args.join(" ");
	if(!msg.member.permissions.has('MANAGE_MESSAGES')) return msg.channel.send("![tickNo](https://cdn.discordapp.com/emojis/315009174163685377.webp?size=128 "tickNo") You don\'t have permission to change the prefix.");
	if(!prefixargs) return msg.channel.send("![tickNo](https://cdn.discordapp.com/emojis/315009174163685377.webp?size=128 "tickNo") You must actually provide a prefix!")
        sql.run("CREATE TABLE IF NOT EXISTS prefixes (guildId TEXT, prefix TEXT)").then(() => {
                sql.run("INSERT INTO prefixes (guildId, prefix) VALUES (?, ?)", [${msg.guild.id}, ${prefixargs}]);
        });

    
        sql.get(`SELECT * FROM prefixes WHERE guildId =${msg.guild.id}`).then(row => {
              if(!row) {
                    sql.run("INSERT INTO prefixes (guildId, prefix) VALUES (?, ?)", [`${msg.guild.id}`, `${prefixargs}`]);
                    msg.channel.send(`![tickYes](https://cdn.discordapp.com/emojis/315009125694177281.webp?size=128 "tickYes") Successfully changed the prefix to \`${prefixargs}\`!`)
              } else {
                  sql.run(`UPDATE prefixes SET prefix = ${prefixargs} WHERE guildId = ${msg.guild.id}`);
                    msg.channel.send(`![tickYes](https://cdn.discordapp.com/emojis/315009125694177281.webp?size=128 "tickYes") Successfully changed the prefix to \`${prefixargs}\`!`);
              }
        });

Error: SQLITE_ERROR: no such column:

pale light
#

h

#

i

thorny hinge
#

H

#

E

#

Y

ornate shadow
#

๐Ÿคฆ

thorny hinge
#

I gave up on that >_> @pale light

pale light
#

Oh rip

thorny hinge
#

I tried looking at it but it looks fine

ornate shadow
#

god dammit I suck so hard Q_Q

#

can anyone teach me, using Node.js and MySQL, how to store a value off a table into a variable? I'm really having trouble doing so...

uncut slate
#

mm, I know about SQLite but that's it

#

I'd recommend looking at the docs

#

they've got to have an example for something like that

ornate shadow
#

docs of what?

jagged plume
#

sqlite and mysql have basically the same syntax

keen wing
#

Wuts your code

#

Give us a sample

ornate shadow
#

I don't even know anymore what's my code cuz I googled a lot and changed it a lot but gonna paste what I got rn...

keen wing
#

What ORM you using

ornate shadow
#

what's that?

languid dragon
#

depends on your uh

#

thing

#

SELECT * FROM table`

uncut slate
#

I seriously doubt he's using an ORM

keen wing
#

Object Relation Map

languid dragon
#

fail exmaple

uncut slate
#

ehm, no

ornate shadow
#
let sql;

        con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        sql = result;
            console.log(result);
      });

ok this is one way I tried it and it makes sql undefined...

uncut slate
#

ew, use prepared statements

ornate shadow
#
let sql = `SELECT cooldown FROM xp WHERE id = '${message.author.id}'`;
#

this is another way

languid dragon
#

the result would be one line

#

result[0].something

#

unless there is multiple cooldowns

#

you'd literate through them

keen wing
#

Use this http://docs.sequelizejs.com/,
Define the model then you can do something like

You can do something like;

models.GuildMembers.findAll({ where: { family_name: 'abc' }}).then((guild_members) => {
   console.log(guild_members)
})
languid dragon
#

[1][2][3] etc

uncut slate
#

I wouldn't suggest using an ORM at this level

ornate shadow
#

well there's only one value, @languid dragon

languid dragon
#

show table?

ornate shadow
#

mysql> SELECT cooldown FROM xp WHERE id = 95917302813310976;
+----------+
| cooldown |
+----------+
| 60 |
+----------+
1 row in set (0.00 sec)

mysql>

keen wing
#

@ornate shadow

Try this instead:

    con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);
      });
#

You are trying to assign result to sql ya?

ornate shadow
#

C:\Users\Chipp\Desktop\Yasashii Bot 0.1.3 PBE\node_modules\mysql\lib\protocol\Parser.js:80
throw err; // Rethrow non-MySQL errors
^

TypeError: Cannot read property 'cooldown' of undefined

#

yes I am

#

I just want that int value of 60

#

from that table

#

never used sql before and I'm not the best at javascript

keen wing
#

Paste more of your code

#

Trying to understand your control flow

ornate shadow
#
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
        if(err) throw err;

        let experience = 0.0;
        let letters = message.content.length;
        if(letters > 100)
            letters = 100;

        for (let i = 1; i <= letters; i++)
            experience += ((100 - i) + 1) / 100;

        experience = Math.ceil(experience);
        console.log(experience);

        let sql;

        con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);
      });

        if(experience > sql.cooldown) {
            experience = sql.cooldown;
        }

        con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
        console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);

        if(rows.length < 1) {
            sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
        } else {
            let xp = rows[0].xp;
            sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
        }

        con.query(sql);
    });
#

well deleted the sql = result;

keen wing
#

Thanks let me read

jagged plume
#

trying to get sql.cooldown but u havent assigned anything to sql

#

also the rest of that code needs to go in the callback

ornate shadow
#

I said I deleted the sql = result;

#

cuz he asked me to

keen wing
#

Try this

con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
    if(err) throw err;

    let experience = 0.0;
    let letters = message.content.length;
    if(letters > 100)
        letters = 100;

    for (let i = 1; i <= letters; i++)
        experience += ((100 - i) + 1) / 100;

    experience = Math.ceil(experience);
    console.log(experience);

    let sql;

    con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);

        sql = result

        if(experience > sql.cooldown) {
            experience = sql.cooldown;
        }

        con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
        console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);

        if(rows.length < 1) {
            sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
        } else {
            let xp = rows[0].xp;
            sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
        }

        con.query(sql);
    });
});
jagged plume
#

yeah that looks better

keen wing
#

The problem was sql var was being called before your sql query (select cooldown) finished executing

ornate shadow
#
3
[ RowDataPacket { cooldown: 60 } ]
undefined = undefined - 3
44
[ RowDataPacket { cooldown: 60 } ]
undefined = undefined - 44
44
[ RowDataPacket { cooldown: 21 } ]
undefined = undefined - 44

this is the console.log ๐Ÿ˜•

#

still undefined

keen wing
#

Which line that from?

ornate shadow
#

it's the console

#

the console.log output

#

but sql is probably undefined

keen wing
#

What's the output of result?

#

I thinks it's need to be sql = result[0]

ornate shadow
#

the thing is that I was using sql already for something else and figured I would use it for getting data off my table before overwriting it with some new code

#

but I will try that

#

crash

#
C:\Users\Chipp\Desktop\Yasashii Bot 0.1.3 PBE\node_modules\mysql\lib\protocol\Parser.js:80
        throw err; // Rethrow non-MySQL errors
        ^

TypeError: Cannot read property 'cooldown' of undefined
keen wing
#

Paste the output of result

 con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);
#

Need to find out the format it returns first

ornate shadow
#

[ RowDataPacket { cooldown: 60 } ]

keen wing
#

Oooo

ornate shadow
#
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
        if(err) throw err;

        let experience = 0.0;
        let letters = message.content.length;
        if(letters > 100)
            letters = 100;

        for (let i = 1; i <= letters; i++)
            experience += ((100 - i) + 1) / 100;

        experience = Math.ceil(experience);
        console.log(experience);

        let variable;

        con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);
      });

        if(experience > variable.cooldown) {
            experience = variable.cooldown;
        }

        con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
        console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);

        let sql;

        if(rows.length < 1) {
            sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
        } else {
            let xp = rows[0].xp;
            sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
        }

        con.query(sql);
    });

I changed the sql variable into variable variable so you can see what's my intention

keen wing
#

Try add this and paste the output

console.log(result.cooldown)
console.log(sql.cooldown)
ornate shadow
#

ok

keen wing
#

Ah wait

#

You still haven't fixed the code like I asked before

ornate shadow
#

I did but undo'd

keen wing
#
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
    if(err) throw err;

    let experience = 0.0;
    let letters = message.content.length;
    if(letters > 100)
        letters = 100;

    for (let i = 1; i <= letters; i++)
        experience += ((100 - i) + 1) / 100;

    experience = Math.ceil(experience);
    console.log(experience);

    let sql;

    con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);

        sql = result

        if(experience > sql.cooldown) {
            experience = sql.cooldown;
        }

        con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
        console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);

        if(rows.length < 1) {
            sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
        } else {
            let xp = rows[0].xp;
            sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
        }

        con.query(sql);
    });
});
#

The rest of the code starting from line if (err) throw err; till con.query(sql); needs to be in the callback of con.query(SELECT cooldown FROM xp W`

ornate shadow
#

well that's exactly what I'm trying to tell you

#

I'm using sql for two purposes

#

read my paste for when I changed my sql variable into variable variable to avoid confuzion

#

I may aswell remove that variable part and the code will still work but that would defeat the purpose of me struggling to make variable work

#

the variable part is a totally different part in the code and it's not until the end

#

just a snippet

keen wing
#

Ya I understand

#

But nodejs not like that

#

It's asynchronous

#

So if you make a sql query in the middle of the code, nodejs will not wait for it to finish, but just continue on running

ornate shadow
#

wow

#

rude xD

#

rude node.js

keen wing
#

To make it wait you need to insert rest of the code inside the callback

ornate shadow
#

ok I did so

#

lemme paste the two lines

keen wing
#

That's what also make it fast xD

ornate shadow
#

undefined
undefined

#

the two lines of code

#
console.log(result.cooldown)
console.log(sql.cooldown)
keen wing
#

You see this

 con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        // To ensure you have value from result, rest of the code to be here
       // So you assign sql = result here.
    });
#

Ok wait

ornate shadow
#

ok

keen wing
#

Try add this line

con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
    if(err) throw err;

    let experience = 0.0;
    let letters = message.content.length;
    if(letters > 100)
        letters = 100;

    for (let i = 1; i <= letters; i++)
        experience += ((100 - i) + 1) / 100;

    experience = Math.ceil(experience);
    console.log(experience);

    let sql;

    con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
        if (err) throw err;
        console.log(result);

        // CHANGE HERE
        sql = result[0]
        console.log(sql)

        if(experience > sql.cooldown) {
            experience = sql.cooldown;
        }

        con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
        console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);

        if(rows.length < 1) {
            sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
        } else {
            let xp = rows[0].xp;
            sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
        }

        con.query(sql);
    });
});
#

sql = result[0]

ornate shadow
#
[ RowDataPacket { cooldown: 60 } ]
RowDataPacket { cooldown: 60 }
#

probably first from result and second from sql

keen wing
#

Ya nice

#

So sql now assigned

ornate shadow
#

I think it might be fixed now

keen wing
#

Rest of the code should work

ornate shadow
#

dunno

#

lemme try

#

holy shit it works!!!!

#

๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„

#

thank you so much but I have no idea how

#

gotta study this code now LOL

keen wing
#

๐Ÿ‘Œ

ornate shadow
#

me is happy

#

me is going for a smoke

keen wing
#

Read about nodejs control flow to understand how it works better

ornate shadow
#

ok thank you so much! ^_^

keen wing
#

Np

neon pasture
#

How do I send a DM with Eris?

stone kiln
#

isn't it something like

getDMChannel(userID)```
and then send it
neon pasture
#

Yeah, TypeError: Request path contains unescaped characters

#

Trying to send a embed.

stone kiln
#

show the part of the code that gives the error

neon pasture
#

It send the Check your DMs for the command list part

#

but not the embed

stone kiln
#

hmmm

#

i don't see it for now will give info i see something

neon pasture
#

Okay, thank you

short siren
#

Discord.js How would i restrict a command to only people who have upvoted

thorny hinge
#

Check who upvotes your bot and then make an if statement that blocks the people who dont upvote

jagged plume
#

getDMChannel returns a promise, you need to use .then or await @neon pasture

neon pasture
#

Okay

#
  // Content
});```
jagged plume
#

wat

neon pasture
#

So this isn't going to work?

jagged plume
#

no

#

you need to use bot.getDMChannel(msg.author.id).then or use async/await

#

pls tell me u know what that means

neon pasture
#

yeah, i know what it means

#

Thank you Thomas

jagged plume
#

np

wooden shoal
#

Isnt the dm channel id the same as the users id? My bot just send a message to the users id and that dms them

median lintel
#

^

frail kestrel
#

o cool

#

dev channel

#

:3

pale light
#

:3

shrewd field
#

hey i have this code for a mute command but it wont work and wont give any errors

if(message.content === "mute") {
    if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You dont have MANAGE_MESSAGES permission.");

    let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
    if(!toMute) return message.channel.send("You didn't specify a user mention or ID!.");

    let role = message.guild.roles.find(r => r.name === "{SS}BOT Muted");
    if(!role) {
      try {
        role = message.guild.createRole({
          name: "{SS}BOT Muted",
          color: "#000000",
          permissions: []
        });

        message.guild.channels.find.forEach(async (channel, id) =>  {
            await channel.overwritePermissions(role, {
                SEND_MESSAGES: false,
                ADD_REACTIONS: false,
                SEND_TTS_MESSAGES: false,
            });
        });
      }  catch(e) {
          console.log(e.stack);
      }

    }

        if(toMute.roles.has(role.id)) return message.channel.send("This user is already muted!.");

      return;
}```
#

no error

#

no response

restive dome
#

looking for experienced node developers to take on paid work, PM me if interested

restive silo
#

owoah did i hear money

neon pasture
#

lol

lethal sun
#

How do i convert a message sending in the console to sending it into a channel?
Expample:

search(args[1], opts, function(err, results) {
  if(err) return console.log(err);
 
  console.dir(results);
});```
#

Im using the youtube-search package

inner jewel
#

get channel by id -> send

earnest phoenix
#

is there a way to check for not just .play but with .play and variables

inner jewel
#

startsWith vs ==

earnest phoenix
#

message.startsWith?

inner jewel
#

is message a string?

#

or an object?

earnest phoenix
#

object

inner jewel
#

startsWith is for strings

earnest phoenix
#

tbh I'm not sure if it's a string or an object

#

message is the message I type

fickle solstice
#

i want a mention prefix like @spice wren when i type @tired lodgename it will send prefix fix is - how can i do that?

bitter sundial
#

a mention is formed as <@id>

#

so yours is @fickle solstice

#

or <@!id> if it has a nickname

pale light
#

<><>

inner jewel
#

if(string matches "<@!?yourid>"

supple shale
#

@earnest phoenix use discord.ext.commands instead of some message.content stuff

earnest phoenix
#

like case?

#

go read & learn

#

it's js though

supple shale
#
@commands.command(pass_context=True)
async def play(self,ctx,url):
    -- play url and stuffs
args = message.content.split(" ")
some other stuff```
#

oh:I

earnest phoenix
#

ew

supple shale
#

theres one for js i believe

inner jewel
#

discord.js-commando

earnest phoenix
#

.js or .io ?

inner jewel
#

js afaik

lethal sun
#

@inner jewel example? for my code ^^^

inner jewel
#

look at the lib docs

earnest phoenix
#

I think I fucked up somewhere and used both

inner jewel
#

how to get channel by id

earnest phoenix
#

but js primarily

inner jewel
#

and etc

earnest phoenix
#

can't find an example on it from the discord js docs

uncut slate
#

do what

earnest phoenix
#

@shrewd field You are try/catching within that code, but I don't think e.stack is a thing

#

when trying to log an undefined property, it won't log anything at all

#

Iirc

uncut slate
#

it is

earnest phoenix
#

when I try to run this with a youtube link it says song is not defined

#

anyone got an idea why?

#

Are you sure you're getting the right args?

#

args[1]

#

are you sure it's not args[0]

#

?

#

if the command is .spela (link) it should take the link right?

#

depends how you set it up

#

also, nice stolen code

#

from trek example code

#

Ytdl*

#

yeah I started doing bot stuff this week

#

very new

#

If you just started making a bot, I wouldn't try music until you're experienced

#

oh well I got it to play music from a constant

bitter sundial
#

I started my bot as a music bot mmLol

earnest phoenix
#

I got it to work btw

#

thanks @earnest phoenix it was args[0] that was the actual link

#

np

ornate shadow
#

Is it OK if I let my bot create tables for each guild? Or should I just add another column for the user's guild?

#

(SQL)

#

I think I should just add a column...

uncut slate
#

No.

#

Don't create a table for each guild

#

lmao

ornate shadow
#

yeah... lol

#

inb4 database gets filled with thousands of tables

jagged plume
#

just add a row with the guild id

ornate shadow
#

yeah

#

I h ad a bad idea for a moment

#

column*

neon pasture
#

A fucking column lol, a row is just fine and better

abstract mango
#

dav says arrays start at 1

pale light
solemn hare
#

where do I request a bot?

uncut slate
#

'request a bot'?

solemn hare
#

request for someone to make a bot for an app

#

like I'm wanting a bot for free gold for tanks, how do I request that

uncut slate
#

First of all, you're thinking of the wrong kind of bot

#

we make chat bots / Discord bots

#

second of all, wrong channel

#

and third, our goal isn't to make free bots for people, so you won't be "requesting a bot"

solemn hare
#

yea sorry, Im in the wrong channel

karmic lake
#

xD

earnest phoenix
#

blobthonkang ...

#

K

wooden shoal
#

wut te fuk

vale orbit
#

๐Ÿ˜‚

small solar
#

are you able to make your bot send a welcome message to a guilds general channel when it first joins?

#

also if a user doesnt have an avatar like me, how do you show the default avatar?

small solar
#

ok moved

#

xD

median lintel
#

it gets the milliseconds

#

of the bots uptime

small solar
#

oh

#

i wanted something like hours

#

so like 4hrs it'd be currently

median lintel
#

u have to use some calculations

round solstice
#

I log it like

@boot
$boot = Time.now
end

and on demand

Time.now - $boot

median lintel
#

stuff

small solar
#

idk how tho thats the reason xP

round solstice
#

And then calculate it using modulators or however they are called

inner jewel
#

modulo

round solstice
#

ty

median lintel
#

humanize-duration

round solstice
#

Time.now.hours

small solar
median lintel
#

no

small solar
#

ok

median lintel
#

u ned to use math calculations

#

or use a module called humanize-duration :)

small solar
#

ok

languid dragon
#

can u do multiple embeds in the same message?

wanton nova
#

I have a question about the API of discordbots.org... where do you use it, and how?

median lintel
#

use it using snekfetch

wanton nova
#

okay

#

in like general code right?

median lintel
#

wat

#

tf u mean

pale light
#

snekfetch

earnest phoenix
small solar
#

so

#

humanizeDuration(client.uptime, { units: ['h'] })

#

would work?

earnest phoenix
#

yes

small solar
#

yay ok

#

ty

#

how do you get your bots mem usage?

languid dragon
#

Do you use discord.js?

small solar
#

ye

languid dragon
#

if you read the documentation i believe it should be ezpz to get the memory usage

small solar
#

ok ty

abstract mango
#

hey, just a disclaimer: https://github.com/giulio1234 has been going around forking bots and leaking tokens on github. not sure if these are stolen. but I found his id and it seems like he's here and on dbots as well, so to the mods, keep a eye out for 294129532531638272 and possible clone bots

umbral pelican
#

wut

#

-bots @earnest phoenix

gilded plankBOT
#
! GแดDส™๐Ÿ‘ป !#3353
Bots

@sharp galleon
@pearl cliff

umbral pelican
#

๐Ÿคท

prime cliff
#

You should also add this to your body to fix the clipping of the bottom background-attachment: fixed;

neon pasture
#

How can I select a .json file? Like in php it's file_get_contents. But how do I use that in javascript?

languid dragon
#

i think you can do that with just the require thing

#
const jsonFile = require("./file.json");```
neon pasture
#

How do I read a json file from a url instead local with fs.readFile

languid dragon
#

fs.readFile("http://link.com/to-file.json");

#

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

#

not work?

neon pasture
#

Still things the url is a file.

#

open 'C:\Users\User\Documents\Eigen Projecten\discord\popcorntime\https:\link.com/test'

languid dragon
#
const http = require("http");
const file = fs.createWriteStream("file.docx");

http.get("http://www.example.com/test.docx", response => {
  response.pipe(file);
});
neon pasture
#

but what is file.docx then?

flint urchin
#

๐Ÿฅ„ ๐Ÿ‘ถ

languid dragon
#

ngl not sure

bitter sundial
#

the file you write to

neon pasture
#

You download the file?

#

So it's local host then?

flint urchin
#

You GET the file, you just use the file variable to use it

neon pasture
#

I used the package request and it worked

#

Thanks guys for helping me

small solar
topaz fjord
#

Lib

lethal sun
#

Anyone got a working calculator command example?

#

discord.js

stone kiln
#

isn't that just input1 handler input2

earnest phoenix
#

@lethal sun use math.js module

#

require("math.js").eval("2 * 3 + 5")

#

I think it's actually called "math"

#

@small solar that's because the variable that you are using for uptime is not a valid number

#

it should be in milliseconds

glossy oracle
#

@small solar Because you may use a module that expect a number

#

And you don't give a number

#

Maybe a string

earnest phoenix
#

tt

#

may i ask if this is the correct way to use the .status function?

client.user.status(dnd)

the lib is discord.js

#

it crashed

#
client.status.number(2)
#

this prob wrong too

lethal sun
#

its bot.user.status

#

not client.user.status

earnest phoenix
#

@lethal sun m

#

it is actually client

median lintel
#

@lethal sun client is what then defined as the "bot client"

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

oops

weak parrot
#

Lol

earnest phoenix
#
const client = new Discord.Client();
#

see

#

its client

#

not bot

inner jewel
#

@lethal sun "bot" vs "client" are variable names

lethal sun
#

bot is working perfectly for my two bots

#

ok

#

noice

inner jewel
#

you can't say it's wrong if you haven't even read where he declares it

lethal sun
#

ye i figured that out

earnest phoenix
#

how do i set it to be idle/dnd

lethal sun
#

under the "ready" thing

#

type in that

earnest phoenix
#

oh so i do a extra dot?

#
client.user.status.idle
#

prob fixed it now

languid dragon
#

๐Ÿ‘€

#

no

#

Discord.JS?

unique star
#

client.user.setStatus("idle")

earnest phoenix
#

i did that code

#

and now the commands apper as the help command

languid dragon
#

wot ๐Ÿ‘€

unique star
#

wot ^ 2

earnest phoenix
#

fixing shit

#

be back

#

Guys how can i make a "Playing [GAME]" under the bot's name?

languid dragon
#

Lib?

inner jewel
#

update presence

earnest phoenix
#

?-?

languid dragon
#

Discord.JS?

earnest phoenix
#

yes

earnest phoenix
#

this will help me?

inner jewel
#

read it

earnest phoenix
#

ok

languid dragon
#

It is the official documentation?

unique star
#

i mean they could also use .setGame

earnest phoenix
#

guys thank you

languid dragon
earnest phoenix
#

or thanx to @languid dragon (Skippy)

#

ClientUser?

languid dragon
#

well

#

<DiscordVariable>.user...

#

so like

earnest phoenix
#

oh

#

ok

languid dragon
#

the user instance of your client/bot

earnest phoenix
#

i use client

languid dragon
earnest phoenix
#

anyways thanx

languid dragon
#

np x

earnest phoenix
languid dragon
#

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

#

possibly a bug in the lib (or that v)

unique star
#

If you change your status too often

#

your status cannot be changed for some time

#

its to prevent status change spamming

earnest phoenix
#

i just did it once

unique star
#

restarting the bot also changes its status

earnest phoenix
#

yeah i know

#

its a bug because the other times it wasnt working

#

so i wasnt abusing the changing thing

#

oh lmao it fineally changed to dnd

#

it took long

#

working now

languid dragon
#

yeet, nice

unique star
#

Discord tend to behave weird with status

#

or presence in general

inner jewel
#

php

unique star
#

natan plx

languid dragon
#

@earnest phoenix easiest way to use a custom emoji is to have them in your server or something right
then you do this
var emoji_to_use = client.guilds.get(your_guild_id).emojis.get(emoji_id)
and then send emoji_to_use or message.react(emoji_to_use )

Should work like that

neon pasture
#
  'test'
});```
How do I add content inside the createMessage?
languid dragon
#

Content?

neon pasture
#

yes

#

Just text

languid dragon
#

You mean the message itself?

#

remove the {'test'}

#

and replace it with "The message to send"

#

it only needs to be string ๐Ÿ‘€

neon pasture
#

Thanks ๐Ÿ˜ƒ

languid dragon
#

np xox

earnest phoenix
#

little help here, i try to make a command but it says something with /NN at the end in the cmd, what does it mean?

prime cliff
elfin hatch
#

hello

earnest phoenix
#

so you have any idea?

neon pasture
#

What lib?

earnest phoenix
#

discord.js

neon pasture
#

/NN at the end of your command?

earnest phoenix
#

no, i mean i use a fake keyword to check if the command works, wich is voicetestingXDok but whenever i use it it shown on the cmd

i /NN
wrote /NN
voicetestingXDok /NN

if i say "i wrote voicetestingXDok"

#

to other commands it does not happen

#
else if(args[i].includes("voicetestingXDok"))
        {
          console.log(`in yay`);
          voiceTTS(msg, args);
          return;
        }

it doesn't even show the console.log

lethal sun
#
        case "yt":
        if (args[1]) {
        search(args[1], opts, function(err, results) {
            if(err) return message.reply(`${err}`);
            
             message.reply(`${results}`);
        });
        } else {
        message.channel.send("smh...")
        }
            break;```
How do i make so the "results" gets send in a channel and not console... I did that code ^ but this is what I get: https://imgur.com/uc613rJ
prime cliff
#

Isnt it supposed to be arg[0]

lethal sun
#

youtube-search package

#

hm

prime cliff
#

Arrays always start at 0 and not 1

lethal sun
#

hm

#

brb

earnest phoenix
#

later can you help me with my problem?

lethal sun
median lintel
#

how do i check if my bot has a specific permission?

prime cliff
#

Thats easy even for you to say that Thonk

#

If its d.js look at the docs

earnest phoenix
#

message.channel.permissionsFor(msg.guild.me).has('permission name')

sinful meadow
#

@lethal sun Try results.url

#

or message.channel.permissionsFor(client.user).has('JASS_PERM') @median lintel

small solar
#
if (!message.author.id === owner) return message.channel.send(`:no_entry_sign: You aren't the owner of the bot.`);

why wouldn't this be working in my eval?

uncut slate
#

owner could be not defined

small solar
#

owner is a thing tho

uncut slate
#

if it is defined properly it would work properly

small solar
#

ok

#

also it doesnt crash

#

if you run eval it just says
"undefined"

uncut slate
#

..

#

yeah

#

probably because you didn't specify any args

small solar
#

oh ok

#

so

#

just put the id instead of owner and check for args?

uncut slate
#

no, pass args

#

send eval msg.channel.send('f') instead of just eval

small solar
#

ok

small solar
#

how do you use some kind of for each thing to send a message in a channel for each object in an array?

#

and also how do you get the position/content too?

uncut slate
#

What?

#

Your question is too vaguely worded

small solar
#

like i have an array with 2 or 3 objects (containing user ids), so for each object in the array, i want to send a message to a channel with the position its in the array, and the content of it

#

does that make more sense?

languid dragon
#
for(var index = 0; array.length>index; index++){
 array[index].id
}

?

#

Really depends

#
for(var object in array){}
earnest phoenix
#

@small solar Umm, no

#

you can't put a ! before something within an IF if you are using ===

small solar
#

Oh..

earnest phoenix
#
if (message.author.id !== owner) return message.channel.send(`:no_entry_sign: You aren't the owner of the bot.`);```
small solar
#

Thx

earnest phoenix
#

No problem

pale light
#

yeah

#

darnit

#

I'm too late

wanton nova
#

I have this here:

 <body background="http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg">

And for some reason this isnt changing my background

#

for the page

languid dragon
#

Because

#

Background isnt an attribute

wanton nova
#

oh okay

languid dragon
#

style="..."

wanton nova
#

background-image?

#

oh

languid dragon
#

Is an attribute

wanton nova
#

okay

#
 <body style="http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg">
#

correct @languid dragon?

languid dragon
#

Lmfao no

wanton nova
#

oh

languid dragon
#

Do you know CSS?

wanton nova
#

oh that works as well?

#

i thought it was only HTML

languid dragon
#

What

#

Omg

#

Inline CSS is the same

wanton nova
#

oh

languid dragon
#

Background-image:....

#

You put that inside the style attribute

wanton nova
#

so

<style>
background-image: "url"
</style>
languid dragon
#

Or yoy put it inside style tags

#

Yes

wanton nova
#

erm

#

still not appearing...

#
<style>
background-image: "http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg"
rest of code
</style>
languid dragon
#

Ok

#

background-image:url(...)

wanton nova
#

ah okay

#

does the </style> go at the very end of my code

#

or like

<style>
background-image: url"http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg"
</style>
languid dragon
#

Url with ()

#

No quotes

wanton nova
#

okay

languid dragon
#

And helps 2 be at the end or inside head tags

wanton nova
#

okay

languid dragon
#

But since i assume you're doing this for your bot

#

Just at the beginning is fine

karmic lake
#

what happened in here

languid dragon
#

๐Ÿ˜ฉ

karmic lake
#

yes

#

that is exactly

#

;3

#

shhhh

#

shhhhhhhh

earnest phoenix
#

@wanton nova um no

#

not at all

patent reef
#

@wanton nova U here

#

Iโ€™ll show u

#

It might look weird since im writing this from mobile

#
<style>
.body {
background-image: url(the url);
}
</style>
#

Use that ^^

abstract mango
#

mostly good except for indents, but that's style, not function

wanton nova
#

Im still not getting the background :P

rich kiln
#
<style>
body: {
        background: url("https://www.walldevil.com/wallpapers/w05/anime-manga-buildings-architecture-urban.jpg") no-repeat center center fixed;
        background: url("url") no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
}
</style>
wanton nova
#

i dont really want the fancy things, yet the style...

#

Im not sure if i should put it like you have

#

or put it at the very end of my code

rich kiln
#

dont think it'll make any difference lol

wanton nova
#

none of them i tried work xD

#

when i put it at the end

rich kiln
#

but i'm not shure

wanton nova
#

everything was blank

rich kiln
#

gimme ur bg url pls

wanton nova
#

like no desc was there

#

one minute

#

this

rich kiln
#

something is wrong with your HTML then

#

@wanton nova can u send us your code?

karmic lake
#

^^^

#

we can help if you do

wanton nova
#

oh sorry

#

i wasnt paying attention xD

#
<html>
<head>
<style>
body: {
        background: url("http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg") no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
}
</style>
  <font face="Verdana" color="#BDC3C7">
  <center><h1>Snap</h1>
  <p>This is a bot where you can do multiple things!</p>
  <p><font size="4"> Some Commands: <br />
  โ—ผ๏ธ >Help โ„น๏ธ <br />
  Shows this page but preetier! <br />
  โ—ผ๏ธ >Ping ๐Ÿ“ <br />
  Shows my ping! <br />
  โ—ผ๏ธ >Minecraftuser ๐Ÿ‘ฅ <br />
  Shows information about the specificed Minecraft Player! <br />
  โ—ผ๏ธ >Avatar ๐Ÿ‘ค <br />
  Sends a link of Specificed User's Avatar or Your Avatar! <br />
  โ—ผ๏ธ >Play โฉ <br />
  Plays music! <br />
  โ—ผ๏ธ >Queue ๐Ÿ“œ <br />
  Shows the music in queue! <br />
  โ—ผ๏ธ >Np โ–ถ <br />
  Shows currently playing song! <br />
  โ—ผ๏ธ >Pause โธ <br />
  Pauses the music! <br />
  โ—ผ๏ธ >Unpause โฏ <br />
  Unpauses the music! <br />
  โ—ผ๏ธ >Skip โ›” <br />
  Skips the currently playing song! <br />
  โ—ผ๏ธ >Stop โน <br />
  Stops the music! <br />
  โ—ผ๏ธ >Userinfo ๐Ÿ˜ <br />
  Shows information about a user! <br />
  โ—ผ๏ธ >Serverinfo ๐ŸŒŽ <br />
  Shows information about the server! <br />
  โ—ผ๏ธ >Uptime ๐Ÿ•’ <br />
  Shows how long I've been up for! <br />
  โ—ผ๏ธ >Calculate โž– <br />
  Helps you calculate a math problem! <br />
  โ—ผ๏ธ >Botinfo ๐Ÿค– <br />
  Gets the bot's info! <br />
  โ—ผ๏ธ >Servers ๐ŸŒŽ <br />
  Fetches how many servers the bot is in! <br />
  </p>
  </html>
  </font>
  </center>
#

@rich kiln

rich kiln
#

you dont need html tag.

#

also.

#

</html> </font> </center>

#

html tag should be like the last tag GWbowsuBlobThonkeng

wanton nova
#

oh GWchadMEGATHINK

#

is there anything else wrong?

rich kiln
#

try it lol

wanton nova
#

it did nothing

#

xD

rich kiln
#

ok give me a sec

#
<style>
    body: {
        background: url("http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg") no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }
</style>
<center>
    <h1>Snap</h1>
    <p>This is a bot where you can do multiple things!</p>
    <p>
        <font size="4"> Some Commands: <br /> โ—ผ๏ธ >Help โ„น๏ธ <br /> Shows this page but preetier! <br /> โ—ผ๏ธ >Ping ๐Ÿ“ <br /> Shows my ping! <br /> โ—ผ๏ธ >Minecraftuser ๐Ÿ‘ฅ <br /> Shows information about the specificed Minecraft Player! <br /> โ—ผ๏ธ >Avatar ๐Ÿ‘ค <br /> Sends a link of Specificed User's Avatar or Your Avatar! <br /> โ—ผ๏ธ >Play โฉ <br /> Plays music! <br /> โ—ผ๏ธ >Queue ๐Ÿ“œ <br /> Shows the music in queue! <br /> โ—ผ๏ธ >Np โ–ถ <br /> Shows currently playing song! <br /> โ—ผ๏ธ >Pause โธ <br /> Pauses the music! <br /> โ—ผ๏ธ >Unpause โฏ <br /> Unpauses the music! <br /> โ—ผ๏ธ >Skip โ›” <br /> Skips the currently playing song! <br /> โ—ผ๏ธ >Stop โน <br /> Stops the music! <br /> โ—ผ๏ธ >Userinfo ๐Ÿ˜ <br /> Shows information about a user! <br /> โ—ผ๏ธ >Serverinfo ๐ŸŒŽ <br /> Shows information about the server! <br /> โ—ผ๏ธ >Uptime ๐Ÿ•’ <br /> Shows how long I've been up for! <br /> โ—ผ๏ธ >Calculate โž– <br /> Helps you calculate a math problem! <br /> โ—ผ๏ธ >Botinfo ๐Ÿค– <br /> Gets the bot's info! <br /> โ—ผ๏ธ >Servers ๐ŸŒŽ <br /> Fetches how many servers the bot is in! <br />
    </p>
</center>
#

try that.

wanton nova
#

still doesnt work...

#

Welp

#

i gtg... you can DM me the fixes if youd like

rich kiln
#

k

languid dragon
#

ok theres so much wrong with his code i wanna cry

#

also <font size="4">

#

there is no </font>

#

so its an open tag

#

that'll create errors

pale light
#

how do you get the news off a website and post it ;-;

#

news = daily news

languid dragon
#

Using API

#

You'd need some sort of News API

pale light
languid dragon
#

well use a request or snekfetch to grab the the information to display

#

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

patent reef
#

I didnt notice the โ€œfont size=4โ€ ๐Ÿ˜‚๐Ÿ˜‚

languid dragon
#

reeeeeee triggers me

#

its html 4

#

old stuff

patent reef
#

5 > 4

languid dragon
#

well yeah, basic math? DUHHH

pale light
#

after you get the data how do you store and output >.<

#

I can't read docs well rip

languid dragon
#

well it would be a massive json object

#

you'd need to literate through it

#

if you want to see what the object looks like just console.log(result)

pale light
#

what if you don't use JSON :[

#

nvm

languid dragon
#

๐Ÿ‘€

#

lmfao

pale light
#

how to literate through

#

<- doesn't use JSON

languid dragon
#

๐Ÿ‘€

pale light
#

๐Ÿ˜…

earnest phoenix
#

how do you make a bot

#
client.user.token
radiant plover
#

step 1: cut a hole in a box

earnest phoenix
#

thanks

#

but step one is geting a eval command

#

then entering !eval client.user.token

#

in a public chat

languid dragon
#

r u asking a genuine question or

earnest phoenix
#

@languid dragon i know how to code a bot

languid dragon
#

ok lol

earnest phoenix
#

this was a joke if you agree

#
      console.log("the following results for changing the status")
      console.log(result)
#

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

earnest phoenix
#

how do i make reactions

sinful meadow
#

wym @earnest phoenix

earnest phoenix
#

i cant put shit together from the docs

sinful meadow
#

like?

earnest phoenix
#

making reactions is harder than embeds

sinful meadow
#

I wanna know what you are trying to do

#

Making reactions in embeds?

#

tf do you mean by that

earnest phoenix
#

no

sinful meadow
#

What are you trying to do @earnest phoenix

earnest phoenix
#

so anyways

languid dragon
#

Making emojis
or reacting to a message with an emoji

sinful meadow
#

^^^^^^^

earnest phoenix
#

when it sends the message it want it to make 3 reactions

sinful meadow
#

ok

#

do something like this

languid dragon
#

message.react(emoji)

sinful meadow
#
message.channel.send('dsadsa').then(e =>{
e.react('EMOJI')
})
#

But instead of 1

#

Do 3

#

And also

#

Embeds aint hard

#

^^^^^^ Go to that it helps alot

earnest phoenix
#

i know that

#

i said embeds are easyier than reacting emotes

#

prob had made a mistake

languid dragon
#

if you need to get an emoji from some server simply do
var emojiToUse = client.guilds.get("guild_id").emojis.find("name", "nameOfEmoji")
then message.react(emojiToUse)

sinful meadow
#

;p

earnest phoenix
#

so if 5 people

#

click on one emote

#

i want it to change the status

sinful meadow
#

It will just add more emotes to it ;p

languid dragon
#

You want an emoji collector

sinful meadow
#

^^^^^^^

earnest phoenix
#

i oh ready know how to change the status tho

earnest phoenix
#

ill check that out

sinful meadow
#

Gotta go

#

โ˜ฎ

uncut slate
#

"emoji collector"

languid dragon
#

listen here

flint urchin
#

how to make donate bot?

rich kiln
#

get a patreon then dm-adv it

echo mason
indigo notch
#

@bitter sundial lol? why am i muted in #general

#

no thing in modlog

bitter sundial
#

everyone is

indigo notch
#

ahhh

trim steppe
inland hawk
#

@white pebble your bot is shit smh

flint urchin
#

we finally made it lol

#

@fossil oxide how come i was ponged?

earnest phoenix
#

message.channel.send('The game has started!').then(e =>{
e.react('red_circle')
e.react('large_blue_circle')
})

#

seems like this code makes my bot crash

rich kiln
#

where are the ::

fossil oxide
inland hawk
#

wrong ss

flint urchin
#

@fossil oxide update lol, I know you were checking my bots ๐Ÿ‘€, but why?

earnest phoenix
#

help?

#

e is my message var.

rich kiln
#

:: <

#

where are them.

#

facepalm

earnest phoenix
#

mistakes

#

@rich kiln just noticed the message function

#

my bot hates me

green abyss
#

why is ur discord not in english

trim steppe
#

people can use other languages that are not english

earnest phoenix
#

DM ads patreon

flint urchin
#

The only other language is weab

lethal sun
#

How to make FFmpeg work when hosting on Heroku? ๐Ÿค”

indigo notch
#

You don't host on heroku

#

Heroku flipping sucks

lethal sun
#

๐Ÿค”

#

shaddap.

indigo notch
#

I'm telling le truth

#

just get a real VPS

lethal sun
#

waht if i say that im broke?

radiant plover
#

oo I know how to fix that step 1 get money step 2 be unbroke step 3??? step 4 profit

cosmic plover
#

get a 3.5$ ovh vps

earnest phoenix
#

better yet, a $7 VPSDime VPS

#

More money but it has 6GB of ram and 4 cpu vcores

#

It also performs better than the cloud ram server i got from OVH

noble hazel
#

hey, i need to know

#

what was the best percent of bots to people to know if the server is a bot collection server

median lintel
#

i say 70%

karmic lake
#

^

#

i give it a solid

earnest phoenix
#

Dont only base bot farms off of percentages, that's a bad idea

karmic lake
#

that makes sense too ^

median lintel
#

^ yup

noble hazel
#

then how would i do then

earnest phoenix
#

get a minimum membercount first

#

then look for ratios

stone kiln
#

if above 100 users and bot to human ratio is above 70%

earnest phoenix
#

yeah 75-100 is a good number to start with

#

but honestly

noble hazel
#

ok so

earnest phoenix
#

why even make your bot leave these farms

noble hazel
#

because its a waste

median lintel
#

i dont bother with bot farms

#

at all

noble hazel
#

anyway

stone kiln
#

same

earnest phoenix
#

I've never seen anybody have an issue with bot farms using more resources than any other guild

#

But if you insist on leaving them

noble hazel
#

if the member count is about > 100, check the ratio is more than 1:4?

earnest phoenix
#

Look for a minimum member count, then if over the minimum, check the ratios

#

ya

ornate shadow
#

Hello, everyone! ^_^ For some reason bot.users.size returns (the actual number of users) + 1 for some reason. Yes, I included the bot itself. Any ideas why? ๐Ÿ˜•
i.e on my testing server I have 9 users in total, including the bot, but it returns 10

#

using node.js

#

and obv discord.js

median lintel
#

no

ornate shadow
#

๐Ÿ˜

#

well thanks for trying I guess

median lintel
#

idk why

#

but maybe make it -1

ornate shadow
#

I would if I knew exactly what's up with it

#

if I'd know that it puts +1 just for the lulz, I'd -1 it

#

but probably not

median lintel
#

doesnt bot.users.size return all the users the bot sees

#

@ornate shadow

ornate shadow
#

I think so, yes

#

I'm using a PBE bot on my official bot server though and that bot is only in one guild and I can clearly see and number its members and they're 9

#

yet it outputs 10

#

๐Ÿ˜•

#

how can it see one more?

earnest phoenix
#

Itself?

#

Clyde?

#

Dunno

rich kiln
#

@earnest phoenix clyde isnt a real bot lol

#

its like only html

abstract mango
#

and js

#

and stuff

rich kiln
#

yeap

abstract mango
#

//echo lol

#

fek

#

lol doesn't work

earnest phoenix
#

Clyde used to be a user

rich kiln
#

used to be lol

earnest phoenix
#

What is the command prefix for the bot; Auattaja?

rich kiln
#

try -prefix @bot

earnest phoenix
#

ok

#

thanks

vale orbit
#

@median lintel You should filter by removing the bot out of it, just to make it only counts non user bots

#

wrong ping

#

@ornate shadow

ornate shadow
#

?

vale orbit
#

How many non users bot are there in the server?

earnest phoenix
#

s!

#

s!help

#

!help

#

HO !

#

OMG

#

Im fucking dead my pc

ornate shadow
#

In my bot's official server?

vale orbit
#

Yeah.

#

or w/e server you mentioned

earnest phoenix
#

w/e

ornate shadow
#

2 - the bot and the PBE bot

vale orbit
#

Hmm

#

I'm talking about the non users bot aka the real users

ornate shadow
#

Exactly

vale orbit
#

Oh

#

2

#

?

ornate shadow
#

Yes

vale orbit
#

Hmm

#

And what did the output give?

ornate shadow
#

10

vale orbit
#

Hmm

#

Are you sure your bot isn't connected to just one server?

ornate shadow
#

7 users and 2 non users. Output 10

#

Yes I'm sure

vale orbit
#

Then would 7 + you = 8 + 2 bots = 10?

ornate shadow
#

No

vale orbit
#

May I see the member list?

#

in your server?

ornate shadow
#

6+me=7 users

#

You may join it

#

Uhm

vale orbit
#

Dm me the inv

#

xD

ornate shadow
#

Sec

vale orbit
#

tyt

ornate shadow
#

Switching to pc

vale orbit
#

Alright

devout jackal
#

can anywho help pls

#

can i use this for when i say "lmao" it will react this?

    if(message.content.includes(lmao)) {
        message.react(`๐Ÿ˜†`);
    };
#

lmao

#

it aint working right now

neat falcon
#

nope nope nope

#

also nope

#

nope

devout jackal
#

@neat falcon what should i use?

neat falcon
#

idk but it's not that

devout jackal
#

yeah

neat falcon
#

i use it kek

devout jackal
#

kthx

vale orbit
#

@devout jackal You forgot to add " "

devout jackal
#

@vale orbit can i use back slash?

vale orbit
#

For?

lethal sun
#

How to make so the bot playing status changes every minute for example?

#

discord.js

clear kernel
#

on ready, do setinterval that changes the game

#
client.on('ready',() => {
    setInterval(() => {
        client.user.setGame('new game')
    },60000)
}```
lethal sun
#

thanks

devout jackal
#

oh nvm

#

kthx

earnest phoenix
#

You should really do bot.setInterval instead of setInterval

#

so it destroys itself when the client dies

clear kernel
#

Is that a function? Forgot about that

prime cliff
#

You mean your profile or the actual bot page?

#

@earnest phoenix boop

#

You need to use css for that here is an example......

#

Btw you cant edit your perm if you dont have a bot?

#

Or one that has been verified?

#

Yea

sinful meadow
#

Just letting you know @earnest phoenix

#

Dont ask or they will postpone your bot

#

Or even decline

#

Anything on the lines of

#

Im waitingfor my bot to be accepted

#

will either be postponed

#

Or declined

earnest phoenix
#

Hello

earnest phoenix
bitter sundial
#

I would rather have it not be there lul

earnest phoenix
#

just realizes this is development

karmic lake
#

kek

median lintel
#

anyone got any recommendations for npm modules for image editing? thonkku

clear kernel
#

Jimp, if you want easy maybe canvas. Jimp as more advanced i think

median lintel
#

ok

rich kiln
#

@clear kernel dont recommend jimp tho

clear kernel
#

y

rich kiln
#

@median lintel use canvas, jimp takes one year to process an image, also cant do like 89% things that canvas can do

median lintel