#development

1 messages · Page 1117 of 1

fringe jackal
#

I know programming language

digital ibex
fringe jackal
#

Ok thanks

digital ibex
#

which one?

pure lion
#

Brainfuck

sudden geyser
#

i still need help the thing on stack didnt do shit
@sterile minnow sorry if I missed it, but what exactly do you need help with

fringe jackal
#

Java and c and little bit node.js@digital ibex

#

But i programmed node.js

pure lion
#

nodeJSisjsbutokay

fringe jackal
#

I love '.'

sudden geyser
#

If you have little knowledge in most the langs you specified or just want to start off fresh, I'd recommend Python.

pure lion
#

Has anyone eve-

solemn latch
#

I like dots too

#

.

pure lion
#

Ew py as a starter language? Do you want to ruin your sense of syntax for the future

fringe jackal
#

Ok bye

pure lion
#

Ever used ;

#

Or ()

sterile minnow
#

I finally got it

pure lion
#

What did you finally got

sudden geyser
#

Python is super beginner friendly like JavaScript is

#

plus you don't need semicolons in either languages

digital ibex
#

whichever ur more comfortable with, use:
c lang: libdiscord (beta)
java: jda
node.js: eris or discord.js

#

@fringe jackal ^

pure lion
#

discord.js-light*

placid iron
#

as a first language i learnt visual basic lmao

solemn latch
#

Probably should learn djs before using djs light for now

placid iron
#

i got sad when there were no goto's in python

digital ibex
#

eh

#

if there are any new bot devs which actually knows node.js, i'd point them into the direction of eris

#

not discord.js

solemn latch
#

The problem is most people who say they know js, dont

#

Especially in this server

pure lion
#

Me when the :=

sudden geyser
#

go

digital ibex
#

which is one of the reasons why i dont like discord.js

#

not this server

#

but the reputation discord.js has

pure lion
#

Why does the walrus operator look weird

digital ibex
#

i like it

sudden geyser
#

it's sad that you're using it as an assignment

opal plank
#

only a man?

solemn latch
#

sorry im a woman

opal plank
#

thats sexist dude

solemn latch
#

shoot, erwin beat me to it

opal plank
#

lmao

#

i identify as an alien

#

okay im getting too shitposting carried away

solemn latch
#

ah 2020

pure lion
#

Sorry I'm a woman too

opal plank
#

either way, not the place for asking that i guess

pure lion
#

Pay me

#

:D

opal plank
#

if you want to code we more than happy to help ASakashrug

pure lion
#

If you want a woman then pay me

#

To do it

#

For you

#

:)

sudden geyser
#

that's going to get you on a list

opal plank
#

Unlikely, unless you willing to hire someone

#

'work for me for free, plsz'

solemn latch
#

new bingo things

opal plank
#

oh you right, might be able to add that to bingo

pure lion
#

Hire me daddy

#

😩

#

Let me do some work for you so you can pay me 😩 😩 😩 😩 😩 😩 😩 😩 😩 😩 😩

#

Please I need money for hosting

slender thistle
solemn latch
#

oop mb

#

sometimes i forget when people ask off topic questions it doesnt automatically make it off topic

sweet ruin
#
    if (guild.levels === "enabled") {guild.levels = "disabled"
        await guild.save()
        message.channel.send("Leveling System is Disabled")
    } else {
        guild.levels = "enabled"
        await guild.save()
        message.channel.send("Leveling System is Enabled.")
    }```
#

This only disables it

#

when the database isnt it

#

anyone help?

solemn latch
#

when the database isnt it?

sweet ruin
#

basically the database saves it under "levels"

#

and it is either enabled or disabled based off of that command

#

but when the database's "levels: "enabled"" it just skips the whole entire command.

#

I've even tried else if statements

#

I cant seem to figure out why it just does not notice if it says disabled or not

strange trout
#

Show where you're checking if it's enabled or disabled

#

Also why don't you just save as a boolean lilyHmm

sweet ruin
#

Top is Code

#

Bottom is Database

#

In guilds

#

where it saves

amber fractal
#

Not sure exactly (because I didnt actually look at the code), but why dont you just use a boolean?

sweet ruin
#

wdym

#

like euhh

amber fractal
#

levels: true or levels: false for enabled or disabled

gritty bolt
#

does anyone know how to make a div take up the entire browser's screen? i've been trying to make it work on my bot's site for the past 30 mins now

strange trout
#

height of 100vh

gritty bolt
#

tried that, doesn't work

#

looks the same

sweet ruin
amber fractal
#

is your div inside of a div

#

Have you used js before?

sweet ruin
#

me?

amber fractal
#

You know what a boolean is right?

#

Yes

sweet ruin
#

yeah a true or false thing

#

but not how to use it

amber fractal
#

You should save guild.levels as a boolean rather than a string

#

is all I meant

sweet ruin
#

just did that

gritty bolt
#
<script src="js/vendor/modernizr-3.11.2.min.js"></script>
  <script src="js/plugins.js"></script>
  <script src="js/main.js"></script>
  <script src="https://cdn.jsdelivr.net/gh/tengbao/vanta@master/vendor/three.r95.min.js"></script>
  <script src="https://cdn.jsdelivr.net/gh/tengbao/vanta@master/dist/vanta.fog.min.js"></script>
  <div id="vantaFog"></div>
  <script>
    VANTA.FOG({
      el: "#vantaFog",
      mouseControls: true,
      touchControls: true,
      minHeight: 200.00,
      minWidth: 200.00,
      highlightColor: 0x70707,
      midtoneColor: 0x0,
      lowlightColor: 0x2f2f2f,
      baseColor: 0x222222,
      blurFactor: 0.40
    })
  </script>```
#
#vantaFog {
  position: absolute;
  display: block;
  min-width: 100vw;
  min-height: 100vh;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}
amber fractal
#

guilds.levels: true is not proper js, nor what I meant

sweet ruin
#
    if (guild.levels === Boolean(true)) {guild.levels = Boolean(false)
        await guild.save()
        message.channel.send("Leveling System is Disabled")
    } else {
        guild.levels = Boolean(true)
        await guild.save()
        message.channel.send("Leveling System is Enabled.")
    }
#

like this?

earnest phoenix
#

what's the point of doing Boolean() on a boolean

sweet ruin
#
    if (guild.levels === true) {guild.levels = false
        await guild.save()
        message.channel.send("Leveling System is Disabled")
    } else {
        guild.levels = true
        await guild.save()
        message.channel.send("Leveling System is Enabled.")
    }
#

this better?

halcyon ember
#

I keep getting this error when I'm trying to put guild data into a mysql table

#

ER_TRUNCATED_WRONG_VALUE_FOR_FIELD

#
  errno: 1366,
  sqlMessage: "Incorrect string value: '\\xF0\\x9F\\x8F\\x96Et...' for column 'name' at row 1",
  sqlState: 'HY000',
  index: 0,
  sql: `INSERT INTO guilds (id, name, prefix) VALUES ('702754622015799336', '🏖Ethereum Paradise🏖', "$")`
}
amber fractal
#

could just do if(guilds.levels) because if checks for a boolean condition so doing if(x === true) is redundant

earnest phoenix
#

you're not sanitizing your input

strange trout
#

Can be as simple as

guild.levels = guild.levels ? false : true

await guild.save();

return message.channel.send(`Leveling System is now ${guild.levels ? 'enabled' : 'disabled'}.`)
solemn latch
#

trying to save an emoji into a mysql db?

earnest phoenix
#

or you're using mysql in which case, why and you need to set the table format to utf8mb4

gritty bolt
halcyon ember
#

i made my mysql collation utf8mb4_general_ci

#

its a table for guild names

placid iron
#

Sqlite3 is the best because u can save emojis with no changing things up

strange trout
#

Why are you saving guild names

halcyon ember
#

guild data

#

prefixes settings and that stuff

strange trout
#

Just save the ID

#

No need to save the name

halcyon ember
#

i put the name so its easier for me to look through in the case i need to change something

misty sigil
#

but id is actually easier tho

strange trout
#

Fetch the guild with the ID

#

Done

sweet ruin
#

@strange trout it still does not work. I took your code exactly, but it only changes if the levels = true and it changes it to false

#

but never if it is false to true

halcyon ember
#

it accesses it via the id

#

the name doesnt do anything for the bot

#

it makes my eyes hurt less when looking through it on phpmyadmin

solemn latch
#

sometimes there are reasons to store names, such as dashboards

gritty bolt
halcyon ember
#

i have the collation set to utf8mb4_general_ci

strange trout
#

@sweet ruin there's probably something wrong with the code I sent. I'm on mobile lol

sweet ruin
#

No no

#

it works now

#

somethin in index which I put there

#

to block the code from working in the first place

#

if it was disabled

#

was stopping it

#

I need to rework that into the booleans xD

strange trout
#

Yeah. Makes it a lot simpler though

sweet ruin
#

Alexis

#

would an If else statement work for the booleans in index

#

because Im looking at the code you wrote here

#

and idk how I could make that into an if else statement with such large code

solemn latch
#

his code is an if else statement really, just written in a different way

strange trout
#

^

halcyon ember
#

nvm

#

.replace(/[\u0800-\uFFFF]/g, '') worked c:

strange trout
#
if(guild.levels) {
  // TRUE do this 
} else {
  // FALSE otherwise do this 
};
sweet ruin
#

coool cool

#

thanks all

earnest phoenix
#

sometimes there are reasons to store names, such as dashboards
@solemn latch
there are never reasons to do that, you can fetch the guild object and if you're using oauth2 you can get partial guild objects with a bearer token

#

if you store any dynamic data then you have to also listen to their changes and update it accordingly which is just retarded

solemn latch
#

so, you should request thousands of guilds names?

strange trout
#

What

earnest phoenix
#

so, you should store and track thousands of guild names?

solemn latch
#

if you need to access all of them

earnest phoenix
#

you don't get the point

solemn latch
#

🤷‍♂️

gritty bolt
earnest phoenix
#

if you need to track guild changes, then you're already logged in to the gateway - if you're logged into the gateway you have guilds in cache which means that you don't have to request anything, the name is pulled from memory lol

solemn latch
#

more than one thing can access a database

earnest phoenix
#

that's not the point

strange trout
#

It's redundant

bright meadow
#

so I am using JDA and created a shard Manager with default gateway intents. Now almost no user data are available anymore?

earnest phoenix
#

accessing from db is slower than accessing memory

solemn latch
#

???

earnest phoenix
#

plus imagine the resource waste that's spent on tracking guild changes just to update strings in a database

strange trout
#

It just gives an extra thing to worry about saving and updating since names are dynamic

earnest phoenix
#

that and you also need to account for bot downtimes and unreceived events

gritty bolt
#

i've literally spent an hour trying to get a background for my bot's website to work i dont get it

earnest phoenix
#

tldr storing any dynamic data is asking for a headache and it's on you

solemn latch
#

so my dashboard, which has no access to my bot, should request every single guilds data from discord?

gritty bolt
#

like i dont get it how do I fit it to the whole screen

#

nothing i try works

earnest phoenix
#

integrate your bot into the dashboard backend

strange trout
#

Why wouldn't dashboard have access to the bot lol

solemn latch
#

seperate servers

earnest phoenix
#

doesn't matter...?

solemn latch
#

so, send request data to the separate server?

earnest phoenix
#

discord bots can be logged in to the gateway regardless on how many machines they're on

#

just integrate your bot into the backend of the dashboard

#

have it logged into the gateway so you get all guilds in cache

#

you don't have to keep any other data in cache but guilds

#

to reduce memory load

solemn latch
#

but that increases memory load doesnt it?

#

caching is more memory, not less

earnest phoenix
#

i'm aware

solemn latch
#

along with more network usage

earnest phoenix
#

the transfer is so small the network usage doesn't matter lol

solemn latch
#

🤷‍♂️

earnest phoenix
#

storing dynamic data doesn't scale and it's just asking for problems

solemn latch
#

hmm

#

okay, what about user data.
for example, mee6 leaderboard data.
wheres the user usernames coming from? discord directly?

#

you cant fetch other users with oauth no?

misty sigil
#

i'm having problems with ms

earnest phoenix
#

most likely mee6 backend

client -> mee6 backend -> cache lookup -> if not found, REST request -> return the user to the client

misty sigil
#

it works normally but not when i feed time in

solemn latch
#

thats gotta destory ram then?

misty sigil
#

time is 3s

#

but ms(time) returns undefined sollyWut

solemn latch
#

because they would be caching the top atleast 100 of each guild atleast

earnest phoenix
#

huge bots consume a ton of ram

#

they're sharded anyways

sudden geyser
#

Jeremy can you show your code

#

It works for me

earnest phoenix
#

also you're probably used to d.js caching which is extremely heavy

#

i easily handled this guild + DAPI + discord bots + 2.5k other guilds at around 150MB steady

#

with all members cached

#

hi

#

what's up

#

at mee6's scale it would cost more resources to store the user avatar and other relevant data in the database and keep up with the changes

#

which they do not

#

keep in mind that you cannot track member/user changes if you don't have shared guilds

quartz kindle
#

if you have a well designed database, you will need very little caching

earnest phoenix
#

sorry my english is horrible

quartz kindle
#

database lookups should be fast enough for something like a top 100 users per guild

solemn latch
#

so you think mee6 stores usernames in their database?

#

for users?

quartz kindle
#

most likely

solemn latch
#

ay

earnest phoenix
#

i doubt it

solemn latch
#

tim agrees with me

earnest phoenix
#

keep in mind that you cannot track member/user changes if you don't have shared guilds
the users on mee6's leaderboard page appear updated regardless

misty idol
#

i doubt mee6 would store usernames it would probs be user IDs

misty sigil
#

Jeremy can you show your code
@sudden geyser just ms(time)

earnest phoenix
#

^

misty sigil
#

and time is defined as my arguments

quartz kindle
#

well if it needs to fetch 100 users every time it loads a top 100, that would be troublesome

earnest phoenix
#

it most likely keeps them in cache

solemn latch
#

they would need to fetch them at startup

quartz kindle
#

in this case, what would a cache do? if you need to fetch them anyway for them to be updated

solemn latch
#

i tried this with my leaderboard system, i swapped to storing them because discord would get mad at fetching 20+ users, let alone 100

quartz kindle
#

sure you wont update it every time, you will keep a cache for like 24 hours

solemn latch
#

even at relatively small scale

earnest phoenix
#

you can cache them from GUILD_CREATE and GUILD_MEMBER_CHUNK and you'll receive according gw events for it

#

however

#

these bots work at a HUGE scale

#

and they probably have specific protocols they use with discord

quartz kindle
#

if they are present in all the guilds they provide top 100 lists for, then they most likely keep their database updated with usernames included

#

and keeps updating them from member_update events

#

then they probably have a short term cache layer for displaying them through the website

sudden geyser
#

and time is defined as my arguments
@misty sigil can you log time

misty sigil
#

so 1s (bare args) undefined (ms(time)) 60000 (ms("1m")) 1s (time args)

#

yes i logged that

placid iron
#

at mee6's scale it would cost more resources to store the user avatar and other relevant data in the database and keep up with the changes
@earnest phoenix yeah why would they do this when they can just link the image in the website XD using member.avatar_url

solemn latch
#

mee6 does just send the discord avatar link

placid iron
#

they do have a username cache tho

earnest phoenix
#

are you using mongodb ?

placid iron
#

i know that

#

because if you delete your account they will still display the username as what it was

#

not deleted account

earnest phoenix
#

mee6 does just send the discord avatar link
@solemn latch you need the avatar hash for that, which is the point of the message, the avatar isn't just the user id

#

i need to found best database for discord bots

misty sigil
#

so 1s (bare args) undefined (ms(time)) 60000 (ms("1m")) 1s (time args)
@sudden geyser

#

there is no best

solemn latch
#

🤔

#

so?

knotty steeple
#

@earnest phoenix mongo or sql dbs

placid iron
earnest phoenix
#

ok ok thanks

knotty steeple
#

whichever u want

earnest phoenix
#

i don't know, how do you fix that when you press invite it sends you to a browser and sends you back?

quartz kindle
#

discord protocol when

earnest phoenix
#

it exists!

#

apps use it internally

quartz kindle
#

why dont they use it tho

earnest phoenix
#

at least they used to, back when the game store was a thing

quartz kindle
#

telegram/whatsapp/viber/skype/etc all use their own protocols

earnest phoenix
#

i'm pretty sure that the discord in-app protocol is experimental for android right now

#

they're experimenting with oauth

quartz kindle
#

well, opening discord urls with the discord app is long overdue

knotty steeple
#

discord:// yeet yeet

earnest phoenix
#

yeah

knotty steeple
#

its how invites are "beamed" too

quartz kindle
#

i dont even use the app so i cant test lmao

earnest phoenix
#

it doesn't even render properly for me on android :omegalul:

#

works on desktop though

quartz kindle
#

cool

#

they need to do it for bot invites

#

and oauth2 in general

#

the app should open discord oauth2 inside the app

earnest phoenix
#

i remember there were plans to allow executing RPC commands with the protocol but that's dead news i assume

#

nothing has been mentioned for over a year

placid iron
#

oauth2 opens in discord for android at least

quartz kindle
#

even when inviting a bot?

placid iron
#

uhhh, i dont know

knotty steeple
#

isn't fully working yet

placid iron
#

at least it partly works then

quartz kindle
#

xD

earnest phoenix
#

just like everything else on discord mmLol

queen hearth
#

my bot won't change his profile picture

quartz kindle
#

its getting there™️

placid iron
#

tbh tho discord has its stuff together better than me

quartz kindle
#

better than all of us

placid iron
#

and i have what. 6 scripts to deal with and a website XD

queen hearth
#

A

quartz kindle
#

what

queen hearth
#

am I the only mobile bot creator

#

I don't have a computer

placid iron
#

i dont think so

quartz kindle
#

depends

#

define "bot creator"

queen hearth
#

Someone who made a bot what else would it mean

earnest phoenix
#

it's not an elite title

#

chile damn

quartz kindle
#

because some people dont consider apps like botghost or bot designer as being a "bot creator"

opal plank
#

Never again

knotty steeple
#

i don't

placid iron
#

assembly bot creator anyone?

quartz kindle
#

haha good joke

opal plank
#

lmao

placid iron
#

thank you

#

i put 2 braincells into it

solemn latch
#

performing get requests with assembly

quartz kindle
#

before you're even able to start coding a discord interface, you'll need to code your own network drivers and shit

earnest phoenix
knotty steeple
#

c bot when

opal plank
#

the moment i see these words i give up:
glitch, heroku, ghostbot

knotty steeple
#

😳

placid iron
#

ive never coded anything below c++ and people who made the first computers scare me

#

their brains must be like skyscrapers

earnest phoenix
#

cpp sockets are already a disaster

#

imagine c

quartz kindle
#

i've never coded anything below js :^)

opal plank
#

Wait a second

#

nono

#

hold up

#

WHAT

solemn latch
#

yes

earnest phoenix
#

yes

solemn latch
#

its a steam game

placid iron
#

add to your wishlist now

opal plank
#

on STEAM?

quartz kindle
#

you didnt know?

solemn latch
#

app

earnest phoenix
#

there's tons of those

opal plank
#

wtf

#

i never searched for it

earnest phoenix
#

tons of bots here are made with "makers" like that

quartz kindle
#

lmao

knotty steeple
#

heroku is good for its actual purpose

opal plank
#

and its PAID?

earnest phoenix
#

granted all of the bots made with those makers are shit but it's the effort that counts ⭐

knotty steeple
#

so is glitch

solemn latch
#

whats the mobile app that you have to watch ads to keep your bot up

knotty steeple
#

bot designer?

opal plank
#

TIL that shit is a steam game

solemn latch
#

thats the one that really gets me

quartz kindle
#

discord on steam when

#

buy discord nitro on steam

opal plank
#

Doing it rn, no balls

earnest phoenix
#

steam tried doing their own discord

#

it's pathethic

quartz kindle
#

lmao

earnest phoenix
#

the ui is so clunky and bad

opal plank
#

who uses steam for talking anyways

quartz kindle
#

what lang/stack?

earnest phoenix
#

no idea

solemn latch
#

someone steam called me once, was so confused

earnest phoenix
#

i'd assume also electron

solemn latch
#

forgot it was a feature

opal plank
#

only good electron app is VSC

#

press ctrl + shift + i and watch the errors on discord bombard

quartz kindle
#

i press f12 :^)

earnest phoenix
#

it's even prettier when you enable gateway logging

opal plank
#

i press alt f4

quartz kindle
#

how do you enable that?

placid iron
#

i press ctrl+shift+w

earnest phoenix
#

~~if i say it i'll get beaned mmLol ~~

solemn latch
#

nice discord

placid iron
#

only works on chrome version tho

quartz kindle
#

lmao

opal plank
#

client muds

earnest phoenix
#

it's totally not client mods wink

#

it's totally not experiments

opal plank
#

he said its not, that makes it safe

#

its like saying no homo

earnest phoenix
#

i didn't reverse engineer half of the user gateway workflow with just gateway logging

opal plank
#

so, who wants to finish my project? cuz my motivation already way too low for today lmao

misty sigil
#

why does ms(time) return undefined?

#

time was logged as 3s

opal plank
#

im about to pull the bingo again with the my code errors and doesnt show error/code

solemn latch
#

does ms() return undefined if it cant figure out what (time) is?

misty sigil
#

why wouldn't it figure out what time is tho?

#

its 3s

#

and it works other times

solemn latch
#

like 3s sometimes works?

misty sigil
#

no its just that it works if i manually input it

solemn latch
#

try checking your actually getting 3s then

misty sigil
#

im getting 3s

solemn latch
#

it does clearly have a case for s

misty sigil
#

on my arg and my time declaration

#

1s is the arg

#

undefined is ms(${arg})

#

60000 is ms("1m")

#

1s and 1s are other ways im trying to make it work

solemn latch
#

just to make sure, this log is
arg ms(arg) ms("1m")

misty sigil
#

yes

#

that is the log

solemn latch
#

i have zero idea then 🤔

#

ill look over the github a touch more, but im not sure

misty sigil
#

it literally should work

#

i've had others use ms in that way

solemn latch
#

this may seem like a dumb question
but if i return nothing

  if (!match) {
    return;
  }

the returned thing would be undefined yeah?

misty sigil
#

yea

#

it would be

solemn latch
#

it could not be matching the regex, or not matching the switch cases, its not really clear

misty sigil
#

but if i were to put in ms("1s") it works

solemn latch
misty sigil
#

console.log(args[2], ms(${time}), ms("1m"), time, time.toString())

solemn latch
#

why are you not using args[2] inside ms?
is time just = args[2]?

misty sigil
#

yea

#

but args[2] returns the same thing lol

solemn latch
#

man, i have no idea. it seems silly

#

looking at the code for the lib, i just dont see how that returns undefined

halcyon ember
#

how do you get the image url of the guild picture

solemn latch
#

<guild>.icon iirc

halcyon ember
#

oh

faint prism
#

this may seem like a dumb question
but if i return nothing

  if (!match) {
    return;
  }

the returned thing would be undefined yeah?
@solemn latch it'd imagine it'd return null

solemn latch
#

your right

#

i think

#

🤷‍♂️

misty sigil
#

OH FFS

#

I FORGOT ABOUT THE SPACE

faint prism
#

That's the issue with js not specifying function signatures

misty sigil
#

i am stupid 10000000000%

#

@solemn latch i fixed it

solemn latch
#

🤔

misty sigil
#

was just me being fucking dummy

solemn latch
#

o left a space?

misty sigil
#

yes

solemn latch
#

youd think the lib would be able to handle a whitespace

misty sigil
#

yea lol

solemn latch
#

🤔 such a tiny fix

halcyon ember
#

@solemn latch i do message.guild.icon onto an embed and it says invalid or malformed url

solemn latch
#

djs right?

halcyon ember
#

oh

surreal notch
#

Can we increase quality of Avatar cmd?

misty sigil
#

yes

sudden geyser
#

You can increase the size of the image.

misty sigil
#

this does the trick (enlarges the image) .displayAvatarURL({size:4096, dynamic:true})

earnest phoenix
#

Yo

sudden geyser
#

hi

misty sigil
#

hello

earnest phoenix
#

Comment allez vous ?

knotty steeple
#

@earnest phoenix

#

merci 🙏

long hare
knotty steeple
#

what

#

do u want a server info command?

#

and u want to get the guild?

#

<Message>.guild should work

#

also read the d.js docs not discord docs

frank wyvern
#

Hey Guys, Discord has disabled my bot and asked me to contact them for more information. I have but obviously they'll take a while to respond. I was wondering if anyone has had a similar experience and could shed some light on the issue?

faint prism
#

Possibly breach of TOS, API abuse, over 100 servers w/o sharding, etc

knotty steeple
#

over 100 servers w/o sharding

#

what

faint prism
#

That's in Discord docs for large bots

#

oh I was way off

100 servers

#

Let me get my facts straight hol up

knotty steeple
#

yes that is why i asked

#

the limit is 2.5k

tepid gate
#

You need to be verified to be over 100 servers*

faint prism
#

That's probably what I was thinking of..

void vale
#

Who needs a free translator api?

solemn latch
#

Someone was looking for one the other day

slow fable
#

hey guys

#

theres some guy named keeperupper

#

he keeps joining my repl

paper cliff
#

wdym

slow fable
#

like

#

whenever i leave it running 24/7

#

he just joins

#

i don't know what his purpose is

#

but i want to get him out of my repl

paper cliff
#

sorry for asking but what is "repl"?

void vale
strange trout
#

A service that you shouldn't use to host bots

void vale
slow fable
#

A service that you shouldn't use to host bots
@strange trout why?

paper cliff
#

oooh I see, that's interesting

void vale
slow fable
#

o lol

paper cliff
#

@slow fable Are you logged in on repl.it? Can't you create a private repl?

slow fable
#

nah

#

i need to pay money for private

#

and no i don't have a paypal or a credit card

solemn latch
#

If its not private, then he is allowed to be there right?

slow fable
#

yeah

#

but atleast he doesn't see my token

paper cliff
#

@slow fable How did you hide it?

slow fable
#

.env

paper cliff
#

Oh

paper cliff
#

@slow fable Btw, you have to stay on the page for the hosting to continue, right?

earnest phoenix
#

You can use a pinger to keep it up 24/7

slow fable
#

yes

#

uptimerobot i use

paper cliff
#

It's fine I don't need it, I was just wondering

#

I didn't know this website existed

#

is it new?

slow fable
#

no

earnest phoenix
#

h

rare moss
#

How long does it take for your bot to be approved?

sonic lodge
errant perch
#
const Discord = require("discord.js");
const bot = new Discord.Client();

const token = "token";

const PREFIX = "-";

const color = "#434072";

bot.on("message", message => {
  if (message.channel instanceof Discord.DMChannel) return;
  let args = message.content.substring(PREFIX.length).split(" ");

  switch (args[0].toLowerCase()) {
   case "test test":
      message.channel.send("test")
   break;
  }
});

bot.login(token);```
How do I make the command to have multiple words? I tried to do it as shown but it doesn't respond.
surreal arch
#

Hi

delicate shore
#

hey

#
const Discord = require("discord.js");
const bot = new Discord.Client();

const token = "token";

const PREFIX = "-";

const color = "#434072";

bot.on("message", message => {
  if (message.channel instanceof Discord.DMChannel) return;
  let args = message.content.substring(PREFIX.length).split(" ");

  switch (args[0].toLowerCase()) {
   case "test test":
      message.channel.send("test")
   break;
  }
});

bot.login(token);```
How do I make the command to have multiple words? I tried to do it as shown but it doesn't respond.

@errant perch no

errant perch
#

ok

delicate shore
#

just create one single case

#

then check for arg

rare moss
#

Yo I was looking in FAQ and rules and I don’t see any reasons why they would decline your bot?

errant perch
#

offline

#

or no help command

delicate shore
#

like if(args[1] === "test"){
msg.channel.send("test")
}

errant perch
#

or just violation of tos

delicate shore
#

so it wll be

#

[prefix]test test

dire obsidian
#

im using a command handler but how i can make to make commands in separated folders

errant perch
#

yes

delicate shore
#

and it will respond

#

try it

errant perch
#

ok

dire obsidian
#

everything is on there, and i want some folder but id to use properly use fs

delicate shore
#
const Discord = require("discord.js");
const bot = new Discord.Client();

const token = "token";

const PREFIX = "-";

const color = "#434072";

bot.on("message", message => {
  if (message.channel instanceof Discord.DMChannel) return;
  let args = message.content.substring(PREFIX.length).split(" ");

  switch (args[0].toLowerCase()) {
   case "test":
if(args[1] === "test"){
message.channel.send("test")
}else{
message.channel.send("Kindly provide Second args")
}   break;
  }
});

bot.login(token);
#

@errant perch ^

errant perch
#

i got it working

delicate shore
#

or to be more fancy

#

ok

#

nice

errant perch
#

wait

#

whats the more fancy way

#

because

#

yea

delicate shore
#

yeh

#

instead of else

errant perch
#

elseif

delicate shore
#

just see if args 1 is present

sudden geyser
#

@dire obsidian you'd need to read the ./commands/ directory with the fs module (readdir)

delicate shore
#

by

sudden geyser
#

you said you were using a command handler, correct

delicate shore
#

if(!args[1]) return msg.channel.send("AH e ")

dire obsidian
#

yes

errant perch
#

ah yes

delicate shore
#

kk

dire obsidian
delicate shore
#

;-;

sudden geyser
#

where are you using Categories though

delicate shore
#

^

dire obsidian
#

nowhere

sudden geyser
#

I assume you're following Discord.js' official guide already

dire obsidian
#

im addin it cuz i think ill need it

sudden geyser
#

but then what do you mean by you have to identify them

delicate shore
#

i can tell u another way

#

it is bit tough

#

but

dire obsidian
delicate shore
#

then it will be what u want

dire obsidian
#

yes i do

#

but then what do you mean by you have to identify them
@sudden geyser to search the commands

delicate shore
#

:pepehmm:

faint prism
#

@errant perch args[index]

delicate shore
#
bot.memes = new Discord.Collection();
bot.fun = new Discord.Collection();

const commandFiles = fs
  .readdirSync("./memes/")
  .filter(file => file.endsWith(".js"));
for (const file of commandFiles) {
  const memes = require(`./memes/${file}`);

  bot.memes.set(memes.name, memes);
}

const commandFiles2 = fs
  .readdirSync("./fun/")
  .filter(file => file.endsWith(".js"));
for (const file of commandFiles2) {
  const fun = require(`./fun/${file}`);

  bot.fun.set(fun.name, fun);
}```
#

this is tough way

#

but i use this from starting

sudden geyser
#

why though

faint prism
#

-command arg1 arg2 arg3 ...
args[0], args[1], args[2], args[4]
@woogie

delicate shore
#

because at that time i was big of a noob

sudden geyser
#

ah

errant perch
#

@faint prism ok i'll check that out

delicate shore
#

-command arg1 arg2 arg3 ...
args[0], args[1], args[2], args[4]
@faint prism
Was i right ? since in his case case is the cmd

faint prism
#

Make sure you understand how arrays work

errant perch
#

you were right but i didnt prefer that way

delicate shore
#

ok

errant perch
#

both work though

delicate shore
#

;-;

#

ok

#

nic

faint prism
#

You weren't wrong using args with the index of one. However, I recommend looping through all available args based on the count in the array

delicate shore
#

ok

rare moss
#

Just curious, what’s more common, discord.py or the js api?

upbeat sedge
#

js

#

probably

errant perch
#

i think js is because its easier and there are more tutorials on it lol

rare moss
#

Really?

upbeat sedge
#

if you judge things off tutorials you won’t get far

rare moss
#

I’ll take a look at js

upbeat sedge
#

docs are the thing you need

errant perch
#

it just depends what your background with coding

#

stack overflow is a life saver

rare moss
#

O:

#

Ok, as a discord.py user, what benefits does js api have over python?

upbeat sedge
#

it may be easier for starters

rare moss
#

Which one is better for starters?

upbeat sedge
#

plus js is similar to c# so if you want to learn other languages that’s cool

rare moss
#

Kewl

faint prism
#

plus js is similar to c# so if you want to learn other languages that’s cool
@upbeat sedge no way. C# and JS are very different

upbeat sedge
#

they’re not really that different

#

At least in my experience

#

I code games n bots

faint prism
#

Do you use abstractions or interfaces at all?

#

Or delegates and event handlers

upbeat sedge
#

yeah

faint prism
#

And you can implement those in js?

upbeat sedge
#

I said similiar

faint prism
#

I'm not too familiar with JS, but from the samples I've seen they seem worlds different

upbeat sedge
#

not the exact same

faint prism
#

Where C# is explicit, strongly typed, and unforgiving.
Js is more relaxed about data types, function signatures, etc

#

Which one is better for starters?
@rare moss Python or JavaScript. But I would lean towards Python imo

dire obsidian
#

somebody know how to make a events handler?

#

i allready have a command one but idk how configure it, the discord.js dont shows anything and i search but nothing works

sudden geyser
#

You do it similarly to the command handler one you do: read a directory and require the file

#

However, since it's going to be events, you'd do <EventEmitter>.<on or once>(eventName, ...args)

#

like client.on(event.name, (...args) => events.run(...args))

dire obsidian
#

oh

#

so thats it?

#

ez

sudden geyser
#

Yeah it's simple

dire obsidian
#

thanks bro

#

ill say the truth, all my time i using programs to make bots, but look coding is more funny

errant perch
#

I use switch () for my commands but if i used if message.content == "egg" would i notice any performance issues?

stoic ermine
#

what is a redirect URI (posted in #support originally, just moved channels)
@earnest phoenix "but the redirect URI is used mainly on sites that use the discord OAuth2 to add/use discord user info on their websites"

if you're adding a bot to a server, you don't need the code grant nor the redirect URI

rare moss
#

Bruh no one uses python here 😦

hallow frigate
dire obsidian
#

maybe because js is more "flexible"?

#

idk i need sleep

stoic ermine
#

don't we all

faint prism
#

I use switch () for my commands but if i used if message.content == "egg" would i notice any performance issues?
@errant perch no

errant perch
#

ok

sinful lotus
#

just use switch if you have like tons of if else

lusty quest
#

for simple bots if / else stuff is fine. but if you get more commands its probably smarter to use a switch case

sinful lotus
#

if else is slower, an example of it is yandere simulator, if you know how bad the fps specially when there is a lot of student, then thats the answer

crystal socket
#

^ thats not the reason its slow lol

lusty quest
#

the issue there is that the checks time variables every frame with a if statement as example

crystal socket
#

the reason its slow is cause the entire game redoes all the scripts every frame

#

instead of doing it, yknow, once ever 30 frames

sinful lotus
#

its because its checking every block one by one, and its doing it every frame

crystal socket
#

thing is when unity compiles it it becomes switch cases so that doesn't matter

sinful lotus
#

if else is already slower, make it per frame thats why, it could be a bit faster if coded with switch but the point is if else is slower

crystal socket
#

^

#

and more ugly

#

btw wanna play @sinful lotus

sinful lotus
#

i didnt buy the game GWahreeVampySmug

lusty quest
#

interestening the url is invalid

crystal socket
#

i didnt buy the game :GWahreeVampySmug:
@sinful lotus its free hahaha

sinful lotus
#

pogey yikes thought it was paid

crystal socket
#

i mean he gets like 300k a year from patreon. but the game is free

lusty quest
#

lol if he would take money for it. Would be funny AF to pay for a game so badly optimized that i would rather play Gmod with 2 Million Addons installed (yes i did it and it was horrible)

crystal socket
#

he's made 4million dollars to this day

#

i mean, the guys not the best at coding, but he's great at getting money

lusty quest
#

lol you can make money if you just make a half decent Weeb / NSFW game

#

there is a guy who makes 50k/Month bcs of a NSFW Sims 4 Mod

delicate shore
#

what

#

how did

charred flame
#

hey guys 🙂

delicate shore
#

i pinged

#

hi

charred flame
#

iam new here i just wanted to ask briefly

delicate shore
#

yes?

charred flame
#

iam making a discord server on my own and i wanted to make a Verification channel
i successfully made a bot where it checks you using Captia (bot checking bots...ironic)
i just wanted to know how can i force send players from one channel to the other

lusty quest
#

maybe with roles

charred flame
#

@lusty quest bother join in and try helping?

lusty quest
#

nope

charred flame
#

sure

#

do you know any way/bot i can force to make the player switch from a channel to another?

twilit rapids
charred flame
#

almost XD

earnest phoenix
#

okay

charred flame
#

i used the carl bot to make the verification poll

#

here

#

to be exact

earnest phoenix
#

use mee6

charred flame
#

i want the player to force switched to the #welcome channel of my server after they hit the check mark

earnest phoenix
#

oh

charred flame
#

the verification is active

#

its working

earnest phoenix
#

that's easy

charred flame
#

if you hit X it bans you

#

well technically it kicks you

earnest phoenix
#

yes

charred flame
#

and gives u a role that mutes you (i know iam smort XD)

#

so how can i do that

#

that's easy
@earnest phoenix

earnest phoenix
#

I made that with mee6

charred flame
#

Note: i have mee6,dyno,carl

#

installed

earnest phoenix
#

you say a command and it verifys you

charred flame
#

say?

#

nononono

#

iam sorry but thats not what i want

earnest phoenix
#

so you want me to help?

winged mulch
#

He means react to a reaction and you get a role.

charred flame
#

nooo

#

ugh okay lemme explain

earnest phoenix
#

no I made it so you say !verify and it verifys you

charred flame
#

i joined a server before for gamers

#

i had to verify my self

earnest phoenix
#

ok

charred flame
#

using the same carl bot thing

#

but after i did that

#

i instantly got switched to #welcome

#

instead of me having to go there manually

winged mulch
#

My bot does that

charred flame
#

who?

winged mulch
#

i know what you mean

charred flame
#

thanks

winged mulch
#

Can I please DM you my bot's link?

charred flame
#

sure

winged mulch
#

Thank you

charred flame
#

no problem

earnest phoenix
#

I'ma go now

charred flame
#

wait one last thing

winged mulch
#

Ok

earnest phoenix
#

pineapple

charred flame
#

is there a bot that can reward players (with XP or anything) for inviting other players?

#

i saw that before

earnest phoenix
#

I'm pretty sure

#

lemme check

#

the bot I always use is mee6

delicate shore
#

;-;

#

Imagine using Discord

earnest phoenix
#

woah

blazing ravine
#

its possible in embed to setimage more than 1 ?

delicate shore
#

Imagine

lusty quest
#

only 1 Image per embed

#

(you could add more as preview image

still lily
#

is it possible to only let a bot speak in one channel but it finds the channel from the name of it

delicate shore
#

How can

#

I make my bot leave VC when queue is over

#

is it

pure lion
#

@still lily it's better to do it by ID

delicate shore
#

Voice channel.leave()?

pure lion
#

Yes

delicate shore
#

Ok

#

Thanks

pure lion
#

Np

delicate shore
pure lion
#

Helo

#

How to nginx + peerjs

#

Please ffs

#

I've googled

#

There's nothing

pale vessel
#

wdym by nginx + peerjs

pure lion
#

Nope it's not

#

I start a peer server and it doesn't work :d

#

On the port my peer connection looks for

raven axle
#

Any reason why the following code is not working? I'm checking if the user has admin permission, or if it's the botowner, but It seems to break the if statement when checking the permissions, my code:

PS: If I log the message.author.id it's the same that I have for ownerId and if I remove the check permission it works.

    if (!message.member.hasPermission("ADMINISTRATOR") || message.author.id !== ownerId)
      return message.reply(
        "Sorry, You don't have the correct permissions for this command."
      );

Thanks

delicate shore
#

why

golden condor
#

If the owner doesn't have admin, it won't activate

delicate shore
#

^^

#

replace

#

the ||

#

with &&

golden condor
#

You need to check if they don't have admin and they are the owner

#

So you should check both

delicate shore
#

@raven axle try this

if (!message.member.hasPermission("ADMINISTRATOR") && message.author.id !== ownerId)```
slender thistle
#

I'm checking if the user has admin permission, or if it's the botowner

delicate shore
#

yeh

#

that's what i am saying

raven axle
#

Isn't && "and"?

slender thistle
#

How does && apply here

delicate shore
#

lemme show u an eg

#

oh

#

ok nvm

#

i thought u meant

#

nothing

#

leave it

#

|| should work

raven axle
#

I'm so confused bout it lol, it doesn't seem to work

still lily
pale vessel
#

it returns, shiv

still lily
#

can i upload more then one bot

pale vessel
#

ya

still lily
#

nice

#

time to add my ai

#

anyone know the webpage / channel that i can find info on bot upvoting checking for discord.js

earnest phoenix
still lily
#

wow these docs are great

#

they have full code exsamples

feral aspen
#

Hello Guys, so I have a premium system where the bot checks in the specific server of having the specific premium role where if they have it, it will run the premium command or else it will state telling that he doesn't have premium and he will need to purchase it. This my current code:

const botconfig = require("../botconfig.json")
const colors = require("../colors.json");

module.exports.run = async (bot, message, args) => {
  if(bot.guilds.cache.get('721372685275234436').members.cache.get(message.author.id)){
    if(bot.guilds.cache.get('721372685275234436').members.cache.get(message.author.id).roles.cache.some(r=>r.id==="736643325863395331")){
      //Commands run of him having premium
    }else{
      // Stating you don't have premium
    }
  }else{
    // Stating you don't have premium
  }
}


module.exports.config = {
    name: "premium",
    aliases: [],
    usage: "a!premium",
    description: "Premium Test!",
    noalias: "No Aliases",
    accessableby: "Members"
}``` As you can see, there are two elses, the first else stating for not having the role, and the second else stating that he is not in the server, but I usually put in the two elses telling he doesnt have the role and finish.

The question is that some commands, for example: I have an economy system, and for normal users, it will give (for example) $150, and for premium users, $250. I put the premium script in the `//Commands run of him having premium`, but for the normal users, should I repeat it twice in the two elses? or what should I do?
still lily
#

jesus thats alot of text

feral aspen
#

Please read and give me help, if so! 😦

restive furnace
#

you just could make a object with premium users and do if (premiumUsers.includes(msg.author.id) { //premium code
} else
{ //normal code }

lusty quest
#

why 2 checks?

restive furnace
#

or something like that

feral aspen
#

you just could make a object with premium users and do if (premiumUsers.includes(msg.author.id) { //premium code
} else
{ //normal code }
@restive furnace no, it will error.

restive furnace
#

and u meant array

#

i*

feral aspen
#

that wont work like that.

restive furnace
#

it does

feral aspen
#

I dont think it does.

restive furnace
#

lemme pull you example

arctic cape
#

how to fix this error? (node:4320) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body embed.image.url: Not a well formed URL. at RequestHandler.execute (F:\BOTS\JSBOT\node_modules\discord.js\src\rest\RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:4320) 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:4320) [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

delicate shore
#

@outer marsh

lusty quest
#

your embed image is a bad url

delicate shore
#

how can my bot see this channel

arctic cape
#

i get it

#

but how do i fix that ? 🤔

lusty quest
#

what is your url?

arctic cape
#

it is an input from user

#

wait let me give

restive furnace
#
let premiums = ["528256079101034506", "another premium user"];

if (premiums.includes(messageAuthor#id)
{
// you premium code
}
else 
{
// normal code
}```
earnest phoenix
#

Hey, I have searched through my code multiple times for an error and haven't found one. This code is supposed to create a captcha and if the user completes it correctly it will give them a role, which it does, and if they don't get it right it would kick them. It correctly does the part for getting it right but it doesn't do anything for getting it wrong 🙁

    let captcha = new Captcha()
    
    const krole = member.guild.roles.cache.find((x) => x.name === "Kick")

    const channel = member.guild.channels.cache.find((x) => x.name === "verify")
    
    if(!channel) {
     return console.log(member.guild.name + " Please Create channel with name verify")
    };
    
    const vrole = member.guild.roles.cache.find((x) => x.name === "non-verified")
    
    if(!vrole) {
     return console.log(member.guild.name + " Please Create role with name 'non-verified'")
    }
    
    member.roles.add(vrole)
    
    const verifycode = await channel.send("Please type the given code to be verified",
                 new Discord.MessageAttachment(captcha.PNGStream, "captcha.png"));
                                          
    let collector = channel.createMessageCollector(m => m.author.id === member.id);
    
    collector.on("collect", m => {
      if(m.content.toUpperCase() === captcha.value) {
        m.delete()
        verifycode.delete()
        member.roles.remove(vrole)
        return member.send("Thank you for verifying! You now have access to the rest of the server!")
        member.guild.roles.add("")
      }else if(m.content.toUpperCase() === captcha.value) {
        member.send("You gave wrong code, so you have been kicked.")
        member.roles.add(krole)
        m.delete()
        verifycode.delete()
        if(member.guild.roles === krole); 
        then (member.kick)
        
      } else{
        verifycode.delete();
      }
      
    })
    
    })
arctic cape
#

oh it becam image

restive furnace
#

or then just do to prevent repeating like if (premiuns.includes(messageAuthor#id) // give 2x coins else // give 1x coins

#

inside one code blcok

delicate shore
#

how can i make my bot purge his own msg

#

it's*

arctic cape
#

LINK https://media.discordapp.net/attachments/677543640456888354/740437339431501903/PMUL_SEMIS_GROUP_2.jpg?width=789&height=444

restive furnace
#

@feral aspen check my messages

delicate shore
#

msg.channel.bulkDelete(100)

#

this is for bulk delete

arctic cape
#

how is this this deformed?

feral aspen
#

@feral aspen check my messages
@restive furnace oh, when someone buys, premium. I should keep adding to my premium listt??????????

#

premium array?

delicate shore
#

yeh

#

u can code it in such a way

restive furnace
#

yes, or then get a proper database, but i just showed how you would do it. it isnt automatic on any bots, atleast i mean, they have to do the keys theirselves

feral aspen
#

No.. that ownt happen

delicate shore
#

using api as well

restive furnace
#

i just showed how you could do it

#

im not going to give you best possible

arctic cape
#

if anybody solves my query just tag me thnks

feral aspen
#

im not going to give you best possible
@restive furnace well my code was better, I believe.

#

Its just that I should repeat two times for normal users?

#

or what.

wild adder
#

Hey can someone help me with making a welcome screen? For node js

crystal socket
#

wdym

#

like a gui?

#

or something like that

wild adder
#

So when someone joins the server

#

It sends a message

arctic cape
#

the way mee6 does it like that ?

wild adder
#

Yeah

crystal socket
#

like with a image?

wild adder
#

Nah

#

Just the username

crystal socket
#

no i mean

#

does it send it as a image, or just a embed

wild adder
#

And saying welcome to ..... @user

crystal socket
#

oh well thats easy

restive furnace
#

@restive furnace well my code was better, I believe.
nope, too many if/elseif/else's

crystal socket
#

one second

wild adder
#

I'll dm u as I need help lol

crystal socket
restive furnace
#

^

earnest phoenix
#

How can you get the right array?
I mean that you can get the one that is the newest.

crystal socket
#

python?

#

array[-1]

earnest phoenix
#

No.

#

discord.js

crystal socket
#

js?

earnest phoenix
#

Yes.

crystal socket
#

my_array[my_array.length - 1]

earnest phoenix
#

I found that but I need help with it.

crystal socket
#

mmLol explain

earnest phoenix
#

Um.

#

I am basically popping a random auditlog.

#

RIght now how do I make it so it picks one.

#

let data = auditlogs.data.pop()

#

@crystal socket

grand dagger
#

What is that spacing

earnest phoenix
#

?!?

delicate shore
#

ok nvm

#

:mmLol:

#

:mmLol:

still lily
#

i need 100 more charters to finish my discord bot page

#

oof

delicate shore
#

oof

earnest phoenix
#

I tried @crystal socket
let datatrue = auditlogs[auditlogs.data.length - 1]
But I know I did it wrong cause I was confused.

#

Can anyone else help me.

crystal socket
#

have you tried putting a ; at the end mmLol

earnest phoenix
#

I actually did.

#

It still says.

#

undefined

#

When I do.
var my_array = auditlogs.data;
var last_element = my_array[my_array.length - 1];
console.log(last_element)

#

It shows one.

#

Just not the right one.

blazing ravine
#

why cache.filter

#

is undefined

#

in discord.js 11.6.2

earnest phoenix
#

I'm using 12.

#

I got it.

#

I had to put like -99

#

Lol.

restive furnace
#

why cache.filter
@blazing ravine because it is 11.6.2...

blazing ravine
#

okay

silver dust
#

UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setColor(...).addRect is not a function

delicate zephyr
#

@silver dust addRect isnt a function meaning you probably havent created your canvas properly

silver dust
#

oh

cerulean venture
#

So uhm how would I go about making a birthday command? Since I'm rather new to js and json as well I'm kinda lost.
I wanted to do something like: "PREFIXbday 01/01/2000" and write that + author into a json file and check every day if it's someones birthday

#

I feel like it shouldn't be hard but somehow my brain is failing lol

restive furnace
#

split the arguments by / or ., then check if the mm/dd/yy(yy) is valid, then store to database, and finally, make an interval where it checks if the day & month matches what it is in the database.

cerulean venture
#

so I should rather use a db for that?

#

I mean json should work fine as well since your birthday really doesn't change

#

right?

restive furnace
#

database = what ever you use as the database.

cerulean venture
#

ahh

restive furnace
#

json is kinda database, so yeah, atleast I do count it

cerulean venture
#

yeah I was thinking about changing my other json stuff to mongo or so

slender thistle
#

well it's a file in the end

cerulean venture
#

yeah

slender thistle
#

and files are persistent storage

#

it's just that it's not as good compared to other databases

cerulean venture
#

yeah I get that so I probably really should switch to mongo or so

slender thistle
#

mongo is nice mmulu

lusty quest
#

yea mongo is nice. there are a few people here wo say its trash but i dont get the reason

rain cradle
#
Task exception was never retrieved
future: <Task finished name='Task-169' coro=<VoiceClient._create_socket() done, defined at C:\develop\python\lib\site-packages\discord\voice_client.py:172> exception=gaierror(11001, 'getaddrinfo failed')>
Traceback (most recent call last):
  File "C:\develop\python\lib\site-packages\discord\voice_client.py", line 191, in _create_socket
    self.endpoint_ip = socket.gethostbyname(self.endpoint)
socket.gaierror: [Errno 11001] getaddrinfo failed

Help

cerulean venture
#

so how hard is it to change from json to mongo in general?

lusty quest
#

you probably have to write everything into the mongdb again

#

either by hand or write a migration script

slender thistle
#

not exactly hard apart from rewriting your write-file stuff to insertOne/updateOne

#

just a bit time consuming

cerulean venture
#

well it aint much rn anyways, just some channel names & id's

#

so might as well do it now instead of waiting even longer

lusty quest
#

yea the earlyer you start the better. i guess it can be annoying if you are already at 100+ guilds and the performance of your json db starts to degenerate

cerulean venture
#

okay 🙂 thanks for the help

silver dust
#

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'utils' of undefined

lusty quest
#

code?

hybrid roost
#

my discord.js bot stops playing a track three seconds before the end. The most interesting thing is that it works on my windows10 computer, and such a bug occurs on the Linux Ubuntu server.

There are no logs, or events..
@hybrid roost well, i did try YTDL-CORE-DISCORD and play(ytdl(url), {type:'opus'});, track still terminating.

silver dust
#

the error comes from this line:

#

.addField(`Roles [${roles.length - 1}]`, roles.length < 10 ? roles.join(', ') : roles.length > 10 ? this.client.utils.trimArray(roles) : 'None')

lusty quest
#

what is utils?

#

the discord client has no utils property iirc

restive pebble
#

lul

#

timeout probably

silver dust
#

the discord client has no utils property iirc
@lusty quest wdym?

lusty quest
#

ts or js?

silver dust
#

js

hybrid roost
#

@earnest phoenix, the simplest solution you can make bool variable and work when it equal true. When command used, make bool false and use Timeout (setTimeout(void, time) in JavaScript)

lusty quest
#

there is no property

#

for utils

silver dust
#

for utils
@lusty quest hm

cerulean venture
#

I actually have never had this issue 🤔 sounds weird, neither on ubuntu nor linux

wanton anvil
#

can somebody say me how can I send webhooks with custom authorname and avatar

#

In a text channel

warm marsh
#

language?

wanton anvil
#

python

robust arrow
#

is that even possible?

wanton anvil
#

yeah

warm marsh
#

It's a kwarg

wanton anvil
#

my friend had done it in .js

elder loom
#

mh?

charred flame
#

hey guys i need assistance

#

brb

misty sigil
plucky harness
#

@lusty quest how to run my bot script on docker container

#

I kinda don't know what docker file would be like

lusty quest
#

node or py?

celest junco
#

How can I see I how much servers is my bot?

misty sigil
#

lib?

wanton anvil
#

how to overwrite permissions for a channel using python

misty sigil
#

How can I see I how much servers is my bot?
@celest junco lib?

neat gazelle
#

so i have this commands that loops through all the guilds and grabs the owner of each one. but i run into this problem where i get a error when it hits this discord which appearantly had no owner or something and idk how to get around this. how do i handle discord with no owners?

wanton anvil
#

how to overwrite permissions for a channel using python @everyone