#development
1 messages · Page 838 of 1
Heroku ig
scratch
ping
dont make a big multipurpose bot
find a purpose
and find commands useful to that purpose
:p
hm?
say actual sentences
no
what about it?
have you seen pokécord
those bots that have a purpose but omg moderation! fun! are annoying af
looks at mee6
other bots have it
the problem with those giant bots, is that no one has everything
so you have to add another giant bot to get the feature you're lacking
so then you end up with TWO moderation bots
TWO music bots
and 50 bots that have a freaking hug command
yea but
why have a ban command
unless you make an entire moderation system
spam command?
yea or that
@earnest phoenix that is api abuse
it is abuse
that maxes your rate limit instantly
imagine spamming spam command
that is abuse
you do know we all have bots on here right? and sorta know what we're talking about?
dont spam the discord api,
@earnest phoenix Two people could do it and get your bot ratelimited easily
little
they dont have a spam command
^
^^
ok and?
ratelimit is not a global
1000 Times a minute is fine globally
the bot isnt ogiing a
the bot isnt going
a
aa
a
a
a
try that sometime in a dm
watch what discord does
its 500/s for global rate limit across all actions approx
not to mention
bots like mee6 and dyno for all their logging stuff use webhooks
there we go again.
because they have a higher ratelimit
k
but still its like wjsjdfb
try like naming the bit
bot*
instead of saying "this bot"
and then take it up with a mod.
because again.
that IS discord api abuse
search api abuse in:mod-log in discord search
and read a bit
right there.
@earnest phoenix
https://ptb.discordapp.com/channels/264445053596991498/325648177178869760/692707815583776789 oh look a bot that was just declined for sending multiple messages in a row
so yea
dont do it
yardim me
since you were the one that just declined that bot
@earnest phoenix how old are u
Kid spam command
What's happening
go here
type api abuse in:#mod-logs
for fucks sake
we're not trying to diss you
spamming a message is api abuse
Can y'all calm down
oh i am calm xD
this mans is just being very difficult
Sometimes they have to learn the hard way lol
There is extremely no need to make a bot spam a channel with stupid messages
it is an API abuse
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thats coming from a mod that decides the fate of your bot.
and we can't monitor the 10k bots that we have in our list
if a bot has a command like that, we can ask them to remove it
simply report it
report it
also #memes-and-media please - give me the bot ID
@earnest phoenix
Wat
oh yea we know
505571539333152781
This discussion is now for #memes-and-media please - again - please move
its not rulebreaking
only dev/code questions here
its API abuse
thats discord rule breaking ;P
ToS 👀
against to ToS
move before eri yeets us all
Can't yeet me since I made the bot Yeet 😉
aight
I'm not joking when I make warnings here, seriously stop and move - keep channels on purpose and clean for everyone
thanks.
Has anyone used node's FS to fetch a github url ?
Github URL https://github.com/p/a/t/h/to/file
fs is not for fetch url 🤔
https://raw.githubusercontent.com/crazygmr101/AnsuraBot/master/main.py <<thats the format to download a raw file btw
oh
its just
^
file
let me eval that
@valid holly Only URL objects using the file: protocol are supported.
file: is a local file in your computer
not a remote file
Really ?
I thought it accepts absolute paths
fs.readFileSync(new URL('file://hostname/p/a/t/h/file'));
Maybe I need to document better
Anyway, thanks, I'll look for something else to use then.
Taking this into consideration:
userinfo host port
┌──┴───┐ ┌──────┴──────┐ ┌┴┐
https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top
└─┬─┘ └───────────┬──────────────┘└───────┬───────┘ └───────────┬─────────────┘ └┬┘
scheme authority path query fragment
file: would be the scheme ?
should be
I'm basically trying to read stuff related to covid
URL constructor returned this for my url
URL {
href: 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/03-25-2020.csv',
origin: 'https://raw.githubusercontent.com',
protocol: 'https:',
username: '',
password: '',
host: 'raw.githubusercontent.com',
hostname: 'raw.githubusercontent.com',
port: '',
pathname: '/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/03-25-2020.csv',
search: '',
searchParams: URLSearchParams {},
hash: '' }
I know request isn't maintained anymore
Anyone knows any other packages for HTTP requests ?
node-fetch
node's built in HTTP library 
node-superfetch
node-fetch or axios
node-fetch
*1000 servers per shard
which one are you correcting?
(ik it's the latter but some people might get confused)
you can't choose how many servers you have on a shard, you're forced to shard when you hit 2.5k guilds, which and how many guilds go to each shard is discord's decision following the formula (guild_id >> 22) % num_shards == shard_id
thats not the bot, thats the bot app
but how?
oauth
how do they do that?
discord dev portal
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
it shows up in your apps once you authorize an app via oauth
Hmm... @solemn quartz are you talking about making a bot or the oauth?
@solemn quartz so wdym by how do they do that?... The oauth?
look at the url above
"Know what servers you're in"
this?
probably for the dashboard
oauth is used in web apps to get a bearer token for your account to access certain endpoints on your behalf
@solemn quartz when he said that you probably went:
Kk
lol
wait
ok so
if i had partial messages, would i recieve messageDelete/Update events from a guild on a different shard?
wait do you recieve events across shards to begin with?
yes
so you can recieve a message event on each shard for one message?
no
DMs are always on shard 0
you'd get MESSAGE_CREATE from a guild on whichever shard the guild is supposed to be in
based on the already mentioned formula above
what
yes they are
shard 0 will be the one handling dms
since they're always sent out to only shard 0
a lot of libraries unify sharded clients into one
so any events you get on any shard are forwarded through one client
how can i make js client.commands.execute(message, client, args) not be a function and be something like ```js
client.commands.execute: (message, client, args)
the second one gives a syntax error, how can i make it not give one and make it function?
any ideas?
what
like
i am getting this error, client.commands.execute(.....) is not a function
so
i need to make it not be a function and be smthing like the second one, client.commands.execute: (message, client, args)
if that makes more sense...
Is it even a real function? I don't think it is
yes..
I just grab the command from the collection and use .run(), but eh
wdym?
@digital ibex what are you trying to do with that function? Can you show us an actual screenshot of it?
sounds like an X Y problem
tell us what you really want to do
ok, so client.commands is a collection
yeah
it is not one command, it does not have an execute
it is many commands, each command with their own execute
mhm
so client.commands.get(command).execute
oh
you have to get/find the command first, so you can execute it
yeah
ok, im getting another error:
cannot read property of 'name' of undefined
here: client.commands.get(command.name);
const command =
client.commands.get(commandName) ||
client.commands.find((cmd) => cmd.aliases && cmd.aliases.includes(commandName));```
const commandName = args.shift().toLowerCase();
how can i make
js client.commands.execute(message, client, args)not be a function and be something like ```js
client.commands.execute: (message, client, args)the second one gives a syntax error, how can i make it not give one and make it function? @digital ibex
i think what you're trying to do is to have something like
module.exports = {
execute: ({ message.client.args }) => {
[command code here]
}
}
in a separate .js and then you assign that to client.commands and just call the exported function with client.commands.get('commandname').execute({ message, client, guilds })
sorry if thats not it
uh
i was getting the error in my command handler file, not the command file
thank you anyways
that means the command was not found
have you tried doing console.log(commandName) to see if the command is correct?
also, why are you trying to get the command again?
let command = client.commands.get(commandName) || client.commands.find(c => c.aliases && c.aliases.includes(commandName));
if(command) {
command.execute()
} else {
// command not found
}```
how to start up making my own website ?
k
and... im using a try and catch thing
Step 1. make index.html
Step 2. write code
Step 3. Run site
Learn a coding language for websites like js and use a framework/web server
@prime cliff i have not learnt to use frame work or web server
Better get learning then 
@prime cliff from where can u plz guide me pal
first of all you need a server
do you have any sort of hosting?
ie: a webhost, or a vps
Glitch supports web servers too i think
hm
or a service like glitch/heroku
yep
which one do you have?
@earnest phoenix https://www.google.com/search?client=firefox-b-d&q=js+web+framework
well, you can use either of them
first you need to install a webserver
if you're using javascript and node.js, a popular webserver you can use is express.js
express.js is used for web development ??
express.js is a backend
express is a webserver
tim, nothing logs when i log commandName
you need html for frontend
a website is made of many different things that work together.
^ yea
at a basic level, there is a "backend" (the server, that people connect to to load the website) and the "frontend" (what people see in the browser)
if (!command) return;
try {
const client = { value: new Eris.CommandClient(token) };
client.commands = new Eris.Collection();
const args = message.content.slice(prefix.length).split(/ +/);
const commandName = args.shift().toLowerCase();
const command =
client.commands.get(commandName) ||
client.commands.find((cmd) => cmd.aliases && cmd.aliases.includes(commandName));
client.commands.get(command.name);
client.commands.get(command).execute;
console.log(commandName);
} catch (e) {
console.log(e);
client.createMessage('689557849214418972', e);
client.createMessage(message.channel.id, `An error occured.\n\`${e}\``);
}``` thats what i have commandName doesn't log anything and i just get an error
@compact oriole dm pls
true
also, what is that first command at the beginning?
oh nevermind the first command
and
i am doing it bc i was getting errors saying cannot read property of 'commands' of undefined even when i defined it in the try and catch, so.... i defined it with a type
you just made it worse lmao
you are basically destroying your entire client, and your command handler
no wonder why it never finds any command
assuming your command handler is properly done, all you need is to check if a command exists
but i guess its not properly done lol
show your entire code i guess
yeah....
i was getting so many errors and that was the only solution
ao
what
so, delete everything in the try thing?
o
ok
what do i do with the catch (e) {}
then?
Tim, https://hasteb.in/obokenig.js like that?
yes
where is it not a thing?
didnt i tell you before that the execute function should be a property?
oh yeah
lol
pretend its the way u shown me
.
module.exports = {
a: something,
b: something,
c: something
}```
module.exports = {
name: 'random',
}
execute: (message, client, args) => {
//code
}
like that?
should be correct
if its not showing what you expect, then its an issue with your code editor
also make sure the file is saved
guys ive just started out with making a discord bot but for some reason when i use the event "on_raw_reaction_add(payload)" and print the payload i dont get the emoji id im at a total loss
What language?
refer to the docs, see what the payload actually returns, see its properties
i mean i have been
Thank you for saying python, some people just say Russian or English
ill give it another look
haha yes i am a programmer i just never did discord bots before
@silent shore on_raw only gives Ids nothing else
when i print it i get this <RawReactionActionEvent message_id=692747529560784959 user_id=210886704842670081 channel_id=692726432018858066 guild_id=692726210849144922 emoji=<PartialEmoji animated=False name='�💩' id=None> event_type='REACTION_ADD' member=<Member id=210886704842670
1 name='Fam' discriminator='5761' bot=False nick=None guild=<Guild id=692726210849144922 name='Fam' shard_id=None chunked=True member_count=2>>>
yh
see the id="none"
cuz its unicode
how am i ever supposed to see what emoji is
only custom emoji's have Ids
ohh
so if i just do emoji == "💩" it works
str() the emoji
^^
so that it will be converted to its name if it's unicode
and if it's a custom emoji, it'll be converted into <:name:id>
okay sorry guys ive wasted alot of time on this and its still not working can someone type it for me i must be a retard just to be sure im not fucking up the syntax
whats ur code
@client.event
async def on_raw_reaction_add(payload):
#channel = get(payload.guild.text_channels, name="welcome")
#print(channel)
print(str(payload.emoji.name))
ive tried some other syntax stuff
but not really working
ignore the # stuff
i just want to print the reaction in string so : poop :
Eh, you don't need to call str() on stuff you print since it's automatically called already
It'll be received as a unicode emoji
so if i store it in a var before itll print out as ": poop :"?
soo how do i get it in str
soo i just compare the unicode with some other unicode
Yeah
yh
yh

imagina how long it took for me to actually search up a discord to get help
ive been struggling with this all day
I got a NullPointerException, but my stacktrace points to where I print my trace. Genius.
Extremely not helpful
How do you do to get server membercount on your website?
what do you mean?
The server MemberCount
oh
You send a request to top.gg with the info about your bot's amount of servers and/or shards
They have their own bot
i'm so confused
stop being so abstract with your questions and describe them instead so we don't have to guess
you add their bot to your server
before getting on the server list
And then their bot counts your users
and tells the server list site
I just told you
On my website @quartz kindle
If you wanted it on your own site
You'd have to make your own bot
That counts users for you
and sends it to your site
then make your bot count it. give it an api that your website can request, or make it available somewhere that your website can use
But i don't have the same server
Yes
Which is ehy you use your own bot rather than dbl's
So you can make it route to you own server
But i don't have the same server
hence whygive it an api that your website can requestwas said
or you can do it the other way around
it doesn't matter which end POSTs
Hi
I'm trying a very simple html but this made the widget always loading help please?
<!DOCTYPE html>
<a href="" target="_blank" rel="noreferrer nofollow">
<iframe src="https://discordapp.com/widget?id=478687499137449984&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0"></iframe>
</a>```
How i create a bot
My broadcast audio gets stuck . What can i do now????
make a loop to check if its still playing
if not post error msg and continue playing (atleast try) if not, then start over
question : whats the best between handle events in a single file (like handle everything into index.js) or handling them in separate files?
whatever you prefer
ok
@strange gyro
widget works just fine
@tight plinth handling everything into one file isn't going to clog your code ?
idk
Also if you have line 2.000 for an event, it will use more resources to read through and translate to machine code
And load them when needed, export global objects you're likely to use
You can also use ES6's import
the resources needed to compile big file vs small file is negligible compared to the resources needed to read multiple files from disk
the reason to go for multiple files is for maintainability and ease of use, not for performance
my command handler and event handler uses 4mb
noo its best rip
since when does that sht have an api?
is there any way that that str.match() dont returns an array?
ever
Shimano you could use a different method, but it depends.
and alot of sites use back end APIs
just theyre protected and locked
all of my backend APIs are locked and protected with oauth
APIs do require bandwidth, storage and cpu especially if it has image generation so yes APIs do cost money
the npm package you found is just a wrapper for an api
Shimano you could use a different method, but it depends.
@sudden geyser wym
anything covid related is not useful for a bot
Probably 10 covid bots listed on DBL
yes
because all of them use the same god damn API scraped from the same site
can someone tell me if this code is right
the only dude who deserves credit for a corona bot is the guy who actually made the api that just about every corona tracker bot uses
@earnest phoenix send it
const wait = require('util').promisify(setTimeout);
bot.guilds.forEach(g => {
g.fetchInvites().then(guildInvites => {
invites[g.id] = guildInvites;
});
});
bot.on('guildMemberAdd', member => {
member.guild.fetchInvites().then(guildInvites => {
const ei = invites[member.guild.id];
invites[member.guild.id] = guildInvites;
const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
const inviter = client.users.get(invite.inviter.id);
const logChannel = member.guild.channels.find(channel => channel.name === "join-logs");
logChannel.send(`${member.user.tag} joined using invite code ${invite.code} from ${inviter.tag}. Invite was used ${invite.uses} times since its creation.`);
});
});
well it say Cannot read property 'get' of undefined
oh wait
omg client.users.get
lol it has to be bot

where did you even define client
bot
i have 2 bot one is client and other is bot i was doing 2 at once so i got confused

I AM NOT 2 DIFFRENT BOTS
*different
quick question : is that right?
https://lumap.is-inside.me/NyJt6R0x.png
https://lumap.is-inside.me/RBsVjHnm.png
*src/events/guildCreate.js
Hello
I am tryna move to v12 in discord.js
And I get this error with embeds
(node:28267) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
What does it mean and how do I fix it
upgrade node
https://lumap.is-inside.me/QOtTLpfM.png require(...) is not a function
I know Im doing smth wrong, but idk what
it works
every message will cache message.js
so lets say you get 3 messages a sec
thats more ram
wdym
using require
change js client.on('message' async message => { require('./src/events/message.js')(client, message, dbl, queue, messageCounter); }) to
Const MessageFile = require('./src/events/message.js')
client.on('message', async message => {
MessageFile(client, message, dbl, queue, messageCounter)
})```
ok
it should still work
const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
i cant find what's wrong with this 
Cannot read property 'get' of undefined
it looks fine to me
or i am just dumb
ik but it say that
g.fetchInvites().then(guildInvites => {
invites[g.id] = guildInvites;
});
});
is this right
no, and thats a privacy branch
to fix that, you just delete this
k
(node:28881) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
at Function.normalizeFields (/rbd/pnpm-volume/6290b71c-6a1d-4514-9546-23b51fb40976/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/structures/MessageEmbed.js:436:8)
at MessageEmbed.setup (/rbd/pnpm-volume/6290b71c-6a1d-4514-9546-23b51fb40976/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/structures/MessageEmbed.js:70:91)
at new MessageEmbed (/rbd/pnpm-volume/6290b71c-6a1d-4514-9546-23b51fb40976/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/structures/MessageEmbed.js:11:10)
at embedLikes.map.e (/rbd/pnpm-volume/6290b71c-6a1d-4514-9546-23b51fb40976/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/structures/APIMessage.js:164:40)
at Array.map (<anonymous>)
at APIMessage.resolveData (/rbd/pnpm-volume/6290b71c-6a1d-4514-9546-23b51fb40976/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/structures/APIMessage.js:164:31)
at WebhookClient.send (/rbd/pnpm-volume/6290b71c-6a1d-4514-9546-23b51fb40976/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/structures/Webhook.js:145:62)``` How can I fix this with embeds
update node
does node of a separate manual to learn or do I just look at javascript's manual?
node just runs js files
lol
hey, i have no idea about programming here
https://hasteb.in/ajorubiq.php
error DiscordAPIError: Target user is not connected to voice.
what's wrong? The error appears after I exit the voice channel
all problem solved
I am on discord.js v12.0.2
I am trying to make a command so that when a user does one certain command It will send a message to a certain channel for example
bot.channels.cache.get(`xxx`).send(`bloa vloa vloa`)
How can this be done when the bot is sharded?
I edited the message I hit enter before
i'm pretty sure you're going to have to use broadcastEval
if I want to send a list of items, how should I do it? I'm not really good at programming so I've been doing the idiot way of sending a large number of messages instead.
in which library
broadcastEval hmm ok
node js
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map to map them to numbered strings and then you can use join() to join them into one string
map provides you with an index argument which allows you to get the position of the element in the array
okay, thanks
and how would I make it so that there are multiple pages to the list?
What are you exactly trying to do ?
Making a list is as simple as joining strings by \n
I'm trying to make a list of monsters for a text-based rpg I'm trying to create on discord.
so when the user hits the necessary keyword and prefix, an alphabetical list of monsters appear
and there will be many monsters so having them appear all at once is too much. Thus I want to also include something that allows the user to flip through 'pages'
Well there's more to that than making a list.
First have an array.
var monsterlist = [
"Monster1",
"Monster2",
"You",
"Monster4"
];
Then:
monsterlist.sort();
This will sort everything alphabetically and in ascending order, placing You as the first monster in the list.
sort() is an Array method.
How much bandwidth should my bot use?
Then displaying the actual list you can join everything by \n
i'm pretty sure Y comes after M
Lol
sort() is sorting strings alphabetically in an ascending order.
var x = [
"B",
"C",
"A"
];
x.sort(); // [ "A", "B", "C" ]
x.sort().reverse(); // [ "C", "B", "A" ]
okay
what do you mean by join everything by \n? isn't \n mean newline or am I thinking of something else?
x.sort() is not needed
You can join by \n
yes \n means newline
I need to have the monsters numbered so that when user chooses a number, it will display the corresponding monster's stats.
How much bandwidth should my bot use? I don't really care how much it uses, but I would like to know why it uses 50kb/s. My bot is a text bot (not a music bot) with 36 servers.
Then easiest method to slice info in a nice format (recommend Embed Message)
var monsterlist = [
"Chair",
"Monster",
"Ducktape",
"Apple"
];
var x = monsterlist.sort(); // [ "Apple", "Chair", "Ducktape", "Monster" ]
x.slice(0,2); // [ "Apple", "Chair" ]
x.slice(2,); // [ "Ducktape", "Monster" ]
Send a message with first items, then update on request with the rest
There are more methods of doing it, but this is basically simple.
Ex: You'ld have a list of 100 items, divide it by 5 and have 20 items per "page".
You can for loop the array, iterate through elements, have an integer inside a variable that you add 20 every time it receives update requests from user input, and stop it when i >= array.length
Then slice with the integer from i
OK
how do i highlight a text in purple?
i'm aware that you can use syntax highlight, but it doesn't seem you can get purple through that method`?
std::cout << "no, you can't" << std::endl
is there any other metod to color code text?
seems kinda counter intuitive since names can be any color
You can make it like this, here is an idea:
Make 2nd embed the list, play an animated gif that basically "loads" the next page and update embed with gif, timeout 1 sec then update with list
Nah
Too much hussle
@loud salmon
Made embed the same size as the gif
12 lines + footer 60 invisible spaces
When you update there will be no change in embed size
But this is purely optional, just an idea to make it unique.
You can also have a fade effect on the loading gif, for smoother slideshow
But yeah good luck with your code.
Omfg when I'm high I have the best ideas @tidal parrot
What if you'ld make gifs out of a movie, then update embed message with each gif sequentially to play the movie
Short films ofc

Cinema Bot
ooo
Update them and have "cinema slots"
not more than 50 people watching the movie across client
So no abuse/insane ram usage
yoo I need to smoke another one
Ima become next Elon Musk
bruh
I'm all out of weed and no dealers available cuz of lockdown
you lucky fuck
send some
mine is literally next door
yall sure you wanna discuss this in this channel
shhh
👀 👮
how will you ensure that the gifs transition smoothly into each other?
you cant
you hope that your end user doesn't live in venezuela and has trash internet
hi
when i use my eval command i get this error args is not defined when it is
any ideas?
execute: async (message, client, args) => {
try {
const { token, prefix } = require('.././/..//config.json');
// const args = message.content.slice(prefix.length).split(/ +/);``` like, i defined it both here but still
it says args isn't defined
@loud salmon Here is more lmao
Have items as emotes for each monster (I put pepes cause that's what I had) then have them highlighted with hover info and clickable link to the monster docs
@digital ibex remove the //
execute: async (message, client, args) => {
const args = message.content.slice(prefix.length).split(/ +/);
try {
const { token, prefix } = require('.././/..//config.json');
how many directories do you need to back ?
ik i have never seen that type of directories
that's an bad idea
nothing as long as it works
also
fs.readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith('.js'));
```why is this only reading files which is is only `.js`?
Because you put the filter to do so ?
If it's a command handler just:
const command = "example"; // This would be your command from user input
require("./p/a/t/h/to/folder/with/commands" + command + ".js");
Idk I'm too high
un momento
fs.readdir("./commands/", (err, files) => {
if (err) console.error(err);
let jsfiles = files.filter(f => f.split(".").pop() === "js");```
@digital ibex
thats-
Wait
Have u got the nested
What have you got dir defined as
<_<
What is dir define as since you are doing ${}

You dont need the ${} in the command handler
learn it & #memes-and-media
Make a prefix command
How?
Have a look there first
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Nice development talk

yes very helpful tysm
No Problem, when you need more help. Dm me.
I still don't understand it
I still don't understand it
@hoary dawn, what do you need?
explain the people here what you need
How to change prefix in the server
I added zerotwo in my server but I want to change the prefix
...u want to change zerotwos..?
Yes the prefix
...........this aint the support server
Thank you
I keep getting a permissions error 50013 with POST (d.js v12)
0|index | 26-03 21:12:54.010: at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
0|index | 26-03 21:12:54.010: at runMicrotasks (<anonymous>)
0|index | 26-03 21:12:54.010: at processTicksAndRejections (internal/process/task_queues.js:97:5) {
0|index | 26-03 21:12:54.010: name: 'DiscordAPIError',
0|index | 26-03 21:12:54.010: message: 'Missing Permissions',
0|index | 26-03 21:12:54.010: method: 'post',
0|index | 26-03 21:12:54.010: path: '/channels/692488724008927333/messages',
0|index | 26-03 21:12:54.010: code: 50013,
0|index | 26-03 21:12:54.010: httpStatus: 403
0|index | 26-03 21:12:54.010: }
I'm checking for:
- ATTACH_FILES
- SEND_MESSAGES
- ADD_REACTIONS
- EMBED_LINKS
- USE_EXTERNAL_EMOJIS
- READ_MESSAGE_HISTORY
- VIEW_CHANNEL
- MANAGE_EMOJIS
- MANAGE_MESSAGES
I still don't know what's causing the problem. Any suggestions? My bot is very simple. It sends, edits, and deletes its own messages. Sometimes sends images, and adds reactions to its own messages.
Can you show the code that's causing the error?
i'm guessing it's sending a message
since it's a POST request to the messages endpoint
gopi, are you sure you're actually checking for those permissions?
be sure to prioritize channel overwrite permissions over guild permissions
are you sure it's not muted?
function Eq(configs, bassboostgain) {
console.log(bassboostgain)
const bands = configs.BassboostBands
tmp = []
bands.map(band => {
band.gain = band.gain + bassboostgain
tmp.push(band)
})
return tmp
}```
when I input 1
into bassboost gain
it works
but when I insert 0 again
its the same output
any idea why?
It just adds more on
and doesn't reset it
like the "const" implies
Trying to make it find the command handler but I don't know how to put it correctly. What you have to do is go into the file handlers, then go into the command.js one. How would I properly do it?
Code:
const Command = require("../handlers/command"),
Error:
[2020-03-26 19:10:06]: [Error]: Error: Cannot find module '../handlers/command'
For js.
nevermind, i fixed.
My old version of my bot has a help command
but I dropped support in the rewrite
It was underused
Mentioned it to another server too
be sure to prioritize channel overwrite permissions over guild permissions
@earnest phoenix do you have any code snippets on how to prioritize channel overwrites?
Again, why the fuck would you drop your help command?

It's like giving you a new closet without any instructions
Or a car without even knowing how to drive
Good point^
Your bot won't even get accepted if it doesn't have a help command lol
yes lmao
hm
Does anyone know what a .then in js is equivalent to in python
I just recently started working in discord py
await
How i can conect a page with a webhook? Discord.js 11v
use async functions @honest whale
Help?
@earnest phoenix https://anidiots.guide/discord-webhooks
npm i
warns dont matter, errors do
npm i quick.db
@mossy vine still fails
what is the error
how would i make a set prefix command that is able to go to a database that supports heroku
you need a remote database
can you recommend one
mongodb atlas
Mongo db
um
can we edit a message and add attachment in it discord.js?
I've done a function that search a guild member by its username and return member. The problem is that if member exists every member propriety returns undefined. Here is an output of the function if I search myself
it works, but member.user is undefined
member.guild too
strange
https://lumap.is-inside.me/Xqs4NWjM.png here is the function
username is a string
wait a second
nah it was the letter
cache is not a promise
icon_url or somthing like then i imagine
why me
Cause yes
it's for image url (or an attachment)
I mean it can be the display avatar one
avatarURL()
it can be either at times
So i have a command called userinfo also serverinfo but it shows the still icons and avatars of the users and servers but when the users or server has an animated icon or avatar it still shows a still image of the animated avatar or icon's first frame... and it doesn't show the animated gif used as icon or avatar... What's the code to fix that?...
I use displayAvatarURL() for users and
iconURL() for server icon.....
(discord.js v12.0.2)
URL({
dynamic: true,
size: 1024,
format: "png"
});
dynamic suits for your problem here, as it returns .gif format for animated and it defaults to .png as mentioned in format if !gif
and also look at the docs
Oh nice... Thx for the help...
Recommend using png as default format, a lot of people use avatars with transparent bg
/transparency
^ better for graphic avatars
webp < jpg
dynamic is set by default to false so this is why you need to set it first
Yup always use webp for Discord avatar in bot commands
webp can't be viewed on mobile
Hmm...
It can
Hello, using d.js v12, this code won't work js client.user.setActivity(`c!help | ${client.guilds.cache.size} servers | ${client.users.cache.size.toLocaleString()} users`); client.user.setStatus("dnd")
if in embed maybe
but this is a browser enviroment
It still can on browser
iOS nah
Webp can be viewed on mobile... I tested it before...
to be as friendly as possible, - the size use png @earnest phoenix
Hello, using d.js v12, this code won't work
client.user.setActivity(`c!help | ${client.guilds.cache.size} servers | ${client.users.cache.size.toLocaleString()} users`);
client.user.setStatus("dnd")```
Hmm... Might be true cuz I'm not an IOS user @prime cliff
don't copy and paste your message again just wait for someone to help you @golden condor
hecc
You are having an #memes-and-media discussion in development
setPresence in v12
also why do you need the .toLocalString()
Thx
Instead of setActivity
What about the setStatus
its the same
setPresence({
activity {},
status: ""
});
https://corynth.is-inside.me/2AZaFpld.png That didn't work either
setPresence({
activity {
name: "your game"
},
status: "your status"
});
Like that
client.user.setPresence({
activity: {
name: c!help | ${client.guilds.cache.size} servers | ${client.users.cache.size.toLocaleString()} users},
status: "dnd"});
👍
you sure on v12 ?
did you stop the bot and restart it
Yes
console log it yes
but also .then
No need to use toLocaleString() as it will convert to string
it's inside ``
.then(console.log("success")).catch(e => console.error(e))
👍
Hi guys I have a question. When I make a Streaming Status on my Bot on PC then theres Playing but on Mobile theres Streaming.
Can someone help me?
Use setActivity @golden condor
He's on v12
Still it's not working
How about going on dnd
Are you sure you're on v12?
Yes I am fucking sure
I just spent the past 3 hours rewriting to v12
And I have updated it
Restart the bot and add the code in ready event
you can still use setStatus
It worked
Hi guys I have a question. When I make a Streaming Status on my Bot on PC then theres Playing but on Mobile theres Streaming.
Can someone help me?
.setActivity
@fallow wigeon it needs an url
I thought v12 wasn’t released tho





