#development

1 messages Β· Page 1193 of 1

carmine summit
#

.catch

#
async function api(url){
  let getURL = async () => {
            let response = await axios.get(url);
            let url = response.data;
            return url;
        };
        var urlValue = await getURL();
        return urlValue
}

if (command == 'test'){
      var send = api('https://hypixel-api.inventivetalent.org/api/skyblock/bosstimer/magma/estimatedSpawn')
      message.channel.send(send.estimate)
    }```
how can i make this work?
#

there is no errors at the same time it doesnt send anything

plush magnet
#

.catch() is a function part of the Promise Object. when something returns or throws an ERROR. the catch function is tried to be called

if you don't want to do that you will need to do your own edge casing

#

using a debugger can also help you

carmine summit
#

.catch() is a function part of the Promise Object. when something returns or throws an ERROR. the catch function is tried to be called

if you don't want to do that you will need to do your own edge casing
@plush magnet I had solved that problem already by removing the var and replacing it on the top so it wont get scope block

plush magnet
#

again you can remove one line of code by simpty returning the await

#

from this

  let getURL = async () => {
            let response = await axios.get(url);
            let url = response.data;
            return url;
        };
        var urlValue = await getURL();
        return urlValue
}

to this

  let getURL = async () => {
            let response = await axios.get(url);
            return response.data;
        };
        var urlValue = await getURL();
        return urlValue
}

its just simple things like that that can make code sections much shorter

#

also if you have declared url with var just pass it through the getURL function like this

  let getURL = async (URL) => {
            let response = await axios.get(URL);
            return response.data;
        };
        var urlValue = await getURL(url);
        return urlValue;
}
eternal osprey
#

hey can someone help me with some errors i am having while pushing my bot to heroku? Traceback (most recent call last):
2020-08-27T09:32:31.676478+00:00 app[worker.1]: File "bot.py", line 5, in <module>
2020-08-27T09:32:31.676479+00:00 app[worker.1]: from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, Defaults,
2020-08-27T09:32:31.676479+00:00 app[worker.1]: ModuleNotFoundError: No module named 'telegram'

plush magnet
#

theres no module named telegram found

leaden lake
#

do you know why my server count don't work ?

    """Handles interactions with the top.gg API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'ey.......WIO1Ra-M5JslLg8'
        self.dblpy = dbl.DBLClient(self.bot, self.token)

    @tasks.loop(minutes=30.0)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""
        logger.info('Attempting to post server count')
        try:
            await self.dblpy.post_guild_count()
            logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
        except Exception as e:
            logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(TopGG(bot))```
it doesn't do anything
eternal osprey
#

i have ran pip install python-telegram-bot

#

so it should be there

plush magnet
#

did you run it inside the directory where your bot is ran

#

also idk anything related to python code wise so I cant help there

eternal osprey
#

okay, but thanks for trying to help tho πŸ˜‰

leaden lake
#

yeah I ran in my py file with my bot

earnest phoenix
#

can someone tell me a good host for 24/7

#

I use downnotifer

leaden lake
#

can someone tell me a good host for 24/7
@earnest phoenix heroku

earnest phoenix
#

kk

carmine summit
#
async function api(url){
  console.log(url)
  let getURL = async (URL) => {
            let response = await axios.get(URL);
            return response.data;
        };
        var urlValue = await getURL(url);
        return urlValue;
}


if (command == 'test'){
      var send = api('https://hypixel-api.inventivetalent.org/api/skyblock/bosstimer/magma/estimatedSpawn')
      message.channel.send(send)
    }
plush magnet
#

just buy a raspberry pi

#

@carmine summit lowercase url here for the function let getURL = async (URL) => {

#

that should work

slender thistle
#

@leaden lake You're not .starting the task

#

Put update_stats.start() at the bottom of the init function

violet maple
#

Is heroku 24/7 free?

leaden lake
#

Is heroku 24/7 free?
@violet maple yeah

violet maple
#

noice

#

Since uptimerobot banned glitch i'll move to heroku

leaden lake
#

for only 1 bot. You got 1 000 hours free per month

violet maple
#

Nice

#

okay thanks

leaden lake
#

I typed lmao

carmine summit
#

TypeError: invalid arg type the url argument must be tye of string

plush magnet
#

@carmine summit at what line

leaden lake
#

@slender thistle so my line must be here ? def __init__(self, bot): self.bot = bot self.token = 'e........1Ra-M5JslLg8' self.dblpy = dbl.DBLClient(self.bot, self.token) update_stats.start()

worthy ice
#

Template?

#

Where Template?

slender thistle
#

yeah

leaden lake
#

okay thx

#

and will it be show on the svg / png file ?

carmine summit
#

hmm

#

doesnt say

slender thistle
#

Should be, as long as cache isn't involved

#

But that's easily bypassed with query parameters in the URL

carmine summit
#

@carmine summit at what line
@plush magnet dont know/ doesnt say

leaden lake
#

after 30minutes it will print the number of servers ?

slender thistle
#

well

#

if you have logging with the logging module enabled, yes

#

or you could use print

plush magnet
#

@carmine summit can you send me an image of the error?

leaden lake
slender thistle
#

in your bot's main file

leaden lake
#

yes, I only have 1 file

carmine summit
#

at let response = await axios.get(URL); i think

slender thistle
#

And you're trying to load the cog in the main file?

leaden lake
#

idk how this library works

carmine summit
plush magnet
#

@carmine summit is the url being logged?

carmine summit
#

logged?

plush magnet
#

you have console.log(url)

carmine summit
#

um

#

yes

plush magnet
#

so is the url appearing in the terminal or is it printing undefined

carmine summit
#

why does it affect it lol

plush magnet
#

nono just so I know

carmine summit
#

its appering in terminal

plush magnet
#

can you show me your current code?

slender thistle
carmine summit
#
async function api(url){
  console.log(url)
  let getURL = async (url) => {
            let response = await axios.get(URL);
            return response.data;
        };
        var urlValue = await getURL(url);
        return urlValue;
}


if (command == 'test'){
      var send = api('https://hypixel-api.inventivetalent.org/api/skyblock/bosstimer/magma/estimatedSpawn')
      message.channel.send(send)
    }```
warm marsh
#

lol

#

URL is a module

carmine summit
#

uhhhhhhhhhhhh

#

ok lol

warm marsh
#

Also no need for the getURL function

#
async function api(url) 
{
  let response = await axios.get(url);
  return response.data;
}```
plush magnet
#

yeah but they havent declared URL as a module? so it doesnt batter

warm marsh
#

It's default.

plush magnet
#

from what

carmine summit
#

Big Brain

warm marsh
#

The engine

#

As it's part of the browser.

plush magnet
#

they haven't imported it though?

warm marsh
#

Doesn't need imported

carmine summit
#

*me sitting here confused...

pale vessel
#

yeah but they havent declared URL as a module? so it doesnt batter

tight plinth
#

nah that's not the same thing

floral creek
tight plinth
slender thistle
#

what doesn't work exactly

warm marsh
#

I don't recall the word but it's globally accessible in node.

slender thistle
#

built-in?

warm marsh
#

I guess

carmine summit
#

umm

#

pls forget url

#

ive changed it

floral creek
carmine summit
#

and it still doesnt work

#

lol

warm marsh
#

Same error?

carmine summit
#

no errors

#

no output

#

xD

plush magnet
#

yeah just set the urls to lowercase or whatever

slender thistle
#

What about the embed

plush magnet
#

then the return is nothing

slender thistle
#

show errors if there are any

warm marsh
#

Make sure you await the api call

#

let send = await api(url);

carmine summit
#

OMG

#

i forgot

plush magnet
#

shouldnt it respond with unhandled promise as text

pale vessel
#

that's only if there's an error

warm marsh
#

It should also return an error when trying to send.

#

Something to do with an empty message

carmine summit
#

let send = await api(url);
works perfectly. Thank you 😘

warm marsh
#

Alright nvm

eternal osprey
#

Exception has occurred: ImportError
cannot import name 'Update' from 'telegram' (unknown location)
File "D:\coding\ReemBot\bot.py", line 5, in <module>
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, Defaults, \

#

what is this issue?

#

python -m pip install python-telegram-bot

#

i have ran this code

#

everything should be installed

#

but instead it is giving me this error

slender thistle
#

god help

eternal osprey
#

yeh, i am back

warm marsh
#

Where even is "Update" grabbed from that import?

eternal osprey
#

import logging
import db
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, Defaults,
PicklePersistence, ConversationHandler
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup, ParseMode,
ReplyKeyboardRemove

#

from this

warm marsh
#

There is updater not update

plush magnet
#

yes but are you running the pip in the correct sub folder

#

or is python using global stuff

#

cause I know npm installs modules into the main bots folder

#

but again idk hopw python works

eternal osprey
slender thistle
#

Well

#

does telegram.Update actually exist

eternal osprey
#

yess

#

but i get another error now πŸ™‚

#

Exception has occurred: ImportError
cannot import name 'Update' from 'telegram' (C:\Users\bilal\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telegram_init_.py)
File "C:\Users\bilal\Desktop\Χ§Χ•Χ“ Χ‘Χ•Χ˜ bot\ReemBot\bot.py", line 5, in <module>
from telegram.ext import Update, Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, Defaults, \

warm marsh
#

You got the same error...

plush magnet
#

Can you send me the link to this module?

eternal osprey
#

no it fisrt gave me the unknown location

plush magnet
#

Just check the docs

slender thistle
#

it exists

#

In the source code, __init__ does import Update so eh

#

Try importing Update from telegram.update instead

plush magnet
#

Shouldn't that be

import Update from telegram

#

Since its a subclass or whatever

warm marsh
#

Python does it the other way around

#

from package import data

plush magnet
#

Ofc it does why would it be normal

eternal osprey
#

ffs this is killing me

#

it was working yesterday

#

just out of the sudden it stopped working

earnest phoenix
#
    function randomstatus() {
      let status = ["BOGSCAM", "Prefix = b!", "Golf Blitz", "BOGSCAM's Cave"]
      let rstatus = Math.floor(Math.random() * status.length);
      client.user.setActivity(status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/bogscam"});
    }; setInterval(randomstatus, 300000)
  
      console.log('Logged in as BOGSCAM!')
  })```

Ξ™ add this to my code it is no error my bot becomes online but the status is not set
plush magnet
#

thanks for the ping mr bog

earnest phoenix
#

xD

#

Pls help

slender thistle
earnest phoenix
#

Pls help @slender thistle

slender thistle
#

I'm not proficient in JS

#

@eternal osprey What's the version of your python-telegram-bot package

plush magnet
#

well firstly it should be changing every 5 minutes

earnest phoenix
#

message.channel.send(Pong! Latency is ${Math.round(client.ping)}ms)
^

ReferenceError: client is not defined

#

eeee

robust arrow
#

Any idea why my bot isn't reacting at all when I start it?

Doesn't appear as online
No errors, warnings or messages in console

summer torrent
#

can you read the error

eternal osprey
#

python-telegram-bot==12.8\

slender thistle
#

Interesting

eternal osprey
#

telegram== 0,02

fluid basin
#

@earnest phoenix did you wait 300000 milliseconds

#

@robust arrow library and/or code

eternal osprey
#

telegram==0.0.1

earnest phoenix
#

oops

slender thistle
#

what

#

uhhhhhhhh

eternal osprey
#

i do have the package python-telegram-bot

#

and telegram

slender thistle
#

why both

#

python-telegram-bot contains a telegram module already

eternal osprey
#

how do i delete telegram

#

pip uninstall telegram

#

right?

slender thistle
#

remove it from your requirements.txt I guess if not that

eternal osprey
#

it gives the same error

#

i will remove telegram

#

hold on

plush magnet
#

@earnest phoenix secondly this needs to be changed since length counts from 1 not zero let rstatus = Math.floor(Math.random() * status.length - 1);

fluid basin
#

bruh

#

it works

#

you don't need to -1

slender thistle
#

What the fuck is that telegram package anyway

eternal osprey
#

i am now at square 1

#

now it gives me the unknown location error again

#

i will fucking remove python-telegram-bot package

#

and install it again

#

it is running

#

this is a miracle

#

IT IS RUNNING

#

LETSS GOOOOO

plush magnet
#

oh floor returns a lower value thats right

fluid basin
#

took you long enough XD

plush magnet
#

I was doing other stuff

#

thats why it took a while to respond

eternal osprey
#

oh no

#

guys

#

i see errors

#

shittt

#

there we go again

leaden lake
#

AttributeError: module 'dbl' has no attribute 'DBLClient'

slender thistle
#

dblpy version?

#

Do you have any files/folders named dbl?

leaden lake
#

yeah I have, and I just installed 2h ago

#

my code ```import dbl
import discord
from discord.ext import commands, tasks

import asyncio
import logging

class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""

def __init__(self, client):
    self.bot = client
    self.token = 'ey.......Ra-M5JslLg8'
    self.dblpy = dbl.DBLClient(self.bot, self.token)
    update_stats.start()
    #self.bot.loop.create_task(self.update_stats())

@commands.Cog.listener()
async def on_ready(self):
    print("Cog chargΓ© !")

@tasks.loop(minutes=3.0)
async def update_stats(self):
    """This function runs every 30 minutes to automatically update your server count"""
    logger.info('Attempting to post server count')
    try:
        await self.dblpy.post_guild_count()
        logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
    except Exception as e:
        logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

def setup(client):
global logger
logger = logging.getLogger('bot')
client.add_cog(TopGG(client))

slender thistle
#

Does the yeah I have part refer to Do you have any files/folders named "dbl"?

leaden lake
slender thistle
#

and what about your bot's folder

leaden lake
eternal osprey
#

me crying in tears πŸ‘€

#

guys it works i guess

#

lovely

#

i love you guys

feral aspen
#

Hello

#

Some websites makes this thing where you login and have access to their dashboard

#

how do they do the login thing?

slender thistle
#

Discord OAuth

feral aspen
#

How can I create one?

#

Or I cant.

slender thistle
#

@leaden lake pip show dblpy

leaden lake
#

Name: dblpy
Version: 0.3.4
Summary: A simple API wrapper for top.gg written in Python
Home-page: https://github.com/DiscordBotList/DBL-Python-Library
Author: Assanali Mukhanov, top.gg
Author-email: shivaco.osu@gmail.com
License: MIT
Location: c:\users\shaal0wfr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages
Requires: ratelimiter, aiohttp
Required-by:

slender thistle
#

Hamoodi, what's the library you mainly use?

feral aspen
#

I use Discord.JS node v12

#

did I say that right.

#

or I am wrong in understanding

slender thistle
#

nah that's exactly what I asked

leaden lake
#

??

slender thistle
#

Try print(dbl) after you import it

feral aspen
#

Okay, thanks!.

leaden lake
#

@slender thistle <module 'dbl' from 'C:\\Users\\Shaal0wFR\\AppData\\Local\\Programs\\Python\\Python37\\lib\\dbl\\__init__.py'>

slender thistle
#

then what the fuck is wrong

robust arrow
#

I still don't understand. My bot isn't starting up with another code (same token, different libraries) or the main bot (same token, same libraries), so it really must be something with the token. I have regenerated and changed it multiple times, still nothing.

slender thistle
#

Try re-installing dblpy

leaden lake
#

okay

fluid basin
#

@robust arrow library and/or code

#

we can't really help you if you're not giving information on what you are trying to do

robust arrow
#

Starting up my bot

#

It has worked perfectly before, just today not working

fluid basin
#

what library are you using? where the main code that you use to connect to Discord (please do redact anything sensitive)?

robust arrow
#

like discord.js v12?

pale vessel
#

yes

robust arrow
#

sorry im new

fluid basin
#

no problem, everyone started from 0 at some point

#

any samples to show us what code you are running? (screenshots, code snippets?)

leaden lake
#

@slender thistle Traceback (most recent call last): File "C:\Users\Shaal0wFR\Desktop\Bot Discord\test on Atom.py", line 11, in <module> import dbl File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\dbl\__init__.py", line 19, in <module> from .client import DBLClient File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\dbl\client.py", line 32, in <module> from .http import HTTPClient File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\dbl\http.py", line 33, in <module> from ratelimiter import RateLimiter ModuleNotFoundError: No module named 'ratelimiter'

robust arrow
fluid basin
#

seems nothing wrong to me, but why are you setting such a high limit for event listeners?

robust arrow
#

Someone told me it was a good idea on another server

fluid basin
#

thats weird

#

is the bot showing "Successfully updated!" in console?

robust arrow
#

nope

#

it doesnt even appear as online

fluid basin
#

can you try to debug the connection?

#

one sec lemme find the syntax

pale vessel
fluid basin
#
client.on('debug', dbg => console.log);
#

can you put this above your client.on('ready')?

pale vessel
#

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

fluid basin
#

yeah same thing

#

do hide any sensitive info such as your token

robust arrow
#

it's above client.on('ready') and I saved it, hasn't logged anything yet

slender thistle
#

@leaden lake pip install ratelimiter

leaden lake
#

it says already installed

fluid basin
#

hmm

robust arrow
fluid basin
#

is the main file called index.js?

robust arrow
#

yes

fluid basin
#

interesting

#

is there any code above the const Discord = require('discord.js') line?

robust arrow
#

nope

leaden lake
#

successfully installed

#

but I got this error : NameError: name 'update_stats' is not defined

pale vessel
#

yeah same thing
@fluid basin don't think so

#

you're providing a function a function

fluid basin
#

yeah I know

leaden lake
#

but I got this error : NameError: name 'update_stats' is not defined
@slender thistle

fluid basin
#

it works the same

#

in this case

#

also @robust arrow that line right after the message listener

pale vessel
leaden lake
#
        self.bot = client
        self.token = 'eyJ........1Ra-M5JslLg8'
        self.dblpy = dbl.DBLClient(self.bot, self.token)
        self.bot.loop.create_task(self.update_stats())```
fluid basin
#

might cause your account to be banned

slender thistle
#

self.update_stats

fluid basin
#

bot account*

robust arrow
#

what line

fluid basin
#

the line below the client on message

#

yeah did you try again with flazepe's code just now?

robust arrow
#

you mean

#
    client.user.setActivity(config.activity);
fluid basin
#

yeah dont update your presence under the message listener

leaden lake
#
        self.bot = client
        self.token = 'eyJ........1Ra-M5JslLg8'
        self.dblpy = dbl.DBLClient(self.bot, self.token)
        self.bot.loop.create_task(self.update_stats())```

same error @slender thistle

robust arrow
#

so should I just move the setactivity

fluid basin
#

yeah, and did you try the debug one with flazepe's code?

fluid basin
#

client.on('debug', console.log);
this

#

@pale vessel well actually you're correct

#

i was brainded for a moment

robust arrow
#

thats alot of ms

fluid basin
#

ok so discord auto-hides the token

#

is the token correct in the config?

robust arrow
#

yes, I've checked it multiple times

fluid basin
#

yeah ok your bot has been temp-banned

#

likely because you've hit rate limit

#

because of the setactivity

#

check the pins for info about ratelimits

pale vessel
#

gg

robust arrow
#

so is the 9000 seconds the duration of the "temp ban"

fluid basin
#

remaining time

#

to be precise

robust arrow
#

oh ok

leaden lake
#
        self.bot = client
        self.token = 'eyJ........1Ra-M5JslLg8'
        self.dblpy = dbl.DBLClient(self.bot, self.token)
        self.bot.loop.create_task(self.update_stats())```

Can anyone help me ? it says NameError: name 'update_stats' is not defined

cinder sandal
#

my bot changes status every 5 minutes, it will not reach the rate limit?

robust arrow
#

so if I have no setactivity, it wouldnt have tempbanned me

fluid basin
#

no its because you spammed the setactivity

earnest phoenix
#

to hit the limit you need to send 1000 IDENTIFY payloads (log ins basically) in a day, how tf did you do that

robust arrow
#

uhm

#

but it does

#

if it isnt under on message

fluid basin
#

every time your bot received a message (even its own messages), it will call setactivity once

#

so effectively when someone chats (like me and you rn), its sending activity updates

cinder sandal
#

86400 Γ— 5

fluid basin
#

bad bad bad

robust arrow
#

oh

fluid basin
#

put it in the ready

robust arrow
#

ok

fluid basin
#

client.on ready

robust arrow
#

in it

fluid basin
#

now you wait XD

cinder sandal
#

is it not reaching rate limit if my bot changes status every 5 mins

robust arrow
#

so 2 hours it is

fluid basin
#

is it not reaching rate limit if my bot changes status every 5 mins
thats fine, every minute or so is fine

#

dgyh's bot hit the global limit

#

check pins for more info

robust arrow
fluid basin
#

yup

robust arrow
#

thanks alot

fluid basin
#

#development message
in any decently large server with some active members, each message will take about a second

if they're running commands on your bot, thats 2 messages every command (or even more, depends on how many responses your bot sends to respond)

cinder sandal
#

why you put =>{ and not => {?
nothing happens but ok

fluid basin
#

bruh

plush magnet
#

its just a formatting difference

nimble kiln
#

@robust arrow Did you check your emails already? As far as I know you also get an email if you hit that limit

robust arrow
#

lemme check

obtuse jolt
#

why you put =>{ and not => {?
@cinder sandal I use both

leaden lake
#
Forbidden: Forbidden (status code: 403)
Traceback (most recent call last):
  File "C:\Users\Shaal0wFR\Desktop\Bot Discord\cogs\topgg.py", line 28, in update_stats
    await self.dblpy.post_guild_count()
  File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\dbl\client.py", line 142, in post_guild_count
    await self.http.post_guild_count(self.bot_id, self.guild_count(), shard_count, shard_no)
  File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\dbl\http.py", line 169, in post_guild_count
    await self.request('POST', '/bots/{}/stats'.format(bot_id), json=payload)
  File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\dbl\http.py", line 143, in request
    raise errors.Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403)```
robust arrow
#

No I didn't get an email

obtuse jolt
#

The first line tells me everything I need to know

#

lOl

nimble kiln
#

ok weird, then I guess you have to wait the 9000 seconds and try again - You should also monitor your bot for permanent restarts

obtuse jolt
#

Failed to post server count
Forbidden: Forbidden (status code: 403)

#

403 means you don’t have access

fluid basin
#

dgyh its either rate limit or you've hit login limit (super unlikely)

obtuse jolt
#

Are you use the right auth headers?

nimble kiln
#

He hit the login limit

#

which usually resets your token too

leaden lake
#

@obtuse jolt ?

obtuse jolt
#

Isn’t the login limit like 1,000 or 10,000

fluid basin
#

1k

#

per day

obtuse jolt
#

damn

#

That’s a lot

fluid basin
#

yeah if you have an autorestarter

#

and your code breaks after logging in

#

it will just restart infinitely

pale vessel
#

brrrrrr

nimble kiln
#

had that happen to me once already

#

But they also sent an email saying that my token got reset

obtuse jolt
#

Never happened to me

nimble kiln
leaden lake
#

@obtuse jolt does my error says I can't try my code on another bot ?

obtuse jolt
#

That’s a nice way of sending an email

nimble kiln
#

It is πŸ˜„

obtuse jolt
#

@leaden lake if it is a token thing you just have to change the token or auth header token if it’s from an api

#

Or if they banned you from the api you have to message them

#

Which could also be a thing

#

To cause a 403

leaden lake
#

it's my first try on the API, how to be banned before tried anything πŸ˜‚

forest drift
#

who knows how to use mongodb

obtuse jolt
#

MySQL ftw

faint prism
#

Non-relational DBS ftw

fluid basin
#

who knows how to use mongodb
@forest drift feel free to ask

forest drift
#

thanks, so how would i host a database that my bot can add to and read from?

leaden lake
forest drift
#

also, if im making a git repository to upload to glitch.com, do i have to include the node.js folder?

faint prism
#

also, if im making a git repository to upload to glitch.com, do i have to include the node.js folder?
@forest drift git should only store source code files, or dependency configurations.

forest drift
#

so lets say id used heroku and have a .git folder hereoku made that has the up to date code, could i just import that to git?

faint prism
#

Git keeps it's versions in "branches" and you can update them with "commits".
So really, you can merge any branches

#

I'm not sure exactly what you mean by import that to git

#

Unless you mean GitHub which is a website

forest drift
#

so when using heroku it made a .git folder, i wanna know if i can just add that folder to github

faint prism
#

Yeah. You can push it to GitHub

fluid basin
#

i dont think its possible to a mongodb server on glitch

leaden lake
#

no you don't need to upload your .git on github, it's not necessary

forest drift
#

i wanna use mongodb for hosting on heroku, so i can use heroku and still have a database

faint prism
#

no you don't need to upload your .git on github, it's not necessary
@leaden lake <-- yeah, just push the branch to GitHub via cli

forest drift
#

no you don't need to upload your .git on github, it's not necessary
@leaden lake would i need to upload the node.js folder?

fluid basin
#

im not sure if you can run a mongodb server on heroku

#

but mongodb cloud altas is free

#

for small databases/bots

forest drift
#

not a mongoidb server, i wanna use heroku for my bot and use mongodb for hosting its database ;-;

leaden lake
#

@leaden lake would i need to upload the node.js folder?
@forest drift idk, I don't use node js, i program with python. But you can upload it to be sure

forest drift
#

cause i was told heroku cant host internal databases

faint prism
#

That's probably correct then

fluid basin
#

ah ok, so you are planning to use mongodb cloud?

faint prism
#

Also if node.js is a folder that's generated while building then you probably don't need it

#

Since it'll be generated every time you build the project

forest drift
#

@forest drift idk, I don't use node js, i program with python. But you can upload it to be sure
@leaden lake so, if i were to be making a github repository, i just upload everything in the bots file except the .git? (*btw i wanna import this github repository to glitch.com

faint prism
#

There wouldn't be a need to keep a version control for it

#

@leaden lake so, if i were to be making a github repository, i just upload everything in the bots file except the .git? (*btw i wanna import this github repository to glitch.com
@forest drift pretty much

forest drift
#

ah ok, so you are planning to use mongodb cloud?
@fluid basin well the free version... i just wanna be able to use heroku to host a bot with a database and was told to use mongodb for the database

fluid basin
#

I see

#

that will work

leaden lake
#

@leaden lake so, if i were to be making a github repository, i just upload everything in the bots file except the .git? (*btw i wanna import this github repository to glitch.com
@forest drift yes, you don't need to upload the .git. I uploaded all files except the .git on github and all perfectly works on heroku

forest drift
#

but i already have coded it for the

const sequelize = new Sequelize('database', 'user', 'password', {
    host: 'localhost',
    dialect: 'sqlite',
    logging: false,
    storage: 'database.sqlite',
});
const strvarsave = sequelize.define('strvarsave1', {
    name: {
        type: Sequelize.STRING,
        unique: true,
    },
    description: Sequelize.STRING,
});

in mind, so how could i convert it so the code still works?

leaden lake
forest drift
#

@forest drift yes, you don't need to upload the .git. I uploaded all files except the .git on github and all perfectly works on heroku
@leaden lake ok

fluid basin
#

oh rip

leaden lake
#

idk how this works lmao

fluid basin
#

converting databases especially from sql to nosql isnt that fun

violet haven
forest drift
#

add a graph showing their average groth rate

violet haven
#

sry for my english

#

how can i make it bigger

forest drift
#

u mean add more things?

violet haven
#

no just the size

forest drift
#

oh ummmm idk then

violet haven
#

ah sah

forest drift
#

oh the image at the bottom?

violet haven
#

yes

#

the guild's banner

forest drift
#

hmmmmm... image manipulation?

leaden lake
#

Can anyone help me with the API reference ?

jagged sun
#

Hey, I'm having trouble setting the image at a message embed for author in discord.js latest. I want to get the profile picture of the user that called the command as image, but it does not work with msg.member.displayAvatarURL. Can someone help me?

spare flicker
#

someone know how to make a random embed command?

jagged sun
#

wdym with random?

spare flicker
#

you speak spanish?

jagged sun
#

no sorry

spare flicker
#

:c

#

lets use translator xd

jagged sun
#

k

spare flicker
#

you know how to make my bot send a random embed

jagged sun
#

What do you mean with "random embed"??

spare flicker
#

like if you put l!ramdom bot cand send 1 of 3 embeds

jagged sun
#

what language are you using?

spare flicker
#

and if you use the command again bot send another embed

#

hmm java

jagged sun
#

make a random number between 1 and 3, if it is 1 send out the first, and so on...?

spare flicker
#

ok thx

jagged sun
#

think u can do it with an int like this: (Math.random() * ((3 - 1) + 1)) + 1

spare flicker
#

ok

earnest phoenix
#
if(!message.guild.me.permissions.has(commandfile.config.perms)){
            message.reply(require("../../functions/permissionMiss")(commandfile.config.perms))
        }

This line of code got ignored

#

but checked that the bot doesnt have oerms

faint prism
#

hmm java
@spare flicker java or javascript?
2 very different languages

spare flicker
#

hmm idk

#

xd

#

im new at coding

earnest phoenix
#

wtf

#

u dont know ?

spare flicker
#

i use visual studio

faint prism
#

You don't know what language you are using to give your computer commands?

earnest phoenix
#

@spare flicker what is the of ur file ?

#

if java .java if javascript .js

spare flicker
#

javascript

earnest phoenix
#

ok

#

@spare flicker so ?

spare flicker
#

you speak spanish?

winter torrent
#

how do i turn an array full of permissions like KICK_MEMBERS to Kick Members

spare flicker
#

the only language i use is lua when i was creating a game in roblox

earnest phoenix
spare flicker
#

this maybe if (!msg.member.hasPermission("KICK_MEMBERS")) return;

drifting wedge
#

how can i get guild avatar?

#

using python

digital ibex
#

is that ur ip @earnest phoenix ?

spare flicker
#

@earnest phoenix why you have a golden apple in your logo?

digital ibex
#

ctx.guild.icon_url i think @drifting wedge

drifting wedge
#

ah thanks

#

was doing avatar

spare flicker
#

xd afk im at class

#

B(

drifting wedge
#

and wut about bot count

#

like for amount of bots

#

@digital ibex

digital ibex
#

amount of bots?

drifting wedge
#

yes

digital ibex
#

idk what u mean by that, read the docs

spare flicker
#

amount of bots in the server?

#

@drifting wedge amount of bots in the server?

drifting wedge
#

yes

earnest phoenix
#

is that ur ip @earnest phoenix ?
@digital ibex no it's the ip of my repl

drifting wedge
#

dont use repl

#

@earnest phoenix

#

it is horrible

#

and will 100% get your token leaked

#

and prob get u discord banned

digital ibex
#

no it wont

drifting wedge
#

yes it will

#

repl code is public

digital ibex
#

ever heard of a .env file?

faint prism
#

proof I am the dumbest guy in the world
@earnest phoenix Posting your db's whitelisted IP address?

earnest phoenix
#

Can anyone pls help

spare flicker
#

how i verified my bot in discord

digital ibex
#

repl hides env files

faint prism
#

Can anyone pls help
@earnest phoenix user.user.username

spare flicker
#

or another thing

earnest phoenix
#

huh

faint prism
#

or another thing
@spare flicker They don't do that anymore

digital ibex
#

get your bot in 75+ servers

spare flicker
#

ok

#

thk

#

thx

faint prism
#

huh
@earnest phoenix what is user.user?

.setDescription(` ${user.user.username} does not have anything you can rob`);
drifting wedge
#

they do\

digital ibex
#

then go to dev portal and click verify bot or

drifting wedge
#

u just dont get a badge

spare flicker
#

ok

earnest phoenix
#

Like saying the other people?

faint prism
#

what?

#

I'm saying that is probably a typo

earnest phoenix
#

it is horrible
@drifting wedge it πŸ‘ is πŸ‘ a πŸ‘ temporary πŸ‘ host

#

No?

faint prism
#

You're telling me that user.user is valid?

#

the object called user has an object property called user which has a username property?

drifting wedge
#

@drifting wedge it πŸ‘ is πŸ‘ a πŸ‘ temporary πŸ‘ host
@earnest phoenix well ur bot is terrible if ull get ur token leaked]

#

use heroku

#

if u dont wanna pay

earnest phoenix
#

Hmm idk

#

But i changed it

#

and i have another error

#

use heroku
@drifting wedge lmao that is even worse

#

saying ReferenceError: random is not defined

faint prism
#

then define random

earnest phoenix
#

repl literally encourage discord bots on their platform. heroku terminated my account for discord bots.

faint prism
#

you can't just say something like

console.log(x)
Err: x is not defined

let x = 5
console.log(x)
Output: 5
#

You have to give random a value

earnest phoenix
#

is that Python

#

No lol

#

js

#

lol js looks so similar for some reason

#

lol

drifting wedge
#

ur problem

#

when u get clapped by t&S youll see

#

honestly idc

earnest phoenix
#

do i have to send 100 claps again saying it is a temporary host

drifting wedge
#

but its ur prob

spare flicker
#

someone know free hosts pls

earnest phoenix
#

you're breaking rule 1 now

spare flicker
#

i want my bot 24/7 for verification in top.gg

earnest phoenix
#

someone know free hosts pls
@spare flicker we just talked about three kinda terrible ones

drifting wedge
#

o ok

#

sorry

spare flicker
#

xd

drifting wedge
#

glitch, heroku and repl ig

spare flicker
#

ok

earnest phoenix
#

XD in lowercase looks like you're REALLY sad

spare flicker
#

lets search youtube

faint prism
#

someone know free hosts pls
@spare flicker free hosts = an internet stranger who lets you use their server, but also gets to see everything about your bot. Source code, logs, tokens, etc

#

Are you sure you want that....?

spare flicker
#

:u

#

but im poor :c

faint prism
#

Self-host

drifting wedge
#

how can i count bots

#

im using py

#

@spare flicker its 36$ a month

spare flicker
#

.-.

drifting wedge
#

if you keep the computer charging 24/7

#

for self hosting

#

on average

spare flicker
#

xd

winter basalt
#

just get a cheap vps

spare flicker
#

i only have 0$

faint prism
#

VPS are $2-3/mo

spare flicker
#

youtube pls pay me

drifting wedge
#

u can just leave bot on ur pv

#

pc*

spare flicker
#

ok

faint prism
#

which is like $0.07/day

drifting wedge
#

or just leave it on when ur using it

spare flicker
#

lets search how to win money free

earnest phoenix
#

@golden condor uhh i used abc.db to migrate from quick.db to mongodb and it sucks tbh why would i store every single quick.db database and key in a single mongodb collection

winter basalt
#

by working

drifting wedge
#

how can i count bots
im using py

earnest phoenix
#

???

spare flicker
#

amount of bots in the server

#

hmm idk

forest drift
#

anyone know a Sqlite host thats free?

#

or somewhere where i can host a Sqlite database

faint prism
#

sqlite is a file based db, correct?

forest drift
#

yes

golden condor
#

@golden condor uhh i used abc.db to migrate from quick.db to mongodb and it sucks tbh why would i store every single quick.db database and key in a single mongodb collection
@earnest phoenix why would you store it all in a single sqlite file

#

Β―_(ツ)_/Β―

faint prism
#

So, keep the db file with the bot locally

earnest phoenix
#

the hell repl.it ispreventing me from putting my computer to sleep

forest drift
#

cant, using heroku as host

earnest phoenix
#

@earnest phoenix why would you store it all in an sqlite file
@golden condor you just made me shut up lol

golden condor
#

Also i'd prefer if you didn't randomly ping me

faint prism
#

cant, using heroku as host
@forest drift And it doesn't let you have store files arbitrarily?

forest drift
#

it seems to completely wipe the database after around 10hrs

faint prism
#

Hm

#

Sounds like a >hErOkU specific issue

forest drift
#

i ran my bot on heroku for 12 hrs, database wiped, ran it on my pc for 2 days, database safe

plush magnet
#

use pouch db

faint prism
#

use pouch db
@plush magnet literally never heard of that before

golden condor
#

heroku has a postgres db

plush magnet
#

maybe actually

#

does heroku folder scan for "junk"?

forest drift
#

ive already tried using mongodb, but it just wont work at a;;

plush magnet
#

pouch db is much easier and simple as

faint prism
#

does heroku folderscan for "junk"?
Probably resets non-source files

golden condor
#

i ran my bot on heroku for 12 hrs, database wiped, ran it on my pc for 2 days, database safe
@forest drift because heroku doesn't write the gh repo, it stores new files in memory and then wipes them after a few it as it restarts after a few hours

spare flicker
#

i use heroku

#

;v

forest drift
#

so that explains it

faint prism
#

I use my own physical server πŸ™‚ and it works great

spare flicker
#

I use my own physical server πŸ™‚ and it works greate
@faint prism epic

plush magnet
#

just use a raspberry pi

faint prism
#

^ I use a rasp pi 4

plush magnet
#

cheap and modular

forest drift
#

pouch db is much easier and simple as
@plush magnet would i be easily able to convert my sqlite system to it? and could i then run on heroku?

plush magnet
#

it reads and saves JSON data

forest drift
#

cheap and modular
@plush magnet im trying but strugling :/

spare flicker
#

goodbye im going to class

plush magnet
#

im talking about the raspberry pi. its cheap and modular

forest drift
#
const sequelize = new Sequelize('database', 'user', 'password', {
    host: 'localhost',
    dialect: 'sqlite',
    logging: false,
    storage: 'database.sqlite',
});
const strvarsave = sequelize.define('strvarsave1', {
    name: {
        type: Sequelize.STRING,
        unique: true,
    },
    description: Sequelize.STRING,
});
sudden geyser
#

take me with you electric

spare flicker
#

xd

forest drift
#

im talking about the raspberry pi. its cheap and modular
@plush magnet i know, i have one right next to me

faint prism
#

wha-

plush magnet
#

whats hard about it then?

spare flicker
#

why everyone name me electric

faint prism
#

then use it instead of heroku

spare flicker
#

.-.

forest drift
#

*well closeish, its on the shelf next to me

plush magnet
#

why arent you using it then

sudden geyser
#

it's easier to say than electricwolf082

faint prism
#

rasp pi is essentially a cheap, lightweight server

forest drift
#

cant get it coded, oits been factory wiped, never had software on it

spare flicker
#

xd

#

it's easier to say than electricwolf082
@sudden geyser and wolfy

faint prism
#

cant get it coded, oits been factory wiped, never had software on it
@forest drift Install a linux dist on it

plush magnet
#

then install a software onto an sd card

spare flicker
#

:v

golden condor
#

then install raspbian on it

sudden geyser
#

cringe /s

golden condor
#

or smth

forest drift
#

ok

faint prism
#

Nah, use Ubuntu Server 20.04 LTS

forest drift
#

anyway, so how would i convert an sqlite system over to pouch db?

faint prism
#

Depends on how you implemented it

#

If you used a factory-design pattern or any DI, and interfaces, it wouldn't be hard

forest drift
#

idc about the data ive saved so far, just wondering what id have to alter in the code

plush magnet
#

do you know how to do JSON objects

faint prism
#

If you didnt, have fun refactoring

spare flicker
#

so goodbye im going to record a video in class

forest drift
#

my bot just sends, edits, and reads data from the sqlite database

#

do you know how to do JSON objects
@plush magnet yes and no?

spare flicker
#

@ everyone

#

:u

plush magnet
#

if yes then that's all you need to do

#

its just a nicer formatter for couchdb

forest drift
#

how would i keep my bot on heroku while having pouch as the database if heroku doesnt support databases

plush magnet
#

its database is on files not memory

forest drift
#

@forest drift because heroku doesn't write the gh repo, it stores new files in memory and then wipes them after a few it as it restarts after a few hours
@golden condor so thats why my bot sometimes just stops mid timer...

earnest phoenix
#

do you know how to do JSON objects
@plush magnet JSON is completely different from JS objects

forest drift
#

its database is on files not memory
@plush magnet isnt that the same for sqlite?

earnest phoenix
#

JSON can be used to store JS objects for later use

#

Example:

#

JSON objects

plush magnet
#

im not sure I dont use it

earnest phoenix
#

Dont use json for a db, it is easily corrupted

forest drift
#

eh imma just setup an old motherboard in a server rack to run my bots

earnest phoenix
#

JS object:

{
  someProperty: someValue
}

JSON string:

{
  "someProperty": someValue
}
plush magnet
#

I said it saves and reads it LIKE JSON data

earnest phoenix
#

there is not much difference in the case of JS

plush magnet
#

I didnt say it IS JSON

earnest phoenix
#

I said it saves and reads it LIKE JSON data
@plush magnet the hell

#

do you...

#

use JSON for a database

#

for storing userdata

forest drift
#

why would my bot sometimes just stop mid timer when hosted on my pc? it keeps happening every now and again

earnest phoenix
#

grabs gun and shoots him

plush magnet
#

sigh for the love of god

forest drift
#

almost asthough its been restarted

plush magnet
#

imAgInE sToRiNG dAtA As a StrInG???

#

anyways idk what that issue is

#

and you should def get that rasp pi working

#

cause you wont have many limitations

forest drift
#

k

#

for now imma just try find a way to host on heroku with a database hosted somewhere else

drifting wedge
#

how can i count bots
im using py

earnest phoenix
#

imAgInE sToRiNG dAtA As a StrInG???
@plush magnet that's just what it's called

#

@drifting wedge repeating the same question doesn't mean we help

forest drift
#

for now imma just try find a way to host on heroku with a database hosted somewhere else
@plush magnet if heroku completely resets files every 10hrs, would pouchdb also be reset?

#

cause it says on the site it syncs to the cloud

plush magnet
#

idk if thats what heroku does

#

ive never used it

hazy sparrow
#

Guys can other people host my bot on github if they have some imformation?

slender thistle
#

GitHub is file storage

plush magnet
#

what do you mean host

drifting wedge
#

Guys can other people host my bot on github if they have some imformation?
@hazy sparrow yea i think

plush magnet
#

like use your bot

drifting wedge
#

they can steal it

plush magnet
#

if you make it public then duh they can use the code

hazy sparrow
#

What information?

drifting wedge
#

with the info u put lol

plush magnet
#

cause its a public repo anyone can see

fallen lake
#

if your rep is public and your token is there

hazy sparrow
#

Like? Tokens?

fallen lake
#

they can use

golden condor
#

@golden condor so thats why my bot sometimes just stops mid timer...
@forest drift yes

earnest phoenix
#

@hazy sparrow don't share the token done

#

and license it too

plush magnet
#

there are github scrapers that search repos for discord tokens so def dont push your token up

hazy sparrow
#

Its a friend who i trust ;-;

earnest phoenix
#

then people will think twice before stealing

#

then make the repo private

#

don't make it public if only your friend and you are gonna see it

#

friends aren't trustable don't share the token

fallen lake
#

make your repo private and use ENV for using token

earnest phoenix
#

dont share the token

#

period

hazy sparrow
#

Then how do i host it without github knowing it? Heroku btw

lost herald
#

in d.py how do i check if a channel is a community channel?

earnest phoenix
#

are you retarted or what

faint prism
#

Also, if you're using git, if you commited your token file at any point and removed it afterwards, it's still in the history

hazy sparrow
#

I have no idea

faint prism
#

are you retarted or what
@earnest phoenix don't attack others please

earnest phoenix
#

you seem like you know nothing about coding

hazy sparrow
#

But i should probably put it in another file

earnest phoenix
fallen lake
#

im done gl

slender thistle
#

in d.py how do i check if a channel is a community channel?
@lost herald a "community channel"?

plush magnet
#

clearly this is your first time round these parts 913

slender thistle
#

Do you mean news channels?

#

are you retarted or what
be nice ty

lost herald
#

also shivaco i reuploaded pandemic

faint prism
slender thistle
#

Mhm

And you're trying to delete either a rules or announcements ("community updates") channel

lost herald
#

ik

#

this is a public bot with a command for mass deleting channels in a category, and i wanna check beforehand if there would be an issue

faint prism
#

Just try it and catch it silently is one approach πŸ˜›

slender thistle
#

I don't think it's possible without actually trying to delete the channel

lost herald
#

i guess

#

ill just skip channels that return an error

lost herald
#

o

#

ill look into that

faint prism
#
try {}
catch(e) {
  if (e.contains('400')
    log('Required channed cannot be removed')) }
sudden geyser
#

syntax error grr

faint prism
#

something like that id imagine

#

it's psudocode. you get the idea

plush magnet
#

wHaT laNGuAgE iS pSuDoCoDe???

sudden geyser
#

python

earnest phoenix
#

code that does not work
(pun intended)
(me does not work)

faint prism
#

but conveys an idea/concept

lost herald
#

im fixing a fuck ton of bugs in my bot lmao

faint prism
#

Make small commits

opal plank
#

hmmm

#

that makes me wonder

#

is there a property or value in Error?

earnest phoenix
#

the object i want to store:

{
  lol: "lol"
}

storage JSON takes to store the object: 37 bytes
storage sqlite takes to save the object: 82 bytes
storage mongodb takes to save the object: MathError: Integer value cannot exceed 2^32

LET'S ALL MOVE TO JSON DATABASES BABYYYYYYYYY

plush magnet
#

sometimes yes

#

depends how they construct the Error class

opal plank
#

was wondering based on what auger said

#

getting the actual error and handling it from there

#

specially when dealing with api's n shit the errors it may return vary a lot

#

re trying based on error sounds like a good idea, but i never thought of handling errors dynamically that way

earnest phoenix
#

typeof e

opal plank
#

object

#

ik the type but i never though about actually using it

earnest phoenix
#
msg = await bot.wait_for('message', check=check(ctx), timeout=30)
if msg:
  async with aiohttp.ClientSession() as ses:
      async with ses.get(url) as response:
        await ctx.send(response.status)```
#

this doesn't work?

sudden geyser
#

What doesn't work about it?

earnest phoenix
#

i'm asking why it doens't work

#

it never sends the message

plush magnet
#

god damn more python

earnest phoenix
#

i hate python

slender thistle
#

What's check

opal plank
#

i bet the C# kids think the same

#

oh no, more js

earnest phoenix
#

check is what i use to check if the msg is a integer

#

I hate Python less than I hate the Math class in js

#

which works

slender thistle
#

I meant the function itself

#

can you send the code for it

earnest phoenix
#

the function itself works

#

^^^^^^^^^^

#

newMsg gets detects

#

just send it

slender thistle
#

because you are passing ctx to it manually

earnest phoenix
#

k

slender thistle
#

which you're not supposed to do

earnest phoenix
#

yeah

#

idc lol

#

works

slender thistle
#

????????????

earnest phoenix
#

if you do know smth works then why ask for help with it

opal plank
#

'it just works'

earnest phoenix
#
def check(ctx):
    author = ctx.message.author
    def inner_check(message):
        if ctx.message.author != author:
            return False
        else:
            try:
                int(message.content)
                return True
            except AttributeError:
                return False
    return inner_check```
#

this works

#

i'm asking

#

why doesn't the aiohttp

#

work

#

cuz

#

cuz

#

it is wrong

#

duh

#

where's it wrong

#

lol

slender thistle
#

code would you mind

drifting wedge
#

how can i count bots
im using py

earnest phoenix
#

?????

slender thistle
#

Because d.py calls the function you are supposed to provide to the check kwarg

#

well, tries to.

earnest phoenix
#

how can i count bots
im using py
@drifting wedge dude stop repeating the same question if no one is answering

#

that's not the problem

#

the problem isn't with the check

#

ask in discord.py official server someone probably will help

slender thistle
#

are you sure

earnest phoenix
#

yes

#

because newMsg gets detected

#

and i print it out

slender thistle
#

For good lord's name code can you stop with the attitude

pure lion
#

Is there a way to have multiple websites on one server?

slender thistle
#

@earnest phoenix So the wait_for works then

earnest phoenix
#

yep

#

on multiple ports

#

saw that in bittorrentweb

slender thistle
#

oh dear God you return another function

pure lion
#

Also through nginx

fluid basin
#

the object i want to store:

{
  lol: "lol"
}

storage JSON takes to store the object: 37 bytes
storage sqlite takes to save the object: 82 bytes
storage mongodb takes to save the object: MathError: Integer value cannot exceed 2^32

LET'S ALL MOVE TO JSON DATABASES BABYYYYYYYYY
thats seriously like comparing apples, oranges and bananas

earnest phoenix
#

that's a joke bruh

#

@slender thistle yes

#

the wait_for works

slender thistle
#

Are you sure the session doesn't just timeout?

earnest phoenix
#

it's the aiohttp

#

why would my session timeout

#

i have a check 4 that

#

if it timeouts i send a msg

slender thistle
#

Because invalid URL or the webserver took too long to respond

earnest phoenix
#

nope

#

Also through nginx
not sure if nginx can do that but i use expressjs and it does support multiple ports serving multiple websites (not in the same node.js process tho)

slender thistle
#

@drifting wedge what do you mean by "count bots"?

drifting wedge
#

like get amount of bots

earnest phoenix
#

like serverstats bot?

pure lion
#

I have another domain set up on it (the conf is in the sites-enabled folder) but it goes to the other site for some reason

slender thistle
#

in a server or generally any bots the bot sees in all guilds?

earnest phoenix
#

<guild>.bots.cache.size

drifting wedge
#

in a server or generally any bots the bot sees in all guilds?
@slender thistle in a server

slender thistle
#

when someone says they use d.py and you give them d.js code

drifting wedge
#

im doing server info command

earnest phoenix
#

oh lol

slender thistle
#

I forgot who here wasn't familiar with list comprehensions. Was it you, 0Exe?

drifting wedge
#

i was bot count thing

#

im not tho

#

im bad at everything

earnest phoenix
#

I have another domain set up on it (the conf is in the sites-enabled folder) but it goes to the other site for some reason
@pure lion Thonk hmmmm..... hits up docs

slender thistle
#

A more appropriate question would be "are you familiar with list comprehensions"- okay

opal plank
#

i mean, technically me, but i doubt i was the one you referring to shiv

slender thistle
#

Yeah not you Erwin, I don't remember explaining list comps to you

earnest phoenix
opal plank
#

i still wonder if i should give py a try, it seems fairly familiar with js at first glance

fluid basin
#

basically one-liner list iterations

faint prism
#

service* not server

earnest phoenix
#

i still wonder if i should give py a try, it seems fairly familiar with js at first glance

at first glance

#

but you should give it a try

slender thistle
#

In any case,

@drifting wedge [m for m in guild.members if m.bot]
The code snippet above iterates over guild.members where each element is assigned to variable m. The if m.bot part will only append the element to a new list if the member is a bot

fluid basin
#

@opal plank py feels really weird if you're coming from C++/JS

sudden geyser
#

@earnest phoenix wouldn't the int() call not being able to parse the string raise a ValueError

opal plank
#

@fluid basin how come?

earnest phoenix
#

i might also try C# cuz Unity decided to fuck up and remove everything JavaScript related

fluid basin
#

well many reasons

sudden geyser
slender thistle
#

uhh

#

yeah

earnest phoenix
#

lol

opal plank
#

most of the snippets here use the same if not similar stuff to js. if, elses, functions, returns, the only major difference ive spotted thus far is syntax in general

fluid basin
#

everything is just... shorter... in general

#

most of the snippets here use the same if not similar stuff to js. if, elses, functions, returns, the only major difference ive spotted thus far is syntax in general
well the 2 popular discord libraries in the 2 popular languages are OOP

restive furnace
#

which are they πŸ€”

opal plank
#

that up there from lite for example

earnest phoenix
#

most of the snippets here use the same if not similar stuff to js. if, elses, functions, returns, the only major difference ive spotted thus far is syntax in general
i'll put some flowers on () and {} code blocks graves cuz they're used VERY less in Python

opal plank
#

def as function()
var =(comparator) var
if
return

slender thistle
#

() tuples, [] lists

fluid basin
#

clearly js and py, I doubt if you can find a language here that has more questions/queries compared to these 2 languages

earnest phoenix
#

@sudden geyser no

quartz kindle
#

bd script :^)

restive furnace
#

py has less questions overall tho

earnest phoenix
#

there is no value Error

#

@sudden geyser yes

#

because i had to migrate the code to a newer versio

slender thistle
#

redundant, as in useless

earnest phoenix
#

i was able to just pass in author

slender thistle
#

a code that doesn't error but doesn't help

earnest phoenix
#

a code

#

a code

#

it's not a timeout error

#

it's horrible async

restive furnace
#

if thing_what_is_same != author

delicate zephyr
#

clearly js and py, I doubt if you can find a language here that has more questions/queries compared to these 2 languages
@fluid basin HTML, CSS mmulu

fluid basin
#

also @opal plank python is synchronous in design, async was only introduced a while ago

#

HTML is not a programming language

opal plank
#

does asyncio exist?

earnest phoenix
#

99% if my mongodb connection problems come from process.env.MONGODBPASS returning undefined cuz i fucked up

#

HTML is not a programming language
@fluid basin you know to cross it out

#

no error

faint prism
#

HTML is not a programming language
@fluid basin It's a markup language, like XML, or YAML

slender thistle
#

Yeah, asyncio exists

earnest phoenix
#

it shows

#

0

#

which is the msg i sent

opal plank
#

im pretty sure asyncio allows for await n async

earnest phoenix
#

but it doesn't execute any of the code

sudden geyser
#

there is no value Error
@earnest phoenix what do you mean? A bit confused. int(something) would raise a ValueError but you're checking for AttributeError

earnest phoenix
#

no

#

where am i doing

restive furnace
#

@opal plank yeah it is allowed now

earnest phoenix
#

int(something)

restive furnace
#

it is just a new thing in py tho

faint prism
#

casting

restive furnace
#

well not new new but still

earnest phoenix
#

oh i see now

#

who in their right mind will use XML instead of JSON

opal plank
#

how was it done before asyncio though?

faint prism
#

who in their right mind will use XML instead of JSON
@earnest phoenix dotnet boys

fluid basin
#

multithreading/multiprocessing

opal plank
#

hmmm i can see that working

slender thistle
#

import threading

import __future__

two things I'm unfamiliar with mmulu

earnest phoenix
#

@earnest phoenix dotnet boys
@faint prism what the hell

#

.NET is a weird name tbh

fluid basin
#

well even if its async, theres still have the issue of cpu hogging the threads (for any cpu bound tasks)

opal plank
#

if i do import __future__ it'll return undefined mmLol , im a disappointment

fluid basin
#

similar to js

earnest phoenix
#

that's a file format or what

restive furnace
#

yes, if u mean xml, if .net it is a framework, the file format of .NET is .cs

slender thistle
#

dev platform

#

software framework

opal plank
#

time for more headache implementing cache

restive furnace
#

asynchrnous functionality was added in C++ recently too, so almost everything on C++ runs with several threads

earnest phoenix
#

ok @sudden geyser

#

i replaced that check

#

with lambda message: message.author == ctx.author

#

still doesn't work

slender thistle
#

Show how you use it

earnest phoenix
#

newMsg = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=30)

slender thistle
#

newMsg.content.isdigit() to check if it can be converted into integer instead of having an exception raised

earnest phoenix
#

ok

#

still doesn't solve my problem

#

just does nothing

#

at all

#

no code gets executed

slender thistle
#

Show the full command

earnest phoenix
#

aiohttp isn't timing out

#

it's too big

slender thistle
#

Use hastebin

earnest phoenix
wheat mesa
#
client.on('ready', () => {
  console.log('Discord bot up and running; no issues reported!')
  function statusThingy() {
    const PossibleStatuses = ['Probably broken', 'The hamsters in my brain are running wild again', 'Find bugs with me please', 'Stop breaking me!!!']
    const currentStatus = Math.floor(Math.random()*PossibleStatuses.length)
    client.user.setActivity(PossibleStatuses[currentStatus], {type: "CUSTOM_STATUS"} )
  }
  setInterval(statusThingy, 10000)
})
``` the status isn't working, any idea why?
fluid basin
#

huh

#

bots can't have custom status?

wheat mesa
#

oh they can't?

slender thistle
#

Yeah they can't

fluid basin
#

lol

wheat mesa
#

oh okay

spare flicker
#

@tough imp

wheat mesa
#

it had an option for that on autofill for that so I just picked it

spare flicker
#

lol my friend is here

wheat mesa
#

so I just changed the CUSTOM_STATUS thing to PLAYING and it's still not working

leaden lake