#development
1 messages · Page 1611 of 1
and im guessing some bots will be hit more than others
I can't really tell rn because we just don't know yet but probably a big percentage
im looking at the turks
mind if i dm about it
i have want to have a quick chat about it and dont want to discuss it in public 🙂

like I don't see any vote botting for the top bots in the homepage
but the entire servers homepage is just bots lol
hey I tried this but it says that indexOf() is not a function
I don't think find / sort returns an array
Im just trying to find a document in a sorted collection and return its index
can i edit top gg?
class="StyleProvider__BackgroundGradient-sc-1wukuln-0 dnTrRP
what is this madness
😛
It's dynamically generated from styled-components
gonna change the next time they update anything on the frontend
^ that wont
but this is temporary
xetera said it'd be fixed soon
yeah this does it
div[class^="StyleProvider__BackgroundGradient"] {
background: none;
}```
styled components lol
Hey, is aws ok for discord bots?
it's not the worst
do any of you guys know of a license for a website that will completly prevent people from using my code
then make it closed source
yeah don't open source it if you don't want people to steal it
minify and uglify javascript and css, too
do any of you know how to get the position of a document inside a collection? (MongoDB)
or you can just make the code visible to all and sue every person who uses it 
there's no open-source license that'll prevent usage of the code
since, well, open-souce is open
your website is automatically protected by default because of copyright
that doesn't prevent someone from stealing code
but it gives you the right to sue them
people just inspect my website steal the frontend code and use it to make their own
isn't there any way to prevent that?
nope
well I still have the take-down rights if they use my code to for themselves or if they sell it
yk, it's painfully hard to steal source code that way
because you need all the assets 'n stuff
if you use react to build ur site it's basically impossible
you can't do anything about stealing html structure but you can do your best to obfuscate your js assets
minify + obfuscate
there's a way to obfuscate html as well
the problem is, it deobfuscates when the website is running
if u minify it doesn't
minified codes are unreadable
html can't be obfuscated
there is a way to
no
haha IDE formatting go brr
and any browser prettifies html in inspect element
yeah, I know, but you technically can obfuscate html, it's just that website deobfuscates it in inspect
html is not a lang, so it can't be obfuscated at all
you can make the whole html file a single line
well I got it obfuscated?
but that's all
format
you might be confusing obfuscation with minification
it changes the html to javascript and uses html to decode it into a html
I'd not worry much about html steal tho
like, as I said, without the assets stolen html will be just a bunch of text
what
well yeah, if you're using a framework, the content is most likely generated with js
@pale vessel I'm not sure if it works that way
it doesn't
they put the html in a garbage string and then let the js code degarbage it and render it
browsers only see html
that isn't obfuscation though
I just put my html in to the program and obfuscate it, it returns me a single line of html code with a bit of random strings that is the obfuscated code
it'll still load the whole html client-side
i think the random strings might just be js files with hash names
@lyric mountain yeah that's what I mean
oh, one of those with hex entities?
people can still view it
i've seen those
if the html is available client-side then there's not much u can do
:/ dang
just don't worry about it
regardless if you see your code used elsewhere you can threathen with legal action or submit a DMCA takedown request
@earnest phoenix I'll do that then
not even google worry that much about html steal
@lyric mountain still if you worked on your html code for few days then see someone else use it for themselves, I'd make you kind of mad, wouldn't it
js is where the goodies are so you should just worry about that
html is useless
thanks
you can go a step further and straight up do server side rendering so your client doesn't even get a glimpse of what's happening in the code
I'm not sure how to do that though
p h p bro
lol
you'll have to search for some libs that are capable of SSR
i know that c# has asp.net core's razor pages
i know dank memer uses this for it's help command, is there a way to change the toolbar? i think that's how its called
toolbar?
idk
you mean the tooltip?
@earnest phoenix I see
if(user.roles.cache.has(muterole)) {
return message.channel.send("Given User is already muted")
}
TypeError: Cannot read property 'cache' of undefined
help
you need to check if an user has been mentioned at all
is canva on browser and as npm module same?
yes I guess
okay thx making my own api to bypass ratelimit ^^
well, on browser it's an actual html tag, so you also have tag stuff
ratelimit for what exactly?
There is api where you can provide query and it will generate the canvas
like vacefron.nl and for downtime too
why were you even using an api to generate canvas?
for the welcome image just to test my ui and the user experience
A user object has no roles, you're looking for guildmember
just write canvas code urself smh
it must be api else the user would steal code from the html page :c
doing it rn
dude...look...you do know that if anyone wanted they could literally write a canvas code to match ur template right?
like, it's not nuclear codes nor the next cure for cancer
so how should i change it
can u show me
canvas stuff are really easy to replicate
then help me lol,but hard work it is quite sad if people copy it and claim it forthemself
after my bots files got corrupted I decided to use python instead and it gives me a syntax error on line 8 at the beginning and when I do indent it says unexpected indentation
that's how internet works
if you keep bashing on copy protection you'll go insane
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')
client.run(TOKEN)```
true xD
Fetch the guild member from guild object, use that instead of the user
perfect protection doesn't exist on internet
only with client side
i dont get u xd
all u can do is make their attempts harder
Then you should take a closer look at the documentation
even if u made an api
let guild = client.guilds.cache.get("gid")
guild.members.fetch("userid") or .cache.get("userid")
a code is only 99% safe if it's isolated from world and locked in a vault
there's still 1% chance to be stolen due to physical attempts
true protection is a myth
also, remember that while you're slowing down thiefs you're also slowing down genuine users
wdym with unique users
not unique, read it right
genuine users, those who have actual interest in using ur site/service/whatever
oh that is right.I typed it wrong.btw which bot do you own or have developed?
message.channel.createWebhook(kisi.username, kisi.displayAvatarURL)
.then(webhook => webhook.edit(kisi.username, kisi.displayAvatarURL)
I can't take avatar picture in code, how do I fix it version v12
I can't change your profile picture
shiro
any error?
There is no error, but the picture needs to change.
async def on_ready():
^
SyntaxError: invalid syntax```
cool
whole error pls
show code
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')
client.run(TOKEN)```
idk what it could be, but that code doesn't look right
Did you import asyncio?
No?
Well you should if you want to use async
Ok
What? That isn't really his issue here
no need to import asyncio to use async
i did multuple times
Half of the code yes
half the code is all the code in this case 
i mean i think python would specify indentation error if the issue was indentation
depends
invalid syntax in async def on_ready(): means the line above is falty
most likely because its copied
unindent the line above and reindent
not true
but sure
but the line above shouldnt be indented
In his case
Well thats interesting
or a py version < 3.5
i think the issue is with discord.Client()
is there a way to invoke this without using new? js module.exports = class PresitgeEmbed extends MessageEmbed { constructor () { super() this.setColor(constants.EMBED_COLOR).setFooter(constants.EMBED_FOOTER).setTimestamp() }
Not really
it does yes
well
3.5.3+
because thats when async/await was added
replace "client = discord.Client()" for "client = commands.Bot(commands_prefix=<your prefix>, intents=<your intents>)", dont forget to from discord.ext import commands
see if it works
that wont change anything 
^
that would be the same as just deleting it and re-adding it
i think the error is that the decorator is not right because the client is not right
it is right...
well if u say so
My oh my
told you 

Its gonna be a challenge to update python to 3
pretty sure you wanna be running it with python3
cuz i think your mobile emulator or what ever is running it as you would expect linux to behave with the versions
if its linux
well anything unix
it could be windows
actually its connected to an external device by ssh
then u should do python3 as he said
because It doesnt have screen functionality
what
So my phone is 1 way to connect to the pi
linux servers™️
ye i know i didnt understand what he meant by screen functionality
oh I cant connect to it on the tv since the pi doesnt support hdmi
oh gotcha
Yep
now im waiting for packages to update
then ill update to python 3.6 then 3.7
it should work then right?
after u download python3
all u need to do is execute ur bot code with python3 <your file>.py
Ok
if u want it to keep running even after closing the terminal, use nohup python3 file.py &
it'll work with 3.6 fine
why specifically python3 <name>.py why not python <name>.py?
python3 on linux is the identifier for python 3
Oh ok
python on linux is the python 2 versioning
why does this circle only go to
ctx.beginPath();
ctx.lineWidth = 10;
ctx.strokeStyle = "#0000ff";
ctx.arc(308, 105,55, 0,360, true);
ctx.stroke();
ctx.closePath();
ctx.clip();
lel my head 🤯
oh thx
Geometry goes brrrrrr
do you know a tool where you can measure image size
because you need to use Math.PI * 2
🤨
in px? you can open in any image editing software (even ms paint) and it says
it doesn't take degrees
yeah it takes radians
and can you measure radians?
no
180° = PI radians
radians are degrees on steroids
pointless ha
(no pun intended)
i mean you can rotate a full circle if it has multiple colors on it or something
can always rely on #development to lower brain cells one way or another
indeed
that's just a method to draw an arc
you ever notice how in practically every other language types a integer as either int or integer and JS just went with "nah lets just use number because we know all the kids are gonna need the basic words with their discord bots"
fr tho
it's cause there isn't a separate type for floats and ints
i was so confused when i started using typescript just because of number
so calling it int would be a lie, cause it can also be a floating point
it's cause there isn't a separate type for floats and ints
in JS all numbers are 32bit floating points
Actually in TS there could technically be a float and int types...
even if they're not real
File "bot.py", line 4, in <module>
import discord
ModuleNotFoundError: No module named 'discord'```
-_-
did u install it?
presumably you need to install discord.py
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-3k3rvhdj/multidict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-c87r74_h/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-3k3rvhdj/multidict/
and when i go to install discord.py
I think i done the command wrong
Hey Evie you here
nanopineo:~:% python3 bot.py <master ✗> Traceback (most recent call last):
File "bot.py", line 4, in <module>
import discord
ModuleNotFoundError: No module named 'discord'``` It wont install discord.py
There was a talk about taking templates for sites earlier, does this look good, I'm afraid I'm making it look template-y
idk why
so
I don't even know what you're trying there
just use pip
i'm trying to list all of the members in one role, but it always returns empty
Trying to install discord.py
ive used pip pip3 python3
same error
yellow text stands out a bit
Is that good?
also looks quite flat
is it equal Since the code is
ctx.beginPath();
ctx.lineWidth = 4;
ctx.strokeStyle = "#ffffff";
ctx.arc(200,70,46, 0,Math.PI * 2, true);
ctx.stroke();
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage("avatar");
ctx.drawImage(avatar,200-50,70-50,100,100);
and that does not make any sense if i -50 and ot -46
Add some pizaz
well, not with the solarized bg color
I know I added pizazz to my websites menus
Well I've only added the header and footer so far, there's going to be stuff in the body
maybe with the black-ish color
add some css to make the menus stand out
like a box function
yeah but, like, both yellow and purple colors are somewhat...eye straining
also sometimes red
watching in your sleep as well?
👀
hmmm maybe less yellow?
don't hardcode coordinates if ur trying to center it
Does anyone know how i can list all of the members in a role
don't like the yellow, and you need a bit more contrast on the elements (darken bars, or lighten the main area)
Cus i've tried a few ways, they all return empty
yellow is often an incredibly hard colour to make work
i want the same xD else i will cry 😭
high contrast with dark colours + high mixing with lighter colours
try some pastel yellow
what do you guys think of this layout and color use?
that fucking wave again
ton of yellow
always that same damn wave
where da fuck you seein da wave?
pretty hard to read
cool but that bg image makes it look template-ish
everyone and that damn wave
also very obviously copied from somewhere
@ornate otter
I did it by getting the role id then using map()
or atleast it looks like your bog standard copy page
I'll try and If I can't get it to work I can just come up I'll just come up with a new theme
looks noice ❤️
Chip's site colour scheme still annoys me a bit
people seem to like it but man it pissed me off
yikes forgot to remove the footer msg
cant find a good alternative though 
btw, I vote for "remove hyperlink underlines"
can you show me an example of the code
ye one moment
must one day re-do this front page
discord cdn dying yay
or my client is atleast

@umbral zealot some more noodle waves.
The final theme... I don't know what I was doing with this one, I got it from the color palette generator
way to hard to read
oh god
that's awful
very harsh on the eyes
my eyes. they bleed
what the actual hell
the colors are uhhmm... challenging.
Serious question: are you color blind?
thought so, lol
looks like a cross between bubblegum and pasta
dark theme bro
still that fucking wave 
smooth
Which bot came up with it? Rhythm, yeah?
is the maker of rhytm also in this server?
probably
everyone using senoidal wave
imma use cosenoidal wave
ahh, really hot.
i try avoid waves in places
they can add depth to some things
but in other cases make it much harder to fit things together
@quartz kindle need a bit of a help
but what about me 
does js has a nice way to throw a nasty crash to exit process?
just call a system exit no?
process.exit
i wanna crash node with non 0 exit
just shut your own process down
checking for env's, and they are needed to run
planning on crashing node with a custom error
you can specify the code
process.exit([exitcode])
Ends the process with the specified code. If omitted, exit uses the 'success' code 0.
To exit with a 'failure' code:
process.exit(1);
The shell that executed node should see the exit code as 1.
yeah throw it before you call process.exit
dont think i'll need trace, i just need a typeerror
since its checking for env's before running
better yellow?
maybe make the navigation font color white?
add depth, diffrent font and text sizes, better highlights, move the nagivation sections left or right to better add the usability aspect
soft gradients + generate a nice palette with this tool https://material.io/resources/color/
most people expect nav buttons to either to the left or the right not dead center
how do i make the logos frame circle?
or just remove the drop shadow
Thanks everyone
yeah border radius
soft gradients are really gonna make stuff more lively
i can use border gradients 50
Failed building wheel for multidict, Failed building wheel for yarl
How do i fix these?
thats when I try to install discord.py
wut
what's the full stacktrace
feud answered lul
i keep scratching it thinking its something on my screen but its not lmao
Could it be an issue with the color theme?
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-725exiyt/multidict/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-fnulzue5/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-725exiyt/multidict/
code:
@keyframes float { 0% { box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6); transform: translatey(0px); } 50% { box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2); transform: translatey(-30px); } 100% { box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6); transform: translatey(0px); } } .entity-header__image { box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6); transform: translatey(0px); animation: float 4s ease-in-out infinite; }
do you see the box in the logo? how do i make that circle?
that's not the full stacktrace
Idk what stacktrace is
switched to a white theme, this happened
are you using posh
if someone could help me pls @ me
posh?
i was talking to tim
oh sorry
posh fucks with ps output so that could be a thing
idk what posh is
but i fixed it by disabling canvas rendering
"terminal.integrated.rendererType": "dom"
made fonts a bit bigger tho
With a motor
(also didn't realize this was #development , oof)
A notice:
Google Feud is to notable to get the Notable Member role 😓
I feel its kinda hard to get notable member in #development
hmmm need help again
Why does notable member really matter much?
dotenv converting numbers to string somehow
any way to avoid that?
also arrays
fucking up anything that isnt string
ngl, I didnt know env could hold anything other than string.
thats going to be a bitch if it cant
afaik property files are string=string stuff
yup strings only
That's the main reason I use json files
what for eroor is this
cannot believe how shitty this dotenv thing is
imagine not parsing types
fuck my life
I mean.. how is it supposed to know what's a string and what's a number
Well then it would break the .env format
well technically it doesn't
json is a notation
you can put anything inside
the language parsing it decides what is what
what's the regex for empty lines?
something like /(\n\r?){2}/ i guess
it would depend on the OS wouldnt it?
windows returns are different than Linux.
only for reading files
yeah
that's why i'm including \r?
oh yeah i didnt see ?
kekw
Error: EBUSY: resource busy or locked, open 'C:\Users\igoro\OneDrive\Bureaublad\DezorBot\node_modules\mongodb\lib\core\a
uth\auth_provider.js'
←[90m at Object.openSync (fs.js:476:3)←[39m
←[90m at Object.readFileSync (fs.js:377:35)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1090:18)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:952:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:88:18)←[39m
at Object.<anonymous> (C:\Users\igoro\OneDrive\Bureaublad\DezorBot\node_modules\←[4mmongodb←[24m\lib\core\auth\mongo
cr.js:4:22)
←[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m {
errno: ←[33m-4082←[39m,
syscall: ←[32m'open'←[39m,
code: ←[32m'EBUSY'←[39m,
path: ←[32m'C:\\Users\\igoro\\OneDrive\\Bureaublad\\DezorBot\\node_modules\\mongodb\\lib\\core\\auth\\auth_provider.js
'←[39m
}``` what t fak is this?
you're trying to read a file that is currently being read by another process
?
tldr you either interrupted npm while it was installing a package or you're trying to run your project while a package is being installed
tldr of the tldr you did something you weren't supposed to do
I need a tldr of the tldr of the tldr /s
C:\Users\igoro\OneDrive\Bureaublad\DezorBot>node ticket.js
MongoDB is Ready
Server started
(node:8712) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Online
(node:8712) DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next
major version.
h
ty
no problem dude
Anyone one know a good app to code in python?
do you mean an editor/IDE or like an actual app to make
An editor
Pycharm or VSC are two good ones
can somebody tell me which font gets used here
uni sans
it's a paid font
that developer of the bot probably downloaded it illegally
considering how ugly the design is
lmfao
you probably shouldn't, but not like anyone would know if you did
:O
i'm pretty sure uni sans is the discord font right?
yup
o
i only use google fonts
are there any similar
it isn't discord's font per se
they just bought the license to use it for their branding
yeah
which the licenses seem super cheap
atm I have this it is really ugly
When it comes to bold, strong, high-quality typefaces, you certainly can't go wrong with Uni Sans. With 7 different weights in 2 styles (both upright and italics), this bold family is the perfect choice for a headline typeface. The Uni Sans font family normally sells for $179, but today is the LAST DAY that you can get all 14 fonts for just $19!...
question:
"["a"]"
any decent way to turn that or "["a", "cbd"]"
into an array?
most free fonts are not for commercial use
trim off the beginning characters, split by , ?
@misty sigil shouldn't it be sco'ish q'ie?
there no , to be split
just be aware you will not be allowed to make a profit more than likely while using a free font, so no premium features.
this only for my bot xD
so it'll return a string still
it's going to be the only element in the array, no?
there are good free fonts
sure, but they are typically licensed to be private use only 👀
json.parse
or that
just make sure to know what your agreeing to using a free font
i keep forgetting js has first level support for json

lel
just write your own parser
lmao i forgot about it too

in .js - v12.5.1
I am trying to remove the category Developer if the author doesnt have my id
let category = await client.commands.map(x => x.category);
``` - What to do here ...
context please
Help command
For my help command I am trying to remove the commends under the Developer category
filter if its not you to not include Developer category
let category;
if(message.author.id !== config.owner) {
let category_s = await client.commands.map(x => x.category);
category = category_s.filter(category_s => category_s !== `Developer`)
}
something like this?
internal sharding only creates multiple connections to the discord API so different internal shards can access the same local variables right?
ex. if var number = 1 is run on one internal shard, would other shards also get 1 from evaluating number
or does this only apply to the caches
sc.send("hi, ive been recently rewriten, if you like me please concider voting for me!", embed)``` sc is a channel object, why am i only getting the text not the embed
(the embed is properly set up
the error if i just send the string:
(node:1548) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
tru i suck at spelling
oka
if it doesn't work then Idk
np
idfk how tho lmao
i just had a thought
i think the bot im working on has a slightly newer d.js version
@copper cradle
mayb thats what went wrong
I have a question regarding publishing a bot
I made a bot that solely depends on NSFW commands
Is there any way to have it in the site, without including any type of nsfw media on the submission?
we do not accept bots which are nsfw only
@solemn latch has your pfp always been a gif?
i mean it has been, i just didnt have nitro for awhile
My bot just inspries peoole as time goes on it will be changed
Hello, can someone help me with discord-image-generation? specifically slap with two user tags [https://www.npmjs.com/package/discord-image-generation]
I've had this problem months ago, anyone here knows the solution to this error?
occurs when upgrading to v12
Hmm, the error would imply try {...} catch {...} is invalid syntax and expects try {...} catch (...) {...}, but that syntax was supported in Node v12.
const indexFile = require("../../index.js")
let pool = indexFile.dbClient;
I was told that requiring index file in other files isn't needed, and it would give an error when I do node index.js. It does give an error, so how am I supposed to use dbClient which I am exporting from index.js?
you never need to require index
?
yeah, I got it now I am just unsure how to use dbClient
it's not like i can just say dbClient and it would magically work right i didn't try but that shouldn't work so how do I do this?
so what now 
try{
}catch(error){
}
I am not good at this but maybe try this
It comes from a dependency so that's not the right approach.
yoo, how can i make my react app into a custom url
like i want localhost:3000 to be mywebsite.com
purchase a domain
i did
KuuHaKu you didn't fill me with all the information, if you know more Ill appreciate if you can tell me
oh
or just pass that object whenever you change files
like, in a function
but since db access will be global, use a middleman
Okay, thank you
no. its .xyz
Get a VPS with a web server on it and tie your domain to the IP of your vps
vercel has good react/nextjs hosting
https://vercel.com/pricing
how to do it on cloudflare?
There's definitely a tutorial out there somewhere. It's gonna be hard to tell you each step in a discord chat
ok thanks! Also, If You Ever Find A Video Please DM ME It. But, You Don't Have To Look. Im Just Saying If You Come Across One Please Send Me The Link. Thanks
then set it where u purchased it
you still need a vps to run the site
or host it locally and risk uptime
im testing it by hosting it locally
You can't test the domain locally, at least not easily
For cloudflare stuff, just search "how to setup cloudflare for domain"
I followed a medium tutorial iirc
oh no i did it alr
just set the nameservers to:
audrey.ns.cloudflare.com
i think
I just would like a moment of your time to tell each person who uses ENV:
HOW?
HOW CAN SOMEONE USE THIS CRAP?!
need strings? we got you
need numbers? FUCK YOU
need bools? FUCK YOU
need arrays? FUCK YOU
HOLY how do people use this shit for entire projects? i had to make my own parser for this crap wtf
Number(thing)
thing === 'true'
thing.split(', or whatever separation you want')
how hard is that
what
i either wrote a parser or added literally all that everywhere
how many variables are you using though?
Number(thing)
thing === 'true'
thing.split(', or whatever separation you want')
this adds logic, a couple is fine, its still increasing code unecessarily
but in my case i got a couple hundread times
imagine adding that literally every single time you call an env
and no even that, theres no types for it
cuz god forsake people from adding types to process.env
this shit is infuriating to work with
casting AND parsing it EVERY FUCKING TIME
// env.ts
const { VAR_ONE, SECRET_NUMBER, SOME_LIST } = process.env;
export const varOne = VAR_ONE;
export const secretNumber = Number(SECRET_NUMBER);
export const someList = SOME_LIST.split(',');
now you don't have to parse the variables every time you use them
you do
cuz env only accepts string
everytime you need to call a variable you need to cast it
EVERY
FUCKING TIME
well k
so why not cast config.shards where you declared it?
or is it something else
from process.env
const config = process.env?
correct
o
client = commands.Bot(command_prefix='!', case_insensitive= False, Help_command = False)
client.remove_command(help)```
ohhh
Case insensitive isn't for that
It's for commands
And it's help_command no caps
I think
Lol
fuck you god you betrayed me tho i dont believe in you
Make a function for that dude
?
oooh i have left over dominos
Like, generics
Pizza = noob food
fuck that
made my own parser
fuck the rest
make a generic function that casts the type
@opal plank i found a lizard and named it after you
ez
ty o kind sire
lmao
Some frogs I found are called carlos
function getEnv<T = string>(name: string) {
return (process.env[name] as unknown) as T;
}
And the crabs are Gilbert
if they are even remotely related to me, make sure to lock them, those fuckers will have some insanely high ability to destroy shit just by staring at it
The lizard?
I found them outside
lizardS
funfact, i was coding and a gecko fell on my keyboard
like, those house geckos you find around
this is the correct format for embeds right? ```py
@commands.command
async def prefix(ctx, embed):
await ctx.send(
embed=discord.embeds(
color=discord.Colour(0xff0000),
title="This servers prefix is:",
decription=f"{prefix}"
))
Atlantis
gave me one hell of a scare
understandable
anyhow, back to coding
Commands.command()
ahh ok ty
it should be defined already no?
They both work
Also, why u passing embed?
And if it's a cog u need self?
And if not, you use client.command
Without ()
im confused as fuck mostly because im tired
cog
U need self?
Send cog code as In imports and class
embed = discord.Embed(title="A cool title", colour=discord.Colour.from_rgb(0, 0, 255), description="This is an embed")
await ctx.send(embed=embed)
And @commands.command() is correct
ahh ok so i did get this a little wrong then?
Mostly just replace discord.embeds with discord.Embed
And yeah, if it's in a Cog class you should have self as the first parameter in the method
\https://discordpy.readthedocs.io/en/latest/api.html#embed
Here's a little more info on embeds if you're interested
cheers
helps alot
so i wanted to test out a event to here the bot sends a message on the join and got this?
not too sure what that means?
requires code grant
that means the dev turned on an option that requires a code grant
huh i mustve done that by mistake
yeah
is a animated status on a Discord bot considered "API Abuse" ?
probably
Ive heard many mixed things
it should only update 4 times every 20 second
gg
i mustve switched it on when toggling intents
Does anybody have a decently large bot? I have a few questions that i would like to ask.
Whats the word for keeping a int between two numbers?
ie if the number is outside
0 and 1 and the number is set to 5.6 its set to 1.
clamp 👀
brainfarts are fun
using ejs, if I am passing a value through a option tag in a select tag and I pass the object will that work 
-bots 184632227894657025
@visual ginkgo
my b
Squeeze 
What kind of question, and how much u define a "big enough" bot?
I was wondering how much bandwidth and ram a bot that is in 3000+ servers takes up
specifically a discord.js bot
A lot then
oof
If u don't manage the cache properly
could be 500mb-2gb, depending on what you cache
could be more if you just cache everything
ok
Bandwidth is quite negligible
Data exchange is waaaaay too small for real-time stuff
if you dont use precense intent and dont have any images being uploaded it wont be a concern
I plan on adding music to my bot and i dont know how much that would take
Music is one hell of a niche feature
yeah
Mainly because youtube hates your bot, you, your ip, your requests, etc
that sucks
most music bots in a few thousand servers probably wont use much bandwidth I wouldn't think, yeah the main concern is ip bans
is their any way to get around that?
buying an ip block
And a ton of ip rotation
Then theres the issue that discord is not made for music streaming
like to have them not ban me
So it's badly optimized for it
agreed
its against their tos, so no?
well, streaming without going through one of their validated services is against their tos(like music bots)
what would be one of their validated servces be
YouTube
youtube.com, youtube app
ok good
No, not good
That means only youtube can use it
Only youtube is allowed to stream YouTube stuff
how does groovy work then
You can, theoretically download all the music files and stream from ur own storage
but discord verified it
But then you'd be breaking not only the tos but the law
discord doesnt care unless they get sued
nice
would streaming from youtube be a lot of bandwidth tho
since it is only audio
^^^
Not at all, the issue is latency
nice
With most vps bandwidth wouldn't be a concern
like a 1tb bandwidth would be good?
Why have limited bandwidth?
Digital Ocean is overpriced af
really?
i mean 1tb should be fine for just starting
i wouldnt expect you to be at a large number of servers before that $100 runs out
That's expensive
its okay considering they charge hourly
when you use it like its hourly its pretty decent imo
buying for a bot host its bad
But since bots will be 24/7 it's really not worth it
oh
It'd be good for like, remote processing
^
Short-lived tasks
ok, i undertand
I really want to setup a rendering platform on DO
just throw it up when I want to render
👀
just for fun
i just have a github stident developer account so i get discounts for some things
anyone knows any guide on react with discord auth ?
react is just the frontend
use express
Search for node auth
including express
I knio
you can just use any react guide
#discordjs #discorddashboard #oauth2
Discord OAuth2 Dashboard setting up with Express.
Want to support me and the channel? Donations are not required but greatly appreciated!
Become a Patreon: http://patreon.com/stuyy
Buy me a Coffee: http://ko-fi.com/anson
Streamlabs: https://streamlabs.com/ansondevacademy/tip
Discord Server: http://discord...
that will tell you
lifesaver
Btw, one tip from someone who spent many hours regarding real time connection with backend:
Use websocket
Dashboard stuff
bake some cookies and
oh
I just use graphql endpoint
Like, if you really want to modify ur bot settings realtime then u need websockets
how about a save button like the one discord uses
mine is almost realime
my old dashboard had a save button that sent the api call
same
it worked pretty good
yeah, save buttons are still kinda standard
pretty much every large and small platform uses them
oh and one of those "u sure u wanna leave the page?" messages
lol
Yeah, like, with websockets you'd also use a save button
The advantage is preventing lost data or miscommunication between layers
my bot interacts with the dashboard with mongodb and graphql
look later in the series
I already know express ejs and have made it
it explains a lot of it
ok
you should probably expose stuff in the api
illl just see the repo
so that the react app can fetch the data
Use post btw
who do yall reccommend for hosting then?
Get is bad
galaxygate 
Contabo
apparently there was a time when everything was made with POST
oversellers
ew
It was kinda fixed from some time to now
Never had st issues again
contabo acutally looks pretty good
They recently bootstrapped their site
ew
they always have been sketchy imo
i am going to have to look at a few options
then again galaxygate recently has been having some issues with their css https://woo.pics/images/368f242962.png



