#development

1 messages ยท Page 1043 of 1

left lake
#

you are right

lyric mountain
#

Just give use some code to start with

exotic cradle
#

@left lake Please show me.

lyric mountain
#

Do you have some code you've made?

left lake
#

my latency is 157 and my api is 28

#

i dont spoonfeed

#

have you googled anything

#

have you tried coding anything

hushed jungle
#

257ms now

#

I can live with that

left lake
#

or did you just come here and expect someone to deliver it on a silver platter with your name on it

exotic cradle
#

Uhm, do you wanna see my 304 lines of code @lyric mountain?

left lake
#

๐Ÿ˜

#

its a client.on event

hushed jungle
#

But this includes API latency

left lake
#

why is it 304 lines

lyric mountain
#

Only 304? bloblul

left lake
#

we dont need your entire index file

exotic cradle
#

because its a big bot?

left lake
#

yes my bot is big too

earnest phoenix
#

monkaHmm big bot

left lake
#

we dont need 304 lines of index code

exotic cradle
#

ok, um im just asking for some scripts as my friend is down.

left lake
#

you need to give us some code as to what you've done

exotic cradle
#

...

left lake
#

you want to make a greeting when a user joins a guild, right

lyric mountain
#

We can't give u code

exotic cradle
#

yes

left lake
#

so

lyric mountain
#

But we can help u make that code

left lake
#

what code do you have to do that

exotic cradle
#

Uh0

lyric mountain
#

Just as a note, do you use any database?

#

Don't say json plz

exotic cradle
#

No..?

left lake
#

i think he wnats it for one guild

#

do you want this for one guild

exotic cradle
#

Yes I do.

left lake
#

like it'll only work on one guild

#

ok

#

then he can just hardcode it

exotic cradle
#

My support server and most people already have one.

left lake
#

when a user joins your guild, all your doing is fetching a channel from the client and sending a message to it

exotic cradle
#

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

left lake
#

ok so what have you coded to do that

exotic cradle
#

nothing because i have no clue how to do it

earnest phoenix
#

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

exotic cradle
#

ok

left lake
#

what properties does guildMemberAdd return

#

member and guild or just member

earnest phoenix
#

member and also the guild

left lake
#

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

exotic cradle
#

Ok, I know what to do...

left lake
#

google my friend

#

google

#

big brain bot developers still use google since they cannot remember everything

lyric mountain
#

Good developers have high ram usage so that's why we always forget everything

hushed jungle
#

Where would we be without Stackoverflow smug_5

left lake
#

facts

#

stackoverflow coming in clutch with those outdated guides ๐Ÿ’ช

earnest phoenix
#

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

exotic cradle
#

would this work?

bot.on('guildMemberAdd', member => {
member.guild.channels.get('channelID').send("Welcome");
});

left lake
#

member.guild?

#

๐Ÿ˜•

exotic cradle
#

idk i found it somewhere dont ask

left lake
#

whoever wrote that is high

lyric mountain
#

Very high

left lake
#

dont copy and paste code if you dont know what it does

earnest phoenix
#

@left lake member.guild is the guild the member joined

exotic cradle
#

i found it on stackoverflow

left lake
#

i thought guildmemberadd returned the member and guild

#

hangon

exotic cradle
#

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"
}
}}); });

earnest phoenix
#

every GuildMember has a guild property which returns the guild itself

left lake
#

nope it jsut returns the member

lyric mountain
#

I mean, sometimes I use member object to get guild data, that's because I hate to put too much args in functions

left lake
#

either way

#

isn't a good thing

#

member.guild.channels*

earnest phoenix
#

Wot

#

Oh yea but that still works

exotic cradle
#

ima just try it and commit see what happends

#

*happens

left lake
#

you want it to work in a certain guild

exotic cradle
#

yes

#

i do

left lake
#

so you'd want to get the guild id and check if it equals the support guild incase the bot is in multiple guilds

exotic cradle
#

its in 5 last time i checked coolcry

left lake
#

so get the guild id from member.guild

earnest phoenix
#
//Do your code
} else {
return;
}```
left lake
#

^

exotic cradle
#

yeah ima ask my friend as i have no clue whats going on flushed

earnest phoenix
left lake
#

we're literally

#

helpign you as much as we can

exotic cradle
#

listen i started a week ago

left lake
#

i wish i had this kind of help when i first started coding

exotic cradle
#

i have no clue what to do here

left lake
#

im self-taught

#

you think you have no clue

exotic cradle
#

.

lyric mountain
#

No dotposting

left lake
#

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

exotic cradle
#

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

left lake
#

we are helpign you

#

and im done with coding lol

#

my command works but it errors at the same time

#

like wth

lyric mountain
#

Start researching some basic CS lessons

exotic cradle
#

except i dont' know what you're talking about

#

thats the issue

lyric mountain
#

You need to start with the fundamentals first

#

Learn about cs concept in general

exotic cradle
#

yes i have stuff like say something and he says something

wraith wing
#

Question

exotic cradle
#

if (message.content.startsWith(;f)) {
message.channel.send('f');
}

lyric mountain
#

Headless question

wraith wing
#

?

lyric mountain
#

Question without the actual question is headless

left lake
#

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

lyric mountain
#

Which error?

left lake
#

i use moment.js for my bot

wraith wing
#

How do you make the invite manager turn online

left lake
#

wrong place

#

go ask in their discord

#

this discord from wha ti know doesnt help you with bots on the website

lyric mountain
left lake
#

you have to go to the bots support server

lyric mountain
#

Nah

wraith wing
#

Ok thanks

lyric mountain
#

What was its link?

left lake
#

its on the website

#

somewhere

earnest phoenix
#

Try invite-manager

#

Bruh

lyric mountain
wanton dew
maiden mauve
#

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

sudden geyser
#

that sounds like api spam

maiden mauve
#

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

clever vector
#

Hello there

#

Developers

#

Can you help me make my bot online 24/7

lyric mountain
#

Your wallet can

#

And a bit of googling

sudden geyser
#

@maiden mauve yeah but the scanning and deleting past messages?

lyric mountain
#

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

maiden mauve
#

๐Ÿ‘Ž

#

oops

#

๐Ÿ‘

#

๐Ÿ™‚

real hearth
#

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

lyric mountain
#

You don't have ffmpeg/avconv

real hearth
#

It used to work though.

tribal rock
#

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?

earnest phoenix
#

preferably in a database for persistance but either way works.

amber fractal
#

I do both just incase the bot restarts

earnest phoenix
#

ye

tribal rock
#

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?

amber fractal
#

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

tribal rock
#

got it

#

so the best way then is to save it in the database and keep checking every x seconds?

delicate merlin
#

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
#

ok

#

thanks for the help guys

left lake
#

@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

tired nimbus
#

why is my array.filter not working

#

I dont understand

#

I tested it on an online code editor and it works

tribal rock
#

@left lake if I don't use a database, when my bot cycles, it will lose all mutes

left lake
#

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

fresh carbon
#

but wondering if there are any that people use

left lake
#

doesnt the idiotsguide have a section on sharding

fresh carbon
#

ah that does also

#

๐Ÿ˜„

left lake
#

i'd read there

fresh carbon
#

tyvm ๐Ÿ™‚

sudden geyser
fresh carbon
#

๐Ÿ˜„ I'll read em all

#

ty ty

tribal rock
#

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

left lake
#

how many guilds is your bot in

tribal rock
#

347

left lake
#

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,

tribal rock
#

true

left lake
#

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

tribal rock
#

in the next few days, when I have time, Iโ€™ll try to play around with it a bit and see what I can

lusty spade
#

i have seen some embeds without the color border has anyone have any ideas how to make it?

delicate merlin
#

Set the color to something

#

the syntax is different depending on what language and library

lusty spade
#

im using djs

#

nvm i found out how

#

Set the color to something
^^^^

clever vector
#

Hello guys

delicate merlin
#

There isnโ€™t a way to make it 24/7 but you can get it to be a lot further

clever vector
#

I saw a way

delicate merlin
#

Open a web port and have something ping it

clever vector
#

But idk how to put

delicate merlin
#

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

zenith terrace
#

Theres a website online to show u how to add a ping service to your bot

delicate merlin
#

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

clever vector
#

Host it on?

#

raspberry pi?

delicate merlin
#

yeah, that is what i do

clever vector
#

No money

#

xD

delicate merlin
#

host it locally?

clever vector
#

How

#

xD

solemn latch
#

same as hosting on a vps

delicate merlin
#

run the code locally

clever vector
#

i dun no know to code

solemn latch
#

just local

clever vector
#

Can you mention how

delicate merlin
#

i dun no know to code
@clever vector what

#

the what are you doing on replit

clever vector
#

My friend help me

#

๐Ÿ™‚

fresh carbon
#

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

autumn summit
#

verified bot dev

#

finally

fresh carbon
#

Congrats ๐Ÿ™‚

rare flax
#

i gay

summer basin
#

how do you enable safe search for a bot using youtube_dl python

dapper rapids
#

youtube is safe tho

foggy scaffold
#

No he means he doesnโ€™t want like potentially inappropriate content played on his bot

pale vessel
#

YouTube isn't fully safe then

summer basin
#

:/

#

Iโ€™m sure itโ€™s fine

#

YouTube hates everything

pale vessel
#

but of course YouTube has inappropriate content

summer basin
#

:/

foggy scaffold
#

(belle delphine twerking)

summer basin
#

...

pale vessel
#

worse than that

summer basin
#

Itโ€™s a music bot so Iโ€™m more worried about thumbnails

earnest phoenix
pale vessel
#

then don't put the thumbnail

foggy scaffold
#

just an examplee

earnest phoenix
#

(is the thumbnail an issue? Nsfw content on YouTube videos are not allowed)

summer basin
#

Ok

#

Then it should be good

earnest phoenix
#

On it's thumbnail especially

pale vessel
#

bruh there's literally a video of a guy stroking his pp and it's count as educational

earnest phoenix
#

Excuse me wtf

pale vessel
#

well, it's okay

summer basin
#

Jk lol

pale vessel
#

no it's not

summer basin
#

How did you find this...

foggy scaffold
#

Why were u looking for this video...

pale vessel
#

ยฏ\_(ใƒ„)_/ยฏ

foggy scaffold
#

sus

pale vessel
#

i tried to find some weird shit and it popped up

foggy scaffold
#

lol

pale vessel
#

very long pp ay

earnest phoenix
#

Well i think he testing to see if there was weird shit to see if he would remove thumbnail or not

pale vessel
#

anyway, other bots don't seem to be getting trouble from it

#

so you should be fine

summer basin
#

Yeah letโ€™s hope

pale vessel
#

who would play those videos anyway

#

and why

summer basin
#

....

#

My friends discord server..:.

earnest phoenix
#

Horny or degenerate people ofc, or ofc very high people

summer basin
#

Sounds right

#

I should sleep itโ€™s 11:40 pm...

fast glen
#

Does someone know if lavalink has safesearch or can I allow it somehow?

earnest phoenix
#

I don't think it does

#

You gotta use some api, lavalink or ffmpeg or anything like this doesn't provide such thing

fast glen
#

Ok, I will look for something

delicate shore
#

anyone help

#

my bot won't go onlone

#

online

#

it keeps on saying this error

#

does it

#

got rate limited

#

or so?

lusty quest
#

enable the debug event

#

client.on("debug")

delicate shore
#

what

lusty quest
#

then log what it says

delicate shore
#

oh

summer basin
#

I donโ€™t know what you are doing .โ€”. I do python

fresh carbon
#
429 (TOO MANY REQUESTS)    You are being rate limited, see Rate Limits.
#

@delicate shore

trim saddle
#

on_debug is the event in d.py

fresh carbon
#

Too many disconnects / reconnects. Are you mass sharding / perhaps something in a for loop like client.login?

lusty quest
#
client.on('debug', console.log)
#

i guess he stuck in a reconnection loop

fresh carbon
#

yeah

delicate shore
#

hmm

lusty quest
#

had this issue with PM2 i needed to enable a limit for how many times it allows the process to restart

delicate shore
#

my bot keeps on logging it's prefix

#

for some reason

#

mass sharding?

lusty quest
#

you have no sharding issue

fresh carbon
#

(doing client.login many times) - but yeah prob not an issue

cinder patio
#

429 means that he's making HTTP requests too fast.

delicate shore
#

should i disable the client.on?

#

one?

lusty quest
#

something in your code just spams the API

delicate shore
#

oh

fresh carbon
#

ah good call, possibly pm2

delicate shore
#

my bot

#

used to log

#

that hearbeet

#

heartbeat

#

again and again

lusty quest
#

its normal

delicate shore
#

oko

#
client.on('debug', console.log)

@lusty quest should

#

i disable

lusty quest
#

if you dont want to debug something comment it out

delicate shore
#

what

#

wym @lusty quest pls explain

opal plank
#

//

delicate shore
#

ok

opal plank
#

or /* */

restive pebble
#

hmmm

opal plank
#

if youre fancy

delicate shore
#

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?

solemn latch
#

already sharding?

opal plank
#

was about to ask

lusty quest
#

in D.js V12 the reconnecting event was renamed to shardreconnecting

#

or something like this

opal plank
#

sharding is 1500 guilds +

delicate shore
#

@solemn latch your bot got approved wow

solemn latch
#

ye

opal plank
#

gratz

delicate shore
#

anyone help m pls

solemn latch
#

already up a handful of servers pogey

delicate shore
#

me*

opal plank
#

@delicate shore how many servers your bot is in?

restive pebble
#

superbrain

delicate shore
#

82

vale garden
#

hoi

opal plank
#

not nowhere close

lusty quest
opal plank
#

i recommend getting rid of that sharind

#

sharding*

lusty quest
#

there is a explanation

restive pebble
#

how u dont have any spotify image

delicate shore
#

??

restive pebble
#

i was just messsing up

vale garden
#

so i have this command

restive pebble
#

@lusty quest

lusty quest
#

@opal plank he has the code right

opal plank
#

sharding is for bots with 1500+ guilds @delicate shore

delicate shore
#

what should i do should i comment out everything

#

i mean debugging

#

one

lusty quest
#

@restive pebble its a Non Released Album on Spotify

vale garden
#

does anyone know how i can

#

not display the gif link

restive pebble
#

@earnest phoenix

vale garden
#

in the command

lusty quest
#

use a embed

restive pebble
#

voltrex

vale garden
#

oh kk

delicate shore
#

anyone

#

help

earnest phoenix
#

@restive pebble ?

delicate shore
#

me

restive pebble
#

voltrex

#

read

earnest phoenix
#

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

restive pebble
#

ok

delicate shore
#

anyone help @opal plank @lusty quest what's the sol

lusty quest
#

@earnest phoenix to much Silicon Valley?

#

(the HBO series)

earnest phoenix
#

wdym by Silicon Valley?

opal plank
#

@delicate shore too much spoonfeeding dude

lusty quest
#

you wouldnt get it then

delicate shore
#

๐Ÿ˜ญ

opal plank
#

remove sharding altogether, earlier on it'll only cause you headache

lusty quest
#

its a HBO Series about a few Guys in the Silicon Valley. Its fun but also stupid at the same time

opal plank
#

your bot doesnt have nearly enough guilds to be using sharding yet

delicate shore
#

but that's not sol

lusty quest
earnest phoenix
#

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

delicate shore
#

i have covid api and meme api and joke api and music api

#

that is it

opal plank
#

give me a reason someone with 80 guilds would use sharding @lusty quest

earnest phoenix
#

congrats your bot is generic

lusty quest
#

read the docs. there where some Breaking changes with the client events

opal plank
#

i am on v12

lusty quest
#

exaclty there

opal plank
#

i dont see the connection about client connection and sharding

delicate shore
#
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;```
lusty quest
delicate shore
#

everything i use

earnest phoenix
#

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

opal plank
#

@lusty quest again, thats for sharding

#

why is he using sharding?

lusty quest
#

i guess he uses the internal sharding anyways

pale vessel
#

it's internal sharding

lusty quest
#

it will not generate any shard but its still running

opal plank
#

but why?

#

theres no need

earnest phoenix
#

editing files is the same process for any extension lol

#

you write bytes to it boom

delicate shore
#
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

lusty quest
#

@delicate shore wait 24 Hours

delicate shore
#

and never stops

earnest phoenix
#

in case of text files, you write text which is still internally bytes

#

you should stop spamming the api, 429 is a ratelimit

restive pebble
#

nv

crimson vapor
#

which package is yours @restive pebble

restive pebble
#

idk

#

voltrex told

#

coronavirus one ig

crimson vapor
#

oh

delicate shore
#

you should stop spamming the api, 429 is a ratelimit
@earnest phoenix which api

restive pebble
#

eh found

#

lel

opal plank
#

@delicate shore turn off bot, set a timer for 24h, dont turn it on till then

lusty quest
#

@delicate shore Discord API

earnest phoenix
#

discord's lol

crimson vapor
#

isnt a ratelimit like 15 mins?

restive pebble
#

now die

lusty quest
#

also fix what is spamming the API

restive pebble
#

enjoy spamming api

earnest phoenix
#

ratelimits are dynamic

lusty quest
#

otherwise it will return

opal plank
#

@crimson vapor not even close, it can go up to 19h

delicate shore
#

how to fix spamming api pls help

#

i was not the one

opal plank
#

i had a 16h before

#

@delicate shore DUDE

delicate shore
#

who started the coding

opal plank
#

shoo

delicate shore
#

of this bot

lusty quest
#

i had 24 Hours

crimson vapor
#

oh, I just had 15 mins

opal plank
#

shoo

#

wait for ratelimit dude

#

listen to what we are saying

delicate shore
#

but which api spams

#

how to know that?

opal plank
#

you keep spamming and spamming

#

we awnsered

#

read the awnsers ffs

#

jesus christ dude

earnest phoenix
#

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

lusty quest
#

wait until you are no longer ratelimited then see what spams. and dont keep it running for to long or you are ratelimited again

delicate shore
#

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()?

lusty quest
#

i dont know your code. its your issue to fix not mine

opal plank
#

check the embed returning from the response

#

json*

#

the response payloads have the info you are looking for

earnest phoenix
#

i dont think djs exposes those so you'll have to manually make the request

delicate shore
#

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

earnest phoenix
#

yikes a help vampire

delicate shore
#

it is not online

opal plank
#

^^

#

even ignores

earnest phoenix
#

don't bother helping help vampires, you'll save yourself time and sanity lol

delicate shore
#

sorry it is online

#

nvm

#
3
3
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 15ms.```
opal plank
#

@earnest phoenix going to follow that advice

delicate shore
#

my bot keeps on logging

opal plank
#

clearly he doesnt want help

delicate shore
#

ok

#

๐Ÿ˜ฆ

fresh carbon
#

@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

delicate shore
#

82

warm cloud
#

why the hell would you shard then

#

there is 0 reason

fresh carbon
#

mmk so no need to use sharding if your bot is under 1000

delicate shore
#

because the tuorial i saw used it

warm cloud
#

in fact it might slow you down to shard

fresh carbon
#

or 2500 usually

lime vapor
#

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

opal plank
#

vampire guys, dont even bother that one

fresh carbon
#

which tutorial are you using?

warm cloud
#

@lime vapor tl;dr heroku is hot shit

delicate shore
#

Zychrop Nation

#

or something

#

channel

#

tuorial

warm cloud
#

tuts on discord bots suck in general

opal plank
#

@lime vapor first step would be getting the bot on a proper stable platform

warm cloud
#

learn to code and read docs properly

#

@opal plank then im not sure what "new features" are

fresh carbon
#

follow this

opal plank
#

or run it locally

fresh carbon
#

you dont need sharding

#

at all

warm cloud
#

best practice is run locally or pay for a server

delicate shore
#

ok

warm cloud
#

not you the other guy

delicate shore
#

i commented out sharidng

#

sharding

warm cloud
#

ok cool

opal plank
#

Heroku isnt a platform for hosting bots

#

@lime vapor

delicate shore
#

my bot keeps sayinf this

fresh carbon
#

awesome, follow the discord.js tutorial

delicate shore
#

ok

fresh carbon
#

throw out your bot

warm cloud
#

heroku is for services and servers not discord bots

opal plank
#

they aggressively take down bots

warm cloud
#

yeah

fresh carbon
#

rewrite it using the new tutorial

#

no need to use sharding

warm cloud
#

glitch is banning users that make bots

delicate shore
#

it has been installing packages from last 20 mins

lime vapor
#

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)

warm cloud
#

heroku will be next

#

heroku is STILL hot shit

delicate shore
#

glitch is banning users that make bots
@warm cloud no

warm cloud
#

as with any free service

#

im not sure a) why you're using heroku b) what new features you're hoping for

opal plank
#

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

warm cloud
#

and c) how you would get said features

opal plank
#

there are vps's for as little as 2 dollars a month

delicate shore
#

i am gonna buy vps

warm cloud
#

yeah

delicate shore
#

once my glitch membership overs

opal plank
#

@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?

warm cloud
#

step 4: use python

#

just kidding i wont flame anyone

opal plank
#

lang wars reee, but we all know Scratch is the ultimate language

warm cloud
#

we can agree on that

#

understandable, carry on with the help

opal plank
#

lmao

lime vapor
#

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

warm cloud
#

the python part was a jok

lime vapor
#

I know I know ๐Ÿ˜›

opal plank
#

so im taking it as a basic/moderate understanding of js and library

#

what is your bot about?

lime vapor
#

it's a crowsourcing/queue bot for games like ACNH (people can request in-game currencies and get into people's islands)

warm cloud
#

hmm

#

that sounds a bit too complex to survive properly on heroku

#

it's a really unstable environment

opal plank
#

was thinking the same

warm cloud
#

and c libs aren't supported for example

opal plank
#

what good practices would you be looking for?

lime vapor
#

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.

opal plank
#

Beta branches

#

get another instance of the bot which you work on the new features

warm cloud
#

make them hidden until you finsih

#

yeah

#

make a beta or bleeding bot

#

so that the prod one doesnt die when you screw over

lime vapor
#

another instance meaning I'd have a tester bot in Dicord Dev as well, right? so it'll have a different token?

warm cloud
#

it would probably not get on dbl

#

it would have a seperate token, yes, because its a different bot

delicate shore
#
    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.```
lime vapor
#

roger, this is what I assumed I might do

#

but good to have confirmaton ๐Ÿ˜„

delicate shore
#

does this cause slowing down of bot?

warm cloud
#

i dont see a problem here

delicate shore
#

this is logging

warm cloud
#

assuming you're the uguy with 80 servers the abstration of sharding is a bad idea for speed

delicate shore
#

ook

warm cloud
#

what tells you its slower is testing not the logs

opal plank
#

@lime vapor

delicate shore
#

i commented it put

warm cloud
#

the logs are not just gonna say "the bot is slower lmao"

delicate shore
#

out

#

but it is still owkring

opal plank
#

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

lime vapor
#

yes, of course, I just don't want both bot instances with the same token replying to me

opal plank
#

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

delicate shore
#

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

opal plank
#

dir/ Stable = > config.token = tokena
dir/ Beta => config.token =tokenb

delicate shore
#

can this be the case?

#

!!

pale vessel
#

i don't think that works anymore

opal plank
#

they'll basically be clones of eachother, you'll only need to switch some minor things

delicate shore
#

ok

#

Erwin you saying me?

lime vapor
#

ok, thanks @opal plank ! I got what I needed to go forward from this ๐Ÿ˜„

opal plank
#

no, im ignoring you @delicate shore

delicate shore
#

ok

opal plank
#

np rige

#

good luck ๐Ÿ‘

lime vapor
#

(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)

delicate shore
#

sorry Erwin

#

๐Ÿ˜ฆ

#

pls ๐Ÿ˜ญ

muted prism
#

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

delicate shore
#

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

clever vector
hazy sparrow
#

Can I get multiple titles in a embed?

restive pebble
#

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

clever vector
#

hello bot developers

#

can i ask you

#

which meme website i put

#

reddit/r/meme?

#

or

#

reddit/r/memes

pale vessel
#

no, dankmemes

clever vector
#

dankmemes?

#

How

#

because i make a bot also

#

so

#

i need memes

restive pebble
#

use http

#

Or some get services

clever vector
#

dankmemer not fun

#

the meme sucks

#

i want the cool one

lime pumice
craggy pine
#

@lime pumice missing the ; at the end of your })

#

It's underlined in red.

pale vessel
#

you didn't close your switch

#

fix your indentation

hazy sparrow
#

how to make bot send images without links

pale vessel
#

attach the image

lime pumice
#

does anyone know?

pale vessel
#

create an embed using the embed builder and put it inside send(here) or just send({ embed: { title: "Hello" } });

lime pumice
#

could u give me the exact line?

pale vessel
#

no

lime pumice
#

i want to send here

golden condor
#

channel.send is a function

tight plinth
#

do you know how to use discord.js embeds?

pure lion
#

h

spare mirage
#

@lime pumice change the const name to something else channel is a reserved word in discordjs

cinder patio
#

It's not a a "reserved" word lol

#

you can call your variables that if you want to

spare mirage
#

it will just work weird xD

#

so its kinda reversed

cinder patio
#

It'll make sense more than anything

spare mirage
#

ok...

wheat hornet
#

i am getting this error for let statement= Lexical declaration cannot appear in a single-statement context

tight plinth
#

what

cinder patio
#

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;
}
tight plinth
#

actually

wheat hornet
#

@cinder patio it worked

tight plinth
#
let a;
if (condition) {a=5}```
spare mirage
#

I dont know what to add for my discord bot

cinder patio
#

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

spare mirage
#

to*

wheat hornet
devout wagon
#

Same problem as before

#

You declare and assign the variable in a context and immediately leave it again

wheat hornet
#

so what should i do?

cinder patio
#

You have to put all your code inside that first if check

wheat hornet
#

still zipcode is not defined

cinder patio
#
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.
pure lion
#

Why not just pass in a string for location

spare mirage
cinder patio
#

that's just wrong

wheat hornet
#

nvm

#

my bad

earnest phoenix
#

A YT TUTorial

#

Mine

#

The administrator part is not comming

#

Like the pop up

restive pebble
#

hasPermission

tight plinth
#

A YT TUTorial
@earnest phoenix woopsie doopsie, you did a big mistake. please NEVER watch yt tutorials

restive pebble
#

And it has some syntax error

cinder patio
#

You are missing a ) in the third if statement

earnest phoenix
#

@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?

tight plinth
#

fair, but reading is way better than watching outdated yt tutorials

earnest phoenix
#

Thats this years

#

March 14 2020

tight plinth
#

cashe?

#

it's cache

earnest phoenix
#

Still the popup doesnt come

#

๐Ÿ˜ฆ

restive pebble
#

Nice yt vid

earnest phoenix
#

XD

#

This one

#

But then I am not getting that pop up

pure lion
#

...cache

quartz kindle
#

if you're already watching a yt video, at least dont make spelling mistakes lol

pure lion
#

^

#

Code is written in the way it is because that's the language

golden condor
#

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

quartz kindle
#

you need to configure your nginx.conf file as well as your domain file in the sites-enabled and sites-available folder

earnest phoenix
quartz kindle
golden condor
#

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

quartz kindle
#

nginx's configration is done through config files

#

all config files are present in nginx's installation folder

wheat hornet
#

how much time will it take for open weather api key to activate?

quartz kindle
#

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
    }
  }  
}
golden condor
quartz kindle
#

nginx configuration files also use the include keyword to merge configuration files

hasty sparrow
#

Ahh

quartz kindle
#

is your server running linux/ubuntu?

golden condor
#

yes

hasty sparrow
#

Nginx proxy

quartz kindle
#

open the nginx.conf file

golden condor
#

ok

earnest phoenix
#

That is not coming for me

cinder patio
#

Just type it

cinder patio
#

ADMINISTRATOR

earnest phoenix
#

Will it work the same way?

wheat hornet
cinder patio
#

yes

wheat hornet
#

so do i have to include a space and than paste my api key?

quartz kindle
#

not a space

wheat hornet
#

ok

quartz kindle
#

if they accept api keys via query parameters, you add a &key=yourkeyhere or whatever they use

spare mirage
#

do you think 20000 calls per month would be fine for an api?

quartz kindle
#

if they only accept keys in headers, then you have to put it in the headers, not in the url

hasty sparrow
#

Depends on the API

quartz kindle
#

depends, 20k calls for a math problem is more than fine, 20k calls for something like translation, AI or OCR is too much

wheat hornet
#

how much time it will take for the key to activate?

spare mirage
#

well its an game stats api

quartz kindle
#

is it yours?

wheat hornet
#

depends upon how many servers ur bot is in

delicate shore
#

for some odd

spare mirage
#

no

delicate shore
#

reason

#

when i try to change prefix for this serverv

#

in my db

#

my bot crashes

#

idk why

quartz kindle
#

lmao

wheat hornet
#

why open weather map api not working๐Ÿ˜ซ

quartz kindle
#

did you read their docs?

#

http://api.openweathermap.org/data/2.5/forecast?id=524901&APPID={YOUR API KEY}

golden condor
#

oh wait

#

no i didn't

quartz kindle
#

did you open your nginx.conf?

golden condor
#

but which file do I puy it in

hasty sparrow
#

Your server block files in /etc/nginx/sites_available

golden condor
#
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?

quartz kindle
#

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

golden condor
#

put it inside there?

quartz kindle
#

thats one option sure

#

check if it has an include line

quartz kindle
#

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

golden condor
#

should I remove what is already there?

quartz kindle
#

in sites-enabled?

#

whats already there?

golden condor
#

yeah

quartz kindle
#

ah its a default file

#

yeah you can remove it

earnest phoenix
#

what is the error?

tight plinth
#

define cache

quartz kindle
#

dude

tight plinth
#

please

quartz kindle
#

@_@

earnest phoenix
#

Bruhh

tight plinth
#

also

golden condor
#

can I do

tight plinth
#

learn js

earnest phoenix
#

I changed that but it didint save ๐Ÿ˜ฆ

golden condor
quartz kindle
#

no i dont think so

#

let me check

golden condor
#
server {
    listen       80;
    server_name  corynth.xyz www.corynth.xyz;

    location / {
        proxy_pass http://127.0.0.1:8080;
    }
}```Like this?
quartz kindle
#

yes

golden condor
#

ok

#

so I can pass more than one domain

#

great

wheat hornet
steel heath
#

Console dir parsedWeather?

quartz kindle
#

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

golden condor
quartz kindle
#

yes

golden condor
#

it worked

#

Thanks Tim and Duke ๐Ÿ‘

quartz kindle
#

@wheat hornet is the error "country is not defined" or "cannot read country of undefined"?

#

show the actual error

wheat hornet
#

cannot read property of country of undefined

quartz kindle
#

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

wheat hornet
#

at parsedWeather[0].main it says cannot read property of 0 undefined

quartz kindle
#

did you console.log it?

wheat hornet
#

wait a min

quartz kindle
#

did you console.log it?

wheat hornet
#

nope

quartz kindle
#

i've told you to do it 3 times

wheat hornet
#

๐Ÿ˜…

#

i am new to javascript

#

so what should i do

slender wagon
#

within the end of the code

#

add a console.log

wheat hornet
#

wait invalid api key wtf

#

code error 401

#

add a console.log
@slender wagon ya done

slender wagon
#

execute the code

wheat hornet
slender wagon
#

u need a api key

wheat hornet
#

how long does it will take to activate

slender wagon
#

from the page

wheat hornet
#

ya i have

slender wagon
#

well um i'm not sure

quartz kindle
#

how are you using the api key?

#

did you already receive one?

clever vector
#

Anybody can help me about the meme

quartz kindle
#

what meme

clever vector
#

like pls meme

#

or

wheat hornet
#

did you already receive one?
@quartz kindle ya i have received one

clever vector
#

!meme

#

and it show a meme

quartz kindle
#

if you received one, then its already active

clever vector
#

from reddit

#

@quartz kindle

#

Can you help me

quartz kindle
#

use the reddit api

clever vector
#

??

wheat hornet
#

than why on earth its showing me invalid api key

clever vector
#

Can you mention

quartz kindle
#

you're probably using the api key wrong

#

how are you using it?

clever vector
#

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: []
}
wheat hornet
clever vector
#

@quartz kindle

pure lion
#

@wheat hornet why not use weather.js???

clever vector
#

Who can help me with my meme command

lusty quest
#

you can get the body as json no need for converting

wheat hornet
#

@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

pure lion
#

what

#

java or javascript

#

?

wheat hornet
#

javascript

#

my bad

clever vector
#

Guys who can help me fix my meme

quartz kindle
#

@wheat hornet is the key supposed to start with "OpenWeatherAPI"?

wheat hornet
#

yes

lusty quest
#

@clever vector have you any idea how to work with APIs?

clever vector
#

Hmm im new

#

can you mention

#

@lusty quest

lusty quest
quartz kindle
#

@wheat hornet im looking for examples and i dont see any example with an api key starting with that

earnest phoenix
#

how do i send stuff to my glitch project through node? basically http requests

pure lion
#

learn

#

full

#

stacc

wheat hornet
#

@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

earnest phoenix
#

@pure lion
what
is
full
stacc

spare mirage
#

can I let my bot make emojis?

lusty quest
#

@earnest phoenix what did you want to send to your bot?

earnest phoenix
#

invalid api key
@wheat hornet maybe you reset it

quartz kindle
#

well then i cant help you any further. if you want i could try testing it

earnest phoenix
#

@earnest phoenix what did you want to send to your bot?
@lusty quest quick.db stuff

wheat hornet
#

np thx for ur help so far

pure lion
#

ew sql

lusty quest
#

why not a proper Database?

pure lion
#

x)

lusty quest
#

so you dont need to do some stupid workarounds

pure lion
#

why not a proper Database?
@lusty quest thank you from yesterday btw :DDD

earnest phoenix
#

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

lusty quest
#

np

pure lion
#

no quickdb bad

earnest phoenix
#

for beginners too

spare mirage
#

? can I make my bot add emojis to an server?

earnest phoenix
#

good for beginners and shit people like me and bad for advanced users

lusty quest
#

quick.db is a SQLite Database. its not really designed to work remotely. but you could try and build a API

pure lion
#

use mongo you can connect and its probably easier

lusty quest
#

then send a Post Request to your API this will then save it to your quickdb

earnest phoenix
#

yeah basically manage my glitch project through node on my pc

wheat hornet
#

@pure lion are there some good weather.js tutorial available

earnest phoenix
#

which i can't smh

pure lion
#

@wheat hornet no, but theres me

spare mirage
#

tutorial is not good~ Justii

pure lion
#

ill be back, gonna write a weather command and a npm command

earnest phoenix
#

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

spare mirage
#

? can I make my bot add emojis to an server?

earnest phoenix
#

(just hope glitch doesn't kill me for using them as a backup)

#

i can just use github...

#

and pull requests from them

wheat hornet
#

regenerated the 3rd apikey in a row and its invaild tooo wow

earnest phoenix
#

maybe you referenced it wrongly

spare mirage
#

can someone help me

earnest phoenix
#

like i spelled process.env.TOKEN in lowercase and got an error on glitch @wheat hornet

wheat hornet
#

nope its not that

slender thistle
#

which library, Justii

spare mirage
#

discordjs

pure lion
#

which js lib

earnest phoenix
#

can someone help me
rn no brainy people looking at this channel so maybe goto the docs

#

lmfao

#

discord.js

#

he meant