#development
1 messages ยท Page 1337 of 1
that is also true
oh my fucking god so give me context what you're doing and working with
a web page?
yep
what are you doing lmao
Well I will just found out it myself
it seems difficult to understand
files don't exist in a browser context (well, they do, but not in a nodejs way)
bruh
u dont understand it
that's why i keep asking you what in the literal fuck are you doing
it would be a lot easier if you just said what you were doing in the first place
i don't get where's the problem
I'll found it myself out
then why ask here in the first place
@weak parrot ads
Because I thought people could understand it
@main bobcat shut
explain then
Well I did it, the best I could
;-;
so I'll try it out myself
i keep asking you what you're doing, what led you to the fact that you need to use appendfile in a browser context and you refuse to answer lol
How can i put in my bot setActivity the shard it is?
using the sharding manager or internal sharding?
you use setActivity 16 times
Hey, good morning everyone. Does anyone know how to make your bot in .js change icon / avatar, just like Loritta and Neko bot do?? Thanks in advance!
each one with a different shardID
huh?
client.user.setActivity("abc from shard 1",{type:"WATCHING",shardID:1})
@tame badger https://anidiots.guide I'd recommend looking at this for help setting up your first bot.
so if i were to 300IQ i could have a status for every guild by having 1 guild in each shard? @quartz kindle

#development message That 16 times with 1, 2, 3 etc... ??
well
HEHEHEHEHEH and here i thought i was abusing twitch with 400 shards(ish)
i cant have 16782 shards so...
discord, here i go!
and even if you do have 1 shard per guild, you are not guaranteed to receive 1 guild on each shard
you will likely get tons of shards with 0 guilds and others with 2-3 guilds
true
@earnest phoenix why do u have prosses hacker
hmmm thats a pain then
per-guild status would be nice
with membercount, all that jazz
spam api with status updates

pls discord ban this dude ^
client.user.setActivity("no",{type:"WATCHING",shardID:1})
client.user.setActivity("yes",{type:"WATCHING",shardID:2})
client.user.setActivity("no",{type:"WATCHING",shardID:3})
client.user.setActivity("yes",{type:"WATCHING",shardID:4})
this 16 times
ye
my eyes burn

no please
@jovial nexus if you have repeating statuses, you can use an array of shard ids
shardID:[0,2,4,6,8]
let count = 0;
guilds.forEach((guild) => {
client.setStatus(guild.memberCount, {shard: count});
count++
})```
behold, the ultimate shit code
at ClientPresence.set (bot title here\node_modules\discord.js\src\structures\ClientPresence.js:27:50)```

@jovial nexus console.log(client.ws.shards)
can we get a dev challenge to see how quick we can get ratelimited?
wdym?
while(true) {client.setActivity('LuL')}
something like this
shortest way to get ratelimited with the least amount of characters
Does someone knows a sick background for my site??
this is going to be funny
you cant have 2 shards for 16k lul, unless you leave 12k offline
you cant have 2 shards for 16k lul, unless you leave 12k offline
@quartz kindle ?????
each shard can have up to 5000 guilds no?
2500
I heard around 1,000 was best practice though. That true?
clientUser#setActivity
i think the best was 2200 - 2300
Someone knows a clean website background
im currently using 1600-2000 per shard
@earnest phoenix try unsplash
from discord's perspective, less guilds per shard is better for them, faster load balancing and faster reconnects
form a user's perspective, more guilds per shard is better
Yeah. On auto shard it does 1k per shard automatically
form a user's perspective, more guilds per shard is better
@quartz kindle how so?
unless you have tons of cpu cores
if you have 10k guilds, and 1 cpu core, its better to have all of them in the same process, and one process with 4-5 shards would be better than 1 process with 10 shards, less connections, less chances of weird shit happening behind the scenes
Discord needs a "save" / "bookmark" feature to save messages in ๐
Thats a nice idea
It would be awesome. I'm always reading or seeing stuff around different servers I'd like to save for later.
Anyway #development ๐
why user.presence.activity ? user.presence.activity.name doesnt work?
?
cond ? if cond is true, this block executes : if cond is false, this block executes
how hard is that to understand smh
user.presence.activity ? user.presence.activity.name : "Nothing"
user.presence.activity ? user.presence.activity?.name : "Nothing" that?
but that dont work
let me check docs
it's activities lmao
plural
it's an array of activities
user.presence.activities[0] ? user.presence.activities[0].name : "Nothing" this gets their first activity
1st?
wil try it gimme a sec
you need to handle those
that worked thanks
Invalid Syntax: ) from exec Does anyone know why this happens?
thonk @slender thistle
How can I make a music bot?
did you install django bro
@slender thistle yeah
How are you running your bot and how did you install Django?
It's not my bot but I'm running it on a VPS Ubuntu 18.04
and I installed it with pip install django and pip install djangorestframework
is I see nowraise ... from ... really valid syntax
it's the code that comes with the file so it should be correct syntax
and I didn't make any changes to it
and how are you running the file?
is debian better or Ubuntu
lol
for my bot
Are you going with the server edition or with a desktop?
yes
are you familiar with Linux's terminal?
yes
Okie-doke. You're all set then
ok
@slender thistle do you know why this is happening?
Not exactly. Can you show your full code?
like my whole manage.py file?
#!/usr/bin/env python
#"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
# """Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'exo_api.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
I've setted up google search console for my site, but it still doesn't shows up if i google site:MYSITE
are you talking to me?
yeah
@earnest phoenix why do u have prosses hacker
@earnest phoenix what the fuck
whats the TEAM_USER flag?
How do I check how many server that other people add my bot in?
whats the TEAM_USER flag?
@ionic dawn Team-owned bots or stuff
client.servers
How do I check how many server that other people add my bot in?
@hushed axle js or py?
Js
@hushed axle eris or discordjs?
or jda 
what you mean
Yes my VPS is shit
what vps you use
Galaxy Gate more like Galaxy Gate
lol
yuh
I dont know but you're kinda weird @delicate shore
Messages are going above me which are posted afterwards
If I say shit, you say i am cursing etc
well considering the fact that discord is storing and processing more than 10000x the amount of things you process on your bot
and you're doing it all the time aswell
well considering the fact that discord is storing and processing more than 10000x the amount of things you process on your bot
@fluid basin Facts facts
๐
If I say shit, you say i am cursing etc
@earnest phoenix
My server family friendly not this
shit isnt not-family-friendly
maybe a dumb question, but I'm sick of trying to explain myself to google.
I want this line to check if the message starts with one of multiple prefixes listed in a config object called modulePrefixes.
if (message.content.startsWith(config.prefix)) {
// ...
}
my parents normally say shit etc
Me too
And idc they do
Nice
Because i used to do that aswell
๐
Lemme work on my site
also rip, google has paused the google search console, indexation
so it can't be on google till they resume it
rip rip rip
also rip, google has paused the google search console, indexation
@earnest phoenix
Sad my website was automatically indexed by Google
But it didn't index its main page
You can tell google to ignore it
And now
also robots.txt
also robots.txt
@faint prism I hab dat
you have to index it
if you cant index it, your site cant be on google
no
they stopped doing that
for a few weeks
Google takes about 2 weeks
For indexing it
Automatically
They'll index it don't worry
My pages also got indexed
Except main one
We can't submit manual indexing request
But automatic is still on
manual will be back soon
same
My main page isn't indexed ๐
how did u made your site
Rest all are
i saw you're github
2k lines for every page nearly
How did you do that
i can't believe you typed 2k lines
per page
But finally my site is online, etc
I got directadmin acces
How do I ping a certain role in discord.py?
no
I mean
boi
<@!id>
do this: \@rolemention
Bruh ok
^^^
Hey so I have this array [1, 2, 3, 4, 5, 6, 7, 8]
Then I have 2 numbers (2 indexes) and I basically wanna split the array depending on these indexes so lets say they are 3 and 7 the array should be: [3, 4, 5, 6, 7]
Rest all are
i tried that I might just be stupid tho
i can't believe you typed 2k lines
@Nutella#0007
I took a lot of code from online as well which you should too
No-one nerd can type 2k lines of code
@tulip ledge [0, 1, 2, 3, 4, 5].slice(1, 4 + 1); // [ 1, 2, 3, 4 ]
Is there a way to join an array at intervals other than each item e.g [1, 2, 3, 4].someArrayFunction(2, "\n"); โ 1,2, 3,4
why do you want to do that @gilded ice

@solemn latch don't wanna have to do ${arr[0]} and ${arr[1]} and ${arr[3]}...\n${arr[4]}...
wew it ends with and
how does it look
@gilded ice make a better structure like js [ ["foo", "bar"], ["baz", "biz"] ].map(x => x.join(" and ")).join("\n"); // "foo and bar\nbaz and biz"
TypeError: Cannot use 'in' operator to search for 'title' in 745608071706837110
at Embed.setup (/var/bot/node_modules/discord.js/src/structures/MessageEmbed.js:38:26)
at new MessageEmbed (/var/bot/node_modules/discord.js/src/structures/MessageEmbed.js:18:10)
at new Embed (/var/bot/src/Util/Client/Functions/Embed.js:5:5)
at /var/bot/src/Commands/Development/evaluate.js:56:28
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

The error is quite self-explanatory: The in operator can't be used to search for a string in a number.
thing is, line 56 is just let errEmbed = new client.Embed(message.guild.id)
discord.js in client sharding isnt working
const client = new Discord.Client(shards:'auto');
Yeah, but the error comes from the MessageEmbed class from the Discord.js library. If you look into it:
this is what should work right?
No
did you forget the {} around it.
it needs to be {shards: 'auto'}
to mention a role it's <@&ID> isn't it?
@winter topaz ikr but it was to test if he had mentions disabled maybe..
Yeah, but the error comes from the
MessageEmbedclass from the Discord.js library. If you look into it:
@sudden geyser so one of the embed functions?
or discord.js itself
No, the constructor client.Embed, which is probably an extended class of Discord.MessageEmbed. Can you show your definition of the class
aight
is there same for CommandClient for discord.js-commando?
Welp const client = new Discord.Client({shards:'auto'});
didnt work either
How do you know
Nvm im dumb
Instead of client.shard i was checking client.shards category
Thanks lol
@snow urchin the first argument of data should be an object. You're giving it the guild ID
its worked before, and I have used the guild ID from it before, just fine.
Try it without a guild ID and give data a default value of {} (data = {}) and see what you get.
nvm sharding isnt working
or i might be wrong
what should !eval client.shard.count reply with?
rn its 0
and my client is
const client = new Discord.Client({shardCount:5});
@sudden geyser fixed :D
Also, would playing an audio stream which is hosted on the same server be faster at all using localhost or direct ip
or no difference
I don't know, I don't work with audio.
@low orbit wdym
does Date.UTC work without internet
try <%= theUser.tag %>
you cant do it like that
one sec
this is an example of how you would go about what your trying
<% if(extra) { %>
<% extra = `${extra}&` %>
<% link = `/bots?${extra}page=` %>
<% } else { %>
<% link = "/bots?page=" %>
<% } %>
<% if(page == 1) { %>
<a style="cursor:no-drop;"><arrows class="left"></arrows></a>
<% } else { %>
<a href="<%= link %><%= parseInt(page)-1 %>"><arrows class="left"></arrows></a>
<%}%>
<% if(page == Math.ceil((extra ? options[extra.split("=")[0]] : botsSize) / 16) || (extra ? !options[extra.split("=")[0]] : null)) { %>
<a style="cursor:no-drop;"><arrows class="right"></arrows></a>
<% } else { %>
<a href="<%= link %><%= parseInt(page)+1 %>"><arrows class="right"></arrows></a>
<% } %>
</div>
<% } %>
close the tag
open one for user
close that
so on
have you not just tried user.tag without any tags?
uh
what
It wonโt have a capital at the start if itโs lowercase will it?
yep
huh
ok youโre literally why it was removed
Korabi, i know u
Im not Lying dude
oh well..
@rough knot Don't start this shit again
ok youโre literally why it was removed
@misty sigil yes lol
what are some ts advantages and disadvantages than straight up using node
i cant get a non bias look ๐

You get type safety
its not about bots but maybe yes but can someone help me set verify page? like user need react with emoji,mark on emssage to see full server or must select role to access full server do u know what i mean please?:/
...
https://gyazo.com/ce1943e75855f5950409b6ea05f5b608
something like this i want.
There are a lot of bots that offer that sort of feature (such as selfroles). One would be Carl.
boot
what are some ts advantages and disadvantages than straight up using node
@split hazel as compared to...
oh ts
typing is great to ensure code maintability
and OOP also encourages good overall code design
typings also make compile-time static type checking possible
which eliminates quite a lot of errors that you might get before running
Think of TS as a higher-level form of JS. Personally I'd stick with JS but there's value in TS.
also able to down-compile to lower ES versions I suppose, useful in browsers which don't support the latest syntax
ts has built-in polyfills for a bunch of things, though everything is done under the hood
@split hazel well I guess that sums up the advantages
disadvantages is basically extra time and steps required to compile the code before each execution, as well as extra overhead from the code conversion and runtime type checking
and requirements might seem daunting for those starting out with emphasis on good code design and structures using types etc
also only those popular or highly used libraries have typings which allow type inference and could cause code to be messy when using a library without typings
how can I call a function based on a variable name? for example:
var functionToRun = "aFunction";
// make the bot run aFunction();
var functionToRun = "bFunction";
// make the bot run bFunction();
I had to send messages at a certain time of the day
in discord.py
suppose every day I want to send messages at exactly 5:00 PM PDT how would i DO THAT?
@modest smelt you're gonna want to use cron. Google how to do that.
Cam one way would be to save the name to a key/value and have the value be the function
interesting
I personally don't recommend it.
any other ideas?
@modest smelt you're gonna want to use
cron. Google how to do that.
@buoyant aspen ok
I know there is a way I think it's with map but idk how and I can't find how to do it online.
So I have this array:
[
"item1": "emoji1",
"item2": "emoji2"
];
```js
Now I wanna get the emoji depending on the item and I don't want to if stack does anyone know how to?
So if the item is item1 it should give me emoji1
wait nvm I can just use objects
yeah
your intention kind of was from the start since you can't use : like that in arrays
yup I sawx it when I typed out the array lol
But isn't there a way using map? ๐ค I wonder now
wait its probably
Array.map(item => {
return object[item];
}
Right?
u'd need an object with the emoji's tho but it would turn
["item1", "item2"] into ["emoji1", "emoji2"] right?
@fluid basin ty
types sometimes mess me up so i'll probably look into ts for projects, quite a fan of strict structures in some cases
ok i have a nodejs question
below is a simple example of an echo server using the net module
const net = require('net');
const server = net.createServer((c) => {
// 'connection' listener.
console.log('client connected');
c.on('end', () => {
console.log('client disconnected');
});
c.write('hello\r\n');
c.pipe(c);
});
server.on('error', (err) => {
throw err;
});
server.listen(8124, () => {
console.log('server bound');
});
how would i send that to a http.createServer object listening on some random port?
basically i want to make a tunnel but JUST for xmlhttprequests so sry if all of this was useless to my question
*http requests
...a proxy?
yea.. because i got a program(yes not discord related)
Any dev topic is welcome
just use express and then listen for all http methods (PUT, POST, GET, PATCH, DELETE)
i mean technically there is a way, along the lines of having the proxy pc take the request and httpRequestToRealListener(JSON.stringify(proxyRecievedReq)) but i sense it would be slow
just use express and then listen for all http methods (PUT, POST, GET, PATCH, DELETE)
@earnest phoenix yea, but im wondering how u would send that exact request back to another listener
copy the headers and the data from the url params and then forward it to the actual url
(with something like node-fetch for example)
stuff really specific i take too(for example i ensure that u r loading this on localhost:xxx)
but.. node-fetch...
hmm
proxying on localhost is like heating up water with a microwave
xD
you can just use warm water from your tap
well its practising
for having the proxy online
i can't depend on ngrok being around forever u see
microwaving water is spooky. You never know how hot it is until you throw it on someone's face
:l
true that
Maybe, maybe not. The fear of scalding water keeps them from snitching talking about it
definitely
I mean microwave water is the lazy way to do it
microwaving water is spooky. You never know how hot it is until you throw it on someone's face
@faint prism you could easily turn that into a florida man story. "Florida Man suffers 1st degree burns after roommate splashes microwaved water in face."
@faint prism you could easily turn that into a florida man story. "Florida Man suffers 1st degree burns after roommate splashes microwaved water in face."
@sudden geyser like this? #memes-and-media message
yes
no
@gilded ice Please stop
anyone here used patreon api/webhooks before?
@fiery canyon No. But it depends on what you're trying to do
๐ฅ

An api would be suited for making calls to Patreon.
A webhook would be reactionary and event based, although I have no experience with webhooks.
@faint prism no
@gilded ice why here and not #general-int where that's allowed?
how do you setup elasticsearch to match "lol" to "league of legends"?
with a fuzzy search
that didnt work
@gilded ice why here and not #general-int where that's allowed?
Am I not allowed to egg in this channel
This is discrimination
lol

plz
using aws @proven lantern ?
i think i can just transform the data before inserting it. just make a huge map of things like lol -> league of legends
what is best data bas for dicord bot sir/mam
what is your bot doing?
with meilisearch id set a row set to common acronyms and other things and i'd add that to search
not sure how you'd do that with elasticsearch tho
hello can i get some help with the bot DSL
If any1 will help me
No, but sometimes people will answer programming questions here
Man then I think ima give up on creating a bot honestly
Not too hard if you know a programming language tbh
define "this"
Like I copied that from yt
So that's your issue
Well what app do I use?
Use a programming language, and use Discord's API or a library
hello can i get some help with the bot DSL
no that is programming
oh
just with a shit pseudolanguage
^ this
Not very descriptive
YA
how do i use discord bot maker
what do you need help with
commands
what piece of logic
DSL doesnt have commands
@strong tundra thanks, elasticseach has the same synonyms feature.
yeah np
How do I talk through my bots
Via an eval lol
Or, make a UI to enable easy communication on specific guilds and channels, but that feels like it may be against TOS
Anyone has a good alternative lib for ajax in njs?
And nope axios is crap as well as xhr.
I need to use get/post mentoding to local files not using http(rotocol)
Oh and of course jQuery not as well since it would require a virtual DOM
hey hey
what are the new rate limits on create reactions for discord.js?
@boreal iron node or browser? or electron/nwjs?
Nodejs
@molten yarrow reacting to messages its 1 per 0.25 seconds
@boreal iron nodejs doesnt really do ajax, but i assume you mean making an http request, for which there are plenty of libraries, such as node-fetch, got, bent, and even the built in http/https modules
rly?
im reacting 3 times to Bots message and get after one rate limited
like this and getting two rate limits in console
Alright will take a look at those, they need to support fetching local files
@boreal iron local files? you mean files from the same machine as the node process is running? you dont use http libraries for that, you use the fs module to access the local file system
Huh nah I guess I misread
@molten yarrow are you properly waiting for the previous reaction to complete before adding the next one?
I need the to use get/post method to local files like in Ajax but I donโt wanna use xhr
ajax and xhr are browser-only things
it would help if you explain what you are trying to do instead
uhm yeah
@molten yarrow welp, discord.js is kinda bad at handling those
i get this error when i start my nodejs bot
one thing you can do is add a delay yourself
i get this error when i start my nodejs bot
@indigo flax what error
(node:851) UnhandledPromiseRejectionWarning: #<Response>
(node:851) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:851) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
hm okay thanks Tim gonna try it xD
it was fine until last week...
Code?
was my installation wrong?
Yeah those require a DOM
I thought about a way to call local files using get/post method in nodejs
Iโm probably unable to explain it correctly while driving lel
i dont understand what you mean with using get/post for local files, you get local files from the file system, and remote files with get/post
Can give bare informations unlikely
maybe don't text and drive and wait until you're at home?
@indigo flax I found this online but don't think it relates to your error unless you are using express. https://stackoverflow.com/questions/53940043/unhandledpromiserejectionwarning-this-error-originated-either-by-throwing-insid
Gonna repeat what I mean tomorrow once again if Iโm back at home
Pretty wild
@compact echo https://hastebin.gq/legicagune.js
I don't know sorry ๐ญ
its ok
@molten yarrow actually, discord.js's system is working as intended:
the rate limit event is discord.js telling you that they prevented a real rate limit error from discord by delaying a request.
since the limit is 1 per 250ms instead of 4 per 1s, you send one and it tells the system the next one will cause a rate limit error, so the second reaction causes discord.js to throw that error to prevent causing a real rate limit error, and then they add it to the queue and retry it later
#workingasintended
but i cant use them after that
tryed with 1 sec wait time between reactions and it working, but kinda slow now xD
additionally, discord.js also adds their own 500ms delay between all requests
"just in case"
thats why the rate limit error shows 750ms instead of 250ms
and thats why reactions are so slow in discord.js
ouh okay
but there is a way to fix that
are rate limits for message edit also changed now?
Just need to post some json content to a local php file without the need to use a callback function. dc about on success or not
a local php file? is the php file running on a web server?
Hmm
if yes, then yes you can use any http library to send a request to localhost:port/file.php
I got the webserver and everything set up but it says forbidden You don't have permission to access this resource. when I try going to the page. Does anyone know why this happens?
Are you using any sort of authentication or does the webserver have permission to whatever your accessing
Are you using any sort of authentication or does the webserver have permission to whatever your accessing
@faint prism yeah I didsudo chown -R :www-data exo_api
to change the group owner of the files
so apache should have access to all of the files
How do i do a forEach loop for permissions on a channel I create?
sounds like an XY problem
@blissful coral Probably should give the library you're using if you want a more specific answer. But generally most libraries either include a way to get permission overrides for a specific role/member, a list of permission overrides that you can loop through, etc.
hi, im trying to get messages which has been bulk deleted
any ideas how im supposed to do this directly from dapi?
How do i do a
forEachloop for permissions on a channel I create?
@blissful coral Loop on permissions of a channel you create? What does that mean
use then @digital ibex
no i know how that works
Like, you can literally pass in permission resolvables instead of a loop, idk what you're trying to do
i just dont get the content of the message
I was asking a dumb question lmfao don't mind me
one sec
this is what im doing, messages.map((e) => e.channel.messages) and it just says collection (0) times however many times i bulk deleted
im using eris idk if discord.js handles it differently or something
you can only get their content if they were cached before being deleted
^
also, you cant get them the way you're doing it
ik, im sending the messages after my bot turns on
they are copied to the collection, then deleted from the cache
so they are all inside messages, but not anymore in channel.messages
messages.map(msg => msg.content)
how do I get a count of how many voice channels my bot is in?
or other, how many servers bot is playing music in
yo
client.voice most likely
client.voice.connections
i currently have this code:
x = requests.get("https://gamerdvr.com/gamer/{}".format(gamertag))
i = BeautifulSoup(x.content, "lxml")
links = i.find_all("img", alt="avatar")
await ctx.send(links)```
and it does this:
how would i get the value of "data-original"
i scrolled up to just messages and it doesnt show anything to do with content, or show it
I've tried the client.voice.connections.cache.size it thorws an error
oh
if its empty, then there are no active voice connections
I see
@quaint peak
links.get("data-original")
@quartz kindle ```py
x = requests.get("https://gamerdvr.com/gamer/{}".format(gamertag))
i = BeautifulSoup(x.content, "lxml")
links = i.find_all("img", alt="avatar")
data = links.get("data-original")
await ctx.send(data)
thanks!
i tried message.content and it actually worked, i didnt see it in the messages object so i thought it wasnt there, re read the docs and saw Array<Messages> ๐คฆโโ๏ธ
@quaint peak try it
ty tim
yw
thanks
site is down
but it'll be a low quality one aka very bad
5 nitro boosts for the best of my ability
does anyone know how to make a picture blury on canvas
like add blur to an image ?
yeah
photoshop is my secret
does anyone know how to make a picture blury on canvas
like add blur to an image ?
yeah canvas...you can use a canvas on photoshop
yeah photoshop a blur on the background
okay how?
buy photoshop
is "photoshop" an npm?
haha i feel like your 9
I feel like you don't understand the fact that I am using a npm called canvas and I am talking about doing it in discord javascript
an other method would do, but in js
okay cool
sooo my coding is harder and your coding is as easy as pressing (Ctrl-Shift-C) and changing something on a website

no
My bad that your coding is harder
I am sorry
does anyone know how to make a picture blury on canvas
like add blur to an image ?
ig they probably don't have a blur cmd
anyone know an alternative if not?
I'm using django and I got an apache webserver and everything set up but it says forbidden You don't have permission to access this resource. when I try going to the page. Does anyone know why this happens?
this didn't work? https://www.tecmint.com/forbidden-you-dont-have-permission-to-access-on-this-server-error/
dbl api is down?
dbl is down
Oh no, what will we do
how can i make a dashboard for my discord bot?
Depends on what programming languages you know
i mainly know js
There is no one way, and there is also no easy way like some website or anything. You will have to do research on how to create and host a website, and make sure what is being taught to you will work for your purposes on a VPS or whatever you end up hosting with.
For site to bot communication at least, the one tip i can give you is I personally use webhooks. Site will send a message formatted for my bot to read through a Discord webhook into a channel. Only solution I could come up with. For bot to site, you will probably want endpoints that you have protected with some sort of key, or just do whatever you want that works I guess.
uhhh ok lmao
so many ways to connect bot with the website tbh
you could host them on the same process
you could use ipc
you could use localhost/path with a small api
theres plenty of methods to connect to the bot without too much of a hassle
I considered doing local communication, but webhook system means that I dont have to actively check for communications and such, and that all communications are nearly instant.
or, you could just have the dashboard in the bot.
you don't have to worry too much about connection.
@vernal rivet wdym in the bot?
you can just run the website in the bot's program. instead of having it separate
threading. effort

i caught on to that concept too late and didnt feel like backtracking but ur right
Code : ```shards.on("shardCreate", shard => {
console.log([${new Date().toString().split(" ", 5).join(" ")}] Launched shard #${shard.id});
let embedt5 = new Discord.MessageEmbed()
.setAuthor(Shard Online | Update!, https://cdn.discordapp.com/avatars/163804470763847680/a_bb43ba59ed24339510d344029ac88d95.gif?format=png)
.setColor("YELLOW")
.setDescription(**I am now available in ${shard.id}.**);
bot.channels.cache.get('768218401466220545').send(embedt5);
});
Error : (node:13576) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
can someone please help?
Would anyone who has been approved on top.gg be able to play around with my bot to help me make sure nothing is broken and anything along thoes lines?
A extra pair of eyes goes a long way.
@dapper dagger I can look at it when I am eating. Just DM me a server that it is in.
How do you add CSS to your bots page?
@wicked narwhal ```html
<style>
css stuff in here
</style>
You can use HTML in the description, but keep in mind you can't use JS in it.
Right, otherwise it basically be XSS
Error : (node:13576) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
@unreal token it works when i do x!eval bot.channels.cache.get('768218401466220545').send('z');
const { Command } = require("discord.js-commando");
const request = require("request-promise");
module.exports = class changelog extends Command {
constructor(client) {
super(client, {
name: "embed",
aliases: ["sayembed"],
group: "miscellaneous",
memberName: "embed",
description: "Posts an embed with desired content",
guildOnly: true,
throttling: {
usages: 2,
duration: 10
},
args: [
{
type: "string",
prompt: "What channel do you want to send this in?",
key: "channel",
},
{
type: "string",
prompt: "What do you want the title to be?",
key: "title"
},
{
type: "string",
prompt: "What do you want the content to be?",
key: "content"
}
]
});
}
hasPermission(msgObject) {
const mainserver = msgObject.client.guilds.get("706999196124840009");
if (msgObject.member.roles.find(role => role.name === "Admin")) {
return true;
} else if (
msgObject.author == this.client.users.get("675794471065092161")
) {
return true;
} else if (msgObject.member.roles.find(role => role.name == "Moderator")) {
return true;
}
return "Sorry ๐ฃ! You must be a Staff Member!";
}
async run(msgObject, { channel, title, content }) {
let embed = new Discord.RichEmbed()
.setTitle(title)
.setDescription(content)
.setColor("RANDOM");
try {
msgObject.guild.channels.find("name", channel).send(embed)
} catch(error){
msgObject.reply(`Sorry ๐ฃ! There has been an error while running this command!\n\n\`\`\`js\n${error}\`\`\``)
}
}
};
is shows an error
i was told to add - someCollection.find('property', value);
- someCollection.find(element => element.property === value)
+ someCollection.find(element => element.property === value)```
but where
is shows an error
@indigo flax thonk
?
hm ill try it thx
consider upgrading soon
@pale vessel lol
lol xd

x can be anything, it's like lambda
wait ur not supposed to replace the line if im correct
u just paste it after the channels
ya
@pale vessel sorry for the ping
but
mayFLOW
BOT
Today at 9:19 PM
@NotCINDERS, Sorry ๐ฃ! There has been an error while running this command!
TypeError: Cannot read property 'send' of null
msgObject.guild.channels.find(x => x.name === "channel").send(embed)
msgObject.guild.channels.find(x => x.name === "channel").send(embed)
is there a channel called "channel"?
oh
do i tell him to put the name of the channel or the channel id
@pale vessel oh
its
;embed #channel title
it goes in the channel he wants it to go in
its ok, ur the one helping anyways
alright so like msgObject.guild.channels.find(x => x.name === channel).send(embed)
bruh
yaya
he said it works but the cooldown doesnt???
ill see
he said its
usages: 2,
duration: 10
},```
i have no idea what that is
same
im asking him
it gives no errors
@pale vessel thx so much for the help
<3
async def serverinfo(ctx):
guild = ctx.guild
create = await ctx.guild.create_invite()
bans = await ctx.guild.bans()
embed = discord.Embed(title = f"{ctx.guild.name}" , colour = ctx.author.colour)
embed.add_field(name = "Server Owner:" , value = f"{ctx.guild.owner}")
embed.add_field(name = f"Server's Id" , value = f"{ctx.guild.id}")
embed.add_field(name = "Member Count" , value = f"{ctx.guild.member_count}")
embed.set_thumbnail(url = guild.icon_url)
embed.add_field(name = "Server created on" , value = ctx.guild.created_at.strftime("%a, %d %B %Y , %I %M %p UTC"))
embed.add_field(name = "Banned Members" , value = f"{len(bans)}")
embed.add_field(name = "Server's Region" , value = ctx.guild.region)
embed.add_field(name = f"Role count" , value = f"{len(guild.roles)}")
embed.add_field(name = "Invite link" , value = f"{create}")
await ctx.send(embed=embed)```
My bot is not able to create invite
I tried coding it but I failed
Does it have the permission to create an invite?
@sick fable whats the error?
@sick fable whats the error?
@hollow sedge wait
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Guild' object has no attribute 'create_invite'
Error^^^
@hollow sedge
so i started learning this thing where you gotta be a dev to enable this command
i tried this
if message.author.id == 675359952679731200:
message.channel.send('This is Brace!')
else:
message.channel.send('This is not Brace!')```
it says error
could someone help please
@hollow sedge wait
@sick fable change guild to channel
it says error
@tribal siren whats the error
Hello. Is there any way I can prevent arrays from being this size or larger? [[], [], [], [], [], [], []]
@sick fable change guild to channel
@hollow sedge what?
@hollow sedge what?
@sick fablectx.channel.create_invite()
Kk
yw
@sick fable
ctx.channel.create_invite()
@hollow sedge What if I want to make it a permanent invite?
Like it should not expire
Anyone know how to get promises to work with loops in javascript?
I've tried but I just don't understand them. It doesn't seem to make the loop wait for its completion.
@sick fable
Hey how can we get all installed package list ? js
or just look through your node_modules folder
@earnest phoenix https://stackoverflow.com/questions/13981938/print-a-list-of-all-installed-node-js-modules
K thanks
np
@rough obsidian
?
how to set a color for an embed?
Discord.js? @tribal siren
Oh
isn't it something like: embed = discord.Embed(...color=discord.Color.blue())
Embed = discord.Embed(title = "Your title here" , description = "description here" , colour = discord.Colour.red())
@earnest phoenix that or simply make execute cmd in ur bot
Embed = discord.Embed(title = "Your title here" , description = "description here" , colour = discord.Colour.red())
@sick fable @tribal siren
oh
ok thank you
and since im here i also wanna ask how to code a footer
i forgot literally everything 
Oh
embed.set_footer(text = "Text here" , icon_url = author.avatar_url)
@tribal siren
ok thank you
@tribal siren Can we still get verified bot Developer badge now?
This is all under a single string. The newlines are always there and the Name:/Subject:/etcs are always there. The fields might have multiple lines and might contain the words below ^^
Any cheesy and smart way to split that?
thought of some loops with startsWith() and split('\n') with breaks but there has to be some better and more optimal way of processing that
@tribal siren Can we still get verified bot Developer badge now?
@sick fable im tryna get all that info i forgot so i am able to be worthy of that badge again
@sick fable im tryna get all that info i forgot so i am able to be worthy of that badge again :laughexpand:
@tribal siren
@sick fable no, also try not to spoonfeed
@sick fable no, also try not to spoonfeed
@restive furnace k
How do i get the bot developer role?
Someone use BDFD?
Cuz i want to know how to share a command
Because i dont see anyone with a casino full random command
(I've use special emote but i can change that for sharing this on the app)
How aprociatly does it takes before my bot get approved?
how much time does it take!
1 week prob
is there any way to add masked link in the footer of a embed in discord py?
get your bot approved here @rough knot
@opal plank Hmm, then still can we get verified developer badge or nah?
nah
you can't on footer
Bruhh
Wha-
is there any way to add masked link in the footer of a embed in discord py?
@obsidian tartan Lol nope you can't add it on footer
I didn't read your question fully
Yeah no markdown on footer.
sad
Hello, there are ping-reading problem. When I am using command !log(just print Message in console), ping looks cool. ID is right
@chrome perch
But.
When I trying to process it, I've got something like <@&740631545429229688>
I can see, it is role ping.. Why?
OMG
I am dumb ass
I am trying to ping Bot
So
It is bot's role ping
\\\<
Sorry

how do I put the server count on my bot's website
I know i can do it using posts requests
but i dunno where to start
can we make a bot that sends messages from my account instead of a bot acconut
can we make a bot that sends messages from my account instead of a bot acconut
@spiral crag that's a self bot and self bots are against TOS
Why?
Beacouse the Discord API is meant for discord bots ;-;
Yeah ik, but why did they ban self bots?

Since you can abuse the api in your favooooooooors
Abuse how? ๐ค
Like a spam reactions function, or bulk delete
I need ideas for a utility bot
Oh but aren't there already bots which have that function? Like !clear 100 or something
yeah
but doing it via self bot would not be very pleasant
oh and most certainly to gain more exp levels via something like MEE6 :p
Hmm, i don't know that much about discord's api, but i suppose regular users have more permissions compared to a bot as well
Oh, haha yeah there's the levelling abuse as well :p
yos
yyou can do big damage with a self bot
@abstract coyote my server was raided by self bots as they don't need someone with manage server perm to add them
yep
Dangg
I thought self bots weren't allowed?
Hey. I need to crate channel and set premissions overwrites.
var overwrites = new ds.Collection;
var memberPremissions = new ds.Permissions;
var memberOverwrites = new ds.PermissionOverwrites;
var everyoneOverwrites = new ds.PermissionOverwrites;
memberPremissions.add("READ_MESSAGE_HISTORY");
memberPremissions.add("VIEW_CHANNEL");
memberPremissions.add("SEND_MESSAGES");
memberOverwrites.allow = memberPremissions;
everyoneOverwrites.deny = memberPremissions;
overwrites.set(msg.guild.roles.everyone.id , everyoneOverwrites);
overwrites.set(clanData.memberRole.id , memberOverwrites);
console.log(overwrites);
msg.guild.channels.create(clanData.name, {type:'category', reason:'new guild', permissionOverwrites:overwrites});
sooo, there are error:
permission_overwrites[0].id: This field is required
permission_overwrites[1].id: This field is required
at RequestHandler.execute (D:\Projects\Maid\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:11828) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11828) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
And I really don't know what I have to do
hi, on my bot i wanted that we can see the warn of someone on every server but i wanted that it's possible to retire the warn only on the server where the warn was given. but the line to compare the guild's id of the message and the id of the guild in my db.json don't work ... can someone help ? it's the script and it's the 20th line that bug
const moment = require('moment')
Discord = require('discord.js')
moment.locale('fr')
module.exports = {
run: async (message, args, client) => {
if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send('Vous n\'avez pas la puissance de unwarn un membre (trop faible)')
const member = message.mentions.members.first()
if (!member) return message.channel.send('Impossible de unwarn du vide (trop bรชte)')
if (!client.db.warns[member.id]) return message.channel.send(new Discord.MessageEmbed()
.setDescription(`**${member.user.tag}** est clean (bien jouรฉ champion)`)
.setColor('#0082ff'))
const warnIndex = parseInt(args[1], 10) - 1
if (warnIndex < 0 || !client.db.warns[member.id][warnIndex]) return message.channel.send('Ce warn n\'est pas dans ma banque de donnรฉes (oups)')
if (message.guild.id !== `${client.db.guildid}`) return message.channel.send(`Ce warn n\'a pas รฉtรฉ donnรฉ sur ce serveur (triche pas)`)
const { reason } = client.db.warns[member.id].splice(warnIndex, 1)[0]
if (!client.db.warns[member.id].length) delete client.db.warns[member.id]
fs.writeFileSync('./db.json', JSON.stringify(client.db))
message.channel.send(new Discord.MessageEmbed()
.setDescription(`**${member.user.tag}** a รฉtรฉ unwarn. Raison : ${reason}`)
.setColor('#0082ff'))
},
name: 'unwarn',
guildOnly: true
}```
it's in javascript*
sorry for my english btw ... im french x)
Premissions overwrites objects looks like
Collection(2) [Map] {
'688755946624647238' => PermissionOverwrites { deny: Permissions { bitfield: 68608 } },
'768409949507551242' => PermissionOverwrites { allow: Permissions { bitfield: 68608 } }
}
@dense spruce please stop using a JSON database
hi, i got an error pls help
const commandFiles = fs.readdirsync('./commands/').filter(file => file.endsWith('.js'));
^
TypeError: fs.readdirsync is not a function
at Object.<anonymous> (C:\Users\Adwait Misra\Desktop\YesBot\main.js:9:25)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47```
Use Mongo B)
why ? @earnest phoenix
@earnest phoenix Sync is capital
can't .json databases corrupt easily?
why ? @earnest phoenix
@dense spruce read pins
nevermind it ain't in pins
its funny cause the only time i used a database was for a failed xp system attempt XD
yeah but as my bot isn't on many server it's not a problem ?
that should be the moto of Mongo
yeah but as my bot isn't on many server it's not a problem ?
@dense spruce cool, but what are you going to do when it will be in many servers?
Draquo its better to do it now than face the depression of corruption later
yeah ... ๐
C:\Users\Adwait Misra\Desktop\YesBot\commands\ping.js:5
message.channel.send(`Pong ๏ฟฝ๐ Latency is ${Date.now() - message.createdTimestamp}ms. AP
Latency is ${Math.round(client.ws.ping)}ms`);
^
ReferenceError: client is not defined
at Object.execute (C:\Users\Adwait Misra\Desktop\YesBot\commands\ping.js:5:122)
at Client.<anonymous> (C:\Users\Adwait Misra\Desktop\YesBot\main.js:29:36)
at Client.emit (events.js:314:20)
at MessageCreateAction.handle (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)```
how do i change the database then ?
first make a mongodb account
?
no
or MySQL but Mongo hotter
I am using JSON now for the test. But I am want to start using MySql tomorrow (I am using VPS and MongDB setup is too hard)
it is super easy to use
hi need help
C:\Users\Adwait Misra\Desktop\YesBot\commands\ping.js:5
message.channel.send(`Pong ๏ฟฝ๐ Latency is ${Date.now() - message.createdTimestamp}ms. AP
Latency is ${Math.round(client.ws.ping)}ms`);
^
ReferenceError: client is not defined
at Object.execute (C:\Users\Adwait Misra\Desktop\YesBot\commands\ping.js:5:122)
at Client.<anonymous> (C:\Users\Adwait Misra\Desktop\YesBot\main.js:29:36)
at Client.emit (events.js:314:20)
at MessageCreateAction.handle (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\Adwait Misra\Desktop\YesBot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)```
hi need help
@earnest phoenix https://dontasktoask.com
also only the first part of the error is enough
the other part is just the file path explaining where it occurred
discord should add a captcha to gifts...






