#development

1 messages · Page 680 of 1

pseudo parcel
#

ok im removed sa thing

earnest phoenix
#

you can remove error event :/

pseudo parcel
#

oh im dont have error

#

:d

earnest phoenix
#

'client.on('error', e => {
console.log(chalk.bgRed(e.replace(regToken, 'that was redacted')));
});' here

mossy vine
#

why would you remove the error event

earnest phoenix
#

why not :D?

mossy vine
#

its useful for handling errors

#

and also knowing what went wrong if something goes wrong

earnest phoenix
#

Alright..

ruby talon
#

Language: Python (3.7.4)
How would you get the x var from the first class to the second class?

class First:
    def __init__(self, x):
        self.x = x
        
class Second:
    def __init__(self, y):
        self.y = y
    
    print(self.y + "X here")
slender thistle
#

First(5).x

#

Create an instance of First class and then access its x variable

pine edge
#

Hi guys, you know how i can adding an image 16x16 in a text like a emoji ?

ruby talon
#

@pine edge go to your server settings and add a custom emoji.
You have to have at least Administrator perms on that server to do that tho.
And to use the emoji cross platform you have to have Discord Nitro

pine edge
#

It is for discord bot @ruby talon

ruby talon
#

Oh

sick cloud
#

literally the same

pine edge
#

No

sick cloud
#

make an emoji and use it

#

bots can use emojis from one server anywhere

ruby talon
#

Then type this in chat to receive your emoji id:
\emoji

pine edge
#

If the bot is on other server he can't send the emoji i think

sick cloud
#

yes they can

pine edge
#

sure ?

ruby talon
#

They can.

pine edge
#

I go trying

ruby talon
#

I'm sorry I proposed my question wrong.
I mean like this:

class Client:
    def __init__(self, secret_token):
        self.token = secret_token

    class User:
        def __init__(self, user):
            self.user = user
        
        @property
        def login(self):
            utils.login(user_name=user, secret_token=token)
>>> client = Client(secret_token="xXxXxXxXxXx)
>>> user = client.User(user='name')
>>> user.login

So how do you assing the secret_token variable to the first self.token?

abstract crow
twilit rapids
#

Is message defined correctly

abstract crow
#

Yes

twilit rapids
#

Are you sure

abstract crow
#

I got this issue once for the past 3 weeks

twilit rapids
#

It could be DMs

abstract crow
#

Ooo good point

#

That would make sense

#

I was going to say that I had already fixed this issue with regular messages

solar quarry
#

Try changing member to author and see if that works

abstract crow
#

I can't

#

Then I can't get the display color

solar quarry
#

Well I know message.author is a thing but I don't know about message.member if you want to get info about the person that sent the message it would be message.author

#

Hi

inner jewel
#

webhooks also dont have members

jolly notch
#

So happy my bot got accepted

plain dove
#

same

jolly notch
#

Is it better to have 1 bot that can do everything

#

or 10 bots that do one specific task

earnest phoenix
#

generally people like a bot that's designated to do one thing

#

as then they can mix and match features to their liking

jolly notch
#

Wow

#

I just restarted my bot and now I have 66816 members

onyx summit
#

Trend goes to having
1-2 Features, perfectly implemented
instead of
10-50 Features shitty implemented

jolly notch
#

Are rpg bots actually worth making?

earnest phoenix
#

if you don't rush it and it's quality, yes

jolly notch
#

Whats this server's member count?

twilit rapids
#

65032

jolly notch
#

So I have 1000 and something other people in my other servers

#

I feel so happy

twilit rapids
#

epic

jolly notch
#

I think my bot just crashed

earnest phoenix
#

How make it ?

+help ping ?

#

Use option.match("ping") ?

#

I have a question : For discordv12 is guild.iconURL
but what is it for the current version?

twilit rapids
#

Both guild icons and user avatars are functions now, so use the iconURL function instead

stray garnet
#
const fs = require("fs")
let coins = require("../coins.json");

module.exports.run = async(client, message, args, la) => {
  
  let amount = args.join(" ")
  
  if(!coins[message.author.id]) {
    return message.channel.send("You do not have any Coins!")
    }
    let ccoins = coins[message.author.id].coins
    let amout = args[0];
    if(ccoins < amout) return message.channel.send("You do not have enough Coins!")
    let result = ["lose", "win"]
    let resault = Math.floor((Math.random() * result.length))
    if(result[resault] === "lose") {
        coins[message.author.id] = {
            coins: ccoins - parseInt(amout)
        }
        fs.writeFile("./coins.json", JSON.stringify(coins), (err) => {
            if(err) console.log(err)
          });
      const embed = new Discord.RichEmbed()
      .setDescription(`You Bet **${args[0]}**\n🎰\nAnd lost **${amout}**`)
      .setColor("RED")
          message.channel.send(embed)
    }
    if(result[resault] === "win") {
        coins[message.author.id] = {
            coins: 3 * parseInt(amout) + ccoins
        }
        fs.writeFile("./coins.json", JSON.stringify(coins), (err) => {
            if(err) console.log(err)
          });
      const embed = new Discord.RichEmbed()
      .setDescription(`You Bet **${args[0]}**\n🎰\nAnd Won **the 3x Amount of your Bet**`)
      .setColor("GREEN")
          message.channel.send(embed)
          return;
}
}
module.exports.help = {
    name: "gamble",
    aliases: []
}```

how can i make it that the `args[0]` gets displayed multiplied 3 times?
so that when i do !gamble 1000 and i win that this gets displayed: ```You Won 3000```
jolly notch
#

Python is so much easier

earnest phoenix
#

@twilit rapids so?

twilit rapids
#

so use the iconURL function instead

earnest phoenix
#

example :

#

.setThumbnail(message.guild.iconURL)

#

?

#

@twilit rapids

twilit rapids
#

use the iconURL function instead

earnest phoenix
#

but

twilit rapids
#

No buts

#

use it

earnest phoenix
#

Can you give me an example?

twilit rapids
#

I'm not here to spoonfeed you

earnest phoenix
#

please

twilit rapids
#

Read. The. Docs.

#

Do you even know what a function is

grim aspen
twilit rapids
#

That's stable, not master

grim aspen
#

fuck

stray garnet
#

@earnest phoenix .setThumbnail(iconURL)

twilit rapids
#

No

slender thistle
#

Hint: function()

earnest phoenix
#

no

stray garnet
#

Wait oh

#

fck

#

i just red all that stuff

twilit rapids
#

Did you really

#

Since when do bot developers not know what a function is

#

😩

grim aspen
#

bruh

earnest phoenix
#

thats what happens when you use youtube tutorials

twilit rapids
#

YouTube tutorials are fine if you have knowledge yourself

slender thistle
#

Or don't learn the language itself and its basics

twilit rapids
#

I mean, a function is one of the first things you encounter while developing a bit

#

I bet they all have them in their code

slender thistle
#

Well that's obviously

twilit rapids
#

even msg.channel.send() is one

#

😩

slender thistle
#

But do they know that it's named a function Delthonkang

twilit rapids
#

😩

earnest phoenix
#

so

#

guild.icon ?

twilit rapids
#

😩

#

Maybe you should learn the basics of JavaScript first

earnest phoenix
#
        return new Promise(async function(resolve, reject){
            // Check if it's the good version
            try {
                guild.iconURL();
            } catch(error){
                if(error.message.includes("guild.iconURL is not a function")){
                    return reject("You must install and use discord.js version 12 or higher to use this package!");
                }
            }```
twilit rapids
#

Where did you get that code from

earnest phoenix
#

How do we install Discord v12?

#

@twilit rapids A friend's module

grim aspen
#

install it by package...

onyx summit
#

npm i discord.js/discord.js afaik

earnest phoenix
#

thx @onyx summit

onyx summit
#

But just use the version property of d.js instead of checking if that function works

twilit rapids
#

version 12 or higher

onyx summit
#

discord.js version 13 when????

earnest phoenix
#

no

twilit rapids
#

probably never

onyx summit
#

But version locking for packages should be made in package.json / package-lock.json, not in the code

earnest phoenix
#
npm ERR!
npm ERR! error: cannot run ssh: No such file or directory
npm ERR! fatal: unable to fork
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /home/container/.npm/_logs/2019-08-23T12_31_05_041Z-debug.log```
abstract crow
#

Ok so I need some help here. 1 or 2

  1. I keep my current domain, vinniehat.tk, and append pbs.vinniehat.tk as my bot dashboard
  2. I keep my current domain, vinniehat.tk, and have a separate domain for my bot.
    My bots name is Project BlueSquare, if we go route 2 what domain should it be?
onyx summit
#

I mean, tk domains are free, so I would just get a new one

#

@earnest phoenix my bad, it's npm install discordjs/discord.js

earnest phoenix
#

uh OK xd

#

thx u bro

topaz fjord
abstract crow
#

That is what I was thinking

topaz fjord
abstract crow
stray garnet
#
const fs = require("fs")
let coins = require("../coins.json");

module.exports.run = async(client, message, args, la) => {
  
  let amount = args.join(" ")
  
  if(!coins[message.author.id]) {
    return message.channel.send("You do not have any Coins!")
    }
    let ccoins = coins[message.author.id].coins
    let amout = args[0];
    if(ccoins < amout) return message.channel.send("You do not have enough Coins!")
    let result = ["lose", "win"]
    let resault = Math.floor((Math.random() * result.length))
    if(result[resault] === "lose") {
        coins[message.author.id] = {
            coins: ccoins - parseInt(amout)
        }
        fs.writeFile("./coins.json", JSON.stringify(coins), (err) => {
            if(err) console.log(err)
          });
      const embed = new Discord.RichEmbed()
      .setDescription(`You Bet **${args[0]}**\n🎰\nAnd lost **${amout}**`)
      .setColor("RED")
          message.channel.send(embed)
    }
    if(result[resault] === "win") {
        coins[message.author.id] = {
            coins: 3 * parseInt(amout) + ccoins
        }
        fs.writeFile("./coins.json", JSON.stringify(coins), (err) => {
            if(err) console.log(err)
          });
      const embed = new Discord.RichEmbed()
      .setDescription(`You Bet **${args[0]}**\n🎰\nAnd Won **the 3x Amount of your Bet**`)
      .setColor("GREEN")
          message.channel.send(embed)
          return;
}
}
module.exports.help = {
    name: "gamble",
    aliases: []
}```


how can i make it that the args[0] gets displayed multiplied 3 times?
so that when i do !gamble 1000 and i win that this gets displayed: 
You Won 3000
abstract crow
#

Number(args[0]) * 3

west spoke
#

^

abstract crow
#

But check if it is not a number 🙂

#

Make sure I can't type !gamble memes

stray garnet
#

wait how can i to this

#

@abstract crow

west spoke
#

literally how they sent it

stray garnet
#

wait thats to much for my retarded brain

stray garnet
#

Got it

#

Thx

tulip wave
#

Imaging getting 3x memes

hollow saddle
#

Can anyone see anything blatantly wrong with this? I’m testing something and it keeps crashing my bot with no response. I think it’s stuck in an infinite loop, just not sure though

const a = '123446360538';
const b = a.split('');

for (let i = 3; i < b.length; i + 3) {
  if (b.length - 3 > 0) {
    b.splice(b.length - i, 0, ',');
  } else {
    break;
  }
}
console.log(b.join(''));
topaz fjord
#

why is i = 3

hollow saddle
#

So I can start out inserting a comma 3 indexes from the end of the array

amber fractal
#

infinite loop

#

crashed my browser aswell

hollow saddle
#

That’s what I thought

topaz fjord
#

and what is the thing supposed to do

#

are you trying to join every item in the array with a comma

hollow saddle
#

Insert a comma every 3 spaces of a string of numbers, like 123,134,124

#

Is there an easier way to accomplish this?

topaz fjord
#

Yes

hollow saddle
#

I mean, I just came up with this loop on the fly and clearly it’s flawed so

topaz fjord
#

Just give me a minute

hollow saddle
#

No problem

#

Oh wait... I just discovered Number.toLocaleString() 🤦

#

My actual value is a number, I was testing with strings since I remembered .splice

#

Damn I could’ve saved so much work for myself lol

opaque eagle
amber fractal
#

The target isnt defined

#

one sec

#

is this eris?

wheat jolt
#

Why you use eris

amber fractal
#

stop

#

just dont

#

it's a preference

lusty dew
#

Eris is not that bad tbh

#

Just don’t know how it works lmfao

west spoke
#

Rule 3c

earnest phoenix
#
TypeError: MessageEmbed is not a constructor```
#

how can i do

smoky spire
#

what version are you using

earnest phoenix
#

v12

wheat jolt
#

How do you define MessageEmbed

earnest phoenix
#
const MessageEmbed = require ("discord.js")```
mossy vine
#

lmao

earnest phoenix
#

what ?

mossy vine
#

const { MessageEmbed } = require('discord.js')

wheat jolt
#

Yup

earnest phoenix
#

it's up to the same

wheat jolt
#

or use new MessageEmbed.MessageEmbed

#

No it's not

#

Try

earnest phoenix
#

ok

onyx summit
#

It's called Object Deconstruction.
And you obviously don't know it, it's worth looking at

#

Not that it's very important, it's just nice to know

wheat jolt
#

@earnest phoenix works now?

earnest phoenix
#

yes thx

wheat jolt
#

Np

earnest phoenix
#

but

#
(node:14) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'calculatedPosition' of undefined
onyx summit
#

highestRole is undefined bolbdance

#

How did you define bUser?

earnest phoenix
#
const { MessageEmbed } = require("discord.js");

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

    if(!message.guild.me.hasPermission("BAN_MEMBERS")) return ("**:x: Je n'ai pas la permission de bannir des membres !**")
    let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    if(!bUser) return message.channel.send("**:x: Veuillez mentionner un utilisateur.**");
    let bReason = args.join(" ").slice(22);
    if(!bReason) return message.channel.send("**:x: Veuillez joindre une raison.**")
    if(!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("**:x: Vous n'avez pas la permission d'utiliser cette commande.**");
    if (bUser.highestRole.calculatedPosition >= message.member.highestRole.calculatedPosition && message.author.id !== message.guild.owner.id) return message.channel.send("**:x: Vous ne pouvez pas bannir cet utilisateur.**");
    if(bUser.hasPermission("BAN_MEMBERS")) return message.channel.send("**:x: Vous ne pouvez pas ban cet utilisateur.**")
    bUser.send("**:warning: Vous avez été bannis du serveur " + message.guild.name + " par " + message.author.username + " pour la raison suivante : " + bReason + "**").catch(err => {
        if(err) {
            console.log("Impossible de DM")
       } 
    }) ```
#

imao

slender thistle
#

message.guild.member(
I have questions

earnest phoenix
#

For information it worked in v11.5.1

onyx summit
#

That's ineffective, but valid

earnest phoenix
#

so ?

wheat jolt
#

Search docs peepoShrug

earnest phoenix
#

yeah

wheat jolt
#

Probably something is deprecated

earnest phoenix
wheat jolt
#

When you define buser

earnest phoenix
#

yes

#

100%

wheat jolt
#

Or that

earnest phoenix
#

yes

onyx summit
#

What version

earnest phoenix
#

i will stay on if bUser has the ban perm so his ban not

#

v12

onyx summit
#

I can't find highestRole in master

wheat jolt
#

Is v12 lauched?

earnest phoenix
#

yes

#

dev version

#

use

wheat jolt
#

So it's not

onyx summit
#

No that I know of, but it's stable enough to use in prod

earnest phoenix
#

npm install discordjs/discord.js

#
wheat jolt
#

Mhm

earnest phoenix
#

you do not have to use it now but I prefer

onyx summit
#

I think he knows what it is, he just wanted to know if it was released

smoky spire
#

It's better in most ways

onyx summit
#

Because its taking quite a while

wheat jolt
#

Yep

#

You're right

#

v12 changed "everything" NotLikeThis

onyx summit
#

But internal sharding still has some problems, so you can't really call it completely stable

smoky spire
#

But you don't have to use internal sharding

onyx summit
#

Ik, but it's a feature of v12, thats why it isn't released ^^

#

U know what I mean

smoky spire
#

ye

earnest phoenix
#

but

#
at Map.find (/home/container/node_modules/discord.js/src/util/Collection.js:173:49)
at Object.module.exports.run (/home/container/commands/admin/ban.js:19:37)```
#

so

#

but imao

#
  let logs = message.guild.channels.find(`name`, "theking-logs");
#

looool

smoky spire
#

You need to use a function in find on master

earnest phoenix
#

ok

#

i don't find lol

#
client
createdAt
createdTimestamp
deletable
deleted
guild
id
manageable
members
name
parent
parentID
permissionOverwrites
permissionsLocked
position
rawPosition
type
viewable
Methods
clone
createInvite
createOverwrite
delete
edit
equals
fetch
fetchInvites
lockPermissions
overwritePermissions
permissionsFor
setName
setParent
setPosition
setTopic
toString
updateOverwrite```
#

i have just this imao

smoky spire
#

what

earnest phoenix
#

i don't find the channels.find in the doc

smoky spire
#

It's on collections

earnest phoenix
#

uh ok

#

where in the site please @smoky spire

smoky spire
#

Put "collection" in the search bar

earnest phoenix
#

good thanks

#

so

#
message.guild.channels.fn("name", "....")```
#

wtf

onyx summit
#

so interesting to see children learning

earnest phoenix
#

im not a children bro

onyx summit
earnest phoenix
#

yes

#

but it's .find

onyx summit
#

then why are you doing channels.fn

earnest phoenix
#

but

onyx summit
#

but?

earnest phoenix
#

(node:14) UnhandledPromiseRejectionWarning: TypeError: fn.bind is not a function

onyx summit
#

code?

earnest phoenix
#
let logs = message.guild.channels.find(`name`, "theking-logs");```
onyx summit
#

so you arent actually reading it

earnest phoenix
#

or

onyx summit
#

interesting

earnest phoenix
#
let logs = message.guild.channels.find(c => c.name == "name")```
onyx summit
#

woahhhh

#

magic

earnest phoenix
#

done ?

onyx summit
#

I guess

earnest phoenix
#

ok

#

wtf

#

TypeError: Cannot read property 'Client' of undefined

const { Discord, MessageEmbed } = require("discord.js");
const client = new Discord.Client();
const botconfig = require("./botconfig.json");
const bot = new Discord.Client({disableEveryone: true});
const fs = require("fs");
const Enmap = require("enmap");
const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('./db.json')
const db = low(adapter)
bot.commands = new Discord.Collection()
const giveaways = require ("discord-giveaways")```
onyx summit
#

oh boi

west spoke
#

eeeek

earnest phoenix
#

what

earnest phoenix
#

i don't see

#

ok

#

but

#

wtf

broken shale
#

Just a quick question, what are your indent sizes

west spoke
#

5

rocky jay
#
const Discord = require("discord.js")
const client = new Discord.Client()

let prefix = "/"

client.on("message", message => {
    if (!message.guild) return
    let args = message.content.trim().split(/ +/g)

    if (args[0].toLowerCase() === prefix + "clear") {
        if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send("Vous n'avez pas la permission d'utiliser cette commande")
        let count = args[1]
        if (!count) return message.channel.send("Veuillez indiquer un nombre de messages à supprimer")
        if (isNaN(count)) return message.channel.send("Veuillez indiquer un nombre valide")
        if (count < 1 || count > 100) return message.channel.send("Veuillez indiquer un nombre entre 1 et 100")
        message.channel.fetchMessages({
            limit: count
        }).then(() => message.channel.bulkDelete(count))
    }
})```
#
const Discord = require("discord.js");
const client = new Discord.Client();
let { prefix,token,presences } = require('./config.json');
let { remerciments,youtube } = require('../Commandes/index_commandes');
let { clear } = require('../Commandes/Modération/index_moderation');
client.on("ready" , function() {});client.on('ready', function() {
    client.user.setActivity("/help | Codé par Ketji")
     console.log("[LOGS]Bot connecté !")
 });

client.login(" ");

client.on('message', message => {
    const args = message.content.split(" ")
    if(!message.guild) return;
    if(message.author.bot) return;
        if(message.content.startsWith(prefix + 'remerciments')) {
               remerciments.execute(message);
        } else if(message.content.startsWith(prefix + 'youtube')) {
               youtube.execute(message);
        } else if (message.content.startsWith(prefix + 'clear')){
               clear.execute(message);
        }
    }
)```
mossy vine
#

can you send clear from ../Commandes/Modération/index_moderation

rocky jay
#
module.exports = {
    clear: require('./clear'),
}```
mossy vine
#

okay then send ./clear

rocky jay
#

I have only that for clear

mossy vine
#

so ./clear doesnt exist

#

found the root of the issue

#

create it mmLol

rocky jay
#

thinks

slim heart
#

whats the best way of adding a white background to a canvas? i used to use sharp but for some reason it would just create a shit ton of issues and i cant find a better way of doing it

mossy vine
#

is it a good idea to mix arrow functions and regular nameless functions in the same library/package

supple owl
#

If I said

if (message.guild.id == 264445053596991498 && !message.author.id == 184070212012736512) return;

That would make my bot(s) not respond to others on this server, right?

smoky spire
#

ids are strings

#

and that's not how you do not equals

supple owl
#

?

#

what do you mean?

#

by your last message

dusky marsh
#

he is saying to use != but your way still works

smoky spire
#

No it doesn't

#

null == string is never true

dusky marsh
#

wait you right, i had a brainfart 200iq

mossy vine
supple owl
#

ah, hold up.

late hill
#

And one more issue that no one mentioned is that you probably meant to use || instead of &&

#

oh

#

wait, im retarded nvm

topaz fjord
#

replace the second == with !=

#

and turn those numbers into strings

supple owl
#
        if (message.guild.id == 264445053596991498 && message.member.user.id != 184070212012736512) return;
#

this?

topaz fjord
#
if (message.guild.id == "264445053596991498" && message.author.id != "184070212012736512") return;```
supple owl
#

ok

mossy vine
#

no need turtle, == doesnt check for types anyways

#

its just good practice

topaz fjord
#

then change it to ===

late hill
#

(so you might as well change them to === for even better practice)

supple owl
#

alright.

#

thanks.

inner jewel
#

@mossy vine yes you should make them strings

#

regardless of == not checking types

#

because of floating point rounding

mossy vine
#

oh

#

huh

inner jewel
abstract crow
#

Is Sentry used while developing to track errors or after the first version etc comes out

inner jewel
#

i'd rather get the errors on my terminal while developing

abstract crow
#

Same

#

Also one other thing. Do you know how I can use folders for my EJS files instead of just having them in the views section?

onyx summit
#

Sentry is meant for production

#

afaik

#

At least it doesn't make any sense to use in development, it's slower and less accurate than having the console output

abstract crow
#

Right

#

Is having one big server.js file better than having a separate file for each thing like login, etc?

earnest phoenix
#

anyone have problems with memory leak in js, when looping over promises ?

#

this works fine when i run it once, but as soon as i set it in a loop it eventually crashes from running out of memory

late hill
#

Well

onyx summit
#

@abstract crow Would be better to make the project modular. it makes everything more readable and modular

late hill
#

Do you ever remove stuff from postList

#

If you just keep looping and adding to it

#

Perhaps that's the problem?

earnest phoenix
#

yeah

#

just noticed that @late hill

#

still crashes though t,t

unique nimbus
#

wait is it adding more things to postList?

#

maybe make it show in terminal whats in postList maybe its duplicating itself

earnest phoenix
#

this is only from one run though

#

but it should clear the list before every loop

unique nimbus
#

¯_(ツ)_/¯

earnest phoenix
#

in postList = [];

quartz kindle
#

you dont need async in there, you also dont need to await postList.length

earnest phoenix
#

the end result is same right ?

quartz kindle
#

you also dont need Promise.all at all, unless post.id is a promise, but im pretty sure its not

inner jewel
#

no

#

actually nvm

#

btw Promise.all(...).then(console.log(postList)) will ignore the result of the promises

earnest phoenix
#

yeah, first time im messing with promises inside a loop >.<

onyx summit
#

correction:
yeah, first time im messing with promises inside a loop >.<

quartz kindle
#

if i understand what you're trying to do and what that reddit package is doing, you can rewrite the entire code simply into js postList = await r.getSubreddit(subreddit).refresh.getHot().map(t => t.id)

earnest phoenix
#

my main goal is just to loop through the posts of a subreddit, check their upvotes and save the id of posts with n or more upvotes

quartz kindle
#

then add a filter

#
postList = (await r.getSubreddit(subreddit).refresh().getHot()).filter(t => t.ups > 1).map(t => t.id)```
earnest phoenix
#

dunno why but it's still crashing ?

onyx summit
#

uhhhh

#

error would be helpful?

earnest phoenix
#

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

#

same error

onyx summit
#

are you joking

#

a while true?

#

never do while(true) without any way of delaying or stopping it, this will completely block the event loop.
and you run out of memory because you console log stuff
https://github.com/nodejs/node/issues/3524
console.log is async and will fill the memory, and because you are blocking the event loop it will never be freed

earnest phoenix
#

oh.

#

setInterval() exists

#

the idea was to have it constantly run, so as soon as a post got x amount of upvotes it would be saved into postList

onyx summit
#

and,

  1. your timeout won't timeout, it will instantly run in the next tick
  2. your loop will run as fast as it can and won't give a fuck about that timeout
earnest phoenix
#

so use setinterval() instead ?

onyx summit
#

you want to check every 2 seconds?

#

then setInterval will do

#

read that

#

you arent using setTimeout correct, it will run instantly

quartz kindle
#

you also dont need to declare a timeout variable, you also dont need to declare an empty array in postList

#

in fact you dont need postList at all because its inside a function

#

you can return it directly instead

#
    return (await etc).etc;
}
onyx summit
#

That code reminds me of my early js times lol
I understood the very basics in c# but in js It kinda looked like this

earnest phoenix
#

well it certainly is my early js days :d

#

also started with c basic myself

quartz kindle
#

well, lesson number one: never use while(true)

#

xD

earnest phoenix
#

but honestly, i don't think i would ever realize that without your guys help xD

#

also, if i can't use console.log

#

is there an alternative to check that my loops work ?

quartz kindle
#

you can use console.log

earnest phoenix
#

just not in while(true) ?

onyx summit
#

just not in a while(true) loop

earnest phoenix
#

aight

quartz kindle
#

never use while(true) in general for anything

onyx summit
#

just remember:
while (true) without any delay or method to stop it, will completely kill js

twilit rapids
#
while(true)
return;
quartz kindle
#

very funny

twilit rapids
#

yes

earnest phoenix
#

i thought, timeout would have added an delay

#

but apparently not

#

you're essentially queuing infinite tasks

quartz kindle
#

but one of the only actual good use cases for a while loop is as an inverted for loop js let i = 100; while(i--) { //do something } because it is faster than a for loop

onyx summit
#

well, you can use timeout different, then it will work

quartz kindle
#

for everything else, a regular for loop will do just fine

#

the performance difference is minimal

inner jewel
#

@onyx summit that timeout is correct```js

setTimeout(() => console.log(Date.now()), a = 2000); Date.now()
1566597563501
1566597565501```

#

<thing> = <value> evaluates to <value>

onyx summit
quartz kindle
#

yes it does, its just an unneeded declaration lul

onyx summit
#

doesnt matter, the loop will still run without giving a fck bout the timeout

quartz kindle
#

yup

inner jewel
#

tim: that's useless microoptimization

quartz kindle
#

yup

inner jewel
#

any half decent compiler will be able to optimize

onyx summit
#

but confuses people, like me

quartz kindle
#

microoptimization can be useful with heavy computation

#

but in 90% of the cases its really not needed

inner jewel
#

if you're doing heavy computation you wouldn't be using js

onyx summit
#

Natan always corrects me with tiny stuff and then I feel like I don't even know js Angery

topaz fjord
#

you don't

inner jewel
#

and any language that's used for heavy computations will optimize that kind of thing

onyx summit
#

I probably get paid because I look good, and not for writing ts/js (jk I dont look good)

quartz kindle
#

regardless, it exists and can be used, so why not

#

there are plenty cpu-intensive js stuff out there, such as pure-js implementations of some algorithms to be used in browsers

onyx summit
#

just write a cpp module and use it in node bolbparty

inner jewel
#

also the while is most likely going to be worse

#

make that while while(i--)

#

the pseudocode below is for that

earnest phoenix
#

so this doesn't work because the console.log executes before stuff is pushed to postList, right ?

onyx summit
#

why u awaiting postList.length

earnest phoenix
#

wait

quartz kindle
#

interesting, that must be something new then

#

last time i tested (1-2 years ago), while was faster than for, now it isnt anymore

earnest phoenix
#

oh right

#

the await thing was because of my old code

peak quail
#
console.log( "Permissions " + server.me.permissions.toArray())

do you guys know how to list this like
PERM 1
PERM 2
PERM 3

twilit rapids
#

This is one way to do it

onyx summit
#

I think he just wants to join this with \n lol

peak quail
#

I think he just wants to join this with \n lol
yes

#

: \

twilit rapids
earnest phoenix
#

oh i found why i had problems

inner jewel
#

because util.inspect

#

easier to just Array#join the permissions

earnest phoenix
#

changed > to >=

abstract crow
#

Should I make a separate file just for managing my dashboard for ejs? Like I have all of my routing in 1 single server.js file and it is getting messy, so I didn't know if I should just call a separate file with the dashboard

onyx summit
#

I really think you should make it modular

earnest phoenix
#

you should split your files

inner jewel
#

just put all the code in a single file mmLol

onyx summit
#

we have a 700 Lines mock express server at work mm

slim heart
#

whats the logistics behind everytime a user sends a message that gets censored, changing a webhook and sending it again with the words censored? because itd be doing a lot to change the webhook, it could be really spammy, not sure

late hill
#

You just pass the icon and name in the post request

earnest phoenix
#

don't waste your time on word filters, they'll always be bypassed no matter how much you try, context > profiling

to achieve what you want, you need to subscribe to the event which fires when you receive a message, compare it against your filter, if there's anything to be filtered, send the message with a webhook but it's username and avatar to match the author, delete the original message

late hill
#

Just get a team of slaves staff

abstract crow
slim heart
#

@earnest phoenix ive already built everything around my bot and it works really well actually but thats besides the point

#

the issue is the actual webhook i feel like itd be spammed

lusty dew
#

How could I write a cooldown to my better-sqlite3 database

#

I already have the column in the db

#

It’s default set to 0

quartz kindle
#

you mean a command cooldown?

hushed berry
#

sqlite probably isnt the best choice for that kind of thing

#

unless youre not doing what i think youre doing

lusty dew
#

What do you think I’m doing @hushed berry

#

I’m making a daily cmd

#

For my economy system

hushed berry
#

oh i see

lusty dew
#

Yea

#

I’m curious what did you think I was doing

#

👀

quartz kindle
#

command cooldown probably

#

like "wait 5 seconds before you can use again"

#

for a daily command, depends on your definition of "daily"

lusty dew
#

Every 24h

quartz kindle
#

reset 24 hour from last command? reset at noon/midnight?

lusty dew
#

The cmd can be used

#

No

#

Say they used the cmd now

#

It’s 5:37pm for me rn

#

They’d have to wait till 5:37pm tomorrow

quartz kindle
#

so 24h from last command

lusty dew
#

To use the cmd again

#

Yep

quartz kindle
#

so when they use the command, save the timestamp

#

when they use the command again, check the saved timestamp, and compare it to the current timestamp

#

if the difference is smaller than 24h, display error

#

else execute command and save a new timestamp

#

the problem with this is that if the person forgets to use it again, or uses it later, then the 24h lock follows them

#

ie person uses at 5pm, next day person uses it at 9pm, the third day they have to wait until 9pm

#

so they use it again at 11pm or something

#

eventually they will lose a day

#

but this is the easiest method

lusty dew
#

How do I get the time stamp of when they last used the cmd?

quartz kindle
#

when they use the command, you save it to your sqlite

#

then you get it back

#

how to save it and get it depends on your sql structure

lusty dew
#

Okay how do I get the time stamp though.

quartz kindle
#

Date.now()

#

or new Date().valueOf()
or new Date().getTime()

lusty dew
#

Okay

#

Me and my other devs logic was:
remain = lastUsed + cooldown - now

quartz kindle
#

thats an option yes

#

with that option, you would check if the remain is negative or not

lusty dew
#

I was gonna check if remain is greater then or equal to 1 day.

quartz kindle
#

assuming your cooldown is 1 day, that math will always get either a negative value, or a positive value smaller than 1 day

lusty dew
#

Wdym?

quartz kindle
#

now will always be bigger than lastUsed

#

so if lastUsed + cooldown are smaller than now (more than 24h passed), the result will be a negative number

lusty dew
#

So my math is incorrect?

quartz kindle
#

its not incorrect

#

just a different way

#

using that method, you would have to check if(remain < 0) { more than 24h passed }

lusty dew
#

Ah

#

And else 24 hasn’t passed

quartz kindle
#

yup

lusty dew
#

So I send the error message?

quartz kindle
#

yes

lusty dew
#

Okay thanks

#

Wait

#

Wouldn’t I want to check if it’s less then or equal to?

#

Or just less then

quartz kindle
#

the difference is 1 millisecond

#

so pretty much whatever

#

one has to be extremely unlucky to use the command exactly 1 millisecond before the cooldown passes

mossy fjord
#

@earnest phoenix

abstract crow
#

Ok so I want to organize my work in a Trello Board(s). How should I organize the following:
Bugs
Suggestions
To Do
Finished
Do I put them all in one board etc or make separate boards for each thing besides the todo and finish

warm marsh
#

Colour code each thing?

abstract crow
#

Right but how should I set my boards up

#

Board 1

To Do
Bugs
Suggestions
Doing
Done

spare goblet
#

@abstract crow change "doing" to "working on"
and "done" to "completed" ty

bahahaha suggestions shouldnt be on the board imo cuz then the list would be hella long

opaque eagle
#

Bugs can be in To-Do with a tag

lusty dew
#

I have a bit of a problem. One of my cmds just stopped working out of the blue (It is no longer responding or throwing any errors) . It’s acting like it doesn’t exist cause when I do -help setNick it doesn’t show the cmd info but it will for other cmds.

wheat carbon
#

I need help

#

How do I know who invites a discord bot?

#

I keep on banning it but it keeps on rejoining

#

Now how do I fix this

loud salmon
#

@wheat carbon you cant ban a discord bot, you need to find the people who have Manage Server permissions and ban them. Someone is abusing their permission to invite it over and over again

wheat carbon
#

Well what if they're higher than me?

#

Ok thanks

#

@loud salmon how do I know who invites them?

loud salmon
#

then you're kinda screwed if they are higher than you

#

¯_(ツ)_/¯

#

i dont think there is an easy way to tell

wheat carbon
#

Ok thanks for helping

abstract crow
#

Ok so I need some more suggestions lol sorry guys! What should I add for stats about a guild, stats for a user, and stats for a user in THAT guild.
Like I have stats for the user, then the member in that guild, and I also just have guild stats

dusky marsh
#

Can I get an image buffer from a Discord image's URL somehow?
I am trying to preserve images that are deleted with the use of a snipe command

slim heart
#

@dusky marsh You can make a request to the image URL that you can get from Message#attachments, depends on the lib you use you can either turn decoding off or request a buffer, for example with node-fetch on .then you'd do response.buffer() and thatll give you a buffer

dusky marsh
#

Yeah I was trying to get a buffer that way but none of it was working, so I just dug around in the attachments object and found I could use .proxyURL instead of just the .url

slim heart
#

so that works ?

dusky marsh
#

Yep

slim heart
#

👌

dusky marsh
#

Thanks for the help tho 👍

rugged whale
#

.setMentionable(true), .setHoist(true), .setColor() arent working

slim heart
#

explain aren’t working, errors, what’s happening etc

mossy vine
#

@rugged whale what library (and which version) are you using?

main chasm
#

hello

rugged whale
#

discord js

mossy vine
#

stable or master?

rugged whale
#

its not making role mentionable

#

master

main chasm
#

who can send me vedio how add bot to bot list

mossy vine
main chasm
#

say now found

mossy vine
#

wrong link, i edited it with the right one

#

@rugged whale does your bot have the right permissions to interact with the role

rugged whale
#

yea it does

#

it has administrator

main chasm
#

bro

rugged whale
#

i tried in eval cmd too

mossy vine
#

is it above the roles youre trying to interact with

rugged whale
#

nd other servers too

#

it has highest role

mossy vine
#

any errors?

rugged whale
#
const perms = ['ADMINISTRATOR', 'MANAGE_ROLES']

const k = args.split(' ').join(' ')

const role = message.guild.roles.find(m => m.name.toLowerCase().includes(k.toLowerCase()))

  if(!message.guild.me.hasPermission(["MANAGE_ROLES", "ADMINISTRATOR"])) return message.channel.send("I dont have permission to perform this command!")

if (!message.member.hasPermission(perms)) return message.channel.send('No permission.');

if (!role) return message.reply("Couldn't find role named " + k)

if (message.guild.me.highestRole.comparePositionTo(role) <= 0 && message.member.id !== message.guild.ownerID) return message.channel.send('I dont have permissions to manage that role!!')  
 
if (message.member.highestRole.comparePositionTo(role) <= 0) return message.channel.send(':youtried: You cant play with that role boi!:youtried:');

if (!role.mentionable)

{role.setMentionable(true).then(message.channel.send(`${message.author.tag} just pinged ${role}`)).then(role.setMentionable(false))
return
};

 message.channel.send(`${message.author.tag} just pinged ${role}`);

  }
}```
#

no error is coming

#

see code

#

i used function too

main chasm
mossy vine
#

is it sending anything?

rugged whale
#

catch too

mossy vine
#

wrong person

rugged whale
#

ye

mossy vine
#

@main chasm your long description field doesnt contain 300 characters

rugged whale
#

it just sends @rugged whale mentioned <@&265125253443878912>

#

or role name

main chasm
#

ok thanks bro @mossy vine

rugged whale
#

but doesnt make it mentionable

#

nor it hoists role in .setHoist

mossy vine
#
if (!role.mentionable)

{role.setMentionable(true).then(message.channel.send(`${message.author.tag} just pinged ${role}`))
    role.setMentionable(false)
return
};```
thats not how you do callbacks
rugged whale
mossy vine
#

you are doing the callback incorrectly

rugged whale
#

see edited code

#

i tried tht too..

#

nd see ss i sent

#

it doesnt make role mentionable...

mossy vine
#
if (!role.mentionable)

{role.setMentionable(true).then(_ => {
    message.channel.send(`${message.author.tag} just pinged ${role}`))
    role.setMentionable(false)
    return
    }
};```
#

you could also do _.setMentionable(false) instead

#

i dont think it matters

rugged whale
#

...

#

it doesnt make it mentionable

#

// Set the name of the role
role.setName('New Name')
.then(updated => console.log(Edited role name from ${role.name} to ${updated.name}))
.catch(console.error);

late hill
#

Don't you think you'd have to await sending the message

quartz kindle
#

setMentionable is a promise, as well as sending a message

late hill
#

It could possibly set it back before the message was sent

quartz kindle
#

^

mossy vine
#

oh god

#

ok

earnest phoenix
#

its good

#

but

#

i have problem

mossy vine
#

i hope you deleted it because you realized your obvious mistake

earnest phoenix
#

i have this :

#
(node:14) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'client' of undefined
at new MessageEmbed (/home/container/node_modules/discord.js/src/structures/MessageEmbed.js:13:60)
at Object.module.exports.run (/home/container/commands/utilitaires/help.js:9:25)
at Client.client.on.message (/home/container/theking.js:225:33)
at Client.emit (events.js:203:15)
at MessageCreateHandler.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:198:13)
(node:14) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)```
#

but

#

in the help.js

#

i have

#
const { MessageEmbed } = require('discord.js')


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

            var choix = new MessageEmbed()
            .setColor("BLACK")```
#

how can i do

mossy vine
#

okay so wheres the problem

#

that code isnt really relevant

earnest phoenix
#

here :

#

var choix = new MessageEmbed()

mossy vine
#

can you show your help.js file

mossy vine
#

so whatever youre passing as the client parameter is wrong

earnest phoenix
#

How do I do it

#

@mossy vine

mossy vine
#

where are you calling it and what are you passing to it

earnest phoenix
#

const Discord = require("discord.js");
const MessageEmbed = Discord
const client = new Discord.Client();

mossy vine
#

first of all, what the fuck is that second line
second, thats not what i asked for

earnest phoenix
#

I translate because I am French and the translation is bad

#

i have this : where are you calling and what are you going to her

#

wot

mossy vine
#

where are you calling the function and what are you passing to it

formal basin
#

lol

earnest phoenix
#

I call it in the index.js:

client.commands = new Enmap ();
fs.readdir ("./commands/admin/", (err, files) => {
  if (err) return console.error (err);
  files.forEach (file => {
    if (! file.endsWith (".js")) return;
    let props = require (`./commands/admin/${file}`);
    let commandName = file.split (".") [0];
    client.commands.set (props.help.name, props);
  });
});```

and I want him to pass that `client = require ("discord.js')`
formal basin
#

:\

earnest phoenix
#

so @mossy vine ?

mossy vine
#

still not helpful

formal basin
#

lol

earnest phoenix
#

What do you want?

mossy vine
#

@formal basin do you wanna help or just say unhelpful things

#

i want to see where the function is called and what variables you are passing to it

formal basin
#

uh

#

im not here

earnest phoenix
#

uh ok

#

this @mossy vine ?

#
  client.on("message", message => {
    if(message.author.bot) return;
    if(message.channel.type === "dm") return;
    if(!message.guild.me.hasPermission("SEND_MESSAGES")) return;
    if(!message.guild.me.hasPermission("EMBED_LINKS")) return;
    
    let prefix = botconfig.prefix
  
    
    if(!message.content.startsWith(prefix)) return;
  
    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);
  
    let commandfile = client.commands.get(cmd.slice(prefix.length));
    if(commandfile) commandfile.run(client, message, args);
    if(message.content.indexOf(prefix) !== 0) return;
     
});```
prisma lion
#

.

mossy vine
#

yes

earnest phoenix
#

ok

mossy vine
#

now how is client defined?

earnest phoenix
#

on the top

#

const client = new Discord.Client();

mossy vine
#

how do you define Discord

earnest phoenix
#

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

mossy vine
#

okay

#

im out of ideas

#

no clue whats happening

#

sorry

prisma lion
#

dm bot

mossy vine
#

what

earnest phoenix
#

ok cyber

prisma lion
#

working still another 9 paragraphs if u wantt

mossy vine
#

are you just gonna post code without any context

prisma lion
#

mm

#

i think i can give free

#

idk

mossy vine
#

???

prisma lion
#

nvm

mossy vine
#

do you need help with something or what

prisma lion
#

mm

#

nvm

#

srry

stray garnet
#
const fs = require("fs")

exports.run = async (bot, message, args) => {
    if(!args[0]) return message.channel.send(`
You must provide an Channel! (without #)
        `)
    let report = JSON.parse(fs.readFileSync("./logss.json", "utf8"));
    report[message.guild.id] = {
        reportchannel: args[0]
    };
    fs.writeFile("./logss.json", JSON.stringify(report), (err) => {
        if(err) console.log(err)
    });
    message.channel.send(`
The Logs Channel is now: **${args[0]}**!`)
}
module.exports.help = {
  name: "setlogs",
  aliases: []
}```

uh probaly an dumb question but why isnt it writing anything in `logss.json`?
earnest phoenix
#

Maybe the destination

#

Is wrong

#

fs.writeFile

#

angeryBOYE json database

stray garnet
#

@earnest phoenix the dest is right

#

@earnest phoenix ik ik

hollow saddle
#

That data is definitely getting corrupted sooner or later

opaque eagle
#

Using a database is so much easier than JSON

stray garnet
#

@hollow saddle nah

#

my bot is just in 27 servers

opaque eagle
#

Still

#

Using a database is easier than JSON

#

And JSON will get corrupted regardless of how many guilds your bot is in

stray garnet
#

Im having an Coin System on JSON and it never got Corrupted

earnest phoenix
#

just because it never did doesn't mean it never will

opaque eagle
#

Well you do you, but we’re likely not going to help you with it

earnest phoenix
#

it's a mistake waiting to happen

stray garnet
#

@opaque eagle wym

opaque eagle
#

IRL if you go to the doctor but refuse to listen to their years of expertise, there’s little they could do to help you with your problem. Same applies for our code suggestions.

stray garnet
#

kk

grim aspen
#

that should be pinned ^^

stray garnet
#

so.

#

whats worng with my code

grim aspen
#

maybe logss.json

#

logs.json should be it maybe?

#

just thinking

stray garnet
#

Thats the Error that i get when i run the Command:

Could not find node null, using 10

#

what does that mean?

earnest phoenix
pine edge
#

Nice @earnest phoenix

stray garnet
#

Looks great

earnest phoenix
#

i need to make it fetch users now instead of show ids

opaque eagle
#

Add dark mode tho

earnest phoenix
#

thankfully, material ui allows that to be done easily

opaque eagle
#

Lol

earnest phoenix
#

i literally just need to append type: "dark" to my theme object

mossy vine
#

i love it, both the ui and the way it works

tight forum
#

uh i have a problem

#
bot.on('guildMemberAdd', member => {
    member.guild.channels.get('607970023331332096').setName(`Member Count: ${member.guild.memberCount}`);
});

this event was running up to 2 minutes ago.

#

but its not working now

earnest phoenix
#

it's not a command

#

and you probably got ratelimited

tight forum
#

oh i know

#

event*

earnest phoenix
#

the event is for every guild

#

you need to fetch if the channel exist in the current guild

tight forum
#

.setName of undefined it says

#

oh.

broken shale
#

you're using an event

earnest phoenix
#

if(member.guild.id !== 'yourguildid') return;

#

@tight forum

broken shale
#

I don't see how that helps

earnest phoenix
#

Correct code bot.on('guildMemberAdd', member => { if(member.guild.id !== 'yourguildid') return; member.guild.channels.get('607970023331332096').setName(`Member Count: ${member.guild.memberCount}`); }); @tight forum

tight forum
#

yes i did it

#

let me try

mossy vine
#

if a user joins a server that doesnt have the channel, it will error @broken shale

tight forum
#

thank you sm @earnest phoenix !

earnest phoenix
#

np

stray garnet
#

what does that mean:

Could not find node null, using 10

small prairie
#

Question: Can we get the total number of channels in a server i know there are certain commands but dunnoi how to umplement using discord js

#

@anyone form the worls

#

world*

#

@flat pelican

#

anyone form the whole world

stray garnet
#

why u ping an Mod? its unnecessary

small prairie
#

sorry

stray garnet
#

just sayin

small prairie
#

@stray garnet youknow answer?

mossy vine
#

have you tried reading the docs

flat pelican
#

I only code python cause the floor is java

grim aspen
#

the floor is ruby

#

for me

earnest phoenix
west raptor
#

@earnest phoenix looks really nice

earnest phoenix
#

thanks xx

#

hey i use glitch right . if i list my bot on dbl and i wanted to add voting system does the port have to be ran through 3000 ?

#

cause i have a dashboard running through port 3000 already

#

can u run vote system and dashboard through PORT : 3000

west spoke
#

dont use glitch... glitch sucks. Forward from a raspberry pi, or a actual webhook server .... for christ's sake reeee

lament meteor
#

@earnest phoenix u can run a seperate route on ur website on glitch for the webhook

west spoke
#

^

lament meteor
#

but just to be clear glitch is not meant to be for bots

west spoke
#

^

lament meteor
#

its meant for websites

west spoke
#

Your bot may suddenly go offline

lament meteor
#

^^

west spoke
#

because it get banne

earnest phoenix
#

oh

lament meteor
#

ya sometimes glitch ips are banned from discord

west spoke
#

ip bans are still happening

#

Yup

earnest phoenix
#
        let adduser = message.mentions.users.first()
        if(!adduser) return message.channel.send("**:x: Veuillez mentionner un utilisateur. Exemple : t/ticket-adduser <@id>**")

        await message.channel.overwritePermissions({
            permissionOverwrites: [
              {
                  id: adduser.id,
                  allow: ['VIEW_CHANNEL', "SEND_MESSAGES", "ATTACH_FILES"],
              },
            ],
              reason: 'Ajout de l\'accès à un utilisateur a un ticket.'
            });```

Why does it put the whole server and not just for the person mentioned?
#

which d.js version is that

#

v12

#

For her it's been a week that I recode my bot to the module v12 xd mdr

merry sail
#

@earnest phoenix tu sais comment faire un systeme de ticket ??

brave anvil
#

I need help because i have a discord dashboard hosted on my local host and its port forwarded

mossy vine
#

what do you need help with

brave anvil
#

Well

#

I need it secured and on an actual website

earnest phoenix
#

buy a vps and a domain

#

point your domain dns to your vps

mossy vine
#

you can use nginx as a reverse proxy and certbot to get ssl, and what cry said

brave anvil
#

...

#

?

earnest phoenix
#

@merry sail oui

brave anvil
#

Nginx is a

onyx summit
#

yes?

brave anvil
#

So I have alocal hosted database

onyx summit
#

what

earnest phoenix
#

what

onyx summit
#

and?

#

what has that to do with nginx

brave anvil
#

Will it interfere with that

earnest phoenix
#

nginx is a web server

onyx summit
#

dafuq? no

brave anvil
#

Okay

#

Sorry I’m new to coding

onyx summit
#

nginx is a webserver, but can also work as reverse proxy and load balancing

brave anvil
#

Aahah

merry sail
#

@earnest phoenix tu pourrais me montrer stp N

brave anvil
#

XD

opaque eagle
#

What

brave anvil
#

So can I use

#

Nginx if I use apache on my home pc

#

And host from my house?

tight heath
#

bad idea

#

you probably neither have a static ip

brave anvil
#

Ok....

earnest phoenix
#

you generally shouldn't selfhost websites

tight heath
#

nor a stable connection

brave anvil
#

Ok

tight heath
#

and also you're prone to ddos attacks

earnest phoenix
#

hosting websites drains bandwidth and that ^

brave anvil
#

Okay thank you for that information

tight heath
#

galaxygate has web hosting for like $2

#

a month

brave anvil
#

OwO

tight heath
#

might wanna use that

brave anvil
#

Lemme look

onyx summit
#
  1. Hosting on your main pc is probably more expensive than renting a vps
  2. static ip?
  3. security issues
  4. bandwidth
west spoke
#

AWS has web hosting for $11 /y

brave anvil
#

I use go daddy for my

#

Main website

west spoke
#

e.e

brave anvil
#

...

#

What?

onyx summit
#

sure, do that

west spoke
#

nothing

brave anvil
#

Its safe for my main

tight heath
#

godaddy is ultra gae

#

anyways

onyx summit
brave anvil
#

Okie

tight heath
#

@onyx summit where the fucketh

brave anvil
#

XD

onyx summit
#

go daddy

earnest phoenix
#

what the fuck

onyx summit
tight heath
#

i can get that for $5 at GalaxyGate

earnest phoenix
#

milking money

onyx summit
#

ik

brave anvil
#

I dont use that

tight heath
#

with better response time

#

lol

brave anvil
#

I dont use vps

onyx summit
#

k

brave anvil
#

Here

earnest phoenix
#

godaddy is trash anyways, their domain register is overpriced too

tight heath
#

ye

#

and porkbun

onyx summit
#

what domain thingy would you recommend?
I wanna get a second domain

tight heath
#

go to

#

enter the domain

#

and choose the cheapest

brave anvil
#

...

#

wow

earnest phoenix
#

namecheap has good offers

onyx summit
#

okay I'm not mentally challenged...

tight heath
#

no

#

namecheap is overpriced af

earnest phoenix
#

i got really good deals out of them

brave anvil
#

I’ll check out galaxy gate

tight heath
#

@onyx summit wdym

brave anvil
#

Where are their servers

#

?

tight heath
#

Staten Island, NYC

brave anvil
#

Okie

#

Nice

onyx summit
#

you explain it like I'm mentally retarded and can't use a website

tight heath
#

no not really

earnest phoenix
#

you can get free one year domain with any TLD on name.com through this year's github student pack too

tight heath
#

that too

#

github doesn't accept my student bs tho

#

so

#

ravy.xyz is only 41 cents per year

onyx summit
tight heath
#

so idrgaf

onyx summit
#

shit already taken

brave anvil
#

I could

#

OwO

earnest phoenix
#

ım turkısh

brave anvil
#

Get a domain for cheaper on godaddy

earnest phoenix
#

türk varmi

brave anvil
#

Then transfer owo

earnest phoenix
#

xyz TLD is really bad

#

Bay Bay

tight heath
#

no shit

#

lol

brave anvil
#

...

#

xyz

tight heath
#

but it is also very cheap

brave anvil
#

You mean

#

Huh?

earnest phoenix
#

they're mostly used by spammers and phishers, as a result it's blacklisted from most services

tight heath
#

no they're not

#

lol

#

but they're still cheap af

earnest phoenix
#

well, not mostly, but in a large quantity

tight heath
#

i mean the scammers possibly

#

but i meant the blacklisting

#

that's just not tru

earnest phoenix
#

i have yet to confirm it

tight heath
#

i mean my main domain is a .gg

#

so

#

shroog

earnest phoenix
#

what i do know though is that xyz domains get pushed down on google search results

onyx summit
#

wait where can I use my student benefits on github?

earnest phoenix
onyx summit
#

ahh thanks

tight heath
#

@earnest phoenix yeah but tbh if you try to get SEO with anything not .net, .com, or .org you're just lost

#

¯_(ツ)_/¯

earnest phoenix
#

true

tight heath
#

.xyz is used because it's meant for misc things

#

and hence cheap

#

I own like 50 domains and none of them has good seo because they dont need to lol

#

oh since we're at .xyz

#

@twilit rapids your domain you mango

#

I need an a record to point it to

onyx summit
#

damn, gh is awesome

#

did know you get that much shit from it

earnest phoenix
#

remember when everyone said github is going to get ruined once microsoft bought it lol

onyx summit
#

chy.fail

#

buy buy buy

brave anvil
#

Is there anyways

#

Get a domain and forward my dashboard to it

earnest phoenix
#

can you please type your message in one instead of
sending it
like this
its
quite annoying

brave anvil
#

Okie

#

Yes?

brave anvil
#

Okie

onyx summit
#

shit, I wanted is-a.fail

#

but already taken

brave anvil
#

i just got a domain

earnest phoenix
#

i have stopbeingabad.dev

brave anvil
#

And

onyx summit
#

DAMN

#

being-a.fail is free

brave anvil
#

Huskyprotector.xyz

onyx summit
#

cool

brave anvil
#

Mhm

mossy vine
#

im.being-a.fail/ure

brave anvil
#

XD

tight heath
#

ok bois

#

but have you ever owned the let it go chorus

#

@earnest phoenix no

#

i

#

wont

onyx summit
#

just got being-a.fail

tight heath
#

ovh is trash

onyx summit
#

is good?

earnest phoenix
#

:c

brave anvil
#

Is ovh good?

onyx summit
#

i think its kinda pricy

mossy vine
#

@onyx summit you better make im.being-a.fail/ure an image hosting domain

brave anvil
#

XD

tight heath
#

imma buy

earnest phoenix
onyx summit
#

@mossy vine sure think!
I already got upload.chilo.space, but nahhh

tight heath
#

dbl.sucks

brave anvil
#

Digital Ocean

tight heath
#

@earnest phoenix i have owned something among the lines of pls-kill.me

earnest phoenix
brave anvil
#

XD

earnest phoenix
grave pilot
#

How do I check the ping from my ubuntu server to the discord api?

#

With a ping command

earnest phoenix
#

in which library

grave pilot
#

Ubuntu