#development

1 messages · Page 678 of 1

quartz kindle
#

well, you need to stop the interval

pine aspen
#

Yes.

#

Shouldn’t it tho

#

If(!util.uptime() >= 30) {
Blah
}
{else
Blah
}

#

@quartz kindle tbh should stop it

quartz kindle
#

that doesnt stop it

#

look at the code flow

#

the ready event fires only once

#

once the ready event fires, your code proceeds, until it reaches the if

#

at that point, if the uptime is bigger than 30, it fires one of the intervals, else, it fires the other interval

#

then the interval proceeds to run forever

#

the code never goes back to the if

#

and intervals always run forever unless you stop them

#

also, checking for the uptime is redundant, because the ready event only fires once the bot is fully booted

earnest phoenix
hollow saddle
#

@dapper glade how? If you use split options, the message will automatically split with a new line or a custom character if specified if it’s over 6000 characters

#

Unless you’re having the problem with embeds, there’s no split options for an embed

quartz kindle
#

@abstract crow is the error during ejs processing or after? if its after, then it would show in the browser console, not in the server

dapper glade
#

Oh I’m using embeds.

quartz kindle
#

embed fields have a max of 1024 chars each if im not mistaken

#

and embed description should be 2048

abstract crow
#

@quartz kindle How do I tell? I can't even load the page as it just hangs with the error

#

Sentry detects it though

#

Like if I go through my sentry account I can most of the time see the error but no one wants to do that.

#

I get nothing on the website console

quartz kindle
#

are you using express?

#

you can try using the express error handler, or you can test a try/catch block in some places to see if they do anything

dapper glade
#

@hollow saddle Thank you

pine aspen
#

@quartz kindle yeah. I want it to go to the else

#

So the flow is perfect it just isn’t working

quartz kindle
#

@pine aspen thats not how it works, i told you the way it works

#

so you have to change your code to make it work

#

a ready event will always fire only once, so an if statement inside a ready event will also only run once, so one of the options inside the if will always run, and the other will never run

pine aspen
#

K

earnest phoenix
#

Help me please

cursive dagger
#

Just dont spam your long description with nonsense

earnest phoenix
#

Yes except that the first time I put it at 15:51 he answered at 16:41 and I put it at 17:45 he still not answered 😭 @cursive dagger

cursive dagger
#

Just wait

slender thistle
#

ily faq 2

covert turtleBOT
#
Frequently Asked Questions 📜

Click the link to get more information on the question:
2) How long is approval?

slender thistle
#

And why are you sending this in 2 channels

lusty dew
#

How could I get info on a user/change their nick with their username

#

Also a mod may want to change my name so it’s easier to read/ping

earnest phoenix
#

i n
w h i c h
l i b r a r y

lusty dew
#

D.js

hushed quarry
#

have you checked the documentation

lusty dew
#

I know how to change their name

#

Just not with their username

hushed quarry
#

what's your code so far

#

wait, username

#

you can't change their username

lusty dew
#

No...

#

I mean change the nickname using their username

hushed quarry
#

username can only be changed by them

#

oh

lusty dew
#

Or whatever

hushed quarry
#

what's your code

lusty dew
#

I know some bots do it idk if they use username or current nickname in the server

quartz kindle
#

you can access their username, and then use it to change their nickname

hushed quarry
#

what's your code

lusty dew
#

Ye

#
message.mentions.members.first() || message.guild.members.fetch(input)
hushed quarry
#

and what's the stacktrace

quartz kindle
#

take a look at the docs, specifically guildmember and user

#

users have usernames, guildmembers have nicknames

#

they are two different things

lusty dew
#

Ah okay

#

So use users instead?

quartz kindle
#

both can be accessed from the message

#

message.author / message.member

tight heath
#

msg.author: User#username

#

msg.member: GuildMember#nickname

#

or

#

msg.member: GuildMember.user#username

#

¯_(ツ)_/¯

lusty dew
#

Okay thanks

earnest phoenix
#

error404 module not found please try again later xD

onyx summit
#

error 500 internal brain error please try again later

mossy fjord
#

Can some people look at my code and tell me if its efficient or not?

tight heath
#

if you pay me

mossy fjord
#

no u

lusty dew
#

@tight heath I’ll pay you Kermit the frog nudes for you to look at my code

tight heath
#

prepaid tho

#

gotta know if theyre quality

unique nimbus
#

@tight heath I will give you nothing but happiness if you give me a compliment

#

thats a good deal

tight heath
#

you're a cool person

unique nimbus
#

thats pretty ok

tight heath
#

:)

unique nimbus
#

c:

tight heath
#

gottem

unique nimbus
#

I cri

mossy fjord
tight heath
#

pls no ads also

#

and o boi for reading eris you gotta pay a lot

unique nimbus
#

@tight heath I wanna read you for free

tight heath
#

oh

#

you can read my eslint config

unique nimbus
#

you can make your bot dm me all the errors when it happens

#

hell yes

tight heath
#

@mossy fjord have you ever used a .gitgnore

mossy fjord
#

yeah I through that together real quick thougj

tight heath
#

so you're asking for a QA review

#

but also

#

"I through that together real quick"

#

that totally makes sense

mossy fjord
#

i mean removed all that credentials shit

fading wigeon
#

i should check my 100% self made bot

#

hmmm

tight heath
#

@unique nimbus I should make a bot that runs your code through a randomly picked eslint config

#

and sends you a dm on every error or warning

mossy fjord
#

@tight heath do you not like eris?

unique nimbus
#

You should just add me as 2nd owner and friends privilege smh

tight heath
#

i do not like eris indeed

#

i would add you to the team but that'd require me actually coding that bot

#

instead of goodboy aero

unique nimbus
#

lmao

mossy fjord
#

i use eris cause discord.js is heavy asf

tight heath
#

yes eris is not heavy

#

it doesn't at all still contain selfbot classes

#

anyways

#

i think imma add a lint command

#

which just runs against my eslint config

mossy fjord
#

you don't use eris I thought.

tight heath
#

yes that is infact the reason I don't

#

but yeah that command could be useful

#

maybe for beginners think_bold

mossy fjord
#

see anything else wrong with my code though?

tight heath
#

and in remembrence of RFJ I'll add a gitignore generator

#

@mossy fjord npm i -g eslint nekiono/eslint-config-raven

#

run it against my eslint config

#

:p

unique nimbus
#

lmao

tight heath
#

that way i dont have to read it

#

i can tell you the first error except indents:

#

global-require

mossy fjord
#

that it?

tight heath
#

can be concatenated

#

and for the other errors you gotta pay me

#

tyvm

#

because why would I do a code review for you

#

if there's people working in QA

#

which get paid 5 grand per month to do just that

mossy fjord
#

QA?

unique nimbus
#

@tight heath Pay me 5 bucks and I pay you 4.99 bucks

tight heath
#

Quality Assurance

mossy fjord
#

what tf is qa?

tight heath
#

and bad deal

mossy fjord
#

where can I get a code review for free lmao?6

tight heath
#

nowhere cuz that's not how life works

pale glen
#

🤣

tight heath
#

why would anyone voluntarily look at your scrambled egg code without anything in return

pale glen
#

why do you need a code review

tight heath
#

like that's the worst possible time investment

#

Invest: 1h
ROI: nothing

pale glen
#

just write tests if you need it that badly

tight heath
#

or like

#

use eslint

pale glen
#

im sure hes looking for more than just synthax and tabs vs spaces review

tight heath
#

optimally my config cuz it's the one and only best

#

i mean his syntax is suboptimal so might wanna start there

pale glen
#

which is never gonna happen for free

tight heath
#

¯_(ツ)_/¯

pale glen
#

how u know?

tight heath
#

i looked through

#

le code

#

lol

pale glen
#

ahh

tight heath
#

either way

#

for an actual QA analysis you gotta pay

#

lol

pale glen
#

meh 404

tight heath
#

ye he made it private

#

after getting bashed here

pale glen
#

lmfao

tight heath
#

anyways

pale glen
#

why bashed

#

was it that bad

tight heath
#

for actual QA

pale glen
#

yikes

tight heath
#

either pay

#

or enslave someone

#

for aero.bot, I have stitch@aero.bot

#

like aero is the most dope project for me

#

neither do i code

#

because rxsto does most

#

nor do I QA

#

I'm currently just paying the bills and doing PR

#

even though I could code

pale glen
#

🤔

mossy fjord
#

I need to move to typescript anyway

onyx summit
#

Typescript good

mossy fjord
#

Why should I switch though?

onyx summit
#

If your project is complex and has many classes it's worth it

mossy fjord
#

does it make faster and easier to scale.

#

I wanna move to a class bases project

onyx summit
#

It doesn't bring much performance improvements, it's typescript, not fastafscript

#

But it makes everything more structured, shorter, and easier to maintain

mossy fjord
#

would it help when moving to a class based setup.

onyx summit
#

Not gonna explain the concept of object oriented programming hmmm

#

JavaScript is pretty limited in things like that

earnest phoenix
#

oop langs 👅

midnight vine
#

how can I delete more than just one message on python ?

earnest phoenix
#

How i can delete 1 word :/

#

on quick.db

#

i pushed blacklisted words

#

Alright I got my soundboard working, what other cool features do your bots have I can try and code?

#

@GoLdEnDrAg#1979 bulkDelete

earnest phoenix
#

i want to remove T3DY throw a command if is posible

    "T3DY": {
        "bot_name": "eu",
        "commands": "dau",
        "status": "salut"
    },
    "ѕcη HitMan 240fps": {
        "bot_name": "sa",
        "commands": "imi",
        "status": "bag"
    }
}```
#

It's a json

#

Command like => .done name invite_link

stark obsidian
#

hi

honest karma
#

Pardon me if this is a dumb question but is it suggested if I use a database if I want to make an economy system? I'm unsure where to start and would like a few resources.

unique nimbus
#

You should use a database

#

You could use for example SQL, SQLITE, MongoDB etc

#

I don't recommend JSON as it can corrupt

honest karma
#

mongodb seems a lot more comfortable for me

#

I was kind of nervous asking because I don't want to seem like I'm asking for too much

unique nimbus
#

There should be tutorials for it online

earnest phoenix
#

bulkDelete is alright but it doesn't give you the ability to delete messages only from certain types of users, so say you want to delete newmember messages but want to leave moderator and trusted mesages it's not a good command to use, it literally deletes everything

unique nimbus
#

¯_(ツ)_/¯

broken shale
#

that's why you filter it out first

#

then you delete

honest karma
#

thank you for the suggestion tho

unique nimbus
#

np

south lantern
#

I need help how to fix this?

earnest phoenix
#

bruh

#

you maybe wanna show the code where "browser" is called

twilit rapids
#

You're calling browser on something that doesn't exist or is already undefined

stark obsidian
#

tf??

twilit rapids
#

@stark obsidian what?

stark obsidian
#

nvm

#

@twilit rapids nonthing

south lantern
#

and what about this error?

west spoke
#

can you not read lol

south lantern
#

I have solved it, thanks.

lusty dew
#

But it says they have successfully changed my name

twilit rapids
#

on what are you calling setNickname

lusty dew
#

nMember.setNickname

twilit rapids
#

what is nMember defined as

lusty dew
#

let nMember = message.mentions.members.first() || message.guild.members.find(member => member.user.username === input)

#

That’s not the problem here

#

I can tell you that

#

Cause I’m able to change their nicknames

twilit rapids
#

do you know what the error means

lusty dew
#

But when a member of my server tries to change mine

#

Yes it’s invalid perms

twilit rapids
#

no

lusty dew
#

Yea?

twilit rapids
#

You're calling setNickname on something that doesn't exist or is undefined

lusty dew
#

Bruh

#

So you’re saying I don’t exist

twilit rapids
#

You exist, but you're doing something wrong im your code

#

in*

lusty dew
#

How so

twilit rapids
#

what is input defined as

#

in the code snippet you send

lusty dew
#

args[1]

#
      let nickname = args[1]
      let nMember = message.mentions.members.first() || message.guild.members.find(member => member.user.username === input)
      if(!nickname){
        message.reply('You need to give me a nickname to name this user')
      }
      if(!message.member.hasPermission('MANAGE_NICKNAMES'){
        message.channel.send('You do not have the proper perms')
      }
      nMember.setNickname(nickname)
#

I don’t think I’m doing anything wrong

viral spade
#

When i put my bot into a docker, am i correct that i have to let docker start pm2, let pm2 start shardmanager, let shardmanager start bots?

twilit rapids
#

You're not defining input in that code snippet

lusty dew
#

I forgot to add it

#

But it’s defined

#

Input is defined as args[0] btw my bad

#

I’m telling you it’s not that

#

The error states permission problems

twilit rapids
#

the hastebin you send is your error right

lusty dew
#

Yes

#

There is two things

#

One of em doesn’t make sense it doesn’t error when I change nicknames

#

And the other is missing permissions

twilit rapids
#

are you trying to change your own nickname with the bot

#

as server owner

lusty dew
#

Only error I’m getting now is missing permissions

#

I told you...

twilit rapids
#

nobody can change the server owner nickname

lusty dew
#

Ik

#

I’m trying to add a check for that though

#

So it will stop erroring

earnest phoenix
#

if the bot is under the persons name you are trying to change it will throw that error as well

lusty dew
#

The bot is at the Top

earnest phoenix
#

does your bot have the correct perms in the server?

lusty dew
#

Yes.

earnest phoenix
#

does it have admin perms?

lusty dew
#

Yes.

earnest phoenix
#

Im not sure then.. those are the only things I can think of that would stop you from doing this

lusty dew
#

User doesn’t have perms mmLol

earnest phoenix
#

unless the || statement is interfering somehow

lusty dew
#

Like he said member can’t change server owner nickname

#

That’s what I’m trying to add a check for

#

So it won’t send 403 errors

earnest phoenix
#

then you would check it by your ID

lusty dew
#

.

earnest phoenix
#

so you want it to only be you that does it right? or the server owner?

lusty dew
#

It’s a global bot

#

So ofc not just me

earnest phoenix
#

if(message.author.hasPermissions("PERMISSION_TAG"){ YOUR CODE HERE }

This what you are looking for?

lusty dew
#

Already have that

#

It isn’t working

earnest phoenix
#

no you are doing message.member

split hazel
#

I'm confused. So I'm using kurasuta to shard my bot into clusters.
So i set my cluster count to 2 (2 shards per cluster) and then evaled client.shard.broadcastEval("this.ws.ping") But it only returned results from the current cluster the shard was on

#

and in the docs it says broadcastEval will contact all clusters

lusty dew
#

@earnest phoenix that’s not a thing

earnest phoenix
#

whats not a thing?

lusty dew
#

Users don’t have a permission object

#

Message.author is a user collection

#

Users don’t have permissions

#

Members do

amber fractal
#

It's not a collection MegaThonk it's just a User, hi. Im here to make your day hard. :+1:

lusty dew
#

Sorry

#

I forget what to call em

earnest phoenix
#

lol

#

let me look at my code because I believe I use the tag I suggested

amber fractal
#

If you use that tag it wont work

#

Users dont have a hasPermission method

#

Because, well, theu dont have permissions

#

GuildMembers do.

lusty dew
#

All I’m trying to do is prevent a missing permission error

#

Smh

earnest phoenix
#

oof

#

it is message.member not members

#

you are right.. sorry I have a lot of code

#

if (!message.member.hasPermission("ADMINISTRATOR"))

#

there you could use that then

lusty dew
#

I already had that

#

Didn’t work

earnest phoenix
#

hmm sorry bud then I am not sure.. I was having missing perms problems as well just recently but it was something completely different

south lantern
#
if (!nMember) return
nMember.setNickname(nickname)```
lusty dew
#

Not what I’m trying to do

earnest phoenix
#

setNickname is the issue

lusty dew
#

Hm?

earnest phoenix
#

not you sorry I was talking to chakung

south lantern
#

try this

      let nickname = args[1]
      let nMember = message.mentions.members.first() || message.guild.members.find(member => member.user.username === input)
      if(!nickname){
        message.reply('You need to give me a nickname to name this user')
      }
      if(!message.member.hasPermission('MANAGE_NICKNAMES'){
        message.channel.send('You do not have the proper perms')
      }
      if (!nMember) return;
      nMember.setNickname(nickname)```
earnest phoenix
#

I saw you had an error for setNickname though in your hastebin

lusty dew
#

Yea that error no longer happens

gritty bolt
#

does anyone know how to define the lng and lat in this tree? (random location) I've tried doing variations of body.results.geometry.location.lat but it doesnt seem to work.

https://hastebin.com/ihijucamup.makefile

south lantern
#

body.results[0].geometry.location.lat

gritty bolt
#

thanks

#

had me stumped for almost half an hour

south lantern
#

You're welcome

gritty bolt
#

new error: Cannot read property '0' of undefined

#

i dont know why that wouldnt work though since its pulling from the tree

#

unless im not understanding right its finding it in the aaray

#

array

#

@south lantern

south lantern
#

show me all code

#

@gritty bolt

gritty bolt
#
    let longitude = body.results[0].geometry.location.lng```
#

returns that tree

#

or well the code above does

#

and im trying to pull the lat and lng from it

#

nevermind I got it

#

I just wasnt parsing it

#

🤦

south lantern
#
for (let result of body.results) {
let latitude = result.geometry.location.lat;
let longitude = result.geometry.location.lng;
console.log(latitude, longitude )
}```
#

@gritty bolt

earnest phoenix
#
{
    "T3DY": {
        "bot_name": "eu",
        "commands": "dau",
        "status": "salut"
    },
    "NAME2": {
        "bot_name": "sa",
        "commands": "imi",
        "status": "bag"
    },
    "NAME3": {
        "bot_name": "443214",
        "commands": "4566534",
        "status": "12dfsdf"
    }
}

i want to remove the name3 with a command , like .donebot @name3#1414 TEXT

#

I just want to remove the name i mention

#

what i wave now if(msg.content.startsWith(prefix + "donebot")) { msg.delete() const player = msg.mentions.members.first(); const args = msg.content.slice(prefix + "donebot").split(' '); const invite = args[2]; player.send(invite); delete all[player] fs.writeFile("./lol.json", JSON.stringify(all, null, 4), err=> { if(err) console.log(err); }) }

#

what would cause a DISCORDAPI ERROR Unknown Message?

south lantern
#

delete all[player.user.username]

#

@earnest phoenix

earnest phoenix
#

ok , i'll try it

south lantern
#

or maybe delete all[player.username]

viral spade
#

When i put my bot into a docker, am i correct that i have to let docker start pm2, let pm2 start shardmanager, let shardmanager start bots?

earnest phoenix
#

@south lantern it works with [player.user.username] so thx very very much

south lantern
#

👌

valid frigate
#

discord api error of unknown message means you're trying to operate on a message that doesn't exist/wasn't seen by your bot

earnest phoenix
#

ahh so something deleted then

#

thank you

valid frigate
#

yeah

earnest phoenix
#

@valid frigate do you know how I can prevent that from restarting my bot exactly?

valid frigate
#

i thought it was a promise rejection, it wont crash your bot

#

but

#

assuming you have a message handler, you can just use .catch after it to catch all errors

earnest phoenix
#

Its crashing it

valid frigate
#
messageHandler.dostuff(message).catch((e) => {
// all errors will be caught, you can handle them here
})
earnest phoenix
#

It a DM feature

valid frigate
#

que

#

the bot is only used in dms?

earnest phoenix
#

No its one of the features we have. I made a Pokemon bot and its a raid reminder for raid bosses

valid frigate
#

ah

#

if your bot is in js take a look at try/catch or promise catching

#

that's how you prevent your bot from crashing, since the only way it can is being thrown errors by djs/the node process itself

pine edge
#

I still have a problem on my command because if he has 0 gem he can sell and his -1 when he should not

case "s":
            // Content available in args[0]
            const test = [
                'money', 'gem', 'prayer',
                'gun', 'chains', 'leaves', 'nothing'
            ];
            // Return message if the user dont enter a item
            if (test == null || args.length == 0) return message.reply('You must specify an item to sell.');
            // If user have amount of this item (gem) 
            if (test.includes(args[0]) && parseInt(args[1]) > 0) {
                if (args[0] === test[1] && args[1] >= 1) {
                    let gemMoneyWon = 50; 
                    data[message.author.id].gem -= args[1]; 
                    data[message.author.id].money += gemMoneyWon * args[1];
                    message.channel.send(`[PNG]**Thanks** ${message.author.tag} **the gem can serve me to create beautiful thing!**`);
                    write();
                } else {
                   message.channel.send(`**Sorry** ${message.author.tag} **you havent this amount!**`);
                    console.log('nop')
                }      
            }       
            function write() {
                fs.writeFile('./data.json', JSON.stringify(data), function(err) {
                    if (err) console.log(err);
                });
            }
            break;
late hill
#

There's nothing in your code that checks the users current gem balance

#

That's the problem you're having

#

Other than that, it would be a great idea to use a database rather than a json file

#

Your test == null check is redundant as you're setting it right before

pine edge
#

For now I'm doing tests in the future I'm counting on using mysql

late hill
#

And you parseInt() in one of the checks but then remain to use the unparsed data

#

Which works in javascript but I wouldn't do that

#

You'd be better of storing the parsed int in a variable and then using that

pine edge
#

like js let parse = parseInt(args[1]);

late hill
#

Yes

#

And make sure you check if the value is an actual number

#

Actually the check you have will already do that

#

Any condition with NaN returns false afaik

pine edge
#

Ok so i can do

 if (args[0] === test[1] && args[1] >= 1 && data[message.author.id].gem >= 1) {
                    let gemMoneyWon = 50; 
                    data[message.author.id].gem -= args[1]; 
                    data[message.author.id].money += gemMoneyWon * args[1];
                    message.channel.send(`[PNG]**Thanks** ${message.author.tag} **the gem can serve me to create beautiful thing!**`);
                    write();
                }
late hill
#

Still isn't parsed

#

Combine it with your previous line of code

#

And use parse instead of args[1]

pine edge
#
case "s":
            // Content available in args[0]
            const test = [
                'money', 'gem', 'prayer',
                'gun', 'chains', 'leaves', 'nothing'
            ];
            // Return message if the user dont enter a item
            if (test == null || args.length == 0) return message.reply('You must specify an item to sell.');
            // If user have amount of this item (gem) 
            let parseAmount = parseInt(args[1]); 
            if (test.includes(args[0]) && parseAmount > 0 && data.[message.author.id].gem >= 1) {
                if (args[0] === test[1] && parseAmount >= 1) {
                    let gemMoneyWon = 50; 
                    data[message.author.id].gem -= parseAmount; 
                    data[message.author.id].money += gemMoneyWon * parseAmount;
                    message.channel.send(`[PNG]**Thanks** ${message.author.tag} **the gem can serve me to create beautiful thing!**`);
                    write();
                } else {
                   message.channel.send(`**Sorry** ${message.author.tag} **you havent this amount!**`);
                    console.log('nop')
                }      
            }       
            function write() {
                fs.writeFile('./data.json', JSON.stringify(data), function(err) {
                    if (err) console.log(err);
                });
            }
            break;
opaque eagle
#

Why do I need to implement my own iterator function when this.levels is an array?```js
import { Message, TextChannel } from "eris";
import { CustomClient, settings } from "..";

type LevelCheck = (msg: Message, client: CustomClient) => boolean;
export default class {

public levels: LevelCheck[] = [

    // LEVEL 0, BOT OWNER
    (msg, client) => msg.author.id === client.owner.id,
    
    // LEVEL 1, BOT STAFF
    (msg, client) => {

        const SUPPORT = client.guilds.get(settings.support.guild);
        if (!SUPPORT) return false;

        const member = SUPPORT.members.get(msg.author.id);
        if (!member) return false;

        return member.roles.includes(settings.support["staff-role"]);

    },
    
    // LEVEL 2, GUILD OWNER
    msg => msg.channel instanceof TextChannel && msg.author.id === msg.channel.guild.ownerID,
    
    // LEVEL X, ANYONE
    () => true,

];

checkLevel(message: Message): number {
    for (const [i, level] of this.levels) {
    
    }
}

}```

#

wait nvm

#

nvm the nvm

#

I made LevelCheck itself an array, still no luck... ts type LevelCheck = ((msg: Message, client: CustomClient) => boolean)[];

rustic scarab
#

Why i can't join in lithium server

stray garnet
#

how to make something like that u only can run an command every 60min

opaque eagle
#

cooldowns?

#

What language

earnest phoenix
#

You could do something like
If (time.now-time.then = 60 min)

stray garnet
#

@opaque eagle js

mossy vine
#

discord.js is not a language

stray garnet
#

yea

#

ik

#

lol

mossy vine
#

save when the user last ran the command in a database, when they run the command again check if 60 minutes have passed, if yes, add new value into database

dusky mist
#

In discord.js is : ``` const cooldown = new Set();

if(message.member.hasCooldown) {
//code
message.author.add(Cooldown)
setTimeout(() =>{
colldown.delete(message.author.id}, //time} ;```

#

@stray garnet

mossy vine
#

if you have many users it will be very inefficient

#

timeouts running for no reason

dusky mist
#

:v

#

In my bot it works

mossy vine
#

the code you posted also has many issues

earnest phoenix
#

Doesn't mean it's a good or scalable solution

dusky mist
#

Im in mobile

opaque eagle
#

Also that code isn't even real

mossy vine
#

yes thats what i said

#

it has so many issues

stray garnet
#

(node:15711) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.

what does error mean

earnest phoenix
#

Incorrect token

stray garnet
#

my bot wont start

#

@earnest phoenix uh what?

earnest phoenix
#

@stray garnet the token is not valid

#

Maybe your bot got banned, or the token has been regen

stray garnet
#

YO wzf my token regened randomly

#

Firstly my Discrim Changed and now the Bot Token wtf?

earnest phoenix
#

Contact discord, if the token doesn't work after regen

stray garnet
#

The Thing is, i didnt even regened it

#

It randomly changed tf

hollow saddle
#

Did you upload it to GitHub?

earnest phoenix
#

Token change if the bot is api banned or something like that

hollow saddle
#

Cause discord has been automatically regening tokens that were

stray garnet
#

@hollow saddle No

#

@earnest phoenix Bot Api banned?

earnest phoenix
#

Token only change if the bot got banned by discord or if the user regen it

#

Try put the new token @stray garnet

#

I've noticed my tokens get regen too but the old still works despite being different

#

If it doesn't work contact discord

stray garnet
#

@earnest phoenix I did

#

I need to wait

earnest phoenix
stray garnet
#

my PC just died

earnest phoenix
#

Reminds me of that time I uploaded my token to github and someone made it into a sub 2 pewdiepie bot

stray garnet
#

Lmao

stuck ravine
#

Hello, I have a problem with ffmpeg, as my bot joins a lounge he leaves directly without leaving a mistake (bot music)

earnest phoenix
#

you need to put the ffmpeg folder in your C:/

#

Its a little bit hard to install

#

Look on youtube how to install it

#

@stuck ravine

dusky mist
#

@stray garnet when u restart the bot 1000 times the token regen automatically

earnest phoenix
#

What no

dusky mist
#

Yeh

grim aspen
#

i... don't think that's how that works

earnest phoenix
#

Bot token never regen

#

Regen only on ban

#

Or if the owner regen it

grim aspen
#

you would have to regen it manually

dusky mist
#

Discors API regen the token after 1000 restarts in a day

#

For security

earnest phoenix
#

Nobody restart a bot 1000 time in 1 day

#

And any source?

dusky mist
#

In glitch it can be

#

Cuz every type is a restart

grim aspen
#

that's not how it works

mossy vine
#

glitch is bad tho

earnest phoenix
#

And yes that's not how it works

dusky mist
#

Omg

grim aspen
stray garnet
#

@earnest phoenix btw my bot works again

earnest phoenix
#

Cool happyHappyKoyori

dusky mist
#

@grim aspen this is what im talking about

earnest phoenix
#

That's just the websocket

#

Like if a bot edit a channel 1000 time in a day

#

He can get api banned for 1h

dusky mist
#

Lmao

#

When u restart the bot u call the websocket

earnest phoenix
#

Hi there! How can I make my bot rejoin DBL? It has not been kicked or anything, I made it leave by accident ... shame on me

grim aspen
#

contact a mod

earnest phoenix
#

allright thanks

earnest phoenix
#

lmao might have happen with my bot, had a bug that created an infinite loop of my bot quoting itself

burnt basin
ancient vine
quartz kindle
#

is that bot in dbl?

west spoke
#

Nope

#

send the ID @ancient vine

ancient vine
#

474240839900725249 I googled the ID as well, I only find it's invite link

#

It's like it completely vanished from the internet

#

But I'm sure I found it from disbordbotlist

west spoke
#

-botinfo 474240839900725249

gilded plankBOT
#

tickNo That bot wasn't found

west spoke
#

not on dbl

earnest phoenix
#

it was

ancient vine
#

Did something happen?

opaque eagle
earnest phoenix
#

it's probably abandoned

opaque eagle
#

Also its invite link is the third search result on google

ancient vine
#

Ah shame

#

I've been using it for a while and just noticed the ban function doesn't work and banned users are still spamming suggestions

#

Any alternative?

copper cradle
#

bruh

west spoke
#

bruh

round shuttle
#

Why were votes reset in the middle of the month?

west spoke
#

Good question

round shuttle
#

So, no official statements?

unique nimbus
#

general pin

earnest phoenix
#

can somebody tell me how to await messages correctly in dc.js v12?

#

because i am too stupid for dis

copper cradle
#

<Channel>.awaitMessages()

#

b r u h

earnest phoenix
#

Quick question: can you use python to code bots?

#

quick answer: yes

#

ok thanks

wet void
earnest phoenix
#

MySQL question
Okay so i'm selecting every distinct value in a column, now i want to count the number of rows for each of those values how should i do it?

copper cradle
#

qUiCk QuEStiOn CaN yOU UsE JSoN tO cODe BoTs

#

answer: yes

earnest phoenix
#

a couple questions: can you do this on mac

copper cradle
#

yes

#

you can code on a potato if you want to

earnest phoenix
#

and how do download discord.py instead of discord.js

copper cradle
#

what kind of question is that

grim aspen
#

install it

copper cradle
#

as long as you can write text you can code

grim aspen
#

not download it

copper cradle
#

install python

#

then

earnest phoenix
#

I have python on my computer

copper cradle
#

(on the terminal)

#

if you ask what a terminal is I'm done

earnest phoenix
#

I know what a terminal is.

copper cradle
#

nice

loud salmon
#

smh zsnails be constructive

copper cradle
#

people were bad to me

#

I'm bad to people now

loud salmon
#

break the cycle

earnest phoenix
#

anybody here wanna help this poor soul

copper cradle
#

alright

earnest phoenix
#

i asked the question above

copper cradle
#

yes

#

wdyn

#

@earnest phoenix just ask your question

#

I said I'll help

earnest phoenix
#

oh okay

copper cradle
#

imma bout to run out of wifi signal

#

i may answer later today

#

(by later I mean 4 mins)

earnest phoenix
#

@copper cradle don't worry i found the solution after fiddling around

copper cradle
#

still

#

what was the problem

earnest phoenix
#
SELECT guild, COUNT(*) FROM `Emojis` WHERE guild IN (SELECT DISTINCT guild FROM `Emojis`) GROUP BY guild
copper cradle
#

and oh nice

#

ah yes

#

the floor here is made out of floor

earnest phoenix
#

thanks by the way 🙂

copper cradle
#

np

mossy vine
#

yes

#

fs.readdir()

earnest phoenix
#

how can i collect multiple messages in one message collector so if someone types "1" that event will be triggered and when somebody types "2" annother event will be triggered. how can i do that with one message collector?

tight heath
#

guise how to write discord bot in html

west spoke
#

Javascript

tight heath
#

can i write in json

earnest phoenix
#

@._.#1234 look docs

#

Yes discord

peak quail
#
TypeError: Discord.Richembed is not a constructor
``` ```js
const Discord = require("discord.js")
module.exports = {
    function: function() {
        
        console.log("lol")
        
    },
    testa: function() {
        
        console.log("that is a normal function")
        
      },
      testn: async function() {
          console.warn("That is a async function example")
      },
      onlybotowner: function(message, bot) {
         let noperm = new Discord.RichEmbed()          
        .setTitle("Zugriff verweigert")
        .setDescription("Nur der Bot Owner kann diesen Behfehl benutzen!")
        .setcolor("#ff1100");
        message.channel.send(noperm);
        console.log(`-----Zugriff für einen User verweigert-----\nUser: ${message.author.tag} (${message.author.id})\nGuild: ${message.guild.name} (${message.guild.id})\n------------------------------`);        
    },      
    onlyservermod: function(message, bot) {
         let noperm = new Discord.RichEmbed()        
        .setTitle("Zugriff verweigert")
        .setDescription("Dieser Befehl ist nur für Server Moderatoren.")
        .setcolor("#ff1100");
        message.channel.send(noperm);
        console.log(`-----Zugriff für einen User verweigert-----\nUser: ${message.author.tag} (${message.author.id})\nGuild: ${message.guild.name} (${message.guild.id})\n------------------------------`);        
    },

}```
tight heath
#

are you on v12 or v11.5

#

require('discord.js').version

#

@earnest phoenix make the filter a logical or (content === '1' || content === '2')

earnest phoenix
#

ooooooh

#

ok

#

thanks

#

wait

#

ok so

#

i wrote a little testing script here but

#

my question was how can i handle multiple responses

#

this is my code:

#
    else if (command === 'game') {
        message.channel.send('What is your favorite game? Fortnite or Minecraft?')
        const filter = m => m.content.includes('fortnite', 'minecraft', 'bruh');
        const collector = message.channel.createMessageCollector(filter, { time: 7000 });

        collector.on('collect', m => {
            if (m.content == 'fortnite') {
                message.channel.send('i hate u')
            }
            else return;
        });
        collector.on('collect', m => {
            if (m.content == 'minecraft') {
                message.channel.send('<3')
            }
            else return;
        });
            collector.on('collect', m => {
                if (m.content == 'bruh') {
                    message.channel.send('**BRUH**')
                }
                else return;
            });

        collector.on('end', m => {});
    }
#

just a example

#

call me a noob

#

but

#

idk how to implement your code there

#

or where

#

:/

late hill
#

You don't need an additional listener for each of those

#

You can combine it all in one

earnest phoenix
#

ik but idk how it worked so i tried it like that

late hill
#

The reason your code won't work as intended is because you're misusing String#includes()

earnest phoenix
#

ok?

#

so how can i do it then

late hill
#

You can't just pass more arguments to it like that

earnest phoenix
#

im noob in coding ik

late hill
#

You could use an array with the options and then use .contains(m.content)

#

Which can still be done on one line if you'd like

#
["a", "b"].contains(m.content)```
earnest phoenix
#

thanks :)

late hill
#

Do note that the message content will have to be exactly what's specified in the option

earnest phoenix
#

ik

late hill
#

You should probably add .toLowerCase() at the least

#

So it won't be case sensitive

earnest phoenix
#

Dicord.js has a good documentation on implementing aliases

#

so idk if im just stupid or you all dont understand me,
i asked how can i do it like
i reply to the bot with 1 and he does that one thing
and if i reply with 2 he does the other thing idk how what you @late hill can help me with that

#

what i have here currently just makes it like that 2 answers do the same thing and i know how to do that

late hill
#

Your code should work if you changed the includes() thing

earnest phoenix
#

it doesnt :)

late hill
#

Send your current code

earnest phoenix
#

i actually didnt change anything because that what you said me i tried before and well

#

it didnt worked at all

late hill
#

So basically

#

You're asking for advice and not actually listening

#

Then wondering why it still doesn't work

earnest phoenix
#

im asking for a way to make a listener event listening to 2 answers, if the one occurs it does the one thing and if the other appears it does the other

late hill
#

Yes

earnest phoenix
#

and i tried everything you said before and nothing worked

#

so

late hill
#

I don't think you did

earnest phoenix
#

i did before i even asked here

#

im at a point where i just want to yeet my pc out of a window

#

Lol

lusty dew
#

doubt

late hill
#

Could you just

#

Change that one line

earnest phoenix
#

fine

late hill
#

It'll work

#

It's just still dumb to have 3 listeners for it

#

You should change that too

#

But just changing the filter should do

earnest phoenix
#

ok so aigan

#

i tried it

#

i tried it with annother format

#

currently it looks like this:

#
    else if (command === 'game') {
        message.channel.send('What is your favorite game? Fortnite or Minecraft?')
        const filter = m => m.content.includes('fortnite', 'minecraft', 'bruh');
        const collector = message.channel.createMessageCollector(filter, { time: 7000 });

        collector.on('collect', m => {
            let collectedmessage = m.content
            if (collectedmessage == 'fortnite') message.channel.send('why bro')
            else if (collectedmessage == 'minecraft') message.channel.send(':)')
            else if (collectedmessage == 'bruh') message.channel.send('bruh')
        });
        collector.on('end', m => {
            message.channel.send('collector ended')
        });
    }
#

WHY DOESNT IT WORK

thorny moth
#

hi team! how do i correctly post the Total Server count using the dbl api when sharded? right now the website only shows the server count of one shard and i use discord.js

trail dagger
#

some of them are outdates but some of them still works

slender thistle
#

Or you know

late hill
#

Because you still didn't change the includes @earnest phoenix

#

..

earnest phoenix
#

ok

#

where exactly do i put them because i am so salty i cant even think normal anymore

late hill
#

I explained the issue

#

includes only accepts one argument

#

It doesn't care what you put beyond that

#

You have to use a different approach

#

Such as an array with the option and then using .contains() on that array

#

As I previously explained

earnest phoenix
#

ill explain aigan: i want to know why only the answer „fortnite“ works and if i respond with „minecraft“ or „bruh“ nothing happens. why?

late hill
#

Ok

#

Another example

#

Look at it

earnest phoenix
#

yes

late hill
#

includes accepts 1 argument

#

It checks if the first argument is in there

#

Whatever you've put beyond that has no effect on the outcome

earnest phoenix
#

im just stupid oof

#

aren't we all

#

sorry for being stupid

#

lul

#

Q: how to keep bot active while your computer is not running

late hill
#

A: by not hosting it on your computer

earnest phoenix
#

Ok

#

Does glitch work with python

mossy vine
#
tight forum
#

hi, is there a module like named anti raid?

#

for example, 10 people entered my server in 15 seconds. i want to prevent this, i think discord-anti-spam doesn't have this.

trail dagger
#

@west spoke Do you remember when i said i had problems with my vote lock shit thing? yea i fixed it

loud salmon
tight forum
#

thx but i dont want bot

#

i want make a anti raid bot

#

im looking for module

earnest phoenix
#

no one is going to give you written code

#

this server has a no spoonfeeding rule

trail dagger
#

@tight forum @urban igloo

earnest phoenix
#

however if you want tips on how to write this, we're here for you

trail dagger
#

Lockdown lets you lock and unlock channels and set mod channels

trail dagger
#

Yea

#

you can lock the channels if raided

earnest phoenix
#

do you not read

trail dagger
#

i read

earnest phoenix
#

they want to make a bot themselves, not use a public one

earnest phoenix
#

how is that relevant again

#

the message under it confirms they want to write a bot

trail dagger
#

This just confuses me

earnest phoenix
#

then you shouldn't help if you're confused

tight forum
#

dude, i think you dont understand me. I don't want written code, i just want to know if there is a npm package/module to prevent x many users to join in 15 seconds @earnest phoenix

earnest phoenix
#

there isn't, and that is written code lol

trail dagger
#

Why wouldnt you let members join within 15 seconds each time?

earnest phoenix
#

raids

trail dagger
#

That will just prevent you from having members

#

Yea ik that

slender thistle
#

Can we focus on the question instead

trail dagger
#

Ok

#

Mr. Yar something, i dont think it is any bots that does that

tight forum
#

@earnest phoenix then every single npm packages/modules are written?

earnest phoenix
#

yes...?

tight forum
#

then I ask for a npm package/module that prevents for example 15 users to join at once.

mossy vine
#

i doubt something like that exists

tight forum
#

what cyber said is all you had to say at first...

earnest phoenix
#

Tbh tho who cares about how many people join in a spend look at how old the account is mainly when getting raided they use accounts under the age of 7 Smart

#

@tight forum I get what you mean. I haven't heard of a module which does this but you can store a Map (I think) in the client which temporarily stores the joined members there and clears them after an X amount of time.

mossy vine
#

hey, so i would like to download all images (in img tags) found on a website. can i do this with a script running in chromes console, and if so, how?

amber fractal
#

@mossy vine I know you can list them

#

not sure if you can download them

#

but you can use the list to download from a separate script

mossy vine
#

how would i download them

amber fractal
#

like if you have an array

#

you could just process all of them

#
var images = $$('img', document.querySelector('.devsite-header-background'));
for (each in images) {
    console.log(images[each].src);
}``` 
https://oliy.is-just-a.dev/301kk6_981.png
#

it's in their dev docs

mossy vine
#

okay, figured it out with some help

lost pike
#

Anyone has any idea of how to have the bot also publish post into an announcements text channel?

smoky spire
#

I suppose

#

That has nothing to do with discord.js

#

You have to push to the repo

earnest phoenix
#

Excuse me but

#

How can I check for the last letter in a string

#

"hello"[0] returns h

#

But I want the last letter, can be any word without me knowing its number of chars

#

JavaScript please xD

#

In Ruby you can just use [-1] 😕

inner jewel
#

slice(-1)

copper cradle
#

@cry then every single npm packages/modules are written?

WeSmart

stark obsidian
#

lol

heady salmon
#

Hi there, I'm trying to create a command using Discord.py and I'm getting an error with images.extend

#
import discord
from redbot.core import commands, Config
from random import randint
import aiohttp
import logging
import nekos

log = logging.getLogger("Interaction")  # Thanks to Sinbad for the example code for logging
log.setLevel(logging.DEBUG)

console = logging.StreamHandler()

if logging.getLogger("red").isEnabledFor(logging.DEBUG):
    console.setLevel(logging.DEBUG)
else:
    console.setLevel(logging.INFO)
log.addHandler(console)

BaseCog = getattr(commands, "Cog", object)


class Interaction(BaseCog):
    """Interact with people!"""

    def __init__(self):
        self.config = Config.get_conf(self, identifier=842364413)
        default_global = {
            "hugs": [
                "https://img2.gelbooru.com/images/ff/63/ff63a3c4329fda2bf1e9704d4e150fea.gif",
#Snipped some image URLs
            ],
        }
        self.config.register_global(**default_global)

    @commands.command()
    @commands.cooldown(1, 3, commands.BucketType.user)
    @commands.bot_has_permissions(embed_links=True)
    async def hug(self, ctx, *, user: discord.Member):
        """Hugs a user!"""

        author = ctx.message.author
        images = await self.config.hugs()

        hugs = await (nekos.cat("meow")
        images.extend(hugs)

        mn = len(images)
        i = randint(0, mn - 1)

        # Build Embed
        embed = discord.Embed()
        embed.description = f":aqsuccess: | *{author.name} hugs {user.name}*"
        embed.set_footer(text="Made with the help of nekos.life")
        embed.set_image(url=images[i])
        await ctx.send(embed=embed)```
hot rampart
#

My bot is using a lot of RAM (500mb) for around 21 servers. Is this normal, and is there any way I can reduce this large memory usage?

languid dragon
#

code optimization

#

and no, it should be using less than 10% of that AFAIK/IIRC

hot rampart
#

Any starting points you would look at? If it helps, I use discord.js with a MYSQL DB

languid dragon
#

i would optimize all your MySQL queries and make sure that you're not calling the database unnecessarily for tiny requests
i would also check all your events and make sure you're not overloading events
also check what you're caching, DJS caches a lot so it's possible your bot is just in REALLY big servers

hot rampart
#

Yeah, I know it's in this one. Is it possible to stop it from caching say users?

sick cloud
#

discord.js has multiple options to lower memory usage too, like disabling the TYPING_START event and clearing the message cache if you don't use it

hot rampart
#

And which function would do that?

opaque eagle
#

Client.sweepMessages()

inner jewel
#

like disabling the TYPING_START event that won't change memory usage

#

from the ws code: js if (packet && !this.client.options.disabledEvents.includes(packet.t) && PacketHandlers[packet.t]) { PacketHandlers[packet.t](this.client, packet, shard); }
PacketHandlers["TYPING_START"]:```js
module.exports = (client, { d: data }) => {
const channel = client.channels.get(data.channel_id);
const user = client.users.get(data.user_id);

if (channel && user) {
/**

  • Emitted whenever a user starts typing in a channel.
  • @event Client#typingStart
  • @param {Channel} channel The channel the user started typing in
  • @param {User} user The user that started typing
    */
    client.emit(Events.TYPING_START, channel, user);
    }
    };```
#

so it'll still parse the payload anyway

#

and even then the memory that gets allocated is just temporary and the next gc cycle will clean it

plucky solstice
#

Hey I have an idea for the Action system, currently we get emails if we are out bid. Any way we could get a discord dm as well or instead? This would make bidding faster and allow for bids to happen back and forth.

#

<@&304313580025544704>

west raptor
#

why

languid dragon
#
  1. not the channel for it
  2. you don't need to ping every moderator
fiery birch
#

i see a few issues here

languid dragon
fiery birch
#

yes

#

also mods dont really do anything with auctions

plucky solstice
#

@west raptor sometimes I don't get the notification that I've been out bid till a hour or two later as email on a phone has to sync up, discord though would be an instant mobile notification

fiery birch
#

hey boss

plucky solstice
#

@languid dragon my bad, ty

fiery birch
west raptor
#

honestly

#

I know nothing about auctions

#

so dont ask me

sick cloud
#

toLocaleString does it

languid dragon
#

@earnest phoenix don't ping mods to try get help faster, wait for a response patiently

spare goblet
#

can you like not tag me randomly

#

who said I even know js -_-

inner jewel
#

toLocaleString() isn't portable

#

it's output depends on the os settings

opaque eagle
#

^

#

It's meant to be used in the browser

zenith fulcrum
#

How do you display a welcome message?

west spoke
#

@plucky solstice that's a ouch.

They already have a auction system, also why the @Moderator ping

opaque eagle
#

When your bot joins a server or when a user joins a server your bot is in? @zenith fulcrum

west spoke
#

on_server_join for py (bot joining server)
on_member_join for py (user joining server)

zenith fulcrum
#

@opaque eagle when a user

opaque eagle
#

What language and library do you use

zenith fulcrum
#

Java and I don’t know? I think node?

opaque eagle
#

Ok do you know how you do client.on(“message”, msg => ...etc?

zenith fulcrum
#

Yes

opaque eagle
#

Same thing but instead of message, you do guildMemberAdd, and instead of getting a message in the function, you’ll get a member

#
client.on(‘guildMemberAdd’, member => {
   // welcome here
})```
#

You can view a full list of events in the docs

languid dragon
tight heath
drowsy sentinel
#

try
'HELLO'.toLowerCase()
or
'HELLO'.toString().toLowerCase()

#

It's strange cause both toUpper and toLower are methods of string.

low wasp
#

maybe ken overwrote them before?

opaque eagle
#

Maybe try String(“hello”).toUpperCase()

low wasp
#

but i dont see why that would cause an issue tho

languid dragon
#

wtf???

tight heath
#

node -v?

languid dragon
tight heath
#

huh

languid dragon
spare goblet
tight heath
#

kenneth qt

#

do not sad

languid dragon
#

it wont work sad

tight heath
languid dragon
#

i need it sad

tight heath
#

can you try in node cli

languid dragon
#

effort

tight heath
#

yeah but that isolates it to either your project or your node install

languid dragon
#

listen here ravy

#

im tryna troll these nerds

#

ur making it hard

spare goblet
tight heath
#

frick you kenneth

languid dragon
#

pls help, i don't understand why none of my string methods work :(

spare goblet
languid dragon
#

people asking for development help be like

tight heath
#

ken u mean

#

i was ready to guide you thru custom compiling node

languid dragon
#

LOL

#

cute

maiden mauve
#

@languid dragon why do you need to use a defined sting method?

#

what's preventing you from doing
aStr = "hello";
aStr = aStr.toUpperCase();

mossy vine
languid dragon
mossy vine
#

im confused, why doesnt this actually work?

#

when it should

languid dragon
#

do you not understand what the code is doing?

mossy vine
#

isnt it supposed to set everything of String.prototype to null

languid dragon
#

yes

maiden mauve
#

what are you running

#

nodejs?

languid dragon
#

name.endsWith wont work because you're setting endsWith to null

#

it's literally setting every string method to null

mossy vine
maiden mauve
#

I'm not sure what you've done to overload a string object?

languid dragon
#

what's between line 1 and line 90 in your code example there

maiden mauve
#

just a bunch of test nonsense

maiden mauve
#

in nodejs stable that 100% works

languid dragon
#

that's

#

okay

maiden mauve
#

im trying to understand what you've done to change that interaction

maiden mauve
#

that loop destroys the standard String object?

languid dragon
#

ya

maiden mauve
#

but, you desire it to work correctly?

languid dragon
#

no

maiden mauve
#

haha maybe your question is outside of my realm of understanding

#

I'm just a hobby guy

languid dragon
#

it's a joke

#

i was making fun of people who somehow fuck their code but still ask here for help even though it's obvious what the issue is

maiden mauve
#

oh you went a long way to do that

#

😄

#

I was gonna say, you seem like an accomplished person based off your roles

#

yet intentionally setting value to null and expecting a method to work

languid dragon
#

yes, that was the meme

maiden mauve
#

meme complete

#

thanks for explaining that though, I was working through what your code was doing lol

languid dragon
maiden mauve
#

I will say though

#

there are different types of help people need

languid dragon
#

the only help i need is a fix for boredom

maiden mauve
#

I've asked a lot of stupid questions in here

#

mostly answered by "what does x(y) do?"

#

imagine an FAQ

#

"my variable is undefined"

#

"my object doesn't have its methods"

#

"I copy and pasted code and it doesnt work"

#

it seems like a lot of times the question itself is the answer

earnest phoenix
#

answer in plain sight

#

bread can't speak

maiden mauve
urban apex
#

how to check if message.author has voted?

earnest phoenix
urban apex
#

ok

earnest phoenix
#

and you mean the author of the vote

#

?

urban apex
#

no, author of the message

earnest phoenix
#

What library?

urban apex
#

javascript

earnest phoenix
#

It's if(dbl.hasVoted(message.author.id))

urban apex
#

okay, i try it

#

it works ty!

earnest phoenix
#

np ;)

urban apex
#

xD i have another problem xD

dbl.on("vote", vote => {
    bot.guilds.get("605725395752452115").channels.get("611467524747296789").send(new Discord.RichEmbed().setDescription(`**${vote.user.username}** just voted!`));
    console.log(`> User with ID ${vote.user} just voted!`);
});

I voted and the bot did not react!

earnest phoenix
#

Hmm

#

Try without bot.guilds.get(''), put just console.log(vote.user) to see if it's working

urban apex
#

okay

#

i try

tight heath
#

@languid dragon ur meanie owoRemHmpf

#

m e a n

#

if ur bored add wss to my shard handler

urban apex
#

@earnest phoenix, it does not work

tight heath
#

what's in the vote object

#

like

#

console.log(JSON.stringify(vote, null, 2))

urban apex
#

exist a fakevote to test?

#

i think no

proper inlet
#

Hello! How to make the message "member connected" to the text channel when member connected to a voice channel?

mossy vine
#

what library

proper inlet
#

discord.js

#

Or how to track a person’s connection to a voice channel

mossy vine
#

stable or master?

proper inlet
#

stable

mossy vine
proper inlet
#

Thx

urban apex
#

@tight heath console.log(JSON.stringify(vote, null, 2)) does not work.

earnest phoenix
#
 const dbl = new DBL('Your discordbots.org token', client); 
``` copy paste this on the top of your index file
brazen ocean
#

okey

#

thank you 🙂

earnest phoenix
#

just

#

Remplace the first string by your dbl token

#

You can found it here

#

@brazen ocean ^

brazen ocean
#

ok

#

thank you @earnest phoenix for helping

earnest phoenix
#

np qt

#

and run npm i dblapi.js in your console

#

to install the package

stray garnet
#

@earnest phoenix yop discord token has changed again

#

without my knowlege

earnest phoenix
#

without your knowledge??

#

Contact discord

stray garnet
#

what was email again?

earnest phoenix
stray garnet
#

thx

#

WAIT WAIT

#

i got an email

#

Discord bot token has been reset for potential abuse

#

Cmon discord

earnest phoenix
#

What Cmon mean??

#

@stray garnet maybe your bot abuse of the api

#

Like changing status too fast

#

Edit a channel/send message too fast

stray garnet
#

@earnest phoenix come on

#

@earnest phoenix No cause it reconnects every tiny change i make

earnest phoenix
#

Yes it's for that

stray garnet
#

I hate glitch sometimes....

earnest phoenix
#

Hm, it's for that i prefeer self hosting than free hosting services