#development

1 messages · Page 755 of 1

loud salmon
#

if I have to tell you both to quit arguing one more time yall are gonna be muted for a while

ripe tulip
#

Me?

loud salmon
#

pls direct all complaints about this ruling to my dms

lusty dew
#

:shrug:

ripe tulip
#

ME????

modest maple
#

I'm not arguing it

lusty dew
#

Yes sir

modest maple
#

Moving on

loud salmon
#

@ripe tulip no

ripe tulip
#

But I need to learn to code

#

Okay

modest maple
#

Do you have access to a laptop or PC?

ripe tulip
#

Nope

quartz kindle
#

then your best bet would be something with an online editor like heroku or glitch lol

#

or get a vps

lusty dew
#

Or if you have a friend with a vps ask them to run a code server and see if they will let you access it

ripe tulip
#

K

lusty dew
#

It’s not the best thing in the world but it helps

ripe tulip
#

Okay

modest maple
#

Tbf if you go to school you might be able to access somthing like glitch on their pcs

ripe tulip
#

Nope thas not happening until like 2+3 year's

loud salmon
#

why 2/3 years?

ripe tulip
#

Uhhhhhh me don't want to say

quartz kindle
#

are you 5 years old?

ripe tulip
#

No

#

Older

delicate zephyr
#

are you under 13

ripe tulip
#

I maybe

quartz kindle
#

rip

loud salmon
#

how far under 13

ripe tulip
#

Almost 4

lusty dew
#

He’s about to be banned

loud salmon
#

-b @ripe tulip 9 years old

gilded plankBOT
#

dblMod Banned pøwerfullKD#2338 (@ripe tulip)

lusty dew
#

XD

mossy vine
#

jeeeez

loud salmon
#

@delicate zephyr let staff agebait please

#

it just gets fucky when 3 people ask the same damn question

lusty dew
#

Can I report to discord ;)

delicate zephyr
#

Okay sorry

loud salmon
#

yea go ahead idm @lusty dew

lusty dew
#

Okay bet

mossy vine
#

oh so do you guys not actually escalate it to discord

delicate zephyr
#

they dont have to

modest maple
#

F

delicate zephyr
#

its not their job

lusty dew
#

You technically have too

west raptor
#

i never bother to

#

no you dont

lusty dew
#

But it’s not their job

delicate zephyr
#

they just have to make sure this server is abiding by TOS

#

thats it

lusty dew
#

Yea

quartz kindle
#

reporting to discord is just being an asshole imo, let them be and do whatever, just not under your jurisdiction. you dont need to go out of your way to witch hunt them

west raptor
#

you;re not gonna get in trouble for not reporting someone lol

lusty dew
#

Though discord advises you to report people under 13 for reasons

west raptor
#

this is off-topic

#

btw

delicate zephyr
#

realistically if they wanted to a DStaff member could just join dbl and read #mod-logs

#

moving

modest maple
#

Discord rlly don't care if you report or not but I agree with dream

surreal sage
#

how to make like an status page for my bot? any templates that you can connect with cname records? @loud salmon

#

oops sorry

loud salmon
#

wtf

surreal sage
#

accedently pinged u

#

or how i need to say it

grizzled raven
#

yeah yeah

#

he gets the idea

#

"Request to use token, but token was unavailable to the client."
in what way would this be caused

lusty dew
#

are there any orms for python?\

#

Well I know there are

#

but what is a good one to use?

sudden geyser
#

@grizzled raven sounds like a bot.destroy()

#

at least I know that's one way it can happen

grizzled raven
#

@sudden geyser yes that is how it happened

#

i know that

#

but how would you prevent thing

#

this

modest maple
#

@lusty dew just us SQL lite or somthing for python, it's simple enough to not rlly be worth bothering with orm

#

Atho it's personal choice

lusty dew
#

I like using orms

earnest phoenix
#

sqlite is a database

#

an orm is a framework that helps you interact with the database

#

using objects

#

instead of writing your own sql queries

lusty dew
#

Yes I know

#

I’m bad at writing sql queries so I use orms

split hazel
#

its really not hard

#

learnt it in an hour

modest maple
#

SQL lite in python is pretty much jus """INSERT INTO stuffs"""

surreal wagon
lusty dew
#

Lol

earnest phoenix
#

SQL lite in python is pretty much jus """INSERT INTO stuffs"""
that doesn't make sense...?

#

also dyinglight, that was directed at chillfish, my bad

#

sql is a language

#

sqlite is a database implementing said language

#

inserting data into it will always be the same regardless which adapter on whichever language you're using

lusty dew
#

I know

#

I just like using orms

#

They save me some trouble

earnest phoenix
#

yeah i love using orms too

lusty dew
#

I see Dijango has an orm

earnest phoenix
#

i much rather prefer sticking to OOP

modest maple
#

Yh ik cry

#

But SQL lite isn't rlly hard to implement by itself rather than using a orm like you could do either

#

And his OOp good

earnest phoenix
#

you still don't make any sense

lusty dew
#

Using orms are fun though

earnest phoenix
#

the point of an orm is to remove the need to handwrite sql queries and instead have a full OOP experience

lusty dew
#

Yea

earnest phoenix
#

plus, they're much more dumbproof

lusty dew
#

If I learn python I’ll probably use Dijangos orm

modest maple
#

Why?

lusty dew
#

I read some of its documentation and it looks pretty nice

modest maple
#

Meh it's alright

#

Mostly for websites etc..

lusty dew
#

Yes but it can be used for anything

modest maple
#

It is only like 4 functions to make a read write db

#

And 2 for creating a table and creating a connection

earnest phoenix
#

again

#

the point of an orm is to have a full OOP experience

#

you can easily set up keying, migrations and orms auto sanitize input

teal pasture
#

quick question if i'm able, can someone double check my code for the bots Playing: Server Count? I cant get it to work and I feel super dumb now.

cursive dagger
#

Just post it

hoary elm
#

What is the best way to Delete an object from a JSON after it has been used the delete method isn't working (no errors either) just doesn't work

earnest phoenix
#

are you using json files as a database

unique nimbus
#

JSON isnt for databases it is for information to be stored and accessed easily, if you want something which can delete, add, edit information use something like sql

lusty dew
#

👀

#

Do you even know if they are using it as a database yet

unique nimbus
#

The word delete can signify it

lusty dew
#

Not really but okay

hoary elm
#

@unique nimbus I wouldn't necessarily say database but yes I use it to store User IDs for blacklist commands ect

#

Store and fetch*

#

I also use it for things like responses for some of our Fun Commands like 8ball ect I store the responses in a JSON instead of adding unnecessary text to the actual js file if it doesn't need to be in there

lusty dew
#

If you’re storing stuff in it and using it for commands that read and write constantly then you’re using it like a database

earnest phoenix
#

hey could someone help me change the invite buttons color

#

im trying to make it a gradient

#

this is what i have rn

#
<head>
  <style>
      .votebutton btn btn-orange btn-2x {
          color: linear-gradient(to bottom, #ff0066 0%, #cc0099 100%);
      }
  </style>
</head>```
valid frigate
#

???

#

you only need the <style> tags afaik

earnest phoenix
#

ok

#

but i had it like that and it wasnt working

valid frigate
#

also you need !important after every rule to override it

earnest phoenix
#

ohh

valid frigate
#

yeah

earnest phoenix
#

wait where do i put important

valid frigate
#

in css, using !important isn't really a good thing but in the case of bot css go crazy

earnest phoenix
#

sorry abt this

valid frigate
#

the end of the css rule

earnest phoenix
#

i havent done css in awhile

valid frigate
#

eg padding: 1px !important;

earnest phoenix
#

so color: linear-gradient(to bottom, #ff0066 0%, #cc0099 100%) !important;

valid frigate
#

i mean

#

try it and see

earnest phoenix
#

i just tried it and it didnt work

valid frigate
#

lmao

#

you're using color instead of background

earnest phoenix
#

i had it on backround

valid frigate
#

color is a text modifier

earnest phoenix
#

sorry im a dumbass

#

hmm

#

yeah it didnt work

#

hmm

#

my spacing doesnt seem wrong

#

idk whats wrong

#
<style>
  .votebutton btn btn-orange btn-2x {
      background: linear-gradient(to bottom, #ff0066 0%, #cc0099 100%) !important;
  }
</style>```
lusty dew
#

Sure you have the right css classes

earnest phoenix
#

i think

lusty dew
#

You do know

#

Votebutton btn btn-orange and btn-2x are all separate classes right?

earnest phoenix
#

i did not know that uhhh

lusty dew
#

You’re probably wanting to change background color of votebutton

#

Either that or btn class

earnest phoenix
#

i was aiming for all buttons

#

just making it .btn worked

#

thank you

lusty dew
#

No problem

earnest phoenix
#

i havent done this in months

lusty dew
#

You haven’t done it so long that you forgot those are separate classes?

#

That should be easy to tell no matter how long of a break you took

earnest phoenix
#

no like

#

ive barely done css

#

last time i did it was ages ago

lusty dew
#

Okay

#

How would you use a .env file in python. I’d assume you’d use a special package like python-dotenv, but are there any other ways?

west raptor
#

I guess you could somehow source the file

#

but dotenv would just be the better option tbh

earnest phoenix
#

so im trying to remove the shadow from my bots icon on its page

#

im using css .bot-card .bot-img {; box-shadow: none !important; }

#

but it doesnt seem to be working

prime cliff
#

Try this?

#bot-details-page .bot-img {
  box-shadow: none !important;
}```
earnest phoenix
#

oh damn that worked

#

thank you!

prime cliff
#

👍

earnest phoenix
#

how do i style the lib button tho

#

i was trying earlier but couldnt get that to style

lusty dew
#

Mk thanks

earnest phoenix
#

has anyone ever managed to style the lib click

#

nvm i got it

earnest phoenix
#

ok so last thing

#

how do i remove this thing

#

like the little bubble things

lusty dew
#

You mean the circles and such

earnest phoenix
#

yes

lusty dew
#

It’s probably a background image

#

Iirc background image prop has a none value

#

Let me verify that though

#

Actually to be honest

#

You can set your own background image I think

#

It just won’t be in file form

#

It’d have to be a url

earnest phoenix
#

yeah but im trying to have a plain backround

lusty dew
#

Ah okay

#

Then just use background-image: none and change the background to how you like

earnest phoenix
#

okay, thank you

#

that didnt work

#

wait its in a class

#

not a backround image

lusty dew
#

Hold up let me take a look myself

#

If background-image didn’t work then I’m not sure what those circles are

earnest phoenix
#

i did it, theyre in a div

#

class shapes-background

lusty dew
#

Oh so I was right

#

I didn’t see that class ahaha

#

Override the background image in that class and change it to none then you won’t have the shapes anymore

earnest phoenix
#

ye thats what i did

lusty dew
#

K

earnest phoenix
#

ok gn now

lusty dew
#

Did it work?

#

Okay Gn

earnest phoenix
#

yeah

#

hosting on heroku overnight sadly

earnest phoenix
#

One simple question : I don't have any money, and I need a good vps. What can I have? (I tried Google or AWS but I don't have credit card to sign-up)

fluid basin
#

bruh heroku

#

its not meant for bots so yuh

#

has similar drawbacks to glitch

#

well iirc one of it was no 100% uptime

green kestrel
#

@earnest phoenix have you thought of asking friends who have a vps to give you an account as a loan?

lusty dew
#

Loans are meant to be payed off

#

If they had money or whatever they’d buy their own

restive furnace
#

I have a friend who gives me vps for some game items

lusty dew
#

Xd

#

I have a friend who’s nice enough to let me use some space on their server

green kestrel
#

@lusty dew youre right, and im sure if someone lends you hosting space, as soon as youre able to afford your own the offer would be there on the table to return the favour

#

it always was for me, i borrowed shell accounts for years from friends

#

they are all welcome now if they need to call in that 'debt' but they generally still have their own server and wont ask

lusty dew
#

Yes

#

I plan on getting my own server at some point when I get a job

green kestrel
#

and superhero is right, theres always the barter system, @earnest phoenix cant you offer some service to someone else in exchange for hosting, e.g. offering tech support for their server, or such? what can you do in exchange for what you want, if you dont have cash? think the way barter cultures work

#

maybe you can write them a bot, or monitor their bot

#

coding has value

earnest phoenix
#

@green kestrel no :'

green kestrel
#

just... make sure you trust your friend. i once got bitten bad by someone who loaned me a dedicated server to host an irc hub, and then they cancelled it without any notice, my irc network was down for days

#

he was working in a datacentre and had the perk of being able to put his own equipment into free rack space

earnest phoenix
#

A lot of my friends don't know what in the world is discord

green kestrel
#

turned out he got fired and didnt tell anyone.

lusty dew
#

Lmao

green kestrel
#

theres no way such a thing would be allowed now, this was what, 2003?

lusty dew
#

Gets fired from job after uploading his shit into the server

#

Big brain

#

Free hosting

green kestrel
#

nah he was literally allowed to connect his own hardware to unused space in the racks of the DC

lusty dew
green kestrel
#

which is actually a really cool perk

#

like i said no way any sane DC would allow it now

lusty dew
#

I mean

#

Why not 😉

green kestrel
#

if i was allowed to do that, i have a dell T310 i'd be putting in there.

lusty dew
#

Xd

green kestrel
#

currently it runs in my utility cupboard 24/7

lusty dew
#

Oof

green kestrel
#

i have a dedicated server at ovh where i run my live bot, and the cupboard server for dev

lusty dew
#

I was planning on buying a server rack and stuff then getting the servers

green kestrel
#

whats your internet connection like

#

is it generally up 24/7 without major outages?

lusty dew
#

It’s not bad but it’s not good

#

It’s up 24/7 for the most part

green kestrel
#

why not get something like a raspberry pi or a protectli FW-1 and host your bot on that

zealous veldt
#

mm I could never self host at my mom's house because PG&E likes to cut our power

lusty dew
#

There’s been 2 days since we had it that it went out

green kestrel
#

rpi is well within affordable, its like £30 one off

zealous veldt
#

They're $35USD iirc

lusty dew
#

Meh

#

I don’t like rpi

green kestrel
#

also if you get a cheap UPS it can run an rpi for hours or even days

#

protectli it is then. i have one as a router, its the size of two cellphones sat side by side, has 4 lan ports on it, and runs intel hardware

zealous veldt
#

Damn

green kestrel
#

a bit more pricey than an rpi, but fanless and silent

#

or, go on ebay and buy a laptop with a broken screen. they go for peanuts, and they make great servers with built in battery backup. just be sure to run them with the screen open.

lusty dew
#

I can’t find it anymore

green kestrel
#

An ancient laptop is more than enough to run a discord bot plus it has WiFi so you can stash it anywhere in the house, under a bed, in a cupboard...

lusty dew
#

But there was this website that sold basically rpi but more powerful and bigger

green kestrel
#

Just keep an eye on heat

zealous veldt
#

Can I run docker containers in my brain?

lusty dew
#

Yes

fluid basin
#

well you could get a UPS easily for a RPi

#

all you need is a decent portable charger

green kestrel
#

No brains are for running full VMs

#

VMware ESXi Grey Matter edition

fluid basin
#

and then prolly some switcher so that it automatically falls over to portable charger power when your mains get cut

lusty dew
#

Never heard of protectli

fluid basin
#

prolly using a relay

green kestrel
#

@fluid basin I suppose, but by the time you've built that you can get a second hand ups off eBay that will run a RPI for days even if it's battery is pants

fluid basin
#

yeah thats true

glacial mango
#

How do I use a local image in embed?

zealous veldt
fluid basin
#

15W isnt too much

green kestrel
#

I have one that could run an rpi but it can't run my server

fluid basin
#

and it only hits around 15W when running on full load

green kestrel
#

I bought it to run my server but it doesn't have the VA

#

Supposedly 750VA, turns out those figures are marketing bs much like megapixels on cameras

#

750VA can't run a small tower server.

fluid basin
#

@glacial mango depends on library, but iirc message attachments are allowed in embeds

green kestrel
#

supposedly

lusty dew
#

Don’t some companies sell servers?

fluid basin
#

750VA is around 6A (on 120V) or only 3A (on 250V)

lusty dew
#

Like ya know something you can own yourself and have in your house

fluid basin
#

which is like

green kestrel
#

As in physically sell you a server you can plug in at home yes

glacial mango
#

@fluid basin I use js

fluid basin
#

almost nothing

green kestrel
#

That's how I got mine

#

Second hand reconditioned, nice spec server for £600

#

As opposed to thousands

green kestrel
#

Sure but where will you rack mount it

fluid basin
#
#

@green kestrel well 750VA literally means 750W

vital lark
#

Willi is smart

lusty dew
#

@green kestrel in my small ass closet that has no other use

fluid basin
#

no me is dumb

lusty dew
#

Xd

green kestrel
fluid basin
#

hmm

#

I would prefer a 1U server though

green kestrel
#

750w should have been more than enough @fluid basin , the server spends 99% of its time idle

#

Again where in your home will you rack mount it

fluid basin
#

much smaller but wider

#

cupboard

green kestrel
#

Btw if you must IKEA do a table who's leg space is exactly 1u

#

;)

lusty dew
#

I have a closet that could fit 10 of those

fluid basin
#

well power is one thing

#

capacity is another thing

lusty dew
#

That is true

fluid basin
#

how much is its rated capacity

green kestrel
#

If you're putting it in a cupboard you'll need good airflow

fluid basin
#

drills some holes

green kestrel
#

I put it behind a louvred shutter

lusty dew
#

But I doubt it’d use a huge amount of power

surreal sage
#

how can i add stuff to a json? like this is an json: json { "1": "12" } but i want it to add something on it

{
     "1": "12",
     "2": "22"
}``` just adding an array to an json not editing
fluid basin
#

bruh

lusty dew
#

Fs?

surreal sage
#

y

#

i got it

vital lark
#

you use fs#writeFileSync

surreal sage
#

y

glacial mango
#

@fluid basin When I do this it sends the embed without image

const embed = new DiscordJS.RichEmbed()
.setTitle("Food")
.setImage("attachment://./API/Food/oMRKkMc4RSq7N91OZl0O_IMG_8309.jpg")
msg.channel.send(embed)```
surreal sage
#

but that overwrites

vital lark
#

not really

fluid basin
#

@glacial mango u need to attach the image as well

surreal sage
#

so if i have an json

glacial mango
#

?

vital lark
#

it only overrides what you add

glacial mango
#

@fluid basin what do you mean

surreal sage
#

i dont want that

#

just want it to add

vital lark
#

well

fluid basin
#

literally what it means:

message.channel.send({embed: {
            description: "This is some text",
            image: {
                url: "attachment://twitter.png"
            }
        },
        files: [{ attachment: 'images/twitter.png', name: 'twitter.png' }] 
    });```
vital lark
#

if I have {a:true}, I would put it in a variable and add to it and use writeFileSync to write the variable to the file

lusty dew
#

I would ask python questions here

#

But I’m to lazy

vital lark
#

but people like to copy and paste because people don't wanna learn how to code / read documentation balancemmlol

lusty dew
#

I copy and pasted a whole bot

#

😉

#

Me big brain

restive furnace
#

no u nit

#

not

green kestrel
#

btw we got our servers for work from bargainhardware on my advice. the specs of both are: 2x xeon 8 core cpus, 384gb ram, 16 1TB drives in raid 10

vital lark
#

someone hasn't heard of sarcasm

fluid basin
#
const embed = new DiscordJS.RichEmbed()
.setTitle("Food")
.setImage("attachment://my_interesting_file.png")
msg.channel.send({embed, files: [{attachment: './path/to/folder/my_interesting_file.png', name: 'my_interesting_file.png'}]});
green kestrel
#

theyre 2U rackmounts with rackmount kits

surreal sage
#

Discord.RichEmbed()

#

use ./

restive furnace
#

??

green kestrel
#

i should run my discord bots at work lol, we got 100mbit leased lines here.

restive furnace
#

You can use different variavle name

surreal sage
#

oh wait thats an yrl

#

url

restive furnace
#

did you know that fact?

surreal sage
#

default= url

lusty dew
#

@green kestrel you should let me run my bots at your work xD

green kestrel
#

lol nope

fluid basin
#

thonk 10mbit should be enough just for text

#

unless you need to send audio/visual stuff

green kestrel
#

im the IT manager, i spec and install the hardware, i could get away with it, but hosting 3rd party code? that wouldnt fly

#

😛

lusty dew
#

Mmm

#

Big sad

#

:(

green kestrel
#

how many servers is your bot on

lusty dew
#

None

#

I haven’t even released it yet

#

😂

green kestrel
#

oh

#

whats it made in?

lusty dew
#

Discord.js

fluid basin
#

yeah then no point aiming to get a strong server for it first

#

make it public

green kestrel
#

i could give you a shell, but i cant offer you any support

fluid basin
#

and see how it performs first

#

imho

green kestrel
#

it would just be a basic ssh session

lusty dew
#

But ima try and make it in d.pu

restive furnace
lusty dew
#

I already have a server

green kestrel
#

it would be up to you to install anything you need in your home dir

fluid basin
#

inb4

lusty dew
#

It ‘‘twas a joke

fluid basin
#

sudo rm -rf /

lusty dew
#

I have a friend lending me some space

green kestrel
#

ah wait getting you muddled up with @earnest phoenix

restive furnace
#

My vps rn is like 512mb ram 😂

lusty dew
#

Lol

green kestrel
#

yeah thats where i'd make the ssh shell

fluid basin
#

tfw your country is already so small that it literally has no space for datacenters (or maybe)

#

and like the only option is to host it at home

#

but I gotta deal with the cooling + network and power

green kestrel
#

i have a digitalocean VPS, $5 a month jobby, all i use it for is a small ircd and a socks proxy

#

it has space for a small js bot

restive furnace
#

finland is cold country so here is many datacenters

fluid basin
#

well ofc I'm talking about dedicated servers not vps

green kestrel
#

@restive furnace if you consider a datacentre a bunch of servers plugged in outside on a glacier, sure

fluid basin
#

its bloody overpriced here that it is almost impossible to get one unless you have the budget

green kestrel
#

wheres here?

fluid basin
#

SG or just asia in general

green kestrel
#

my dedicated server costs me £70 a month, ish

fluid basin
#

yeah prolly £70 could only get a server 2/3 of your specs

green kestrel
#

cant really afford it, but its my hobby, in the same way others might play xbox or go out down town

fluid basin
#

well thats true

surreal sage
#

this is off-topic

green kestrel
#

no its about development, and where to put your development 🙂

surreal sage
#

:/

fluid basin
#

aka hardware

#

no software can run without hardware mmLol

green kestrel
#

hmm, we dont really have a #hosting channel, Mods/admins can we pleaaase have one?

fluid basin
#

well development should suffice, anyways back to the topic im still looking for a decently priced 1U server

green kestrel
#

to buy physically or rent

fluid basin
#

that maybe could serve as hosting for a few bots and a game server

#

buy hardware

green kestrel
#

ok

#

ebay for sure

#

because you mentioned asia

#

postage for a company to asia from anywhere but HK would be major ouch

fluid basin
#

ok ebay

fluid basin
#

but any specific models thats nice?

green kestrel
#

dell R620 is awesome, and it has hardware raid and a fair chunk of ram

fluid basin
#

ouch doesn't post anywhere outside EU

green kestrel
#

actually that one is awesome, just no hard drives

#

if i was in the market for a new server i'd consider it

#

there are ones that do, that was the first i found

fluid basin
#

storage shouldn't be a problem, planning to buy a few ssds for the speed

green kestrel
#

dell R620 even comes with idrac which is a kvm/ip solution

#

mine also has that

#

generally any that have a model starting with R means rack, and T means tower, so mines T310 meaning tower and that ones R620 meaning rack

fluid basin
#

oh thats good

#

to know

green kestrel
#

only thing to look out for is servers are fussy about hard disk capacity and speed if you want to run raid

#

you cant just buy any sata hard disk

#

you have to look up the specs and buy ones that are compatible, multiples of the same type

fluid basin
#

wow poweredge r620 are all in the 100+ range

#

don't see any cheaper ones

green kestrel
#

they arent that old, try a lower model number

#

something like that perhaps

#

1 xeon cpu, 4gb ram

#

oh and if you can, get hard disk caddies with it even if you dont get disk

#

because the caddies are really expensive, its like "ka ching, enterprise"

#

you might also get a better price looking at supermicro instead of name brand like dell or HP

#

thats an example, that particular one is collection only from london though 😛

earnest phoenix
#

who pinged me

green kestrel
#

this one is £45 and posts to SG

fluid basin
#

hmm yeah lower price would be better

green kestrel
#

me lumap

earnest phoenix
#

oh

fluid basin
#

wait does the latter link has 2 systems in 1??

green kestrel
#

lumap how many servers your bot on

#

and is it djs?

earnest phoenix
#

What do you advise as host to make housing?

green kestrel
#

no thats just one server @fluid basin

fluid basin
#

oh, hmm well that still needs quite a bit of upgrade if I get it

green kestrel
#

for running a discord bot? probably ok

fluid basin
#

international shipping for big stuff is rather pricey

earnest phoenix
#

👀

vital lark
#

imo d.js just waste ram when using the default options

green kestrel
#

says free shipping paddle

fluid basin
#

@green kestrel yeah ofc a discord bot will definitely be fine

green kestrel
#

to uk and various countries

#

😄

#

ofc you do need to get a couple of sata hard disks

fluid basin
green kestrel
#

@vital lark agreed node.js is a waste of ram in general. this is why i write my bot in C++ 😄

#

free shipping to sg, £45 GBP, buy-it-now auction

fluid basin
#

oh I didn't see that

green kestrel
#

just add hard disks

fluid basin
#

thats why living in asia is a pain sometimes

green kestrel
#

ah wait

#

its not free at all. nasty trick.

fluid basin
#

yeah postage is the way to trick and earn more

green kestrel
#

you could contact the seller and arrange your own shipping after paying perhaps

fluid basin
#

since postage doesn't need VAT

compact oriole
#

And I thought it was horrible enough for the customs price in Finland

#

if you buy something outside of EU and it costs 20€+ they take a fee

#

sometimes its huuuuge

green kestrel
#

heh... when i bought my protectli fw-1 i got it from america... had to import it, and i was stung on import tax. import tax on a £300 piece of computer hardware isnt small 😦

vital lark
#

@green kestrel I never said node.js itself is a waste of ram, but ok then 02shrug1

green kestrel
#

you mean its not? 😄

vital lark
#

it's detable

fluid basin
#

sigh, might as well build my own server now

#

at least parts are way cheaper than one set/rack

green kestrel
#

this is true

#

if you buy a cheap sata raid card, and a sturdy case, you can build something server grade for cheap from second hard parts

surreal sage
#

how to convert this message.createdTimestamp in hours with Math.round ? and with minutes?

warm marsh
#

Math.round won't help.

#

use Date

#
// example
const timestamp = Date.now(); // 1577187054194
const time = new Date(timestamp);
#

Date has methods for getting hours and minutes.

surreal sage
#

gonna try

glacial mango
#

Could someone help me changing my bot's page button color & form?

wheat jolt
#

What?

#

Be more specific @glacial mango

glacial mango
earnest phoenix
#

From what Bot is That?

summer torrent
#

with your css code

earnest phoenix
#

see the class the buttons are using and overwrite it in your description with the style tag

#

finding the classes in there is hard af for me

#

what

#

inspect element

#

and read the html

#

lol

#

on Phone? yeah sure

warm marsh
#

Could just use a PC/laptop

earnest phoenix
#

Mine died 1month ago

#

i mean there is the view-source protocol on chrome

#

it keep was heating to 90° in 10mins

warm marsh
#

Laptop or PC?

earnest phoenix
#

also you can always like not use chrome, i use firefox on my phone because i value my data lmaoo

#

and they allow addons

glacial mango
#

I have this now, how do I change the vertical text position?

<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #8572ff;
  height: 20px;
  border: none;
  color: white;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}

.button1 {border-radius: 80px;}

.button1:hover {
  background-color: #7661ff;
  color: white;
}
</style>
</head>
<body>

<button class="button button1">Add to server</button>

</body>
</html>
warm marsh
#

You put all that inside of the description?

earnest phoenix
#

@warm marsh laptop

warm marsh
#

Fair.

earnest phoenix
#

Hi! I have a preobleme with my DIscord bot, can you help me?

warm marsh
#

What problem?

#

Asking for help without providing what you need help with is completely useless.

earnest phoenix
#
    if(error) {return console.error(error);}
    let jsfiles = f.filter(f => f.split(".").pop() === "js");
    if(jsfiles.length <= 0) {return console.log("Aucune commande en cours...");}

    jsfiles.forEach((f) => {
        let props = require(`./commands/${f}`);
        console.log(`${f} commandes en cours...`);
        client.commands.set(props.help.name, props);
    });
});```
#

On index.js

#

On commands.js

#

module.exports.run = (client, message, args) => {
    let embed = new Discord.RichEmbed()
    .setColor("RANDOM")
    .setTitle("Commandes/Events de PorkeyBot")
    .setDescription("Contient toutes les commandes et tous les events de PorkeyBot.")
    .addField("Informations")
    .addField("Events", "newmember")
    message.channel.send(embed);
};

module.exports.help = {
    name: "commands"
};```
#

And I can't use commands.js

#

But I don't have an error on the terminal

warm marsh
#

Then that probably isn't your issue.

earnest phoenix
#

?

#

Where is the error

warm marsh
#

Send your client.on('message')

#

code

earnest phoenix
#
    if(message.author.client) return;
    if(message.channel.type === "dm") return;

    let prefix = config.prefix;
    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);
});```
#

This?

warm marsh
#

Yeah

#

All of it

earnest phoenix
#

All index.js?

warm marsh
#

No

#

Is that your entire client.on('message')?

earnest phoenix
#

Yes

warm marsh
#

if so you're missing vital parts.

#

you need something to get the command from your map/collection

earnest phoenix
#

client.commands = new Discord.Collection();

#

I have this

warm marsh
#

like ```js
let command = client.commands.get(cmd) || false;
if (!command) return;

command.run(client, message, args);

#

You're missing the part where you get the command from your collection

#

and then you need to call the function and pass the parameters.

#

But honestly, Don't just copy and paste code because you get stuff like this and you have no clue what it does or why it "doesn't" work.

earnest phoenix
#

OKya👍

#

But its still showing me nothing? This code comes from my old bot (6 months ago), and it worked, but I forgot everything about Javascript.

vagrant stream
#

Help please (JS)

for (const guild of data.guilds) if (!client.guilds.has(guild.id)) client.dataManager.newGuild(guild);
                                                        ^

TypeError: client.guilds.has is not a function
earnest phoenix
#

@warm marsh

glacial mango
earnest phoenix
#

play around with the border

#

try setting it to none

fluid basin
#

either border or border shadow or outline

warm marsh
#

@earnest phoenix try using the console.

#

Add console.log(client.commands); in your message listener.

earnest phoenix
#

Ok

glacial mango
#

@earnest phoenix I don't see border

grizzled raven
#

could be top.gg and scaling/cropping issues

prime cliff
glacial mango
#

Thanks that works

#

I changed the color for

html, body, p, ol, ul, li, dl, dt, dd, blockquote, figure, fieldset, legend, textarea, pre, iframe, hr, h1, h2, h3, h4, h5, h6```
to white for 'Commands Prefix' & 'Bot Tags' but now is all the text in my long description also white, how do I change that?
prime cliff
#

Doing that to all those tags will cause that btw are you using chrome or firefox?

glacial mango
#

I use inspect on chrome

#

Do you know which tags are for long description and which are not?

west spoke
#

ctrl shift I after highlighting what you want

shy turret
#
async function configSet(name, response) {
  try {
    if (config[name] === undefined) {
    } else {
      delete config[name];
    }
    if (response.toString() === "") {
    } else {
      config[name.toString()] = [response.toString()];
    }
    fs.writeFile("config.json", JSON.stringify(config, null, 2), function(err) {
    if (err) throw err;
    });
  } catch(err) {
  }
}

Sometimes, when I restart my bot, something like this happens:

{
  "this": [
    "thing"
  ],
  "is": [
    "not"
  ],
  "working": [
    "."
  ]
} ] // <- so I have to always manually remove that
}
#

I don't want to use SQL

west spoke
#

config[] is set to be that.

#

Make sure the string is correct

shy turret
#

wdym

#

config[name.toString()] = [response.toString()];

#

i still dont get it

sudden geyser
#

a good example of why not to use json dbs

shy turret
#

im not gonna make a web or anything

#

or else people will prob try to hack

#

honestly, that doesn't help

west spoke
#

JSON works fine for me

shy turret
#

rip me

#

how do you set ur variables?

west spoke
#

I use python, and it has global variables

shy turret
#

oh lol

modest maple
#

global variables = bad

shy turret
#

I suck at python

west spoke
shy turret
#

so i gave up

modest maple
#

class vars are bea

shy turret
#

let me try updating my node.js

west spoke
#

bea?

glacial mango
#

How do I show my website in long description?

atomic crow
#

How long does it take for the bot to be verified

modest maple
#

2 weeks atm

atomic crow
#

Yeesh

shy turret
#

im guessing fs spam caused the problem

golden raven
#

how can i change the theme of my bot page

valid frigate
#

add css using style tags in your bots long description

golden raven
#

i couldn't understand

modest maple
#

you use html and css

opaque eagle
#

In your bot's description: ```
<style>
.selector {
property: setting;
}
</style>
Hello my bot is so cool

golden raven
#

ok let me try

opaque eagle
#

Not that exact codeblock though... you have to use your own css

#

Idk what else I'd need to put in there

#

That itself took a while to make lmao

golden raven
#

@opaque eagle im a web designer and i will use my own css, thanks for showing intrest to help me

earnest phoenix
#

Is there a bot that can send customizable private messages when clicking on a reaction?

golden raven
#

what is the class/id of invite button

modest maple
#

@golden raven youre not allowed to edit any buttons

#

@earnest phoenix wdym

earnest phoenix
#

So uh

#

If someone clicks on a reaction

#

Is there a bot that will send a customizable message in DM's depending on on what reaction that person clicked?

#

Im sorry for bad spelling, im from germany. xD

modest maple
#

i think that might be a bit to specific

#

you might have a hard time finding somthing like that

earnest phoenix
#

Mhmmmmm.

modest maple
#

maybe try hiring someone from fiver or somthing

warm marsh
#

Does anyone know how Discord bot tokens are generated?

modest maple
#

someone had a good diagram of it

fluid basin
#

python itsdangerous

#

@modest maple tokens not snowflakes

modest maple
#

but basically it takes the date it was created, a unique code, and another thing

amber fractal
#

Just look up how an api token is made, they usually follow the same basic process

modest maple
#

yh

fluid basin
#

well pretty much but to be precise its in python/itsdangerous module

slender thistle
fluid basin
#

hmm didn't know a diagram existed

modest maple
#

dankies shiv

fluid basin
#

@warm marsh why would you need to know how they are generated though?

#

I presume you are making your own or something?

opaque eagle
#

Why does Discord need to use its own epoch

fluid basin
#
  1. makes it easier to count your token age from start of discord (basically how old in terms of discord's age)
  2. because it reduces the number so it kinda saves some space
  3. why not
warm marsh
#

Yeah I just wanted to know how they're made I've made an API for my chat, Just using it for testing and wanted to know how it was made.

amber fractal
#

And because the unix epoch is running out of numbers lmao

#

No time soon of course

#

The Year 2038 problem (Y2038) relates to representing time in many digital systems as the number of seconds passed since 00:00:00 UTC on 1 January 1970 and storing it as a signed 32-bit binary integer. Such implementations cannot encode times after 03:14:07 UTC on 19 January ...

sudden geyser
#

18 years pretty close umaruworried

amber fractal
#

I never said close

blissful scaffold
#

in the early 2000's there was this time traveler guy online who claimed he came back from the future because he needed unix hardware to fix the unix time problem 😄

warm marsh
#

How often can the ban method be called?

modest maple
#

follows the same rate limit as Editing messages and sending like messages every 12 seconds i think

#

but its kinda just blurred cuz is differs

warm marsh
#

Thanks

modest maple
#

idk why you want to call the ban method many many times without having some sorta malicious intent

warm marsh
#

Nah so can add cool down

#

So people don't spam it

blissful scaffold
#

You are allowed to call it a few times in short succession, but not too many times.
I think the rule is something like no more than 5 times per minute

#

If you need to ban 2 people you are allowed to do it without delay

lusty dew
#

In python what is __name__ and __main__ for?

warm marsh
#

Google?

lusty dew
#

I have

mossy vine
lusty dew
#

so basically say I have this


initial_cogs = [
    'cogs.owner',
    'cogs.mod',
    'cogs.fun',
    'cogs.general'
]
#
if __name__ == '__main__':
    for exstensions in initial_cogs:
        client.load_extension(exstensions)
        print('Successfully loaded {0}'.format(exstensions))

Then I do this which is my if __name__ == '__main__': check

#

it will strip off the cogs and leave owner, mod, fun, general?

modest maple
#

that just essentially determines weather the program is being started directly or not

#

e.g running the program in idle or pressing the run command in pycharm

lusty dew
#

Wait what

modest maple
#

the one you see here

#

is the program i use to run everything else

vital lark
#

but what if they aren't using pycharm

modest maple
#

doesnt make any diffrence

#

this is the program i want to call with my main program

#

the __name__ if statement wont run if i call / import the file Caller and then run it with my main program

#

only if i run the file manually

earnest phoenix
#

Hi i need to help

modest maple
earnest phoenix
#
      connection.connect(function (err) {
  if (err) throw err;
 
connection.query('SELECT * FROM erensibot', function (error, results, fields) {
  if (error) throw error;
  console.log('Result: ', results);
});
connection.end();
      });
``` Code Was Working But When I Starting the Code again i give err
modest maple
#

what is the error

earnest phoenix
#

PROTOCOL_ENQUEUE_HANDSHAKE_TWICE

#
      connection.connect(function (err) {
  if (err) throw err;
 
connection.query('SELECT * FROM erensibot', function (error, results, fields) {
  if (error) throw error;
  console.log('Result: ', results);
});
connection.end();
      });
      message.channel.send(`:ehayir: Oto as zaten ayarlı.`)
     connection.connect(function (err) {
  if (err) throw err; -- ERROR Was Here
 var sql = mysql.format(`INSERT INTO erensibot (deger, sonuc) VALUES('sas_${message.guild.id}', 'acik') ON DUPLICATE KEY UPDATE deger='sas_${message.guild.id}', sonuc='acik'`);

  connection.query(sql, function (err, result) {
    if (err) throw err;
    console.log("1 record inserted");
  });
  connection.end();
.
.
.
lusty dew
#

@modest maple I figured it out thank you hehe :3

earnest phoenix
#

if (err) throw err; -- ERROR Was Here

modest maple
#

im not rlly sure what is going on castial

valid frigate
#

lol

#

you can't connect to your db

sudden geyser
#

I think the problem with the query is the way callbacks are triggered later, so you may be trying to connect twice (just my guess)

valid frigate
#

if (err) throw err; means something was thrown

#

can you post the error here

earnest phoenix
#

@earnest phoenix ir(err) throw new Error(err); ?

#

If*

#

Error: Cannot enqueue Handshake after invoking qu
it.

#

:/

#

To Me Problem is connection.end();

dusky marsh
#

Yeah remove it

#

You ended the connection and tried to query again

earnest phoenix
#

not fixed

#

Can I Try To use MySQL Pool

#

im try only ```
connection.connect();

connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
if (error) throw error;
console.log('The solution is: ', results[0].solution);
});

connection.end();

#

But Same Error

#

i write +saas code was Working Good But When i write 2th time +saas code was break

#

'PROTOCOL_ENQUEUE_AFTER_QUIT' error

unique nimbus
#

From the name alone it seems to be that you ended the connection and tried to add information to something which isn't open

late hill
#

query probably async meaning you're ending the connection before it's finished the query

earnest phoenix
#

??????

#

hi

#

nevermind im blind as shit

earnest phoenix
#

How to make it that when for example when the User Count is 28000 that it adds to 28000 so that it is 28,000?

scenic kelp
#

what lang? js?

earnest phoenix
#

yes

#

use humanizer

#

how

#

google exists

unique nimbus
#

google

scenic kelp
#

there's Intl.NumberFormat

unique nimbus
#

install the package

#

read the docs

#

try

scenic kelp
#
const formatter = new Intl.NumberFormat('en-US')
formatter.format(1234) // 1,234```
#

no additional dependencies

earnest phoenix
#

Nah found an easier way by myself

.toLocaleString()

but still ty

lusty dew
#
Message DyingLight#7276: p$dog
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "dog" is not found```
#

Did I setup my cogs wrong?

#
initial_cogs = [
    'cogs.owner',
    'cogs.mod',
    'cogs.fun',
    'cogs.general'
]

if __name__ == '__main__':
    for exstensions in initial_cogs:
        client.load_extension(exstensions)
        print('Successfully loaded {0}'.format(exstensions))
#
  File "star.py", line 32, in <module>
    client.load_extension(exstensions)
  File "C:\Users\Username\Desktop\PyStar\venv\lib\site-packages\discord\ext\commands\bot.py", line 625, in load_extension
    self._load_from_module_spec(lib, name)
  File "C:\Users\USername\Desktop\PyStar\venv\lib\site-packages\discord\ext\commands\bot.py", line 577, in _load_from_module_spec
    raise errors.NoEntryPointError(key)
discord.ext.commands.errors.NoEntryPointError: Extension 'cogs.owner' has no 'setup' function.
#

I am confused by this error

#

What setup function does it want

west spoke
lusty dew
#

Wait what

vital lark
#

you need add a function to add the cog itself

warm marsh
#

Can you still ban someone before they join your server?

vital lark
#

you can actually

lusty dew
#

If the member is cached

#

You should be able to

#

Or is there another way?

warm marsh
#

I thought you were able to ban using ID even if the user isn't cached

lusty dew
#

@west spoke Thats not working for me

slender thistle
#

You can ban anyone regardless of whether they're in the server or not

lusty dew
#

Wait really

#

I thought they had to share a server with the bot or be cached

slender thistle
#

Most libraries usually implement banning as <Member>.ban but there should also be <Guild>.ban that takes a user ID/snowflake object

lusty dew
#

Oh dang

modest maple
#

erm

#

right

#

anyone know how to reconnect to disconnected tasks using pycharm

#

as it would apear

#

i might of lost a couple bot programs that are running

#

with no way to reconnect to them

lusty dew
#

is there a better way I can load the cogs in the folders

#

rather then just doing

#
initial_cogs = [
    'cogs.owner.kick',
    'cogs.mod',
    'cogs.fun.dogs',
    'cogs.general'
]
modest maple
#

i mean all its doing is just essentially doing all the from <folder> import <program> and simplifying some of the stuff so you dont have to keep writing some long line of sutffs

lusty dew
#

but won't I have to do that for every file I add into the fun or owner folder

#

that just seems tedious to me

#

and pointless if there is a better way

modest maple
#

i mean i dont use the inbuilt system

#

cuz i found it annoying

lusty dew
#

I find this very annoying

#

if I have to do that for every file i have in the folder

modest maple
#

tbf you could use an automatic system to auto list everything and load it

#

rather than manually doing it

lusty dew
#

How so?

modest maple
#

but it gets a lil complicated with it

lusty dew
#

Idc

#

I’ll learn whatever I need to learn to do it

#

I just don't wanna manually do it

modest maple
#

well essentially all youre doing is adding strings to a list of the objects

#

so in theory, altho i havent tried this with the inbuilt system

#

you could use listdir() and get the folders and their internal files and just use some string manipulation to get the list

lusty dew
#

Hm

#

I will test it out

#

Is there a specific way to specifying the folder and such?

#
path = '/Users/SecretUsername/Desktop/PyStar/cogs'
dir_list = os.listdir(path)
#

I did this and it returned an array of folders

#

would I have to individually load each folder and its contents?

modest maple
#

essentially yh

#

just get the list of folders

#

then edit the file path cuz you can use somthing like an f string

#

and iterate throught the list and have somthing like a dictionary or 2D array or somthing

lusty dew
#

Hm

#

so like

#
fun = '/Users/SecretUsername/Desktop/PyStar/cogs/fun'
dir_list = os.listdir(dir_list)
for files in dir_list:
    #get the files and load em
#

Something like that?

modest maple
#

yh

#

well it would be folders your get from the loop

#

but you could then do

#

filepath + folder = Newfilepath

#

and then listdir for each new file path and append to a list

#

so you then have a 2D list

lusty dew
#

Wait what

#

@modest maple

#

/fun is the folder

#

Where the files are

modest maple
#

yh

lusty dew
#

So what are you talking about

modest maple
#

idk

lusty dew
#

🤔

modest maple
#

just going off the cog.<folder>.<file>

#

in your example code

lusty dew
#

Yea

earnest phoenix
#

const { resolve } = require('path');
const walk = require('walk');

class CommandHandler {
  constructor(client) {
    this.client = client;

  }

  async load() {
    const walker = walk.walk('./commands');
    walker.on("file", (root, stats, next) => {
      if (!stats.name.endsWith('.js')) return;
      const Command = require(`${resolve(root)}/${stats.name}`);
      const command = new Command(this.client);
      command.aliases.forEach(r => {
        this.client.aliases.set(r, command);
      });
      this.client.commands.set(command.name, command);
      console.log(`[Command Loaded] ${command.name}`);
      next();
    });
  }

}

module.exports = CommandHandler;

Anyone can tell me that when i use aliases the aliases wont work?

lusty dew
#

Can you explain your POV on it

#

Wait a sec

earnest phoenix
#

what

lusty dew
#

Do you mean

#
path = '/Users/SecretUsername/Desktop/PyStar/cogs/'
fun = 'fun'
dirFun = path + fun
dir_list = os.listdir(dirFun)
for files in dir_list:
    #get the files and load em
copper cradle
#

huh

lusty dew
#

@modest maple is this what you mean?

modest maple
#

sorta

#

but you dont need to have a var for each folder

#

just

#
My Cogs list = []
Defualt-Path = "xyz"
for somefolder in thelistListdir(FilePath) gives:
    NewFilepath = f"xyz/Somefolder (formatted duh)"
    TempList = []
    for somefile in thelistListdir(newFilePath) gives:
        TempList.append(LeFiles)
    My cogs list . append(Templist)

etc...
#

gives you a two dimentional array

#

e.g

#

List = [[1, 3, 4], [4, 5, 6]]

#

i mean it might be easier just having a dictionary and making the key the folder and the values the file name

#

and then just interating over it and formatting the string so its like cog.folder.file

#

it just sorta depends on how you wanna do it

#

but as a rough idea

lusty dew
#

Hm okay

west scroll
#

erm dose anyone know why the Qasmoke bot is streaming?

#

should i be concered

modest maple
#

you can set activities for bots

#

like streaming, watching etc...

west scroll
#

what dose this do becuase once i click it says it is not streaming

#

saorry for my spelling

modest maple
#

wdym

lusty dew
#

Bot devs can use it to set if they are streaming on twitch or if other people are streaming on twitch

#

Then it links to said persons twitch channel

sterile minnow
earnest phoenix
#

it's just a css animation

#

use animista if you have no clue how css works

sterile minnow
#

But how? I'm not good at site stuff

earnest phoenix
#

i told you

#

...

sterile minnow
#

Whats Animista?

earnest phoenix
#

google exists

sterile minnow
#

ahh and how do i use that in my bot page?

earnest phoenix
#

use the style tag to use your own css

#

find the class that the avatar on the page uses with inspect element

#

and add the animation to that class in your css

sterile minnow
#

Okay i'll try it

halcyon kestrel
#

botinfo @hasty hedge

#

-botinfo @hasty hedge

gilded plankBOT
#
Bot info
ID

282859044593598464

Username

ProBot ✨

Discriminator

5803

Short Description

Welcome images, voice/text levels per guild, global levels, logs, high quality music, moderation and many many more!

Library

Eris

Prefix

(Customizable)

Total Upvotes

56607

Monthly Upvotes

14138

Server Count

121620 Servers | 80 Shards

Owner(s)

@muted junco
@tiny crag

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

module.exports = class extends Command {
  constructor(client) {
    super({
      name: "database"
    });

    this.client = client;
  }

  async exec(message, args) {
    let embed = new MessageEmbed()
    .setAuthor("Destiny's Datebase")
    .setDescription(`\`\`\`${this.client.db}\`\`\``)
    .setColor(this.client.EMBED_COLOR)
    message.channel.send(embed)
  }
};

help me please

lavish shuttle
#

Why are you trying to send the entire bot DB? And why are you redeclaring client?

#

Anywho, uh, use util's inspect function

lusty dew
#
cog_list = []
for folder in os.listdir(defaultPath):
    newPath = f'{defaultPath}/{folder}'
    tempList = []
    for file in os.listDir(newPath): 
        tempList.append(file)
    cog_list.append(tempList)
if __name__ == '__main__':
    for extensions in cog_list:
        client.load_extension(extensions)
        print('Successfully loaded {0}'.format(extensions))
#

@modest maple you mean something like that?

modest maple
#

Somthing like it yh

#

But you'll need to remember that the cogs list seperates it with a . as it acts like an object

lusty dew
#

okay

modest maple
#

So you'll want to append to the array "cogs.{folder}.{file}"

#

But you might need to remove the .Py at the end of each file

#

But youre along the right lines

lusty dew
#

Hm

#

That is odd

earnest phoenix
#

if you wanna talk code

lusty dew
#

when you print out cog_list it doesn't print out anything

#

Oh wait

#

I see why

#

there is a + in the path

barren moss
#

Hm

#

I'm new to uh code

#

Where can I run a const thing?

#

I'm being dumb enough to use git right?

earnest phoenix
#

const is a declarement of a constant variable, means you cant change it, it just stays how it is

#

1/10 would not recommend

#

the usage is ```js
const someVariableName = "Some value"

#

or numbers if you desire, booleans are possible too

#

just like var and let, just not changeable

cinder dome
#

so I'm new to writing bots and found this line on the discordjs.guide site "By default, up to 3 fields will display inline. If a thumbnail is set, this will change to 2", but when I try to get two inline fields per line I get three even with a thumbnail:
'''const statsEmbed = new Discord.RichEmbed()
.setTitle('Match Info')
.setAuthor('PasteBot', 'https://cdn.discordapp.com/embed/avatars/0.png')
.setThumbnail('https://cdn.discordapp.com/embed/avatars/0.png')
.addField('Oc', '9/0/0', true)
.addField('a','a',true)
.addField('Ben', '0/9/9', true)
.addField('b','b',true)
'''

#

is there any way to get it to restrict it to two a line?

west spoke
#

That's normal, and no you cant

cinder dome
#

so is the line on the website just outdated or something?

west spoke
#

The top is the title.

#

If you removed it, it would show the 2 lines.

earnest phoenix
#
.addField('Ben', '0/9/9', false)
.addField('b','b',true)
``` @cinder dome
west spoke
#

huh?

#

what's this sorcery

earnest phoenix
#

I don't know

#

🤔

#

This is a "test"

#

wait youre not allowed to style the buttons?

#

@earnest phoenix you can

#

okay phew

#

Lol don't worry

#

also do you guys think this looks good

#

Yes you can :)

#

This is good

#

Gn devs

#

gn dany

#

Ty

#

:)

cinder dome
#

still kinda confused, removing the title still puts 3 per line and I would like the third line to still be inline with the fourth so making it not inline doesn't work. I can get it to be two per line by putting a blank field inbetween fields 2 and 3, but that makes an awkward space. I'll go with that if it's not possible to make it limit to 2 per line, but the discordjs.guide page seemed to indicate that adding a thumbnail would restrict it to 2 per line.

#

thanks for the help either way

west raptor
#

@cinder dome it also depends on how big the text is iirc

#

i've experienced the same

cinder dome
#

like the amount of text or the font size?

west raptor
#

the amount of text

#

what you could do

#

is make an empty field

cinder dome
#

yeah, if I can't get it to limit it on it's own that's what I'll go for. It leaves some empty space which I don't particularly like but it's not that bad

west raptor
#

ah

#

didn't see you mention that

#

my bad

cinder dome
#

no worries, thank you

#

I tested with longer strings and now it just looks like my bot is screaming at me

west raptor
#

interesting

#

it might be outdated then

#

I wish users had more power with embeds

abstract crow
#

Merry Christmas Eve to ya guys

sterile minnow
#

Yo too

abstract crow
#

Thanks

#

Oh shit wrong channel

sterile minnow
#

Yeah

#

I just noticed that too yet

plush wren
#

-botinfo @agile fern

gilded plankBOT
#
Bot info
ID

611723981019545622

Username

Ellie

Discriminator

9051

Short Description

Ellie is a bot that has useful commands such as Moderation Commands and Economy Commands, and Verification Commands.

Library

discord.js

Prefix

$

Total Upvotes

15

Monthly Upvotes

3

Server Count

No server count

Owner(s)

@junior aurora

sudden geyser
opaque eagle
#

Why do I get all those question marks next to all the files/folders in NERDTree?

#

nvm im dumb, just had to install a font

lusty dew
#

How do I remove the file exstension of files in python?

#

nevermind

plush wren
#

i love howeverone says something

#

and find it out themself

lusty dew
#

xD

#
for folder in os.listdir(defaultPath):
    newPath = f'{defaultPath}/{folder}'
    tempList = []
    for files in os.listdir(newPath):
        file = os.path.splitext(files)[0]
        tempList.append(file)
    cog_list.append(tempList)
#

Real question is

#

how would I append tempList and folder to cog_list

#

actually

#

if I was to try and load this as an exstension would it error?

#

I think it would but I don't know

slender thistle
#

You load them separately

#

Also why the brackets in cog filename

lusty dew
#

What

slender thistle
#

The []

lusty dew
#

Oh

#

Because it’s an array

slender thistle
#

The ones inside the strings

lusty dew
#

Which ones

#

There’s so many

slender thistle
#

cogs.general.[]' for example

lusty dew
#

Yes