#development
1 messages ยท Page 1127 of 1
yeah but thats a syntax error
You own a custom domain?
Is it just a static site
no
youd have to get a free domain from freenom or something
then find a free host, like glitch
eUgH
okay
Or repl
heroku ^^
github pages
not glitch cuz glitch aint no host ๐ฉ
๐ค
Or GitHub Pages if it's just a static page
glitch is a web host.
its terrible for bots, its not great for sites, but it does work.
github pages is probably the best out of the suggestions given
Is free?
yeah
There are a lot of static site hosts out there
gh pages, gitlab pages, netlify, surge, now.sh, etc
There isn't a defined schema for your config file
You can put it in however you want, just make sure you're importing it in properly wherever necessary
how do I find one then
.tk, .cf, .ga, .ml, and .gq
I want any domain just so it'll work
your SEO might be terrible, if that matters
am I doing something wrong?
I'm not really experienced with browsers so I don't really know how to properly search for a domain
when I'm trying to search for .ga nothing pops up and when I put just ga other like .com pop up only
i wanna make a snipe command but it just wont work
e
any bots with snipe commands will never be in any server of mine
why
๐คทโโ๏ธ
Same
anyway can you help me Woo
if i was going to make a snipe command, id map it
wdym
:0 the usb windows boot is so long
You could start by showing us what you have tried so far
it is like 2h
my brian got hurt it when I look my code
in the snipe command file
LoL
i tried this
`module.exports = {
name: "snipe",
description: "get deleted messages",
execute (client, message, args) {
const msg = client.snipes.get(message.channel.id)
if(!msg) return message.channel.send("There are no deleted messages in this channel!")
const embed = new Discord.MessageEmbed()
.setAuthor(msg.author)
.setDescription(msg.content)
if(msg.image)embed.setImage(msg.image)
message.channel.send(embed)
}
}`
@lusty lintel that happend when u read ur code that u wrote 2month ago
please use
```js
```
yes
module.exports = {
name: "snipe",
description: "get deleted messages",
execute (client, message, args) {
const msg = client.snipes.get(message.channel.id)
if(!msg) return message.channel.send("There are no deleted messages in this channel!")
const embed = new Discord.MessageEmbed()
.setAuthor(msg.author)
.setDescription(msg.content)
if(msg.image)embed.setImage(msg.image)
message.channel.send(embed)
}
}
u are wellcome
ah ok
how are you setting client.snipes
iwait
then hastebin
in this?
you defined snipes
hmmmmm
yt tutorials suck
that's why i ask here xd
yt for learning concepts, docs for developing
Well if you know JavaScript then it's an easy fix
Very easy fix actually
One line of code
Map()
module.exports = async(bot, message) => {
bot.snipes.set(message.channel.id, {
content: message.content,
author: message.author,
image: message.attachments.first() ? message.attachments.first().proxyURL : null
});
};
Snipe.js
const msg = bot.snipes.get(message.channel.id);
if (!msg) {
let embed = new MessageEmbed()
.setColor(color.red_dark)
.setTitle(":x: Error !")
.setDescription("There is no rencent deleted message")
return message.channel.send(embed);
};
let embed = new MessageEmbed()
.setTitle("Sniped a message")
.addField("**Author:**", msg.author.username)
.addField("**Deleted message**", `\`\`\`\n${beautify(msg.content, {
format: "js",
})} \n\`\`\``);
if (msg.image) embed.setImage(msg.image)
message.channel.send(embed);
unrelated, but i dont think messageDelete provides a channel
try this
ooooo
spoon feeding
ah
Reeeeeeeeeee
rip breaking rules
wut i just help him
About my question from earlier... imma just use redis
give him a example
e
@solemn latch
you gave copy paste code
which is spoonfeeding
i didn't copy pasted rly
10000% spoonfeeding
Don't see how that's going to work anyway
maybe
._.
lets not pretend spoonfeeding is a good thing
im reading and trying to understand the code
If you're going to spoon feed, the very least you could do is give working code
@strange trout ahm wtf it wroks
i am using it
: /
That doesn't fix his issue
idk i am trying to understand
man whathe fuck
?
ddue my I have no brian now
i still don't know
I just want to sleep
._.
...
@solemn latch u there ?
mongodb is better than quick.db?
Yes
@solemn latch u there ?
please stop spam tagging me
can we dm
cuz i cant dm u
thats for a reason
:))
@jolly wave where did you define client.snipes
:0
maybe he didnt like execute the code
the snipes ๐ค
erm
why so much code for just sniping a message..
e
now on my code i need a }somewhere
`deleted_messages = {}
@client.event
async def on_message_delete(message):
deleted_messages[message.channel] = message
@client.command()
async def snipe(ctx):
last_message = deleted_messages.get(ctx.channel
embed = discord.Embed(title= f'{last_message.author}', description= f'{last_message.content}', color=0x808080)
await ctx.send(embed=embed)`
credit me :)
on index.js
Why make a snipe command in the first place
@delicate shore killed me
python
py
this is js
bc of him now I dotn understand anything now
a
i know yeah
I mean the logic is there
huh ?
The code he shared can easily be rewritten in JS
it would be a bit longer, since the way the embed builder works, and brackets and whatnot
hey I got a domain from freenom and I have this code, what am I supposed to do with it
yeah, just saying, ze was saying why is it so long
What
what do ',' expected mean bruhhh
and just by nature, the js code will be a bit longer
dude guys guys I need fkcing help srlsy
Add a comma ffs
explain your problem
Hi
hey I got a domain from freenom and I have this code, what am I supposed to do with it
@ancient nova
so how to setup the config file and ex things
e
dont copy paste code plox
@jolly wave Add ๐ a ๐ comma
e
I copy and paste teh code always and now I;m idiotn @solemn latch I dont understanding anything
then delete your code, and learn it and write it yourself
hmmmmmmmmmmm
You don't learn by doing that.
Just because YouTube tutorials give a GitHub repo doesn't mean you should copy from there.
Wherever the error comes from.
What
most errors tell you exactly where the problem was found @jolly wave
I didn't understand anything about that sentence
e
just shut up I need to think codes now fuk
What even is this conversation lol
what is config file
Oh, I should shut up. I'm sorry that I actually learn instead of copy and pasting. I'm sorry for trying to help you. I won't ever do that again, I'm awfully, terribly sorry.
Your on your own if you try copy paste.
i have the same config file
^ json validator
hmm i learning form idiot website https://anidiots.guide/v/v12/first-bot/your-first-bot
By learning do you mean copying as you said earlier
I wonder if people are coding bots because they're actually passionate about it or just to get a badge
js linter yeah
No I learn my lessson
I wonder if people are coding bots because they're actually passionate about it or just to get a badge
@strange trout most do it for the badge tbh
i don't
Not me
I started bot development before the badge so...
I do for ppl
at base
i was creating my bot so i wasn't alone on my discord server
I make bto and sell for 1000dollars @golden condor
https://discordjs.guide/preparations/setting-up-a-linter.html#setting-up-a-linter
^ js linter
^ annoying if you go with default settings
hmmmmm
so idc of the badge
// guildCreate event
for (let i = 0; i < guild.channels.cache.size; i++){
console.log(guild.channels.cache[i])
}
-> undefined every time
I liek to make bot bc I'm alone i need friend
e
yo
the channels are key'd by their id
// guildCreate event
for (var channel of guild.channels.cache){
console.log(channel)
}
I do this what is command with arguement? anyoen explain
what
couldnt you just log the channels
@earnest phoenix
the channels are key'd by their id
its a collectionn innit
oop
// guildCreate event
for (var channel of guild.channels.cache){
console.log(channel)
}
@earnest phoenix
ty ty
@solemn latch dm
I do this what is command with arguement? anyoen explain
@lusty lintel a command argument is... an argument
You were going about it wrong
my dms are closed
what
It's not an array
then dm me
and will remain closed
It's a collection
ok nvm
when you need to do an operation like sqr or sqrt, you need an argument to do the operation on
when you want to do division, you need two arguments
I should close my dms from here so people don't DM me for help because it pisses me off
Why so persistent in DMing
hmmmmmmmmm ok?
It happens too often
i dont mind a dm, i mind dming for things that are not my job
so i do this const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();?
?
this is the only server i have dm's blocked.
i also disabled friend requests just because this server

and do if(command?
so i do this const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();?
@lusty lintel
and do if(command?
@lusty lintel
https://tryitands.ee
@earnest phoenix
Then try to fix it
What
// guildCreate event
for (const c of guild.channels.cache){
console.log(c.type)
}
-> undefined
lol
remove the .cache
i dont remeber codes it hard too rermber ngl
and add c.cache.type
No that wouldn't work
what
o?
that shouldnt make a difference
it should
but it wouldn't do what you want to do
Because that would be an object
You can use a map?
are we sure channels are cached?
yes
guild.channels.cache.map(channel => {
})
i want to do it in a loop
wha tis map
send a msg in the first textchannel
then break
the channels should be cached as soon as the guild object is deserialized
what is map
since they're sent with the guild
@earnest phoenix try the ready event
and then loop over the guilds / get the guild you want
wait so
so are code have words?
but i want to send a msg whenever the bot joins a guild
not when it comes online
oh
@earnest phoenix your command don't work
๐คฃ
you where told it doesnt work
for (const { type } of guild.channels.cache.array()){
// Stuff
}
like as soon as it was posted
AH
@jolly wave wdym
ok @strange trout lemme try

so first I dont copy paste and second need to learn online and second need to learn perfix config and second need to lear commmand with arguemtn
tf so many works
Collection<Snowflake, whatevertheothertypeis>
you're looping over a keyvalue pair
so i don't wanna ask for a solution to make a snipe command xd
what is array
g.channels.cache.forEach((c) => {
console.log(c.type)```
this works but i want to loop it
not foreach
lemme try alexis
Hey keds how to i use uptime robot on my vps to monitor downtime of bots? ping me pls?
foreach is looping
@fierce arch @fierce arch
@lusty lintel are u serios
forEach is slow though and the for keyword outperforms it
what @earnest phoenix
@lusty lintel Wtf who asked for that
u dont what is arrat
array
yeah
@earnest phoenix so what do i do with the not working command
what is array
you have google
omg my eyes
go search it
WHAT IS ARRAY
Show ur event handlers
wdym
https://lmgtfy.com/?q=array&iie=1&ovr=1 @lusty lintel
what is event hadler!
@lusty lintel
if you don't know what an array is you really should leave, study js, and come back when you think you're ready
@earnest phoenix you mean command handler?
wot
oke imma leave
@jolly wave ye
ah
ty that works
so i need to show you my command handler?
and i understand why so ty
what is array
Awesome
array is a keyboard?
I onyl do this npm init nothing else
@fleet hornet you can use setTimeout() to run a callback function after a set amount of time (in milliseconds)
what is db
yeah i ggole it and it tellss keyboard
No way he's over the age of 10
so are you here to troll or something
i believe they're genuinely underage and dumb
see keyboard
Now do a 4D
that's not a keyboard are you on crack
tf you mean?!
intresting keyboard
It can go past 3, lol (not talking about keyboards)
don't you cover arrays in like first months of taking CS
I donwload discord,js 2days ago
They cover "lists" now
db is mongolia?
How long have you been using JavaScript/Node.JS @lusty lintel
db=dopebean?
i guess you are trolling
db=database
How long have you been using JavaScript/Node.JS @lusty lintel
@strange trout 2day
yea a Database is a country
they're trolling
^
@sinful belfry
who
read up a few messages
Next message is gonna be "i downloaded this bot from discord.dev how 2 make it work"
lol
@lusty lintel this really isn't the place to troll
I thought he was trolling a while ago tbh..
teh
I didnt even trol tf
feel free to make jokes like that in #memes-and-media
What's is happening
idk
I rlly dont knwo what is array
i just went to get a drink
I hearing first time in my life
i am gonna too because idk what is array too
I think this is a 10 year old who can't spell and also has never seen a single piece of code other than what is on a hacker's screen in a movie
yes I ggolgle it and it said it slike keyabord or sqaure somehting
I think this is a 10 year old who can't spell and also has never seen a single piece of code other than what is on a hacker's screen in a movie
@golden condor hacking into the mainframe
lol
you gotta type "javascript", a space, and then "array"
Lmao
!c.permissionsFor(bot.user).has(['SEND_MESSAGES'])
No I already made bot
e
@lusty lintel it obviously isn't. search up what it means in terms of programming and if you are unsure, then come and ask here
It always skips this line of code.
it said sqaure and said 1 and 3
wym he sold a bot for $1000
in the pic
๐ณ
e
Check #starboard
what is this
@earnest phoenix the permissions permissionsFor returns can be null, it means there's no overwrite on the channel
array is comand in code?
Not quite
ohhh
how can you check it on @ everyone cry
egar how old are you
why I told myagsh9q
There we go
Ok
what is ur age egar
but I need to sleep Its 3:30 am rn
...
answer the question
Egar you're 9?
why the fuck you code a bot so late
๐
LOL 
why do you say e all the time, doesnt contribute at all to the conversation
if i wanna say e i say e
e
e
e
these messages don't belong to this channel either
oof
now
don't continue it
anyway
hwo do i make command with arguement I mean code
split the message content by space
split the content into the command and args
arg ,arg2?
time to go
arg
if(command === say

#gene
oh
Dude learn discord etiquette before hopping into making bots
@fleet hornet wdym I already made 5bots
Idk 2
same
tf so much
good bots have as many as they require
Mine have 11
...
ok bye gn
i got 11
moedrtaion and gen
my eyes
I give gen nitro and give them free nitro
This is off topic
what i restock gen and give them free nitro
are you done
It do
anything you get is not what it is advertised as
true
I'm wathcing this chnannel bye gn

loll
bvreh
\`\`\`\`test\`\`\`\`\
how to make this in embed with js key
NOW SSLRY GN BEY GESYS
you're annoying
oo lmk how it goes, i have been meaning to make a remind me command
put it in the embed description
\`\`\`\`test\`\`\`\`\how to make this in embed with
jskey
@viral iris can any1 help ?
put it in the embed description
Yeah
you can add
```js
code
``` like you would a normal message
Just use backslashes and js and \n
good evening all,
anyone know about this shard error only just started happening
Shard 0's Client took too long to become ready.
it took to long to become ready
Therefore you may have been rate limited in terms of gateway connections
Can you do ```js
client.on("debug", console.log)
Or.bot
Or whatever you use as your client variable
@golden condor anywhere right
Yes
0|projectb | Recommended Shards: 2 0|projectb | [WS => Manager] Session Limit Information 0|projectb | Total: 1000 0|projectb | Remaining: 955 0|projectb | [WS => Manager] Spawning shards: 0 0|projectb | [WS => Shard 0] [CONNECT] 0|projectb | Gateway : wss://gateway.discord.gg/ 0|projectb | Version : 6 0|projectb | Encoding : json 0|projectb | Compression: none 0|projectb | [WS => Shard 0] Setting a HELLO timeout for 20s. 0|projectb | [WS => Shard 0] [CONNECTED] wss://gateway.discord.gg/?v=6&encoding=json in 226ms 0|projectb | [WS => Shard 0] Clearing the HELLO timeout. 0|projectb | [WS => Shard 0] Setting a heartbeat interval for 41250ms. 0|projectb | [WS => Shard 0] [IDENTIFY] Shard 0/1
@golden condor sorry for ping again lol
No you should be all good
looking up the shard took too long issue
put it in the embed description
@sonic lodge it's on field
it still just times out
and it's
works in field too
``0|projectb | [WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
0|projectb | [WS => Shard 0] Heartbeat acknowledged, latency of 5972ms.
0|projectb | [WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
0|projectb | [WS => Shard 0] [HeartbeatTimer] Didn't process heartbeat ack yet but we are still connected. Sending one now.
0|projectb | [WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
0|projectbump | [WS => Shard 0] [HeartbeatTimer] Didn't process heartbeat ack yet but we are still connected. Sending one now.
0|projectbump | [WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
``
Seems like discord isn't sending a heartbeat back
@viral iris example
embed.addField('Title', `\`\`\`js\n${code}\`\`\``)
thx
@earnest phoenix you should try two shards yes
It is recommended to have 1 shard per 1000 but 1 per 2500 is the max
i think the recommended really depends on the bot
1 shard per 1000 is the recommended amount by discord
I am making a website for my discord bot, can anyone tell me how can i dynamically by javascript change the website's icon (favicon)
@solemn latch also thanks I got the domain and I'm coding the website in glitch now
``0|projectb | Recommended Shards: 2
0|projectb | [WS => Manager] Session Limit Information
0|projectb | Total: 1000
0|projectb | Remaining: 953
0|projectb | [WS => Manager] Spawning shards: 0
0|projectb | [WS => Shard 0] [CONNECT]
0|projectb | Gateway : wss://gateway.discord.gg/
0|projectb | Version : 6
0|projectb | Encoding : json
0|projectb | Compression: none
0|projectb | [WS => Shard 0] Setting a HELLO timeout for 20s.
0|projectb | [WS => Shard 0] [CONNECTED] wss://gateway.discord.gg/?v=6&encoding=json in 221ms
0|projectb | [WS => Shard 0] Clearing the HELLO timeout.
0|projectb | [WS => Shard 0] Setting a heartbeat interval for 41250ms.
0|projectb | [WS => Shard 0] [IDENTIFY] Shard 0/2
0|projectbump | [WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
0|projectbump | [WS => Shard 0] Heartbeat acknowledged, latency of 125ms.
`` @golden condor
Should be all good now
bot is taking so long to respond
but earlier it worked fine all day
i know my host limits bandwidth once reached
1041643MB / 1024000MB
I got this code: ```js
document.head || (document.head = document.getElementsByTagName('head')[0]);
function changeFavicon(src) {
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'shortcut icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
}
changeFavicon();
will this work?
cough cough, galaxygate unlimited bandwidth
cough cough, intents, cough
true, proper fix
Some providers have unlimited bandwith, if you use up all your bandwith then it's a good idea to get a provider that gives unlimited bandwith
oh yeah, forgot they are mostly out of stock
do you believe this is why its acting this way
Perhaps
what would happen if u have low frequency?
the normal ones are fine
i dont really understand computer stuff
my vps costs 25 euros so i need a good provider to match it
the high frequency servers are just a lot faster
im pretty sure what happened above is that you got ratelimited
Hey, so I tried to do research on how to do math algorithm by user id, but didn't find anything. I want to make like -gay -dick commands, but the number won't change. Please help!
what have you searched, justas
because queries like "how to make an algorithm on a discord user's id" won't work
you need to narrow down your search
you could get the last three digits of their id
my vps costs 25 euros so i need a good provider to match it
@earnest phoenix What kind of specs do you get for that?
@ember oak you need to put the variable inside the run function of the command not outside of it
what vps provider do you recommend
so if u had a low frequency server it'd be slow?
no
slower
@ember oak you can literally use modulo on an id lol
@earnest phoenix try contabo, digital ocean and other professional ones
oh
not slow, just slower than the high frequency
I use Contabo
8 GB Memory
4 CPU Cores
60 GB SSD Disk @sullen harness
the higher the frequency, the faster the changes
regular, most stuff
high frequency for things that need it
@earnest phoenix try contabo, digital ocean and other professional ones
cpus running at a higher frequency can do operations faster
because their cycle is much faster
their website is like so 2011 lol
Yup
Yeah but they are fairly good
But hey, don't judge a book by it's cover.
the only downside ive really had with them, is they have had stock issues every few months
24gb ram tho damn
I've been fine with them when I used them you should try it
i spoke to my host owner of the company and he said they dont offer unlimited due to prevent ddos

Contabo has DDoS protection and a lot of bandwidth
but i was like boi youd expect unlim for that price lol
However I think for the price you're paying you could get a lot better.
i always hit my band limit with them
@signal carbon hello
they reset it 3 weeks ago and ive already hit it
Unlimited bandwith
lmfao
yeah thats what i need lol
well rip in the chat for u
I mean read the ToS when getting "Unlimited" bandwidth.
its jsut setting it all up again rip
25 euros
var shp = json.data.shopHistory[0];
TypeError: Cannot read property '0' of null
var shp = json.data.shopHistory[0];
if (shp === null) {
shp = "None";
what's wrong >?
It's null
ik
The 26.99eur plan is VDS no VPS
No
It's null
@golden condor should i add[0]?
in this var shp = json.data.shopHistory[0];
It's null there is nothing you can do about it
Was on the wrong page, mb
Aok
no
lol
you can see if it exists and if it doesn't return
214TB of bandwidth a month
feelsbadman
they use dedicated machines iirc
they probably have their own
probably a handful of them across several hosts
^
there was one in particular right?
var shp = json.data.shopHistory;
if (shp === null) {
shp = "None";
huh
i fixed the None error but got this
hello i neeed help how can i put a gif emoji to my bot messages?
Anyone who could help me with which permission I should use for a mute command?
The mute command assigns a "Muted" role to prevent ppl from sending messages.
dunno if MANAGE_ROLES is suitable
MANAGE_MESSAGES and MANAGE_ROLES probably?
hmm, didnt think of adding MANAGE_MESSAGES as well
only using that for purge

Well, imma do that, thanks 
@snow urchin what is not working?
Also, I have a bigger question but dunno how to put it into words properly so bare with me.
Do you need to handle cases like when the sender (Moderator) tries to use a moderation command on someone with higher permissions (e.g. Admin/Owner)?
My question is if you gotta do anything special to prevent the execution or if it'll be prevented by itself with Discord.js (and if it throws an error possibly)
It's based on highest role position
So I don't need to do anything special to prevent the execution? The bot has the highest permissions of all users (since the bot is somewhat of an overlord).
You should not allow users below someone to ban them regardless
That'd be a bit of a security flaw
You should check the position of the executors highest role and that of the person they are executing it on
alright, so I have to check it myself, thanks
didn't know if there were any measures that automatically handled it (maybe on the side of the Discord API) and if I could've just handled an error
Discord doesnt know who the executor is except the bot
alright, thanks 
Also wanted to ask for an opinion on my command handler if that's allowed 
First time actually making a "proper" command handler.
https://hastebin.com/sutolajuta.js
EDIT: wanna know if there's anything terribly bad that should be changed asap
with what can i connect my patreon with my bot db? and which db do u guys suggest
You can use Patreon Webhooks https://docs.patreon.com/#webhooks
how do I do links in embed
Sorry
don't advertise anywhere in this server
how do I do links in embed
hello i neeed help how can i put a gif emoji to my bot messages?
<๐ ฐ๏ธemoji name:emojiid>
i do it with a gif also?
<a:name:id>. pretty much the same way you'd do a static emoji except with a a in front
hello I need help with links in embeds
Let's use
for example.
To get the emoji string form, you add a \ before it. So, that would become !blobcatban
To send it, you'd send it in the desired channel in that form. For example, message.channel.send("Yeah! ")
@peak shard embeds support markdown
e.g. google
it would show "google" but would be clickable (would become a link)
back slash
It needs to be a backslash (escape character)
\
you need the whole form
that's probably the emoji id
Yeah, that's the emoji id.
yup
thx!
well wait
come on, it's just putting a backslash in front of an emoji
/
When someone upvotes my bot, it does not send the data to my webhook. When I go to the webhook test, click save then test, it works then. But does not work when someone actually upvotes.
For animated emojis you just need to send <a:emoji_name:emoji_id>
You get the ID with the backslash.
kk thx
ty
https://discordapp.com/channels/264445053596991498/272764566411149314/741400159229050900
Anyone know whats up?
would prob be better in #support tbh
it says :tickYes.: when the bot sends it
what exactly are you sending?
embed message...
well, I meant what exactly, like code that you're using to send it (+ to create the embed)
The bot must share the server the emote is in
the bot must be in the server where the emoji comes from, and must have EXTERNAL_EMOJIS permission
that's a forward slash

how to get data from firebase and store it in the value?
So I'm new to making npm packages and i made my first package but how can i make the package to be a class when required?
export the class?
module.exports = class
That's it?
yes
Oh thanks tim
my bot... it sends the message twice in my bot
its so annoying
its not anything about instance too
im not sure whats wrong
@quartz kindle So tim i did this
module.exports = Functions;```
But what it returns is just
```js
{}```
what is Functions?
class Functions {
//Things here
}```
and you're requiring the module?
Do you want it to be an instance of Functions when required?
Wouldn't it be
module.exports = new Functions();
So when you require it, it'll be an instance
I did that, still returns {} @strange trout
Or that ๐
Did u try my way, Voltrex?
Lemme try
Also how are u requiring it
who want help discord.py?
This is how i require it
require("string-toolkit");```
In eval
Try returning the require
Do wot
did you restart the process?
What process?
or are you requiring it from a live process?
Heโs using eval, Tim
i am bot developer using python
thats why im asking
if any one want help mention me
@earnest phoenix arab?
delete require.cache[require.resolve("your module")]
delete require.cache[require.resolve('module')]
K lemme test
And then require again
Oh i now know, the thing i did was correct, just had to clear cache
I finally finished that website
What website
That website
for my discord bot
Good job
Im proud of you
Nice, is it live?
yeah
Link?
dm
i need help with an api here
let me get the images rq
first image (code, and im sure you can figure out why this issue is happening just from it)
second part
const targetPos = target.roles.highest.position;
const authorPos = message.member.roles.highest.position;
if (targetPos >= authorPos) return "you cant ban this dude";
Guess this is enough for the target role position detection then?
here is error code
now i know why its happening
but
i do not know how to fix it
without
going against what someone told me
@eternal flame you're defining stats inside the ready event
therefore it doesnt exist in the global scope
and you're defining servers outside of the ready event, so it will always be 0
is it possible at all to await a function as an item in a dict ๐ฅบ
how i should make a color changing thing in discord js
people have prob told me this and i just wasnt paying attention
if you want the variable to be accessible in the global scope, you need to declare it outside, even if empty
someone have good meme API?
let stats;
bot.on("ready",() => {
stats = {...}
})
i love you now but not in a gay way
someone have good meme API?
@toxic bane
return {
'a': await if_a(),
'mb': await if_b(),
'm': await if_cd(),
's': await if_d()
}.get(x, 9)
this is mmy code for the py switch workaround thingy
how i should make a color changing thing in js e
what color changing thing
idk something color changing
someone have good meme API?
@toxic bane
if you mean roles that always change colors, thats not allowed
i don't mean this
@toxic bane api for what?
@toxic bane api for what?
@nimble escarp memes
you mean the embed color? you can set it to random
if you mean like animated, no
color changing would have to be constant edits
@toxic bane https://lmgtfy.com/?q=meme+api
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
@eternal flame it will be a blank page if the bot is not ready yet
also, you probably need to stringify the object
remove the var
remove the "var" keyword
.setColor()?



