#development
1 messages Β· Page 975 of 1
I need help how to make a mute and unmute command
u want to know line 17?
yes
ok
@north hollow Discord.py??
U should have stored muted role ID in db, to give that to users
Let me tell how to make the role..
Ah ok
role = await ctx.guild.create_role(name = 'Muted')
for channel in ctx.guild.channels:
if channel.type == 'voice':
await channel.set_permissions(role, speak = False)
else:
await channel.set_permissions(role, send_message = False)
#then store the role id to db, and give that to users thats all
In mute command, to setup muted role, if it is not existing.
I made this code and it did not work
client.on('message', message => {
if(message.channel.startWith('${prefix}clear'))
if(message.member.roles.some(r=>['ADMIN'].includes(r.name))) {
message.channel.bulkDelete(100).then(() => {
message.channel.send("Delete 100 messages.")
.then (message => {
message.delete(5000);
})
})
}
else {
message.channel.send ("Did you really think you could do that?")
}
return;
})
@spare iron
But if someone can help me pls tell me
This Is Js, Dude..
@north hollow
First => no opening or closing brackets for the if check
Second => you used .some() function incorrectly
Third => delete(5000) doesn't work anymore... It's .delete({ timeout: 5000 })
I am not good But Ask..
hi
i already sent this
but
const Discord = require('discord.js');
const bot = new Discord.Client();
module.exports = {
name: 'servers',
description: "displays all the servers of the bot, for owner's use only",
execute: (message, args) => {
message.channel.send(`Serving ${bot.guilds.cache.size} servers: `);
//message.channel.send(bot.guilds.map(g => g.name).join("\n"));
console.log("Debuging: " + bot.guilds.cache.map(g => g.name).join("\n"));
}
}
^my cide
code
the bot.guilds.cache.map didnt work so i logged it and got nothing
also for some reason the bot.guilds.cache.size shows 0
ur initiating a new client
even tho it works perfectly in the status
thats why its 0
TypeError: Class constructor Client cannot be invoked without 'new'
at Object.<anonymous> (/home/runner/Trade-Bot/commands/servers.js:2:21)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at /home/runner/Trade-Bot/index.js:15:21
at Script.runInContext (vm.js:131:20)
at Object.<anonymous> (/run_dir/interp.js:156:20)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
this is what happens
if you exclude new
not discord.Clinet
you're going to be creating a new cleint every time, just change new Discord.Client() to message.client
ok
you have defined it, wym?
yes
i need to define message
you've got message.channel.send
const Discord = require('discord.js');
bot.on('message', async message => {
if (!message.content.startsWith(PREFIX)) return;
const bot = message.client
module.exports = {
name: 'servers',
description: "displays all the servers of the bot, for owner's use only",
execute: (message, args) => {
message.channel.send(`Serving ${bot.guilds.cache.size} servers: `);
//message.channel.send(bot.guilds.map(g => g.name).join("\n"));
console.log("Debuging: " + bot.guilds.cache.map(g => g.name).join("\n"));
}
}
})
this is my code
idk what is wrong
my dude
but if the const bot is abiove bot.on
ok what is it
i feel very dumb rn
what is it
and i can't just tell you, also, you're going to get a memory leak or something if thats how ur doing it
from DiscordAPI.raincord import Discord
@slender thistle sorry for the ping sir
Have u know about this
from DiscordAPI.raincord import Discord
I am having troubles with my vote api code. can anyone help me?
(Please ping me if you can)
@sweet ruin this belongs in #topgg-api but to quickly help you vote.user is a string containing hte ID of the suer who voted
thanks @steel drum but euhm it doesnt log it when someone votes either
you should do something like Bot.users.fetch(vote.user)
are you sure you're providing top.gg the correct webhook address?
I have "const dbl = new DBL("token here", client);"
and it updates the servers
@steel drum ^
im busy
is there a neat way to store created embeds?
also I use heroku and it works fine
having all my embeds in the same command file is genuinely starting to look unneat as hell
Just make some funtions, and call them when needed
I just really though I could store them all in a separate file
ytsr is still being annoying I just donβt get it
const Moderation = new Discord.Collection()
Anyways can someone help me with polling system that executes command after a certain time?
I am having troubles with my vote api code. can anyone help me?
(Please ping me if you can)
can anyone help me
I have this
message.channel.send(embed)
} catch (error) {
message.author.send(embed)
message.channel.send("I wasn't able to send the help embed in this channel, please notify a server admin. I've sent the embed to your DMs instead")
}```
but instead of doing the error when I prevent it from sending the embed it just says error discordapi error missing perms
How do you make a channel move to a category that were both created at the same time using discord.js? Basically organize it. Also how do you make it check if the category is already made before making a new one? If that makes sense, ping me so I see your message please!
my bot keeps showing this error when i run the command
TypeError: args.slice(...).enter is not a function
at Client.<anonymous> (/home/runner/exciting-pine-clove/index.js:854:30)
at Client.emit (events.js:322:22)
at MessageCreateHandler.handle (/home/runner/exciting-pine-clove/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/runner/exciting-pine-clove/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/runner/exciting-pine-clove/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/runner/exciting-pine-clove/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/runner/exciting-pine-clove/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:310:20)
at Receiver.receiverOnMessage (/home/runner/exciting-pine-clove/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:310:20)
exit status 1
ξΊ§ ```
To go index.js line 854 of column 30 and you'll see the line. The error means you're trying to slice the arguments then call the enter method, which does not exist.
what is calling .enter() supposed to do?
okay but what is calling .enter() supposed to do // what did you expect it to do
hack the user isn't really specific.
its supposed to reply with a hacking message like ('Hacking ${'tohack'}
let tohack = args.slice(0).enter('');
message.delete();
let msg = message.channel.send(`Hacking ${tohack}`)
i dont know if that defines it
if u need the whole code ill send it
You're probably looking for join (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join). I don't see the point in slicing an array by 0 though.
okay. I've been writing javascript for 8 years, and I've never heard of array.prototype.enter?
yeah it doesn't exist
Ah, I see
what am i supposed to remove?
erm
we love a copy pasting sister
String.slice(0) should do absolutely nothing
then .enter isn't defined either
Since string.prototype.enter isn't defined either
You should have a huge error in your console, right?
yes
a really big one
Plus, generally args is an array?
So slice shouldn't work either
ok i removed them
and now it says
args.enter is not a function
ill send the whole code to u
in dms
please don't direct message me
Your issue is that you're trying to call functions that do not exist
You should read the mdn docs on what types of array and string functions do what
and https://doesitmutate.xyz is a great resource for array functions
also probably would be better to learn basics first
code?
Because youre using a string
And youre picking random from that
And then do hilo1+hilo2+etc etc
I'm trying to make my bot send a message to a server's 'default' channel if it leaves due to it having more bots than humans. The actual leaving part works fine, not the message command though. Maybe send it to the server owner's dm's? Library is Eris.
Never assume the token is safe....
pllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll;'l
"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmddddddddddddddddddddssssssssssssssssss
if (guild.members.filter(m => m.bot).length / guild.members.size >= 0.50) {
bot.createMessage("There are too many bots on this server! I'm flattered at your collection but have to leave due to my owner (SF) Seagull#2224's requests.")
logger.info(`Detected bot collection guild '${guild.name}' (${guild.id}). Autoleaving...`);```
the problem is that you're using hilo before defining it, and your embed is static, will always return the same value
@earnest phoenix
probably missing something obvious
Is it in py(the code in general)?
Javascript
I see
which library? eris?
Yup! Eris.
bot.createMessage requires a channel ID as first argument
I'm sure I forgot to define a channel to send the message to, I'm not sure how to get the default channel for a guild (The join message channel).
there is no default channel
the problem is that you're using hilo before defining it, and your embed is static, will always return the same value
@quartz kindle umm i defined the numbers then assigned them to other variables
you have to loop over channels and find one that you have permissions to send in
you can filter channels that your bot can send messages to but it would be annoying if i were to see it
Or i can use message.channel.send it fixes everythung for me lol
How To add Attachments in Embeds And Auto spawning that
discord.js
please help
@earnest phoenix the problem is that you predefined the embed and saved it in a variable
if you send that embed just like that, it will always be the way it was when you created it
changing the variables used to build it doesnt change the embed after it was built
// Create the attachment using MessageAttachment
const attachment = new MessageAttachment('https://i.imgur.com/w3duR07.png');
// Send the attachment in the message channel
message.channel.send(attachment);
}```
if i use thge command its not working and i want to make this a embed and auto spawnit for req messages
plz ping and reply
i m beginner so hard stuffs
can someone explain!
huh js and python look similar
thats cool
@weary ridge can you post your code
like copy it then paste it
? why
@weary ridge what if you do ffmpeg -version in your editor's terminal?
@quartz kindle , ffmpeg : The term 'ffmpeg' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At line:1 char:1
- ffmpeg -version
-
+ CategoryInfo : ObjectNotFound: (ffmpeg:String) [], CommandNotF oundException + FullyQualifiedErrorId : CommandNotFoundException
hmmm
@weary ridgeffmpeg !== ffmpeg/avconv | ffmpeg/avprobe
so if your ffmpeg is found in cmd but not in your code editor, you need to restart your code editor and/or your pc
wait fr
i'm gonna restart brb
same error
@quartz kindle
anyways how come it can download
what error
are you logged in
yea
Ive switched out the embed for message.channel.send
@acoustic kiln create embed const exampleEmbed = new Discord.MessageEmbed()
Set your image .setImage('https://i.imgur.com/wSTFkRM.png')
Send the embed message.channel.send(exampleEmbed);
@weary ridge check these https://stackoverflow.com/questions/30770155/ffprobe-or-avprobe-not-found-please-install-one
@haughty night thanks
Np, dont forget to define Discord
Ok thanks @quartz kindle
In node.js, how can I create a command that shows me the last error in console?
What would happen if you try to get a non-existent value with quick.db?
It returns undefined?
I can't test right now π
@balmy knoll I don't think you should have bot developer role if you ask a question like that
process has serveral error events which you can catch to prevent your bot from going down if it hits an error if that's what you mean
But your question is vague
@earnest phoenix I know how to do it, just use a catch right after the action you want to check, but I don't want to catch the error as soon as it occurs. I want to catch it only when I ask for it by command
"I don't think you should have bot developer role if you ask a question like that" just save it in an array and call the last element of it with your command
or if you don't care about any errors except the latest one, just save it as a single variable and change it everytime there is an error
I was just asking to avoid saving it in an array, since I should go back to editing all the commands done so far
bruh
Dude you really should just go back to the basics. Process is a global variable, meaning you can call on it from any file or function and it does the same thing
if you have an error handler that catches and saves the uncaughtexceptions and whatnot then you will be golden
Maybe you misunderstood my question. Well, I'll take it easy on my own.
Wait pokecord shut down?
And try to be nicer and less aggressive next time
process.on('uncaughtException', console.error);
process.on('unhandledRejection', console.error);
These two lines of code will log every error that your process receives, in any file
they only need to be there once
Yes, it did.
I'm sure you can get it to push to an array or keep as a variable somewhere
@earnest phoenix Please don't say "I don't think you should have bot developer role if you ask a question like that" in the future, respect some people as they may be earlier on in their coding "career" and maybe haven't messed around with that section yet.
Just be nice. π
okie
@balmy knoll if you want a command that shows errors, you should create an array of fired errors and append items to it on error, and then just fetch the most recent one from that array when you use the command
or just have a singular stored error if the most recent one is all you care about
i literally said that
i specifically said that the example catches every error that node.js receives and that with a smidge of ingenuity, one can do either of those two things
I wasn't spoonfeeding them code, I was providing an example of an error handler at work
π
how to detect if a user voted my bot
Dm me
:D? No
@earnest phoenix Please consume the information in the official API documentation not just with your eyes, but also with your mind, so that you may truly understand the information and not have simply "read it" and remember to study the basics of whatever language which you are writing a bot for so that you can better understand the terminology. Secondly, it is generally frowned upon in programming communities to direct message other users for help or to be asked to be directly messaged
i think they gave up reading that
question is whether they could even comprehend
Is there a way to have a bot respond to a message without @ing the person
Ofcourse
yes
hey @quartz kindle i just got back home and looked into the website you gave me but i cannot do sudo
Than how do I do it because it always @ me
no linux for you lol
@versed igloo I unfortunately am not familiar with libraries for bots other than discord.js, however I do believe that the @ing thing you're referring to is message.reply. so id recoumend you use message.channel.send instead
@versed igloo What do you use? .reply()?
Im using discord.js
@cosmic gorge wrong channel?
To send the message?
sorry
Are you using .reply()
So instead of msg.reply I should put msg.channel.send?
yes
Ok thanks
Another day is saved, thanks to Logos Rex!
Is there a different between roles and channels in the way that I can't add properties to roles but I can to channels? For cache purposes
Errr....yes
Channels have parent category, type, slowmode (or bitrate for vc), etc.
@weary ridge look at answers for windows only, ignore everything that is linux
there are many there that are specific for windows
no I mean like with the guild, you can cache the prefix is guild.prefix = '.', but for roles it doesn't work for me
of course I don't cache the prefix on the role object
how are you adding it?
counterRole.counter = true;
maybe because this is a boolean and otherwise I'm using a string
haven't tested that tho
discord.js
when someone reacts to a specific message, how can I remove the reaction?
Yo Tim
however im not sure if role objects are replaced when updated (edit, no they are not replaced)
yeh still doesn't work
@quartz kindle Is There Alternative's To FFmpeg
i've already tried Lavalink thats broken
@nocturne grove you need to add it to the role object you get from guild, not the one you get from member, ie : guild.roles.cache.get(roleid)
the roles you get from members may not be linking correctly to their cache
i've already tried Lavalink thats broken
@weary ridge its not
@weary ridge did you try this?
lavalink isn't the same as ffmpeg
lavalink is "all in one" while ffmpeg is only one part of audio streaming, specifically converting audio to discord standard
Any free alternatives to storing data in json files
if ffmpeg isn't working like its supposed to, then you're using it wrong
okay thanks @quartz kindle, though I don't get them from a member
@earnest phoenix nearly all database systems out there are free and open source, or have a free version
Does anyone know how to add an image to an embed field? I see some bots in the testing channel that have small icons next to the "value" property of their fields
I'm getting the role by looping through guild.roles.cache until something turns true
so just from the cache I guess
@faint osprey probably unicode emojis
@faint osprey probably unicode emojis
@quartz kindle ahhh that makes sense
@nocturne grove it should work then
hmm will try again
@quartz kindle it's working if I do it myself using eval
console.log('hi');
guild.roles.cache.get(counterRole.id).counter = true;```
I tried it without getting the role again too, I know this is more work
It's loggging the `hi`
after that, this (just did all roles to be sure):
```js
.eval message.guild.roles.cache.map(r => r.counter);```
returned an array with `undefined` elements
@quartz kindle do you know what's going wrong?
Hello
I'd like someone to help my with a coding
So recently i made a money system and it works really well.. Today I made the a!pay command and people were successfully being able to pay others
but people are paying sometimes letters and not numbers
how can I make it only numbers?
Check if input consists of only numbers
which language?
Anyone also getting this message? I can't init my bot.
javascript has isNaN(n) and Number.isInteger(n) functions to find out if a value is a number or not
I cant upload photo
parseInt() can also be used, you just need to check if it returns NaN
anyone else have error 500 - internal server error
me
but people are paying sometimes letters and not numbers
@feral aspen how can i fix it?
i told you how
javascript has
isNaN(n)andNumber.isInteger(n)functions to find out if a value is a number or not
Ya I made he bot online
isnt it self explanatory?
isnt it self explanatory?
@quartz kindle sorry, im a beginner
ummmm
if input is not a number, don't execute the code
Help Error fetching aplication
you use isNaN(value here) to check if a number is NaN (Not a Number), if it is, then return an error message instead of continuing the code
whats going on with discord?
pretty much the same way you did the rest of your code
lmao
API response time shot up to >1s
BRUH DISCORD
sorry duplicated text
is killing ME
it should return undefined for all roles except the one where you set it
@quartz kindle yeah I thought the same, but it doesn't π€·
Maybe I should just remove that little cache, it's almost never used
is anyone else sending images and they taking so long to send
well my bots are still working
someone else with gateway issues here?
how i can clean cache on glitch.com
i have 41k ms to the gateway
who ever had there bots still running are lucky
my bot crashed bcs the heartbeat missed
lol
My bots are off WTF
relax
discord ded
i cant be bothered lol
Help my bot isn't loading
It's not starting
my bots π
HOW FUN LOL
@woeful pollen discord API has a error
relax people, its just discord having issues
Patience
Ah phew
just relax they will fix it
Tim lol
What happened
@tulip ledge discord are ded
api has a stroke
on the stat page the api got a 1kms response time rn
You're like the 3rd person sending the same pic, we get it
Even the images take 6 hours to load
the same person sending the same pic 3 times
^
i like it how when our bots don't work we instantly check dev
Loo
not really the right place to check lmao
i just enabled debug on my bot. now i know why it doesnt work no need to check a webpage that is buggy sometimes

i mean it did sorta let us know something wrong lol
but how come bots that were already online don't get affected?
https://status.discord.com/#day you can see there is something on the api
Welcome to Discord's home for real-time and historical data on system performance.
Why don't my bots come on?
my bot was online and crashed bcs the heartbeat missed
@plush holly Discord issues rn
people are already creating issues in the discord github lmao
yeh i already checked the web
wtf?
LOL

I'm unable to see my applications and create applications on [https://discord.com/developers/applications] Can someone help? Thanks,
my other bot works perfectly fine lol
When can bot's on again?
Once it's fixed
Okay
wdym clean cache
whoah glitch looks cool
i dont think thats a cache issue
how big is your bot?
how many guilds/servers
do you use intents?
is it the free glitch plan? how much memory do you have and how much does your bot use?
do you use intents?
@quartz kindle I pass you the link of the glitch I trust you
https://www.skysilk.com/ This Is The best bot hoster
there's no such thing as the best
welp
you get what you pay for
currently i run on a Digitalocean VPS and will switch to a kubernetes in the future if i keep growing
I haven't had issues with SkySilk personally so 
Glitch is so nice to start cause you can share projects invites 
i still havent had issues on galaxygate personally so π€·ββοΈ
i dont trust everything that offers hardware for free. there has to be a catch
(node:29) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'size' of undefined
at DBLAPI.postStats (/app/node_modules/dblapi.js/src/index.js:149:79)
at Client.<anonymous> (/app/node_modules/dblapi.js/src/index.js:54:14)
π¦
._.XD
REEE how are these ppl still using there bot's lol
@earnest phoenix your code is very unoptimized and glitch's cpu is bad. besides rewriting your entire bot, what you can do is enable gateway intents to remove presence updates
that should massively reduce cpu usage even with your unoptimized code
Couldn't find the right place, so I hope it's okay to ask here.
Considering the CDN, and apparently the API have decided to hang themselves, is anyone able to get their bot online?
tim
I tried to start my bot, and, no dice.
How to enable gateway attempts to remove presence updates
okok
API seems to be fine again
@brittle copper Nobody can get there bot online but some can hmmm
Yeah, like I said, the CDN and the API have decided to neck-rope themselves

lel

Seems to be working
apparently none of my bots went down lul
Well I think it was more for bots that tried to access the gateway after the fact
if your bot was already online, it was fine
Poor Dyno
lol
~100 shards offline
100? more like 1000
1,000,000
my bot never went down
cool
Hi Guys.
I made a money system for my bot and it was working really well. I made a pay command and people were able to pay money! I noticed people were paying letters and that ruins the database.. can you help me by telling me whats the command to make it only numbers?
Can you just tell me the command please?
what are bot shards?
a shard is basically another websocket connection to discord. it handles up to 2500 guilds
yeah an sql database will work perfectly for that
How can I access 1st function inside the 2nd function ?????
lol
Function undefined
just define it
Does anyone know how to make it so the bot displays how many server it's in on the status?
which library?
Ah wait nvm
how to find out how many people jthe joined server in the last 1 minute?
(djs)
I made a money system for my bot and it was working really well. I made a pay command and people were able to pay money! I noticed people were paying letters and that ruins the database.. can you help me by telling me whats the command to make it only numbers?
Please just tell me the command and where to add it...
You've been told multiple times already
if input is not a number, don't execute the code
javascript has
isNaN(n)andNumber.isInteger(n)functions to find out if a value is a number or not
how to find out how many people joined the server in the last 1 minute?
(djs)
yo
ΓΏo
@stuck scaffold filter out users whose joined at prop difference from the current date is bigger than a minute
does anyone know how to define bot without starting a new client
wym
like see
const Bot = new Discord.Client()
starts a new client
so how do i define it
without doing that
it doesn't start it
^
and you can't have something out of nothing
bot is just a variable
var bot; = empty variable
someone told me
you donβt have to use bot for a client
(client).login(token) starts the client
idk some guy told me
lol
const Discord = require('discord.js');
const bot = new Discord.Client()
module.exports = {
name: 'servers',
description: "displays all the servers of the bot, for owner's use only",
execute: (message, args) => {
const guildNames = bot.guilds.cache.map(g => g.name).join("\n")
message.channel.send(guildNames)
}
}
@vale garden i told u
yeah ik
my dude
i already told u and told u to learn js
lol
you can't tell me what to do 
LOL
just tell me plz
no
lol
donβt spam my dude
i have finished both anidiots guide
and the discord.js guide
so do i really have to
the guide shows u how to do it
it doesnt
discord.js guide != learning js
yes it does, i also told u
see
the js guides
are way larger than the discord.js guides
so
i cant
lol
just tell me whats wrong plz
thats why you need to learn the js guides
ik but
const Discord = require('discord.js');
const bot = new Discord.Client()
module.exports = {
name: 'servers',
description: "displays all the servers of the bot, for owner's use only",
execute: (message, args) => {
const guildNames = bot.guilds.cache.map(g => g.name).join("\n")
message.channel.send(guildNames)
}
}
how is this
an empty message
:wowcringe:
bruh
why are you creating a new bot client
im trying to tell you w/o spoonfeeding
if you do new Discord.Client() that creates a new instance of the bot client, completely separate from your bot
like if you wanted to run 2 bots in the same file
this new client is not logged in, so all its structures are empty
first of all remove that line
second, you can access the client from any discord.js structure
for example, a message (message.client)
so basically all you need to do is message.client.guilds.cache....etc
Does anyone want a free mousepad from amazon, for me to get the product advertising api?
no
how i can optimize this
{
"//1": "describes your app and its dependencies",
"//2": "https://docs.npmjs.com/files/package.json",
"//3": "updating this file will download and update your packages",
"name": "hello-express",
"version": "0.0.1",
"description": "A simple Node app built on Express, instantly up and running.",
"main": "server.js",
"scripts": {
"start": "node bot.js"
},
"dependencies": {
"express": "^4.17.1",
"weez": "^1.5.7",
"youtube-node": "^1.3.3",
"ffmpeg-static": "^4.2.0",
"@discordjs/opus": "^0.3.2",
"youtube-search": "^1.1.4",
"ytdl-core": "^2.1.1",
"node-opus": "^0.3.3",
"random-puppy": "^1.1.0",
"common-tags": "^1.8.0",
"fs": "^0.0.2",
"chokidar": "^3.4.0",
"figlet": "^1.4.0",
"util": "^0.12.3",
"isgd": "^1.1.3",
"marioapi": "^7.0.0",
"oakdex-pokedex": "^0.4.5",
"pokedex-promise-v2": "^3.1.1",
"math-expression-evaluator": "^1.2.22",
"discord-cards": "^1.2.0",
"enmap": "^5.2.4",
"genius-api": "^0.4.1",
"lyricist": "^2.2.2",
"randomstring": "^1.1.5",
"superagent": "^5.2.2",
"overwatch-stats-api": "^2.1.0",
"moment-duration-format": "^2.2.2",
"moment": "^2.25.0",
"google": "^2.1.0",
"sqlite3": "^4.2.0",
"ytdl-core-discord": "^1.2.0",
"meowdb": "^2.0.7",
"snekfetch": "^4.0.4",
"mech-aki": "^0.0.5",
"megadb": "^3.2.0",
"node-fetch": "^2.6.0",
"iso-639-1": "^2.1.0",
"discord.js-commando": "^0.10.0",
"quick.db": "^7.1.1",
"hastebin-paste": "^1.3.1",
"discord.js": "^12.2.0",
"mz": "^2.7.0",
"request": "^2.88.2",
"request-debug": "^0.2.0",
"request-promise": "^4.2.5",
"standard": "^14.3.1",
"uws": "^99.0.0",
"better-sqlite3": "^7.0.1",
"zlib-sync": "^0.1.6",
"weather-js": "^2.0.0",
"weather.js": "^0.1.0",
"marsnpm": "^0.4.5",
"request-promise-native": "^1.0.8",
"jimp": "^0.10.3",
"fs-extra": "^9.0.0",
"youtube-dl": "^3.0.1",
"simple-youtube-api": "^5.2.1"
},
"engines": {
"node": "12.x"
},
"repository": {
"url": "https://glitch.com/edit/#!/hello-express"
},
"license": "MIT",
"keywords": [
"node",
"glitch",
"express"
]
}
jesus christ
i need to optimize this
how tf do you optimise a .json file
jesus fucking christ how many dependencies do you have
holy
My problem is use a lot of CPU and I need that we do not use as much
Can someone help me make a bot like better antispam
"snekfetch": "^4.0.4"
"node-fetch": "^2.6.0"
Pretty sure you don't need both
plus snekfetch is depreceated
OML you have superagent as well
What is an API ban
being rate limited or permanately ip banned
Is there a way to get aroundit
My problem is use a lot of CPU and I need that we do not use as much
Doubt reducing the amount of used dependencies would help with that, review your code instead
@earnest phoenix remove everything that you dont actually use in your code lol
If I get API banned will the bot still work or not
@woeful pollen nop
If the bot is banned, how would it still work?
If you get API banned you bot is yeet
O frick
Depends on what you're doing
Using a Google translate api
what about it
To translate every message sent ever into dutch
google's api has nothing todo with discords
Not going to receive a Discord ban for using a Google product
so your fine in that regard
But you will get suspended from Google's stuff for 24 hours if you hit their ratelimits
Might get rate-limited/blocked by Google if you have too many messages
unless you send a translated version of a message to Discord on each message
also the api allows a maximum of 2 Mill characters
@earnest phoenix i seriously doubt your bot uses all of that
which you hit very fucking quickly
per day i think?
As I know what you do not use the bot, they are myportalbot codes
Oh that's fine
:o wtf were you doing
just testing some stuff
so you can imagine the ratelimit is very low
and very quick to nuke you
Is it possible to increas the ratelimit
any idea how i could make a calculator command
@misty sigil evaluation works like a calculator
easy way - use a lib
huh
harder way - write a regex exp to parse mathematical expressions
never thought of that
@modest maple Pricing is per month, so if I'm reading this correctly, you should have a quota of 500k chars per month
Id like to see you run that on a bot lol
Would it be possible just to make your own translation service
Uh no
i'd rather just be a lazy and get the library
you'd need an offline translation software
and hook it up with some code
if said software supports it
theres a reason why google charge $20 per Million characters
it could be way less
besides, google isnt the only translation api out there
their target is just large companies
yeah
tbh the user google translate limit is massive
When i ran out on their api i just scraped the normal version
everything google is expensive af
cuz companiesβ’οΈ
i used to use their geocoding apis
just like make a bunch of api keys and cycle
i switched to mapbox and get 3 times higher rate limits per month for free lmao
or you can exploit their $300 trial and the fact that they don't deny duplicate cards
they do now
do they?
The API provides access to the Yandex online machine translation service.
i've been using that method for the past 3 years to host a minecraft server on a powerful vm
lol
discord already took a stance against heroku and glitch
they banned a fuck ton of ips
this is why we can't have nice things
selfbots were allowed until people started utilizing them for spamming and raiding
can discord keep doing that
how do i copy a message and cut of the prefix
fuck heroku and glitch
@daring quiver [some text](some url)
dudes ihave a doubt
this will create the blue text
is the embed doesnt need a title?
no
here i get some helps tbh
the embed requires at least ONE field
be it author, title, description, etc
fields are optional
hi, why is my bot coming online? its connecting to the database and the file the event is in loads but doesn't do anything? my code:
a property?
module.exports = (client) => {
const channel = require('../../config/channels').bot;
client.createMessage(channel, {
embed: {
title: 'Bot is now online.',
footer: { text: 'timestamp' },
timestamp: new Date()
}
});
console.log('bots online my dudes');
};
afaik you can't send empty embeds
You can
would you like to see some black magic
I know little english
like, you can if you add a content-less title or whatever
but it's technically not empty
.setFooter("This is the footer text, it can hold 2048 characters", "http://i.imgur.com/w1vhFSR.png")
can i only add that and a description
and how to make it auto spawn it for a req messages needed
a i did this
E
ai did this
@daring quiver only embeds can have url texts
Who knows how to make a betterantispam bot
@lyric mountain
What do you use to enter the code

How Can I Online My Bot
can i write here or Do I need a bot
Oh Thank you
Kk
Bearing in mind I haven't a clue how shards work (due to lack of necessity so far) is it possible to run one shard on one machine and another shard on another machine etc?
yes
Wow epic
Thank you
Ig a music bot for example could provide reigonal voice then?
If they wanted
no
Ah okay
you have no control over how shards are organized
O
which guilds go to which shard
Oh I see, I wouldn't need to organise them anyway it was just a theory
So if I wanted to get my bot to add it to a server how would I do that
Perhaps use google?
what is it
A antispam bot
a bot cannot invite other bots
hey guys, i'm having problems editing my bot for music reproduction, i'm searching for an npm package that would work like ytld core. any suggestions? (i'm trying to change it cause 429 error is s**t)
@quartz kindle Yeah thankfully I won't need to (as I don't have a music bot lul) but thank you anyway
use abal's permission calculator
https://discordapi.com/permissions.html @timber linden
K
@lyric mountain
@earnest phoenix i'm using discord-js advanced can i do this
discord.js advanced?
Discord.js pro max
DLC
Loot box
lmao
the developer portal literally has a perm calculator
Oh
and Invite generator
can i send link
discord.js advanced?
@quartz kindle
hey, i've made a simple express server (with nodejs), that i'm hosting on a vps, but when i got on the url with the defined port the page just keeps loading but doesn't display anything (after 5 minutes my browser displayed the "page not found/not internet connection" page). Do i need to configure anything else than just the server.js file ?
if you don't make a route it should simply return a 404
did you get the correct ip?
const express = require("express")
const path = require("path")
const app = express()
app.get("/", (req, res) => {
res.send("Ok !")
})
app.listen(5000, () => console.log(`Started on :5000 !`))```
it's all for the moment :/
Tried to make a bot on mobile pc tome
did you get the correct ip?
@copper cradle yep
time
@daring quiver send in dm
@hasty lotus weird
yep :c
you didn't forget about the port right
no
hmmmm
if i forgot the port it would have sent me to the homepage
there is already a website on the vps in the /var/www/html folder
un m
does your vps require opening ports in some firewall?
does your vps require opening ports in some firewall?
@quartz kindle i don't think so
what is the command to check ?
(it has ubuntu 18.04)
which hosting is it?
ovh vps
Βͺ
:c
Does anyone here use grasshoper
ah nvm thats only for dedicated servers
hm ok
try making a curl request from inside the vps
can someone help me for my homework jk

@lyric mountain
@earnest phoenix not empty tho
it is

only the color prop is set
because how is the client supposed to know which color to use
Yeah, so it has a property
It's just content-less
Oh gish
But not empty
and libs automatically set the color prop internally so you can send an empty embed
without setting anything
I use spck editor
@hasty lotus try sudo ufw status my ovh vps came with ufw on it, maybe yours did
k
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
10000:20000/udp ALLOW Anywhere
10000/udp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
10000:20000/udp (v6) ALLOW Anywhere (v6)
10000/udp (v6) ALLOW Anywhere (v6) ```
is it good sign ?
or not ?
x)
Well it means the firewall is on
what is the command to stop it ?
And they opened 10000 to 20000 for me reason
ufw stop ?
I'm trying to make betterantispam for people on discord but when I play it says error null
k
I'm trying to stop the script
Just open the port you need opened
how ?
sudo ufw allow PORT
@timber linden you can get help here, you dont nees to dm me
hi
does anone know why im getting this error: TypeError: guildSettings.findOne is not a function ? guildSettings is:
As I try to play it
const guildSettings = require('../../models/guild');
It is error null
wait, i fixed it nm
No help??
You haven't given the code in a sourcebin so how would we help?
Hi, do anyone use imgur to save his bots embed images ?
because mine sometimes sends the embed without images and I think that it's bcs of imgur..
I get my imgur image using inspect element
Huh?
You aren't using these links [https://i.imgur.com/7D6Ha7p.png] ?
Like ```python
embed.set_image(url="https://i.imgur.com/7D6Ha7p.png")
oh i think you're using the embed feature wrong
or probably because of Discord
hm ? π
It's either imgur or Discord here
But my pictures that are in images.unsplash never got problems
I was thinking that he didn't define an embed
I was thinking that he didn't define an embed
@torn ravine Oh that's not the problem!
If the message was posted just fine, that's not the issue
hold on
For example :
This is an embed stored in my DB
With the title, text and imgur link
And sometimes like today, the pic is missing and it's the same for the rest of the images stored on imgur
@timber linden explain
ok what is the script
Language?
Seems like Discord does something funky with the embed images sometimes. I got around it by adding a link to it and saying "Image missing? Click [x]".
I can't help because I'm new to making bots.
I need ideas tho. Help me bruh



