#development
1 messages · Page 1208 of 1
@sick fable you need to pick a host first
theyre asking what provider youre using
Digital ocean, locally, something
what provider did you buy the server from, or are you self hosyinh
Someone guide me up. I am 14 y/o

what provider did you buy the server from, or are you self hosyinh
@honest perch wha-
what does age have to do with anything. also you gave us like 0 info
Hmm

@sick fable which company did you buy your VPS?
Lmao, wait
i dont think they have one tbh
me neither tbh
@sick fable hosting means your bot program will run 24/7 inside some computer. this computer can be anything, such as your home pc, or a server you rent from a hosting company
i agree
that map is compulsory?
@sick fable hosting means your bot program will run 24/7 inside some computer. this computer can be anything, such as your home pc, or a server you rent from a hosting company
@quartz kindle oh
@sick fable which company did you buy your VPS?
@opal plank I don't have one.
self-hosting wont run 24/7
im assuming your question will be now (how to turn but on) ?
self-hosting wont run 24/7
@earnest phoenix depends
Yes
in any case, renting a server from a hosting company is not free, but is not expensive either (starting at $2.50/month or even lower), and is the recommended way to host bots that should be online 24/7, and is what most people here do
host it on potato ez
Lmao😂
honestly if you have a spare pi and stable internet its not that bad either
or pull an 'erwin' and use an Old Wii
if you dont want to pay, there are a few companies that offer limited hosting for free, some of them with either trial limitations or limit how many hours per day they allow your bot to be online
if you dont want to pay, there are a few companies that offer limited hosting for free, some of them with either trial limitations or limit how many hours per day they allow your bot to be online
@quartz kindle I want that one only
google has a free forever plan that is more than good enough, but you need a credit card to register
or pull an 'erwin' and use an Old Wii
@opal plank try running a minecraft server on a very old laptop
google has a free forever plan that is more than good enough, but you need a credit card to register
@quartz kindle hmmm
alternatively, you can run the bot yourself in your own computer
it will be online as long as your computer is on
@sudden geyser runing server is fine, loading client is the issue
as long as it supports java it should be ok
idk im not a magik man
@misty sigil i fix that
-p indonesia raya
I'm trying to make a queue system for my new music bot, however, the queue is always one song. I try to add something to the array, but a new song just plays (the connection.play(); is what controls playing a new song). I just want to add a new song to array, rather than deleting it.
Code:
var server = servers[message.guild.id];
const channel = message.member.voice.channel;
if (!message.member.voice.channel || channel.join == null) {
message.channel.send("Channel doesn\'t exist or you're not in a voice channel!");
} else {
console.log(server.queue);
server.queue.push(args[0]);
if (/*server.queue[0] != "" && */server.queue.length = 1) {
channel.join().then(function(connection) {
connection.play(ytdl(args[0]));
})
} else {
console.log("ok zoomer thing is not empty");
server.queue.push(args[0]);
}
/*
channel.join().then(function(connection) {
connection.play(ytdl(args[0]));
})
*/
}
Full code: https://hatebin.com/mrqsuzpfnc
does anyone know of a nodejs library that can convert strings such as "1 hour" or "30 minutes" to timestamps?
look up ms
ms?
is there any decent reddit node packages i can use to get random images?
someone said random-puppy isn't the best
so im not suer
use the official api
Are image embeds broken for everyone?
I can't upload any images with my friends nor can my bot, I think discord images broke
Discord is sending them as download attachments with a huge delay
Yeah
Yes it’s broken for everyone @green kestrel
Client bug?
I am having trouble connecting to discord's websocket.
pog moment, discords dead
@simple stump
I assume server.queue is an array.
let array = []
// now lets say you're pushing a song
array.push("Song 1");
// Output: ["Song 1"] which can be accessed by array[0]
array.push("Song 2");
// Output: ["Song 1", "Song 2"] which can be accessed by array[1];
//If you want to remove the first song, slice it out.
//use .slice or .pop
or you can shift it .-.
how can i learn if someone boosted my server? (with event(s)) guildBoostAdd? Or guildMemberBoost?
you can use guildMemberUpdare
Listen for the message event
and check the USER_PREMIUM_GUILD_SUBSCRIPTION event, or do what undefine said (or any of these that make sense https://discord.js.org/#/docs/main/stable/typedef/MessageType)
guildMemberUpdate
so , if (member.premiumSince !== null) will work, right?
idk, but you can check if the member was given the Server Booster role,
async def number():
if 'number' in locals():
print('number exists!')
else:
number = 0
print(number)
number = number + 0
I'm trying to check if number exists and if not define it -- and later add 0 to it.
But it always prints 0.
you check if number exists in locals
but you never update it in locals
in any case is locals() the right place to store such variables?
anyway try something like this ```py
async def number():
if 'number' in locals():
print('number exists!')
locals()["number"] = locals()["number"] + 1
else:
locals()["number"] = 0
print(locals()["number"])
locals() I think is bound to the scope
Which is why at the top scope you get a lot of stuff, but in the function you get an empty dict.
Hello! How can I add in my bot status in how much servers my bot is in and how much members it is watching?
what library?
What?
what lib?
How can i learn the any server's boost count?
I'm bad at server boost , bruh
Could someone tell me how to do the bot invitation link instead of getting that link to be "click here" if you know please tell me
?
in an embed?
im trying to make a reminder command for my bot but I don't know how to actually get the bot to remind the user at the right timestamp
i already have the timestamps stored in the db but I don't know how to make the bot dm the users at that timestamp
could anyone get me in the right direction?
maybe use cron for checking it every minute
T
that's what I do actually
use node schedule @gritty bolt
but how would I do that for every timestamp in that DB?
what is wrong here https://i.imgur.com/n7wfBUE.png
You sure you supposed to login via root?
Yeah well as far as I know root is the "user" with access to everything and sometimes depending on your vps provider or your server you have to make an own user with custom permissions. Do you log in with root in termius?
Hello
@torpid heart yes
@opal plank so you mean like do a .forEach for everything in the database every time the bot starts?
what should i use instead
use for in this case
The difference between .forEach and for in in the case of speed is not that significant
i read that wrong haha
also yes, delete entries that are old and not needed
on startup you should only require active timestamps
just do a check if somehow your bot missed that specific time
yeah
if (job < now) run job
Anyone know how to code a starboard disc py
is there anyway I can fix my banid command?
bUser is not defined for let bUser = args[0]; for userID only
Windows,Node,D.JS V11, etc fun stuffs
what is args
Is there a fast way to add extra domain names and sites to my webserver with nginx?
Not really
What's the slow way
I tried adding another conf to the sites enabled but it redirects to the other site
Just add all the domains under server_name
server_name www.domain.com domain.com www.domain2.com domain2.com;
@pure lion
@pure lion you have to restart the server
ip > domain you mean?
Say I'm going to the site via domain2, is there a possibility of it showing site1 and not site2?
what is wrong here https://i.imgur.com/n7wfBUE.png
@summer torrent Your config could be disallowing root login
Français dans #memes-and-media svp
@nimble kiln does it automatically redirect?
@pure lion If you add all domains in one server{}-block then all domains will go to theroot-directory you specified there
How long does it take for a bot to be verified? If it does.
How long does it take for a bot to be verified? If it does.
@earnest phoenix +4wks
Alright, cheers.
You could use if-statements to send them to different locations, maybe. But if you have different root directories then just add a second server-block
@nimble kiln it's a node app, I want each domain to take me to a different place
I mean, for node apps I use reverse proxies
I only have apache examples
a
it's possible with nginx tho
You can catch multiple domains in one server block, then proxy to different /directories based on the hostname
Anyone knows statuspage.io and can help me with it? I want to connect my discord bot to it.
@nimble kiln example?
eh, like I said only for apache. But I can try and look around
Can you show me how you did it on Apache?
On apache I dont redirect based on hostname, I got one hostname and subdirectories:
ProxyPass /socket.io/ ws://127.0.0.1:1/socket.io/
ProxyPassReverse /socket.io/ ws://127.0.0.1:1/socket.io/
ProxyPass /longlinkwhichshouldnotgetfoundanytimesoon/ http://127.0.0.1:2/
ProxyPassReverse /longlinkwhichshouldnotgetfoundanytimesoon/ http://127.0.0.1:2/
ProxyPass / http://127.0.0.1:1/
ProxyPassReverse / http://127.0.0.1:1/```
Hmmm
robots.txt:
disallow: /longlinkwhichshouldnotgetfoundanytimesoon
Can I redirect based on domain name from request?
idk 🤣
:o
actually
I hope it'll work with ssl
it's using $request_body
dont check this 😂
I never had to play around with nginx's proxy unfortunately, cause the server where I host my bot already runs an apache server (apache boooo) for my monitoring
😩
Is this what I think it is? 👌 ?
I hope it'll work with ssl
oh dang u right
I'm pretty sure it works with ssl
Y..es?
On DO there's a tool to add multiple nginx poopoo boyes
Callum what are you doing
👌 got em
Basically it sets everything up for you
Fixing my c: drive so I can defrag
hdd
Apparently I've done a bad
Haha lol defrag
On DO there's a tool to add multiple nginx poopoo boyes
@pure lion Send link
Okay

cya
Aw it doesn't exist
oh boy that looks fancy, thx for sharing
Np lol
My bot doesn't login.
Most likely a websocket connection
How would I resolve this?
@earnest phoenix Try debugging:
client.on('debug', msg => console.log(msg));
Well I tried both my VPS and my PC, it wont connect
Ill debug.
@golden condor what do you mean by operations?
Maybe you're banned for too many restarts
I barley restarted
In 24hrs?
- its been 24h
mhm, still. Debugging is worth a shot
[ws] [connection] Sending a heartbeat
READY [REDACTED]
[ws] [connection] Heartbeat acknowledged, latency of 1274ms```
and then it died

well, its sending heartbeats.
not logging itself in though
uhhh
4k
1k
LoL
¯_(ツ)_/¯
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));```
yeet my debug, slapp that stuff in
maybe that shows more?
maybe ur vps is running something big
yes boss
like Database self host
i did one time
db selfhost isnt that bad my dude
i hosted MySQL on my vps
const config = require('./config.json');
const { Client } = require("discord.js");
const client = new Client();
client.on("ready", () => {
console.log("READY")
});
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));
client.login(config.tokens.main).catch(console.error);```
This is literally the whole code if you're wondering
and it had 2k ping
oh
maybe thats just a mongo thing now
so i moved to Atlas
using mongo
so i don't have to selfhost a databse
:))
and added some swap file
so everything are fast now
:))
@earnest phoenix Any new output(s)?
wait why does it post a [uuid] after READY
i said uuid?
ok 
idk if its a uuid

its a long auth time for just a simple file
uuid = ?

but its back up
Works?
apparently
Noice.
I will try to start it in the main code lmfao
Good luck 🤞
i mean, it looks uuid like. But idk
but its back up
def not copy of aeon's av
Which discord.js version are you using
v11 ._.
Cause my startup looks like this
i still use 11.6.4
Update time 
how your guys's login is nice
no 
Why 😢
cooler than mine
I have to update alot of functions
still
Mostly you have to add .cache to all your stuff
you won't be able to connect after oct 7th iirc
Does the test button on dbl work??
yes
really? I thought you needed to get verified before oct 7th
if thats not the case then ill update soon
you need to be verified to have over 100 servers
already am verified
you wont be able to use djs v11 after oct 7th iirc
yes
Odd so when ever I click test button it doesn't send a message but when someone votes it sends a message
ill research
Odd so when ever I click test button it doesn't send a message but when someone votes it sends a message
@vague kite That's probably something for #topgg-api, but try to click the "Test" button a couple times (Wait a few seconds in between each Test tho) - For me I had to use it couple of times before it actually tested
would
if (isNaN(amount)) return message.channel.send('**error** Please Give me a valid number);
return give me a vaild number
if i did '1s' or '1h', '6h', '17d'
That's probably something for #topgg-api, but try to click the "Test" button a couple times (Wait a few seconds in between each Test tho) - For me I had to use it couple of times before it actually tested
Okay thanks will try now
@still merlin
oh whoops, i thought it was parseInt
1s would be a string, so it's not a number
Eh, this is weird
mhm
are you looking for isNaN(parseInt("1d"))?
I had that error once aswell, but I think it was caused by being ratelimited - Either ratelimited or straight up banned
weird
I dont wanna contact support
it took me a month for my last email to get a response
that should resolve by itself after some time
I'd say send me your code so I can test, but yeah 😂
theres a github
apollyon600/projectalpha
although, not all files are pushed due to .gitignore
it does
but it takes 10 seconds to connect
const config = require('./config.json');
const { Client } = require("discord.js");
const client = new Client();
client.on("ready", () => {
console.log("[LOGGING] THE BOT IS ONLINE")
});
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));
client.on("message", msg => {
if (msg.content == 'start') msg.channel.send("YES")
})
client.login(config.tokens.main).catch(console.error);```
Heres the quick code, message event still has flaws but yeah
should still be the same
@earnest phoenix Logged in after a few seconds, and commands works
I assume it was instant?
yes
Where is that "Provided Token" coming from, I dont have that on my main bot 👀
Must be the way I define my stuff in the main bot:
const client = new discord.Client({
partials: ['MESSAGE', 'CHANNEL', 'REACTION']
});```
His way:
```const { Client } = require("discord.js");
const client = new Client();```
Does it take too long to approve the bot la on the top.gg website?
how can i get the "description": "All Systems Operational" section at https://srhpyqt94yxb.statuspage.io/api/v2/status.json?
@earnest phoenix Well yeah sorry, bot is still up and working just fine :/ Maybe it is time to update to v12? 🙃
Does it take too long to approve the bot la on the top.gg website?
@earnest phoenix ? Help
const { MessageEmbed } = require('discord.js');
const superagent = require('superagent');
const request = require('request');
const { autimatic } = require("../../JSON/colours.json");
const url = 'https://srhpyqt94yxb.statuspage.io/api/v2/status.json';
request(url, function (err, response, body) {
if (err) {
console.log(err);
return message.reply('error.');
};
body = JSON.parse(body);
//testOff = JSON.parse(testOffline);
const embed = new MessageEmbed()
.addField(`Durum`, `${body[3]['description'] === "All Systems Operational" ? 'çalışıyor' : 'hata'}`)
message.channel.send(embed);
TypeError: Cannot read property 'description' of undefined
how can i get the "description": "All Systems Operational" section at https://srhpyqt94yxb.statuspage.io/api/v2/status.json?
@earnest phoenix If you parse that JSON, then trybody.status.descriptionorbody["status"]["description"]should also work
@nimble kiln that information comes from client.on("debug")
the token that shows up there is what you give it in client.login()
@nimble kiln im probably ratelimited, but I will def upgrade to v12 soon
@nimble kiln that information comes from client.on("debug")
@quartz kindle I am debugging in my main bot, doesnt show up
I wanted it to be faster is a long time but it can be approved before, right?
You can't make it go faster, you have to wait
it takes around 4 weeks
GAS GASS GASS

gas gas gas > dejavu
^
gas gas gas > dejavu
Oh, thanks
thx @nimble kiln
@earnest phoenix Come over here, what do you need help with
Umm It's just discord reseted my Bot's token.
Got this message.
It's obviously clear from the message.
lol
Well, this is the wrong discord for that. But just go to your developers page and request a new token. Also make sure to fix the problem
It got caused by 1000 restarts within 24hrs
Damn
, Alright.
You probably have a restart script which restarts your bot
"name": "API", "status": "operational" how can I get this data as body?
body1.components.API.status ?
why the image is so small
anothers bot it display so big image
@earnest phoenix you're already been told how
Someone know how tosend a message with discord webhook using node.js http lib ?
I want to take this area "name":"API","status":"operational"
Can someone tell me what are those error logs means?
you have to loop through body.components
This will give you Cloudflare and operational:
body.components[0].name
body.components[0].status
@earnest phoenix
you can also use array.find
you can also use array.find
Or this 🙂
@earnest phoenix it means you're using too many event listeners
this is an event listener: client.on("message")
Oh alr.
instead of doing ```js
client.on("message", message => {
// command 1
})
client.on("message", message => {
// command 2
})
client.on("message", message => {
// command 3
})
do this
client.on("message", message => {
// command 1
// command 2
// command 3
})
yikes
i remember when I did that top example
my bot didnt like it at all and had too many errors
though i'd recommend
bot.on("message", async message => {
if(message.channel.type === "dm") return;
if(message.author.bot) return;
if(!message.content.startsWith(prefix1)) return;
let messageArray = message.content.split(" ")
let cmd = messageArray[0];
let args = messageArray.slice(1)
if(cmd = `${prefix}commandName`){
//functions here
}
if(cmd = `${prefix}commandName`){
//functions here
}
});
``` instead
yes @earnest phoenix
Are you using discord.js v11? 
client.user.setActivity(`whatever`);
@earnest phoenix But yes, use this
Yes
Isn't it more than just a string?
Well I am; I am not able to update to v12 because my NPM wont update my node to v12
I am using discord.js v11
@earnest phoenix If possible you should update to v12
oh, glitch
It's not if possible
It's required past oct 7th
Yeah
well what about users like me; node doesnt update
Glitch probably should update it to v12
and if I cant update my node to v12 I cant get discord v12
v11 is no longer supported past the 7th and iirc cannot handle new discord api changes that will happen on the 7th
Mhm.
yikes so id just have to shut my bot offline then after oct 7th
Probably glitch Is the problem.
Or just upgrqde to v12
I think repl.it is similar to glitch
And I know it supports v12
I would recommend you host it yourself though
@real niche i cannot update to discord v12 because my node refuses to download the latest version for whatever reason
doesnt say any reason; i've tried installing node v12 and everytime I installed nodev12; and check it, it always says node version: 10.9.0
for whatever reason, I cannot go passed v10.9 and i've had this conversation before with someone
How do you install it?
directly from nodes site?
Wait are you on windows?
Windows 10 yes
That's strange. Those installers should work. It might be that it is installing but you have two installations.
i'll attempt it again
wait what?
if it doesnt work I'll just destroy my bot
type where node into cmd
no I have node v12 on my system; my bot just wont upgrade it from v10
how come?
its in program files
use node manager to have multiple node versions
open the powershell to update it with admin
Can you try to uninistall node?
wont matter if program files are admin locked
i can uninstall node sure
can someone help me code a mute command too stupid to understand coding
Learn how to code first
@chilly mason we dont spoonfeed
Well it's just adding a role
if you need a general guide, we can provide one
in order to mute someone you need to use roles and keep track of timers in a database
no i made the command i just dont know where to put it

That's a temporary mute, which is much more difficult
did u use bot maker or something along those lines?
i just started downloading v12.18.3 LTS for node
@obtuse wind uninstall node, then run where node again (probably in a new commadn window)
Alright
in order to mute someone you need to use roles and keep track of timers in a database
Or you live on the edge and hope that your bot will never crash, so you can just keep everything in memory
ill do that;
I just want to make sure it's completely uninstalled before you try to install the new version
It tells you the path of a comand
Well this is just ready. What is your full webhook code?
Also #topgg-api
Did you fix it?

yeah who would be dumb enough to forget to put http
ppppf shame on you

@slender thistle
idk somehow asking people for help helps you solve your dumb issues
usually after you type it you think about it again
idk somehow asking people for help helps you solve your dumb issues
Yeah honestly
Then your like "Oh shit this guild id was actually the channel id fuck me"
just reinstalled node with the v12.18.3 and its still saying on my node that its v10.9.0 .-. i'm just gonna have my bot go offline from here on-out
what does it say when you run node -v in command prompt?
#server-nevalid
again, v10.9.0 ( for Tim )
i completely uninstalled it yes
ok so, please help me with this...
no matter if the message.content is 5 rose or rose 5
But the variable would take the right one i.e
var amount = "5"; //number```
uninstall it again
make sure it says that node doesnt exists when you try to run node -v
@sterile thicket do you want to parse number and string?
yes
how i get tokens with the Casino Bot?
okay
im confused now
I just spammed node -v command in cmdprompt
that is very odd.
Lol
so does that mean I can install discord v12?
its already installed according to that
no im still using v11 for d.js
parseInt(message.content)
for number
@summer torrent that gives meNaNonly
now my computer is not finding npm im confused
I meant, I want to take only those args which has number only and also tale that arg which has alphanumeric chracters
close cmd and open it again, trixinity
<args>.match(/^\d/) @sterile thicket to check if its a number
changing discord to v12 would be npm install discord@12.3.1 correct?
or npm update to update all outdated packages
ill use that instead cause its saying no target found for discord@12.3.1 so
if you already have v11 installed, it wont update to v12
you have to either npm i discord.js@12, or uninstall v11 first
okay now that everything is updated to cough v12 and higher; i guess I have to scratch my programming cause nothing has .cache.
yup
It happened that my bot has some problems with the api code, my bot has music content, and when I want to play a stream from youtube my bot just comes in and says it finished playing the song, I tried various ways to fix it but I didn't succeed, all I learned was something to do with this -> curl -I https://discordapp.com/api/v7/gateway
I get an error ;3
@drowsy sentinel
then show error
I wouldn't know what you're doing, that's not much context.
Unfortunately my console doesn't get any error or anything like that, the console behaves quite normally
So there was no error?
I tried to play music on my bot but stream music, she interrupted the music and said that the music was finished, but nowhere in the console showed an error, and if the streamers were working normally
curl -I https://discordapp.com/api/v7/gateway
This is a bug I found and which others told me was a real problem for letting the stream over the bot
music issues happen all the time for a variety of reasons
the problem can be anywhere from youtube to your code
I have tried it on other bots and it works normally
other bots you made or bots from other people?
I went through the glitch forum I apologize for the ad, and they said it was a mistake is there any way to fix it?
From other people
glitch has a lot of issues with bots, most people are moving out of glitch
do these other bots that work also use glitch?
I have my own host
then fixes from the glitch forum wont apply to you
can we do a command like this with a discord bot?
https://www.w3schools.com/graphics/tryit.asp?filename=trycanvas_clock_start
As in generate an image?
is the best way to create a gif? the problem is that the time is delayed and not 1to1 correct
is there like a way to show a gif with the correct time/seconds?
There isn't really an accurate way since the gifs would be delayed by latency (which can be compensated for), and discord's preview server latency, which is significantly harder to compensate for
It's definitely possible to get within a couple seconds accuracy, but not by milliseconds
meh, I wish there would be a way tho 🤔 maybe we can edit the canvas every minute?
If you were to make it generate an image based off of the minute, you can probably get away with a very simple api
I see, I guess api is the only way rip
If you wanted to do it yourself you could easily do it with image manipulation APIs
It should just be overlaying 3 elements on top of each other (background, hours and minutes hand)
Then just rotate them a bit depending on the current time and it would work
🤔 I had this in mind already, I guess this is the way to do it. thanks for the ideas
whats a check for python to check if ur alone in the vc with the bot:
After a couple of hours running my bot restarts because of a mysql "Connection lost" error. I thought all my connections errors are handled.
I connect to one manager and one data db (might be multiple data dbs in the future) in these two files:
dataDb: https://pastebin.pl/view/b72ee237
managerDb: https://pastebin.pl/view/6169f083
Any idea why the error occurs or how to prevent a restart of the bot?
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
is there anyway ask the user for multiple inputs
i tried collectors but it works only with the first input
how do websites like github store code
@dreamy cedar Havent tried them out, but maybe on collection of the first message, start the next collector?
u mean i put collector inside another collector
i dont think that it will work
how can i convert the base64 image type to .setThumbnail?
try Buffer.from("image data here","base64")
and if you're on djs use messageattachment
I lost my email to login to discord
send a message if args[0] contains the letters a b c
how can i do that
if(args[0].includes("a") || args[0].includes("b") || args[0].includes("c") {
//Code
}
bnruhw awit
ok thats the one
thx
Hello All! I am creating audit logs. and this is how i doing them
client.on('inviteDelete', async (invite) => {```
my problem is that it isnt working for memberUpdate
or any of those
how do I get the object for that?
yes
those are audit log actions, not events
there is no client.on("audit log action")
its not an event
but messageDelete is?
messageDelete is an event
this is the list of events from discord's official website: https://discord.com/developers/docs/topics/gateway#commands-and-events
and here you can find them for discord.js https://discord.js.org/#/docs/main/stable/class/Client
Here's my code and some info about random(). Why does TS think that res is of type any and not ImgurResult?```ts
const res = await fetch(IMAGE_API)
.then(res => res.json())
.then(body => Util.random<ImgurResult>(body.data));
random<T>(source: ArrayLike<T>, before?: number, after?: number) => T;```
Here's my code and some info about
random(). Why does TS think thatresis of typeanyand notImgurResult?```ts
const res = await fetch(IMAGE_API)
.then(res => res.json())
.then(body => Util.random<ImgurResult>(body.data));random<T>(source: ArrayLike<T>, before?: number, after?: number) => T;```
@opaque eagle
because it is, running json() converts the string into an object, ts doesn't know which one magically
cast it as Promise<T>
Oh, I thought that it'd infer it's ImgurResult since Util.random returns objects of that type
If I do this, TS still thinks res is any
might be because of the anonymous object as the type in the promise
oh no wait
res is whatever fetch returns
check if node fetch has types
you can then do (res: thetype) =>
is there anyway ask the user for multiple inputs
i tried collectors but it works only with the first input
Hello,so im trying to use axios for a welcome card but with the api im using idk how to define multiple things in the link like https://api.no-api-key.com/api/v2/welcome?username=Korabi20?user_image=https://images-ext-2.discordapp.net/external/RaGA1y3Hyk6qwIqmyyswMClY5EEWXBX14Cb3z0tpJ-U/%3Fsize%3D256/https/cdn.discordapp.com/avatars/638476135457357849/a_a8c5baa49ae64f13a5672023e2583c7b.gif
see it says missing user_image query when you click it
Hii
Hello
How can I check if there is only the bot in a vc?
members size === 1 && that member id === your bot id
@sick cloud for me?
yes
how do i run a command
like how do i make a command
client.command doesnt work
like @client.command
i have the worst command format
@chilly mason wut u need?
it takes 9 hours to make like 2 commands
uh
i need to make an embed
and itd not working
wut lib?
it takes 9 hours to make like 2 commands
@chilly mason bro i make a command every 5 mins lmao
?
bruh dont spam
i suck at coding, im kinda new to coding too and its not working reeeee
@chilly mason
check docs?
here
ill make a pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
WHAT LIBARARY?
?
is it discord py
cant help sorry
no
yes
@ember lodge
the user must take an action before playing sounds
like clicking
hey guys
its a security restriction
there is an autoplay tag iirc
there is an autoplay tag iirc
@lament meteor it wont work unless the usee clicks
but it doesn't work automatically?
how do i make a command for premium users in discordpy
anyone gonna help?
it doesnt require input
step 1: learn python
step 2: learn discord.py
step 3: use a different language jkjk
how do i make a command for premium users in discordpy
bruh
depends on how u are getting the premium
I DID
how do i make a embed im new
or payment
how do u plan to get the payment
ima head out, people here make my head hurt and i want to stab things bye
probably pay pal?
cya later
monthly
hmm
'd
btw this is for discordpy
u could probably give them a role every month and check if they have the role
@chilly mason i can help u after im done with ur embeds
but that will only work in 1 server
ok
@lament meteor Yeah it works good, but it appear that button
@lament meteor again, that would only work in my server
u could probably hide it with css
what if they don't want to join the support server
i created the embed code but it doesnt work
how do i do it when i click the button?
@chilly mason is this discordpy?
when i click a button with ID: mybtn it reproduces that audio
@modest smelt i think its discord.js
#embeds = variable
embed = discord.Embed(title = "Name it whatever", description = "Description")
embed.add_field(name = "Whatevs", value = "Whatevs", inline = False)
#inline = False just means that it will start a new line. if you want more than one command in a line, just ignore that command. Play around with it
#hopefully u using ctx
await ctx.send(embed = embed)
#you put embed = variable name. i made my variable = embed
```code in python
im js
@modest smelt if they are paying for something it doesnt hurt to join a server
i guess so
thats how Timo's(one of the moderators) bot does premium
i personally use patreon
and cuz it automatically adds a role when someone subscribes
sadly no
oh ok
@chilly mason what error did you get?
i didnt get an error the command just doesnt work
@ember lodge wut do u mean?
here is my command
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
hmm
ignore the yeet and spam commands
well what i mean is to reproduce the audio automatically when the user enters the website
hmm
when i do -embed it doesnt do anything
@chilly mason try to add like a console.log in the cmd incase the cmd itself isnt running
} else if(command === 'embed'){
console.log('yes i am working')
const testEmbed = new Discord.MessageEmbed();
testEmbed.setTitle('User Info')
testEmbed.setDescription(`Username: ${message.author.username}\n ID: ${message.author.id}`)
message.channel.send(testEmbed)
}```
if you get a message in the console then that is weird
ok
<audio controls autoplay>
<source src="https://cdn.glitch.com/5be59cbc-4cc9-497d-b104-80bbeeeadb6a%2Fstart.mp3?v=1599010773482" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
that's the part of the audio
does it autoplay?
nop
it's on local host
oh
apparently u can meme with this https://stackoverflow.com/questions/50490304/how-to-make-audio-autoplay-on-chrome
well i think if i can't
wait whats wrong with mine
how do i play it when i click a button?
if you make it autoplay
ohh
how you handle inputs seem to be wrong
it will automaticcally play when you click a button
i forgot to do the -embed
when someone clicks this button the website plays audio
or the page

yes
i got this warning
because user input lets the browser play audio
otherwise it simply WONT
iirc a keypress works too
there are workarounds
no there arent
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i suggest learning js?
like i cant rlly help u if u dont understand errors like that 
What you guys talking about? 
You can't calculate the antenna without transcoding the wireless UDP pixel
Is there a way to quit using && every time I want to run more than 1 function on a line?
If we transcode the antenna, we can get to the HDD array through the ethernet DHCP address
JS related
wdym
example
send
plox
Let’s say I want to run 2 sql.run functions at once
func()
func()
func(); func()
Rn I’m doing sql.run(blah blah) && sql.run(other blah blah)
there are two otpions
idk why you would necessarily want them on the same line
Alright I’ll try it
you dont need the && either
func(); func(); func(); func(); func(); func(); func(); func();
this.func() = func(t);
this.func() = func(func(t));
I want power rangers pics can anyone suggest a api for me
web api is preferable
ping me on answer please
google api
Hi
Ez
is there any discord server for discord support
discord-testers iirc
Hey I have a question how do you make it so on discord.js you add multiple reactions at once instead of one at a time.
you can't
just add them one at a time
Yeah its just slow
It's been 32 hours since my last login from my bot.
None of my heavy codes for this bot doesn't work.
Everything I login, every event loads BUT the ready.js event.
Debugging just shows it heart beating but never readies up.
If you have a solution, please help me
This code works instantly on my other bots, my main bot however, doesnt work.
What is interesting to me is that my bot still logs events even when its offline, not to mention I resetted its token 10 times already. It still logs events.
const config = require('./config.json');
const { Client } = require("discord.js");
const client = new Client();
client.on("ready", () => {
console.log("READY")
});
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));
client.login(config.tokens.main).catch(console.error);```
This is literally the whole code if you're wondering
When it logs its events, everything is undefined but its guild size.
It still somehow logs even when its offline.
Proof that it did it.
Dont understando
ugh, ill make a video 1 sec.
What should the bot be doing and is not doing?
Show does numbers and that undefined?


monkaTOS
Alright sending the video, hopefully you can figure it out
imma just refresh its tokens now ._.
how can bot use gif emotes
^ Appy your bot
And @earnest phoenix I can't really tell, I dont think im the right guy to help you, but if the bot goes on but dnt load anything it dsnt even mean the bot is good, propably reach the login part but have an error or skip the next thing and is now stuck at the READY
@heavy crown you're 12?
incoming punishment
@ionic dawn all events are listed, error, debug, and warn
if there was an error then it should of logged it
Well I dont really know your strucure but, perhaps you missing somthing or as I say, is stuck on something at loading
Mayb any typo, or is just a copy paste from one of your bots?

Did he deleted the messages?
Banned
@earnest phoenix this may not work but maybe try replacing
const { Client } = require("discord.js");
const client = new Client();
with
const Discord = require('discord.js');
const client = new Discord.Client();
Basically yeah but simple things can can mess it up
@slender thistle why does batman beat someone unconscious and then say "NOW TALK"
wait this is development
if batman.attack == 999:
question_response("NOW TALK")
Has any1 connected top.gg webhooks to .netconsole app before and could explain the process to me to get that to work 🤔
rn im checking vote list / has uservoted yet on vote command but seems inconsistent and has delays
if i do:
const phin = require("phin");
phin({
url: "https://some-random-api.ml/TELK/IS/A/QT",
method: "GET",
parse: "JSON"
});
how is phin parsing JSON?? The recieved response is in HTML so it doesn't make sense to me
because that url's response is not a valid json? @earnest phoenix
the response is: types
<html>
<body>
<pre>
{"something":"something"}
</pre>
</body>
</html>
If i put that in my browser it will show::
{"something":"something"}
But that's still HTML right? Then how can it parse JSON?
@pale vessel
yes
@earnest phoenix JSON.parse();
lemme just copy paste the code from one of the endpoints of the API
thef fuck
my browser added those extra html thingies
the actual response is JSON
my brain hurts
the trash inside is too weird
@earnest phoenix
JSON.parse();
@earnest phoenix
JSON.parse('{}');
what are you even trying to say
JSON.parse(response.body);
no
Thats how it parse it
i don't do that
no
it should parse it with the parse: "json" option
i just pass parse: "json" in the options object
it should parse it with the parse: "json" option
@pale vessel both ways work
i'm aware, yes
And
You want to know how it parse?
phin({
url: "hayper gay",
method: "flazepe's method",
parse: "JSON"
});
Is the same as```js
phin({
url: "hayper gay",
method: "flazepe's method"
}).then(response => {
JSON.parse(response);
});
lol
response.body
i just toldya how to save three lines of storage space
no need to thank me
You want to know how it parse?
response.body
@pale vessel god it's an example
mmlol
I am confused
You asked how phin parse html?
to json*
@earnest phoenix alright so what
i just toldya how to save three lines of storage space
no need to thank me
one-liners: exists
Anyways this is how they parse it
who uses top.gg webhooks off discord
if (Object.parse.equals("JSON")) return JSON.parse(nddejwiwidje.bodyidklolhahha);
else if ...
else if ...
else if ...
else return witirebjwod
Thats how they do it

Simple if else and regurn
Return
Also no that is not spoon feeding
Someone else that getting this error msg?
[JDA MainWS-ReadThread] WARN GuildSetupController - Accumulating suspicious amounts of cached events during guild setup, something might be wrong. Cached: 2000 Members: 1/134938 Status: CHUNKING GuildId: 264445053596991498 Incomplete: 6/7
The Guild ID is this discord and it have runned fine until i was going to restart the bot then i got it.
Have worked fine before. 😕
:o
The "source code" forums
I made my bot's economy global
Try https://stackoverflow.com
@earnest phoenix I use that website quite a lot actually it's been very useful through out my learning of javascript and other langauges
I didnt say anything about the website being bad, so why did you ping me for no reason
Finna make stack underflow
stackoverflow saved my life
there we go, added all the stuff to my bot so that i can award nitro to each months winner 😄
that took a while lol
is there anyway ask the user for multiple inputs
i tried collectors but it works only with the first input
Does anyone know how to have multiple instances of code running at the same time linked to one user
Hello guys
How i can track some other memes from other subreddit when my code is like this
const Discord = require('discord.js');
const fetch = require("node-fetch");
exports.run = async (client, message, args) => {
let loadingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription(`:loading: Generating a meme!...`)
let msg = await message.channel
.send(loadingEmbed)
.then(m => m.delete({ timeout: 2000 }));
fetch("https://www.reddit.com/r/Memes.json?sort=top&t=daily")
.then(res => res.json())
.then(body => {
if (!body) return message.reply("I broke, try again!");
const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18);
if (!allowed.length) return message.channel.send('Hmm looks like an error to me...');
const randomnumber = Math.floor(Math.random() * allowed.length)
let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}`
let embed = new Discord.MessageEmbed()
.setTitle(allowed[randomnumber].data.title)
.setURL(url)
.setImage(allowed[randomnumber].data.url)
.setDescription("**-----------------------------------**")
.addField("Upvotes and Comments", `:upvote: **${allowed[randomnumber].data.ups}** | :comment: **${allowed[randomnumber].data.num_comments}**`)
.setColor("RANDOM")
return message.channel.send(embed);
});
}
exports.help = {
name: "meme",
description: "Checkmate some memes from Reddit",
usage: "meme",
example: "meme"
}
exports.conf = {
aliases: [],
cooldown: 3
}
Hi I'm tryNa use a usb stick with a vm on virtual box, how can I attach a physical usb to it or make a virtual one, ping me if you can help or have an answer (ty)
never used virtualbox, but on vmware when you attach a usb and you have the vm open and active in front of you, it asks you if you want to connect it to the guest or host
you can also go into some option in the toolbar to connect/disconnect usb devices from the vm
What is the wrong on this code?
too much )
also
please don't use glitch to code
bad idea
oof
use real ide
like vsc
too much )
@earnest phoenix read the code lol
do one lol from me gagahaah
