#development

1 messages · Page 347 of 1

sinful meadow
#

@inner jewel Not when you have seprate files for each command

#

lmfao

inner jewel
#

intellij can do a find and replace on the whole project

earnest phoenix
#

@inner jewel @sinful meadow So can VSC

inner jewel
#

never used it

#

¯_(ツ)_/¯

earnest phoenix
#

:P

sinful meadow
#

didnt know that @earnest phoenix

earnest phoenix
#

lol

sinful meadow
#

@thorny hinge just updated

#

and they havent changed it

#

;p

thorny hinge
#

master? Thonk

sinful meadow
#

Yep

thorny hinge
#

The staff there say its message embed 👀

sinful meadow
#

npm i discord.js right?

#

Or is the command different for master?

thorny hinge
#

Sigh

#

Yes its different on master

sinful meadow
#

Well rip

thorny hinge
#

npm i discord.js will give you the latest stable version

#

Lemme see how you get master

#

To install and use the Discord.js master branch:
Without voice support: npm i -S hydrabolt/discord.js
With voice support (node-opus): npm i -S hydrabolt/discord.js node-opus
With voice support (opusscript): npm i -S hydrabolt/discord.js opusscript

If you use yarn:
Without voice support: yarn add hydrabolt/discord.js
With voice support (node-opus): yarn add hydrabolt/discord.js node-opus
With voice support (opusscript): yarn add hydrabolt/discord.js opusscript

You need Git for this to work:
Ubuntu/Debian: sudo apt-get install git
Windows: https://git-scm.com/download/win

Documentation: https://discord.js.org/#/docs/main/master/

#

@sinful meadow

#

Copy paste hehe

sinful meadow
#

thanks mate

agile sierra
#

OmG

#

Sorry

#

Kuy

#

Ban?

#

Hey

old badge
#

hey guys, who would my music not be working? here's what it throws at me when i try playing:

native steeple
#

is taking guild names and owners on which the bot is against TOS?

old badge
#

i think without perms yes

native steeple
#

ok

sinful meadow
#

@native steeple Explain more

native steeple
#

in my bot i have command --servers

#

--servers

fervent goblet
#

lol

native steeple
#

and the command sends list of servers on which the bot is

#

and sends owner name too

sinful meadow
#

@native steeple That is fine

#

I had that command but my bot got over 90 servers and hit the character limit xD

native steeple
#

ok 😃

quasi marsh
#

@sinful meadow you didn't split it?

sinful meadow
#

No since then i would have a giant spam of servers @quasi marsh

quasi marsh
#

Heh

inner jewel
#

that's only fine if you explicitly say you do that @native steeple @sinful meadow

#

eg on a join message

neon pasture
#

How do I check if there's a channel in a server when I only have the channel ID?

#

O wait, there's guild.channels.

waxen heart
#

Donut, you can't read commands? You are supposed to type the initial command and one of the following commands from the list underneath it

inner jewel
#

@earnest phoenix ^

earnest phoenix
#

What bot?

#

@waxen heart

waxen heart
#

Wise wizard

earnest phoenix
#

re add it

#

ill look at it again

#

when i get to it

umbral pelican
#

if commands can't be easily used by a web mod, normal discord users have no hope

earnest phoenix
#

^

#

I dont just add, read prefix and try stupid shit, I do actually red...

#

@waxen heart actually

#

I do...

#

I did try what you said

#

so...

#

What do you expect me to do

#

@umbral pelican

languid dragon
earnest phoenix
#

No response there either

#

¯_(ツ)_/¯

weak parrot
#

Lol

umbral pelican
#

looks like you tried everything, lol

#

it's offline now anyways

old badge
#

so anyone know why my music doesn't work? ;-;

#

still got no-ones responce

smoky rampart
#

anyone have experience in modifying role permissions with discord.py?

karmic lake
#

lol

smoky rampart
#

🤔

vestal torrent
#

How to make a bot run without having to have your computer on and connected to the Internet?

languid dragon
#

Google VPS

eager ferry
#

heroku

vestal torrent
#

thx

low rivet
#

@smoky rampart me

earnest phoenix
#

why is my bot @velvet mesa not working?

#

it should be online...

#

it says it is but it isnt here...

thorny hinge
#

Is this a development question though

earnest phoenix
#

now it online

next wedge
#

hi

quiet bobcat
#

How do I add multiple prefixes? So like one is l. another one is L. and another one is @smoky plinth ?

#

I have a case system and I am using d.js

uncut slate
#

prefixes.some(prefix => msg.content.startsWith(prefix))

#

(roughly)

quiet bobcat
#

I currently have this if (!message.content.startsWith(Prefix)) return;

#

So I just do if (!message.content.startsWith("l.", "L.", "@Lion#7616")) return; or am I getting this wrong?

uncut slate
#

I literally gave you the code to use 🤔

quiet bobcat
#

prefixes.some

uncut slate
quiet bobcat
#

But how do I add multiple

#

Can I just do ,?

inner jewel
#

if(!["a", "b", "c"].some(prefix=>message.content.startsWith(prefix))) return;

quiet bobcat
#

oh

#

im so dumb

inner jewel
#

could also use map eg prefixes.map(prefix=>message.content.startsWith(prefix) && message.replace(prefix, "")).filter(messagewithoutprefix=>typeof messagewithoutprefix === "string").first()

#

or something like that

quiet bobcat
#

Ok

#

Thanks

#

Thanks Aetheryx and Natan

#

How can I make the bot resond to mentions?

uncut slate
#

regexes-

#

or msg.mentions

quiet bobcat
#

Ok

#

Thanks

shrewd field
#

hey does anyone know why this won't work

   if (message.content === (prefix + "bcc")) {
        let args = message.content.split(' ').slice(1).join(' ')
        if (!args) return (message.channel.send("You need something to brodcast!"))
        message.guild.members.forEach(m => {
            let bc = new Discord.RichEmbed()
                .setTitle("Brodcasted Message!!")
                .addField('**● | The Guild**', `${message.guild.name}`, true)
                .addField('**● | The Author **', `${message.author.username}#${message.author.discriminator}`, true)
                .addField('**● | The Message** ', args)
                .setThumbnail(message.guild.iconURL);
            // message.guild.members.forEach(m => {
            // m.send(`${m}`);
            //message.author.send(`${m}`);
            message.channel.send({ embed: bc });

        })
    }
})```
uncut slate
#

wat

shrewd field
#

wat wat

inner jewel
#

you check if it's exactly that

#

then want to get args

shrewd field
#

yes

#

this is how I do any command and it always works

inner jewel
#

if the message is "<prefix>bcc"

#

it won't have any args

#

but will be true on that if

#

if it has args

#

it won't be equal to that anymore

shrewd field
#

it is <prefix>bcc <args>

uncut slate
#

yes but

#

when you add args

inner jewel
#

(╯°□°)╯︵ ┻━┻

uncut slate
#

it's not <prefix>bcc anymore

bitter sundial
#

!eval "<prefix>bcc <args>" === (prefix+"bcc")

#

I forgot I took off the prefix

inner jewel
#

rip

north fog
#

you check if the message === "<prefix>bcc", you should split it with space or something and change the first split

bitter sundial
#

lul

languid dragon
#

@abstract aspen eval

#

:[

inner jewel
#

fail

bitter sundial
#

@abstract aspen eval let prefix = "<prefix>"
"<prefix>bcc <args>" === (prefix+"bcc")

abstract aspenBOT
#
Input: let prefix = "<prefix>"
"<prefix>bcc <args>" === (prefix+"bcc")
Result: false
bitter sundial
#

instead

languid dragon
#
  1. You send the message <prefix> <command> <args>
  2. "If statement" is looking for <prefix> <command> EXACTLY and nothing else
  3. You try defining args even though if you wrote only <prefix> <command> there would be NO args.
  4. You need to check if the message STARTS WITH <prefix> <command>
shrewd field
#

now

bitter sundial
#

what ken said

shrewd field
#

i dont understand what to do

languid dragon
#

You do what i told you to do

uncut slate
#

deni pls just go learn js

shrewd field
#

ok

languid dragon
#

4. You need to check if the message STARTS WITH <prefix> <command>

bitter sundial
#

🥄

languid dragon
#

dont spoonfeed

#

(╯°□°)╯︵ ┻━┻

shrewd field
#

ok

#

thx

bitter sundial
#

doing "<prefix>bcc <args>" === (prefix+"bcc") is basically asking if apples are onions for the computer

#

which is false

shrewd field
#

ok

#

so can i put it

#

.startswith

north fog
#

wait, there did genral go

bitter sundial
#

but then if you check if the onion is round like an apple it's true mmLol

shrewd field
#

so startswith is true

languid dragon
bitter sundial
#

if it actually starts with it

shrewd field
#

ok

prime cliff
#

I thought deni was banned Thonk

smoky rampart
#

@4JR#2713 could you show me how it's done I can't find anything about it and nothing I try seems to work

#

rip

fervent goblet
#

wut

quiet bobcat
#

How do I use isMentioned?

#

It's probs really easy to use

rich kiln
#

maybe it returns a bool Thonk

glossy mason
#

I feel like I'm opening a can of worms, but when working with Java, do people prefer JDA or D4J?

inner jewel
#

i've only used JDA

sinful meadow
#

@glossy mason ask @inner jewel

#

shit

inner jewel
#

ninjad

sinful meadow
#

you already got here

#

xD

inner jewel
#

git gud

glossy mason
#

Oh, and to ammend to my question, if I want to try to use Kotlin (want to just do a small project to teach myself and check out Kotlin and have fun) does that influence which one I should choose to work with?

inner jewel
#

i know JDA has KJDA

#

which are kotlin extensions for jda

glossy mason
#

I also saw D4J has D4K.
Does it just come down to a matter of preference? Are both maintained equally as well (the base, not the Kotlin extensions)?

inner jewel
#

afaik yes

#

just choose the one you're more comfortable with

glossy mason
#

Arlight, thanks for the advice.

crisp warren
#

guyz im noob need help with music commands for discordjs

pale light
#

specifics

crisp warren
#

my ting works but sometimes it crash cuz of memory

#

i dont need queue or anything like that yet

#

just want to play one music with no crash

pale light
#

you try and play one music file and it crashes cuz of memory bloblul

crisp warren
#

yep

#

what lib do u suggest first of all

pale light
#

are you trying to download the video

crisp warren
#

no

#

stream

#

i think thats the problem

pale light
#

just queue it

#

get the youtube link and queue it

crisp warren
pale light
#

msg.member.voiceChannel.queue.songs..

crisp warren
#

oo

vital lark
#
const ytdl = require('ytdl-core');

const voiceChan = <Message>.member.voiceChannel; // <Message> is your bot.on('message');

if (!voiceChan) return;

voiceChan.join().then((connection => {

});```
crisp warren
#

ive got that

west hollow
#

guys my blargbot is not working do you know anything about this

prime cliff
#

"my blargbot"
"my"
my
MY

#

@low niche

low niche
#

and I see memes

prime cliff
#

@west hollow Can it send messages?

west hollow
#

umm

prime cliff
#

That should have been an ovious yes/no

west hollow
#

i got it thx

earnest phoenix
#

https:

#

https:

languid dragon
#
$string = "yeet" . "." . "lmao";

Would return "yeet.lmao"

#

return $new;

#
<?php
$config = include('i/config.php');
$key = $config['secure_key'];
$uploadhost = $config['output_url'];
$redirect = $config['redirect_url'];
if ($_SERVER["REQUEST_URI"] == "/robot.txt") { die("User-agent: *\nDisallow: /"); }
 
if (isset($_POST['key'])) {
    if ($_POST['key'] == $key) {
        $parts = explode(".", $_FILES["d"]["name"]);
        $target = getcwd() . "/i/" . $_POST['name'] . "." . end($parts);
        if (move_uploaded_file($_FILES['d']['tmp_name'], $target)) {
            $target_parts = explode("/i/", $target);
            echo $uploadhost . end($target_parts);
        } else {
            echo "Sorry, there was a problem uploading your file. (Ensure your directory has 777 permissions)";
        }
    } else {
        header('Location: '.$redirect);
    }
} else {
    header('Location: '.$redirect);
}
?>
#
<?php
return array(
    /* This is a secure key that only you should know, an added layer of security for the image upload */
    'secure_key' => 'somerandomlongstringoftextforkey',
    /* This is the url your output will be, usually http://www.domain.com/i/, also going to this url will be the gallery page */
    'output_url' => 'http://example.com/i/',
    /* This is a redirect url if the script is accessed directly */
    'redirect_url' => 'http://example.com/',
    /* This is a list of IPs that can access the gallery page (Leave empty for universal access) */
    'allowed_ips' => array('192.168.0.0', '0.0.0.0'),
    /* Page title of the gallery page */
    'page_title' => 'My Upload Site',
    /* Heading text at the top of the gallery page */
    'heading_text' => 'Uploading Site',
);
languid dragon
#
$domains = array('http://oliy-wants-to.thebostontea.party/', 'http://liberals-did.thebostontea.party/', 'http://dev1nee-drank-tea-from-the-water-right-after.thebostontea.party/');

$dindex= array_rand($domains);

$domain = $domains[$dindex];

$key = "your special key lmao";

$uploadto = $domain . "/images/";

$redirect = $domain;

if(isset($_POST['key'])){
    if($_POST['key'] == $key){
               $parts = explode(".", $_FILES["d"]["name"]);
                $target = getcwd() . "/i/" . $_POST['name'] . "." . end($parts);
                if (move_uploaded_file($_FILES['d']['tmp_name'], $target)) {
                    $target_parts = explode("/i/", $target);
                    echo $domain . end($target_parts);
                } else {
                    echo "Sorry, there was a problem uploading your file. (Ensure your directory has 777 permissions)";
                }
    }else{
        header("Location: INVALID_KEY");
    }
}else{
    header("Location: NO_KEY");
}
?>
sinful meadow
#

@vital lark

#

Come over here

#

xd

earnest phoenix
#

@languid dragon WuT is dat lib ;-;

languid dragon
#

PHP, unrelated to bot making lmao

earnest phoenix
languid dragon
#

not "lib"
sry
It's just a sharex related image uploader for PHP

earnest phoenix
#

k...

earnest phoenix
#

does any discord.js programmers knows what does this warning is and how to fix it?
(node:3468) DeprecationWarning: Guild#defaultChannel: This property is obsolete, will be removed in v12.0.0, and may not function as expected.

languid dragon
#

its kinda self explanatory

earnest phoenix
#

i mean, i just want to know how to fix it

#

😓

languid dragon
#

you cant use defaultChannel anymore as it is deprecated

earnest phoenix
#

what to use instead?

languid dragon
#

so whatever you're trying to do with a default channel, you'd need to find an alternative like channels.first()
and/or just skip the entire defaultChannel process altogether

#

or alternatively you can look for "#general"

inner jewel
#

channels.filter(channel=>canSendMessagesIn(channel)).first()

languid dragon
#

^

earnest phoenix
#

ok, i guess

earnest phoenix
#

Example code

<client>.user.setPresence({
          status: "online",
          activity: {
            name: "Donut: Rainbow Six",
            type: 0,
            url: "https://www.twitch.tv/discorddonut/"
          }
        })

Types

Type 0: Game / playing
Type 1: Stream / streaming
Type 2: Listen / listening to
Type 3: Watch / watching

This is for people who constantly as me how to do the other status

undone plover
#

please tag me in the responce

rugged girder
#

@undone plover Get the links to pop up?

undone plover
#

with the specific text yes

delicate zephyr
#

@undone plover This: [link](text) I believe

undone plover
#

mk

delicate zephyr
#

nvm

#

its

umbral pelican
#

First one is text

delicate zephyr
#

[text](link)

#

@undone plover ^

undone plover
#

okie

#

for any langauge?

#

and does this only work in embeds?

#

nvm

#

it works

#

Thanks!

rugged girder
#

How would I post my servercount to the API? I was reading the docs and came across this:

{
  "server_count": 666
}

but I'm not sure how to use it.

mighty barn
rugged girder
#

Thank you.

mighty barn
#

You're welcome

earnest phoenix
#

i need help to create to my discord bot a music feature

young wind
#

I need help with my bot on dbl

#

on the website, instead of saying online or offline it says ???

bitter sundial
#

@young wind that's because the bot isn't in this server

young wind
#

oh ok

#

thanks

quiet bobcat
#

Can someone help me use a background on dbl?

#

Like instead of using bg.png it also works on dbl

inner jewel
#

upload image somewhere

#

use css

quiet bobcat
#

Can I upload it to like imgur?

#

bc I dont own a site

lethal hamlet
#

Why does it say this?

#

It's listing DiscordClient as an error

#

same as LogMessageEventArgs

inner jewel
#

try googling the error

lethal hamlet
#

.3.

quiet bobcat
#

I'm trying to get my bot to respond to mentions like @smoky plinth help.

#

I dont know how

sinful meadow
#

That is a mention prefix

quiet bobcat
#

Yes

sinful meadow
#

Try and ask Donut

#

Since idk

quiet bobcat
#

Ok

vital lark
#

@earnest phoenix give me mention prefix code

earnest phoenix
#

@quiet bobcat Check if the message starts with "@smoky plinth "

#

or "@smoky plinth "

prime cliff
#

Both

earnest phoenix
#

yes, check both

quiet bobcat
#

Ok

prime cliff
#

One is for nickname and the other for non-nickname

earnest phoenix
#

^

quiet bobcat
#

ok

#

thanks

#

Should I return any of them?

earnest phoenix
#

make sure to check if there is a space after the mention, or else your bot will only work if it sees this: @smoky plinthhelp

quiet bobcat
#

or?

prime cliff
#

I have my bot checking for prefix/mention prefix and custom prefix if set 😄

earnest phoenix
#

wdym return

quiet bobcat
#

Like if its <@! should I return?

#

or continue

earnest phoenix
#

Continue

quiet bobcat
#

and if its <@

#

continue aswell?

earnest phoenix
#

yes

quiet bobcat
#

ok

earnest phoenix
#

This is all I use to check if it's a command:

    let prefix = ((msg.content.startsWith(((msg.channel.guild) ? bot.prefixes[msg.channel.guild.id] : config.prefix))) ? ((msg.channel.guild) ? bot.prefixes[msg.channel.guild.id] : config.prefix) : ((msg.content.startsWith("<@" + bot.user.id + ">")) ? "<@" + bot.user.id + "> " : ((msg.content.startsWith("<@!" + bot.user.id + ">")) ? "<@!" + bot.user.id + "> " : null)));
    if (!prefix) return;```
#

kinda long

#

but it works

#

bot.prefixes is an object with guild ID keys and prefix values

#

if the guild has no custom prefix set, then it's default

thorny hinge
#

wew

earnest phoenix
#

but for every guild the bot is in, there should be a value within bot.prefixes

thorny hinge
#

PassTheLongCode

earnest phoenix
#

True

quiet bobcat
#

It doesnt work

#

if(!["l.", "L.", message.content.startsWith("<@" + bot.user.id + ">"), message.content.startsWith("<@!" + bot.user.id + ">")].some(prefix=>message.content.startsWith(prefix))) return;

#

Thats my code

#

for it

earnest phoenix
#

I see why

quiet bobcat
#

Why?

earnest phoenix
#
if(!["l.", "L.", "<@" + bot.user.id + ">", "<@!" + bot.user.id + ">"].some(prefix => message.content.startsWith(prefix))) return;```
#

There is a fix

#

should work

quiet bobcat
#

oh...

#

🤦

earnest phoenix
#

The third and fourth value of your array would be true

#

but that's incorrect checking

#

Does it work? @quiet bobcat

quiet bobcat
#

No

earnest phoenix
#

:/

quiet bobcat
#

I have this after it const args = message.content.substring(Prefix.length).split(" ")

#

And for that to work I need to define Prefix

#

And I cant define prefix as "l.", "L.", "<@" + bot.user.id + ">", "<@!" + bot.user.id + ">"

earnest phoenix
#

oof

#

idk how to help

#

brain dead

quiet bobcat
#

im ded

#

too late

#

im tired

#

lol

earnest phoenix
#

lol

quiet bobcat
#

yay

#

I broke my bot

#

😃

#

ok so l. and L. works, but @smoky plinth doesnt @earnest phoenix

earnest phoenix
#

rip

#

ok

quiet bobcat
#

I think I'll just sleep on it

#

Cya

#

Thank you for helping me

earnest phoenix
#

yup

warm canopy
#

How do you get a role id?

vital lark
#

idk

thorny hinge
#

You get the role object

#

Then get the id

pale light
#

lul

prime cliff
#

@warm canopy or you could use your own bot to get role ids

#

🙄

warm canopy
#

k

inner jewel
#

\@role

lethal hamlet
#

I am confused...

#

Here is some code I made in Visual Studios and it says this

#

Error Log ^^^

#

This is the CS file it is getting the errors

kindred epoch
#

you wrote discord wrong

#

in your imports

lethal hamlet
#

Still not taking it as a type/namespace

vital lark
#

<@&265158261945270273>

#

sorry but not sorry <3

prime cliff
#

@lethal hamlet read the docs

carmine ermine
#

Maybe use updated version

#

And stop following shitty examples

lethal hamlet
#

Maybe I am trying and shut it.... I asked for help and I just found what it is... I am MORE basic than you so I usually will use examples for a while and make it more complex overtime

#

//Actually, newer releases of Discord.NET (>0.9) no longer use DiscordClient. You have to use ``DiscordSocketClient`` instead.

#

Thats as far as i know

#

And it will require this

#
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Discord;
using Discord.Commands;
using Discord.WebSocket;```
vital lark
#
using Discord.SocketClient;
```?
#

idk

#

never used C#
use DSharpPlus

lethal hamlet
#

I was thinking about that

strange lintel
#

so

#

uh

#

could you reexplain that all

patent reef
#

Im getting ram percent usage by using psutil

#

and it returns this

sullen sapphire
#

shut up

patent reef
#

svmem(total=10682740736, available=5945892864, percent=44.3, used=4736847872, free=5945892864)

strange lintel
#

oh?

patent reef
#

i wanna get the percent from the tuple

sullen sapphire
#

jqwiljdd

strange lintel
#

well thats not a tuple

lethal hamlet
#

Says the one who has no role

sullen sapphire
#

ge

#

fes

#

dw

#

dw

#

wd

#

w

#

aw

lethal hamlet
strange lintel
#

what you would probably do

patent reef
#

cuz its in BYTES

lethal hamlet
#

I am coding still

strange lintel
#

oh

#

you can convert it

patent reef
#

yeah

#

ill just multiply it

strange lintel
#

bytes / (1024*1024.0)

#

thats how

vital lark
#

lol

patent reef
#

yep

strange lintel
#

that all you need?

patent reef
#

yep thx

strange lintel
#

k

#

=m s

lethal hamlet
#

What do I do for a replacement as code LogMessageEventArgs

#

Oh wait....

#

@_@ I forgot to try installing it in older versions

prime cliff
#

Read the docs for v2 its really simple

lethal hamlet
#

I can't find it ...

patent reef
#

@strange lintel so for no = psutil.virtual_memory() i would do no.percent?

prime cliff
#

Also there is a CommandService to use

lethal hamlet
#

I am new to programming in C#

strange lintel
#

yes

#

i think

prime cliff
#

I can tell that lol

lethal hamlet
#

I am trying to make it so the bot will come online

patent reef
#

lemme check

#

sweet

#

thanks

lethal hamlet
#

Here

sinful meadow
#

hmmmmmmmmm

lethal hamlet
#
{
    class MyBot
    {
        DiscordClient discord;
        public MyBot()
        {
            discord = new DiscordClient(x =>
            {
                x.LogLevel = LogSeverity.Info;
                x.LogHandler = Log;
            });
            discord.ExecuteAndWait(async () =>
            {
                await discord.Connect("SECRET TOKEN HERE");
            });
        }
        private void Log(object sender, LogMessageEventArgs e)
        {
            Console.WriteLine(e.Message);
        }
    }
}```
strange lintel
#

@patent reef worked?

lethal hamlet
#

LogMessageEventArgs comes up as an error.

#

do I just put it as LogMessage?

patent reef
#

yeah but i dont think its bytes

#

kb maybe?

#

fk

lethal hamlet
#

OOF...

#

I forgot about putting using DSharpPlus

#

OOF...

#

I am stupid

#

Af

#

What about ExecuteAndWait

patent reef
#

oh yes makes sense

#

43 GB of ram usage

vital lark
#

HI

#

MY NAME IS MR HATE PYTHON

#

HOW CAN I HELP YOU FOR TODAY?

lethal hamlet
#

Python

#

Ew

eager ferry
#

Hey

lethal sun
#

How can I make the Rich Presence for a bot in js?

earnest phoenix
languid dragon
#

discord-rpc

earnest phoenix
#

^

sinful meadow
#

@lethal sun You cant rn

#

Not in pure js

earnest phoenix
#
snekfetch.post(`https://discordbots.org/api/bots/386510361152585738/stats`)
    .set('Authorization', key)
    .send({ server_count: bot.guilds.size, shard_count: bot.shard.size, shard_id: bot.shard.id })
    .then(() => console.log(`Posted to dbl.`))
    .catch((e) => e);
thorny hinge
#

It already says

#

Your shards are null

#

aka you don't have any shards

#

Did you spawn them?

languid dragon
#

i think its bot.shard.count

earnest phoenix
#

Yeah its .size

#

And I was using bot.js over shard.js by accident :/

#

lmao

#

Error was fixed now

vital lark
#

You need a Shard.js file

#

and it's count

ornate shadow
#

anyone knows how can I use inline of RichEmbed using Discord.js to inline them 2 by 2? I can only put 1 or 3 on each row and I want 2... am I missing something?

earnest phoenix
#

yeah i have same problem ;-;

ornate shadow
#

@earnest phoenix solved it by adding an inline blank field as the 3rd in the line 😄

earnest phoenix
#

how

#

0.0

#

@ornate shadow how do u do a blank field

ornate shadow
#

oh

#

embed.addBlankField

#

and to make it inline

#

you add true as an argument

#

embed.addBlankField() for a whole blank row and embed.addBlankField(true) just for a "block"

earnest phoenix
#

wow

#

thanks

ornate shadow
#

np 😄

sinful meadow
#

@earnest phoenix Come over here

#

Ill help ya

earnest phoenix
#

Okay

#

I'll quickly DM you

steel heath
#

What's the script for "ram usage" thing for discord.js? Please mention me when you say something to me.

weak parrot
#

Wut

patent pollen
#

.ownerkanalayarla

#

.yardım

prime cliff
bitter sundial
prime cliff
worthy flicker
#

someone can jhelp me ?

thorny hinge
#

With what

prime cliff
#

^

worthy flicker
#

i get some bot files in the gifhub

thorny hinge
#

And what do you wanna do with those files

worthy flicker
#

and put on my bot name

thorny hinge
#

What

worthy flicker
#

have a lot comands

#

but some commands dont work

prime cliff
#

Is it a redbot?

worthy flicker
#

no

#

masterbot

prime cliff
worthy flicker
#

rebot is better?

thorny hinge
#

Are you cloning? lol

prime cliff
#

Show us the github?

thorny hinge
worthy flicker
#

yes

#

i cloning 😄

#

thats i

#

it

thorny hinge
#

Oh

prime cliff
#

Post the github here?

worthy flicker
#

i thing thats files

#

are verry old

#

i seaching for new bot files

#

you can segest some ?

prime cliff
#

Show us the github

worthy flicker
prime cliff
#

🤦

thorny hinge
earnest phoenix
#

add it

#

no balls

thorny hinge
#

I suggest you end your cloning career

prime cliff
#

@worthy flicker you do know that bot isnt really yours

worthy flicker
#

i dont made the code

#

but i can use the files

#

dont ?

#

is wrong use that files ? is ilegal ?

thorny hinge
#

It's not development if you are using someone else's code

#

It is legal but

lapis rock
#

not very welcome on bot lists

thorny hinge
#

^

worthy flicker
#

is develpment if dont works perfect 😛

thorny hinge
#

No

prime cliff
#

Yea you should really join rhinos support server @worthy flicker

inner jewel
#

if you want it for private use, go ahead

prime cliff
#

Not ask in here

inner jewel
#

just don't try adding it here

prime cliff
#

^

inner jewel
#

it won't get accepted

thorny hinge
#

Yeah

worthy flicker
#

i want give new functions

#

of my bot

prime cliff
#

Oof

thorny hinge
#
}``` hm
worthy flicker
#

but add my bot here is not important to me

thorny hinge
#

But you shouldn't ask here

#

Using someone else's code isn't really development now is it? mmLol

worthy flicker
#

rules here, rules there 😦 i hate thats rules

prime cliff
#

How did you even get here thonkku

lapis rock
#

bUt rUlEs kEeP oUr gUilD sAfE aNd sOunD

prime cliff
#

@inner jewel cough cough

inner jewel
#

@cosmic plover @unique star come see this mmLol

cosmic plover
#

lul

#

LOL

unique star
#

memes

crisp warren
#

@colt_letter#1455 my name is louis

#

oof

worthy flicker
#

i love jesus

prime cliff
#

@low niche this meme lol

worthy flicker
crisp warren
#

@colt_letter#1455

worthy flicker
#

what ?

crisp warren
#

why are you untaggable

worthy flicker
#

i have no idea, if you are god and dont, what i can do ?

lapis rock
#

@worthy flicker

#

ha i can tag

#

@crisp warren ^

cosmic plover
#

mobile is bugged

crisp warren
#

what the fuck

#

@colt_letter

#

i want to die

cosmic plover
#

put a space after the mention and wait like 3 seconds

#

on mobile

crisp warren
#

@colt_letter#1455

cosmic plover
#

same

thorny hinge
#

@worthy flicker

crisp warren
#

@worthy flicker

#

THERE

cosmic plover
#

@colt_letter#1455

#

LUL

#

I'M ON DESKTOP

thorny hinge
#

@colt_letter#1455

cosmic plover
#

@colt_letter#1455

worthy flicker
#

wtf o.o

#

leavemealoneeeeeeeeee

#

Ç.Ç

#

stay way from me

prime cliff
#

^ Crazy person

worthy flicker
#

not soo much

#

then

#

why i have to development my bot from zero, if have alot good codes waiting for me ?

#

why not only add funcions

#

or remove some

prime cliff
#

You cant take all the code from someone else and claim yourself a developer @worthy flicker

thorny hinge
#

^

worthy flicker
#

i dont do that

prime cliff
#

Thats not how it works

thorny hinge
#

All ur doing is adding a couple of functions

#

It's still not really your bot 👀

worthy flicker
#

i'm not programer for start

#

i just loser front end website

thorny hinge
#

skid

worthy flicker
#

i could be your father

thorny hinge
#

You aren't even a developer lol, you are just using rhinobot's files

worthy flicker
#

yeah, whats the problem

#

is ilegal ?

#

is ilegal dont be developer ?

#

i think no... then

#

you can suggest a good bot files name

#

to me? i using Windows

#

and i think my bot problems is because that

thorny hinge
#

I can suggest some good bot files

#

Your own

worthy flicker
#

.-.

#

i agree

#

but i need another

thorny hinge
#

make your own

#

Or learn to code

worthy flicker
#

i just need a webadhook

#

i dont will learning anything about that just for 1 thing

#

then is more easy, and smart, get files

#

i thinking in install Linux on my old Nintendo Wii

#

and make my bot server on Wii

thorny hinge
#

k

#

tries to host a bot on a wii

#

Good luck I guess

earnest phoenix
#

How do i make my bot customisable per guild? Do i have to do new Array() ?

thorny hinge
#

Lol

#

Wouldn't the arrays reset every time the bot restarts?

#

What you need is a database

earnest phoenix
#

A guildsettting file you mean?

#

I would need to create a new file and require it., Store it all there?

thorny hinge
#

Yes

#

But you need a database Thonk

earnest phoenix
#

Elaborate

thorny hinge
#

like sql or something

earnest phoenix
#

ugh ffs

thorny hinge
#

I mean you can store it in an array if you want your "database" to reset after every bot reboot

worthy flicker
#

I will respectfully leave this room and move to general

thorny hinge
#

k

earnest phoenix
#

No, that wouldnt be good

quasi marsh
#

What is meant with sending the shard_id to the API?

#

Should it be the shard that has this guild in it?

wanton plover
#

per shard, you give the number of guilds connected to it

quasi marsh
#

Using discord.py[rewrite], it will combine them tho, to just give me all guilds with len(client.guilds)

#

Should i just send shard 0 then?

#

Since 0 is the DM/global shard I reckon

thorny hinge
#

How can I record a vc, then give the user a mp3 of their chitter chatter?

#

discord.js

earnest phoenix
#

Hey guys, how do you test for a negative number in javascript?

inner jewel
#

number < 0

earnest phoenix
#

Thx

thorny hinge
#

wew

earnest phoenix
#

Errr one last question

#

How would I reference roles in a mention statement

#

I tried message.mentions.first().role

#

But it comes up undefined

#

Also message.mentions.roles.first().role

vital lark
#

message.roles.find('name', 'name');
message.roles.find('id');

earnest phoenix
#

No im like trying to find role positions

#

So, for example

#

If this role is above that role

#

Then do this

#

Hm

#

let rolecompare = message.mentions.roles.first().comparePositions(message.author.role, message.mentions.roles.first())

vital lark
#

Try the docs

earnest phoenix
#

I did

#

._.

vital lark
#

or the official discord server

earnest phoenix
#

???

#

But then what is this channel for...

#

development

#

Wait I got it I was doing something stupid

#

not failing at development 😂

earnest phoenix
#

twas a mem

agile lake
#
0|joebot   | DiscordAPIError: undefined
0|joebot   |     at item.request.gen.end (/home/justin/joe-bot/node_modules/disc                                                                                                                     ord.js/src/client/rest/RequestHandlers/Sequential.js:68:65)
0|joebot   |     at then (/home/justin/joe-bot/node_modules/snekfetch/src/index.                                                                                                                     js:257:21)
0|joebot   |     at <anonymous>
0|joebot   |     at process._tickDomainCallback (internal/process/next_tick.js:2                                                                                                                     28:7)
#

🤔

#

I think someone was trying to access the bot while the channel he/she was trying to access had read_message premission for bot but no send_permission for bot

#

attempted return statements when bot did not have send message perms on the channels but still seems to return unhandled rejection even after attempting throw error

#

nvm just checked thru channel perms

crisp warren
#

uh

#

.catch()

vital lark
#

.catch() is bae

hot flint
#

more like .catch(e => console.error(e))

inner jewel
#

.catch(console.log)

earnest phoenix
#

.catch(STDs)

wise nexus
#

.catch(meoutside) .then ashf;hs;jkahfupwehurh

#

fak

lethal sun
#

thonk

#

welp

#

ima uninstall

#

wow that was the fastest unistall

#

wow

wise nexus
#

okay soo im having trouble getting json objects inside like i want json.house inside of a embed which works, but the problem is I can't have any if satements inside of my embed javascript name: 'Type:', value: json.house, inline: true this is the plain I dont want that i want javascript { name: 'Type:', value: if(json.house == 0){ console.log("this is house 0") } else if (json.house == 1) { console.log("this is house 1") } else { console.log("cannot find the next house") }, inline: true }

crisp warren
#

because a value must be a string

#

not a if statement and a log

languid dragon
#

EYES ^ you cant put if statements inside a json object

crisp warren
#
let ting
if(json.house == 0) return ting = 'this house is 0'
{
name: 'Type: ',
value: ting
}```
wise nexus
#

fjkslajd

#

so i cant the value change depending if json.house = 0 or 1?

languid dragon
#

what are you trying to acheive with this

#

whats the end goal

wise nexus
#

ip checker via iphub

languid dragon
#

why dont you do the checks outside of the object

wise nexus
lethal sun
#

What's the HEX for BPurple?

languid dragon
#

or: #6B82D3 / #6F84D3 / #7187D8

#

one of those

#

#7289DA I think its this one though <

wise nexus
inner jewel
#

first one is localhost

#

second one is on my vps

#

it's the same file

glossy sand
#

are your stylesheets synced properly

#

your vps copy looks like it's missing a white space rule on the code block

inner jewel
#

oh

#

it was cloudflare being retarded

#

adding a page rule to disable performance fixed it

analog breach
#

interesting page

#

went to the url

sinful meadow
#

@wise nexus is that js lmao

#

Since it looks like youre trying to do but is failing

wise nexus
#

yeah

sinful meadow
#

If youre trying to send a message to the author do

#

message.author.send

#

@wise nexus

wise nexus
#

wrong

sinful meadow
#

No?

wise nexus
#

oh i was ysing lua

#

RIP

sinful meadow
#

Lmao

foggy violet
#

how should i post stats? i tried Token and Authorization in post request and it gives me out: {"error":"Unauthorized"}

inner jewel
#

Authorization header

#

with the token you get from the website

foggy violet
#

found it out yeah, ty anyway 😃

sinful meadow
#

Anyone know a better npm for a music bot because ytdl-core is trash

bitter sundial
#

youtube-dl?

sinful meadow
#

@bitter sundial Thats what ytdl-core is

#

It streams from youtube

#

And its really trash

bitter sundial
#

nope

#

different module lol

sinful meadow
bitter sundial
#

literally

#

ytdl-core and youtube-dl

#

you see the difference right

sinful meadow
#

yt stands for youtube lmfao

#

dl stands for download

#

xDDD

bitter sundial
#

tru

elfin depot
#

hey

bitter sundial
#

but other is just that and other is core

sinful meadow
#

The thing is

#

Can the youtube-dl stream

#

onto audio

#

Instead of saving

bitter sundial
#

yes

#

read the docs lul

elfin depot
#

anyone know googie from discord bots server

sinful meadow
#

all i see is downloading lmao @bitter sundial

bitter sundial
sinful meadow
#

im on that

#

lmfao

bitter sundial
#

it has the readme with examples there

clear kernel
#

Just wondering, anyone who has experience with rethink and has SSL/certs enabled, where do you store it? Anywhere? The docs kind conflict

pseudo inlet
#

yo famsquad im making a bot and im making an 8ball function and it only poops out yeds

#

yes

inner jewel
#

move balloutput = ... inside the command

glossy sand
earnest phoenix
#

eww

#

stop it

pseudo inlet
#

@glossy sand the code is python not c

glossy sand
#

it's ... .. .. . a joke

#

I'm making a reference to xkcd...?

pseudo inlet
inner jewel
#

yes

pseudo inlet
#

its not working

#

whenever i try it it spews out this

#

@inner jewel help me

inner jewel
#

¯_(ツ)_/¯

pseudo inlet
#

😦

vital lark
#

then don't use Python

#

use js

pseudo inlet
#

but

#

i like pythong

vital lark
#
ball[Math.floor(Math.random() * ball.length)];
earnest phoenix
#

this is python @vital lark

vital lark
#

your python

pseudo inlet
#

woo fixed it

ornate shadow
#

how do I get an user from an user ID?

earnest phoenix
#

@ornate shadow message.guild.fetchMember('id')

#

Or

#

I think

ornate shadow
#

client.users.get('id')

#

got it 😄

earnest phoenix
#

Or that

#

Lmao

ornate shadow
#

thx anyway ^_^

earnest phoenix
#

Np

#

Does anybody know I can ban all mentioned users in a message?

#

Well, by I i mean my bot

#

I think its something like forEach

#

I dont know how to write the full code tho :L

wise nexus
#

for what lib?

vital lark
#

@earnest phoenix why even?

#

No one will like your bot if you ban all mentioned users.

spiral trail
#

^

wise nexus
#

i'd add it for a troll command

#

or nuke

#

or use it to kick instead of ban all users within a join time

foggy violet
#

anyone facing problems with discord.io library and 4012 disconnect?

fervent goblet
#

How

stone kiln
#

i have a sql license from Oracle itself 😛

north fog
#

same

fervent goblet
#

SQL license?

#

Die from aids already

#

Databases should be free

stone kiln
#

they aren't

bitter sundial
#

nothing is free

stone kiln
#

^

bitter sundial
#

no database research would be done if databases are free

fervent goblet
stone kiln
#

rekt

bitter sundial
#

nobody does work without getting paid

stone kiln
#

so true

fervent goblet
#

Lol

#

Then why does github exist

#

So many open source free shit

stone kiln
#

someone needs to do the research before they can even start coding

#

and that costs time

#

and time is money

fervent goblet
#

Lol

stone kiln
#

it's the truth though

#

someone has done the research before they started there project

#

and that costs a lot of time

pseudo inlet
#

help

#

its not working

quasi sandal
#

python

pseudo inlet
#

yeap

north fog
#

i think you miss ;

#

not sure

#

otherwise im useless

pseudo inlet
#

its pythong

#

my man

languid dragon
#

google the error?

#

¯_(ツ)_/¯

fervent goblet
#

What characters can an invite link contain?

#

or just all letters and numbers?

languid dragon
#

probably all letters and numbers

fervent goblet
#

I remember seeing something somewhere

pseudo inlet
#

only letters

fervent goblet
#

I'm looking for it right now

#

oh well whatever

#

oh ye I forgot only letters xD

icy epoch
#

@pseudo inlet if you never figured it out all indentation in the same block needs to match

languid dragon
#

it contains numbers as well

neon pasture
#

When you download a video with ytdl-core, does the file save on your vps?

#

how?

#

currently I have this const stream = ytdl(url, { filter: 'audioonly' });

#

how's this not save then?

#

just wondering

#

o lol, I was reading it wrong

#

okay, thanks

#

Thanks for helping

spiral trail
#

Where the fuck does [object] [object] come from?

north fog
#

from a object.toString

spiral trail
#

Ah

#

MEOW!

weak parrot
#

Lol

north fog
#

you need to read the File parameter, not the .toString()

spiral trail
#

🤔 I am still bad at this

#

ofc

north fog
#

or remove the file parameter

spiral trail
#

Remove file:

north fog
#

im sure that it isnt a valid array

spiral trail
#

oh dear

north fog
#

well, a part will work, other doesnt

#

in what IDE are you making it ¿¿

spiral trail
#

IDE?

#

Integrated development environment?

#

Do you mean what am I designing this for?

#

Well, alone, I did get this working.

quasi marsh
#

No the program you are using to write the code

spiral trail
#

Sublime

quasi sandal
topaz fjord
#

Heh

spiral trail
#

MY EYES!

topaz fjord
#

White theme

spiral trail
#

MY FUCKING EYES!

spiral trail
#

I should changing something here Thonk

quasi sandal
#

yes, your indents

spiral trail
#

._.

#

.-.

shrewd field
#

Hello

#

Guys I have an error missing catch or finally after try I don't know why I have it?

umbral pelican
#

because you missed a catch after a try

earnest phoenix
#

or finally ❗

shrewd field
#

I do have a catch

umbral pelican
#

show kode, kthx

languid dragon
#

show error

umbral pelican
#

show nudes

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

       }
            catch(err) {
           console.log(err) 
     } 
    } 
  
#

Error is missing catch or finally after try

umbral pelican
#

pretty sure your brackets don't match up

shrewd field
#

Ohh the last one

#

At the very end

languid dragon
umbral pelican
#

wtf is that ULTRALUL

quiet bobcat
#

its a masterpiece

tawny lava
#

that's orgasmic

shrewd field
#

Wtf is what

languid dragon
#

its trying to explain to a child what the heck is wrong with your code

shrewd field
#

Ok

#
let role = message.guild.roles.find("name" , "Muted");
     if(!role) {
       try {
         role = message.guild.createRole({
           name: "Muted",
           color: "#000000",
           permissions: []
         }
        }
       })
            catch(err) {
           console.log(err) 
     } 
    } 
  
languid dragon
#

if you actually studied your own code, you'd find the error WaitWhat

shrewd field
#

Now

tawny lava
#

kek

shrewd field
#

Correct ya

languid dragon
#

na

#

read ur fukn code

shrewd field
#

Why

#

Ok

#

I will read

#

Now

umbral pelican
#

try it

shrewd field
#

K

trim steppe
#

oh no

umbral pelican
#

and sort the identation out

shrewd field
#

Oh no what

umbral pelican
#

"oh no", it's even worse than before

trim steppe
#

learn javascript before you use javascript

#

these errors are way too basic

#

we're not here to spoonfeed

shrewd field
#

Whta

umbral pelican
#

other than spoonfeeding a lizard

shrewd field
#

Ok I now you are not here to spoonfeed

#

Ok

umbral pelican
#

because lizards are tasty

#

do you like lizards?

shrewd field
#

Ya