#development

1 messages · Page 1228 of 1

earnest phoenix
#

not gonna waste my lunch break on dev again
@thick gull you're in skool what

digital ibex
#

sometimes u talk nonsense

earnest phoenix
#

nah maybe he is in work

fervent goblet
#

its not centering....

earnest phoenix
#

@fervent goblet try posotion: fixed

digital ibex
#

i was talking about code913, ace

earnest phoenix
#

left: 50%;

#

sometimes u talk nonsense
@digital ibex i also sometimes code at skool

digital ibex
#

ok?

#

i dont care

earnest phoenix
#

my school doesn't allow phones smh

#

or pc

#

or lap

drifting wedge
#

can anypne help me with pollow?

#

pillow

#

im doing a progress bar

#

but i can get it to go into the correct spot

cinder patio
#

Ok, show your code

earnest phoenix
#

yeah

torn ravine
#

my school allows everything except your phone

#

which I found dumb af

wooden ember
#

how would I make a json file on a bot joining a new server

misty sigil
#

don’t

wooden ember
#

why

misty sigil
#

use a database

wooden ember
#

eh

misty sigil
#

put wrong link lmao

wooden ember
#

lol

#

i know that json databases are bad

misty sigil
#

why use them then

wooden ember
#

i just thant a json for each server that just has the prefix in it

#

and that isnt enough reason for me to use a db

digital ibex
#

what language are you using?

wooden ember
#

js

misty sigil
#

and that isnt enough reason for me to use a db
@wooden ember yes it is

wooden ember
#

sry forgot to mention that

misty sigil
#

I use a db for that

wooden ember
#

why thojust for one reason

misty sigil
#

just use quick.db

#

json db’s are shit, and unscalable

#

so please I beg use quick.db

wooden ember
#

tell that to some guy I met that has an entire economy system that uses json

misty sigil
#

quick.db is easier than json db too

#

lmao

wooden ember
#

he has a json for each user in each server

#

over 5k files

eternal merlin
#

Hello

misty sigil
#

db.set("guildID_prefix", prefix)

#

it’s that simple

wooden ember
#

mmm

digital ibex
#

lemme check rq

#

quick db is shit

misty sigil
#

over 5k files
@wooden ember wearybread

digital ibex
#

suck a horses dick

misty sigil
#

not as shit as json db

wooden ember
#

qdb is a rapper for my sql isnt it

misty sigil
#

sqlite3 iirc

wooden ember
#

ah yeah

digital ibex
#

use fs, @wooden ember

misty sigil
#

mongodb’s cool too if u’re into that

digital ibex
#

wrong mention

#

mb

#

fs.writeFile

misty sigil
#

bruh just use quick.db or something

wooden ember
#

yeah but can that make a file tho

digital ibex
#

that saves data in a json

final stone
#

oh no

digital ibex
#

my mind is retard 101 today

tight plinth
#

who said json db

final stone
drifting wedge
#

u want to see the code?

restive furnace
#

use real db (or if you have enough knowledge, go make ur own database (real database, runs with binary for example))

digital ibex
#

u guys need to chill, like fr. if he wants fo use it, let him use it

misty sigil
#

how would I make a json file on a bot joining a new server
i just thant a json for each server that just has the prefix in it

drifting wedge
#

this is what i use to make the rank card

digital ibex
#

ok

drifting wedge
#

i want to have a progress bar

misty sigil
#

use hastebin

drifting wedge
#

this is the card

earnest phoenix
#

Im trying to make an app that when someone is buying something trough paypal, it will auto pay to two people using paypal api, for example someone paid 3$, it will be paid to
general-mail@gmail.com, so with paypal api it will pay 1$ to submail1@gmail.com and another dollar to submail2@gmail.com, how to do it ?

drifting wedge
#

so can anyone help?

#

i want to make the progress bar work

digital ibex
#

stripe might be able to do that

earnest phoenix
#

you are talking to me ?

digital ibex
#

sigron ^

#

yeah

earnest phoenix
#

oh

#

Ok, i will google it

drifting wedge
#

can anyone help?
make a progress bar?

opal plank
#

huh?

#

postgres doesnt have bars

#

@drifting wedge

drifting wedge
#

@opal plank im using pillow

#

postgres?

opal plank
#

ooooh

#

my bad, i read postgres not progress

drifting wedge
#

ahh lol

#

im trying something

#

ill check in about in soon

prisma wraith
#

Question. So, if I make a bot, and publish it to top.gg and it gets accepted, am I allowed to create 'devchannel' command that shows my channel

opal plank
#

you dont have permissions here to do so @prisma wraith

prisma wraith
#

I mean, on my bot

opal plank
#

bots added here only have 2 or 3 perms iirc, send messages, read history and embeds

prisma wraith
#

e

#

ok

#

So no credits thing

opal plank
#

i mean, its ads but i guess you can if the user requests it

#

not something automatic

#

like !mychannel

#

then it displays it

prisma wraith
#

Not automatic, they say t$devchannel and it shows my channel (I created bot)

opal plank
#

should be fine

prisma wraith
#

aight

#

thanks

#

:>

opal plank
prisma wraith
#

👍

severe socket
#

have any of you registered a .bot domain with a discord bot?

pure lion
#

no but do you need help

severe socket
#

yes, if you have a .bot domain lol

pure lion
#

I believe you need ssl for a .bot domain, so you'll have to set up something like nginx

forest epoch
#

Has someone experience with pm2?

pure lion
#

Me

misty sigil
#

Me

severe socket
#

it's behind verification, hence why I need someone that already has it

pure lion
#

cd into the folder => pm2 start <main bot file>

#

Khaaz, I'm confused what do you want to do

forest epoch
#

@pure lion perfect I have a question
I am starting my bot

but for a reason the pm2 always creates 2 processes

severe socket
#

if you don't own a .bot domain, it's normal for you to be confused.

drifting wedge
#

wuts floodfill?

pure lion
#

Oh that's sick

#

@forest epoch you need to end all instances of your bot and then run it

#

Are you hosting on a vps?

granite echo
#

@earnest phoenix 👀

#

btw dk if isaid but my issue fixed itself @thick gull

thick gull
#

yes you told me

pure lion
#

Imagine pinging two people for absolutely no reason

forest epoch
#

yep
ok I try that. I have a Idea where it comes from now
I always use pm2 start node index.js
but I do not need to write the word "node" right?

misty sigil
#

No

sonic lodge
#

no

forest epoch
#

Yehaw that was the error I made

#

now its working Partyblob

sharp thicket
#

Hey,anyone know how to get the total users of my bot not just the online ones?

obtuse saffron
#

for changing custom statuses of a bot what is the discord api rate limit

thick gull
#

"The maximum frequency you can change your status is 5 times per 20 seconds (approx. every 4 seconds); any faster than that is considered as Discord API Abuse. We suggest you change it to something more reasonable, such as every 120 seconds."

#

but personally i wouldn't change it anywhere near that

pure lion
#

@sharp thicket what library?

thick gull
#

i change mine every 24 hrs:)

drifting wedge
#

plez lol

sharp thicket
#

discord.js

drifting wedge
#

can anyone help me do a rank card?

#

its python

#

and im using pillow

sudden geyser
#

Bots can't have custom statuses.

sharp thicket
#

they can

misty sigil
#

No.

drifting wedge
#

i only need the progress bar

sharp thicket
#

why is it a value then?

sudden geyser
#

Kora wdym

misty sigil
#

they can’t set custom statuses

forest epoch
#

its a game that you can set

pure lion
#

@sharp thicket they can be "playing" or "watching" or "streaming" and shit but not have a custom boye

sharp thicket
#

bot.user.setPresence({ activity: { name: With Avio Developers | ${config.prefix}help | Avio Help, type: "CUSTOM_STATUS" }, status: 'dnd' })

forest epoch
#

the custom status is that what we have

sharp thicket
#

i never tried it

sudden geyser
#

They say you can only read it

#

you can't set it

sharp thicket
#

it shows up when i typ it is vcs

#

vsc*

obtuse saffron
#

"The maximum frequency you can change your status is 5 times per 20 seconds (approx. every 4 seconds); any faster than that is considered as Discord API Abuse. We suggest you change it to something more reasonable, such as every 120 seconds."

  • #mod-logs
    @thick gull thanks I am changing the time it was 5sec now btw
sudden geyser
#

Yeah, because it's in the enum/types. You can't actually set it as your presence.

sharp thicket
#

Hey,anyone know how to get the total users of my bot not just the online ones?
@sharp thicket anyone though

sudden geyser
#

You could try it and see it fail.

sharp thicket
#

oof everyone went away

pure lion
#

Listen mate

#

Sometimes you just can't do stuff

thick gull
#

i dont think it lets you cause ram

#

imagine caching 130K users

crystal mountain
#

    const browser = await puppeteer.launch({
        defaultViewport: {width: 1920, height: 1080}});
    const page = await browser.newPage()
    await page.goto('https://sa-mp.im/server/war-stats/22/cuneo-vs-triads')

    const element1 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(1) > h3', el => el.textContent);
    const element2 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
    var amountString = element1;
    var amount = amountString.replace(/\./g, '').match(/^.*([0-9]{10})/)[1]
    var amountString2 = element2;
    var amount2 = amountString2.replace(/\./g, '').match(/^.*([0-9]{9})/)[1]
    var x = amount - amount2;

    const element3 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
    var amountString = element3;
    var z = amountString.match(/^.*([0-9\.]{10})/)[1]



    await browser.close()
    return {diff: x, triadlost: z};
};```

```      let {diff, triadlost} = wardiff(x, z);```
#

(node:1092) UnhandledPromiseRejectionWarning: ReferenceError: x is not defined

#

what's incorrect here

pure lion
#

You haven't defined x

crystal mountain
#

diff : x

#

?

pure lion
#

so console.log(x)

crystal mountain
#

wait sec

#

i think i fucked up something ye

#

so console.log(x)
@pure lion undefined

#

btw i changed let {diff, triadlost} = wardiff(x,z); to let {diff, triadlost} = wardiff(); it was dummy mistake i had those x,z but im not using them

earnest phoenix
#

@earnest phoenix 👀
@granite echo lmao

granite echo
#

👀 stop following me god damn

dire obsidian
#

like the white name that I am

#

How get the number of the servers my bot is

#

bot.guild.size?

granite echo
#

@dire obsidian what language

#

js py?

dire obsidian
#

Js

granite echo
#

also i need a massive favor from somone

#

<client>.guilds.cache.size

dire obsidian
#

I forget simple lines of code im stupid

granite echo
#

then re learn it

dire obsidian
#

Cannot read property 'size' of undefined

granite echo
#

what version?

#

v11 or 12

dire obsidian
#

Let me

#

11

granite echo
#

anyway if ur v11 whats before size is undefined im p sure u can work that out

dire obsidian
#

OwO ok

restive furnace
#

use v12

#

thanks

#

v11 is deprecated

misty sigil
#

use v12

granite echo
#

and that

thick gull
#

do the topgg webhooks send json

sorry im an idiot ;tm;

misty sigil
#

ok sure I’ll try it

thick gull
#

11
@dire obsidian please asterki ;weary;

#

v11 will just not work

misty sigil
thick gull
#

in a month

#

;weary;

sinful belfry
#

do the topgg webhooks send json
@thick gull
yep

thick gull
#

okay

#

do you have an example i can see so i can see if its even possible to use ifttt with it

sinful belfry
#

for what? server votes?

thick gull
#

yea

sinful belfry
#

no, but i can get it rq

#

gimme a moment

thick gull
#

ty

earnest phoenix
#
//value = @pliant gorge;
return value.split("<").split(">").split("@").split("!");
TypeError: value.split(...).split is not a function
    at module.exports (/home/thinh/Programming/judger-djs/tools/mentions.js:6:41)

Help me

sinful belfry
#
{ 
  "webhook": "http://the.webhook/url", 
  "webhookAuth": "your secret authorisation",  
  "guild": "264445053596991498", 
  "type": "test", 
  "query": "?test=data&notRandomNumber=8" 
}

@thick gull

thick gull
#

thanketh thee

earnest phoenix
#

help me

#

:((

cinder patio
#

ACE, split returns an array

#

arrays don't have a split method

earnest phoenix
#

oh

cinder patio
#

What are you trying to do?

#

Get an ID from a mention?

earnest phoenix
#

yes

cinder patio
#

You can use regex for that

earnest phoenix
#

regex ?

pure lion
#

Regular expression

cinder patio
#

Yeah, discord.js even provides you with a regex to use

earnest phoenix
#

and what is that

pure lion
#

It does?

cinder patio
#

yup

pure lion
#

:o?

earnest phoenix
#

Is this a bot coding support channel

#

can u send me docs about that

pure lion
#

Yup (@earnest phoenix)

earnest phoenix
#

Idk what's the problem apparently it cant read the length of the aliases

granite echo
#
let fetch = require("node-fetch");

fetch(`https://space-bot-list.xyz/api/bots/${client.user.id}`, {
    method: "POST",
    headers: {
    Authorization: "your sbl api key",
    "Content-Type": "application/json"
    },
    body: JSON.stringify({ guilds: client.guilds.size, users: client.users.size })
  }).then(req => req.body);

can someone convert this to py?, idk py but its for another bot list, and im not learning py just for this if i aint gonna use it again

earnest phoenix
#

But there is no alia

#

Aliases*

pure lion
#

Send code

sand condor
#

yea just pay me and ill convert laughlol

earnest phoenix
#

The command code or index.js

#

Or both

pure lion
#

Both

earnest phoenix
#
/<(?:[^\d>]+|:[A-Za-z0-9]+:)\w+>/g
```
This ?
#

one

cinder patio
#
const {MessageMentions} = require("discord.js");

MessageMentions.USERS_PATTERN // Regex for matching user IDs
earnest phoenix
#

USERS_PATTERNS ?

#

what is that

granite echo
#

google is ur friend

cinder patio
#

A static property of the MessageMentions class

granite echo
#
#

u can find docs of regexes on there

earnest phoenix
drifting wedge
#

using PILLOW, can i replace a color?

#

escrever.rectangle((311, 250, 122+(int(cur_xp/xpneed*100)) * 2, 25), fill=(255, 255, 255, 255))

#

i want to replace a color and put the bar

earnest phoenix
#

@pure lion

granite echo
#

know whats annoying?, people pinging for support, just saying

earnest phoenix
#

I was waiting before I pinged

granite echo
#

¯_(ツ)_/¯

earnest phoenix
#

And this error is getting annoying

granite echo
#

how much of js do you know?

sinful belfry
granite echo
#

lol

hasty mulch
#

How do I get a response of “Command not found” for commands I don’t have? Using Python

fervent goblet
#

any way to reduce cpu usage on my Discord bot?

#

I am using Discord.js

faint prism
#

Is this a bot farm?

** BOT-TO-USER IMBALANCE **
    Admins (74)
    Total Users: 99
    Bots to Users ratio: 89.90 %
    Real Users: 10
    Bots: 89```
sudden geyser
#

Probably

faint prism
#

I see others too, but it's hard to tell

    Admins (28)
    Total Users: 80
    Bots to Users ratio: 71.25 %
    Real Users: 23
    Bots: 57```
sudden geyser
#

I mean think about it: does a user really need 89 bots in their server

#

when only 10 people are there

sharp thicket
#

Hi,so im using the "guildCreate" event but how do i define the guild that the bo was added to? (discord.js)

faint prism
#

I see some that are 50/50 up to 40 users

sudden geyser
#

It's the first parameter Kora

sharp thicket
#

what do you mean?

sudden geyser
#

Like js bot.on("guildCreate", (guild) => {...})

sharp thicket
#

oh

#

i tried defining it as the 3rd

#

im stoopid

final summit
#

Anyone wanna code a Discord Bot and its own Dashboard( TypeScript, MongoDB ) IM SO BORED

faint prism
#

what would "a Discord Bot" do?

granite echo
#

if it was in js maybe

faint prism
#

lol

granite echo
#

?

faint prism
#

Typescript is a JS superset

#

You can do native JS if you want

granite echo
#

different tho it uses import which i aint use to

leaden shoal
#

can someone help me or suggest somewhere to learn how to put like server names and stuff into embeded welcome messages please

earnest phoenix
#

Do I need to use forEach for user.presence.activities.type === 'LISTENING'

acoustic bridge
#
@client.event
async def on_member_join(member):
    channel = client.get_channel(channel id)

    await channel.send('A new member arrived! Let us welcome {member} to {guild.name}!')
   
    role = discord.utils.get(ctx.guild.roles, id = (role id) 
    await ctx.add_roles(role)

Want to make a welcome message and auto role function in one, what do i need to edit for the ctx in the role function?

earnest phoenix
#

Py?

acoustic bridge
#

yeah

earnest phoenix
#

I cant help u sorry

#

😔

placid iron
acoustic bridge
#

I see, so it would've work with member.

placid iron
#

yeah you cant add roles to a context object

#

not that you can get a context object in that case anyway

#

also you forgot the f in front of the string

acoustic bridge
#

ahh that was intentional

placid iron
#

oh

acoustic bridge
#

i wanted to make an embed welcome message

#

and had to edit so the embed stuff wouldnt flood the chat

placid iron
#

ah ok i see now

eternal osprey
#

hey guys

#
(node:11812) UnhandledPromiseRejectionWarning: ReferenceError: location is not defined
#

i don't know why this happens

#
let [skytext] = msg.slice(prefix.length).split(" ");
      console.log('Searching locations with:', skytext);
      let locations_found =  await get_location_by_skytext(skytext);
      console.log({locations_found});
      if (locations_found.length === 0)
      
        
      
      {
        return message.author.send("<@" + message.author.id + ">" + ' ```No locations have been found!```');
      }
      
      let embed = new Discord.MessageEmbed()
                              .setDescription("**Weather type:**" `*${location.current.skytext}*`)
                              .setTitle(title);
        locations_found.slice(0, 10).forEach(location =>
        {
        embed.addField(
          `${location.current.observationpoint}, ${location.location.lat}, ${location.location.long}:`
          );
      });
      embed.setThumbnail('https://media.giphy.com/media/CKsIi206Ntz4k/giphy.gif')
            .setColor('#FF0000')
            .setFooter("Command hosted for Pokehub`s community!");
            message.author.send("<@" + message.author.id + ">")
      message.author.send({embed});
    }
  }
});

bot.on('ready', () => {
    console.log('Bot started.');
});
earnest phoenix
#

How can I add spotify uri as .setImage

cinder patio
#

It's kinda obvious

#

location is not defined

eternal osprey
#

it happend after i set tghe location current skytext as description

cinder patio
#

You never define location, but use it in multiple places

eternal osprey
#

i did

#

this is not my whole code

cinder patio
#

Where did you define it? Maybe it's out of scope

eternal osprey
#

it's just a snippet of the embed

#

should i pastebin it?

cinder patio
#

yes

eternal osprey
#

at Client.<anonymous> (c:\Users\bilal\Desktop\fitlering\osom_bot (1).js:185:71)

#

line 185

#

.setDescription("Weather type:" *${location.current.skytext}*)

#

i was right

cinder patio
#

The only place "location" is defined locations.map(location => get_weather({search: location, degreeType: 'C'}))

#

That's the only place you define location, and it's a function parameter

eternal osprey
#

i am using weather-js package

#

should have said that

cinder patio
#

that doesn't change anything

eternal osprey
#

but it worked

#

this

#

fucked it up ${location.current.skytext}

#

i've put this into the description

#

instead of the addfields

#

that's when it stopped working.

thick gull
#

Is this a bot farm?

** BOT-TO-USER IMBALANCE **
    Admins (74)
    Total Users: 99
    Bots to Users ratio: 89.90 %
    Real Users: 10
    Bots: 89```

@faint prism did you loop through the member count? I'm sus of a server that i think is a bot farm and I wanna leave it kekw

drifting wedge
#

instead of putting it somehwere, with PILLOW can i instead replace a color with a bar?

#

like with a progress bar

#

can i replace a color with it?

midnight blaze
#

@drifting wedge what

drifting wedge
#

like i have a rectangle

#

that is basicly a progress bar with xp

#

and i have a background

#

can i put it there like replacing the color?

faint prism
#

@faint prism did you loop through the member count? I'm sus of a server that i think is a bot farm and I wanna leave it kekw
@thick gull Yeah I did

thick gull
#

is it .forEach() i cannot remember and im too lazy to tryitandsee

faint prism
#

for JS

thick gull
#

yes

faint prism
#

yes

thick gull
#

ok

midnight blaze
#

@drifting wedge ok, I dont know what you are talking about. What do you want to replace? YOur color with what?

drifting wedge
#

so i have a card

#

right

#

and im writing on top of the card

#

and i have a rectangle

thick gull
#

TypeError: client.guilds.cache.get(...).members.forEach is not a function

midnight blaze
#

where is your rectangle

thick gull
drifting wedge
#

1 sec

#

escrever.rectangle((0, 257, (int(cur_xp/xpneed*100)) * 2, 282), fill=(255, 255, 255, 255))

#

it works

#

but i want it to write a specific place

#

like ik i can edit the pixels

midnight blaze
#

but?

#

you dont want to edit the pixels

drifting wedge
#

well i could its jsut that i want to figure out a way to put it on top of a specific color

midnight blaze
#

I guess you have two bars and one has a color and you want to put it where the color is? Is that what you try to do?

drifting wedge
#

1 sec

#

so this is my rank card

#

u see the bar?

midnight blaze
#

yes

drifting wedge
#

so i want to put my bar over it

midnight blaze
#

ok, but you just edit the pixels

drifting wedge
#

no memes

midnight blaze
#

that is how you are doing that

drifting wedge
#

i can

midnight blaze
#

I dont know why you would make it differently

drifting wedge
#

but the thing is i want to round it out

#

like the sides

midnight blaze
#

ah

#

now I understand

#

how about you make a second background

#

that cuts the gray xp bar

#

and then you put the redbar behind the second background

drifting wedge
#

like the progress bar

midnight blaze
#

that is how people do it usually

drifting wedge
#

can u explain it again?

thick gull
#

@mint thicket ^^ meeems

midnight blaze
#

make a background that is transparent at the xp bar

#

this is your top layer

#

under it

#

make a red bar

#

under the red bar

#

the grey bar

drifting wedge
#

ok

#

i mean i can put this stuff before it then

#

before i open the background

midnight blaze
#

yes, you can do it how you want to, but I think you get my solution

#

it is the most simple one

drifting wedge
#

imma try

#

thanks

thick gull
#

why isnt guild.members.forEach() working for me, it says it's not a function. i've looked it up and asked @faint prism it should work ;tm;

midnight blaze
#

try map()

faint prism
#

Not a JS dev, sorry

thick gull
#

i have

#

same exact thing

midnight blaze
#

what kind of data is guild.members

#

and turn it into an array

thick gull
#

mk, i got it

sudden geyser
#

What library and what version of it are you using

midnight blaze
#

Array.from()

#

try this

#

or let array = [...coll];

earnest phoenix
midnight blaze
#

with canvas and api? You need an api to get the information and the canvas to display it

placid iron
#

that is just the spotify info in the member activity though

pure lion
#

Ping

earnest phoenix
#

How can I paint the canvas background according to the song background?

placid iron
#

colour theif gives you palettes of images and also the dominant colour

midnight blaze
#

I guess the api gives you the color information

#

I have never worked with it tho

earnest phoenix
half shell
#

Is botghost a safe website to make bot commands on?

misty sigil
#

no

midnight blaze
#

@half shell pls

half shell
#

?

misty sigil
#

it may be safe

#

but NO

midnight blaze
#

@half shell make your own bot

#

😛

misty sigil
#

please dont

slender thistle
#

BotGhost is a third-party hosting service

half shell
#

Oki, I can’t figure out how to add commands on the discord website though-

slender thistle
#

You don't get access to the backend whatsoever so you can only assume it's (un)safe

misty sigil
#

@half shell you need to code the bot

#

botghost is going to leak your token everywhere at some point

#

and your bot will be hacked and you will probably be hit hard by it

#

so Shrug

#

your choice

half shell
#

Ight

midnight blaze
#

look up discord js guide

#

the most simple guide to build a bot

#

I think it is more simple than botghost

opal plank
#

@earnest phoenix can u go shitpost elsewhere?

misty sigil
#

@earnest phoenix its this dude again

opal plank
#

bye bye

midnight blaze
#

@gleaming glen

misty sigil
#

ugh just ban this idiot please

earnest phoenix
#

STOTP!

slender thistle
#

@earnest phoenix First and last warning, move to #memes-and-media with the out of context pictures

earnest phoenix
#

STOP!!

#

SROP!!!111

misty sigil
#

get out please

sonic lodge
#

that's not how you spell "ban me"

lyric mountain
#

i vote ban

#

1/1

earnest phoenix
#

no

#

I ban u

misty sigil
#

no

slender thistle
#

Leave it y'all

earnest phoenix
#

e7s

#

yes

opal plank
#

dont feed the troll

misty sigil
#

anyways, what were we discussing

earnest phoenix
#

im not troll

#

yui are troll1!

#

you

lyric mountain
#

anyways, what were we discussing
@misty sigil botghost is like a siren: it lets you taste the sweetness of bot development before wrecking everything you've made

earnest phoenix
#

you are trolling

#

not me

misty sigil
#

Ah, so just like some bad cake

midnight blaze
#

Honestly, js guide is so imple. Everyone could do a bot with it

misty sigil
#

tastes good at first

lyric mountain
#

the cake is a lie

midnight blaze
#

Just do it with that xd

misty sigil
#

makes you die next

#

because it was heavily out of date

drifting wedge
#

@midnight blaze

#

how can i save both of them as one?

midnight blaze
#

pls, more context xD

#

what do you mean?

drifting wedge
#

1 sec

#

like i have 2 backhrounds

#

but i need to save it

#

how can i save both backgrounds as one

midnight blaze
#

you layer them and at the end, you save it only once, so you create the attachment

drifting wedge
#

yea

#

i added both of them

#

but how can i save them both?

midnight blaze
#

You dont save them both. you only create one attachment

drifting wedge
#

yea

midnight blaze
#

can you show the code?

drifting wedge
#

i have save them both as one

#

1 sec

#
            fundo = Image.open('rankcard12.png')
            fonte = ImageFont.truetype('PTSans-Regular.ttf', 37)
            font = ImageFont.truetype('PTSansCaption-Bold.ttf', 37)
            fontee = ImageFont.truetype('PTSansCaption-Bold.ttf', 45)
            xpdiv = (int(cur_xp/xpneed))
            pbarwidth = xpdiv * 624
            #fonte = ImageFont.truetype('Roboto-Regular.ttf', 150)
            #levelfont = ImageFont.truetype('KumbhSans-Regular.ttf', 150)
            draw = ImageDraw.Draw(fundob4)
            escrever = ImageDraw.Draw(fundo)
            #draw.rectangle((1, 1, 1, 1), fill=(64, 64, 255,255))
            draw.rectangle((311, 200, (int(cur_xp/xpneed*100)) * 2, 200), fill=(255, 255, 255, 255))
            
            escrever.text(xy=((855, 45)), text=f"{lvl_start}", fill=(154, 156, 159), font=font)
            escrever.text(xy=((571, 125)), text=f"{cur_xp}", fill=(154, 156, 159), font=font)
            escrever.text(xy=((280, 115)), text=f"{ctx.author.name}", fill=(154, 156, 159), font=fontee)
            escrever.text(xy=((700, 125)), text=f"{int((5 * (lvl_start ** 4 / 5)))}", fill=(154, 156, 159), font=font)

            fundo.paste(avatar, (86, 66), avatar)
            fundo.save('rank1.png')
            #fundo.show('levelup1.png')

            await ctx.channel.send(file=discord.File('rank1.png'))```
#

i need to save both "fundo" and "fundob4"

#

as one

#

and then send it

midnight blaze
#

this is how I draw avatar, I dont know what .paste and stuff like that mean.

    const avatar = await Canvas.loadImage(userz.displayAvatarURL({ format: 'jpg' }));

    ctx.drawImage(avatar, 10, 10, 150, 150);
drifting wedge
#

well its python

midnight blaze
#

yes

drifting wedge
#

and i opened 2 files

#

progress, and rankcard

#

i need to open them both

midnight blaze
#

it seems like they use a different system. Js is a lot easier

drifting wedge
#

and then save them both as one

midnight blaze
#

you need somone who is experienced with python. I am only doing js

drifting wedge
#

x.save('rank1.png') and then do x = fundo,fundob4

half shell
#

Do I download Node.js? That’s what the guide says to do

midnight blaze
#

Yes

half shell
#

Ight

placid iron
#

@drifting wedge you need to convert the iamge thing to a bytes object to send it to discord

drifting wedge
#

@drifting wedge you need to convert the iamge thing to a bytes object to send it to discord
@placid iron how?

placid iron
#

discord doesnt know about PILLOW images. let me show you how

drifting wedge
#

ok

half shell
#

Which one do I download

#

Can I send a picture of the options it shows?

placid iron
#

base is the name of my rank card

midnight blaze
#

@half shell yes

drifting wedge
#

ok

half shell
placid iron
#

so you save it to an ioBytes variable thing

midnight blaze
#

14.10.0

placid iron
#

and then you can use that as the image in your attachment

half shell
#

Oki

drifting wedge
#

im confused

#

i get that

#

but where woould i put the with bytes io thing?

half shell
#

It took me into ibispaint when I tried to open it

placid iron
#

replace the save and send lines with what i sent

drifting wedge
#

ok 1 sec

#

i have 2

#

fundo and fundob4

#

so i do save both of them?

lyric mountain
#

ah, BR

placid iron
#

you want to send fundob4 as well as fundo?

drifting wedge
#

i want to send them both as one

placid iron
#

as one message?

drifting wedge
#

fundo b4 as background

#

yes

#

and fundo as the overlay

placid iron
#

oh so you want to combine the images then send the new image

drifting wedge
#

yea

placid iron
#

ok

#

so yes pasting fundo onto fundob4 would work

drifting wedge
#

ooo 1 sec lmao

placid iron
#

then you use the ioBytes to send the resulting image

drifting wedge
#

ok 1 sec

#

ok so how would i do that

#

and how can i paste them?

placid iron
#

do what you did here

drifting wedge
#

yea

placid iron
#

without the save

#

but with fundo and fundod4

drifting wedge
#

but the avatar in the end

#

wut do i do w dat

placid iron
#

the one at the end is the "mask", just change that to what you want to paste too

#

so i think

drifting wedge
#

can i just ignore it?

#

and remove it?

placid iron
#

fundob4.paste(fundo, (posx, posy), fundo) no you cant remove it i think

drifting wedge
#

fundo.paste(fundob4, (311, 200), fundo)

#

?

#

ooo 1 sec

placid iron
#

no

drifting wedge
#

got it

#

fundob4.paste(fundo, (311, 200), fundo)

placid iron
#

yes

drifting wedge
#

and now i gotta byte save?

placid iron
#

yep

#

save fundob4 to bytes and send the bytes

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: bytearray index out of range

#

i got this

placid iron
#

what is the code you wrote

drifting wedge
#

1 sec

#
            fundob4 = Image.open('progress.png')
            fundo = Image.open('rankcard12.png')
            fonte = ImageFont.truetype('PTSans-Regular.ttf', 37)
            font = ImageFont.truetype('PTSansCaption-Bold.ttf', 37)
            fontee = ImageFont.truetype('PTSansCaption-Bold.ttf', 45)
            xpdiv = (int(cur_xp/xpneed))
            pbarwidth = xpdiv * 624
            #fonte = ImageFont.truetype('Roboto-Regular.ttf', 150)
            #levelfont = ImageFont.truetype('KumbhSans-Regular.ttf', 150)
            draw = ImageDraw.Draw(fundob4)
            escrever = ImageDraw.Draw(fundo)
            #draw.rectangle((1, 1, 1, 1), fill=(64, 64, 255,255))
            draw.rectangle((311, 200, (int(cur_xp/xpneed*100)) * 2, 200), fill=(255, 255, 255, 255))

            escrever.text(xy=((855, 45)), text=f"{lvl_start}", fill=(154, 156, 159), font=font)
            escrever.text(xy=((571, 125)), text=f"{cur_xp}", fill=(154, 156, 159), font=font)
            escrever.text(xy=((280, 115)), text=f"{ctx.author.name}", fill=(154, 156, 159), font=fontee)
            escrever.text(xy=((700, 125)), text=f"{int((5 * (lvl_start ** 4 / 5)))}", fill=(154, 156, 159), font=font)

            fundo.paste(avatar, (86, 66), avatar)
            fundob4.paste(fundo, (311, 200), fundo)

            with io.BytesIO() as output:
                fundob4.save(output, format="PNG")
                output.seek(0)
                await ctx.send(file=discord.File(fp = output, filename = "rank1.png"))```
#

draw.rectangle((311, 200, (int(cur_xp/xpneed*100)) * 2, 200), fill=(255, 255, 255, 255))

#

this is the line with the erorr

placid iron
#

uhhhhh

#

i have no idea why that is happening

drifting wedge
#
import datetime
import random
#import aiohttp
#import requests
import pymongo
from io import BytesIO
from pymongo import MongoClient
from PIL import Image, ImageDraw, ImageFont, ImageOps
from discord.ext import commands
from discord.ext.commands import command, cooldown, BucketType, Cog```
#

these are my imports

placid iron
#

from io import BytesIO
with io.BytesIO .....

do you see a problem?

earnest phoenix
#
const arkaplan = await Canvas.loadImage('https://media.discordapp.net/attachments/699267550223138816/745787010073231390/arkaplan.png');
                             ^^^^^

SyntaxError: await is only valid in async function

midnight blaze
#

make your function async

misty sigil
#

you have to iirc

spare lintel
#

-p music

crystal mountain
#

    const browser = await puppeteer.launch({
        defaultViewport: {width: 1920, height: 1080}});
    const page = await browser.newPage()
    await page.goto('https://sa-mp.im/server/war-stats/22/cuneo-vs-triads')

    const element1 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(1) > h3', el => el.textContent);
    const element2 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
    var amountString = element1;
    var amount = amountString.replace(/\./g, '').match(/^.*([0-9]{10})/)[1]
    var amountString2 = element2;
    var amount2 = amountString2.replace(/\./g, '').match(/^.*([0-9]{9})/)[1]
    var x = amount - amount2;

    const element3 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
    var amountString = element3;
    var z = amountString.match(/^.*([0-9\.]{10})/)[1]



    await browser.close()
    return {diff: x, triadlost: z};
};```
why isnt it returning diff , triadlost
faint prism
arctic igloo
#

i

#

also how do I view all total users of my bots?

sweet ruin
#

Hello. I am trying to fetch invites and cache them for all my servers. and everything works. but I get errors for the guilds that do not allow my bot to fetch invites. I need to figure out how to fetch invites ONLY for guilds that allow him those permissions or atleast hide the errors. can anyone help me?

arctic igloo
#

How do I get the total amount of users in all the servers my bot is invited to?

hexed vortex
#

Hello. I am trying to fetch invites and cache them for all my servers. and everything works. but I get errors for the guilds that do not allow my bot to fetch invites. I need to figure out how to fetch invites ONLY for guilds that allow him those permissions or atleast hide the errors. can anyone help me?
@sweet ruin try catch

#

and catch permission error

#

create a custom error event handler

sweet ruin
#

I tried the first one

#

didnt work

#

and im not making that kind of handler yet

hexed vortex
#

what's the fired error ?

sweet ruin
#

it sends about 20 of these

#

making it seem like 20 servers dont allow him perms to do that

hexed vortex
#

hum

#

in fact the code don't crash xD

sweet ruin
#

no

#

like i said

#

all of it works

#

i just doing it for myself

#

so that I dont see errors

#

haha

earnest phoenix
#

why dont u just check if the bot has permissions for that guild

hexed vortex
#

just verify the permission before doing it

#

@earnest phoenix is more faster than me

sweet ruin
#

yes but i am unsure of where to put that

earnest phoenix
#

and errors arent just wanted to be removed for visual ur sending discord rest errors to the http api of discord

sweet ruin
#

i know the code is like guild.me.hasPermission("AUDIT_LOGS")

hexed vortex
#

yes

earnest phoenix
#

well just put it before the guild invites thing

hexed vortex
#

it return booleam

#
 if(!guild.me.hasPermission("AUDIT_LOGS")) return ;```
#

something like it

earnest phoenix
#
g.me.hasPermissions("AUDIT_LOGS") ? return: continue```
sweet ruin
#

return: continue?

#

that gives an error

earnest phoenix
#

what error?

hexed vortex
#

try my condition

#

it will work

sweet ruin
earnest phoenix
#

thats the ternary operator built in

#

u forgot the ?

hexed vortex
#

?

earnest phoenix
#

before return

sweet ruin
earnest phoenix
#

return null then

ancient nova
#

is it possible to make bot message the top avaiable channel without having an ID of it?

hexed vortex
#

is it possible to make bot message the top avaiable channel without having an ID of it?
@ancient nova what ?

earnest phoenix
#

@ancient nova no

#

basically noi

ancient nova
#

make the bot message top channel of a server

#

without an ID

hexed vortex
#

yes you can

#

wait a minute

ancient nova
#

how?

hexed vortex
#

i've it

earnest phoenix
#

the id is always needed because of the http requests u have to make

ancient nova
#

alright

hexed vortex
#

var chx = guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0);

earnest phoenix
#

that returns the objects of the channels so that will work

hexed vortex
#

it will get the first text channel

ancient nova
#

chx.message.send('your message') am I right?

sweet ruin
earnest phoenix
hexed vortex
#

chx.message.send('your message') am I right?
@ancient nova yes

earnest phoenix
#

but with my bot

ancient nova
#

alright thanks a bunch @hexed vortex

earnest phoenix
#

@sweet ruin what does the vsc error say

hexed vortex
#

alright thanks a bunch @hexed vortex
@ancient nova you're welcome

sweet ruin
earnest phoenix
#

hmmmm hmmm hmmm weirdddd

#

anyone here better than me at js here lmao

#

cause idk on that one

#

how i can do that?

#

😔

sweet ruin
#

deafen?

earnest phoenix
#

I'm trying to get the current position of an element but idk how lmao

Object.keys(donations).sort((a, b)=> b - a).map(x => `${x.indexOf(donations[x])} • **${client.users.cache.get(x)}:** ${nFormatter(donations[x])}`).join("\n")

the ${x.indexOf(donations[x])} just returns as -1
donations.json

{
  "131841679769600000": 5000000,
  "481000248034983936": 50100000
}
#

@sweet ruin, yes

#

@earnest phoenix pro tip dont use json or config files for storing data

#

it's temporary

#

I understand that

#

Just need help for now

#

hmmm then lets see

#

@earnest phoenix what have you tried

#

<ClientUser>.setDeaf(true)

#

😔

#

please stop making up your own methods and properties

#

refer to the docs

#

ok

#

thx

ancient nova
#

@hexed vortex cannot read property of send?

sudden geyser
#

@earnest phoenix .indexOf returns the index of a certain phrase found in a string. So what you're trying to do is find the value of donations.json in the key of it.

earnest phoenix
#

lol I figured it out

sudden geyser
#

aight

earnest phoenix
#

thanks anyways ❤️

sweet ruin
#

when doing this ^

granite echo
#

@sweet ruin

#

its VIEW_AUDIT_LOG not AUDIT_LOG

sweet ruin
#

OH

#

im dumb

#

thank you

granite echo
#

ofc

sweet ruin
#

great

#

now i get error xD

pure lion
#

Is that json db?

sweet ruin
#

huh?

pure lion
#

What is invites

sweet ruin
#

it gets all invites?

#

like for guilds?

pure lion
#

Well it looks like there's nothing cached

sweet ruin
#

and again it worked before without the line 36

pure lion
#

Which was?

sweet ruin
#

ill show you if I comment it out

#

i wont get errors

#

Well

#

ill get errors for guilds that choose not to allow permissions to view invites for my bot

#

but i wont get the id error

pure lion
#

can you do console.log(g.id)

#

Before the comment

sweet ruin
#

euh sure

#

it logs about 120 guild id's

#

if that makes sense

#

i cannot send ss because confidentiallity

ancient nova
#

guildCreate event how do I make it message the top channel of the server?

sweet ruin
#

euhhh

#

i make it search for channels

#

but if there is a .position

#

like channel.position

pure lion
#

@ancient nova top channel or the system channel?

ancient nova
#

bot.on("guildCreate", guild => {
if (guild.memberCount < 5) {

var chx = guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0);
chx.message.send('Your server has been tagged as a fake/dummy server, therefore the bot will leave, to prevent bot from leaving next time, please make sure to have atleast 10 active members and that you have not exeeded the amount of avaiable servers')

guild.leave()

}
})

sweet ruin
#

guild.channels.position(0) would do it

ancient nova
#

top

#

I got this

#

it doesn't show any errorrs

pure lion
#

Yeah I'd send that to the systemChannel

ancient nova
#

so I'm wondering why doesn't it work?

drifting wedge
#

from io import BytesIO
with io.BytesIO .....

do you see a problem?
@placid iron the problem is?

pure lion
#

Basically

placid iron
#

you are importing bytesIO but trying to use io

ancient nova
#

so?

#

is it possible to make it then

#

I've seen bots have it

#

but I can't seem to make it

pure lion
#

Why the top channel?

#

That's probably going to be "rules and info" or something like that

placid iron
#

well you know that there is always a top channel

#

not a bad idea

ancient nova
#

top channel because that's auto leave command

#

bot.on("guildCreate", guild => {
if (guild.memberCount < 5) {

var chx = guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0);
chx.message.send('Your server has been tagged as a fake/dummy server, therefore the bot will leave, to prevent bot from leaving next time, please make sure to have atleast 10 active members and that you have not exeeded the amount of avaiable servers')

guild.leave()

}
})

#

read the code of it

pure lion
#

Yes but the systemChannel

#

Mnmnmnmn

ancient nova
#

I'm really confused

pure lion
#

Why don't you want to use the systemChannel

ancient nova
#

don't know how

pure lion
#

guild.systemChannel.send("message")

ancient nova
#

what if the guild doesn't have a system channel

pure lion
#

Then auto leave and DM the owner of the server or something

drifting wedge
#

you are importing bytesIO but trying to use io
@placid iron so wut improt?

#

import?

ancient nova
#

oh, that'd be better

pure lion
#

And if you can't do that then just leave

ancient nova
#

how do I do that?

pure lion
#

Firstly, read the docs

placid iron
#

just import io

ancient nova
#

I don't really have the time to do so

#

does the script take long to write?

pure lion
#

Then how did you find the time to make a bot

#

No

#

But I'm not going to write it for you unless you pay >:)

ancient nova
#

the bot I've been developing for past 7-9 months

pure lion
#

Longer than me

ancient nova
#

come on man I'm not gonna pay for like 2 lines of code

pure lion
#

Then write those two lines of code

#

You know what an if statement is?

ancient nova
#

:/

#

I'll just do it later

pure lion
#

Bruj

ancient nova
#

bruh

#

I got the code

#

that's not even two lines of code and you wanted me to pay

granite echo
#

if you cant be bothered to code ur own bot dont code at all

tight plinth
#

^

ancient nova
#

I do code it, the problem was that I didn't know some of the code that was needed to something I was writing

#

what else am I supposed to do if not ask for help?

sweet ruin
#

learn a bit of basic javascript?

ancient nova
#

I do know javascript

granite echo
#

if ur gonna get salty u wont be helped

#

and what creepa said

ancient nova
#

I am saying that I don't know everything about discordjs

#

I am good with javascript

#

by itself

granite echo
#

do you know the basic fundamentals of it?

#

if not please learn it

ancient nova
#

yes, I do, I think I got it so I gotta go I had some stuff to finish after that

granite echo
#

"long version"

#

lol

tight plinth
#

follow that guide to understand discord.js basics

ancient nova
#

also I know that I lack some knowledge about discordjs but I'll learn it eventually

granite echo
#

lol

ancient nova
#

@tight plinth I'll look at it later, thanks

granite echo
#

gl coding then

ancient nova
#

thanks

#

if it's not sarcasm of curse.

pure lion
#

Nobody here is being sarcastic lol

#

That being said, good luck uwu

ancient nova
#

thanksGWcmeisterPeepoLove

sick cloud
#

can i again ask how to await a map sort of

#
things.map(thing => {
  const newThing = await getThing(thing)

  return newThing
})

always returns [object Promise]

sudden geyser
#

Promise.all?

raven urchin
#

Hey I need some Help with MongoDB, what do I put for the username and Password? I don't understand it much

pure lion
#

@raven urchin for username you put your username and for your password you your your password

raven urchin
#

So like my password when I sign into github?

#

Or any password or username?

pure lion
#

No

#

Your mongodb credentials

valid frigate
#

tony

pure lion
#

Have you created a cluster and stuff?

valid frigate
#

add async before the thing parameter

#

things.map(async thing =>

#

@sick cloud cc

raven urchin
#

I have created a cluster yes, but idk where to check my password and username

sick cloud
#

i mean it already does that with or without async

#

so

valid frigate
#

weird

#

i see that actually what its saying is its returning an object of promises

#

so whatever newThing is, it's a promise that hasnt been resolved

drifting wedge
#

same erorr

sick cloud
#

ah

#

so how do i sort it

#

like promise .all or something

valid frigate
#

well for starters

#

you should still add async because if you have await inside a non-async anonymous function its basically like invalid

sick cloud
#

yeah

valid frigate
#

but otherwise to sort that should work

#

hmm

#

does running async getThing() return something other than a promise

#

outside of that code

sick cloud
#

no it always returns a promise

sharp thicket
#

Hello

sick cloud
#
const getValue = (val) => {
    return new Promise(async (resolve, reject) => {
        // ...
    });
}
#

real func

valid frigate
#

interesting

pure lion
#

@sharp thicket how can I assist

lyric mountain
#

Do anyone here know what are heroku events? That dude is trying to setup a webserver on heroku and it's asking for that

sharp thicket
#

yeah

pure lion
#

Thefuck

sharp thicket
#

ty for explaining

#

what?

pure lion
#

I am confusion

valid frigate
#

oh thats right

pure lion
#

KuuuUUuUUuUuuuUuUuuuUUU, but whyyYYy?

lyric mountain
#

Afaik you're just supposed to import ur code, setup the dyno and run the code

sharp thicket
#

I'm trying to make a webhook that works with dbl in heroku

valid frigate
#

@sick cloud you cant return an entire promise like that, but if you do you still have to resolve it to actually extract the value

sick cloud
#

er

valid frigate
#

i mean you can return promises

#

but like

#

awaiting it doesnt automatically resolve it

#

what youre saying is basically, "when this function returns, i will return an unresolved promise"

sharp thicket
#

I'm confused..

sick cloud
#

i can send the full code if you want

valid frigate
#

no its ok

#

actually yeah why not

sick cloud
#

wait

lyric mountain
#

@sharp thicket please send screenshots or record how exactly you're setting up heroku

sick cloud
#

i got it

sharp thicket
#

k 1 sec

valid frigate
#

did you use promise.all

lyric mountain
#

Something is not right there

sick cloud
#

yes

valid frigate
#

nice

sick cloud
#

and await getValue(message.guild.config[key]); in the map()

valid frigate
#

oh ic

sharp thicket
sick cloud
#

so ye

valid frigate
#

well congrats

sharp thicket
#

i go to view webhooks

valid frigate
#

promise.all is really good for lots of promises in parallel

sharp thicket
drifting wedge
#

how can i layer 2 images on top of eachother with PILLOW?

sharp thicket
#

@lyric mountain now?

sick cloud
sharp thicket
#

noone help me ;c

drifting wedge
#

@placid iron can u help me again?

#

its not really working

sharp thicket
#

?

lyric mountain
#

Ah

#

I found what you're doing wrong

sharp thicket
#

?

lyric mountain
#

That's not how you're supposed to create webhooks

sharp thicket
#

How do i make one?

lyric mountain
#

You see, those are basically subscriptions to events (eg. receive a message when it goes off, or when the code is updated)

sharp thicket
#

Sory i'm stupid

#

oh

lyric mountain
#

What you need to do is create a new repo (workspace? Idk how it's called there)

sharp thicket
#

project

#

ok 1 sec

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: bytearray index out of range

#

wut does this mean?

sharp thicket
#

What you need to do is create a new repo (workspace? Idk how it's called there)
@lyric mountain ok done now?

#

?

#

u there?

drifting wedge
#

anyone?!

lyric mountain
#

Now u import ur code

#

Do you have a webserver coded already?

sharp thicket
#

hi

#

no

#

i want to use dbl api..

lyric mountain
#

You need to setup a code that will run on heroku

#

It's just like any other software

sharp thicket
#

How though? (sorry im new oof)

#

html?

lyric mountain
#

Do you have a bot?

sharp thicket
#

yep

lyric mountain
#

Same thing

#

Except instead of a bot it'll be a webserver

#

Research a bit about express.js

sharp thicket
#

what do i add there though?

lyric mountain
#

It's one of the easiest to setup imho

sharp thicket
#

ok]

drifting wedge
#

pillow is blocking?

#

what else can i use?

#

how can i get latency in cogs?

urban olive
#

im pogger

earnest phoenix
#

Yes, PIL is blocking @drifting wedge

#

@sharp thicket Also, please don't use Heroku like this other guy suggested, you can save so many headaches by getting a VPS

#
Need to run your bot 24/7? Get a cheap VPS.
https://www.scaleway.com/ EU            https://www.linode.com/ US/EU/Asia
https://www.digitalocean.com/ US      https://www.vultr.com/ US
https://www.ovh.co.uk/ EU/Canada    https://galaxygate.net/ US
https://www.time4vps.eu/ Lithuania.  https://www.hetzner.com/ Germany
Self-hosting:       Free hosting:                 Kinda free:
Any computer.    No. Not even heroku.   GCP, AWS have one year free micros.
lyric mountain
#

"the other guy" didn't suggest, it's he who said he'd use heroku

earnest phoenix
#

Either way, I suggest not using it

lyric mountain
#

and please, either kuuhaku or sora

sharp thicket
#

can you recommend a vps?

lyric mountain
#

contabo

sharp thicket
#

cc blocked oof

earnest phoenix
#

GalaxyGate accepts PayPal, debit, & credit cards, and they are fairly decent

sharp thicket
#

whats the difference?

lyric mountain
#

isn't galaxy gate expensive af?

earnest phoenix
#

Whatever you do, stay away from OVH, lots will claim they've had zero issue with them, but the ones that do.. Talk about a fucking nightmare

#

No, they are extremely cheap

honest perch
#

isn't galaxy gate expensive af?
@lyric mountain no

sharp thicket
#

whats the difference?
@sharp thicket

lyric mountain
#

mainly support, stability, price and reliability

#

and specs

sharp thicket
#

so if i were to use a vps how would i make the webhook?

lyric mountain
#

a vps is basically a remote computer

#

you just need to run the webserver just like you'd do in your pc

sharp thicket
#

I still don't know much about webhooks tho

#

so localhost?

#

like uhh

lyric mountain
#

not localhost because you'd have the vps' IP

sharp thicket
#

oh so host it in the ip

lyric mountain
#

webhooks are like APIs: you send a request and it'll process it

sharp thicket
#

?

#
const http = require("http");
const { ESRCH } = require("constants");

const host = 'IP';
const port = 8000;

const requestListener = function (req, res) {
    res.writeHead(200);
    res.end("WebHook!");
};

const server = http.createServer(requestListener);
server.listen(port, host, () => {
    console.log(`Server is running on http://${host}:${port}`);
});

#

like that?

lyric mountain
#

except that code would be running in the VPS itself

sharp thicket
#

yes i know

#

what about the url then?

#

would it be the ip of the vps?

earnest phoenix
#

How can I get a Spotify oauth token unlimitedly?

sharp thicket
#

so dblapi can access it

lyric mountain
#

the url would be the IP + the port + the endpoint (if there's any)

sharp thicket
#

@earnest phoenix wrong server

lyric mountain
#

for example: 127.0.0.1:1234/someapi

sharp thicket
#

ok so in this case ip:8000

#

yeah

lyric mountain
#

IP:PORT/path

earnest phoenix
#

Google is best at this point, he knows far too little to try & direct him (not trying to be rude)

sharp thicket
#

i don't have path so

lyric mountain
#

yep, it's IP:PORT then