#development
1 messages · Page 1225 of 1
just change it to your bot's id after it's approved
ok BOOMER

Is VBA part of .NET
yes
yea
yes
how the hell did cry come up at the perfect time
that's because @earnest phoenix
Mobile logo
Why are you usung fucking members+ ripoffs
he made it
Yeah yeah
@earnest phoenix You need serious help
Ripoffing Members+ completely doesn't make you a good bot developer
Hello, can someone tell me how to make my bot send a message when someone votes for my bot?
Hello, can someone tell me how to make my bot send a message when someone votes for my bot?
@earnest phoenix #topgg-api
he never said he's a good developer
yup
chill out man
but still
poor guy
users+ has great potential
Let people do their own thing
this bot called my status ad ACTUALLY GIVES A FUCK about servers
i need help
my bot responds to other bots
return``` where shall i put this code in my index.js?
That's Python code
You'd need to convert it into JS code and enter in the message event
That's Python code
@slender thistle i typed it out as pseudocode
stop the code if the author is a bot
Quick question, I applied for discord partnership and want to give a DM when the server review staff joins to check the server however I don't want to DM everyone who joins in this period, so is it possible to only DM a user if they have like the Discord Staff badge?
How would I go about doing this ?
Hey guys how to make @mention bot and it send prefix
Quick question, I applied for discord partnership and want to give a DM when the server review staff joins to check the server however I don't want to DM everyone who joins in this period, so is it possible to only DM a user if they have like the Discord Staff badge?
@undone carbon whyyyy
They're just people
Hey guys how to make @mention bot and it send prefix
@clever vector just check if the message contains a mention for your bot, and if yes then you can send the prefix
@slender thistle if message.author.bot return; Where shall i put this code? I have discord.js not python
oh my god
In your message event
- put it in your message event
- consult your library's documentation for the correct bot boolean
@slender thistle I have more than 11 message listeners lol
Quick question, I applied for discord partnership and want to give a DM when the server review staff joins to check the server however I don't want to DM everyone who joins in this period, so is it possible to only DM a user if they have like the Discord Staff badge?
@undone carbon There's a possibility that they won't join the server at all so it's a bit pointless
why do you have so many message listeners @sly dawn
@earnest phoenix a long story, i will put the code on each message event
oh my god
Bad idea
Dont worry
WHY mY Bot uSe So MuCh RaM whY PinG so High
You'll have to enter the same snippet in all 11 listeners...
I understand that, however, our server is community gated which means only verified members have access to the full server, I asked the community team beforehand if community gated servers are eligible for partner and they said yes. However, the partner description is limited to like 150 characters and we weren't able to explain things.
imagine having copy-pasted code in all 11 listeners, and you just found a bug that's in the repeating code. you'd have to edit the code 11 times to fix the bug
@undone carbon discord staff has a brain... they'll figure it out
I hope that makes more sense
@undone carbon discord staff has a brain... they'll figure it out
@delicate zephyr yeah, they're people
@undone carbon discord staff has a brain... they'll figure it out
@delicate zephyr fuck no they don't have a brain they've got CPUs
realistically you should have a channel explaining things when they join anyway
Haha
so you shouldnt have an issue
imagine having copy-pasted code in all 11 listeners, and you just found a bug that's in the repeating code. you'd have to edit the code 11 times to fix the bug
@earnest phoenix it's not only that, you take a huge hit on performance
@earnest phoenix it's not only that, you take a huge hit on performance
@earnest phoenix yeah
because the bot has to run the functions 11 times
and probably only one actually gets executed for a longer period of time
one message listener with a switch-case would have better performance than 11 listeners checking for individual commands
yeah
I just updated my bot's code
cool
(prefix)say title with 1 or more words (end of title, for example character "|") text
Someone who could help me with this?
Say command that looks like this.
you split the string by "|"
^
but first substring out the prefix
and the word say
@modest plaza do you use discord.js or discord.py or smth
discord.js
k
show the command handler
the bot.on("message">: shit
screenshot the first few lines
give me a second, im playing leauge rn.
lmao
discord staff is widely known for not having a brain tho
Can anyone make the mention bot it give prefix?
Can anyone make the mention bot it give prefix?
@clever vector https://dontasktoask.com
@clever vector do you seriously not get it that we're telling you to learn stuff before trying to make a bot
It got an error
discord bot development NEEDS you to have a good understanding of programming
See pre-last pin
Can anyone make the mention bot it give prefix?
@clever vector Can you elaborate?
when someone pings bot it tells them what is the prefix
😞
its literally ```py
if ctx.guild.me in ctx.message.mentions:
await ctx.send("prefix is fuck!")
and we literally spoonfeeded him code earlier yet he still doesn't get it
some people think by learning a smol thingy they're a god of programming
I've got hundreds in my programming server
Dillon, I assume you have a custom prefix feature?
is anybody have nsfw api
I don't have a bot
is anybody have nsfw api
@dull badger but why
bcs i cant find api 
why an nsfw one
reddit api exists
Dillon, I assume you have a custom prefix feature?
@slender thistle we're talking about @clever vector
bcs im doing nsfw command.
why an nsfw one
reddit api exists
@earnest phoenixjust take posts from r/hentai lol
@dull badger
https://google.it/search?q=reddit+api
@dull badger use reddit api lol
virak is now playing clash of clans, hes done trying to code
completely ignored us
the
bot.on("message">:shit
@earnest phoenix You mean this?
client.on("message", async message => {
const prefix = ".";
if (message.author.bot) return;
if (!message.guild) return;
if (!message.content.startsWith(prefix)) return;
if (!message.member) message.member = await message.guild.fetchMember(message);
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
if (cmd.length === 0) return;
let command = client.commands.get(cmd);
if (!command) command = client.commands.get(client.aliases.get(cmd));
console.log(command)
if (command)
command.run(client, message, args);
});```
yeah
You were trying to make a say command that takes <title> | <content> ?
You were trying to make a say command that takes <title> | <content> ?
@warm marsh Yeah
What do you need help with inside the command?
how to make it
that's it
he asked how to make it
Yeeeee that's a hard pass for me
If I were to create a command like that, I'd manipulate the args array by joining it by spaces then splitting it by the separator (ex. "|"). Then say[0] = title and say[1] = content
Joining the args array as it should already be missing the prefix and command name.
So far, I've done it this way.
let title = args[1]; let text = args[2];
if (args[0].toLowerCase() === "embed") {
let sayembed = new RichEmbed()
.setTitle(`${title}`)
.setColor("#576bff")
.setDescription(`${text}`)
.setTimestamp();
const esayMessage = args.join(" ");
message.delete().catch(O_o=>{});
message.channel.send(sayembed)
} else {
message.channel.send(args.join(" "));
const esayMessage = args.join(" ");
message.delete().catch(O_o=>{});```
RichEmbed
v11
Not entirely true.
const {RichEmbed} = require("discord.js")?
Uhhh yea
It might be defined like const {RichEmbed} = require('discord.js');
Yeah
Not following industry standard will getcha in a lil' bit O' trouble
Not following industry standard will getcha in a lil' bit O' trouble
@earnest phoenix What trouble?
we wouldn't be able to fully understand your code
Oh, sorry then.
I mean, it's technically preference
yeah but still
please upgrade
How can I get a Bot developer role?
@earnest phoenix By getting a bot approved
yep, np
What?
The bot command channel?
yea
Mine specifically is t+
?
:print/hello world ,that
print("You mean this?")
Yes
Well that works everywhere
I only know basic python i don't seem to remember how to tho
Then you could refresh with reading through the docs or some course
I read a book
I want to get information about how to add my bot to discord bot list server.
@earnest phoenix @warm marsh ```js
if(args[0].toLowerCase() === "embed") {
if(message.content.includes(";")) {
var title = message.content.split(";")[0]
title = title.replace(".say embed","");
var text = message.content.split(";")[1]
var sayembed = new RichEmbed()
.setTitle(title)
.setColor("#576bff")
.setDescription(text)
.setTimestamp();
const esayMessage = args.slice(1).join(" ");
message.delete().catch(O_o=>{});
message.channel.send(sayembed)
} else {
return;
}
} else {
message.channel.send(args.join(" "))
}
}
}``` This one works fine.
How do I add my bot here? I want to know how many servers it has.
<@&304313580025544704>
-atmods
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
-faq 1
sigh
You can also figure out how many servers your bot is in without adding it here
wheres the raid?
oh wait, just another atmods :/
@green kestrel here -> ❤️
one day, someone will actually be doing one of the things that youre supposed to atmods for, and we'll all ignore it thinking its one of these 😄
like that age old proverb the boy who cried atmods
😄
Yeah
common prefix
How will I find out how many servers my bot is on?
By reading the client's guild count.
how?
The description of the client object's properties is in your library's docs
Or are you using the Discord API directly?
@last valve which library are you using
I want to know how many servers my bot is on, except that my bot has been approved
discord.js
glitch
<Client>.guilds.cache.size
what
@last valve did you actually coded this bot
I'm sorry I don't understand much of what you're saying.
The only dream I made while building this bot was to have my bot verified and have a verified bot developer badge.
They don't do badges anymore iirc
I want to know how many servers my bot is on.
I want to know how many servers my bot is on.
@last valve https://discordapp.com/channels/264445053596991498/272764566411149314/752870443484053505
@last valve you can't get badge anymore
I did not understand what you said
they stopped to giving badges
Discord's decision
:/
doesn't matter
So what if we make boots now?
The only dream I made while building this bot was to have my bot verified and have a verified bot developer badge.
@last valve Your bot can get a verified badge that's more nice
discord.gg/discord-developers
Check discord-api-announcements channel
your bot can get a tick but you can't get
Even if my bot is approved, can't I get the badge?
pff thank you
So, as of today--August 19, 2020--we are changing the “Verified Bot Developer” profile badge to the “Early Verified Developer” badge, and will not be granting it to anyone who submits for approval after today. If you have already submitted your application, you will still receive the badge.```
so how will i learn how many servers are
oml
I say man, how can I find out how many servers my bot is on. Why are you twitching?
"why are you twitching"
Smh
@last valve to make a bot you need to be able to program. Usually, unless you use discord bot maker or dbd or similar
What is your programming experience? A bot is not a wise idea for a first project.
yes it is
Unless you leaked it yourself
lol
hehe
You know, tokens should be able to be regen'ed via API
queue.tracks.map((track, i) => {
if (i < 25) return `#${i+1} - ${track.name} | ${track.author}`
}).join('\n')
it will be
#1 asd | asd
but i want to use as
#1 asd | asd
pls help me

background = Image.open('levelupcard.png')
how can i open images? using PIL in discordpy?
Depends on what Image is. A lib? Is it an obj in the lang?
Depends on what
Imageis. A lib?
@faint prism he's trying to use PIL so I'm not sure if he uses Pillow or PIL
you should be able to do that without issues
but PIL might not have support for it
first of all, remove PIL and install Pillow
second of all, check if you have the from PIL import Image import
ok 1 sec
have a question about fs write
how can i write in a array
I have a config.json file and there is an array as example named banneddgld
and there i want to add the banned gld
You can serialize it to JSON which is a string, and write the string to a file
@tired panther However, if it is something you will be modifying, a database would be a better idea
but thats just a small data
What is it's use?
to ban a guild
So you want to hold information for "banned guilds" in a json file?
yes
and update it to add new entries?
yes
That's definitely something for a database. JSON can mess up and can boom every banned guild entry is gone
You'll want a lightweight database system
it is just 1 guild i want to ban
but you said you want to add more
This is a design choice. I recommend a database management system, not JSON to store mutable data
Serialize from object -> write to file
Deserialize to object <- read from file
can i resume PIL code for pillow?
what
Pillow uses the same PIL imports since it's a fork
just uninstall PIL and install Pillow
no need to change anything else
unless your code is borked
Serialize from object -> write to file
Deserialize to object <- read from file
@faint prism I have no Idea , how I should do that.
You need to google how to read a file to a variable, and how to deserialize it
And vice vera
I can only describe what you need to do since I'm now allowed to spoonfeed code
🤣 okay thx
np. Again, don't recommend what you're trying to use JSON for.
I use mongo db , but when there is a slow connection , then it have to wait till the data comes
otherwise I could use asynchron db
don't fetch big amounts of data at once, use a cursor to obtain data asynchronously
and cache frequently used data
(since mongodb doesn't have a cache itself)
dot dot dot
just uninstall PIL and install pillow as he said
no need to change anything else
^
i had pillow
i have a levels thing
but when i import it the whole bot slows down
its using mongo db
?
it's python, right?
yea
1 sec
ok
so its the level cog
100%
ill try to move the cpde
well its working
i think theyres something wrong with the cog file
btw, cog file?
yea?
just a question: why?
why should i not use cogs?
like, I'm not THAT experienced in python, but isn't cog code generation stuff?
It's a discord.py thing where cogs are separate classes containing event listeners and commands
Usually done through completely separate files
ah, I thought it was another thing
anyway, is your bot slow to answer or to retrieve data from the DB?
How can i grab the user's profile badges? I never managed to make my system work...
what lang and lib?
Discord.js v12
how can I launch puppeteer specifying the path of chromium ?
nvm it's executablePath
How can i grab the user's profile badges? I never managed to make my system work...
@velvet bluff you can use User#flags to obtain any profile information available to the bot
thanks, ill read more on the documentation
how do I make welcomer message (d.js)
@velvet bluff also, UserFlags#serialize() is useful if you need to get a list of everything without much hassle
alright, thank you again! gotta read more to understand fully that argument
you can try it out actually, pretty much just makes it into a true/false list
alright, ill set up a testing bot and will test out these things, thanks again
how can i limit my send embed to only 10 countries?
here's a fun challenge if you're bored, go make a program that posts webhooks from DSL/DBL votes into a discord webhook by formatting it automatically
damn, so its not Veld's fault?
how do I make welcomer message (d.js)
@woeful pike any constraints?
do it in a new language that you're not comfortable with
uh, what can be considered as an "uncomfortable" language
up to you
@ancient nova guildMemberAdd event
how do i limit me embed to only 10 countries that are being sent?
bonus points: do it in JSFuck
onst title = '**Countries/cities ranked by weather type**';
async function get_weather(options) {
return new Promise((resolve, reject) => {
weather.find(options, function(error, result) {
if (error) reject(error);
else resolve(result);
});
});
}
async function get_data(locations) {
return Promise.all(
locations.map(
location => get_weather({search: location, degreeType: 'C'})
)
);
}
async function get_location_by_skytext(text) {
text = text.toUpperCase();
let result = await get_data(locations);
result = result.flat();
return result.filter(entry => {
return entry.current.skytext.toUpperCase() === text
});```
@sonic lodge welcomer message for when someone invites my bot to their server
haskell might be an uncomfortable language for you but it wouldn't for me
flex
then guildCreate

well I don't know haskell so ¯_(ツ)_/¯
@sonic lodge alright
great, it's an uncomfortable language
just saying it would be a good excuse to learn a new language
no-one?
await get_data(locations.slice(0, 10));
uhhm i have put in let result = await get_data(locations.slice(0, 10));
but it only returns me 1 array
anyone?
how to install the new version of nodejs on Debian 10 (64 bits)
Go to the node.js website it may help
async function get_data(locations) {
return Promise.all(
locations.map(
location => get_weather({search: location, degreeType: 'C'})
)
);
}
async function get_location_by_skytext(text) {
text = text.toUpperCase();
let result = await get_data(locations.slice(0, 10));
result = result.flat();
return result.filter(entry => {
return entry.current.skytext.toUpperCase() === text
});```
why is this slice method only giving me 1 array?
idk
okay, thanks!
I think you have only defined one array?
no.
how many?
there you go
like 68 arrays
lol
ok
For me i re write the code
do you even code bro?
yes
cuz the only thing that i have been hearing was shit?
sorry for the bad language.
ok chill
what does return 1 array mean, Promise.all returns one array
it does not work 
What does that error means? https://srcb.in/87bcdbd7d2
@wicked pivot
use nvm to get latest node v then reinstall npm modules
already tried, not working I'll end up with delete canvas
ok
wait
where are you running the bot on?
@wicked pivot can you give the output of node -v?
why just not use .then or async methods?
if you're using embeds, its message.embeds and not message.content
why just not use .then or async methods?
and you can use .then on the message.edit(embed1) as well
@fluid basin I uninstalled canvas, otherwise I was just going to break something
break what?
afaik deleting the node_modules folder and just doing npm install should fix the problem
unless you have a specific (and dumb) package that is only compiled for node v10
@fluid basin what would i put in the " "
needs a music bot a license or something to play music?
well in a sense you actually need (if you're going to play copyrighted music), but in reality no
short answer is no
would i just put pinging...?
if you're using embeds, its message.embeds and not message.content
and that means? i mean i would to play it from yt
message content has the message text, but embeds and embed text belongs in embeds
well yes (you don't need a license), no one really cares tbh, most popular bots stream from yt anyways
hm okay
thanks
this seems like a https://en.wikipedia.org/wiki/XY_problem
The XY problem is a communication problem encountered in help desk and similar situations in which the real issue, X, of the person asking for help is obscured, because instead of asking directly about issue X, they ask how to solve a secondary issue, Y, which they believe wil...
@fluid basin thanks alot
and read the docs too, you still need a few more steps to get the "Pinging..." text @earnest phoenix
k
Hello
this seems like a https://en.wikipedia.org/wiki/XY_problem
@misty sigil not really tbh, its more of a legal/copyright issue but no one really cares tbh
I want help with programming
don't see anyone reported from streaming from youtube
at most google/youtube blocks your IPs
@frozen crest do you have any experience in programming?
making a bot is one of the harder things
And I want to learn program
its highly unadvised to do it on mobile if you dont know a language
its highly unadvised to do it without knowing a language
What does that mean
without knowing the language you're writing in
depends on what you need the bot for and what purpose does the bot need to accomplish
Eng
matt chill lol
Sorry I am a noob at this T-T
we're talking about someone who watches YT to learn how to make bots, and possibly know nothing about coding
oh yes i am english programmer
O
depends on what you need the bot for and what purpose does the bot need to accomplish
well if you can answer this maybe we can help you
Hey guys. Quick question. Is it possible to make a 'testing' bot? My bot is on quite a few servers and I need to test new features without changing the existing bot
My bot I want to be a game bot
@misty sigil cheers. I thought about that, but wasn't sure it would be allowed
you'd need a database
@storm knot its entirely allowed, i have @earnest phoenix and animal bot beta
ok let me be honest right now, learning a new language isn't an easy task, and so is making a discord bot
"Muted"
Humm
@storm knot its entirely allowed, i have @earnest phoenix and animal bot beta
@misty sigil Cheers mate
Think 🤔
aye no problem
ok let me be honest right now, learning a new language isn't an easy task, and so is making a discord bot
so unless you do have the perseverance and time AND effort to do so, I strongly recommend not to
Well....
i have @near moat and @glad quartz
not trying to discourage you to try out new things, but making an actual bot (a game bot moreover) really isn't an easy task
learn js db interactions
so unless you do have the perseverance and time AND effort to do so, I strongly recommend not to
@fluid basin I second this. Making a bot and learning a language are very different things
then make a bot
and dont you dare come back with some JSON db rubbish
but like
and having a computer is really essential I would say
^
Well can you give me a link to the program thing so I least can try Q-Q
not that coding on a mobile device is impossible, but it really is impractical
and having a computer is really essential I would say
@fluid basin <voltrex master has entered the chat>
const browser = await puppeteer.launch({
defaultViewport: {width: 1920, height: 1080}});
const page = await browser.newPage()
await page.goto('https://sa-mp.im/login', {waitUntil: 'domcontentloaded'})
await page.waitForSelector('input[name="username"]');
await page.type('input[name="username"]', 'username');
await page.type('input[name="password"]', 'password');
await page.click('input[type="submit"]');
await page.goto('https://sa-mp.im/profile/faction')
const el = await page.$('body')
const buffer = await el.screenshot({ path: `${Date.now()}.png` })
await browser.close()
return buffer
};
```why isnt it logging in.. i already changed username/password to real ones to be used for logging .. even login page have red message error if username/pass incorrect but it just prints login page w/o even typing into fields and clicking login
@crystal mountain can you try without going to the faction page? does that work?
(like a successful login, basically)
I guess I have to find someone that I can share my bot with that can help
having a team to make a bot is great, but do find people who are willing to help you wholeheartedly
anyone know max reactions discord can show in a single emoji?
I think it was 5000 iirc
sigh
i forgot
hey boys
This will be hard than 😭
think that was it thanks
return new Promise((resolve, reject) => {
weather.find(options, function(error, result) {
if (error) reject(error);
else resolve(result);
});
});
}
async function get_data(locations) {
return Promise.all(
locations.map(
location => get_weather({search: location, degreeType: 'C'})
)
);
}
async function get_location_by_skytext(text) {
text = text.toUpperCase();
let result = await get_data(locations.slice(0, 10));
console.log(result)
result = result.flat();
return result.filter(entry => {
return entry.current.skytext.toUpperCase() === text
});
}```
this is only showing me 1 country
a
i still know nothing about async xd
what is wrong?
@split hazel not a 100% sure so don't blame me 
Bai
i still know nothing about async xd
@earnest phoenix it means running everything asynchronous aka at the same time
while there are actually 68
@eternal osprey does your weather function return more than 1 for each query?
yes
if you use $po sunny
it returns countries that have sunny weather
usually more than 10 countries
(i have picked warm countries).
also why are you only limiting the search to 10 locations
those 10 locations might have 9 raining and 1 sunny
cuz otherwise i get an embed with maybe 40 countries
no because i have filtered the skytext
so $po sunny
yes I know
those 10 locations might have 9 raining and 1 sunny
this could have actually happened
so you only get 1 country ¯_(ツ)_/¯
filter AFTER you get the results, not BEFORE
Session Expires 7 hours, 57 minutes```
How do i make this ngrok session dont expire until i restart or stop it?
not possible on free plan
whats a paid plan
et [skytext] = msg.slice(prefix.length).split(" ");
console.log('Searching locations with:', skytext);
let locations_found = await get_location_by_skytext(skytext);
console.log({locations_found});
if (locations_found.length === 0)```
ngrok secure introspectable tunnels to localhost webhook development tool and debugging tool
should i filter it here
yes
lets say you have all the countries in the world
you should first find out which countries are sunny
so skytext.slice(0, 10)
then take the first 10
yeah
not the opposite, right?
5$ one gives that ?
yeah ofc.
5$ one gives that ?
yes
or is there any better alternative
what do you need it for?
webhooks receving
donations and other stuffs
let [skytext] = msg.slice(prefix.length).split(" ");
console.log('Searching locations with:', skytext);
let locations_found = await get_location_by_skytext(skytext.slice(0, 10));
console.log({locations_found});
if (locations_found.length === 0)
```
it returned 13 arrays
instead of 10
ok lemme rephrase that, what application/software/program needs it?
no not you
i am gonna be using donate bot which sends a post webhook
@eternal osprey nonono, don't slice the text, slice the array
just need the info to add to database
lets say you have all the countries in the world
you should first find out which countries are sunny
then take the first 10 of the results (locations_found)
i am gonna be using donate bot which sends a post webhook
could it not be hosted on a server instead?
otherwise if you are going to host it on your home network you will need to port forward
i can't seem top find where the location found is.
it is only in the let location_found
let [skytext] = msg.slice(prefix.length).split(" ");
console.log('Searching locations with:', skytext);
let locations_found = await get_location_by_skytext(skytext.slice(0, 10));
console.log({locations_found});
if (locations_found.length === 0)
that is here
this is after getting the locations
async function get_weather(options) {
return new Promise((resolve, reject) => {
weather.find(options, function(error, result) {
if (error) reject(error);
else resolve(result);
});
});
}
async function get_data(locations) {
return Promise.all(
locations.map(
location => get_weather({search: location, degreeType: 'C'})
)
);
}
async function get_location_by_skytext(text) {
text = text.toUpperCase();
let result = await get_data(locations);
console.log(result)
result = result.flat();
return result.filter(entry => {
return entry.current.skytext.toUpperCase() === text
});
}```
uhuh
this is how i get the info
yeah
and you only need 10 results
so slice that 13 country array and only get 10?
understandable?
i know
great
let result = await get_data(locations.slice(0, 10));```
this can't
it gave me shit ton of errors
nono
and only returned 1 array.
i do have 68 countries
and 10 different weather types
so $po sunny
$po windy
etc.
so i can't just slice the 13 off.
yes, I know
could it not be hosted on a server instead?
that donate bot is not mine its a donate bot. I am just gonna be using its function where it send webhooks
my bot is hosted on a vps
let [skytext] = msg.slice(prefix.length).split(" ");
console.log('Searching locations with:', skytext);
let locations_found = await get_location_by_skytext(skytext.slice(0, 10));
console.log({locations_found});
if (locations_found.length === 0)
```
look at this code
yeah
how can i catch its post request
@crystal mountain can you try without going to the faction page? does that work?
@fluid basin yes willi
btw it even prints the login page
but w/o trying to login
i mean if u try to login with wrong id/pass u get red message error in the same page
my bot is hosted on a vps
oh, in that case you can catch the webhook on your vps
without port forwading?
i can show ut that it actually works
i can't find anything useful in that code.
let locations_found = await get_location_by_skytext(skytext.slice(0, 10));
console.log({locations_found});```
if your vps has a dedicated IP address (which it usually does), you will be able to setup a webhook catcher on your vps
this should be good right?
let me try
can you try without going to the faction page? does that work?
@crystal mountain do you get the profile page or something after logging in?
but location found i guess
to make it 10
i want it to be 10
i have it already sliced
let [skytext] = msg.slice(prefix.length).split(" ");
console.log('Searching locations with:', skytext);
let locations_found = await get_location_by_skytext(skytext.slice(0, 10));
console.log({locations_found});
if (locations_found.length === 0)```
it still returns 12 arrays
i have no clue why
urgh
yeh
the api tells you, out of your 68 countries, 12 of them are sunny
yes, its intended to have 12?
et embed = new Discord.MessageEmbed()
.setDescription(description)
.setTitle(title);
locations_found.forEach(location => {
embed.addField(
`**${location.current.observationpoint}:**`,
`${location.current.skytext}`);
});
embed.setThumbnail('https://media.giphy.com/media/CKsIi206Ntz4k/giphy.gif')
.setColor('#FF0000')
.setFooter("Command hosted for Pokehub`s community!");
message.author.send("<@" + message.author.id + ">")
message.author.send({embed});
}
}```
can't i try to maximize this.
you mean minimize?
no i am trying to maximize the given countries to only 10
why would u wanna maximise code
but it is not wroking for me.
that's minimize
minimize*
wouldn't locations_found.slice(0, 10).forEach() work?
let me try.
yes, you slice the locations_found
this has been exactly what I am trying to tell you for the past 10 minutes
@fluid basin DUDE THANKS A LOT IT WORKED!
Well im using ffmpeg static and ytdl core to make a music command, but isnt playing audio, the bot just still there with the green circle, anything i can do?
Did you install opus bindings?
If you're using nodejs and d.js npm install --save @discordjs/opus or npm install --save opusscript
Let me try
(node:22) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [VoiceConnection]. Use emitter.setMaxListeners() to increase limit how could i fix this and what is this error about
The error states that there are too many listeners bound.
It means you added 11 disconnect events to a VoiceConnection instance. It's a warning as Node thinks you may have a memory leak.
A common example of it happening would be nesting events, but we don't know what your source code is.
You should.
oh
how do i dm a user via their id using eris
get user by id -> open private channel -> send message
the exact method names idk
probably
yes
okay but how do i get a user
client#users
and is there a get function?
yes
eris has collections too
it's a bit different than discord.js's one though
.filter() returns an array
so you need to use .length after it, not .size
it's not once you get the hang of it
like this: user.getDMChannel().then(x => x.createMessage())
kk thanks
how to make nuke command?
@earnest phoenix wdym?
Discontinued by Discord
Role or badge?
I think he means the bot developer role on here, not the badge, but let's see
yeah they want the role
they have the badge already
and are flexing it smh
@whole patrol you need to add your bot on top.gg and wait for it to get accepted. that's how you get the role
omg the hoist
Okay
i get this
message.member.guild.hasPermission is not a function
when i do
if (!message.member.hasPermission(['KICK_MEMBERS', 'MANAGE_GUILD'])) return message.reply(To start a server lockdown, you need to have \MANAGE GUILD` (Manage Server) & `KICK MEMBERS` permissions.`)
message.member.hasPermission
It accepts a string, not an array
You'll have to use the same function separately with && for each permission
if (!message.member.hasPermission('KICK_MEMBERS')) && (!message.member.hasPermission('KICK_MEMBERS'))'MANAGE_GUILD'
yes
thanks
try { kick() }
catch { log("missing perms") }```
brb
Auger, it's better to save an API request
prob bad auger
yeah i was about to mentiion that
dont use api as your error catcher
and as cry has been for a while here, exceptions are a good hassle for RAM so better to check before doing something
Are you sure that's the line where the error is occurring?
Ctrl + F -> member.guild
the file says message.member.haspermission
ur snippet doesnt match that
hmm
Snipes are reset when the bot shuts down. what should I do.
Save snipes in database
although thats slightly grey area

It might bite them in the ass someday. None of my business from here.
they DO say some stuff like statistic bots are permitted to store some level of end user data as long as its encrypted and secured iirc, but that needs to have an opt-out way of avoid having your data collected and shit of the sorts which is a super hassle
cache is fine
shouldnt be a big deal unless ||your bot is shit and restarts every 10 minutes|| your bot has uptime problems
@misty sigil what do u think https://www.judger-bot.tk/
thx
huh
here steal my design if u want
nah
im good
A simple discord bot with the most aesthetic profile pictures out there.
bruh
how much money did u spend for .vip
5 whole dollars 😸
What
i thought it must be somelink 100$
it was
but i changed the name
and it was 5 dollars
uhmm there are nothing
Domains are dirt cheap
just the invite the bot
thats all u need
there is info and server button underneath
how do i get a progress bar with pillow
this is really weird
Hi,anyone know any npm package that converts ms to minutes?
you dont need a package for that lol
milliseconds / 1000 / 60 = minutes
But im too dumb :(
Packages make things easier, but you don't need a package for everything.
It's handy to know how to convert time measurement units
I know but i get confused
comment your calculations then
i mean
// minutes * secondsInAMinute * 1000 because a second equals 1000 milliseconds
10 * 60 * 1000``` and you got yourself 10 minutes in milliseconds
thats like 3rd grade math
ik
shouldnt you pretty much know that?
yes
3rd grade
I half-assed my way through school since 3rd grade and even I know this :^))))
or maybe 3rd class
wut
it was a joke
lmao
bad joke
ik 
im bad at maths
you cant be that bad that you cant do a simple multiplication
math is just math, so if you can count, you can do everything (on computers).
look at my custom status 
yeah binary
also can we move to #general or #memes-and-media i don't want to be muted again
how can i make a progress bar?
how can i save snippets to the database?
bot.snipes = new Collection();
bot.on('messageDelete', message => {
//if(message.author.bot) return;
const snipes = message.client.snipes.get(message.channel.id) || [];
snipes.unshift({
author: message.author,
content: message.content,
message: message.id,
channel: message.channel.id,
date: new Date().toLocaleString("tr-TR")
})
snipes.splice(10);
message.client.snipes.set(message.channel.id, snipes)
//db.set(`snipe_${message.guild.id}`, message.channel.id, snipes)
});
quick.db
hey
db.set()
clie.snipes and then bot.snipes as collection
Yes


eeey nice
yeh it's hot.
is it properly fixed or half way fixed?
i am done
with everything
i just need to display the coordinates of the places.
nooice
using weather-js package.
Check climate in a specific city with city name and geographical coordinates. Using api of the website https://openweathermap.org
(node:14516) UnhandledPromiseRejectionWarning: Error: An invalid token was provided.
uhhm
pretty sure i have a good bot token in my .env.template
then you used it wrong
apparently not
pretty sure i did not
well errors dont lie
bot.on('messageDelete', message => {
//if(message.author.bot) return;
const snipes = db.get(message.channel.id) || [];
snipes.unshift({
author: message.author.id,
content: message.content,
message: message.id,
channel: message.channel.id,
date: new Date().toLocaleString("tr-TR")
})
snipes.splice(10);
db.set(message.channel.id, snipes)
//db.set(`snipe_${message.guild.id}`, message.channel.id, snipes)
});
const snipes = db.get(message.channel.id) || [];
const msg = snipes[args[0]-1||0]
if(!msg) return message.channel.send(`**${message.author.tag}**: Hiç mesaj silinmemiş.`);
const embed = new MessageEmbed()
.setAuthor(`#${args[0]||1} - ` + msg.author.tag + ' tarafından silindi.', msg.author.displayAvatarURL({dynamic: true, size: 1024, format: 'png'}))
TypeError: msg.author.displayAvatarURL is not a function
msg.author.tag appears as undefined.
uhhh
u write message








