#development

1 messages ยท Page 341 of 1

earnest phoenix
#

Hey uh

#

@sinful meadow

#

Or anyone?

#

Anyone?

#

Okie guess not

earnest phoenix
#

How do I turn message.content into an array?

thorny hinge
#

Like args?

earnest phoenix
#

Yes

#

I am trying to get an arg from message.content

thorny hinge
#

const args = message.content.slice(ur prefix.length).trim().split(/ +/g);

earnest phoenix
#

Uh

#

Wow okay

thorny hinge
#

Then u can get args[0], args[1], args[2]

#

etc

earnest phoenix
#

Alright thank you!

thorny hinge
gilded plankBOT
#
Rainbowdashboygamer#2846
Bots

@edgy dew

earnest phoenix
#

i have python but I dont have an code

thorny hinge
#

Do you know python

earnest phoenix
#

nope ;-;

thorny hinge
#

Welp

earnest phoenix
#

its for an xp bot

#

This is my first time

thorny hinge
#

You wanna make one?

earnest phoenix
#

yes

thorny hinge
#

Well you can't if you don't know python

#

Or any other lang

earnest phoenix
#

;-;

thorny hinge
#

Bots can't appear out of thin air

earnest phoenix
#

ik tht

#

my friend told me to do python and if I had an code

#

Hey

#

Uh I have another question

thorny hinge
#

ok

earnest phoenix
#

How do I put a space as a .split() seporater?

#

.;-;

#

Thought this group was supposed to help ):<

#

It is

#

Wait

#

So you need to learn how to code a bot with python?

#

yas

#

:/

#

Hold on

#

Just for an xp bot

#

Wait

#

Here

#

Okay

#

Anybody

#

How do I use a space for a .split() method

#

Is it even possible

#

And everyone left again

#

Dont

#

Use regex

#

Wot

#

But if for some reason you do need to use split it would be <string>.split(" ")

#

Google it

#

Okay

#

I tried that

#

It still seporated with a comma

#

Im so confused ๐Ÿ˜

#

@earnest phoenix

#
const args = message.content.slice('afk'.length).trim().split(" ");
#

Wait

#

Idea

#

Nope

#

Still doesnt work

#

Help ;-;

#

What language?

#

@earnest phoenix

#

Javascript

#

d.js is the lib

#

Do you have this file uploaded to any website?

#

No...

#

Wait

#

If you mean connected yes

#

To discord

#

But no I didnt upload it anywhere

#

Im using VCS

#

Link?

#

Why would you need the link?

#

I told you its not on a website

#

:/

#

I need help still I made the bot but python wont work );

#

We cant help with that

#

Its a python problem then

#

;-;

#

Wait

#

It just helps me to see what JAva is concerned

#

about

#

@earnest phoenix

#

Heres the documentation

#

I did that

#

It still came up with commas as seporators

#

It kinda worked

#

But now its repeating the same thing twice

#

const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
It's making me use multiple prefixes.
"prefix.length" = 2
"~>" = 2
"!!" = 2
ect.

#

Try That

#

Nvm

#

Stupid mistake, left the debug console open

#

Thank you tho!

#

Your Welcome~!

#

wait

#

One last question sir

#

Nevermind

#

afk

#

Also make sure to not switch to switch/case

#

@earnest phoenix

#

?

#

Wot

#

Im not using switch and case

#

Okay.

#

Wait

#

@trim steppe

trim steppe
#

welcome to biscord dots 24/7 technical support

earnest phoenix
#

Uh you up for a question?

trim steppe
#

no

#

yea

earnest phoenix
#

Okay

trim steppe
#

use switch and case

earnest phoenix
#

Wot

#

No

trim steppe
earnest phoenix
#

My question is how do I make javascript ignore capital and lowercase letters?

#

You really can't

trim steppe
#

you can't just "ignore" capital letters

#

just make both lowercase

#

then check

earnest phoenix
#

Ah

#

Change them to lowercase

#

Understood

inner jewel
#

or upper

trim steppe
#

heck

#

nobody uses uppercase

earnest phoenix
#

Loli, You just wanna see him freak out...

#

Just installing Python, I forgot I need all the software Bots need

topaz fjord
#
<h2 class = "underline">Modertaion Commands</h2>

<ul>
  <li>Antelope</li>
  <li>Bison</li>
  <li>Camel</li>
  <li>Deer</li>
  <li>Eland</li>
  <li>Gazelle</li>
</ul>

<style>
ul {
  float: left;
  width: 20em;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

li {
  float: left;
  width: 6em;
  margin: 0;
  padding: 0;
  text-align: center;
} 

h2 {
 color: gray
}

.underline {
text-decoration: underline;
}
</style>
#

is there a way

#

yo make the list stay in the center

#

cause rn

#

it looks like this

earnest phoenix
#

try "gravity: center"

topaz fjord
#

in what?

earnest phoenix
#

put it in after lines with "text-align"

topaz fjord
#

ul or li?

#

ok

#

nope

#

nope doesnt work

earnest phoenix
#

Try making a vertical layout.

#

@topaz fjord <center>

#

You also spelled Moderation wrong

#

kek

abstract mango
#

center element

#

>IMPLYING HTML 4

#

angery

earnest phoenix
#

lol

#

Also, why are you doing text-decoration: underline; when you could use <u>...</u>

#

????

#

addicted to css

#

Mayo...

#

Yes

#

Labels can hurt

#

wdym

#

lol

topaz fjord
#

what would u use to edit the bot prefix part

earnest phoenix
#

edit the bot

safe cloak
#

^, most libraries allow you to change the prefix

topaz fjord
#

you can put in tb! {configurable per-server}

#

in that space?

#

wow you can

earnest phoenix
#

Hello?

#

Erm I have a question

#

Well

#

I need help

#

Anybody?

#

Annnddd nobody is here

clear kernel
#

well

#

ask your question and people will help

earnest phoenix
#

Okay

#

How do I use .toLowerCase() on message.content

umbral pelican
#

did you even try?

earnest phoenix
#

Yes

#

Many times

#

And its still not working

#
message.content.toLowerCase();
#

This for some reason

#

Doesnt work

vale orbit
#

For that to work

umbral pelican
#

it returns the new value

vale orbit
#
if(message.content.toLowerCase() === "ping") {
// code here
}
#

It converts the captial letters to

#

lower case

prime cliff
#

Are you using c#?

earnest phoenix
#

No

prime cliff
#

js

earnest phoenix
#

Yes

#

@vale orbit But wouldnt that check for lower case?

vale orbit
#

Yeah

earnest phoenix
#

Instead of changing it?

vale orbit
#

both

earnest phoenix
#

Oh wot

vale orbit
#

capital and lowercase

earnest phoenix
#

Okay thank you

vale orbit
#

for an example

#

PiNg

#

= ping

#

๐Ÿ‘

earnest phoenix
#

OH

#

Oh I get it!

#

Wait

#

That wouldnt work

vale orbit
#

Hm?

earnest phoenix
#

Because my if statement has message.content.startsWith()

#

And goes off that

vale orbit
#
if(message.content.toLowerCase().startsWith("ping")) {
//insert code here
}
earnest phoenix
#

Ah okay

#

Thank you

vale orbit
#

Anytime. ^^

earnest phoenix
#

@vale orbit Hey uh can I ask you something else

#

Sorry to bother

vale orbit
#

Sure

earnest phoenix
#

I have an embed system thats gonna be used for afk messages

#

But

#

Something keeps coming up undefined

vale orbit
#

Hmm

earnest phoenix
#

Do you have any idea why its doing that?

vale orbit
#

May I have a look at your afk message code?

earnest phoenix
#

Sure

#

Whoops

#

Wrong code

vale orbit
#

xD

pale light
#

lol

earnest phoenix
#
client.on("message", (message) => {
    const args = message.content.slice('afk'.length).trim().split(/ + /g)
        if (message.content.toLowerCase().startsWith('afk')) {
        var Embed = new Discord.RichEmbed().addField(`Reason: ${args}`).setColor('BLUE').setTitle(`${message.author.username} is afk!`).setTimestamp(message.createdAt);
        message.channel.sendEmbed(Embed);  
    }
});
#

Here ya go lmao

vale orbit
#

Hmmm

pale light
#

hm

vale orbit
#

"Reason: k"

earnest phoenix
#

Its an arg system

vale orbit
#

Oh

#

You should cut out prefix + afk

earnest phoenix
#

Where?

vale orbit
#

Do you have a prefix?

earnest phoenix
#

Not set to a variable

#

But yes

vale orbit
#

Oh

#

Hmm

earnest phoenix
#

This doesnt use my prefix tho

pale light
#

oyes

#

Ik why

earnest phoenix
#

It just uses a simple message

pale light
#

.addField takes two parameters

#

you can't specify

#

just the top part

earnest phoenix
#

Oh

pale light
#

the top part is the title

vale orbit
#

OHHH

earnest phoenix
#

Wait what would the value be?

vale orbit
#

Thanks for pointing that out

earnest phoenix
#

Yep thank you

vale orbit
#

You could either do

pale light
#

np

vale orbit
#

.setDescription("Reason:"); if you're doing one parameter

#

or just do that

earnest phoenix
#

Doooo what?

pale light
#

just use .setDescription

vale orbit
#

^

earnest phoenix
#

Wait I tried that tho ;-;

pale light
#

?

vale orbit
#

Huh?

pale light
#

didn't work?

earnest phoenix
#

Ill show you

vale orbit
#

Okay

earnest phoenix
vale orbit
#

Hmm

#

What did you do

earnest phoenix
#

I added setDescription

vale orbit
#

Hmm

pale light
#

are you sure?

earnest phoenix
#

Yes

#
client.on("message", (message) => {
    const args = message.content.slice('afk'.length).trim().split(/ + /g)
        if (message.content.toLowerCase().startsWith('afk')) {
        var Embed = new Discord.RichEmbed().setDescription('test').addField(`Reason: ${args}`).setColor('BLUE').setTitle(`${message.author.username} is afk!`).setTimestamp(message.createdAt);
        message.channel.sendEmbed(Embed);  
    }
});

pale light
#

but then it works doesn't it

vale orbit
#

Then its args

pale light
#

oh my god

#

your reason is still in an add field ๐Ÿ˜‚

vale orbit
#

OH

pale light
#

so the undefined part of it is still there

#

just use

earnest phoenix
#

OHHHH

pale light
#

"\n"

earnest phoenix
#

I get what you mean

pale light
#

to make them into two lines

#

yeah

earnest phoenix
#

Thanks!

pale light
#

np

vale orbit
#

I was about to say that xD

#

๐Ÿ‘

earnest phoenix
#

Lol i find it funny how \n is a new line

vale orbit
#

lol

earnest phoenix
#

Wait

vale orbit
#

?

earnest phoenix
#

So is it impossible to have it in a line?

#

Or can it only be in the description

vale orbit
#

For addField, no

#

It can be in Descrpition

#

Description(

earnest phoenix
#

Okay

#

Wait

#

When I try to add a field its still coming up

#

I seporated the "reason:"

vale orbit
#

Hmm

earnest phoenix
#

Into the description

vale orbit
#

Take .addField out

earnest phoenix
#

Okay

vale orbit
#

if you haven't

earnest phoenix
#

Done

#

But then how would I do the reason

#

Wait

#

Idea

vale orbit
#

Break Line

earnest phoenix
#

Okay thank you again lmao

vale orbit
#

lol

#

Np

earnest phoenix
#

Yes

sinful meadow
#

i was sleeping my dood @The Darkness Soldier#1418

#

@The Darkness Soldier#1418

#

rip?

earnest phoenix
#

@The Darkness Soldier#1418

#

He either keeps leaving (that is third time) or invisible @sinful meadow

umbral pelican
#

@earnest phoenix

#

just invis

vale orbit
#

@The Darkness

#

He left

wispy jolt
#

still here

vale orbit
#

Lol

#

ok

#

I had to check via eval but seems like he still here

umbral pelican
#

"had to check via eval" GWlgbtqpFeelsthinkingman

#

just look at mutual servers

tawny lava
#

kek

vale orbit
#

nah

#

I'm lazy to look through a profile.

#

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

neon pasture
#

Is there something like fetchUser but then for Eris?

jagged plume
#

ive searched for something similar but cant find it

#

lemme know if you do find it though GWbowsuBlobThonkeng

bitter sundial
#

i think it was like getapiuser

#

getRESTUser

#

havent found anything else than that

neon pasture
#

Thanks, i will take a better look then

jagged plume
#

i think that requires a certain setting

earnest phoenix
#

Wow

neon pasture
#

@jagged plume First you have to enable restMode on the client options, then you have to use getRESTUser(userId)

earnest phoenix
#

I still need to add commands on my bot

next wedge
#

hi!

#

how can i create a ping command?

cerulean zinc
#

You need to learn code and decide on a lib

earnest phoenix
#

^

next wedge
#

...

merry yoke
#

Whats wrong here?

woven drum
#

Your opening the site as a file?

stone kiln
#

instead of fetching info you are trying to read it as a file

merry yoke
#
 private static JSONArray getArray(String userpass, String u){
        try {
            URL url = new URL (u);
            String encoding = Base64.getEncoder().encodeToString(userpass.getBytes());

            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setDoOutput(true);
            connection.setRequestProperty  ("Authorization", "Basic " + encoding);
            InputStream content = connection.getInputStream();
            BufferedReader in   =
                    new BufferedReader (new InputStreamReader(content));
            StringBuilder b = new StringBuilder();
            String line;
            while ((line = in.readLine()) != null) {
                b.append(line);
                System.out.println(line);
            }
            return new JSONArray(b.toString());
        } catch(Exception e) {
            e.printStackTrace();
        }
        return null;
    }```
#

I didn't read it as a file

#

WAIT

#

REQUEST METHOD

#

๐Ÿคฆ

#

I'm dumb

#

it needs to be GET

#

LOL

woven drum
#

lol

stone kiln
#

GG

merry yoke
#

eval this.class

#

java.io.IOException: Server returned HTTP response code: 401 for URL: https://discordbots.org/api/bots/364678314108911616/votes?onlyids=true

#

error

#

@woven drum

#

can u help ๐Ÿ˜› ?

abstract mango
#

server returned 401

#

401 = unauthorized

merry yoke
#

I put my token

woven drum
#

-bots @merry yoke

gilded plankBOT
#
VRCube | Cubxity#7801
Bots

@full whale

abstract mango
#

which means you either didn't specify a key, or it's invalid

woven drum
#

^

abstract mango
#

did you use your bot api key

merry yoke
#

use bot's api token right

#

yes

abstract mango
#

yeah

merry yoke
#
private static JSONArray getArray(String userpass, String u){
        try {
            URL url = new URL (u);
            String encoding = Base64.getEncoder().encodeToString(userpass.getBytes());

            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.setDoOutput(true);
            connection.setRequestProperty  ("Authorization", "Basic " + encoding);
            InputStream content = connection.getInputStream();
            BufferedReader in   =
                    new BufferedReader (new InputStreamReader(content));
            StringBuilder b = new StringBuilder();
            String line;
            while ((line = in.readLine()) != null) {
                b.append(line);
                System.out.println(line);
            }
            return new JSONArray(b.toString());
        } catch(Exception e) {
            e.printStackTrace();
        }
        return null;
    }```
#

code to get the upvote list

#

@abstract mango I did auth, so you know whats wrong here?

woven drum
#

@merry yoke i can check how i am doing it

#

wait a moment

merry yoke
#

k

woven drum
#

remove the "Basic "

merry yoke
#

lemme try

#
private static JSONArray getArray(String userpass, String u){
        try {
            URL url = new URL (u);
            String encoding = Base64.getEncoder().encodeToString(userpass.getBytes());

            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.setDoOutput(true);
            connection.setRequestProperty  ("Authorization",  encoding);
            InputStream content = connection.getInputStream();
            BufferedReader in   =
                    new BufferedReader (new InputStreamReader(content));
            StringBuilder b = new StringBuilder();
            String line;
            while ((line = in.readLine()) != null) {
                b.append(line);
                System.out.println(line);
            }
            return new JSONArray(b.toString());
        } catch(Exception e) {
            e.printStackTrace();
        }
        return null;
    }```
#

@woven drum doesn't work

woven drum
#

how it does not work?

earnest phoenix
#

woah...

merry yoke
#

I have no idea how that doesn't work

woven drum
#

No errors?

merry yoke
#

4-1

#

401

earnest phoenix
#

that... that... that... that coding... i have no clue how. but i could learn... :/

woven drum
#

-bots VRCube | Cubxity

gilded plankBOT
#
VRCube | Cubxity#7801
Bots

@full whale

merry yoke
#

returns 401 for that url

woven drum
#

-botinfo @full whale

gilded plankBOT
#
Bot info
ID

364678314108911616

Username

Cuberz

Discriminator

8759

Short Description

A multi-purpose discord bot, Moderation, Fun, Development

Library

JDA

Prefix
Upvotes

3

Server Count

No server count

Owner(s)

@merry yoke
@charred fractal
@slender garnet

Links
woven drum
#

hmm

#

@merry yoke send me the whole code w/ tokens and all in dms

#

so that i can check

merry yoke
#

why with token

woven drum
#

well

#

so that i can properly test it

#

in my own thing

merry yoke
#

wait

#

do i need user agent

woven drum
#

no

#
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
  .set('Authorization', dbotstoken)
  .send({ server_count: client.guilds.size })
  .then(console.log('Updated dbots.org status.'))
#

^ my code

merry yoke
#

wait

#

u don't need Base64 encoding thing?

woven drum
#

no?

merry yoke
#

just raw token

#

um

woven drum
#

ya

merry yoke
#

@woven drum works

#

can u try >eval command in #commands for me please?

earnest phoenix
#

@tawny lava

#

@merry yoke YOU ARE HERE XDDD

merry yoke
#

ofc

#

cause my bot is here

#

๐Ÿ˜ƒ

earnest phoenix
#

iam waiting

#

my bot

#

-bots @earnest phoenix

gilded plankBOT
#
Rakash#7591
Bots

@grand tulip

earnest phoenix
#

I added a status to it

#

and /ban & /kick

#

xD

#

lol xDD

merry yoke
#

:>

earnest phoenix
#

Lel

merry yoke
#

@glossy steeple

quiet bobcat
#

How do I make so when my bot joins a guild it shows it in the console?

prime cliff
#

๐Ÿคฆ thats too easy

quiet bobcat
#

ik ๐Ÿ˜ฆ

inner jewel
#

listen to event -> log

thorny hinge
#
client.on('guildCreate', guild => {
console.log(`Joined ${guild.name}!`);
});
shy rose
thorny hinge
#

thats d.js

#

Answering @quiet bobcats question

shy rose
#

well the have the same guild event ๐Ÿ˜›

thorny hinge
#

oh

quiet bobcat
#

I got it

#

But thanks atmg

thorny hinge
#

๐Ÿ‘Œ

elder badge
#
    at Object.exports.run (/root/Ignore/Ken-Kaneki/commands/info.js:25:64)
    at Client.client.on.err (/root/Ignore/Ken-Kaneki/ken-kaneki.js:58:19)
    at emitOne (events.js:96:13)
    at Client.emit (events.js:188:7)
    at MessageCreateHandler.handle (/root/Ignore/Ken-Kaneki/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (/root/Ignore/Ken-Kaneki/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (/root/Ignore/Ken-Kaneki/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:330:35)
    at WebSocketConnection.onMessage (/root/Ignore/Ken-Kaneki/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:293:17)
    at WebSocket.onMessage (/root/Ignore/Ken-Kaneki/node_modules/ws/lib/EventTarget.js:99:16)
    at emitOne (events.js:96:13)``` any1?
#

.addField(`My status is currently:`, `${client.presence.status}`, true) this is the erroring line

thorny hinge
#

Lol

earnest phoenix
#

help

#

lol

#

im here

thorny hinge
#

d.js?

earnest phoenix
#

ew

#

fuck off

elder badge
#

ya

#

wow

earnest phoenix
#

๐Ÿ™ ๐Ÿ”ซ

elder badge
#

i do multi languages but k

thorny hinge
#

client.user.presence.status

earnest phoenix
#

ima kms

#

lol

elder badge
#

thank you

thorny hinge
#

๐Ÿ‘

elder badge
#

i'll test it brb

#

works ty @thorny hinge

thorny hinge
#

Np

sinful meadow
#

@neat falcon

#

Do you actually want to lock a command or is it a troll

#

or lock it for upvotes

neat falcon
#

lock it for upvotes

#

i need upvotes

sinful meadow
#

I cant really tell if your joking or not

neat falcon
#

i'm not

#

i want to do it for @grand tulip

#

because i want to have 10x more upvotes :^)

#

and to lock my eval command as a joke

sinful meadow
#

lmao

#

Anyways i mean i can help

#

do you care if you use snekfetch

#

since thats how i did it

vale orbit
#

I wonder, if I can make a event of memberKick

prime cliff
#

There is no event for that

sinful meadow
#

Yea there is

vale orbit
#

Rip then

#

o

sinful meadow
#

i think there is

prime cliff
#

Thats on member leave

#

There is no kick event

sinful meadow
#

oh damn

#

there isnt

#

i know there is a ban one

vale orbit
#

Unless we hardcode it or something?

sinful meadow
vale orbit
#

Or its impossible

#

I have those

neat falcon
#

@sinful meadow ya i use litty snekfetch

#

lightweight af

#

5kb

#

nice meme

sinful meadow
#

Enjoy some crap code

#

๐Ÿ˜‰

#

Its crap

#

ik

neat falcon
#

thanks

sinful meadow
#

Np lmao

neat falcon
#

now to lock all commands but help

sinful meadow
#

xDDD

neat falcon
#

inb4 mee6 does that

sinful meadow
#

lmfao

neat falcon
#

instantly 100000000k upvotes

vale orbit
#

lmao

earnest phoenix
#

When do you look a certiacations? cause i have waited a day @fossil oxide

prime cliff
#

Waited only a day ahahaha boi

earnest phoenix
#

2 now

#

-bots @fossil oxide

gilded plankBOT
#
Oliy#0330
Bots <:dbladmin:308881474998763520>

@olive juniper
@tawny plover
@gilded plank
@finite olive
@exotic kite

prime cliff
#

Reee the pings

earnest phoenix
#

Hmm..

#

How can i upload an image in discord.js ?

#

-bots

gilded plankBOT
#
๐ŸŽ…Demi-lea๐ŸŽ…#7951
Bots

@neat pawn
@wind fossil

earnest phoenix
#

:/

#

-help

#

-bots noembed

gilded plankBOT
#

๐ŸŽ…Demi-lea๐ŸŽ…#7951's bots:
@neat pawn @wind fossil

earnest phoenix
#

lel

#

@gilded plank's Commands:
Luca works with the prefix of - or @gilded plank

  • botinfo @bot Click the bot name at the top to go to the website. Do not use this command for advertising or checking your server count in #general
  • bots <user>*
  • owner / -owners @bot*
  • prefix @bot
  • nsfw Hide the #306891333405245450 channel if you are under 18 and/or you don't want to accidentally go there after clicking through the warning (please use this command in testing)
#

@earnest phoenix

#

lol

#

-botinfo @gilded plank

gilded plankBOT
#
Bot info
ID

264811613708746752

Username

Luca

Discriminator

0393

Short Description

Luca is a bot for managing and informing members of the server

Library

discord.js

Prefix
Upvotes

35

Server Count

No server count

Owner(s)

@bitter sundial dbladmin
@fossil oxide dbladmin

Links
earnest phoenix
#

35 UPPVOES??

#

upvotes*

#

lel

#

-botinfo @wind fossil

gilded plankBOT
#
Bot info
ID

371304975390736384

Username

๐ŸŽ„ Discord Drinks ๐ŸŽ„

Discriminator

1841

Short Description

We love ice-cream and pizza... But to make it perfect you need a drink from Discord Drinks

Library

discord.js

Prefix

D-

Upvotes

4

Server Count

169 Servers

Owner(s)

@gritty acorn
@frozen heron

Links
earnest phoenix
#

169

#

:/

sinful meadow
#

Please dont do commands here

brazen grove
#

-botinfo @Zocket!

gilded plankBOT
#

Please include a bot mention

brazen grove
#

:/

earnest phoenix
#

Help

#

Pls

brazen grove
#

-botinfo @<373451764667777024>

gilded plankBOT
#

Please include a bot mention

brazen grove
#

:/

#

yeah

vale orbit
#

wew

earnest phoenix
#

You gotta

vale orbit
#

<@InsertID>

earnest phoenix
#

-botinfo @storm fossil

gilded plankBOT
#
Bot info
ID

373451764667777024

Username

Zocket!

Discriminator

7471

Short Description

A Beta Multi-purpose bot. (w/ Extraordinary Bug Fixes!)

Library

discord.js

Prefix

$$

Upvotes

1

Server Count

No server count

Owner(s)

@brazen grove

Links
vale orbit
#

m8

earnest phoenix
#

There ua go

#

*ya

brazen grove
#

kewl

prime cliff
#

No bot commands in here

#

REEEE

earnest phoenix
#

I needz help ;-;

vale orbit
#

Hm?

prime cliff
brazen grove
#

with what?

earnest phoenix
#

I cant reference the discord.richembed client outside of the index.js file

vale orbit
#

You gotta define Discord as well

brazen grove
#

yup

earnest phoenix
#

So var Discord = Discord.Client?

brazen grove
#

const

earnest phoenix
#

Doesnt rlly matter

brazen grove
#

yeah

vale orbit
#

require('discord.js');

#

If thats what you meant

earnest phoenix
#

Ah yes thats what I ment

#

Wait

vale orbit
#

?

slow folio
#

Does anyone have experience with converting letsencrypt ssl files to a .jks file?

brazen grove
#

it would be var client = new disocrd.client

earnest phoenix
#

DOne dev

#

*Done

#

So you need requires even in the other files ๐Ÿค”

#

Curious

vale orbit
#

Yeah

earnest phoenix
#

@brazen grove No

#

Well

#

Not for this

brazen grove
#

k

vale orbit
#

I had module exports before, but now I use a single file.

earnest phoenix
#

Well thank you!

#

Okay

vale orbit
#

๐Ÿ‘

earnest phoenix
#

I prefer different files for commands

brazen grove
#

ok

vale orbit
#

That's your opinion ^-^

earnest phoenix
#

Wait

vale orbit
#

Hm?

brazen grove
#

ive never gotten that to work for me ๐Ÿ˜›

earnest phoenix
#

So const Discord = require('discord.js');

vale orbit
#

Yeah

earnest phoenix
#

Correct?

#

Okie

#

Thx!

vale orbit
#

๐Ÿ‘

brazen grove
#

^

thorny hinge
#
"Hey-hi".split("-")

Will give "Hey,hi"
But how can I get the first thing only GWflamesThonking

clear kernel
#

[0] โฌ‡

smoky rampart
#

"Hey-hi".split("-")[0]

#

damn I was too slow

thorny hinge
#

k

#

Thx

wispy jolt
#

what lang is this

quasi marsh
#

Python probably

abstract mango
wispy jolt
#

not python and even then

#

you wouldn't use split

#

not like that at least

#

(not without specifying a limit)

wooden shoal
#

Its javascript...

smoky rampart
#
Python 3.5.3 (default, Sep 14 2017, 22:58:41) 
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> "Hey-hi".split("-")
['Hey', 'hi']
>>> 
#

python as well

river dawn
#
    r = requests.post("https://discordbots.org/bots/{}/stats".format(bot.user.id), json={"server_count": len(bot.guilds)}, headers={"Authorization":config.orgtoken})
#

does it take a long time to post or is there something wrong with this

thorny hinge
#

It's almost instant so something is up with ur code

#

But I don't do the snake lang

#

Lol

river dawn
#

idk what could be up with it because it's working for discord.pw

thorny hinge
#

Hm

river dawn
#

i'll keep trying other stuff

thorny hinge
#

Ok

inner jewel
#

if it takes a long time to post

#

it's most likely your internet

river dawn
#

it's working now

#

idk what fixed it but i randomly started changing stuff and now its working ยฏ_(ใƒ„)_/ยฏ

thorny hinge
wispy jolt
#

lol

earnest phoenix
#

Help

#

pls

#

Im getting a memory leak error

#

@sinful meadow

#

Bro?

#

.>

#

@here

#

Anyone?

#

.>

pale light
#

close it

earnest phoenix
#

?

pale light
#

why are you getting a memory leak error

#

ah

earnest phoenix
#

I tried the method

#

But it said it was undefined

pale light
#

are you using request?

earnest phoenix
#

No require

pale light
#

var request = require('request') ?

earnest phoenix
#

Nope

pale light
#

you're just using require

#

._.

earnest phoenix
#

Im using require to hold together the other .js files

#

And to call Discord.js

pale light
#

yeah ok

earnest phoenix
#

But thats it

pale light
#

idk about the specifics

#

but you should take a nice look through your code, cause theres an error in there somewhere

earnest phoenix
#

.>

#

I think it just reached the max amount of listeners

#

It says I can reset the limit but im not sure how to set that up

#

Wait

#

Lemme try something

#

Great I got an import error

sinful meadow
#

How can you be getting a memory leak @earnest phoenix

#

Wait

#

i think i know why

#

You may have too many events when the bot is launched

mossy sonnet
#

you should only allow nsfw content in channels that start with nsfw- right?

sinful meadow
#

Nope @mossy sonnet

#

The channel has to have the nsfw permission

#

or the name

earnest phoenix
#

Yep

#

@sinful meadow

sinful meadow
#

Yep what? @earnest phoenix

#

Too many events?

earnest phoenix
#

Its too manye vent listeners

#

*many

sinful meadow
#

Yep

earnest phoenix
#

How do I fix it ;-;

sinful meadow
#

That will cause a leak

#

Dont put alot in 1 file

earnest phoenix
#

Oh

#

๐Ÿ‘Œ

#

Thx!

mossy sonnet
#

oh

#

so is NSFW a perm?

#

I'm using discord.js so idk how that would work

sinful meadow
#

They have a channel option for it

#

if(message.channel.nsfw) lmao

wispy jolt
#

there are new-style nsfw channels

#

they do not have to start with nsfw- anymore

mossy sonnet
#

o

#

ok thanks

#

:3

earnest phoenix
#

Uh

sinful meadow
#

Suuh

earnest phoenix
#

Its still coming up with an error

sinful meadow
#

Delete all the events that you dont need

earnest phoenix
#

After I dissemminated my code

#

I did

#

I put most into seporate .js files

wispy jolt
#

you're welcome ari

earnest phoenix
#

Its still erroring

#

๐Ÿ˜

#

@sinful meadow

#

I has a question

sinful meadow
#

Sup

#

Sure

earnest phoenix
#

How can I make my code wait for another message

#

And then run itsself?

sinful meadow
#

You might be talking about a message Collector

earnest phoenix
#

Well, like

#

A message is said and a code is run

#

Then it waits for another message

#

And then runs more code

#

Is that what it is?

sinful meadow
#

Yea

earnest phoenix
#

How would I work that >.>

#

Sorry to bother you

sinful meadow
#

Well

#

You get who said the command

#

for example their id

earnest phoenix
#

Okay

sinful meadow
#

Then use something like message Collector on the d.js and wait for a reply

#

or something idk

earnest phoenix
#

Okie ill try it!

#

so like message.author.fetchMember(IDhere)

sinful meadow
#

idk

earnest phoenix
#

๐Ÿ‘Œ

sinful meadow
#

@earnest phoenix Just made a porn command

#

๐Ÿ˜‰

pale light
brazen grove
#

@storm fossil

earnest phoenix
#

@The Darkness Soldier#1418 the message event?

#

wtf

#

stop going offline

earnest phoenix
quiet bobcat
#

@earnest phoenix What lib?

earnest phoenix
#

discord.js

quiet bobcat
#

Ok

#

var embed = new Discord.RichEmbed()
       addField(output)
        message.channel.send(embed)```
#

idk if that works

#

or not

#

it should be .addField but it wouldnt let me

#

@earnest phoenix

earnest phoenix
#

err : output is not defined

#

i'm stupid ๐Ÿ˜

quiet bobcat
#

You removed the output let

#

@earnest phoenix Did you fix it?

earnest phoenix
#

noh

quiet bobcat
#
if (command == "test") {
    if(message.mentions.users.first()) { 
        let user = message.mentions.users.first()
        let output = user.avatarURL
    var embed = new Discord.RichEmbed()
    .addField(output)
    message.channel.send(embed)
}}```
#

Try that

#

@earnest phoenix

earnest phoenix
#

k

quiet bobcat
#

Hmm

#

Why does it say undefined

earnest phoenix
#

idk :)))

quiet bobcat
#
if (command == "test") {
    if(message.mentions.users.first()) { 
        let user = message.mentions.users.first()
        let output = user.avatarURL
    var embed = new Discord.RichEmbed()
    .setAuthor("Avatar")
    .setDescription("[Avatar Link](output)")
    message.channel.send(embed)
}}```
#

Maybe try that

#

@earnest phoenix

earnest phoenix
#

hmm

quiet bobcat
#

And click that blue text

#

Did that bring you to the avatar?

earnest phoenix
#

noh ๐Ÿ˜ฆ

quiet bobcat
#

Hmm

#

What did it do?

earnest phoenix
#

my bot is not in the server :

quiet bobcat
#

Oh yeah

#

:/

tawny lava
#

@earnest phoenix change addField to setImage

quiet bobcat
#

Oh yeah

#

So .setImage(output)

smoky rampart
#

I am Groot

earnest phoenix
#

yess !! TY @quiet bobcat and @tawny lava

#

๐Ÿ˜—

quiet bobcat
#

It was only lizard

#

๐Ÿ˜‰

tawny lava
#

Np

quiet bobcat
#

but np

undone plover
#

how do I make it link text?
[my bot]

prime cliff
#

For embeds in the description add Name

#

@undone plover beep

crystal void
#

Hello normal people and of course our developers ๐Ÿ˜Š
I am very happy to announce that after our whole ChatWithUs company network (only servers) have crashed and that we have recovered everything, so @gritty dirge is finally up again! I hope you will have some fun with it again ๐Ÿ˜„
Thanks to @earnest phoenix and some other people, including @upper ember for helping to get everything up again and just helping with the code ๐Ÿ˜‰
I will soon add an option to report bugs, submit wanted improvements and a lot of other stuff, with that release, you will also get an option to host (only one part of the code for now, sorry ๐Ÿ˜ญ) it yourself ๐Ÿ˜ƒ
Enjoy life if and when you still have it ๐Ÿ˜›

next wedge
#

:)

prime cliff
#

Nice PSA

#

Also that emoji spam oof

next wedge
#

๐Ÿ˜€ ๐Ÿ˜€ ๐Ÿ‘Œ ๐Ÿ‘Œ

uncut slate
#

@quiet bobcat you have no idea what you're doing ๐Ÿค”

quiet bobcat
#

I know

wispy jolt
#

ok

quiet bobcat
#

@uncut slate I suck at coding GWcfcThonk

wooden shoal
#

How r u here tyen lol

quiet bobcat
#

Not sure

#

Luck I guess

earnest phoenix
#

๐Ÿ‘€

smoky rampart
#

๐Ÿค”

#

I'm the best coder in the universe

agile lake
#

hmm not exactly sure how to use the discordbot api for posting server count

#

hmm not exactly sure how to use the discordbot api for posting server count

#

hmm not exactly sure how to use the discordbot api for posting server count

vale orbit
#

Library?

#

And its in

prime cliff
#

You need to send a POST request also look in ^

agile lake
#

ooh tyty

earnest phoenix
#

Any idea how I would get my bot to send a message to a random channel when it first joins a guild?

#

JavaScript

clear kernel
#

Completely random, or a first channel that it has permission to send to?

earnest phoenix
#

first channel its got perms to

#

Iterate through the chans till you find one you have perms

#

Send message

#

Then break the for loop

#

im not smart like that xD I dont know how to code shit like that but ill give it a go ๐Ÿ˜›

clear kernel
#
msg.guild.channels.filter(v => v.type === 
"text").first().send(yourMessageGoesHere)```
#

that's a start

#

that checks if its a text channel

#

and then you need to add a check if the bot has permission to send_messages, and you might want to catch errors

smoky rampart
#

inb4 no channels

clear kernel
#

then you just raid it and spam the owner duh

smoky rampart
#

good strategy

desert orbit
thorny hinge
#

You tried to access something you don't have access to

#

๐Ÿ‘€

#

Probs perms or smth

desert orbit
thorny hinge
#

Oh

earnest phoenix
#

vscode or atom? that theme is familiar

thorny hinge
#

So still that error means ur trying to access something u dont have perms to view GWflamesThonking

desert orbit
#

vscode

earnest phoenix
#

ahh

thorny hinge
#

Hmm

#

Well I dont use that method of posting to their api so idk

desert orbit
#

what method do you use?

thorny hinge
#

I just used a random d.js one lol

#

But try putting that id in a string

#

Or what I am assuming is an id

desert orbit
#

okay I will try that.

#

It wants a value not a string.

#

@thorny hinge Do you know what d.js thing u use if you know?

thorny hinge
#
const snekfetch = require('snekfetch')

snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
  .set('Authorization', 'YOUR DISCORDBOTS.ORG API TOKEN')
  .send({ server_count: client.guilds.size })
  .then(() => console.log('Updated discordbots.org stats.'))
  .catch(err => console.error(`Whoops something went wrong: ${err.body}`));

desert orbit
#

ty

thorny hinge
#

๐Ÿ‘Œ

desert orbit
#

do I need to download an npm called snekfetch?

thorny hinge
#

Yeah

desert orbit
#

okay

thorny hinge
#

Wait

desert orbit
#

This one seem okay?

thorny hinge
#

Yes

desert orbit
#

Okay ty so much

thorny hinge
#

And I changed the code above a bit

#

๐Ÿ‘€

desert orbit
#

u have been a life saver

thorny hinge
#

No problem

desert orbit
#

OMG it worked

#

Ur the best

earnest phoenix
#

Hey uh guys?

#

Anybody? ._.

#

Nvm

pale light
#

lol

cosmic plover
#

lol

pale light
#

on point

earnest phoenix
#

Can I have my bot tested here

gilded plankBOT
#
Rainbowdashboygamer#2846
Bots

@edgy dew

earnest phoenix
#

Pls

#

Help

#

Im dying is a dessert

#

Jk

#

I needz some help

shy rose
#

wut

earnest phoenix
#

I need to know how to make a permission checker

#

For d.js

shy rose
#

uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh i know d.io

#

there close enough right?

earnest phoenix
#

Nooottt rlly

#

Jk idk

shy rose
#

no there not .js is way more object orentated then .io

earnest phoenix
#

Oh

#

Okay

#

๐Ÿ‘Œ

#

Anywho

sinful meadow
#

Sup

earnest phoenix
#

String!

sinful meadow
#

Hey man

earnest phoenix
#

Sup bro

shy rose
#

look up the byte numbers thats what you wanna check

earnest phoenix
#

I needz a bit of help

sinful meadow
#

Whats ya trying to do

earnest phoenix
#

Permission checker system

#

Would it be an if statement?

sinful meadow
#

@earnest phoenix ```js
if(message.member.hasPermission("KICK_MEMBER")){ message.channel.send("YOU HAVE PERMISSION KICK_MEMBERS")}else{message.reply("Fuck off you dont have KICK_MEMBERS")}

#

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

earnest phoenix
#

It is an if statement!

#

I shall study this forever

#

Lmao thank you!

sinful meadow
#

You cant use author because that isnt a guild object

#

member is a guild object which is like author

earnest phoenix
#

Ik

#

Author gets the user

#

And user and member are different

sinful meadow
#

Yea

earnest phoenix
#

Uh

#

My bot crashed

#

When I said something

shy rose
#

welcome to bot developers life

earnest phoenix
#

Lmao ik

#

My bot crashes so often

sinful meadow
#

Yep

#

Welcome to becoming a developer

earnest phoenix
#

It says rangeError

#

๐Ÿ˜

sinful meadow
#

ranageError Thonk

earnest phoenix
#

Oh

#

"invalid permission string"

sinful meadow
#

What did you put

earnest phoenix
#

The thing you put

#

Plus

sinful meadow
#

KICK_MEMBERS?

earnest phoenix
#

"BAN_MEMBER"

#

Oh

sinful meadow
#

add a s

earnest phoenix
#

Forgot the S

sinful meadow
#

lool

earnest phoenix
#

FFFFFFFFFFFFFFFF

#

forgets one s

#

code crashes entire system

sinful meadow
#

Yep

#

Thats why its nice

#

having a seprate file bot

earnest phoenix
#

Lmao

sinful meadow
#

1 code breaks

#

Whole bot wont

#

Only that command

earnest phoenix
#

Well good for them

#

Lel

#

Wait

#

How would I reference my bot as a member ๐Ÿ˜

#

TypeError: Cannot read property 'hasPermission' of undefined

sinful meadow
#

shit

#

um

#

do this

#

.member(client.user)

#

or if you didnt say client do .member(bot.user)

earnest phoenix
#

Wait I has fixed it

#

I just needed to define discord client and discord again

#

Thx tho!

#

And now its silent

#

With no errors and still not working

#

๐Ÿ˜

#

@sinful meadow >.>

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

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

Ill run the debugger

tawny lava
#

becuase client.member isn't a thing

earnest phoenix
#

Then how do I reference it ๐Ÿ˜

#

I tried what string said