#development
1 messages · Page 1904 of 1
i am adding a amazing thing to the bot
pls help me
if a person types ^news add heloo
it should be added
in a command called ^news
and it should be seen if anyone types
^news
@feral aspen
can you help
@spark flint
hello

ok
i am adding a amazing thing to the bot
pls help me
if a person types ^news add heloo
it should be added
in a command called ^news
and it should be seen if anyone types
^news
You forgot to ping @ everyone.
lmao
Oh my god, you just repeated your text.
pls help me to make it

What are you exactly doing?
only code if you know what to do
i am adding a amazing thing to the bot
if a person types ^news add heloo
it should be added
in a command called ^news
and it should be seen if anyone types
^news
Saying help me won't benefit me or you.
lmfao
You just COPY PASTED AGAIN.
read
Okay..
Show me your base command, for now.
means
just store the text in a database with the guild id
what u coded till yet
The code where you make the command?
nothing probably
ok
Yup, I'll be waiting. :)
client.command()
async def news(ctx):
await ctx.send('** Todays News Headlines**'+' '+"--------------------------------------------"+' '+'Marshadow is getting High demand')

PYTHON.
o python
yea
Oh, I'm no use. 
😢
I do
i'm only doing this to shut him up
😢
@client.command()
async def news(ctx, *, news):
channel = client.get_channel(CHANNELID)
await ctx.send(f"News: {news}")```
now work on that
@pale vessel only gave him basic code
it needs to be able to get a servers news channel, send a better message etc
just sent that code which is a base for him to get started from
also as he kept pinging people for it

2 years of experience
imagine doing work for some 13 y.o. guy, that just continues being annoying with his silly questions, who for a long time could find everything he needs on the Internet, maybe not even in the best possible way, but no, he just keeps asking the same thing here to press the long-awaited Ctrl+C Ctrl+V
no problem if you get paid for it
Quick question.
How can you handle the if (!response)? I can't edit the embed in any shope or way, possible.
hmm?
that error literally could not be more clear
slash commands name cant be uppercase or empty string
No need actually
file.name || "no name"
if(file.name === noname) return
Discordjs moment
cough
No need to create useless vars for one time use only 
if(!command.name || !command.name.length) ...
But I love my high memory usage

Yes
Depends on the amount of servers of course
wow 50 MB is way too much then
My bot out here using 160mb rss for 25 guilds and 10.5k users
But my code can run bot with 90 server and 250k users with 300mb ram
errr...member count isn't a metric
Define commandFolders
since most of them will not be cached at all times
My bot runs pretty high on ram usage considering what I cache
When i restart bot it shows 2.3k
your cache has a cache
You lowered where is your purple
And its so good
I only cache guilds and channels
Actually I don’t even think I cache channels anymore
Still using 160mb rss 
well not much usage at least
Js always been more faster
lol who tf cares about a bot status io page
Granted I don’t really care about my ram usage all that much

??
Am i wrong?
Very
C++ is incredibly fast compared to js
Js is one of the slower languages in the modern world
Than why all indian youtubers say that
at least faster than python kekw
python is so interpreted it has to interpret the interpreter
From what I’m reading C++ is 10 times faster than js across the board
Helo guys welkam bek tu may chenıl
But for more complex things I have a feeling C++ is likely hundreds of times faster
D++
If somebody ever mentions an Indian and tech together in any way, I always think about Indian "tech support"
Very serious thing of course
Plus I’ve just been loving C++ recently and a discord bot might be a fun little project for it
all indians are born as tech support and have a barely visible youtube channel which explains exactly your current coding issue

if stackoverflow fails, it's guaranteed there's an indian guy solving it on youtube
Stackerflow never fails
sometimes it does
I didnt get any on my js fails
ack your ints
Because everyone using djs has asked the same question a billion times on stackoverflow
“Discord bot no work pls help”
Wait untill some try again if it still fails start to cry or fix code
I am not asking this
“SyntaxError: ';' expected” HOW FIX GUYSSSS
"heres my code" proceeds to add 1000 line code
I am asking
Could not found 'discord.js' module
What should i do
add more message event listeners
that should help
Lmfao

It was my first fail lol
"Detailed answers are very appreciated"
Watch me solve this whole thread
Learn javascript

I really made a msg event listener for each command



Pretty funny how many people have spaghetti code with djs
Mainly because djs promotes spaghetti code
Glad I'm never asking on the internet on help about something, either look up already given answers, check the docs or give up entirely
djs are so confusing they could make it easier
Literally saw a guy make an event listener for the message event for every command
It was me
this is literally me

there's almost no scenario where an in-depth search doesn't help
You’ll almost never find a detailed solution to an obscure problem though
(On the internet)
Check docs => guides => github examples => stackerflow => discord-> top.gg> Development hey fake can you help me about my slash commands
like, sometimes you got 5-6 levels deep during searchm but for sure the answer is somewhere there
when I was making my GP I had to find out how to calculate texture normals in real time on android
most answers were in other prog langs, but I could extract useful info out of it
God… I remember the times when searching the 'net wasn’t actually a way to go
Had to try the shit yourself
And learnt it byself
fake is a boomer laugh at him
learning is gud
Actually better but it can be cause by losing much time
Why bother learning when you can have some random person on a discord server write your code for you
Sshhh
That’s the djs mindset
fiverr for free
Hello!
Hello
yas
Are you police?
nah.
lol
Because i am op
try this
client.destroy();
Tyrone, you should change the css for your website to make the edges smooth.
Nah it will logout of Client
I dont have time
we may need some code...
no... python op
phahahah
no
I tried but failed
Says the guy using Java
python does look funny
thats the code
ahh
The last time I used Java was for that webhook dogshit I made a few weeks ago
TypeError: the JSON object must be str, bytes or bytearray, not TextIOWrapper
I know what you did this summer, Sir
C++ with SDL on top
And yes bc i have school 12 hours need sleep 7 hours eating 1 hours and try to be alive for 4 hours
You must know everything about me, it’s always summer in Texas
with open("assets/variations.json") as file:
allvariation = json.load(file)
what is in that file
80f rn actually good weather

ah fuck ignore my variation1 duplicate error
aight
Damn… wasn’t prepared for that one 
uhh
that was just me quickly copying it over to see if it worked
Spoonfeed moment
i cant think as errors
its not json that the issue
Did you google your problem?
@app.route("/santavariations")
@route_cors(**CORS_SETTINGS, provide_automatic_options=False)
async def variations():
with open("assets/variations.json") as file:
allvariation = json.load(file)
variation = random.choice(allvariation)
return(variation)
title1 = allvariation[variation]["title1"]
title2 = allvariation[variation]["title2"]
title3 = allvariation[variation]["title3"]
desc1 = allvariation[variation]["desc1"]
desc2 = allvariation[variation]["desc2"]
desc3 = allvariation[variation]["desc3"]
return jsonify({"title1":title1, "title2":title2, "title3":title3, "desc1":desc1, "desc2":desc2, "desc3":desc3})```
Quart
sdl is fucken amazing
ur returning two things
quart is a production version of Flask
Ikr
?
yeah to test
SDL is great
Pastebin isnt working for me
i see great pastbin here
Just started learning it recently
Probably country error
i was returning variation to see what the response was
with wonderful error
Got a 404 on the pastebin link

You didnt send a valid link
he does
Or code correct = no problem
Are you pretty sure close of your Nose?
Someone that sits next to me in class got covid
And I feel a little sick
Might be ggs
then u are on right way
Is it than or then?
I’ve gotten tons of emails from my school saying “someone in your class got covid” etc
Use sourceb.in
But they won’t say who it is
start debugging
same
Send me over that minigun before you quit 
"omg some one got covid in ur class guess who it is"
yes
With who?
waffle
Already on its way
are you even sending the commands to discord to actually create these slash commands on a server?
because according to your code, doesn't seem like it
Remove intent and try
I don't have them enabled, would need to apply
implement that in the start of your bot instead
ohh
because i always get null, and I read somewhere that you need them
but wanted to verify
You need this intent for like message.author client.user things
I can do message.author
guys help discord bot no work
import discord
discord.make_bot_for_me_pls()
getUser probably wont inside in it
if (_dbuser[`blacklisted`][`condition`]) { pseudoMessage.channel.send(`<@!${pseudoMessage.author.id}>, You are blacklisted. Contact admins for additional info.`)
return
}
No u

Bc their destination remove to acses of bots private things
would that be the member intent?
imagine using message instead of msg
I am not lazy ass
i am lazy ass
message is more clear
i like to call my vars as i like to
imagine lmao

my vars are mostly 2 random letters 👍

yes
from blacklister import BL
BL = BL("API key")
if BL.check(ctx.author.id).blacklisted == True:
await ctx.reply("You are blacklisted. Contact admins for additional info.")
thats the python alternative
idk about python
@spark flint
ty
flask i guess?
the API?
ye
dont know it... i j ust use flask
I use Quart primarily
express.js is so easy and for what
can i use it spooky?
Well the API uses a mixture of Quart and Express
Sure
need a key 🙂
Grabbing one now
cheers
slosh
Very sloshy
Still registering slash commands on any startup

I’m trying so hard
slush commands better

and getting so faaaaar
ah yes, the good old slush cmds
i love em
why couldnt i see luca's cornet, now i can?
You'll have to eventually
ooops iim in dev
can we make these messages with our bots?
r/hadastroke
starman uses it on Quark - not sure how tho
wtf
Startman
Starman
wahts the uh assembly decode program thing called
im using the api directly so maybe i can use it
ayyy I got the santas-list.com working finally
only took like 30mins
more than that
You may wanna define bot as your client or simply called it client 
lol
const discord = require("discord.js")
client = discord.Client()
bruh
i dont even use js and i know that
...
Wtf is bot exported from discord?
no
That doesn’t exist
what doesnt exist?
Hold on. Do you actually define multiple clients and instances? I read ready.js

you are defining bot in discord, but are using mongo?
do you even know js?
hmmm
this says otherwise.

i lost all braincells trying to fix santas-list
I lost a lot in the last 10s
i lost my braincells trying to make a chat bot in py then ended up it being about 200 lines long xD
i am using mongodb, but via models only

but... you dont understand discord.js
You already use the passed argument client in your execute() function
No need to import discord again, creating the var a second time
If you pass client as argument then use client.on(…)
command.execute(interaction)
You’re passing interaction as argument
Don’t u ever need the client in your command modules?
Also where do you even call your ready event JS file?
Am I blind
You’re already listening to the ready event in your index
Why would you create a second listener?
Your event has like 5 lines
Reading the file and including it as well as executing it is longer than what you got before

Would only make sense if you would move all event listeners to modules
Which is like over complicating things but well why not
Anyone knows how to move that topbar so the sidebar doesn't overlap it?
z-index
remove it from the html code???
if I do that the topbar will overlap the sidebar
?
Is what you need to use on all associated elements
I basically want the topbar to start at the end of the sidebar
Is it an absolute or fixed display already?
If so use the left property then
Only if the element being display as absolute or fixed one
Let it overlap the sidebar and margin the content in it
Same for the sidebar
Is easier and more flexible as well as better responsive design if the sidebar for example shouldn’t be shown up on mobile
wait so what do I do
you need to think of it as legos
create an element that contains <navbar/> and <div><sidebar/><content/><div> that is flex column
Let the navigation overlap the sidebar and use to push your sidebar element down THE HEIGHT the navigation has

Also I did
But it doesn't affect it
are you trying to copy discord's ui?
Kind of
You could say so yeah
Even though I'm gonna make it look completely different
the skeleton is the same
so umm.. where can I find the button to apply for the message intent ?
ping in replies
you need to structure your html so it looks like
<body>
<sidebar />
<main>
<navbar />
<whatever />
</main>
</body>
make body a flex element that contains a sidebar and the "main" content, and have the main content a column flex
html is just rectangles at the end of the day, you have to recognize how to stack them on top of each other
Issue is I'm working with routers
That’s actually not the best design either
First element of all is your wrapper
Would that still work?
wrapper for what? <body> is the main flex element that holds sidebar and main content
To keep the hierarchy in place always
<main> itself can be a router outlet that changes depending on dynamic content
ok
use whatever wrappers you need on top of that
that's just the high level idea behind the html structure, not a copy pastable html example
ok buddy that's the 3rd time you're saying that here

a
<div className="flex">
<Sidebar />
<main className="flex-col">
<Topbar />
<Router>
<Switch>
<Route exact path="/">
<Home />
</Route>
</Switch>
</Router>
</main>
</div>
Think I did it wrong
Consider a proper command handler this time in order not to be forced to update it a few days later again
.top-navigation {
@apply flex flex-row items-center justify-evenly
bg-gray-800 bg-opacity-90
w-full h-24 left-24
shadow-lg
}
if you give main full width the top bar should be stretching with it
it contains w-full
which is 100%
this just popped up on my recommended, thought it was relevant here lmfao; https://www.youtube.com/watch?v=pfaSUYaSgRo
Learn the basics of Tailwind CSS by building a Discord-inspired navbar from scratch. Learn how to leverage utility classes to build responsive animated UI elements faster https://fireship.io/lessons/tailwind-tutorial/
#webdev #css #tutorial
🔗 Resources
Tailwind Docs https://tailwindcss.com/
Tailwind React Setup https://tailwindcss.com/docs/gu...

oh main
just mouse over the html elements in inspect element and see what's not taking up enough space
can't make websites without devtools
then its parent isn't stretching
keep going up one level until you find an element that's not stretching out to its parent
<div className="flex">
<Sidebar />
<main className="flex-col w-full">
<Topbar />
<Router>
<Switch>
<Route exact path="/">
<Home />
</Route>
{/* <Route exact path="/maaltijden">
<Meals />
</Route> */}
</Switch>
</Router>
</main>
</div>
no
Only parent is the top div
A is that you wrote wrong that's why I asked you xd
what did I write wrong?
I mean the margin thing is a crutch
you want to have a proper layout instead of adding margins to things and using absolute positions
send a codepen or something idk
cuz adding w-full to the top doesn't fix it
can't tell without devtools
Can I send a codepen with react stuff?
cuz I'm using react and tailwindcss
You’re far away from doing a responsive design anyways
you can do that, but adding a margin to overlapping elements in this case is kind of like seeing that a square peg doesn't fit in a circle hole and grabbing a hammer instead of learning where things are supposed to go
The margin has to be adjusted by the screen size easily done by using media queries
"Easily" more like annoyingly ^_^
Shh shh Mr. Woo
html is about creating a layout where boxes flow into each other, position:absolute; margin-left: 25px is the nuclear option
Also for some reason my sidebar isn't at 100vh when I scale down the screensize
Depends on you design things
And margin makes it overflow on the x axis
If I want a static header and static footer responsive and on any browser you will have to use some sort of tricking
But nvm is free to do what he wants
Why suggesting somebody do use djs without proper knowledge if I can suggest him to create his own library
issue to this was with the margin too for some reason
Not that this would make sense in the first place, but it’s just an example
I’m trying to get an user by their ID using message.guild.members.cache.get(id) and then add an user permission to the channel, but the user is returning undefined. I compared the ID to the actual user ID, and it all checks out. It’s weird because if an user has Admin, it works fine. But for a regular member, it doesn’t work.
probably means they aren't cached
Ah. How would I fix it then?
Still confused to why the topbar doesn't wanna get 100% width
feth them
Oh. So use .fetch instead?
100% means 100% of the parent. If the parent doesn't stretch across the entire page the child won't either
optimal solution would be to try to find in the cache and if they don't exist fetch them
Aight. Thx
Yes but the parent of the parent stretches fully but the parent doesn't even though it has 100% width
probably because body doesn't have a 100vw width
make sure you learn flexbox
If I have an user ID, how would I create a channel where only that user can see the channel?
create an overwrite for the @everyone role and disallow viewing the channel
create an overwrite for the user id and allow viewing the channel
Don’t forget to assign html, body a width and height of 100% and remove the default padding and margin by setting both on 0
Who know where I can find docs from npm discord-buttons ?
Maybe on their npm preview page linked somewhere
Most likely
Is it even worth to use that library?
Yep
probably deleted
Yes When i Use ds v12
But why
Just update to v13
Using v12 is like using var in modern day javascript
Except not really because var doesn’t always make life a pain in the ass
var is deprecated, just like v12

i just need to change a lot of staff to update on v13
Outclassed by better keywords such as let and const
i am too lazy for it
I will never understand the motivation to spend time on something you wanna do or you’re interested in but actually being too lazy to do it accurately.
I mean the time you invested into it is gone anyways you won’t get it back in your life.
Instead of dealing with your own sloppy done work investing even more time to keep it alive somehow instead of completely overhauling it is even more wasted time.
Life time to mention it once more.
That's such a strange argument, you gain a ton of experience doing things the wrong way as a beginner
being told "var is bad" doesn't really teach you anything, but using var for a loop counter and getting frustrated when it doesn't work after you log it from inside a closure is a lot more instructive
(still a relevant analogy even if you weren't talking about var)
I guess the critic has nothing to do with skill here, just the fact being too lazy to update deprecated stuff is weird.
The day will come you got actually not time to spend and your shit doesn’t work anymore.
Which could be prevented by doing it accurately in the first place or not being too lazy to maintain or update something.
I can understand not wanting to constantly maintain your work tho
that's not really something you sign up for when you start working on a project
Well that’s usually not the case
the js ecosystem doesn't help that either
clone an unmaintained C repo from 1994 and it still compiles on the first try, clone a js repo from 2019 and you get 23 errors trying to run it lol
you’re generally right but in fact Discord is moving forward fast and they always cut the line behind forcing you to do things
true, that's generally an L you have to take when you're dependent on a 3rd party api
yes discord is screwing over a lot of people, so even if your bot is written in C99 it will still break several times
Businesses, apps, huge eco systems, even government environments etc. which are nowadays built for example on XP or PHP 4, generally spoken on old hardware or software etc could be updated since years tho but there’s actually no reason to if you’re not forced to
But discord is forcing users to
I can understand it from their side, it just sucks for the user
And that’s what I mean if I say being lazy here if you got some motivation to spend time on something is just wasted time x2
why upgrade your bot when you could use that time to complain about having to upgrade your bot on discord

IT, tech, software is enveloping so fast, you can’t be up to date all the time
But if you’re not working with discord, building something or at least trying to which can last a few years or decades, depending on its needs and purpose is worth the time to spend
Instead of being lazy
But arguing about that is also wasted life time like anything else, too

can someone make me a restart cmd for me thanks
Special tonight offer, just 50 bucks
Vbucks
50 bitcoins, sry 
but... can u make it for me pls
I love how people are still crying about slash commands in discord's github issues
Huh just exit your process, handle that exit to logout your client and close database connections or whatever, and create a new process launching your node app after a short timeout
Yeah but to be fair here, the fact discord isn’t moving forward really fast to bring all features they planned to it is something you can complain about
probably, but slash commands are just a natural evolution of bots on any kind of centralized chat app. It's crazy how long discord let bots just read all messages
I have to agree and the fact the increase the usability for the common (dumb) discord user is a good thing as well
the only thing that seems strange to me is discord trying to crack down on bot accounts when bots run rampant on user accounts
but that's like a super super hard problem to fix
I mean like idk I’m sure 90% or more of the bots out there actually don’t need more requirements than slash commands already offer, so yeah more complaints are just because people are again too lazy to update stuff or straight too dumb
I'd probably be angry too if I hadn't killed my only bot a while back
Hmm the balance between creating false positives and obvious cases is hard to find, which will always require an human to step in and look about it, which will most likely be an overkill of cases to handle
I work on a fraud detection system for a living and sometimes I really wish it was as easy as some people on discord like to think it is
Welp, I don't have little hobbie bot, so for me it long process, and yes I will update it soon, I am already spending a lot of time creating new things till release, and for future updates also, so I haven't been fully honest when I said I am lazy, I like doing that staff very much
That’s like the major difference between coding and developing
Using something existing to form it a little bit to fit into your needs is something compared to actually creating something from scratch, totally need to investigate each point etc
well in most cases you don't create things from scratch but yeah, unlike developing a discord bot the goal is not well defined for anti-abuse and the thing you're fighting basically changes every day
Well then acting like you actually don’t care about good tips or calling yourself too lazy to do stuff might move yourself into a bad spotlight
Well yeah the comparison wasn’t perfect but you got what I mean I guess
also it's difficult to measure how well you're doing since you can't rely on basically any metric
how does discord figure out whether or not some solution they implement for these phishing attacks is working as intended?
Well yeah creating something new always be successful or not how the user using it at the end decides
Or generally spoken how good it works of course supposed to do what it should do
I don’t think will ever do
They keep that stress away of them
They develop and provide the platform and moving forward to create more possibilities for users to control it
And the end the users need to find a way themselves to deal with it like developing addons or in this case bots
To do the job the platform creator should actually do
ok but those bots have the exact same problem
you implement a solution for an unknown problem, but have no idea if the thing you're doing is working
for example you catch 100k phishing links a day. Is that 90% of all phishing links or 10%? You can't know because if you could identify all possible phishing links you would've solved the problem already
the next day the messages you delete drops to 10k. Did the the attacker give up after you added protection or have they started bypassing your checks? Very unpleasant problem to solve when you don't have the data you need to work with
That’s why I said discord doesn’t bother, they say they’re creating the possibilities and it’s up to your creativity dealing with the issue
And this keeps them out of all the trouble and possible false positives to deal with
I highly doubt that's the case
letting malware and viruses run rampant on their platform has a serious impact
I don't think that's something you would let the people doing the phishing know
Hmm might be the case yeah
And then phishers will evolve
if I had to guess Discord just hadn't thought about these things until fairly recently
and it's taking a while for them to put something together because they're starting from 0
Probably yeah I’m actually not even aware how they steal your account other than fishing the login data
hi 12 year old kid, run this exe for free nitro
But since people talked about stolen token or cookie shit I wonder why they don’t do something
then the program decrypts your chrome password store for your discord token and other login credentials
If they not already doing something
phishing is the hardest one of these to stop because it bypasses all 2fa and attacks the weakest part of security which is users
Yeah so generally malware, thought there are ways I’m not aware of
Don’t they force 2fa nowadays anyways
if you have someone's discord token there's no 2fa
Yeah ik not speaking about that
But in order to fix the issue of fishing passwords
At least I was forced to use one
how does 2fa fix that
In order to unlock my account
oh for passwords
you can MITM 2fa code too though
if you can get a user to fall for a fake login screen, you can get them to fall for an email verification modal too
Fishing your password doesn’t matter if 2fa doesn’t allow you to login from a new device
right, so I ask you to click on approve on the email you got on your email to proceed
No matter it’s been filtered by the IP or some sort of hardware ID if you use the app on a PC
(like TeamSpeak does)
_bad internet connection _
and you do it because you think it's a genuine discord login page
Will probably spam my messages if my connection is back 
2fa is good for when there's a login attempt that doesn't involve you
but when you're the person trying to do the login and approving 2fa notifications it doesn't help that much
Damn my message appear under your name
Total chaos
Discord with short period of a disconnect on mobile fucks the app hard
Let me restart it
Hmm that’s actually true
Unfortunately
We’re back to the question what would you do against it
And I dislike the idea of needing your fingerprint to access the net to provide your identity at any time
Spoken as metaphor
you already give discord your fingerprint
Unfortunately yeah to be able to use it
they check it on the signup page but I don't think they do for sending messages and such
I mean the metaphor wasn’t only about discord
Generally people argue if you completely remove the possibility to be anonymous in the net that would solve all the issues
yeah the fight between privacy and security. Daily struggle
Which is bullshit
I mean for this case in specific it wouldn't do anything because someone is pretending to be you
or performing actions on your behalf
it might solve some issues, but definitely not all
Correct which throws us back again
I think this is the closest option to getting the benefits of proving your identity and remaining anonymous https://blog.cloudflare.com/introducing-cryptographic-attestation-of-personhood/
An experiment that uses hardware security keys (like a YubiKey) to replace CAPTCHAs completely. The idea is rather simple: if a real human is sitting at their keyboard or uses their phone, they can touch their security key’s button or bring it near their phone to demonstrate that they are human.
It might be unfair to compare that to terrorism but it will also ever happen no matter what u do and how much you think you can control people
At some point you have to live with it and try to be always one step in front of the attackers
Just like a cat and mouse game
a very fun one
well for me it's fun but yeah also difficult
https://www.youtube.com/watch?v=5gxI-6QmPdE this is a pretty good talk on the topic
Slides and blog posts available at https://elie.net/ai
This talk explains why artificial intelligence (AI) is the key to building anti-abuse defenses that keep up with user expectations and combat increasingly sophisticated attacks. It covers the top 10 anti-abuse specific challenges encountered while applying AI to abuse fighting, and how to ...
At the end it’s something you can’t actually solve or prevent but you should be aware of and try to deal with not like discord atm being far, far behind
Can’t watch that atm while driving lol
the thing is, just like how discord doesn't know how well it's doing in terms of dealing with the problem, you don't know how well they're doing either
what if discord is doing a lot of work behind the scenes and this is only 10% of the phishing we would otherwise be seeing
considering how bad things are I kind of doubt that but you know, that's a possibility
Yeah also true even if I believe it’s not the case, but I could be wrong
ugh I want to work at google just so I can learn from this guy in the talk lol
Finally made it home through all the fog, rain, while eating in my car and texting with you
Proves I’m a multithread talent 
And yes I said thread intentionally instead of task since we’re in the development room
Needs to sounds "techy" and fancy
isn't consciousness single-threaded
Nope some people actually can’t walk and breathe at the same time watching them
consciously multitasking is just quickly switching between multiple things
humans are async
Driving and texting
That'll be £70
No no I’m always stopping my car if I’m replying, trust me
Hmm dunno why people always complain if I stop on the highway
People are weird, isn’t me
Pause the road
Lmaoo
Hi. can i get help here with my code?
ye
I'm trying to log all the log to a webhook but idk how. I already use this code.
console.log("Help command has been ran by "+message.author.tag +"["+message.author.id +"]")
that will log to console not webhook
here're some reference docs https://discordjs.guide/popular-topics/webhooks.html#what-is-a-webhook
I already look at the guide but i still don't understand.
Maybe i you can give me example?
there are already examples there
Ok...
just give it a calm read, don't try to grab the first piece of code your eye sees and chunk into ur code
I get error here.
https://gyazo.com/7df85aabf647df8cb25be0031b169d32
This one has my head scratching:
Code:
@commands.command(name='load', hidden=True)
@commands.is_owner()
async def _load(self, ctx, *, cog: str):
await ctx.send(f'**`Loading Cog: {cog}...`**')
"""Command which Loads a Module.
Remember to use dot path. e.g: cogs.owner"""
try:
print('Loading cog...')
await asyncio.sleep(0.1)
print('Cog name:')
await asyncio.sleep(0.1)
print(cog)
await asyncio.sleep(2)
self.bot.load_extension(f'cogs.room-sealer-{cog}')
except Exception as e:
await ctx.send(f'**`ERROR:`** {type(e).__name__} - {e}')
else:
await ctx.send(f'**`Cog: {cog} has loaded successfully`**')
```Python language
Error:
`ERROR:` ExtensionNotFound - Extension 'cogs.room-sealer-gather' could not be loaded.
Local file path: `MainBotFolder/cogs/room-sealer-gather.py`
you cant define twice if you use const or let
And its easier to just get Discord from discord.js
And
Discord***.***MessageEmbed()
Discord.MessageButtons()
Solved with os.chdir
if (!interaction.isCommand()) return;
const command = client.commands.get(interaction.commandName);
if (!command) return;
try {
premiumGuildSchema.findOne({
User: interaction.user.id
}, async(err, data) => {
if(!data){
try {
interaction.deferReply();
await interaction.editReply({content:`This bot is a premium only bot. You can only use \`v!help\` and \`v!vote\` without premium.\nIf you've already voted then use \`v!premium\` to claim your reward.\n\n (To get 24hours of premium vote on top.gg by using the command \`v!vote\` . You can claim premium everyday by voting once every 24 hours.)`, components: [row]});
}catch (e)
{
console.log(e);
}
}
else if(!data.Permanent && Date.now() > data.Expire) {
data.delete();
try {
await interaction.author.roles.remove(memberRole);
} catch(e){
console.log(e);
}
interaction.deferReply();
await interaction.editReply({content:`Your premium has expired :(
\`claim again by voting on top.gg\``, components: [row]});
}
if(data) await command.execute(interaction);
});
} catch (error) {
console.error(error);
return interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
});```
The interaction keeps failing if data = null
what is premiumguildschema? everything is into its () does the findOne method works that way?
yes it does
what does the error say?
i never get an error
just the reply is just never sent
due to deferReply() the bot keep thinking forever
@rustic nova
Thanks
np
in the console you should get an error 
no why should i? because catch{} is never reached
I made a music bot
in an example it says you need to await the deferReply()
nice talk more in #general
let me provide the latest code
if (!interaction.isCommand()) return;
const command = client.commands.get(interaction.commandName);
if (!command) return;
try {
premiumGuildSchema.findOne({
User: interaction.user.id
}, async(err, data) => {
if(!data){
try {
await interaction.deferReply();
await interaction.editReply({content:`This bot is a premium only bot. You can only use \`v!help\` and \`v!vote\` without premium.\nIf you've already voted then use \`v!premium\` to claim your reward.\n\n (To get 24hours of premium vote on top.gg by using the command \`v!vote\` . You can claim premium everyday by voting once every 24 hours.)`, components: [row]});
}catch (e)
{
console.log(e);
}
}
else if(!data.Permanent && Date.now() > data.Expire) {
data.delete();
try {
await interaction.author.roles.remove(memberRole);
} catch(e){
console.log(e);
}
await interaction.deferReply();
await interaction.editReply({content:`Your premium has expired :(
\`claim again by voting on top.gg\``, components: [row]});
}
if(data) await command.execute(interaction);
});
} catch (error) {
console.error(error);
return interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
});```
and still fails ig
but why a you doing deferreply and instant editreply?
just delete deferreply and change editreply simply to reply
bruh already tried
the interaction fails in that case
I used uptimerobot
ye
channel = client.get_channel(ID)
await channel.send(“msg”)
Replace msg with anything you want
please dont forget me (:
yes
mongodb schema
how to set the channel is by command like
^cid #commands
^news #commands
like this
?
<#channel_Id>
ohk
did you tried to reply with a simple text to see if its the message content?
add channel: discord.Channel to async def news(ctx, channel:discord.Channel)
lemme see
then you can do channel.mention etc and it mentions the channel
if (!data) {
try {
await interaction.reply({
content: `This bot is a premium only bot. You can only use \`v!help\` and \`v!vote\` without premium.\nIf you've already voted then use \`v!premium\` to claim your reward.\n\n (To get 24hours of premium vote on top.gg by using the command \`v!vote\` . You can claim premium everyday by voting once every 24 hours.)`,
components: [row]
});
} catch (e) {
console.log(e);
}
}
so you tried this?
where did you defined row?
whats the output of my codesnippet?
@client.command()
async def news(ctx, channel:discord.Channel)
channel: discord.Channel
await channel.send(f"News: {news}")
is this correct
or wrong
wrong
@client.command()
async def news(ctx, channel:discord.Channel, *, news)
await channel.send(f"News: {news}")```
then you would do ^news #commands test
oh wait
@client.command()
async def news(ctx, channel:discord.Channel, *, news):
await channel.send(f"News: {news}")```
there
working
try using an embed for the news
Traceback (most recent call last):
File "main.py", line 75, in <module>
async def news(ctx, channel:discord.Channel, *, news):
AttributeError: module 'discord' has no attribute 'Channel'
see
error
lemme look
oh wait
its discord.TextChannel
embed = discord.Embed(title="Embed title", description=f"Submitted by **{ctx.author}**")
embed.add_field(name="Put something here", value=news)```
something like that
work on that code and build from it
let invites = await interaction.guild.fetchInvites();
err: TypeError: interaction.guild.fetchInvites is not a function
How can I fix this?
hello how make vote require command in djs
read the error
interaction.guild.fetchInvites is not a function
which function should I use
i don't use d.js so i don't know sorry
for get the invites from an interaction


bro embed not working
just showing News: ""
yes i send
do await channel.send(embed=embed)
gnoring exception in command news:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 74, in news
await channel.send(embed=embed)
UnboundLocalError: local variable 'embed' referenced before assignment
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'embed' referenced before assignment
yeah
you've probably put an embed somewhere else @deft citrus
or used the variable "embed" for something else
ok
i was about to send an example lol
i'm trying not to give fullblocks of code now
just tips like adding colours to the embed
they still have to figureout how to do it
i just started 3 days before
yeah
its easy for someone with experience to make
I always say that you should only code to a level you are comfortable coding at
don't make features too advanced if you don't know how to
why not more easily .setColor('exadecimal_color)
yea dpy
hello
const Topgg = require('@top-gg/sdk');
const topgg = new Topgg.Api("TOP.GG_TOKEN")
let voted = await topgg.hasVoted(message.author.id);
if (!voted) {
return message.reply('not voted')
}``` still bot command working
without vote
just bot send message
but work command to
why cant we leave space in command name
because then it doesn't work
because the bot will pick the command after the space as an input
then how can we add space
any one
!help me
would send !help with me being a variable
you can;t
;-;
ignore
@spark flint
I don't know discord.js sorry
oh hmm
bro then if i type async def news(ctx,'add', channel:discord.TextChannel, *, news):
will it work
no
wdym with add?
that won't work at all
means ^news add
yea but that doesnt make sense
;-;
that's not how it works
doesn't work like that
ooh then how
could do (ctx, option, channel:discord.TextChannel, *, news)
then if option == "yes": ...
wait fuck
oh
almost
wht
if option == "add": ...
get this error
not yes






