#development

1 messages Β· Page 329 of 1

keen nest
#

^halp

#

Ugh

ebon helm
#

dmail help

sinful meadow
keen nest
#

Oh

#

Shit

#

I thought I was sorry πŸ˜‚

#

Didn't notice

sinful meadow
#

Its good

#

@ebon helm Learn this

#
ebon helm
#

ok

sinful meadow
#

Or Python

ebon helm
#

i got python

sinful meadow
#

Python is better but i dont use it

keen nest
#

Meh

ebon helm
#

huh

thin pilot
prime cliff
thin pilot
#

srry

topaz fjord
#

tickYes

earnest phoenix
#

My monitor was fixed πŸ˜ƒ

scenic crest
#

yay

earnest phoenix
#

now my screen can be large, ;D

barren brook
#

Hi.

topaz fjord
#

can someone help me

earnest phoenix
#

With what? @topaz fjord

topaz fjord
#
google.resultsPerPage = 3
let object = args;
 
google(object, function (err, res){
  if (err) console.error(err)
 
    var link = res.links[1];
    var link2 = res.links[2];

        if(!link.title) {
test = "Nothing Found, Sorry";
}

if(!link2.title) {
test2 = "Nothing Found, Sorry";
}

    if(link.link == null) {
test = "Nothing Found, Sorry";
}

if(link2.link == null) {
test2 = "Nothing Found, Sorry";
}

    let test = `${link.title}\n${link.href}`;
    let test2 = `${link2.title}\n${link2.href}`;

    // console.log(link);
    // console.log(link2)

    const embed = new Discord.RichEmbed()
            .setColor("RANDOM")
            .setAuthor('Google Search Results', `http://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/1000px-Google_%22G%22_Logo.svg.png`)
            .addField(`First Result`, test)
            .addField(`Second Result`, test2)
            .setTimestamp()
            .setThumbnail('https://cdn.dribbble.com/users/604032/screenshots/2675111/1.gif');
    message.channel.send({embed})

})
#
        if(!link.title) {
                ^

TypeError: Cannot read property 'title' of undefined
    at C:\Users\Sid\Desktop\BobBot\cmds\google.js:14:17
    at Request._callback (C:\Users\Sid\Desktop\BobBot\node_modules\google\lib\google.js:96:7)
    at Request.self.callback (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)```
#

tryiing to put a precaution so that if there no title then it returns something

inner jewel
#

link is undefined

topaz fjord
#

title is undefined

inner jewel
#

if(!link || !link.title)

#

iirc

#

no

topaz fjord
#

because there is no title

inner jewel
#

link is

topaz fjord
#

thats why

inner jewel
#

it can't read title from link

#

because link is undefined

topaz fjord
#

i wanna check id the link has no title

inner jewel
#

you never check if link is undefined

topaz fjord
#
    if(link.link == null) {
test = "Nothing Found, Sorry";
}

if(link2.link == null) {
test2 = "Nothing Found, Sorry";
}
#

i actually did

inner jewel
#

no

#

link != link.link

#

var link = res.links[1];

#

this is undefined

topaz fjord
#
  link: null,
  description: '',
  href: null }
{ title: 'Facebook Newsroom',
  link: 'https://newsroom.fb.com/',
  description: 'As part of Facebook AI Research (FAIR), this new team will join more than 100 \nscientists across Menlo Park, New York, and Paris in working to advance the field\nΒ ...',
  href: 'https://newsroom.fb.com/' }```
#

when i console.log link

#

but that still doesnt work @inner jewel

earnest phoenix
#

@topaz fjord thats node, correct?

topaz fjord
#

yes

earnest phoenix
#

Lib?

topaz fjord
#

discord.js

#

moose

#

i wanna make it so that if the bot cant find the title of the link

#

it will send nothing found

earnest phoenix
#

Sending embed as json or Rich embed

topaz fjord
#

rich

#
google(object, function (err, res){
  if (err) console.error(err)
 
    var link = res.links[1];
    var link2 = res.links[2];
    let test = `${link.title}\n${link.href}`;
    let test2 = `${link2.title}\n${link2.href}`;

    if(link.link == null) {
test = "Nothing Found, Sorry";
}

if(link2.link == null) {
test2 = "Nothing Found, Sorry";
}

    const embed = new Discord.RichEmbed()
            .setColor("RANDOM")
            .setAuthor('Google Search Results', `http://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/1000px-Google_%22G%22_Logo.svg.png`)
            .addField(`First Result`, test)
            .addField(`Second Result`, test2)
            .setTimestamp()
            .setThumbnail('https://cdn.dribbble.com/users/604032/screenshots/2675111/1.gif');
    message.channel.send({embed})

})
#

my code

earnest phoenix
#

What is the title of the link if there isn't anything foun

#

D

#

Undefined or something else?

topaz fjord
#
  link: null,
  description: '',
  href: null }
{ title: 'Facebook Newsroom',
  link: 'https://newsroom.fb.com/',
  description: 'As part of Facebook AI Research (FAIR), this new team will join more than 100 \nscientists across Menlo Park, New York, and Paris in working to advance the field\n ...',
  href: 'https://newsroom.fb.com/' }```
#

an example if i console.log(link)

#

i want to check if link.title = null

#

but i keep on getting this error

#
    let test = `${link.title}\n${link.href}`;
                      ^

TypeError: Cannot read property 'title' of undefined
    at C:\Users\Sid\Desktop\BobBot\cmds\google.js:14:23
    at Request._callback (C:\Users\Sid\Desktop\BobBot\node_modules\google\lib\google.js:96:7)
    at Request.self.callback (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)```
barren brook
#

I have a question.

trim steppe
#

when link is null

#

you probably can't read title

barren brook
topaz fjord
#

i have the precaution for like = null

#

@barren brook google

earnest phoenix
#
If(link.title) { title = link.title; } else { title = "Nothing Found"; }```
#

That should work

topaz fjord
#

same error

earnest phoenix
#

What is link

topaz fjord
#

wrote it like this

#
    google.resultsPerPage = 3
    let object = args;
    google.protocol = 'https';
     
    google(object, function (err, res){
      if (err) console.error(err)
     
        let title;
        var link = res.links[1];
        var link2 = res.links[2];

            if(link.title) { title = link.title; } else { test = "Nothing Found"; }
    if(link2.title) { title = link2.title; } else { test2 = "Nothing Found"; }
    
        let test = `${link.title}\n${link.href}`;
        let test2 = `${link2.title}\n${link2.href}`;

        if(link.link == null) {
    test = "Nothing Found, Sorry";
    }

    if(link2.link == null) {
    test2 = "Nothing Found, Sorry";
    }

        const embed = new Discord.RichEmbed()
                .setColor("RANDOM")
                .setAuthor('Google Search Results', `http://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/1000px-Google_%22G%22_Logo.svg.png`)
                .addField(`First Result`, test)
                .addField(`Second Result`, test2)
                .setTimestamp()
                .setThumbnail('https://cdn.dribbble.com/users/604032/screenshots/2675111/1.gif');
        message.channel.send({embed})

    })
barren brook
#

Can i have a script for a music bot?

earnest phoenix
#

No

topaz fjord
#

no

earnest phoenix
#

Make your own

topaz fjord
#
C:\Users\Sid\Desktop\BobBot\cmds\google.js:16
            if(link.title) { title = link.title; } else { test = "Nothing Found"; }
                   ^

TypeError: Cannot read property 'title' of undefined
    at C:\Users\Sid\Desktop\BobBot\cmds\google.js:16:20
    at Request._callback (C:\Users\Sid\Desktop\BobBot\node_modules\google\lib\google.js:96:7)
    at Request.self.callback (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (C:\Users\Sid\Desktop\BobBot\node_modules\request\request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)
earnest phoenix
#

There are many tutorials for making music bots

barren brook
#

Ok.

topaz fjord
#

xoxfl

barren brook
#

?

topaz fjord
#

arent you a roblox scripter

barren brook
#

Ya.

topaz fjord
#

what lang does that use

barren brook
#

Idk I just know the scripts.

inner jewel
#

lua iirc

topaz fjord
#

lol

#

then how do you call yourself a roblox scripter if you dont know the language your writing

#

any idea moose

barren brook
#

Wait I think I know the language

topaz fjord
#

lol

#

fake robloc scripter here ^^^

#

idk why your so proud of robloc scripting, its not gonna earn you shit

inner jewel
#
function f() 
    return ({pcall(function() return "You have paid your respects" end)}[2]
end```
barren brook
#

Um..., I use Lua 5.1 scripting on roblox.

inner jewel
#

that's valid lua 5.1

#

lul

topaz fjord
#

took you years but k

surreal peak
#

lol

slow idol
#

@topaz fjord Check if the variable isn't null before checking its properties

#

Because when a variable is null, it doesn't have a property title therefore it gives you that error

#

null / undefined

#
if (link && link.title) { ...
topaz fjord
#

i fixed it

earnest phoenix
#

help

#

RangeError: RichEmbed field values may not be empty.

umbral pelican
#

the heck do you think that means

tawny lava
#

Lol

ebon helm
#

i need help

#

with python coding

fickle solstice
#

when i type -servers can i make so i can see all guilds name? discord.js

ebon helm
#

i need help with making a new comand python

next path
#

cAn I gEt ScRiPt

ebon helm
#

plz help

tulip bane
#

wee

earnest phoenix
#

Hey

#

I need a little help

fringe flame
#

@earnest phoenix, I can help you.

earnest phoenix
#

Okay

#

Well

#

Im trying to create a ban system

#

Yet, whenever i do any promise

fringe flame
#

hmm~

#

Lib?

earnest phoenix
#

It comes up as an unhandled promise rejectione rrotr

#

*error

#

No, discord.js

#

*rejection

tawny lava
#

Thonk

ebon helm
tawny lava
#

Show code wgen

earnest phoenix
#

I followed the documentation

#

Okay

fringe flame
#

The code, please.

earnest phoenix
#
//    async run(message, args) {
        doSomething().then(function(result) {
            return doSomethingElse(result);
          })
          .then(function(newResult) {
            return doThirdThing(newResult);
          })
          .then(function(finalResult) {
            message.mentions.members.first().guildmember.ban("You have been banned")
          })
          .catch(failureCallback);
        
        console.log("Command run: Ban")
    }
}
#

It comes up unhandled

#

Yet, im not sure why

#

It has a catch to catch the faliure callback

fringe flame
#

I think can send you my system

earnest phoenix
#

Okay...

#

But whats wrong with the code lel

#

It seems to be handled

#

So im not sure why its erroring

languid dragon
#

here

earnest phoenix
#

Yes ik

#

Lol

languid dragon
#

kk

#

u just had .ban("You have been banned")

earnest phoenix
#

Yes...

#

Oh

#

Wait

#

Ban.reason

#

The documentation didnt say that

#

.>

ebon helm
#

xd

earnest phoenix
#

It said to either put a number value or a string value

ebon helm
#

btw what documenttion

languid dragon
#

d.js?

earnest phoenix
languid dragon
#

.ban(options)

ebon helm
#

ok ty

earnest phoenix
#

Yep

languid dragon
#

options = {2, "Ban reason"}

earnest phoenix
#

Oh

languid dragon
#

or

earnest phoenix
#

.ban.options?

languid dragon
#
guildMember.ban({days:3,reason:"reason here"});
#

Ban options. If a number, the number of days to delete messages for, if a string, the ban reason. Supplying an object allows you to do both.

earnest phoenix
#

Yes

#

It didnt say anything about the {} lol

#

Oh

languid dragon
#

its implied with knowing javascript

earnest phoenix
#

🀦

#

Okay

#

Objects are {} im guessing

#

Its still unhandled

languid dragon
#

also

earnest phoenix
#

πŸ€”

languid dragon
#

message.mentions.members.first().guildmember.ban("You have been banned")

#

message.mentions.members.first().ban("You have been banned")

#

first() grabs the first instance

earnest phoenix
#

Lol ik ik

languid dragon
#

well if you know, why is it like that Thonk

earnest phoenix
#

It will grab the mention

#

Okay, so

#

message.mentions.members.first().guildmember.ban("You have been banned")

#

This grabs the mention

#

Then bans the member

#

No

languid dragon
#

no

#

message.mentions.members.first().ban("You have been banned") this does.

earnest phoenix
#

πŸ€”

#

Didnt work

#

As i thought

languid dragon
#

show the error

earnest phoenix
#

Still unhandled promise rejection

#

Yet

#

The promise seems fine

languid dragon
#

on what line

prime cliff
#

You need to ban on the guild object not the user object?

earnest phoenix
#

12256

#

@prime cliff Yes

languid dragon
#

can you show the code pls

#

the error

earnest phoenix
#
//    async run(message, args) {
        doSomething().then(function(result) {
            return doSomethingElse(result);
          })
          .then(function(newResult) {
            return doThirdThing(newResult);
          })
          .then(function(finalResult) {
            message.mentions.members.first().ban({days:99,reason:"Your a bad person"})
          })
          .catch(failureCallback);
        
        console.log("Command run: Ban")
    }
}
prime cliff
#

Its suppose to be on the guild object though?

languid dragon
#

are you actually

#

using that copy pasted code

#

you know you dont need all that to ban a user?

#

right?

earnest phoenix
#

Lol ik

#

You just need the last part

#

.then

prime cliff
#

Guild.Ban(User,Days,Reason)m

languid dragon
#

well obviously that code wont work

earnest phoenix
#

See

prime cliff
#

^

earnest phoenix
#

It is guild.ban

languid dragon
#

its d.js

earnest phoenix
#

Wait

#

Wouldnt be guildmember?

languid dragon
#

my way was perfectly fine

earnest phoenix
#

Then why is it erroring?

#

Β―_(ツ)_/Β―

languid dragon
#

// async run(message, args) {

#

are you actually running that code

#

how it is

earnest phoenix
#

x d

languid dragon
#

or have you edited it to be different

#

in your actual code

#

because if thats the case, show us the actual code where the error is occuring

#

other wise

#

you have async run() commented out

#

and you have unnecessary callbacks and empty functions & .then()'s that do nothing lmfao

earnest phoenix
#

Lol ik

#

I removed them

#

Β―_(ツ)_/Β―

languid dragon
#

if you knew, u wouldn't be coming here for help

earnest phoenix
#

Um, what xD

languid dragon
#

"Lol ik"

earnest phoenix
#

Yes

#

I knew they did nothing

#

If they were the thing erroring the code, i didnt know

languid dragon
#

then why didn't you remove them>

earnest phoenix
#

Because i didnt want to

#

Β―_(ツ)_/Β―

languid dragon
#

well that seems stupid and unnecessary if im honest

earnest phoenix
#

Yep

#

It is

#

Im tbh just trying to build a ban system

prime cliff
#

Well you aint getting nowhere if you dont even know how to debug your code

earnest phoenix
#

Im trying to debug it lol

#

Yet this documentation sucks

languid dragon
#

this documentation is the easiest one

#

its not the docs πŸ‘€

prime cliff
#

^

languid dragon
#

docs aren't meant to teach you how to code

earnest phoenix
#

Ik, ment for help

languid dragon
#

they're there 2 teach you how to use the wrapper

earnest phoenix
#

promise.then(onFulfillment)
return codehere
.catch (error)

#

πŸ€”

#

Well, guess im figuring this out on my own

languid dragon
#
async function banCommand(message){
  if(message.mentions.users == null || message.mentions.users == undefined){
    // no user was tagged etc
    return;
  }else{
    await message.mentions.members.first().ban({days:0,reason:""});
  }
}

banCommand(message).then(()=>{ message.channel.send("User was banned.") });

#

its untested and

#

its not perfect

#

but that would be an example of how to do it

#

im not actually sure if mentions.users returns null or undefined if no one is tagged

#

but i'd gues so

earnest phoenix
#

It would be undefined

#

You need the members.first() code line

#

But thx!

#

Okay wait

#

Imma study this

prime cliff
#

Yea you better πŸ™„

#

:3

earnest phoenix
#

Its message.mentions.members

#

Hm πŸ€”

#

I get it

languid dragon
#

it doesn't matter really

#

either way

#

if its null its null and it means nobody was tagged

earnest phoenix
#

Oh true true

languid dragon
#

so really it doesn't matter which you use

earnest phoenix
#

But they will be tagged

languid dragon
#

assuming some idiot comes along and types //ban

#

without tagging someone

earnest phoenix
#

Lmao

languid dragon
#

you're going to get an error

earnest phoenix
#

Okay

languid dragon
#

its common sense

earnest phoenix
#

Yep

#

I need to learn asyncs and stuff

#

Oh i get it!

#

The {} are kinda like the .then statements

#

Only with open code

#

Well, in this case its what that looks like

languid dragon
#

what

#

{} means a lot of different things

earnest phoenix
#

Okay

#

"message is not defined"

languid dragon
#

i wonder what that means Thonk

earnest phoenix
#

Ah

#

Wait

#

message.member

languid dragon
#

what about it?

earnest phoenix
#

Annnnddd nevermind!

#

Lmao as soon as it starts up

languid dragon
#

well obviously you're not calling it when a message event occurs

#

you're calling it straight away

#

so obviously a message doesn't exist

#

Β―_(ツ)_/Β―

earnest phoenix
#

When i do, it wont let me start the bot lol

#

Because "Message is undefined"

languid dragon
#

omg what is your code

#

you're obviously missing something or you're doing the message event completely wrong

earnest phoenix
#
//const commando = require('discord.js-commando');

class BanCommand extends commando.Command {
    constructor(client) {
        super(client, {
            name: 'ban',
            group: 'moderation',
            memberName: 'ban',
            description: 'Bans the mentioned user'
        });
    }
}
async function banCommand(message){
    if(message.mentions.members == null || message.mentions.members == undefined){
      // no user was tagged etc
      return;
    }else{
      await message.mentions.members.first().ban({days:0,reason:""});
    }
  }
  
  banCommand(message).then(()=>{ message.channel.send("User was banned.") });
  module.exports = BanCommand;
#

It comes up with an error the second to last line

languid dragon
#

yeah

#

nah

#

that makes no sense 2 me

earnest phoenix
#

?

#

So is the code supposed to be working?

#

Or did i do something wrong lol

languid dragon
#

im not gr8 with classes so honestly i cant help you with what you're doing

#

seems like its way too complicated for what it is

earnest phoenix
#

Okay

#

Its just erroring all over the place'

ebon helm
#

i need help with making new command

#

python

restive totem
#

console.print("Enter the JDA chamber")

#

idk python

shrewd field
#

hey

#

how can i make an announce command like this but gives me what needs to be announced not with it the command it self. I used message.content but i want it without the command

#

without --announce

#

only announced then the announcement

fleet epoch
#

@earnest phoenix

paper zephyr
#

Hii

shrewd field
#

hi

#

yes

#

does anyone know how

earnest phoenix
#

@fleet epoch

fleet epoch
#

is the //command stuff in your code

earnest phoenix
#

No

fleet epoch
#

commando*

paper zephyr
#

Does any one know what?

earnest phoenix
#

Im using commando

#

And d.js

fleet epoch
#

right

#

why is it // out then

#

//const commando = require('discord.js-commando');

earnest phoenix
#

Because its how you highlight syntaxs

#

@fleet epoch

fleet epoch
#

its how you block stuff out

earnest phoenix
#

Oh

fleet epoch
#

xD

earnest phoenix
#

Its not like that in the code lmao

fleet epoch
#

ahh k

earnest phoenix
#

Its just for the syntax highlighting in discord

fleet epoch
#

ahh

#

@shrewd field

#
client.on(`message`, message => {
    if (message.content === "/announce") {
  let modRole = message.guild.roles.find("name", "Moderators");
  if(message.member.roles.has(modRole.id)) {
  let announcement = args.join(" ");
  const embed = new Discord.RichEmbed()
  .setColor(0x00AE86)
  .setTimestamp()
  .addField(`New Announcement by ${message.author.username}`, `${announcement}`)
  client.channels.find("name", "bot_testing_room_2").sendEmbed(embed);
  message.channel.sendMessage(`:ok_hand: Annoucement sent to #bot_testing_room_2`)
} else {
  message.channel.sendMessage("**Error:** \n You dont have permission 'Moderators' to announce")
}
)};```
#

this is made to be edited the way you like it

topaz fjord
#

commando is confusing

#

-bots

gilded plankBOT
#
TurtleGamingFTW#4822
Bots

@grave sonnet

fleet epoch
#

lol thats why i dont use it

#

-bots

gilded plankBOT
#

This user has no bots

topaz fjord
#

d.js

fleet epoch
#

lol

topaz fjord
#

is easier

fleet epoch
#

i use discord.js

#

lol

#

also i hate my bot being here

#

it kept spamming my console

#

all though it might be fixed since ive done major updates to it

#

i might add it back later

fringe flame
#

-bots

gilded plankBOT
#
BannerGames#1300
Bots

@stuck fjord

fleet epoch
#

lol

fringe flame
#

I think i will wait more time

#

to the bot be verificed

fleet epoch
#

yea it still has to be verified

#

ok im heading out cya

fringe flame
#

She have 2 days of life here

#

xD

fleet epoch
#

lol

shrewd field
#

doesnt work @fleet epoch

#

the code u gave

fleet epoch
#

What comes back, like what error

ebon helm
tawny lava
ebon helm
#

so it is or not

prime cliff
#

🀦

#

If only people knew how to use google thonkku

ebon helm
#

i dont

topaz fjord
#
bot.user.setPresence({ game: { name: prefix + "help" + " | " + bot.guilds.size + " Guilds", type: 1}});
#

where do i put the streaming link

inner jewel
#

url maybe

topaz fjord
#

where do i put it tho

abstract mango
#

@topaz fjord commando is d.js, just a extension

lethal grove
#

Hey i started the bot (nodejs main.js) and it says that is online
and now what?

carmine berry
#

what are you needing

median lintel
#

^

lethal grove
#

how i invite the bot to my server?

#

how do i

carmine berry
trim steppe
#

πŸ‘€

lethal grove
#

oh, thanks. ^^

#

okaay. I already invited the bot. But it seems unresponsive, when i type !help nothing happes in the chat nor the console

#

nvm. i already figured out. sorry for the disruption 7w7

prime cliff
#

Have you given it perms you should be able to mention the bot with @ @lethal grove

lethal grove
#

the prefix was - not ! πŸ˜›

prime cliff
#

πŸ‘ :/

earnest phoenix
#

best verificashun lvl

ebon helm
#

hi

prime cliff
ebon helm
#

wrong channel

fickle solstice
#

when i type -servers can i make so i can see all guilds name? discord.js

scenic crest
#

yes and no

#

in theory this is possible

#

the problem is, that discord has a char limit

#

so you will not be able to display all if you have a lot of them

fickle solstice
#

I have 4 now

scenic crest
#

no

#

guilds is a collection

#

you'll have to make a list of names

#

loop through all guilds, and have a string called names

#

then in every iteration concatenate the guild name to names

#

not the most efficient approach but the easiest

earnest phoenix
#

-bots

gilded plankBOT
#
unknownuser#2312
Bots

@fervent gazelle

inner jewel
#

bot.guilds.map(guild=>guild.name).join(" ") or smth

scenic crest
inner jewel
#

idk js

#

@fickle solstice

noble hazel
#

made a Pomf.se image uploader in python

#

yes, theres an async one as well

inner jewel
#

lul

noble hazel
#

so now you can upload your files to whatever pomf you want

ebon helm
#

need help with new command discord.js

chilly hedge
#

What kind of new cmd?

ebon helm
#

like

#

;server and it shows a server link

#

not a random one

#

a specific one

scenic crest
#

it's literally like a pingpong command but the name is diff and the output is diff

ebon helm
#

what

#

show me script

scenic crest
#

Google is your best friend

ebon helm
#

he isnt

#

npm init

patent reef
#
client.on('message', msg => {
  if (msg.content === 'ping') {
    msg.reply('Pong!');
  }
});```
#

@ebon helm i dont code javascript and i found it

ebon helm
#

kool

ebon helm
median lintel
#

what

#

no

earnest phoenix
#

Do you know node.js? @ebon helm

inner jewel
#

notice me @visual ginkgo

#

yes, i know it's a bot

earnest phoenix
#

i have ffmpeg installed on my server and everything i tested my pla command running on cmd on my desktop it worked but when i do it on my server it does not even join all other commands work tho????

#

@earnest phoenix

#

Well its maybe because of wi-fi cause i have the same problem and if you run it off a app its differant then when you do it directly

#

i run it off digatal ocean

#

Im not sure then cause i host my bot on my laptop

#

@earnest phoenix you host your bot on your laptop lmao

#

There nothing wrong with it lmao

weak parrot
#

Yeah whatever works

#

Lol

#

You really don't need much to run bots

earnest phoenix
#

Anyone know how to fix my bot code? It only replies with the file name and not the actual photo...

//------------------------------------------------------------------------------
//MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME MEME
var fs = require('fs');
var files = fs.readdirSync('/Users/User/Desktop/Memes/faces');
var randimage = files[Math.floor(Math.random() * files.length)];
if(message.content.startsWith(prefix + "meme")) {
  return message.channel.send(randimage);
}
//---------------------------------------------------------
median lintel
#

use links to the images insted of raw images

#

Β―_(ツ)_/Β―

earnest phoenix
#

they are images from my files tho, how? Theres atleast 1000ish pics in the folder

median lintel
#

wot

earnest phoenix
#

anyone? 😦

median lintel
#

idk sry

deft garnet
#

boom

#

beaaaatch

topaz fjord
#

can anyone help me with d.js

earnest phoenix
#

please anyone?

sinful meadow
#

Hello anyone here?

hallow goblet
#

Does anyone know how to integrate the DBL API with their bot? Running discord.js

trim steppe
#

integrate?

hallow goblet
#

well update the server count on startup

trim steppe
#

Check there

cinder oriole
#

anyone know a javasctip way to control or send commands to a bot through a website.

delicate zephyr
#

Webhooks @cinder oriole

weary shoal
#

@cinder oriole All I can think of is to add an express-style site to your bots code because if not you're gonna probably be leaking a token

scenic crest
#

when someone sends me a REST request, and their request json is invalid, and I return a 400, is there any way I can supply like "ur json sucks kiddo" alongside the 400? If so, where do I put it?

bitter sundial
#

in the response?

scenic crest
#

yeah

#

do I put it in the header somewhere

bitter sundial
#

no

scenic crest
#

hm

bitter sundial
#

just in the response

#

body

scenic crest
#

ahh so I just do

#

"reason":"ur shit"

bitter sundial
#

ye

scenic crest
#

danke

earnest phoenix
#

-go5w

#

-bots

gilded plankBOT
#
unknownuser#2312
Bots

@fervent gazelle

fickle solstice
#

can i make a -bug command and it send to my server? its that possible?

inner jewel
#

yes

fickle solstice
#

how?

inner jewel
#

get channel by id -> send message

faint jetty
#

what is a channe

earnest phoenix
#

dafuq

earnest phoenix
#

Hey

#

I have a question

shrewd field
#

How do i make a restart command

#

Guys

median lintel
#

restart what

#

the bot?

tawny lava
#

No restart his toaster

median lintel
#

toaster.restart()

#

duh

tawny lava
#

O yis

#

@shrewd field use pm2 / forever and run process.exit()

median lintel
#

nah pm2

shrewd field
#

Huh

#

I want to restart my bot

#

What is pm2

#

??

tawny lava
shrewd field
#

How can i make the command

tawny lava
#

I just told you

#

Use pm2, then run process.exit() in your code

shrewd field
#

Is this pm2

#

Huh

umbral pelican
#

no, it's a banana

earnest phoenix
#

^

tawny lava
#

Can confirm

shrewd field
#

What do u mean

weak parrot
#

Lmao

shrewd field
#

What is pm2

#

I dont get it

#

I read

#

On google

earnest phoenix
#

Pm2 is annode process manager for node JS apps

old breach
#

hi hi hih iih ih

earnest phoenix
#

read teh docs

old breach
#

y

earnest phoenix
#

because

abstract mango
#

docs are useful

old breach
#

i did

earnest phoenix
#

they're ur friend

old breach
#

it didnt helped

abstract mango
#

hm

old breach
#

can i send you the code and you can see whats wrong?

earnest phoenix
#

if ur using bot

#

then

#

well

old breach
#

self bot *

earnest phoenix
#

hm

#

same thing

#

CHECK THE DOCS YOU MORON

old breach
#

it wont help

earnest phoenix
#

it will.

#

:/

#

tell me how it doesn't help

#

can you read

old breach
#

i dont understand it

#

how to use it

#

can i just send you the code

#

and u can see whats wrong

abstract mango
#

@old breach ```py
meme = await bot.say('meme')
await meme.delete()

#

there you go

earnest phoenix
#

^

old breach
#

o

#

hold on then

earnest phoenix
#

waitwot

#

that's rewrite

#

dolt

abstract mango
#

no

#

bot.say is async

earnest phoenix
#

thonky

#

o ye

abstract mango
#

ctx.send is rewrite

earnest phoenix
#

thet's ext

old breach
#

which is what im using ?

#

im using a async

earnest phoenix
#

maybe he's using client

old breach
#

yes

earnest phoenix
#

Β―_(ツ)_/Β―

abstract mango
#

are you using commands.Bot

old breach
#

but i replace client with bot

earnest phoenix
#

uh

old breach
#

look ill just

#

send the code

#

ok?

earnest phoenix
#

probably works

abstract mango
#

oh, discord.Client

earnest phoenix
#

ok

abstract mango
#

well, ok

earnest phoenix
#

```py
code
...

old breach
#

o shoot

earnest phoenix
#

wew

#

kek

old breach
#

sorry

earnest phoenix
#

hastebin

old breach
#

i sent it wrong

earnest phoenix
abstract mango
earnest phoenix
#

neh

old breach
earnest phoenix
#

hastebin better

old breach
#

true

earnest phoenix
#

delete_message needs params

abstract mango
old breach
#

i know

#

;-;

#

idk what to do with that

#

i just want it to delete

earnest phoenix
#
@bot.event
async def on_message(message):
    if message.author.id != bot.user.id:
        return
    if message.content.lower().startswith("_kek"):
        msg = await bot.edit_message(message, new_content=("THIS THINGk3kTICK TICK TICK"))
        await bot.delete_message(msg)
abstract mango
#

await bot.delete_message(message)?

old breach
#

let me try

#

o

#

thanks

#

but

abstract mango
#

np

old breach
#

theres 1 last thing

abstract mango
#

o

old breach
#

how do i make a wait function

#

example

#

blabla
wait
blabla

abstract mango
#

as in you want it to wait

earnest phoenix
#

import asyncio
asyncio.sleep(seconds)

abstract mango
#

you can use time.sleep or asyncio.sleep

earnest phoenix
#

time.sleep is blocke

abstract mango
#

preferably asyncio sleep

earnest phoenix
#

^

old breach
#

so example

abstract mango
#

since yeah, time is blocking

old breach
#

blablabla
asyncio.sleep(seconds)
blablabl

earnest phoenix
#

yes

#

seconds would be an int

abstract mango
#
import asyncio
asyncio.sleep(1)
earnest phoenix
#

sleep 1 second

abstract mango
#

yes

earnest phoenix
#

also put that import at the top of the file

abstract mango
#

yes x2

earnest phoenix
#
import asyncio
...
asyncio.sleep(1)
# Do stuff```
#

x2?

old breach
#

asyncio is already imported

earnest phoenix
#

thonkeryang

#

k

abstract mango
#

then just do asyncio.sleep(1)

#

and it'll work

earnest phoenix
#

aaa netlify team is slow

#

yeah

old breach
#

is the asyncio milliseconds ?

abstract mango
#

no

#

seconds

old breach
#

well it didnt worked then

#

look

abstract mango
#

if you need milliseconds you can use floats

old breach
#

it deleted it fast

abstract mango
#

actually

old breach
#

i did sleep(5)

#

so

#

5 seconds

abstract mango
#

await asyncio.sleep(5)

#

if you didn't add await already

old breach
#

i didnt

#

xd

#

xD

#

YAYYYY

#

IT WORKED

#

WOO

abstract mango
#

np ;)

old breach
#

tha n ks

#

if you let me the time

#

xd

abstract mango
#

hmm

old breach
#

its time to have fff-ff-f-f-ffun

abstract mango
#

I should start working on mine again

#

;)

old breach
#

selfbots are amazing

abstract mango
#

ikr

old breach
#

its like better discord

abstract mango
#

although against tos

old breach
#

but for yourself

#

nah

#

only if u abuse

#

the api

#

other than that

#

its k

abstract mango
#

lol betterdiscord sux :^)

old breach
#

ikr

#

but its against tos to use selfbot only if you abuse the API

abstract mango
#

although I use a similar thing

#

discordinjections lul

#

tru

old breach
#

can i do asyncio.sleep(0.5) ?

#

@abstract mango

abstract mango
#

yes

#

iirc asyncio.sleep accepts floats (0.5 as a example) too

#

since it's a int

old breach
#

guess who forgot how to use the sendmessage

#

@abstract mango is this how you send messages "await bot.send_message("Thanks")" i forgot

abstract mango
#

yeah

#

although

#

consider using commands.Bot

#

and rewrite

old breach
#

time to test my thing

abstract mango
#
  1. commands.Bot makes it way simpler
  2. rewrite has way better docs, etc
old breach
#

well it didnt worked

#

but ok

abstract mango
#

rip

old breach
#

dude

#

watch this

#

XDDD

earnest phoenix
#

-bots

gilded plankBOT
#
unknownuser#2312
Bots

@fervent gazelle

earnest phoenix
#

is my bot technically here

#

xD

#

if i do a command which can force leave it

#

will it disappear

#

xD

bitter sundial
#

your bot is not here

#

it's awaiting approval

earnest phoenix
#

k

#

/leave

#

-bots

gilded plankBOT
#
unknownuser#2312
Bots

@fervent gazelle

earnest phoenix
#

hm

#

nice

#

BRO! Why won't the

client.user.setGame("-help")

Work for my bot?!?!

#

@earnest phoenix

#

hm it should

#

it doesnt

#
client.on('ready', () => {
  client.user.setGame("-help");
  console.log(`Ready to serve on ${client.guilds.size} servers, for ${client.users.size} users.`);
  client.channels.get("361108864973930506").send({embed: {
  color: 3447003,
  author: {
    name: client.user.username,
    icon_url: client.user.avatarURL
  },
  title: "GameBot Online!",
  description: `\n\n**GameBot is now Online!**\n**Server Count:** ${client.guilds.size} Servers.\n**User count:** ${client.users.size} users.`,
  timestamp: new Date(),
  footer: {
    icon_url: client.user.avatarURL,
    text: "Β© GameBot"
  }
}
});

#

@earnest phoenix ☝

#

i use handlers

#

so

#

xD

#

ill try to

#

see

earnest phoenix
#

@earnest phoenix I have an error on the code you gavr mr

#

gave me*

#
    message.guild.member.setNickname(user);
#
    message.guild.member.setNickname(user);
#

tf

inner jewel
#

it's me

#

not member

earnest phoenix
#

i want the bot to change its nickname... Not me

inner jewel
#

🀦

earnest phoenix
#

bot want to change its own nickname

inner jewel
#

message.guild.member

#

doesn't

#

exist

#

is the bot

earnest phoenix
#

kk ty lol

earnest phoenix
#

Bro wtf!!! @inner jewel Do you see an unexpected string anywhere?

var yomommajokelist=["Yo Momma is so fat, she fills the bathtub before she even turns on the water", "Yo Momma is so fat, when she jumps off the high dive, she shows up on radar", "Yo Momma is so fat, she doesnt need the Internet -- shes already worldwide", "Yo Momma is so fat, the last time she saw 90210 was on the bathroom scale", "Yo Momma so fat, that Yo Daddy is still climbing back off", "Yo mama so fat she left the house in high heels and when she came back she had on flip flops." "Yo mama so fat she sat on an iPhone and turned it into an iPad",  "Yo mama so fat she went to KFC to get a bucket of chicken they asked her what size and she said the one on the roof", "Yo momma so fat she sued xbox 360 for guessing her weight", "Yo mama so fat that I ran out of gas trying to drive around her", "yo mama so fat that she gave draclua diabetes"]
#

nvm

#

found it

inner jewel
earnest phoenix
#

ye ik lol found it

median lintel
#

use an api

#

insted of random array

earnest phoenix
#

Seems harder to use, i only have one api... im dumb

#

@median lintel

median lintel
#

?

earnest phoenix
#

Idk how to use API's properly

#

I only have one which one guy gimme code to

var request = require ("request");
var cat = "http://random.cat/meow.php"

if(message.content.startsWith(prefix + "cat")) {
  var args = message.content.substring(prefix.length).split(" ");

switch (args[0].toLowerCase()) {
    case "cat":
        request({
            url: cat,
            json: true
        }, function (error, response, body) {
            message.channel.send(body);
        })
        break;
    }
}
#

Could you help me with API's please?

old breach
#

@abstract mango can u help

cinder oriole
#

!stats silentsushix3 duo

jolly zodiac
#

@earnest phoenix You should really consider setting up your own testing server.

earnest phoenix
#

I have my support server. Im sorry about the spam. Im making a spam filter

#

@jolly zodiac

old breach
#

martw

#

i need ur help with 1 small problem

jolly zodiac
#

But why not use a separate server and bot account for that? Actively changing a running public bot is a bad idea.

#

Sorry, Ouindoze, I’m going to bed now.

old breach
#

aw ;-;

#

it was just 1 tiny thing

jolly zodiac
#

…

#

What?

old breach
#

why does it do that it wasnt doing that earlier

#

it says client object has no attribute

#

theres no client object

jolly zodiac
#

You probably forgot the parentheses when calling edit_message() somewhere.

#

πŸ‘‹

#

Or no

#

wait

#

I have no idea

#

I would need to see your code.

#

But I won’t check that tonight anymore

#

Learn to find bugs.

#

It’s a valuable skill to have as a developer.

old breach
#

aight so

#

i got this problem

#

idk why

#

it didnt do that before

strange lintel
#

hmmm

old breach
#

need the code?

#

or no

strange lintel
#

sure

old breach
#

@strange lintel

strange lintel
#

yeh ik

#

hmmm

old breach
#

hmmmmmmm

strange lintel
#

your bot.run(token, bot=False) might have something to do with it

#

try rmoving the bot=False

old breach
#

hold on

#

bop

#

nope

#

it makes even more error

#

kek

strange lintel
#

alright put it back xD

old breach
#

it back

strange lintel
#

add from discord.ext import commands

#

change bot=discord.Client() to bot=commands.Bot()

#

are you using the rewrite?

old breach
#

i d k

#

im new to python

strange lintel
#

try that

old breach
#

(yes i know my name is garlic bread)

strange lintel
#

bot = commands.Bot(command_prefix='!')

#

try that

old breach
#

i changed ! to _ but ok

strange lintel
#

use whatever your prefix is

old breach
strange lintel
#

foooo

#

lol that should work

old breach
#

well its not

#

k3k

strange lintel
#

i dont think i cant help you here. ask someone more experienced with discord.py like crystal

old breach
#

grrr

strange lintel
#

Im sorry i cant help you here

old breach
#

what does that mean

strange lintel
#

that means theres no function in the bot object called send message

old breach
#

but

#

isnt that like

#

impossible

#

because im using import discord and stuff

strange lintel
#

@old breach i think you might have the rewrite

old breach
#

i dont even know whats that

strange lintel
#

try changing it back to bot = discord.Client()

old breach
#

_test

strange lintel
#

and now

#

change await bot.edit_message(tmp, 'You have {} messages.'.format(counter)) to await bot.edit(tmp, 'You have {} messages.'.format(counter))

old breach
#

"elif" is an invalid syntax now

strange lintel
#

youre probably missing a paranthases

old breach
#

WHERE

#

i dont understand

strange lintel
#

at the end of await bot.edit_message(tmp, 'You have {} messages.'.format(counter))

old breach
strange lintel
#

show the code -.-

old breach
strange lintel
#

you indented elif too much

old breach
#

which means

strange lintel
#

change it to like that

old breach
#

_test

#

what the fuckkkk

strange lintel
old breach
#

_test

#

same fucking thing

strange lintel
#

show it

old breach
strange lintel
old breach
#

_test

#

Calculating messages...

strange lintel
#

now were getting somewhere

old breach
#

for fuck sake

#

yeah at least

strange lintel
old breach
#

u had added one dot too much but ok

#

aight starting

#

_test

#

Calculating messages...

#

gRRRRR

strange lintel
#

whats the error

old breach
#

thanks for taking time to help me at least

strange lintel
#

justa sec

#

this better work lol

old breach
#

aight

#

_test

#

Calculating messages...

strange lintel
#

=.=

old breach
strange lintel
#

i have to go im really sorry

old breach
#

b-but daaad

#

;-;

strange lintel
#

you might want to learn some simple programming before trying to make a bot

#

bots are pretty complex

old breach
#

will u help me when u come back

strange lintel
#

depends

#

if i have time

old breach
#

b-but daaad

#

ok

strange lintel
#

bye

old breach
#

seeya then

prisma quarry
#

So you can't just randomly create a bot, right? You have to program it and all that stuff, right? Sorry, I'm new to this bot stuff.

trim steppe
#

If only making bots was that easy

old breach
#

^

prime cliff
#

Yes you have to learn a programming language

abstract mango
#

discordblocks

trim steppe
#

for android

umbral pelican
#

lmfao bloblul

pale light
earnest phoenix
#

i need help

#

xD

#
exports.run = (client, message, args) => {
    let guild = message.guild
    var content = message.content.split(' ').slice(1).join(' ')
    var content2 = message.content.split(' ').slice(2).join(' ')
    guild.createRole({
        name: `${content}`,
        color: `${content2}`
    })
    .then(role => message.channel.send(`Created role ${role}`))
    .catch(console.error);
}

exports.conf = {
    aliases: ['creater']
}

exports.help = {
    name: "createrole",
    description: "creates a role with no date",
    usage: "createrole <name>"
}
#

it works decently

#

but the thing is

#

the content2 gets mixed with the content

#

and it ends up saying

#

/createrole testing BLUE

#

Created role testing BLUE

#

even though the color is blue

#

i dont want that blue added

#

xD

cerulean zinc
#

Anyone got any bot ideas?

sinful meadow
#

Sup @cerulean zinc

#

I have a idea

#

Something like a color wheel

#

/color blue

earnest phoenix
#
Discord Bot List

This command randomly generates a hex-color code number!

Random Hex Color:

#ee29ad

cerulean zinc
#

Hmm. Not a bad idea

sinful meadow
#

oh shit

#

Yea something like that

#

That supports all colors

cerulean zinc
#

Wait. Did you trigger a user bot??

sinful meadow
#

Omg

#

i did πŸ˜„

#

@weary shoal

#

Babe we need you

cerulean zinc
#

Wait

#

Let’s have fun first

#

/ping

earnest phoenix
#

:ping_pong: Response Time: (184ms). API Latency: (69ms)

sinful meadow
#

xDD

cerulean zinc
#

XD

sinful meadow
#

HAHAHA

cerulean zinc
#

/help

earnest phoenix
#
= Command List =

[Use /help <commandname> for details]

/8ball          :::
/addcontrib     :::
/addrole        :::
/avatar         :::
/ban            :::
/blacklist      :::
/blusers        :::
/cat            :::
/channelinfo    :::
/clearbl        :::
/coinflip       :::
/createinvite   :::
/createrole     :::
/credits        :::
/delchannel     :::
/delrole        :::
/devinfo        :::
/diceroll       :::
/discord        :::
/eval           :::
/help           :::
/info           :::
/insult         :::
/kick           :::
/leave          :::
/lockdown       :::
/ping           :::
/purge          :::
/randomhex      :::
/reload         :::
/rename         :::
/roleinfo       :::
/roles          :::
/rules          :::
/say            :::
/serverinfo     :::
/setchannelname :::
/setchanneltopic:::
/setgame        :::
/setnick        :::
/setprefix      :::
/setrolename    :::
/setroleposition:::
/setstatus      :::
/setstream      :::
/softban        :::
/starttyping    :::
/stoptyping     :::
/suggest        :::
/takerole       :::
/unban          :::
/uptime         :::
/userinfo       :::
/warn           :::
/watch          :::
cerulean zinc
#

Oh shit

sinful meadow
#

LMAFO

earnest phoenix
#

I’m
retarded
because
I
have
an
open
selfboat

sinful meadow
#

xDDD

#

Wait a second

earnest phoenix
#

@earnest phoenix
SUCK
MY
DICK

sinful meadow
#

xDDD

#

AHAHAHA

cerulean zinc
#

We can kick the user using the user

worldly steeple
#

/eval 2+2