#development
1 messages ยท Page 1709 of 1
No top bun?
there is precompiled binaries in discord py's bin folder for some reason
maybe it can help?
how can i code the bot send a message to a specific channel when someone votes my bot?
language?
You'll want to use the api to receive a webhook, and then send a message like normal for your library.
what is the best way to set up a reminder system for my bot in d.js? would I just use a setInterval for 1 minute and loop through an array of reminder objects to check if date has passed?
for my purposes anywhere in the 10 min ballpark works, so ill go with that ๐
if you want more exact reminders, create an interval that creates timeouts
ohh that is smart
might end up doing that, thx!
loop through the array, if the date is less than 1 minute from now, create a timeout with the remaining time
right
One message removed from a suspended account.
One message removed from a suspended account.
timeouts do be cringe
agreed
function TimeoutPog(fn: fn<any>, time:number) {
let now = Date.now();
while(now + time > Date.now()) {
fn();
}
}```
This is for the big bois
@crimson vapor @quartz kindle
dont try that, it'll run that function a fucking gazillion times
didnt me and tim build a timeout thing?
wat
actually it was a highFlex with a setInterval

million said setTImeout is cringe, so i amde that instead
now you can be not only ON time, but before time too
never late
watยฒ
this
so instead of being late, you make me work a gazillion times?
i quit
:^)
imagine if programs became sentient and could modify themselves on the fly
how long until they add process.exit()
on a dev from here? about a minute
while (true) process.exit()```
i rather do a much better way
you have to make sure to exit the exit
import {exec} from 'child_process';
exec(`SIGKILL ${process.pid}`);
wink wink
can you evet get your own process's PID from there?
perhaps?
import { execSync } from 'child_process';
while (true) execSync(`echo ${execSync(`SIGKILL ${process.pid}`).toString()}`);```
there we go
much better
it's inside a template literal already
you are wrong

you are so wrong
bad code doesnt beat purposefully bad code
we can come up with shitter designs than someone without experience would
we are good at creating bad code
have you seen my bot?
thats definition of purposefully poorly coded bot
i have bot repos that would put that shit to shame
most people here are notorious for purposefully bad code
tim for example used to eval code on a daily basis

i would like a button in github to report a repo to their local authorities please
removed the link
like
you think your code is bad
at least you KNOW whats bad about it
serverid.bal
It cannont find what it is but on normal check like db.has(โ293829.balโ) it return true
Anyone can help me with this?
yummy source code
i want that it needs a whitespace before //
give an example where it shouldn't match
that shouldn't match?
or text//comment
yes
so, like, text// comment should match
nope it needs a whitespace before it
so it trigger only if there is a space before //
like
text //comment yes
text //commentno
text//commentno
text //commentyes
text// commentno since no whitespace before
comments of code
no comment can be anything

you don't get it still
sorry
capture group = what to return, not what to match
what is your expected output?
or is it just a boolean
i just replace them with ""
them who?
string.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,'')
yes
is this what you want to retrieve?
circled in red
return ONLY comment
without //
nor space
works now i need it with /*.I wil try to do it myself
||\/\*(\n|.)+\*\/|| if you don't find it yourself
is it combined with the first or seperate?
separate
:C
comments cant be combined
you can do this to get both:
\/\*(\n|.)+\*\/|\s+\/\/.+
also, you surrender way too fast
uh you are the best ๐ค
yes. 2fa is part of mfa which is "multi-factor authentication"
ah alright
also what does
flags: 256,
stand for
and is it supposed to be different for everyone
bc i have a different flag
anyone want to give me some feedback on my slash commands functions in my lib?
๐
its taken me so long to do because i thought i had a bug
turned out that i had a second instance of my bot running elsewhere, that was eating interaction_create messages and invalidating interaction ids
EventEmitter or EventEmitterOptions?
EventEmitterOptions
How do you do
name = "Zeli"
print(f"Hello {name}!")
In C#?
string name = "Zeli";
Console.WriteLine("Hello " + name);
so basically f-strings
pog thanks
waits extremely patiently
$trings
hi
ahahaha very funny xD
experimental binary serializer
using System;
namespace GettingStarted
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter your name: ");
string name = Console.ReadLine();
if ( name == "Zeli")
{
Console.WriteLine("Welcome Zeliktric");
}
else
{
Console.WriteLine("YOUR NOT ZELIKTRIC!");
}
}
}
}
am pro
#development message
bump
im getting annoyed with this.. i cant win first it denied message.member.hasPermission("ADMINISTRATOR")
for a hasPermission error now i cant even have it role based
err
let allowedRole = message.guild.roles.cache.find(r => r.name === "Crystal Bot Permissions")
^
TypeError: Cannot read property 'roles' of undefined
code
exports.run = (message, args) => {
let allowedRole = message.guild.roles.cache.find(r => r.name === "Crystal Bot Permissions")
if (message.member.roles.has(allowedRole.id)) {
return message.channel.send(
"Sorry But You Have Been `Rejected` From This Command"
);
}
message.channel.delete()
}
Your message parameter is probably not a real message instance, try logging it
And use <GuildMember>.permissions.has() because <GuildMember>.hasPermission() is gonna be removed in v13
gotta love people straight up ignoring me ๐ฎ
how would i log the message? the last time i tried loggin a message i got everything about the guild but nothing about the message
const userResult = await fetch('https://discord.com/api/users/@me', {
headers: {
authorization: `${oauthData.token_type} ${oauthData.access_token}`,
},
});
user = await userResult.json```
how do i print the user's username
from this
oauth

ill give u a hint, console log user
anyways
how can I extend an interface in a .d.ts file, obviously when I use import { EventEmitterOptions } from "events" it thinks of it as a module, so what would be a workaround.
https://i.callumdev.pw/j53me.png
https://i.callumdev.pw/yuia7.png
i already did
also idk ts so sorry
and it showed...?
user.username
when i do console.log(message) It logs the guild info? but not message param
undefined
do console.log(message.channel?.type || "not a msg") and lmk the result
ok, so as I asked before, what does console.log(user) give
infact
what fetch library are you using?
axios/node-fetch?
it said the not a msg part
{
id: '293060399106883584',
username: 'samm',
avatar: 'a_2cbcb6c17ca217d968553fe36deee9d6',
discriminator: '0021',
public_flags: 640,
flags: 640,
locale: 'en-US',
mfa_enabled: true,
premium_type: 1
}
ok, try adding a 3rd param called client, and put it before message, args, then try again!
ima assume you didnt run the .json as a function?
or..?
ofc the client kick it in the balls, it said txt on the console no errors, looked on my phone and it deleted the channel
what
it returned text
well, of course it will delete the channel, if you have message.channel.delete()
i forgot .json() 
and del'd the channel
ok, so its fixed now
yas
great!
I thought so ๐
#development message
NOW, my issue, for anyone to help with ๐
lets hope I don't get ignored again
for a discord bot, if we're on a team, does everyone need to verify or only the team leader
for bot verification
leader
team
so is it optional or required for all devs on team to verify
only leader
and devs can verify optionally?
when(if) bot is verified, everyone on team gets the badge
no
yes
rip
do you have node typings installed?
huh why is my bot not loading its been saying that for a while and not truning my bot online
this is what I got
I need the EventEmitterOptions type to be imported into the .d.ts file, and extended into one of my interfaces
you dont need to import it
did you do client.login('token')
just create an interface for EventEmitterOptions and it should automatically merge with the existing one with the same name
Can someone help
what would I stick inside the interface?
i did client.login('process.env.TOKEN)
its not auto merged, as far as I am aware
did you add the token to the .env
npm rebuild
where are you hosting? install build tools and reinstall the module
this s where .env is located
Ok
is*
ohh ik my issue it i misstyped something
What it will make worse when I'm finishing Installing the packages it will send me a err
thats a permissions error, run it as root
How?
are you hosting on your phone?
Yea I use termux
Bruh
what modules are you trying to install? why do you need babel?
to jump back to this, cause my issue got lost again ๐ฆ
What would I stick inside the interface, if anything, and I do not believe it auto merged, could be wrong? Still gives the same error
yeah that's the new.env and i have no clue if i should keep the same code or no
you just put token as the key and the token itself as thevalue
Key: token
Value: Your_bot_token
this is what worked for me on djsl ```ts
import * as Discord from "discord.js"
export * from "discord.js"
export class Client extends Discord.Client {
public sweepUsers(lifetime?: number): void;
public sweepChannels(lifetime?: number): void;
}
declare module "discord.js-light" {
interface ClientOptions {
cacheChannels?:boolean
cacheGuilds?:boolean
cachePresences?:boolean
cacheRoles?:boolean
cacheOverwrites?:boolean
cacheEmojis?:boolean
cacheMembers?:boolean
disabledEvents?: Array<string>
}
}
try that in your .d.ts file
anytime I import anything, it instantly treats the file as a module instead of the declarations file
use import *
I do.
show your code
youre not using import *
I tried that too
one thing is idk if i should keep the client.login(proess.env.Discord_token or if i should do something diffrent
import * as Events from "events"
export * from "events"
declare module "mymodule" {
interface ClientOptions extends Events.EventEmitterOptions {
mongo_uri: string;
}
}
right, doing exactly that code now, still same issue (second screenshot)
process.env.token
is this a module you are importing?
do you do import mymodule in your code?
or are you using ClientOptions directly?
finally the repl desied to load
Actually ye, I am just using it directly, I don't want to have to import the types, hence why I am doing this in the first place
if you're using it directly, dont use a .d.ts file
create the declarations in your normal ts files
idk how to c++
trying to follow this: http://www.cplusplus.com/forum/beginner/4639/
can someone tell me what my stupid is?
okay i put a ; and its better error but still dk
oh i set it to void but im saying its gonna give an int mayb?
nope
apparently eventemitter doesnt even have EventEmitterOptions type? am goin mad here ๐
alright i got it. i had to match up the function exactly ๐
can you tell im coming straight from js?
it does
well, not according to typescript right now, I don't have a clue why this aint working
yeah its not exported
just create your own interface
interface ClientOptions {
a: string;
b: string;
captureRejections?: boolean;
}
c++ is much lower level so yeah the syntax can be very specific
yea but i guess the nice thing about that is that you have very little limits on what you can do.
but yea static typing is hard for me ๐ฉ
i mean
all languages have roughly the same limits
theres nothing you can do in c++ that you cant in node.js for example
except maybe code that runs on specific machines
why are you reading a forum thread that's over 10 years old
like OS-level or integrated ciruits
cpp syntax evolved by a mile since then
you cant read random shit from memory with js 
id like to see that happen lmfao
sure
what? lol
also uhhh idk how to line in with js
js is fine for applicatoins
build a browser with js 
See the thing is it depends what you actually mean by "application"
๐คฆโโ๏ธ
js is great for cross platform apps, especially because of how easy it is to build interfaces using html and css
no no really. You say "browser" as if it's a damn trap question but that's one of the only things JS can't actually do
yea im specifying something that doesnt need a runtime, eg an executable
js isnt an executable
of course c++ is more powerful, uses 10x less memory, but you need to build it differently for each machine, and it has no built-in user interface capabilities
You can compile JS down to an exe though
thats what im trying to say
Did you know, right now, at this exact moment in time, you were using an application made fully in JS? LOL
does it look like i give a fuck about anything you say rn?
evie is a node fanatic ๐คทโโ๏ธ node just isn't as powerful, but js is great for apps that heavily rely on ui (chromium -> electron), not for anything else though
performance is shit
Ah well, aight then, understandable, have a nice day, gg
yes what im trying to say
ty for that
what is your app gonna do?
inb4 chat app 
Tim, how much are you paid to write shit apps in a language with "shit performance" exactly? Cuz for me it's $78k/year, $CND
$0 :(
d'awww that sucks. no contracts at the moment?
I wouldn't think that. I used to just write bots and look at me now.
something 
"something"
im gonna keep it secret cuz imma get reamed if i share it in this server
Oh it's a thing that breaks a ToS somewhere. Gotcha, can't perform in video games so you gotta cheat you way to the top, eh? 
nah it doesnt effect anything else 
i dont know if i want an actual job, i like open sourcing and also have tons of personal projects to work on
I mean at one point, you gotta feed the family and pay for rent amirite?
at one point I'll be looking for JS devs for a startup. I'll keep you in mind ๐
if only i stopped procrastinating
<3
I know you're on a competence level that's similar to my own, so, like, don't put yourself down man. Hell, discord.js-light is already a project that you've done, give yourself some more credit!
So Say We Allโข
every time money is put on the equation i dont wanna do it anymore, too much pressure
that's why I work for a consulting firm. I let my boss deal with budget and I just collect my paycheck after doing the work I love
Start a youtube channel! ๐
idk if i have the energy to maintain it xd
I did for a couple years, got my 1.6k subs still sitting there, not growing.
ยฏ_(ใ)_/ยฏ
nice
dont you have to release new videos every week to get monetized?
yeah, and I was doing that back when I was active. discord.js tutorials and such
can someone pls explain what this is trying to say
type mismatch
show your code
im using cpp _probabilityFunctions[choice - 1] (results, amount, limit); to call cpp probabilityProcessor _probabilityFunctions [1] = {strictProbability}; witch contains ```cpp
int strictProbability (int results, int amount, int limit) {
int s = 0;
for (int i = 0; i < amount; i++) {
if (){
/* code */
}
}
}```(the function isnt done yet)
looks like you're trying to run ts directly in node.
imma add more thats why i have an array
you need to transpile it to your dist folder
uh, trying encapsulating the array indexer in its own parenthesis
oh wait no I'm wrong that is definitely in the dist folder, nevermind.
that error is related to one of their deps
not their fault
oh wait
is that their own package
i am confusion
What I'm confused about is why someone would try to import their index file
its the line to call it that is having the mentioned issue
you didn't read the link i sent you
i didnt get a link?
^
do you have esModuleInterop:true in your tsconfig?
mhmm
ohhh i see @vivid fulcrum
sorry about that
im self taught in most of what little ik
it's fineee
just don't look on archaic forum threads
ms docs contain a huge majority of useful information
ohhhhh i figured out my issue
is your "main" in your package.json pointing to index.js or index.ts?
i was putting an array of int into an int variable
aaaaaaaaaaaaaaaaaaaaa its not working
ah oops, had it going to the main, my bad ๐
This is nice though, happy I got it working
https://i.callumdev.pw/0z4iv.png
thanks for the help, yet again ๐
@vivid fulcrum the main issue i seem to have (ill look, im just trying to keep you in the loop) is that i cant pass in an array to a function?
wym
stack overflow moment:
https://stackoverflow.com/questions/7454990/why-cant-we-pass-arrays-to-function-by-value
modern c++ allows unsized arrays as parameters, no?
code: ```JS
if(!result[0]) {
realCount = 0,
leaves = 0,
fakes = 0,
bonus = 0;
let bonusFinal = bonus + count;
options.database.query(`INSERT INTO invites (guild_id, user_id, realCount, leaves, fakes, bonus) VALUES ('${message.guild.id}', '${member.id}', '${realCount}', '${leaves}', '${fakes}', ${bonusFinal})`, function(err, result) {
if(err) throw err;
return message.channel.send(options.emojis.yes + " Successfully added **"+count+"** invites to **"+member.username+"**");
});```
I want 0 + count but my bot set 0count
this seems hopeful?
how can i do please
that code is sql injection heaven
count would be a string, so Number(count)
ay back off i already have a bot that does that ||jkjk competition is good||
lol
mine is off of top.gg tho cuz im in limbo with my discord account
if discord wont let me appeal my old account i dont wanna be a "clone" of my own bot
ehhhh fuck you c++
ohh std::array
okay
(node:14008) Warning: Accessing non-existent property 'instance' of module exports inside circular dependency any idea?
show code
you have a circular dependency
beta.js extends client
you proably messed up orders but idk
Don't import your index from other files
var instance;
static get instance() {
return instance
}```
thats what im using inside beta.js
instance = this; //eslint-disable-line
global.Promise = require('bluebird')
const config = require('../Structures/config');
const logger = require('../utilitys/logger')
const CommandCollection = require('../Collections/Commands');
const GuildCollection = require('../Collections/Guilds');
const ModuleCollection = require('../Collections/Modules')
const PermissionsManager = require('./PermissionsManager');
const Collection = require('../Structures/Base/Collection')
const EventManager = require('./EventManager');
const Loaders = require('../Loaders')
const util = require('util')
const { Client } = require('discord.js');```
what file is this?
beta.js
and the other file?
const logger = requireReload(require)('../../utilitys/logger');
const utils = requireReload(require)('../../utilitys');
const Resolver = requireReload(require)('../../utilitys/Resolver');
const FailureEmbed = requireReload(require)('../Base/FailureEmbed')
const config = require('../config')
const beta = require('../../Managers/Beta')```
Base.js
of base.js?
@vivid fulcrum heres where ive gotten, you make sense out of it?
wait no it dosent
and permissionsmanager requires base?
no it dosent acc
no
search for files that require base.js
is there a way i could define an object ending before applying for example
get.object.house
do it something like this
let obj1 = .house
get.object + obj1
when i try something like this it returns [object object].house
Guys can you write most simply how to see how many servers my bot is in
get.object["house"]
<client>.guilds.cache.size
and this is what please tell it most simply you can
I am new to the bot making community
What language
python
if you want a variable length array why not a vector?
len(bot.guilds)
and where i have to write that? into my bot code or?
worked u are a legend!!
What do you want to do with it?
Have it displayed in a command?
yes
how would i add something like const item = ''; into an ejs file?
@client.command()
async def guilds(ctx): # mmm spoonfeeding
await ctx.send(len(client.guilds))```
With your level I doubt you're using cogs
i dont know what that is, and heres my idea... imma make a class that way i can get in the array size so then i can create a destination array with the right size for the function to dump into
how would i add something like const item = ''; into an ejs file?
its jank but hey
anywhere below defining client and above client.run()
You didn't close some brackets there
wait I will test it
a vector is a variable length array
also delete that, I can see your token
How can I display it with command in my server?
How can I display it with command in my server?
I just showed you
Where I can t see it
Now you just type .guilds
what command as .help or .givemeallyourinformations
And if you used CTRL+C and CTRL+V right it should work
yes i did
But I don t know command
read
Yep
Thank you so much it worked
ehhh looking at how c++ does classes i think this will do what i want anyways

how would i add something like
const item = '';
into an ejs file?
hi
i need cod protect role update with adminstretor
when someone give premission to role with adminstretor then the bot remove premission
tim i broke it
impossible unless the bot has admin perms, which would effectively make you be denied on top.gg if you request it
i need the bot only to my server hust for protect
my bot it music and games
but i need bot to my server
then check role permissions when it gets updated, if it has admin just remove it
Because my server was sabotaged more than once
won't give you copy-ready code tho
define "sabotaged"
it'd only happen if:
A - someone in your staff is a traitor
B - your bot's token was leaked
C - some other bot's token was leaked
in all 3 cases, you shouldn't give admin perms to anyone anyway
One of the token is stolen
is it from your bot?
again, no admin perm = way less danger
This is why I want a bot that prevents giving adminstrator
just don't give admin perm to any role
without admin perm you cant give admin perm
unless you're the owner of the server
yes iam ownership
remove admin perm from all roles, easy
i cant becuas my staff is my friend
tim how would i do what im trying to do herecpp class Probability { public: void construct(int b, int a, int l) { int batches = b; int amount = a; int results[b][a]; int limit = limit; } }; like can i make the variables defined in the function appear outside of the function?
if you can make a constructor like js imma scream
then don't complain about sabotages
but they downlod any think from Anonymous source
I'll say once more:
- Give admin perms to roles and face the risk of sabotage/invasion/nukes
OR - Remove admin perms from all roles and stay safe
friendship apart, security is security
declare them as class variables and assign inside the constructor
tanks you
Does anyone know how I make my bot create channels with permissions?
I haven't tried C++ in a very long time and only know the basics
Oh yea le dumb. I thought of an idea using that and switch statements, but Iโll have to do it tmrw. Itโs schoolwork time as I canโt use my meeting and an excuse to be on my laptop ๐
10/10 mobile webpage design
Anyways Iโm trying to get outside data into the constructor the way js uses โnew object**(data)**โ
I donโt, sorry.
that's why you never use resize-mode: "stretch"

the problem is that array sizes are defined at compile time, not at runtime
you cannot define an array size from a variable
Aaaaaaa
Elaborate pls
vector<int> myvector;
myvector.push_back(5)
I didnโt know that existed in cpp my bad. can you tell Iโm a noob?
you're doing way better than i did when i first tried cpp
cpp classes are still weird af for me
im also a js guy
Same
you can also allocate memory
i like rust a bit more than cpp, the memory management with it is way easyer
int* mymemory = malloc(size)
*mymemory[1] = 23
// or something like that i dont remember
but other stuff with the language is a pain in the ass instead
I still dont get why I should use pointers in cpp
there is a reason, but rn i only can remember 50% of the answer
right stacks and heaps
hi guys
do you need help?
i like you
ยฏ_(ใ)_/ยฏ

My fucking god i hate cors
bane of my life
just with how dumb web browsers and JS clients handle them
only useful if you own the server that you're requesting to
mojang's api doesn't have properly configured cors
so you can't make api requests through websites
๐ง
this has been an issue for 8 years btw and the devs just ignore it
probably because they don't know what they're doing
you know i think my CDN isnt working
tsc tsc
saying that i dont think the reverse proxy is doing litterally anything
which i cant tell if it's CF or if its the server
I tried to find the user with tag and then send a DM to it
the code is this
client.users.cache.find(u => u.tag === User + Tag).send(HelpEmbed)```
it gave me this error
```javascript
TypeError: Cannot read property 'send' of undefined```
ah yes, CF was on the wrong SSL
because it returned no user
it didnt find a user 
User + Tag is "YouTube_101#1520" does it cause the problem?
just be safe ezpz
how would u.tag be equal to user + tag?
๐
man i really need to get a colored name so people stop ignoring me
it's like saying banana + milk is equal to banana
because the u.tag is both the username and the tag.
User is username
and Tag is discrimination
so...i put it as that
just compare the IDs
lemme try
just say every day is your birthday
substring
wait sorry idk how to check ID instead of..name?
hey, I'm working on sharding for my bot, and I'm having an issue with getting express to work for voting.
What's happening is whatever port I use it says it's already being used and stops everything from working.
I'm guessing it's something to do with using multiple processes, but don't know how to fix it. Could anyone explain the issue or at least point me in the right direction please?
ty
client.users.cache.find(u => u.id === ID).send(HelpEmbed)```
still says the same error ;-;
You're probably starting an instance of express on each shard, hence why the port is already in use. Make sure you're running the server outside of the shards
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./index.js', { token: token })
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn();
//set up vote listener
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express()
const webhook = new Topgg.Webhook(||secret password||)
const vote = require('./events/vote')
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
vote.execute(req.vote.user, client, req.vote.isWeekend)
res.status(200) //respond to top.gg to close connnection and avoid looping
res.end()
})
app.listen(5000)
I've got this. I'm pretty sure it's outside of the shards...
And that file isn't index.js correct?
no it's a different one
Are you requiring that file from any other files?
I get this error
Error: listen EADDRINUSE: address already in use :::5000
create your express server outside of your event listener
you're creating one for every shard created
no that file is the main file
Are you requiring that file from any other files?
no
oh wait I have an import I'm requiring from it.... that's probably it
okay removed the import and still nothing smh
Make sure you're not importing that file from anywhere else. Also make sure you aren't opening it from another file or another process outside of node
oof I missed one import.... got it, thanks for the help
np
How would you remove an object from memory?
10/10 mobile
moment
free(obj)
That seems pretty easy
Moment
@restive furnace(obj)
hmmmm intensifies
https://github.com/tailwindlabs/headlessui
i always end up writing my css from scratch no matter how many times i try to use those css frameworks
hey
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
where can i find them
Twitter developer not available on the portal
@quartz kindle do you know if a <select name="roles" multiple> will return a array alwayts
and if empty do []
you need twitter developer account to generate keys
it is not like discord
you have to answer some questions to get access
Apply for access. Get started with Twitter APIs and tools. All new developers must apply for a developer account to access Twitter APIs. Once approved, you can begin to use our standard APIs and our new premium APIs.
this tbh
so if none '' if single '<response>' and multiple []
Will just check if it is a array and if not make it one
The selected option
the value property only returns the first selected option
it does not return multiple
to get all selected options you need to use other properties
yeah but this is a little different though, this is unstyled components, so it's less a CSS framework than it is a component framework that you can apply your CSS to directly.
nah it integrates with tailwind, but it's not using it by default
hmm
I think it could be interesting, I think basically this is components like... y'know, tabbed navs, alerts, accordions, we all do those things and they require some integration and code, and this is saying "yeah we provide that but not a default style"
hi, i need help to put an html in my bot's description. The issue is that I do not know how to do it since as I have config my page has separate files for the convenience of things and in the animations
commands: {} commands.push() would be valid correct?
no?
what would be then?
example
push() is for arrays []
use an iframe
thx
and can you with a file?
idk honestly
No, only pages
Iframes are just small browsers
okey, thx
i am trying to make an eval command but this doesn't work
it gives me an error of: missing key-word arguments
Iโm making an economy bot and itโs going pretty well but thereโs not much ways for you to earn money
Anyone got any ideas? Iโm using discord.py btw
๏ฟผ
ctx.author is the shorthand for ctx.message.author, and you're comparing them? It's like doing if 1 or if True which is superfluous 
ctx.message.author will always be = to ctx.author
Const xpCooldown = new Set();
client.on("message", msg => {
if(msg.content === "test"){
xpCooldown.add(msg.author.id)
setTimeout(() => {
xpCooldown.delete(msg.author.id)
}, 30000)
return message.channel.send(" worked")
}
})```
This isnt deleting author from cooldown after 30 secs
Help pls i have to fix this bug today
@ me thanks
Okay so, i don't get any error with my code, but i want to optimize it, to be clear, i get 12 Modules for protection, each module get 4 settings
To do a setup command i need like 400 line
There is a exemple
if(module === 'ban') {
// #1
if(settings === 'changecount') {
}
// #2
if(settings === 'changestatus')
}
// #3
if(settings === 'changepunish'){
}
// #4
if(settings === 'changebypass'){
}
}
So i need this for 12 module, how can i do all in one, each module get the same settings
look into switch cases, will make it a bit cleaner
or make it dynamic by using a map or something to have all your modules stored as key in it.
or 1 liner statements
switch would take up more lines as it requires the break key word after every expression block
Oh yeah
but its already way better than having a else if statement of doom
else's can't chain like
if
else if
else
can
better than switch statements
also py 3.10 gets switch cases
switches take more lines which is gross
took only like 30 years
I mean
its in starboard
lmao
that ss is directly from the starboard message
and it relates to the convo a bit
I just don't like switch. Some prefer it which is fine. I just prefer one line if statements and chains
agreed
I barely use it so I can't really give a full preference from a performance aspect
but definitely in my opinion better than a if else
i like switch cases more, looks a bit cleaner than just writing your entire bot with a single if else statement
yea same
Why
Is it really faster
stackoverflow people say difference is little to none
realistically if/else statements are O(n) where as switch/case is O(1)
In the era of performance improvements and the advanced technology, these changes commit little to no performance at all
if else chaining decreases readability as well
switch (true) {
case //if
break
case //else if
break
default: //else
};
``` am i right
switch (string) {
case 'h':
case 'help': {
// code
break
}
default: {
// code
break
}
}``` iirc
by this style i can also do fallthrough which makes it easier than typing if (statement1 || statement 2)
no, both are O(n) because it depends on the amount of chaining or cases
switch statements iterate through every case, they're not considered as maps
3 responses claim c++ is O(1)
I can't find much about it for JS
The low amount of cases are indeed turned into jump tables for faster lookups, if there are many cases, this is ignored and it uses other algorithms to go through them
You can have a look at the internals of the V8 engine for JS
i did, nothing changes
Anyone help pls ^
Hey guys, I'm setting up a server info command, but when I do the command the message isn't sending. Along with that I'm getting no errors.
Please dm me, if you have a fix.
Thanks man. <3
const embed = new Discord.MessageEmbed()
And im guessing u have command handlers setup to work with array name
Here, can you dm me?
So, I am almost done with my auto mod bot (can kick mute ban, ect..) and apparently I need my bot to be able to let the user know that if the BOT doesn't have the kick_member permissions enabled, it needs it to perform the command -kick @ memberhere
Like this something like "I need KICK_MEMBERS to use the kick command"
Here, dm me.
Okay
Why do you use DMs for such simple stuff
VC lol.
for whatever reason
when I check the channel.nsfw property
it tells me its false
even though the command is executed in an nsfw channel
also that first part is just a typescript thing
so it doesn't cry around
when making the channel not nsfw it also still says false
not sure why
is it because the channel just isn't cached or something?

what
Very true. You can also do it over a vc to help with the learning process.
Not everyone is comfortable with a vc and in case you happen to make a mistake, someone can correct you here
True, next time that will happen.
No big deal. I only tried dms because I was learning as well.
I'm thinking of adding a helper method for my embeds ngl ๐ค
@command(description="Test command lol.")
async def test(self, ctx: CommandContext):
kwargs = {
"content" : "Message.",
"allowed_mentions": {"parse": []},
"embeds" : [
{
"title" : "Test",
"description": "Test haha",
"footer" : {
"text": "My footer!"
}
},
{
"title" : "My title.",
"description": "This is a description.",
"fields" : [
{
"name" : "Field name 1.",
"value" : "Field value 1.",
"inline": True
},
{
"name" : "Field name 2.",
"value" : "Field value 2.",
"inline": True
}
]
}]
}
print(await ctx.send(**kwargs))
cuz this is ugly
In javascript, how to retrieve the invitation used when a member joins the server?
this is indeed ugly
read the docs
You can't directly do that via accessing some property
You have to fetch all server invites before and after member join, and then calculate which invite got an incremented use
why'd you eval typescript??
how can you define arguments with specific symbol in djs?
you mean reference emojis to letters?
do you know how to do this?
Do you know what fetchInvites returns
show your cache options
I will Programm a generator where have code
So I'm wondering what I can do to have autocompletion and not have to do shit like
if title:
d['title'] = title
if description:
d['description'] = description
Any ideas?
and thats it?
Not allowed + stupid
?
yes
strange
well all the other ones not in it are just disabled
there is also an option to cache channels
there are more options
but I just didn't enable the others
lol
do you have any partials or anything?
idk
stop spamming
and like I said
it's stupid and not allowed by most services
So you can scrap the idea and do something more useful
@slender thistle you are stupid
djsl doesn't need them
not sure
but I do use discord.js-light
lol
djsl == discord.js-light
strange, djs light shouldn't mess with the nsfw property, what happens when you change to regular client + default options?
well I don't wanna use the default options
because
I have a permissions check
and for that I need roles cached
lol
with regular clent
is the channel also cached?
Why would you eval typescript
how can you define arguments with specific symbol in djs? i tried this but it didnt work```js
const args = message.content.slice(prefix.length).trim().split(/|+/);
what?
| is a alternation like or
its suppoesd to spit the argument
so when i say hello, hi, hey | phone, pc, mouse then ``hello, hi, heyis an argument andphone, pc, mouse` is another
You could just do "|" instead of using a regex for that
i dont understand. i am too dumb
@crimson vapor @lusty quest it seems like if the channel isn't cached it will let the nsfw property stay at false
lol
for uh
whatever reason
yes
defaults to false
guess I will just fetch the channel when checking if the channel is nsfw
imo it could be null as a default
I disabled the cacheChannels and cacheRoles option
I instead now use the fetch methods
incase the command has a check for something like permissions
or nsfw
works perfectly
if the roles are cached already it will just return the cache
so there wont be any response time issues
lol
for the nsfw check I just fetch the channel now from the guild
again returns the cached one if its already there
all works fine
thanks for help
although I did kinda figure it out myself
lol
Is it possible to enlist a bot on top.gg but not have it be availabe to the public?
In order to test stuff?
Hi uhm I got a question
I want to sell premium for my Bot. I saw Dank Memer using Patreon. How do they check if they are the persons who have premium and so on?
And how do they see if they donโt have it anymore automatically
if doubt ping Tim and ask why D.js-light does this stuff
yeah






