#development

1 messages ยท Page 1118 of 1

misty sigil
#

have you tried reading the documentation?

wanton anvil
#

yeah

#

didn't work

#

firstly say me how can I get a specific channel

dreamy yoke
#

just wondering approximately how long it takes for bots to get approved?

sullen harness
lusty quest
#

3+ weeks

dreamy yoke
#

oh that's quite long

#

nvm I can wait

finite bough
#

@wanton anvil want me to show u?

#

about that webhook thingy

#

its possible and an example is #bids

mild flower
#

how do i make a vote command where the two choices don't get mixed together?

#

how am i supposed to seperate it basically

wanton anvil
#

@finite bough yes please

eternal adder
#

All happened within seconds

delicate shore
#

hey @lusty quest have u applied for bot whitelisting?

#

nvm

#

u are a verified bot

#

sry for ping

#

What are the odds of my bot being rejected
for bot whitelisting

finite bough
#

tey reading these

wanton anvil
#

thanks

delicate shore
#

AN IDIOT'S GUIDE

#

lol

wanton anvil
#

can you say me how can I send messages in specific channel @finite bough

summer torrent
#

it is outdated

mild flower
#

is there any way for the bot to react in discord emojis and not just iwndows 10 emojis

#

cus i cant get the bot to react with number emojis

summer torrent
#

windows 10 emojis th

#

discord using twemoji

mild flower
#

thats not the point

finite bough
#

@wanton anvil using webhooks?

wanton anvil
#

no

#

usually

finite bough
#

\1๏ธโƒฃ

mild flower
#

ok i got it

finite bough
#

yes

delicate shore
#

What are the odds of my bot being rejected
for bot whitelisting

finite bough
#

@wanton anvil search for the channel then send a message in it

wanton anvil
#

@finite bough

delicate shore
#

;-;

#

way is same

#

only code is different

finite bough
#

same thing

delicate shore
#

What are the odds of my bot being rejected
for bot whitelisting

which kind of bots get rejected

#

by discoed

#

discord

#

for bot verifications

wanton anvil
#

client.get_channel(734273820784984114)

#

will this work

#

@finite bough

finite bough
#

dunno never worked with d.py

wanton anvil
#

ok

#

thanks for help

finite bough
#

np

wanton anvil
#

@finite bough what you've sent is js guide

finite bough
#

ye

#

sorry for that

sullen harness
#

Make an alt

#

Ezpz

mild flower
#

invite me

#

@earnest phoenix

honest perch
#

Or just make an alt

lusty quest
#

@delicate shore bot whitelistening?

mild flower
#

;vote "choice 1" "choice 2"

how can i add a seperate feature to seperate the two choices like above

lusty quest
#

split where " is

mild flower
#

how i do dat

#

like

restive furnace
#

split the string with "

mild flower
#

hmm

delicate shore
#

@delicate shore bot whitelistening?
@lusty quest ye

#

the Verified bot mark

mild flower
#

pchoice2 = args[2] || str.split("\""); this work?

delicate shore
#

what are main rules

#

that if my bot does this it cannot be approved

#

there was a problem with gif command

#

that it could give NSFW

#

since i removed gif command

#

i don't think there is any thing like this

mild flower
#

its not workin

lusty quest
#

i never applied for whitelistening

#

i just got verified

calm dragon
#

Cool @lusty quest

#

that bot do you own?

#

I got verified like 3 weeks ago.๐Ÿ™‚

lusty quest
#

about a month ago for me

calm dragon
#

i just got verifiedKEKW

lusty quest
#

in the context just is not a time constrain

misty sigil
#

need any help? or just here to dotpost?

honest perch
#

What

misty sigil
#

anyways, is there any way i can cut out all spaces in a string?

delicate shore
#

hey

lusty quest
#

regex

misty sigil
#

regex.

delicate shore
#

i had one query

#

i found a npm package

#

but idk what object it povides

#

they have no docs as well

lusty quest
#

package name?

delicate shore
#

i wanna it to do like

lusty quest
#

yea they break YT TOS

delicate shore
#

oh

honest perch
#

All do

delicate shore
#

i just wanna give

#

the name

#

not play it

#

like

honest perch
#

Rythm breaks yt tos

#

Chip does

lusty quest
#

you are not allowed to Scrape Google Pages

honest perch
#

All of them do

delicate shore
#

s!searchyt OOOP

#

then it will say

#

VIDEO NAME : OOOP
BY: FSF
LENTH

LINK

#

like this

#

not play it in a vc

honest perch
#

@lusty quest pretty much all music bots break tos

lusty quest
#

not if you go throu the Pain with the Google API

#

but i also dont care about Music bots.

#

if i want to play Music i have my Plex Server, Spotify and my PC

misty sigil
#

how do i use regex in .match()

#

do i put it in as a string?

restive furnace
#

also yt doesnt care really much

still merlin
#

Does anyone know any good translating api's that work with discord.js

mild flower
#

pchoice2 = message.content.split('"').slice(2).join(' ') does this work for splitting the choices

#

oh yes it worked

knotty steeple
#

@still merlin any api works with d.js

mild flower
#

how do i stop this tho

knotty steeple
#

just search for one

mild flower
#

?

knotty steeple
#

realize im not talking to u

#

anyway

#

yandex has translations iirc

#

or just use plain google translate christmasthink

#

@mild flower i recommend u use | as the splitter

mild flower
#

k

sullen harness
#

You can do \n for a new line

delicate shore
#

how can i see

#

what object i get

knotty steeple
#

what

delicate shore
#

@knotty steeple like i wanna tell app name so it is object.name

#

so what should i replace object with

#

they didn't mention it anywhere

knotty steeple
#

but they did?

#

have u actually read docs

pale vessel
#

how do i use regex in .match()
@misty sigil "yo yo".match(/yo/g);

misty sigil
#

ty

solid falcon
#

Any web developers using flask in here? I wanna ask some question

delicate shore
#

have u actually read docs
@knotty steeple they did not

#

they inly told abot gPlay

knotty steeple
#

what do u want to do, search for app via name?

delicate shore
#

yeyeye

knotty steeple
golden condor
delicate shore
#

brvh

#

i mean

knotty steeple
#

u can await gplay.search

delicate shore
#

ok but

#

;;----;-;;;;

#

i mean to say

#

in embed

#

for name

#

it will be gplay.title?

knotty steeple
#

no

delicate shore
#

that's what im asking

knotty steeple
#
const [results] = await gplay.search()
#

iirc

delicate shore
#

okkk

knotty steeple
#

anyway then u can do results[0].whatever

delicate shore
#

;-;

#

ok

#

error @knotty steeple

#
if(command === "playstore"){
    
    var gplay = require('google-play-scraper');
 
gplay.search({
    term: "panda",
    num: 2
  })
    
    const [results] = await gplay.search()
    
console.log(results[0])

msg.channel.send(results[0].title)
(console.log, console.log);
    
    
  }
  
#

but search term is there

#

;-;

knotty steeple
#

GWliliumFacepalmSeola u just copied my code

#

and

#

did nothing

delicate shore
#

yeh

#

ik

knotty steeple
#

put the search term????

delicate shore
#

i did ?

#

panda

pale vessel
#

no you didn't

#

yikes

#

you copy pasted his code and left your old code

misty sigil
#

no

pale vessel
#

no

misty sigil
oak shuttle
#

ok sorry

knotty steeple
#

no

pale vessel
#

no sorry lol

oak shuttle
#

mb

knotty steeple
#

yikes dude

misty sigil
#

you'll be gone in a sec eyesOG

sinful sorrel
#

how to make flip coin game if he got heads he will recive 2* his money

misty sigil
#

array or something

slender thistle
#

if (math.random > 0.5) win
else lose

misty sigil
#

oh

sinful sorrel
#

if (math.random > 0.5) win
else lose
is this the code?

knotty steeple
#

its a function

misty sigil
#

i was thinking that he wanted the user to choose

knotty steeple
slender thistle
#

it's pseudocode

sinful sorrel
#

how to make flip coin game if he got heads he will recive 2* his money
how to make this

slender thistle
#

apply that logic and create your code

sinful sorrel
#

ok

slender thistle
#

I told you how ๐Ÿ‘€

jolly quail
#

Don't expect ready made code XD

misty sigil
#

if so, you have an array ["head", "tail"] and you get random, and compare with what the user put in

knotty steeple
#

just saying since they will copypaste alone

#

@misty sigil no that doesn't make sense

misty sigil
#

yea

earnest phoenix
#

How do I make my discord.py bot automatically update a voice channel with the member count of my guild. And I need to limit to my support server only.

slender thistle
#

also mind the ratelimits because they're stricter for channel updates now

earnest phoenix
#

yes I will do it every 10 min

#

wait

#

I figured it out I think

slender thistle
#

In the task itself, you'll get your support server through get_guild and guild.get_channel

#

or just bot.get_channel

still merlin
delicate shore
#
if(command === "playstore"){
    
    var gplay = require('google-play-scraper');
     
    const [results] = await gplay.search({
    term: "panda",
    num: 1
  })
    
console.log(results[0])

msg.channel.send(results[0].title)

    
    
  }```
then @pale vessel @knotty steeple will thi work
summer torrent
knotty steeple
#

^

delicate shore
#

rn

knotty steeple
#

try it and see?

pale vessel
#

yes you can

knotty steeple
#

how can u not

summer torrent
#

^

pale vessel
#

how did you even test it

#

oh my god

delicate shore
#

i am off pc rn

#

;-;

pale vessel
#

you do realize there's runkit that lets you test it online right?

earnest phoenix
slender thistle
#

I'd suggest using wait_until_ready in the task itself instead of before

opaque eagle
slender thistle
#

but yeah you get the overall idea

summer torrent
earnest phoenix
#

@slender thistle why is guild red?

slender thistle
#

Because you didn't define it

#

You can slap channel.guild there

opaque eagle
#

i wanted to post a slap emoji but all the ones that showed up were nsfw

#

nvm i fixed my issue

delicate shore
#

@summer torrent ```(node:12422) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'title' of undefined

#

i did

#

results[0].title

#

nvm

#

i found problem

sinful sorrel
#

(node:7044) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined

#

can anyone help me

#

?

earnest phoenix
#

whatever you're trying to call 0 on is undefined

#

โœจ ๐ŸŒˆ read your errors ๐ŸŒˆ โœจ

golden condor
#

The emojis made that statement so much better

#

For Example,

const arrayThing = undefined; //why would you do this, please don't do this
arrayThing[0];
//OOPSY IT IS UNDEFINED
sinful sorrel
#

How to make if i send fc 5 then it will reply to 10 so its * by 2

#

5*2=10

opal plank
#

what

sinful sorrel
#

if i send fc 5

opal plank
#

fc 5 said in chat, okay

#

next?

#

you want to multiply that by 2?

sinful sorrel
#

then the bot send 10

earnest phoenix
#

reply to and reply with have entirely different meanings

sinful sorrel
#

you want to multiply that by 2?
@opal plank y

opal plank
#

you using d.js?

sinful sorrel
#

yes

#

im

opal plank
#

good

#

how are you parsing your arguments?

sinful sorrel
#

im still new

#

wait

#

il chat in private

opal plank
#

nonono

#

keep support here @sinful sorrel

sinful sorrel
#

ok

#
        if (isNaN(args[0]))
            return message.channel.send("Please input a Valid number");
        if (args[0] > 100)
            return message.channel.send("Insert The Number less Than 500.");
        if (args[0] < 2)
            return message.channel.send("Insert the number more Than 1.");
opal plank
#

you need to parse it first

#

you are trying to multiply a string

sinful sorrel
#

how

opal plank
#

here

#

use this method

golden condor
#
var parsed = parseInt("1")```
#

^^ example

opal plank
#

send the docs bonkcat

#

also im not sure you can isNaN undefined

#

you can nvm

sinful sorrel
#

ty for helping

faint prism
#

isNaN returns a bool if that's what you're saying

opal plank
#

no problemo

golden condor
#

You can isNaN anything

opal plank
#

isNaN(undefined)

sinful sorrel
#

if i have problem i will ask here

opal plank
#

thats what i meant

#

sure

#

we are here for helping

faint prism
#

Oh I see

sinful sorrel
#

isNan for me its work

faint prism
#

if (args.length > 0)

opal plank
#

the isNaN is fine

sinful sorrel
#

becuz i have make delete command before

faint prism
#

If you want to be sure

opal plank
#

the thing you need is parseInt the arguments

sinful sorrel
#

ok

opal plank
#

o0therwise youd be multiplying a string by a number

#

math needs to be number * number

faint prism
#

does it not have an integer cast?

opal plank
#

or rather than a comparator

still merlin
opal plank
#

just do if (args[0])

sinful sorrel
#

what is radix

faint prism
#

remove embed pls @still merlin

sinful sorrel
#

just do if (args[0])
ok

opal plank
earnest phoenix
#

@still merlin are you aware of what slice does

faint prism
#

cuts like butter?
edit: butter doesn't cut

earnest phoenix
#

pretty much

still merlin
#

Yeah, That was a old pastebin its const pollMsg = args.join(" ");

earnest phoenix
#

you could've diagnosed the issue yourself

opal plank
#

also, recommendation, use a dynamic command handler and stop using embed builders

still merlin
#

Well my code is args.join I removed the splice a while ago, I didnt make a new Pastebin though ๐Ÿคฆ

pale vessel
#

your code is diagnosed with depression

earnest phoenix
#

im14andthisisdeep

#

i just spat out my gum

pale vessel
#

dansgame

opal plank
#

Problems:

  1. PASTEBING confused_cat
  2. Prob a good idea to add a command handler
  3. Embed builders are fine but bad, its unecessary processing power. Sending an object is better
earnest phoenix
#

i mean does it matter

opal plank
#

will it work without you completely ignoring my recommendations? 100%

earnest phoenix
#

it's a few ns of difference

faint prism
#

pastebin is where you post your tokens and secrets right?

opal plank
#

ik but its completely useless

earnest phoenix
#

pastebin aka give us money for something that should be free, also we steal your data

opal plank
#

rather than making an object yourself you're calling methods and making new vars

#

this is the same as this

earnest phoenix
#

i'm aware but it doesn't matter as much

opal plank
#

its much more pratical to just send it right away on the .send() method

still merlin
#

Okay thanks

earnest phoenix
#

it's not a performance impact

faint prism
#

Image how many things would break if imgur went down

opal plank
#

rather than creating a new variable, calling methods, building it, then sending

#

you right, there is barely any impact, its just prettying it a bit

still merlin
#

I changed my embed and its fixed, Thanks!

opal plank
#

Hmmmm i wonder....

faint prism
#

I tried out embeds recently

#

I don't think I can go back to my bot replying with text

opal plank
#

there are definetly instances where you'd want raw text

delicate shore
#

i need help

#

lmao

opal plank
#

code blocks, mentions, and a couple others

#

it definetly has limitations

faint prism
#

Mhmm, I can see that

opal plank
#

crossing my fingers i dont get ratelimited for doing this...

ripe wasp
#

michael reeves is wifey

delicate shore
#

  if(command === "playstore"){
    
// code
    let currency = results.currency
    if(currency == undefined) {
     currency === "It's Free App Lmao"
    }
    const result = new Discord.MessageEmbed()
//code
    .addField('PRICE' ,`${results.price}${currency}`)
//code
console.log(results)

msg.channel.send(result)

    
    
  }```
#

why doesn't it says it's free lmao

#

anyone

faint prism
#

0DEFINED

ripe wasp
#

youre saying the var is equal to its free app

#

lol

#

call currency

delicate shore
#

0DEFINED
@faint prism 0 is price

#

and undefined us currency

placid iron
#

I'm guessing currency is not unidentified to begins with

delicate shore
#

u know what

placid iron
#

So it's not using the string

delicate shore
#

i will do if else

#

nvm

hollow current
#

im using discordpy and the on_message event, how would i make it so the script doesnt detect messages sent by any bot

#

any help would be great

slender thistle
#

message.author.bot return a boolean indicating whether the author of a message is a bot or not

#

simply return if that's true

hollow current
#

so: ```if message.author.bot:

return```

faint prism
#

if (message.author.bot) return

slender thistle
#

mhm

faint prism
#

ye

slender thistle
#

python gang

hollow current
#

alr thanks, i wasnt sure if i needed anything else for it

#

i found a stack overfflow answer for discordjs and converted it

#

but im not good with js

#

so

#

thanks

faint prism
#

C# gang:

if (context.Messsage.Author.IsBot)
{
    return;
}
lethal pine
#
inconsistent use of tabs and spaces in indentation (<unknown>, line 138)```
slender thistle
#

exactly what it says

lethal pine
#

what is the meaning of this

slender thistle
#

you're mixing tabs and spaces in indentation

faint prism
#

Python is whitespace sensative

hollow current
#

you ahve an incosisten use o tabs and spaces

faint prism
#

Use tabs OR spaces

#

cant mix em

hollow current
#

only thing i dislike python

lethal pine
#

ok @slender thistle

hollow current
#

bc its so sensetive with whitespaces

slender thistle
#

A good IDE will help you avoid that

lethal pine
#

i am using vs code

hollow current
#

vs code is good

#

its what most people use

slender thistle
#

it should have a feature to replace tabs with spaces and vice versa

faint prism
hollow current
#

i know in thonny if you open a file with broken whitespaces it fixes it for you

slender thistle
#

that's uglier than my Brainfuck code

faint prism
#

I can see that. It's pretty bad

hollow current
#

@slender thistle thank you so much, it worked

lethal pine
#
  File "main.py", line 134
    embed.add_field(name="Humans:", value= len(list(filter(lambda m: not m.bot, ctx.guild.members))), inline = False)
                                                                                                                    ^
TabError: inconsistent use of tabs and spaces in indentation
``` How do i fix it please help
faint prism
#

Dude

#

Replace your indentations either spaces OR tabs

lethal pine
#

k

#

kk

faint prism
#

It's right after that line it highlighted

opal plank
#

Eeeey it works fine

lethal pine
#

my problem is solved thankx everyone

slender wagon
#

client.on("guildMemberAdd"

#

what's the oposite?

cerulean venture
#

Leave I think

#

not 100% sure

earnest phoenix
#

no

#

Remove

slender wagon
#

oh okay

#

ty

cerulean venture
#

ah remove okay

#

So I finally managed to write the birthdays in a json file. Now I gotta go through all of them and compare them to the current date, how would I do that?

#

(well more or less the command to write them in the json file)

earnest phoenix
#

i wouldn't suggest using json files to store data like that

cerulean venture
#

hmm yeah I thought about a db as well but urgh then I would need to switch hosting since my current discord bot host doesnt allow dbs

#

need to switch to a vps in the future anyways

#

but for now I'd like to get the command done

earnest phoenix
#

mongodb and mongoose is fine

surreal notch
#

(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined

earnest phoenix
#

send code

cerulean venture
#

I have no experience with mongodb/mongoose so yeh gotta figure out what the hell to do lol

narrow folio
#

undefined.length
thats your error @surreal notch

earnest phoenix
#

i started without any experience got it setup like 2 weeks ago

surreal notch
#

so how to fix that

cerulean venture
#

oh okay ๐Ÿ™‚ so it aint that hard?

surreal notch
#

@narrow folio

earnest phoenix
#

send the code tf

#

i can't magically see it

cerulean venture
#

lmao

earnest phoenix
#

oh okay ๐Ÿ™‚ so it aint that hard?
@cerulean venture no it aint

narrow folio
#

By taking the length of something that isn't undefined

#

ยฏ\_(ใƒ„)_/ยฏ

earnest phoenix
#

pretty easy

#

i need help regading webhooks

cerulean venture
#

are there any beginner friendly guides for that?

earnest phoenix
#

i can link you something in dms

surreal notch
#

@narrow folio const { MessageEmbed } = require("discord.js"); module.exports = { name: "8ball", description: "There is a big chance I insult you!", category: "fun", run: async (bot, message, args) => { let question = message.content.slice(bot.prefix.length + 6); if (!question) return message.channel.send(`You did not specify your question!`); else { let responses = [ "Yes", "No", "Definetly", "Absoloutely", "Not in a million years", ]; let response = responses[Math.floor(Math.random() * responses.length - 1)]; let Embed = new MessageEmbed() .setTitle(`8Ball!`) .setDescription(`Your question: ${question}\nMy reply: ${response}`) .setColor(`RANDOM`); message.channel.send(Embed); } }, };
Help me to figure out

#
        responses[Math.floor(Math.random() * responses.length - 1)];```
#

Maybe this line

narrow folio
#

bot.prefix.length

#

w8

#

It also could be responses.length

cerulean venture
#

wouldnt it be -1 instead of - 1 ?

surreal notch
#

wot

earnest phoenix
#

@narrow folio can you help me regarding webhooks

surreal notch
#

Now what do

#

*to

narrow folio
#

How I am going to help with webhooks when you don't tell what's your problem

earnest phoenix
#

i want to add a webhook for my youtube channel

#

@surreal notch give the full stack error in a sourcebin

narrow folio
#

i want to add a webhook for my youtube channel
@earnest phoenix discord says that webhooks do not totally work properly with youtube

earnest phoenix
#

ok then i have to create a bot regarding this one

#

??

surreal notch
#

@earnest phoenix (node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined at Object.run (/home/container/commands/info/8ball.js:7:53) at Client.<anonymous> (/home/container/server.js:47:17) at Client.emit (events.js:327:22) at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14) at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32) at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31) at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22) at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10) at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:125:16) at WebSocket.emit (events.js:315:20) (node:24) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:24) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hastebin not saving the file

narrow folio
#

Also, idk how to do that :/
Only time I messed with webhooks was to create a github updates webhook

earnest phoenix
#

what is bot.prefix defined as?

surreal notch
#

Um my bot.prefix is not defined

#

as i think

earnest phoenix
#

then define it

knotty steeple
#

that isn't the issue..?

earnest phoenix
#

u wot m8

cerulean venture
#

"'length' of undefined"

#

it is the issue

earnest phoenix
cerulean venture
#

since the prefix isnt defined

earnest phoenix
#

that's where the issue is and the issues is that bot.prefix isn't defined

#

which is also what the error says

#

so it is the issue, unless there is more problems in the file

surreal notch
#

my prefix is in config.json

cerulean venture
#

then do config.prefix

#

instead of bot.prefix

surreal notch
#

Yes

#

ik

#

wait

#

let me show

#

will it work const {prefix} = require("./config.json")

knotty steeple
#

yes

cerulean venture
#

should be working yes

earnest phoenix
#

then you can just do prefix

#

since you are destructuring

strange trout
#

Assuming that's the correct path to the config file

cerulean venture
#

lol let's just assume that it is

surreal notch
#

i used this let question = message.content.slice(config.prefix.length + 6);

#

Now how to define config

earnest phoenix
#

??

knotty steeple
earnest phoenix
#

just put prefix.length

surreal notch
#

const config = require(config.json)?

#

i did

#

it shows prefix is not defined

earnest phoenix
#

will it work const {prefix} = require("./config.json")
@surreal notch you defined prefix here

surreal notch
#

Oof

opal plank
#

bruh

#

are you requiring that on the file?

#

or on the index?

strange trout
#

If you're going to use the prefix a lot in your code then it would be easier to import it into your main file and then just do

const { prefix } = require('./config.json');

// Other logic here

bot.prefix = prefix;

Then you'll be able to access it from bot.prefix in any command

opal plank
#

cuz i saw you had a /commands folder

earnest phoenix
#

yeah make sure you're requiring the file in the right path

surreal notch
#

Yes i use cmd handler

opal plank
#

so it'd be a folder up

surreal notch
#

uwu

opal plank
#

also are you passing client?

surreal notch
#
Require stack:
- /home/container/commands/info/8ball.js
- /home/container/handlers/command.js
- /home/container/server.js```
opal plank
#

called it

#

its one folder above dude

earnest phoenix
#

Ultron, you wanna learn basic js?

surreal notch
#

maybe

earnest phoenix
#

I suggest it

surreal notch
#

respect ur suggestion

opal plank
#

well, on the bright side, i havent been ratelimited

#

YET

surreal notch
#

lol

strange trout
#

These are basic concepts

opal plank
#

Node Relative Pathing

earnest phoenix
#

its kinda sad because all he had to do was just type a few dots and some slashes

opal plank
#

this should give an idea

#

i would get the Node Docs but they are a pain to find

#

ngl, i did not think a script would work to access Twitch Api

strange trout
#

wym

opal plank
#

check my status

#

thats an setInterval loop with a base64 img

#

on my bot

surreal notch
#

i can also do that

opal plank
#

with a script?

strange trout
#

I use cron

opal plank
#

dude, the loop isnt the big deal here

#

the fact that twitch is accepting bs64 images on a buffer to stream is

#

its not the presence that im looping, its the stream itself

earnest phoenix
#

hello

wide crane
#

Need the maniacs bot for my clan.

#

Can someone help me?

slender thistle
#

-needdev

gilded plankBOT
#

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

chrome crest
#

i got pinged here?

strange trout
#

Check your mentions

weak parrot
#

I have someone in my DMs (which due to verification reasons can't send messages in the server) who heard that v11 from discord.js will stop working/be discontinued October. Does anyone know whether that is true or not?

sudden geyser
#

It's true

summer torrent
#

yes it is true

lusty quest
#

yep

#

same day they switch to the intends

weak parrot
#

Alright thanks

summer torrent
solemn latch
weak parrot
#

Thanks

solemn latch
#

Djs v11 has been deprecated for awhile then. Didn't even realize it was already

lusty quest
#

october will be a fun month for this channel here.

solemn latch
#

Let's hope we get a public command and slow mode right when it happens

#

Like a -v11 or something

wheat jolt
#

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1596635515, 0, 0, 0, '399868039484538884', 'scripter', '(true false ) Prima intr' at line 1
https://alex.is-bad.com/9U9wkZa.png

#

the heck is wrong with this

solemn latch
#

Syntax errors with sql sometimes is so annoying.

wheat jolt
#
INSERT INTO scripter (at, status, pros, cons, userId, type, questions, answers) (1596635634, 0, 0, 0, '399868039484538884', 'scripter', '(true false ) Prima intrebare s ฤƒรฎศ™ศ›รข | (false true Introdu aici \\(adica\\) ) A doua intrebare s', 'sa | ')
#

ik but anyone know what causes it?

sudden geyser
#

you forgot VALUES

earnest phoenix
#

yikes

wheat jolt
#

aah

earnest phoenix
#

sql injection heaven

wheat jolt
#

i'm a dumbass

earnest phoenix
#

yes you are, sanitize your input

lusty quest
#

atleast mysql tells you there is something wrong

wheat jolt
#

i'm already escaping the strings

knotty steeple
#

or prepared statements mmLol

lusty quest
#

with mongoose i have the issue i need to litterally pull it out of my ass to get an error

wheat jolt
#

lol

hybrid roost
#

I think all VALUES also should still be wrapped in '

wheat jolt
#

@sudden geyser thanks

hybrid roost
#

.setTimestamp?

knotty steeple
#

yep

#

should be

#

i don't use the embed constructor christmasthink

cerulean venture
#

what do you use then?

strange trout
#

Plain objects probably

#

That's what I do

hybrid roost
strange trout
#

It's all in the docs

hybrid roost
#

I know, I just couldn't keep my eyes on it

pale vessel
#

i'm already escaping the strings
@wheat jolt no

wheat jolt
#

no what

sudden geyser
#

I don't see any (direct) user input in that sql statement

#

it more looks like the result of one

wheat jolt
#

@pale vessel ?

surreal sage
#

what is the file exstension that is similair to json

#

like

#
{
{
"something": "something",
"a": b"
}
}
pale vessel
#

no.

#

xml?
that looks nothing like xml wtf

surreal sage
#

sorry lol

pale vessel
hybrid roost
#

JSON, but custom filename.. and with Syntax error in it

pale vessel
#

nice

fresh matrix
#

@hybrid roost why did you choose me? Lol

hybrid roost
#

I was just flipping through testing-1

#

I saw your embed and I was like, " wow, how did he do it?. I want that too"

sudden geyser
#

what is the file exstension that is similair to json
yaml?

#

doesn't look anything like the example you gave

#

but json and yaml are pretty similar

solemn latch
#

Looking around, I cant find any standard format that supports what was given.
Looks like json inside extra brackets to me

pale vessel
#

scuffed array

restive willow
#

in discord.py, is there a way to have a different status for every server? or is it just one global one

summer torrent
#

it is not possible

#

you can do it for shards

solemn latch
#

I had no idea shards had their own status.

pale vessel
#

i mean they're different instances are they not?

slender thistle
#

Essentially

solemn latch
#

Yeah, I just assumed each one would share statuses for some reason

knotty steeple
#

what do you use then?
@cerulean venture
Plain objects probably
^^

cerulean venture
#

huh?

#

ohh

#

sammy do you have any clue about mysql by any chance?

pure lion
#

Oh MySQL

knotty steeple
#

i do

cerulean venture
#

yeh kinda forced to use it due to my hoster <.<

pure lion
#

Piece of cake

If the cake as made of acid

cerulean venture
#

could I dm you real quick?

knotty steeple
#

can't u say here

cerulean venture
#

I mean I can, just gonna be kinda a wall of text

pale vessel
#

do it

#

more people can help

pure lion
#

Yea more people who aren't me because I'm nosql

knotty steeple
#

im not like a mysql expert

faint prism
#

tfw sql page indexes are 99% fragmented

cerulean venture
#

Okay following: I'm still working on the birthday thing that I was talking about like a few hours ago.

I made some regex stuff to make sure it's actually a date (dd/mm). So far so good, writing to json worked without a issue. Writing to mysql tho tells me it's the wrong format (in terms of dd/mm)

pure lion
#

It's probably something like
rowName.forEach(r => r.delete())

cerulean venture
#

just tried to keep it short

pale vessel
#

that's not how sql works-

pure lion
#

Wdym wrong format?

#

LmAo

cerulean venture
#

wait listen xD

pale vessel
#

sql need queries

faint prism
#

You need a key for it

cerulean venture
#

I know

#

lemme just try to explain somehow

#

mostly using the same command except for doing this
"INSERT INTO `birthday` (`bdUser`, `bdDate`) VALUES ('"+message.author.username+"','"+ editedmessage+"')";

instead of fs.writeFileSync ("./birthday.json", JSON.stringify (bday, null, 4))

  • so everything is kinda the same
#

I can use queries without any issues but when I try to keep the (dd/mm) format it tells me it's the wrong

#

even tho it's the same message that I'm trying to query

#

like I don't think it's an issue with mysql to be honest, I feel like something else is going wrong

#

since editedmessage stays the same, json or mysql but regex is like: yeah nah wrong

#

i dunno how to explain it lmao

pale vessel
#

what's editedmessage?

#

and what type is bdDate

earnest phoenix
#

now imagine if my username was ', ''); DROP TABLE birthday;--

pale vessel
#

rip

knotty steeple
#

prepared statements prepared statements

cerulean venture
#

okay so:
editedmessage = message.content.slice(10);

bdDate was for json that part:

    "Lysec": {
        "bDate": "01/02"
    }
knotty steeple
#

or just use id

pale vessel
#

and what type of data is bdDate

cerulean venture
#

text

earnest phoenix
#

rewrite your sql code, you're vulnerable to sql injection in multiple places

cerulean venture
#

but that shouldnt matter since I didnt even check if it's the right data for mysql

#

yeah I noticed sadly

#

was just trying to figure out how it works in general and after that working out the sqli's

#

What I just dont get is why my regex (/^[0-9]{2}[/]{1}[0-9]{2}$/) tells me the date is fine when I check it in my json version (which is basicaly the same thing except for not using mysql) but on the mysql version it tells me it's not a date kinda

#

that's what my issue is right now

pale vessel
#

99/99 lol

solemn latch
#

Does mysql support that format?

pale vessel
#

it's text

#

it's fine

tawny badge
#

Halo

cerulean venture
#

yeh it does

#

so I dunno what's going on

earnest phoenix
#

wait

pale vessel
#

unless he put timestamp

faint prism
#

/^[0-9]{2}/[0-9]{2}$/ dont think you need /{1}

cerulean venture
#

I could literally post both commands since they're rather short

earnest phoenix
#

are you trying to store a date in the table by parsing it from discord

solemn latch
earnest phoenix
#

cause if so, literally parse it in your code and store the unix timestamp

cerulean venture
#

im trying to store a date in the table when someone says

$birthday 01/01 for example

pale vessel
#

$birthday 99/99

cerulean venture
#

exactly

knotty steeple
#

$birthday 00/00

pale vessel
#

you don't even need regex to parse those date properly

faint prism
#

Gotta be a bit more explicit

pale vessel
#

explicit flushwobble

#

you mean specific or something lmao

faint prism
#

Explicit is a correct term

cerulean venture
#

Okay so the plan currently:
Command: (prefix)birthday date
The date + author name should get into the mysql table

solemn latch
pale vessel
#

doesn't he store it as text?

cerulean venture
#

yeah I do

solemn latch
#

Ohhh

#

Then no idea

#

id store it as a date

cerulean venture
#

since apparently most people in the discord hate using dd-mm-yy or whatever

knotty steeple
#

u can fill in the year ig

#

just use 9999

solemn latch
#

You can turn
99/99 into a dd-mm-yy

cerulean venture
#

hm true

knotty steeple
#

why not

faint prism
#

[0-9]{4}-[0-1][0-9]-[0-3][0-9] and it still feels not good enough

pale vessel
#

how about parse it without regex

cerulean venture
#

how would I do that?

pale vessel
#

split, moment, etc. idk

faint prism
#

DateTime.Parse() mmLol

pale vessel
#

also, new Date()

faint prism
#

Oh yeah, JS has a date datatype. You're covered

cerulean venture
#

I might be dumb or just overthinking stuff but how would I use that since that still wouldnt check if it is actually a date, right?

faint prism
#

Covert it back to a string in the format you want

#

The new Date() will verify it's valid on construction

cerulean venture
#

yeah nah I don't get it anymore, might need to take a break from coding for today I think

faint prism
#

So some psudo code:

var bday = "04/20/97"
var bDate = new Date(bday)
return bDate // 1997-04-20T00:00:00.000Z I think that's how JS works
cerulean venture
#

so bday would be my current editedmessage I guess

faint prism
#

new Date("00/00") or new Date("99/99") would throw an exception you could catch

cerulean venture
#

wouldnt I still need to add the year n stuff?

still merlin
#

Does anyone know how you splice stuff in discord.js? I tried args.join.splice but

:\Users\ewe0 name /Desktop\SpiderBot Project\index.js:192
      const messageContent = args.join.splice((prefix + "say"))
                                       ^

TypeError: args.join.splice is not a function```
knotty steeple
#

remove .join

#

actually

sonic lodge
#

also .splice() takes in a number

knotty steeple
#

make the join a function

#

cuz it is

faint prism
#

Read the docs, I think it assumes this year, but wouldn't be hard for you to check and concatenate that to the end if that wasn't the case
@cerulean venture

cerulean venture
#

yeah doing that rn

#

yeah nah my brain stopped working

faint prism
#

Lol

dire obsidian
#

well im making a command handler and i need make a command restriction(no cooldown) like, restriction: 'owner', or 'member', i need edit the bot.js file and the discord.js guide& docs dont say anithing abaut command handler restrictions

#

uff

faint prism
#

Is there no way to check the message senders Id?
I check if they are in the array of admin ids

hybrid roost
#

if i use MessageEmbed.toJson() how can i turn it back to MessageEmbed object?

dire obsidian
#

Is there no way to check the message senders Id?
I check if they are in the array of admins
@faint prism well actually yes, like at the start of the module make: id (msg.author.id !== 'ur id') return;

#

wait ill see some examples on the same file

#

hmmmm maybe

    if (command.ownerOnly && message.author.id !== 'my id') {
        return message.reply('you cant execute this command');
    }
faint prism
#

So for instance, one of my admin commands looks like this (C#)

        [Command("info")]
        public async Task Info()
        {
            if (Context.User.Id == _config.AdminId && Context.IsPrivate)
            {
                await ReplyAsync("", false, _commandRepository.InfoCommand(Context.Client));
            }
        }
dire obsidian
#

hmmm

#

ill try

#

but i need a test subeject

#

time to dm 100 persons

solemn latch
#

Alt accounts

dire obsidian
#

(not from here)

earnest phoenix
#

you should probably offload that if check to a precondition @faint prism

#

equivalent of filters in asp.net core

faint prism
#

Can you elaborate?

earnest phoenix
faint prism
#

damn it

#

There are so many preconditions I am already checking for

#

like is the guild this, or is the user in that guild, etc

#

Ugh, I should read docs more

cerulean venture
#

I'm getting closer Auger, trying to use moment currently but it's kinda weird

#

it tell's me it's a valid date but when I log it, it just says "2" instead of "01-02"

faint prism
#

That might help, since I don't know JS myself, and my code snippet was psudocode

cerulean venture
#

yeah I know

#

it kinda does help but it also leads me to moment

faint prism
#

json stringify sounds like what was missing

cerulean venture
#

hmm

faint prism
#

JavaScript doesn't have a date literal, and for this reason JSON serializes dates as strings rather than real JavaScript dates

cerulean venture
#

json stringify sounds like what was missing
@faint prism

That's what I used before but just with regex

#

and it worked it just didnt want to work as soon as I tried using the date in mysql

#

whhich i still don't get

faint prism
#

With regex you're doing a lot of the heavy lifting yourself, like verifying if the date is valid

cerulean venture
#

Well that's what I tried to explain earlier

#
        fs.writeFileSync ("./birthday.json", JSON.stringify (bday, null, 4))
        message.channel.send(`Added: **${editedmessage}** as birthday for **${message.author.username}**`)
    }```

That was the part for my json
#

and I just changed the fs.writeFileSync to the normal mysql stuff

#

but then it tells me that the regex is wrong

#

so I still don't get why

#

since it shouldn't really matter if it's json or mysql since it doesn't even get that far anymore

faint prism
#

JSON.stringify ( is that space there important?
^

neon matrix
#

how i can do in css the top.gg buten chance

cerulean venture
#

nah I just got used to doing that

faint prism
#

Can you send the error output?

cerulean venture
#

sure gimme a sec

#

Well thing is, there is not really an error lol

#

was just making sure that nobody wanted to add "awuid8ujfhas" as their birthday

#

urgh it's hard to explain

faint prism
#

You want input validation, I get that

cerulean venture
#

yeah and it works

gilded trout
#

my code

const commandsFolder = fs.readdirSync(path.join(__dirname, "/commands"));

for (var folder of commandsFolder) {
  const files = fs
    .readdirSync(path.join(__dirname, "/commands", folder))
    .filter((filename) => /^.*\.(t|j)s$/.test(filename));
  for (var filename of files) {
    const command = require(`./commands/${folder}/${filename}`).default;
    bot.commands.set(command.name, command);
  }
}

my error
`
C:\Users\rmota\Documents\Ambiente\bot\src\index.js:19
bot.commands.set(command.name, command);
^

TypeError: Cannot read property 'name' of undefined
`

faint prism
#

Great

cerulean venture
#

it just doesnt work as soon as I change to mysql

#

works great with json

#

but I don't get what the issue is since it's still checking for the same regex

faint prism
#

sql doesnt like the stringifyied date?

cerulean venture
#

not really apparently

#

lemme just pastebin that stuff real quick and maybe you get why that's happening since I can't find the reason behind it

delicate shore
#

my bot comes first then Autjja on top bot list

cerulean venture
#
            return message.channel.send('Not a valid date (DD/MM)');
        }```

This part works in the json version but not in the mysql version for some reason
delicate shore
#

my comes on page 30 and auttja comes on page 31

cerulean venture
#

like it works it just tells me that it isnt a valid date lmao

faint prism
#

I got a question myself. How do you inline 2 fields for an embed, but add a break between that and another 2 inline fields?

cerulean venture
#

huh?

#

just add ,true

#
    .addField('**Stuff**', Stuff, true) ```

That would put them next to eachother
#

or what did you mean?

faint prism
#

I want those 2 inline, but a newline seperating another 2 inlines

cerulean venture
#

ohh uhm probably just add a filed and leave it empty or just use ' ' ? dunno

faint prism
#

cant be null, empty, or whitespace

#

๐Ÿ˜›

sonic lodge
#

add a field with a zero-width space

cerulean venture
#

\u200B

solemn latch
#

^

cerulean venture
#

good to know tho lmao was looking for that as well a few weeks ago

sonic lodge
#

in between these quotes 'โ€‹'

cerulean venture
#

yeh

opaque eagle
#

If I use GitHub Actions in a repo owned by an organization and I need to add in my github token as a secret, can collaborators see that secret too?

faint prism
#

builder.AddField("\u200B", "\u200B"); gonna try that

cerulean venture
#

yea

#

or nah '

faint prism
#

ayy

#

great

cerulean venture
#

builder.AddField('\u200B', '\u200B');

faint prism
#

Accepts strings only

#

not chars

#

But, that's okay because the escape \ escape takes care of it

cerulean venture
#

hm nice

delicate shore
#

how to

#

get custom bg

#

like this

earnest phoenix
#

overwrite the css

delicate shore
#

is it css

#

o

faint prism
#

get fancy

delicate shore
#

overwrite the css
@earnest phoenix do i need to do it in long descr

earnest phoenix
#

where else

delicate shore
#

ok

solemn latch
#

Next to the bot id ofc

faint prism
#

The real question is. How do you all implement that embed with page flipping reactions?

delicate shore
#

is there any tutorial or docs

#

for it

earnest phoenix
#

I'm so friggin mad. I can't figure out how to use emoji regex to identify if a message is an emoji or not

pale vessel
#

learn how to use html

earnest phoenix
#

latest version of interactive should be on fox's myget

#

give me a sec i'll grab the feed url for you

solemn latch
#

Deleting every message?

earnest phoenix
#

Is anyone here very familiar with regex?

faint prism
#

You're fast Cry, ngl

earnest phoenix
#

Just deleting any message that isn't an emoji

#

add this to your package sources on vs

solemn latch
#

The regex for that would be pretty straightforward

earnest phoenix
#

If you know regex

#

but once you add emoji regex

faint prism
earnest phoenix
#

I understand that

#

but how do I implement it

#

into node

faint prism
#

js has .match(regex)

solemn latch
#

Google regex nodejs

earnest phoenix
#

I have been trying

#

there's a fuckton of prebuilt emoji regexes online, you can find one within 20 seconds

solemn latch
#

Its like the first result

earnest phoenix
#

I know that

#

but

faint prism
#

Especially Cry, he's fast af

earnest phoenix
#

I don't understand specifically

#

sorry

#

I'm super slow

#

what is there to not understand

#

I understand how to filter out emojis

#

with regex

#

but

pale vessel
#

what

faint prism
#

You want the opposite right? lol

earnest phoenix
#

I don't understand how to implement it into messages

pale vessel
#

if (string.match()) delete();

solemn latch
#

Message.match ?

faint prism
#

Are you sending emojis, or...?

pale vessel
#

what

earnest phoenix
#

just like you would with any other string, compare against the content

#

If anyone sends a message that is not an emoji or longer than one emoji then delete

#

I'm so fucking stupid

pale vessel
#

check if it matches then

restive furnace
#

the regex is similar to mention regex

earnest phoenix
#

HOW DID I FORGET THE CODE EDITING SOFTWARE

#

WHAT'S IT CALLED

#

FRICK

pale vessel
#

notepad.exe

solemn latch
#

???

earnest phoenix
#

-_-

restive furnace
#

vim better

sonic lodge
#

vsc? atom?

pale vessel
#

nano gang

earnest phoenix
#

VVSC

#

VSC

faint prism
#

All good options

pale vessel
#

who's spamming reactions

solemn latch
#

Psh, dev mode

earnest phoenix
#

wait

#

bot.on('message', msg => { if (msg.author.bot) return; if (msg.content !== (I HAVE NO FUCKING IDEA)) {

#

what would it look like

pale vessel
#

yikes

#

help vampire moment

restive furnace
#

g/regex/

#

probably

pale vessel
#

no

earnest phoenix
#

I have no idea what that means

solemn latch
#

If(message.match())
?

earnest phoenix
#

FUCK I CANT

solemn latch
#

We are kinda getting into help vampire territory now

pale vessel
#

why are you so smart

earnest phoenix
#

I DON'T KNOW WHERE THAT GOES

solemn latch
#

Learn js before making a bot

sonic lodge
#

if (/regex_that_matches_an_emoji/.test(message_content)) {
   // delete the message
}```
earnest phoenix
#

WHAT

faint prism
#

/^(u||you)$/g

sonic lodge
#

..that's js

restive furnace
#

no

earnest phoenix
#

I FEEL STUPID

restive furnace
#

its regex, not js.

earnest phoenix
#

I HAVE NO CODING KOWNLOEDGE

faint prism
#

Thats your problem

earnest phoenix
#

you maybe shouldn't be making a bot then

solemn latch
#

You should learn that before making a bot

earnest phoenix
#

This is how I'm learnign

#

by making a bot that literally just deletes a message

solemn latch
#

Bots are not the best first project

earnest phoenix
#

if it isn't an emoji

faint prism
#

You need to Hello World first

pale vessel
#

/^(u||you)$/g
@faint prism u|you

earnest phoenix
#

i did that

restive furnace
#

Bots are not the best first project
^

cerulean venture
#

okay wtf I'm confused @faint prism I pasted the literally SAME code to the birthday command and it works

earnest phoenix
#

you don't learn french by writing a book in french, do you?

cerulean venture
#

but wont work with the test command

earnest phoenix
#

You can learn french by writing small sentences in french

#

eventually you get better

#

and write big books

solemn latch
#

Your trying to write a book first

earnest phoenix
#

A book is a big bot this is a minimal simple bot

solemn latch
#

Simple bots have a lot of moving parts

faint prism
#

Oh really?

earnest phoenix
#

oh it's a book

solemn latch
#

Even the simplest bots

delicate shore
#

then do i need to

earnest phoenix
#

`bot.on('ready', () => {
console.log('Emoji Bot is Online!')
})

bot.on('message', msg => {
if (msg.author.bot) return;
if (msg.content !== (I HAVE NO FUCKING IDEA)) {
msg.delete();
msg.author.send({ embed: embed });

}
if (msg.content === new RegExp(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g)) {
    msg.member.setNickname(msg.content);
}

})

bot.login(token);`

#

This is the entire bot

cerulean venture
#

yeah I don't get it

delicate shore
#

e

faint prism
#

My class library alone is 70kb

pale vessel
#

what the fuck is that regex

faint prism
#

My bot project compiled is 237mb

earnest phoenix
#

that was me testing things

solemn latch
#

Why would the command be === to a regex

earnest phoenix
#

I HAVE NO IDEA

#

please give feedback

delicate shore
#
<html>
<head>
<style>
body  {
  background-image: url("paper.gif");
  background-color: #cccccc;
}
</style>
</head>
<body>

<h1>The Best Bot</h1>

<p>Black Sheep</p>

</body>
</html>
#

here

pale vessel
#

yikesss

solemn latch
#

Learn js first

delicate shore
#

how can i

faint prism
#

=== is type sensitive too in JS right?

solemn latch
#

Then make a bot

#

Yeah

delicate shore
#

put a picture

#

i was reading w3schools

pale vessel
#

learn html

delicate shore
#

do i need to replace url with something

pale vessel
#

img tag

earnest phoenix
#

Can someone please just write the one bot.on script for me so i can see what I'm doing wrong

pale vessel
#

no.

delicate shore
#

;-;

earnest phoenix
#

if you pay me

solemn latch
#

No spoon feeding

earnest phoenix
#

);

delicate shore
#

lol

solemn latch
delicate shore
earnest phoenix
#

it's 5 lines of code