#development
1 messages ยท Page 1404 of 1
how else would you do it?
oh
makes more sense
you're getting the wrong element
find where the color is set in your CSS
thats the thing
ive been trying to for the last 1.5 hours
i know where the white color thing is
but i legit cant figure out where
can i just overset it in html?
could you share it?
css?
u want 25k lines of css?
are you using bootstrap?
well kinda but not really
just use the inspect tool on the button
not sure how to explain it, but like we just found a bunch of css we thought we needed and put together
look at the styles
you could but how would you know when to change it
how would I get this to work?
if(user.includes(admin)) message.reply("cannot remove an admin!")
Includes admin? U mean a role?
admin is a role
let admin = message.member.roles.cache.has("710751019495194645")
then user is const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || bot.users.cache.get(args[0])
Thats for checking if the member who executed the command has the admin role
ah
Thank you
And also remove the || bot.users.cache.get(args[0])
Since the user could be at another server and that server doesnt has the same role
if(user.roles.cache.has('710751019495194645')) (node:13800) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'roles' of undefined
no clue
;-;
user is undefined
user is defined as const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || bot.users.cache.get(args[0])
not mentioned and args is either an invalid id or not found in the cache, so it ends up being undefined
Thank you
if in bot.on message i have it so where it changes someones message into an embed, how would i save that so i can use it when someone reacts and it changes color based on how much reactions
i can fetch all the documents with filter but i cant get different variables of filters
why i get undefined :/
hmm this is kinda annoying me i keep getting this error and tf is a cog.database
code inside the file that should be used by th cogs
sending 1 sec
How can I make my bot leave servers below a certain amount? ( discord.js v12 )
@commands.command()
@commands.has_role("Meeting_Controls")
async def start(self, ctx):
user = ctx.message.author
role = get(user.guild.roles, name="Meeting_Participant")
await user.add_roles(role)
@commands.command()
@commands.has_role("Meeting_Controls")
async def end(self, ctx):
user = ctx.message.author
role = get(user.guild.roles, name="Meeting_Participant")
await user.remove_roles(role)```
Is there a way to make this command role everyone in the server the role? (server only has like 10 people) (Ignore the `ctx.message.author` it was for testing purposes)
*please ping me if you can help answer this inquiry*
@agile lance not sure how js works but if you can, make a check so the bot sees how many users are in it, then if its below, lets say 10 or whatever it leaves? sorry this may not help at all
Hm, Iโll try it
You gotta do a filter() on the guilds collection
Loop through your servers and if the member count is below your amount, leave the server
And do a for loop to leave them
If you're going to loop you don't need to filter anyway
[Imagine it's not working as intended and all guilds are gone]
anyone here know discord.py rewrite?
You want to list everyone with the role?
yo
Im trying to check how long it has been since a member has last kicked someone
wait a minute
@pale vessel i want to role everyone a specific role
Add a role to everyone with a specific role?
no so like lets say i do .start it roles everyone in the guild "Meeting_Participant"
What do you mean by "it roles"?
the bot
It adds a role to everyone?
"it" refers to the bot
so i do the command "start", the bot roles everyone in the guild the role "Meeting_Participant", is that possible?
someone told me to make a loop with ctx.guild.members
Yeah
how does one create a loop? heh
But that sounds like an API abuse
Yeah and how many members?
like 8
Oh
its so when a user has that role they can speak
its for among us
:/
so people dont talk not in meetings
bc rn we have to manually mute people and it takes awhile
Trust me, i tried that
it ratelimits the fuck out of your bot
at like 4-5 users, it breaks completely. I did it through if one user muted (presumably with the role "master"), the other users will get muted too
but yeah, ratelimits
tryna make a vote reward system that rewards all guilds that the user and bot are apart of, anyone got an idea of how to fetch all those guilds that the user is in?
@ me
@rustic nova @restive lily What about using a muted role without permission to talk in VC rather than server/muting them. That endpoint is muhc better than the ones you trying with the manual mute
Works partially, until you have members that have admin permissions
or manage channels (iirc)
account for that
check role permissions
its cached, shouldnt even be an issue to check for that
and then server-mute the users that couldn't be muted through the role?
correct

have fun
discord.Guild.icon_url
what exactly is that?
is it the long description or whatever its called in top.gg
where you can use code n stuff?
now thats useful
If I wanted to embed my website into the site description what html code should I put?
Yes
Does anyone know a fix for:
MinigetError: Status code: 429
at ClientRequest.<anonymous> (C:\Users\HP\Desktop\music\node_modules\ytdl-core-discord\node_modules\miniget\dist\index.js:163:31)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:596:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at TLSSocket.socketOnData (_http_client.js:469:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at TLSSocket.Readable.push (_stream_readable.js:212:10)
429 is rate-limited, meaning, the server is denying the request because you're making too many of them.
so this comes from either youtube or ytdl ;-;
probably youtube.
but my api quota says that it is all okay
This isn't about quota
It's about rate limits.
As in, limited by x/interval (just like discord has rate limits)
i find it weird that it only does that randomly once every few weeks/months
Perhaps you get more requests in those cases.
it always happens after my bot crashes because of a 403 error
Maybe you should catch errors then 
Gotta catch 'em all
that is what i am currently working on doing but the 403 error has a stop function on it from ytdl.
I'm not very familiar with ytdl to be honest but I'm sure it has a way to catch errors and prevent crashes
it prevents crashing on every error even 429 except for the 403 error for some reason
is it ytdl or youtube search api
youtubes search api has limits per second, minute, week, month iirc
Ytdl is not for searching
With the status 429 on ytdl-core, I found that the only way to fix it in my case was to generate a new API key
well you reached the quota
I only used it like twice and I was the only one with access at the time so I don't see how I did
@chilly veldt
idk if someone already answered this, but here you go
client.guilds.cache.forEach(server => console.log(server.name))
Emm
Hi
How can I change the nickname of an user?
with discord.js
I tried with message.member.setNickname and doesn't work
Hm
also with the id but the same
has to work
very helpful hope
i made a new app in heroku, where do i choose in the dyno that its not a web
?
i made the Procfile already
welp even creating new youtube api keys doesn't work ;-;
What is in your Procfile?
You need to put
worker: node index.js
In the Procfile
i did
but i dont know how to update that so it will update in the web so it will let me
@blissful raft
In the Dyno tab
Umm, I changed mine then it showed up in Dynos
It may take some time
Auto deploy ?
When I used heroku I had mine auto deploy from GitHub
First time deploy manually then select auto deploy
Then after some time (1-3 min) The dinos will appear
You can turn off web and turn on worker from there
its not letting me deploy
What does it say ?
1s
okay while i didnt look
it didi it it self
now i just need to wait till the dyno will show me that option?
Oh,
You're using Heroku git
I thought you were using GitHub
Well I don't know what I'm looking at
Sorry,
Can't help
how come in this code
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
when you restart the bot
it dosent let you do the code anymore?
like it dosent do the code if you stop and start the bot
anyone know how to upload mp3 from assets?
does that have todo with the code or because of the function messageReactionAdd?
how to add external emoji in the bot commands please tell
basicly put the emoji in your server, and do <(emoji name):(emoji id)>
i guess
if that's not react though
ok thanks
ok
message.react(<Client>.emojis.cache.get("id"))
<:(emoji name):(emoji id)> @earnest phoenix
Hello
hi, how to get messageAttachment url from my code? i want to put into embed.setURL
how would you get the reason to log in audit logs using .ban()? I am able to use the .kick(reason) and it logs it fine in the audit logs, but not for the ban command. Discord.js
I might be able to help.
You need to use
message.guild.members.ban(user, { reason })
Thank you!
๐ ๐
i make a different way but that one works to
Probably u define the member first and then you do member.ban({reason: reason});
?
NzgwNzA4ODc0OTE0NjI3NTk0.X7zBzA.-3gwV853BJTOa8LHb1ZCc25nkLs
what is this
?
bot token ?
Undefined?
?
Can i do anything to remove the "undefined" part
lemme see ur code
show code
there may be a error in your code
async execute(client, message, _args, {config, Ticket}) {
const embed = new MessageEmbed()
.setTitle('DynamicBot help list')
.setColor("32FF00")
.setDescription(`DynamicBot Commands list!`)
.addField(' :gear: **Admin** :tools: **suggestion** :moneybag: **Invites**\n\`,help admin\` \`,help suggestion\` \`,help invites\`\n')
.addField(' :love_letter: **Tickets** :notes: **Music** :gift: **Giveaway**\n\`,help tickets\` \`,help music\` \`,help giveaway\`')
add , false at the end
of
.addField(' :love_letter: **Tickets** :notes: **Music** :gift: **Giveaway**\n\`,help tickets\` \`,help music\` \`,help giveaway\`', false)```
use "\u200B" at value
Does sharding is necessary and does it works for a bot that is less than 2.5K servers??
@harsh blade i am recommended to use description to make this
Hm
will try ig
a vps
DynamicHost
.addField("This is name", "This is value")
you can use
.addField("\u200B", "here your help command")
its paid i need free
you're out of luck then
DynamicHost is free
promotion op
Wdym?
i joined your server
but you did not help me
to host the bot
Bruh
what
Will '' work aswell?
Like if i have " and ' mixed
need a help
lmao
yes
.addField("your help command", "\u200B") make like this
i added code guildcreate event that bot will send messag to system channel of server but how can it send to any other channel like NQN
\u200B is like invisible text,
message.mentions.users.first() ||
message.guild.members.cache.find(m => m.id === args[0]);```
``` message.channel.overwritePermissions(member.id, {
VIEW_CHANNEL: true,
SEND_MESSAGES: true,
READ_MESSAGE_HISTORY: true,
});``` anyone know why this errors with ```(node:18392) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.```
PLS
yeah
np
i need some help
hello! Currently I am trying to fetch information from the discord api using users/{id}, but I seem to be getting a 401. I'm properly authenticated and users/@me works, why doesn't the users/id work?
Sorry, my guildMemberAdd event doesn't work
Event
const { MessageEmbed } = require('discord.js');
const canva = require('discord-canvas');
const welcomes = require('../database/models/welcome');
module.exports = (client) => {
client.on('guildMemberAdd', async (member) => {
if(member.bot) {
return;
} else {
const wel = await welcomes.findOne({
guildID: member.guild.id,
guildName: member.guild.name
});
if(!wel.channelID) return;
if(!wel.Message) return;
const msg = wel.Message;
const chann = wel.channelID;
let card = await new canva.Welcome()
.setGuildName(member.guild.name)
.setAvatar(member.user.displayAvatarURL({ dynamic: true }))
.setMemberCount(member.guild.memberCount)
.setText(`Welcome to Server ${member.guild.name}`)
.setDiscriminator(member.user.discriminator)
.setBackground("https://cdn.mos.cms.futurecdn.net/2eUcV2529hH4DtBjHAH2b9-970-80.jpg")
.setColor("border", "#07e65c")
.setColor("title", "#07e65c")
.setColor("username-box", "#07e65c")
.setColor("discriminator-box", "#07e65c")
.setColor("message-box", "#07e65c")
.setColor("avatar", "#07e65c")
.toAttachment();
let embed = new MessageEmbed()
.setImage(card.toBuffer())
.setDescription(msg)
.setFooter(`Joined at ${Date.now()}`)
.setColor("#131413");
member.guild.channels.cache.get(chann).send(embed);
}
});
}
Command:
const welcomes = require('../../database/models/welcome');
module.exports = {
name: 'setwelcome',
category: 'General',
description: 'Set Weclome Channel for Welcome Message!',
usage: 'f!setwelcome <#channel> <message>',
run: async (client, message, args) => {
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send(`You don't have \`MANAGE CHANNELS\` permission to do that!`)
.then(m => m.delete({ timeout: 10000 }));
let channel = message.mentions.channels.first() || message.guild.channels.cache.get(args[0]) || message.channel;
let msg = args.slice(1).join(" ")
const settings = await welcomes.findOne({
guildID: message.guild.id,
guildName: message.guild.name
}, async (err, guild) => {
if(err) console.log(err);
if(!guild) {
const newGuild = new welcomes({
guildID: message.guild.id,
guildName: message.guild.name,
Message: msg,
channelID: channel.id
});
newGuild.save()
.catch(err => console.log(err));
return message.channel.send(`Please Retype the Command`).then(m => m.delete({ timeout: 5000 }));
}
});
if(!channel) return message.channel.send("Please Select a Channel!");
if(!msg) return message.channel.send("Please Specify a Message!");
await settings.updateOne({
Message: msg,
channelID: channel.id
});
message.channel.send(`Seted Welcome Channel: ${channel} **(${channel.id})**\nSeted Message: *${msg}*`);
}
}
What happened?
sorry i can't help because i never use like that
@humble rock you need to enable the intent at the portal
go to the developer portal
Yes
go to your app
Ok
then the bot tab
Ok
scroll to the gateway intents and toggle on GUILD_MEMBERS
1 or 2?
server members
should work
I'm trying
@pure lion, doesn't work ):
https://stackoverflow.com/questions/64839772/how-to-make-a-setwelcome-command-using-databasemongodb-and-discord-js
I was inspired by this article
Someone can help me again?
ye
I think I learned that u need to be authenticated with a bot account rather than a user's oauth2
just simply dm them
remember that this user has to be in a guild with the bot
variable names are case sensitive
thanks ๐
dbl.webhook.on('vote', vote => {
let user = client.users.cache.find(user => user.id === vote.user).tag
client.channels.cache.get("764317983131828277").send(`Thank you ${user} for voting Isla on top.gg`)
});
its not doing anything when i voted my bot
self voting, i see 
hey guys what is used for adding a delay sending messages
setTimeout();
You can wrap it inside a promise and do something like await delay(3000); send();
how would i store an embed properly so i can use it later? like one that was already sent i can edit later on a different file?
how else would i test it??
@sly wing let's not

but i am not using async so it wont work
Then use setTimeout() or .then()
prob
It completely depends on your application
For simpler projects you may not even need 1 gb, but anything that caches a decent amount of data in memory may need 2-64 times that, depending on what you are caching and how much
what does Presence Intent do?
I code for like 6 Months now and I never knew what it stands for and I want to know it now
Basically allows the bot to access user's status and presence data
oh
So like if they are online, idle, dnd
oh so that's why bot always said undefined to status before i turned that thingy
ok thank you
I believe it also allows you to get their status / what game they are playing, not sure though as I've never tried using it for that
Hello, I am using discord.js I have an Id of a Server I Have a Bot on the Server How Do I Know How To Role A Member On That Server
Do you have this turned on
member.roles.add(role)
buddy i have to do with the server was
A message will be written from dm to bot and should give it a role in the server specified in the bot
here, this should cover all you need to know about roles and permissions. https://anidiots.guide/understanding/roles
i can't quite get what you're trying to explain
ok then i can specify the server with how the server was
I can't use message.guild
what do you have then
I only have the reverse
What's the reverse of messagse.guild? What event are you in?
let sunucu = client.guilds.cache.find(server => server.name === test);
What event are you in
So it's a DM
You can get a member from a guild by doing guild.member("some user ID")
guys can you fix this problem ? : /app/bot.js:48 log(`Yรผklenen komut ismi: ${props.help.name.toUpperCase()}.`); ^ TypeError: Cannot read property 'name' of undefined at /app/bot.js:48:44 at Array.forEach (<anonymous>) at /app/bot.js:46:9 at FSReqCallback.oncomplete (fs.js:153:20)
oh thanksss
let sunucu = client.guilds.cache.find(server => server.name === example);
let member = sunucu.member(message.author.id)
error ๐ฆ
help
what error
node:12347) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'member' of undefined
then it didn't find that server by name.
In an embed?
in a normal message
no
You shouldn't really be using guild.member anymore
UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'Embed Master' of undefined
theres a pr in line to be merged thats removing it
wait how do i put local images in an embed
hmm
attach the image w .attachFiles
UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'Embed Master' of undefined
why i got this err
show code
mine?
If I send you the code, can you solve it?
yes
let onaylama1 = db.fetch(onaylama_${message.author.id})
let onaylama2 = db.fetch(onaylama2_${message.author.id})
if (message.channel.type === "dm") {
if(!onaylama1) {
return;
}
let rol = "778693229767950356"
let sunucu = client.guilds.cache.find(server => server.name === onaylama1);
let รผye = sunucu.member(message.author.id)
if (message.content.toLowerCase() == onaylama2) {
message.channel.send('ok')
(รผye.roles.add(rol.id))
}
}
ur not check if the guild was properly found
const Discord = require("discord.js");
const fs = require("fs")
const client = new Discord.Client();
const { prefix } = require('../config.json');
const tempvoice = require("../tempvoice.json");
module.exports = {
name: 'tempvoice',
aliases: ['tv'],
description: 'Create a voice channel',
usage: 'tempvoice',
cooldown: 1,
guildOnly: true,
async execute(message, args) {
client.tempvoice [message.guild.name] = {
voiceid: args
}
fs.writeFile ("../tempvoice.json", JSON.stringify (tempvoice, null, 4), err => {
if (err) throw err;
message.channel.send(`Your Temp Voice Channel is set to ${args}`)
})
}};```
args ```js
const args = message.content.slice(prefix.length).trim().split(/ +/);
and dont use <guild>.member
thats not where ur error occured @cobalt spruce
cant u read a stack trace
guild.member() is like literally guild.members.cache.get()
why do they even have that
UnhandledPromiseRejectionWarning: ReferenceError: tempvoice is not defined
got new one
client.tempvoice = require("../tempvoice.json");
What
asking for homework but it's also kind of development.
How to convert decimal to hexadecimal?
number.toString(16)
hello just wanna ask, embed sometimes doesnt appear. does it have to do being rate limited or cpu/ram usage?
ุชุจู ุณูุฑูุฑ ุญูุงู ูุงูุนูู ุฌุฏุง ุฑุฎูุต
ุจู ุณู
ุชุนุงู ุฎุงุต
Anyone a idea how to get all online users a bot can see? I already got whitelisted by discord but its still not working
pls give me a nice css
channel.id 4head
uhh
@pale vessel how to do it without code
Mafs
?
What are you trying to do
how to make a guild only command?
friends please help (member.roles.add (role)). catch (console.error) I wrote this code But it gives Error
i mean i can use my bot in dm, I want to make the command only can used in guild
@ionic silo ```js
if (command.guildOnly && message.channel.type === 'dm') {
return message.reply('I can't execute that command inside DMs!');
}
(node:16063) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'add' of undefined
help please
let rol = "778693229767950356"
Any idea how to make my giveaway bot to ask for invites? to join the giveaway?
// Giveaway prize
let giveawayPrize = args.slice(3).join(' ');
// If no prize is specified
if(!giveawayPrize){
return message.channel.send(':x: You have to specify a valid prize!');
}``` this is based on all commands (start.js)
help me please :c
if (command == 'a' || 'b' || 'c' || 'd')It doesnt seem to be working
it always returns true
the giveaway bot to ask for invites
like wumpus bot
to join the respective giveaway
Any idea how to make my giveaway bot to ask for invites? to join the giveaway?
// Giveaway prize
let giveawayPrize = args.slice(3).join(' ');
// If no prize is specified
if(!giveawayPrize){
return message.channel.send(':x: You have to specify a valid prize!');
}``` this is based on all commands (start.js)
yes, the bot to ask for invites, if i set the invites to min 5, everyone who join will receive: "You don't have enough invites to participate to this giveaway" if they don't meet the requirement
man, no, it doesn't work, i opened a new role and wrote his id but it gives the same error again
@earnest phoenix
Hey! So
I Created a help.js command that returns a list of sub help directories ( Help music, help invites etc) But when i type ,help music
It just shows help.js (help list) and not the help music.js command
Any ideas? Feel free to @ me
let sunucu = client.guilds.cache.find(server => server.name === onaylama1);
let uye = sunucu.members.fetch(message.author.id)
let rol = "780790848564232202"
doesnt forcing users to join servers or ask them to invite people fall under join 4 join?
the giveaway bot to ask: "You want to set an invite requirement to join? " and if i put 5 for example everyone who has 5 invites to join, who doesn't is not allowed to join and the bot to remove his reaction @earnest phoenix
to invite
ppl
let onaylama1 = db.fetch(`onaylama_${message.author.id}`)
let onaylama2 = db.fetch(`onaylama2_${message.author.id}`)
let rol = "780790848564232202"
let sunucu = client.guilds.cache.find(server => server.name === onaylama1);
let uye = sunucu.members.fetch(message.author.id)
uye.roles.add(rol)
@earnest phoenix
i think that falls under J4J bots
there is a bot
that does that
(it's a private project i don't want it to publish here etc)
@earnest phoenix the erro doesn't mean that the the role doesn't exist
no
u can't add ID's as roles
u wanna use member.roles.cache.add
so what should i do
member.roles.cache.add
@earnest phoenix u said the error meant that the role didn't exist, wich isn't true the error clearly sais that member.roles doesn't exist
(node:16810) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
@tulip ledge
Would you like me to send the full code
oh and I'm sorry u don't need cache to .add u only need it for some
Just do:
console.log(member)
member.roles.add()
What should i write
dm can you come, i want to send the codes
sure ;-;
how to customize bot page background. just gimme code, i tired multiople methods including a bit of css. jus tell me. am nub at css.
no work w3
@summer perch put it all in a div with this attribute: style="background-color: (hex color goes here);"
Before the description, put this: <div style="background-image: url('linktoimage');">
ok
and at the end put </div>
use this https://markdowntohtml.com/
Convert your markdown to HTML in one easy step - for free!
ok
Then add the stuff I sent
Click enter markdown
where?
Blue text right at top of that screenshot
Alright, on the right side click "raw html"
Copy the text that shows under that, and put it somewhere u can edit it
kk
Error: EMFILE: too many open files, open I keep getting this error I think i might know what the problem is. Is there anyway to like unopen or remove files from cache?
Now add the stuff I sent you at the start and end
how to add cooldown to a command
still
not work
wait at the end of the code?
<p><strong>Nitro Type Commands</strong><br><code>n.news</code> - An interactive view of the latest nitrotype news<br><code>n.register</code> - Link your NT account to your discord!<br><code>n.stats</code> - Shows the stats of a nitrotype user.<br><code>n.team</code> - Shows the stats of a NT team.<br><code>n.unregister</code> - Unlink your NT account from your discord.<br><code>n.verify</code> - Verify your account ownership after registering!<br><strong>Games'n Currency</strong><br><code>n.bal</code> - Check Your Lacans!<br><code>n.guess</code> - A game where you guess a silhouetted Nitro Type car<br><code>n.noobguess</code> - A game where you guess a nitrotype car<br><code>n.leaderboard</code> - Check the users with the most Lacans!<br><strong>Meme'n Image generation</strong><br><code>n.meme</code> - Fetches a meme from Reddit
<code>n.communism</code> - Join the soviet union!<br><strong>Useful</strong><br><code>n.bug</code> - Report a bug in the bot!<br><code>n.feedback</code> - Give the developers a feedback!<br><code>n.help</code> - Shows a list of commands and their descriptions!<br><code>n.info</code> - Get info about this bot.<br><code>n.invite</code> - Invite this wonderful bot to your server!<br><code>n.ping</code> - Gives the latency between the client and the websocket.<br><code>n.server</code> - Join the support server!<br><code>n.shard</code> - Lists all the shards in the client instance.<br><code>n.suggest</code> - Suggest a feature or command for the bot.<br><em>We have many more commands. Just type <code>n.help</code> and you will see a list of a bunch of commands!</em></p>
``` like that?
the </div> goes at the end of all the code
and replace link to image with a url to the image u want
oya k
@earnest phoenix If you go to your bot page there should be an edit button
@earnest phoenix Then edit the description, it works with HTML and MD I think
ok one moment typerious
k
typerious whats the url to the background image you want
ok
wait
the link is long idk why
wait ill get better img
yea this one
https://simplycoding.org/wp-content/uploads/2020/09/Nitro-Type.png
yeah that was the whole image, not just a link. which can be better sometimes
alright
Oily Ill help u with it in just a moment, almost done helping typerious
ye k spit what next?
one second, im gonna send it to u
kk
how to add cooldown to our command?
Typerious <div style="background-image: url('https://simplycoding.org/wp-content/uploads/2020/09/Nitro-Type.png'); background-repeat: no-repeat; background-size: cover;"> <p><strong>Nitro Type Commands</strong><br><code>n.news</code> - An interactive view of the latest nitrotype news<br><code>n.register</code> - Link your NT account to your discord!<br><code>n.stats</code> - Shows the stats of a nitrotype user.<br><code>n.team</code> - Shows the stats of a NT team.<br><code>n.unregister</code> - Unlink your NT account from your discord.<br><code>n.verify</code> - Verify your account ownership after registering!<br><strong>Games'n Currency</strong><br><code>n.bal</code> - Check Your Lacans!<br><code>n.guess</code> - A game where you guess a silhouetted Nitro Type car<br><code>n.noobguess</code> - A game where you guess a nitrotype car<br><code>n.leaderboard</code> - Check the users with the most Lacans!<br><strong>Meme'n Image generation</strong><br><code>n.meme</code> - Fetches a meme from Reddit <code>n.communism</code> - Join the soviet union!<br><strong>Useful</strong><br><code>n.bug</code> - Report a bug in the bot!<br><code>n.feedback</code> - Give the developers a feedback!<br><code>n.help</code> - Shows a list of commands and their descriptions!<br><code>n.info</code> - Get info about this bot.<br><code>n.invite</code> - Invite this wonderful bot to your server!<br><code>n.ping</code> - Gives the latency between the client and the websocket.<br><code>n.server</code> - Join the support server!<br><code>n.shard</code> - Lists all the shards in the client instance.<br><code>n.suggest</code> - Suggest a feature or command for the bot.<br><em>We have many more commands. Just type <code>n.help</code> and you will see a list of a bunch of commands!</em></p></div>
aight is that good
also id reccomend lighter color text on that background
@summer perch
I don't think it lets u do that
alr i'll test it
Why is it in the outside?
const embed = new Discord.MessageEmbed()
.setColor('#ffae6a')
.setTitle('Potato')
.attachFiles([`./potatoes/potato (1).jpg`])
.setImage(`attachment://potato (1).jpg`);
message.channel.send(embed);
wait but other bot pages have
idk, that's the only way I know
hm?
np
Oliy, for ur background just use this: ```<div style="background-image: url(โyourimageurlhere'); background-repeat: no-repeat; background-size: cover;โ>
Your description stuff here
</div>```
background color or image
aight use that then, replace the yourimageurlhere with a url to the imagte and it should be good
I cannot cuz the image is local
hi
aight one second
i just came to this channel and the first thing i saw is a guy sending his whole long description; not even on a paste site just as a big code block
@earnest phoenix ```<div style="background-image: url('https://i.ytimg.com/vi/h6yP6w2HW7c/maxresdefault.jpg'); /* background-repeat: no-repeat; */ background-size: cover;">
- | Ennard El Bot De Discord |
| Bot con mรกs de 40 comandos!|
|Bot en 80+ servidores!|
Comandos y utilidades:
- |Moderaciรณn: Kick & Ban|
- |Comando 8ball|
- |Comandos de Roleplay|
- |Comandos Generales|
- |Comandos Five Nights at Freddyโs|
- |Comandos Anime|
- |Comandos de Diversiรณn|
- |Comando de Roll|
- |Comandos de Avatars/รconos|
- |Comandos de la Tabla de Clasificaciรณn|
- |Comandos de Informaciรณn sobre Servidores y Usuarios|
- |Y mucho mรกs!|
|Nuevas actualizaciones vienen pronto! Estate atento!|
</div>```
Some of the quotes were the weird styled ones
anyone?
<style>
body {
background-image: url('https://i.ytimg.com/vi/h6yP6w2HW7c/maxresdefault.jpg');
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>```
@earnest phoenix
see if that fixes your problem
wait does using a style tag modify the whole page not just description?
How can i edit a message and turned it into a embed in v11?
orrr
depends on the CSS inside
<style>
.body {
background-image: url('https://i.ytimg.com/vi/h6yP6w2HW7c/maxresdefault.jpg');
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>```
<div class="body"></div>
oh the other guy was asking how to do that too
@summer perch Someone just sent how to do the whole background
@earnest phoenix help meh
how do I display a local image in an embed
you need to read the file data with fs then pass the Buffer object containing the data to Discord.MessageAttachment constructor
let i = Math.floor(Math.random() * 434)
const embed = new Discord.MessageEmbed()
.setColor('#ffae6a')
.setTitle('Potato')
.attachFiles([`./potatoes/potato (${i}).jpg`])
message.channel.send(embed);
```this is code
but images go outside
i see
you are attaching images
what you wanted is to display the image inside the embed body
yes
to do that you need to set it as (don't remember for MessageEmbed class) url property of image property of an embed object
which I don't know how to do
its local
Can someone please send me the code in dms for the 8ball command code for a discord bot codkng in Pydroid.3 that has hentai in it thatbif j made the bit send it it would auto play as if it was sent by a user??...
(e.g.) Send as a gif.
I just need it real quick to tesg something. Also... Ima edit it. If its ok with u.
@weary torrent we don't spoonfeed try figuring it out yourself and ask for help if you need with stuff
we don't just give you code
also i won't help with NSFW
no nvm
how do I do it with local images
Try giving it a name
setImage only works for url I think
i think it's the same method you used earlier for attaching files
attachFiles({ attachment: "path", name: "name.png" }).setImage("attachment://name.png")
Like that
.attachFiles([`./potatoes/potato (${i}).jpg`])
use the same url for .setImage
wait what
Well... Can someone help me understand how to make the bot send gifs??
And it only shows the gif??
no link nothin??
ah
@carmine summit remove the [ and ]
just upload the file like normal image
how???
or if you have a direct link to it just send the link in the message body
im gonna try flazepe's
it works
use setInterval
@carmine summit lol potato handling tips
potatoes go brrr
setInterval(() => {
/* change activity */
}, /* time in milliseconds */);
Thks
yw
Anyone knows how to set an custom image to a "game" playing on a bot? A game visualizer with a custom image
code by yourself, we only help if you are stuck
anyone also work with youtube_dl and ffmpeg and knows how to stop it from freezing the bot while processing a video?
i work in discord.py
this works fine and it uses ffmpeg
maybe its cuz im processing videos and audios on a raspberry pi3b+ ๐
if you're doing it synchronously, then yes it will freeze
you should fire up a separate process/thread to do it
pain
bread
jam
peanut
butter
am i able to do it using subprocess?
sandwich
happiness
yes that should work
You might want to use asyncio for this
alot of my video editing commands use os.system("ffmpeg -i in.mp4 out.mp4")
annoying thing is that bots dont get a higher upload limit
so if its too big it just goes to my cdn on my website XD
check this
ye good enough
you could look into something like streamable tho, or something that allows hotlinking
i could
i wanted to take advantage of having unlimited bandwidth and a stable upload speed
so i jsut used my own resources
does your link not embed/preview automatically?
rip
yop
Error ```xl
TypeError: message.channel.messages.fetch(...).edit is not a function
the web server is jsut apache2 so i dont think that would be the problem
alguรฉm br??
fetch() returns a promise, you must resolve it with .then() or with async/await. Learn more about promises here https://js.evie.dev/promises.
.work
dlpath = "/home/lombex2/optimbot/youtube"
ydl = youtube_dl.YoutubeDL({
'outtmpl': dlpath + "/" + "%(id)s" + ".ogg",
'format': "bestaudio/best ",
'nocheckcertificate': True,
'writethumbnail': False,
'postprocessors': [
{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
},
{'key': 'FFmpegMetadata'},
],
})
with ydl:
result = ydl.extract_info(
cleanal,
download=True
)
@quartz kindle this what process the audios
i have no clue on how i would use this in subprocess
or asyncio
look into the threading module
asyncio.run_in_executor do be hot
How do I make bot cogs??
I know haow to Im using a tutorial but...
On pydroid.3 mobile how do I??
I need a folder. Please dm me an answer xdd
threading is blocking afaik
threading is not really concurrent in python
nope
it's why Python is known for being slow, because you basically can only have one block of code doing something, not two blocks doing two different things
like, if you have two threads print a million numbers, I don't think it'll be any faster than not having threads at all to print 2 million numbers
i heard that threading in python is a literal nightmare
i mean
js is the same
thats why threads exist in js
arent threads supposed to do exactly that?
1
christ this hurts my brain
whats the point of threads if they block the main thread wtf
or am i not understanding something?
that's like if you want to join them, like if you made an HTTP request to a server and spun it off to another thread, then joined them together to get the value. At least that's one example, but not all use cases of threads need to be blocking
at this point py is as confusing as php
with css
Learn CSS, use developer tools in your browser to find which selectors you need
What does a hard restart mean on a VPS?
shutdown 'n boot up again
no
Ok
you will need to start the proccess again
Ok
When fetching ban logs from the audit logs, does it not fetch the logs without a reason?
ig they're fetched even without a reason
because the log is still there, albeit missing a reason
Ok, since they didn't when I tried without a reason
weird
(node:4) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
this is happening somewhere in another server
is there any fix? or a way to avoid receiving this in the logs if it's not fixable
you gotta catch that stuff
if you don't use catch, it'll just show you an error for missing permission
isn't it showing you where the error is?
like file; line
it's on a message.channel.send as I can see there
Hi
how do i stop a setInterval?
by using clearInterval(intervalName)
ah ok thanks
although, you'll have to run it in the same code you're starting the interval
ye
so if you just want to end it after for example 24 hours, you should be fine with clearInterval
if not, I would at least use a database to check for when to clear it
I've been using this catch line
.catch(err => { console.error(err); });
I know there are many ways to catch, but I don't know if any is better then another
there ain't "many ways" to catch actually, only 2
it's either try-catch or Promise-catch
both will do essentially the same thing: execute a code section when an exception is thrown
what you do inside the catch block is what really matters
in your example, all you're doing is logging the error (which in JS is almost the same thing that appears if left uncaught, except the "you must catch" message)
can u clear a itnerval in a interval?
state =true;
console.log(state)
if(!state){
clearInterval(loop)
}
},500)``` this is my code and `state` is a boolean tho when state is null it still runs the interval can someone help
.catch(console.error) does the same thing as .catch(err => { console.error(err); })
yes you can clear an interval from inside an interval
ye but it doesn't work
even tho the boolean is null the interval still runs
and ive cleared the interval if state is null
you're probably messing up your state
if you don't want to see those missing permissions errors you can just have an empty .catch()
client.on('voiceStateUpdate', (oldState, newState) => {
var state = null
if (!newState.channel){
console.log('left')
state = false;
console.log(state)
}
if (!oldState.channel) {
console.log('join')
state =true;
console.log(state)
}
let ifmute = newState.member.voice.selfMute;
if(ifmute === false){
var loop = setInterval(function () {
console.log("ok")
if(state === false){
clearInterval(loop)
}
},500)
}
});``` weird this is my entire code but even though i leave the vc which makes the state false it still doesn't clear theloop @quartz kindle m
you can't clear a loop that way
because loop is not defined yet
try with a lambda + this reference
lambda?
yeah, arrow function
setInterval(() => {
//do stuff
clearInterval(this);
})
idk if this works tho
but since this will be referencing the lambda, it might work
this?
sec
Arrow function don't have this
idk how to explain
no?
nope
Yes, they're anonymous
still consoles a lot of times
ye but it isn't working liek that for me
js is really weird
Isn't the first argument of the function the interval?
check this even though its false no stop for loop
what?
The first argument of the callback is the interval that's calling it
the lambda function is essentially a callback, by the time it is called, the interval is already defined long ago
1 more item to "Javascript's Bizarre Adventures"
@ivory seal your problem is that you're creating a new interval on every single voice state update
oh
you are not stopping older loops
is there any other way to track voice mins other than what im doing?
rn im just adding a number to a db
yes
oh whats that
when a user joins, save the timestamp
is that part of the object/
when a user leaves, check the timestamp, and compare with the saved one
yes
should i use local vars for that or save those two values to a db?
save it to a db
kk
tysm
var time2 = ""
if (!newState.channel){
console.log('left')
time2 = Date.now()
}
if (!oldState.channel) {
console.log('join')
time1 = Date.now()
}
var time3=time2-time1;
let unix_timestamp = time3
var date = new Date(unix_timestamp * 1000);
// Hours part from the timestamp
var hours = date.getHours();
// Minutes part from the timestamp
var minutes = "0" + date.getMinutes();
// Seconds part from the timestamp
var seconds = "0" + date.getSeconds();
console.log(seconds)``` so just for testing i took 2 vars but it returns - values sometimes what do i dp?
should I math.floor or math.round for rng?
and, if I put math.random() * 1 can I get 1 from there?
or 0.(9) at max. only?
that code makes 0 sense
that means I'll always get 0
you have two separate variables, and only one of them is defined at a time
so essentially you are doing time3 = date - "" or "" - date
if you want a random item from an array, you need 0
so I should put math.random() * 2 so i can get 1 at some point
I know the indexes
but, aren't the possibilities only 0 and 1 at Math.flor(Math.random() * 2);?
yes
so yeah, that's what I want
either 0 or 1 to randomize a gender
cuz my shop has pets, and the gender has to be random
if you only need rng between two states, just do Math.random() > 0.5
when buying xD
or < 0.5
๐ฎ
yeah true
const rndG = Math.random();
let gender = items.pets[pet].gender;
if (gender == 'random') rndG < 0.5 ? gender = 'โ๏ธ' : gender = 'โ๏ธ';
basically this
How to 'find' a channel in a guild in Discord.js again?
My code:
user.voice.setChannel(message.guild.channels.cache.filter(ch => ch.name === ":microphone:XP Lobby ${args[1]}"))
filter() => find()
kk wait
" => `
yep, thanks
ya ik
it didnt format correctly on discord
i changed it in the message so it shows up right
English: How to create a ticket systeme but no wis data bas
Franรงais: comment crรฉe un sytรฉme de ticket mais sans data base
english: you don't
you need a database
Yes but for 1server
then use another bot i.e. tickety if it's for a single server
Oky
Thanks
does anybody know why d.js when I do
.setTitle("Choose an option")
.setDescription("Which setting would you like to configure?")
.setColor("GREEN")
.addField(":one: - Auto URL Scanning", "Enable or disable automated url scanning in this guild.")
.addField(":two: - Auto Deleting Suspicious Links", "Enable or disable the deletion of suspicious links.")
.addField(":three: - Auto File Scanning", "Enable or disable automated file scanning in this guild.")
.addField(":four: - Auto Deleting Suspicious Files", "Enable or disable the deletion of suspicious files.")
.addField(":five: - Auto Delete IPs", "Enable or disable the automated deletion of messages with IPs in.")
.addField(":six: - Silent Mode", "Enable or disable reactions to safe files or urls.")
.setFooter(`| Created by ${client.users.cache.get("551854789990940699").tag}`, client.users.cache.get("551854789990940699").avatarURL())
let m = await message.channel.send(embed).catch(e=>{return;})```
does this?
(node:1085079) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
(node:1085079) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)```
update your node.js to 12 or higher
๐ค
same issue with v12.0
are you sure
I get the same issue with
let m = await message.channel.send({embed: embed}).catch(e=>{return;})```
what does node output when you run node -v in a console
i know how to make a command that makes a role with a permission that i want it to have, but i dont know how to make it remove permission, help
yeah sec getting my magic crystal ball ๐โโ๏ธ

What library
sorry for the stuppif question, library is node.js, etc right?
and language is discord.js, etc right?
@south sinew
nope
language is javascript or js for short
library is discord.js
node.js is the "runtime" or the "javascript engine" that runs the code
I need a register bot codes help pls
@sour steeple could you be more specific with your question?
I want a registry bot infrastructure
What do you mean by "registry bot infrastructure"
registration bot codes
Ok, what do you mean by that

Im from Turkey
Google Translate?
yeaa
so im assuming you are using discord js
Are you asking how to submit an application for your bot?

