#development
1 messages · Page 963 of 1
they wouldn't want to kill it
but like I said only the ads that are spammy and resource heavy will be killed according to them
Been using Firefox developer edition for about ten years
that
Imho they need to kill the chum networks, taboola etc
"you won't believe what she did when she saw this photo!!!!"
I wanna switch to another browser but literally everything I use depends on the sign in with gmail for syncing
What do you use?
chrome
You can keep chrome for those apps but just make another browser your default
I have chrome too but not as my default, need it to cast YouTube videos
or make your own
We have Chromecast in the living room
i only use chrome for an addon that firefox removed from their extension page :(
I just want edge to allow signing in with gmail but that'll get rid of the point
what was the addon
there's a css mod
https://github.com/muckSponge/MaterialFox i've been using this for a good year or so now
Look at subadub or subtitle pro
I wouldn't trust a Google sponsored ad block
That's like trusting tobacco company sponsored nicotine patches
I want it to block all ads as in the name
Sometimes it help if the site loves to throw 46675 new tabs
Non google ad adblock
i've been thinking of getting an rpi so i can run pihole on it
network wide adblock
But 90% of ads are Google network ads....
^
unless you're visiting pirating sites chances are you're going to get google ads
i don't have anything to run it on
Or unless you visit top.gg
Run it on the same pc you browse from cry
All it is, is a simple DNS server
yeah ikik but i want to keep it on at all times so it affects my phone while my pc is off
Hmmm, there's DNS servers you can put in the router settings that do the same
If you trust them
oh, might try that
Saves you running a pi
1.1.1.1 best
but yet again i don't even have a proper router, i've got a homebox running 4g+
How can I replace all spaces except the regular one? RegEx is hard for me but I'm trying
in what language
js
.trim()?
replace
no that's totally not what it does
replace only does the first occurance, so you need to add the global regex flag to allow it to reoccur
something like this:
.replace(/if char == ' ' ? do nothing : replace if it's another space/g, '')
/char/g
but what I said in regex language lol
no I want to replace all "fake" spaces
Empty Characters, Whitespaces & Blank Unicode Characters
empty chars
That's harder then
I mean, there're lots of blank chars
(char1|char2|char3|...)
I know .replace(/\s+/g, '') but then without the normal space
Is there not an option to replace all \s+ except ' '?
i'm really meh at regex so i don't know, i only know basic operations lol
oh okay np
you can use this tool https://regexr.com/
thanks
How do you make the discord bot have costum currency and the more they talk the more XP they get? A command is they can check their profile and see their XP and Coins. A normal User should make give [amount] [user], bank [user] or themself without adding a @. And a Admin should can make gift [infinite amount] [user] and take [amount (if its over a amount that the user has, he goes minus)] [user]. And a Jobsystem where the Jobs get everyday more money. And with the command work they can everyday get their coins, that I assigned to their job. And a marry and divorce command would be nice. so if anyone knows it by themself or knows a video, i would find it nice to see it.
Don't follow videos tutorial, please. Just learn js in general (assuming that your bot is using js) and how to use a db
i use python
how can i create a perma invite with discord.js?
Well learn how to use python
@earnest phoenix I don't think it's the nicest way, but solved it for now by replacing a normal space to the message object (just something random), replacing all spaces (\s+) by nothing and then replacing the object back to a normal space
edit: no don't do that lmao
i have it ^^
i have it ^^
but thanks
my bots music system stopped working so i try playing a song and it joins the vc channel and i can see the green ring around it is lit up my sound is at max its user volume is at max but no audio i checked logs and nothing
could be a Discord issue
what is the best language to create discord bots (i mean to create complex one's)
also has the ability to free host them
you can create 'complex' bots with every language
how?
so any language can does what other language?
the libraries are different
for sure there is a better library
Pick the language you like the most and create a bot with it, there's a library for interacting with the discord API for almost every popular programming language
-bots
-bots Fate Harsh#4310
-botinfo AMY
Please include a bot mention or ID
-botinfo 716893391560114186
716893391560114186
AMY
6561
A Moderation, Economy, Verification, Fun, Logging Bot
discord.js
/
1
0
No server count
@slow mirage
@small zenith
Invite | Website | GitHub | Support Server
-botcommands @small zenith
@small zenith
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
any py devs around?
im js
not helping :/
@earnest phoenix whats up
can i dm ya?
sure
HI
-bots
How do you make the discord bot have costum currency and the more they talk the more XP they get? A command is they can check their profile and see their XP and Coins. A normal User should make give [amount] [user], bank [user] or themself without adding a @. And a Admin should can make gift [infinite amount] [user] and take [amount (if its over a amount that the user has, he goes minus)] [user]. And a Jobsystem where the Jobs get everyday more money. And with the command work they can everyday get their coins, that I assigned to their job. And a marry and divorce command would be nice. so if anyone knows it by themself or knows a video, i would find it nice to see it.
maby search on fiverr, maby they know
-bots
there's 👏 not 👏 a 👏 yt 👏 tutorial 👏 for 👏 everything 👏
and 👏 you 👏 shouldn't 👏 use 👏 them 👏 in 👏 the 👏 first 👏 place 👏
so how i should do it?
MESSAGE_CREATE / message / messagereceived event depending on the lib you're using, hook into a database (my suggestions are sqlite for small scale, postgres for big scale), from there on you can store any data you want and pull it anytime you want, including your currency and your xp
and boom, profit
no, sorry
@earnest phoenix i cant read here https://discordpy.readthedocs.io/en/latest/api.html?highlight=presence#message anything about something like message_create or message received or something like levelup
and of course you're not going to find something like leveling, that's out of the scope of the library and up to you to implement lol
if (erkek.some(isim => msg.content.includes(isim))) {
Why doesn't it detect uppercase and lowercase letters?
Because you don't tell it to
Okay but is 8k sentence.
client.on("message", async msg => {
const args = msg.content.trim().split(/ +/g);
let isimk = args.slice(0).join(" ");
// let asd = isimk[0];
//isimk = asd.toUpperCase() + isimk.substring(1);
if (msg.author.bot) return;
let kanalid = await db.fetch(`${msg.guild.id}_${msg.author.id}_kullanici_kanal_id`);
if (msg.channel.id != kanalid) return;
//////////////////////////////////
let yask = args.slice(0).join(" ");
if (db.has(`${msg.author.id}.isim`) === true) {
if (!yask)
return msg.reply("**Yaşını yazmalısın. " + db.fetch(`${msg.author.id}.isim`) + "**");
if (yask) {
if (isNaN(yask))
throw msg.channel.send("**Yaşını** `(sayı)` **olarak sadece yaz. **");
await db.set(`${msg.author.id}.yaş`, yask);
msg.reply("**Kayıt işlemin başarıyla tamamlandı! " + db.fetch(`${msg.author.id}.isim`) + " iyi eğlenceler dilerim!**\n\n*İsim:* " + db.fetch(`${msg.author.id}.isim`) + "\n*Yaş:* " + db.fetch(`${msg.author.id}.yaş`)
);
}
}
// if (msg.content.toLowerCase() === erkek.some) {
// if (msg.content.toLowerCase(erkek.some(isim =>isim.includes()))) {
if (erkek.some(isim => msg.content.includes(isim))) {
var sayiiiiii = [];
for (var x = 0; x < 10; x++) sayiiiiii.push(x);
if (sayiiiiii.some(word => isimk.includes(word))) return msg.reply("**Sadece ismini yaz. Yaşını değil.**");
// if(isimk.includes(!isNaN(isimk))) return msg.reply("ismini yaz sayı değil")
msg.reply("Merhaba, " + isimk + ", şimdi **yaşını** (sayı) olarak **yaz.**");
//if(!isNaN(isimk)) return msg.reply('**Lütfen sadece ismini yaz, yaşını yazma.**')
db.set(`${msg.author.id}.isim`, isimk);
}
here is my code
...
how do you get the bot dev role?
oh when it gets accepted
You will know by Luca DMing you
thx
np
ok so I'm doing a command to create a role but when I answer yes to the mentionable and hoisted question it still sets it to off. Any ideas? https://sourceb.in/a7d3844a75
just ping me if you have a tip or any idea...I'm going be going back and forth between multiple servers. I took the line that says data out and am going to test it
Well it's hoist not hoisted
yeah I changed that...I even console logged responses...it's not even seeing the responses to hoist and mentionable
heck now it's not even doing the name or color...it's doing just like if you made a new role
Does anyone know of a list or something showing how much processing power/ram/bandwidth a bot requires based on usage (number of servers/users) and features (whether it does img manipulation/music streaming etc.)?
why i got this error code?
lvl_start = user[user.id]['level']
TypeError: 'Member' object is not subscriptable```
my code is this
experience = users[user.id]['experience']
lvl_start = user[user.id]['level']
lvl_end = int(experience ** (1/4))```
What do you pass as user argument when calling the function?
xp
What is xp
https://srcb.in/6bd1a0f397 ok so this code will put mentionable and hoist as false even if the response is yes...any ideas?
nvm got it
How would I get my bot to only accept a response if its numbers? Or if its a decimal?
What is
xp
@slender thistle experience
What object is it
that the user gets the experience
Do we get connections in discord.js?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
with css, how can i make that bit be a different colour?
the line and the bit under
shouldn't this delete a role? js const roleToDelete = message.guild.roles.cache.find(r => r.id === args[0]) try { message.delete(); if (message.member.id === message.guild.ownerID) { message.guild.roles.delete(roleToDelete) } else { message.channel.send('You do not have permission to use that command'); } } catch (err) { console.log(err) }

make sure you await it btw
How can i add a cooldown to my leveling system? I need it to give a specific amount of experience every 1 minute... (
- Python) ping if responded
Does anyone know of a list or something showing how much processing power/ram/bandwidth a bot requires based on usage (number of servers/users) and features (whether it does img manipulation/music streaming etc.)?
@open dove that varies a tonne, it depends on language, library used, and how optomized your code is in general
How can i add a cooldown to my leveling system? I need it to give a specific amount of experience every 1 minute... (:GWcodesPython: - Python)
@wise quartz do you want to do it by message, or just constantly give xp every min
By message
I tried to just asyncio.sleep for 60 seconds after it gives the experience but didn't work 😅
try making a function that you run when a message is sent. This function will check if it has been a minute since the user's last message, if so, add xp
im not super familiar with python so I can't provide an example
sry
Np i'll look into it tho anyone that could provide an example i'd appreciate it.
Ik, but is there at least a very rough guide?
dont think so, but a google search could help
That's why I've come here, the internet is completely empty lol
then I doubt it, sry
Ok, well thanks for responding anyway
simple bots like mod bots shouldn't take that much, but music bots have gotta cache any music thats playing, so that'll take a decent bit of ram
you shouldn't need more than 1 gig of ram
what lang/library do u use?
I use node and my simple bot doesn't need that much
dpy
yeah, you'll prolly only need like 1-2 gigs
if ur looking for a free VPS try one from google cloud
they have a good free trial
Ok great, thanks a lot
np
@wise quartz You can create a global dict (a dict attached to the bot object) where the key is user ID and the value is datetime of when their last message was sent
if for per-server, maybe something along server_ID: {user_ID: datetime_object}
That's what I do ^^
Okay thanks i'll try it
I should really relearn python 😣
60
then you could do something like if (now - bot.dates[user_id]).minutes == 1
Or .seconds, look up the attributes of timedelta object to make sure
@open dove you can get a rouge idea of process usage and load with pstuil
my ticket support bot wont work when someone dm's the bot it creates a new ticket in the server but wont send them that a new ticket has been created and wont show what reply the staff member gives them https://hastebin.com/asipelixos.js
(node:1003) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
at Client.<anonymous> (/Users/sadashivappakenchannavar/Desktop/support bot/index.js:54:38)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
warning.js:32
(node:1003) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
warning.js:32
(node:1003) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i defined active tho
so
what's on line 54
channel = client.channel.get(active.channelID)
your issue is right in front of you
client.channel
it's client.channels
read the docs
(node:1035) UnhandledPromiseRejectionWarning: TypeError: client.channels.get is not a function
wat
you. are. in. discord. js. version. twelve.
oh right
cache.get
when the staff member in the ticket tries to send a message in the ticker the bot wont send it to the person who made the ticket it returns this error
(node:1072) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'targetID' of null
Whatever is before .targetID is null
how to get client uptime please but as like 1h not 1 or else
Hi I wanna know how I use an api at discord.js?
go to #topgg-api
You want the uptime only in hours?
Hey all, quick question for bot dev gurus here, I'm having trouble finding this information anywhere - are role IDs unique across servers?
yes they are
Any ID is unique on Discord
Just wanted to be sure~ ty ty
except some really old servers that were created when general channels were "default"
and then just print that
Np
ah i forgot to seconds you need to do seconds %= 3600 @turbid pivot
ooh
w e w
xd thanks
kk
Thats where all your html goes as far as <div> <p> etc etc goes
i have a problem
i did what u said and it shows really weird numbers
saat is hours
saniye is seconds
idk why it showed up like this
So I'm creating an event logger for my Discord server [message delete, editing messages, bans, etc.] using Discord.js; Every time an event fires, I get an EMBED_FIELD_VALUE error [causing the process to exit] but the embed still sends as intended. Here is the content of one of my events [messageDelete].
client.on("messageDelete", (message) => {
var embedded = new Discord.MessageEmbed()
.setColor(randomColour())
.setAuthor("Logger")
.setThumbnail(client.user.avatarURL())
.setTitle("A message was removed.")
.setDescription(`A message from ${message.author} was deleted.`)
.addField(`Content`, message.content)
.setFooter(`Delete event`)
.setTimestamp()
message.guild.channels.cache.get("channel id here").send(embedded)
})
whats the error message
oh
[EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
And yet it sends as intended
console.log(message.content)
What do you mean by "log it"? Like, console.log the message content?
@digital ibex You can use Math.round()
yes
?
oh, ok lol
nice
goodnight ma kachigga
Yeah, it logs the message content and it's the actual content of the message
idk whats kachigga though lol
It wasn't an embed
Doesn't toFixed have a problem with rounding
it shouldn't error even if its an embed
So far i didnt have a problem with it
PLS HELP ABOUT THIS
Math.round?
Anlamazlar
oh mane
😂
no
o h
i need help still
So you used toFixed()?
who
wait i didnt knew u said it to me
😂
var seconds = bot.uptime / 3600
var hours = seconds / 600
what the HECK is going on with my bot
lol
Unfortunatly
what
you can if you have a magic crystal ball
Im sorry im too poor for that
pls beg
i have a BALL but no magix
is there dank memer
no sir
@haughty night how can i move the text to the bottom?
margin-top is one option
i need helping
i didnt try tofixed
On both
If you want to move your div use margin-top: px of %
yeah
my navbar is right above it btw
use moment
then us it on your <p>
moment is so easy to use
wym dieslrae?
you used <p>here is your text</p> inside the div no?
moment(time).fromNow() is enough in moment
Or did you do <div>text</div>?
yae, then use the margin-top on the class you used for <p>
try it
oh ok
Or you could use ```` display: flex;
justify-content: flex-end;
align-items: flex-end; ```
on your div
Which is probably way way better
margin-top? or the last one?
last one
@earnest phoenix it works but only shows seconds, can i make it show hours with seconds?
its 4700 seconds
like that
how would i change the margin-top bit on a class?
like ```css
footer-text class {
}```?
kk
If that is the class on your div
ok... the css is: css .footer { margin-top: 25%; } and the html: ```html
<div class="footer">
<p class="footer-text">Lost 2020</p>
</div>
Oh it goes out of your div
Then reduce the margin-top
It shouldnt go out of your div with only 25% tho
Im kinda learning to code my first discord bot using visual studio but i got a problem with microsoft extentions could someone help me if i join general vc and screenshare
Doesnt your Lost 2020 go outside your div when you used margin-top:25%?
Or am i blind?
Try something like this
.divclass{
position:relative;
}
.textclass{
position:absolute;
bottom:0;
left:50%;
}
``` @digital ibex
@earnest phoenix well i read the docs and found nothing helpful, is there no way to delete the decimal?
o ok
when?
@summer torrent it says 50 years ago
yeah, i want it at hte bottom of th epage tho, rn it looks like
Then you should put your text in the element thats the gray box
thats the background
Oh, alright then do this
.divclass{
bottom:0;
position:absolute;
}
.textclass{
position:absolute;
bottom:0;
left:50%;
}
i dont have anything in that yet
oh wait, i was looking at the wrong file
You had me scared for a sec
kk
Like width:100% at least
why is the height staying the same? when height: 10px; it shows:
What about em
still i changed it to 100px
/bots
i think this is a db issue that one of the fetches is returning null
https://hastebin.com/etugigesog.js
(node:1072) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'targetID' of null
at Client.<anonymous> (/Users/sadashivappakenchannavar/Desktop/support bot/index.js:109:40)
what line
102
then it can't find the user?
What version of Discord.js are you using.
if below 12, remove the cache property
if over 12 what the fuck
lol
i bet its an issue with repl
its repl so i have no idea
so this error takes me to #general in this server...why would I be getting this? what perms is it trying to find? js DiscordAPIError: Missing Permissions at RequestHandler.execute (C:\wildcat\node_modules\discord.js\src\rest\RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:93:5) { name: 'DiscordAPIError', message: 'Missing Permissions', method: 'get', path: '/guilds/264445053596991498/invites', code: 50013, httpStatus: 403 }
oh yea i need to remove cache
you should migrate soon tho, they're depreciating v11
@fast trench your bot doesn't have perms to do that cmd
it's not even a command...I put in an invite tracker...and i made sure if the guild id isn't my support server it's supposed to return and not do anything...here's the code
if (member.guild.id === `708514630204522574`) {
const cachedInvites = guildInvites.get(member.guild.id);
const newInvites = await member.guild.fetchInvites();
guildInvites.set(member.guild.id, newInvites);
try {
const usedInvite = newInvites.find(inv => cachedInvites.get(inv.code).uses < inv.uses);
const embed = new MessageEmbed()
.setDescription(`${member.user.tag} is the ${member.guild.memberCount} to join.
Joined using ${usedInvite.inviter.tag}
Number of uses: ${usedInvite.uses}`)
} catch (err) {
console.log(err)
}
} else {
return;
}```
it doesn't crash the bot thankfully but I want it to be gone lmao
soooooooooooooooooooo
oooooooooooooooo
now i have this problem
client.user.setActivity(`${prefix} help on ${client.guilds.size} servers`, {
type: "PLAYING"
});
setInterval(function () {
var u, user;
for (u in client.users) {
user = client.users[u];
if (user instanceof Discord.User)
console.log("[" + u + "] " + user.username);
}
}, 10000);
});```
doesnt show prefix
This is silly but is it possible for someone to 'DDOS' a bot? I know what I mean isnt exactly DDOSing but I don't know how else to putnit
Because my bot is somehow in way too many servers and can't start up.
lol
@modest schooner that happens sometimes, maybe just a bad connection?
happened to me when i had about 1.7k guilds i think
also each message has the server count rising so maybe check if its logging when its fully ready or just maybe a shard's ready
ugh, that'd make sense... I dont know what I'm doing. Thank you though
when it happened to me it stopped after an hour or two, so i don treally know
also,
uh
ah
does your bot tell you when it disconnects from discord?
like do you listen to any disconnect event?
so this code gives this error even though that channel in the error isn't even in the server I want the code to work in...can I get some help? js if (member.guild.id === `708514630204522574`) { const cachedInvites = guildInvites.get(member.guild.id); const newInvites = await member.guild.fetchInvites(); guildInvites.set(member.guild.id, newInvites); try { const usedInvite = newInvites.find(inv => cachedInvites.get(inv.code).uses < inv.uses); const embed = new MessageEmbed() .setDescription(`${member.user.tag} is the ${member.guild.memberCount} to join. Joined using ${usedInvite.inviter.tag} Number of uses: ${usedInvite.uses}`) } catch (err) { console.log(err) } } else { return; }
DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\wildcat\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
name: 'DiscordAPIError',
message: 'Missing Permissions',
method: 'get',
path: '/guilds/264445053596991498/invites',
code: 50013,
httpStatus: 403
}```
Yes I know but it should be completely ignoring the guild that the perms are missing in...
but it should be completely ignoring that server that is giving the error...
the channel that is giving the error isn't in the guild that has the id of 708514630204522574
meaning...
channel giving the error = #general
is not in
guild id in code = a completely different server
which means it should be returning and not doing anything
how do i fix this
client.user.setActivity(`${prefix} help on ${client.guilds.size} servers`, {
type: "PLAYING"
});
setInterval(function () {
var u, user;
for (u in client.users) {
user = client.users[u];
if (user instanceof Discord.User)
console.log("[" + u + "] " + user.username);
}
}, 10000);
});
my code is normal
prefix isn't defined
it'd be prefix.prefix
what
It requires the object, i.e. it's {prefix: "!"}
It's an object, you use it like an object
ok it worked thnx
or you can const {prefix} = require(...) to destructure it
omg
my ping cmd still doesnt work
case 'ping':
client.commands.fetch('ping').execute(msg, args);
break;
// ping.js
module.exports = {
name: 'ping',
description: 'Ping!',
execute(msg, args) {
msg.channel.send('Pong.');
},
};
What would hog memory usage where I start I hit 100mb and running idle it's at 50mb?
@vale garden Js or py
@vale garden are you getting an error? Do you have anything to reproduce it? Have you tried debugging it yourself? What is client.commands and what is the fetch method?
no i didnt get any error
its js
i meant to do get
but it still doesnt work
client.commands is bot.commands
can you send us your index.js or bot.js?
@jagged gulch who
const Discord = require('discord.js');
const prefix = require('./config.json');
const token = process.env.DISCORD_BOT_SECRET
const keep_alive = require('./keep_alive.js')
const client = new Discord.Client();
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('Ready!');
client.user.setActivity(`${prefix.prefix}help on ${client.guilds.size} servers`, {
type: "PLAYING"
});
setInterval(function () {
var u, user;
for (u in client.users) {
user = client.users[u];
if (user instanceof Discord.User)
console.log("[" + u + "] " + user.username);
}
}, 10000);
});
client.on("message", message => {
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
switch (args[0]) {
case 'ping':
client.commands.get('ping').execute(msg, args);
break;
}});
client.login(token);
my whole index.js file
^
client.commands.get(<command>).execute(params);
use that instead of your case/switch
replace ```js
switch (args[0]) {
case 'ping':
client.commands.get('ping').execute(msg, args);
break;
}});withjs
client.commands.get(command).execute(params);```
it does it automatically. It grabs the command from the message, then searches for a command from your command collection that has a matching name in module.exports
so if I run -ping, the code will look for a file from client.commands with the name ping
js
client.commands.get('ping').execute(msg, args);
client.commands.get('beep').execute(msg, args);
like this?
replace the quotes with just command
client.commands.get(command).execute(msg, args);
this will get the command that you get from const command = args.shift().toLowerCase();
then search for that in your collection
client.on("message", message => {
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
js
client.commands.get(command).execute(msg, args);
});
client.login(token);
is this right
@jagged gulch
lol my b
what's below that error?
like can u send the whole thing?
also don't use repl, switch to Visual Studio Code or smthn like that, it'll save u sooo much time
and headaches
What would hog memory usage where I start I hit 100mb and running idle it's at 50mb?
discord J's V12.2
No database either
do you have a ping.js file @vale garden
and did u use the exact command
What would hog memory usage where I start I hit 100mb and running idle it's at 50mb?
discord J's V12.2
@silent berry what
yea i have a file
// ping.js
module.exports = {
name: 'ping',
description: 'Ping!',
execute(msg, args) {
msg.channel.send('Pong.');
},
};
yea args are valid
Bot startup is 100 mb
anyone know how to send a js widget with a command?
I'm idle at 50mb of mem usage
@silent berry node and d.js still use ram, even when the bot isn't doing anything. It's constantly checking the discord API so it'll take a little ram to run
anyone know how to send a js widget with a command?
@fallow mango I don't think you can
oof
yea args are valid
@vale garden what aboutcommand
i integrated js into py for nothing 😦
@jagged gulch ik that but 50-100 mb isn't very good
that's what my bot uses on idle
And this bot only in 16 servers
and why isn't that good?
like is your command var valid? can you log it with console.log(command) to see if it actually is what we want
@jagged gulch it just seems like it to me
@silent berry did you specify which intents you're interested in ?
someone knows why "voice" does not recognize it as a function?
once i specified which intents i was interested in, i noticed a ram usage reduction
@steel drum trying to lower the mem usage and not be at 50-100 mb mem usage
@silent berry check that out
they mean like what exactly do you wanna do with the bot
Ok thanks
should i switch from discord.js to eris?
write your own library
i heard eris is much less cache-y but i have been using discord.js for 2 years
too lazy man
same kek
lmao
i have so much base code over the last
3-4 yrs
in djs
if i was gnna switch to another library, id probably switch languages entirely
i might just create a test bot to see how eris works and convert my existing bot into eris
once i get the hang of it
If you care about performance and growing then sure go eris
my old bot had a massive spike to 300 servers once and the bot was breaking left and right
and i think it would be the best bet to switch to eris
so this code gives this error even though that channel in the error isn't even in the server I want the code to work in...can I get some help? js if (member.guild.id === `708514630204522574`) { const cachedInvites = guildInvites.get(member.guild.id); const newInvites = await member.guild.fetchInvites(); guildInvites.set(member.guild.id, newInvites); try { const usedInvite = newInvites.find(inv => cachedInvites.get(inv.code).uses < inv.uses); const embed = new MessageEmbed() .setDescription(`${member.user.tag} is the ${member.guild.memberCount} to join. Joined using ${usedInvite.inviter.tag} Number of uses: ${usedInvite.uses}`) } catch (err) { console.log(err) } } else { return; }
DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\wildcat\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
name: 'DiscordAPIError',
message: 'Missing Permissions',
method: 'get',
path: '/guilds/264445053596991498/invites',
code: 50013,
httpStatus: 403
}```it should be completely ignoring that server that is giving the error...
the channel that is giving the error isn't in the guild that has the id of 708514630204522574
meaning...
channel giving the error = channel in Discord Bot List's server
is not in
guild id in code = a completely different server
which means it should be returning and not doing anything
@fast trench
DiscordAPIError: Missing Permissions make sure have permissions to do :/
did you not see what I said after the error? it should be completely ignoring the server that the channel is in that is giving the error
i just solved it i m sorry to disturb you

lmao
Selam
quick question, im just starting eris, and for the channel types, its numbers. I figured out 0 is a regular text channel, so is DM 1, or is voice 1?
i cant seem to find what type is what number anywhere
but i might not be searching correctly 
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Someone can help me with the Mojan api?
what do you need help with
hey there! I'd like to know if there's a difference (mainly in security) between storing tokens in a .env file or in a json. thanks.
not really
ty 👌
just two different methods of providing a config
getting Connection closed error for mongodb on heroku..
can someone help me?
it’s being closed because the connection is idle for too long
Hel
How do I get the name of the guild bot was added to/removed from
bot.on ("guildCreate" => {
//I want the code to get the name of the guild bot was added to but I can't
});
bot.on("guildMemberRemove", member => {
console.log(member);
});
help console.log(Member) it says Undefiened
Ah thank
Does Discord.js store the events in a type usable in TypeScript?
Because currently get an error trying to dynamically import events.
Discord.js
Yes. The whole typings is written in TS. - found out
¯\_(ツ)_/¯
bot.on("guildMemberRemove", (guild) => {
console.log(guild);
});
@earnest phoenix It will send a Guild if the guild gets removed
Ty
Hello, is there a way to check if an invite url is valid without having to use .fetchInvites(), which needs the manage guild permission?
nvm
Hello there, I am having issues with going setting my bot's status (to dnd) but I only have this issue when intents are on, when they are not defined, everything works fine. What could be causing this and how can I fix this (feel free to ping if you have a response). I am using discord.js v12.2.0. Thanks in advance 🙂
hmm, i want to duplicate this UI, in the same way MEE6's dashboard has. What would you call this input type? so i can search out a good bootstrap plugin as a starting point
a searchable dropdown?
hmm, yeah perhaps thats a good description 🙂
or filterable
bootstrap 🤢
i love bootstrap. what ya gonna do about it 😄
more interestingly, whats up with bootstrap?
Bootstrap is nice
Hi, I keep getting this error and my bot is not working because of it, please help
F
o0f
Idk, bootstrap gives a certain feel to a page
Can node.js applications make use of multiple CPU cores by default?
I imagine not
But just curious
Any reason why i got discord api erros like missing permissions
Breaking the bots code etc ..
well because your bot doesnt have the required permissions to do something
handle the promise rejection and notify the user in the case of insufficent permissions
And i got response none of the commands work
The error is pointing towards node module D.js rest/requesthandler
yes, thats where the error is thrown
But i am using try & catch blocks
They should catch the error while using commands
try catch blocks only catch it if you are awaiting the promise. otherwise chain a .catch onto it
Anyone know how to edit role names in discord.py
Im tyna make a command that adds medals to the role name
loop through the roles, find the one == the role name, get the name before the edit and add \🏅
wait lemme check
ok
for role in server.roles:
if role.name == 'role_name':
# What you want to do.
await client.edit_role(server=server, role=role, colour=0x0080000)
break
i found this on stack overflow, idk if itd work (d.js user)
lmao I was looking at the same thing
thats python my dude
yeah
then it wont work in d.js
csHaRp?
python
that code is long since outdated
so what yall wanna do
ig you want to rename a role?
<role manager>.find(role => role.name == "rolename").setName ig
hi there. i'm trying to do reverse engineering with my school's management system. For the logins, I found that JSON format (it's unimportant just for context) : ```json
data:{n "identifiant": "I won't tell u",n "motdepasse": "I wont tell u either"n}
but WHY is there `n` in this thing? wery weird
(that's french, it means id and password)
why would you do that
and its probably some \n but broken
its \n but broken
What are shards?
shards are websocket connections to discord
Ok
when your bot reaches 2500 servers, discord requires you to start "sharding" which means splitting your bot into multiple connections, for example 2 connections of 1250 servers each
Ok I understand
I fixed it btw
quite a while ago
# @commands.command()
# @commands.has_role("privacy")
# async def addMedal(self,ctx,role:discord.Role, value):
# guild = self.bot.get_guild(privacy)
# if role.name == f'{role}':
# await role.edit(name=f"{role}" + f' {value}🏅')
# await ctx.send("Done!")
# print(role)
# @commands.command()
# @commands.has_role("privacy")
# async def clearMedals(self,ctx,role:discord.Role):
# for i in range(0,10):
# rolee = str(role)
# rolee = rolee.replace(f'{i}', '')
# rolee = rolee.replace('🏅', '')
# await role.edit(name=rolee)
# await ctx.send("Done!")
# print(role)
```
how to a get a bots mutual servers with a member id?
and its gonna be running off an eval command
Alright I have a genuine question
if role.name == f'{role}': what is this supposed to stand for
basically the same as if role.name == str(role) no?
But what's the point
how comes when I try to paste an emoji into python ide it closes the application?
any error?
nope, application just closes immediately
I ctrl + c then ctrl + v and it just closes
what ide?
Python IDE 3.7
it was just on the python website
I might need to update to latest version
ah, idle
wut
It's just a text editor
with some stuff from IDE
imagine using idle
vs code is the best imo
MS paint where ya at
ow
hm thanks but it doesnt work for me lol
What's the error?
it returns an empty list
Show your code
What is client?
Where are you printing
client is just my bot instance
Where are you printing?
I'm gonna take a guess: you are logged in with a different instance of client than one you're using to get guilds. Is that it?
its at the very end of the code. The only line that comes after that is the client.run(token) line
if I do it after that line, it doesnt print anything xD
do you mean like printing it out in an on_ready function?
Yup
You also might want to use this https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_until_ready
hi, does anyone know why the height of the footer doesn't change?
the code, in css: ```css
.footer {
bottom: 0;
position: absolute;
height: 10px;
width: 100%;
background-color: rgb(119, 117, 117);
}
everything else works, apart from the height, doesn't change
i want to use "fs" to display last 100 lines of a .txt file
pls help
Read a file using fs, split the string you get with \n then slice
.split(/(\r\n|\r|\n)/g).splice(0, 100);
how do i make my bot send a dm to a spefific user from their user id
im using disacord js
then read what they sent
@clever garnet get user from client and send message
how
Client.users.get('id').send
ok
.split(/(\r\n|\r|\n)/g).splice(0, 100);
yes
let data = contents.split(/(\r\n|\r|\n)/g).splice(0, args[1]);
will it work ??
let me try
Also 0, N will give you the first N elements, and also it modifies the original array, so if you save it into memory for performance it'd be better to use slice
I just gvave a really basic example
and for his bot you probs dont need performance
it 100% uses 10gigs
@indigo notch wdym
why 10gigs
explain pls
why 10gb

BRUHHHH
@indigo notch wdym
hi, i am struggling making my bot have a prefix and have a simple command using that prefix. could someone help me?
Wich language ?
@earnest phoenix what's up
what in the fuck
i mean if i use this let data = contents.split(/(\r\n|\r|\n)/g).splice(0, args[1]);
lmao
you know the lower mem used the better right?

Well whats contents
ahm a logs file
with 1000+ lines

so i wanted to get lastest lines
what the fuck kind of bot were you given
omfg
wait
What you are trying to with that file ?
to get lastest line of the logs file
with command /log 100

huh ?
I am going to mental hospital.. bye 
wtf
why
it is bad
?
hi, i am struggling making my bot have a prefix and have a simple command using that prefix. could someone help me?
before going there ill play pubg
did you just randomly buy a discord bot?
@modest maple me ?
yes
then wtf are you going on about
you question makes no sense
10gigs is fucking insane
Spoodfy uses 2 gigs
at 55,000 servers
I think Wesselgame just made fun of them it's not that deep
i just think this dude has 0 idea about what hes doing
i am struggling making my bot have a prefix and have a simple command using that prefix. could someone help me?
what have you tried so far Charweeeeeeee?
i have done "prefix": "!"
and then
if (message.content === ${prefix}ping) {
message.channel.send('Pong.');
} else if (message.content === ${prefix}beep) {
message.channel.send('Boop.');
}
That looks correct to me, is your bot online? Any errors?
what is that?
wut
