#development
1 messages · Page 1434 of 1
im trying to make a function called getEffects
i need the for to be async because i need to get something from the database
what is this.client.potions
json file
why do you need to await a json file?
no, i want to await the data from the database
why is the await keyword in front of this.client.potions
Wouldn't an async loop be kinda messy anyways? Is it completely necessary?
the await keyword belongs in front of function calls that are async
or of promises
for async (let pos in ...) { ... }
ok it works, nevermind
btw your potion var is holding an index
no
Change in to of
your first snippet used a for of loop and your second snippet uses a for in loop
ah
yeah i was just testing
it works now though
👍
hey can I get some help?
module.exports.run = async (bot, message, args) => {
const MessageEmbed = require('discord.js');
const embed = new MessageEmbed()
.setTitle("Support has arrived! [Prefix t.]")
.addField("`help`: This!")
.addField("`bananba`: You can't get it!")
.addField("`navyseal`: What the fuck did you just say about me you little bitch?")
.addField("`ping`: See my ping.")
.setColor("#FF0000")
await message.channel.send(embed)
}
module.exports.help = {
name:"help",
aliases: [""]
}```
How do I send a base 64 image ?
you'll need a db
db??
database
assign Guild id with prefix
Ok
store it in DB
mhm
Fetch it in need
Can u come to my project and do it?
Might try using a map if bot is not big
Sorry,
we're not supposed to spoonfed
It's super easy if you're using MongoDB lol or really any database could even use JSON if you wanted to as a databse( heavily not recommended )
JSON is gonna slow down when you hit more servers
use mongo then
yep thats why i said heavily not recommended lol also has higher chance of corrupting when the file gets big enough
Looks like the bot is not big yet
You can use SQLite
Repl = database 
He'll have to host the DB somewhere else
like Atlas
it makes code public
Okay
not suggesting
How
Caution: It'll be erased once you restart your bot
a moment of silence for people who leaked their token then edited it out not realizing the point of git is to track commits
Oh
F
Once I did that 6 months ago
My token was automatically reset
oh yeah
discord has a partnership with github to analyze code for leaked tokens now
lol
you have an extra `
what's your Problem ?
use escape then
`` he means to use them like this
oh ok
Not sure why he decided to insult me however
\
yeah
I would suggest you not insult someone trying to help you. Please.
yes because the way you have it at the moment is resulting in how it's coming out
if you want to fix it
you need to use backslashes `\`
imagine calling someone a dumbass when you're struggling with a basic syntax problem 😕
Can someone please help me out
how do I send base 64 image ?
it actually looks like this
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAAAB0CAYAAABUmhYnAAAAAklEQVR4AewaftIAAAKqSURBVO3BQW7sWAwEwSxC979yjpdcCXiQur/NYUT8wRqjWKMUa5RijVKsUYo1SrFGKdYoxRqlWKMUa5RijVKsUYo1SrFGKdYoFw8l4ZtUuiR0KneScEelS8I3qTxRrFGKNUqxRrl4mcqbknBHpUvCCZUTKm9KwpuKNUqxRinWKBcfloQTKieScEelS0KXhE7lRBJOqHxSsUYp1ijFGuXij1O5k4ROZbJijVKsUYo1ysX/TBLuqPxlxRqlWKMUa5SLD1P5pCR0Kp3KJ6n8JsUapVijFGuUi5cl4TdJQqfSJaFTuZOE36xYoxRrlGKNEn+wxijWKMUapVijXDyUhE6lS0KnciIJd1S6JJxQOZGETuVOEjqVLgmdyhPFGqVYoxRrlPiDFyWhU+mScELliSR0Kl0SOpUTSehU7iThjsoTxRqlWKMUa5SLh5JwJwlPJOGOyh2Vb0pCp9KpdEl4U7FGKdYoxRrl4iGVLglPqDyRhCeS0Kn8JcUapVijFGuUiy9T6ZLQJeGOygmVLgl3VE6odEn4l4o1SrFGKdYoFy9TOaHyRBI6lTcloVPpkvCEypuKNUqxRinWKBcPJeGbVO4k4Y5Kl4Q3qXRJ6FS6JHQqTxRrlGKNUqxRLl6m8qYk3FHpktCpdEnoVO6odEnoVLokdCrfVKxRijVKsUa5+LAknFD5l5LQqXQqXRI6lRMqbyrWKMUapVijXAyXhE6lS0Kn8pcVa5RijVKsUS7+uCR0Kl0STiThjsqJJJxQeaJYoxRrlGKNcvFhKp+k0iWhU3lCpUtCp9IloVP5pmKNUqxRijXKxcuS8E1JOJGEJ1S6JHQqJ5LQqTxRrFGKNUqxRok/WGMUa5RijVKsUYo1SrFGKdYoxRqlWKMUa5RijVKsUYo1SrFGKdYoxRrlPyTUBvLbYyS5AAAAAElFTkSuQmCC"
Convert it to a buffer
Make sure you cut the text part
Buffer.from(base64.slice(22), "base64")
You can create a message attachment using the buffer
e.g. channel.send(new Discord.MessageAttachment(buffer, "image.png"))
How to make a command that only voters can use i downloaded dblapi.js but i dont know how to use
You can find the documentation of our API here https://top.gg/api/docs#jslib, if you need any help with it feel free to ask in #topgg-api
use desktop
speaking of which, ty for reminding me

wrong npm module
dblapi isnt being used anymore
Just make a post request instead
ezpz
well this was a scam

@opal plank bot.guilds.cache?
THEN size, yes
np
not all users are in cache
owo
hmm
wait
a sec
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
this should work
lemme try
what should i do
guys
how to write bad code
I don't know how to write bad code
can anybody show me ways to write bad code
this is not a joke
yea it really doen't look like a joke
if else if else if else if else if else if else
nah thats not bad enough
yandere simulators code
no
imagine not commenting with chinese
I just found that command.execute(1, 2, 3), when called in another file with module.exports, has to also be execute(1, 2, 3)
that's why I had problems getting the .json in other commands, cuz lang was getting the args value, which was []

Wtf
the bad thing is, I need to declare variables I won't use, just to get to the variables I need
@lusty quest #development message
tag command?
- Don't use
case. Use a ton ofifs andelse ifs. - Don't use
await. Spam.then(() => {}). - Don't use any functions. If you need to reuse the same code, copy and paste the same thing.
- Hard code.
- If you are doing something like express, put the website markdown (and css + js) within the javascript file.
- Don't use
${these stuff}. Spam a ton of"these" + "stuff". - Copy and pastas from other websites.
- No command handler (for Discord bots). No website page or whatever it is called for websites handler for websites.
- No typescript. You need to restart the process to update anything.
- A ton of junk code that is not required for the code to work.
k thanks
on it
ok
yah
@shy turret like this??
that wont work so no
not good enough
is this css
if (a = 1, a) {
console.log("a")
}
thisss
What is that error ```
:=
won't work
hared
shush
remplace all js if(condition){} else {} by ```js
if(condition === true) {if(condition === true){ }} else if(condition !== true){if(true){ }}
ooo
if (a = 1, a) {
delete a;
console.log("a")
}
else if (a !== 1) {
delete a;
}
ok brb
i forgot to include: mess up spacing
@earnest phoenix what's your Python version
like this
What the fuck?
Moon are you okay?
what do you suggest master :o
You mean not bad enough
Wtf
yes i learning node
the fuck are u trying to do
ok i'll try harder master
you forgot the callbacks
to make the code a shit slower
useless callbacks*
that isnt required
also make some random try {} catch(){}
don't forget the else if's
also
if there is an error
dont define the error
if you want there to purposely be an error
make it like
this dude is smart ^
3.7
you'll have to make a on ping event
disss
oh
You are here to burn our eyes
Thank you
ok brb got school
i can if you want
on the event js client.on('message', message =>{ you'll have to see if the message is mentionning the bot if(message.mentions.users.has(clientq.user.id)){}, if true then you send an embed
const commiterrorrrrrrrrrrrrrrrrrrrrrr = "nooooooooooooo"; // yes const
if (commiterrorrrrrrrrrrrrrrrrrrrrrr == "nooooooooooooo") {} else if (elsevariable = commiterrorrrrrrrrrrrrrrrrrrrrrr == "nooooooooooooo" ? false : true) {
make.an.error();
} else {
console.log("lol" + " you" + " will" +" never" + " get"+" here")
}
Two goes brrrrrr
F
so basically if the message matches the bot id it responds with something
@slender thistle I'm installing python 3.9
Why 3.9
client.user.id in this case
@coarse hill for exemple is what a mention will look in a message.content
@slender thistle ok so I'll install 3.8
Yes
oh
yea ik
he wanted that if someone ping the bot, it will respod
:-:
i mean he wasn't precise maybe he wants smt else
Python 3.8.6 @slender thistle
i think that's what he want

OH
PYTHON

keep in mind, that's valid code in C++
?
means
gotta love bash
696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696
696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696
op 696
echo 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696 696
print("hello world");
pretty sure thats python
brb gotta go to schooL
^ it can be js if you make the function
print("hello world");
function print(msg) {
console.log(msg);
};
Sure
if (!message.guild) return at the top of your message callback
where
possible to have the number of lines of a file without using a module?
without external modules? yes
thx
without any modules? that's equivalent of asking if you can unlock your doors to the house without having literally anything to put inside of the keylock

I imagine that means no, which module offers this?
fs
it's a built in module
use it to read the file contents to a string then count the number of newline occurances
let print = console.log
I am finding a good host for my second bot so can anyone tell me?? so I can also see the logs?
Error: internal/modules/cjs/loader.js:968 throw err; node module
hatası
ve bu hata ile ilgili
bu sitede
bişey buldum
bu sitede yazan kodlar doğru mudur
ben windows da hostluyorum
app.listen(config.port)
console.log(`Serverstarted on port ${config.port}`)
})
bu kodu mu yazıcam ?
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);
kodu yerine
app.listen(config.port)
console.log(`Serverstarted on port ${config.port}`)
})
English only on this channel
bunu mu yazmam gerek
How I can check if a message is in a dm
what language?
what library?
node
It’s ok
library?
chances are high that he uses js
i can hear Brain cry
now i wonder how many Discord bots are running on a Samsung Smart Fridge.
i would do it just for the memes
os: samsung smart fridge
they run android
android + samsung smart fridge
it would be saved energy in the end
the fride runs anyways
so why not installing a small discord bot on it
how much ram does your fridge have?
250 liters
idk i dont own one. if i had one i would have already installed a Bot on it
but they dont have much, maybe 265MB
Give me code game xD
Hack Me, hack me 2
Could I grab the errors from here as listed and put them into an error cog in Python? https://requests.readthedocs.io/en/stable/api/#exceptions
I am using the example error cog as the base
How can I fix this bug ? Its a RGB Gif with color fade but the red pixels are shown every time. And if you press "Show Origional" these red pixels are not shown. Why ?
And it looks bad when I put this as the embed thumbnail
You 👏 need 👏 to 👏 say 👏 your 👏 coding 👏 language
the bug is on Discords Side and not on my own
Then why bring it here? Lol
How to check to see if a channel is valid?
Valid as in exists?
yes
Any one
How to work youtube notifications bot systems like api and more like that
Just get it from cache. If a channel is returned then it exists.
I would look at the YouTube api docs @earnest phoenix
Im collecting responses as in interactive setup
const Channel = content.mentions.channels.first() || client.channels.cache.get(id);
if(Channel) {
responses.channel = content;
} else {
throw new Error('Not a channel') | message.channel.send('Invalid Channel, Giveaway Cancelled!')``` it juss logs as channel undefined
Whats content defined as
const response = await message.channel.awaitMessages(m => m.author.id === message.author.id, { max: 1});
const { content } = response.first();```
But that's a string
Could someone show an example of getting an API to get the ping of the API? I have 3 APIs and don’t know where to go
Language is Python
an interactive setup to start a giveaway
You'll want to use a Message for .mentions.channels
message.content.mentions doesnt exist
?
Use the mentions property on the Message
What is bot.latency in Python. Like, how does it work?
The ping. Use it in a message or embed and then it shows your ping in seconds
i don't understand
So, the ping to Discord
Yes
I linked the docs where the proper method is shown @pseudo wadi https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=mentions
yh but it shows .mentions and i dont know how to implement it
Its just a property of message
message.mentions
yes.
ok.. but can i but it on another object other than message?
any object with the mentions property.
which mentions is really only for messages by default afaik.
if you need it for something which doesnt have it, youll have to make that code yourself.
oh ok thxs
in html style tags, you write your css.
https://www.w3schools.com/css/
Check out https://custom.discord.re/ also for a quick overview of how to do it for top.gg.
Thanks
This is updated right?
css doesnt really change anyway.
CSS details might be slightly different but the concept is there
@bot.command(name='ping')
async def _ping(ctx):
print('Ping!')
timestamp1 = datetime.datetime.now().strftime('%S')
api1 = requests.get("https://api.weatherbit.io/v2.0/current?postal_code=11001")
timestamp2 = datetime.datetime.now().strftime('%S')
api2 = requests.get("https://api.weatherbit.io/v2.0/alerts?lat=40.72&lon=-73.71")
timestamp3 = datetime.datetime.now().strftime('%S')
api3 = requests.get("http://api.openweathermap.org/data/2.5/weather?zip=11001,us")
timestamp4 = datetime.datetime.now().strftime('%S')
api4 = requests.get("https://avwx.rest/api/metar/KFRG?options=&airport=false&reporting=true&format=json&onfail=cache")
timestamp5 = datetime.datetime.now().strftime('%S')
#Pings
ping1 = timestamp2 - timestamp1
ping2 = timestamp3 - timestamp2
ping3 = timestamp4 - timestamp3
ping4 = timestamp5 - timestamp4
embed=discord.Embed(
title='ROOM SEALER PINGS :ping_pong:',
type='rich',
colour=discord.Color(0xFF9E00),
description=f'''Pong!
Bot Ping: **{round(bot.latency * 1000)}**ms
Weatherbit Current Weather Ping: **{ping1}**ms
Weatherbit Weather Alerts Ping: **{ping2}**ms
OpenWeatherMap Ping: **{ping3}**ms
AVWX Ping: **{ping4}**ms'''
)
await ctx.send(embed=embed)
pass```
Produces: ```
Ignoring exception in command ping:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/pi/Documents/Room_Sealer/room-sealer-core.py", line 195, in _ping
ping1 = timestamp2 - timestamp1
TypeError: unsupported operand type(s) for -: 'str' and 'str'
I’m trying to get just the seconds here
Rounded as well, if able
Language is in Python
you can't
api limit is 100
discord API only allows a max of 100 per bulk delete
why mee6 can
bcs of some workarounds
verified bots might be able to bypass
or maybe it's just deleting and recreating the channel to clear everything
this is my page ``<style>
body {
#bot-details-page {
background color: #90EE90 !important;
}``
still showing as white
any help
what kind of white?

but i have provided the hex color i want lol
can you send me your bot page link
https://top.gg/bot/720260333423558758
i havent clicked submit it wont show
you say that's your page... but you just mentioned css that's... not on that page.
are you sure you saved
what do you mean?
he didn't press submit yet
Ah right I see
Which part of the page do you want to change the color of? bot-details-page doesn't exist
There's been a lot of changes
i frame dead 😩

Today you learn you can't do literally everything in life by following a tutorial, perhaps? 😛
Ezpz
or stop spending precous time on shitcord and go and play minecraft ¯_(ツ)_/¯
You started it
Markdown:
````!setlanguage en, de or pl` - Changes the bot's language to English, German / Deutsch or Polish / Polska
!start 5h 2w Fancy hoodie- Starts a new giveaway for a fancy hoodie that ends in 5 hours and has 2 winners```
Looks like this since the new update:
https://screen.beatz.dev/uCwi
Does anybody know a way to keep the box but also not have the text in there in light gray aka nearly unreadable?
how i can change to custom background on my discord bot page and invite button ?
Using css
https://www.w3schools.com/css/
but where to enter my css code
Long description of your bot in html style tags
ah, thanks you for help
can you mix markdown and html in the description
¯_(ツ)_/¯
should be able to.
i mean, i would guess youd do something like
#Title
<img srd="urltosomeimg">
and it would just work
or whatever markdown and html you want.
srd
but how the heck do they know which part of <lel>#text</lel> is markdown and which is html?
hakx?
presumably in that case html would take over.
tags
markdown has no tags
it ain't a css in that example
is for ids, so it'd have to be inside an id="something"
lib/lang?
If I used a command I must wait any time to use it again
i can recomend something like Redis. you can set a TTL for entrys
Yeah
and there is a event that fires if a key runs out
wait nvm its overkill for a cooldown
or just..
setInterval
its nice for a mute command
also a nice way to kill your heap
@placid iron i think they fixed the iframe bug 🤷♂️
how i can make to its be just 1 full walpaper
not to split on more
@earnest phoenix
<style>
body {
background: url('image url') !important;
}
</style>
put it on this section
<style>
body {
background: red !important;
}
</style>
where is "red" put color which you want
i think yes
am not sure
you can @earnest phoenix
i just checked now
just put # then code
u have to put #
second to check
<style>
body {
background: #FF9300 !important;
}
</style>
put it like this
why you put entity-header
entity-header {
background: #FF9300 !important;
}
</style>```
just copy paste this
wait
wrong one
body {
background: #FF9300 !important;
}
</style>```
this copy paste, i took color which u wanted
i dont know for entity header
i just started to watch this about editing website today
@earnest phoenix
good news
i found
<style>
body {
background: #FF9300 !important;
}
#menu {
background: #FF9300 !important;
}
</style>
here code to its all be same
How can I make a snowflake animation in the background?
matija, you from croatia?
i think you need script access for this. and only verified bots get access
to discord bot avatar be circle and fly its also need to be verified?
No from Montenegro
ja sam iz Bosne
Oooo
gg
do sada ni jednog balkanca nisam nasao
Anyway, my question
How can I make a snowflake animation in the background?
ne mozes
keep in min all channels exept #general-int and #support are english only
A bot with a tick? I have my bot verified
Oh
and the verification is closed
idk i dont do much css/html stuff.
well, i too
use Photoshop
started to make a dashboard for my bot a few months ago but havent really worked on it for a while
body {
background: #FF9300 !important;
}
#menu {
background: #FF9300 !important;
}
</style>```
@earnest phoenix
there is news
and there is showed every part how its called
this up thing?
its entity-header
Hello, can someone help me with my command handler?
Im getting the error "TypeError: Cannot read property 'run' of undefined", I've made it so that the bot reads all messages that have the prefix before the message
are you missing a run function in one of your command files
No, the problem is
That if someone makes a typo in a command, like mistakenly changed "-ping" to "-pung", the bot still tries to read a file names "pung", which doesn't exist
How do I make it only detect the real commands and not every message which has "-" before it
Alright, then you need to see if the command exists before trying to run it. For example, if you stored your commands in a map, you could use .get(...) and see if the value is undefined (no key found). Hence, can you show your source code.
umm
just a sec
This is the command.js script ```const { readdirSync } = require('fs')
module.exports = (client) => {
readdirSync("./commands/").forEach(dir => {
const commands = readdirSync(./commands/${dir}/).filter(file => file.endsWith(".js"))
for(let file of commands) {
let pull = require(`../commands/${dir}/${file}`);
if(pull.name) {
client.commands.set(pull.name, pull);
console.log(`${pull.name} has been loaded.`)
} else {
console.log(`${file} has an error.`)
continue;
}
if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
}
})
}```
not sure if sync is the correct way to go tbh
In the index.js file client.commands = new Collection(); client.aliases = new Collection();
hmm
const array1 = ["e8c547","30323d","4d5061","5c80bc","cdd1c4","90ffdc","8de4ff","8ac4ff","dcd6f7","a6b1e1", "001021","034748","1481ba","11b5e4","0caadc","f1e3f3","c2bbf0","cca43b","e5e5e5","ffffff", "40f99b","61707d","9d69a3","f5fbef","e85d75","e5d4ce","de6e4b","0d1321","ffeddf","1ccad8", "d7fdec","a9fbd7","b2e4db","b0c6ce","938ba1","fbaf00","ffd639","ffa3af","007cbe","775b59", "16bac5","5fbff9","efe9f4","171d1c","5863f8","ff5e5b","ffed66","522b29","37ff8b","a06b9a"]
var randomcolor = array1[Math.floor(Math.random() * array1.length)];```
i try to print randomcolor in an embed
but it just gives a black embed
instead
nvm readdirSync is correct
It's a loader, so it shouldn't really matter.
yea
But the loader is not important here. It's the message event, which should try finding the command and running it.
in JS you can use RANDOM you know
i know but
you need either a hashtag or don't represent it with strings, just pure hex, i.e. 0xffffff
the colors r ugly
orthat
This is in the client.on message event const args = message.content.slice(prefix.length).trim().split(/ +/g); const cmd = args.shift().toLowerCase();
why is my bot not caching all members and guild.members.fetch returning undefined??
what lib?
discord.js
@sudden geyser https://hastebin.com/otuluviqom.typescript
i added #hex but
Index.js file
try fetchAllMembers in the client settings
I have.
hmm
you need to regenerate the color on every command
you can't keep it outside of the scope of the event otherwise it will remain static and unchanged
o
how would i regenerate it
var randomcolor = array1[Math.floor(Math.random() * array1.length)]; is what i have to
call it
take a guess
@terse berry so what matters is: ```js
let command = client.commands.get(cmd);
if (!command) command = client.commands.get(client.aliases.get(cmd));
if (command)
if (command.timeout) {
// ...
}
command.run(client, message, args);
You could try logging `command` to the console to see what the value is before the command runs.
It looks correct at first glance.
use let and move the variable inside of the event scope, otherwise you're going to run into concurrency issues @sterile lantern
I also noticed doing this makes the bot unresponsive and not emit events
how would i put inside of a embed event
I want the bot to ignore everything except the real commands
or should i put it before the embed
hmm maybe your server is overloaded bcs of so many guilds
only?
and not only ignore the message if the prefix is not there @sudden geyser
o nvm
yep
its local rn
I know, hence to debug it, logging the value of command is a step to figuring it out. By the looks of your code, command.run(...) is being run even though you're seeing if command exists. It looks correct yet the only thing weird is the lack of braces.
Now what does it show when the command is mistyped
Does it print anything above it (like it would with the console.log call).
handle non existing commands before executing them
hmm
Interesting, you could try adding braces: if (command) {...} to make sure JS is not interpreting command.run(...) outside the check to see if the command exists
Superbrain that is what they're doing sort of
Ok, I'll try
check if your collection contains the command if not return
rq
just realised, the bot does not completely start with fetchAllMembers, as I said only 1 server 5 members, ready event never emits
They're doing that too: https://hastebin.com/otuluviqom.typescript
lol
Alright
braces fixed it
._.
never not adding braces again
lmao
@sudden geyser @lusty quest Thanks :D
well then
but im not sure if this will be bullet proof. like the only line where you check if the command is invalid it searches for an alias.
or did i forgot a line?
If it isn't a command, it returns false in if(command) {...}
in the hastebin if (!command) command = client.commands.get(client.aliases.get(cmd));
it's there
This is there too if (command) { if(command.timeout){ if(Timeout.has(`${message.author.id}${command.name}`)){ return message.channel.send(`Wait ${ms(command.timeout)}econds to use that command again. DON'T BREAK ME!`) } else{ Timeout.add(`${message.author.id}${command.name}`) setTimeout(() => { Timeout.delete(`${message.author.id}${command.name}`) }, command.timeout); } } command.run(client, message, args); }
The weird part was JS not respecting the whitespace
uh
ok?
Yeah that was the prob lol
you spelt seconds wrong
econds
The module names it {no of seconds}s so I wrote econds at the end @young flame
naise
come back when the people are back who dont like js but code in node
@terse berry you can use ms(the number, {long: true})
._.
El what
That's done by the module ;-;
oof
odule is stupid then
see how stupid that is
odule sounds dumb
module doesn't sound bad smh
nice
@young flame I'm good, really tired tho
why is fetchAllMembers making my bot take 5 minutes to start and then not even caching all members in the end, only 1 server with 5 members...
maybe slow internet connection?
fetchAllMembers fails if you dont have the server members intent
And it doesnt error when it fails, it just waits for 2 minutes before it times out
how to reply to a message like this?
.votebutton{
background: rgb(52,207,235);
background: linear-gradient(344deg, rgba(52,192,235,1) 0%, rgba(52,192,235,1) 100%);
color: white;
}
</style>
<style>
.bot-img{
animation: float 2s ease-in-out infinite;
}
@keyframes float {
0% {
box-shadow: 0 10px 25px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
}
50% {
box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
transform: translatey(-20px);
}
100% {
box-shadow: 0 25px 55px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
}
}
</style>
<style>
body {
background-image: url("imagelink");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.columns .bot-img{
border-radius: 50%;
}
</style>
<style> .bot-name{ background: -webkit-linear-gradient(0deg, #058BF2, #4AC3E8 , #00F2FF); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } </style>
Dunno why its broken oof
All the class names changed I think
ID props too probably
#reviews>.reviews__action>h2.override {
}
i believe
yea it worked, ty
idk how but in discord.js its not a thing for now. but there is a open pull request if you want you could merge it yourself
Hi, i would like to know how i can change the background of this buttons, what class i need to target? https://alexander.is-ne.at/MzxWNV
.entity-button works
Thx 😄
Dint have to be an arse bout it
hi for some reason some of my bots don't react to my discord server and that i don't know how to upload an image on my server at the top can you help me ?
Hello
Not sure, but is it considered as spam if my help command sends out 2 embeds but the second embed is like 2 lines only?
can you tell me where that info is written
First Embed is the help embed
Second Embed is an embed regarding bot incident. doesnt send ALWAYS, only at incidents..
Its written in the html code of the website
Right click > inspect element
anyone?
👍
I've seen bots that send 4 embeds at the same time, all full
You wont get banned for that no
But you can only send 5 messages per 5 seconds, so the more you send at once, the less commands you can respond to
Ohhhhh what too?
Inspect element
I'm no mobile rn cant inspect
So do it later on a pc
So, I've got this code:
else if(message.content.startsWith(prefix + "setprefix")){
if(message.member.hasPermission('ADMINISTRATOR')){
const args = message.content.slice(prefix.length).trim().split(' ')
require('./config.json').prefix === (args[1])
}
}```
The command would be something like `>setprefix !?`. The prefix is stored in my `config.json` file. This code is trying to change the prefix in the config.json file the the first argument of this command (in this case, changing the prefix to !?). Also I'm only trying to do this for the guild the command is run in. It wouldn't change the prefix of ALL the servers the bot is in.
You need to use =instead of ===
ohh
== and === is for comparing
ah
your prefix won't be saved with this code
Damn
It will be reset once your bot restarts
it wouldn't even store it in memory once you leave the function and gc clears it
the scope of your config object is just inside that if block right now
anyone know what image types discord supports
I have .jpg .jpeg and .png in my list rn
(im not gonna use .gif btw so it doesn't count)
webp
ok
and i mean also
image formats that let you actually see the image
and it doesn't just get sent as you know
a file
Yes, I understand lmao
I cannot use inspect element on my current device and people are refuting to help give me class names / ids, what should I do...
what's your current device? @warm bolt
if it's generated dynamically you wont be able to see it tho
ok I got the source nice
Quite frankly idk how it helps me
it has no correlation to my code
apart from being html
Ah I see
Hey guys, technical question. Currently my Discord bot's code is a series of conditions with a simple on_message() event. For example, if message.content.startswith("dc.command") etc. It's not using sharding or separate files for commands. Now it has reached 2300 servers, including some with 50k+ members and it looks like it is starting to slow down. Can it be due to this, should I rewrite the code to include sharding?
Can it be due to this, should I rewrite the code to include sharding?
yes and yes
startsWith is super slow once you start scaling it
you need to use a proper command library or build your own
Is Discord.py good enough for scalability?
Okay thank you, feel like it's gonna be a ton of work to change the code's structure
are you using dpy right now?
they have a built in command library, you should check that out
Okay thank you 🙂
Uhm
hey I'm stuck and I would like to know what is the command in javascript so that the bot can do a poll imself
is it html ?
pull them up with a negative margin-top ig
if it doesn't work, it's probably because you're clipping them
also that styling is webkit
meaning no firefox support for a lot of shit
you should use firefox as the browser to style
or use https://caniuse.com/
if you're more interested, see: https://www.youtube.com/watch?v=a-V8GFtwjos
Start creating responsive layouts with confidence with my free responsive layouts course: https://courses.kevinpowell.co/conquering-responsive-layouts
Chrome is a great browser, and for JS debugging it has the upperhand, but if you're writing CSS, there's no reason not to be using Firefox as your development browser. It has some amazing feature...
Idk how to do that with top.gg
It's literally the stars on the top.gg bot page
yeah but you're using css styling
Well I was just thinking that the size of the stars
Is all preset
So how can I mess with that
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="class="entity-header__star star icon"">
<path class="svg-star" d="M8.10314 1.05616L6.06251 5.19366L1.49689 5.85928C0.67814 5.97803 0.350015 6.98741 0.943765 7.56554L4.24689 10.7843L3.46564 15.3312C3.32501 16.153 4.19064 16.7687 4.91564 16.3843L9.00002 14.2374L13.0844 16.3843C13.8094 16.7655 14.675 16.153 14.5344 15.3312L13.7531 10.7843L17.0563 7.56554C17.65 6.98741 17.3219 5.97803 16.5031 5.85928L11.9375 5.19366L9.89689 1.05616C9.53127 0.318658 8.47189 0.309283 8.10314 1.05616Z" fill="#9FA6B2"></path>
</svg>
Like that^
I cant edit it
I'm not that pro on css styling so this is all kinda confusing to me
Aight,
Tried this dont work oof
Bet I'm doing it wrong
well you moved it by one pixel
you should probably talk to someone who's studying law
Let's try 20 😂
ill just not add it lol
using discord.js & canvas, how can i cut an avatar in half?
@earnest phoenix tried 200 and it didnt budge
it's the line height that's messing them up
set line-height to 1 on entity-header__star class
Can you please verify my bot?
nope
everytime you ask you need to wait an extra week
😦 okay

somebody know why when i use my nuke command the channel is on the bottom ot the channels
and if somebody know how to fix it
there is defo a better way of writing this code, simpler, less messy, anyone able to help out LOL
yeah you could just have a list of roles and iterate over it
yo guys i don't know why, but recently i had this error when i want to play music with my bot
erreur de dispatcher : Error: input stream: Error parsing info: Unable to retrieve video metadata
make a list of roles and iterate over them
Toxica remix
On a User, Member or ClientUser instance, see the avatar_url property: https://discordpy.readthedocs.io/en/latest/api.html#discord.ClientUser.avatar_url
gotta love it
Don´t work
do you know how to code?
Follow Lite's advice and read the docs, Stack Overflow is very specific.
You need to be specific. What doesn't work about it.
This is my script
*@bot.command()
async def avatar(ctx, , avamember : discord.Member=None):
userAvatarUrl = avamember.avatar_url
await ctx.send(userAvatarUrl)
I have imported their respective libraries
And I get an error and it says:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'avatar_url'
Do you know what to do there?
this
The "attribute" avatar_url
and I do not know what to do
well i mean avamember wasn't passed in the command
To know what to do requires understanding the error: AttributeError: 'NoneType' object has no attribute 'avatar_url'
'NoneType' refers to when something is None. has no attribute X means you tried using dot notation (x.y) to access a property that doesn't exist.
Put the puzzle pieces together, and now you have this: avamember was None and you tried using .avatar_url on it, just like in your source code. ```py
userAvatarUrl = avamember.avatar_url
If the user is required to supply a user, you shouldn't be defaulting to `None` because it should never be `None`.
@wind vault so, try removing `=None`
He shouldn't remove it he should make sure that it is supplied so that the exception isn't thrown
So they should remove the default case of None to say it's required?
discord.ext.commands.errors.MissingRequiredArgument: avamember is a required argument that is missing.
New error 😦
So, do I remove the = None or not?
See, you didn't supply the avamember argument when you ran the command.
So, do i remove the discord.Member?
that would throw the error as the function is called rather than letting him check and perhaps sending a usage message to the user
Sorry, I'm just learning to program and then I don't understand many things,
😦
For example, what was the error there and how is it solved? and how would the result be?
sorry i meant to send that one earlier discord just took a while to send that one
lmao
kinda seems out of context now
I believe
*@bot.command()
async def avatar(ctx, , avamember : discord.Member):
userAvatarUrl = avamember.avatar_url
await ctx.send(userAvatarUrl)
The script and the error is this:
discord.ext.commands.errors.MissingRequiredArgument: avamember is a required argument that is missing.
lets take this for example
def test(bruh: str = None):
if bruh:
print(bruh)
else:
print("please provide a string to print")
test()```
if u ran this code with your python interpreter it would print back please provide a string to input
now if u put a param in the function call that was a string it wouldn't print in back
you can do the same thing with your command
How are you using the command?
Like, what are you entering when you use the command
So I have to print 2 times?
This command i use now:
@bot.command()
async def avatar(ctx, *, avamember : discord.Member):
userAvatarUrl = avamember.avatar_url
await ctx.send(userAvatarUrl)
Ok
I need to see what you're doing to trigger it because I think the problem may be you're not mentioning anybody
may be
bot.run(token)

