#development

1 messages ยท Page 1487 of 1

stuck pike
#

I asked same question some days ago lawl

fathom nymph
#

Hey

sacred trout
#

hello gray

#

vvvvvvvvv

fathom nymph
#

How do i make the picture

sacred trout
#

lol?

fathom nymph
#

instead of that boring internet look

stuck pike
#

Wot

sacred trout
#

idk

stuck pike
#

@fathom nymph what is that?

fathom nymph
#

html

stuck pike
#

O

sacred trout
#

uh

stuck pike
#

Use image src

#

@CallMeGray#0001

#

That's basic lmfao

fathom nymph
#

welp

#

ok]

sacred trout
#

``@client.command()
async def wanted(ctx, user: discord.Member = None):
if user == None:
user = ctx.author

wanted = Image.open("wanted.jpg")
asset = user.avatar_url_as(size = 128)
data = BytesIO(await asset.read())
php = Image.open(data)
php = php.resize((244,306))

wanted.paste(phh, (189,262))

wanted.save("profile.jpg")

await ctx.send(file = discord.File("profile.jpg"))``
#

@fathom nymph

#

?

stuck pike
#

#gaycanvas

sacred trout
#

lol

stuck pike
#

Lol

sacred trout
#

ofc

knotty obsidian
#

anyone knows how to turn my project into a ARMv7 thing on Intellij IDEA

toxic glade
#

@earnest phoenix

vale garden
#

yo

toxic glade
#

hi

earnest phoenix
sacred trout
#

umm

#

plox help!!!!!

lament rock
#

That was their code they wanted help with. LOL

sacred trout
#

bruh

#

why you bully me liek dat? ;-;

lament rock
#

Was loling at norizon for not understanding the complete context

sacred trout
#

lawl

#

pls send help

earnest phoenix
#

Oh really? Mb then, Gray was asking something about a picture which I believe has something to do with favicon, and then ctx.author just sent a code which related to image and tagged Gray and didn't ask anything

sacred trout
#

umm

earnest phoenix
#

ctx.author, phh is not defined

lament rock
sacred trout
#

php?

lament rock
#

wanted.paste(phh, (189,262))

#

phh is not defined

sacred trout
#

fuck me

#

xD

earnest phoenix
#

And you should save the image to BytesIO, imagine 100 people were using the command at the same time, which profile.jpg is gonna be sent?

#

I wonder if that's gonna get corrupted

#

nah it would probably throw

#

the file would be locked

#

while its open

#

How to get a guild invite? I forgot (js)

#

How we use the languages.json

#

?

pale vessel
#

require("languages.json");

#

done

earnest phoenix
#

Is my I can use for the commands

#

How we make ?

lusty quest
#

make a collection where you reference a guild to a selected language and export the collection. (or map or object also works) then just reference the guild with the key for the string you want to send

tribal siren
#

how to get the first channel of the guild that the bot sees?

cinder patio
#

so the channel which is at thw highest position?

#

the*

tribal siren
#

yes

earnest phoenix
#

filter channels which are text ones and where you have permissions to send and read messagesลพ

#

then just sort by their position in an ascending order

umbral zealot
#

A very very complete example of this: ```js
const getDefaultChannel = (guild) => {
// get "original" default channel
if(guild.channels.cache.has(guild.id))
return guild.channels.cache.get(guild.id)

// Check for a "general" channel, which is often default chat
const generalChannel = guild.channels.cache.find(channel => channel.name === "general");
if (generalChannel)
return generalChannel;
// Now we get into the heavy stuff: first channel in order where the bot can speak
// hold on to your hats!
return guild.channels.cache
.filter(c => c.type === "text" &&
c.permissionsFor(guild.client.user).has("SEND_MESSAGES"))
.sort((a, b) => a.position - b.position ||
Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber())
.first();
}

// This is called as, for instance:
client.on("guildMemberAdd", member => {
const channel = getDefaultChannel(member.guild);
channel.send(Welcome ${member} to the server, wooh!);
});

quartz kindle
#

you can also check for guild.systemChannel

spiral crag
#

Guys i was wondering if a feature like bots being able to stream video would come in the near future?

quartz kindle
#

nobody knows

earnest phoenix
#

@umbral zealot arrow functiom without braces on multiple lines that's illegal

earnest phoenix
umbral zealot
#

It's definitely not illegal ๐Ÿ˜‚

earnest phoenix
#

I'm super dumb
I kept getting an error : Type error : Assignment To Const Value
Cuz I kept trying to change a constant value cuz I forgot u couldn't

#

Lol

umbral zealot
stuck pike
#

what is a good free hosting till lik 80 ish members

#

80 ish server*

earnest phoenix
#

I use repl.it and had no problem when my bot was in 70 servers

#

My old bot that got deleted

stuck pike
#

waw

earnest phoenix
#

How to check if guild is deleted then delete all from database?

#

Gives u 500 mb memory

stuck pike
#

anyone has a good support server

#

where i can test my boy

#

boy;-;

earnest phoenix
#

Lol

stuck pike
#

bot*

earnest phoenix
#

Any help?

umbral zealot
earnest phoenix
umbral zealot
#

If a guild is deleted it triggers the same event as when leaving a guild, yes.

stuck pike
earnest phoenix
#

Ok Got it.

#

ThAnks

#

Yes

mint hamlet
#

Hey, I wanted to check whether the user has modrole role but .roles returns all the role names and not the IDs.
The variable modrole is accessed from my database and it is the role ID
How can I get all the role IDs of the user?
P.S. Using ctx.author.roles.id gives AttributeError

if modrole in ctx.author.roles:```
quartz kindle
#

.roles is a list of Role objects

earnest phoenix
#

Can ye use npm to update node

heavy marsh
#

I am trying to get all the users that included the name Deleted User from the ban list using discord.js - v12

let users = await message.guild.fetchBans()

for (const user of users.array()) {
          await user.username.includes(`Deleted User`).then(console.log(user))
          
}
``` - I get errors
umbral zealot
#

"errors"

#

very useful

umbral zealot
#

you can update npm

#

if you want to update node you need n or nvm

earnest phoenix
#

ok

quartz kindle
#

there are no promises there, just do it the normal way

pale vessel
#

Isn't it user.user.username?

pure lion
#

yeah

#

because user in that context is a member

pale vessel
#

no

#

it's a ban entry

pure lion
#

ah

pale vessel
#

that has reason and user

pure lion
#

either way

#

what you said is correct

grizzled raven
#

docs are pretty cool to read right guys

pale vessel
#

idk

misty sigil
#

docs are great fun

#

apart from canvas docs

pure lion
#

great read

#

@misty sigil

misty sigil
#

i love docs

pure lion
#

same

misty sigil
#

that was surprisingly short

grizzled raven
#

the easiest docs to read are the ones that always roll in from ledge

earnest phoenix
#

I want meme command to be fast. What options I have how can I speed up fetching and show to user.

pale vessel
#

A better internet

#

Caching

earnest phoenix
#

๐Ÿ˜

misty sigil
#

you donโ€™t wanna cache a random api request do you?

earnest phoenix
#

I am fetching from reddit

#

got('https://www.reddit.com/r/memes/random/.json').then(res => { let content = JSON.parse(res.body) message.channel.send( new MessageEmbed() .setTitle(content[0].data.children[0].data.title) .setImage(content[0].data.children[0].data.url) .setColor("RANDOM") ) ) })

#

I got this code from friend

pale vessel
#

I use that too and it works just fine

earnest phoenix
#

It's slow?

pale vessel
#

Not really

earnest phoenix
#

What if thousands of user use?

pale vessel
grizzled raven
#

fetch multiple posts, cache them, get one per command used, fetch more when the list ends

earnest phoenix
#

How to cache?

misty sigil
#

new Map()

earnest phoenix
#

Oh nice

grizzled raven
#

new Object() bigbrain

misty sigil
#

no

#

I prefer map

earnest phoenix
#

Nice

#

Can you tell how to use map.

#

I never used it

grizzled raven
misty sigil
#

MDN

earnest phoenix
misty sigil
grizzled raven
#

Map<string, Array>

#

wait

#

eh either way

misty sigil
#

Iโ€™d personally Map<string, Object>

earnest phoenix
#

How much map can hold?

misty sigil
#

string being the post title and object being the post

misty sigil
#

:^)

grizzled raven
#

so it'd be a map for each guild?

earnest phoenix
#

Any effect on bot speed?

misty sigil
#

no, Iโ€™d say global

misty sigil
grizzled raven
#

well

misty sigil
#

If you use it correctly that is

grizzled raven
#

how many servers is your bot in

misty sigil
#

:p

earnest phoenix
#

๐Ÿ˜

#

Ok

grizzled raven
#

alrighty then

stuck pike
#
const cheerio = require('cheerio');
const discord = require("discord.js");

module.exports = {
  name: "wallpaper",
  description: "info",
  aliases: ["wl", "weeb"],
  async run (client, message, args){


    let random = Math.floor(Math.random() * 107)
    let text = await fetch(`https://hdqwalls.com/category/anime-wallpapers/page/${random}`, { method: "GET" })
    text = await text.text()
    let $ = cheerio.load(text)
    let images = []

    $('img[class="thumbnail img-responsive custom_width"]').each(function(i, elem) {
      images.push($(this).attr('src'));
    });



    let limit = images.length
    let pg = 0;
    let embed = new discord.MessageEmbed()
      .setColor("#FF69B4")
      .setImage(images[0].replace("/thumb", ""))

    const msg = await message.channel.send(embed);

  

#

why aint aliases working?

grizzled raven
#

aliases as in wl and weeb?

stuck pike
grizzled raven
#

then that's your command handler or message event

tribal siren
#

how to get the first 3 characters of a user's username?

quartz kindle
#

username.slice(0,3)

pale vessel
#

Tim

#

"Tim".slice(0, 3);

grizzled raven
#

message.client.users.cache.get(userID).username[0] + message.client.users.cache.get(userID).username[1] + message.client.users.cache.get(userID).username[2]

earnest phoenix
#

Lmao

#

Hello ๐Ÿ‘‹. I'm making a command that gives everyone a specific role. I would like to send a message after it completed the loop. How can i do that?

grizzled raven
#

await

#

promises

earnest phoenix
#

the add role promises?

grizzled raven
#

but, depending on the size of the server it may not be ideal to do this, unless you space out the requests

earnest phoenix
#

I use Eris, it handles rate limits for me ๐Ÿ‘

grizzled raven
#

something like await Promise.all(message.guild.members.cache.map(m => m.roles.add(roleID)))

#

but in eris

#

then send the message after the await statement

earnest phoenix
#

Aha, alright let me test something like that.

pale vessel
#

I guess Promise.all(guild.members.map(x => x.addRole(id));

earnest phoenix
#

Can i use a forEach loop?

pale vessel
#

Don't

#

Those don't handle async well

earnest phoenix
#

Hmm alright ill try map then

pale vessel
#

map AND promise.all

misty sigil
#

ok Iโ€™m here because I cba with slowmode and the twats in general

#

anything exciting

#

no? aw

quartz kindle
pale vessel
#

oh

quartz kindle
#

mapping promises or using forEach is the same thing

#

all are executed concurrently

pale vessel
#

it doesn't await it?

earnest phoenix
#

Seems to work.

pale vessel
#

bruh

pale vessel
#

so a for loop then?

quartz kindle
#

yes, a for loop with await is the only way to do it sequentially

earnest phoenix
#

hm

#

await for() {} ?

misty sigil
#

for async() {}

#

iirc

pale vessel
#

just for (x of members) await x.addRole(id);?

mellow kelp
#

Pretty sure the loop itself must be inside an async context

quartz kindle
#

the classic way is just ```js
for(const x of ...) {
await x.addRole(id)
}

#

but you may be able to use the new async iterators

earnest phoenix
#

Yep

#

Works

#

thanks

#

I use discord.py but I have found recently that the guild.members() doesn't work as it should, and only returns the bot itself as a member. Does anyone have the same problem and can help?

wanton thunder
#

discord.Member

#

@earnest phoenix

earnest phoenix
#

Hmmm

#

I'll take a look

wanton thunder
#
async def geton(ctx, member: discord.Member, *, reason=None):
    i = 5
    while i > 0:
        i -= 1
        await ctx.send(f"Get the fuck on {member.mention}")
#

this is how i used it in one of my bots lol

#

@earnest phoenix

earnest phoenix
#

Hmmm ok

#

Thanks

wanton thunder
#

i know a fuck ton of discord.py so just lmk if you need any more help

earnest phoenix
#

I am trying to add loads of commands this next few weeks so I'll probably need it lol

wanton thunder
#

i gotchu lol

#

have you set up cogs or are you just using one file

surreal sage
#

What 'language' is this?

49 20 77 6f 6e 64 65 72 20 69 66 20 79 6f 75 27 6c 6c 20 68 61 76 65 20 74 6f 20 6b 6e 6f 77 20 68 6f 77 20 74 6f 20 64 65 63 6f 64 65 20 74 68 69 73 3f```
wanton thunder
#

assembly maybe?

#

no no nvm

cinder patio
#

That's just hexadecimal numbers...

surreal sage
#

thx

runic gyro
#

Does anyone know how to change style of the menu of bot?

azure yoke
#

What do you mean by that? What library do you use?

willow mirage
surreal sage
#

It was hexadecimal.

willow mirage
#

oh

#

nvm then

restive furnace
#

hexadecimals are like number, often presented in languages they are like: 0xFF2074

earnest phoenix
#

```message.channel.overwritePermissions(message.guild.id, { SEND_MESSAGES: false }).then(() => { message.channel.send(Channel locked).then(() => {

how to rename channel ?
earnest phoenix
#

Thanks ๐Ÿ˜˜

restive furnace
#

CALLback HELL

pale vessel
#

that ain't callback sure

umbral zealot
#

technically the .then() method takes a callback function.

quartz kindle
#

promises were made to fix callback hell

#

then they introduced promise chaining hell

#

then async/await was made to fix promise chaining hell

#

xD

misty sigil
#

what did that bring

umbral zealot
#

Heaven ๐Ÿ˜‚

quartz kindle
#

nothing, async await is amazing

#

xD

#

although it did bring sync/async confusion hell

#

xD

misty sigil
#

just unconfuse yourself

quartz kindle
#

^

#

Promise used confuse ray

#

its super effective

crimson vapor
#

it makes sense tho

#

tbh most things make sense in js

#

its just whether or not you understand why it makes sense

pale vessel
#

am I the only one who prefer promise.then().catch() rather than try catch await? unless there's an easier way

crimson vapor
#

maybe

digital oyster
opal plank
sudden geyser
#

and code blocks that require it.
What would require it?

I'd say try {...} catch (...) {...} is better when you have multiple expressions that may throw an error and you want them all to be handled the same way.

#

Or if you need to do a side affect that can't be restricted to the function call you provide to .catch

#

Like returning early.

thin apex
#

how to get custom status?

opal plank
thin apex
#

discord.js ig

#

for bots

drifting wedge
#

we're taking this channel over ๐Ÿ˜Ž

#

issa joke

earnest phoenix
#

what if i told you that i downvoted all anime bots in the bot suggestion form v2 for being anime

drifting wedge
#

@placid iron @old cliff ok so like how do i like give js the response i want to show

#

from flask/quart

placid iron
#

you can just do

#

return dict()

#

have the dict contain the data you want

drifting wedge
#

mhm

#

but how do i return it?

#

like and how does js get it?

opal plank
# sudden geyser > and code blocks that require it. What would require it? I'd say `try {...} ca...

@sudden geyser
say you have a variable

let foo= {
}
db.fetch(thing).then((thing) => foo.db = thing).catch(e => console.log(e));

try {
let bar = await fetch(url, params);
bar.parse();
let _bar = await fetch(e.anotherURL, params));
foo.response = _bar
} catch() {}

return foo```
In this example, foo is not dependant on anything.
the first db fetch is also not dependant on anything, as if it fails, nothing would go wrong.

However in the try catch block, _bar is dependant on bar, for chaining promises and parsing, things might go wry. Not only for promises, but that parse too for example, if you get an error, you cant parse it, and normally you would need to check if bar was returned, and its type. With that try catch you are expecting that whole code block to perhaps fail and not be added onto foo.
placid iron
#

when i update a character this is what i do

#

and in the backend

opal plank
#

if its not urs or public and the owner tells you to take it down, yeah

placid iron
drifting wedge
#

flask cant edit the page directly doe

#

wait

#

i might have an idea

old cliff
#

use ajax

placid iron
#

dude

old cliff
#

bruh

drifting wedge
#

gimme 5 mins

placid iron
#

stop

pale vessel
#

why are you using flask

placid iron
#

ajax

#

is bad

drifting wedge
#

mhm

opal plank
drifting wedge
#

not ajax

old cliff
#

is it ?

drifting wedge
#

look

#

i have big brain idea

#

so on post request

#

i change the var

#

GIMME A MIN

old cliff
#

ajax is used everywhere

earnest phoenix
#

jquery moment

drifting wedge
#

IM SO BIG BRAIN

opal plank
#

not only for bots, for anything. If its not yours, dont use it, rule of the thumb. Copyright applies to anything really

thin apex
#

you think i haven't read the docs?

opal plank
#

clearly not

#

cuz thats what you looking for

thin apex
#

no

#

that makes it say

#

"Playing"

drifting wedge
#

wait no

#

it wont work

old cliff
#

he is talking about front end js @thin apex

drifting wedge
#

rip

placid iron
#

@drifting wedge teh website makes a request to the server to edit teh data, if the server says it is ok then the website stays as it is otherwise it changes teh data back

drifting wedge
#

maybe

#

gimme a min

earnest phoenix
#

@drifting wedge learn frontend js ig

drifting wedge
#

mhm*

thin apex
#

I am not

sudden geyser
#

However in the try catch block, _bar is dependant on bar, for chaining promises and parsing, things might go wry. Not only for promises, but that parse too for example, if you get an error, you cant parse it, and normally you would need to check if bar was returned, and its type. With that try catch you are expecting that whole code block to perhaps fail and not be added onto foo.
So about the same thing I was saying about multiple expressions being handled the same way, but including errors not caused by a promise rejection.

thin apex
#

I am talking about discord.js

old cliff
#

You want browser to send request or server ? @drifting wedge

thin apex
#

not my status

#

for a bot

#

look at this image

drifting wedge
#

ok so

earnest phoenix
#

yeah?

drifting wedge
#

i have flask validate the reponse

pale vessel
#

So grab the member?

thin apex
#

see that there is no "Playing" in front?

placid iron
#

also in what i have said, flask doesnt edit the page at all

drifting wedge
#

but i want to SHOW like a text or something saying: worked | not worked

placid iron
#

yes

drifting wedge
#

so i need to use js

#

to change it

placid iron
#

BRUH

#

YES

#

wtf are you on

thin apex
drifting wedge
#

but i need flask to send the validation TO js

earnest phoenix
pale vessel
#

bro flask is for backend

placid iron
#

do you even read what i have been sending and saying

pale vessel
#

you're doing frontend

thin apex
pale vessel
#

wtf that's XHR

thin apex
opal plank
opal plank
#

chill your tits

old cliff
#
 document.getElementById("demo").innerHTML = this.responseText;```
#

this ?

pale vessel
#

Be patient for god's sake

earnest phoenix
#

what the fuck

earnest phoenix
#

discord doesn't allow bots to have normal status

placid iron
earnest phoenix
#

a custom statis

thin apex
placid iron
#

i send a delete thing to the server, if it deletes it then the page will remove it to show it has been deleted

earnest phoenix
#

idfk

#

what language are you hsing

old cliff
#

how a normal status ?

placid iron
#

otherwise it doesnt remove it from teh page

earnest phoenix
#

using*

thin apex
#

Discord.js

earnest phoenix
#

that's illegal

thin apex
#

for the 7th time

drifting wedge
earnest phoenix
#

in Js you can simply use ".setActivity"

thin apex
opal plank
#

@thin apex can we stop spamming?

thin apex
#

it has a game

old cliff
earnest phoenix
#

look in the docs

thin apex
earnest phoenix
#

You cant have a status without playing or listening or streaming or watching

earnest phoenix
#

oh you want to set it to 'gaming' ?

thin apex
earnest phoenix
#

then..?

opal plank
#

where did you even get that pic from?

placid iron
#

@drifting wedge flask will send a response with the STATUS of 200 or whatever error applicable, if the status is 200 then the page will show a div saying edited sucessfully otherwise it will say it didnt edit

opal plank
#

it could very well be photoshoped

thin apex
opal plank
#

i know

thin apex
opal plank
#

where is that from?

#

did YOU take it?:

earnest phoenix
#

it is completely utterly impossible to do that

#

oh i just understand

#

Discord api says you cant

drifting wedge
earnest phoenix
#

Now if you want to continue yelling at us read the fucking api docs

opal plank
pale vessel
old cliff
#

something like this ?

#

this is how you edit html without reload

drifting wedge
placid iron
pale vessel
#

USE FETCH

old cliff
#

u using python ?

earnest phoenix
#

bots cannot have custom status because custom status is wrapped rich presence

rich presence is user token & client only

pale vessel
#

oh my god

earnest phoenix
drifting wedge
#

ok so i have flask getting the form awnser

earnest phoenix
#

hes just using another language

placid iron
#

@pale vessel ima just go

#

๐Ÿ˜ฉ

#

literally going in circles

earnest phoenix
#

and since the custom status is long, its a status that rolls

drifting wedge
#

i got the idea

thin apex
#

what the heck

earnest phoenix
#

@drifting wedge try looking up a recent tutorial on yt for it

old cliff
#

U using py or js ? @drifting wedge

thin apex
#

that's from my client

drifting wedge
#

but i dont know how i wopuld

earnest phoenix
drifting wedge
#

js front end

old cliff
#

ok

#

use ajax js frontend @drifting wedge

earnest phoenix
#

the text above means "Playing"

#

@thin apex dude you asked a question we answered it and you're continue to ask how they did it

placid iron
#

stop with ajax bruh

#

just yse fetch

old cliff
#

oof you dont understand @placid iron

earnest phoenix
#

if you know we're wrong what's the point of asking

thin apex
#

i was still confused

pure oar
#

how do i get the bot dev role again

earnest phoenix
#

also yall keep forgetting that discord is a website (including the desktop client) and that everything can be edited with inspect element lmfao

thin apex
thin apex
pale vessel
#

Inspect element? Nah, that's photoshopped

old cliff
#

inspect easier

drifting wedge
#

ok so flask can send variables with the website, but like how can flask send something to js, without having to reload the page?

#

thats the thing

earnest phoenix
#

it ๐Ÿ‘ is ๐Ÿ‘ impossible ๐Ÿ‘ for ๐Ÿ‘ a ๐Ÿ‘ bot ๐Ÿ‘ to ๐Ÿ‘ have ๐Ÿ‘ normal ๐Ÿ‘ status

drifting wedge
#

with post requests / get?

pale vessel
#

did you even take that screenshot

earnest phoenix
#

when you boot up ps but ps says scratch disks are full ๐Ÿ˜”

opal plank
old cliff
#

flash can respong with json @drifting wedge

drifting wedge
#

yes it can

old cliff
#

and ajax could interpret that @drifting wedge

pure oar
old cliff
#

and edit page accordingly

drifting wedge
#

but how would it update the variable

old cliff
#

it can

drifting wedge
#

without reloading the entire page?

opal plank
#

the person they copied that image from was likely using client mods

pale vessel
#

Dude

#

DOM

#

DOM

old cliff
#

yes

earnest phoenix
#

@pure oar submit a bot and get it approved

pale vessel
#

oh my god

old cliff
#

no reload needed

drifting wedge
#

i gtg sorry

drifting mortar
#

TURKEY๐Ÿ‡น๐Ÿ‡ท๐Ÿ‡น๐Ÿ‡ท

pale vessel
#

you don't need to reload

old cliff
#

the whole point of ajax is to make a request and fetch and not reload and update page @drifting wedge

pale vessel
#

you just wait for the response from the API

thin apex
#

duh

#

unless you're doing API stuff

earnest phoenix
#

wait till they discover SPAs and state management

#

unlocking a whole another realm

umbral zealot
#

Oh man wait until they discover REACT.

drifting mortar
#

๐Ÿ‡น๐Ÿ‡ท๐Ÿ‡น๐Ÿ‡ท

#

Love

#

๐Ÿ‡น๐Ÿ‡ท๐Ÿ‡น๐Ÿ‡ท

old cliff
#

stop spamming jerk

earnest phoenix
#

stop being annoying

#

lmao what

drifting mortar
#

Where are you from

earnest phoenix
pale vessel
#

Not Turkey

earnest phoenix
#

mars

old cliff
#

Pluto

drifting mortar
#

Sorry

earnest phoenix
placid iron
#

@drifting wedge this is what you want to do
FRONT END

async function onClick() {
    r = await fetch("update_page", {method:"patch", body=data))
    banner.style.display = "block"
    if (r.ok) {    
        banner.innerText = "saved!"
    } else {
        banner.innerText = "coulnt save!"        
    }
}```

backend```py
async def update_page(requqst):
    # validate data
    if valid:
        return flask.ok
    else:
        return flask.badRequest```idk fask so idk how to do that but something like that
pale vessel
earnest phoenix
#

@placid iron yo u having a stroke with that much spelling mistkae

pale vessel
#

he's on mobile

#

wait nvm

crimson vapor
#

thats poggers discord theme

#

tbh

#

I rate

earnest phoenix
#

acrylic background

stuck pike
#

is replit good?

pale vessel
#

No

crimson vapor
#

vps > most

placid iron
#

im not actually writing it for myself so i dont mind if i get spellings, its just less pesudo pesudo code so dude knows what to do

earnest phoenix
stuck pike
#

best free hosting?

earnest phoenix
#

yes

#

repl is best free host

stuck pike
#

for like 80 ish server

earnest phoenix
#

no

#

use a vps for that much

stuck pike
earnest phoenix
#

i have three servers rn so ยฏ\_(ใƒ„)_/ยฏ

earnest phoenix
#

dbl

#

ok

shadow furnace
earnest phoenix
#

yeah

placid iron
#

yea

stuck pike
#

yea

earnest phoenix
#

anything paid is good

placid iron
#

rpi is great, if you get it for free

#

๐Ÿ˜Ž

deft lark
#

'

shadow furnace
stuck pike
stuck pike
earnest phoenix
#

with free version + uptimerobot it is like 90% uptime

#

with hacker plan we're getting 99.999% uptime in 2021

#

hacker plan

stuck pike
#

smh repl is confusing

#

idk how to host there

earnest phoenix
#

literally just open an http server then set uptime robot to send an http request every five minutes

stuck pike
#

lawl

earnest phoenix
#

just a simple server

umbral zealot
earnest phoenix
#

evie advertising his website

earnest phoenix
#

@modums ban ban ban ban

umbral zealot
#

Good!

umbral zealot
placid iron
stuck pike
earnest phoenix
#

and this is why we use gender neutral pronouns on the internet!!

stuck pike
#

how much does data repl it gives

#

like ram>

placid iron
#

you couldve avoided it tbh
EVIE ADVERTISING EVIES WEBSITE Shocked Shocked Shocked Shocked Shocked Shocked Shocked

#

but that is a pain

earnest phoenix
#

this is all the code i have:

const app = require("express")(app);

app.get("/", (req, res) => res.status(200));

app.listen(8080);

// =====botum code
umbral zealot
#

I mean it's literally not my website tbh

blissful oxide
#

banned for ads

cobalt spruce
#

could you ping role in embed ?

umbral zealot
#

I don't own that domain. Or that gitbook team. Thanks.

placid iron
#

ban speedrun time?

earnest phoenix
#

ikr

#

supa easy

cobalt spruce
pale vessel
#

No

blissful oxide
cobalt spruce
#

sad

earnest phoenix
umbral zealot
#

Oh really?

#

Huh.

blissful oxide
#

because people kept posting links to stuff asking how to code it LUL

#

and we were like...no why tf would we give you a tutorial on how to follow a tutorial

umbral zealot
#

But the guides literally say how to code it! ๐Ÿ˜‚

#

That's why you need a jsfirst tag in every programming server, tbh

earnest phoenix
blissful oxide
#

lol

umbral zealot
blissful oxide
#

yeah we have something like that in pins

stuck pike
#

how much ram replit gives tho?

blissful oxide
#

kids never read it though

stable eagle
#

e

umbral zealot
#

Tylers never care, do they?

earnest phoenix
#

Imma go put a selfbot on me account that responds to learnfirst

stuck pike
#

lol

umbral zealot
#

That's what used to be the primary use of my own selfbot actually. Tags.

#

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

earnest phoenix
#

๐Ÿ˜ฎ

crimson vapor
#

lmao

earnest phoenix
#

EVIE MADE SELFBOT

#

BAN BAN BAN BAN

blissful oxide
#

mine just used to post my messages as pink embeds

blissful oxide
#

I miss those times lol

crimson vapor
#

the only reason I would selfbot would be to have 24/7 online

blissful oxide
#

simpler discording

earnest phoenix
crimson vapor
#

no one dms me lol

umbral zealot
#

I had other features, actually. Like ghost ping detection, and kick/ban commands (all with the / prefix which was super convenient)

earnest phoenix
#

why should they

crimson vapor
#

exactly

opal plank
#

only selfbot i would use is the ones to auto delete links in my dms if the dms are new and their first message contains a link.

earnest phoenix
#

nobody dms weebs

#

i get dms tho

crimson vapor
#

im not a weeb lmfao

earnest phoenix
#

from luca

opal plank
#

everybody gets shitty dms

earnest phoenix
#

saying botum got declined

crimson vapor
#

I get people asking me for help

pale vessel
umbral zealot
#

if I had a selfbot I'd use it for bot reviewing ๐Ÿ˜‚

crimson vapor
#

ok

#

LOL

blissful oxide
#

oh and the other thing I used it for

crimson vapor
#

eval command

#

lol

blissful oxide
#

was checking how many servers I was in with eval

#

that was the shit

umbral zealot
#

Obviously eval is bae

earnest phoenix
blissful oxide
#

its 2020 and we STILL do not have a built in UI element just to tell us how many fucking servers we're in lmao

#

scratch that

#

its basically 2021

placid iron
#

installation

earnest phoenix
#

did you know?

crimson vapor
#

not this again

#

please

pale vessel
#

?

opal plank
#
client.on('message', (m) => {
if(m.type !== 'dm') return;
if(/fancyURLRegexhere/g.test(m.content) || /fancyDiscordInviteRegerx/g.test(m.content)) {
m.user.block();
m.user.report();
}
})```

Someone make this selfbot pls
crimson vapor
#

fuck regex

opal plank
#

regex good for finding URL's

crimson vapor
#

if (m.content.includes('discord.gg')) doShit()

earnest phoenix
#

remove the two ifs mmLol

opal plank
#

no u

#

add it all onto a single if

blissful oxide
crimson vapor
#

wtf

pale vessel
#

lost nitro PepeHands

crimson vapor
#

you lost nitro

#

sad

umbral zealot
blissful oxide
earnest phoenix
#

@opal plank here's your regex:

const urlRegex = /https?:\/\//;
const inviteRegex = /discord\.gg/;
opal plank
#

mememe

#

ik, i have tags for the regexes

pale vessel
#

n.tag regexes

#

close

#

god damn it

crimson vapor
#

thats cool tbh

opal plank
#

imagine taking off the bot that was doing gods work in the stead of R.Danny

#

since R.Danny cant be added on other servers anymore since it aint verified

old cliff
#

thanks for regex

opal plank
#

yw

placid iron
#

i watched the youtube video of your pfp

#

its basically hentai

opal plank
#

anime of culture is the right term

earnest phoenix
#

@opal plank steam...

opal plank
#

i should be coding rn

crimson vapor
#

or drinking?

opal plank
#

both

misty sigil
#

get to coding code monkey

opal plank
#

i need to start getting the framework for the votes in place

old cliff
#

but that hentai pfp isn't nsfw cause

#

you know

#

it isn't

#

can be called explict

earnest phoenix
#

when you get happy that you get free regex but you dont know the invite for erwin's botum

old cliff
#

yes I need that bot

timber hinge
#

How to make the bot 24h open and not lock I have tried except for sites and it didn't work

opaque seal
#

What?

distant mango
#

Hosting

timber hinge
#

Please help me

#

How to make the bot 24h open and not lock I have tried except for sites and it didn't work

distant mango
#

lol

earnest phoenix
#
  1. Stop spamming
  2. What host are you using currently?
distant mango
#

You must be one of the worlds most impatient people

distant mango
earnest phoenix
#

self host is good tho

distant mango
#

But not if you canโ€™t keep it up

#

If you have a server n stuff thatโ€™s cool but

unreal light
#

Is there any method to keep bot online 24x7?

sudden geyser
#

A VPS

earnest phoenix
#

Yeah

unreal light
sudden geyser
#

A virtual private server (VPS) is a virtual machine sold as a service by an Internet hosting service. The virtual dedicated server (VDS) also has a similar meaning.
A VPS runs its own copy of an operating system (OS), and customers may have superuser-level access to that operating system instance, so they can install almost any software that run...

kindred igloo
#

A

unreal light
#

Thank you :)

shut spear
#

bot's activity status disappears for unknown reason

#

what could cause this?

wind crow
#

Brand new at this is there a guide?

sudden geyser
#

A guide for what?

unreal light
#

I am not able to keep my bot online 24x7 ๐Ÿ˜ฉ

quartz kindle
#

bots are a program

#

the bot is only online while the program is running

#

the program needs to run somewhere, either in your computer or in some computer somewhere

#

a vps is a private computer that you rent and connect to through the internet

#

so for those who dont want to have their computers turned on 24/7, they rent a computer for their bots

unreal light
#

Hmm Alright Alright

#

Thanks

wicked sapphire
#

Is it a good idea to switch to Commando for my command framework?

sudden geyser
#

no

quartz kindle
#

commando is not very well regarded

sudden geyser
#

no

#

my god my message won't send

quartz kindle
#

plus i believe its outdated

sudden geyser
#

no

wicked sapphire
#

outdated?

marble juniper
#

if you don't wanna make a command handler urself when making a bot use something like slappey

#

its a package

#

for discord.js

wicked sapphire
#

Yeah I used slappey.

sudden geyser
#

Klasa was an okay choice but that got nuked

quartz kindle
#

command frameworks can be extremely opinionated and personal, so most people just build their own

unreal light
#

Can anyone tell how can we login in to the bot Account?

quartz kindle
#

you login with your bot's token through a program

#

you need to build the program

#

do you have any experience with a programming language?

marble juniper
quartz kindle
#

oh you mean login as the bot using discord's client?

marble juniper
#

I mean he makes it sound like it

#

whatever

quartz kindle
#

yeah thats not allowed and may get your bot banned

fossil canyon
unreal light
#

Like I saw on yt
They guy used botclient.tk named site in that we filled our bot code or something, then we can get the access to the bot Account.

sudden geyser
# fossil canyon Hi, can someone help me?

If you want to check if the bot has permission in the guild to do something, you should get its guild member instance (such as <Guild>.me). Keep in mind, just because you have permission server-wide to do something doesn't mean you have permission to do something channel-wide

earnest phoenix
#

May anyone help me to use mongodb? I use java. My work is much simple or give me a doc so I can read and get all knowledge

regal creek
earnest phoenix
#

@quartz kindle may u help with this?

midnight brook
#
TypeError: Class constructor YouTube cannot be invoked without 'new'
``` what does this mean?
midnight brook
#

in a music bot; searching for tracks using ytsr

regal creek
#

Use const a = new b.Client()

#

Gotta add the new part before you Get the client

midnight brook
#

yea but how do i do that in this?
by the way im tryna convert a spotify playlist to youtube for more context

let s;
for (var i = 0; i < playlist.tracks.items.length; i++) {
            let query = `${playlist.tracks.items[i].track.artists[0].name} - ${playlist.tracks.items[i].track.name}`
            let results = await ytsr(query)
            if (results.items.length < 1) {
               s++
               continue;
            }
            const resultsVideo = results.items.filter((i) => i.type === 'video');
            tracks.push(resultsVideo[0])
        }
regal creek
#

Uh

summer dust
#

if its a music bot i dont think creating a whole yt playlist per spotify playlist scales pretty well

earnest phoenix
#

May anyone help me to use mongodb? I use java. My work is much simple or give me a doc so I can read and get all knowledge

midnight brook
# regal creek Uh

is it possible for me to just invoke outside of the for loop?

i don't know about this because this is the usage in the docs

const ytsr = require('ytsr');

const searchResults = await ytsr('github');
dosth(searchResults);
summer dust
#

this is bot dev, your questions seems more general for java development and im sure there're lots of tutorials on the internet @earnest phoenix

earnest phoenix
#

@summer dust that's the prob lmao there are too less java tutorisls

#

Tutorials*

regal creek
#

The ytsr variable is that just: const ytsr = require('ytsr')?

midnight brook
#

yep

regal creek
#

Nvm

#

Uhh

regal creek
midnight brook
#

aite

regal creek
#

Ping me once done

earnest phoenix
#

May anyone help me to use mongodb? I use java. My work is much simple or give me a doc so I can read and get all knowledge
If anyone relplys me ping me, ty

#

I'mma sleep

gilded olive
boreal pewter
#

Anybody knows how long does a refresh token lasts?

young coral
#

HEllo

halcyon kite
#

ok so

#

you should make a randomizer using Math.random

#

for example

#

let awnser = ["test1", "test2"]

#

then

young coral
#

Ok

halcyon kite
#

let ranswer = Math.floor((Math.random() * awnser.length))

#

then you can see what the awnser is by doing

#

awnser[ranswer]

#

so yeah
and you can add more to it

young coral
#

I'm doing the same

#

Yeah

halcyon kite
#

ok

young coral
#

I need something to get me random words into the array

#

I can't make an array of 50000 words

halcyon kite
#

uh

#

wait

young coral
#

So, is there an api, or random word generator to use

halcyon kite
#

so like a captcha or something?

young coral
#

Ok sure

#

Wait

#
const possible_words = ["abruptly", "affix", "awkward", "bagpipe", "blitz", "absurd" , "abyss", "duplex","dwarves","embezzle", "zombie"]
#

This is an array I made

halcyon kite
#

ok

#

now your rawnser

#

will randomize it

young coral
#

I need possiblewords to not be an array, rather a generator

halcyon kite
#

ok so

young coral
#

which gets value from an api maybe

halcyon kite
#

you can search npm or api for this

young coral
#

Doing so. Was seeing if anyone knows

halcyon kite
#

idk any word generators

#

so yeah

young coral
#

I need them to be uppercase

#

So

halcyon kite
#

ok

young coral
#

Thanks

#

Imma find soemthing I hope

halcyon kite
#

ok

earnest phoenix
#

they can be used until they're revoked

halcyon kite
#

or refreshed

crimson vapor
#

or if you manually refresh it

#

or regen

#

how ever you want to call it

earnest phoenix
#

hey i have a question. Someone made a blackjack bot and made this message purely in Discord markdown.

Does anyone know how to make that red bar on the left?

#

oh thanks!!!

gilded olive
#

RENO i wouldn't recommend you use requests

earnest phoenix
#

didn't realize it was an embed

gilded olive
#

aiohttp

#

I assume thats for your bot

#

Requests would be blocking then

#

aiohttp is async

#

Much better

#

error?

#

can you try debugging?

#

(Printing)

earnest phoenix
#

Authorization should be in header?

boreal pewter
gilded olive
#

Hold up lemme write that in aiohttp for you

earnest phoenix
#

both aiohttp and requests have params kwarg

young coral
halcyon kite
#

noice

young coral
#

i used a 'random-words' api btw

halcyon kite
#

ok

terse finch
#

how do i add the ability to allow either selecting a user via Discord ID or a mention in discord.py? like in my arguments for a command?

young coral
#

If anyone else needs help, I can surely do!

halcyon kite
#

message.mentions.members.first()

young coral
#

isn't that for discord.js?

halcyon kite
#

yeah idk python

young coral
#

Or is it same

halcyon kite
#

i think mabye

#

im not sure

young coral
#

Wait I have a docs bot too

halcyon kite
#

ik somebody who does this in python but he is offline

terse finch
craggy pine
#

Does anyone have experience with puppeteer willing to DM me about an odd issue I'm having. It's pretty specific.

terse finch
#

does the format ping (ctx, *, member: discord.Member, *, message): also work

halcyon kite
#

do you mean custom status or like dnd

earnest phoenix
#

no, you can only have one asterisk

terse finch
#

so if i need member and a message after it what would i want to do

earnest phoenix
#

It can only have 1 keyword argument, so remove the asterisk before the member

terse finch
#

so member without an asterix will only allow one member to be messaged?

halcyon kite
#

hmmmmmmmmm

#

mabye you need to fetch the song

terse finch
halcyon kite
#

then apply it to the setActivity

#

part of it

earnest phoenix
halcyon kite
#

you could make a randomizer but use `` instead of "" then put the code in there

#

it would work

gilded olive
halcyon kite
#

because using `` then puting the line of it fetching inside of ${}

#

it may work

gilded olive
#
from discord.ext.commanads import Greedy

async def foo(ctx, members: Greedy[discord.Member])```
#

import discord as well^

earnest phoenix
gilded olive
#

i need to sleep

#

Eeee

quiet topaz
#

why is com.my.calculator.Main.Window at com.my.calculator.Main.main(Main.java:15) and how to fix this

#

you need to put a token i think

#

btw whats the problem

tame kestrel
#

just reading the docs it looks like the api wants the guild count as the server_count parameter

earnest phoenix
#

hi, this is not discord related but

tame kestrel
#

data = {'server_count': len(client.guilds)}

earnest phoenix
#

it doesnt show end start port

tame kestrel
# earnest phoenix

that's just internal stuff, if you wanted to have the local port be different from the outside facing port, ie the outside facing one can be 80 but internally the program sits on the 2000 port

earnest phoenix
#

but it worked before

#

suddenly it stops

quiet topaz
#

may be rate limit

quiet topaz
young coral
#

Guys, what can you recommend me to integrate chess into a discord.js bot. Any api?

quiet topaz
#

pls why no one helpin me

young coral
#

Btw its not an only chess bot, so nothing too big with extreme computation needs

tame kestrel
umbral zealot
quiet topaz
#

no its not static i think, btw im not so good at java, im still learnin it

quartz kindle
#

did you import window.java somehow?

umbral zealot
#

I mean yes, with message edits, a lot of emojis, and two people that already know how to play to the fullest.

quartz kindle
#

because the error is saying that Main.Window is null

young coral
#

But yeah I might try some other games easier than chess tbh

umbral zealot
#

The problem with discord is that it doesn't have appropriate inputs for a game

young coral
#

Yup

#

Biggest

#

Problem

#

Imo

umbral zealot
#

Well, that means it's not appropriate as a platform to do these games.

quiet topaz
quartz kindle
#

im not a java user, but doesnt the file window.java has to be uppercase to match the class Window?

earnest phoenix
#

it dooesn't

#

and @quiet topaz you never initialize window

#

it never gets a value

#

that's why you're getting a nullptr

quartz kindle
#

did that change or is this stackoverflow answer straight up wrong?

earnest phoenix
#

nothing changed

#

the mistake is an eye sore to me

quartz kindle
#

i mean about file names needing to be uppercase

earnest phoenix
#

oh

#

that's straight up false

quartz kindle
#

What's missing from all the explanations is the fact that Java has a strict rule of class name = file name. Meaning if you have a class "Person", is must be in a file named "Person.java". Therefore, if one class tries to access "Person" the filename is not necessary, because it has got to be "Person.java".

#

thats from an SO answer

earnest phoenix
#

which year is that answer from lol

quartz kindle
#

lmao 11 years ago

earnest phoenix
#

the only place where i'd assume that had to be true was for the main file

quartz kindle
#

so java has no concept of importing files? it automatically looks for a file named whatever class you're calling?

earnest phoenix
#

it doesn't care about your file name

#

it uses namespaces

cinder patio
#

It's the same with Cยฃ isn't it

#

C#*

earnest phoenix
#

lmfao

#

yes

quartz kindle
#

so it always loads all files in the dir?

earnest phoenix
#

i guess so

quartz kindle
#

or you have to explicitly add the files you want to some compiler?

#

like C

earnest phoenix
#

you still have to import them to actually use them

#

but importing works by using namespaces and class names

#

file names and folder hierarchy are irrelevant

quartz kindle
#

so basically doing new ABC() will work if you have a public class ABC in any file somewhere in the directory

earnest phoenix
#

correct

#

and under the condition that you imported it obviously

#

there's also a * wildcard which allows you to import everything from a namespace/package

regal creek
#

is this a good way to check if a server is added in the database?

#

if this would run every time the bot starts up and joins a new server

quartz kindle
#

because in huz17's code, i see no mention of importing window.java in his main code

earnest phoenix
#

you do need to import it but most IDEs are smart enough to do it as you type

#

they exist under the same namespace

cinder patio
earnest phoenix
#

that's what i forgot to mention

#

or, package

quartz kindle
#

so package com.my.calculator

regal creek
quartz kindle
#

all files with that line will get compiled together?

earnest phoenix
#

yes

#

well

#

everything gets compiled together

#

importing is just syntax sugar to prevent pollution

cinder patio
#

yeah I don't think there's a better way of checking if a guild is in the database