#development
1 messages ยท Page 1712 of 1
So I think URL class is redundant on this one
0 iq me.... i thought that there is another website for that, sorry
lol np
i don t use dblapi.js for my bot
i use topgg-autoposter
ah yes I need my token for X website, I probably need to check it on Y website
so if dblapi.js will not work you could try that module
What can bot vote do?
hey message.guild.channels.delete(channel1) returns Uncaught TypeError: message.guild.channels.delete is not a function
i thought that this was the v12 way to do it>?
so in my case: channel1.delete()
Yeah
okay lovely!
owh my bad, one last question.. how do i get someones id by just his username?
for example an array like this:
i want to get the ids of all the users in the array
Thing is username isn't unique
you could use find but if theres 2 users with same name only one will be picked
so it s not the best ideea
but if you need it try something like this
yeah just worth a shot actually!
guild.members.cache.find(member => member.user.username === 'Steve')
name or username
i think
xd
np
it's username.
np, i love you for the help you've given me!
ly2 bro
tell me if is working
member.user.username
i would just work with mentions, is probably a bit more reliable
sure names are fun, until you have 12 people with the same name in one guild
does language support on a discord bot actually make any sense?
If it's a big bot I guess
i have it, where a pain in the ass to setup, but it works sortof
but if the majority of users can read english, then no
some stuff i cant really localize like getting memes from r/memes
yea
hmm yeah i get the issue
issue for me is that some languages are built differently
1 last question before i fuck off
Didn't you use something like "WELCOME": "Welcome, {}!"
i support Bulgarian with my bot, did the first translation with google translate, and a friend of mine is Bulgarian who Proofread it
so i am foreaching the array to get all the users: . Defined to the variable names. Now i can just search by variable names right? Or should i foreach this too?
if you want sentences construction i guess i18n is helpfull
but i havent figured out how it works
also moving my existing translations over is annoying
so the way I currently do it is this
but some languages are different ex. changing congugations based on the subject
i do something like this, i just use string.replace and add placeholders to the translation strings
not the best way but it sort of works
private formatString (string: string, ...args: string[]): string {
return string.replace(/{(\d+)}/g, function (match, number) {
return typeof args[number] !== 'undefined' ? args[number] : match
})
}``` this is what I do
just gotta order them correctly
but one thing im a bit proud of is how i keep the translations updated. i have a github repo with the translations, and when the bot starts he downloads the translations from github and loads them into a map
anyone knows the answer?
It's 12
nah my code is open sourced idgaf
Ah, the rose one is OSS too? oh right you sent it to me iirc
almost all of my code is OSS
Use array.map() and client.users.cache.map()/fetch
I c
I don't really have any real reason to make anything closed sourced
its not like its amazing code
or new features
kay kay!
Forget about the fetch part, you only have usernames which is impossible to fetch with
then there is this https://github.com/Million900o/screenshotx
i know
i am searching differently
let p = haha.forEach(element => console.log(element));
const poom = p.map()
let k = guild.members.cache.find(member => member.name === `${poom}`)
console.log(k)```
what the fuck is this
very informative variable names lol
p: undefined
poom: undefined.map
k: finding a member named undefined
poom!
uhuh just figured that
but didn't i already define p to the foreach
owh so i should use the variable inside the function?
im not sure what you are attemptig to accomplish
i am trying to get the info inside the haha,foreach
in the console.log
yeah
so my question is, how can i define that info from the console.log to a certain variable so i can keep on using it
haha is already that info
console.log(haha) returns me:
you're just console logging each element separately
what do you need then
Because forEach just iterates through the array, it doesn't return anything
what the fuck are you trying to do
haha is already what you want
hi
const arr = [1, 2, 3]
// this doesn't work
const a = ...arr
// this works
const b = [...arr]```
this is what i meant.
the last one
that just copies the array tho...
thats making an array thats exactly the same tho
I don't think you know what you want ๐
I sure as hell don't
wait so i was told to map the array haha
so i can easily foreach it and get everyones id
however, i don't get how i can map it
it would just be: const p = array1.map(x => x );
as i want the whole names
that also clones it though
array1 is already an array with all the names in it... what do you want to with the names
get the IDs of everyone with the name in the array?
yeah exactly
a single for...of loop does the job
you don't need anything else
for (const name of array) {
// Find the user ID with the name somehow
}
const name of array?
I guess, depends on what they want to do with the id
you can use the WS operation and search by query
so that array is defined to haha
and i can then search by name with the variable names?
mhm
for (const names of haha) { let k = guild.members.cache.find(member => member.name === `${names}`) console.log(k) }
if i understand it right, it would be likes this.
member.user.username
why don't you just do js haha.map(e => guild.members.cache.find(member => member.name === e)).filter(e => e)
e
Then they'll have to loop through that again if they want to do something with each member individually
so what's the point
good point
okay it worked great
so i first wanted to add a role to the users whose id i just retrieved, but can't i directly add it to a user as i already have variable k defined?
nvm got it already
k is your Member
my bad for asking so much
k.roles.add
is there a way of passing events to another folder aswell as events?
@pale vessel js if (!userFetch || (userFetch == null)) continue this is some actual code I have
(() () () ())
How do I get my bot to recognize live music from youtube, and not make an error, use yt-dl | ytdl-core | ytdl-core-discord
He goes, but after about 5 seconds he stops playing
How can I get him to recognize it as live and not as a song
https://cdn.discordapp.com/attachments/655768412269838346/833409901195821066/unknown.png
yk, music stuff is hell by definition
Hmmm... so I have 2D coordinates, which are all 8 bits in size, and I'm curious what method of storing them would be faster / use up less memory:
- Using a single
Map, where the keys are the 2D coordinates turned into an 16 bit number (first 8 bits x, last 8 y) - A 2D array
can anyone help me on some code for my bot?
yours would be 0x1122
please?
Do you have 'audioonly' enabled in your ytdl options? Removing that will allow you to play streams fully
I use Lavalink so I can easily have something get recognized if it's a stream or not by using the .isStream property, and I'm pretty sure ytdl-core should provide a property similar to that
nvm
what's the best way to test a feature that requires 6 different accounts? make 6 accounts?
You could mimick accounts
But this depends on what "accounts" is and how easy it may be able to replicate.
{"d":{"guild_id":"537746810471448576","user_id":"326465432389287946"},"op":0,"s":21923,"t":"GUILD_JOIN_REQUEST_DELETE"} whats this event?
It's probably some internal event
never seen that before
Searching it on Google only brings up 3 results
same
@slim heart
maybe its something new
yeah all dated 1 week ago
One result from a month ago
well the content looks simple enough
Its a new undocumented event atm
but this indicates that somewhere is a GUILD_JOIN_REQUEST_ADD and a GUILD_JOIN_REQUEST_UPDATE
Someone says it's for membership screening
registerListener(event, listener) {
console.log(event, listener)
this.beta.on(event, listener, this);
}``` dosent allow the event to work, log returns `messageCreate [Function: messageCreate]`
well it dosent change anything
I'm interested in building a platform online. I believe I'll need to create a backend API and frontend for a website and mobile app (if I ever get there; each their own separate projects/repositories), but it's something I've never done before nor do I know where I would start. Does anyone have advice on where I should start to learn about it?
what do you want it to do, how do you want it to work, what language do you want to code in is stuff you need to ask yourself first
/**
* @brief on guild join request delete.
* Triggered when a user declines the membership screening questionnaire for a guild.
*
* @param _guild_join_request_delete User function to attach to event
*/
void cluster::on_guild_join_request_delete(std::function<void(const guild_join_request_delete_t& _event)> _guild_join_request_delete);
another undocumented event bites the dust!
what are you doing firefox ๐
not broken at all
probs from when i was trying to corrupt my memory in c++ and never restarted

bbasically invite delete but for those stage things
or wtf
not
bruh ok doge
hi
i need help
because I get argument "0" with the "1" on the onsled?
command is: !entregar julian julian96
let perms = message.member.hasPermission("MANAGE_GUILD");
if(!perms) return message.channel.send(':x: No tienes permisos.');
let user = args.slice(0).join(" ")
let clave = args.slice(1).join(" ")
// message.channel.send('**'+message.author.username+'** *Te respondo por privado!*');
message.channel.send({embed: {
color: 3447003,
title: ":zap: Entregar :zap:",
fields: [
{
name: "Usuario:",
value: ( user)
},{
name: "Clave:",
value: (clave)
}
],
}})
}```
You should get the value from the index alone rather than get anything after the index.
Aka instead of doing args.slice(x).join(" "), do args[x]
Understanding what Array.slice does is also important
How would the code look to achieve what I'm looking for?
https://i.callumdev.pw/hrmg5.png
Why are the first 2 case ids ALWAYS 00001, the second one SHOULD be 2? Every case ID after the first 2 go up just fine, with the 3rd one being 3, and so on
Does it make sense to have an API and database in the same project for a backend?
could be a public api
It may be a public API in the future, but right now, it's a project I'm developing with the API being private.
You're saving yourself some trouble by making the design how you intend it to be in the future
does anyone know why pm2 would be spinning up 65 instances of my process instead of just 1?
im trying to have it make a screen, and each time I do it instead of 1 i end up with it exponentially growing
i mean, the answer is pretty obvious no? if no length, set to 1. if length == 0 also set to 1. if length == 1 also set to 1, if length == 2 set to 2
was literally just missing () around length || 0, fixed ages ago ๐
Hi Tim
if anyone has used mongoDB decently
Is it possible to easily transfer db from atlas to localhost and vice versa when i need to? Or is it i need to stay with whatever i started with
does anyone know what this means??
Traceback (most recent call last):
File "main.py", line 288, in <module>
client.run(os.getenv('TOKEN'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 718, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 697, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 660, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 509, in login
await self.http.static_login(token.strip(), bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 293, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 209, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.
its written what it means lol
429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Shat
I wonder how big bots operate then lol
Same
by being efficient
mine was only in 38 Servers
big bots dont spam requests
i mean
mine doesnt ether
true i guess they can prevent it
nvm i just watched it request it 3 times in 2 secs
lul
if every msg send is a request, if most bots have a response for each cmd, i think some bots can reach up to 10k cmds per 10 mins
it requests 3 times ever 5 min
which is not a problem
the cap is 10k per 10 mins
the limits for sending messages are 5 per second per channel
per CHANNEL
each channel has separate limits
just make sure your bot doesnt spam the same channel
so its not 10k globally per 10 mins
what
the global limit is 50 per second
you use a webhost to host a dbot?
is it public
yes
u must hide tokens
regen ir
i heard .env is only visible for owners is that true
you cant see it unless i let you
also, the 10k per 10 minutes is invalid requests
true
aka requests that return errors, for example trying to send a message without having permissions
ohh that's good did you put the token there
which i can let you see it if i was to give you perms
yep
if you send 10k invalid requests in 10 minuts you will get banned for 1 hour
Shat
i mean the downside of replit is anyone can fork your code and steal it all
but the rest of the code
u using discord.py?
someone could just yoink the code and make their own bot and say its theirs
and use their own token
ye
the point isnt token security lmao
ik
dont worry, nobody is gonna steal your code
i just use .json for tokens 
idk i made it an open sorce So people can take it
the chances of someone stealing your code depend on:
- your code being actually good
- your code and your bot being popular or widely used
- people actually knowing what they're doing
3 Most people dont have that
exactly
dpy should do a lot of stuff themselves
people who steal code have no idea what they're doing
i make my code as ugly as possible
like they are the only lib i know of that still supports the dreaded ||selfbot||
i wouldnt call my stuff code
i use cogs bc most dont know how to use them
a lot of people copy code from open source music bots on github and then ask here why its not working
xd
why code say token not define
ye
"cant read property x of undefined"
"where/how did you define it?"
"i dont know"
If i was going to take someone else work i would change it to make it not see able to the naked eye or just give credit
yeah like botghost
I always encounter music clones in the bot queue
As well as BotGhost bots
So annoying
ghostbot ghosts
but im not an a hole
"Token Invalid"
"Did you enter in the token correctly?"
"Where do you get that?"
how can I get the result of different capturing groups of a regex?
asking to ask
"Anyone Online?"
Usually you can access it by the index
But this depends on the parser and the regex
const urlRegex = /((http|https):\/\/)(www.)?([a-zA-Z0-9@:%._\+~#?&//=]{2,256}\.[a-z]{2,6})\b([-a-zA-Z0-9@:%._\+~#?&//=]*)/gi;
const str = "https://www.google.com/google.png";
console.log(str.match(urlRegex)); // ["https://www.google.com/google.png"]
// I want it to be
["https://","https","www.","google.com","/google.png"]
how can I get the result of its different capturing groups?
.match returns an array of matches in the string, so all you need to know is what the array should look like and access it like one. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match for more info
The match() method retrieves the result of matching a
string against a regular expression.
.exec and .match work similarly, but .match should be fine in your case. .exec is not deprecated for the record.
If you're using Node.js, there's a built-in URL module I believe you can use to validate the URL as well (https://nodejs.org/api/url.html).
Just [...<Your string>.matchAll(<regex>)]
I believe your issue stems from adding the g flag
You have all of the parts after that
When the g flag is present, the entire string is returned. When it's not, the matches are there
then you can see the array parts
uh... but I will match it from strings such as "Hmm check this... https://google.com"
so I think g is necessary
Then prefix the regex with ^ and suffix it with $ so it forces the entire string to be just the url
then it won't match ._.
"Hmm check this... https://google.com"
ah wait... it still matches
after removing g
yeah
how about Lite's advice to use URL
Though, I very much recommend you use the built-in url module instead of writing your own URL parser
How To Put Imgur Images In Bot Description?
does it have option to return the domain?
uh...
@earnest phoenix If you're using markdown, do 
consnt { URL } = require('url')
Markdown?
URL is already imported in all scopes to my knowledge
ok... but can it search for a url from a string such as "Hmm check this... https://google.com"
You wanted to put an image in your bot description
The bot description supports markdown
So you can use that markdown I gave you
It's text that'll appear when the user hovers over it I think.
can I leave that blank?
probably
afaik it's the label. tooltip is [label](url "tooltip")
fixed my regex... time to start work...
In that case, probably not
Hm It Didn't work I Used
But it appears Like
are you sure the url it points to is correct + an image
That happens if the URL doesn't return any buffers resolving to an image
Hm
Means Url isn't correct?
Or the URL is just incorrect
well what did you put
it needs to be the direct link to the image
that's the link to the site
the actual link is https://i.imgur.com/H5PQ13Lh.jpg
notice the i. and .jpg
hm
is there a way to download images to a certain folder using requests in python
ok
how did u get that link?
right click the image and press copy image address
the text may differ per browser
how do you make that thing when you invite a bot that on the permissions it says:
ready you a story
?
wdym
Guys I wanna make a toggle command that disables or enables commands for a specific server in discord.py, can someone help me?
how do i add that to my own bot
sure
do you want a channel by id?
yaa
not the channel
I want the guild id
ok
to disable commands for a specific server
what code do you have now?
wait I'll send it to u in 5 mins bro
ok
@earnest phoenix Yo
@commands.has_permissions(administrator=True)
async def(ctx, * , command):
command= client.get_command(command)
if command is None:
await ctx.send("I can't find a command with that name!")
elif ctx.command==command:
await ctx.send("You cannot disable this command!")
else:
command.enabled = not command.enabled
ternary = "enabled" if command.enabled else "disabled"
await ctx.send(f"I have {ternary} {command.qualified_name} for you!")```
here's the code
first of all you can't have
async def(ctx, *, command):
you need
async def [command name](ctx, *, command):
Lol I forgot to do that
@earnest phoenix aight then after that?
make
if command is none
to
if command == None:
still the same thing bruh
BRUH -_-
if you still can't figure this out dm me tomorrow bc rn its 1:20 am here
oof okay np
1|run | (node:21696) UnhandledPromiseRejectionWarning: Error: Undefined binding(s) detected when compiling SELECT. Undefined column(s): [guild_id.guildID] query: select `name`, `channelID`, `ownerID` from `category` left join `guild_id` on `category`.`ownerID` = `guild_id`.`id` where `guild_id`.`guildID` = ?```
I understand that the column **guild_id.guildID** is undefined, but it exists ...
Hey, I have a Question:
I'm creating a Reddit Bot with Python/discord.py/praw. But how do I enable an NSFW Filter - or a Safe Search?
you can
how?
You cannot
Discord randomly chooses a phrase and puts when you need to check what permissions to your bot
(name=f"Guilds | {len(bot.guilds)}")```
what for the members in server?
users = 0
for guild in bot.guilds:
users += len(guild.members)
print(f"Members | {users}")
ok
Sorry, how can I set the title and description of an embed from discord via command?
emb = discord.Embed(title="The title", description="The description", Color=discord.Color.blue())
exports.run = (client, message, args, ops) => {
const Discord = require("discord.js");
if (message.author.bot) return;
message.delete();
const embed = args.slice(2).join(" ");
const title = args.slice(1).join(" ")
const embedembed = new Discord.MessageEmbed()
.setColor(`#ff9e00`)
.setTitle(title)
.setDescription(embed)
.setTimestamp();
message.channel.send(embedembed);
};```
i use this, but it print in title the desription
const title = args.slice(0).join(" ") takes all the args and joins them
slice(0) slices nothing
I think you were just trying to get the first array element, probably?
[0] to access that...
like literally just args[0]
also there's a typo
message.channel.send(embed=embed);
it shld be dis in the end
this is not python
ik but js doesnt hv dat ?
If you do'nt know JS please don't try to help
um ok
I want to do for example: f! embed hello (the title) hello (the desription), but it print hello hello (the title) hello (the description)
you want to make an embed maker command?
yes
oh
or do f! title hello then f! description hello and then f! send

instead to put spaces in the title? I thought with _ but how do I get it removed? @umbral zealot
use replace()
.0.
you're replacing it with nothing
did you even try to read the docs on string.replace?
smh
no .-.
So start with that
The replace() method returns a
new string with some or all matches of a pattern replaced by a
replacement. The pattern can be a string or a
RegExp, and the replacement can be a string or a function to
be called for each match. Ifย patternย is a string, only the first occurrence
will be replaced.
thanks, it work
<div class="taak0c-4 dcumgc">
<img src="../assets/imgs/ModerationLogo.png">
</div>
<div class="taak0c-5 kzFnqY">
<div class="taak0c-6 kpvzAk" href="/" >Moderator</div>
<div class="taak0c-7 cXZMsb">Power up your serever with cool moderation and automations!</div>
</div>
</div>``` if i use `href` to redirect it never will redirect anyone know?
href only works on the <a> element
what can i use on a div?
pretty much just class and style and id
divs are the "generic" element, you shouldn't use them for everything
it's always best to use the closest semantic equivalent
i added this an it worked so i guess this will do js <a href="/"><div class="taak0c-3 djzcKk"> <div class="taak0c-4 dcumgc"> <img src="../assets/imgs/ModerationLogo.png"> </div> <div class="taak0c-5 kzFnqY"> <div class="taak0c-6 kpvzAk">Moderator</div> <div class="taak0c-7 cXZMsb">Power up your serever with cool moderation and automations!</div> </div> </div></a>
@bot.event
async def on_ready():
print('Bot is ready!')
await bot.change_presence(activity=discord.Streaming(name=f"Members | {len(bot.users)}", url="https://www.twitch.tv/garuda0007", description="Use !help to start."))
await bot.change_presence(activity=discord.Game(name="Managing Garuda's Server!"))```
How do i make this in change in within 12 sec.?
Code:```JS
let invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
console.log("Used invite :" + invite.code + " by " + invite..inviter.username)```
guildInvites returned : https://pastebin.com/raw/KdxeZ91H
But he tell me cannot read property invite.code, how can i do?
what should I replace it with?
anyone know what does this called?
a > b ? a : b
ternary operator
thx
@umbral zealot how can i resolve this?
uhhhh ... no idea man, maybe... show us code?
I can't magically guess wtf you're doing here darling 
exports.run = (client, message, args, ops) => {
const Discord = require("discord.js");
if (message.author.bot) return;
message.delete();
const embed = args.slice(1).join(" ");
const title = args[0].replace('_', ' ')
const embedembed = new Discord.MessageEmbed()
.setColor(`#ff9e00`)
.setTitle(title)
.setDescription(embed)
message.channel.send(embedembed);
};```
Also what you mean by "Resolve this". I can't guess what the problem is either.
sorry
Okay
{ "userid": "", "reps": ""}```hey, how can i push a certain userid into this file using fs?

already done
Hi, i have a issue
Imagine that i have message 1 and message 2. I want that my bot send messages 1 and 3 seconds later edit it and put message 2
How i can do it
I feel like you've been asking the same question for the past few months
That sucks
Literally should have been able to do this day 1...
@eternal osprey you should really be learning more js, not just relying on people here for your issues
I mean... look I'm going to be rude and condescending here but I have to: @eternal osprey if you've been struggling with extremely simple json read/writes for 8 months, just... stop. Not just json, but programming in general. You're not made for it.
I've literally never seen someone struggle with such a simple concept for so long.
Actually tbh it's even longer than that since 8 months ago you claimed you tried to make one in the past, before that even. This is just... scary.
^
TypeError: Cannot read property 'url' of undefined
That probably indicates that the message didn't have any attachments.
attachments is for message attachments though
if you want a URL you sent in a message, just get your message.content
^
TypeError: message.content is not a function
direct?
request(url, async function(err, res, body) {
if (err !== null) return;
```
not working
strings do not have a "url" property
huh
Hello can anyone say why my bot is not responding it's offline but it's hosted
:/
No responds
we cant say why your bot is not working
you have to check that yourself
open logs, look for errors
There is no error
did u run the file on your host
your* :^)
wow
https://replit.com
I did
Console
what does the console say?
did u restart after the fontconfig error
well then it seems u still have a fontconfig error cuz its still the latest entry in your console
:')
Hmm there is no way to fix that I thonk
i want convert this
for(var i = 0; i < message.embeds.length; i++){
if (message.embeds[i].title.includes("test") || message.embeds[i].title.includes("test")) {
if (e.image) {
let url = e.image.url;
request(url, async function(err, res, body) {
if (err !== null) return;
without embed
i try message.content or attachments
but not working
anyone help me plz
I think my bot is dead
i meant Shark but ok
lol
what are you trying to do? that code makes no sense
why a loop inside a loop
Discord.js
add client.on("debug", console.log)
to your code
and restart the bot
Where?
see what the console says
yes
429 hit on /gateway/bot?
that means you're temporarily banned
Why
you did too many invalid requests
Need a quick info regarding webm-usage on embeds: I assume they're not working the same like gifs do right?
What u mean?!
animated webms to speak
invalid requests: requests that were rate limited because you sent too many at once, requests that caused errors because you dont have permissions or similar, requests to things that dont exist, etc...
usually it lasts for 1 hour
you have to turn your bot off and wait
no need for array()
Owo sunucunun linkini nerde bulabilirim
?
@drowsy crag in multple channels
see
^
TypeError: Cannot read property 'url' of undefined
well im not sure why you are trying to get message.content.url because that is a string not an object
tรผrk ๐
@earnest phoenix #general-int
okey. i am sorry
Ment : Where can I find the link of the Owo server
๐คฆโโ๏ธ ๐
use message.attachments but it will only fire on edit iirc
no response
request(url, async function(err, res, body) {
if (err !== null) return;```
i still dont get what you're trying to do
how about you explain what you want and show the full code?
please learn basic javascript
no like
I mean
https://github.com/pgamerxdev/projects/issues/11
Doesnt have a banner like this
say I send "aaaaaaa https://i-think.berry-is.gay/5inNBcI3"
url: "aaaaaaa https://i-think.berry-is.gay/5inNBcI3[object Object]"```
but that repo does
oh
see
wait wha
hmmm
its probably discord caching
Ohh
@quartz kindle i want this ``` let url = message.embeds[0].image.url
url/attachments
got it?
message.attachments.get(attachment_id).url
this?
no
you can do message.attachments.first() which is the same as [0]
weit
anyone else's bot sometimes gets a "Connection reset by peer" error when someone uses a command?
message.embeds.forEach((e) => {
for(var i = 0; i < message.embeds.length; i++){
if (message.embeds[i].title.includes("avatar") || message.embeds[i].title.includes("avatar")) {
if (e.image) {
let url = e.image.url;
request(url, async function(err, res, body) {
if (err !== null) return;
imghash
.hash(body)
.then(hash => {
let result = db[hash];
if (result === undefined) {
embed
.setTitle("image not found")
.setDescription("sed");
return message.channel.send(embed);
}
```
i want this without embed
understand ?
You don't get coding. You write coding.
@quartz kindle and i want to remove this line
for(var i = 0; i < message.embeds.length; i++){
if (message.embeds[i].title.includes("avatar") || message.embeds[i].title.includes("avatar")) {
if (e.image) {
let url = e.image.url;
then just do message.embeds[0].image.url?
this? ```js
if (message.author.id == "id") {
let url = message.embeds[0]?.image?.url;
request(url, async function(err, res, body) {
...
})
}
hahahaha rly? XD
and someone here also decided to name all his variables after emojis
What will happen after my bot reaches 100th server?
posted this like 2 days ago in #memes-and-media
you'll have to verify
Nice
i never go in media to be honest ๐
Similar to Brainf*ck, Befunge was developed by Chris Pressey in 1993, with the aim of creating a language that would be as hard to compile as possible. He does this by implementing self-modifying code and having the same instruction being executed in four different ways, not to mention the instruction set itself. However, a number of compilers were eventually created. Below is the source code for โHello World!โ:
> v
v ,,,,,"Hello"48*, v
v,,,,,,"World!"25*,@
thats even worse then brainfuck
self-modifying
tricky af
float away;
long long ago;
char coal;
hahaha
my favorite esolang is chef
Cow lang is also stupid
esketit is better
Guys how to get a boolean that says if a role has a certain permission in a certain channel?
ever seen the Piet code ?
Can I invite it to 100 servers from alt?
oh i wouldnt do that
Why
a discord server altho not owned, still is a private server
i got spanked for this too
.....oH
inorganic growth and suspicious growth
And people wonder why the dev badge was removed 
What if a random guy invites em to 100 servers
same
yeah i can see why
dosen't matter who
If they have same user set then it's sus
That Stupid Things ._.
._.
Just don't try to fake it, let it grow like it's supposed to
just make a good bot, problem solved
all bots have awaifu pfp (at least 80%)
i think we need a new set of bot rules called The Ethical Discord Bot Etiquettes ๐
he he
@dusky sundial
?
Discord tos will handle that themselves :)
Code:```JS
let invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
console.log("Used invite :" + invite.code + " by " + invite..inviter.username)```
guildInvites returned : https://pastebin.com/raw/KdxeZ91H
But he tell me cannot read property invite.code, how can i do?
Well, luckily we don't have anything to do with Discord verification so
console log invite
Well that's your problem
yes
The find function did not find any value that matches the predicate
bruh i mean without embed like normal msg
._.
lol ...
what normal message?
like https://cdn.discordapp.com/attachments/272764566411149314/833691749704007680/Screenshot_20210419-134608_Instagram.png
@quartz kindle
like attachment?
what lib
wut
discord.js?
yup
like i said, message.attachments.first().url
it works with attachments
but not working with attachments link
what attachments link?
you mean if you send a link in the message content as text?
on discord.js-light, channelCache is off
on MessageUpdate event do you know the message.pinned property?
https://cdn.discordapp.com/attachments/272764566411149314/833691749704007680/Screenshot_20210419-134608_Instagram.png
like
what do you want to do
this link automatic changed to image
message.embeds[0].url
old message no, new message yes
okay thats good
How would i make a command in discord.py which tells me when my bot is added to a server
he didn't work with attachments link/image link
Is there a way to get a boolean that returns if a certain role has a certain permission in a certain channel? (e.g: @everyone has the send messages permission in #development )
message.attachments.first().url
i want both

I get so triggered
, when I see people with bot avatar 
bot avatar 
@plain holly hello carlo
if you are talking about carl-bot, they are using google blobs
?
Hi guys how do i change the amount of points the bot gives for a right answer and how to set it were if 5 ppl answer only the first one is accepted
u can go two ways
either u go per user or the total point divided by total user
since they all give the right answer i would personally go per user
else ppl lose interest in ur game
bot+
coz in their eyes, they also gave the right answer, the satisfaction from that response must be given ๐
its simple behavior code ๐
@cyan path
if you setup a game, make sure to have it fair, ppl and games.. they go nazi on ur ass with that ๐
Ok what are the commands for i did this Trivia score-5
did u make the game urself ??
Oh i need to say im not hosting the bot i just invited it
ok? ๐
go to support server
they are talking about a bot
lol got it XD
@rustic nova -wrongserver moment
-wrongserver @cyan path
@cyan path
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Get Support" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server or you were banned from the bot's support server, then we can't help you. Sorry :(
How can I make a command which work in dm too
humm ok
well first we need to know what library u used
Discord.js
ok, then the library has (im sure) docus on that
i dont do js myself
i do dotnet ๐
Out of the gate djs should let it work on dms unless you do something to prevent it from happening.
All messages go to the same event, including dms
in the dotnet version, messages come one class, however they can be casted into DM variant if that was tested by Type
dunnow how js does that
Js doesn't have types.
aha
If (Not arg.Channel.GetType Is GetType(SocketDMChannel) so nothing like that would even work ?
open DM channel
it is js if (message.channel.type == 'dm') { //code } in js
You can do something simular, just not using types, just a property.
so u get a string that determines the type, lots of things are string stated
yeah
Pretty much everything is.
.type is property of Channel
fascinating
Channel can be TextChannel, DMChannel
yeah, i assume the API must be similar in some way, just the form of it is different
or you can do ts instanceof (TextChannelDm)
instanceOf ...aha, so js does have a mechanism for this
What would you choose to build a website from React, svelte, vue, angular, or just expressjs with some ejs? 
typeof is for primitives, but instace of works on classes
yeah i know that
but js can indeed check if someone is from a class
there is typescript btw
so js is not a true OOP
if you don't know
hi @opal plank
hi @crimson vapor
hi @pale vessel
Why I get this again and again
well that didnt last long
hahahahaha

I waited for hour
you are spamming the api for some reason
429 is being ratelimited
yes you need to wait longer
check ur headers to see how long you need to wait for
So I should stop the bot?
Where?
erwin
any request u make to discord will return headers
thats too advanced
@earnest phoenix just wait or close the repl and reopen it
Ok
also fix ur code before running it again
I did re-open but same
you are spamming the api
you wouldnt get ratelimited otherwise
Breh
Hmm
429 means ratelimited, or that you've requested too much.
Oo
discord just doesnt randomly selects a bot out of thousands and say F you, im ratelimiting you for the next 4h
You were explained this morning... #development message
so theres definitively something in your code spamming it
Yeah
Stop your bot, catch your errors, make better code.
isnt that limit tim mentioning on the 10's of thousands rate per day?
iirc the cap is 10k error's a day
not sure, could be
I wonder if it has to do with the command they have called nuke.js
10000 invalid requests on 10 minutes ===> bot will be disconnected for 1 hour
theres that one which i pointed
but i think theres another one per day
or used to at least
Breh my bot turns on automatically if I turn it off and close the repl
do you have the hacker plan?
Now my command is working on dm but not on channel
show what you got so far
client.on("message", message => {
if(message.channel.type == 'dm'){
if(message.content === "dm"){
message.channel.send("oook")
}
}
})
So can I do else
you only send a message there if its a dm, nothing else
yup, OR
you can use the OR operator ||
np
https://js.evie.dev/conditions#conditions-can-be-combined for more details and examples
^^
I opened your main site and my browser want responding 
Bye
Always on repl, there is an option
Ok
sounds like a browser problem
I use the latest build of edge dev 
ยฏ_(ใ)_/ยฏ
Anyone know how to convert an svg animation into a gif?
do you have the svg image as a link, as a buffer......
One message removed from a suspended account.
It's a file.
are using js?
Yep
Rust is bullying me... the function is returning an Option but the compiler disagrees ๐ญ
Needed an to take an SVG and individually grab frames of the same SVG and place them into an animated gif. This lib simplifies it to await gif.addFrame(svgString, delay). The SvgGif util below simplified the use of gif-encoder, convert-svg-to-png, and png-js. const fs = require('fs'); const GifEncoder = require(
Thanks
What is the return type of the function you're in
whats the code? lol
Index.js?

