#development

1 messages · Page 1241 of 1

flint yew
#

dont work

opal plank
#

you're saying on a message

#

saying on a channel makes sense

#

reply to a message

slender thistle
#

.conversate for crying out loud

earnest phoenix
#

.reply
@flint yew js Message.prototype.reply() doesn't exist on commando

#

Ngl i wish people who didnt know js or djs would be yeeted from here
@earnest phoenix then i would have never been encouraged by awesome people here that i'm not a dumbass and i can learn programming and 3 months later i wouldn't have been here with a bot with over 2500 lines of code

opal plank
#

.exchangeCommunitcation()

flint yew
#

@earnest phoenix yea not working

earnest phoenix
#

Hmm, can you show your new code in hastebin

slender thistle
#

.contributeToChannelActivityViaAMessage

earnest phoenix
#

2500 lines of code for a discord bot, bad.

opal plank
#

.assertAPIDominanceWithANewMessage

flint yew
slender thistle
#

Number of lines don't really say that a bot is good or bad

earnest phoenix
#

More lines doesnt mean your bot is better

opal plank
#

quite the opposite

#

i think small code is better

#

optimized

earnest phoenix
#

@earnest phoenix whatever you say i'm gonna literally destroy the server if you just kcik out noobs

opal plank
#

its either 8 or 80

#

its either absolutely shit/basic or well/complicated/optiized code

earnest phoenix
#

.putsOnAAPIfromDiscordGatewayWithANewMessageObjectWithContent

slender thistle
#

One-liners for 2D lists are pain

flint yew
opal plank
#

.sendAJSONStringifiedPayloadToDiscordAPIThatMayContainContentOrEmbedOrSomeOtherAcceptableProperty()

earnest phoenix
#

@flint yew You must have executed your command in an unordered way of parameters

#

That args is message and message is args

#

Can you show how you execute the commands

opal plank
earnest phoenix
#

In your main file or whatever

#

and i have error
@earnest phoenix What's the "error"

opal plank
#

<channel>.send()

#

also, method

#

not property

#

did u define channel?

#

ur compiler disagrees

earnest phoenix
#
client.on('channelCreate', async (channels) => {
    const options = await config.get(channels.guild);
    const ChannelIDLogs = options.logsChannel;
    let embed = new MessageEmbed()
        .setTitle('Channel Created!')
        .setDescription([
            `**-> Channel Name:** ${channels.name}`,
            `**-> Channel ID:** ${channels.id}`,
        ])
        .setColor('GREEN')
        .setTimestamp()
        .setFooter('Time event:')
        .setThumbnail(client.user.displayAvatarURL({ dynamic: true }));

    const channel = client.channels.cache.get(ChannelIDLogs);
    channel.send(embed);
});

@earnest phoenix As you defined channel here, it wasn't able to find that channel from the bot's cache

#

Make sure the id is correct

opal plank
#

define channel

#

thats it

flint yew
#

like i have more then 150 commands

earnest phoenix
#

Also why to resolve a non promise function?

flint yew
#

after some updates got many errors

opal plank
#

try porting everything to TS and then come talk tome

earnest phoenix
#

await config.get(channels.guild) doesn't return a promise @earnest phoenix

opal plank
earnest phoenix
#

No need to await

opal plank
#

Js: thisisfine i run code;
Ts: CatNOOO Nooo you cant do that!throw 872 errors!

earnest phoenix
#

Js: I run code without inspection to let the developer know what's wrong so they should get along with this and get used to it
Ts: I just throw errors if i see a missing particle in code, or just a semicolon, but it's better to resolve the errors before running them

#

Ts is better, change my mind

opal plank
#

no need, you right

earnest phoenix
#

Ts was always better

#

@earnest phoenix but 3 days ago yoy said ts is useless KEKW

slender thistle
#

For small scripts JS is fine

earnest phoenix
#

Find me that single message when i said TS is useless

slender thistle
#

And I mean, generally if you aren't an idiot, JS is fine. TS just helps you prevent shit with types

opal plank
#

as a wise man once said, 'Would you rather have silly development errors or insanity inducing bugs in production?'

slender thistle
#

Why not both?

opal plank
slender thistle
#

That way you show authenticity

opal plank
#

god knows i dont have money for that

#

way too many broken keyboards

earnest phoenix
#

Oop-

#

I said TS is just js with Type Guards, if you not be able to resolve and rewrite a typing correctly, you're stuck

opal plank
#

why not 300 iq?

earnest phoenix
#

badges?

#

That'll be a cool thingy

opal plank
#

just do any on everything and then claim to be a cultured man. Just like people who use ARCH linux with a UI

earnest phoenix
#

Add badges if you can though

opal plank
livid breach
#

hi

slender thistle
#

Slap dynamic and any everywhere

opal plank
#

thats the gist

earnest phoenix
#

just do any on everything and then claim to be a cultured man. Just like people who use ARCH linux with a UI
@opal plank lmao imagine using two ` for inline code blocks

livid breach
#

sa

earnest phoenix
#

@livid breach do you need help with anything?

opal plank
#

dont kink shame my OG shit

earnest phoenix
#

just do any on everything and then claim to be a cultured man. Just like people who use ARCH linux with a UI
@opal plank I mean some things throw type errors which their typings weren't written correctly, or as you wanted it to work so you gotta rewrite the typings

#

More work

#

But less errors, but stuck if you can't

opal plank
#

i was joking of course, its bad to have any's floating around

#

some stuff do need any though

earnest phoenix
#

any and any[] goes brrr

opal plank
#

good luck typing an interface with every single country out there that can come from an api request

slender thistle
#

My type annotations genuinely go fuck-all with dictionaries and lists

opal plank
earnest phoenix
#

good luck typing an interface with every single country out there that can come from an api request
@opal plank That's the problem with TS

opal plank
#

you end up having to do key:['string']:something

earnest phoenix
#

good luck typing an interface with every single country out there that can come from an api request
@opal plank challenge accepted and declined at the same time cuz the function was async
you won't get it mmLol

opal plank
#

what?

earnest phoenix
#

If you're a experienced developer and can write code with mostly no errors at all, JS is completely fine than TypeScript

opal plank
#

what does async have to do with this?

#

you can code on notepad too,but having some extra tools help,dont they?

earnest phoenix
#

I mean they do but TS isn't related to this, is it

opal plank
#

its strong typed javascript,basically

#

it gets compiled to js either way

#

transpiled, i should say

earnest phoenix
#

Wait does TS even count missing semicolons as errors?

opal plank
#

i would think so,yeah

#

actually

#

no

#

though vsc auto places it for me

#

good vsc

earnest phoenix
#

vsc is god

opal plank
#

agreed

earnest phoenix
#

Imagine a ported android version of vsc

opal plank
#

okay now you ruined it with mobile coding

#

cmon dude, read the mood

earnest phoenix
#

Bruh

#

mobile coding sucks
hail smartphone coding

(mobile means that shitty filp phone all teens used to use)

opal plank
earnest phoenix
opal plank
earnest phoenix
#

mobile coding sucks
hail smartphone coding

(mobile means that shitty filp phone all teens used to use)
@earnest phoenix Excuse me you can't code on those can you

#

I mean the flip phones that were made a long time ago

opal plank
#

i guess as long as it has a keyboard it should work/

#

?

#

imean, they had sms

earnest phoenix
#

Lmao

opal plank
#

worst case scenario you send an sms with your code

#

gives me shivers to even think about doing that

earnest phoenix
#

Sms with codeblocks would actually be kinda cool

opal plank
#

code with a dial telephone, use 1 and 0 to write in binary if you truly despise your own life

earnest phoenix
#

Or just make a compiler out of it, to attach a keyboard to it for it to understand human readable code

opal plank
#

make async code in binary using a dial telephone

#

i think that goes way beyond self-harm, if you are mad enough to attempt

earnest phoenix
#

What does use strict mode in Js even mean i wonder

opal plank
#

some keywords arent allowed

earnest phoenix
#

Such as

#

What does use strict mode in Js even mean i wonder
@earnest phoenix strict mode?I thought it was obvious

slender thistle
#

What is defined as strict mode exactly

#

Which keywords would be disallowed etc

earnest phoenix
#
"use strict";

// Code```
opal plank
#

right here

earnest phoenix
#

MDN is better

opal plank
#

thats usage

#

not the reserved words

earnest phoenix
#

You can obviously use all of those keywords in strict mode that you showed

opal plank
#

in strict, you cant

#

i think only my compiler is in strict

#

lemmedouble check rq

#

yep, compiler in strict

#

lemme try rq

valid frigate
#

tf is allowjs

opal plank
#

should prob check the compiler ts config options

valid frigate
#

strict is pretty much a must in a tsconfig

#

also wasn't there an option for no implicit any

#

or did that get removed

earnest phoenix
valid frigate
#

use strict oooooooooooh

opal plank
#

indeed

#

they are two different things

#

hmmmm

earnest phoenix
#

Didn't you say you can't use those keywords in strict mode

opal plank
#

yup it does catch

#

also even without 'use strict'

#

i assume the ts config does it forme

earnest phoenix
#

I didn't mean like that

#

is it lookin' good

opal plank
#

then?

earnest phoenix
#

then?
@opal plank more like .then(reply?: confusion)

opal plank
#

hehe

earnest phoenix
#

You obviously can't use global keywords as variables or function names, i meant what does strict mode do to your js code? Throwing more errors? Increasing speed?

#

idk wtf i said

#

You obviously can't use global keywords as variables or function names, i meant what does strict mode do to your js code? Throwing more errors? Increasing speed?
@earnest phoenix read the MDN docs link i sent

opal plank
#

try writing that same snippet in vanilla js

earnest phoenix
#

But yea went there and saw

opal plank
#

actually,lemme do it

earnest phoenix
#

try writing that same snippet in vanilla js
@opal plank bruh strict mode is also a type of vanilla js

opal plank
#

i mean non strict

earnest phoenix
opal plank
#

without strict it allows you to

#

if you get that error your module is in strict mode

#

this one

#

@earnest phoenix

fringe axle
#

I have this ```js
if(message.channel.type !== 'nsfw')

earnest phoenix
#

WHY DOES CANVAS DRAW TEXT FROM THE BOTTOM LEFT TO THE TOP RIGHT AND DRAW IMAGES FROM THE TOP LEFT TO THE BOTTOM RIGHT

opal plank
#

@fringe axle cuz its channel.nsfw not type

fringe axle
#

Oh

opal plank
#

type returns dm | textchannel | something else

fringe axle
#

Thanks

earnest phoenix
#

@fringe axle stop with these NSFW commands man

fringe axle
#

D:

opal plank
#

more horny bots is what we all need

earnest phoenix
#

no

#

not mre

opal plank
#

flood the discord community with horny bots

earnest phoenix
#

i need @Tim#2373 and @flazepe#8587

fringe axle
#

Mine is in NSFW channels only :0

earnest phoenix
#

but still

opal plank
#

even i has some nsfw shit

earnest phoenix
#

why do you have nsfw anyways

opal plank
#

cuz you underestimate the power of horny people

#

thatprob my third highest used command

#

gotta understand your demographics, discord is filled to the brim with furries/weebs

earnest phoenix
#

lol

earnest phoenix
#

is there any better way to get id of voter user without using ksoftapi?

quartz kindle
earnest phoenix
#

how?

fast loom
#

or the API docs

earnest phoenix
#

does this work with both bots and server votes?

royal bane
#

how can i host my 24/7 for free?

#

can I?

fast loom
#

@royal bane paid hosting services

royal bane
#

oh

#

ok

fast loom
#

with free ones you'll have downtime

#

or you can host it yourself

#

if you have an old computer that's buggy enough and not used

royal bane
#

how can i host for free?

fast loom
#

check in google for free hosting

royal bane
#

no, i dont another have computer

#

ok

fast loom
#

for example Heroku

#

can let you freely host but you get only 500 free hours per month

royal bane
#

ok

fast loom
#

and the bot goes in a sleep mode 30min after last used

royal bane
#

how hours are there in one month?

fast loom
#

720

#

so yeah, go check in google and read here and there

royal bane
#

can heroku and i host at the same time?

earnest phoenix
#

@royal bane you can use aws which is "technically" free

royal bane
#

uh?

earnest phoenix
#

or you can try chaoticdestiny hosting or fatcat hosting they give 1 pterodactyl server for free

royal bane
#

whats pterodactyl?

earnest phoenix
#

aws = amazon web service

#

google it

royal bane
#

ok

earnest phoenix
#

basically you can host your bot there no downtime 24/7

fast loom
#

can heroku and i host at the same time?
@royal bane you can host at the same time but that will just make your bot send work on commands twice or more every time

#

so it's not good

royal bane
#

pterodactyl is a dinosaur?

#

ok

earnest phoenix
#

no search for "pterodactyl server"

royal bane
#

oh ok

earnest phoenix
#

ofc if you search just pterodactyl thatll get you the dinosaur

royal bane
earnest phoenix
#

thats the website for pterodactyl yes but thats not what you wanna visit

royal bane
#

ok

earnest phoenix
#

i can dm you the link if ya want

royal bane
#

ok

#

dm me

green kestrel
#

you can get a vps capable of running a bot for like $3 a month

#

vultr, i think

#

it might be worth it, rather than relying on free

earnest phoenix
#

if only i had a credit card

green kestrel
#

got paypal?

earnest phoenix
#

any VPS which i can buy with cryptocurrency?

#

got paypal?
@green kestrel under 18

green kestrel
#

only hackers use cryptocurrency

lul
only kidding

slender thistle
#

ask permission from parents ez

earnest phoenix
#

they won't let me

green kestrel
#

yeah, $3 is like, below pocket money amounts

earnest phoenix
#

i'm untrustable mmLol

#

yeah, $3 is like, below pocket money amounts
@green kestrel i have 0.10$ a week pocket money because i avoid eating junk food to save up time for programming

green kestrel
#

i remember the days when i had pocket money

earnest phoenix
#

*0.14$ forgot 10 rupees is 14 cents in dollars

green kestrel
#

now i have to go to work and earn it all, for it to go straight back out on bills

earnest phoenix
green kestrel
#

yeah lets move this convo

indigo burrow
#

halp me

#

hot tf

#

how

#

remaking a generator not the bad one but a good one which gens quotes and other stuff

weak rain
#
.setColor("FF0000")
.setTitle("TIMINGS")
.setThumbnail("https://cdn.discordapp.com/icons/694838568333475880/a_c2217a7a1bf26f8d5a1927a68de2c814.gif ")
.setDescription(`
**3 MATCHES WILL BE HELD EVERYDAY TILL LESS REGISTERATIONS**
```REGISTERAION FOR 3:00PM STARTS AT 12:00PM```
```REGISTERAION FOR 3:30PM STARTS AT 12:10PM```
```REGISTERAION FOR 4:00PM STARTS AT 12:20PM```
**FOR MORE INFORMATION CONTACT MANAGEMENT & STAY TUNED WITH #𒌇・au-announcements **
`)
message.channel.send(embed)```
#

SyntaxError: missing ) after argument list

#

it says syntax error

#

missing )

scarlet salmon
#

You have to escape the backticks inside the string. If you don’t, the parser will terminate the string at the next backtick instead of the end of what you want to be the string

drifting wedge
#

if using js and python on a dashboard

#

js (dashboard)

#

py (bot)

#

what mongo language do i do the driver?

earnest phoenix
#

technically if you have a credit card you can get 12 months of free hosting on AWS

#

and nothing you can rely more on than amazon

river sedge
#

what's the ratelimit for editing an embed message?(like I can edit in every x seconds(altough I will stop the loop after few seconds so that it doesn't api abuse))

earnest phoenix
#

editing embed message and editing normal message has same ratelimit

#

5/5s

weak rain
#

my bot tells wrong amount of users

#

I use ${client.users.cache.size}

misty sigil
#

cuz that’s cached

weak rain
#

so what should i do

drifting wedge
#

do bots blow up easily?

weak rain
#

no

misty sigil
#

you need to round the amount up

#

you can use reduce on the client.guilds.cache

weak rain
#

how

misty sigil
#

.reduce

#

.reduce((a, memberCount) => a + memberCount)

weak rain
#

hm

faint prism
#

halp me
@indigo burrow wasn't RichEmbed deprecated in v12?

indigo burrow
#

shit

#

Then whats the command for embed now

thick gull
#

MessageEmbed()

dreamy thistle
#

Discord.MessageEmbed()

delicate shore
#

How can I perform an action for all the channels

brazen epoch
#

on here the listener is this for bot vote or server vote

#

or like both

faint prism
#

How can I perform an action for all the channels
@delicate shore you'd have to do a for loop over each channel in a guild

#

It's worth getting into the habit of saying "for each" instead of "for all"

eternal osprey
#

hey auger

#

i am still not sure how do it.

flint yew
#

TypeError: math.eval is not a function

#

why getting that error

pale vessel
#

read docs

#

is that mathjs?

flint yew
#

yes

pale vessel
#

try evaluate

flint yew
#

k

#

TypeError: Unexpected type of argument in function evaluate (expected: string or Array or Matrix or number or boolean, actual: undefined, index: 0)

#

@pale vessel new error

pale vessel
#

show code

flint yew
#
const Discord = require('discord.js');
const math = require('mathjs');


module.exports = class MathCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'math',
            aliases: ['solve', 'calc'],
            group: 'utility',
            memberName: 'math',
            description: 'I\'ll do your math homework!',
            examples: ['~math [equation]'],
            throttling: {
                usages: 1,
                duration: 5
            },
            args: [{
                key: 'equation',
                prompt: 'Please provide me with an equation to solve!',
                type: 'string'
            }]
        });
    }

    run(message, args) {
        var { equation } = args;
        try {
            var solution = math.evaluate(equation)
        } catch (err) {
            return message.channel.send(`❎ | I couldn\'t solve that equation! \`${err}\``)
        }
        
        const embed = new Discord.MessageEmbed()
            .setColor('#767CC1')
            .addField('**📥 Expression**', `\`\`\`${equation}\`\`\``)
            .addField('**📤 Result**', `\`\`\`${solution}\`\`\``);
        return message.channel.send({ embed })

    }
}```
cerulean salmon
#

how do u guys add channel related thingy ?
like with command handler we can create a single file for a command and its makes our project easy to manage .Index.js looks clean for that .

but some feature which doesn't need to trigger with bot prefix where u guys code them ? in index.js ?
like in my bot i did something like mod-mail , u dm the bot and bot will post that message in a specific channel , u don't need to use any prefix just type the message .

a counter channel where people just count 1 ,2,3 ,bot just monitor that channel if someone miss a number of post anything else thats not a number
i have another channel monitor in a channel like one-word story ,so if someone try to send multiple word bot will delete that message .

now the problem is as those message don't need to startwith bot prefix i coded them in index.js . i wonder if i increase channels my index.js will get messy

any other way i can follow ?

pale vessel
#

looks like commando

flint yew
#

yea

pale vessel
#

@flint yew try console.log(args) before var solution

flint yew
#

same error

pale vessel
#

check console

flint yew
#

[ '2*2' ]

#

it give that

pale vessel
#

change var { equation } = args; to const [equation] = args;

#

you can't destructure using {} for arrays

flint yew
#

@pale vessel can u help me in 1 more

pale vessel
#

with?

flint yew
#

"stack": "TypeError: Cannot read property 'startDate' of undefined

pale vessel
#

where did that come from?

flint yew
#
const moment = require('moment');
const sherlock = require('sherlockjs');

module.exports = class RemindMeCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'remindme',
            aliases: ['remind', 'timer', 'alarm'],
            group: 'utility',
            memberName: 'remindme',
            description: 'I\'ll remind you of something!',
            details: 'This does not persist across restarts! Please keep it short!',
            guildOnly: true,
            throttling: {
                usages: 2,
                duration: 3
            },

            args: [{
                    key: 'remind',
                    label: 'reminder',
                    prompt: 'what would you like me to remind you about?',
                    type: 'string',
                },
                {
                    key: 'time',
                    label: 'time',
                    prompt: 'In how long would you like me to remind you?',
                    type: 'string',
                    validate: time => {
                        const remindTime = sherlock.parse(time);
                        if (!remindTime.startDate) return `please provide a valid starting time.`;

                        return true;
                    },
                    parse: time => sherlock.parse(time)
                }
            ]
        });
    }

    async run(message, args) {
        const { remind, time } = args;

        const timer = time.startDate.getTime() - Date.now();
        const preRemind = await message.channel.send(`Got it! I will remind you in **${moment().add(timer, 'ms').fromNow(true)}**! \`(${timer}ms)\``);
        const remindMessage = await new Promise(resolve => {
            setTimeout(() => resolve(message.author.send(`⏰ | ${remind}!`)), timer);
        });

        return [preRemind, remindMessage];
    }
};```
pale vessel
#

hmm, you're using {} again

#

args is an array

#

you have to use [] to destruct arrays

flint yew
#

"stack": "TypeError: Cannot read property 'getTime' of undefined

#

it give new error

pale vessel
#

try console.log(args) again

flint yew
#

"stack": "TypeError: Cannot read property 'startDate' of undefined

pale vessel
#

check your console

#

console.log() is used to log something into the console

#

it's for debugging purposes

flint yew
#
"stack": "TypeError: Cannot read property 'startDate' of undefined
    at RemindMeCommand.run (C:\\Users\\K\\YK303bot\\src\\commands\\morefun\\remindme.js:48:28)
    at module.exports (C:\\Users\\K\\YK303bot\\src\\events\\message.js:52:24)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\\Users\\K\\YK303bot\
ode_modules\\discord.js\\src\\client\\actions\\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\\Users\\K\\YK303bot\
ode_modules\\discord.js\\src\\client\\websocket\\handlers\\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\\Users\\K\\YK303bot\
ode_modules\\discord.js\\src\\client\\websocket\\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\\Users\\K\\YK303bot\
ode_modules\\discord.js\\src\\client\\websocket\\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\\Users\\K\\YK303bot\
ode_modules\\discord.js\\src\\client\\websocket\\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\\Users\\K\\YK303bot\
ode_modules\\ws\\lib\\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)"
}
#

error

#

only

pale vessel
#

where did you put the console.log()? it must be before timer since that's where the error is coming from

flint yew
#

async run(message, args) {
console.log(args)
const [ remind, time ] = args;

    const timer = time.startDate.getTime() - Date.now();
    const preRemind = await message.channel.send(`Got it! I will remind you in **${moment().add(timer, 'ms').fromNow(true)}**! \`(${timer}ms)\``);
    const remindMessage = await new Promise(resolve => {
        setTimeout(() => resolve(message.author.send(`⏰ | ${remind}!`)), timer);
    });

    return [preRemind, remindMessage];
#

like that?

pale vessel
#

yes

flint yew
#

i did that

pale vessel
#

scroll up in your console

flint yew
#

i did

#

there nothing

pale vessel
#

that's odd

flint yew
#

wdym

pale vessel
#

try again

flint yew
#

ok

grand path
flint yew
#

@pale vessel [ 'i', 'am', 'k' ]
2020-09-14 16:04:38 - error [app.js]: Cannot read property 'getTime' of undefined

#

it give

#

what i write in discord

pale vessel
#

so it's not a valid time

knotty obsidian
pale vessel
#

client secret is for oauth

knotty obsidian
#

oh

flint yew
#

the what to fix

pale vessel
#

you don't need it if you don't use it

knotty obsidian
#

oki

pale vessel
#

i'm not familiar with commando but you should check the args and validate functions

#

sorry, can't help more than this

flint yew
#

okay

royal laurel
#

hey so i tried to fix this on my own but i still cant find why, so im trying to make a command where i type ^makecache (insert pinged user here) and then it will make a role and add it to that user and will make a MessageEmbed() at the end to say its done

#
client.on('message', msg => {
if(msg.author.id === '388931035607597057')
{
    if(msg.content.startsWith(`${prefix}makecache`))
    {
        const cacheRole = msg.guild.roles.create({
            data: {
                name: 'CacheRole',
                color: '#ff0000',
            },
            reason: "ROLE CREATED TO ACCES CACHE CHANNEL"
        })
        .catch(console.error)
        const member = msg.mentions.members.first()
        if(!member.roles.cache.get(cacheRole))
        {
            member.roles.add(cacheRole)
        }
        const embedSuccess = new MessageEmbed()
        //Set the title of the Embed
        .setTitle("Cache created!")
        //Set the color of the Embed
        .setColor(ff0000)
        //Set the description of the Embed
        .setDescription(`Sunglasses successfully made a meme cache for ${member.user.username}`)

        msg.channel.send(embedSuccess)


    }
}
else{

}

}) ```
#

and im getting this error

#
TypeError: Cannot read property 'roles' of undefined
    at Client.client.on.msg (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/index.js:27:20)
    at Client.emit (events.js:189:13)
    at MessageCreateAction.handle (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/ws/lib/event-target.js:125:16)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/home/pi/Desktop/shit/Bot/Discord/CustomChannelMakerBot/node_modules/ws/lib/websocket.js:797:20)```
pale vessel
#

should there be only one cacheRole?

#

your code creates a new one every command

royal laurel
#

fair point

#

didnt think of that

#

actually no i did

pale vessel
#

but the error is unrelated

royal laurel
#

its gonna make a role everytime because i need it to since im also going to make a channel soon for that specific role but right now trying to get my embed and new role to show up

cinder sandal
royal laurel
#

wdym, i defined it there

pale vessel
#

you mentioned a member right?

royal laurel
#

yes

pale vessel
#

where is line 27?

faint prism
#

i am still not sure how do it.
@eternal osprey wdym

royal laurel
#

line 27 is the if(!member.roles.cache.get(cacheRole)) if statement

pale vessel
#

so there is no member mentioned, according to the error

flint yew
#

anyone know commando

royal laurel
#

why would that be, i wouldnt be able to move it outside of the event

warm marsh
#

good gun

pale vessel
#

msg.mentions.members is a collection of mentioned members in the message and .first() grabs the first member. if undefined, it means that there's not a single mentioned member

royal laurel
#

mkay

#

i see something lemme try fixing it real quick

#

nah didnt help

pale vessel
#

after const member, try adding if (!member) return msg.channel.send("no member")

royal laurel
#

wait im trying to say the mentioned member on my command is that a problem

#

guess what

#

now its saying "MessageEmbed()" isnt defined

pale vessel
#

define it

#

if you defined discord.js, you can use <discord.js>.MessageEmbed()

royal laurel
#
const embedSuccess = new MessageEmbed()
        //Set the title of the Embed
        .setTitle("Cache created!")
        //Set the color of the Embed
        .setColor(ff0000)
        //Set the description of the Embed
        .setDescription(`Sunglasses successfully made a meme cache for ${member.user.username}`)

        msg.channel.send(embedSuccess)``` it is here
pale vessel
#

that's using it

royal laurel
#

is it

pale vessel
#

what did you define require("discord.js") as?

royal laurel
#

?

#

i did
const Discord = require('discord.js')

pale vessel
#

try Discord.MessageEmbed()

royal laurel
#

ok so, it cleared the error, but i pinged a user and it stil said "No member specified"

#

its clearly my member variable that fucking stuff up

pale vessel
#

can you add console.log(msg.mentions) before defining the member?

#

check your console after that

royal laurel
#

ok

#

this is what it logged

#
MessageMentions {
  everyone: false,
  users: Collection [Map] {},
  roles: Collection [Map] {},
  _members: null,
  _channels: null,
  crosspostedChannels: Collection [Map] {} }```
pale vessel
#

so it's still empty

#

can you show me how you used the command?

royal laurel
#
sunglassesToday at 11:21 PM
^makecache @test scripts
Meme Cache Maker
BOT
Today at 11:21 PM
No member specified```
pale vessel
#

can you show a screenshot?

royal laurel
#

im runningon pi and dont have screen shot program

#

ill clean it up

#

sunglasses: ^makecache (pinged user)
Meme Cache Maker: No member specified

pale vessel
#

did the mention show up as @ flazepe or @pale vessel ?

royal laurel
#

it did @Lorem ipsum dolor sit amet

#

as the mention

pale vessel
#

so @pale vessel

royal laurel
#

yes

pale vessel
#

that should be valid then

#

hm

royal laurel
#

should i remove the if statement that checks what user is sending the message

#

the if(message.author.id == "id")

faint prism
#

The if would only execute the code block if it was true.
So, if that's the expected behavior.

royal laurel
#

its getting past ther so thers no point of removing it

faint prism
#

Also, I recommend not hard coding your ID, and instead keep a config file with it inside

royal laurel
#

mkay

#

brb

#

ima head off its 11:30 pm here so cya guys, thanks for all the help

eternal osprey
#

hey

#

how do i debug c# files?

#

i wanted to try something

faint prism
#

how do i debug c# files?
@eternal osprey What are you writing your code in?

eternal osprey
#

vsc

faint prism
#

So for VSC you need a launch.json and a tasks.json inside the .vscode/ folder in your project directory

eternal osprey
#

okay

#

i tried to run the little snippet you sent me

#

so i could see how i operates

#

idk if you mind?

faint prism
#

So you can execute it correct?

eternal osprey
#

i will try it now

#

which debugger should i choose?

faint prism
eternal osprey
#

i supposse .netcore

faint prism
#

yeah

earnest phoenix
#

I seriously need an actual command handler instead of an ENORMOUS block of switch case statements
but i won't be able to do aliases so CS_AlphabetF

eternal osprey
#

what should i input in these

faint prism
#

Exactly what it says

eternal osprey
#

program framework and project name

faint prism
#

go to your bin/

#

and see what the folder names are

eternal osprey
#

how de fuck do i find bin

faint prism
#

it's a folder

#

in the project

eternal osprey
#

no?

faint prism
eternal osprey
#

i don't have that lmao

faint prism
#

well do dotnet build then

#

and fill in launch.json with the new folder names

earnest phoenix
#

should i die thonkingintensifies

eternal osprey
#

dotnet is not a command

faint prism
#

I doubt you're using core v5 so don't copy mine lol

#

oml

eternal osprey
#

i aid

faint prism
#

do you have dotnet sdk installed? lol

eternal osprey
#

said, that i wanted to look how your program operates.

faint prism
#

right

#

You need dotnet sdk to compile and run your C# code

#

with that, you can tell VSC how to debug it

#

and then you can set breakpoints and stuff

#

also that code snippet should be easier to rewrite in Javascript

#

So, why aren't you just doing that?

eternal osprey
faint prism
#

yep

eternal osprey
#

i will write it in j

#

it is my best language

#

i just want to see how it operates.

#

i have downloaded the left one already

faint prism
#

i will write it in j (js?)
That's a good idea

it is my best language
You're allowed to have that opinion, but i disagree

eternal osprey
#

i meant js, my keyboard just struggles.

#

and i don't mean that it is the best language out there

#

i mean that i know the language the best

faint prism
#

Ah gotcha

eternal osprey
#

from all the other ones i know

faint prism
#

That's how I am with C#

#

But what I want you to understand is that the concept is the same

thick gull
#

I seriously need an actual command handler instead of an ENORMOUS block of switch case statements
but i won't be able to do aliases so :CS_AlphabetF:
@earnest phoenix just check the djs guide

#

it has aliases

earnest phoenix
#

wtf

thick gull
#

it does proper cooldowns, aliases, cmd handling

earnest phoenix
ripe wasp
#

programming a simp bot 😈 💯

thick gull
green kestrel
thick gull
#

i dont know whats going on

ripe wasp
#

^

green kestrel
#

its the admin backend for my bot, for moderators who maintain the bots database

thick gull
#

well this is pretty distracting

green kestrel
#

they kind of know what theyre doing with it, but its still becoming a mess

thick gull
#

like the tables

#

the outline

ripe wasp
#

i mean

#

that's nit picking

thick gull
#

yea

#

but i think it'll look better if you change the colors

#

the blue pops too much imo

#

blue in some spots is ok but not for all buttons

pale vessel
#

can i delete everything if i were to be able to access the moderator panel

green kestrel
#

one question at a time? 🙂

#

for me to then revoke that access and restore a backup? 😛

#

i think someone might notice youre doing it

#

plus, the ids are not sequential, theres huge holes in the sequence

eternal osprey
#

how do i fetch a php file lmao

#

nvm got it

small zenith
#

Jake never eats cake
how do i translate this to another language

#

without using any npm package in discord.js

restive furnace
#

what if your mods scrape the webpage and do their job remotely (eg. from discord bot)? 🤔

silk chasm
#

@thick gull

thick gull
#

yes

silk chasm
thick gull
#

yes

silk chasm
#

Which compiler or lang is this?

thick gull
#

.js

#

java script

silk chasm
#

Oh lol

#

Doesn't seen it

#

Sorry

restive furnace
#

it's javascript

#

java script is literally like scripting java

#

or sounds like it

slender thistle
#

JS is drunk Java

restive furnace
#

^^, literally doesn't even care about types

slender thistle
#

Except not Java

#

Imagine not erroring out on randomobj.propertynoexist

ripe wasp
#

java script is retarded

#

like its a cool language

#

its jus not as organized as python

earnest phoenix
#

java script is retarded
@ripe wasp no

#

it's not

small zenith
#

Jake never eats cake
how do i translate this to another language
without using any npm package in discord.js

slender thistle
#

Would never recommend to programming beginners at least. Even PascalABC is reasonably better.

restive furnace
#

it's not retarded, it's just a drunk language.

slender thistle
#

It's not beginner-friendly is what I would like to imply

#

and yes it's also drunk

small zenith
#

I like js 😆

earnest phoenix
#

@small zenith you'll need to design the whole thing yourself if you're not gonna use any npm package or API

thick gull
#

if your forced to learn a language it sucks

#

thats why i hate python

small zenith
#

ok @earnest phoenix

slender thistle
#

Python is more consistent and reasonable with its typing at least

earnest phoenix
#

if your forced to learn a language it sucks
@thick gull Latin, Hindi, Bengali, QBasic, Windows Batch, XML, even more my school teaches us all kinds of OUTDATED stuff

small zenith
#

Yall chatting?

thick gull
#

what

small zenith
thick gull
#

are you trying to tell me hindi is outdated

small zenith
restive furnace
#

i'm forced to learn python in school, but i don't still hate it or smth

slender thistle
#

Dev chatting is allowed

earnest phoenix
#

are you trying to tell me hindi is outdated
@thick gull uhh no

#

lmao

pale vessel
#

i learn no programming language in school OMEGALUL

slender thistle
#

Windows Batch is outdated?

faint prism
#

java script is literally like scripting java
@restive furnace They are too different to compare really.
js was renamed from MochaScript to JavaScript because at the time Java was really popular

earnest phoenix
#

imagine forgotteing that hindi ain't a programming language

#

Windows Batch is outdated?
@slender thistle they tell us windows XP batch we use windows 10 except me

small zenith
#

imagine forgotteing that hindi ain't a programming language
@earnest phoenix meowow

thick gull
#

what

small zenith
#

is it?

ripe wasp
#

hindi da programming language 😈 💯

thick gull
#

yeaa

restive furnace
#

yeah im talking about java script
^ ^ ^
and not javascript

small zenith
#

Leo.Muh.melo()

slender thistle
#

Are Java scripts even a thing?

earnest phoenix
#

Are Java scripts even a thing?
@slender thistle yeah shit.js

faint prism
#

Java Scripts?

#

Java is a compiled language

pale vessel
#

"script"

java

faint prism
#

Script would imply it's interpreted

earnest phoenix
#

i'm retarded

pale vessel
#

yeah

restive furnace
#

java script != thing // except in java i guess
javascript == thing

slender thistle
#

Not exactly sure what it could be, but let's say an interpreter with dynamic typing for Java projects

faint prism
#

Not exactly sure what it could be, but let's say an interpreter with dynamic typing for Java projects
@slender thistle Why would you want that

slender thistle
#

Let's just blame being desperate for entertainment during a quarantine...

faint prism
#

Java is trying it's hardest to be fast, but already failing. Making it interpreted would make that problem even worse.

earnest phoenix
restive furnace
#

java is replacing kotlin what i heard

#

kotlin's speeds are faster tho

slender thistle
#

Java is trying it's hardest to be fast, but already failing. Making it interpreted would make that problem even worse.
@faint prism Performance can go out of the window. I'm somewhat confident you know I use Python. 😂

restive furnace
#

(both ran in JVM, aka intepreted and compiled)

earnest phoenix
#

ecmascript is a fucking standard language wtf

faint prism
#

@faint prism Performance can go out of the window. I'm somewhat confident you know I use Python. 😂
@slender thistle Let me tell you about performance. Once upon a time, I wrote a statistics program in bash. BASH. It doesn't even do complex math natively! I had to pipe math functions to a calculation library (bc). Which added an insane latency

slender thistle
#

🤣 I think you went over that at least once before

faint prism
#

Couple that with a for loop, and bam. A simple standard deviation calculation takes all night

#

🤣 I think you went over that at least once before
@slender thistle Glad you remembered 😉

silk chasm
#

I literally felt that there are two lang named Javascript.... Lol

ripe wasp
#

wait

#

not an iphone???

#

cringe

faint prism
#

How else am I supposed to use Android's Linux-based OS to host my discord bot? mmLol

ripe wasp
#

you can convert it im pretty sure

faint prism
#

convert it to what? lmao

#

Swift?

ripe wasp
#

islam

slender thistle
#

Bismillah

faint prism
ripe wasp
#

yuh

#

bismillah

slender thistle
ripe wasp
#

oh no

#

the mod ruining fun ;(((

faint prism
#

pretty funny, but wrong channel for that

slender thistle
#

Oh no. Rules existing. :(

plush magnet
#

Imagine following rules where the anarchy smh

silk chasm
#

How else am I supposed to use Android's Linux-based OS to host my discord bot? mmLol
@faint prism can u elaborate...

plush magnet
#

Oh geez

faint prism
#

Download Termux app. Run apt install node-js. Run node run index.js mmLol

silk chasm
#

To "host my discord bot"??

faint prism
#

Yeah sure why not ||, other than the terrible latency and large use of data||

silk chasm
#

Imagine thinking ik everything and then meeting some who has more knowledge then you.... :(

sudden geyser
#

that's how this channel goes

faint prism
#

Imagine thinking you know everything
That's ignorance, my friend

#

Someone will always know more 🙂

vague wigeon
#

uptime 24/7?

faint prism
#

When was the last time you turned off your phone?

#

Sure, your bot would go down if you ever lost cell.
But what about having a spare phone running it on wifi?

#

Shit... that's not a bad idea

#

That'll have a backup battery...
Cell backup...
And even a better cpu and ram than a rasp pi...

silk chasm
#

Hmmm... I am a school teen and y'all are professional programmers... It can be seen that y'all r always Have ultimate knowledgelol but I am learning....

thick gull
#

no we're all broke college/highschool students

faint prism
#

^ this lmao

thick gull
#

only a small percentage are past that mmulu

#

shut shiv

#

i dont need facts

faint prism
#

like shiv

thick gull
#

let me spread misery

slender thistle
#

This server is very diverse, but the main part is just students doing development as a hobby

faint prism
#

Yupp

#

I tbh just wanted to apply some new C# design patterns I learned at work, and thought Machine Learning was cool. And somehow ended up making a bot with both of those. And consequentially learned how to use a non-relational database.

slender thistle
faint prism
#

What's confusing about it?

#

Pretty sure it was a joke

shy turret
#

i dont think it was lol

thick gull
#

it was

faint prism
#

Javascript (originally Mocha) is nothing like Java

shy turret
#

i lost brain cells i should leave this server

faint prism
#

That's more of an interop

dreamy thistle
shy turret
#

wdym

slender thistle
#

split by space, get X index

shy turret
#

like

#

.split(/ +/g)

#

^

wicked pivot
#

hi, you advise me what as a method to perform a clear user "<prefix> clear @user <number>"

faint prism
#

That's just attaching JS -> Java. Kinda like how I'm using interpreted C# in my bot's eval using CSharpScript library (Dotnet Roslyn API)

#

.split(/ +/g)
@shy turret is that not the same thing

#

regex + is just 1 or more

shy turret
#

ikr

faint prism
#

why is it "better"? because it's regex lol?

shy turret
#

.split(/ +/g) should be good if you !command <args> <a lot of spaces>

#

it is better in some cases

faint prism
#

ah. Good point

#

I see the use now

#

wouldn't be fun to parse an array of strings that's like [8] or something because someone put a ton of spaces

shy turret
#

i wouldnt use it if you do -send this message

#

LOL

#

What not to do:

message.channel.send(`${args[0] ? args[0] : ""}${args[1] ? args[0] : ""}${args[2] ? args[2] : ""}${args[3] ? args[3] : ""}${args[4] ? args[4] : ""}${args[5] ? args[5] : ""}${args[6] ? args[6] : ""}${args[7] ? args[7] : ""}${args[8] ? args[8] : ""}${args[9] ? args[9] : ""}`);
earnest phoenix
#

is here someone that can guide me on webhooks

faint prism
#

why not? you'd just check if the arr[i] is a command, if it is, the argument would be arr[i+1] and any arr[] after it until another command is found

shy turret
#

@earnest phoenix what lib or using fetch()

earnest phoenix
#

discordpy

faint prism
#

I'd just loop over the array of strings, and construct the command args until I hit another command

slender thistle
#

which webhooks

earnest phoenix
#

dbl vote

slender thistle
#

To quote my message from #topgg-api,

It's literally a webserver listening to POST requests

#

If you need async webserver, use Sanic or aiohttp.web
if you don't care about async, feel free to use Flask or overcomplicate life with Django

shy turret
#

im kinda confused how message events work on libs

#

does the bot just spam GET requests

#

to discord

slender thistle
#

No, Discord sends websocket requests to you

shy turret
#

wait what nani

slender thistle
#

A Discord bot receives messages and other real-time events over websockets

shy turret
#

so we get reqs?

slender thistle
#

Yes, events like message receiving, role updates, etc.

dreamy thistle
#

.split(/ +/g)
@shy turret

and how do i diff the first part and the second part of the msg?

faint prism
dreamy thistle
#

oh, my bad

charred geyser
#

im gonna delete my dashboard and start again

#

can anyone advise me the best way to do it

thick gull
#

~~use wix

[/s just in case, shiv]~~

charred geyser
#

for reference i mean a dashboard as in somewhere you edit your servers bot settings. (login with Oauth)

wheat mesa
#
const Clowns = new Set()
if(command == 'clown') {
let newClown = message.mentions.users.first()
if(Clowns.has(newClown)) {
  Clowns.delete(newClown.id)
  message.channel.send('removed clown')
}
else {
Clowns.add(newClown.id)
message.channel.send('new clown!')
}

client.on('message', function(message) {
if(Clowns.has(message.author.id)) {
  message.react('🤡')
}})
``` this code does everything right, except it doesn't remove the user ID from the clowns constant. I'm confused as to why this doesn't work. Can anyone help?
charred geyser
#

bruh

#

what is command?

pale vessel
#

that looks like you're using multiple messages events

charred geyser
#

i think command should be inside onmessage

#

yeah

faint prism
#

const Clowns = new Set()
Not sure if that's valid (I don't do JS), but it'll reset the Clowns to empty every time

Is that code block in a function or...?

wheat mesa
#

Oh

pale vessel
#

wait didn't i help you last time

wheat mesa
#

It's in my entire async function

pale vessel
#

and you did the same thing

charred geyser
#

lol

wheat mesa
#

I just moved it cus I was just trying things

#

it didn't work while it was in the if statement either

#

I'll put it outside of my function and see if it works

#

It still doesn't work

#

this code used to work but I had to change it because I was stupid and used listeners for every command ```javascript
const clowns = new Set() //w!clown command
clowns.add("313481150637277197")
clowns.add("224363077318082561")
client.on('message', function(message) {
if(message.content.startsWith(${prefix}clown)) {
if(!message.member.hasPermission('ADMINISTRATOR')) return message.reply('cant use this L')
if(message.mentions.everyone || message.mentions.roles.size) {return message.reply('Improper mention.')}
let person = message.mentions.users.first()
if(person.bot) {return message.reply('You cannot clown bots.')}
let newClown = message.mentions.users.first()
if(!newClown) return message.reply('You need to mention the user you want to clown.')
if(clowns.has(newClown.id)) {
clowns.delete(newClown.id)
message.reply('removed clown :(')
} else {
clowns.add(newClown.id)
message.reply('new clown in town!')
}
}
})
client.on('message', function(message) {
if(clowns.has(message.author.id)) {
message.react('🤡')
}
})

pale vessel
#

you're still using two message listeners

charred geyser
#

lol

wheat mesa
#

No I'm not using that anymore

pale vessel
#

why not move the second one inside the first one too

wheat mesa
#

That's old code that was basically just a test

#

I don't use that anymore

#

I'm just saying that used to work and I have essentially the same thing now and it doesn't work in my new code

pale vessel
#

what do you mean by doesn't work?

#

nm just read

eternal osprey
#

hey how do i delete a message in a certain amount of time (15 s)

charred geyser
#

rip my messages 😔

eternal osprey
#
      message.author.send("<@" + message.author.id + ">")
      return message.author.send(embed);
      ```
charred geyser
#

gone but never forbotten

pale vessel
#

await the message or use then. you'll receive the sent message. delete it using <message>.delete() with the timeout option (<mesaage>.delete({ timeout: 5000 })). timeout must be in milliseconds

charred geyser
#

you can also use ms

#

if you wanna do like

#

args in a command

#

and not just in milliseconds

#

i mean ms as in the module

drifting wedge
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: filter must be an instance of dict, bson.son.SON, or any other type that inherits from collections.Mapping``` code ```levelstoggled = collection.find(guild_id)```
slender thistle
#

So

#

let's go through this

drifting wedge
#

pog

#

so bascly the funtion is a level toggle

slender thistle
#

With mongo, you need to specify which keys of a collection must be found

#

you are simply saying "find me a document with guild_id" without specifying which key it is

drifting wedge
#

key?

#

as in database?

slender thistle
#

as in {"key": "value"}

pale vessel
#

you know how in mongodb there's `{-

slender thistle
#

because mongo is JSON

drifting wedge
#

because mongo is JSON
@slender thistle "fancy json:

#

😳

slender thistle
#

BSON for all I care

pliant iron
#

Can anyone here give me advice regarding an issue i have with my npm package im making?

slender thistle
#

you still work with a dictionary if you pull up a document

pliant iron
#

Anyone got experience with making npm packages?

pale vessel
#

just one

#

but you should just ask

eternal osprey
#

@pale vessel i did what you said

#

UnhandledPromiseRejectionWarning: TypeError: message.reply(...) is not a function

pliant iron
#

So my package that I'm making is to get data from my mysql database on my website. Like getting an id of a user then it shows other details about them etc. How would I get it to connect to the MySQL database because if I just insert my MySQL details such as host,user,password etc people can just go in the node_modules file and get info and then login and that would not be ideal at all.

eternal osprey
#

````message.reply("A private message has been sent to you!")(message.delete({ timeout: 15000 }))```

pliant iron
#

Would I have to make an api that the npm package gets info from?

pale vessel
#

use reply().then(sentMessage => <delete>)

wicked pivot
#

how to delete a message with the message id?

fringe axle
#

How can you ping a website and get the ping in HTML?

slender thistle
#

Sorry what

fringe axle
#

Like I want to ping google.
<h1>Ping: Example MS</h1>

pale vessel
#

html is markup

fringe axle
#

I know but anything with <script>?

pale vessel
#

use javascript or get a backend

drifting wedge
#

am i allowed to do this?

#

if 'true' in arg:

slender thistle
#

what's arg

drifting wedge
#

so basicly if the word true is in arg

fringe axle
#

use javascript or get a backend
@pale vessel any other idea?

drifting wedge
#

arg should be the message arg

#

arg = arg?

slender thistle
#

do you want it to be strictly true or anything like I'mAButterflyIFlyLikeAtrueFly

drifting wedge
#

@slender thistle i mean if its strictly true

fringe axle
#

I want to ping
www.google.com
and then it should return the ping in a HTML Line

drifting wedge
#

if its not too hard

pale vessel
#

use Date.now() and fetch/xhr i guess

fringe axle
#

Me?

pale vessel
#

yes

fringe axle
#

oof

eternal osprey
#

(node:13748) UnhandledPromiseRejectionWarning: ReferenceError: sentMessage is not defined

#

@pale vessel

misty sigil
#

sentMessage = await message.author.send()

eternal osprey
#

can't i just use mesasge.delete?

misty sigil
#

no

#

not at all

pale vessel
#

and what are you deleting?

misty sigil
#

that deletes the OG message

eternal osprey
#
      message.author.send("<@" + message.author.id + ">")
      message.author.send({embed});```
#

still not defined

pale vessel
#

no

#

don't use it as a method

#
const sent = await send();
sent.delete();```
eternal osprey
#

ffs i dont get this

pale vessel
#

you can't reply()(sentMessage.delete())

#

put sentMessage.delete() in a new line, without parenthesis

eternal osprey
#

uhhm so

drifting wedge
#

@slender thistle i mean if its strictly true
@drifting wedge u there?

flint yew
#

TypeError: Cannot read property 'split' of undefined anyone can help

eternal osprey
#
           message.reply("A private message has been sent to you!")
           sentMessage.delete({ timeout: 15000 })```
drifting wedge
#

lib?

eternal osprey
#

like this @pale vessel

pale vessel
#

yes

flint yew
#

TypeError: Cannot read property 'split' of undefined

slender thistle
#

The person you have attempted to reach is not available due to lacking braincells at this moment. Please try again when they are done having a tantrum.

charred geyser
#

should i ask again

#

yes

#

I'm trying to make a new web dashboard for my discord bot (in nodejs). Could anyone advise me the best way to do it or walk me through some of the basics? For reference i mean a dashboard as in somewhere you edit your servers bot settings. (login with Oauth, etc.) I do have a mogodb and stuff that the bot runs off but im happy to change if someone can suggest something better for this application

#

🤞

flint yew
#

TypeError: Cannot read property 'split' of undefined

#

help with my error

pale vessel
#

the property you're trying to split is undefined, exactly what the error said

charred geyser
#

lol

flint yew
#

i mean how to fix

charred geyser
#

show code 🤡

pale vessel
#

define the property

#

or make sure it's defined

slender thistle
#

I'm trying to make a new web dashboard for my discord bot (in nodejs). Could anyone advise me the best way to do it or walk me through some of the basics? For reference i mean a dashboard as in somewhere you edit your servers bot settings. (login with Oauth, etc.) I do have a mogodb and stuff that the bot runs off but im happy to change if someone can suggest something better for this application
@charred geyser Mongo is fine as a database. I'm not a JS dev but you could probably use something like express server for backend

misty sigil
#

Use node-fetch for OAuth

charred geyser
#

is there any guides or docs you could link?

#

sorry

misty sigil
#

@pure lion can u tell him the basics of oauth

near ether
#

discord will temp-ban your bot for an hour if it gets 10,000 invalid requests in 10 minutes from your bot. this includes the "spam" error, 429. right?

doesnt discord.js automatically throttle the client before it begins reaching the 429 error? how come my bot is still getting temp-banned despite having < 100 api errors across 4 days (most of which are "cannot dm user" errors which are unavoidable)

misty sigil
#

unavoidable? Yes they are, just send everything in a channel

near ether
#

i only send one dm when users vote - its definitely not spamming the api with failed dm requests

flint yew
#

"stack": "TypeError: message.say is not a function

#

anyone know how to fix that

green vale
#

message.reply or message.channel.send() for that

eternal osprey
#

@pale vessel errior

#

(node:11828) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied options is not an object.

#

sentMessage = await message.channel.send("<@" + message.author.id + ">" , "A private message has been sent to you!") message.reply("A private message has been sent to you!") sentMessage.delete({ timeout: 15000 })

flint yew
#

"stack": "TypeError: message.say is not a function
anyone know how to fix that

#

anyone know?

slender thistle
#

message.reply or message.channel.send() for that

flint yew
#

dont work

#

2020-09-14 18:58:24 - error [app.js]: Cannot send an empty message
{
"name": "DiscordAPIError",
"method": "post",
"path": "/channels/739485293547356171/messages",
"code": 50006,
"httpStatus": 400,
"stack": "DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (C:\Users\K\YK303bot
ode_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)"

charred geyser
#

are you brain dead?

#

im sorry but

#

come on

flint yew
#

:/

charred geyser
#

message.channel.send()

#

Cannot send an empty message

#

what are you trying to send lmfao

flint yew
#

gif

charred geyser
#

do you have the link?

flint yew
#

my bot must send giphy

charred geyser
#

ii have no idea what that means

#

but

misty sigil
#

It needs to be an attachment

flint yew
#

fetch(https://api.tenor.com/v1/random?key=${tenorAPI}&q=${text}&limit=1)

charred geyser
#

uh

#

did you paste a bot from somewhere?

flint yew
#

no

charred geyser
#

how do you not know how to message.channel.send

#

thats like

#

the first thing you learn

flint yew
#

message.channel.send

#

that give error

#

are u...

misty sigil
#

You’re sending an empty message

flint yew
#

no

charred geyser
#

you can't send nothing

#

yes you are.

misty sigil
#

some code would help

#

please

charred geyser
#

^^

#

bruh.

flint yew
#

all working

charred geyser
#

are you trying to tell me you have a command handler

#

but

#

you dont know how to message.channel.send

misty sigil
#

message.say

#

what

charred geyser
#

???

#

no idea

#

@flint yew where did you get this from lmao

flint yew
#

nah only dont want to reply

#

can u shut up

#

or leave maybe?

charred geyser
#

what?

misty sigil
#

ok no help for you then

flint yew
#

already fixed

charred geyser
#

🤡

misty sigil
#

broh

#

ok

charred geyser
#

welp

#

that was weird

misty sigil
#

I agree

#

I moved boost to other server

#

eh I’ve got everything I need

slender thistle
charred geyser
#

silly matthew

#

😄

#

@misty sigil can you help me

#

with actual

#

bot

#

development

misty sigil
#

yea sure

charred geyser
#

ok so

#

i have a bot

#

and its like

misty sigil
#

aye

charred geyser
#

its okay but i wanna make it better

#

my ideas are:
website (dashboard, really wanna do but struggling)
xp system, probably could do but not priority
adding support for searching places like youtube
giving the bot music functionality

#

do you think if i have these all working they will accept my bot?

misty sigil
#

yea

#

lemme guess, you want oAuth help?

charred geyser
#

nah

#

oauth is not too hard

#

i just

#

im not sure how to make a website that gets user info like guilds where they have perms and put that into a nice looking ui

#

you know like

#

you log in with oAuth and you get a list of your servers

#

and then you can edit the settings

#

i wanna do that but i assume that means it has to be a node app becuase idk how tf else to get discord info

silk chasm
#

Just like the normal dashboard used by other bots... Right?

charred geyser
#

precisely

silk chasm
#

Like first getting a list of server on which u have admin perm and can change the settings...

charred geyser
#

yeah

#

like this

#

no?

#

@misty sigil did you die

misty sigil
#

yes

charred geyser
#

😮

misty sigil
#

i haven't worked with guild displays, i'll set up a test application and i'll brb

charred geyser
#

oh

#

thanks

misty sigil
#

ok yea i just cannot figure this out

ionic dawn
charred geyser
#

ok yea i just cannot figure this out
@misty sigil rip

#

do you know anyone who might?

misty sigil
#

no idea.

pure lion
#

@charred geyser hello

#

I'm here to tell you about oauth

charred geyser
#

i uh

#

hello

pure lion
#

Hello

charred geyser
#

oauth is maybe not the thing i need the most help with

#

but

pure lion
#

Do you need help or not owo

charred geyser
#

yes

pure lion
#

Okay where are you stuck?

#

Oauth is actually really simple

pure lion
#

Once you do it once you got it forever

charred geyser
#

from there

pure lion
#

Easy

charred geyser
#

i mean really its

#

how i would aproach it

pure lion
#

Do you want to load it into a cookie?

charred geyser
#

what sort of project

#

i would make