#development
1 messages Ā· Page 573 of 1
they are according to some
yes my b
XDD
php yes is a programming code
imperative = you're an emperor, a dictator, you must order your subjects to do everything you want them to
Hypertext
Markup
Language
im sorry but if you can't understand, not everyone should code and that's the T
its a programming language
say that to the normies that make discord bots
html
declarative = you declare laws and people adapt their existing stuff to work around those laws
i don't even look at generic bot developers
because they dont have a clue what they're doing
and have never heard of any other programming language other than js
they code in english
node.js operating system
im worried that someone who doesn't get sarcasm will take this seriously
got it to work with my main prefix
how would you do archives of a channel
like do you fetch 100x until theres no more then jam it in a file or what
is that even allowed?
then i guess thats the only way
but like
there are channels with millions of messages
i'm making a ticket bot
they'll be newer channels in a way
basically on close the content is archived to a file
you could keep track of the contents with a db
you need to record a lot of back and forth messages?
ok i have to be really dumb to not get this. Why is my bot able to subtract but not add? ```js
let amount = args[0];
let bank = money[message.author.id].bank;
let cash = money[message.author.id].cash;
let newCash = Math.floor(cash - amount);
let newBank = Math.floor(amount + bank);```
cash money
...
"5" - 5 = 0
"5" + 5 = 55
anyway around?
make sure you're using numbers and not strings
they are numbers
"280815367662731266":{"cash":2397,"bank":211000}
args is a string
amount is not
if you cannot use that

then that is super sad
This bug has been in my nightmares for the past 6 months or so and I don't know how to fix it
I'm literally willing to pay money for someone to help
6 months for it not being able to read a property?
seeing the full dump from the error would be helpful
@molten pewter the problem should be here js const imageType = imageCheck(image); await client.wait(500); if (["jpg", "png", "webp"].includes(imageType.ext)) {
What file is that in
i dont know what imageCheck does, but if you're arbitrarily waiting 500ms, i assume its an async function
instead of waiting a hardcoded value, you should await the function to complete. depending on the image size and download speed, or whatever else your code does, it can take longer than 500ms to complete
well, apparently its an npm package file-type and its not an async function, so waiting 500ms will do nothing
its returning null because it found no match, so either unsupported or broken file
just check for null and throw an error when that happens
const link = req.query.link;
const exp = new RegExp('https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)');
const matches = link.match(exp);
return res.json({ matches });
so i made that
but i always get null

why are you using regex to parse an url
uhh
Tony I believe the proper answer to zig's question is "yes"
I keep seeing this big error at random in my logs and I don't know what it is. The error code is ECONNRESET if that helps
that means your bot disconnected
could be network failure, bad/slow internet, or a billion other things
Ok, so it's nothing that I should worry about in terms of the bot itself
so i have a responsive navigation bar that changes depending on screen size
the problem is for mobile only
the first time i click on the three lines to open up the nav but it just pops up but when i close and re open again it does the animation i made but it doesnt work the first time i click on it for some reason
been trying for 30 mins now and no results
i can screenshare if needed
how does GroupDMChannel actually work
i made a group DM channel and it even logs the proper object but when i do .then(dmchannel => dmchannel.send(etc... its missing access
0|CensorBo | JPBBerry#9659 ran command: eval
0|CensorBo | GroupDMChannel {
0|CensorBo | type: 'group',
0|CensorBo | deleted: false,
0|CensorBo | id: '545094689989328897',
0|CensorBo | name: 'Censor Bot',
0|CensorBo | icon: '87d1e17bdca6c63bd8682bd0c01d1bca',
0|CensorBo | ownerID: '394019914157129728',
0|CensorBo | managed: true,
0|CensorBo | applicationID: '394019914157129728',
0|CensorBo | recipients:
0|CensorBo | Collection [Map] {
0|CensorBo | '142408079177285632' => User {
0|CensorBo | id: '142408079177285632',
0|CensorBo | username: 'JPBBerry',
0|CensorBo | discriminator: '9659',
0|CensorBo | avatar: 'fa56f5964f8de67e28b1a4a89928ce9d',
0|CensorBo | bot: false,
0|CensorBo | lastMessageID: '545094688781238272',
0|CensorBo | lastMessage: [Message] } },
0|CensorBo | lastMessageID: null,
0|CensorBo | messages: Collection [Map] {},
0|CensorBo | _typing: Map {} }
0|CensorBo | JPBBerry#9659 ran command: eval
0|CensorBo | (node:13872) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
0|CensorBo | at item.request.gen.end (C:\Users\ninja\Desktop\bot\node_modules\discord.js\src\client\res
t\RequestHandlers\Sequential.js:79:15)
0|CensorBo | at then (C:\Users\ninja\Desktop\bot\node_modules\snekfetch\src\index.js:215:21)
0|CensorBo | at processTicksAndRejections (internal/process/next_tick.js:81:5)
0|CensorBo | (node:13872) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error origina
ted either by throwing inside of an async function without a catch block, or by rejecting a promise which w
as not handled with .catch(). (rejection id: 12)```
```js
client.user.createGroupDM([{user: '142408079177285632', accessToken: ACT}, {user: "339091840538247179", accessToken: ACT}]).then(a=>a.send('test'))```
@slim heart well first and last of all, you can not create a group dm with the bot
only singular dms
@visual zenith yes u can
- bots literally have an oauth scope for making a user join a group dm
- itās literally making the group DM as I showed above its made a GroupDMChannel Object
Uhm, im pretty surs the createGroupDM() only works on user accounts, exactly like <User>.addFriend()
Sure*
Thatās why you need the scope and accessToken
You need the accessToken instead of a friend request essentially
And also itās not marked as user only, and again, itās still making it.
It obviously CAN make it but I think Iām doing something wrong after making it
Huh? Im 99% sure it says on the discordapp docs that bot users cant create/participate in group dms
Let me check
Look at the oauth tab on discord
It has the gdm.join scope
And also the piece of documentation above shows that you can
That doesnāt say it canāt make gdms
It does!!!
It just says it canāt be added to one
xD
creating one would mean adding yourself to it
and it shows missing access
Clearly not because I LITERALLY made a GroupDMChannel

what are you trying to accomplish even mate?
If you look at the console log above way up there it literally says GroupDMChannel { ...
what does it matter...?
?
And even if thatās not enough it even says managed: true meaning it owns it obviously meaning itās apart of it š
Missing Access
It means the endpoint exists, but your bot cant use it
Yea Iām probably doing something wrong
Yes, you are trying to use a function that only works on user accounts
ye
It only says missing access when it try to send a message
no, it doesnt matter
it still didnt create the group
and did you even get the token?
Yes I did
using the oauth?
ok then.
Thatās not what Iām saying
unless another user would to authorize it
I have the actās of the two different users
On the API DOCS it literally says that bots cant join or participate in group dms
ofc lmao
you understand what oauth is right
W8


oauth is just letting the bot execute actions for you
YOU made that group DM
Nik I know what oauth is

OAuth is magic ofc
oh boy
No ok Iām confused cuz I just did that again using three separate account I got the notification on my phone FROM the bot and I canāt seem to find it now-
I got a notification from a gdm but now I canāt find it
Wow so much abuse right here
You can't use a client for a bot account
well u can use client.whatver
client.channels/client.users/client.guilds etc
U mean duh discord application client but still
Use a client like the discord app
xD
How dat abuqse
u can use client on both user and bot -_-
No
Discord.Client() ???
You shouldnāt
then it'll be called client
But u can
I mean A DISCORD CLIENT
Just because the endpoint and function exist doesnt mean that you can use it on a bot account. Examples of that include: creating/joining a group dm
-_-
not a lib
Dondish u make no sense
I MAKE LOTS OF SENSE
Are u one of the idiots that use bot instead of client

@slim heart you make no sense, you are trying to use a user account only endpoint on A BOT ACCOUNT
^^^
Ok well it just worked so
mate
i know for sure u cant create group dm using a bot
The docs are wrong, they should say thaz the endpoint is only available on user accounts
You can't use a Discord client like the website app on a bot account
For two seconds but it did
^^^
It didnt work because you got an api error
ofc
You realize thatās in recipients right?
@slim heart are you using a bot?
Yes
or user account
Bot bot
It just doesnāt pop up on my DM list but Iām getting notifications from it
You realize that you are still trying to do the impossible

Itās literally like half working donāt say itās impossible smh
ye
It sends it and I get a notification on my phone but itās like the gdm gets deleted instantly after
because its an error
Obviously not
Obviously it is
obv šš¾
If itās sending it then itās not erroring on the bots end
lmao heres the best conversation xD
Unless discord is just broken
unless discord doesnt let bots in group dms
š
discord DOESNT let bots in group dms
Just stop this isn't an argument of who's right or wrong, Currently it's stated by discord that bots cannot join/create group DM's
If you wanna test around with it do that in your own space
If you find a bug great, Tell Discord
Yes I understand that Iām just saying it like just did work then deleted itself after it wasnāt an error in the bot it might be a bug then Āæ
wheres ur code and error?
Thereās no error and itās the same code just with another user
User account?
no bot account lmao
Another user as recipient but not itās a bot account making the gdm
Did you read what Xig even said?
Itās what I sent above I just put another recipient in the array and it made it
switch to user account and see if it works šš¾
holy shiiiiiit Iām not disagreeing with that Iām literally saying itās still like working even tho itās not supposed to

šš¾
Like I said stop this
Its clearly notworking, youre getting errors

Stop,
As I said three times Iām not getting errors anymore
ok srry
Final time I will say it
....
Oh I thought u were talking about the emojis
Ok
Even tho itās not even much of an argument š
Can you even comprehend
Fishy, use ur nitro emojis man
The fuckin words I speak
no @ fal
No not really
oh great
Then let me make it clear, This conversation about bot clients making group dm's is over
š¤
š
.navbar {
overflow: hidden;
background-color: #094990;
margin-bottom: 10px;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 30px 40px;
text-decoration: none;
}
``` how come there is a gap between the element and the top of the background?
better image ig
still the same thing
Donāt @ me but Iām pretty sure it moves it down
Hold on just for testing get rid of the whole padding element
And see if that makes a difference in the position of the bar
Yea I just did
and.. it didnt work
Is that the only element the navbar is nestled under?
well theres more
.navbar {
overflow: hidden;
background-color: #094990;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 30px 40px;
text-decoration: none;
}
.navbar a:hover {
background-color: lightgray;
color: #340329;
}
body {
background-color: #36393E;
}
.header {
text-align: center;
color: white;
font-size: 30px;
}
.content h3 {
display: inline-block;
margin-top: 150px;
margin-left: 30px;
color: white;
}
.image {
border-radius: 50%;
margin-top: 100px;
margin-left: 50px;
width: 10%;
display: block;
float: left;
}
Do you specify css for the things that contain navbarv
One second I needa get on my laptop real quick to look at it
ok
@visual zenith ok just add margin-top: -6px to align it to the top
Also whatās with the random div element in the style?
wait i think i found whats causing it
Idk where thatās being called but somethings happening with it
Itās the default css that the browser gives it I guess
@visual zenith I found it, in your body tag just put margin: 0; Iām pretty sure itās cuz ur stylesheet isnāt being called from a separate file so chrome is using a itās āuser agent stylesheetā maybe not tho, but just add margin: 0 to body{}
thanks so much @slim heart
is it impossible to use await in a async function?
no?
ur awaiting an awaiting reaction š i think?
my code is this
oof
then retry
i don't believe he'd get that error, and i don't think that's his code anyhow
can you post the full code instead of just a screenshot of two lines lol
he already put async
how do you know
in the module.exports part
yes
the gchannel.send
i dont see async being there for ^^
thats legit 2 different files
make sure the function immediately containing the await is marked async
more context would allow us to say for sure
instead of 2 lines
gimme a sec
where's the await?
bin pls
how to embed code again?
see those lines aren't in that function tho
oh ur using switch xD
and case
ik its notgood code
you've got the containing function, the exports.run, which is async, but in that function you define another function in collector.on('collect', message => { that gets called when it detects a message
i just had to get an ideo how to make it...
mark that function async too
message => { ... } defines a function
yea
it's called arrow function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
that's the one that isn't async
so
..
make it async
same as the other one
yea ik but idk where to place the async at that function
??
async goes before the arguments
like how it's async (bot, message, args) => {
you've already got an async function right there just do the same thing lol
parentheses or not it doesn't matter
no
collector.on(eventName, function) is what you have there
eventName is 'collect'
right
yes
function is the whole message => { ... } bit
the function is what you mark async
not the whole thing
not sticking it in front of the arguments for calling .on()
ok thx iam new to js and retarded
you're fine, we all start somewhere
i would strongly recommend making a serious effort to follow some javascript tutorials all the way through so you have a grasp on the basics, it makes botmaking severely easier
ok you maybe recommend me a specific one?
sorry, i don't really know of any specific ones lol
the only one i've skimmed through is the one starting from this section: https://www.w3schools.com/js/js_syntax.asp which i think does a pretty good job though it's in context of browser js and not node.js
you can look around on google if you like tho
Hey does anyone know any good image grabbing and saving module for node? I tried using jimp to grab the widget from dbl but I keep getting unsupported mime type
image grabbing and saving? do you need to do anything with the image or just save it?
if you just want to save it, use any request module like got and just write file with it
you dont need an image module for that
Ah ok thanks
thx @peak bloom
I streamed that image onto a file, it writes and appears normally when opening file but it won't send when i try attach it to an embed?
.setTitle('Discord Bot List')
.attachFiles(['./images/dblstats.svg'])
.setImage('attachment://dblstats.svg')```
embed sends just image doesnt
some quick testing from random svg images found online
discord doesn't embed any of them
meaning you probably shouldn't try and make it put a svg into an embed, either
their caching service likely just ignores svgs
Yeah discord doesn't embed svgs
gonna have to get your image to another file format
btw, you can skip saving the file to disk and just pass the buffer directly to attachFiles as FileOptions: https://discord.js.org/#/docs/main/stable/class/RichEmbed?scrollTo=attachFiles
if you dont need the image anymore
how can i check if rows is empty? (idk if the line 4 works)
@fiery nebula always say what lib and version you are using
there is no magic function called empty, you can't pull functions out of thin air
if rows is an array, what you want to do is check if the array has no elements, i.e. has no element 0 or the length is 0
yes
javascript isn't php though
really?
if in doubt google it
"how to check if array is empty javascript"
javascript isn't php though - really?

ik its diffrent
imagine having to implement your own functions, gets me every time smh
some things are always similar, that's why learning new languages is way easier if you already know some
really basic syntax is always somewhat similar if not even the same
i hate when i try to use + in php to connect strings
so im very new to eris and im trying to rewrite my bot but have no idea how i would do
${message.member.nickname ? message.member.nickname : message.author.username}
? it's the same thing
just with nick
look at the docs - https://abal.moe/Eris/docs/Member
so message.author.nick?
authors dont have nicks
oh, right
authors are users, users are guild-independent
always start with what you have (message) and click properties til you get where you want to be (nick)
thanks
Hello,
-
am i correct in saying that when sending a direct message to a user from a shard it will always go through shard 0 (the api?) - i do not have to care about if the user is in a guild on the shard?
-
How about textchannels? can i only retrieve textchannels and send messages to a textchannel if the guild is on the shard i am executing the command on? 3. If yes, is the only way to handle this a broadcast eval or polling a database from every shard, or is there any other better way?
Idk
You can only retrieve text channels if the channel is on the same shard you are using to retrieve it.
That's why you should use a shard manager
i am using shard manager, otherwise why would i suggest broadcast eval as solution?
If you use the shard manager instance/object to retrieve a text channel, it shouldn't be a problem
It doesn't matter then at which shard the message got sent
why do you need to get channels across shards anyway
i need to send a message to a textchannel of shard 1, from shard 0
if you have the id just do it, the rest api is separate from gateway
wait
discord.js right
nevermind i think they don't expose a way to send message via id do they
for.. some reason
they do with users
i can send direct messaged from shard0 to a user that is only in a server of shard 1, but will this work for textchannels too?=
if you absolutely need a channel object to be able to send a message, then you need to get that code to run on shard 1
;o
okey, again..
with users i do shard0's bot.users.fetch(id).send(text), while the user is not on a server of shard 0 --works accross shards
can i do something like:
shard0's bot.channels.fetch(id), while the channel is not a textchannel of a guild of shard 0? does it work accross shards?
the only issue with DMs and shards is that all the DMs the bot receives will be received on shard 0
also no it doesn't work accross shards if you don't use internal sharding
if you do use internal sharding, yes it does work
if fetch is fetching from the rest api then yes that will work across shards
because the rest api doesn't know what shard you're sending from, it can't
they're separate concepts lol
at least i assume by the fetch you're on djs master using userstores
actually nvm yeah fetch uses the rest api
yes, thats exactly my question "if fetch is fetching from the rest api then yes that will work across shards" is it like that or not?
so it would work regardless of what kind of sharding you use
also with textchannels?
try it and see
however you should make sure you don't overuse it because ratelimits ā¢
What's the best image manipulation module for node?
javascript manipulation program
okey so should i use a database or broadcasteval to not use the api and instead transfer the task to the according shard, so it can send the message without fetching?
how often do you need to do this exactly
id say extreme upper limit would be with 10k servers about 100/min
tf
well ideally you should find a way to send a message without having access to the Channel
okay yeah go for eval
or db or w/e
idk how djs sharding goes
in eris id just send via id lol
without using fetch, and to another shards guilds channel?
yea
bot.createMessage(knownChannelID, "blah blah")
im really not sure why djs hides that capability
but it is what it is
another question: does broadcast eval deny my ability to scale horizontally?
i mean if i do every communication over database (of course its way slower and costly but besides that), then i could connect the bot from different servers to the same online database and all work like they run on the same machine
i'm not sure dumping your channel/guild/user caches to a database will do you many favors, but i could be entirely wrong on that
you'd also have to dick with internals to actually get djs objects out of that
iam not dumping my cache
just what i would do with broadcast eval replace with database. i dont send my cache over broadcasteval either. you only send the information the other shard needs to execute its task.
in case of textchannel message you could let one shard write a database entry (textchannelid, text). meanwhile all shards poll the database every 10 minutes to check if theres a task with a textchannelid that is on that shard, and if yes, send the text and remove the database entry.
that works accross shards that are not even on the same server and is not much information
doesn't that mean tasks are delayed up to 10 minutes
that's not a very reactive design
yes thats not a problem
is there no eval-on-shardID sort of function for djs?
would make it very straightforward
you can create that easily with broadcasteval { if shardid == xx}
true but if performance is your concern that's a lot of unnecessary messages being sent to all the shards lol it's not a big deal though tbh computers are fast af
just do it that way and move to the fancy db solution if need arises, is my advice
there are many databases with a publish/subscription capability
yes
if you have a remote database, you can connect to it, and subscribe to a specific table/key/entry
just get a message broker eg rabbitmq
whenever data is added there, you should receive an event from the database
then you can just send("shard-" + id + "-dostuff", stufftodo)
and if eg shard is dead the message will stay in the queue until it comes back
this rabbitmq is like ipc?
Is there an async Node module for checking the magic number of a file?
Magic number?
Yeah
I want to find the file type using the magic number of a file
Not just the extension
I know about the file-type module, but that's synchronous only
Never mind, I found one https://www.npmjs.com/package/guess-file-type
š
"various checks"
if else
if else
if else
if else
switch
almost 1k switch cases š
not even using else if
it doesn't š¤
mine is 4 characters for this guild
for me
Do you not check the prefix length?
because of var prefix comman
Am I allowed to host multiple discord bots on one machine? I'm using Steam's Discord Bot Maker stuck_out_tongue:
why wouldn't you be allowed to do so
you can host multiple bots on one machine
ps: the bot maker is garbage
But thats just pointless if you would ask me
@marble needle im a child who knows nothing about making discord bots. the bot maker provides for an easy way for me to develop and experience this stuff. if you have any recommendations for something else, let me know! š
but ok cool thanks guys
@earnest phoenix how old are you? 
lol well im 19, but š¤·
i'd rather not start learning discord bots by making them all by hand lol
well dbm is from a free library
Thats the best way to get experince
everything that dbm provides you can do for free
and more efficient
you paid something that you can get for free for a little effort
what does dbm even use, djs?
I considered buying that in past but I stopped myself from doing so. And it was the right choice
oh no i didn't pay for it
Then you pirated it?
lol leaked version, but nonetheless.

using it to """develop""" bots is just as bad lmao
dbm might even hinder learning
It's sad, it will disencourage people to learn by using it because it's easier
quoting my message from before:
dbm is actually an embarrassment to development in general, future people will think that they have to pay in order to make a bot
discourage*
I highly recommend that you learn the programming language itself than using dbm.
In all fairness, getting into bot development with DBM isn't a bad idea
Xignotic did it and now he's learning JS because he wanted to go further
Starting out with DBM is fair and I think if they want to proceed to learning languages then by all means do so, but I wouldn't discourage people from starting somewhere easy
But most people probably wont have that idea
but dbm doesn't provide the same vibes as actually coding something
for me I was able to try it, but it hindered my learning
as a result my bot crashed a lot
But what does it matter, it's just drag and drop isn't it?
You could make a bot in like a minute without setting up environments and downloading dependencies (i'm assuming)
I think it's drop down menus
dbm was made specifically to charge those that don't want to code, I don't think it actually has a purpose to "help" anyone with making a bot
That's contradictory
It help's users by skipping all the learning and getting right into the development right away
And in all fairness, people who just want to get straight to it and make a bot, its exactly what they want
skipping all the learning isnt helpful?
discord bot maker from steam is not useful
it gets the job done tho
But what if they don't want to learn? People just want the bot?
so how isn't it useful
It's inefficient from what I've heard
may aswell just get a public bot that does the same thing but better, saves you the hosting aswell
That's like, building your own car because it helps you learn about engines so you can fix the car yourself instead of buying the car and just getting it fixed at a mechanic
exactly @languid dragon
If I learn something, I'd prefer it to be useful in the real world. I'm not gonna spend hours learning something that I'm only gonna be using for my hobbies n whatnot. š
some users may have been helped by dbm, but it may vary from users, it didnt really help me by any chance. Thats what I experienced on it
You're not going to build a car from scratch if you just need to drive, but you'll do it for the fun of it
I code as a hobby
I also encourage coding as a learning utility to help you progress to more advanced things, but for something as simple as making a bot quickly, DBM should work fine and honestly it's a matter of each to their own
Bot making was just a gateway drug to better languages and a career for me
And yea, that's where u would say to learn coding discord bots from scratch
And that's why I would say I'd rather not @amber fractal lol
I feel like that's the main debate going on rn
But for others, its just for the fun and to get a bot of their own to do things they want it to do
but I would credit dbm for simple bots fot private users
for* private purposes
for public, I wont
I wouldn't recommend it for public use but it works
yes I agree with that, if you would develop a public bot, knowledge of programming lang is a must
or at least if you're designing the bot to be large
Hi
Who can help me ? :
I want :
Make a top of my json who content : {"Aqua":7,"Magma":111,"Rocket":25}
How can I do ?
would you mind rephrasing your question, having a hard time understanding what you want to do
assuming notation? {{"Aqua",7}{"",111}{}}???
Hey, what's the best way of implementing granular permissions for bot commands? I've seen some bots that require users of certain commands to have certain roles, but that only allows somewhat limited granularity since that's not really feasible for more than just one or two permissions.
But doing it through an internal permissions DB can also gets unwieldy since now you're trying to configure the potentially dozens of permissions through a bot command interface.
Have an array of ids of people who can use a specific command?
That brings it back to the same problem though, since then you have to populate your array database with each user's ID and all the permissions you want to grant them, which is also unwieldy.
How else do you expect to do it?
I don't know, that's why I was asking.
For one of my bots, I had it store roles into the guilds. Commands were set to have permission levels themselves and would be checked against the role of the user in question based on the guild it originated from.
Oof
Well atleast it isnt a lie
Any one got any bot starter code?
most libs have a "get started" section in their documentation that provides the bare minimum to get it running
alternatively you could write it yourself
thx
Im going to start up a bot running on my raspbeerry pi 3 using discord.js please dm some code or i will just start from beginning again
nobody will spoonfeed you code
we encourage "think with your brain" not "think with my brain"
https://hastebin.com/migidixuco
how can i make this read the first 3 words instead of 1?
should i do args[3]?
learn how array indexing works
ik
also if you want a discord.js bot i have a npm repo if you want it it is very basic
why is my name like this???
Because of the bracket in your name
^, it makes you appear on top of the member list making you hoist
ill change the brackets
Can i have my name back to @red mountain please back to original
not hoister no hoisting but to Carreto
thx
ask a mod
For anyone using the DBL NPM package, what are they expecting in the webhookServer key for the options object
okay fixed ā
I'm pretty new to html. Anyone know how to make it so when someone sends link, it sends a custom embed like one above?
thats ogdata
Thanks
@copper wraith always say what lib and version
Does there happen to be a tool/method to add/remove sensitive information from Docker ENVs prior to commit?
no because the description doesnt end at "
the description is "...".format(...)
all one thing
So, where should I try inserting it in?
..is that not outside of the bot.say() and the discord.Embed()
it's a part of the embed, put it in the embed
what?? that's not in the embed that's in the .say() and now you're no longer executing discord.Embed()
i dont know d.py, but im pretty sure its embed=discord.Embed(title="etc",color="etc",description="etc")
can you send the full code in code block, not as an image
Yep
temp = await bot.say(embed=discord.Embed(title="etc",color="0xB40404",description="etc")(title="Current time in Paris:",description="{0}:{1}:{2}".format(int(now.hour),now.minute,now.second)))
How do you make that code say like current time in paris in "RED"
oh god, there are multiple mistakes
I have done reaserch and I can't seem to figure out how to fix it
i see it too
did you add the mongodb repo? @lusty dew
first, you are using an outdated library, there are 2 versions of discord.py, the old one is async and the updated is rewrite
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ Followed this whole guide everything went well until installing mongodb-org
second, consider learning python first before doing a discord bot
Wait that not my orangal one
temp = await bot.say(embed=discord.Embed(title="Current time in Germany:",description="{0}:{1}:{2}".format(int(now.hour),now.minute,now.second)))
orangal?
Original
Works tho but not in color.
you didn't assign a color?
I tried, but gave errors & some didnāt which still didnāt work
@hushed berry https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ Followed this whole guide everything went well until installing mongodb-org
@copper wraith Learn the language first :)
what language is he using?
python I think
literally all of your mistakes are just terrible syntaxes, which just makes me want to tell you to learn python first
@lusty dew did you install the correct repo for your ubuntu ver?
yes
bad python knowledge + outdated library
oh jeez š¤ that seems old
nik isn't certified anymore?
yeah oliy decerted me š
yeah, please get a tutor to teach you python before you attempt at a bot
I read my release wrong
late message

- something
yeep
Skirt
My bot was muted and I've made changes to it, how do I request unmute?
You yeet a mention at an online moderator and give them your bot's id
okay, ty
@hushed berry sorry for ping
But it still won't install mongodb-org
even with the proper repo
I'm not sure then, friend
Hello @coral trellis , I've made new change to my bot could you check to make sure if I'm able to have my bot unmuted now?
BotID: 403402614454353941
sorry im not a mod
oh
hey, don't mock people from the past
xD
i was a mod too
Hello @coral trellis , I've made new change to my bot could you check to make sure if I'm able to have my bot unmuted now?
BotID: 403402614454353941
Thank you
const logs = message.guild.channels.find(channel => channel.name === "logs");
if (message.guild.me.hasPermission('MANAGE_CHANNELS') && !logs) {
message.guild.createChannel('logs', 'text');
}
if (!message.guild.me.hasPermission('MANAGE_CHANNELS') && !logs) {
console.log('The logs channel does not exist and tried to create the channel but I am lacking permissions')
}
const entry = await message.guild.fetchAuditLogs({type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
let user = ""
if (entry.extra.channel.id === message.channel.id
&& (entry.target.id === message.author.id)
&& (entry.createdTimestamp > (Date.now() - 5000))
&& (entry.extra.count >= 1)) {
user = entry.executor.username
} else {
user = message.author.username
}
logs.send(`A message was deleted in ${message.channel.name} by ${user}`);
})```
I add this logs feature to my bot but it's not working
I deleted a few text and nothing happened
every thing else works
audit logs take an indeterminable amount of time to generate after a message deletion
chances are the correct audit log isn't there when the event fires
you can add some console.logs to confirm
Thank you
Lol now I deleted something I shouldn't have
Welp now I AM ******
I'm really triggered rn
I tired adding a webhook feature to my bot but it's just not working
I give up on the web hook
š¦
Well I can make webhook bots but yeah
why don't you do it then
I did
I just like to make the bot like have it so it can make copies of what I want onto other servers
so it's easy
let tomute = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!tomute) return message.reply("Couldn't find user.");
if(tomute.hasPermission("MANAGE_MESSAGES")) return message.reply("Can't mute them!");
let muterole = message.guild.roles.find(`name`, "muted");
if(!muterole){
try{
muterole = await message.guild.createRole({
name: "muted",
color: "#000000",
permissions:[]
})
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});
}catch(e){
console.log(e.stack);
}
}
let mutetime = args[1];
if(!mutetime) return message.reply("You didn't specify a time!");
await(tomute.addRole(muterole.id));
message.reply(`<@${tomute.id}> has been muted for ${ms(ms(mutetime))}`);
setTimeout(function(){
tomute.removeRole(muterole.id);
message.channel.send(`<@${tomute.id}> has been unmuted!`);
}, ms(mutetime));
}
module.exports.help = {
name: "tempmute"
}```
I have this but the time for the mute isn't working
it just gives them the roles
and doesn't show the template
really doesn't even mute them
Your tomute var
Isn't what you want it to be
You put an expression
Which means it'll be true or false
so what do I have the change exactly @late hill sorry I haven't slept
in almost 24hrs
Yes
but that's all it does
*mute @ user reason
that works
wait
mute @ user time
that works
so what's the problem
it doesn't remove the role when the times up
any errors?
ye..
hahaha
lol

well it makes use feel smart
how?
no it's not smart to not know how milliseconds work
using a function to convert time into ms
and some times it doesn't work like that
hmmmmm
that works but how
It's 3 am for me
I'm kinda learning on the way with this
i know node.js
first off it looks like eventFunc.run wasn't defined as a function, i am most likely wrong though
@grim aspen Do you want to take a look?
hold on, going to ask a friend
It seems right
fs.readdir("./eventos/", (err, files) => {
if (err) return console.error("[ERRO] " + err);
files.forEach(file => {
let eventFunction = require(`./eventos/${file}`);
let eventName = file.split(".")[0];
kitsunemi.on(eventName, (...args) => eventFunction.run(kitsunemi, ...args));
});
});```
mmm
checking in my own application
i never use kitsunemi function
change eventFunction.run() to eventFunction()
kitsunemi is my client
you should bind the event
<client>.on(eventName, event.bind(null, <client>))
I never thought of that idea
are u tryna bind an event to a function?
eventos is spanish
Just do this: js client.on(eventName, (...args) => function(...args));
no

binding is better, and that doesn't guarantee it to work
Hi
Who can help me ? :
I want :
Make a top of my json who content : {"Aqua":7,"Magma":111,"Rocket":25}
How can I do ?
???
The command would trirai the number of points of each team and display them by order of clasement
Yep
Just a for
yes
How i can do ?
use a sorting algorithm
use. a. sorting. algorithm.
you implement a sorting algorithm in your language
I know this š¢
then whats the problem?
So, thanks you like even
js
thanks you š
thats all you fucking had to do s my h
I know but it's because I had a problem but let's say it's good, thank you
Hi Help Me
(node:152) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead
What's the problem?
It literally told you the problem
Please Can You Help Me Out
Can someone help me set this up so it will ignore spaces in server names. right now it throws and error because of the space in servername.
query("INSERT INTO server_settings (server_name, server_id, prefix, modlog_channel, mod_role, admin_role, welcome_channel, welcome_message, welcome_enabled, leave_channel, leave_message, leave_enabled, level_messages, invite_filter_enabled, invite_whitelist, swear_filter, swear_words, log_deletes, log_newmember, log_commanduse, donot_announce, send_help, enabled)" +```
sanitize your input
@dusky steeple if the column is defined as TEXT datatype, then the value can be inserted between 's, but make sure to escape them in strings
its a varchar
I'm not familiar with that
@ruby dust that way works with varchar also ty š
@earnest phoenix What library you using?
Discord.Js @dull bobcat
š
wot
let upvotes
dbl.getBot(client.user.id).then(bot=>upvotes= bot.points)
Why does upvotes return undefined? lol
@amber fractal
its mostlikely logging poinst before the promise if fulfilled
points*
put the console.log(upvotes) inside of the .then maybe
u were right, thanks @amber fractal
mhm
Well, just finished submitting my bot. I probably should expand the admin commands to make fixing broken character sheets easier, but at least it's stable now.
Took a bit of work to figure out how to make a player's default character selection per-server rather than global, since originally I'd been using their user ID as my database primary key.
Yeah that's what I ended up with.
I started writing the bot three days ago Monday, so honestly I'm just glad I was able to get it to work since I need it for a roleplaying session this Saturday
they both are in mobile mode
even with the website on pc, the colours and stuff dont come out right
Well probably because they are being overwritten


OOO I got an animated emoji for that




