#development

1 messages Β· Page 1651 of 1

unreal estuary
#

is there a way to like see the data properly cuz it looks like this

pale vessel
#
const { world } = require(path).greetings```
#

OR js const { greetings: { world } } = require(path)

slender thistle
#

The cog code is in test.py, I assume?

rocky hearth
#

how much information can we store in 1kb?

restive furnace
#

1024 bytes*

boreal iron
#

*1024

#

correct

rocky hearth
#

how much is that? Like what is the max characters I could store in that?

restive furnace
#

1024

#

1 char = 1 byte

pale vessel
#

lol

chilly veldt
chilly veldt
#

help πŸ˜”

kind viper
#

Hey
Is it possible to create a discord bot that go online for streaming football in any voicechannel?

opaque seal
#

bots can't screenshare

kind viper
#

:/ sad

#

ik that

#

but u cant do with other links

#

as far as i know

#

like I use different website for watch football

tired panther
kind viper
#

wym with legal rights?

opaque seal
#

you would get banned by twitch by streaming a game there

kind viper
#

itsnt twitch

opaque seal
#

tldr you can't make a bot for that

kind viper
#

i want a bot that can stream in discord voice channels

opaque seal
kind viper
#

from websites like Hahasport.eu

#

yeah

#

sadly

#

kk tyvm

rocky hearth
#

I'm trying to implement role based access to my website, just like discord roles.
So how does discord roles work under the hood?

#

discord uses something like bits for role based access. How the bits are resolved, for different type of permissions.

opal plank
#

with bitfield

#

and bit operations

#

are you aware of how bits works?

rocky hearth
opal plank
#

then let me get the docs

unreal estuary
#

can someone help me with this nightmare

#
        case "help":
            msg.channel.send(`${config.prefix}help - shows this message\n${config.prefix}ping - view bot ping`);
        break;
        case "ping":
            var latency = Date.now() - msg.createdTimestamp;
            msg.channel.send(`pong! bot latency: \`${latency}ms\``)
            log("ping command executed");
        break;
        default:
            msg.channel.send(`unknown command! type \`${config.prefix}help\``);
    };```
#

its sending the help command multiple times

#

but not for others

#

anyone?

cinder patio
#

Is that all your code?

unreal estuary
#

nope

#

do u want the full message event

cinder patio
#

Send your entire file

unreal estuary
#

ok

cinder patio
#

don't share your token tho

unreal estuary
#
const fs = require("fs");
var config = JSON.parse(fs.readFileSync("config.json","utf8"));
var bot = new discord.Client();
bot.login(config.token);

bot.on("ready", () => {
    log(`${bot.user.tag}: ready`)
})

bot.on("message", msg => {
    if(!msg.content.startsWith(config.prefix)) return;
    var args = msg.content.split(" ");
    var command = args[0].slice(config.prefix.length);

    switch(command) {
        case "help":
            msg.channel.send(`${config.prefix}help - shows this message\n${config.prefix}ping - view bot ping`);
        break;
        case "ping":
            var latency = Date.now() - msg.createdTimestamp;
            msg.channel.send(`pong! bot latency: \`${latency}ms\``)
            log("ping command executed");
        break;
        default:
            msg.channel.send(`unknown command! type \`${config.prefix}help\``);
    };
})

var log = (m) => { console.log(`[${new Date().toTimeString().split(" ")[0]}] ${m}`)}```
#

shall i send config file

cinder patio
#

no need

unreal estuary
#

do you know what i did wrong

cinder patio
#

You're not ignoring messages from bots

#

and your help message starts with -help

#

so the bot triggers itself

unreal estuary
#

so thats the problem

#

ok ill try it thanks

#

it worked lol im so dumb

earnest phoenix
# chilly veldt help πŸ˜”

You should load the cog with something like path.to.the.cog not just cog alone unless you have it in the same directory. What you were loading was the test standard library which indeed has no setup function.

rocky goblet
#

Sa.

slender thistle
earnest phoenix
earnest phoenix
#

Imagine escaping instead of using !r

slender thistle
#

I'm just wondering

#

why

earnest phoenix
#

So, it's just basically higher level of dblpy since dblpy provides raw data

slender thistle
#

Pretty much

#

Overcomplicating shit, you people...

fierce ether
#
 message.guild.members.cache.sort((a, b) => a.joinedTimestamp - b.joinedTimestamp).first(10 - 50)```how would i get the first 10- 50
slender thistle
#

.slice?

cinder patio
#

No .slice on collections

slender thistle
#

Aw

fierce ether
#

.array().slice(9, 49)?

cinder patio
#

yes

fierce ether
cinder patio
#

Maybe there are less members in the cache

fierce ether
cinder patio
#

That code gets the elements from index 10 to index 50, which is 40 in total, so I don't see what's wrong

fierce ether
#

oh yh

sick fable
#

guys

#

i still have that problem in node.js

#

whenever i run node . , It shows cannot find the module

#

and i have discord.js installed

cinder patio
#

Is the entry file in package.json correct?

#

The "main"

sick fable
#

I dont have those packages.jsob installed

#

i tried doing it

#

but same error

cinder patio
#

If you don't have a package json then node won't know which file to start

#

just do node nameOfFile

sick fable
#

@cinder patio Can you send me package.json full code in my dms

cinder patio
#

Can you show the error

sick fable
#

use pastebin or hastebin

cinder patio
#

npm init -y to generate a package.json

sick fable
#

and?

solemn latch
#

And it'll make it for you

sick fable
#

oh

#

i tried doing npm init but i clicked enter key in everything

#

never tried npm init -y. I'll try doing it

cinder patio
#

Maybe the issue is with the code itself and you're trying to require a module which doesn't exist

viscid gale
#

Well I'll leave it as avoiding being seen on browser side
https://github.com/Y0ursTruly/HideJS.git

#

This is me giving up as it was called sisyphus's stone

chilly veldt
unreal estuary
#
            db.each(`SELECT * FROM users WHERE id='${mentioned.id}'`, (err, row) => {
                msg.channel.send({embed:{
                    title: mentioned.tag,
                    thumbnail: { url: mentioned.displayAvatarURL({dyanmic: true}) },
                    description: row.description
                }});
            });```
#

how would i check if the row isnt in the table

#

anyone?

sour flame
#
const{  MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
    constructor(){
        super();
        /*
        Dependencies
        */
       this.path = require('path')
       this.discord = require('discord.js')
       this.fs = require('fs')
       /*
       Collections
       */
      this.commands = new Collection();
      this.threads = new Collection();
      /*
      Constants
      */
     this.prefix = "m!";
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`, path, f))
            this.commands.set(File.name, File);
        });
    }
    getCommand(cmd) {
        return this.commands.has(cmd) ? this.commands.get(cmd) : false;
    }
    start(token, path){
        this.commandHandler(path);
        this.login(token);
        this.on('ready', () => {
            console.log("I'm now  online")
        });
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
            const args = message.contect.slice(this.prefix.lenght).time().spilt(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(command) command.run(this, message, args).catch(console.error);
        })
    }
}
``` My modmail bot so far. What else should be added
#

?

sour flame
unreal estuary
#

ohh

unreal estuary
sour flame
#

welp when the bot is online thats possible the only way

unreal estuary
#

?

sour flame
#

I check what you send and you ask if if the row isn't in the table

unreal estuary
#

yeah

#

but how would i make it check if the row doesnt exist

sour flame
#

bruh

#

then idk

unreal estuary
#

i cant find anything on how to do it

sour flame
#

welp what bot ya making

unreal estuary
#

lol i did it

#

its good now

sour flame
#

cool

unreal estuary
rocky hearth
#

should firebase-admin only be used on backend?

sour flame
cinder patio
#

of course it should be used only in the backend

rocky hearth
#

so when it could be used on frontend (client side)

rocky hearth
cinder patio
#

You should have a server, which the client can make HTTP requests to in order to get data stored in the db

dark crest
#

how i can to take top 10 from quick.db?

cinder patio
#

you have to get all rows, use sort to sort them however you like, and then slice to only get N amount of them

dark crest
#

thx

runic depot
cinder patio
#

advertising much?

vivid fulcrum
#

as if there aren't other packages that do that better lol

modest maple
#

Or we could just use the inbuilt logging module bloblul

#

and stop fantasizing over colors in a terminal you look at for a insignificant amount of time

unreal estuary
#

is there like a max time for setTimeout

vivid fulcrum
#

int32 max value i guess

unreal estuary
#

ok thanks

crimson vapor
#

im like 99% sure that im still blocked by erwin

#

yea I am

#

someone think that they could ping him for me?

solemn latch
#

erwin definately has expressed he does not want to be pinged here

night urchin
#

did anyone have mod mail script

crimson vapor
#

oh

unreal estuary
#

how would i check if a user is less than a month old

sour flame
#

Well not name

#

but when you click them something those pop up saying that they are new to discord(aka less than a mouth)

unreal estuary
#

i mean like by code?

lusty quest
unreal estuary
lusty quest
#

or was it member object

unreal estuary
#

idk

#

probably user

#

ill check

lusty quest
#

yea

unreal estuary
#

ah that

lost wadi
#

How can I subtract the one with the largest amount if I need to look for it?

//In mongodb

alm_oro: Array
0: Object
id: 11835
limite: 1200
lleva: 0
nivel: 1
1: Object
id: 15015
limite: 1200
lleva: 600
nivel: 1

//this would be to calculate the total between both objects

let map_alm = <schema>.alm_oro.map(x => x.lleva);
let lleva_lot = map_alm.reduce((a, b) => a + b, 0);

//then I want the larger amount to subtract the value that I specify

lleva_lot - 15

//then I want the larger amount to subtract the value that I specify
lusty quest
#

so you want to get a map of the object from the array sorted by the amount?

#

since you use mongodb you could use .sort({key:1})

#

1 ascending
-1 descending

lost wadi
#

the money is "lleva_lot", so when doing "lleva_lot - 15", I want you to remove 15 from the largest amount, in my case it would be in "object 1" in "lleva: 600"

slender thistle
#

dbl.WebhookManager(self.bot).dsl_webhook("/dsl", "yolo").dbl_webhook("/dbl", "haha")

Something about this makes me wonder

old cliff
#

no one needs help today?

lost wadi
old cliff
#

What kind of help?

#

send code

old cliff
#

can you elaborate... I cant interpret that code and problem

lost wadi
#

have, I map 2 quantities, one is 15 and the other 630, then I add both and subtract 5 from the larger quantity that would be 630 so that there is 15 and 625

pale vessel
#

...okay?

old cliff
#

Your map has 2 values and you want to subtract from the higher value?

sour flame
#
const Client = require('../structures/Client');
const { Messege, ReactionUserManager } = require('discord.js');
module.exports = {
    name: `ping`

    /**
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args
     */
    run: async(client, message, args) => {
        const msg = await message.channel.send(`Pinging..`);
        await msg.edit(client.embed({
            title: `Pong!`,
            description: `WebSocket ping is ${client.ws.ping}MS!\nMessage edit ping is ${msg.createdAt}`
        }))
    }
``` did I go wrong somewhere cause I'm getting an error with run (its underline in red)
old cliff
#

There is nothing called client.embed

sour flame
#

well this

earnest phoenix
old cliff
old cliff
#

AFTER
name: 'ping'

sour flame
pale vessel
#

hover it

old cliff
#

Put a comma

pale vessel
#

ah

old cliff
#

Put a freaking comma before run

sour flame
#

The code is better now

earnest phoenix
#

Hi

#

What's the permission to create an invite ?

south root
earnest phoenix
#

CREATE_INVITATIONS ? lmao

earnest phoenix
south root
earnest phoenix
#

for here

south root
#

yes

earnest phoenix
#

but for my code

south root
#

i am dbd developer

quartz kindle
#

CREATE_INSTANT_INVITE

earnest phoenix
#

Oh thanks

earnest phoenix
gleaming citrus
#

why is this happening?

quartz kindle
#

?

gleaming citrus
#

it stops showing suggestions (vs code)

quartz kindle
#

which suggestion are you looking for?

#

require doesnt have suggestions

gleaming citrus
#

na na look

quartz kindle
#

unless you install extensions

gleaming citrus
#

its supposed to show suggestions like this

quartz kindle
#

yes, but require doesnt have them

gleaming citrus
quartz kindle
#

did you change any extension?

gleaming citrus
#

see this

quartz kindle
#

do you have eslint or typescript?

earnest phoenix
#
if(message.guild.me.hasPermission("CREATE_INSTANT_INVITE")) return message.channel.send(":x: Missing permissions (create_invite)")```πŸ‘€
gleaming citrus
#

fresh install

pale vessel
#

don't you need to check channel overwrites too?

earnest phoenix
#

Is that a walk?

quartz kindle
#

fresh vsc install?

icy fjord
#

hi

gleaming citrus
#

yeah

quartz kindle
#

install the intellisense extensions

slender thistle
#

if has permission say missing permissions

earnest phoenix
#

he always say missing perm

slender thistle
#

yeah

#

look at the condition you use

earnest phoenix
slender thistle
#

Negate the condition

earnest phoenix
#

if(!message.guild.me.hasPermission("CREATE_INSTANT_INVITE")) return message.channel.send("❌ Missing permissions (create_invite)")

slender thistle
#

try it

earnest phoenix
#

but the invite is undefined

old cliff
# lost wadi Yes

let big = Math.max(val1,val2)-5;
let small = Math.min(val1,val2);

old cliff
#

get max and min feom 2 vals and sub 5 from max

earnest phoenix
#

if(!message.guild.me.hasPermission("CREATE_INSTANT_INVITE")) return message.channel.send("❌ Missing permissions (create_invite)")

Its dont work help me cryingcat

old cliff
#

@earnest phoenix

earnest phoenix
#

i will test

#

@old cliff thanks ❀️

#

Give me your bot πŸ‘€

old cliff
#

Nah the git repo is private for a reason

lament rock
#

Just write a non permissive license, then no one can clone your bot and if they do, money

cinder patio
#

have you sued anyone so far?

zenith knoll
lament rock
#

Was going to when I saw someone tried to deploy to Heroku, but they promptly deleted the repo

zenith knoll
#

Some toolboxes are shwon only with the language extension from vscode

gleaming citrus
#

@zenith knoll it does, it was bugged out

zenith knoll
#

some come with the module

lament rock
#

issue a DMCA, then if they counter claim, you can take them to court

unreal estuary
#

can i, as a 15 year old, take someone to court

lament rock
#

You can so long as you have a lawyer on your behalf

#

I'm unsure if you're able to speak for yourself, though

solemn latch
#

depends on the country i would presume

cinder patio
#

Also your parents must be present most likely

unreal estuary
#

uk

lament rock
#

Perhaps. Probably synonymous with what age your country defines as an adult

#

Japan used to be 14

#

now it's 18 iirc CVRchanMonka

old cliff
#

Btw is there an api to get song lyrics?

lament rock
#

genius

old cliff
solemn latch
#

πŸ‘€ kinda off topic

lament rock
#

If you're trying to get lyrics based off YT videos, you'll have to have a regex to pick apart the author and the song title as genius will not pick that apart for you

old cliff
#

I know

#

But the api

#

Is there any?

lament rock
#

There is

#

there's an npm module for it

old cliff
#

Api?

#

Wait... I remember a command in bot-clones had an api for lyrics

lament rock
#

What do you think an API is? the npm module is a wrapper for genius' lyrics api

old cliff
#

genius ok

void orchid
#

oi m8ts

unreal estuary
#

wut

lost wadi
old cliff
#

No

#

Math.max takes 2 parameters

#

2 numbers

#

You can although Google how to get the largest value in a array

lost wadi
#

...

#

then you can't

pale vessel
lament rock
#

"The Math.max() function returns the largest of the zero or more numbers given as input parameters"

pale vessel
#

spread the array for the params Math.max(...array)

tired panther
#

how to upload a link as a attachment in an embed?

lost wadi
#

what do i do then?

lament rock
#

set the image of the embed as the link

tired panther
old cliff
#

I remembered java math.max lol

#

It took only 2 lol

lament rock
#

Then you'd have to download the file from the link and then attach

#

be careful of links that aren't to direct downloads. Discord does processing on their side for embed previews

tired panther
#

its a canva image, which should be send

unreal estuary
lament rock
#

Look at the Discord library you're using's docs for how to set a field as an attachment you're choosing to upload.

#

for djs, you'd set the attachment like:
"attachment://file.png" iirc

#

note that you actually have to set the attachment Buffer first

tired panther
#

discord js lol

old cliff
#

Bro just setImage and in description add a direct link

#

Ez

tired panther
#

found it

.attachFiles(['../assets/discordjs.png'])
    .setImage('attachment://discordjs.png');

lament rock
#

Alright. Then if you want lower level than that, this is what your request should look like:

{
  method: "POST",
  headers: {
    "Authorization": "token here",
    "User-Agent": "user agent here",
    "Content-Type": "multipart/form-data; boundary=boundaryhere",
    "Content-Length": bytes
  },
  body: "Content-Disposition: form-data; name="file"; filename="file.png"\r\nContent-Type: image/png\r\n\r\npngfilecontents"
}
tired panther
lament rock
#

Yes, which is why I initially suggested to just set it as a link

tired panther
lament rock
#

Why would hiding the link matter to you?

tired panther
lament rock
#

Big whoop. Discord caches the response for a while and presents the cached result

tired panther
#

a attachment wont change?

lament rock
#

Correct

tired panther
#

it is working sending it as a attachment, but It does not send it in the embed 😦

lament rock
#

embed.setImage

#

Ah. That is what you're doing

tired panther
# lament rock embed.setImage
.attachFiles([`https:myimage...............................`])
.setImage( "attachment://"+ `card.png`)

should I place there my link?

tired panther
lament rock
#

You have to download the file and name it as card.png. This can be done with the MessageAttachment class as you'll download it as a Buffer and then mutate it with the MessageAttachment class

#

attachFiles does not accept URLs

#

even though it says it does amandathink

rich heart
#

What name apps this?

lament rock
#

Visual Studio Code

rich heart
#

but what name in marketplace?

#

@lament rock ^

tired panther
#

how to make it "Bufferresolavle?"

tired panther
lament rock
lost wadi
#

Can somebody help me?

lament rock
#

You should manually download the file from your API, then use the MessageAttachment class to name the Buffer from your API and then attach that

tired panther
lament rock
#

Yes

#

You should always avoid unnecessary network I/O

tired panther
lament rock
#

You don't need a client instance in order to post to Discord's API, you can use a lib like SnowTransfer to make requests or build the HTTP request yourself

tired panther
#

I wont login

lament rock
#

a rule of thumb in web dev is that you should never let the client be an authority. That's how sites, and games for that matter, get hacked. Also, if a client isn't authorized to do something, return 404 so that unauthorized clients don't attempt to reverse engineer your API

lyric mountain
#

that's how karens are born

tired panther
livid lichen
#

Does anyone know how I can format a number into it's place value? Example: 100000 = 100k

tired panther
#
const {token} = require('./config.json')
const Discord =  require('discord.js-light')
let client = new Discord.Client({});
client.token = token;
var express = require("express"); //requiring express module
var app = express(); //creating express instance
const Canvas = require("./package/index.js");
const fs = require("fs");

app.get("/card", async function(req, res) {
}
``` So can they access or hack in?
earnest phoenix
#

How can I edit my bots page css?

cinder patio
earnest phoenix
#

when i try to dm a user (me so ik my dms are open) i get this error:(node:3840) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Channel

cinder patio
#

unless you do some authorization or maybe IP checking

tired panther
cinder patio
#

no

#

they can just access the API

tired panther
#

so its safe when I add a header with a token?

earnest phoenix
livid lichen
earnest phoenix
livid lichen
tired panther
tired panther
earnest phoenix
livid lichen
cinder patio
earnest phoenix
livid lichen
#

message.author.send works. I use it with my own bot.

tired panther
earnest phoenix
livid lichen
earnest phoenix
#

at least in my discord.js

livid lichen
#

Same.

#

I'm running at v12.

earnest phoenix
#

same

livid lichen
earnest phoenix
livid lichen
earnest phoenix
#

I'm gonna test out the message.member.user.send("") even though it doesnt show up as a method for me

earnest phoenix
#

oh god gotta wait for 100 shards to load up

earnest phoenix
#

because I tested it on my big bot

#

breh

#

im gonna run it on the testing one LMAO

tired panther
livid lichen
earnest phoenix
#

i seriously have no idea why it dont work. should i just use eris.js for this?

tired panther
livid lichen
tired panther
#

what is the problem?

tired panther
earnest phoenix
tired panther
earnest phoenix
#

that thing actually works even though it isn't a method in my js

livid lichen
tired panther
tired panther
earnest phoenix
earnest phoenix
livid lichen
tired panther
livid lichen
earnest phoenix
tired panther
livid lichen
tired panther
earnest phoenix
tired panther
earnest phoenix
tired panther
earnest phoenix
tired panther
#

1 shard per 1000 guilds

livid lichen
tired panther
earnest phoenix
#

is it just me that dont give 2 fucks?

livid lichen
livid lichen
earnest phoenix
earnest phoenix
livid lichen
earnest phoenix
#

50k but I do not even really own it

earnest phoenix
#

why would you even do that

tired panther
earnest phoenix
#

isn't that considered as raiding

tired panther
earnest phoenix
livid lichen
tired panther
livid lichen
#

@earnest phoenix You should really set your sharding to auto. It really helps.

earnest phoenix
earnest phoenix
tired panther
tired panther
solemn latch
#

auto doesnt account for traffic does it?

livid lichen
#
    const Discord = require("discord.js");
    const ShardManager = new Discord.ShardingManager("./ch1llblox.js", {
        token: process.env.token,
        totalShards: Number(process.env.TotalShards) || "auto",
        shardArgs: typeof v8debug === "object" ? ["--inspect"] : undefined,
        execArgv: ["--trace-warnings"]
    })

    // Shard Handlers //
    ShardManager.on("shardCreate", (Shard) => {
        console.log(require("chalk").blue(`SUCCESS - SHARD ${Shard.id + 1}/${ShardManager.totalShards} DEPLOYED`))
    })

    ShardManager.spawn(Number(process.env.TotalShards) || "auto", 8000, -1);
``` This is my some of my sharding script.
livid lichen
#

I use auto so my bot will ajust.

earnest phoenix
#

I'll try brb

livid lichen
earnest phoenix
#

I know this is probably not the right place to ask but how would I setup freenom DNSSEC

earnest phoenix
earnest phoenix
#

I already bought a .com from them

#

after your domain expires it shows some really inappropriate ads

earnest phoenix
#

Eh

livid lichen
earnest phoenix
#

So no one knows

earnest phoenix
livid lichen
#

My bot runs all day without a problem.

earnest phoenix
#

About 8$

#

1 year

#

oh thats fineish

earnest phoenix
earnest phoenix
#

wait damn that would take days

livid lichen
#

Indeed.

earnest phoenix
#

5.25 hours aprox

earnest phoenix
livid lichen
#

Don't do it.

#

It's not worth getting banned.

earnest phoenix
earnest phoenix
#

but they can ip ban you

earnest phoenix
#

or release ip in router settings

#

I run a vpn

earnest phoenix
#

okay why when i launch a bot from a bat script does it act diffrently than running the file directly

#

im like dafuq

vivid fulcrum
#

what is acting differently

earnest phoenix
#

nvm im just dumb

nimble kiln
proven lantern
nimble kiln
#

I am, yes

proven lantern
nimble kiln
#

That's what I thought too, but it's eris.js πŸ˜„

proven lantern
#

is there a way to fetch the member?

nimble kiln
#

That's the problem, I dont know

#

I'm hosting that instance as like a "last resort solution" because the official one is down, and maybe someone knows eris.js well and knows a fix

If I dont get it fixed it's not a big deal tbh, there are most likely better music bots out there

proven lantern
#

maybe the model needs a VoiceState property

nimble kiln
#

VoiceState directly or the whole member object?

proven lantern
#
    public id: string;
    public channelId: string;
    public guildId: string;
    public createdAt: Date;
    public updatedAt: Date;
    public content: string;
    public embeds: any;
}```
nimble kiln
#

yeah, so I'd add public voiceState: any; into it?

proven lantern
#

that needs to have voiceState as a propertyt

#

that should do the trick

nimble kiln
#

Worth a shot, thx alot for your help already πŸ˜„

#

Still the same message that I'm apparently not in the voice channel

vestal wadi
#

Any one need help dm me!

nimble kiln
#

Ok even hardcoding my current voiceChannelId returns You must be in a voice channel, lel

earnest phoenix
#

what is that ?

nimble kiln
#

or something with permissions

earnest phoenix
#

const Discord = require('discord.js');
const talkedRecently = new Set();



exports.run = async (client, message) => { 
    const footer = "(C) 2021 Bumper"
    if (!message.guild) return;

   // if(!message.channel.permissionsFor(message.guild.me).has(['MANAGE_CHANNELS'])) return message.channel.send(":x: Missing permissions (manage_channel)")

    if(message.member.hasPermission("MANAGE_CHANNEL")) {
    const waitembed = new Discord.RichEmbed()
.setTitle(client.user.username)
.setColor("RED")
.setDescription(`:x: You can only configure the server every 5 minutes !`)
.setImage("https://media.discordapp.net/attachments/812775174491471926/820208188056928256/standard.gif")
.setFooter(footer)
.setTimestamp();
    if (talkedRecently.has(message.author.id)) {
        message.channel.send(waitembed);
    } else {


        message.guild.createChannel('bumper', { reason: `Config command used by ${message.author.username}` })
  .then(console.log)
  .catch(console.error);

  message.reply(`**The #bumper channel has just been created ! **
  It wasn’t created? I probably don’t have the right permissions !
  (You can edit the bumper channel with this name only: :blue_book:・partner)`)

    };
    talkedRecently.add(message.author.id);
    setTimeout(() => {
    
      talkedRecently.delete(message.author.id);
    }, 120000);
  } else {
    message.channel.send(":x: Missing permissions (MANAGE_CHANNEL) ! ")
}
    }

    ```
#

@nimble kiln πŸ‘€

nimble kiln
#

It's MANAGE_CHANNELS

#

you're missing an S at the end

earnest phoenix
#

ooooh im stupid lmao

nimble kiln
#

πŸ™‚

unreal estuary
#

i made my first project with sql today

nimble kiln
#

I hope you defined your primary keys correctly

#

Easiest primary key is an id column with AUTO_INCREMENT and primary key enabled mmLol

#

column, not row πŸ‘€

unreal estuary
#

lol

nimble kiln
#

I even mix those two up in my native language

earnest phoenix
#

Hello, i have a bot in 4000 guilds using shards and written by nodejs.
Every shard a node cmd gets open, is there a way to make them run on the background?

nimble kiln
earnest phoenix
#

is there a guide for that option ?

nimble kiln
#

wait, that may be outdated actually

#

yeah it is, umm

#

You simply give your discord client the shards option like this:

    shards: 'auto'
});```
earnest phoenix
#

i noticed there is manager#mode, i'll try to set it to "worker" maybe it will solve it

unreal estuary
#

can someone explain what shards are, i havent used them before

nimble kiln
#

If you already use traditional sharding with a manager and got that working, I'd stick with it tho

earnest phoenix
#

those cmds open, each for every shard

#

its annoying

nimble kiln
#

yeah cause it actually creates another child process for every bot

earnest phoenix
#

i need them to run on the background

earnest phoenix
#

i'll try

nimble kiln
#

That I dont know, sorry πŸ˜„

#

But yeah try it

nimble kiln
#

Every shard handles X amounts of servers where your bot is in

unreal estuary
#

ohhh

nimble kiln
#

It's used for load distribution

#

So a bot with 100K servers wont hammer one single connection

unreal estuary
#

how many servers does a bot need to be in for it to need shards

nimble kiln
#

Recommended is that you shard between 1000 and 2000 servers

#

You are required to shard when you reach 2500 servers however

#

I set my bot to shard: auto

#

And it started to use 2 shards at around 1500 servers

potent ocean
nimble kiln
#

I dont know what happens when you launch your bot with 1 shards at, lets say, 3000 servers

#

But I assume they simply deny the connection

unreal estuary
#

ah

potent ocean
#

Well an unsharded bot uses 1 shard, right?

nimble kiln
#

yeah

#

that's what I meant with 0 shards, sorry πŸ˜„

unreal estuary
#

im boreedd

#

what can i make in nodejs

zenith terrace
#

a command

opaque seal
#

What's the definition for a database + cache microservice

#

Idk what name I should give it

boreal iron
#

Call it Hans. Hans is always a good choice.

lyric mountain
#

hans olo

boreal iron
earnest phoenix
#

e

#

Who can give me a code for a stats command, with cpu,...

zenith terrace
#

make your own

#

no one gonna spoon feed you

lilac surge
#
if message.content.startswith('b.purge ')>0:
            ownerPerm = await client.fetch_user(message.guild.owner_id)
            counter = 0
            async for msg in message.channel.history():
              counter+=1
            #await message.channel.send(counter)
            if message.author == ownerPerm:
              arg = message.content.split(' ')[1]
              if arg == 'all':
                await message.delete()
                await message.channel.purge(limit=counter, check=None, before=None)
                embedVar.add_field(name='Purged', value=f'`{counter}` messages')
                embedVar.set_footer(text = f"requested by {message.author}", icon_url = message.author.avatar_url)
                await message.channel.send(embed=embedVar)
              else:
                number = int(arg)
                #channel = message.channel
                await message.delete()
                await message.channel.purge(limit=number, check=None, before=None)
              #author=message.author.mention
              embedVar = discord.Embed(color=0x197bd1)
              embedVar.add_field(name='Purged', value=f'`{number}` messages')
              embedVar.set_footer(text = f"requested by {message.author}", icon_url = message.author.avatar_url)
              await message.channel.send(embed=embedVar)

This is a purge command that should purge all the messages in a channel if the argument is all and it did work once a while ago. Instead, it only deletes 1 message. Can someone tell me why this isn't working? thx

sudden geyser
#

@lilac surge are any messages cached in the channel? You could log the value of counter

earnest phoenix
#

noice

wraith parrot
#

Could someone help me figure out if I need these checked? I only have the users who have used the create account command in my database

earnest phoenix
#

so I’ve asked this before but no one seems to know, using mongodb how do I make data with sets of two things in it, then later able to get the data, then find somewhere in the data and get the other info in the sets

#

make sense?

solemn latch
#

as in relational data?

#

two tables, one is related to the other?

earnest phoenix
solemn latch
earnest phoenix
#

do you know any? I can do some searching if not

#

ok thanks

#

I do not

#

I just use my pc lol

#

and probably soon a dedicated pc

#

Ok thanks

astral crown
#

Do anyone know in python how to make bot send message like this? With just await ctx.send my bot returns a text message but is there any way to decorate the message or make the UI look better in text?

wraith parrot
#

What's a good way to test new features for the bot so that other people can still use the working version?

#

Awesome thanks so much

astral crown
#

How to do that? Is it like making the text bold by putting in stars? Do we need to write some syntax in message we send?

earnest phoenix
#

how can I get the number of how many guilds my bot is in using shards?
I want to send a request like for example:

guildCount: get_all_guilds_somehow
astral crown
#

Ohh alright. Thank you so much

wraith parrot
earnest phoenix
#

js

#

discord.js

astral crown
earnest phoenix
#

ty

maiden jacinth
earnest phoenix
#

do you think that this should work

client.shard.fetchClientValues('guilds.cache.size')
        .then(results => {
          topggAPI.postStats({
            serverCount: results.reduce((acc, guildCount) => acc + guildCount, 0),
            shardCount:    client.options.shardCount
          })
        })
        .catch(console.error);
#

well yea Im just asking about

client.shard.fetchClientValues('guilds.cache.size')
        .then(results => {
results.reduce((acc, guildCount) => acc + guildCount, 0)
}
boreal iron
#

The object you wanna post seems to be correct. Just test it. That’s always faster than asking if something works.

earnest phoenix
#

okay ty just gotta finish this game LOL

elfin bridge
#

Does anyone know if there are plans to add prefix, shard count and server count as an widget

earnest phoenix
#

no idea

lyric mountain
#

imagine using a non-relational database for relational data

elfin bridge
#

yeah

zenith terrace
opal plank
#

xetera mentioned stuff regarding to polyfil

#

you MIGHT be able to use that

#

that'd be only for your bots page

zenith terrace
#

oh widget

opal plank
#

otherwise you'd probably have to add your own widget

#

on your domain(if you have one)

zenith terrace
#

nvm then ignore me

elfin bridge
#

widgets like the owner name, bot status and etc

opal plank
#

if you REALLY mean wdiget, like the ones topgg currently has, then i dont think so

#

if you only mentioned widgets cuz you wanted to add that info on your bots page, then you cn do it

crimson vapor
#

hi Erwin

opal plank
#

these are all the options you got tbh

#

other than this, you can only make your own

elfin bridge
#

yeah probably will have to make my own

#

thanks for the help

opal plank
#

no problomo

quaint wasp
slim heart
#

it is now B)

#

beeg pog

opal plank
slim heart
#

@quartz kindleberly

#

no caching 45 shards

#

ofc cache will increase it but it's lookin poggir

earnest phoenix
#

is there a way to catch the error for the entire code, just so I dont have to put .catch everywhere in the code

lone pendant
solemn latch
#

sometimes catch is needed, but probably not so much it becomes an issue typing it out.
many languages do have try catch or something similar, and they can be useful, but its not too common that they are truly needed.

twilit hawk
#

do you have to use arrow pointers in discord js

quartz kindle
torpid crown
#

Uhh can I talk about python script here?

modest maple
#

sure

torpid crown
#

I am now learning pys rn and I need some help when I let the user to type freely Usieng name = input('\n')
I wnat what he type copyed and pasted into print() I mean answering him the same thing that he typed

past idol
#

I’m having this problem and I don’t know how to solve it

torpid crown
past idol
#

I’m trying to invite it from top.gg

#

Yeah

torpid crown
#

Okay now after you solve his problem can you help me then?

earnest phoenix
small tangle
#

In the invite url of the bot its oke to have predefined permissions or?

boreal iron
#

Yes

earnest phoenix
#

It's ok to have permissions encoded to the invite URL if the bot needs those permissions to work

#

Those who invite the bot can modify the unwanted permissions easily

small tangle
#

Yeah ok nice, because for some Reason the permission integer were gone in the url and now i was wondering if its forbidden

past idol
earnest phoenix
small tangle
#

Yeah maybe but i saved the new url by now so it should work

earnest phoenix
earnest phoenix
#

noice

#

oops

#

my vad

#

bad

#

@earnest phoenix so basically click on your discord bot invite link and go to invite it to a server and before you authorize it, it will say at the bottom what servers its in

#

where do i find my bot key

earnest phoenix
#

?

#

did you check your bot application

#

😐

#

then idk what ur referring to

#

the server count key.

earnest phoenix
#

dont quote me on that

#

omfg

#

dont get angry at me try contacting some actual staff or figure it tf out lmfao

earnest phoenix
#

Does discord have a rate limit as to how many times you can make a call to this endpoint?
https://discord.com/api/users/

#

I can't seem to find the exact place it states the rate limit

lament rock
#

If you make a request to it, there will be an x-ratelimit header from the response where you can see the bucket, how many requests are left in the bucket and when it resets.

The docs do not state rate limits as they are subject to change and you should not hard code rate limits

earnest phoenix
#

Does it also display when they reset?

#

Or is it daily?

lament rock
#

None of the endpoints have a daily reset except for socket identify

#

it does display the reset after header though

#
Rate Limit Header Examples

X-RateLimit-Limit: 5
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1470173023
X-RateLimit-Bucket: abcd1234

    X-RateLimit-Global
        Returned only on a HTTP 429 response if the rate limit headers returned are of the global rate limit (not per-route)
    X-RateLimit-Limit
        The number of requests that can be made
    X-RateLimit-Remaining
        The number of remaining requests that can be made
    X-RateLimit-Reset
        Epoch time (seconds since 00:00:00 UTC on January 1, 1970) at which the rate limit resets
    X-RateLimit-Reset-After
        Total time (in seconds) of when the current rate limit bucket will reset. Can have decimals to match previous millisecond ratelimit precision
    X-RateLimit-Bucket
        A unique string denoting the rate limit being encountered (non-inclusive of major parameters in the route path)
slim heart
#

how do you use the dynamic type paramaters with enums?

#

trying log (type: ActionType, content: string, data: typeof type extends ActionType.Message ? APIMessage : GatewayMessageReactionAddDispatchData, response: FilterResponse) {
but its always GatewayMessageReactionAddDispatchData so how can i match type to ActionType.Message

dusk skiff
#

in html how ``https://can i add here a (docs).example.com`?

wraith parrot
#

Does anyone know why this after_invoke function isn't being called? It works in the main module but not after I've moved it to a cog

crimson vapor
#

wait you're nextProgram

#

pogging

earnest phoenix
#

@earnest phoenix I wanna see the server names, so I can also join them. Not the amount of servers it’s in

solemn latch
#

joining servers because they invited your bot is a privacy concern.

earnest phoenix
#

Lol

#

I just wanna see and say thanks

crimson vapor
#

its still not allowed and can get you banned

solemn latch
#

well, just a heads up, this will likely result in a ban from discord and our platform.

earnest phoenix
#

OH SHIT

#

Lmao then nvm

#

I got my bot in 28 servers yay

feral aspen
#

Can I DM you?

solemn latch
#

yes, please

fathom tiger
#

in the last few days started having really issue with Discord.py. If I run my bot on a windows machine there are no issues, but if I run the bot (same Python version, same code) on my Ubuntu server suddenly the wait_for stops responding to user inputs after 30 seconds consistently.

Tried a fresh install of python as well but issues persists. Anyone have any insight? There was no code change in the last 2 weeks but this issues only just started occurring in the last few days. My bot has been up and running for a few months now without issue this is really weird.

icy skiff
#

Reactions?

fathom tiger
#

yes reactions

icy skiff
#

Try using "raw_reaction_add" and "raw_reaction_remove" instead of "reaction_add" and "reaction_remove"

#

Reaction_add and reaction_remove only works for cached messages

#

So after x amount of time it stops working properly

fathom tiger
#

i just ran some test and I think I found the issue but absolutely no idea how to fix it. I think it has to do with the number of servers the bot is in, which sound kind of insane that would be the issue. I created a new bot on the portal and changed my token to connect to that bot instead of my usual one (so the new one is in a single server instead of many). This solved the issue, however the bot is now down for anyone who has it in their server for now and I'm unsure how to resolve this.

icy skiff
#

It is highly unlikely It's an issue with the amount of servers

#

How did you setup the check function?

#

Did u try using raw reaction as i said?

fathom tiger
#

as i said its working 100% fine after switching to a different bot user...this is really weird

#

i can try raw_reaction though

icy skiff
#

Actually

#

It is expected to work with New bots

#

Say your bot is in, idk, 100 servers with a total of 10k members

#

Discord.py automatically reads all the messages from text channels it has access to

#

Therefore, the cached messages will expire quicker, since there are going to be more message in less time and there's a limit for cached messages

#

Raw reaction should fix it

fathom tiger
#

that makes...a ton of sense

icy skiff
#

mindblown

fathom tiger
#

@icy skiff question, is this the change you are talking about?
reaction, user = await bot.wait_for('reaction_add', timeout=timeout, check=check)
to
reaction, user = await bot.wait_for('raw_reaction_add', timeout=timeout, check=check)

icy skiff
#

Yes, but i think u need to change the parameters from the check function iirc

fathom tiger
#

hm, I'm having trouble finding documentation for the check function for this change

runic depot
#

recently i figured out to work with websockets

#

its awesome!

icy skiff
#

It should look similitar to this

#

This makes sure the reaction is on the same message, from the same user and is between 2 selected emojis

fathom tiger
#

thank you

#

I'll try it

icy skiff
#

Np

#

Let me know if It works

dusk skiff
#

how do i make a 403 error? in nginx

dusk skiff
#

ok

icy skiff
#

@fathom tiger if u have any other problem feel free to dm me, im going to bed so i'll answer as soon as i can

earnest phoenix
#

dose someone have a auto moderation code in discord.py that i could have

#

hey i have came 1 message from discord offical like verify your discord bot

#

100 sever reached

earnest phoenix
#

If you want invites I do have a bot, and there are many other bots that do work

#

If you want music tho just get a music bot

#

I didn’t know that invite manager had music bot?

sick fable
restive furnace
#

you just hided the real error, but what i can say rn is that it can't find a file.

#

a .js file.

cinder patio
#

you're giving it a folder

#

do you have an index.js file in that folder?

sick fable
#

those both are in the same folder

earnest phoenix
# sick fable

You know there is this cool thing called a screenshot right

sick fable
crimson vapor
#

you are in the wrong folder

#

you can do cd Discord\ bot

sick fable
#

ok

#

it worked tysm❀️

#

@crimson vapor it shows cannot read property 'set' of undefined.

crimson vapor
#

show the error

rocky hearth
#

why they have imported 'firebase-functions' twice??

river panther
#

juys, jai need jelp with java?

#

exam on 22nd

#

if ju hab ani gud book or tutorial , ples tel me

#

thank you juys

#

ples pinj me ben ju repli

crimson vapor
#

what the fuck are you ok?

hazy sparrow
#

is your english exam over KEKW

sick fable
#

it got solved but this error is fucking me up

#

like wtf

river panther
sick fable
#

lmaooooo

river panther
#

?

hazy sparrow
#

Oh good luck with that then

sick fable
#

go study instead of chatting

#

wish ya the best

river panther
#

i need book

#

for java

sick fable
#

:>

river panther
#

it is on 22nd

#

the exam

sick fable
#

no idea tbh

river panther
sick fable
#

i dont even knoq why these indian schools are using java

hazy sparrow
#

Theres a bunch of ebook out there for learning java

river panther
sick fable
#

nvm

hazy sparrow
sick fable
#

i am high

#

same

river panther
#

and java > others

sick fable
#

my school has mongo db , my sql , html , css

earnest phoenix
#

java == others
compiling java < other languages

river panther
#

no no no, java is bettor

#

because it gives depressun

#

and it is slow af

sick fable
#

javascipt is better than java

river panther
#

no no, javascript is simple

#

java develops your brain

#

for programmer thinking

lusty quest
#

i think i have somewhere a few EBooks for java

pliant minnow
#

hi

sick fable
#

Invalid regular expression: /+/: Nothing to repeat

#

Invalid regular expression: /+/: Nothing to repeat

#

Invalid regular expression: /+/: Nothing to repeat

#

help me 😭

sudden linden
#

Β―\_(ツ)_/Β―

nimble kiln
sick fable
#

it worked ffs

#

theres just an other error

#

the bot wont reply nothing

#

const Discord = require(discord.js);
const {prefix , token} = require('./config.json');
const client = new Discord.Client();
const fs = require('fs');
client.command = new Discord.Collection();
const commandFiles = fs.readdirSync(./Commands).filter(file => file.endsWith('.js'));

for(const file of commandFiles){
const command = require(./Commands/${file})

client.command.set(command.name , command);

}

client.once('ready' , () => {
console.log("I am online.");
});

client.on("message" , message => {
if(!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();

if(message.content === 'ping'){
    client.command.get('ping').execute(message , args);

}

});

client.login(token);

heavy marsh
#

in d.js is there a way to get the webhook avartar url

river panther
#

loose codes give me trigger

sick fable
#

```const Discord = require(discord.js);
const {prefix , token} = require('./config.json');
const client = new Discord.Client();
const fs = require('fs');
client.command = new Discord.Collection();
const commandFiles = fs.readdirSync(./Commands).filter(file => file.endsWith('.js'));

for(const file of commandFiles){
const command = require(./Commands/${file})

client.command.set(command.name , command);

}

client.once('ready' , () => {
console.log("I am online.");
});

client.on("message" , message => {
if(!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();

if(message.content === 'ping'){
    client.command.get('ping').execute(message , args);

}

});

client.login(token); ```

hazy sparrow
#

...

#
This is a code block 
river panther
#
const Discord = require(`discord.js`);
const {prefix , token} = require('./config.json');
const client = new Discord.Client();
const fs = require('fs');
client.command = new Discord.Collection();
const commandFiles = fs.readdirSync(`./Commands`).filter(file => file.endsWith('.js'));

for(const file of commandFiles){
    const command = require(`./Commands/${file}`)
    
    client.command.set(command.name , command);
}
client.on('ready' , () => {
    console.log("I am online.");
});
client.on("message" , message => {
    if(!message.content.startsWith(prefix) || message.author.bot) return;
    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();
    if(message.content === 'ping'){
        client.command.get('ping').execute(message , args);
    }
});
client.login(token); 
#

now try

heavy marsh
#

... if you have defined a command folder why have the ping command on your main folder

river panther
#

^

hazy sparrow
#

Can you show code for ping.js

river panther
#

ah wait

#

the fuck

#

make a proper command and event handler

#

i would have helped you make a command handler and event handler but, i have exams

young flame
#

is there any way to like detect a certain string and run something after?

#

i know there's like

#
if (client.keys.indexOf('your string') > -1)
{
  alert("input found inside client.keys");
}
#

but if you're storing data in arrays it hardly works

slender thistle
#

.includes?

young flame
#

unless you can access the key directly

#

includes wouldn't work on arrays either

#

unless you can access the string itself lol

#

if you just do like

#
client.keys = database.tag(`key-${message.author.id}`, { type: string }, [ "key ect ect"]);
#

there's no way to access the content unless you just call it using like list and get it from that

#

but when i tried it just said null

#

@slender thistle which is why i kept saying gay

#

in the server lol

#

ah nvm

#

just gonna make a dot notation function for the database ig

cinder patio
#

Wait what are you trying to do exactly?

pulsar bone
#

anyone know how to run bot script from phone?

rigid sandal
#
    throw err;
    ^

Error: Cannot find module './commands'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/matthan/discordbot/bot.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[nodemon] app crashed - waiting for file changes before starting...```
#

Idk how to fix it

#

but

#

I got the required directory

#

and it is saying It has trouble finding it

rigid sandal
dusky lagoon
#
const Discord = require("discord.js")
module.exports = {
    name:"test",
    run(message){
    
        const embed =  new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription('Text')
        .setImage(`https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/socialmedia/apple/271/a-button-blood-type_1f170-fe0f.png`)
        .setFooter('page 1')
  
  const embed2 =  new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription('text 2')
        .setImage(`https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/socialmedia/apple/271/b-button-blood-type_1f171-fe0f.png`)
        .setFooter('page 2')

        
  
        
  message.channel.send(embed).then(async msg => {
              setTimeout(function () {
                 msg.react("β—€")
              }, 500)
              setTimeout(function () {
                 msg.react("β–Ά")
              }, 600)
              const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "β—€", "β–Ά"))
              collector.on("collect", r => {
                  r.users.remove(message.author.id)
                  switch (r.emoji.name) {
                      case "β—€":
                          msg.edit(embed) 
                          break
                      case "β–Ά":
                          msg.edit(embed2) 
                  }
              })
          })

    }
}``` ok so i made this page command only i dont know d its kinda shitty in a way that when the second reaction gets loaded in the page goes to the next page and i dont know how to add more pages
iron tendon
#

discord.js is basically one giant beginner hivemind

you have people asking 'how to navigate folder in file explorer'

we have to help brickheads like thise

#

those*

iron tendon
#

or you could use embed editing

dusky lagoon
#

yeah but look at the video how do i fix it that it directly goes to page 2

cinder patio
#

Don't accept reactions from bots

#

your own bot reacts to it and triggers the collect event

#

@dusky lagoon

feral aspen
#

!eval message.member.hasPermission("ADMINISTRATOR"), is there a way it can return the list of permissions the bot has in a server?

cinder patio
#

<Guild>.me.permissions.toArray()

feral aspen
#

Thanks! :)

#

Wait.

#

TypeError: Cannot read property 'permissions' of undefined?

#

Let me check docs.

cinder patio
#

not guaranteed to be cached

feral aspen
#

What do you mean?

cinder patio
#

<Guild>.me is not guaranteed to be in the cache, you should fetch the object

feral aspen
#

Oh.

#

Alright.

shut swan
#

Should you license your closed source discord.py bot?

#

I want to have as strict license as possible

cinder patio
#

What's the point of licensing the code if it's private

modest maple
#

if its close source there isnt any reason for a license

shut swan
#

For example a host can steal it

#

I trust my host

modest maple
#

that would be a privacy and data protection breach

shut swan
#

But are never sure

cinder patio
#

yeah you can sue your host regardless

shut swan
#

But is it actually alright?

#

To have a licence in a bot

#

Or em

#

Not

#

For example if somebody somehow gets the private source code of my bot

#

There is no license in my project

cinder patio
#

I mean sure, I guess it doesn't hurt

shut swan
#

That means I am screwed

#

What is the best restrictive license

modest maple
#

if you're code is unlicensed it means no one is allowed to use it and re-distribute it

#

its the same reason why you get massive Open source project on github that are unlicensed

shut swan
#

Wait

#

Is Β© 2021 (E-GIRL) even necessary

#

For example in license.txt

#

Then

#

Like copyright notice is not a license

#

It’s just a proof I own this project

#

But it’s not a license

modest maple
#

the license only says what you can and cannot do

shut swan
#

Is it necessary to keep copyright then?

modest maple
#

by default if a project is unlicensed it's deemed to give no rights

shut swan
#

Like I understood about licenses

#

I won’t put it in my closed source projects

#

But what about copyright

modest maple
#

you own the copyright regardless

shut swan
#

I really want to include atleast copyright in my project

modest maple
#

I mean sure shrug But i would advise you get a lawyer todo it bloblul

modest maple
#

as soon as you add explicit and not blanket coverage you open loop holes in the world of the law

#

its the difference between having a legally binding and a un-enforceable license

shut swan
#

Btw how it’s possible to know

#

If my project was private

#

When for example in case of leaking it

cinder patio
#

If you don't share your code to anyone, then it's considered private

modest maple
#

most of the time you cant

#

unless it gets big enough to notice it / care about

#

unless you have the money to spend on crawlers

restive furnace
#

isn't propiertary the most limited "license"

rocky hearth
#

I'm working on react native, I have make a custom Input component, how do I make it in ts, so that it accepts the same props as TextInput of RN

rancid bay
#

How can I add my bot to top.gg?

digital ibex
silent terrace
#

i made bot the play songs non stop 24/7

#

but when no one in the room
it stops

#

how can i fix this?

#

hosted by heroku

lusty quest
#

full error trace please?

#

also dont use heroku for Music bots, they need a lot of resources and Herkou is not even ment for normal bots

earnest phoenix
#

Heelo

#

Any body help me to host a bot for 24/7 in free

silent terrace
lusty quest
#

any decent Paid VPS

silent terrace
mint anchor
#

sa

earnest phoenix
#

like .catch

still storm
#

Hi guys

#

Can i ask how to makr a custom voice channel that when you join it creates a room for you with your name?

eternal osprey
#

hey guys

dusky lagoon
#

Ok so im trying to copy this and what i mean with that is the space between the commands i know it has to do something with startWith but i cant find any pages that explain this

willow mirage
#

this is called api abuse?

lyric mountain
#

that's ratelimit

lyric mountain
#

let args = command.split(" ");

#

then remove the first element of the array

#

since it'll be the prefix + cmd name

dusky lagoon
#

ohw thank you

eternal osprey
#

hey i have a json file that looks like this

#

i am currently using : const array1 = fs.readFileSync('./keywords1.json', {encoding:'utf8'}); const array1res = array1.slice(1,-1) to read the file

#

how would i loop through it? To get all the contents?

cinder patio
#

just look through all the arrays

pale vessel
#

or if you don't care just flatten the array

lyric mountain
#

btw, why are you removing the first element of it?

eternal osprey
#

so i am removing the first and last characters

eternal osprey
pale vessel
#

just...loop?