#development

1 messages ยท Page 1217 of 1

eternal osprey
#

i changed everything

#

and i do not get the error again

#

but another error:

#

failed to parse weather data

#

(node:9916) UnhandledPromiseRejectionWarning: Error: failed to parse weather data

earnest phoenix
#

F

eternal osprey
earnest phoenix
#

what

eternal osprey
#

was that 'F' necessary?

#

anyone that knows my error?

#

and that can help

quartz kindle
#

the way your code is designed right now, if a single error happens in one of the functions, everything else errors

eternal osprey
#

okay

quartz kindle
#

you have to add some error checking

eternal osprey
#

like console.log(...)

quartz kindle
#

for example, in this function

#

if a single weather fails, all of them fail

eternal osprey
#

yeah

#

i know they won't fail

#

because i have ran them all

#

in another code

#

remember that hell code?

#

i've changed my whole source code

#

to this.

quartz kindle
#

where is "failed to parse weather data" coming from then?

#

sounds like a weather related error

eternal osprey
#

yeah

quartz kindle
#

so it seems one of the weather checks is failing

eternal osprey
#

@earnest phoenix bropleasse, if you cannot help please stop with fucking around all the time.

#

yeah, i will run them again

#

one by one

weak rain
#

how can i make my bot leave servers with x members

#

which event?

earnest phoenix
#

@earnest phoenix bropleasse, if you cannot help please stop with fucking around all the time.
@eternal osprey this channel is technically a chat channel but for only development

#

how can i make my bot leave servers with x members
@weak rain that's just suicide

#

no one will use your bot if you do that

weak rain
#

i just want to that for now

eternal osprey
#

Searching locations with: SUNNY
bot.js:107
(node:8536) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'skytext' of undefined

#

new error

#

we re getting there :0

earnest phoenix
#

send code

quartz kindle
#

@weak rain you want to leave all servers with more than X members?

#

only current servers or also including new servers?

weak rain
#

current

earnest phoenix
#

thank god

weak rain
#

only for now

earnest phoenix
#

loop over the collection

quartz kindle
#

loop over client.guild.cache and check if guild.memberCount is lower than X, if it is, call guild.leave()

weak rain
#

@weak rain you want to leave all servers with more than X members?
@quartz kindle less*

earnest phoenix
#

bot.guilds.cache.forEach();

#

inside forEach pass a callback function

#

@weak rain why the hell do you want to leave servers anyways

#

that's being a deek

whole stream
#

is there a dated tutorial on how to make a welcome to the server discord bot

#

ive never tried it

fringe axle
#

You mean if a member joined?

whole stream
#

yeah

fringe axle
#

Use the guildMemberAdd event.

whole stream
#

ty

fringe axle
#

@whole stream now the link is perfect.

whole stream
#

lol

#

i saw you editing it

fringe axle
#

xd

whole stream
#

new Discord.GuildMember(clientdataguild);
is that it?

quartz kindle
#

no

golden condor
#

You don't have to do that, d.js does it for you

left sentinel
#

Can anyone join my test server to test my new report system?

#

Dm me if u do ;)

misty sigil
#

@sinful belfry im fairly sure theres a tag for this

sinful belfry
#

uh probably let me find it lol

#

-helptest @left sentinel

gilded plankBOT
#

@left sentinel

We aren't a server full of guinea pigs, and are not obligated help you with features that can easily be tested with alts or friends. If you don't have either - at least you can make alts without problems.

left sentinel
#

??

misty sigil
#

read it mmulu

left sentinel
#

Oh

#

Well thats annoying

#

no one is online

#

grrrr

misty sigil
#

A L T S

zenith terrace
#

Or get an alt

left sentinel
#

that means fake emails and stuff

misty sigil
#

no

left sentinel
#

thats just annoying

#

Ugh

#

Wdym no?

misty sigil
#

just make a temp one in a browser

left sentinel
#

How tf do u do that

#

xD

misty sigil
left sentinel
#

But i need a email

misty sigil
#

then open it in browser

#

you dont need a bloody email

left sentinel
#

Fr?

misty sigil
#

yes

left sentinel
#

Yeh i do

misty sigil
#

no you dont

#

bruh

weak rain
#


    module.exports = {
        name: "getinvite",
        category: "owner",
        run: async (client, message, args) => {
        if (message.author.id !== "554185890453389322") {
        let guild = null;

        if (!args[0]) return message.channel.send("Enter An Name")

        if(args[0]){
            let fetched = bot.guilds.cache.find(g => g.name === args.join(" "));
            let found = bot.guilds.cache.get(args[0]);
            if(!found) {
                if(fetched) {
                    guild = fetched;
                }
            } else {
                guild = found
            }
        } else {
            return message.channel.send("Invalid Name!");
        }
        if(guild){
            let tChannel = guild.channels.cache.find(ch => ch.type == "text" && ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE"));
            if(!tChannel) {
                return message.channel.send("An Error Has Occured Try Again!"); 
            }
            let invite = await tChannel.createInvite({ temporary: false, maxAge: 0 }).catch(err => {
                return message.channel.send(`${err} has occured!`);
            });
            message.channel.send(invite.url);
        } else {
            return message.channel.send(`\`${args.join(' ')}\` - Bot is Not in this server`);
        }
    } else {
        return;
    }
}}```
#

why isnt this working

left sentinel
#

It says:

#

Email
username
pass
DOB
TickMark

#

to register

#

....

misty sigil
#

not signing up

left sentinel
#

Then what do i do?

#

sign in??

#

Thats my main acc

misty sigil
left sentinel
#

i click that and it logs to my main

earnest phoenix
#

SA

pale vessel
#

AS

left sentinel
#

so i log out

misty sigil
#

then log out of your main

#

yes

left sentinel
#

thenwjat

misty sigil
#

press the button again

left sentinel
#

OHhh

#

That makes sence

#

ooo

#

well that failed

#

my test server has email verification ...

#

LOL

#

'report @MissModerator#5157 Test

#

OOps

#

wrong server

earnest phoenix
#

Idling here
Need help ping me
blobsipfast

fathom topaz
#

does someone know how to assing a varible using command

#

like &assing lol

#

and the bot will reply

#

lol

earnest phoenix
#

just send a message

#

"lol"

left sentinel
#

Is there a faster way to get your bot verified?

misty sigil
#

no

left sentinel
#

oh

#

Imma go to a different website then

ember oak
#

Hey! Can someone drop working tutorials (Discord.js v12) for making a music commands?

misty sigil
#

lmao

#

the only reason top.gg takes so long is because so many people see it

left sentinel
#

Yeh ik

ember oak
#

bruh I waited 1 and a half month to get vertified...

left sentinel
#

but im not waiting 1 month]

#

lOL

#

imma just add on like 10 websites

#

and see whats fasteswt

misty sigil
#

i know which is fastest

#

but im not gonna tell you because of rules

dusty onyx
#

ah!!

#

wrong server

slender thistle
#

That would be ๐Ÿ—ก๏ธ, I assume

earnest phoenix
#

-wrongserver

dusty onyx
#

oh wait this is development anyway haha

slender thistle
#

:p

dusty onyx
#

but yes its that emoji

#
        def check(reaction, user):
            return str(reaction.emoji) == '\U0001f5e1'

        try:
            reaction, user = await self.bot.wait_for('reaction_add', timeout=10.0, check=check)
        except asyncio.TimeoutError:
            await ctx.channel.send('Time\'s up!')
            return
        else:
            print("Added")```

ok ill repost since it development anyway, ive tried a few different emojis too but i can never get to the print part :(
pale vessel
#

did you try \๐Ÿ—ก๏ธ

strange hatch
#

Hello Yall GWumidahKKE

dusty onyx
#

yep

strange hatch
#

i wanted to ask for help Beacuse my Kick command Wont Work well it works but it says if i kick som i was Unable to kick the Person But the bot kicks the Person.

ember oak
#

If someone saw legit working code to make music bot, please share it with me, tired to do it for like 3/4 hours now..

strange hatch
#

ill dm u @ember oak if i find one.

ember oak
#

okay, thanks.

slender thistle
#

@dusty onyx Is the message you are reacting to cached btw

#

(I'm not sure if that's the case but...)

strange hatch
#

hey @slender thistle

slender thistle
#

hi

dusty onyx
#

i wouldnt think so, its sent by the bot t before

#

just

slender thistle
#

๐Ÿค”

strange hatch
#

do yk what the problem is with my kick command for my bot Like it kickes the Person buttttttttt it says after it i was Unable to ban the person

slender thistle
#

Tried raw_reaction_add yet?

#

Well, you didn't provide any details like your code or any errors you're getting

#

so no, there's no way I would know

strange hatch
#

wait imma send

dusty onyx
#

it doesnt work for what im trying to do h

slender thistle
#

Oh?

weak rain
#

how can i add 2 ids for owner

slender thistle
#

id1, id2

weak rain
#

ok

#

but not dbl one

#

code one

dusty onyx
#

i tried initially using it, but because i only want reactons to be counted for so long, i thought it would be much simpler to just have a wait_for instead

slender thistle
#

An array of IDs

#

Then check if message author is included in the array

weak rain
slender thistle
#

Oh, I meant using wait_for("raw_reaction_add")

strange hatch
#

@slender thistle thats the Script its js btw ```bot.on('message', message=>{

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

switch(args[0]){
   case 'kick': 
   

   const user = message.mentions.users.first();

   if(user){
       const member = message.guild.member(user);

       if(member){
           member.kick('you has been Kicked For Testing!').then(() =>{
               message.reply(`Sucessfully kicked ${user.tag}`);
           }).catch(err =>{
               
               console.log(err);

           });
         
           message.reply(`I was unable to kick  ${user.tag}`);
           }
        } else {
            message.reply('you need to Specify a Person.')

        }
slender thistle
#

unless that's what you meant? ๐Ÿค”

dusty onyx
#

oh i see!

#

no i thought u meant the evnt haha

#

event

strange hatch
#

idk know how to make it so i can make an radome reason...

slender thistle
#

ah ๐Ÿ˜„

misty sigil
#

@strange hatch put the i was unable to kick in the .catch

strange hatch
#

okey

weak rain
#

Speedy is pro

strange hatch
weak rain
#

he tested many bots today

#

and he will be testing my bot soon

strange hatch
#

lol

misty sigil
#

yes

strange hatch
#

okey

tight terrace
#

...

weak rain
#

he is testing bots which were submitted on the same day with mine

strange hatch
#

but do yk how i make it so i can use an radome reason? @misty sigil

weak rain
#

gap of 5hours

tight terrace
#

Im black jesus...

#

;-;

dusty onyx
#

tried raw_reaction_add, same outcome

misty sigil
#

but do yk how i make it so i can use an radome reason? @misty sigil
@strange hatch args

#

use arguments

#

also your indentation is making me have a stroke

weak rain
#

how can i add 2 owner ids

misty sigil
#

use an || thing

strange hatch
#

well i am a bit ne w to coding js

weak rain
#

ok

misty sigil
#

if you're new to js you should learn base js

#

not bot dev

weak rain
#

if (message.author.id !== "554185890453389322 || another-id") return message.reply("I m sorry but this is a owner only command")

misty sigil
#

no

weak rain
#

this will work?

slender thistle
#

id == firstid || id == secondid

strange hatch
#

well i last code after 2 years ago

weak rain
#

ok

misty sigil
#

if(thing !== thing || thing2 !== thing2)

weak rain
#

if (message.author.id !== "554185890453389322" || "anotherid") return message.reply("I m sorry but this is a owner only command")

#

this?

misty sigil
#

no

weak rain
#

oko

#

got it

#

this

misty sigil
#

yes

weak rain
#

oh thanks Matthew

#

now bot is saying to sending a message -->> I m sorry but this is a owner only command

finite bough
weak rain
#

ok

blazing ravine
#

any1 know how to make command that convert the text to image/photo

digital ibex
#

use something like canvas

earnest phoenix
#

why the bot remove the reaction of the bot?

#

messageReactionAdd

fast quail
#

does someone has an exemple of dbl vote in python

golden condor
#

I think that's the link

fast quail
#

it doesn't work

#

Idk what I'm doing wrong

honest perch
#

@fast quail what errors are you getting?

fast quail
#

how do we get a webhook thing

#

nothing

#

even when I try testing the bot

honest perch
#

code?

golden condor
fast quail
#
class TopGG(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token = ''
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print("Received an upvote:", "\n", data, sep="")
    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print("Received a test upvote:", "\n", data, sep="")
def setup(bot):
    bot.add_cog(TopGG(bot))
honest perch
#

do you have a webserver?

#

with an open ip

fast quail
#

I have a vps

honest perch
#

if you go to ip:port/dblwebhook does the page exist

fast quail
#

can't I run it on my local ?

misty sigil
#

no

fast quail
#

uhh

#

no @honest perch

#

the page doesn't exit

honest perch
#

the ip needs to be open

fast quail
#

how do I open it ?

slender thistle
#

port does

#

Through your router settings

honest perch
#

same thing

slender thistle
#

If I'm gonna be a smartass, not really :^)

fast quail
#

and on the vps, same thing, right ?

honest perch
#

If I'm gonna be a smartass, not really :^)
@slender thistle >:

fast quail
#

still nothing @honest perch

#

oh wait

honest perch
#

not a network expert so idk

fast quail
#

but isn't there a simplier way to get the votes ?

earnest phoenix
#

why when I reset my bot this dont work?

#

messageReactionAdd event

delicate shore
#

can i somehow get message object here and add message.channel.send(error)?

misty sigil
#

no

delicate shore
#

oh

misty sigil
#

just use try catch for that

delicate shore
#

I need to do that in all cmds

#

@misty sigil can i do it together for commands i don't have in cmd handler

blazing ravine
#

why not work

honest perch
#

NaN

earnest phoenix
#

NaN

warm marsh
#

personal preference

thick gull
#

bot-code.js

earnest phoenix
#

index.js is my express.js server

#

can't delete index.js on repl.it so I recycled it bigbrain

marble geode
#

how to show all user in my bot

#

in discord.js

#

maybe like ${client.users.cache.reduce i forget the code

opal plank
#

size

#

but thats only cached users

#

loop all guilds if you want a more precise number

misty sigil
#

its client.guilds.cache.reduce

opal plank
#

he wants size no?

#

well, if they want a more precise way of getting the users, they can use a loop on each guild, then on each member list, then map em. by the end they'd have a precise user count since it'll override duplicates when you set the map entry

strange hatch
#

can som tell me why this dose not work it says Await is not an valid in async function? even tho i did all right ```bot.on('message', message=>{

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

switch(args[0]){
   case 'kick':
if (message.member.hasPermission("KICK_MEMBERS")) {

    if (!message.mentions.users) return message.reply('You must tag 1 user.');

    else {

        const channel = message.guild.channels.cache.get(696692048543088691);
        const member = message.mentions.members.first();
        let reason = message.content.split(" ").slice(2).join(' ');

        if (member.kickable == false) return message.channel.send("That user cannot be kicked!")

        else {

            if (!reason) reason = (`No reason provided.`);

            await member.send(`You have been kicked from **${message.guild.name}** with the reason: **${reason}**`)
                .catch(err => message.channel.send(`โš  Unable to contact **${member}**.`));

            await member.kick(reason);

            const kickEmbed = new MessageEmbed()
                .setAuthor(member.user.tag, member.user())
                .setThumbnail(member.user.avatarURL())
                .setColor("#ee0000")
                .setTimestamp()
                .addField("Kicked By", message.author.tag)
                .addField("Reason", reason);

            await channel.send(kickEmbed);

            console.log(`${message.author.tag} kicked ${member.user.tag} from '${message.guild.name}' with the reason: '${reason}'.`);

        }
    }
} else {
    message.channel.send("You do not have permission to use kick.");
    return;
}





       break;
           
         
     
        }
opal plank
#

@strange hatch wait needs to be in async code

#

you should read thsi

strange hatch
#

?

#

alr

opal plank
#

async is a basic building block of js, you should learn it

strange hatch
#

okey

fierce arch
#

Hiya how can I run commands in my cmd like: Me: ?pull, CMD: git pull <github_link>. Not printing responses I want it to run the command I set? Discord.py

misty sigil
opal plank
#

2 for one, nice

misty sigil
#

ikr

#

what error

#

wait i see

#

!message.member.roles.cache.has(message.guild.roles.cache.find(r => r))

#

you weren't checking if the member had the role

#

remove the .

#

after return

hazy sparrow
#

return**.**message.channel.send('YOU DONT HAVE PERMISSIONS')

misty sigil
#

its literally pointing at it

hazy sparrow
#

also maybe put a ; at the end ๐Ÿค”

slender thistle
#

semicolons are optional in JS

delicate shore
#

i just got this error rn

#

tf

hazy sparrow
#

@delicate shore code

delicate shore
#

Bruh

#

It says unexpected token const

#

how can it say that

hazy sparrow
#

no im asking for the code

thick gull
#

use .toLowerCase()?

hazy sparrow
#

.toLowerCase()

thick gull
opal plank
#

wait a secibd

#

second

#

didnt i tell you to change that already yesterday?

hazy sparrow
#

lul

opal plank
#

doesnt matter

#

click it

#

i told you 3 days ago to fix it

hazy sparrow
#

hmm does anyone know bluefox here

misty sigil
#

after message.content

opal plank
#

you can start by learning JS rather than copying code you find around

misty sigil
#

^

hazy sparrow
#

toLowerCase() btw

misty sigil
#

yes please

sand condor
#

no

misty sigil
#

no

#

not at all

pale vessel
#

it's string.toLowerCase(), message.content is the string, add .toLowerCase() to it, message.content.toLowerCase()

misty sigil
#

then just how are you

pale vessel
#

this boi got it ^

misty sigil
#

no need for 690000000000000 if statements

opal plank
#

512 combinations

#

i did the math

misty sigil
#

fucking hell

opal plank
#

512 if's

#

good luck

pale vessel
#

challenge accepted

misty sigil
#

yandev wins

thick gull
#

message.content is a string

sand condor
#

wow

thick gull
#

.toLowerCase() works on a string

misty sigil
#

๐Ÿ˜ฉ some whitenames i swear

sand condor
#

true

opal plank
#

How dare you want me to learn? just spoonfed angeryBOI

sand condor
#

i never look at docs i hate them so much i just copy code all the time

misty sigil
#

i hate docs

thick gull
#

well then

misty sigil
#

i just look at github

#

and steal code

sand condor
#

yeah same

misty sigil
#

dont try to teach me

thick gull
#

ok but if you actually read the code in GitHub and understand how itโ€™s operating itโ€™s fine

#

but thatโ€™s not white names

#

at all

sand condor
#

i don't understand i just copy and paste

opal plank
#

stackoverflow is 90% of my code, the other 5% is github and those dum-dums over in a support server that gives me free code

misty sigil
#

lmao

opal plank
misty sigil
thick gull
#

your missing a )

#

๐Ÿ˜ฉ

opal plank
#

emphasis on the second part of what i sent above

sand condor
thick gull
#

where do you think

#

where did you edit last

#

๐Ÿ˜ฉ

#

oh

pale vessel
opal plank
#

im pretty sure its 512

#

2^9

pale vessel
#

i don't even know what we're talking about

thick gull
#

please what is this

#

you forgot to return when you find a match

#

๐Ÿ˜ฉ

pale vessel
#

you don't need it

opal plank
#

HOW ARE YOU, each field can be used twice, upper or lower case. So its 2*2* 2 (HOW) 2*2*2 (ARE) 2*2*2(YOU)

thick gull
#

ok

#

fair but

#

why

#

it just hurts my soul

#

not to see a return in there

pale vessel
thick gull
#

letโ€™s go I

opal plank
thick gull
#

you need to check with regex too

opal plank
#

idk how the heck that didnt get starred tbh when it was posted, that turned into my live example of 'HOW NOT TO CODE'

#

this code makes the term callback hell looks like an understatement

delicate shore
#
  if (command === "playstore") {
    let reason = args.slice(1).join(" ");

    var gplay = require("google-play-scraper");
    if (!args[1])
      return msg.reply(`Correct usage is ${PREFIX}playstore APPNAME`);
    const [results] = await gplay.search({
      term: `${reason}`,
      num: 1
    });

    if (results.title === undefined) {
      return msg.reply(`App Not Found BOOMER`);
    }

    let currency = results.currency;
    if (currency == undefined) {
      const result = new Discord.MessageEmbed()
        .setTitle(results.title)
        .setDescription(results.summary)
        .setThumbnail(results.icon)
        .setColor("RANDOM")
        .addField("Developed by", results.developer)
        .addField("PRICE", `It's Free Lmao`)
        .addField("How To Download?", results.url)
        .setFooter(`App id - ${results.appId}`)

      msg.channel.send(result)
    } else {
      const result = new Discord.MessageEmbed()
        .setTitle(results.title)
        .setDescription(results.summary)
        .setThumbnail(results.icon)
        .setColor("RANDOM")
        .addField("Developed by", results.developer)
        .addField("PRICE", `${results.price}${currency}`)
        .addField("How To Download?", results.url)
        .setFooter(`App id - ${results.appId}`)

      msg.channel.send(result)
    }
  }```
#

code

#

error

thick gull
#

huh

#

idk is the json correct

delicate shore
#

yes

thick gull
#

ok then idk

delicate shore
#

it was working 7 days back

#

it just stopped working

#

@thick gull at JSON.parse (<anonymous>) at /root/app/node_modules/google-play-scraper/lib/utils/scriptData.js:78:26 at Array.reduce (<anonymous>)

#

does this mean it has to do something with package

thick gull
#

I have no clue

delicate shore
#

ok

opal plank
#

see where position 143 leads you

#

it gives you where the error token is

#

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

fringe axle
#

Anyone knows how can I get a users game? Like if he's listening to spotify he's saying true and if he's doing nothing/not playing spotify he returns false

opal plank
#

Chrck presence

fringe axle
#

I know but it's false everytime.

earnest phoenix
#

anyone else have an issue with embed length on mobile...somwtimes mine is very narrow...but if i scroll up then back down its full width

#

width not length

quartz kindle
#

that bug has been around for a long time

#

you can fix it by setting an author field

slender thistle
#

Can we put a zws there?

earnest phoenix
#

awesome ty

quartz kindle
#

i think we can, not sure

fringe axle
#
user.presence.activities.name === 'Spotify'
``` So I try to do a Spotify info if the user is listening to spotify but he's still returning that he's not listening
slender thistle
#

Does [1,2,3] == 1 make sense to you

fringe axle
#

To me?

slender thistle
#

Yes

fringe axle
#

Oh, no

slender thistle
#

You are comparing an array against a string

fringe axle
#

Means only ```js
user.presence === 'Spotify'

quartz kindle
#

actually, you're checking if undefined equals a string

#

[1,2,3].name === "Spotify"

slender thistle
#

or that

sand condor
#

activities is an array and doesn't have a property named name
you'll have to use array methods such as find() to check the activities

fringe axle
#

Oh, hmm

sand condor
thick gull
#

you can log it to see how it works

sand condor
#

or use docs

fringe axle
sand condor
#

that's not how find works

errant perch
#

how do i catch a unhandled promise rejection

fringe axle
#

Hm...

sand condor
#

try catch

earnest phoenix
#

im rewriting my bots using discord.ts and its awesome..just a fyi

sand condor
#
try {
// code
} catch(error) {
// code 
}```
#

or use .catch

fringe axle
#

Still don't really understand how...

sand condor
#

the docs linked explains how

fringe axle
#

I know

earnest phoenix
#

throw a .catch(err) after then await

sand condor
#

the demo on site ```js
const array1 = [5, 12, 8, 130, 44];

const found = array1.find(element => element > 10);

console.log(found);
// expected output: 12

earnest phoenix
#

or

sand condor
#

in your case array1 is activities and the activities are activity objects

fringe axle
#

Oh

sand condor
#

they have the name property which is what your looking for

robust arrow
sudden geyser
#

It probably means your bot got temporarily banned.

robust arrow
#

it doesn't always mean that

#

but is there a solution for that?

sudden geyser
#

one way to test is to send a get request to https://discord.com/api/6/gateway/bot and see the headers

robust arrow
#

how do I do that?

sudden geyser
#

by sending a get request to the url and checking its headers

earnest phoenix
#

oof

robust arrow
#

like how do I send a request

#

sorry new

solemn latch
#

"It doesn't always mean that"
But it is kinda always a temp ban

sudden geyser
#

If you're in the CLI run curl -I https://discord.com/api/6/gateway/bot

robust arrow
#

I am looking for a solution not what it means

sudden geyser
#

you should know what it means

solemn latch
#

Wait till it ends

earnest phoenix
#

your solution is to sit and wait

robust arrow
#

yes and then it rate limits me again

#

when the zombie connection comes up

solemn latch
#

What causes the ratelimit isnt always the easiest afaik.

#

Easiest to find*

robust arrow
#

I understand

thick gull
#

please Iโ€™m like 2 IQ but my console spans with missing permissions how do I stop this๐Ÿ˜ฉ

#

all it does is delete the occasional message or two

#

thatโ€™s it

slender thistle
#

The bot's or user's message

thick gull
#

user

slender thistle
#

No MANAGE_PERMISSIONS permission

solemn latch
#

I've seen people make loggers, that log every request(to discord) to track down ratelimits.

robust arrow
#

this is everything it logs for me

client.on('rateLimit', (...args) => console.log('rateLimit', ...args));
client.on('debug', console.log);
solemn latch
#

That only logs things after hitting the ratelimit iirc

robust arrow
#

nice

solemn latch
#

Not what caused the original one

robust arrow
#

so what logs the cause of the original one

solemn latch
#

Nothing.
Since its not simple to do that.

robust arrow
#

oh well today's my lucky day

thick gull
#

No MANAGE_PERMISSIONS permission
@slender thistle is it possible to just not delete messages / catch the error without logging it every time

#

cause my bot doesnโ€™t have any other functions really itโ€™s just random shit without a main purpose

slender thistle
#

Overall logic is if channel.permissionsFor(guild.me).manage_messages {message.delete()} else {}

#

or even scrap the else

thick gull
#

is it possible to do that without having it everywhere I delete messages

slender thistle
#

Don't think so

thick gull
#

well

#

hm

slender thistle
#

Unless you change it in the library's code

thick gull
#

well thanks anyways then

robust arrow
#

I have a commands folder, I redirected the fs filesync to another folder which has only one js file, and now it doesn't ratelimit me. I think I narrowed it down to one reason why it is ratelimiting me

#

this is an update for my ratelimit problem

#

ok nvm not one reason

drifting wedge
#

Anyone can help me do prefixes with mongodb? Using py

sudden geyser
#

[Swift] Is it possible to have a KeyPath that can point to two different paths? I'm trying to supply an id parameter to a function (ForEach), but due to the way some generated code was made (using GraphQL + Apollo-iOS), it's split into two separate fields.

fierce arch
#

Yo you know the screen package you can get for ubuntu? sudo apt-get screen. How can I see what files are running on each screen so that I can locate the bot I want to terminate?

earnest phoenix
#

yo

#

me and my friend had doubts

#

right a command handler is not full of switch statements

#

there's only one

#

i mean cases

#

uhh yeah

#

they're for aliases

#

no its not

#

๐Ÿคฆโ€โ™‚๏ธ

#
case "command":
case "alias":
#

i literally just used if statements when i started off with my bot

#

thats a performance issue tho

#

how

#

i've been using that for over 6 months now

thick gull
#

I mean yeah it is a performance issue

earnest phoenix
#

since if someone does C-ACommandWhichNotExsist

thick gull
#

but people do it the way they want

earnest phoenix
#

it loops thrguh every 30 commands

#

in the switch

thick gull
#

code is pretty capable

#

Iโ€™m sure heโ€™s fine with the way heโ€™s got it already

earnest phoenix
#

wha-

thick gull
#

@sinful belfry

earnest phoenix
#

f i wanted to ping a mod

#

switches only gives a little performance benefit

sinful belfry
#

@cold sundial don't send that here please

earnest phoenix
#

or a huge

#

depends

#

but on message.content not too much but its worth it

#

yeah

#

but command handler is alot better

#

god stop

sinful belfry
#

next time you'll be banned

earnest phoenix
#

sorry can't fix something you did purposely

#

but command handler is alot better
@earnest phoenix please explain what you mean by a command handler i don't get you

thick gull
#

He means separate files

earnest phoenix
#

ye

thick gull
#

command.execute etc

earnest phoenix
#

that's what i do

thick gull
#

but like why

earnest phoenix
#

but smoler

thick gull
#

why force it on someone

earnest phoenix
#

no listen his my co worker

thick gull
#

oh ok

earnest phoenix
#

and im trying to fix this perfrmance issue

#

but he doesnt get it

thick gull
#

ban

#

next time you'll be banned

#

L

earnest phoenix
#

no listen his my co worker
@earnest phoenix did you just literally throw a reversal card on me you're my co worker lmao reverse

#

lmao

#

your my co worker
im your co worker

#

but he doesnt get it
@earnest phoenix same

#

you don't get what i'm saying i don't get what you're saying

#

see i catagorized it

#

still works

thick gull
#

finally someone who does that too

earnest phoenix
#

i don't mean folders

#

i meant a single file for each category of commands

#

listen

#

and every command is a method of the exports object

#

but its alot more easy on the performance

#

so i can just do const ImageComands = require("./commands/image.js");

thick gull
#

why

#

๐Ÿ˜ฉ

earnest phoenix
#

and do ImageCommands.gay(message);

#

maybe i am just crazy

#

yes

delicate shore
#

I am making a mass dm bot

thick gull
#

no

#

why

digital ibex
#

good for u

delicate shore
#

Only for my server for important announcements

thick gull
#

oh ok

earnest phoenix
thick gull
#

but no

earnest phoenix
#

dont do this

#

I am making a mass dm bot
@delicate shore whytho ytho

thick gull
#

discord api

earnest phoenix
#

aboose

thick gull
digital ibex
delicate shore
#
const members = message.guild.members.filter(m => !m.user.bot).array(); // Filter out bots.

let undelivered = 0;

for (let i = 0; i < members.length; i++) {
  const member = members[i];
   member.send('Hello there.')
    .catch(() => undelivered++);
}

message.channel.send(Messages sent. ${undelivered} members couldn't receive it.)
  .catch(console.error);```

I tried this
earnest phoenix
#

dank villain, #memes-and-media pls
@digital ibex its still related to development

#

@delicate shore thanks for saying that you just increased the activity on this channel by saying you're making a mass dm bot lmao KEKW extremewiggle

digital ibex
#

its more shitposting than it is related to development

thick gull
#

mass DMs even to one server is api abuse

earnest phoenix
#

no im trying to say not use alot of ifs or cases for commands

#

verified bot dev

#

@delicate shore god you'll lose verified bot dev if you even JOKE about mass dm bots

misty sigil
#

@delicate shore is that a mass dm

#

not cool man

#

not cool.

thick gull
#

Yeah he wants to make for one server

delicate shore
#

mass DMs even to one server is api abuse
@thick gull the command
Only I will be able to use that
Only my server
rarely for important things

misty sigil
#

NOT

#

COOL

digital ibex
#

rateimit urself

thick gull
#

itโ€™s still api abuse

misty sigil
#

STILL NOT COOL

delicate shore
#

oh

digital ibex
#

no its not api abuse

earnest phoenix
#

bruh

thick gull
#

yes it is

sudden geyser
#

If you need to message everyone just use @everyone or something

earnest phoenix
#

yeah

thick gull
#

you can check #mod-logs bots get denied for it

misty sigil
#

If you need to message everyone just use @everyone or something
@sudden geyser ikr it isnt hard

digital ibex
#

if ur ratelimiting urself + library ratelimits, its nowhere near abuse

earnest phoenix
#

yeah but still

misty sigil
#

its still shitty thing to do

digital ibex
#

use a setTimeout and do it for like, a second and ur good

earnest phoenix
#

djs doesn't have preemptive ratelimits

#

but still

#

against TOS

digital ibex
#

mass dm?

misty sigil
#

ye

earnest phoenix
#

and it is the reason we have to pass a verification wall now

digital ibex
#

how do u expect a private bot, limited to a few servers, able to get verified?

misty sigil
#

mass dm stinky

thick gull
#

hes verified

earnest phoenix
#

yeah

thick gull
#

check pgamerx badges

earnest phoenix
#

the "black sheep" bot is public

misty sigil
#

like just use a fucking @everyone ping

#

๐Ÿ˜ฉ

delicate shore
#

I am talking about another bot

earnest phoenix
#

why the hell would he stay in DBL for a private bot

delicate shore
#

which i ill create

misty sigil
#

STILL

thick gull
#

itโ€™s still an issue

misty sigil
#

mass dm is shit

#

mass dm is bad

delicate shore
#

PRIVATE Bot

digital ibex
#

Only for my server for important announcements

earnest phoenix
#

@delicate shore stop

misty sigil
#

STILL FUCKING BAD

earnest phoenix
thick gull
#

itโ€™s like you have two houses, one has a basement full of kids, the police can still search the other house

#

๐Ÿ˜ฉ

delicate shore
#

ok fuc it i will delete my server b making a mass ban thing

digital ibex
#

@delicate shore they r talking shit

misty sigil
#

JUST USE A @everyone ๐Ÿ˜ฉ

thick gull
#

๐Ÿ˜ฉ

sudden geyser
#

this convo is a lot more extreme than it needs to be

digital ibex
#

ikr

misty sigil
#

mass dms are bad ok?

delicate shore
#

@delicate shore they r talking shit
@digital ibex but now i am scared

#

so i will not do it

misty sigil
#

nobody likes receiving mass dms

thick gull
#

<3

#

crown up chin your king is falling

misty sigil
#

i dont have @earnest phoenix dm everyone in my support server for updates

digital ibex
#

how do you get hit a ratelimit or whatever u wanna call it? i dont think u guys here understand how it works

misty sigil
#

i just use @everyone

thick gull
#

yeah i dm all 50K users on my bot when thereโ€™s updates

misty sigil
digital ibex
#

do what u want

#

why isnt dyno banned?

thick gull
#

they make special cases

misty sigil
#

why would dyno be banned?

digital ibex
#

yes

thick gull
#

not everything is the same

#

dyno is one of the top bots

digital ibex
#

dyno has a role all command

thick gull
#

okay?

misty sigil
#

dyno has elevated ratelimits

thick gull
#

^

earnest phoenix
#

dude

thick gull
#

discord makes special cases, not for private server bots though

#

makes 0 sense

earnest phoenix
#

PLEASE STOP MASS DM BOTS

delicate shore
#

Ok i am gonna tell you truth
Someone said he will give me 5$ for making a mass dm bot for his own server

sudden geyser
#

Dyno handles its rate limits a bit differently though.

digital ibex
#

yes, that still doesnโ€™t give them the right to abuse their api

thick gull
#

uh

misty sigil
#

mass dm stinkier than xig

delicate shore
#

Ok i am gonna tell you truth
Someone said he will give me 5$ for making a mass dm bot for his own server
@delicate shore but i refused him now

digital ibex
#

ik, thats what im trying to say. but no one here has any clue about what theyโ€™re talking about

thick gull
#

morals over money

#

pog

earnest phoenix
#

Ok i am gonna tell you truth
Someone said he will give me 5$ for making a mass dm bot for his own server
@delicate shore getting 5$ and getting your bot BLAK SHIP verified only to get banned from discord?

thick gull
#

blak ship

delicate shore
#

star

earnest phoenix
#

wrong one it was

delicate shore
misty sigil
#

how do ratelimits work?
@digital ibex by make too much requests you get ratelimited

earnest phoenix
#

yeah

#

ask Telk

#

she's got her own API with rate limits

digital ibex
#

what r the actual limits though?

earnest phoenix
#

there aren't "actual" limits

delicate shore
#

Stop staring bru

earnest phoenix
#

you follow whatever is returned in the request headers

#

two dumbass posts on #starboard back to back from the same guy

digital ibex
#

the ratelimits for discord

delicate shore
earnest phoenix
#

yes

sudden geyser
#

Shouldn't it be possible to not hit 429s based on the headers

thick gull
#

@lament meteor rate limit explain

digital ibex
#

i saw it on the docs, im talking about

earnest phoenix
#

just

#

don't

#

make

#

a

digital ibex
#

mass dm isnt api abuse unless u handle it correctly

earnest phoenix
#

mass dm bot

thick gull
#

insert b1nzy saying no doing z every y

lament meteor
#

what rate limit @thick gull ?

earnest phoenix
#

Shouldn't it be possible to not hit 429s based on the headers
@sudden geyser some libraries do that, some don't

some stop you after you get a 429 and some know when you're going to hit a ratelimit and just block the request until the ratelimit expires

thick gull
#

heโ€™s asking how rate limits work

delicate shore
#

i refused him but he said this

thick gull
#

explain to him

earnest phoenix
delicate shore
thick gull
#

you have a brain

earnest phoenix
#

WHY MAKE MASS DM BOTS ANYWAYS

digital ibex
#

ik how ratelimits work lmao

misty sigil
#

just tell him to fuck off

#

lmao

lament meteor
#

so ratelimits is basically how many requests you can do in a certain period of time

thick gull
#

then why did you ask

#

how it works

digital ibex
#

because ur making no sense

delicate shore
#

Ok can we stop now

earnest phoenix
#

mass dming is api abuse because it is opt-out and not opt-in, the user didn't do anything and they got dm'd. check pins

lament meteor
#

so what do u need help with?

sudden geyser
#

Why don't libraries just go with the path of not hitting 429s by looking up its headers beforehand

earnest phoenix
#

Ok can we stop now
@delicate shore not like we told you a 100 times

digital ibex
#

u saying making a mass dm bot is api abuse, what if the server had 2 members?

misty sigil
#

thank you cry

delicate shore
#

i said him no sorry

#

he said $7/week

misty sigil
#

ok i'll do it trol

quartz kindle
#

@sudden geyser they do?

digital ibex
#

im gonna go eat now my hed hert

lament meteor
#

@digital ibex any server more than 5 members is probs api abuse

sudden geyser
#

I don't think Dsicord.js does for example

thick gull
#

Iโ€™ll do it for 20$ a week

quartz kindle
#

they do

misty sigil
#

it may not be api abuse

digital ibex
#

๐Ÿ—ฟ

misty sigil
#

but doesn't it have to be opt-in

thick gull
#

Just add a 1 week gap between every DM

earnest phoenix
#

u saying making a mass dm bot is api abuse, what if the server had 2 members?
@digital ibex just like how offline bots are declined regardless of the reason DISCORD ๐Ÿ‘ API ๐Ÿ‘ ABUSE ๐Ÿ‘ IS ๐Ÿ‘ API ๐Ÿ‘ ABUSE

digital ibex
#

im keep on going in circles here

thick gull
delicate shore
#

Hey Money doesn't matter I have worked hard on my bot and I cannot even take a single chance I am sorry :(
I said this

earnest phoenix
thick gull
#

just say fuck off

#

:)

misty sigil
#

that's me

earnest phoenix
#

not to pgamerx

#

i'm saying that to OfficiallyLost

delicate shore
thick gull
#

Matthew mind making me a bot to ban all users in every server

delicate shore
#

I am gonna sleep good night

earnest phoenix
#

k

thick gull
#

Goodnight

misty sigil
#

yea sure but for $69,420 per person banned

earnest phoenix
#

do not make mass dm bots

thick gull
#

bet

solemn latch
#

Let's hope it gets approved here, with admin perms

earnest phoenix
#

tf

delicate shore
earnest phoenix
#

HOW DID YOU SEND A MESSAGE ABOVE ME

thick gull
#

some kid was harassing me for not having a reaction help menu

earnest phoenix
#

@solemn latch please explain your wizardy powers

thick gull
solemn latch
#

Magic

#

Reaction help menus suck

#

Imo

earnest phoenix
#

no

thick gull
#

I agree

earnest phoenix
#

tip.cc reacction helpmenu is OP

thick gull
#

anything reaction based I absolutely hate

#

Not all users have reactions in

#

on

earnest phoenix
#

anything reaction based I absolutely hate
@thick gull Zira bot: angeryBOYE i have reaction roles as the primary feature

#

Not all users have reactions on
@thick gull that is just admins being potatoes

cinder patio
#

If the bot reacts to the message with the reactions, then everyone can react to it

thick gull
#

yea but I still donโ€™t like it

earnest phoenix
#

If the bot reacts to the message with the reactions, then everyone can react to it
@cinder patio not necessarily

#

oauth authorize urls can specify perms

solemn latch
#

Blind people(yes they do use discord) often cannot react at all.

#

๐Ÿคทโ€โ™‚๏ธ

earnest phoenix
#

unless the bot adder disables

cinder patio
#

No, there's a role permission which stops users from reacting

earnest phoenix
#

Blind people(yes they do use discord) often cannot react at all.
@solemn latch they do react (not with emojis) like WHY DOES THE BOT HAVE A REACTION HELP MENU

delicate shore
earnest phoenix
#

yeah

#

wut

misty sigil
#

how did they invite the bot

#

if they're blind

solemn latch
#

Easily

#

Blind people use computers all the time ๐Ÿค”

#

Discords a wonderful chat program for the blind and visually impaired.

earnest phoenix
#

Blind people use computers all the time ๐Ÿค”
@solemn latch why the thinking emoji

solemn latch
#

Always the thinking emoji

#

My cousin is blind, some of the choices I've taken with my bot is in mind of blind folk, which is why generally it sends new messages rather than editing in a lot of cases, so the tts can read it automatically

sudden geyser
earnest phoenix
#

My cousin is blind, some of the choices I've taken with my bot is in mind of blind folk, which is why generally it sends new messages rather than editing in a lot of cases, so the tts can read it automatically
@solemn latch you deserve ||stuff|| good boi

dreamy thistle
#

anyone knows how to use node-cron and wanna help me with some simple stuff?

earnest phoenix
#

i havent used it but it looks very simple

#

if you need help

gentle wolf
#

i've been trying to rewrite a bot i wrote two years ago, but every time i try to run the very simple code all i get is a super long error message i can't figure out
can i DM it to someone who thinks they might be able to help? i use python btw

earnest phoenix
#

<--

#

ill look

fickle sapphire
#

You say 2 years ago.. so maybe the discord.js version doesnโ€™t match what youre writing

misty sigil
#

i use python btw

charred geyser
#

can anyone help me with Oauth2 stuff?

earnest phoenix
#

i have about 40 min if anyone else needs help....if thats ok im not official or anything

charred geyser
misty sigil
#

you need to add the redir uri to the list

charred geyser
#

so pretty much

#

i was testing with localhost

#

and it worked fine

#

and now i uploaded to heroku to test with a domain

#

so i updated the config acordingly

earnest phoenix
#

did you change uri from localhost to new route

charred geyser
#

and i just cannot get it to work

#

yea

#

so my understanding is that heroku asigns a port automatically

#

to the .env

thick gull
#

link a domain to heroku

earnest phoenix
#

oh yea....i delt with that before with express server ports

thick gull
#

and use that

#

maybe

#

idk

earnest phoenix
#

i cant remember fix though....

charred geyser
#

its ok tho cause i can just set the url as url process.env.PORT /callback

#

but

#

that doesn't seem to work

#

i made it log the end url in console and it seems fine

earnest phoenix
#

or possibly

charred geyser
#

i cant see anything wrong with it

earnest phoenix
#

was app sleeping

charred geyser
#

no

#

the console logs

#

and the port changes every time i start

#

becuase thts just hpw heroku does things

#

but idk why its not working

#

cause the same thing worked fine on localhost

misty sigil
#

heroku

#

hosts on

#

a port internally

#

but its 80 or something on the outside

earnest phoenix
#

maybe process.env.PORT || 80

misty sigil
charred geyser
#

on stack overflow it said

#

5000

#

i will try 80

#

im mad cause i finally managed to set up a proper bot dashboard for my bot

#

with login and shit

#

and then as soon as i test not on localhost

#

it goes ๐Ÿ˜”

#
2020-09-05T17:22:17.012906+00:00 app[web.1]: Bot is ready. (8 Guilds - 117 Channels - 267 Users)
2020-09-05T17:22:17.020386+00:00 app[web.1]: Dashboard is up and running on port 80.
earnest phoenix
#

so in your url ... https://name.herokuapp.com:${process.env.PORT}/callback doesnt work

charred geyser
#

callbackURL: https://unnamed-dashboard.herokuapp.com${config.port == 80 ? "" : :${config.port}}/callback,

#

and then config.port is process.env.PORT

earnest phoenix
#

that link is bad

charred geyser
#

but with that change it logs a new port

earnest phoenix
#

try mine once

charred geyser
#
2020-09-05T17:25:54.049019+00:00 app[web.1]: Bot is ready. (8 Guilds - 117 Channels - 267 Users)
2020-09-05T17:25:54.055829+00:00 app[web.1]: Dashboard is up and running on port 35208.
#

ok im trying yours

#
2020-09-05T17:28:43.173624+00:00 app[web.1]: Bot is ready. (8 Guilds - 117 Channels - 267 Users)
2020-09-05T17:28:43.181116+00:00 app[web.1]: Dashboard is up and running on port 3136.
earnest phoenix
#

any err in browser

charred geyser
#

oh wait i made a mistake

#

one sec

earnest phoenix
#

did you make the background graphics?

charred geyser
#

no thats the discord thing

#

when it redirects to the Oauth2 page

earnest phoenix
#

lol nice

charred geyser
#

still doesn't work

#

uhhhh

#

the format

#

is

earnest phoenix
#

worked?

charred geyser
earnest phoenix
#

no browse err?

#

browser

charred geyser
#

it didn't

#

work

#

no

#

WHY

#

it litterally works on localhost

#

with a specific port

#

all it needs to do is get the heroku port and add it to the url

earnest phoenix
#

whats dev tools console say in browser

#

when you fail

charred geyser
earnest phoenix
#

can someone be a babe and list the pro's and con's for a database that stores per guild settings in their own json file?
For example,
A bot joins a guild, a new GUILD_ID.json is created with their own settings.

Is dat bad or good?
Doesn't matter about storage btw

#

sounds like a pain...id use a db

#

nah, i'd say it's easier to manage

#

ok

acoustic bridge
#
@client.command()
async def suggest(ctx, member: discord.Member):
    try:
        channel = client.get_channel(741284150970941522)
        member = ctx.message.author

        embed = discord.Embed(
        title = "Suggested by:",
        description = f'{member}',
        color= discord.Colour.blue()
        )

        embed.set_thumbnail(url=ctx.message.author.avatar_url)
        embed.add_field(name="Suggestion:", value=str(ctx.message.content), inline=False)
        await channel.send(embed=embed)
    except Exception as e:
        await ctx.send(e)

I have this code for "suggestions". It worked before, when my bot runned via my PC. But when i host the bot on heroku it doesnt. any reasons?

charred geyser
#

does the rest of the bot function when you host it on heroku?

trim lark
#

is there an error message?

charred geyser
#

^^

acoustic bridge
#

it does,

charred geyser
#

mmm

acoustic bridge
#

about errors - i dont know where to look up

charred geyser
#

what does console say

acoustic bridge
#

if there are any

charred geyser
#

click view logs

acoustic bridge
#

logs is empty after "login"

#

as i said. it worked before when i run the bot on my pc via cmd/terminal

#

the code itself didn't change

charred geyser
#

edit your command so that it llogs a message in console every time the command is run

acoustic bridge
#

yes i changed it - i had an command error respond to let it say something else

charred geyser
#

so the command is just not registering at all?

acoustic bridge
earnest phoenix
#

so whats your dashboard gonna do/show @charred geyser

acoustic bridge
#

Something not found ?

charred geyser
#

@earnest phoenix it lets you login and edit settings about guilds you have perms on

pure lion
#

What's going on here?

charred geyser
#

so far all i have added is like

#

prefix and welcome channel

delicate shore
#

I use Galaxy Gate for hosting

pure lion
#

@acoustic bridge what's the issue?

delicate shore
#

But find out this

#

This is also amazing

charred geyser
#

woa

pure lion
trim lark
#

@acoustic bridge thats because you didnt specify a member when u ran the command

restive furnace
#

@delicate shore what's that host

acoustic bridge
#

@pure lion i posted a code above of a "suggestion" command. although on heroku it now says "Member "Testing" not found

trim lark
#

ideally that should send an error message to the user

delicate shore
#

Should I drop link here ?

restive furnace
pure lion
#

Okay number one; don't use heroku

trim lark
#

theres no member in the guild u tested called 'Testing' so it wont work

restive furnace
#

Should I drop link here ?
ur choice

pure lion
#

Number two, @restive furnace, dis bad