#development

1 messages · Page 618 of 1

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

let quote = array[Math.floor((Math.random() * array.length) + 0)]

#

any errors?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

also if its + 0 why are you even adding 0

earnest phoenix
#

Hi i need help again with discord.js bot script

module.exports.run = async (bot, message, args) => {

  var con = mysql.createConnection({
    host: "localhost",
    user: "****",
    password: "*********",
    database: "******"
  });
  con.query("SELECT user FROM Staff", function (err, result, fields) {
    const users = JSON.stringify(result)
    console.log(JSON.stringify(result))


    let userr = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);

      if(!message.author === (`${users}`)) {
        if (err) throw err;
        console.log(err);
      if (!userr) return message.channel.send("Usage: -givepremium <server id>")

CODE

  } else {

    message.channel.send(`Sorry but you are not staff!`);
  }
  })
}

Error:
I got Sorry but you are not staff! as reply but i am added in db

BTW: last person that help me give me script but its not working for me

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

because you didnt define the array in that one line you copy pasted

earnest phoenix
#

me @mossy vine ?

mossy vine
#

oh i think i see the issue

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

if(!message.author === (`${users}`)

earnest phoenix
#

users is define

mossy vine
#

users is a list of users, right?

earnest phoenix
#

yes

mossy vine
#

aaand the message.author object isnt that list of users

#

you need to check if the users includes the message author

earnest phoenix
#

its not includint its checking in db if user is mod

mossy vine
#

you arent checking that

#

okay let me explain

#

message.author might look like this

#
id: "123456789",
username: "someguy",
discriminator: "1234"```
#

and your users object might look like

#

["someguy", "someotherguy", "yetanotherguy"]

#

no matter how you look at it, those 2 arent equal

#

you are comparing an apple to a basket of fruit

#

the basket may include the apple, but they arent the same thing, which is exactly what the command says

earnest phoenix
#

i got 2 one on my script i convert the 1 one by JSON.stringify

mossy vine
#

yeah you obviously dont understand

earnest phoenix
#

but what should i do to that work

mossy vine
#

i literally explained

quiet topaz
#

@mossy vine in your code is a mistake

mossy vine
#

i even came up with a very nice metaphor just for you

#

@quiet topaz my code is the mistake

quiet topaz
#

You wrote
if(!message.author === (`${users}`)
But you forgotten a )

lament meteor
#

wait why is there the ( before the `

quiet topaz
#

Yes, that i mean

earnest phoenix
#

but look i got this as out put
[{"id":1,"user":"572527691949932556","type":1,"date":1556908550,"administrator":"572527691949932556"},{"id":2,"user":"559041831569063936","type":1,"date":1556908550,"administrator":"572527691949932556"},{"id":3,"user":"572527691949932556","type":1,"date":1556908550,"administrator":"572527691949932556"}]
Then what should i do convert back to sql version?

#

@mossy vine

mossy vine
#

@quiet topaz thats not my code i just copypasted it from him

#

@earnest phoenix no clue, never used sql

quiet topaz
#

Ah, ok but it a mistake anyway

mossy vine
#

just a copypasting mistake

#

it was correct in his code

earnest phoenix
#

:/ shit i am playing with this aroun a 1/2 weeks and none work

ancient prawn
#

ok progress

#

´´´previous problem: bot.registry.registerGroup('simple', 'simple'); "simple" was big letter instead of small
NEW PROBLEM:const bot = new discord.client();
^

ReferenceError: discord is not defined
at Object.<anonymous> (C:\Users\Liam\Desktop\MYBOT\index.js:2:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)´´´

quiet topaz
#

Did you define discord or did you define Discord

ancient prawn
#

discord

quiet topaz
#

Big i mean

ancient prawn
#

small

grim aspen
#

you didn't even define discord first

#

what library are you using?

lament meteor
#

dpy

ancient prawn
#

VSC

#

js

#

i think

late hill
#

almost

quiet topaz
#

You must know what library you use...

ancient prawn
quiet topaz
#

But i think i are using js

grim aspen
#

still

#

discord isn't defined

quiet topaz
#

Yes it mustve defined

ancient prawn
#

ehm what that mean?

grim aspen
#

you've defined commando as discord

#

other way around actually

#

sorry i

#

i'm tired*

quiet topaz
#

const discord = require ('discord.js')
You must define it, or use 'commando' istead of 'discord'

grim aspen
#

no wait

#

use discord

#

instead of using new Discord.Client

quiet topaz
#

You need to declare discord.js too

grim aspen
#

const Commando = require('discord-js-commando');

quiet topaz
#

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

grim aspen
#

const bot = new Commando.Client();

quiet topaz
#

Yes

ancient prawn
#

no ; at the end?

quiet topaz
#

you should do it

ancient prawn
#

ok i did that now i get

#

(function (exports, require, module, __filename, __dirname) { constant Commando = require('discord-js-commando');
^^^^^^^^

SyntaxError: Unexpected identifier
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)

quiet topaz
#

Do 'discord.js' instead of 'discord-js-commando'

mossy vine
#

wait what

#

constant is valid javascript?

grim aspen
#

no

mossy vine
#

its not

ancient prawn
#

huz i get same thing

ancient prawn
#

hold on

#

the beginning was constant instead of const

quiet topaz
#

You did 'const' not 'constant' right?

ancient prawn
#

i copied and pasted what creeper said

#

he had constant

quiet topaz
#

He edited

ancient prawn
#

this is what i get now

#

internal/modules/cjs/loader.js:584
throw err;
^

Error: Cannot find module 'discord-js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Liam\Desktop\MYBOT\index.js:1:80)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

mossy vine
#

oh boooooy

quiet topaz
#

'discord.js' not 'discors-js'

ancient prawn
#

ok

#

same thing happends

quiet topaz
#

Like he said

#

Did you do
'npm install discord.js'

lament meteor
#

installing commando should do that

ancient prawn
#

i did what you said

const bot = new Commando.client();
^

TypeError: Commando.client is not a constructor
at Object.<anonymous> (C:\Users\Liam\Desktop\MYBOT\index.js:2:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

quiet topaz
#

How did you declare discord.js?

ancient prawn
#

declare?

grim aspen
#

const bot = new Commando.Client();

ancient prawn
#

oh new things

#

bot.registry.registeerCommandsIn(__dirname + '/commands');
^

TypeError: bot.registry.registeerCommandsIn is not a function
at Object.<anonymous> (C:\Users\Liam\Desktop\MYBOT\index.js:7:14)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

#

nvm

quiet topaz
#

const Commando = require('discord.js')
const bot = new Commando.Client();

ancient prawn
#

that was a misstype by me

#

its working MY BOT IS ALIVE

quiet topaz
#

Yes, first time i helped a person

ancient prawn
#

just because of that i will give you and creeper early access to it

#

now i got new question

quiet topaz
#

Ask

ancient prawn
#

class CoinFlipCommand extends commando.Command
{
    constructor(client)
    {
        super(client,{
            name: 'flip',
            group: 'simple',
            memberName: 'flip',
            description: 'flips a coin, landing on either Crown or Heads'
        });

    }

    async run(message, args)
    {
        var chance = Math.floor(Math.random() * 2);
        if(chance == 0)
        {
            message.reply('Your coin landed on Crown!');
        }
        else
        {
            message.reply('Your coin landed on Heads!');
        }
    }
}

module.exports = CoinFlipCommand;```
#

does this look right?

quiet topaz
#

I am not the best at js, but i could work

ancient prawn
#

i followed a guy making tutorials on youtube and that was the next tutorial

#

to make

quiet topaz
#

Yes, it could work

#

You must try it yourself

late hill
#

please no var oliy

quiet topaz
#

Why?

late hill
#

var isn't block scope

quiet topaz
#

Block scope?

late hill
#

yes

quiet topaz
#

What is block scope?

ancient prawn
#

so know i tried the command and in the terminal this came up

late hill
#

block scope variables means they can only be used in the block of code they have been defined in

ancient prawn
#

if(msg.content === 'HI')
^

ReferenceError: msg is not defined
at CommandoClient.bot.on (C:\Users\Liam\Desktop\MYBOT\index.js:15:2)
at CommandoClient.emit (events.js:194:15)
at MessageCreateHandler.handle (C:\Users\Liam\Desktop\MYBOT\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\Liam\Desktop\MYBOT\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (C:\Users\Liam\Desktop\MYBOT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\Liam\Desktop\MYBOT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\Liam\Desktop\MYBOT\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:189:13)
at Receiver.receiverOnMessage (C:\Users\Liam\Desktop\MYBOT\node_modules\ws\lib\websocket.js:789:20)
at Receiver.emit (events.js:189:13)

late hill
#

var is global / function scoped

#

Which you shouldn't use unless you need it

quiet topaz
#

Did you decrare message as msg?

mossy vine
#

@ancient prawn do you know javascript?

late hill
#

Using let / const also allows you to give a clear signal if that variable will be changed or not

#

While var is just var

ancient prawn
#

ehm it was like 2 days ago i started with any coding at all

quiet topaz
#

Ok, you are a beginer

ancient prawn
#

ye

sage bobcat
#

One message removed from a suspended account.

ancient prawn
#

?

sage bobcat
#

One message removed from a suspended account.

mossy vine
#
  1. dont call me Cy
  2. most likely because it isnt compatible with your command handler, the main code is there, you just need to edit it a bit
sage bobcat
#

One message removed from a suspended account.

ancient prawn
#

yay now my bot can do flips

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

@ancient prawn i didn't realize that you were new, my fault

ancient prawn
#

np

grim aspen
#

first try to learn to code javascript

#

then you can go here https://discord.js.org/#/

earnest phoenix
#

after doing

msg.channel.createWebhook("name");```
how would i get the webhooks id & token? (d.js)
#

i did what it said in the docs but its being weird

grim aspen
#

api for discordbots?

#

the website here?

earnest phoenix
#

no

#

im not using any api for this its just making a webhook

ruby dust
#

instead of blindly creating a webhook, how about you bind it into a variable? that way that variable will be an instance of a discord webhook object

earnest phoenix
#

i did that and deleted it
i should go with my first insticnt on these things
thank you

quiet topaz
#

hoew can i create and send things over a webhook?

#

d.js

mossy vine
quiet topaz
#

ok, i look

#

must i define the id and the token or how it wirks?

mossy vine
#

yes

#

you create a webhook in discord

quiet topaz
#

i create a webhook in my channel and then i write the id and the token?

mossy vine
#

yes

quiet topaz
#

thanks

ruby dust
earnest phoenix
#

hmm

#

when i tried to patch a message on ptb base url it returned 404

ruby dust
#

then probably ptb don't work

#

nope, another 200

earnest phoenix
#

they probably fixed that

#

ill test when i get home

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Hey, I have one question right. Is there a limit on how many voice channels a bot can be in because my bot crashes as soon as its in 22 voice channels with the same error each time!

#

no, your vps is probably too weak to handle it

ancient prawn
#

so i am trying to get my bot to join VC but its not able to

#

this comes up
(node:12944) DeprecationWarning: Collection#filterArray: use Collection#filter instead

inner jewel
#

pretty self explanatory

smoky spire
#

@ancient prawn do you use commando with discord.js?

ancient prawn
#

yes

smoky spire
#

it's a known issue with stable commando you can ignore it

amber fractal
#

Use a function

ancient prawn
#

@inner jewel its not for me as i am new

amber fractal
#

What?

#

It's a deprecation warning not a bug

inner jewel
#

it says pretty clearly "use X instead of Y"

#

/shrug

smoky spire
#

it's in commando source

amber fractal
#

.find("username", "bobby") -> .find(u => u.username == "bobby")

#

Well when it's updated it literally wont exist

smoky spire
#

it's literally commando source he can't change it

amber fractal
#

Ah yes... I forgot commando is out of date

#

But he can change it tho

earnest phoenix
#

But @earnest phoenix, its printing this error on 22 servers.

if(this.queue[id].length > 0) { TypeError: Cannot read property 'length' of undefined

Is this vps related?

#

clearly not

#

your object in the queue doesnt exist

#

But the part me and my other dev dont understand is we dont even have a queue

#

Its nothing that is queue related

#

can you provide the full stacktrace

opaque eagle
#

commando sux

ancient prawn
#

this is my code

#

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

class JoinChannelCommand extends commando.Command
{
constructor(client)
{
super(client,{
name: 'join',
group: 'music',
memberName: 'join',
description: 'The bot will join the channel youre in'
});
}

async run(message, args)
{
    if(message.member.voicechannel)
    {
        if(!message.guild.voiceConnection)
        {
            message.member.voiceChannel.join()
                .then(connection =>{
                    message.reply('Success i joined you Sir!');
                })
        }
    }
    else
    {
        message.reply('Sorry i have failed you Sir 😭');
    }
}

}

module.exports = JoinChannelCommand;
´´´

grim aspen
#

class JoinChannelCommand extends commando.Command
{
    constructor(client)
    {
        super(client,{
            name: 'join',
            group: 'music',
            memberName: 'join',
            description: 'The bot will join the channel youre in'
        });
    }

    async run(message, args)
    {
        if(message.member.voicechannel)
        {
            if(!message.guild.voiceConnection)
            {
                message.member.voiceChannel.join()
                    .then(connection =>{
                        message.reply('Success i joined you Sir!');
                    })
            }
        }
        else
        {
            message.reply('Sorry i have failed you Sir :sob:');
        }
    }
}

module.exports = JoinChannelCommand;```
#

there you go

neat tinsel
#

Anyone know how I'd add a role to a member using the role's ID?

role = discord.utils.get(member.guild.roles, id='ROLE ID HERE')
await member.add_roles(role)

Does not seem to work.

(Discord.py Rewrite branch)

broken elm
#
const Discord = require("discord.js");
const perp = require("../personal-profiles.json");
const fs = require("fs");
    
    let defName = "N/A";
    let defGender = "N/A";
    
    if(!perp[message.author.id]) {
        perp[message.author.id] = {
            Name: "",
            Age: 0,
            Gender: "",

        };
    }

    perp[message.author.id] = {
        Name: perp[message.author.id].perp + defName,
        Gender: perp[message.author.id].perp + defGender
    };
    fs.writeFile("../personal-profiles.json", JSON.stringify(perp), (err) => {
        if(err) {
            console.log(err);
        } else if (!err) {
            message.channel.send("Account created successfully! Use `r!help pers` for help on completing your account!");
        }
    });
#

it doesnt write to the file

#

im using a command handler btw

#

and the command responds with the message too

#

so the command itself IS running

dusky marsh
#

I wouldn't use json as a database

earnest phoenix
#

no sane person would

#

because it isn't one

dusky marsh
#

Indeed

#

Yet people still do

empty owl
#

lmao

broken elm
#

im just testing

empty owl
#

How about encapsulated

#

enmap

broken elm
#

i know its bad

#

just tell me whats wrong, this isn't permanent

empty owl
#

Maybe just don’t write to the file

#

Idk

#

Well

earnest phoenix
#

using json as a databae is what's wrong

broken elm
#

I know

#

again, i'm not going to use it as a database

#

im testing things

empty owl
#

If u need to write to a file use like SQLite or something

earnest phoenix
#

then don't test with json

empty owl
#

Don’t use SQLite tho

broken elm
#

why is it so hard to get an answer ffs

earnest phoenix
#

what's the point of testing if you won't be able to apply that knowledge in prod

#

...?

broken elm
#

yes

#

json is horrible for databases

#

i understand

#

i dont have money

#

to buy a database

earnest phoenix
#

wat

opaque eagle
#

You can use SQLite

empty owl
#

Use mongo

dusky marsh
#

You don't. Need to buy a databae

empty owl
#

yes

broken elm
#

or i would be using it

dusky marsh
#

Database*

earnest phoenix
#

databases

#

are

#

free

empty owl
#

You don’t buy a database

earnest phoenix
#

...?

dusky marsh
#

Lmao

earnest phoenix
#

do your research before making an argument thanks 🙏

amber fractal
#

You'd buy a host, but you dont need one

broken elm
#

i know there are free databases

empty owl
#

You can have a database on a google spreadsheet

opaque eagle
#

Lmao I like how the poor guy asked an innocent question and everyone lashes out

empty owl
#

Idk about that tho

opaque eagle
#

They're all free dude @broken elm

empty owl
#

Lmao

amber fractal
#

Like sql or mongo or any other db

opaque eagle
#

A great one for beginners would be SQLite, which is file-based, just like JSON (which isn't a database).

broken elm
#

this is literally the one reason i hesitate asking questions in servers like these

#

innocent question

#

gets lashed at

empty owl
#

literally we are trying to help u

opaque eagle
#

Ikr I don't like how ppl lash out either

#

I mean some legitimately try to help but others like that cry person doesn't

broken elm
#

i asked a simple question

amber fractal
#

We're trying to tell you how to improve

empty owl
#

literally do you want to waste 15 hours for stack overflow

broken elm
#

all i wanted was help lmao

#

not improvement

empty owl
#

bro just use quickdb or something

broken elm
#

im not using thsi forever

empty owl
#

then why r u making it

#

Nvm

broken elm
#

your acting like my bot will be large enough to where i would need to worry about json being bad

empty owl
#

horrible question

#

DNA what r u hosting on

#

or do u not host

earnest phoenix
#

why you shouldn't and can't use json as a database:

  1. you're writing to a file. it isn't and doesn't support async, you can't do two operations on the same file at the same or close to the same time.
  2. it's a file, it's size will buff up to very huge sizes in a very shot timespan
  3. it's lacking with data types
  4. it has strict formatting rules, mess up one character and your ""database"" is invalidated
broken elm
#

i

#

know

#

json

#

is

#

bad

earnest phoenix
#

and you can't use it as a database

empty owl
#

Then why r u using it..

earnest phoenix
#

the only paid databases are the fancy ones like ravendb, and even those have a free version

broken elm
#

ya know what

#

nevermind

earnest phoenix
#

if you want to do local databases you can use sqlite

broken elm
#

oh no no no no

earnest phoenix
#

but you can't use json as a database, there's no fix to it

broken elm
#

nevermind

#

disregard my question

#

completely

empty owl
#

Dna every server out there would tell you the same thing

broken elm
#

except for that one

#

singular server

empty owl
#

Called?

earnest phoenix
#

the answer to your question is not to use json. you're using filestreams, which, quoting; you're writing to a file. it isn't and doesn't support async, you can't do two operations on the same file at the same or close to the same time.

broken elm
#

that would actually help me with the issue im having rather than lead me in a different direction then what i asked

empty owl
#

well

broken elm
#

thanks

empty owl
#

If we helped you... we would be directing you to a hole

broken elm
#

sorry for bein a cucc

empty owl
#

well good luck realizing we were correct after coding like 200 lines

#

but ok

unique nimbus
#

I used json for an economy section its bad and very long to manage

earnest phoenix
#

you can't make it work, no matter how hard you try you will always have issues if you use regular files as databases

empty owl
#

bro bro bro

#

Use quick dB at least

unique nimbus
#

My excuse of not learning sql is that I am lazy

neat tinsel
#

I use Google Sheets for my database :dab:

empty owl
#

Yes

#

google sheets is the best database

neat tinsel
#

ikr

empty owl
#

I said that before lmao

unique nimbus
#

actually notepad is

earnest phoenix
#

discord text channels best database

neat tinsel
#

I recently watched a video on it

unique nimbus
#

.txt all the way

empty owl
#

Yes

#

discord channels

unique nimbus
#

yes

#

use a server as a database

empty owl
#

no wait

#

GarageBand is the best database Well.. yes but actually no

mossy vine
#

@earnest phoenix actually, 2-3 years ago someone wrote a library that does just that

neat tinsel
#

I store all my data in my phones text messages. It uses a service to text my phone which I respond with the correct things that would come from a database

empty owl
#

I store all@my data in Pokémon go

#

Pokémon names

neat tinsel
#

I store it all in sound waves inside a jar

earnest phoenix
#
c but longerToday at 11:08 PM
@cry actually, 2-3 years ago someone wrote a library that does just that```

what, discord channels or?
mossy vine
#

Yep

#

Discord text channels

empty owl
#

I store all my data in a roblox decal

earnest phoenix
#

oh i-

mossy vine
#

Yeah, you were joking

earnest phoenix
#

imagine the latency on that

mossy vine
#

Some madlad did it way before you

neat tinsel
#

My data is stored inside of my TV remote

earnest phoenix
#

normal simple* sql queries usually take 1ms, this would take like ~100ms

#

oh

neat tinsel
#

I recently started storing my bot's data in my tablets cardboard box

earnest phoenix
#

hire slaves to write data on a piece of paper and retrieve it on request

neat tinsel
#

Nah but seriously tho, anyone know how I'd give a role via ID? using rewrite branch

#

I tried id instead of name but it would have an aneurism

empty owl
#

I’m

#

I don’t use py

topaz sphinx
#

whats the css tag to edit the bg color of this

#

anyone knows?

opaque eagle
#

Inspect element and find out

#

Also css doesn't have "tags"

topaz sphinx
#

well issue is

#

i dont mean tags but

#

name of it

#

cause i looked around

#

and i found no way accessing it

opaque eagle
#

That doesn't exist either

#

Like do u need to know the selector u wanna change or the property?

topaz sphinx
#

found

opaque eagle
#

k

topaz sphinx
#

this one

west spoke
#

@opaque eagle

topaz sphinx
#

this property

#

how do i access it

opaque eagle
#

@west spoke

west spoke
#

.tag{
values
}

#

So

opaque eagle
#
.selector {
   property: value;
}```
#

tag and values don't exist...

west spoke
#

It's just a example

#

<div style="name">text</div>

topaz sphinx
#

.content doesnt exist.

west spoke
#

It's in <style>

topaz sphinx
#

hmm

opaque eagle
#

@topaz sphinx css section#bot-details-page { background-color: /* color here */ }

west spoke
#

Now to make my own py module to simplify discord async

topaz sphinx
#

its the content one

#

the one below

#

not bot details page

opaque eagle
#

If u wanna change the background color what's what u do

topaz sphinx
#

bot details page -> wrapper-page -> container is-widescreen -> container is-widescreen -> longdescription -> content

opaque eagle
#

Ohh u wanna change the white part

#

the foreground

topaz sphinx
#

yes

#

the bg is just

#

body {background-color: #085485;}

#

that easy

opaque eagle
#
div.longdescription {
   background-color: /* color here */;
}```
topaz sphinx
#

seems like it doesnt access it

opaque eagle
#

Try the edit

topaz sphinx
#

still not

opaque eagle
#

Add !important

topaz sphinx
#

nope

#

seems quite unaccesible

opaque eagle
#

Show CSS, show page

topaz sphinx
opaque eagle
#

It works if you do div.content and !important

topaz sphinx
#

how u combine those two

opaque eagle
#
div.content {
   background-color: springgreen !important;
}```
topaz sphinx
#

1 se

opaque eagle
#

(You can use any color u want, that's what I used)

topaz sphinx
#

yes

#

excellent

#

i just did that wrong

#

thanks mang u saved me lots of time

opaque eagle
#

np lmao

fiery quest
#

is there any Xcode rich presence?

opaque eagle
#

Not that I know of, but you can easily make an xcode RPC client.

spring ember
#

It's a library

fiery quest
#

nice, i'll try, thanks

opaque eagle
#

Ik... I was suggesting that they make their own

pliant needle
#

There a way to grab an img url from custom emotes?

#

Specifically discordjs?

buoyant wagon
#

emoji.url

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusky marsh
#

You're console logging the help object

#

It would appear

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusky marsh
#

He's exporting the object, it's happening else where in his code obviously

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusky marsh
#

Oh you're the same person who asked the question lol, just look wherever you handle the help objects

sage bobcat
#

One message removed from a suspended account.

dusky marsh
#

Which I would assume is in a help command

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

@sage bobcat make sure you are using .run where the code is being run

sage bobcat
#

One message removed from a suspended account.

night imp
#

no

#

The message event

#

What code are you using to execute said command

sage bobcat
#

One message removed from a suspended account.

night imp
#

ie client.on("message", async =>{})

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

okay

#

The code you are using to run the file

#

Where is that

sage bobcat
#

One message removed from a suspended account.

night imp
#

do you not have any logic determining what file should run

sage bobcat
#

One message removed from a suspended account.

night imp
#

you get a message

sage bobcat
#

One message removed from a suspended account.

night imp
#

it goes into the on.("message")

#

it determines it to be this command

#

It runs this command

sage bobcat
#

One message removed from a suspended account.

night imp
#

is that how your code goes?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

how does your code go

#

because you are sending module.exports.help

sage bobcat
#

One message removed from a suspended account.

night imp
#

🤔

sage bobcat
#

One message removed from a suspended account.

night imp
#

You want to send module.exports.run

#

But you are sending module.exports.help

sage bobcat
#

One message removed from a suspended account.

night imp
#

I am not talking about that file

#

The file that handles what should be run

sage bobcat
#

One message removed from a suspended account.

night imp
#

The file which you run the command

#

/ call upon the function

sage bobcat
#

One message removed from a suspended account.

night imp
#

Where is that

sage bobcat
#

One message removed from a suspended account.

night imp
#

do you have a central/main file

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

When you run your bot

#

What command do you use

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

okay

#

do you have a server.js/app.js/index.js

opaque eagle
#

For some reason I keep getting this weird error... sh /usr/src/app/dist/commands/ping.js:5 class default_1 extends __1.Command { ^ TypeError: Class extends value undefined is not a constructor or null

sage bobcat
#

One message removed from a suspended account.

night imp
#

In index.js

#

Where do you handle running the file

sage bobcat
#

One message removed from a suspended account.

night imp
#

@opaque eagle __1.Command does not exist

sage bobcat
#

One message removed from a suspended account.

opaque eagle
#

But it does tho...

#

what code do u want to see

night imp
#

console.log commandfile and see if it logs when you run the ban command

#

@opaque eagle have you tried console.log-ing it?

#

right before creation

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

no

opaque eagle
#

It says undefined

night imp
#

After let commandfile = ... put console.log(commandfile)

opaque eagle
#

but it's defined :(

night imp
#

See if it prints out anything when you run the ban command @sage bobcat

sage bobcat
#

One message removed from a suspended account.

night imp
#

@opaque eagle obviously not mi amigo

sage bobcat
#

One message removed from a suspended account.

opaque eagle
#

Dude u have to believe me... I can show my code

night imp
#

maybe move the definition above the code?

#

If it says undefined it is undefined

opaque eagle
#

I normally don't ask help for such dumb errors... but I've tried everything...

sage bobcat
#

One message removed from a suspended account.

night imp
#

Where are you defining it @opaque eagle ?

#

/ if you could post the code you use to do so

sage bobcat
#

One message removed from a suspended account.

opaque eagle
#

[Deleted message]

night imp
#

@sage bobcat that's not what I told you to do. I recommend getting your beforementioned friend to help as this is not working out

#

/ if anyone else here wants to step in

opaque eagle
#

This is ping.ts, where the error comes from, which I didn't commit yet```ts
import { Command, Penelope } from "..";
export default class extends Command {

}```

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

why are you doing __1. Then

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opaque eagle
#

That's the TypeScript compiler @night imp

night imp
#

Aight

sage bobcat
#

One message removed from a suspended account.

night imp
#

I don't use typescript hopefully someone else knows

opaque eagle
#

Oh

#

Dude get a linter... @sage bobcat

night imp
#

Just confirm that your path is right ig

opaque eagle
#

k

sage bobcat
#

One message removed from a suspended account.

night imp
#

okay, you need a )

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

night imp
#

Ok den it isn't finding the command file

robust acorn
amber fractal
#

You make useless loggers and send it to bot hell

grim aspen
#

like a welcome message

robust acorn
#

I do not think my bot does have the permissions to talk there.

grim aspen
#

not in these channels

robust acorn
#

yeah, I mean bot-hell

grim aspen
#

it can

robust acorn
#

I can see that it can read messages, but not text

grim aspen
#

oh

robust acorn
#

yup it cannot text

#

I cannot find anything in faq

pliant needle
#

What was the way to display the bot's avatar url again?

steel heath
#

client.user.avatarURL?

pliant needle
#

.user...

#

I'm a dumbass lmao

steel heath
pliant needle
#

It took me forever to figure out I defined my bot as conn lmao

empty owl
#

hi

pliant needle
#

@steel heath Love

steel heath
split jungle
#

Why are people brutal force attacking my bot?

#

😢

#

I never wanted to programm banning people

#

now i have to -.-

#

What are best methods to ratelimit requests?

shy rose
#

welcome to the real world....

split jungle
#

What are best methods to ratelimit requests?

shy rose
#

depends on what time frame you want to limit by

#

like cooldown 5 seconds your lib probably has a built in thing for it

cooldown 24 hours then a db is prefered

fiery stream
#
    const settings = client.getSettings(guild.id);
    if (settings.randomEvents !== "true") return;
    axios({
      method: "get",
      url: "https://api.memeload.us/v1/random"
    })
      .then(function(response) {
        console.log(response.data.image);
      });
    
    var embed = new Discord.RichEmbed()
      .setAuthor("Meme-time")
      .setColor(client.config.botColor)
      .setFooter(welcomeMessage);
    
    guild.channels.find(c => c.name === settings.eventChannel).send(embed).catch(console.error);
  }

  (function loop() {
    var rand = Math.round(Math.random() * (200000 - 500)) + 500;
    setTimeout(function() {
      task();
      loop();  
    }, rand);
  }());```
split jungle
#

what do you think about:

fiery stream
#

ayy how can i check in every server if there is guild

split jungle
#

If i make a veriable for each user, and i add +1 to this each time a user uses a bot

#

and i have a background task, reducing all these variables each 4 seconds

#

and then a check, if this variables comes over lets say 60, a user gets on banned list for a day?

dusky marsh
#

If there is guild? What does that even mean

pliant needle
#

Guilds are servers in the api

broken elm
#

im now using mysql

#

and its working fine

#

although

#

im trying to collect names by getting args[0]

#

but in the table its a number

#

im pretty sure it just counted the number of letters in the string

#

the name column is varchar btw

#

it seems like its not updating at all when i use the UPDATE thingy

bright spear
#

What

sinful lotus
#

make sure you use prepared statements on userinput or I will attack ur sql

earnest phoenix
#

Hi i need help again with discord.js bot script

module.exports.run = async (bot, message, args) => {

  var con = mysql.createConnection({
    host: "localhost",
    user: "****",
    password: "*********",
    database: "******"
  });
  con.query("SELECT user FROM Staff", function (err, result, fields) {
    const users = JSON.stringify(result)
    console.log(JSON.stringify(result))


    let userr = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);

      if(!message.author === (`${users}`)) {
        if (err) throw err;
        console.log(err);
      if (!userr) return message.channel.send("Usage: -givepremium <server id>")

CODE

  } else {

    message.channel.send(`Sorry but you are not staff!`);
  }
  })
}

Error:
I got Sorry but you are not staff! as reply but i am added in db

#

If you know anwser ping me

mossy vine
#

Still the same question i answered yesterday..

#

I even wrote a damn beautiful metaphor smh

earnest phoenix
#

@mossy vine i know but i dont get it what you mean

#

do research on it then

#

@earnest phoenix i did a loot past a week

#

ok

#

research is not googling HOW TO DO X HELP?? and going to the first youtube video. research is searching a specific term, reading up docs about it

#

@earnest phoenix i did that

#

you don't have to ping me on every message

#

and clearly not enough

opaque eagle
#

OMG do u guys remember that one question I kept asking about the constructor doesn’t exist thing? Fixed it!!! Someone in the Discord API server helped

fierce tulip
#

hi can someone give me an example of iframe tag to use in the bot's detailed description ?

pallid zinc
#
async function replyWithInvite(message) {
  let invite = await message.channel.createInvite({
    maxAge: 10 * 60 * 1000 
    maxUses: 1 
  }, `Requested with command by ${message.author.tag}`).catch(console.log);

  message.reply(invite ? `Here's your invite: ${invite}` : "There has been an error during the creation of the invite.");
}
break;```
#

Unexpected identifier

late hill
#

idk

#

seems like you just randomly dropped that here without any context

pallid zinc
#

Try to see small text below cool

mossy vine
#

what line are you getting it on

pallid zinc
#

2nd

late hill
#

Why does the "invite" case just define a function

#

Would be a good question to ask

mossy vine
#

^

late hill
#

no comma

pallid zinc
#

Why?

late hill
#
object = {
    propety: something,
    anotherPropety: somethingElse
}```
pallid zinc
#

Ohh

late hill
#

👀

ruby dust
#

"why"

pallid zinc
#

I thought you talking about *

pallid zinc
#

It's not working deivedux

ruby dust
#

what

dawn kindle
#

How can I make a prefix + say command? Can someone help me? (discord.js)

spring ember
#

what is the issue here? what have you set up already?

vague chasm
#

hey

#

I need a part in a string starting from the 2048th character of string to the 4096th

#

how can I do that?

west spoke
#

@dawn kindle bruv

#

That's easy

#

Just strip the command name

#

And have it reply with the rest

mossy vine
#

@vague chasm <String>.substring(2047, 4095)

vague chasm
#

I had tried that

#

but

#

still error

#
embed.description: Must be 2048 or fewer in length.

#

oh wait I found my mistake

copper cradle
#

lmfao

earnest phoenix
#

Hey, do you know any bot host $1/month.?

copper cradle
#

no

earnest phoenix
#

sad

sage bobcat
#

One message removed from a suspended account.

opaque eagle
mossy vine
#

^

opaque eagle
#

Check pins, it's 2.49 france currency

mossy vine
#

very good service

#

also its euros

opaque eagle
#

idk what they use in france

earnest phoenix
#
Hey, do you know any bot host $1/month.?```

just a note, there's no such thing as ""bot"" hosts
opaque eagle
#

no euro is for europe

mossy vine
earnest phoenix
#

also france uses euros and francs

#

not the switz ones

#

every country in europe uses euros and then there's their own currency

mossy vine
#

"every"

earnest phoenix
#

almost

mossy vine
#

better

opaque eagle
#

oh

empty owl
#

@dawn kindle take message.content and send it after slicing the prefix

#

¯_(ツ)_/¯

#

or use args.join(“ “)

#

and send what ever

lapis meteor
#

@earnest phoenix you code in javascript ?

dawn kindle
#

@empty owl oh thanks alot! Worked perfectly.

empty owl
#

np

earnest phoenix
#

here :

const discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {


            let user = 
            try {
            if (!user.voiceChannel) {
                return message.channel.send('**❌ Vous devez être dans un salon vocal pour pouvoir exécuter cette commande.**')
            } else {
                if (user.voiceChannel.joinable) {
                    user.voiceChannel.join().then(async (connection) => message.channel.send(`Sécurité anti-ddos activée.\n\nJ'ai rejoind le salon vocal : \`${connection.channel.name}\``))
                }
                else {
                    return message.channel.send(`**❌ Je n\'ai pas les permissions d\'accéder au salon vocal ${user.voiceChannel.name}.`)
                }
            }
        } catch (e) {
            console.log(e);
            return message.channel.send('**❌ Le système ne peut pas être exécuté. Veuillez ressayer ultérieurement.**')
           }
} 

module.exports.help = {
	name:"antiddos-on"
}

How can I define user?

late hill
#

message.author ?

earnest phoenix
#

ok

#

but

mossy vine
#

message.author

earnest phoenix
#

He tells me every time You must be in a voice channel while I'm in a voice channel

late hill
#

oh

#

probably because it's a user object

#

and you probably need a guildMember

mossy vine
#

^

earnest phoenix
#

ok

mossy vine
#

message.member should work

late hill
#

yes

earnest phoenix
#

ok

#

So I set user by message.member

#

Okay thank you very much

#

Works! Thank you

split jungle
#

Are you guys also experiencing BFA attacks on your bots?

grim aspen
#

excuse me what

split jungle
#

Brutal force attack

grim aspen
#

no

split jungle
#

Intentionally sending extreme amount of commands in order to crash him

earnest phoenix
#

here's your lord and saviour; command cooldowns

grim aspen
#

sounds like ddos

split jungle
#

I have around 2000 commands per second ... Lol

grim aspen
#

please use command cooldowns

split jungle
#

Yes i upgraded bot with cooldowns

#

I am just wondering, if you guys experiencing this too

ruby dust
#

best anti-ddos - limit each command to one use per day globally

grim aspen
#

rate limit the people fast or you will be having problems

earnest phoenix
#

spamming commands which dont have a cooldown is not a ddos

#

it's the fault of the bot dev for being dumb

grim aspen
#

i said it sounds like ddos

#

doesn't mean it is

split jungle
#

Is it allowed to add users ids and server ids on permanent ban?

earnest phoenix
#

i'm wondering if it's even possible to ddos a bot's vps

#

surely it is, but purely from discord

grim aspen
#

i'd be impressed

split jungle
#

Can those people report me for a bot not working?

ruby dust
#

but 2000 commands per second, in how many guilds the bot is even in?

earnest phoenix
#

no lol, it's your bot, you decide what the bot does

late hill
#

dbl doesn't care if your bot stops working if that's what you're thinking

split jungle
#

Okay thank you :)

#

I was afraid i might be breaking some rules if i ban users from using it

earnest phoenix
#

hm so if the bot takes unsecure links from users (e.g image manipulation commands via urls) you could make the bot visit an iplogger, even then the host would have to be really bad for it to be easily ddosable, otherwise i dont believe you can get the ip

split jungle
#

Naah, my ip is luckly not available :)

#

It isnt ddos, just BFA with commands

#

They programmed spamming coands

#

It is happening now for 18h already -.-

#

I wonder why would someone do this ...

novel wolf
#

!say test

#

!!say test

#

@earnest phoenix

grim aspen
dusk merlin
#

ddosing a well built bot would be very difficult to do as shards are there to take the hits

amber fractal
#

uh

#

ok

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

west raptor
sage bobcat
#

One message removed from a suspended account.

west raptor
#

what

sage bobcat
#

One message removed from a suspended account.

west raptor
#

it's a.. textchannel

#

it is

#

so when i get the doc and try to do doc.logChannel.send() it says .send() isnt a function

#

nvm fixed it

#

lmao

dusky marsh
#

if event.user.bot_account then return nil end

#

@sage bobcat should work if i looked at the module correctly

west spoke
#

Dumb question of mine but how would you make a icon for a embed footer (d.py async)

mild mason
#

@west spoke javacord can do that, want me to check their sources for the raw api call?

#

maybe you can lookup the py api for its location then

west spoke
#

@mild mason discord.py

#

Py = python

ruby dust
#

I would've helped, if you wouldn't have said async

mild mason
#

i know

#

I meant a reverse "loopup"

#

lookup*

west spoke
#

:v

ruby dust
#

isn't async like... super outdated?

west spoke
#

It is

earnest phoenix
#

20 seconds worth of searching

west spoke
#

I googled it but all I was finding was rewrite

slender thistle
#

@ruby dust working with embeds hasn't changed

earnest phoenix
#

you literally google discord.py async docs, click on the first link, scroll to data classes and click on embed

west spoke
#

Again I was finding rewrite

fiery stream
#
    client.guilds.forEach(guild => {
      const settings = client.getSettings(guild.id);
      console.log(settings)
      callback(settings[0]);
    }); // Close foreach
  }
  
  function RunGuilds() {
    getAllGuilds(function(err,data) {
      console.log(data)
      if (data.randomEvents !== "true") return;
      axios({
        method: "get",
        url: "https://api.memeload.us/v1/random"
      })
        .then(function(response) {
          console.log(response.data.image);
          var embed = new Discord.RichEmbed()
            .setAuthor("Meme-time")
            .setColor(client.config.botColor)
            .setFooter(welcomeMessage);

          guild.channels.find(c => c.name === settings.eventChannel).send(embed).catch(console.error);
        });
    });
  }

  (function loop() {
    var rand = Math.round(Math.random() * (20000 - 500)) + 500;
    setTimeout(function() {
      RunGuilds();
      loop();  
    }, rand);
  }());```
#

i cant mangae to log data of all guilds help

modest remnant
#

Can I make a bot on android

#

It's possible

grizzled spruce
#

@modest remnant yes you can

amber fractal
#

It is, but it's also not smart

grizzled spruce
#

You’ll have to have it hosted online tho

#

And editing bots from mobile is a much more painful experience than on computer

modest remnant
#

I am make my first bot so what I do

#

@grizzled spruce

grizzled spruce
#

Well you’ll need to set up the bot in the applications settings of discordapp.com

#

Then you’ll need to choose an online platform to host it from

#

Then you’ll need a tutorial of some sort to show how to make the bot, but you’ll have to do it on mobile instead of on pc (like in the videos)

modest remnant
#

Which online platform is bet to host bot

grizzled spruce
#

I’d ask someone else about that. I use glitch.com but I wouldn’t recommended using it to host ur bot

modest remnant
#

@grizzled spruce okay

opaque eagle
west spoke
#

@grizzled spruce depending on the phone, if its android, pydroid works v well

#

I used that to host the early stages of my bot

#

But since started using a laptop

grizzled spruce
#

I see

pliant needle
wanton walrus
#

oh

#

well

#

I edited my message

#

maybe that broke it?

pliant needle
#

Nah

#

It ignores edits

#

Okay well I moved self.friends to the actual update and shit works now so idk

heady zinc
#

logging messages

pliant needle
#

They don't log

#

Nothing saves

heady zinc
#

still, yikes asf

pliant needle
#

It's no issue to remove it, tbh the entire reason I even had it print was to make sure my bot wad ignoring other bots and I never bothered to remove it lmao

#

Meh, I'll pull it now while I'm editing the main file

#

Done

copper cradle
#

@fiery stream you need guild names, right?

fiery stream
#

Wdym

#

Ohh i got that working thx tho

copper cradle
#

bruh

fiery stream
#

What?..

copper cradle
#

nothing lol

fiery stream
#

Okay 😂

earnest phoenix
#

Why the status of my bot has not changed since ??? on online? (ID: 552187061847719943)

copper cradle
#

idk

#

just give it some time

earnest phoenix
#

The bot has been on DBL for a long time)

copper cradle
#

well

#

is the bot here?

earnest phoenix
#

I'll tell you now, I'm just looking for him.

#

I have a suspicion that he still does not)

simple silo
#

does anyone has an music source code?

pliant needle
#

@simple silo what lang?

simple silo
#

@pliant needle doesn't matter.

#

i can translate it.

#

but i tried tons of and no ones works

lapis meteor
#

i have youtube search

simple silo
#

works like a music player?

lapis meteor
#

stop resume now playing resume pause

#

yes

simple silo
#

yeah

#

can you give me ?

lapis meteor
#

&&play <title||link URL>

#

idk

simple silo
#

i have a custom but

lapis meteor
#

im waiting to approuve my bot

simple silo
#

me too

lapis meteor
#

3 days waiting

simple silo
#

wanna see may bot ?

#

my

lapis meteor
#

Ok, come DM

simple silo
#

@here does someone has an music command source code?

languid dragon
#

yes

#

do you want it? @simple silo

ruby dust
#

It's best to not spoon-feed

#

You'll only get in trouble as well

languid dragon
#

why not? i want to help him :)

#

here @simple silo ```JS
var MusicJS = require(music-discord-javascript);
var musicHandler = new MusicJS();

musicHandler.play(youtubeURL); // u need to put ur youtube url here

module.exports = new Command("play", () => {

musicHandler.play(youtubeURL);

});

ruby dust
#

Wait

#

Ken?

languid dragon
#

and that's how u make it a command :)

ruby dust
#

I'm confused

opaque eagle
#

He’s using some crappy third-party framework to make a music bot since apparently it’s “too hard”

simple silo
#

someone here?

mossy vine
#

@ruby dust yes thats ken, he was promoted to whitename lmao

ruby dust
#

nice

simple silo
#

i need a music command

#

play stop

thin lance
#

ok

#

so make one

west raptor
#

No one is going to spoonfeed you code for those commands

surreal peak
#

don't ping all mods for no reason kthx

modern sable
#

]]faq 10 --clean

covert turtleBOT
earnest phoenix
#

idk

simple silo
late hill
#

that indentation + no ; hyperharold

#

anyway

#

From what I can see, the issue is literally right next to the error message

opaque eagle
#

Why does ts give me that error?js const { getPromiseDetails } = process.binding("util");``````sh Property 'binding' does not exist on type 'Process'.

simple silo
#

who has an music source code ?

west spoke
#

Google it @simple silo

simple silo
#

i found just shitty things

west spoke
#

Good for you just use them

simple silo
#

not workng

earnest phoenix
#

by the time you spent looking for the code you could've written it

simple silo
#

i don t know to code

earnest phoenix
#

great, then don't code and use public bots

grim aspen
#

please learn how to code before you code a bot @simple silo

burnt zealot
#

Or learn by doing.

grizzled spruce
#

I learned to code a bot as I coded the bot

earnest phoenix
#

product of that is having a bot with messy and unoptimized code

grizzled spruce
#

Well I used a tutorial

earnest phoenix
#

even worse

burnt zealot
#

But then you have the fun of optimizing the code later on.

grizzled spruce
#

I used tutorials to learn the basics and learned everything else from the docs

earnest phoenix
#

but you don't know how to, because instead of learning the language first like a sane person, you learned as you went and only learned terms that are requried from the library

grizzled spruce
#

Well technically I already knew JavaScript

#

Partially at least

simple silo
#

what's this ?

steel heath
#

You're out of your command template sir

#

You have to build things on a specific template you can't just put codes in a new file and hope it'll work

#

Check your other commands and try to find the difference

grizzled spruce
#
let baseAmt = Math.floor(Math.random() * 18) + 1;
console.log(`${coinAmt} ; ${baseAmt}`);
  
  if(coinAmt === baseAmt){
     yen[message.author.id] = {
       yen: yen[message.author.id].yen + coinAmt
     };
    fs.writeFile("./yen.json", JSON.stringify(yen), (err) => {
      if (err) console.log(err)
    });
    let creditembed = new Discord.RichEmbed()
    .setAuthor(message.author.username)
    .setColor("#008B00")
    .addField("Yen", `${coinAmt} Yen added!`);
    
    message.channel.send(creditembed).then(message => {message.delete(10000)});
     };
#

How would I disable this for this server?

simple silo
#

it's there a way to get minecraft server stats ?

buoyant wagon
#

api

earnest phoenix
#

use an api, there are thousands or ping the server directly yourself

west spoke
#

^

static matrix
#

Discord api is so slow nor?

earnest phoenix
#

Yeah @static matrix

opaque eagle
#

Yeah, it's not working for me too sh DiscordHTTPError: 500 INTERNAL SERVER ERROR on GET /api/v7/oauth2/applications/@me

idle basalt
#

if nobody answered you yet, its prob because process.binding() is deprecated

west spoke
#

It's taking me a bit to login to my own user

pliant needle
#

Same

granite tartan
#

😤

empty owl
#

Any idea where I could start with building a smart convo bot?

copper cradle
#

@empty owl what is a convo bot

empty owl
#

like

#

where u say hi it says hi back

#

etc

copper cradle
#

ooh

empty owl
#

Like having a convo with a person

copper cradle
#

idk

empty owl
#

but it’s not a person

copper cradle
#

you can make a bot answer to certain words

empty owl
#

ah

copper cradle
#

but in a non-smart way

#

You'll need an AI

empty owl
#

I see

night imp
#

@empty owl use natural language processing

stray wasp
#

There is a API service that does that

ionic latch
#

Anyone know where I can find a rainbow bot???

stray wasp
#

I forgot the damn name

#

@ionic latch for roles?

ionic latch
#

Yes

stray wasp
#

That would be API abuse

ionic latch
#

???

stray wasp
#

So no. As it's considered API abuse which is a bannable offense

ionic latch
#

Wtf is api abuse

shy rose
#

Where the API is spamed/abused for no reason @ionic latch

ionic latch
#

So there is no rainbow bot

shy rose
#

No

night imp
#

@stray wasp you may be thinking of cleverbot

stray wasp
#

Yes!

#

That's the one

night imp
#

but ur own nlp is better cuz u don't have to spam the api

shy rose
#

Clever bot costs now iirc

night imp
#

🤣

stray wasp
#

😂

earnest phoenix
#

cleverbot's overpriced

shy rose
#

Not really tbh

#

Ai is computational very expensive

earnest phoenix
#

cleverbot isn't an AI, it's advertised as one but it isn't one

shy rose
#

It's a very shallow ai

#

Should be given way more neutral depth

#

It seems like currently it only goes 2-3 deep

junior summit
#
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
    at VoiceConnection.emit (events.js:178:17)
    at VoiceWebSocket.ws.on.err (C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:363:32)
    at VoiceWebSocket.emit (events.js:189:13)
    at VoiceWebSocket.onError (C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot\node_modules\discord.js\src\client\voice\VoiceWebSocket.js:156:10)
    at WebSocket.onError (C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot\node_modules\ws\lib\event-target.js:128:16)
    at WebSocket.emit (events.js:189:13)
    at _receiver.cleanup (C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot\node_modules\ws\lib\websocket.js:211:14)
    at Receiver.cleanup (C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot\node_modules\ws\lib\receiver.js:557:13)
    at WebSocket.finalize (C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot\node_modules\ws\lib\websocket.js:206:20)
    at TLSSocket.emit (events.js:189:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

C:\Users\chillkey123123123213\Desktop\ChillBot\discord-bot>pause
Press any key to continue . . .

``` i get this
copper cradle
#

what were you trying to do?

#

@junior summit sorry for the ping

junior summit
#

nothin

#

just got an error

#

fix it

#

ig

copper cradle
#

oof

#

that's just a random error

smoky mica
#

how do i make a discord invite link with the perms that my bot requires and admin lmao

potent saffron
#

^^

smoky mica
#

wait nevermind, i just added 8 to the number i got

potent saffron
#

Yep, 8 is for ADMIN

smoky mica
#

Yep hehe

potent saffron
#

but you have to put it after the &permissions=0

#

and replace 0

#

if i remember well

smoky mica
#

yeah i know lmao

potent saffron
#

Oh ok

#

Great then ^^

smoky mica
#

ty for your concern though

potent saffron
#

Your welcome, i'm happy to help

smoky mica
#

ah i'll soon update my bot page on this website, i think its outdated a bit now

potent saffron
#

I just made a page for mine hehe

#

I'm developing since january or feb i think konathink

smoky mica
#

sameeee

potent saffron
#

Which language do you use ?

smoky mica
#

but i left it for 3 months cause uh not interested and had my finals

#

js

potent saffron
#

Great GWovoYayy

#

I do too

#

Yep I also had severall problems

smoky mica
#

THAT WAS LIBRARY

#

IM DED

potent saffron
smoky mica
#

🤦

#

anyway in js, eris is better i think. less complicated

potent saffron
#

I see

smoky mica
#

I can't spell.

#

Nice.

potent saffron
#

I use discord.js

smoky mica
#

I should have switched to eris from discord.js

potent saffron
#

Well, I don't plan to change

#

xD

copper cradle
#

idk why people use this