#development

1 messages · Page 1163 of 1

pure lion
#

Are you have brain damage?

#

You don't need backticks

weak rain
#

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

#

now ?

pure lion
#

Why don't you try it and see

weak rain
#

hm

pale vessel
#

use !==

weak rain
#

kk

ionic dawn
#
if (message.author.id !== ('YOUR I')){
        return;
    }
#

something like that using !==

pale vessel
#

parenthesis moment

earnest phoenix
#

Bruh

#

!==

pure lion
#

Same diff

ionic dawn
#

cutted from one test bot

pure lion
#

Also spoonfeed

earnest phoenix
#

No

ionic dawn
#

nah isnt

#

we explaining him

pure lion
#

Es em h

earnest phoenix
#

Allow me to explain

pure lion
#

Also imagine using {}

#

In an if

ionic dawn
#

how can we explain code without showing any code

pale vessel
#

but dice, rem? good choice, i'm so proud of you

pure lion
#

:D

earnest phoenix
#

Random Edgy Memory

ionic dawn
#

this guy isnt talking anymore so.. problem solved I guess

polar temple
#

help pls
emoji animated not working

pure lion
#

Can't do emojis as field names

restive furnace
#

^

polar temple
#

setDescription is possible?

misty sigil
#

yes

polar temple
#

can i +1 setDescription?

#

i am used 2 setDescription

#

only 1 appeared

#

sorry my english

misty sigil
#

no

#

there can be only one description

polar temple
#

:c

misty sigil
#

you can use emojis in field body

#

but not in field title

#

I think

small zenith
#

Anyone here who knows how to convert a website like ht tps://youtube.com/c/ItzRockstarYT to json format and get channel details like subs and total views?

#

but not in field title
@misty sigil We can use emoji in field title

#

I have used

#

in d.js v12

misty sigil
#

no, no you can’t?

polar temple
#

``` .addField(:RAGE:,oi)

#

not working

#

for me

#

sorry my english

small zenith
weak rain
#

how to use

#

guild create

#

event

small zenith
#

@polar temple <:emojiname:emojiId:>

weak rain
#

@small zenith <a:emojiname:emojiid:>

#

for animated

misty sigil
#

guild create
@weak rain it emits a guild member object

small zenith
#

or ```js
let emoji = client.emojis.cache.get("id")

.addField(${emoji} Title, "Value")```

#

How to convert a website like ht tps://youtube.com/c/ItzRockstarYT to json format and get channel details like subs and total views?

misty sigil
#

you’d need to use the api

#

you can’t really just convert a website into json

small zenith
#

YouTube API?

misty sigil
#

yea

small zenith
#

Ok

#

what about other webstie likes FB Page

thick gull
#

find the API if there is one

delicate shore
#

oh wait wrog channel

#

fuck

ionic dawn
delicate shore
#

@ionic dawn change ur nick

polar temple
delicate shore
#

remove the : in the end

misty sigil
#

Yea

polar temple
#

ok

misty sigil
#

ID doesn’t need the : at the end

ionic dawn
#

No?

delicate shore
#

<a:id:name>

#

like this

polar temple
#

ow shit

#

ok

delicate shore
#

oh wait

#

no

pale vessel
#

pepega

delicate shore
#

<:a:id:name>

#

this

earnest phoenix
#

whatsup gamers

weak rain
#

: )

pale vessel
#

<a:id:name>*

delicate shore
#

r u sure?

misty sigil
#

yes

delicate shore
#

ah yes

#

i checked it

#

lol

polar temple
#

i too

#

'<a:NAME:ID>'

#

not working

#

for me

#

didn't 1 out of 2 work

#

"<a:NAME:ID>" and "<:a:NAME:ID>"

misty sigil
#

its <a:name:id>

#

and the bot has to be in the same server

polar temple
#

yes

#

are and nothing changes

cinder patio
#

you can try doing client.emojis.get("the custom emoji ID")

polar temple
#

Hello, I'm Brazilian and I don't have this content here, I would really like this progress bar, can someone help me?

#

its <a:name:id>
@misty sigil It worked, thanks c:

pure lion
#

@misty sigil what do we have left to do other than delete?

polar temple
#

sim

#

ow shit

#

yes**

earnest phoenix
#

how do people still not know how to calculate percentages

polar temple
#

I saw it but I didn't understand how to assemble it in the code: C

earnest phoenix
#

LMAO

#

lol

#

tfw your entire bot is based on copypasting from samples

polar temple
#

no

earnest phoenix
#

tfw your entire bot is based on copypasting from samples
@earnest phoenix that's how all great bots are made

polar temple
#

I did everything so far on the embed but this progress bar doesn’t have anything like it here, so I don’t know where it starts, and I already have a lot

earnest phoenix
#

just stop..

#

if you cant notice that the code provided isn't js then you should stop

golden condor
#

It's not python, this is js

polar temple
#

you're right 04:40 should i go to sleep

earnest phoenix
#

I don't recall being responsible for your sleep time

polar temple
#

wow,you are arrogant

#

flw seu arrombado

earnest phoenix
wanton anvil
#

can I have multiple bot prefixes??

golden condor
#

Yes

wanton anvil
#

how??

#

can i pass a list

golden condor
#

Just program it to have multiple prefixes

#

Yes

wanton anvil
#

thanks @golden condor

earnest phoenix
#

😐

#

[/]

#

im trying to make logger someone got good ideas

viral iris
#

what's wrong?

fluid basin
#

titles do not support markdown or mentions

viral iris
#

that field

#

not title

fluid basin
#

yes field title

#

lol

viral iris
#

oh yea got it

#

any idea ?

fluid basin
#

don't use mention then

opal plank
#

@earnest phoenix thats favela language, means 'bye you asshole'

#

fields name cant have mentions iirc

#

nor title

earnest phoenix
#

Hi, i just made a rank command and i have this error saying Cannot read property 'users' of undefined and I have already defined it but i have the same error.

opal plank
#

nor footer

#

show code @earnest phoenix

golden condor
#

Code?

earnest phoenix
#
const { MessageAttachment, MessageEmbed } = require("discord.js")
const Canvacord = require("canvacord");
const { match } = require("ffmpeg-static");
const { Attachment } = require("canvacord");
const canvacord = require("canvacord");


module.exports = {
    name: 'rank',
    description: "rank command",
    async execute(client, message, args) {

        let user = message.mentions.users.first() ||
            client.users.cache.get(args[0]) || match(args.join(" ").toLowerCase(), message.guild) ||
            message.author

        let level = client.db.get(`level_${user.id}`) || 0
        level = level.toString()
        let exp = (client.db.get(`xp_${user.id}`) || 0).toString()
        let neededXP = Math.floor(Math.pow(level / 0.1, 2)).toString()

        let every = client.db
            .all()
            .filter(i => i.ID.startsWith("xp_"))
            .sort((a, b) => b.data - a.data)
        let rank = every.map(x => x.ID).indexOf(`xp_${user.id}`) + 1
        rank = rank.toString()

        const card = await canvacord.rank({
            username: user.username,
            discrim: user.discriminator,
            level: level,
            rank: rank,
            neededXP: neededXP.toString(),
            currentXP: exp.toString(),
            avatarURL: user.displayAvatarURL({ format: "jpg" }),
            color: 'RANDOM'

        })
        const MessageAttachment = new MessageAttachment(card, "rank.png")
        return message.channel.send(MessageAttachment)


    }

}
opal plank
#

which line ?

golden condor
#

client is undefined?

opal plank
#

@earnest phoenix show the error line

golden condor
#

Why are you using ffmpeg-static for it lol

opal plank
#

assuming its line 15

#

add a breakpoint/console log the user after its been defined

#

see whats going on with it @earnest phoenix

earnest phoenix
#

wait

#

TypeError: Cannot read property 'users' of undefined

golden condor
#

Yes then client is undefined

#

Or...

#

message.mentions

earnest phoenix
#

Oh okay

golden condor
#

Can you show your message event?

earnest phoenix
#

you mean client.on?

golden condor
#

Yes

#

Like

#

client.on("message"

#

Show the code within that

earnest phoenix
#
client.on('message', async message => {
    let prefix = db.get(`prefix_${message.guild.id}`)
    if (prefix === null) prefix = "h!";
    if (!message.content.startsWith(prefix) || message.author.bot) return; //if the content does not start with the prefix or author is a bot
    const args = message.content.slice(prefix.length).split(" ");

    if (!message.content.startsWith(prefix)) return;
    const command = args.shift().toLowerCase();
    const commandFiles = `./commands/${command}.js`;
    if (fs.existsSync(commandFiles)) {
        require(`./commands/${command}.js`).execute(message, args);
    } else {
        message.channel.send("error, not found");
    }



golden condor
#

Ah

#

Can you show another command, does it just take message, args or client, message, args?

#

Also you have two checks in the message startsWith the prefix

earnest phoenix
#
const discord = require("discord.js")
const { NovelCovid } = require("novelcovid");
const track = new NovelCovid();

module.exports = {
    name: 'covid',
    description: "covid",
    async execute(message, args) {

        if (!args.length) {
            return message.channel.send("Please give the name of country or try using ``As!corona all``")
        }

        if (args.join(" ") === "all") {
            let corona = await track.all() //it will give global cases

            let embed = new discord.MessageEmbed()
                .setTitle("Global Cases")
                .setColor("#ff2050")
                .setDescription("Sometimes cases number may differ from small amount.")
                .addField("Total Cases", corona.cases, true)
                .addField("Total Deaths", corona.deaths, true)
                .addField("Total Recovered", corona.recovered, true)
                .addField("Today's Cases", corona.todayCases, true)
                .addField("Today's Deaths", corona.todayDeaths, true)
                .addField("Active Cases", corona.active, true);

            return message.channel.send(embed)



        } else {
            let corona = await track.countries(args.join(" ")) //change it to countries

            let embed = new discord.MessageEmbed()
                .setTitle(`${corona.country}`)
                .setColor("#ff2050")
                .setDescription("Sometimes cases number may differ from small amount.")
                .addField("Total Cases", corona.cases, true)
                .addField("Total Deaths", corona.deaths, true)
                .addField("Total Recovered", corona.recovered, true)
                .addField("Today's Cases", corona.todayCases, true)
                .addField("Today's Deaths", corona.todayDeaths, true)
                .addField("Active Cases", corona.active, true);

            return message.channel.send(embed)


        }


    }
}
#

Also you have two checks in the message startsWith the prefix
@golden condor where is that

golden condor
#

So you need to change the command you just showed

earnest phoenix
#

wdym

fluid basin
#

wot

golden condor
#

So

fluid basin
#

@viral iris no markdowns, no mentions, no formatted text

golden condor
#

You know the rank command

earnest phoenix
#

yeah

golden condor
#

You need to change it go

#

execute(message, args)

earnest phoenix
#

Ah

golden condor
#

And you can define client

#

By doing this

#

const client = message.client;

viral iris
#

so This won't work ?

fluid basin
#

yes

#

it wont

golden condor
#

You can do that iirc @viral iris

earnest phoenix
#

oh okay

golden condor
#

If you do this

viral iris
#

do what?

golden condor
#
`__This__`
viral iris
#

what about ping role ?

golden condor
#

Wdym

#

Like pinging a role with it

#

?

earnest phoenix
#

I have another error saying ReferenceError: match is not defined

golden condor
#

You defined that at the top, no?

#

Show the changed code

viral iris
#

Like pinging a role with it
@golden condor ye

earnest phoenix
#

okay

viral iris
#

<@&roleid>

#

like this i think

earnest phoenix
#
const { MessageAttachment, MessageEmbed } = require("discord.js")
const Canvacord = require("canvacord");
//const { Attachment } = require("canvacord");
const canvacord = require("canvacord");


module.exports = {
    name: 'rank',
    description: "rank command",
    async execute(message, args) {
        const client = message.client;
        let user = message.mentions.users.first() ||
            client.users.cache.get(args[0]) || match(args.join(" ").toLowerCase(), message.guild) ||
            message.author

        let level = client.db.get(`level_${user.id}`) || 0
        level = level.toString()
        let exp = (client.db.get(`xp_${user.id}`) || 0).toString()
        let neededXP = Math.floor(Math.pow(level / 0.1, 2)).toString()

        let every = client.db
            .all()
            .filter(i => i.ID.startsWith("xp_"))
            .sort((a, b) => b.data - a.data)
        let rank = every.map(x => x.ID).indexOf(`xp_${user.id}`) + 1
        rank = rank.toString()

        const card = await canvacord.rank({
            username: user.username,
            discrim: user.discriminator,
            level: level,
            rank: rank,
            neededXP: neededXP.toString(),
            currentXP: exp.toString(),
            avatarURL: user.displayAvatarURL({ format: "jpg" }),
            color: 'RANDOM'

        })
        const MessageAttachment = new MessageAttachment(card, "rank.png")
        return message.channel.send(MessageAttachment)


    }

}
golden condor
#

I'm not sure if you can

honest perch
#

@golden condor can you fix

golden condor
#

What does the match function do?

viral iris
#

i'll test

feral aspen
#
        throw new Error(`The class ${this.constructor.name} may not be instantiated!`);
        ^

Error: The class Canvacord may not be instantiated!
    at new Canvacord (C:\Users\hajji\OneDrive\Desktop\Attitude\node_modules\canvacord\src\Canvas.js:25:15)
    at Object.<anonymous> (C:\Users\hajji\OneDrive\Desktop\Attitude\commands\social\rank.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at load (C:\Users\hajji\OneDrive\Desktop\Attitude\handlers\command.js:7:26)
    at C:\Users\hajji\OneDrive\Desktop\Attitude\handlers\command.js:12:96```
earnest phoenix
#

It's the prefix i think but i can remove it

feral aspen
#

Anyone knows what is wrong

golden condor
#

Also I would suggest doing message.guild.members.cache.get(args[0]) instead

#

of the client.users.cache.get

viral iris
#

ping not working

earnest phoenix
#

okay

honest perch
#

CALLUM

golden condor
#

I'm not sure why you are using the match function, can you try remove it and see what happens?

honest perch
#

Ffs

fluid basin
#

@viral iris apologies, only no ping for field name

honest perch
#

Can you just fix earth

earnest phoenix
#

okay

viral iris
#

ok ;-;

golden condor
#

Misly what the fuck do you fucking want

#

You are starting to get on my nerves

honest perch
#

What a roadman

#

You are starting to get on my nerves
@golden condor ytho

golden condor
#

I don't think the match function is very important in this case @earnest phoenix

earnest phoenix
#

Alright

golden condor
#

Try it now

earnest phoenix
#

(node:21076) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

golden condor
#

Show?

earnest phoenix
#
const { MessageAttachment, MessageEmbed } = require("discord.js")
const Canvacord = require("canvacord");
//const { Attachment } = require("canvacord");
const canvacord = require("canvacord");


module.exports = {
    name: 'rank',
    description: "rank command",
    async execute(message, args) {
        const client = message.client;
        let user = message.mentions.users.first() ||
            message.guild.members.cache.get(args[0]) || message.author

        let level = client.db.get(`level_${user.id}`) || 0
        level = level.toString()
        let exp = (client.db.get(`xp_${user.id}`) || 0).toString()
        let neededXP = Math.floor(Math.pow(level / 0.1, 2)).toString()

        let every = client.db
            .all()
            .filter(i => i.ID.startsWith("xp_"))
            .sort((a, b) => b.data - a.data)
        let rank = every.map(x => x.ID).indexOf(`xp_${user.id}`) + 1
        rank = rank.toString()

        const card = await canvacord.rank({
            username: user.username,
            discrim: user.discriminator,
            level: level,
            rank: rank,
            neededXP: neededXP.toString(),
            currentXP: exp.toString(),
            avatarURL: user.displayAvatarURL({ format: "jpg" }),
            color: 'RANDOM'

        })
        const MessageAttachment = new MessageAttachment(card, "rank.png")
        return message.channel.send(MessageAttachment)


    }

}
golden condor
#

Huh

#

Which line does it come from?

earnest phoenix
#

The define bit i think

golden condor
#

The error should tell you the line I think

earnest phoenix
#

This: (rank.js:15:31)?

#

idk..

golden condor
#

What is on line 15?

earnest phoenix
#
let level = client.db.get(`level_${user.id}`) || 0
golden condor
#

client.db doesn't exist

#

Oh right

#

message.client should work

ionic shard
#

CS:GO:
is there any api i can use to get rank of someone?

earnest phoenix
#

okay

golden condor
#

Uh

#

I'm not sure why it has done that

#

Unless client.db doesn't exist

#

In your main file

#

Can you say

#

client.db = db

#

Like somewhere near the top but after db and client have been defined

earnest phoenix
#

Oh okay

#

Do i have to put the quick.db thing at the top?

golden condor
#

Just put it underneath where you have defined db

earnest phoenix
#

okay

#

Cannot read property 'users' of undefined

golden condor
#

What the.

earnest phoenix
#

...

golden condor
#

Maybe

#

It's because there is no mentions

#

In the message

earnest phoenix
#

But i put message.mentions.users.first() ?

golden condor
#

Yeah but there might be no mentions in the message

earnest phoenix
#

wait

#

i got this

#

but idk what happened at the bottom

golden condor
#

That'll be to do with CanvaCord

earnest phoenix
#

Oh

#

How do i fix it then

sleek apex
#

i need help to js

honest perch
#

Maybe ask

#

How do i fix it then
@earnest phoenix once you get xp

earnest phoenix
#

wdym?

#

So if i have xp, that will disappear?

honest perch
#

Yes

earnest phoenix
#

Cool!Thanks!

#

And thanks @golden condor

golden condor
#

np

sleek apex
#

i need help to js

honest perch
#

Omg

#

Ask your question then

#

I dont have mind reading abilities

thick gull
#

hey

#

they need help to JavaScript

honest perch
sleek apex
#

yah

thick gull
#

do you need any base tutorials for it?

#

or is there a language barrier

earnest phoenix
#

I have another question about the command. So if i talk more, it will rank up automatically?

split vapor
#

The newer beta update for android bug does not display for discord calls.

honest perch
#

I have another question about the command. So if i talk more, it will rank up automatically?
@earnest phoenix you need to do leveling yourself

golden condor
#

@earnest phoenixyou need to code that

earnest phoenix
#

I just did and thanks

earnest phoenix
#

Is it legal to embed Bitcoin mining scripts on my website? That's the only alternative I have to ads and ads suck

#

also

#

is there anything that i can use to mine it anyways

honest perch
#

Is it legal to embed Bitcoin mining scripts on my website? That's the only alternative I have to ads and ads suck
@earnest phoenix don't do it

#

That's just being a dick

#

No one agreed for their pcs or phones to mine btc

split hazel
#

if it was possible I'm sure a lot of shady sites would make you stay while mining bitcoin in the background

earnest phoenix
#

No one agreed for their pcs or phones to mine btc
@honest perch it's in my TOS

#

they agreed

honest perch
#

Not if they randomly go to the site

#

Also it will earn you 0 money

#

Usually these scripts are blocked and sites blacklisted from google

split hazel
#

and I doubt they will stay long enough to mine anything if it would work

#

ads are your best bet

honest perch
#

Or a premium plan for your bot

winter basalt
#

oh nice ive come to a weirdchamp development moment

royal portal
#

ok so

#

not sure why

#

if (command === 'test' || command === 'test1') { is kinda broken

#

you can say test

#

and then test1

#

but you have to say it multiple times

#

for it to actually work

carmine summit
#

you must define command

royal portal
#

yes i did that

#

the bot just restarts

#

the test1 doesnt work

#

but the test works

carmine summit
#

dont put number

royal portal
#

it doesnt even work without the number

#

you gotta say it like 5 times for it to work

carmine summit
#

if (command === 'test'){}else if (command === 'test2'){}

weak rain
#

how can i use custom domain on GitHub

carmine summit
#

do you own the custom domain?

weak rain
#

i will get from Freenom

#

free domains

honest perch
#

Go to settings

carmine summit
#

im not sure about that

honest perch
#

Then github pages

#

Then set a domain

weak rain
#

i have to set a domain

#

which i have?

#

@honest perch

#

or any

honest perch
#

The one you own

#

Lmao

weak rain
#

XD

ionic dawn
#

elif instead of ||

low phoenix
#

How can I make an API JSON query in discord.js?

ionic dawn
#

A request?

low phoenix
#

yes

ionic dawn
#

fetch or whatevwr

honest perch
#

Node fetch

low phoenix
#

Do you have an example?

ionic dawn
#

look at google

#

The node-fetch package

#

Look at the api examples

quartz kindle
#

or any other http library such as axios got bent superfetch superagent etc, including the built in http and https modules

weak rain
#
DNS verification failed

thunder2op.tk doesn't appear to be served by Netlify
We can’t provision a certificate until your DNS configuration is pointing at the Netlify servers and the changes have propagated.

If you’ve already changed your DNS configuration, allow up to 24 hours for the changes to be processed, or check our troubleshooting guide for some tips on what might be happening.

Go to troubleshooting guide

Retry DNS verification
Provide your own certificate```
#

what to do

honest perch
#

You need to add dns records

weak rain
#

where

#

i m rebuying

#

what to do?

#

hey Misly can u help? @honest perch

ionic dawn
#

Thats not a "domain"

#

Its a redirection

weak rain
ionic dawn
#

You cant edit the favicon

weak rain
#

so from where i can

#

buy domain

#

for free

ionic dawn
#

Get a domain?

#

Free? Nowhere

#

And: Buy a free domain

#

Isnt weird?

weak rain
#

bruh

earnest phoenix
#

ads are your best bet
@split hazel I don't have a bank account to receive the ad cash
Or a premium plan for your bot
@honest perch my bot is completely free
Usually these scripts are blocked and sites blacklisted from google
@honest perch there is an option to disable it

honest perch
#

Just dont

split hazel
#

then how will you redeem the crypto currency to real money without any of those (90% of stores do not support crypto)

cinder sandal
#

how to make the arguments without commas
like
argument argument2
and not
argument,argument2

quartz kindle
#

split on commas instead of spaces?

cinder sandal
#

split on spaces instead of commas

quartz kindle
#

change it to spaces then

weak rain
#
  console.log('I m ready to Go | Thunder is OP')
  client.user.setPresence({ game: { name: 'tr!help | tr!invite | A all in one bot made by Thunder OP' }, status: 'idle' })

  const API = new DanBotHosting.Client("api-key", client);
    // Start posting
    let initalPost = await API.autopost();
 
    if (initalPost) {
      console.error(initalPost); // console the error
    }
})
#

why is my status

#

removed

#

after some time

quartz kindle
#

presences may be lost during disconnects and reconnects

#

if you set it in your client options instead, then it wont be lost

#

because it will be reapplied on all reconnects

cinder sandal
#

same happens with me but the presence is random it changes every 5 minutes, and sometimes it changes to no presence

weak rain
#

so what should i do

cinder sandal
#

sometimes the random presence changes, but to the same presence

quartz kindle
#

define it in your client options instead of the ready event

#

like this

weak rain
cinder sandal
#

so what should i do
@weak rain wait until i shows the presence, happens when reconnecting the bot

quartz kindle
#
const client = new Discord.Client({
    presence: {
        activity: "your activity here"
    }
});
weak rain
#

ohk

quartz kindle
#

also, isnt game deprecated?

#

you should use activity instead

weak rain
#

hm

quartz kindle
#

which version of discord.js are you using?

weak rain
#

v12

quartz kindle
#

weird... there is no game anywhere in the v12 docs

weak rain
#

......

#

well how should i setup random status @quartz kindle

quartz kindle
#

set up an interval

#

for example

weak rain
quartz kindle
#
client.once("ready",() => {
  setInterval(() => {
    client.user.setPresence(...)
  }, 60000)
})
#

with a randomized presence in there

#

also, your ready event should be .once not .on

cinder sandal
#

well how should i setup random status @quartz kindle
@weak rain search on google random messages and put them ast he status and make setInterval so it updates every [value] miliseconds

quartz kindle
#

because with .on it may be emitted more than once, during hard disconnects, outages and such, so it may screw up your stuff

cinder sandal
#

also, your ready event should be .once not .on
@quartz kindle what's the diffrence between .once and .on?
i have .once

weak rain
cinder sandal
#

should i use .once or .on?

weak rain
#
    console.log(' Bot is online now!');
    let statuses = [
        `tr! | ${client.guilds.cache.size Servers`,
        `tr! | ${client.users.cache.size Users`,
        `tr!help | tr!invite | A all in one bot made by Thunder OP`
        
    ]
    setInterval(function(){
            let status = statuses[Math.floor(Math.random() * statuses.length)];
            client.user.setActivity(status, {type:"WATCHING"})
    
        }, 3000) //Seconds to Random



});```
#

this type will work?

pure saddle
#

try it and see

weak rain
#

kk

earnest phoenix
#

You want it to generate a different status every 3 seconds? Isn't that considered API spam?

weak rain
#

so what time should i set

carmine anvil
#

You want it to generate a different status every 3 seconds? Isn't that considered API spam?
@earnest phoenix that's most likely not even in the ratelimits lol

weak rain
#

15sec will work?

fringe axle
#

Try and see

cinder sandal
#

how to make it generate random number between a number and a number
discord.js

#

normally it generates numbers like 0.999999999

summer torrent
#

Math.random() * (max - min) + min;

cinder sandal
#

in an ${} ?

#

i need to put it with some other text

jolly quail
#

Store it in a variable and use it wherever u want..

cinder sandal
#

ty

finite bough
#

@cinder sandal u want whole numbers?

#

like

#

1, 2,3

cinder sandal
#

between a number(max) and a number(min)

finite bough
#

yea that works

#

also

#

u can floor it

cinder sandal
#

and also put it in a ${}

finite bough
#

let random = Math.floor(Math.random() * number)

cinder sandal
#

ty, but why let? const is the same

#

or not

digital ibex
#

what

sinful belfry
#

the value of a const can never change

#

it is constant

#

let can be changed

cinder sandal
#

oh

#

thanks for explaining

sinful belfry
#

but it is different to var, as let will only apply to the current block if that makes sense

#

you can't access its value from outside of that block, whereas with var you can

cinder sandal
#

just replacing it with var?

earnest phoenix
#

Help with bot pliz

sinful belfry
#

@earnest phoenix your bot?

earnest phoenix
#

Yes

#

I cant open the bot on rdp @sinful belfry

sinful belfry
#

are you getting any errors?

#

would you mind explaining what exactly you're trying to do

earnest phoenix
#

Yes i get errors

sinful belfry
#

what error?

earnest phoenix
#

node server.js

#

This errors

#

@sinful belfry

sinful belfry
#

i'm not entirely sure to be honest, i'd suggest you try re-installing your modules (because it looks like you may have a file missing here and there)

#

otherwise if that doesn't work, just wait for someone who knows what they're talking about to get here lol

earnest phoenix
#

Ok

opaque eagle
#

Based on Discord and DBL's rules, would it be ok for me to have an "upvote leaderboard" on my bot's website?

#

which has their name and avatar

#

on a leaderboard

fringe axle
#

Yea I think.

earnest phoenix
#

How do i set a code that can separate my folders

finite bough
#

export the data

#

then require it in the file u want

earnest phoenix
#

Im trying to do this:


    const commandmodFiles = `./commands/Mod/${command}.js`;
    if (fs.existsSync(commandmodFiles)) {
        require(`./commands/Mods/${command}.js`).execute(message, args);
    } else {
        message.channel.send("error, not found");
    }

but doesn't work

finite bough
#

thats the full thing?

earnest phoenix
#

I think so?

#

wait that's not the full code in my index

finite bough
#

no i mean

azure quail
#

how i see my node.js version

rustic ridge
#

node -v

finite bough
#

@azure quail node -v

rustic ridge
#

in cli

finite bough
#

lol

earnest phoenix
#

no i mean
@finite bough ?

finite bough
#

like

#

is that the full thing u are using to get the files from other folder?

earnest phoenix
#

Yeah

finite bough
#

its incomplete then

#

and also depends upon the the file u are reading

earnest phoenix
#

I have this above:

for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command);
neat harness
finite bough
#

@neat harness life

neat harness
#

cry

finite bough
#

@earnest phoenix and whats above it

earnest phoenix
#
const fs = require('fs'); //fs = file system module
const { execute } = require('./commands/addrole');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
neat harness
#

how do I make a gacha bot

#

like with percentages and stuff

rustic ridge
#

yes

finite bough
#

the starting looks fine

earnest phoenix
#

...

finite bough
#

Im trying to do this:


    const commandmodFiles = `./commands/Mod/${command}.js`;
    if (fs.existsSync(commandmodFiles)) {
        require(`./commands/Mods/${command}.js`).execute(message, args);
    } else {
        message.channel.send("error, not found");
    }

but doesn't work
is this inside a message event scope?

earnest phoenix
#

Yeah

neat harness
#

Is this too complicated for a ping command?

module.exports = {
  name: "ping", // Command Name
  async execute(
  client, message, args, Discord,
  config, auth, guild, channel,
  color, prefix, emoji, def, login,
  dev
  ) {
    // Command Starts Here //
    var avtr = message.author.avatarURL()
    if (!message.author.avatarURL()) {
      var avtr = def.noimg
    }
    const eembed = new Discord.MessageEmbed()
      .setAuthor(config.client.info.name, config.client.image.avatar)
      .setColor(color.yellow)
      .setDescription("**Pinging...**")
      .setTimestamp()
      .setFooter(config.client.settings.footer , config.client.image.avatar);
    const msg = await message.channel.send(eembed);
    const embed = new Discord.MessageEmbed()
      .setAuthor(config.client.info.name, config.client.image.avatar)
      .setColor(color.default)
      .setTitle("Ping Result")
      .addFields(
        { name: "Latency", value: `**${msg.createdTimestamp - message.createdTimestamp}ms**`, inline: true },
        { name: "API Latency", value: `**${Math.round(client.ws.ping)}ms**`, inline: true }
      )
      .setTimestamp()
      .setFooter(`${message.author.username} pinged`, avtr);
    msg.edit({embed: embed});
  }
};
finite bough
#

yes

neat harness
#

Oh

#

I was trying to keep the looks

#

So it looks decent

finite bough
#

well

#

not bad tho

neat harness
#

My bot got rejected twice, then accepted, then removed, then reaccepted, then removed again.

#

First was because of eval command leak

finite bough
#

why so

neat harness
#

and second was... Some stuff

finite bough
#

@earnest phoenix can ya show me the full block?

earnest phoenix
#

sure

neat harness
#

why so
@finite bough I kinda screwed up the perms for the eval command and gave everyone eval perms

earnest phoenix
#
const Discord = require('discord.js')
const Client = require('discord.js')
const config = require('./config.json');
const client = new Discord.Client();
const db = require("quick.db")
client.db = db
const request = require('request');
//const ytdl = require("ytdl-core");
const canvacord = require("canvacord");
const covid = require('novelcovid')



client.on('ready', () => console.log('hedwig is online'))
client.on("ready", () => {
    client.user.setActivity("Hedwig | h!help", { type: "PLAYING" })
})
const fs = require('fs'); //fs = file system module
const { execute } = require('./commands/addrole');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command);
}


client.on('message', async message => {
    let prefix = db.get(`prefix_${message.guild.id}`)
    if (prefix === null) prefix = "h!";
    if (!message.content.startsWith(prefix) || message.author.bot) return; //if the content does not start with the prefix or author is a bot
    const args = message.content.slice(prefix.length).split(" ");

    if (!message.content.startsWith(prefix)) return;
    const command = args.shift().toLowerCase();
    const commandFiles = `./commands/${command}.js`;
    if (fs.existsSync(commandFiles)) {
        require(`./commands/${command}.js`).execute(message, args);
    } else {
        message.channel.send("error, not found");
    }

    const commandmodFiles = `./commands/Mod/${command}.js`;
    if (fs.existsSync(commandmodFiles)) {
        require(`./commands/${command}.js`).execute(message, args);
    } else {
        message.channel.send("error, not found");
    }
})

client.login(config.token);

finite bough
#

the moderators wont reject it coz of that but you know its coz of the safety of your bot as if people can use eval they can access ur token and can do something bad

neat harness
#

put const outside on client.ready, and mix the log to the bottom one, making only one client.on('ready', ()) call

#

@earnest phoenix

#

No, actually pull everything out of client.on('ready', ())

#

except the log

earnest phoenix
#

Like how?

#

i dont get it

neat harness
#

This is mine

// Load Commands /////////////////////////////////////////
client.commands = new Discord.Collection();
var commandFiles = fs
  .readdirSync(`./resources/commands`)
  .filter(file => file.endsWith(".js"));
for (var file of commandFiles) {
  var command = require(`./resources/commands/${file}`);
  client.commands.set(command.name, command);
  console.log(`Loading command "${command.name}"`);
}
//////////////////////////////////////////////////////////
finite bough
neat harness
#

It's not inside client.on('ready')

#

The above is also another issue i guess

#

but each are differrent @finite bough

#

It's the requiring that's wrong

#
require(`./commands/${command}.js`).execute(message, args);
#

while it calls for mod

finite bough
#

no i am saying

neat harness
#
const commandmodFiles = `./commands/Mod/${command}.js`;
finite bough
#

u have to then read each file

#

not only the commands folder

neat harness
#

I get it but see his code again, the commandmodFiles are wrongly setup

earnest phoenix
#

So i need the for loop as well?

neat harness
#

maybe it causes an error?

#

How do I say this... it's kinda complicated

finite bough
#

No, actually pull everything out of client.on('ready', ())
??

#

the only thing i can see which is inside the ready event scope is setPresence and log

#

lol

neat harness
#

xd

#

Imma blind

#

The code wasn't all that neat

cinder sandal
#

i don't use command handlers

#

they are too hard/or u need to open the command file to ope the command code

finite bough
#

makes stuff easier to find

neat harness
#

true

#

If you have like 80+ commands, then...

earnest phoenix
#

and saves you the repetitiveness of parsing

#

So how do i do the code to put the folder separately

faint prism
#
    if (fs.existsSync(commandmodFiles)) {
        require(`./commands/${command}.js`).execute(message, args);
    } ```

@earnest phoenix Ngl, I really like that approach

earnest phoenix
#

Thanks

faint prism
#

I see too many devs putting their logic with their command handler

#

Separation makes it more maintainable

earnest phoenix
#

Yeah

#

I totally agree

#

that's severly slow though

#

checking if a file exists is a kernel call

faint prism
#

Probably could require the js file at the start rather than on command, true

earnest phoenix
#

or... load all commands and put them in an array/collection

#

which is the usual approach

#

array lookups are faster than kernel calls

#

Do i use for loop for that

faint prism
#

Any IO is usually pretty slow. Preloading the logic at the beginning would avoid any unnecessary latency when calling command logic

earnest phoenix
#

Could i have an example pls

faint prism
#

You may want to iterate over each js file in you commands/ folder, and require them at the start of the application, rather than where it currently is.

earnest phoenix
#

You mean something like this:

module.exports = {
    name: 'mod',
    description: "This is a mod command",
    execute(message, args) {
#

?

faint prism
#

Storing them in an array is a good idea. Then when the command is called, you can search for the command in the array where the item's name = ${command} or something

earnest phoenix
#

Hmm but if i do this, will it work?

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command);

 const commandmodFiles = `./commands/Mod/${command}.js`;
    if (fs.existsSync(commandmodFiles)) {
        require(`./commands/Mod/${command}.js`).execute(message, args);
    } else {
        message.channel.send("error, not found");
    }
pure lion
#

There a way to push something into an array in a mongodb document?

cinder sandal
#

my random status sometimes changes to the same status and remains still, how can i make the random status do it without changing to the same one?
discord.js

honest perch
#

code?

pure lion
#

Check if the new status is the same as the previous status

#

Probably use a while loop

#

Or an if like a normal person

faint prism
#

There a way to push something into an array in a mongodb document?
@pure lion Yeah, it supports objects and arrays of objects

pure lion
#

But the document is already made

#

I want to find => push

fierce arch
#

How do I delete a directory over the command line even if it has files in it? Windows

cinder sandal
#

rmdir?

#

or del

#

rmdir for directory

#

del for file

fierce arch
#

But that says I can't remove a dir with files in

earnest phoenix
#

delete the files using *.* and -r

fierce arch
#

K

earnest phoenix
#

so the directory is clear

faint prism
#

@fierce arch

Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a directory
            tree.

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S```
fierce arch
#

Okay

#

so rmdir /S?

faint prism
#

that's what it looks like

earnest phoenix
#

so rmdir /S /Q "path/to/dir"

fierce arch
#

Wait sorry its on my VPS so linux 🤦‍♂️

faint prism
#

Even easier

#

rm -rf /the/exact/path/be/careful/with/this/command

#

@fierce arch

fierce arch
#

okay

faint prism
#

@fierce arch be super careful with spaces

#

You need to escape them properly otherwise you'll delete multiple folders

#

ex: /folder/with\ a\ space/something

fierce arch
#

rm -rf /beats Not removing it

faint prism
#

/ is the root directory

#

so unless beats in in the root dir you need to check your path

lyric mountain
#

heya, can someone gimme a bit of help setting up namecheap domain + VPS?

#

like, I'm totally lost

faint prism
#

run pwd to see what folder you're in

fierce arch
#

@lyric mountain Host it on github lol

lyric mountain
fierce arch
#

@faint prism Im in root

faint prism
#

why are you saving stuff in root dir lol

fierce arch
#

Done it

earnest phoenix
#

Do i do this?

for (const file of commandFiles) {
    let command;
    if (Array.isArray(file)) {
        command = require(`./commands/${file[0]}/${file[1]}`);
    }
    else {
        command = require(`./commands/${file}`);
    }
    client.commands.set(command.name, command);
}
faint prism
#

do sudo with it if it isn't working, but be careful

fierce arch
#

Who knows they are all old files from when i made my vps and never discovered linux before lmao

indigo flax
#

what is the eval to shutdown the bot discord.js

lyric mountain
#

System.exit() if java

faint prism
#

fork bomb itself

indigo flax
#

cause someone is running the bot and theres 2 at the same time

#

so ill shutdown the bot

#

and then restart on my host

faint prism
#

look up js exit proccess commands

lyric mountain
#

boi, you gotta figure HOW you're running two bots without knowing at first

fierce arch
#

How do I rename a directory on the command line?

faint prism
#

just regen the token

cause someone is running the bot and theres 2 at the same time
@indigo flax

lyric mountain
#

cp old new
rm -r old

earnest phoenix
#

Can anyone pls help me with my question.

faint prism
#

If I knew JS I'd help lol

lyric mountain
#

Hmm but if i do this, will it work?
you could try it and see

earnest phoenix
#

I did but it says there is an error

lyric mountain
#

which error?

faint prism
#

require('./commands/${file[0]}/${file[1]}')
Not sure that's a valid path: ./commands/commandThing.js/anotherCommand.js

#

lol

#

Files aren't folders

fierce arch
#

Sooooo satisfying to do some vps housekeeping and free up some storage

faint prism
#

lsblk should list drive usage

cinder sandal
#

Files aren't folders
@faint prism always has been

lyric mountain
#

so, namecheap help anyone?

fierce arch
#

Is there a file type i can use to give a my bot a port on my VPS

faint prism
#

what..

lyric mountain
#

you want to open a port for your vps?

#

or point an address to a file?

fierce arch
#

I want to basically give each bot a port

faint prism
#

file type? give a bot a port? waitWhat

fierce arch
#

On my vps

lyric mountain
#

nginx maybe?

fierce arch
#

Yes I'm new to VPS and that stuff but all I want to do is give each bot a port

#

for the sake of using a uptime robot status page to monitor downtime

faint prism
#

Bot's communicate with Discord's API. You don't need to forward any ports unless you're serving a service on a port

lyric mountain
#

unless you have some sort of webservice in ur bot, which doesn't seem to be the case

fierce arch
#

Can I give my code a port tho

lyric mountain
#

no, you can give your webservice a port

fierce arch
#

Or just open a port on my vps

faint prism
#

Why

fierce arch
#

for the sake of using a uptime robot status page to monitor downtime

lyric mountain
#

a bot is an output service, it doesn't need any port to work

faint prism
#

Bot's don't need a port to do regular internet communication

fierce arch
#

Okay then so how do I get a port of some kind so that I can use monitoring

faint prism
#

You only open a port if someone is connecting to a service like myvpnip.some.ext:<port>

fierce arch
#

Okay

lyric mountain
#

oh, I got what you're trying to do

fierce arch
#

okay

lyric mountain
#

although I don't know HOW uptime robot work

fierce arch
#

I just want to monitor my bots downtime on uptime robot basically

static trench
#

I just want to monitor my bots downtime on uptime robot basically
@fierce arch it’s trash. It doesn’t do anything. Just spams your inbox with emails

fierce arch
#

although I don't know HOW uptime robot work
@lyric mountain To setup monitoring you just need the IP and port of what you want to monitor thats it

lyric mountain
#

yeah, there's only ONE issue

fierce arch
#

@fierce arch it’s trash. It doesn’t do anything. Just spams your inbox with emails
@static trench Not if you use a public status page and choose not to be emailed

faint prism
#

So a you're trying to host a monitoring service? In that case, you would be serving something on a port

lyric mountain
#

bots don't have a port nor address for them

#

since they dont do input

fierce arch
#

I have a status page atm but its just monitoring my VPS

#

As the vps has an ip

lyric mountain
#

you could make a simple webservice which returns code 200 whenever someone calls an specific port (with ip)

fierce arch
#

Don't know how to do that

lyric mountain
#

then make uptime robot ping that webservice every X seconds

#

Don't know how to do that
@fierce arch research a bit about express.js

#

there are other options, but express is the most popular

fierce arch
#

k

faint prism
#

or use netcat and return a 200 http header :^)

earnest phoenix
#

şarkı açtığımda botum şarkı kanalına geliyor
gidiyor
nie böyle oluyor

faint prism
#

şarkı açtığımda botum şarkı kanalına geliyor
gidiyor
nie böyle oluyor
@earnest phoenix Other languages are in #memes-and-media as per #rules-and-info

earnest phoenix
#

when I open a song, my boot comes to the song channel
going
nie, this is what happens.

#

help me

restive furnace
#

?

earnest phoenix
#

?

#

Bruh

#

help me ?

#

lang tr

#

when I open a song, my boot comes to the song channel
going
nie, this is what happens.
help me

pale vessel
#

you're being very vague about it

#

i'm having trouble understanding you

#

maybe use a translator?

earnest phoenix
#

I don't have English I use translation

#

I'm opening a song the bot is going in and out of the audio channel

pale vessel
#

ah

earnest phoenix
#

😦

#

we have improved our English by writing bot

#

you know what I mean? use translation.

#

@pale vessel

pale vessel
#

yeah

faint prism
#

Well the translation is still legible.

earnest phoenix
#

when I open a song, my boot comes to the song channel
going
nie, this is what happens.
help me

#

Nie means why

#

sjsjjs

faint prism
earnest phoenix
#

@faint prism shut up

#

when I open a song, my boot comes to the song channel
going
nie, this is what happens.
help me

#

@earnest phoenix firstly, replace nie with, "why" 😖

faint prism
#

@faint prism shut up
@earnest phoenix ? But it's rule 6

earnest phoenix
#

@faint prism He's not speaking as Turkish?

#

yes I türksh

faint prism
#

^

earnest phoenix
#

He's just using translate

#

so, it's translating wrong

#

@earnest phoenix yes

faint prism
#

I thought I saw another language. Perhaps it was deleted or I was otherwise mistaken. 🤷‍♂️

earnest phoenix
#

“My bot is joining and leaving the channel when playing a song”

pale vessel
faint prism
#

“My bot is joining and leaving the channel when playing a song”
@earnest phoenix post the relevant code section

earnest phoenix
#

@faint prism DM

#

I thought I saw another language. Perhaps it was deleted or I was otherwise mistaken. 🤷‍♂️
@faint prism So? What should be if you saw another language? You can directly report to any mod. Why are you doing this?

#

Hi

slender thistle
#

Don't minimod though

faint prism
#

copy that

#

@faint prism DM
@earnest phoenix You DMed me your project, which contains a token. Please regenerate your bot's token

earnest phoenix
#

ok

#

Is there someone who want free hosting for the bot

sonic lodge
#

you seem very unconcerned about leaking your token

earnest phoenix
pale vessel
#

read that bottom text thank you

earnest phoenix
#

256mb ram 10GB memory free hosting

pale vessel
#

no

earnest phoenix
#

lol

faint prism
#

What even is that

#

You implied that RAM != memory. I suspect you mean storage

earnest phoenix
#

you shouldn't even trust providers you never heard of, go with providers that are reputable

faint prism
#

Right. Running on someone elses server could result in a token leak

#

They could even grab it from in-memory if they were trying

earnest phoenix
#

any sensitive data could get leaked

#

Is there someone who want free hosting for the bot
no i already got my host

#

Hey when i start my bot i get this error:
Code:

const server_count = client.users.cache.size;```
```js
 client.on("ready", async () => {
    console.log("ready");
    
    setInterval(() => {
        dbl.postStats(server_count);
    }, 1800000);
 
  
}); ``` Error: 
`[dblapi.js autopost] Failed to post stats: {"error":"Required parameter server_count or shards missing"}`
#

Please help

#

are you spoofing your server count lol

#

you're using the users instead of the guilds

#

are you spoofing your server count lol
@earnest phoenix what is spoofing?

#

ah

#

Wait

#

that is why

#

oops

#

shouldn't be the issue that's causing the error

#

smh

#

oh

#

i changed it guilds

#

using a lib for this is dumb anyways you can make a request yourself

#

oh

#

what?

vivid jacinth
#

Hello guys I coded a discord bot in nodejs and I am looking for a vps to host it, but I can't choose where, does any1 have a good recommandation for a hosting provider?

earnest phoenix
#

i have one

#

oh

vivid jacinth
#

oh thanks

lyric mountain
#

about cname (namecheap), how do I setup a domain like test.domain.tld (consider my domain as domain.tld)?

quartz kindle
#

what do you want the subdomain to do?

still merlin
#

This might sound stupid, But how do you give a webpage a url?, I've got a file url but no one can visit it

restive furnace
#

vps, domain

pale vessel
#

well that's because it's hosted locally in your computer

quartz kindle
#

if you have a webserver, you can access it via ip address

still merlin
#

Cool, thanks

weak rain
#

@restive furnace Give me @restive furnace Domain

solemn latch
#

freenom

pale vessel
#

bruh

weak rain
#

how should i connect my website with domain

#

i m using netlify

#

and freenom

earnest phoenix
#

i don't think you can

weak rain
#

we can

#

but idk how to

earnest phoenix
#

sure you can

#

lmfao

weak rain
solemn latch
#

i dont know anything about netlify, vps provider or something?

pale vessel
#

nope

weak rain
solemn latch
#

🤔

#

i wish they would save me 38k

weak rain
solemn latch
#

i spent like $10 a month

faint prism
#

Better than what? Savings compared to what?

weak rain
#

lol

solemn latch
#

so saving 38k would be neato

faint prism
#

Yeah, I'd love to save $38k lol

placid iron
#

How do people log stuff on their vps

faint prism
#

System logs?

placid iron
#

In the command line that is

solemn latch
#

log what specifically

faint prism
#

^

weak rain
#

how do i add one more prefix to my bot

solemn latch
#

i have logs in like 10 places

#

databases

weak rain
#

i mean mention prefix

solemn latch
#

oh

#

anidiotsguide covers it pretty well

#

if on djs

faint prism
#

Check for if message starts with either of prefixes or if it is present in a collection of prefixes
@weak rain

weak rain
#

i have message starts with

#

but

#

can i add one more their?

faint prism
#

if msg starts with x || y
@weak rain

weak rain
#

this will work?

placid iron
#

If I were to print it would show the string in the terminal

faint prism
#

@weak rain Yeah, wherever you are already checking for the prefix, just add an or conditional

placid iron
#

So do I have a logging terminal?

weak rain
solemn latch
#

🤔

placid iron
#

Dude

solemn latch
#

im sorry

placid iron
#

Anyway

faint prism
weak rain
#

if(!message.content.startsWith(prefix)) return;

#

my message event

#

i mean

faint prism
#
  // Do the thing
}```
Just remove the !not and add an OR
weak rain
#

ok

#

how do i log guild create events

faint prism
#

Add a handler for the event, and implement a logger to log whatever details you want

#

Psudocode:
```client.on(`guildCreate') {
logger.log('something')
}

weak rain
#

hm ok

#

what if i make it

#

ok

#

i will set it

#

by quick.db

#

and log it

balmy ether
#

Can i get a sword related story for my bot

weak rain
#

story?

#

@balmy ether

balmy ether
#

Yep

#

Just like myuu

#

And

pure lion
#

Gimme money and I'll make one

balmy ether
#

Epic rpg

weak rain
#

wdym

faint prism
#

You'll just have to implement it 🤷‍♂️

pure lion
#

@faint prism you nooob!!!! You fool!!!!!! Learn js!!!!!!!

balmy ether
#

ik

#

i am even making

#

I am not just getting the end

faint prism
#

@faint prism you nooob!!!! You fool!!!!!! Learn js!!!!!!!
@pure lion I will eventually. I'm an intermediate C# developer 😛

balmy ether
#

Like how to end the story

earnest phoenix
#

and they all lived happily ever after

#

the end

faint prism
#

^ lol

pure lion
#

Once upon a time

#

Fuck you

#

The end

#

Unless?

#

Yes it's the end

#

Love me some rick and morty

solemn latch
#

omg, my boss just saw you say that. im now fired, this isnt sfw

#

oof, i was joking

delicate shore
#

Guys tell fast

#

Is skysilk worth it ?

#

If not then pls tell a cheap vps like DO

#

But DO isnt good fot mr

solemn latch
#

i like galaxy gate 🤷‍♂️

delicate shore
#

Ok whats the price

solemn latch
#

looking at skysilk, they dont even provide ipv4 addresses on their sub $5 plans

#

which is pretty standard

delicate shore
#

oh

#

And woo do u think that 3$ one is ok for mr ?

solemn latch
#

if you dont need more than 1gb of ram, its plenty

delicate shore
#

Or do i need 5 dollar one

#

I get 512 mb ram on glitch

solemn latch
#

i have 4 websites and a handful of bots on the $5 plan

#

🤷‍♂️

delicate shore
#

Oh ok

restive furnace
#

1gb is enough for bot with even 20k guilds

#

after that you gonna start needing more

delicate shore
#

Ok ill go with 3$ one

slender thistle
#

Is skysilk worth it ?
SkySilk prices seem fair enough for the quality they provide tbh

restive furnace
#

what do theyd o better than galaxygate?

solemn latch
#

seems cheaper

slender thistle
#

Don't know, I haven't used any other provider other than SkySilk

solemn latch
#

but, also less resources.

slender thistle
#

But they allow you to use custom .isos

restive furnace
#

prob thats why 🤔

#

so you can literally use any os

solemn latch
#

can you make iso's with preconfigured stuff?

#

🤔

restive furnace
#

yep

#

atleast for linux

solemn latch
#

hmm, seems useful sometimes

slender wagon
#

is there any way to make a contact form without php

solemn latch
#

the whole, no ipv4 sucks tho

#

pretty sure most backend servers can handle form data.

quartz kindle
#

contact forms are html

slender wagon
#

i mean the actions are taken by php

quartz kindle
#

to handle the data sent by them however, many langs can do it

slender wagon
#

ohh okay

#

i'll just go with php it seems easy

#

does it have limitations?

earnest phoenix
#

yes

solemn latch
#

for some reason, a lot of people hate it

slender wagon
#

oh

earnest phoenix
#

use modern secure languages

#

php is outdated and slow despite still being maintained

misty sigil
#

fact: php is used by facebook

earnest phoenix
#

other languages outperform it

quartz kindle
#

if you already have a webhosting server that includes stuff like cpanel, etc... just go for php

slender wagon
#

would vercel support it

earnest phoenix
#

@misty sigil i dont think they do anymore

misty sigil
#

they do on messenger

earnest phoenix
#

they've changed the technologies they use a fuckton in the past few years

misty sigil
acoustic bridge
#
@client.event
async def on_message(message: discord.Message):
    channel = client.get_channel(743161649338253423)
    if message.guild is None and not message.author.bot:
        await channel.send(f'{message.author} sent: "{message.content}"')
    await client.process_commands(message)

'NoneType' object has no attribute 'send'. But why though?

  • I made this client event in order to receive messages from the channel. However it throws an error if someone else writes a message first. (Means I have to make that event "Active" in order to work)
#

(python by the way if necessary)

slender thistle
#

Channel isn't found under that ID

misty sigil
#

also uh

acoustic bridge
#

its a dm channel id

misty sigil
#

what are you doing

#

is that a message log

acoustic bridge
#

Lets say

#

person a types a message to the bot

slender thistle
#

DM channel IDs aren't supposed to be fetched that way 🤔

misty sigil
#

oh yea

#

i didn't notice it was excluding guilds

acoustic bridge
#

bot will send ME a message which says "person a sent: message"

#

it works though

slender thistle
#

Huh

acoustic bridge
#

As i said

quartz kindle
#

dm channels are not cached by default

acoustic bridge
#

only if i send a dm to the bot first

quartz kindle
#

they become cached once any activity goes through them

earnest phoenix
#

let me explain this problem on my server dm link

quartz kindle
#

you need to create the dm channel first, to ensure it gets property cached if its not cached yet

acoustic bridge
#

i see

slender thistle
#

Can't you use get_user?

acoustic bridge
#

get_user(my id) ?

slender thistle
#

yeah

acoustic bridge
#

I'll try that

faint prism
#

I use GetUser(id).SendMessageAsync(msg) for my lib if I need to send a DM

earnest phoenix
#

@quartz kindle let me explain this problem on my server dm link?

still merlin
earnest phoenix
#

@still merlin let me explain this problem on my server dm link ?

still merlin
#

No? Tell me here?

faint prism
#

What is your issue? @earnest phoenix

misty sigil
#

json database?
Highly not recommended

solemn latch
#

o, the all bots require a privacy policy is going into affect today.

misty sigil
#

Use an actual database like MongoDB, or SQLite, something like that

still merlin
slender thistle
#

Are private ones included?

earnest phoenix
#

I need to broadcast.

solemn latch
#

i dont think they specify

slender thistle
#

Broadcast what?

faint prism
#

json database?
Highly not recommended
@still merlin Yeah, JSON can easily mess up and become unreadable

earnest phoenix
#

no

restive willow
#

how would I get the message object of the target msg on on_raw_reaction_add? I tried using MessageConverter, but that requires a ctx argument and I don't have that

slender thistle
#

Woo, could you toss me the source in DMs?

restive willow
earnest phoenix
#

I can broadcast because I don't have English

slender thistle
#

@earnest phoenix What exactly do you need help with?

misty sigil
#

i made a privacy policy like uh ages ago

solemn latch
#

yeah, ill be a minute tho

slender thistle
#

not an emergency

earnest phoenix
#

music bot

#

problems

still merlin
#

Use an actual database like MongoDB, or SQLite, something like that
Thanks for the suggestion

slender thistle
#

Problems with your music bot, mustafa?

faint prism
#

Thanks for the suggestion
@still merlin trust me it's worth it

slender thistle
#

@restive willow You should have payload.message_id instead

still merlin
#

I don't know how to use other databases though

#

Are they similar to json?