#development
1 messages ยท Page 1043 of 1
Just give use some code to start with
@left lake Please show me.
Do you have some code you've made?
my latency is 157 and my api is 28
i dont spoonfeed
have you googled anything
have you tried coding anything
or did you just come here and expect someone to deliver it on a silver platter with your name on it
Uhm, do you wanna see my 304 lines of code @lyric mountain?
But this includes API latency
why is it 304 lines
Only 304? 
we dont need your entire index file
because its a big bot?
yes my bot is big too
big bot
we dont need 304 lines of index code
ok, um im just asking for some scripts as my friend is down.
you need to give us some code as to what you've done
...
you want to make a greeting when a user joins a guild, right
We can't give u code
yes
so
But we can help u make that code
what code do you have to do that
Uh0
No..?
Yes I do.
My support server and most people already have one.
when a user joins your guild, all your doing is fetching a channel from the client and sending a message to it
and I use node.js for stuff, discord.js for other stuff, visual studio code for c o d e, and cmd for hosting.
there.
yes
ok so what have you coded to do that
nothing because i have no clue how to do it
If you want to do something when a new user joins, listen to the guildMemberAdd event and if you want just one guild, filter by checking if the guild is that or if you want to any guild setup by a command seperated, use a Database
@exotic cradle as you trying to
ok
member and also the guild
yeah
ok that makes it easier
just check if the guild.id equals your support guild
if it does then go ahead with the code, else return
google my friend
big brain bot developers still use google since they cannot remember everything
Good developers have high ram usage so that's why we always forget everything
Where would we be without Stackoverflow 
When you don't know about something, google it first and if you didn't find anything about it... Ask for support... This is a better way of doing it
would this work?
bot.on('guildMemberAdd', member => {
member.guild.channels.get('channelID').send("Welcome");
});
idk i found it somewhere dont ask
whoever wrote that is high
Very high
dont copy and paste code if you dont know what it does
@left lake member.guild is the guild the member joined
i found it on stackoverflow
now someone is saying:
client.on('guildMemberAdd', member => {
client.on('message',
var role = member.guild.roles.find('name', 'Beginner role name'); // Variable to get channel ID
member.addRole(role); // Adds the default role to members
member.guild.channels.get('JOIN/LEAVE Channel ID').send({embed: {
color: 3447003,
title: "SERVER NAME Welcome Bot!",
url: "WEBSITE URL",
description: "Welcome " + member + " to the Server name discord server!",
fields: [{
name: "Information",
value: "Some info on the server"
}
],
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "ยฉ NAME OF SERVER 2018 - 2019"
}
}}); });
every GuildMember has a guild property which returns the guild itself
nope it jsut returns the member
I mean, sometimes I use member object to get guild data, that's because I hate to put too much args in functions
you want it to work in a certain guild
so you'd want to get the guild id and check if it equals the support guild incase the bot is in multiple guilds
its in 5 last time i checked 
so get the guild id from member.guild
//Do your code
} else {
return;
}```
^
yeah ima ask my friend as i have no clue whats going on 

listen i started a week ago
i wish i had this kind of help when i first started coding
i have no clue what to do here
.
No dotposting
i wish i had this kind of support when i started
we are giving you everything you need
coding isn't a "im just gonna go to this person"
else you're not really coding just copying
well how am i supposed to commit learn script when i have no clue how to make it
because i asked my friend 30 minutes ago and hes still doing something
so i came here
we are helpign you
and im done with coding lol
my command works but it errors at the same time
like wth
Start researching some basic CS lessons
yes i have stuff like say something and he says something
Question
if (message.content.startsWith(;f)) {
message.channel.send('f');
}
Headless question
?
Question without the actual question is headless
if u hav ea question ask it
dont just say question
๐
alson i love coding
my command works but it sends an error at the same time
Which error?
i use moment.js for my bot
How do you make the invite manager turn online
wrong place
go ask in their discord
this discord from wha ti know doesnt help you with bots on the website
you have to go to the bots support server
Nah
Ok thanks
What was its link?


Hmm, so my bot has dm help menus
with remotes that refresh etc
How much of a project would it be to "scan" the dm with the bot and try to delete past messages
in the easiest sense, someone has 6 help menus
that sounds like api spam
you think so?
it would essentially just do 2 tasks per command
it would detect that someone has 2 active menus, and remove the previous
@maiden mauve yeah but the scanning and deleting past messages?
it would detect that someone has 2 active menus, and remove the previous
@maiden mauve you could, instead, save the message ID for later removal
This way you'd be able to delete it when sending a new menu, without having to retrieve 'n delete the whole chat
Can someone tell me what this means?: "I could not join the voice channel: Error: FFmpeg/avconv not found!"
It still joins the voice channel
You don't have ffmpeg/avconv
It used to work though.
guys, a doubt, to make a mute system, is it preferable to just set a setTimeout or is the mute information saved in the database?
preferably in a database for persistance but either way works.
I do both just incase the bot restarts
ye
yes, I was thinking about exactly that problem when the bot resets
but then after the bot resets, do you pull all users and start setTimeout them all?
I dont, would hit performance a little hard to set all those timeouts at once
I sweep the db every now and then
but the other will be good if you want exact times
got it
so the best way then is to save it in the database and keep checking every x seconds?
yep that is what I do
I save the time I epoch seconds then every 15 seconds I check if this is up yet
@tribal rock settimeout
if your bot restarts its a pain in the ass to go into the database in each column and continue the mute time
i tried coding something like it for 3 days and it worked but kept repeating mutes
why is my array.filter not working
array.filter(i => i !== user.id)
I dont understand
I tested it on an online code editor and it works
@left lake if I don't use a database, when my bot cycles, it will lose all mutes
but you'd still have to code it going into said database
getting every single mute in every single guild if there are any
then getting the times and setting a timeout for said time
i spent 3 days on it and the closest i got was it working, however it'd log the same guild multiple times
Anyone have a good guide they suggest to read about sharding discord bots? I'm reading https://maah.gitbooks.io/discord-bots/sharding.html currently
but wondering if there are any that people use
doesnt the idiotsguide have a section on sharding
i'd read there
tyvm ๐
You could also read this https://discordjs.guide/sharding/
in my mind, calculating the current time + the time the user was mutated and at each x seconds checking if the current date is equal to or greater than the one recorded in the bank does not seem to be a problem @left lake
how many guilds is your bot in
347
not as easy as that
each guilds muterole wont be the same ID
so you'd have to make a database to store the guilds muterole,
true
then for the guilds that have muted members in them you'd have to get the muterole, set a timeout for each muted member (store the TIME THEY'RE TO BE UNMUTED), do some math
then set a timeout for the difference
else remove the users role
in the next few days, when I have time, Iโll try to play around with it a bit and see what I can
i have seen some embeds without the color border has anyone have any ideas how to make it?
Set the color to something
the syntax is different depending on what language and library
repl.it does restart
There isnโt a way to make it 24/7 but you can get it to be a lot further
I saw a way
Open a web port and have something ping it
But idk how to put
trust me, you canโt
Servers have to restart
You can make it for like 6-7 hours without being in the tab
the just reopen the tab and it will reload the bot
Open a web port and have something ping it
@delicate merlin
Theres a website online to show u how to add a ping service to your bot
yes
uptimerobot
what i use
but again, it cant go 24.7
maybe like 6-8 hours before a restart/need to open the tab
i would suggest hosting it on a raspberry pi
yeah, that is what i do
host it locally?
same as hosting on a vps
run the code locally
i dun no know to code
just local
Can you mention how
Quick question about sharding, just rearing through the tutorial now.
https://github.com/discordjs/guide/blob/master/code-samples/sharding/getting-started/12/index.js
https://github.com/discordjs/guide/blob/master/code-samples/sharding/getting-started/12/bot.js
in the index.js we have the ShardingManager which takes token as one of the options parameter.
However, in the bot.js we still have client.login('token');
Is there a reason in bot.js that its not using process.env.DISCORD_TOKEN? it seems to set it here https://github.com/discordjs/discord.js/blob/master/src/sharding/ShardingManager.js#L140
Congrats ๐
i gay
how do you enable safe search for a bot using youtube_dl python
youtube is safe tho
No he means he doesnโt want like potentially inappropriate content played on his bot
YouTube isn't fully safe then
but of course YouTube has inappropriate content
:/
(belle delphine twerking)
...
worse than that
Itโs a music bot so Iโm more worried about thumbnails

then don't put the thumbnail
just an examplee
(is the thumbnail an issue? Nsfw content on YouTube videos are not allowed)
On it's thumbnail especially
bruh there's literally a video of a guy stroking his pp and it's count as educational
Excuse me wtf
well, it's okay
Jk lol
no it's not
How did you find this...
Why were u looking for this video...
ยฏ\_(ใ)_/ยฏ
sus
i tried to find some weird shit and it popped up
lol
very long pp ay
Well i think he testing to see if there was weird shit to see if he would remove thumbnail or not
Yeah letโs hope
Horny or degenerate people ofc, or ofc very high people
Does someone know if lavalink has safesearch or can I allow it somehow?
I don't think it does
You gotta use some api, lavalink or ffmpeg or anything like this doesn't provide such thing
Ok, I will look for something
anyone help
my bot won't go onlone
online
it keeps on saying this error
does it
got rate limited
or so?
what
then log what it says
oh
I donโt know what you are doing .โ. I do python
429 (TOO MANY REQUESTS) You are being rate limited, see Rate Limits.
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
@delicate shore
Too many disconnects / reconnects. Are you mass sharding / perhaps something in a for loop like client.login?
yeah
hmm
had this issue with PM2 i needed to enable a limit for how many times it allows the process to restart
you have no sharding issue
(doing client.login many times) - but yeah prob not an issue
429 means that he's making HTTP requests too fast.
something in your code just spams the API
oh
ah good call, possibly pm2
its normal
if you dont want to debug something comment it out
//
ok
or /* */
hmmm
if youre fancy
ok
bot.on("debug", console.debug);
bot.on("warn", console.warn);
bot.on("error", console.error);
bot.on("ready", () =>
console.log(`Serving on ${bot.guilds.cache.size} servers!`)
);```
```js
bot.on("shardDisconnect", (event, id) =>
console.log(
`Shard ${id} disconnected (${event.code}) ${event}, trying to reconnect!`
)
);
bot.on("shardReconnecting", id => console.log(`Shard ${id} reconnecting...`));```
anything out of these
that needs to be commented out?
already sharding?
was about to ask
in D.js V12 the reconnecting event was renamed to shardreconnecting
or something like this
sharding is 1500 guilds +
@solemn latch your bot got approved wow
ye
gratz
anyone help m pls
already up a handful of servers 
me*
@delicate shore how many servers your bot is in?
superbrain
82
hoi
not nowhere close
there is a explanation
how u dont have any spotify image
??
i was just messsing up
so i have this command
@lusty quest
@opal plank he has the code right
sharding is for bots with 1500+ guilds @delicate shore
@restive pebble its a Non Released Album on Spotify
@earnest phoenix
in the command
use a embed
oh kk
@restive pebble ?
me
Then the only way to fix is just to replace the image with an image saying no image
Is there away to modify a .js file's content using JavaScript? I am trying to make an AI fix bugs for me cuz I'm lazy.
I gotta do that to mine to @restive pebble
ok
anyone help @opal plank @lusty quest what's the sol
wdym by Silicon Valley?
@delicate shore too much spoonfeeding dude
you wouldnt get it then
๐ญ
remove sharding altogether, earlier on it'll only cause you headache
its a HBO Series about a few Guys in the Silicon Valley. Its fun but also stupid at the same time
your bot doesnt have nearly enough guilds to be using sharding yet
but that's not sol
@opal plank he is right with sharding. https://discordjs.guide/additional-info/changes-in-v12.html#client
does that even have anything to do with me wanting to write an AI to help me fix bugs
Is there away to modify a .js file's content using JavaScript? I am trying to make an AI fix bugs for me cuz I'm lazy.
@earnest phoenix
so you want to do machine learning without... even knowing how to edit a file
or did i miss the sarcasm here
give me a reason someone with 80 guilds would use sharding @lusty quest
congrats your bot is generic
read the docs. there where some Breaking changes with the client events
i am on v12
i dont see the connection about client connection and sharding
const Discord = require("discord.js");
const { Client, Util } = require("discord.js");
const client = new Discord.Client();
const searchYT = require("yt-search");
const ytdl = require("ytdl-core");
const dotenv = require("dotenv").config();
const moment = require("moment");
const worldometer = require('worldometer-coronavirus-info')
const db = require("quick.db")
//equire("./server.js");
const fetch = require("node-fetch");
const YouTube = require("simple-youtube-api");
const giveMeAJoke = require("discord-jokes")
const TOKEN = process.env.BOT_TOKEN;
const DPREFIX = process.env.DPREFIX;```
everything i use
I only know how to edit .json files's contents and I learned JavaScript through cracking up source codes so expect me to not know a lot of stuff's name @earnest phoenix
i guess he uses the internal sharding anyways
it's internal sharding
it will not generate any shard but its still running
editing files is the same process for any extension lol
you write bytes to it boom
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
429 hit on route /gateway/bot
my bot keeps spamming that
@delicate shore wait 24 Hours
and never stops
in case of text files, you write text which is still internally bytes
you should stop spamming the api, 429 is a ratelimit
nv
which package is yours @restive pebble
oh
you should stop spamming the api, 429 is a ratelimit
@earnest phoenix which api
@delicate shore turn off bot, set a timer for 24h, dont turn it on till then
@delicate shore Discord API
discord's lol
isnt a ratelimit like 15 mins?
now die
also fix what is spamming the API
enjoy spamming api
ratelimits are dynamic
otherwise it will return
@crimson vapor not even close, it can go up to 19h
who started the coding
shoo
of this bot
i had 24 Hours
oh, I just had 15 mins
you keep spamming and spamming
we awnsered
read the awnsers ffs
jesus christ dude
ratelimits are dynamic and they can adjust to the frequency of you crossing, severity and quantity
it's why the docs explicitly state not to hardcode ratelimits
wait until you are no longer ratelimited then see what spams. and dont keep it running for to long or you are ratelimited again
wait until you are no longer ratelimited then see what spams. and dont keep it running for to long or you are ratelimited again
@lusty quest ok my question is how can i see that tho?
console.log()?
i dont know your code. its your issue to fix not mine
check the embed returning from the response
json*
the response payloads have the info you are looking for
i dont think djs exposes those so you'll have to manually make the request
hey @lusty quest i remixed my project which means creating a duplicate one and regebrating bot token now how what should i look for thanks
yikes a help vampire
it is not online
don't bother helping help vampires, you'll save yourself time and sanity lol
sorry it is online
nvm
3
3
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 15ms.```
@earnest phoenix going to follow that advice
my bot keeps on logging
clearly he doesnt want help
@delicate shore how many servers is your bot in, is there a reason you are using sharding?
I'll take 5 mins to help, not a second longer
82
mmk so no need to use sharding if your bot is under 1000
because the tuorial i saw used it
in fact it might slow you down to shard
or 2500 usually
ok, I need help ( or a point to the right direction...) ๐ Bear with me though, I suck at devops ๐ฉ I currently have my djs bot hosted in Heroku and that's working fine. Now what is best practice when I do more development? So that I can test new features before they are available for everyone
vampire guys, dont even bother that one
which tutorial are you using?
@lime vapor tl;dr heroku is hot shit
tuts on discord bots suck in general
@lime vapor first step would be getting the bot on a proper stable platform
learn to code and read docs properly
@opal plank then im not sure what "new features" are
or run it locally
best practice is run locally or pay for a server
ok
not you the other guy
ok cool
awesome, follow the discord.js tutorial
ok
throw out your bot
heroku is for services and servers not discord bots
they aggressively take down bots
yeah
glitch is banning users that make bots
it has been installing packages from last 20 mins
I was hoping it wouldn't come to those options... So far Heroku's been working for me fine with just one bot (enough dyno hours to keep it online)
glitch is banning users that make bots
@warm cloud no
as with any free service
im not sure a) why you're using heroku b) what new features you're hoping for
its not because it works now that you should keep doing it, to avoid future problems you should definetly pick a proper place to host the bots
and c) how you would get said features
there are vps's for as little as 2 dollars a month
i am gonna buy vps
yeah
once my glitch membership overs
@lime vapor Step 1, move from heroku
Step 2, how much knownledge of js do you have?
Step 3, how much of d.js do you know?
lang wars reee, but we all know Scratch is the ultimate language
lmao
Ok, I'll start looking into other hosting options (I do hate that part though). I know enough of JS and DJS and will not switch to Python with this one
the python part was a jok
I know I know ๐
so im taking it as a basic/moderate understanding of js and library
what is your bot about?
it's a crowsourcing/queue bot for games like ACNH (people can request in-game currencies and get into people's islands)
hmm
that sounds a bit too complex to survive properly on heroku
it's a really unstable environment
was thinking the same
and c libs aren't supported for example
what good practices would you be looking for?
but if I what to switch something up, as in add a new feature for giveaways, I do not want those commands showing up in my bot's help until I release it to the production.
make them hidden until you finsih
yeah
make a beta or bleeding bot
so that the prod one doesnt die when you screw over
another instance meaning I'd have a tester bot in Dicord Dev as well, right? so it'll have a different token?
it would probably not get on dbl
it would have a seperate token, yes, because its a different bot
Gateway : LINK HIDDEN BECUASE BOT
Version : 6
Encoding : json
Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] [CONNECTED] HIDDEN in 83ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] [IDENTIFY] Shard 0/1
[WS => Shard 0] [READY] Session HIDDEN.
[WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 712ms.
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.```
does this cause slowing down of bot?
i dont see a problem here
this is logging
assuming you're the uguy with 80 servers the abstration of sharding is a bad idea for speed
ook
what tells you its slower is testing not the logs
i commented it put
the logs are not just gonna say "the bot is slower lmao"
youd prob have a test server/support server
usually its a good idea to leave the beta branch accesible for bug testing in your server
getting people to break your bot on purpose and reward them with points
yes, of course, I just don't want both bot instances with the same token replying to me
dont use the same token
use a different acc
if your problem is token, put it in a config file to load a different config per bot once you move it over
i just realised
i am pinging my bot internslly
require("./index")
var express = require("express");
var http = require("http");
var app = express();
// Ping The Apps.
app.use(express.static("public"));
// http://expressjs.com/en/starter/basic-routing.html
app.get("/", function (request, response) {
response.sendStatus(200);
});
// Request Listeners.
var listener = app.listen(process.env.PORT, function () {
console.log("Your app is listening on port " + listener.address().port);
});
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 270000);```
this
dir/ Stable = > config.token = tokena
dir/ Beta => config.token =tokenb
i don't think that works anymore
they'll basically be clones of eachother, you'll only need to switch some minor things
ok, thanks @opal plank ! I got what I needed to go forward from this ๐
no, im ignoring you @delicate shore
ok
(also I have to say that the prev Silicone Valley comment was so... spot on ๐น Didn't want to step into the discussion at that time)
Hello
const DBL = require('dblapi.js'); const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' }); dbl.webhook.on('ready', hook => { console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path}); }); dbl.webhook.on('vote', vote => { console.log(User with ID ${vote.user} just voted!); });
What the webhookAuth: Password
hey @opal plank i am sorry dude i panicked that what happend to my bot pls understand because it's first time my bot is in 82 servervs and i panicked hope you get it and forgive me
Can I get multiple titles in a embed?
No lol @hazy sparrow
hey @opal plank i am sorry dude i panicked that what happend to my bot pls understand because it's first time my bot is in 82 servervs and i panicked hope you get it and forgive me
@delicate shore discord has ratelimited ur bot
Now go and email them saying sorry about spamming their api
hello bot developers
can i ask you
which meme website i put
reddit/r/meme?
or
reddit/r/memes
no, dankmemes
what could be the reason of this error
how to make bot send images without links
attach the image
create an embed using the embed builder and put it inside send(here) or just send({ embed: { title: "Hello" } });
could u give me the exact line?
no
channel.send is a function
do you know how to use discord.js embeds?
if no, read this: https://discordjs.guide/popular-topics/embeds.html
h
@lime pumice change the const name to something else channel is a reserved word in discordjs
It'll make sense more than anything
ok...
i am getting this error for let statement= Lexical declaration cannot appear in a single-statement context
what
You can't do this:
if (condition) let a = 5;
you can do this:
let a;
if (condition) a = 5;
or this:
if (condition) {
let a = 5;
}
actually
@cinder patio it worked
let a;
if (condition) {a=5}```
I dont know what to add for my discord bot
That's the same as the 2nd example I gave. if (condition) let a = 5; is not allowed because you declare a in a context that you immediately leave
to*
now i am getting error zipCode is not defined @cinder patio
Same problem as before
You declare and assign the variable in a context and immediately leave it again
so what should i do?
You have to put all your code inside that first if check
if (condition) {
// If "condition" is a truthy value, this code will execute. Every variable you declare here can only be used here.
let something = 1;
}
console.log(something); // "something" is not defined.
Why not just pass in a string for location

that's just wrong
A YT TUTorial
Mine
The administrator part is not comming
Like the pop up
hasPermission
A YT TUTorial
@earnest phoenix woopsie doopsie, you did a big mistake. please NEVER watch yt tutorials
And it has some syntax error
You are missing a ) in the third if statement
@earnest phoenix woopsie doopsie, you did a big mistake. please NEVER watch yt tutorials
@tight plinth I dont understand reading
You are missing a ) in the third if statement
@cinder patio line number?
fair, but reading is way better than watching outdated yt tutorials
Nice yt vid
...cache
if you're already watching a yt video, at least dont make spelling mistakes lol
Hi, I am trying to setup nginx on port 80 on ubuntu to route to different ports depending on the domain
Is there any guide on how to do this, or can someone help
I've been searching google for the past hour and I can't find how to do it
you need to configure your nginx.conf file as well as your domain file in the sites-enabled and sites-available folder
??
you need to configure your nginx.conf file as well as your domain file in the sites-enabled and sites-available folder
@quartz kindle wdym
nginx's configration is done through config files
all config files are present in nginx's installation folder
how much time will it take for open weather api key to activate?
nginx's configuration files are similar to json, and work in blocks, like this
http {
// general nginx configuration
server {
// configuration for a specific website or domain name
location / {
// configuration for a specific url
}
}
}
@hasty sparrow what I mean is like this
http://domain1.com/ => 127.0.0.1:8080/
http://domain2.com/ => 127.0.0.1:8443/
nginx configuration files also use the include keyword to merge configuration files
Ahh
is your server running linux/ubuntu?
Nginx proxy
open the nginx.conf file
ok
Just type it
ADMINISTRATOR
Will it work the same way?
yes
so do i have to include a space and than paste my api key?
not a space
ok
if they accept api keys via query parameters, you add a &key=yourkeyhere or whatever they use
do you think 20000 calls per month would be fine for an api?
if they only accept keys in headers, then you have to put it in the headers, not in the url
Depends on the API
depends, 20k calls for a math problem is more than fine, 20k calls for something like translation, AI or OCR is too much
how much time it will take for the key to activate?
well its an game stats api
is it yours?
depends upon how many servers ur bot is in
for some odd
no
reason
when i try to change prefix for this serverv
in my db
my bot crashes
idk why
lmao
why open weather map api not working๐ซ
did you read their docs?
http://api.openweathermap.org/data/2.5/forecast?id=524901&APPID={YOUR API KEY}
@golden condor https://gist.github.com/soheilhy/8b94347ff8336d971ad0#step-9-optional----redirecting-based-on-host-name
@hasty sparrow i saw that
oh wait
no i didn't
did you open your nginx.conf?
but which file do I puy it in
Your server block files in /etc/nginx/sites_available
server {
listen 80;
server_name example1.com;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
server {
listen 80;
server_name example2.com;
location / {
proxy_pass http://127.0.0.1:8181;
}
}
server {
listen 80;
server_name example3.com;
location / {
proxy_pass http://127.0.0.1:8282;
}
}```Where do I put this?
and is that all I need?
Your server block files in
/etc/nginx/sites_available
@hasty sparrow in default?
the configuration starts with nginx.conf
if your nginx.conf has this line in it : include /etc/nginx/sites-enabled/*
then you can put it in any file in the sites-enabled folder
you can even put it directly in nginx.conf
whatever you want
as long as its inside the http block
so you can put it in any file in the sites-enabled folder, just so you dont get your nginx.conf crowded
its like requiring files in node
should I remove what is already there?
define cache
dude
please
Bruhh
also
can I do
learn js
I changed that but it didint save ๐ฆ
server_name: domain1.com domain2.com domain3.com; ?
server {
listen 80;
server_name corynth.xyz www.corynth.xyz;
location / {
proxy_pass http://127.0.0.1:8080;
}
}```Like this?
yes
error country not defined temp_max not defined temp_min not defined
Console dir parsedWeather?
you can pass in more than 1 domain name, but then all domains will point to the same port
unless you use different urls for each port
so I can have www.domain.com + domain.com link to one port
and then like api.domain.com link to another ?
yes
@wheat hornet is the error "country is not defined" or "cannot read country of undefined"?
show the actual error
cannot read property of country of undefined
then the problem is not country
its sys and main
which likely dont exist
so console.log(parsedWeather) so you can see what it actually looks like
at parsedWeather[0].main it says cannot read property of 0 undefined
did you console.log it?
did you console.log it?
nope
i've told you to do it 3 times
execute the code
u need a api key
how long does it will take to activate
from the page
ya i have
well um i'm not sure
Anybody can help me about the meme
what meme
did you already receive one?
@quartz kindle ya i have received one
if you received one, then its already active
use the reddit api
??
than why on earth its showing me invalid api key
Can you mention
Here is the code
const Discord = require('discord.js')
const bot = require('../config.json');
const emoji = require('../emoji.json');
const fs = require("fs");
const chalk = require("chalk");
const https = require("https");
module.exports.run = async (bot, message, args) => {
if(message.content === bot.prefix + "meme"){
//https://some-random-api.ml/meme
https.get('reddit.com/r/meme',res => {
res.setEncoding("utf8");
let body = "";
res.on("data", data => {
body += data;
});
res.on("end", () => {
body = JSON.parse(body);
var randomColor = Math.floor(Math.random()*16777215).toString(16); // randomizes colour again
const MemeEmbed = new Discord.MessageEmbed()//creates embed
.setAuthor('Meme Module')
.setTitle("Here's your " + body.category + ' meme') //the main message
.setColor('#' + randomColor) // sets the colour to the random colour
.setDescription(body.caption) //sets text
.setImage(body.image)
//{"link":"img link"} in this case it is an image, use .setImage for that.
message.channel.send(MemeEmbed); //sends the embed
});
});
}
}
module.exports.config = {
name: 'meme',
description: 'Showing Random meme',
usage: `${bot.prefix}meme`,
accessableby: 'Members',
aliases: []
}
look at the api key idc gona regen new
@quartz kindle
@wheat hornet why not use weather.js???
Who can help me with my meme command
you can get the body as json no need for converting
@wheat hornet why not use weather.js???
@pure lion i dont know about it as i said i am new to javascript i switched from python cause java is fast
Guys who can help me fix my meme
@wheat hornet is the key supposed to start with "OpenWeatherAPI"?
yes
@clever vector have you any idea how to work with APIs?
@wheat hornet im looking for examples and i dont see any example with an api key starting with that
how do i send stuff to my glitch project through node? basically http requests
@wheat hornet im looking for examples and i dont see any example with an api key starting with that
@quartz kindle i removed that and still error
invalid api key
@pure lion
what
is
full
stacc
can I let my bot make emojis?
@earnest phoenix what did you want to send to your bot?
invalid api key
@wheat hornet maybe you reset it
well then i cant help you any further. if you want i could try testing it
@earnest phoenix what did you want to send to your bot?
@lusty quest quick.db stuff
np thx for ur help so far
ew sql
why not a proper Database?
x)
so you dont need to do some stupid workarounds
why not a proper Database?
@lusty quest thank you from yesterday btw :DDD
basically if someone runs SMTH the app sends some stuff to the glitch project and it saves in quick.db AND HAIL QUICK.DB AAAAAAA
np
no quickdb bad
for beginners too
? can I make my bot add emojis to an server?
good for beginners and shit people like me and bad for advanced users
quick.db is a SQLite Database. its not really designed to work remotely. but you could try and build a API
use mongo you can connect and its probably easier
then send a Post Request to your API this will then save it to your quickdb
yeah basically manage my glitch project through node on my pc
@pure lion are there some good weather.js tutorial available
which i can't smh
@wheat hornet no, but theres me
tutorial is not good~ Justii
ill be back, gonna write a weather command and a npm command
so
how do i send commands to my glitch project remotely . i saw someone use app.on(SMTH) to get requests from other apps remotely
? can I make my bot add emojis to an server?
(just hope glitch doesn't kill me for using them as a backup)
i can just use github...
and pull requests from them
regenerated the 3rd apikey in a row and its invaild tooo wow
maybe you referenced it wrongly
can someone help me
like i spelled process.env.TOKEN in lowercase and got an error on glitch @wheat hornet
nope its not that
which library, Justii
discordjs
which js lib



