#development

1 messages · Page 1332 of 1

agile lance
#
if (args[0] == "catch" && args[1] == `${pkmn}`) {
        try {
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        }
        .catch (err) {

  console.log(err)

}
      }
#

Try that

#

@agile lance yes
@viral veldt Thank you

viral veldt
#

@viral veldt Thank you
@agile lance try to use, <client>.guilds.channels.cache.get("ID")

agile lance
#
if (args[0] == "catch" && args[1] == `${pkmn}`) {
        try {
       message.channel.send("You have caught a "+pkmn)
       console.log(counter+" yeet")
       counter = 0;
        }
        catch (err) {

  console.log("error")

}
      }

@vale garden Counter was defined AFTER the logging thats why.

#

@agile lance try to use, <client>.guilds.channels.cache.get("ID")
@viral veldt Alright, <client> is replaced with how I use my client class right?

viral veldt
#

yes

vale garden
#

yea but it has a value before anyways

#

and defining it before didnt make any difference

agile lance
#

yea but it has a value before anyways
@vale garden Try what I put

vale garden
#

kk

agile lance
#
if (args[0] == "catch" && args[1] == `${pkmn}`) {
        try {
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        }
        .catch (err) {

  console.log(err)

}
      }
#

Oh I see an issue

#
if (args[0] == "catch" && args[1] == `${pkmn}`) {
        try {
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        }
        .catch(err=> {

  console.log(err)

})
      }
vale garden
#

what

agile lance
#

You just did catch (err) =>

viral veldt
#

ahh yes

agile lance
#

Typically that doesn’t work for me, I do .catch(err => { code here

vale garden
#

wdym

viral veldt
#

.catch(err => console.log(err))

vale garden
#

kk

agile lance
#

.catch(err => console.log(err))
@viral veldt Thats about the only d.js thing i was taught at first

vale garden
#
if (args[0] == "catch" && args[1] == `${pkmn}`) {
        
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        .catch(err => console.log(err))
      }
#

even after this

#

nothing

viral veldt
#

wait that's try catch statements

#
try {
  //code
} catch (e) {
  console.error(e)
}```
vale garden
#

wat

#

so youre telling me to do this

#

ok

viral veldt
#

yea catch the error first

vale garden
#

bruh

#

still nothing

#

aaaa

viral veldt
#

hmm

agile lance
#
if (args[0] == "catch" && args[1] == `${pkmn}`) {
        
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        .catch(err => console.log(err))
      }

Do you have args defined?

viral veldt
#

if (message.content.includes("!")) {
!catch ?

agile lance
#
if(message.content.startsWith(“!catch) {
if(!args[0]) return message.reply(“Provide the pokemon!”)
if (args[0] == `${pkmn}`) {
        
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        .catch(err => console.log(err))
   }
      }
#

That could work

#

Try that @vale garden

viral veldt
#

if (message.content.includes("!")) {
!catch ?
@viral veldt the error maybe from this

vale garden
#

still

#

nothing

#

@viral veldt the error maybe from this
@viral veldt wdym

agile lance
#
if(message.content.startsWith(“!catch) {
if(!args[0]) return message.reply(“Provide the pokemon!”)
if(!args[0] == pkmn) return message.reply(“This is incorrect!”)
if (args[0] == `${pkmn}`) {
        
       message.channel.send("You have caught a "+pkmn)
       counter=0;
       console.log(counter+" yeet")
      
        .catch(err => console.log(err))
   }
      }
#

Try that

#

It checks if the message starts with !catch

#

Then proceeds to checks for the argument

#

If it fails to find it returns a error message saying it can’t find it

vale garden
#

kk

agile lance
#

If it finds it but it’s the wrong pokemon, It says its the wrong pokemon

#

If it finds it and its the right pokemon, It sends the message displaying it was the correct pokemon

vale garden
#

it stilll doesnt work

#

i dont even understand what the problem is

agile lance
#

How is the pkmn defined?

vale garden
#
let pkmnsList = [["Weedle", "https://bit.ly/3nX5gVk"], ["Kakuna", "https://bit.ly/2T0vzf9"], ["Beedrill", "https://bit.ly/3dAhUoi"], ["Pidgey", "https://bit.ly/3lXgbN2"], ["Pidegotto", "https://bit.ly/2H7689i"], ["Pidgeot", "https://bit.ly/2HbfgK7"], ["Scyther", "https://bit.ly/3k6lxFe"], ["Rhyhorn", "https://bit.ly/31xNG0L"], ["Rhydon", "https://bit.ly/3o3hvQ7"], ["Rhyperior", "https://bit.ly/3nZISum"],  ["Horsea", "https://bit.ly/3nZITyq"], ["Seadra", "https://bit.ly/346t3dy"], ["Kingdra", "https://bit.ly/2HhEAxS"]]

      let no = Math.floor(Math.random() * pkmnsList.length)

      let pkmnsImg = pkmnsList.map(item => item[1])
      let pkmns = pkmnsList.map(item => item[0])

      let pkmn = pkmns[no]
    let pkmnImg = pkmnsImg[no]  

#

heres everything

agile lance
#

Maybe pkmn isn’t spawned?

vale garden
#

no it does spawn

#

and also when i typed the wrong args[1] it logged the pkmn

viral veldt
#
try {
  if (args[0] == "!catch") {
    if (!args[1]) return
    if (args[1] == `${pkmn}`) {
    message.channel.send("You have caught a "+pkmn)
    counter=0;
    console.log(counter+" yeet")
    } else {
    if (args[1] != `${pkmn}`) {
    message.channel.send("Wrong pokemon")
    }
  } 
} catch (e) {
console.error(e)
}```
#

@vale garden try this

vale garden
#

kk

pale vessel
#

mmm 🥄

vale garden
#

ok so now

#

when i do that

#

it just spawns in a new pokemon

#

after me doing the command

agile lance
#

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

client.on('message', message =>{
 const guild = message.guild;
const joinChannel = guild.channels.get("767258761038790656")
})
client.on("guildMemberAdd", async member => {
await joinChannel.send("welcome to the server, " + member + "!")
return;
})
const filePath = require(“./token.txt”)
client.login(filePath.token)

It says “guild.channels.get is not a function”, Help please

vale garden
#

and if the args are wrong, it gives the wrong pokemon message and then spawns in a new poke

trim saddle
#

@agile lance read the docs

restive furnace
#

@agile lance use fetch and get is inside cache prop

agile lance
#

@agile lance use fetch and get is inside cache prop
@restive furnace so instead of “get” use “fetch” and add .cache before .channels?

strong night
#

Test

restive furnace
#

if you use fetch don't add .cache after .channels

#

but if you use get, add .cache after .channels

agile lance
#

Ohh okay, Thanks

restive furnace
#

np

agile lance
#

it says joinChannel isn’t defined?

#

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

client.on('message', message =>{
 const guild = message.guild;
const joinChannel = guild.channels.get("767258761038790656")
})
client.on("guildMemberAdd", async member => {
await joinChannel.send("welcome to the server, " + member + "!")
return;
})
const filePath = require(“./token.txt”)
client.login(filePath.token)

I defined it here

trim saddle
#

dude

#

read the docs

agile lance
#

Could I call it from a global.joinChannel?

#

read the docs
@trim saddle I have, Nothing worked

trim saddle
#

defining code in one event call back doesn't apply it globally

agile lance
#

So should I use a global.joinchannel then?

drifting wedge
#

Hey, just a question on stats, how many servers on average do I need to like start getting premium subscriptions?

trim saddle
#

no, using let outside of any functions works

agile lance
#

Okay

trim saddle
#

@drifting wedge uh that's up to you

agile lance
#

Hey, just a question on stats, how many servers on average do I need to like start getting premium subscriptions?
@drifting wedge Idk. I only have 1 premium user for mine and mine has 12k users and 59 servers

trim saddle
#

when you feel you've built a sufficient userbase and feel a need to expand then you start premium features

drifting wedge
#

No not that

restive furnace
#

@agile lance learn scopes

drifting wedge
#

Like how big, until ppl start paying?

#

@agile lance how much does the one person pay?

restive furnace
#

1 million ¯\_(ツ)_/¯

agile lance
#

@agile lance how much does the one person pay?
@drifting wedge $3 monthly

#

said*

drifting wedge
#

@agile lance can u share deets on ur bot? Dm maybe?

agile lance
#

@agile lance can u share deets on ur bot? Dm maybe?
@drifting wedge deets?

drifting wedge
#

Like what is it?

#

What does it do?

agile lance
#

Economy

ivory seal
#
        const oauth = new DiscordOauth2();
        const accesstoken=accessCode;
        
        oauth.getUser(accesstoken).then(console.log);```
when i put the variable (and yes its defined before) it doesn't work but if I manually put a code  in " " it works.
agile lance
#

It’s all economy, Soon to be global

drifting wedge
#

And what does premium do?

restive furnace
ivory seal
#

Its guilds

restive furnace
#

what?

#

did i say that errors

#

no?

#

i showed kt works

agile lance
#

Going to that hastebin

#

it said

#

TypeError: message.guild.channels.fetch is not a function
at eval (eval at evulate (/home/freestyle/bot/dist/commands/developer/EvalCommand.js:22:30), <anonymous>:1:24)
at EvalCommand.evulate (/home/freestyle/bot/dist/commands/developer/EvalCommand.js:22:30)
at EvalCommand.execute (/home/freestyle/bot/dist/commands/developer/EvalCommand.js:50:31)
at Client.eval (eval at evulate (/home/freestyle/bot/dist/commands/developer/EvalCommand.js:22:30), <anonymous>:6:33)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (/home/freestyle/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:3114)
at Object.module.exports [as MESSAGE_CREATE] (/home/freestyle/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/freestyle/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/freestyle/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/freestyle/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)

restive furnace
#

hmm

#

ok

agile lance
#

Docs didnt help

#

I figured it out

#

The way I defined it didnt wokr

#

I switched it to a global.joinchannel instad

leaden rover
#

These commands:

    @commands.command(hidden=True)
    @commands.is_owner()
    async def load(self, ctx, module : str):
        """Loads a module."""
        try:
            self.bot.load_extension(module)
        except Exception as e:
            await ctx.send('\N{PISTOL}')
            await ctx.send('{}: {}'.format(type(e).__name__, e))
        else:
            await ctx.send('\N{OK HAND SIGN}')

    @commands.command(hidden=True)
    @commands.is_owner()
    async def unload(self, ctx, module : str):
        """Unloads a module."""
        try:
            self.bot.unload_extension(module)
        except Exception as e:
            await ctx.send('\N{PISTOL}')
            await ctx.send('{}: {}'.format(type(e).__name__, e))
        else:
            await ctx.send('\N{OK HAND SIGN}')

    @commands.command(name='reload', hidden=True)
    @commands.is_owner()
    async def _reload(self, ctx, module : str):
        """Reloads a module."""
        try:
            self.bot.unload_extension(module)
            self.bot.load_extension(module)
        except Exception as e:
            await ctx.send('\N{PISTOL}')
            await ctx.send('{}: {}'.format(type(e).__name__, e))
        else:
            await ctx.send('\N{OK HAND SIGN}')```
Don't work all of a sudden :/
pastel grail
#

I want to make my bot spawn credits (my bots currency) every x hours in a server for people to be able to pickup. How do I make a timer for it so that it spawns it automatically for every server? (discord.py)
Like the trick'ord treat bot

honest perch
#

@ivory seal use passpord instead

carmine summit
#

count howmany bots in a server?

gentle lynx
#

how is this wrong syntax

#

in prepared statements

pale vessel
#

because you're adding the id inside the string

gentle lynx
#

oh

pale vessel
#

wait

#

you didn't provide the value for those ?

gentle lynx
#

how?

pale vessel
#

wait you did

gentle lynx
pale vessel
#

ok that's better

gentle lynx
#

still doesnt work

pale vessel
#

bruh

silver lintel
#
Items.findOne({
      userID: message.author.id,
    }, (err, itemDB) => {
      if (err) console.log(err);
      if (!itemDB) {
        const newItems = new Items({
          userID: message.author.id,
          huntingrifle: 0,
          fishingrod: 0,
          pickaxe: 0,
        });
        
        newItems.save().catch(err => console.log(err));
      }
      
    });
    
    Items.findOne({
      userID: message.author.id,
    }, (err, itemDB) => {
      if (err) console.log(err);
      console.log(itemDB); //null
      itemDB[item] += amount;
      itemDB.save().catch(err => console.log(err));
    });

why does it say null when i delfined it right before

#

;-;

pastel grail
#

Is your id a string or a number?

#

because if it is a number then why are there '' marks surrounding it?

#

@gentle lynx

gentle lynx
#

string

pastel grail
#

oh ok

earnest phoenix
#

this*

silver lintel
#

write a description for your bot

earnest phoenix
#

Detailed description of your bot *

honest perch
#

Use a keyboard

#

And press each key for what you want to type

slender thistle
#

Use a keyboard, use your language knowledge, think how to write a good description

zinc stratus
#

I made a simple moderation bot. But im still working on it at the moment

ivory seal
#

@ivory seal use passpord instead
@honest perch do u mean passport?

gentle lynx
earnest phoenix
#

does someone knows mongoose db findoneupdate method? I am trying to make that work with a custom prefix, but so far it isnt working..

sudden geyser
#

@gentle lynx setTimeout(async () => {...}). You can just search Google and find a lot of answers: https://stackoverflow.com/a/42964310

tired panther
#

How do send messages in other guild in sharding? with brodcasteval?
@tired panther

#

any idea?

earnest phoenix
#

ask Tim our saviour

honest perch
ivory seal
#

ye but this is only for authentication right?

#

does it work for the guilds.join scope?

sudden geyser
#

@tired panther Try experimenting. Are you able to successfully broadcastEval a channel.send(...), or are you able to fetch the guild then send from there?

honest perch
#

does it work for the guilds.join scope?
@ivory seal see yourself

ivory seal
#

kk

honest perch
#

Yes it does

ivory seal
#

oh ok nice

#

thanks

tired panther
#

@tired panther Try experimenting. Are you able to successfully broadcastEval a channel.send(...), or are you able to fetch the guild then send from there?
@sudden geyser I think you do not have to fetch them since this operation will be proceeded in all shards.
another question?
which changes are there in sharding?

honest perch
sudden geyser
#

when I say fetch, I just mean look up, which would be by cache

ivory seal
#

ah ok thanks @honest perch

earnest phoenix
#

when I say fetch, I just mean look up, which would be by cache
@sudden geyser the word fetch is usually used for promises
iirc

sudden geyser
#

It can be used for a number of things, but I misused it a bit.

#

Not necessarily promises, but some form of look up in my eyes

#

for example, you may fetch some data from your local database

#

it may return a promise, a callback as its last argument, or just the value assigned to the variable

earnest phoenix
#

i use the word fetch for doggos catching bones thrown in the air

sudden geyser
#

if I had nitro I'd use an image of a dog with a waffle in its mouth

#

that's close enough

earnest phoenix
#

ok

sick fable
#

I have one small doubt. I coded another avatar command and I want to make it like there should be a masked link that should be like Click here to download this avatar

#

Can I get any tip by how can I do it

#

I am sending the code

earnest phoenix
#

just link it to the avatar

#

[Click to download avatar](link to avatar)

#

that's how you put links in markdown

sick fable
#

that's how you put links in markdown
@earnest phoenix k

earnest phoenix
#

put member.avatat_url inside {} and put that inside ()

#

so ({membet.avatar_url})

sick fable
#

Kk

#

I fixed it lol

#

Thanks :)

earnest phoenix
#

how to add multipule owners on User IDs, max. 3, You are already listed as an owner.

#

,space??

tame kestrel
#

how to add multipule owners on User IDs, max. 3, You are already listed as an owner.
@earnest phoenix if you have friends, you put their discord ids in separated by commas

707198291246579732, 503948134439976972, 141075183271280641

earnest phoenix
#

ok

pastel grail
#

I want to make my bot spawn credits (my bots currency) every x hours in a server for people to be able to pickup. How do I make a timer for it so that it spawns it automatically for every server? (discord.py)
Like the trick'ord treat bot

tight plinth
#

So i have this code on my bot, but it seems like the collect event never triggers, the normal message event is triggered first, anyone knows why?

         let c1 = msg.c.createMessageCollector((m) => { m.author.id === msg.author.id }, { time: 30000 })
        c1.on("collect", m => {
            msg.client.db.set(`${msg.g.id}.config.prefix`, m.content)
            msg.s(`My prefix has been succesfully set to\n> ${m.content}`)
        })
        c1.on("end", () => {
            msg.s("Woops, looks like nothing has been sent in 30 secs, cancelling...")
            return;
        })```
#

the end event triggers tho

sudden geyser
#

You forgot to return in the filter function.

tight plinth
#

it has to return?

#

if i lok at the example guide i dont see any return

#

lemme try with that

sudden geyser
#

If you don't return or don't use the short-hand version of an arrow function (=> expression rather than => { expression; }), it evaluates to undefined by default.

#

Which is a falsely value.

#

Which is why it never passes the filter.

tight plinth
#

oohk

#

thanks ^^

#

worked btw

#

k now the end event triggers even if the collect event triggered, do i need to put a return or smth in my collect event?

sudden geyser
#

It's supposed to emit when the event ends.

tight plinth
#

hm

#

ok

twilit rapids
#

Might wanna stop the collector to prevent it from firing multiple times within those 30 seconds

tight plinth
#

yeah thats what i was about to do

twilit rapids
#

👍

sudden geyser
#

^ you can pass to the options object (the third argument to .createMessageCollector) a key called max, which is the max number of items to collect.

If you don't want the end event to trigger, I recommend you look at the two parameters you're given: collected and reason. If collected is empty, nothing was collected. If the collector ended for some reason, such as expiration, it means the time ran out.

tight plinth
#

got it

#

thanks

earnest phoenix
#

When someone who doesn't have access to my (public) repl presses the run button, will repl.it allow the program to read data from the environment variables in .env? Because I'm testing smth using discord.js webhooks and would NOT want anyone else to run the same instance of the node.js app.

misty sigil
#

No

fading breach
#

ok so my bot goes online but its a command that wont work, it says this in the terminal ReferenceError: options is not defined its if you do ,image it sends a image from google

earnest phoenix
#

so the app will just crash when someone presses run cuz process.env.WEBHOOK_ID should be undefined and discord.js will go nuts?

misty sigil
#

@fading breach define options

earnest phoenix
#

ok so my bot goes online but its a command that wont work, it says this in the terminal ReferenceError: options is not defined its if you do ,image it sends a image from google
@fading breach options is supposed to be an object iirc

#

i think you forgot to replace the english word with an actual object

fading breach
#

yeah

#

🤦

earnest phoenix
#

send code

fading breach
#

how do i put the code in a little box

#

so its a little easier to read it

gaunt spear
earnest phoenix
#

how do i put the code in a little box
@fading breach put ``` then your code then end off with a ```

gaunt spear
#
('like this')
fading breach
#

    let args = message.content.substring(prefix.length).split(" ");

    switch (args[0]) {
        case 'image':
        image(message);

        break;

    }


    function image(message){

        var options = {
            url: "http://results.dogpile.com/serp?qc=images&q" + "example",
            method: "GET",
            headers: {
                "Accept": "text/html",
                "User-Agent": "Chrome"
            }
        };
        
    }```
earnest phoenix
#

how is options not defined here???

fading breach
#

i dont know

#

maybe thats not the right code though

earnest phoenix
#

jsut hastebin the whole file

fading breach
#

nope its right

earnest phoenix
#

testing smth

fading breach
#

ill hastebin it

earnest phoenix
#

the program should outright crash when you press run since it can't read environment variables

fading breach
#

its really crappy code

earnest phoenix
#

its really crappy code
@fading breach basically all of us have crappy code

#

no need to be ashamed

fading breach
earnest phoenix
#

i got it

#

options is defined inside a function which means outside stuff can't use it

fading breach
#

alright

earnest phoenix
#
function image(message){

        var options = {
            url: "http://results.dogpile.com/serp?qc=images&q" + "example",
            method: "GET",
            headers: {
                "Accept": "text/html",
                "User-Agent": "Chrome"
            }
        };
        
    }


    request(options,
#

put the request stuff inside the function

fading breach
#

yeah

#

where

earnest phoenix
#

the image function

fading breach
#

function image(message){ there or

#

haha

quartz kindle
#
function image(bla) {
  var options = "something"; // options is created here, it only exists inside here
  // options exists here
  request(options) // works
}

// options does NOT exist here
request(options) // error, options is not defined
earnest phoenix
#

What is the difference between putting script tags inside the <body> tag and <head> tag

#

How can i add a function / method to D.js files in node modules? without editing the actual files in node modules

open rune
#

head tag only for js, meta, title and css

#

body for it's elements

#

but, if you put script tag inside body

#

they will execute it later after they load the elements

earnest phoenix
open rune
#

but you can use defer <script src="#" defer >

earnest phoenix
#

so if i want stuff like d3.js to load before all other elements i put them in head?

open rune
#

probably, yes, because html loads from top to bottom, so the head loads first.

#

I'm not sure about where to put the javascript, but as far as I know, the HTML loads from top to bottom

earnest phoenix
#

ok

pure lion
quartz kindle
#

what app is that?

#

@earnest phoenix use djs's structure extensions

#

which class do you want to add a method to?

earnest phoenix
#

Several classes

quartz kindle
#

not all classes are extensible through this method, so it depends which ones, but here's an example: ```js
Discord.Structures.extend("Message", oldMessage => class myMessage extends oldMessage {
myMethod() {
console.log(this.content)
}
})

earnest phoenix
#

Hmm ill try

sick fable
#

I want to try out the command called Bans. I coded one command which shows the bans of a specific server but it's not showing the bans. Can anyone help?

earnest phoenix
#

Why don't the server images show up as GIFs in the command you see in the image? Coding is as follows;

embed.setAuthor(message.guild.name, message.guild.iconURL({}))

embed.setThumbnail(message.guild.iconURL({}))

pure lion
#

what app is that?
@quartz kindle duckduckgo

sick fable
pure lion
#

It has an inbuilt thing

#

@earnest phoenix you need to set the format as gif, in the {} put format: "gif"

misty sigil
#

@earnest phoenix try .iconURL({dynamic: true})

sick fable
#

Someone help me

earnest phoenix
#

@earnest phoenix try .iconURL({dynamic: true})
@misty sigil i trying

sick fable
#

I want to try out the command called Bans. I coded one command which shows the bans of a specific server but it's not showing the bans. Can anyone help

pure lion
#

Are there errors?

next flax
misty sigil
#

What’s the code

#

smh

sick fable
#

Me?

next flax
#
        if (!serverQueue) return msg.channel.send({embed: {color: "#2F3136", description: "**:x: | There is nothing playing that I could stop for you**"}});
        serverQueue.songs = [];
        serverQueue.connection.dispatcher.end("Stop the music");
        return msg.channel.send({embed: {color: "#2F3136", description: "⏹️  **| Stopped Music** "}});```
#

why

pure lion
#

@next flax who did you copy

next flax
#

i used a src

#

iCrawL

#

i m not making a public bot as its src

pure lion
#

Write your own fucking code

next flax
#

i m making for my own servers

pure lion
#

Then use someone else's bot

#

Or learn to code

next flax
pure lion
#

Because you learn nothing through ctrl c ctrl v

sick fable
#

Because you learn nothing through ctrl c ctrl v
@pure lion true. I code these things myself. If I have any problem. I go through the documentation and stack overflow for the explanation

#

Explanation = Learning some things which I don't fuckin know

fluid basin
#

then go ask on stackoverflow KEKW

pure lion
#

Stack overflow is last resort

sick fable
#

Ikr@pure lion

pure lion
#

Always refer to docs first

#

Then ask us

#

/s

#

That's a joke we're shit at code

earnest phoenix
#

@earnest phoenix try .iconURL({dynamic: true})
@misty sigil thx ❤️

quartz kindle
#

@pure lion so apparently they use https://tosdr.org/ to grade a website's privacy rating

pure lion
#

Okay epic

quartz kindle
#

so unless your website is listed there, your website will remain "unknown"

pure lion
#

Tos doctor

#

So I need to write my own tos

#

Epic

quartz kindle
#

idk if you can add websites to it

#

its mostly just popular services and big websites there atm

next flax
#

i dont use ctrl + v/c i use download this repo as zip GWcorbinHolyFuck

#

sometime

sick fable
#

Why didn't nobody help me

next flax
#

what is it

sick fable
#

😢 😦

#

Bye

quartz kindle
#

Lol

pure lion
#

@sick fable send your error for fucks sake

#

And code

next flax
#

show ur code

pure lion
#

We asked you

sick fable
#

L

pure lion
#

😫 😫 😫

sick fable
#

K

#

**

#
async def bans(ctx):
   await ctx.send(f"{ctx.guild.bans}")```
next flax
#

its py

#

k

sick fable
#

Ye

next flax
#

idk then

sick fable
#

I guess I am close to victory

#

Less goooo

quartz kindle
#

guild.bans is not a property

#

its a method

sick fable
#

Yeah

quartz kindle
#

you need to bans = await ctx.guild.bans()

sick fable
#

Oh

next flax
#

Tim are u py dev

sick fable
#

@quartz kindle Thanks ❤️

#

And I want to make a system type of thing like if I type ,warn . It should send Please mention a member and a reason with it

#

@quartz kindle

#

I tried many times

#

T didn't worked but

#

It*

earnest phoenix
#

read the docs on dpy commands

#

they explain everything you want to do

sick fable
#

K

quartz kindle
#

@next flax no

dapper ocean
#

Does somebody in here knows dblpy well?

quartz kindle
#

#dontask2ask

dapper ocean
#

That’s not related to dontasktoaks ;-;

earnest phoenix
#

it's an ask2ask just ask your question

quartz kindle
dapper ocean
#

I think it’s more related to: can I get help or smth

quartz kindle
dapper ocean
#

Well ok sorry

quartz kindle
dapper ocean
#

Hmmm

#

...

#

Sorry, I will repaste it

#

Here

#

on_dbl_py doesn’t work. When I vote for my bot I don’t get any output

#

I am not sure if the rest of the code is correct

#

But the bot itself just ignores this part

quartz kindle
#

async def on_dbl_vote(self, Bot, data):
should be
async def on_dbl_vote(self, data):

#

also, receiving vote events requires you to setup the webhook in your bot's edit page, in top.gg

#

did you do that?

dapper ocean
#

No :0

#

Btw I tried (self, data), it didn’t work at first

next flax
#

how can i make my bot that if it gets disconnected it will automatically delete the queue

dapper ocean
#

I think the problems is in webhook

next flax
#

i made this

pure lion
#

Any java experts around? My bot made in Rust is on the blink again uwucard

#

@next flax no don't do that

next flax
#

what

dapper ocean
#

But how do I set the webhook properly

pure lion
#

It automatically destroys the connection when it's disconnected

#

Assuming you're using ffmpeg

next flax
#

yep

pure lion
#

They ye

quartz kindle
#

@dapper ocean where is your bot hosted?

pure lion
#

Up my bum

dapper ocean
#

@quartz kindle heroku

pure lion
#

Why

#

WhYyYYyYY6

dapper ocean
#

I know Heroku is trash

pure lion
dapper ocean
#

But it’s the best hostings from free ones

quartz kindle
#

then your webhook URL should be YOURPROJECTNAME.herokuapp.com/WEBHOOKPATHHERE

pure lion
#

There is literally a pinned message

quartz kindle
#

you also didnt add the webhook options in your code

dapper ocean
#

Hm

#

Is this hard to add them?

quartz kindle
#

self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=3000)

dapper ocean
#

Woah

#

Thx :)

next flax
#

i want it that it will delete queue for the server it happened in

dapper ocean
#

I got your point

next flax
#

but what should i do for that

dapper ocean
#

I will try this out

#

Thx a lot Tim 🙏🏻

quartz kindle
#

👍

next flax
#

as if i dont do that and it gets disconnected it says

#

so i have to restart

#

it

#

again

#

😢

#

@pure lion pls help

pure lion
#

With

#

?

next flax
#

this issue

pure lion
#

Where do you host

next flax
#

i m making one rn

#

then i will host

pure lion
#

Wot

next flax
#

bot

#

for my server

#

@pure lion u there?

carmine summit
#

How do I count how many bots in a server?

#

How do I add comma to numbers

tulip ledge
#
    this.user.setPresence({
      status: "online",  //You can show online, idle....
      game: {
          name: "Moving Money",  //The message shown
          type: "WATCHING" //PLAYING: WATCHING: LISTENING: STREAMING:
      }
    });

Any idea why this isn't changing the presence?

boreal iron
#

game as well as activities is an array
game: [{ ... }]

misty sigil
#

does canvas output gif

#

well, can

boreal iron
#

Not sure if this required in DiscordJS too but worth a try

pale vessel
earnest phoenix
#

Venity url name

carmine summit
#

How do i count bots in a guild

earnest phoenix
#

in which lib

#

don't spoonfeed code

lean wing
#

??

earnest phoenix
#

exactly what i said

#

you would also probably need to fetch all users in order to get an accurate count

lean wing
#

ok

carmine summit
#

.filter()

#

ooooh

#

ok ty

lean wing
#

i use this code on my main bot

#

and it works fine

dapper ocean
#

Guys, how I set up webhooks correctly for top.gg XD

lean wing
#

@earnest phoenix

earnest phoenix
dapper ocean
#

What’s that

earnest phoenix
#

if you eval that code here you'll probably not get an accurate count because not all members are fetched, vaggos

dapper ocean
#

...

#

Ok...

earnest phoenix
#

i wasn't talking to you kirya

dapper ocean
#

But you pinged me

earnest phoenix
#

yes

dapper ocean
#

Oh

earnest phoenix
dapper ocean
#

Thx

feral aspen
#

console.log(bot.guilds.cache.map(g=>g.name)) Consoling log the following doesn't show me all the servers and only 100, what is a better way to do it?

earnest phoenix
#

join the array

#

with a newline

feral aspen
#

?

earnest phoenix
#

what is there not to understand about three words

#

okay, 6

#

console.log(bot.guilds.cache.map(g=>g.name)) Consoling log the following doesn't show me all the servers and only 100, what is a better way to do it?
@feral aspen join the array

#

add .join(", ") after the mapping

#

you don't have to spoonfeed them lol

#

let them figure out

#

if they wanted to know more they'd ask

#

🥄

slender thistle
#

no one has to spoonfeed but a simple snippet is fine to help

#

we're here to be helpful, not judge

next flax
#

i m unable to find a dispatched stop property in the docs like the method used for that in v11 was end can u help me finding one?

earnest phoenix
#

on which object

next flax
carmine summit
#

getting used to sharding is hard....

next flax
#

no info with v12

carmine summit
#

broadcastEval()

next flax
#

on which object
@earnest phoenix stream dispatcher

carmine summit
#

try modifying the url?

#

make it v12?

#

instead of v11?

#

ok

next flax
#

k

earnest phoenix
#

you're not helping cwickks

#

the dispatcher itself is now a stream

#

so it has a finish event

next flax
#

ok

#

finish doesnt work

#

i tried it already

#

i saw a conversation

#

on

#

github

#

saying its a proper

#

which can be used in 12

#

but it says

earnest phoenix
#

Server venity url name?

next flax
earnest phoenix
#

well

#

did you read the error

#

Server venity url name?@earnest phoenix

#

i can't speak caveman

next flax
#

yep

earnest phoenix
#

it means that there is no stop method @next flax

next flax
#

hmm

earnest phoenix
#

Wdum caveman

#

are you looking for destroy, by any chance @next flax ?

next flax
#

is that a loop hole

#

are you looking for destroy, by any chance @next flax ?
@earnest phoenix what do u mean

#

i just want my bot to stop the queue

surreal sage
#

Can someone get me thru discord oauth with glitch?

next flax
#

@surreal sage click on 3 dots

#

and

#

wait

#

what

#

idk then

surreal sage
#

what

next flax
#

u mean

#

captcha?

surreal sage
#

no lmao

#

How to make a Discord Oauth2 App with Glitch

next flax
#

destroy works @earnest phoenix

#

thnx

#

wait

#

if i use that

#

then

#

it happens the same thing when i disconnect

#

the bot

#

without clearing the queue

#

wait lemme

#

update my code

#

more

#

its fine now

#

no

#

is their a event like if my bot gets disconnected

#

queue will be delete

#

lemme check docs

next flax
#

finally

#

my bot is over

#

Thanks DBL Community For Help

sly marten
#

guys how do i make my bot dm someone

earnest phoenix
#

in which library

next flax
#

i know in js but if i know spoonfeeding 😢

#

sorry

ivory seal
sly marten
#

wdym

#

i know in js but if i know spoonfeeding 😢
@next flax huh?

earnest phoenix
#

is their a event like if my bot gets disconnected
@next flax voiceStateUpdate event

ivory seal
#

@sly marten we aren't allowed to just tell u the code

#

no spoon-feeding here

sly marten
#

o

#

then how?

next flax
#

u saw docs?

ivory seal
#

well u can refer the docs

next flax
#

yep

#

@next flax voiceStateUpdate event
@earnest phoenix ok

#

lemme try

ivory seal
#

docs

next flax
#

if we spoonfeed Shivaco will ban us 😱

#

😱

ivory seal
#

wait its a ban?

next flax
#

na idk

#

i m kidding

#

xD

restive furnace
#

@ivory seal yes, make yourself one

ivory seal
#

ye i tried using the fetch method i was unable to do more than one in the js file

next flax
#

how can we use non released packages

#

using git repo

#

i saw someone using it

earnest phoenix
#

you should be able to do npm i <github repo>

#

i might be wrong

next flax
#

he did

#

clone method

restive furnace
#

then do that?

#

but you can also do that ^^^^

next flax
#

hm

#

can someone help me i want to use spotify links for my discord bot

#

i need docs or a package

earnest phoenix
#

erela.js has a spotify plugin

restive furnace
next flax
#

i m unable to find 😢

earnest phoenix
#

or use the official api

next flax
#

and

#

some bots use soundcloud

restive furnace
#

lavalink prob

earnest phoenix
#

yeah

restive furnace
#

since soundcloud api is closed rn

blissful coral
#

Oof

next flax
#

how can i add lavalink to my bot then

#

i m using ytdl-core rn

earnest phoenix
#

spotify and soundcloud are being scraped

#

none of the official apis are being used

#

you're not allowed to stream from spotify; some bots scrape spotify links and search the songs on youtube

#

lavalink is an external program

#

a webserver running java

#

google lavalink and an appropriate lavalink client for your lib

#

lavalink is trash with performance though

restive furnace
#

lavaplayer is alternative too

next flax
#

is lavalink ez to use?

earnest phoenix
#

lavaplayer is java

#

lavalink is a wrapper around lavaplayer

#

i'd go for implementing everything by myself but that requires a lot of lowlevel knowledge (any -> RAW -> opus) etc. which i doubt you have

#

also yes

#

lavalink is easy to use but is absolutely trash in performance

next flax
#

hm

restive furnace
#

i would make one in c++, but I don't have enough experience in it

earnest phoenix
#

i made an alternative in c# but it's private use only right now

pale vessel
#

i wish we can see your work/use your private bot

#

kinda curious

next flax
#

is their a way by which the bot will create a webhook

#

nd send it

opal plank
#

anyone know a way to reconnect a debugger session with VSC?

ionic dawn
#

is their a way by which the bot will create a webhook
@next flax yeah, there's a few bots that actually those that to clone users name and profile pictures and act like them.

dull bramble
#

So, my basic commands look like this. I've tried following tutorials and the official discord.js but I found nothing! I'm trying to make the bot send an embed, but it's really hard to find a good explanation on how to do it! Anyone able to help?

earnest phoenix
#

you must be blind because embeds are right to the side on the official docs

dull bramble
#

I know, I tried that.

earnest phoenix
#

oh?

dull bramble
#

It just doesn't work for some reason

pale vessel
#

what did you try that didn't work?

#

and of course, there's a reason as to why it didn't work lol

dull bramble
#

Lemme show you the error...

pale vessel
#

show the code too if you can

dull bramble
#

Code ^

earnest phoenix
#

you're trying to use message where it doesn't exist

dull bramble
earnest phoenix
#

look at your code

pale vessel
#

you defined message as msg, not message

earnest phoenix
#

^

dull bramble
#

Ohhhhhhh

earnest phoenix
#

@dull bramble please learn javascript before trying to make a bot

#

read pins

pale vessel
#

chill

earnest phoenix
#

try not to copypaste code next time

#

📌

winter topaz
next flax
#

is their a event like

#

client on disconnect

main trench
#

Like for a vc channel?

next flax
#

yep

main trench
#

I think their is a event for that if it is it will be in the docs

#

Are you using node/discord.js?

next flax
#

djs

main trench
#

Ok

#

Yes a event exists

next flax
#

client on disconnect will work right

main trench
#

When you do client.on a list should pop up (if your using vsc im not sure if other editors do this) displaying a list of events that can be used

next flax
#

ok

main trench
#

If you see it in the list then yes it will work

pale vessel
#

that is VoiceConnection#disconnect so you need to join a channel first and then listen for that event

#

you're probably looking for Client#voiceStateUpdate, which triggers when a member leave/joins a VC

main trench
#

Ah

pale vessel
#

but what do you mean by client on disconnect?

#

the shard/client itself or regarding VCs?

next flax
#

like

#

if my bot is disconnected manually

#

so queue will be deleted automatically for that guild

pale vessel
#

should be Client#voiceStateUpdate then

next flax
#

as i have used queue.delete(msg.guild) in cmds like disconnect

#

thats fine

pale vessel
#

this sends two parameters, oldState and newState. to check whether the bot was disconnected, make sure that newState is null , which means that the bot is no longer inside a VC

#

you can delete the queue if that returns true

next flax
#

u have example?

pale vessel
#

like your message event, you can use it likejs client.on("voiceStateUpdate", (oldState, newState) => { if ( oldState.id === client.user.id && // make sure that the member is the bot itself by comparing old VoiceState member ID and the bot's ID! !newState // ...and make sure the bot is not in a voice channel anymore, meaning that it got disconnected ) deleteQueue(); // delete the queue if all the conditions are true });

here's the available VoiceState properties - https://discord.js.org/#/docs/main/stable/class/VoiceState

next flax
#

ok

pale vessel
#

read it and understand it

#

don't copy paste

next flax
#

hm

#

but i think

wary dagger
#

#verification-help

next flax
#

if somone drags the bot

#

then also

#

queue will be deleted

wary dagger
#

like
if my bot is disconnected manually
so queue will be deleted automatically for that guild

pale vessel
#

if somone drags the bot
@next flax newState will still exist, thus your bot will not delete the queue

next flax
#

ok

pale vessel
#

oldState is your bot's previous VoiceState. if it was moved, newState will be the about the new VC

main trench
#

So in theory Flaze couldn't you make a switch argument that detects if the bot was moved or just disconnected normal to delete the queue?

pale vessel
#

yea

#

switch statement? not sure if it would suit this though

main trench
#

Hmm

pale vessel
#

since the values can be different types

main trench
#

True

chrome hound
#

what permission do you guys recommend for prefix changing?

pale vessel
#

MANAGE_SERVER

next flax
#

manage server

chrome hound
#

okay, thanks

next flax
#

or administrator

pale vessel
#

don't ever put administrator lul

pure lion
#

Poo

chrome hound
#

and for nuking a channel?

pale vessel
#

manage channels

next flax
#

manage channels

chrome hound
#

manage messages isn't enough right

next flax
#

it is

pale vessel
#

yes, not enough

chrome hound
#

okay

next flax
#

oh

#

that

pale vessel
#

you need to nuke a channel, that requires manage channels permission

next flax
#

oops

#

how do u nuke a channel

pale vessel
#

i was assuming they mean deleting them

next flax
#
channel.clone```
pale vessel
#

thonk

next flax
#

i think this

#

some one told me

#

clone will do

main trench
#

Clone just copys the channel

next flax
#

so channel.delete too?

chrome hound
#

how can i call a function in bot.py from /cogs/admin? (discord.py)

main trench
#

If you want to delete it do channel.delete

next flax
#

hm

pale vessel
#

make sure to add (), since it's a method

next flax
#

idk why my ban cmd doesnt work

#

k thnx @pale vessel

main trench
#

What's the error?

next flax
#

their isnt any

#

module.exports = {
  name: "ban",
  category: "moderation",
  description: "Ban anyone with one shot whithout knowing anyone xD",
  usage: "ban <@user> <reason>",
  run: async (client, message, args) => {
    
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author},I m sorry but You do not have perms to ban someone**`)
    }
    
    const target = args[0];
    

    if(target.id === "724300617656303687") {
      return message.channel.send(`**${message.author},I m sorry but  I cannot self-ban**`)
     }
    
 if(target.id === message.author.id) {
      return message.channel.send(`**${message.author}**,I m sorry but You can not ban yourself!`)

 }      
  
        let reason = args.slice(1).join(" ");

        if(!reason) {
             reason = "No reason given";
        } 
        
    target.ban(reason)
    let embed = new discord.MessageEmbed()
    .setTitle("Action : Ban")
    .setDescription(`Banned ${target} (${target.id})`)
    .addField("MODERATOR", `**<@!${message.author.id}>**`)
    .addField("REASON", reason)
    .setColor("#ff2050")
    .setFooter(`Banned by ${message.author.username}`);
    
    message.channel.send(embed)```
main trench
#

Target may be the issue

next flax
#

so what should i do

winter topaz
#

Are you trying to make the target the first user mention in the command?

#

Or an ID?

next flax
#

i m trying to make it both

main trench
#

Ah

next flax
#
if (!channel) return{ 
channel = message.channel
}
channel.clone();
channel.delete();
#

updated version of nuke cmd

main trench
#

Do something like let user = message.mentions.members.first()

next flax
#

earlier it was

#

like that

winter topaz
#

you can use <Message>.mentions.members.first() to get the first mention of a member in the message, and as for ID, you can get the member from the cache using message.guild.members.cache.get(args[0])

main trench
#

^

winter topaz
#

(Trying not to spoon-feed too much)

main trench
#

Yeah lol

#

Kinda hard for that one

pale vessel
#

if you use message.mentions you're going to have a hard time getting the ban reason

#

the mention could be the last arg for instance

main trench
#

Hmm

#

In that case make it look for the mention in the first arg

#

If it doesn't see a mention execute nothing or a help message

#

@next flax also your nuke command looks like its gonna make a copy of the channel then delete the original channel leaving the copy

earnest phoenix
#

hi, i have an idea on creating a reward for those people who vote the server, then what command do i have to make?

rose warren
#

@earnest phoenix you have to use webhooks and use the vote event to fire the rewards

earnest phoenix
#

k

next flax
#

@next flax also your nuke command looks like its gonna make a copy of the channel then delete the original channel leaving the copy
@main trench nuke cmd is that only

#

u havent tried better anti spam bot?

slender thistle
#

how can i call a function in bot.py from /cogs/admin? (discord.py)
@chrome hound what are you trying to do

earnest phoenix
#

i dont understans

#

stand

#

can u explain with an example

next flax
#

module.exports = {
  name: "ban",
  category: "moderation",
  description: "Ban anyone with one shot whithout knowing anyone xD",
  usage: "ban <@user> <reason>",
  run: async (client, message, args) => {
    
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author},I m sorry but You do not have perms to ban someone**`)
    }
    
let user = message.guild.members.cache.get(args[0]);


    if(user.id === "724300617656303687") {
      return message.channel.send(`**${message.author},I m sorry but  I cannot self-ban**`)
     }
    
 if(user.id === message.author.id) {
      return message.channel.send(`**${message.author}**,I m sorry but You can not ban yourself!`)

 }      
  
        let reason = args.slice(1).join(" ");

        if(!reason) {
             reason = "No reason given";
        } 
        
    user.ban(reason)
    let embed = new discord.MessageEmbed()
    .setTitle("Action : Ban")
    .setDescription(`Banned ${user} (${user.id})`)
    .addField("MODERATOR", `**<@!${message.author.id}>**`)
    .addField("REASON", reason)
    .setColor("#ff2050")
    .setFooter(`Banned by ${message.author.username}`);
    
    message.channel.send(embed)

    let dmembed = new discord.MessageEmbed()
    .setTitle("Action : Ban")
    .setDescription(`You were banned from ${message.guild.name}`)
    .addField("MODERATOR", `**<@!${message.author.id}>**`)
    .addField("REASON", reason)
    .setColor("#ff2050")
    .setFooter(`Banned by ${message.author.username}`);
    user.send(dmembed)    
      
  }
}
#

it is still not working

chrome hound
#

@chrome hound what are you trying to do
@slender thistle I wanna have a global function called is_owner_or_has_perms and i don't want to add it to every cog.

main trench
#

@earnest phoenix you need to make a webhook that uses the top.gg api to detect if someone votes your server

slender thistle
#

sounds like a separate utils.py file you could create

chrome hound
#

oh i actually have one

earnest phoenix
#

@earnest phoenix you need to make a webhook that uses the top.gg api to detect if someone votes your server
@main trench and how do i do it in javascript?

slender thistle
#

Why not add it there?

main trench
#

@next flax you have it set to only work with id's

next flax
#

what

#

oh

#

that

#

ik

main trench
#

@earnest phoenix you can make webhooks in the discord server settings but I would ask for more help in #topgg-api

next flax
#

i used ids only

earnest phoenix
#

k can u help me with an example

#

@main trench

sick fable
#

In embed: Embed size exceeds maximum size of 6000* 😦

main trench
#

I'm not good with Api help so I don't have a example

earnest phoenix
#

k

#

i see

sick fable
#

Help me

main trench
#

@next flax the issue is it is banning a user then dming them have it dm the user first before banning them

#

Your embed is too big try making it smaller @sick fable

next flax
#

ok

earnest phoenix
#

170,000 times a year - That’s how often criminals attempt to steal domains. Protect your domain. This is what it says once I am buying my domain, is this true? Or they just want my money :((

main trench
#

Its just wanting you to upgrade a safety plan in your domain you can just ignore it

#

So yeah they want your money

earnest phoenix
#

Bleh scammers xD

next flax
still cliff
#

What scammy registrar is that, @earnest phoenix?

main trench
#

One of the embeds was coded wrong

next flax
#

ok

earnest phoenix
#

Godaddy

pale vessel
#

sounds like freenom- oh

still cliff
#

Scummiest of all.

#

Use NameCheap.

earnest phoenix
#

What are good ones then

#

Alr

#

My friend told me about that once b4

still cliff
#

It's basically the one that has provided me with the best experience.

pale vessel
#

namecheap, cloudflare, google

#

not sure about google though

sick fable
#

Your embed is too big try making it smaller @sick fable
@main trench I can't make it more smaller

still cliff
#

Cloudflare is a newbie in the registrar game, so won't recommend it.

#

Google domains is good.

earnest phoenix
#

Btw, can I get a free email on that domain?

#

Without having to pay again a lot money

still cliff
#

You can.

earnest phoenix
#

Hm its only 0.91$ kekw

still cliff
earnest phoenix
#

nutella-dev.xyz

#

is it searchable on google?

still cliff
#

1000 email accounts, free.

earnest phoenix
#

Perfecto

still cliff
#

Not until it is on the search console.

#

is it searchable on google?
@earnest phoenix ^

earnest phoenix
#

search console?

still cliff
#

Google search console.

earnest phoenix
#

I never heard of that sorry if I am dumb

#

oh yes

#

k

still cliff
#

Mention me if you need help regarding anything WoT or IoT.

earnest phoenix
#

WoT loT?

#

I am new to domains

still cliff
#

Web of things, Internet of things.

earnest phoenix
#

oh k

#

will be alright

next flax
#
module.exports = {
  name: "ban",
  category: "moderation",
  description: "Ban anyone with one shot whithout knowing anyone xD",
  usage: "ban <@user> <reason>",
  run: async (client, message, args) => {
    
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author},I m sorry but You do not have perms to ban someone**`)
    }
    
let user = message.guild.members.cache.get(args[0]);


    if(user.id === "724300617656303687") {
      return message.channel.send(`**${message.author},I m sorry but  I cannot self-ban**`)
     }
    
 if(user.id === message.author.id) {
      return message.channel.send(`**${message.author}**,I m sorry but You can not ban yourself!`)

 }      
  
        let reason = args.slice(1).join(" ");

        if(!reason) {
             reason = "No reason given";
        } 

        message.channel.send(`<@!${user.id}> was banned`)

    user.ban(reason)
  }
}
earnest phoenix
#

Holy moly

next flax
#

i removed embeds

earnest phoenix
#

Could you please do that in a pastebin?

next flax
#

in return for now i added a simple message

#

me?

earnest phoenix
#

yes

#

u

next flax
#

my pc lags if i open several tabs

#

😢

#

why isnt the bot is banning

#

i just wanted to know this

#

same error

earnest phoenix
#

what's the error?

next flax
#

i cant copy and send this as its cmd

opal plank
#

well, you need a try catch block on the bottom half of the error

#

users may not always have their dm's open

#

there might be a better way than just try-error tbh[

#

@quartz kindle do you know if theres a better method in d.js than just wrap a <user>.send() onto a catch block?

#

im now curious

autumn heart
#

If there is, ping me please ^

still cliff
#

Doesn't a .catch(e) exist already?

opal plank
#

a better method in d.js than just wrap a <user>.send() onto a catch block?

still cliff
#

Oh.

pale vessel
#

no, the api doesn't tell you anything until you try to send a message

opal plank
#

i know that bit, but idk if d.js provides a better method that accounts for that

pale vessel
#

thonk

#

how would that work

opal plank
#

attach the catch internally

earnest phoenix
#

that would be swallowing errors

opal plank
#

idk, just wondering tbh

earnest phoenix
#

i.e. bad lib design

opal plank
#

tell ME about bad lib design

earnest phoenix
#

not like djs already swallows ws errors

opal plank
#

fucking twitch lib devs swallow 90% of all errors

#

library.on('error', e => {})

they swallow so many errors it feels lke they did that internally ngl

earnest phoenix
#

@still cliff i bought Nutella-dev.xyz !

#

😄

#

I am so happy !!

opal plank
earnest phoenix
#

Thanks for your help it was only 1$ it was very cheap

still cliff
#

Nice, @earnest phoenix!

earnest phoenix
#

Now I am going to work on it!

#

yesss

#

because it has a low seo rating

#

you should've checked out github student pack and gotten a cheap .dev domain

lethal pine
#

how to downgrade discord.py version 1.5.0 to V1.4.1

opal plank
#

out of curiosity, why would you do that?

earnest phoenix
#

Im now going to set everything up with my site, then email I feel so happy ;DDD

still cliff
#

XYZ is pretty popular too. It is used for all sorts of things nowadays and .dev is not included in the GH Student pack.

earnest phoenix
#

is it not?

#

i got a .dev domain from it that expired now

#

stopbeingabad.dev

still cliff
#

Let me know if you need help with the email setup. I am a little too experienced with that.

lethal pine
#

how to downgrade discord.py version 1.5.0 to V1.4.1
??

opal plank
#

i'd assume => uninstall py 1.5.0, install 1.4.1

still cliff
#

You get a couple of options with Name.com, .tech and .me.

pale vessel
#

wot

#

downgrading a lib doesn't sound like a good idea

opal plank
#

out of curiosity, why would you do that?

#

maybe using old lib that doesnt support newer sytanx?

pale vessel
#

discord.js v12 to v11 would be a huge troll

blissful coral
#

v13 gonna be just like the update from v11 to v12

opal plank
#

MORE CACHING INTENSIFIES IN v13

blissful coral
#

crys

opal plank
#

laughs in 128gb RAM

quartz kindle
#

More work for me @_@

pale vessel
#

woohoo more bandwidth to spend

opal plank
blissful coral
#

wow

opal plank
#

correction, 126GB

quartz kindle
#

And 200mb/s disks

opal plank
#

precisely

#

dude i was legit pulling my hairs trying to figure out how to re-attach a VSC debugging session

blissful coral
opal plank
#

finally figured out

carmine summit
opal plank
quartz kindle
#

What the fuk

opal plank
#

wot?

quartz kindle
#

I got a friend request from hydrabolt

opal plank
#

imma slap you with a Leviathan friend rq

#

brb

#

actually

#

bots dont have friends anymore i dont think

quartz kindle
#

I mean

opal plank
quartz kindle
#

Hes the owner/author of discordjs

#

Lmao

carmine summit
#

Wut

#

U sure?

still cliff
#

yep

opal plank
#

shameful of me to not know them

still cliff
#

he is

opal plank
carmine summit
still cliff
#

the guy with pikachu pfp

opal plank
#

even though i asked em' if they wanted d.js typings for TS

#

i dont think i spoke to that person though

#

im like, 99% sure

main trench
#

@main trench I can't make it more smaller
@sick fable try reducing the amount of words and or images in the embed

carmine summit
#

Can I get ram???

opal plank
#

a cheap way to check length is to simply JSON.stringify(embedObject).length > 2000

#

like, REALLY cheap way of doing it

still cliff
#

Is there an efficient way to run multiple puppeteer instances?

opal plank
#

i only played a little with puppeteer, cant give much help there

#

that shit is the only reasons i still have ERRCON errors on my bot

still cliff
#

What do you use puppeteer for?

#

On a Discord bot!?

rotund vale
#

What

opal plank
#

cough cough web scrapping cough couhg

pale vessel
#

i have a google assistant command that uses puppeteer

still cliff
#

Oh my my.

#

Use Request with Cheerio.

earnest phoenix
#

can a bot accept a friend request

queen needle
#

I've seen people use it for running HTML code and sending the result

still cliff
#

No, @earnest phoenix.

pale vessel
#

yeah, that

rotund vale
#

@earnest phoenix no

still cliff
#

Use request, @queen needle.

opal plank
#

bots have no friends, they are lone losers mmulu

rotund vale
#

F

earnest phoenix
#

why does puppeteer download the whole fucking source of chromium

still cliff
#

That sounds like I.

#

Because it runs on chromium, @earnest phoenix.

#

You can also use Firefox.

earnest phoenix
#

what does it even do

#

also do you guys mind if i use phin

still cliff
#

It's a browser inside the console.

#

I use it to run WhatsApp web instances to automate several things and work on an unofficial API.

rotund vale
#

Wait isn't Puppeteer that Chrome Node.js API?

earnest phoenix
#

Whats that

pale vessel
#

yes

earnest phoenix
#

I use it to run WhatsApp web instances to automate several things and work on an unofficial API.
@still cliff you fucking smartass

still cliff
#

:p