#development
1 messages Β· Page 957 of 1
wut
i just tried module.exports = { name: "setupmute", category: "moderation", usage: "setupmute>", description: "Setup the mute role", run: async (client, message, args) => { let muterole = message.guild.roles.cache.find(r => r.name === "Muted") if(!muterole) { try{ muterole = await message.guild.roles.create({ data: { name: "Muted", color: "#514f48", permissions: [] } })
cuz u didnt add the catch()
where?
add this after try{} :
catch(e) {
console.log(e)
}
be nice
??
https://discordapp.com/channels/264445053596991498/272764566411149314/718071309556252684 im sure this can ratelimit u too
the loop
where ?
do what
that is not the problem right now.
Playing game (sublime text)
@knotty steeple rich presence
Sublime Text has a plugin for Discord rich presence
:0
how can st have a workspace lol
how can vscode have a workspace lol
Project
in vscode yes, but st is just a fancy text editor like np++
it has
no?
does it have projects?
obviously
Bruh i added this Extension but nothing :((
errr....that's not obvious ma'am
it is
my brain is hurting
can u paste it
I don't see any "new project" option, so it's not obvious
discord presence*
:0
that's what I mean
@earnest phoenix not everyone has the same editor or the same design as you, if you dont know then please shΓΌt. This is a place to ask for development help not to shittalk other users preferences
its a folder but vscode names it as workspace or whatever and if u have a brain u could figure it out 
^
what are u saying
@earnest phoenix sorry, relax :((
?
get the first one
what have I done to you?
be stupid
by asking a question?
with an obvious answer
sammy
hi
Do I have to remind you
no
??? like
yeah, I just wanted to know how to open a project on st
that single line would be enough at the start
A folder is technically considered a project in Sublime and it's not exactly clear at first if you haven't used it before
fancy name
I don't use st too often, I was curious because never heard of that
I've seem workspace and project, but "folder" is kinda new
hi, this is gonna sound like a stupid question.
i completed my discord oauth and now idk how i can incorporate the front end and the backend together and make it like
interact with each other and stuff
this is my first actual time making a public site so i'm kinda very confused
use jquery for frontend to retrieve data from the webserver, and use http shit for backend
i completed some of my backend, but i was told to do both at the same time, like do the backend and then do frontend stuff for like each page, im assuming they meant
so, i completed one pages backend, and now im stuck incorporating the frontend onto it to make it half decent
you can't really make anything work with backend in the frontend if you have no backend
so like, make for example a page that just returns a json string
and use client side js to parse that data
using express or vue?
o ok
jquery is just a way to do http requests in js
i just started this project 2 days ago, i'm kinda new to making public sites, sorry about my lack of knowledge about these things π
Well it does a lot more than that
why would you use fucking jQuery for that
idk cause i use it, and i dont know web dev
Sounds like a major security flaw
what
i only jquery.get request to my website, not to discord
im confused
idk how he means by security flaw π€·
wss
jquery is extremely outdated and should not be used in modern web dev
the thing im most confused about is, i completed the backend with express for one page, and now im trying to use vue for the frontend
i only learned jquery cause i probably saw it on w3schools or something
and idk how to
a lot of sites go for SPA frameworks now, react / vue / angular
and you can use node-fetch with them
why custom emoji don't work when it's between ` ?
between ``?
cause its not supposed to
basicall means ` ` turn anything to UTF-8 text only π
prob
so, there is no way to use custom emojis between `` ?
idk
Well It's just an inline code block
nope

No
It sends it as actual text
Like when you eacape it
utf-8
I've done it without nitro before 
i have what are we doing
you could do it before
like a year ago
then they started messing with the chat and made it so you can only escape custom emojis if you have nitro (or if you're in the guild w the custom emoji)
tf
@turbid bough iirc its utf-16 as it supports the extended block of unicode
oh you're on mobile
nothing works on mobile like its supposed to, including escaping emojis 
Lmao
@turbid bough but if i do let emoji = bot.emojis.get(id).toString and then i do ${emoji} it won't work ?
i got the backend done for one page, and idk how to use vue with it
look at the getting started on the site
Why ould they make it nitro only ffs
@earnest phoenix uuh, as long as you dont put it in a code block yes
What about the non-nitto devs :(
moneeeeeeeeey
sucks for you
they don't care about you, they care about your money
Can you teach me how to code
thank u
I mean it still works in between an inline code block
why do you think they made the dev license so expensive which only allows you to have an announcement channel linked to an SKU lol
dev license? expensive?
it's like 35 bucks
25
It's not worth whatever it is lmao
ah well, its kinda is expensive since its per application, not like google where you only need to pay once per acc
The only thing people use is the announcement channel
I wish to believe their reasoning for it was to restrict it to actual bot devs and people who used bot making websites
How about some free bot app?
yeah, instead of just allowing random people to make fake stores with fake nitro and rickroll videos
You know?
no
no
no one will make you an app for free
Even the paid ones are garbage

Yeah both suck though
dont use that shit
They are not for learning
Pretty sure neither are accepted here
they are for people who want to easily make a bot to scam people to donate to their patreon
They are purely made as services that provide you with templates that you use in your bot
Haven't haard about BotBind but BotGhost is allowed as long as you it's modified
modify botghost lol
they are for people who want to easily make a bot to scam people to donate to their patreon
error out with a command by votelocking it and when they vote error out again saying they have to donate
If anyone uses botghost, they arent gonna modify it 
if you modify botghost, you better just make your own bot. than use that bloat
And they're probably all bad
Thaun, the modifications happen through a """WYSIWYG""" UI where you choose what it does instead of actually coding it
btw, emotes can't be used inside codeblocks/inline code because it converts everything to unicode
wtf is a "WYSIWYG" UI
what-you-see-is-what-you-get
holy
You don't do the actual coding, you just have options to choose
scratch type stuff then
"Add Role", "send message", that kind of stuff
yeah so like normal any bot with custom commands

i wonder if it allows you to connect to a rest api with it
that would probably be pretty useful
with just the ui
and then what it could do is autogenerate schemas depending on what the initial request
then use that to make it available as parameters in commands
and then you have like a UI for doing rest requests with the disord bot, very easily with all the api references
soo, even if i define the emoji it returns undefined :/
what are you trying to do?
i want to use custom emojis between ``
i want to use custom emojis between ``
@earnest phoenix you can't
and isnt bot.emojis undefined?
no
inline code and codeblocks convert everything to unicode
no, ok idk js
even normal emojis "can't" be used inside ``
they can
oh
they only show up as what the system shows it as, not what discord wants you to see
which is the same as, say, letter A
Why they don't update and let us use custom emojis? :/ this is shitty
for example π₯Έ this does not support on windows or any platform, but it supports on android phones
nvm that emote does not what i sent
Why they don't update and let us use custom emojis? :/ this is shitty
@earnest phoenix because custom emojis don't have an unicode char
cause its not supported by your operative system to view "custom" emotes
only unicode
custom emotes are just ids replaced by images
im still confused how i interact my backend with frontend
no, the front end interacts with the back end
normal emoji = π = \π = \u1F600
custom emote =
= !weirdsip = ???
see the difference?
if you want to have a constant connection with your webserver, use a websocket
or just ws
im trying to make a dashboard, i've got some backend code done. but now i'm confused how to use vue to like
make it uhh
the using vue bit isn't the hard part, its cuz w/ express, u hav app.get('route') and with vue its the same kinda thing
yes
im really confused
how exactly does it return
but you can't entirely rely on the header if you want to be certain of the file type
the header defines how the browser will interpret the file
for example if the content-type is any of the image mime types, the browser will simply display it
if the content-type is text/html, the browser will attempt to render the contents
oh ok
if its an audio mime type, the browser will use its built in html5 media player
not all mime types have browser specific behavior, for example application/json is viewed as json in firefox, but as text in chrome
because chrome doesnt have any built in way of interpreting json, unless you have an extension for it
no, if you load a json file directly in the browser
like an url that returns a json response
yeah, firefox does have a json viewer built in
what is the difference between console.log and console.error
chrome doesnt
o
@quartz kindle https://cdn.discordapp.com/attachments/272764566411149314/718093228649349181/unknown.png what is the place that you did that?
chrome's dev tools console
browser console
Ok thanks
what data would i need in my api for a bots dashboard?
idk what data you want your dashboard to show?
Guilds, users etc.
just like a normal dashboard, like, the bots prefix, logs channel etc
Guilds, users
ok, thank
And your database
quick question
would i need a database for my bot and one for the dashboard?
so 2 dbs with the same info?
wouldn't that be like
bad? if i have to anyways
both the bot and the server would connect to the database server?
yeah, connect both the server and the bot to the database server
you could use Redis for caching
o ok
If you are using a local file with SQLite you can just point to the database file for both
do i need to host my db or something?
Is it on the same computer?
yeah
Then no
oh, ok
why even if a use a custom emoji betwen "" i still got :diamond: and not the emoji ?
the bot must be in that server
it is
is the custom emoji from your server? or is it a custom emoji from a different server?
is from a different server but the bot is in it
does the bot have EXTERNAL EMOJIS permission?
yes, it has admin permissions
try using a custom emoji from your own server
how are you sending the emoji
i'm doing an userinfo command i want to have a custom emoji and i have this ```js
.addField("π :diamond: Status", ${status[target.presence.status]}, inline, true)
in code emoji is like this
yes
where do you use that emoji code?
In the field title
wdym
it don't work either in description
try getting the emoji from the cache
i tried
Though that should work...
it returns undefined
you said in the code your emoji looks like that, but in your add field you have "π :diamond: Status" not the emoji code you showed after
Is member.id the same as message.author.id?
yes
thanks
when i copy paste an emoji reverts to this @quartz kindle
<a:diamond~1:707248274498781355>
oh nice
Help how i can read custom status
now it works
=))
@quartz kindle help
target.user.presence.activities.name is says undefiened
target.user.presence.activities is says vscode
user.presence.activities returns an array of activities
Thats rich presence
@pale vessel OH
Nope
https://canary.discordapp.com/channels/264445053596991498/272764566411149314/718114923892441180 it can send gif emojis though
Yes
@copper cradle lol they have every nitro perk except all of them, except animated and global emotes
yes the only perk they have is emotes
well
well?
what is >>
Sign-propagating right shift a >> b Shifts a in binary representation b (< 32) bits to the right, discarding bits shifted off.
with what permissions (permissions of the member we are trying to kick) do you have to be so the bot cannot kick you
If the bot has kick permissions, and the bot role is higher up in the list than your role that you have. you can be kicked
well it is, and it does have the kick perms but the role below has the administrator perms
is
that the thing that doesnt let me?
and how would i make the bot to check if the person i am mentioning has the administrator permission
Administrator is all perms.
i know, the bot and the role below it has the administrator, and then the bot cannot kick it
If you wanna check perms you can use this for the message sender.
message.member.roles.cache.map(role => role.toString())```
or this for someone specific
```js
message.guild.members.cache.get(message.mentions.users.first().id).roles.cache.map(role => role.toString())```
oh I forgot, yea
by getting your server count and updating your bot's presence
how can i do server count?!
If you are using discord.js v12 it would be something <Client>.guilds.cache.size
But if your bot is sharded then it would just display the guilds the shard is handling
I've recently gotten to 75+ servers. However, when I try to fill in and send my application it says that it was "inorganically grown". What does this even mean? I've contacted Discord support and no reply yet.
However one thing I did notice was that my bot jumped from 30 servers to 75 in a matter of days
Has someone, perhaps, hoarded my bot?
I think it means that you got those servers unfairly, like creating a bunch of servers and inviting your bot to them
you should ask in discord.gg/discord-developers
I genuinely don't know where that's coming from though. I know stuff like that wouldn't work.
Will hop in there and ask.
Thank you.
I see that they have a FAQ in there so that's really helpful. Thanks!
"**π Channels:**" + bot.channels.cache.get```
i got this
why ?
because bot.channels.cache.get is a function
and this is what happens when a function is added with a string
it is
hello
hi, i have two models for a member. one for my dashboard and one for the actual bot itself. and when i try to use the same model for both dashboard and bot, it doesn't let me authorize my account, i get can't access users guilds
mongoosejs
But the user thing works
hello can anyone help me with python bot script?
i will show it to you when you accept
it just wont work
you are probably using .size not .get
oh yes
my python script just wont work. no wrong
no errors
commands didnt work
How do I add aliases to my music bot?
v12
aliases: ['y'] I'm doing it as
pls help
@rigid maple it really depends on how you structure stuff. But the best way is to use the include method to search for the command under that aliases
Just store the aliases same way as you do the commands.
Wait, no I am wrong. Include is a string method, you would use the find method
It's also a string method
Yeah.
That's why I got confused, cause I forgot that it's an array and string method.
But that's not the best way for checking for aliases.
I use the find method for mine
oof.
Oofers indeed
How can I remove an object from an array
would setting the object to null remove it?
I do something like
for (const file of files) {
const required = require(file);
const parsed = path.parse(file);
client.commands.set(parsed.name.toLowerCase(), required);
if (Array.isArray(required.aliases) && required.aliases.length > 0) {
for (const alias of required.alises) client.commands.set(alias.toLowerCase(), required);
}
}```
No?
array = array.filter(data = data != search);
due to JS garbage collector?
Oofers mine is completely different
That's how command I do command loading.
Oofers
Kings, you should use the splice method
Splice would also work.
Also you can remove an object from an array by using multiple array methods, depends on where it is located
Slice also.
Yee
Setting the object to null?
yes
the whole object to null
array[index] = null;
It won't
That won't change what's stored in the array.
it still counts as an element in the array
then what does the garbage collector do
Remove unused variables
or ones that have already been used and are no longer needed
JS could do with pointers.
I mean J's arrays don't care about what type it is, as long the object exist in the array
ok so it can only delete an object if the object is from a variable?
no, that's not how references work
var x = {"y","x"};
x = null
let obj = {};
const array = [];
array.push(obj);
delete obj;
console.log(array[0]) // {}
^^^^
Objects are passed by reference, so if you add an object to an array, that object gets referenced in the array
obj is simply another reference
If you remove the object from the array, obj will still be {}
If you want to fully delete the obj object, you have to destroy the obj.
so If I have for loop I can say
for(let x = 0;x < x.length; x++)
array.splice(x, 1)
I mean if you want to remove everything from an array, you can just do array.splice(0, array.length); that will remove everything
yea I was going to add another if statement in the loop
Yee
Or array = [];
Not in here
hi, i have two models for a member. one for my dashboard and one for the actual bot itself. and when i try to use the same model for both dashboard and bot, it doesn't let me authorize my account, i get can't access users guilds
js
anyone here mind offering some feedback on my bot's page design?
sure
guys
i havent finished with the dashboard yet, so nothing to show there
looks nice. is it responsive?
on my bot
hello
i havent got the responsive side of it working right with the score tables atm though
nvm
just ask, Aspect :)
didn't know that was a thing in glitch
it's only a test bot
also, nice token
why is there two
nope
do i not need one in the end?
code plz
you already have like 3 people helping you
just fyi, this is only a test bot so dont try to hack me
sorry
i should be gratful
does glitch actually support python?
then why are you using python in glitch

that code is somewhat confuse
?
also, refresh that token asap
confuse to the computer.......?
can someone help me?
python
his code
bruh
discord.py or js
discord.py or js
ok
client.run?
have u got a on_message event
below all codes?
ah, forgot that in python you gotta define all methods before the actual code
await bot.process_commands(message)
see that client.run('TOKEN')
atleast learn the basics of python before doing discord.py
put that in your on_message event
and yes its a nice token leak
he is a beginner
client.run()?
@earnest phoenixawait bot.process_commands(message)
what?
he is a beginner
put that in on_message event
no?
wait put what in what?
await client.process_commands(message)
where?
in the bottom of on_message
ok
alright
lmk if works :)
Can someone help me now?
okay
Aslong as client.run() is still above those commands
Can someone help me now?
@wet iron what u need
they will never work
i learned python
is that py on glitch
yes u need it above
@earnest phoenix clearly not
@limber flume π€
is that py on glitch
It pains me but yes
cuz you dont know the basics
i do
does it work aspect
you dont
all ur commands
fix them
you litterally
show me error
you litterally have a indentation issue
and cant read an error
BRUH
secondly
YOU STILL HAVE CLIENT.RUN() ABOVE THE COMMANDS
the end of above code
@wet iron what u need
@limber flume I made a shop in discord.js like with economy but it wont work
then press enter
it will show up
ok
but the buy function wont work
what?
@limber flume I made a shop in discord.js like with economy but it wont work
@wet iron whats error im mainly py but i can try to help
japanese girl what?
send me the code
client.run?
im in discord.js
ill fix it god damn
send me the code aspect
one does not simply indent with spaces in python
???
aspect
wtf
send me code
okay
ill fix itr
import discord
import os
import keep_alive
from discord.ext import commands
###ENVIRONMENT###
TOKEN = os.getenv("TOKEN")
APIKEY = os.getenv("APIkey")
SECRET = os.getenv("ClientSecret")
ID = os.getenv("ClientID")
###ENVIRONMENT###
client = commands.Bot(command_prefix = '!')
Clientdiscord = discord.Client()
@client.event
async def on_ready():
print("I'm in")
@client.event
async def on_message(message):
print(str(message.author.display_name)+" "+message.content)
if message.author == client.user:
return
if message.content.startswith("!HiZombia"):
await message.channel.send("Hello! I am the official bot of Zombia.io Discord Server! ") # startswith returns true if the string its called on startswith something
await client.process_commands(message)
client.run('NzE3MTA4MjA0NDMzMDQ3NTc0.XtkwDA.fg_c9beMdCRUOdGz5T9DhobinTk')
@client.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)
await ctx.send(f'User {member} has been kicked!')
@client.command()
@commands.has_permission(mute_members=True)
async def mute(ctx, self, member : discord.Member, *, reason=None):
await member.mute(reason=reason)
await ctx.send(f'User {member} has been muted!')
@client.command()
@commands.has_permissions(ban_members=True)
async def ban(ctx, self, anything: discord.Member, *, reason=None):
await member.ban(reason=reason)
await ctx.send(f'User {anything} has vanished!')
code here
bruh
wtf.
lmao
token
he leaked the whole code
yeah
even the token
okay
u will learn it eventualy
checkmate
why don't you start with a very simple code and put more things as you develop your skills?
im 5 weeks python
like, there's no shame in starting with a Ping command or a "Hello World" string
thank you so much
dont spoon feed code smfh
np
what is ur xperiences
what
how could these bot instructions be improved?
it's very easy to miss the whitespace there
lOl
field titles are bad for commands
now my code crashes
because they're too "invisible"
now my code crashes
@wet iron eoor?
They should of kept the old Field name colours
error*
but kept the value colors they have now
im trying to give the sender a role
rr?
for example if they type .buy 'role' they get a role
i like the current embed, it gives more emphasis to the field content rather than the title
so
White > the shitty grey
so it looks like your content is correctly separated into sections, but doesnt overload it with bright and strong titles
hello
bruh
i dont see my problems
oml
just copy paste
i cant
π Dont π Spoon π feed π
dude
ur problems is that u dont know python
you'll not learn fishing by being given a fish
bro
same with programming
yea
and SPOONFEEDING CODE π Is NOT the way to help
i do /s
and SPOONFEEDING CODE π Is NOT the way to help
@modest maple 100% agree
can you explain which line?
nor is jumping to discord.py WHICH IS RENOUND FOR BEING NON-BEGINNER
@quartz kindle @modest maple thanks, i'll try messing around with it some more
You seem to have 0 idea of the following:
OOP
PEP 8
Functions
INDENTATION
ASYNC AND AWAIT
and more...
basically everything discord.py requires you to know
I think the biggest issue here is not admitting that he's a beginner
wait whats pep
i am yeah i am
so accept our help dude
If he isnt a beginner that makes me a god of Python
you WILL come back here N more times
NO COPY
because making bots does not resume to "making a working bot"
wait
because there's no 100% bug-free code
activate windows
what will you do when you need to fix your code?
will you ask sean again?
seee if i video and he dont see it
y
we WILL bully you if you continue to Spoon feed code
y
Especially without given any prior info
i will definitely
and he WILL bother you with N issues
i got bullied for spoon feeding code
im just tryna help
and showing that you damn well dont have a good knowledge of python aswell
yk
@earnest phoenix this is last time im showing u https://discordapp.com/channels/264445053596991498/272764566411149314/718160153018368172
test me after i fix code
bro
wait, are you accepting that we test you about python knowledge?
can someone help me
how do I add a role to the sender?
I am now the god of python
@modest maple "test me after i fix code"
how do I add a role to the sender?
@wet iron language?
that's about it, maybe the issue is somewhere else
@earnest phoenix What does this bit of code do
do you get any error?
Its pretty simple being 12 lines
wait
what exactly is sender
a member or a user
sender.addRole is not a function
sender.addRole is not a function
@wet iron show the bit where you're defining "sender"
msg.author
thats not a member
thats a user object
Member != User
@earnest phoenix is your code working
lol
define role
is msg.member even a thing in d.js
im not discord.js
bruh
i know a little
:|
look at mistakes
lol
bruh
:/
whats the error now
@earnest phoenix What does this bit of code do
@modest maple is that a broadcasting function?


