#development

1 messages · Page 1598 of 1

pale vessel
#

it's the source xd

#

oh right

crimson vapor
#

bruh

cinder patio
#

Woah

smoky herald
cinder patio
#

That's weird... You can try a different approach, instead of executing the code straight away, maybe send an event with the array?

client.shard.broadcast({type: "leaderboard", arr: fameLeaderboard});

And then:

client.shard.on("message", msg => {
   if (msg && msg.type === "leaderboard") {
     // Do something with msg.arr here
} 
}
crimson vapor
#

@opal plank bro I need some ts help

#

berry doesn't know what to do

restive furnace
#

?tag ask

cinder patio
#

👀 Someone else may be able to help too

crimson vapor
#

alr sec

earnest phoenix
#

oh so thats how to make types in js

slim heart
cinder patio
#

👁️ 👄 👁️

summer torrent
#

wtf

crimson vapor
#

I change 1 word and everything breaks

smoky herald
cinder patio
#

I also think the other suggestion is generally better, it gives you more control

crimson vapor
#

this

cinder patio
#

that's... weird

summer torrent
crimson vapor
#

I agree

cinder patio
#

So it's because of the typing

crimson vapor
#

so im sinning and using any

cinder patio
#

can you show APIMessage?

slim heart
#

it's from discord-api-types

crimson vapor
#

im grabbing it

cinder patio
#

hmmm... usually that error means that a function is calling itself a bunch

#

Can you edit the typings and remove referenced_message?: APIMessage | null; to see what happens?

slim heart
#

i turned on strict mode

cinder patio
#

Typescript is somehow entering in an infinite loop by checking the APIMessage typing

crimson vapor
#

yeah

#

kinda sucks

cinder patio
#

Open @types/discord-api-types and remove referenced_message?: APIMessage | null;

crimson vapor
#

yeah still fails

cinder patio
#

hmmmmm maybe you should open an issue? I feel like it's definitely a problem with the typings

crimson vapor
#

@slim heart do this

cinder patio
#

Do you use the restrictions function anywhere?

crimson vapor
#

yeah, it just returns a boolean

slim heart
#

i just deleted a random flags check in tsc, probably not a great idea but it fixed it so

cinder patio
#

lmao

solemn jolt
#
const entry1 = await guild.fetchAuditLogs({ type: "ROLE_DELETE" }).then(audit => audit.entries.first()); 

Why i have error in this code

cinder patio
#

what's the error

solemn jolt
solemn jolt
cinder patio
#

Your bot doesn't have permissions to get the audit log

solemn jolt
#

How I can Fix it

cinder patio
#

You give your bot the "View Audit Log" permission

solemn jolt
#

This is a verify bot

#

I wanna Fix it in the code

cinder patio
#

You want to ignore the error?

#

There's nothing wrong with the code your bot just doesn't have the permission

solemn jolt
#

This error well be down my bot

cinder patio
#

Catch the error

#
.catch(err => /* Do something with the error */);
solemn jolt
#
module.exports = class {
	constructor (client) {
		this.client = client;
	}
	async run (role) {
		const client = this.client;
		const { guild } = role
		const entry1 = await guild.fetchAuditLogs({ type: "ROLE_DELETE" })
		.then(audit => audit.entries.first()); 

How I can catch it in this code

cinder patio
#

You put the .catch after the .then

#

Also, you're mixing async/await syntax with .then syntax, you should just stick to one

#
const audit = await ...
const entry1 = audit.entries.first()
solemn jolt
#
module.exports = class {
	constructor (client) {
		this.client = client;
	}
	async run (role) {
		const client = this.client;
		const { guild } = role
		const entry1 = await guild.fetchAuditLogs({ type: "ROLE_DELETE" })
		.then(audit => audit.entries.first()).catch(err=>{}); 

Like this

cinder patio
#

Yeah that should do it

#

but you should also don't do anything if there's an error

#

I recommend switching to async/await and try/catch instead of using .then and .catch

#

Your context is already async, so there's no point in using .then

solemn latch
#

also, just destroying the error is typically a bad practice

cinder patio
#
try {
const audit = await guild.fetchAuditLogs({ type: "ROLE_DELETE" });
const entry1 = audit.entries.first();
// Do something...
} catch(err) {
  send("No permissions, sorry!");
  return;
}
solemn latch
#

doing something with the error would be smart

solemn jolt
#

@cinder patio thank you bro

cinder patio
#

np

crimson vapor
#

if an error isn't really useful and is 1/2 expected, what should you do isntead of destroying it?

opal plank
#

void it mmulu

grizzled raven
#

or be even more lazy;

Object.defineProperty(Promise.prototype, "silence", {
  value: function() {
    return this.catch(() => {})
  }
})

const value = await riskyPromise.silence()
opal plank
#

i can one one better

earnest phoenix
#

can someone help me make my bot listing look nice

opal plank
#
Object.defineProperty(Promise.prototype, "shh", { value: function() { return this.catch(() => {}) } })

const value = await riskyPromise.shh()```
grizzled raven
#

hold my async beer

#

oh wait nevermind lmao

rocky dagger
#

i have this code for discord.js and i am logging the files loaded bit instead of listing the files after each other i want it under each other and i need helpjs client.once('ready', () => { console.log(commandFiles + ' loaded'); console.log('Bot launched successfully'); });

solemn latch
#

well, the command files doesnt load on the ready event anyway

#

so logging it there doesnt really make sense.

grizzled raven
#

actually yeah

rocky dagger
#

when i run the code it shows tho

solemn latch
#

sure, but you could log anything there, it doesnt mean it makes sense to do so.

grizzled raven
#
const then = Promise.prototype.then
Object.defineProperty(Promise.prototype, "then", {
  value: function(handler) {
    return then.apply(this, handler, () => {})
  }
})

const value = await riskyPromise
//idk if this'll even work lmao
rocky dagger
#

where should i log it then?

solemn latch
#

when you load each command.

rocky dagger
#

how?

#

if you cant tell i arent really good at discord.js

tidal basalt
#

when readdir ?

solemn latch
rocky dagger
#
for (const file of commandFiles) {
    const commandName = require(`./commands/${file}`);
    client.commands.set(commandName.name, commandName);
}
```https://github.com/Madmadz16/DcBot2 here is the code (its not much)
solemn latch
#

so log it then

rocky dagger
#

ohh yea thx

undone rose
#

Does anybody know of Eris based bots having stability problems?

modest maple
#

why would they have stability problems?

undone rose
#

Bc idk why my shit keeps going down

solemn latch
#

from what i understand eris is known to be a bit unstable

undone rose
#

Then the bot goes offline

#

According to Eris docs it's supposed to attempt to reconnect which I've ensured is properly configured

solemn latch
undone rose
#

hmmmmmm

lucid prawn
#

how to i make my bot react to it self

opal plank
lucid prawn
#

js
i did
await message.react("🎉")

opal plank
#

discord.js i assume

#

js is the language

#

not the library, but anyway

#

show your code

lucid prawn
#

im dumb

#

i hit my head 100 times so

opal plank
#

we all been there, just show what you got so far

solemn latch
#

message.react will react to whatever variable message is.

#

for example if your message is the received message it will go to that.

lucid prawn
opal plank
#

okay so its sync

#

the channel.send() returns a promise

#

so

#

what you could do is

#
channel.send(embed).then(newMessage => {
newMessage.react('emote')
})
#

otherwise i would've told ya to use async functions and await for channel.send()

#

also, please take a look at this

glacial pagoda
opal plank
#

your code works, but its grotesque

#

follow this guide, and by the end you'll have a nice 6/10 bot

lucid prawn
opal plank
#

indeed

#

its really bad rn

solemn latch
opal plank
#

but it works

lucid prawn
#

i will fix it

#

thx

opal plank
#

np

glacial pagoda
#

Anyone?

solemn latch
#

i would read the troubleshooting guide

glacial pagoda
#

I did

solemn latch
#

did you follow it

glacial pagoda
#

and they said to install lastest version of py

#

and i went to the warns

#

What Does Switch mean

#

like npm install quick.db --python="C:\Path\To\python.exe"

#

?

solemn latch
#

windows or linux?

glacial pagoda
#

windows

solemn latch
lucid prawn
opal plank
#

ini

earnest phoenix
#

incorrect

opal plank
#

its not count thats undefined

#

its get() thats returning undefined

#

maps can return undefined, so account for that

#

@lucid prawn

#

check with an if or conditional chain

earnest phoenix
#

Cannot read x of undefined always refers to the thing x is being called on

#

js doesn't care if a property/method exists or not

lucid prawn
earnest phoenix
#

it will just default to undefined if it doesn't

opal plank
#

? means it'll stop if what comes before is falsey

#

its the same as

#
if(get('thing')) get('thing').count```
lucid prawn
#

oh ok

opal plank
#

check ur node version btw

#

i think its very recent stuff

#

node 14 i think?

#

yeah i think node 14 is the one that introduced conditional chaining

lucid prawn
#

im on a hosting website

umbral zealot
#

Still uses a version of node you should be able to change ...

lucid prawn
#

i think it auto updates

opal plank
#

that would be dumb

#

some node related stuff requires gyp for example which tends to break when new versions of node come up

#

if it auto-update it'd break a lot of users without notice

#

that would be terrible design

lucid prawn
#

i will check it

#

i cant check it

lucid prawn
opal plank
#

it should work then

lucid prawn
opal plank
#

did you do what i sent?

#

and added a conditional chain?

lucid prawn
#

yes

lucid prawn
opal plank
#

it may be on node 15 then

lucid prawn
opal plank
#

just check if cache has that

lucid prawn
#

ok

heavy marsh
#

I have a small problem with an npm
With the images ... - Some have spaces [discord.js - v12.5.1]

#

Is there anyway to fix this?

slender wagon
#

I am trying to work on an AI chatbot for a discord bot what would u guys suggest me to use?

earnest phoenix
#

an existing bot

opal plank
#

tensorflow might be able to do it, but theres a ton of ai chatbots out there

#

some scrape stuff from Evie bot, and those online ones

#

theres also that python one

#

forgot the name

#

fuck

#

ts4 or something

#

i forgot

lucid prawn
opal plank
lucid prawn
#

ok

lucid prawn
opal plank
#

okay that code is giving me a headache to even read

#

and im not trying to be mean

lucid prawn
#

it ugly

#

i will fix it later i just need it to work then i will make it look better

opal plank
#

cuz u didnt add what i told to you do

#

there you go

#

its not fixed btw

#

but at least its formatted

lucid prawn
lost stone
#

Hello.
if i say

const vicky1 = Discord.Client();
const vicky2= Discord.Client();
const vicky3 = Discord.Client();

can i connect all of them to the one code?
like :

and

vicky2.login('');
vicky3.login('');```
opal plank
#

what

#

the fuck

#

are you doing

#

thats not how js works at all

#

and why do you wnat 3 clients?

lucid prawn
#

ummm

lost stone
#

for my alts

opal plank
#

what alts?

lost stone
#

tokenns

opal plank
#

users or bots?

lost stone
#

user

opal plank
#

yeah no fam, thats against ToS

#

selfbots

#

nobody here gonna help you with that

lost stone
#

if u join my server its all this

opal plank
#

well your server is against tos then

#

¯_(ツ)_/¯

lost stone
#

i bought it tho

opal plank
#

what server?

#

a discord server?

#

so, you bougth accounts?

lost stone
#

yes

gilded olive
#

TOS breaker in action

lost stone
#

i wanna try this code

gilded olive
#

you dont

lost stone
#

okay i wont

sudden geyser
#

Too dark? Light mode 🔦

lost stone
#

i really didnt know thats against

#

tos

opal plank
#

buying accounts AND selfbotting

slender thistle
#

Man

opal plank
#

two big tos breaks

lost stone
#

ow

modest maple
slender wagon
urban surge
#

The bot responds to commands 2 times after running for a while.

#

When I close cmd, the bot does not close and the answers are lonely

#

how do i solve this problem?

opal plank
#

probably got 2 instances of the bot running

#

you stopping 1, but the other still on

urban surge
#

I can't see the other working

#

I change the token of the bot and reboot, after a while it becomes double again

solemn latch
#

does it only become double when you are doing stuff with it? ie editing/starting/stopping it?

earnest phoenix
#

you might be doing something in the ready event

#

ready can fire multiple times during your app lifetime

solemn latch
#

isnt py's sharding just a startup parameter?

earnest phoenix
#

@solemn latch I’m not sure

#

I’m new to this all lol

#

my bot is in 220 servers

#

And it’s delayed

glossy spoke
#

220 guilds mm

#

Sharding is neccesary at 2.5k guilds

#

So you hasn't to start sharding rn

#

but if you wanna to, there is no any problem.

solemn latch
#

not necessarily, he mentioned delay issues, which could potentially be solved by sharding.

glossy spoke
#

o

solemn latch
#

what platform are you using to host?

near plover
earnest phoenix
#

MegaThonk That delay can't be resolved by sharding

solemn latch
#

why not?

earnest phoenix
#

It's just probably their host machine having a weak connection to the gateway

solemn latch
#

which is why i asked about the host

#

some low end rasperberry pi's can start having cpu issues quite early, and sharding can help with that.

earnest phoenix
#

¯\_(ツ)_/¯

near plover
#

just make a better bot 😛

solemn latch
#

some features require a fair amount of cpu no matter how "better" you make it.

quartz kindle
#

for all we know they could be talking about delays in the verification process lul

#

they didnt specify :^)

solemn latch
#

solving delays in verification by sharding PogSpin

crimson vapor
misty sigil
#

hi

crimson vapor
misty sigil
#

aw

crimson vapor
#

you are still here

#

so hi

marble juniper
#

tim is our personal stack overflow

misty sigil
#

right back to listening to Scottish techno then

gilded olive
earnest phoenix
#

@gilded olive you familiar?

misty sigil
#

speed it up by 10x

gilded olive
#

if you're at 220 guilds there's no need to start sharding

#

2k-2.5k

earnest phoenix
#

Why is my bot delayed then

gilded olive
#

there are a lot of reasons it can be delayed

crimson vapor
#

imo its better to understand sharding before you are required to

earnest phoenix
#

Do I need to refresh/regen mg token

#

@crimson vapor exacty

gilded olive
#

that wouldn't change anything

#

delayed as in it takes a lot of time to respond?

#

is there a blocking process going on?

#

some api command using requests? that can delay your bot

strong sinew
#

How would you make a temporary warn using mongo. Right now I'm just using setTimeOut, the only issue with that is if the bot goes offline/restarts the warn will be there permanently since the timeout stopped due to the restart/downtime.

Ping me on answer please.

sudden geyser
#

You could save the expiration date in ms

#

Then just check if it's passed

#

Well, that's for if you want to see if it's expired. To get a notification when it expires is something else.

solemn latch
#

yeah, kinda two ways to do it, if you want exactly when it expires I would just check for close to expiring events(every few minutes or 30 minutes or whatever), and then doing a timeout for that length for it for each one.

proven lantern
#

if a member doesnt allow direct messages from server members, but sends my bot a message, will my bot have permission to respond via DM?

solemn latch
#

nope

proven lantern
#

do they need to change that setting?

solemn latch
#

yep

proven lantern
#

dang, thanks

#

oh, they wont even be able to send a message to my bot?

#

that's weird

earnest phoenix
#

How do I make a Discord bot in a call 24/7?

#

How does Rythm and groovy do it

#

lol that’s what I mean

#

How do I do it?

#

I’m working on a 24/7 radio station for my bot and it needs to be in there 24/7

#

let it join a vc

#

and never leave

#

well you need to be a bit more detailed then that

#

with Rythm & Groovy you need to use a prefix to make them join you

#

I’m wondering if that’s needed in this regard.

gilded olive
#

not necessarily(meaning [prefix]24/7) but that would be the best way to go about it

solemn latch
#

its not 100% required to be a command, if its just for one server and one specific channel you can just have it join on startup

earnest phoenix
#

How would I do that in JavaScript, example?

solemn latch
#

how to do which one, you got several suggestions

earnest phoenix
#

I just need to join

#

The simplest way

solemn latch
#

for this there is no simplest way tbh, music bots are always relatively complex.

opal plank
#

@earnest phoenix let me give you a piece of advice, a bot for your server or maybe 10? sure, it'll work fine

#

but those bots dont scale well

#

unless you got all musics cached locally

#

otherwise you're gonna start hitting ratelimits from youtube or spofity

#

which will lead for you to have to buy IPV4's to be able to "trick" their api

#

my advice is: if you wanna make a music bot for the public: dont

earnest phoenix
#

ok

#

not the best advice but ok

solemn latch
#

music bots are complex, and expensive

earnest phoenix
#

I’m going to be using Soundcloud so

solemn latch
#

soundcloud has a stricter api than youtube afaik

earnest phoenix
#

gosh

solemn latch
#

15,000 requests per day for soundcloud

earnest phoenix
#

ok

#

How do I just make a bot join the call with JavaScript, example

solemn latch
#

well, the docs cover that

earnest phoenix
#

The music part isn’t my concern st the moment

#

link?

solemn latch
earnest phoenix
#

I’ve tried the JavaScript join commands, could I get an example

solemn latch
#

the docs have an example

earnest phoenix
#

The one I used didn’t even show anything in Output

#

search in google: discord.js music bot

#

ok

solemn latch
#

i mean, the docs have an example for joining a channel

#

no need to google it 👀

earnest phoenix
#

ok

#

also how do I keep my bot running after I turn my pc off?

#

for free

solemn latch
#

typically you buy a VPS for a music bot

#

as free platforms really cannot cope well with music bots.

earnest phoenix
#

I see

gilded olive
#

tho...if it's just 1 server

#

heroku would work fine

earnest phoenix
#

I host it on a second pc that runs 24/7

solemn latch
#

please not heroku, every single heroku music bot ive ever seen stutters so bad

quartz kindle
#

if you have a credit card, go for google compute engine f1-micro

#

its free and much better than heroku

earnest phoenix
#

ok

gilded olive
#

music on it was ok

earnest phoenix
#

"semi fine"

#

I want high performance

solemn latch
#

its not rare to see them in reviews, they stutter a few times a song :/

gilded olive
#

then go with what tim said

quartz kindle
#

if you want high performance you have to pay for it

gilded olive
#

^

earnest phoenix
#

ok

quartz kindle
#

vultr, upcloud, ovh, galaxygate, contabo, digital ocean

#

those are the most recommended vps companies i've seen around here, in no particular order

earnest phoenix
#

ok

solemn latch
#

AngryDoggo gg not first

quartz kindle
#

xd

earnest phoenix
#

How much money does it cost to run a music bot in total? (around)

solemn latch
#

depends on the size

quartz kindle
#

depends

#

lol

opal plank
#

wew, am i big boi now?

quartz kindle
#

well of course if your bot has millions of guilds

opal plank
#

60 new guilds in the past few hours

solemn latch
#

pog

earnest phoenix
#

I’m willing to put $100 down for a music bot

opal plank
#

i made it

#

its using grafana

quartz kindle
opal plank
#

let me get a whole scope

quartz kindle
#

then upgrade as needed

earnest phoenix
opal plank
#

@gritty tartan

#

i also spotted a memory leak, next update should be using less than 800mb again

solemn latch
#

pog

quartz kindle
#

what are you leaking this time?

opal plank
#

my reaction collectors

quartz kindle
#

you damn perforated hose

#

:^)

opal plank
#

hehehe

#

what im confused is that big ass spike on startup

#

1.2k messages within a minute

#

thats way over avarage

#

❤️

delicate zephyr
#

i really need to actually work on my bot

opal plank
#

indeed

quartz kindle
#

im pretty sure discord queues events

opal plank
#

hmmm could be but its weird that its bulking all those in one go

#

nothing wrong with it

#

just weird

quartz kindle
#

it probably starts queuing the moment you connect

opal plank
#

i assume as much, yeah

quartz kindle
#

then send everything once you finish receiving the initial guild creates

opal plank
#

thats likely whats goin on

earnest phoenix
#

This isn’t related to bots, is it possible to make a GUI on Visual Studio 2019 without coding?

#

cause the form method doesn’t work for me

quartz kindle
#

it should be

#

but idk, i have no experience with it

earnest phoenix
#

ok

#

Also is it possible to host bots from Mobile?

#

It sounds unrealistic but not impossible

opal plank
#

yeah should be fine

quartz kindle
#

its possible yes

opal plank
#

who was it that did it

#

fuck i forgot the guys name

#

it was googlefeud

quartz kindle
#

several people here did it or tried doing it

opal plank
#

someone made a thing for it

#

i put leviathan in an old Wii i had

#

if that counts

quartz kindle
#

lmao

#

put it on a smart toaster

#

smart fridge

opal plank
#

smart fans

#

smart lights!

quartz kindle
#

smart toilet, where it belongs

#

:^)

opal plank
#

^^

#

100%

earnest phoenix
#

Host a discord bot on your amazon Alexa lol

mellow kelp
#

iToilet™️

delicate zephyr
#

btw

quartz kindle
#

and have alexa tell you every time you get a new guild

delicate zephyr
#

with a shit ton of modification

#

you can

mellow kelp
#

LMAO

opal plank
#

i'd be itnerested in that tbh

#

read out the amazing names we have in them

delicate zephyr
#

lmfao

quartz kindle
#

get rid of your grafana and switch to alexa logging

delicate zephyr
#

LMFAO

opal plank
#

Guild **I Put ketchup on my pizza** added the bot

quartz kindle
#

"alexa show me ram usage for the past 15 hours"

opal plank
#

prob get on some micheal reeves level of shit

opal plank
earnest phoenix
#

Would be a good usage for it

opal plank
#

Alexa, delete the bot!

quartz kindle
#

xD

#

have you seen that dude who was streaming himself sleeping on twitch?

#

and he had alexa on

delicate zephyr
#

can someone remind me of the name of if ? true : false

quartz kindle
#

and twitch voice over on

earnest phoenix
#

Text to speech?

quartz kindle
#

yes

#

and his viewers said

#

"alexa, order an iphone 13"

opal plank
#

inline check is what i call it

solemn latch
#

ternary operator

opal plank
#

oh yeah

#

its ternary

earnest phoenix
#

At least it isn’t like those which are like what is my location

quartz kindle
#

xD

earnest phoenix
#

Alexa knows too much

#

and surely purchases using Alexa would require authorisation

quartz kindle
#

there was also that stupid challenge that the guy had to hold his finger on his phone screen for hours, and some twitch viewer send a message under the name "hey zee ree"

#

and the idiot read it out loud, and his phone closed the game and opened siri

earnest phoenix
#

The Mr Beast app

zenith terrace
#

IT WAS MR BEASTS GAME

quartz kindle
#

aka stupid

#

lmaó

earnest phoenix
#

I don’t think it was real ?

delicate zephyr
#

discord just shit the bed

earnest phoenix
#

MrBeast got popular for this money

zenith terrace
#

I honestly hate you a little bit now tim

delicate zephyr
#

and didnt send my messages

quartz kindle
#

lmao

zenith terrace
#

my note on tims profile:

Doesn't like Mr Beast so I dislike him a little bit

quartz kindle
#

lmao

#

its not that i dont like him

#

i dont even watch/know him

solemn latch
quartz kindle
#

just heard of him from memes

delicate zephyr
#

I mean I understand why people dislike him, i think he's cool for just throwing money at random people who need it

quartz kindle
solemn latch
#

just someone who follows rules and is around helping or participating

zenith terrace
quartz kindle
#

xD

delicate zephyr
#

Im about to launch 900 clusters and 900 shards

#

to see what grafana looks like

quartz kindle
#

good luck

delicate zephyr
#

not gonna launch all 900 shards

#

obv

#

im not stoopid

zenith terrace
#

aaaa

quartz kindle
#

bbbb

delicate zephyr
#

lmfao

#

Grafana died

#

this is what we call "not worth it"

quartz kindle
#

xD

#

did you actually identify 900 times?

delicate zephyr
#

Nah

#

it identifies 1 shard at a time

#

so it only got through 10

quartz kindle
#

xD

delicate zephyr
#

but it launches all clusters

#

so

#

now I need to wait 5 minutes before I can view my grafana dash again

#

its laggy

oak cliff
#

If people come in here trying to be spoonfed you all have permission to use

solemn latch
earnest phoenix
sick sluice
#

hi, does anyone know how to debug when a bot getting timeout trying to connect to a VC in certain servers?

#

like how to get a VC server ip address

glacial pagoda
#

I Cant Install Dependencies Because This Stupid Error. Can Someone Help Me Fix It

solemn latch
lyric mountain
#

Also, please stop using VB case when typing

glacial pagoda
lyric mountain
opal plank
lyric mountain
#

Well yes but actually maybe

opal plank
#

you can get ips yes

#

looks

#

discord ip

misty sigil
#

OMG DISCORD IP?!

lyric mountain
opal plank
#

heheheheh

misty sigil
#

i thought discord worked on magic hamsters and messenger pigeons

#

not the internet

#

😭

solemn latch
#

isnt that just a cloudflare ip

lyric mountain
#

Who knows

delicate zephyr
lyric mountain
#

But does cloudflare use cloudflare?

delicate zephyr
#

thats fucking cloudflare

#

lmfao

mellow kelp
opal plank
solemn latch
delicate zephyr
solemn latch
#

lol

misty sigil
#

ah so there's still a possibility of magic hamsters and messenger pigeons

solemn latch
#

jinx

lyric mountain
#

4 digit http status

#

Wtf

opal plank
#

well, clearly i didnt bother going that far into a meme

misty sigil
#

between the cf and discord servers

misty sigil
opal plank
#

to actually check the ip

misty sigil
#

they've got some for argo tunnels n some shit

opal plank
#

sounds kinky, im in

lyric mountain
#

Meh

sick sluice
misty sigil
misty sigil
#

oh god

#

my laptop battery is gonna die

#

cya

#

and gn

opal plank
#

o/

sick sluice
lyric mountain
#

Idk then

sick sluice
#

only workaround is move server to another region, eg: from singapore to japan and then my bot can connect to vc just fine

#

but it works in another server in same region the other can't thonkku

lyric mountain
#

Maybe it's the high af latency then

tribal siren
spice tide
#
  let optiona = [
    "add more",
    "like this"
  ]

  let optionb = [
    "add more",
    "like this"
  ]
  let optionac = `${optiona[Math.floor(Math.random() * optiona.length)]}`

  let optionbc = `${optionb[Math.floor(Math.random() * optionb.length)]}`

  let embedwyr = new Discord.MessageEmbed()
  .setTite("Would you rather...")
  .setDescription(`1️⃣${optionac} **OR** 2️⃣${optionbc}`)
  .setColor("GREEN")
  message.channel.send(embedwyr).then (sentMessage => {
    sentMessage.react("1️⃣")
    sentMessage.react("2️⃣")
  })
}
#

I made this for would you rather

#

but it doesn't work

#

can anyone help

solemn latch
#

what doesnt work

tribal siren
spice tide
#

repl process died unexpectedly

#

@tribal siren

tribal siren
#

hm

#

let me eval your code real quick

spice tide
#

ok

tribal siren
#

oh

#

that's your error

#

you're welcome

spice tide
#

o

#

o

#

o

#

o

#

o

#

o

#

i'm dumb

tribal siren
#

stop the spam

nimble kiln
tribal siren
#

please

spice tide
tribal siren
#

im sorry for minimod btw

blissful coral
spice tide
#

np

blissful coral
#

Anyone know why?

#

@delicate zephyr if your on ik you know mongo could you try to help out?

delicate zephyr
#

@blissful coral make sure mongo is listening on 0.0.0.0

tribal siren
#

hm mongo error

#

yes yes i agree with luke

delicate zephyr
#

/etc/mongo/

nimble kiln
#

why 0.0.0.0 when he's connecting to localhost Thonk

delicate zephyr
#

actually

#

good point

#

hmm

tribal siren
#

oh it's localhost?

blissful coral
#

I restarted my bps

#

vps

tribal siren
#

bruh didn't see

blissful coral
#

and mongo went crazy

nimble kiln
#

netstat -tulpen | grep mongo
^idk how the mongo process is called

delicate zephyr
#

@blissful coral shoot me a dm

nimble kiln
#

But with that you can check if the port is listening, on linux

blissful coral
#

ok

earnest phoenix
#

can anyone say how to make a warn command for discord/py

#

ohk but I want to make the bot send the message in the server itself not DM the users!

#

and could you say which docs I need to see!

#

ohk

#

thanks @gritty tartan

nimble kiln
earnest phoenix
#

thanks @nimble kiln

blissful coral
#

Never been more happy to see a green online status

#

never restarting vps again

delicate zephyr
#

rofl

sturdy dock
#

in discordjs all DMs are handled by one shard right?

pale vessel
#

Yes

sturdy dock
#

nice thanks

nimble kiln
crimson vapor
#

yes

#

they are

sturdy dock
#

got it thanks everyone

nimble kiln
#

👌

sturdy dock
#

and there's no way to change this behavior?

crimson vapor
#

nope

sturdy dock
#

ic

#

yeah makes sense lol

crimson vapor
#

in reality there is no drawback as you are likely to get 1000x more guild messages than dms

sturdy dock
#

i'm builing a feature that's pretty DM heavy so I was just curious

crimson vapor
#

even then

#

think about it

#

every guild message gets sent

#

even if its not a command

sturdy dock
#

lmao yeah

#

for sure

#

i was also curious about sharing local storage for dms though

#

for responses

crimson vapor
#

wdym?

sturdy dock
#

arrays, variables

#

it's convenient that it's on a single shard so i won't have to use mysql

crimson vapor
#

ah

robust fern
#

Yo whys my bread not toasting

#

I pulled the lever down. But nothing's happening

solemn latch
#

unplug it and plug it back in

sturdy dock
#

is it plugged in? Thonk

robust fern
#

Wait I just realized it's not connected

#

Hec

#

Ok thank you

sturdy dock
#

rip

robust fern
#

Bye now

nimble kiln
#

lmfao

placid iron
#

@drifting wedge send a ss of the error

drifting wedge
#

alr so

#

ok

#

this for example

placid iron
#

Remove the await

#

Lol

#

You can't await a return

drifting wedge
#

oh

#

lol

#

haha

#

@placid iron

#

coroutine 'render_template' was never awaited

#

and the proper way to do it is "return render_template()"

placid iron
drifting wedge
#

so wot

placid iron
#

return await render_...

drifting wedge
placid iron
#

No

drifting wedge
#

AHAHHHAHAHA

#

i need to read docs lol

#

i mean i do

#

waiy

#

gimme a second

#

yep

#

i just got confuzzed

#

confuzzled

#

@placid iron sorry for murdering 6 brain cells of yours

placid iron
#

It's 4am

#

I can't type

drifting wedge
#

well at least since i killed you last 6 brain cells

#

at least youll die in your sleep

placid iron
drifting wedge
#

alr ty tho

#

youre like my bing duckduckgo google

#

and shivaco is like google

pale vessel
#

did you just insult rovi

drifting wedge
#

no

placid iron
drifting wedge
#

@pale vessel fixed

pale vessel
#

Oh yes

placid iron
#

It's fine. Shicaco is lib dev

earnest phoenix
#

shic

drifting wedge
#

there

placid iron
#

I still need to tell them about my rust one to see if I can get the role

drifting wedge
#

ur both google

#

happy?

earnest phoenix
#

I thought you hated rust syntaxes

placid iron
#

Io

#

I do

#

It's trash

earnest phoenix
#

kek, is this equivalent to async for ... generator?

placid iron
#

Yes

earnest phoenix
placid iron
#

It's actually poggers that is

#

Everything else is bad

uncut swallow
#

hi, is normal a error for installing npm i quick.db?

solemn latch
#

yep

#

follow the troubleshooting guidelines to fix those errors.

uncut swallow
#

thanks

near plover
#

does anyone happen to have a nice clean command system for JDA to give me some inspiration on my rewrite 🙂

snow urchin
fluid basin
#

there isn't an emoji with the name "success"

solemn latch
snow urchin
fluid basin
#

lemme rephrase that, there isn't a discord default emoji with the name "success"

snow urchin
#

that wouldnt matter

sudden geyser
#

You could log the value of x.emoji.name beforehand

snow urchin
#

I figured that out, works now

devout hawk
sudden geyser
#

use breakpoints

sturdy dock
#

I am trying to make a command only useable 5 times every 24 hrs, what would be the best way to do this? Originally my solution was to set up a column in a mysql user database to increment when a user runs the command and set up a mysql global event scheduler to clear it every day but I'm not sure if this is the best way to do so

solemn leaf
#

How can I make my bot play from a live stream

#

play stream

#

say like radio

earnest phoenix
#

is a raspi 3 running ubuntu with 1gb ram good enough to host a bot for a private server?

solemn leaf
#

Yes

earnest phoenix
#

bet

#

so it wasnt in vain after all

snow urchin
earnest phoenix
#

guys im doing my bot uptime but sometimes bot down how to do alwasy up

zenith terrace
#

source.pause is not a function

snow urchin
#

ye thats created by data.append somehow

#

im not just a total idiot

grizzled raven
lethal trout
#

https://sourceb.in/HLTbl7J18k
look at this error
never seen like this before
even my bot not working
the cmds
only cc prefix working
default prefix not working
i am sure it is related to top.gg

opal plank
#

how is that even remotely related to top.gg?

#

Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: yt-dl.org. is not in the cert's altnames: DNS:*.aries.uberspace.de, DNS:aries.uberspace.de

lethal trout
#

uh.................

#

i am not sure from where,why and how is the error coming

#

so idk which code to give KEK

delicate shore
#
  {
    id: '4',
    user: true,
    trigger: '5'
  },
  {
    id:"5",
    message: ({ previousValue }) =>  await api.ai.getReply({previousValue}),
    end: true
  }
#

SyntaxError: /Users/navdeepsharma/Desktop/demo/my-app/src/App.js: Unexpected reserved word 'await' (37:37)

pale vessel
#

remove await

delicate shore
#

it won't work

#

the function has to be awaited

#

will return null

#

and when I removed it I got this error

pale vessel
#

you await it when calling the function

barren solstice
#

are you using a command handler?

delicate shore
#

React is fun they say

pale vessel
#

either way it has to be awaited

delicate shore
barren solstice
#

like this: module.exports = { name: 'ping', discription: 'discription', execute(message, args) { message.channel.send('pong') }, };

delicate shore
barren solstice
#

are you coding ur commands in the index file?

pale vessel
#

try async ({ previousValue })

delicate shore
#

ok lemme try

#

Actually

delicate shore
#

I mixed nodejs with react

#

and its just bullshit now

pale vessel
#

bru

lime current
#

hi

pale vessel
#

it shouldn't even matter because you still need to await the method when calling it

#

so removing await is fine

delicate shore
#

ys but I get some weird error

delicate shore
#

so I figured out that I will just

#

Delete the folder

lime current
#

I have a problem, the bot does not send messages if someone does not have permission, help?

#

cod

delicate shore
#

👍

pale vessel
#

that's weird, express?

lime current
#

client.on("message", message => {
if (message.content == "$clear 5") {
if (message.member.hasPermission("MANAGE_MESSAGES")) {
if (!message.member.hasPermission("MANAGE_MESSAGES")) {
return message.channel.send(You do not have permissions to use this command.)
}
message.channel.bulkDelete(5)
.then(function(list){
message.channel.bulkDelete(list);
message.channel.send("Chat cleared");
})
}
}

});

delicate shore
#

nvm

#

I deleted it

#

will start over

#

Thanks for help

pale vessel
barren solstice
#

yeah

lime current
#

y

pale vessel
#

That second if would never be true

barren solstice
#

you should put a different permission in the second one

pale vessel
#

Third, sorry

lime current
#

@pale vessel delete if (!message.member.hasPermission("MANAGE_MESSAGES")) {
?

pale vessel
#

You're repeating everything twice

barren solstice
#

and ur using double quotes

pale vessel
#

hey what's wrong with double quotes

lime current
#

give me good script
?

pale vessel
#

I use them :(

lime current
#

;_;

barren solstice
#

if he is using eslint it will be wrong

lime current
#

im starting programin ;_;

pale vessel
#

It won't, it depends on what rule you set

lime current
#

ok

cinder patio
#

Lmao imagine using single quotes

barren solstice
sudden geyser
#

all my homies use double quotes

lime current
#

and what can be corrected in this script?

#

;_;

barren solstice
#
    name: 'purge',
    discription: 'discription',
    execute(message, args) {
        if (message.member.hasPermission('MANAGE_MESSAGES')) {
            return message.channel.send('You do not have permissions to use this command.');
        }
        message.channel.bulkDelete(5)
            .then(function(list) {
                message.channel.bulkDelete(list);
                message.channel.send('Chat cleared');
            });
    },
};```
#

all you need to do is add your own command handler

lime current
#

ok

#

thx

barren solstice
#

np

pale vessel
barren solstice
#

bruh

pale vessel
#

they're going to copy paste that

barren solstice
#

ye XD

#

its just eslint

#

it corrected it

#

there was so much unwanted junk

lime current
#

ym

#

where to paste?

#

XD

barren solstice
#

bruh

#

make a command handler its better

lime current
#

..

small tangle
barren solstice
#

yeah ik i fixed that

small tangle
barren solstice
#

i wanted him to learn to troubleshoot problems :D

clear shoal
#

Does anyone write a bot in typescript?

pale vessel
#

A lot do

clear shoal
#

I want to learn, too.

opal plank
#

and i use a typescript library too

near stratus
clear shoal
#

Both.

opal plank
#

probably best to start with something small

#

though

#

heres the question

#

do you know javascript already?

clear shoal
#

yeah

opal plank
#

then you should be fine starting with ts right away

#

i recommend skimming through this

near stratus
earnest phoenix
#

can someone help me make my bot listing look nice

winter basalt
#

What does 'look nice' mean? What do you need help with in particular?

earnest phoenix
near stratus
earnest phoenix
near stratus
#

You can put Custom style in <style> tag too

earnest phoenix
#

Can you help me make my bot post Catchy

near stratus
#

what's cachy ?
some kind of module ?

earnest phoenix
#

Can I pm you

near stratus
earnest phoenix
#

Ok

rose warren
#

I have a problem with this code https://sourceb.in/f0v2HwRcoe
It's not detecting usernames starting with 0, ", < and ;. Possibly others too. Seems to detect !, ,, ., (, -, 5, _ and $ based on the testing I've done and members in my server. Any ideas why it's not detecting some characters but is detecting others?

EDIT: Found the problem. In a Discord server that has member screening enabled, users who haven't accepted the rules yet still appear in the member list even though they haven't been approved yet, so bots can't detect them. Disabling the built-in member screening in the server settings allows you to get around this.

earnest phoenix
#

It does

#

hey

#

dupa

old cliff
#

what is the use of worker sharding manager mode ?

lusty quest
#

i guess it uses Node.js workers for spawning each shard

old cliff
#

what is the use of worker ?

lusty quest
#

running the process on a different Thread

old cliff
#

omg I am so stupid... I could make gif modulation on a worker thered

#

so it happens more quickly

#

hmm 😛

lusty quest
#

its not really faster, just wont bog down your main thread running the bot itself

#

if you want to make it faster add a Dedicated GPU for rendering

old cliff
#

no it uses cpu

lusty quest
#

yes but CPU is way slower than GPU for rendering

old cliff
#

but my code uses cpu

lusty quest
#

yea i know. but if you want to make it faster add a Dedicated GPU

#

or have it running on mutiple threads at once on your CPU

fathom frost
#

Does someone knows how to put that description thing like Playing or Streaming on the bots?

blazing sage
#
await client.change_presence(activity=discord.Game(name="Fortnite: Ray Edition"), status=discord.Status.idle)
await client.change_presence(activity=discord.Game(name=f"on {len(client.guilds)} servers"), status=discord.Status.idle)
await client.change_presence(activity=discord.Streaming(name="Fortnite", url="url goes here"),status=discord.Status.idle)
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="My Master, Ray"), status=discord.Status.idle)await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="Dark Riot Gamers"), status=discord.Status.idle)
#

My BOT code

#

most of those r here

fathom frost
blazing sage
#

yes

lusty quest
#

if you post code here make sure to not spoonfeed, also it might help to know for what language/library the code is

blazing sage
#

Ok

fathom frost
#

discord.js

blazing sage
#

Aha LOL

fathom frost
#

O_O

#

(i dont know if I'm saying something stupid...)

blazing sage
#

Search on google?

fathom frost
#

. . .

#

ok i will shut up

lusty quest
#

well your code doesnt look like d.js tbh. this is why im asking

fathom frost
#

const Discord = require('discord.js')

#

It's d.js

lusty quest
#

change_presence is something i cant really find in the docs, this is why im not sure that its d.js

#
// Set the client user's presence
client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' })
  .then(console.log)
  .catch(console.error);```this is what the docs give you
fathom frost
#

well i am BIG noob, so i will let the true programmers talk here...

lusty quest
#

if its a thing ok but its nothing i havent seen here in about 1 year on this discord here

nocturne peak
#

you can do setActivity("activity", { type: 'PLAYING' });

#

for streaming you'll need an extra key, which is url a link to ur stream

fathom frost
nocturne peak
#

add the code into your ready event

fathom frost
#

wait

#

Can't I add just a word

nocturne peak
#

thats really not how that works

fathom frost
#

Like only: PLAYING memes

#

Uh

nocturne peak
#

please learn js

fathom frost
#

STUPID CODE

nocturne peak
#

no

fathom frost
#

AAAAAAAAAAAAAa

nocturne peak
#

the code makes sense

#

you dont lol

fathom frost
#

WHY IS THIS NOT SIMPLE

nocturne peak
#

i've litreally given you the code

fathom frost
nocturne peak
#

you have to call one function

#

with 2 params

lusty quest
#

its simple, you just have to understand how it works

fathom frost
#

eh ok

#

maybe when I grow up

nocturne peak
#

before making a bot learn js

#

or the programming language u are doing the bot in

fathom frost
#

ok

#

Maybe when I grow

#

up

#

I will let the bot how he is

nocturne peak
#

then why did u make a bot

fathom frost
nocturne peak
#

yea you do you

fathom frost
#

I do

nocturne peak
#

1 function has killed your motivation