#development
1 messages · Page 1065 of 1
-verify
@fading holly U cant dude
forgot the lucas command
@earnest phoenix so do u only used html
use ejs
nice
Wrench is this good?
@earnest phoenix 👍 👍
Use ejs
Don't tell me how to do my stuff xd
Ejs better
I do things nice
Php ew
Yes but php is bad
let him do how he likes bruh
I'm good at what I do in a certain way
No need to alter that
My goal is to be a bit like mee6
very modern/easy to use
is the bot invite link working?
Just gonna take a lot of time
gargle
like
but it's offline rn cause I'm to lazy to turn it on 😂
lmao
well if u wana make it like mee6 i guess there is also a welcome message type thing
nice
Mee6
fuck
lol
Top buttoms
@earnest phoenix i like urs i am with u
I can easily add the header
I need to fix that gap tho
although you don't even notice it
on the phone itself
@opal plank you can't use Luca tags
JavaScript
Html
css
With code
OOOOO
anyone know a good free translate api
i actually like bootstrap a lot more then bulma surprisingly
i like nothing :v
having a css framework speeds up my frontend dev time like 10fold
and i do not enjoy frontend so thats always a plus lol
so
is there a way to make server count without top.gg
wdym
on discord.js
like the number?
yeah
i believe it is
k thx i will try it
wait no
its client.guilds.cache.size
@earnest phoenix
k
@slender thistle ah that explains why
if(command === "bird"){
const bird = [`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(1).jpg?v=1594973390465`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages.jpg?v=1594973390591`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(5).jpg?v=1594973391172` ,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(4).jpg?v=1594973392160`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(4).jpg?v=1594973428871`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(5).jpg?v=1594973429215` ,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(3).jpg?v=1594973429240` ,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(2).jpg?v=1594973429818`]
let final = `bird[Math.floor(Math.random() * bird.length)`
const embed77 = new Discord.MessageEmbed()
.setTitle(`Here is a bird`)
.setImage(`${final}`)
.setFooter(`${PREFIX}help`);
msg.channel.send(embed77);
}
```
embed.image.url: Not a well formed URL.```
1 sec
ok
if(command === "bird"){
const bird = [`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(1).jpg?v=1594973390465`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages.jpg?v=1594973390591`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(5).jpg?v=1594973391172` ,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(4).jpg?v=1594973392160`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(4).jpg?v=1594973428871`,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(5).jpg?v=1594973429215` ,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(3).jpg?v=1594973429240` ,
`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(2).jpg?v=1594973429818`];
let final = bird[Math.floor(Math.random() * bird.length);
const embed77 = new Discord.MessageEmbed()
.setTitle(`Here is a bird`)
.setImage(final)
.setFooter(`${PREFIX}help`);
msg.channel.send(embed77);
}
There
what u changed
let final = `bird[Math.floor(Math.random() * bird.length)`
To
let final = bird[Math.floor(Math.random() * bird.length)
And
.setImage(`${image}`)
to
.setImage(final)
Np
you shouldn't create the array everytime you execute your command
that's a memory leak
create it once somewhere and keep a reference to it
also hayper you should not spoonfeed code
Alright
heavily discouraged
I see
Sorry for my action, i wont do it again.
no worries it's just a heads up
when i was learning i made my help command automated, but it always created new array at command executing so uhh.. very inefficient code
(my code)
yeah that's a mistake people make very often
they keep rebuilding the help command when they can do it once and cache the result of that
because it's highly unlikely your commands are going to change during runtime
even if they are you can rebuild it again so
¯_(ツ)_/¯
const { MessageEmbed } = require('discord.js')
module.exports = {
name: '',
description: "",
execute(message){
const taggedUser = message.mentions.members.first();
if(taggedUser){
if (!message.member.hasPermission('BAN_MEMBERS')) {
message.channel.send("you don't have permission to kick this user! ")
}
const embed = new MessageEmbed()
.setDescription("***:bowyesmark: " + taggedUser.user + " has been successfully banned*** ")
.setColor(0x43b581)
if(message.member.roles.cache.has('562486904935940106')){
guild.taggedUser.ban().then((member) => {
message.channel.send();
}).catch(() => {
message.channel.send('you cant ban this person!');
});
}
if (!taggedUser) {
message.channel.send('Next time, tag a person to ban.')
}
}
}
}
not sending any message, not banning, no error in the console. any help?
roles = sorted(user.roles, key=lambda r: r.position)
for role in roles:
if str(role.color) != '#000000':
color = role.color
if 'color' not in locals():
color = 0
role_names = ' `,` '.join([r.name for r in roles if roles != '@everyone']) or 'None'```
**Hi, I use this code to get user roles, but it is still displayed in the `@everyone` output section
What should I do?**
user.roles should already be sorted as-is
You are comparing the roles list to a string
const Discord = require("discord.js");
module.exports = {
name: "ping",
aliases: "",
group: "Info",
desc: "Return Latency and API Ping",
usage: "<input>",
run: async (client, message, args)=>{
const msg = await message.channel.send(` Pinging...`);
let embed = new Discord.MessageEmbed();
embed.setDescription(`\`${msg.createdAt - message.createdAt}ms\``);
msg.edit(embed);
}
}
how to get name or desc inside run?
@slender thistle Is it possible to send me the correct code?
Compare r.name != '@everyone'
@night bridge change the arrow function to a normal function then you can call this.
can i just added (client, message, args, name)=>{...}
Doing that would require you to pass it when you call the function.
so it not work
It would work but is long winded.
@slender thistle thanks 
run: async function(client, message, args) { console.log(this.name); }```
thanks for guide
is there a vote listener in JDA?
Is Tim here?
Anyone know why my bot isnt returning a error message when I get something wrong. In my eval command. I can eval things like message.author but getting something wrong nothing happens.
code
client.on("message", (message) => {
const args = message.content.split(" ").slice(1);
if (message.content.startsWith(prefix + "eval")) {
if (message.author.id !== "529770099285032980")
return message.channel.send(
"**error** Only the bot owner can execute this command!"
);
try {
const code = args.join(" ");
let evaled = eval(code);
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
message.channel.send(evaled);
message.channel.send(
"``❌ Error preforming eval command``" + `(${err})`
);
} catch (e) {}
}
});```
^
I removed some code that triggered the error message O.o
I added some code so when theres a error it would return a err message but it didnt.
if (err)
return message.channel.send(
"``❌ Error preforming eval command``" + `(${err})`
);
message.channel.send(evaled);
} catch (e) {}```
So I put my error message in the } catch (err) { here }
(I forgot to change my e to err last night)
How can I fetch a certain guild member
Via their id.
Yeah
Shift?
Nothing
they are staying
Most libraries will handle the domain change for you
discord.js users use this if people try to @ everyone
bot.on('message', function(message){
if(message.content === '@everyone')
{
message.react("😡")
}
})
🤣
omg so funny 🤣 🤣 😂 😂 😂
more like
client.on("message",e=>{e.content.includes("@everyone")&&e.channel.send(`<@${e.author.id}>`)});

lol
@pale vessel yes
anyone else got a dm from discord
yes
:)
developer tos update
everyone that has an application did
finally
so pretty much every bot dev
discord is being gay
discord mass dm 
kek
boeing hows your day
ban @hazy sparrow
oof
raid bots bad
you know logs exist
.
also this is about development
and my brain is developing backwards
^
oh
your brain is evolving link
we are all bots
raid bots
@restive pebble no
ok bye
raid bots are not bots? 
Off-topic
well they are bots so we can talk about them here
well they are bots so we can talk about them here
@hazy sparrow They are prohibited so no
oof then
api abuse
And also the left column the search bar if put to 100% width goes outside of the box
anything that spams and/or abuses the api is prohibited
even if it's a "no u" attack
no u attack lmao
Raid a raider
surely a good idea... if you ignore the fact that you still abuse the API
Just because X or Y "did it" doesn't mean you are allowed to
they're kidding
Anyhow, off-topic content, move away from this channel
i hope
alright
no
Can somebnody please help me align this?
idk
probably scraping youtube
Heya,
I have this issue:
A bot counts 5 servers together and the biggest Guild has 10k members.
Its giving me somehow this: 5533361643759861861107
This is the Code:
const math = require('mathematics-js-example');
let all = math.add(greenflame,blueflame, yellowflame, redflame, purpleflame);
console.debug("[DEBUG] All Members: " + all)
can someone help?
its like this:
redflame = client.guilds.resolve("583253117735272448").members.cache.size
Try to parseInt all of the values
@tulip ledge how?
Parseint??
yes. I'm dumb currently
so fucking confused lel
Just read it dude
i do but i'm dumb lel
read it again
but for what do i use it in my code
NaN = not a number
i know
yeah the error explains it self
I know
Show code
U prob fucked up the parseint
^
Show code
Aight
ty
Its funny how yesterday everyone was doing web development and now there’s noone who knows how to align a div 
Which part are you trying to align exactly?
It should look like this
But it looks like this
They're 2 divs wrapped in a div wrapped in a div
Wtf happened here
i'm sad
what do you mean ? i don't know ... what is this?
no
Wait what
their policy update and things
I wish Tim was here he'd prob know how to allign the divs
.>
Tim knows a lot.
^-^
but my bot not join this server
Literally say his name and he's here lmao
It needs to be approved
How to make it show my bot is typing
Like many bot does
But my bot doesn't show that black sheep is typing
in which library
im a bot that auto-responds to my name
smart
Hi
I think u can do <Channel>.startTyping
.>
Or something like that
It needs to be approved
@misty sigil owh my bot must to be approved it
So Tim I suppose you don't know how to allign the divs then?
Wellp then I wasted my time trying to disable the scroll function 
How to add music command
what library?
Spoonfeeding is not allowed here, we cannot give you the whole code of a command.
We will help you though.
it seems I'm not the worst coder here
I don't really use bot designing apps
Np
I code the bot myself
But give me coomand pls
what bot did you make Nasachan?
😓
@hushed furnace
oh nice
I made that ^
mine hasn't been added here but I made it today in like a 1 hour project
and it's don't laught Casually Ultimate Master bot
oh wow
short for C.U.M
lol
Help me
and there are more bugs than it's actually good
😑
but thats what makes the bot amazing
might work out the bugs if I ever want to or have the time to though
They won't give you the entire code command, they can help you getting to it but giving out code thats not how it works mate.
hosting
Idon't have money
contabo
550 hrs or so per month though
I can't read his thoughts
Who?
Who
you Defalter
me to
😓
Someone know how to remove the { , } , ' from the text? Please python user help me
Don't just send the dictionary
What?
Do you know what a Python dictionary is?
Hm i am new on python, and am trying to learn api, hm idk what python dictionary
But how to remove that
...so no
Key pairs basically..
Okay
...because you decided to ignore to the basics of Python before getting to a complicated library...
Okay ')
In coding it's better to start learning the basics and slowly working your way up, never in any coding try doing hard stuff when you are only a beginner, I don't know python that much but want to learn it one day.
--> npm install
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for npmtest-sql-template-strings
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-07-17T12_20_24_990Z-debug.log
exit status 1
^^^^^
need help with this
:
You are sending the dictionary itself. Two possible solutions for you are:
- Iterate over the dictionary keys, access a value under the key (hell, you can just iterate over dictionary.items()), add the text to a string but separate them with \n (newlines)
- A list comprehension with iterating over dictionary.items() where
kis they key andvis value, then format the string
Okay, tysm @slender thistle ^^
He said he doesn't know a dictionary though..
Yeah, but i just say thanks:v
Lol
Google is easily accessible
His solution requires dictionary knowledge I meant
@spark wing learn dictionary first
So I'm learning how to code right, and I ran into a problem with Java script however it doesn't say that there are problems, when I use my bot I used the Args[0] but the prefix that I put doesn't seem to work
the prefix I meant for it is $
so my webhook doesnt work :/
but it seems to work with other things aswell
So any Java Scripters who know how to fix this current problem I have?
Kono giorno giovanna niwa yume ga aru xD
@earnest phoenix hellooo
Lemme read
lmao
@jolly quail okay ojay
im a java scriper!!!
@slender thistle okay tysm
what do u need sony?
alright @digital ibex do you know how to fix this problem?
KONO DIO DA
Just search if
send ur code
The message starts with
but it works with other things like ^ or ù or % or ! etc etc
Ur prefix
code?
someone help my bot doesnt log when someone votes :/
Ya
delete
Check if
t?
ur message
Oof
@white stone
understandable my bad
send it without the token this time
Anyway
ye
U splitted the prefix but matched the prefix with yours?
help my bot doest well log when someone votes
switch is fine
ah
Substring*
if u do $sex it won't respond?
I meant
I mean technically it does work but it doesn't work fully as it works with other prefixes that I didn't put
no it does
wait look
substring is fine too, what?
oh right
yes thats the problem
He didn't match the prefix
aight Loom can you help me on that as I'm fairly new to coding
youu njust neeed to check if the message doesn't start with your prefix
how can i get the current time of music
if (!message.content.startsWith('ur prefix')) return
lemme see
time of music?
then is playing on the voice channel
so do I put that right after the prefix?
what
Not system time
wtf is time of music?
Like 1:00
for example
Mins have passed
he is probably talking about a music feature
i put a music to play on a voice channel using ytdl-core
oh right
how can i get the time the time of the music of the voice connection
is there a way i can make "chances" like i want my bot to execute either a or b when doing bow coinflip but i want the chance for a to be executed more than the chance for b to be executed
try taking away the full length of the song by the timestamp now, that might work
and u can format it however u want
cuz it'll return a timestamp
maybe it have but i can use that
np
@jolly quail @digital ibex Ty you fixed the problem I'm grateful
Np
you should probably learn basic javascript before trying to learn nodejs and using a library
Lol i learnt javascript while developing my bot
me also
A good starter project
i never knew anything about js before i coded my bot
Idk abt quick.db sorry xD
don't use free hosts
you'll experience huge throttling if you get more than 2 commands per second which most bots here don't because they are trash
put stress on your bot and you'll see how bad heroku is
ohhhhhhhhhhhhhhhhhhhhhhh
how can i add the mute role to someone after rejoining the server using fs ?
Heroku doesn't support quick.db due to it requiring integer.
I am not salvage_dev
stop chatting here !1
ok
@earnest phoenix no you can't use FS because FS is the node file system.
if you want sticky roles, store the ids in a database
^
If you are trying to read a JSON file with FS, that has nothing to do with the role stuff.
Goddamn mobile I don't wanna use caps for this
can u give me a tutorial video or smth ?
Hold on. Let me read your mind and find out exactly what you mean and then go and search it up for you because why would you do it yourself?
there isn't a video for everything 👏
you are perfectly capable of doing research for yourself
you do not need to mindlessly copypaste from a video
you take the development part out of development lol
Lol
Docs exist for a reason
Devs aren't copycats
YEP
I swear half the people here don't know how to Google or don't know how to read
Can you shut up?
Hmm well sometimes asking other ppl seems a better option than asking google sensei xD
Keyword: "sometimes"
why https have to be so hard to work
Hmm well all the time, checking the docs first is better than asking here xD
yes
that is what you are supposed to do in the first place
first do research on your question
see if anyone else asked
browse forums
if you absolutely cannot find your answer then you resort to asking in discord
Can you shut up?
@golden condor SHUT UP
Both of you cut it out
Lol
That's the way it's always been
Ppl think other ppl would answer fast idk why
Most errors.. Just type the log in google and done
yes, its way faster than asking from humans
I always say coding is (even if you are a good programmer) 50% actual coding and 50% googling.
XD
Imagine all the work that doesnt get done when Google is down
I'm coding everyday from 8 to 5. And still I can't code without having at least 20 chrome tabs open xD
if content:lower():sub(1,#"+mute") == "+mute" then
local mentioned = message.mentionedUsers
local idOfGuild = message.member.guild.id
if idOfGuild == "719486191535390780"
then message.guild:addRole(mentioned[1][1], 731180560256466954)
end
end
when i do +mute <@user> i get this error:
Uncaught Error: C:/Bot/deps/coro-channel.lua:62: C:/Bot/deps/discordia/libs/utils/Emitter.lua:105: C:\Bot\Bot.lua:652: attempt to call method 'addRole' (a nil value)
This is discordia btw
yes
ok no idea sorry
@jaunty junco don't you miss those sweet curly brackets?
@jaunty junco don't you miss those sweet curly brackets?
@fast yacht heh?
wha
what
it is not discord.js
Is mentioned[1][1] giving the right thing?
that doesn't even look nowhere like js though
I'm coding everyday from 8 to 5. And still I can't code without having at least 20 chrome tabs open xD
@hidden lynxi have ~20 brave tabs open
Is mentioned[1][1] giving the right thing?
@jolly quail yes it gives off the id of the mentioned user
hmm ok
Right
it does i suppose
yeah i checked the documentation like 10 times
Lol
a nil value
So u require to pass a user id and a guild id in addRole
can u try throwing the mentioned[1][1] thingy in the console
Ya try it once
maybe if i try
message.member.mentioned[1][1]:addRole()
?
can u try throwing the mentioned[1][1] thingy in the console
@finite bough hmm i will try to
But maybe doc can help
its in the member section tho
?
Uhmm
"00", i hope this is right
the id after mentioned[1][1] is the id of the role
mentioned[1][1] gets the 1st mention?
mentioned[1][1] gets the 1st mention?
@finite bough yes
if mentions are an array
U don't need user id
@jolly quail yeah i see
idk
well
yes
they do
what if i just surround the id of the role in "" ?
nope doesnt work
🤔
oh i edited that
Arrays in Lua start at 1 if I remember correctly.
its
message.guild.mentioned[1][1]:addRole(731180560256466954)
Oof
@finite bough its lua
That mentioned returns the id
What's the name of the library you're using.
in lua arrays start from 1
Ur adding role to user id
What's the name of the library you're using.
@sudden geyser discordia
User id. Addrole method won't exist obviously
you need to fetch/get the user
Yep
thats what
local mentioned = message.mentionedUsers
does
What is mentioned[1]
it gets the id of the mentioned user
A user?
hmmm
Try it
btw now it gives off this
attempt to index field 'mentioned' (a nil value)
which is mentioned
message.mentionedUsers returns ArrayIterable of User, but that's a user object and not a member object.
no
Oof
what
It won't work then
Just try it once
why wouldnt it work then?
No point in not trying
XD
message.mentionedUsersreturnsArrayIterableofUser, but that's a user object and not a member object.
@sudden geyser how will u find the first member then
I mean we need member object
Iterate and get the first member
Use the method on that
I have very little to no experience in Lua, so I'm going off the documentation (https://github.com/SinisterRectus/Discordia/wiki). For example, if you have .mentionedUsers, you could get the first mentioned user, then get their ID to look in the guild.members cache and get them by ID.
nah not really, but it light cause u issues
Ok
and its bad practice tho
Hmm
Having all your code in one file is an issue of readability and not taking power of doing it modularly.
Won't really take much time
But I can find the code
message.mentionedUsers[1]:addRole()
@jolly quail
attempt to call method 'addRole' (a nil value)
Yeah @jaunty junco
Control + F
He said User objects r returned
I'm not having issues
Not Member
@jaunty junco get the user ID and search in the guild maybe to get a member
Then addRole to that member
That's a user array
well
Not member array
mentioned[1][1] does
Hmm
i mean
That's just user id
it works in ban commands
Hmm
so why wouldnt it work here?
the fault is probably in the addRole
im literally trying everything
maybe . instead of : for addRole()
nope
Equivalent to Member.guild:banUser(Member.user, reason, days)
U r supplying a user there
yeah and mentioned[1][1] works for it just fine
Cuz it's a user id
it should require used ids for any interaction with a user tho
if content:lower():sub(1,#"+ban") == "+ban" then
if member:hasPermission(0x00000004) or member:hasPermission(0x00000008) then
local mentioned = message.mentionedUsers
if #mentioned == 1 then
message:delete()
message:reply("The ban hammer has come, and it has chose to land on <@!"..mentioned[1][1]..">!")
member.guild:banUser(mentioned[1][1], "get banned noob", nil)
end
if #mentioned > 1 then
message:delete()
message:reply("You can only ban 1 person at a time you bot!")
end
if #mentioned < 1 then
message:reply("Try to mention someone next time so that i can ban them!")
end
else
message:reply("<@!"..memberid.."> you dont have the permissions required to ban people, you noob!")
end
end
wait
member.guild
hmmm
Ya
Ur supplying user id there
so it works
Cuz that's in doc
Equivalent to Member.guild:banUser(Member.user, reason, days)
then what should i do for the +mute
Hmm
Mute?
See probably
U have to get that user id
Search that in guild
For a member object
And mute that?
@sudden geyser help
@jaunty junco
yeah im here
hmmm
hmmm sure
Hmm
attempt to index global 'Guild' (a nil value)
hmmm
U were using before
Nah
message.guild.getMember(mentioned[1][1]):addRole()
message.guild gets the correct guild i guess
@jaunty junco trying?
C:/Bot/deps/coro-channel.lua:62: C:/Bot/deps/discordia/libs/utils/Emitter.lua:105: C:/Bot/deps/discordia/libs/containers/Guild.lua:161: attempt to index field '_members' (a nil value)
Hmm
Umm
Are functions in this language used like
:function()
Or .function()
@jaunty junco
Why
Hmm
what idk
Like :function1():function2()
no like
I guess
message.guild:getMember(mentioned[1][1])
probably one of my files got corrupted
This works?
Hmm
so yes it works
but the issue is that :addRole doesnt exist
In that result
Store that result as a variable and try addRole on that?
if the function doesnt exist then how will it work?
Maybe it doesn't show
no reason not to
Cuz it doesn't recognise it as member
It worked before?
cause last time one of my bot files was corrupted
good thing that it was just an empty .json file tho
how do u corrupt an empty file
how do u corrupt an empty file
@misty sigil nice question xD
i should check just in case
no
maybe its a new function?
Nah
since im using the version before the latest version
Try again
sure...
Result?

i have ~20 brave tabs open