#development

1 messages · Page 1752 of 1

spice socket
#

or sum

opal plank
#

if u cant send it because nitro, i only know 2 ways you can get it

#

one is using a bot to fetch all emojis in the server

spice socket
#

oh wait it just all of a sudden worked

opal plank
#

and the second is the same, but using your user token, which i would HIGHLY NOT RECOMMEND

#

once again

#

I DO NOT RECOMMEND USING UR TOKEN

spice socket
#

if i send the ID it automatically gets replaced by the emoji

#

:piglinvibe:

#

ya see

#

i cant send the raw id

earnest phoenix
#

Uh

spice socket
#

i typed the ID

#

and as soon as i send itr

#

it gets replaced by that

opal plank
#

cuz u dont have nitro most likely

zenith terrace
#

^

opal plank
#

u just cant send it

#

no way around it

spice socket
#

so does anyone here have nitro that can do this for me

#

lol

opal plank
#

like i said, you need the bot to fetch the emotes in that server

#

OR

#

you can get it by its url

#

i think it gets the id there

spice socket
#

aight

opal plank
#

hmmm

spice socket
#

but i would have needed to send the emoji to copy it lol

opal plank
#

thats a message id

#

lets see

umbral lake
#

hey

#

how to do:

opal plank
#

https://cdn.discordapp.com/emojis/587328389929500692.png?v=1

#

thats the url

umbral lake
#

when someone has, discord .gg/(url), the bot add a role

opal plank
#

that thing after the /emojis/ should be the id

earnest phoenix
#
    const radio = {
        "nrj": "http://185.52.127.132/fr/30001/mp3_128.mp3?origine=fluxradios",
        "skyrock": "http://icecast.skyrock.net/s/natio_mp3_128k?tvr_name=tunein16&tvr_section1=128mp3",
        "rapfr": "http://generationfm-rap.ice.infomaniak.ch/generationfm-rap-high.mp3",
        "virgin": "http://stream.virginradio.fr/virgin.mp3",
        "mouv": "http://direct.mouv.fr/live/mouv-midfi.mp3",
        "swigg": "http://start-adofm.ice.infomaniak.ch/start-adofm-high.mp3",
        "nostalgie": "http://scdn.nrjaudio.fm/adwz2/fr/30601/mp3_128.mp3",
        "cherie fm": "http://scdn.nrjaudio.fm/adwz2/fr/30201/mp3_128.mp3"
    }```
How to list that (i try whit .map and .join but its doesnt work...)
opal plank
#

thats an object

#

not an array

opal plank
#

use Object.values().map() =>

#

@earnest phoenix

earnest phoenix
#

-_-

opal plank
#

wdym -_-

spice socket
#

oops

opal plank
spice socket
#

it has to be .gif

opal plank
#

if u want mimu support, ask in their server

spice socket
#

they dont have one

opal plank
#

they do

spice socket
#

their "join discord" leads here

opal plank
#

surely not

spice socket
earnest phoenix
#

mdrok radio.values().map()

#

@opal plankshy

spice socket
#

mr millenium

#

can u join my server for 2.5 seconds to help me out

zenith terrace
opal plank
#

@spice socket

spice socket
#

o ok

opal plank
#

use them

#

thats not how u use what i said

#

read that

#

or spread the object into an array

#

either works

earnest phoenix
#

thx Object.keys(radio).join(\n• )

dense spire
#

anyone know how I could indent inside of a code block with code?

distant cobalt
#

How do you extract a zip file on github? I zipped my bot folder into a zip folder and now i want to unzip it on github. how can i do that?

dense spire
#

no no

#

like

half dagger
#

Ok so

dense spire
#

if i were to do it with python

half dagger
#

How/where can i host this

const express = require("express")

const app = express()

const webhook = new Topgg.Webhook("token")

app.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\
  
  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.listen(80)```
umbral zealot
#

on any VPS that can run nodejs code

half dagger
#

and the url will be its ip ?

umbral zealot
#

And can be accessed from outside, too

#

as long as it's accessible publicly? Yeah, sure.

#

but usually you'll need an actual domain pointed to it and configured

deep mantle
dense spire
#

more like \n

#

but if i send that through it actually prints that

deep mantle
#

\n is a new line

dense spire
#

im trying to avoid printing the \n

#

yes

#

meant new line

deep mantle
#

using \n should make a new line not print \n

#

maybe you are doing /n?

distant cobalt
#

How can you host your discord bot using github for free with your pc off?

solemn latch
distant cobalt
ivory rampart
#

is the great idea

distant cobalt
#

I used github to store the files

#

and used heroku to get it

#

and

solemn latch
#

heroku hosts stuff, but they have a limit of like 21 days a month free.

distant cobalt
#

deploy the application?

ivory rampart
#

I randy Ortons you fake ?

solemn latch
#

if you want full time you need to pay

distant cobalt
#

I used heroku, connected my github repository, and deployed it, the commands don't work.

solemn latch
ivory rampart
#

oOo

#

OK!

#

I developer.

#

CityHuB? xD

distant cobalt
solemn latch
distant cobalt
solemn latch
#

heroku can deploy something, and it not work.

distant cobalt
solemn latch
#

on discords side, is your bot logged in(without you running the bot off heroku)

solemn latch
#

is heroku giving any errors in logs

ivory rampart
#

homework

#

great.

#

@lilac saffron hojgeldin bacım xD

distant cobalt
lilac saffron
umbral zealot
#

English only in this channel please

#

If you want to use another language please move to #general-int

real rose
#

chuo help

solemn latch
distant cobalt
#

@solemn latch what do i do

solemn latch
#

🤷‍♂️ thats pretty much the limit of my heroku knowledge. never used them.

distant cobalt
#

oh ok

marble juniper
#

what library are you using? discord.js?

pale vessel
#

Detritus.

marble juniper
#

flazepe no

umbral zealot
#

detritus is literally trash.

pale vessel
#

It does mean that, yes.

marble juniper
#

detritus is like the sword in a gun fight

earnest phoenix
umbral zealot
#

discord.js isn't trash, but detritus literally actually means trash. like, it's the same word.

earnest phoenix
#

I prefer the rest api or djs-light the only way without memory leak

marble juniper
tired shard
#

Please ping me with reply as I won’t see it otherwise.. how and where can I get a database for my bot for its economy system and any other system that needs a database that I might add down the road. I currently code my bot on GitHub and host it on heroku, I am currently looking at vps options but currently can not pay for a Vps... so do any of you also know of a free Vps I can host my bot on that doesn’t require a credit card... as I said at start of this message, please ping me with reply as I will not see the reply due to notifications turned off for this server

umbral zealot
deep mantle
#

also DynamoDB

tired shard
#

Okay, I’ll check those 2 out (MongoDB Atlas and DynamoDB)

lyric mountain
#

if you don't have a credit card I doubt heroku will be enough

#

unless you're fine with 20 days per month uptime

marble juniper
#

laughs in my bot running on a dedicated server

rare sierra
#

Im so fucking confused with doing this

#

cool so this is my code

#
<style>
.entity-header__name {
  color: #000dff;
}
</style>

#

and then

#
<style>
.entity-header__name {
color: #000dff;
}

h1 {
 color: #000dff;
}
</style>
#

once I chaneg to this everything breaks

lyric mountain
rare sierra
#

yup

lyric mountain
#

put the style tag before all the text

rare sierra
#

Yeah it is

lyric mountain
#

sometimes it glitches hard for no aparent reason

rare sierra
lyric mountain
#

try reducing h1 scope

#

maybe .entity-header__name also uses h1 styles

rare sierra
#

so like this h1 { color: #000dff }

lyric mountain
#

no, like

#

make it more specific

rare sierra
#

Ohhh ok

#

so h1.something_something_something

lyric mountain
#

parent child child child { styles }

#

h1 would be the child of longdesc

#

whatever is its class name

rare sierra
#

Ok

#

I'll just use classnames

#

btw, I switched to a DB like you said I should

lyric mountain
#

oh nice

#

postgres?

#

or sqlite?

rare sierra
#

MongoDB

#

pls dont tell me thats bad

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

umbral zealot
#

yeah mongo is pretty awesome.

tired shard
#

How do I get my GitHub bot repo/project into my new MongoDB Atlas thing

marble juniper
#

wanna know what the funniest thing they said in discord.js v13 for me was?

#

"to reduce caching"

sudden geyser
#

delete from dbs where name = 'mongodb'

marble juniper
#

uwu

umbral zealot
tired shard
#

Gotta love when your battery bank dies while charging your phone lol

rare sierra
#

top.gg is so freaking broken rn oml

tired shard
umbral zealot
#

it's suggested to use a separate token/configuration for development on your local PC (using environment variables) so that you don't affect your prod bot and database.

rare sierra
#

its giving me fucking anxiety

umbral zealot
tired shard
#

Okay

rare sierra
#

could someone check my bto page

#

and tell me what they see please

#

like send a screenshot

solemn latch
rare sierra
#

Wow

#
<style>
.entity-header__title {
color: #000dff;
}

.entity-sidebar__title {
color: #000dff;
}
</style>

#

so top.gg just preten this does not exist 👍

tired shard
#

what do i use to connect heroku to my mongodb atlas cluster..

#

there is a "connect with the mongo shell", a "connect your application" and "connect using MongoDB Compass"

rare sierra
#

connect your application

umbral zealot
#

you`re using an "application"

tired shard
#

ok

rare sierra
#

and then choose what ur using

#

so maybe Java

#

3.6

#

mongo version

tired shard
#

my bot is coded with node.js

rare sierra
#

ok good

#

so

#

node.js

#

then click "Include driver code example"

#

copy that code

tired shard
#

ok

rare sierra
#
const MongoClient = require('mongodb').MongoClient;
const uri = "mongodb+srv://SorinoRPG:<password>@sorinorpgcluster.huchg.mongodb.net/myFirstDatabase?retryWrites=true&w=majority";
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true });
client.connect(err => {
  const collection = client.db("test").collection("devices");
  // perform actions on the collection object
  client.close();
});
marble juniper
#

xd

rare sierra
#

this

tired shard
#

then where do i put that code.

umbral zealot
#

in your bot

#

lol

tired shard
#

but which file lol

solemn latch
#

the file you want to use mongo

#

or the file you will be exporting from.

rare sierra
#

...

rare sierra
tired shard
#

i dont know what you mean by that @solemn latch ....

umbral zealot
#

where do you want to use the database?

tired shard
#

on as much of my bot as i can...

umbral zealot
#

that... sounds like you have no idea what you're going to do with a database

tired shard
#

currently just the economy system of the bot

#

which consists of multiple files(1 file for each economy command)

rare sierra
#

jesus is lord

umbral zealot
#

Right so you'll probably want to create a module file where oyu connect to mongo and then export that connection to other files

#

and export the client from there

placid iron
#

i doubt it but does anyone use pillow and if so how do you support random characters in peoples names?

#

^testing hence my name has random unicode

solemn latch
rare sierra
#

he is advertising himself

umbral zealot
#

if by "this" you mean my js guide, it's been around for some years

rare sierra
#

but i respect it tho

solemn latch
#

I mean it's relevant. I just never knew evie had this.

rare sierra
#

sneaky af too

umbral zealot
#

I just wanted specific, helpful, friendly information pages on a limited number of topics related to bots

rare sierra
#

yeah, but i mean..

umbral zealot
#

mdn can be confusing even for knowledgeable devs

solemn latch
#

Yeah it's clean. Totally stealing it.

umbral zealot
#

Feel free ^_^

cinder patio
#

I meeean

slender thistle
placid iron
#

okay, thanks

sudden knoll
#

Is there a way to set a prefix as case insensitive?

#

not command, but prefix

solemn latch
#

wrong reply wth

#

idk how that even happened 👀

sudden knoll
#

lmao

solemn latch
#

mb manny

placid iron
#

@slender thistle thanks, that seems to work nicely

slender thistle
#

I have zero clue what I suggested but you're welcome

placid iron
#

lmao

slender thistle
#
    """Class that represents widget options that are passed to widget URL generated in
    :meth:`DBLClient.generate_widget <topgg.DBLClient.generate_widget>`."""

this is ugly af and I want to complain but it works so I can't

sudden geyser
#

python docs look ugly in general

slender thistle
#

Why must you hurt me with facts?

sudden geyser
#

snakes bite

slender thistle
#

KEKW Get out

sudden geyser
#

🚪 🚶‍♀️

cinder patio
#

Done with the parser now time for a type checker, where do I even start

tired shard
#

do i need to put module.exports = economy; at the end of the module file then what do i do?

sudden geyser
#

get some good type inference in there

#

and look at the problems with current type checkers

cinder patio
#

I think I've made my typing system a little too complex for me to handle, but we'll see

sudden geyser
#

You could do that. You could also set module.exports.x = y

#

Or, for example, assigning a class without a given name as module.exports = class {...}

#

It's your choice.

tired shard
#

okay

sudden geyser
#

It just needs to be set so the processor can actually read the exports

tired shard
#

okay, how to i export the economy system things to that then..

sudden geyser
#

Like I said, whatever you use is up to you. module.exports is just a regular property.

tired shard
#

ok

sudden geyser
#

When the file is required or imported, whatever you set the exports to is what will be accessible to the importer

sudden knoll
#

all I know is how to return the prefixes

solemn latch
#

whats your code look like?

sudden knoll
#
PREFIX = "a!"

def get_prefix(bot, message):
    try:
        custom_prefix = db.database.get_server(message.guild.id).get_custom_prefix()
        if custom_prefix == None:
            raise AttributeError
        else:
            return sorted([custom_prefix, PREFIX], key=len, reverse=True)
    except AttributeError:
        return PREFIX

bot = commands.Bot(command_prefix=(get_prefix), case_insensitive=True, help_command=None)
solemn latch
#

is this the code for getting prefixes? i am looking for the code which you compare whats returned from this, to the messages prefix.

sudden knoll
#

yes, idk where the code where you compare would go

earnest phoenix
#

I'm way too dull to be in this server

solemn latch
#

ah, so you dont have prefixes working at all?

golden rock
#

You don't have to write any other code

solemn latch
#

oh py has inbuilt command handlers, i see.

sudden knoll
#

yeah

#

the only thing I can think of is returning the list of all cap combos instead of the 2 prefixes

solemn latch
#

yeah, thats what I would do.
loop over the list, and just make a .lower and .upper of each

sudden knoll
#

sadge

#

hoping for a more elegant solution, but it is what it is ig

solemn latch
#

👀 kinda why i dont like premade command handlers. its much cleaner doing it yourself
there might be a better way, I just dont know the default command handler at all.

sudden knoll
#

yeah

#

shivaco help meeeeee

slender thistle
#

What are we doing

sudden knoll
#

how do make prefixes case insensitive

#

without having to return all cap permutations

slender thistle
#

custom_prefix is the custom prefix a guild has, correct?

sudden knoll
#

yeah

worn sonnet
#

oke so a noob question here

#

how do i sort dictionary based on it's values

#

I tried this sorted_links_likes = sorted(links_and_likes.items(), reverse=True)

#

me using python

sudden knoll
#

but say your prefix is abc, is there a way to allow Abc, aBc, abC, ABc, ..., ABC without actually making and returning that list in get_prefixes

slender thistle
#

So in your else why not just return (custom_prefix.lower(), PREFIX.lower())

sudden knoll
#

that wouldn't solve the issue tho

worn sonnet
#

just do message.content = message.content.lower()

golden rock
#

Yeah that leaves our the weird ones though

#

Like aBc

placid iron
#

nice, time to implement that in my real code

worn sonnet
#

@sudden knoll

golden rock
#

@sudden knoll I can write you a quick loop that would return all permutations if you'd like

sudden knoll
golden rock
worn sonnet
#

It works

#

i use it

placid iron
#

i just did it so the prefix thing returns the prefix + prefix with first letter capitalised

golden rock
#

Yes but it ruins any caps in the command

#

So if they try to input variables with caps then rip

worn sonnet
slender thistle
#

x in the lambda function is each tuple that contains key-value pair

sudden knoll
#

lambdas are stonk

slender thistle
#

zeroth element being the key, first being the value

golden rock
#

Yeah tbh @sudden knoll as long as you return abc, Abc, and ABC I bet you'd be fine

slender thistle
worn sonnet
#

well i tried but for bigger dicts it doesn't work or something......?

golden rock
#

.lower,.title,.upper

sudden knoll
golden rock
#

I don't think there's any option other than returning all permutations

#

If there was it would be in the documentation

sudden knoll
#

yeah

slender thistle
#

Why do you want specifically permutations and not just .lower the prefix

broken matrix
#

const guildMember = message.author
guildMember.roles.add(['843924656884678667'])
"stack": "TypeError: Cannot read property 'add' of undefined

sudden knoll
#

because if you lower the prefix, I don't think it'll work
eg.
a! works
A! does not

golden rock
#

Because there's no way to lower their message without losing their caps

sudden knoll
#

or would it work?

golden rock
#

What if you have a a.input Cats command

#

And you want Cats and not cats

sudden knoll
slender thistle
#

What are you talking about

broken matrix
#

Is anyone open?

slender thistle
#

Pass a lowercase version of the prefixes to command_prefix arg

#

Hold on

broken matrix
#

ight

golden rock
sudden knoll
worn sonnet
golden rock
#

On_message, do what h4cker had above

slender thistle
slender thistle
golden rock
worn sonnet
#

i passed the key parameter with itemgetter

sudden knoll
slender thistle
#

you didn't pass anything in the code you provided bro

worn sonnet
#

I'm fcking tiered as fck

#

overriding the lib functions

worn sonnet
#

is something u should never do

#

unless u want to be brain fucked

slender thistle
#

@sudden knoll Do you store prefixes in cache?

sudden knoll
#

also a dict

slender thistle
#

Dict in cache or?

sudden knoll
#

sql db is for persistence, dict is for runtime

golden rock
#

The await process_commands thing is what triggers your bot.commands()

#

So it'll still work

slender thistle
#

Right, okay

sudden knoll
#

stores in a dict

sudden knoll
#

also thanks @worn sonnet

worn sonnet
#

Welcome

#

just a smol payback for heroku i guess

sudden knoll
#

I recommend learning lambdas and list/dict comprehension btw h4ck3r_x

#

lol sure

slender thistle
#

Dear fucking God help my soul

worn sonnet
sudden knoll
#

they're just mini functions

#

what's up shivaco

worn sonnet
#

When I try to perform more than one or two things

slender thistle
#

lambda is just an anonymous function

golden rock
#

Lol yeah I need to learn more about them too, anytime I use them I pull from stackoverflow or something

placid iron
#

lambda is OP

slender thistle
#

Okay

>>> timeit.timeit("if any([content.lower().startswith(_.lower()) for _ in ['A!', 'AbC']]): pass", setup="content = 'a!oMglol'", number=1000000)
0.9915907999999973
>>> timeit.timeit("for i in ['A!', 'AbC']:\n if content.lower().startswith(i.lower()):\n  pass", setup="content = 'a!oMglol'", number=1000000)
0.6331427000000076
sudden knoll
#

lmao

slender thistle
#

You can probably do

def get_prefix(...):
    ...
    return your_prefixes

bot = commands.Bot(command_prefix=get_prefix)

@bot.event
async def on_message(message):
    for prefix in bot.command_prefix(bot, message):
        if message.content.startswith(prefix.lower()):
            message.content = message.content.replace(prefix.lower(), prefix, 1)
        elif message.content.startswith(prefix.upper()):
            message.content = message.content.replace(prefix.upper(), prefix, 1)
    return await bot.process_commands(message)
#

Or at that point bot.process_commands should work without the manual checks anyway

sudden knoll
#

I just did

@bot.event
async def on_message(message):
    message.content = message.content.lower()
    await bot.process_commands(message)
slender thistle
#

Yeah, that's if you don't need case sensitivity with your args

sudden knoll
#

yeah I don't need any

slender thistle
#

You're kidding me right

sudden knoll
#

but for another project I do, so I'll keep this

#

ty

slender thistle
#

How did I miss that

#

I suggest testing that beforehand because I didn't

sudden knoll
#

okay ty

sudden geyser
#

[PostgreSQL] I'm in the process of refactoring a platform primarily available in English to support any language. I've only written the API and managed the database so far and was considering creating a table to hold all translations:

CREATE TABLE translations (
    id uuid NOT NULL DEFAULT gen_random_uuid(),
    text TEXT NOT NULL
);

However, I've heard this approach (and similar approaches where all translations are stored in a single table) has many drawbacks. There are other approaches I've read about having big drawbacks as well, but for anyone who's has experience with this, how would you suggest it be modeled?

slender thistle
#

What do you think of making a separate table for each language?

prime mist
#

Translations in the code is often done. Then you just keep them in memory

#

By code I mean yaml files etc

sudden knoll
#

separate table for each language and a unique id that corresponds to each text doesn't sound bad imo

prime mist
sudden knoll
#

ooh dewey decimal system

#

lol

#

or ibsn num

#

idk what texts he's talking about tho

sudden geyser
slender thistle
sudden knoll
#

damn

#

ty

#

yeah I was wondering how it was replacing the prefix earlier

slender thistle
#

It might not cover all cases but I'll leave that up to you now

#

Cuz it's 2:43 and I'm tired as hell

sudden knoll
#

lol, thanks, I'll be sure to test it

prime mist
eternal osprey
#

hey

#

[] how do i check whether this is empty?

#

Like is the index -1?

sudden geyser
#

depends on the language

placid iron
#

[]==[] SkFlooshed

#

😳 😳

sudden geyser
#

I'm allergic to loose comparison

placid iron
#

Bro I was not using js

#

But okay

slender thistle
#

len([]) == 0

placid iron
#

Okay what if ```py
Def is_empty(list):
for n in list:
return true
Else:
Return false

#

On mobile so excuse formatting

#
Def is_empty(L):
    Try:
        L[0]
        Return true
    Except:
        Return false```
woeful pike
#

it's paid but you can get a free license for open source

marble juniper
#

xetera laughing in top.gg docs being open source

sudden geyser
#

Crowdin and Weblate look like promising sites for collaborative localization, but I'm unsure about it since:

  • The platform I'm developing is completely collaborative
  • It (Crowdin and Weblate) would be an external platform to rely on (which I want to minimize as much as possible).
earnest phoenix
#

S

sudden geyser
#

yes, s

prime mist
woeful pike
slender thistle
# placid iron Okay what if ```py Def is_empty(list): for n in list: return true ...
def is_empty(l):
    F = "F"; A = "a"; L = "l"; S = "s"; E = "e"; 
    if isinstance(l, list):
        if len(l) >= 1 and list.__len__(l) > 0:
            for _ in list(l):
                if _ in list(l):
                    return bool(l)
                else:
                    return l.__bool__()
            else:
                return bool(l)
        else:
            return True if bool(l) else False
    else:
        return False if bool(l).__str__() == "".join(eval("""''.join([F, A, L, S, E])""")) else True
woeful pike
#

also there's very little vendor lock-in with crowdin. It's literally just json files as a service

sudden geyser
#

I'd prefer to use a site like Crowdin as opposed to writing my own localization system, but given the structure of the platform I'm developing, Crowdin doesn't look feasible. Originally, I asked the question with less knowledge about how I'd really structure the platform, but I've learned more from it.

severe pike
#

Hey with the new site redesign some of my html has stopped working. For example my logo used to float up and down. Changing the class to this doesn't fix the issue.

#

changed the class using this

#
.Avatar__StyledImage-sc-11xtpcc-1 dwineZ {
    -webkit-animation: floate 5s ease-in-out infinite;
    border-radius: 20px;
}
#

Not quite sure whats wrong with it now?

#
<style>
.orange { 
color: #FF8C00 !important;
}
@keyframes floate {
    0% {
        box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.6);
        transform: translatey(0px);
    }
   50% {
        box-shadow: 0 25px 15px 0 rgba(0, 0, 0, 0.2);
        transform: translatey(-20px);
    }
   100% {
        box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.6);
        transform: translatey(0px);
    }
}
.Avatar__StyledImage-sc-11xtpcc-1 dwineZ {
    -webkit-animation: floate 5s ease-in-out infinite;
    border-radius: 20px;
}
.discordcolor {
color: #7289da !important;
    }
    .red {
        color: red !important;
    }
        .white {
        color: white !important;
    }
</style>
sudden knoll
#

For all you Python ppl, I finished my class creation script (I yoinked shivaco's camel_to_snake method, thank you shivaco)

sudden geyser
#

Doesn't Python have a module for generating source code

sudden knoll
#

ehhhhh idk

analog tinsel
#
{"12312401124124":{"registrar":71},"125412541251":{"registrar":4},"125125125125":{"registrar":5}}
#

(photo for example)

#

how i can make json to table like photo? (i tryed tons of source on github but my json style different from their so not worked)

stiff lynx
#

Which is the best free bot host?

sudden geyser
#

It depends on your project.

#

If you're hosting a website, glitch, repl.it, heroku, etc. are in your favor.

#

If you're hosting a Discord bot, your options are limited.

#

If you're building the next Google, good luck.

sudden geyser
analog tinsel
#

html page

#

so people can see their data on site

sudden geyser
#

I don't have enough experience with HTML to give you a constructed solution, but I know you can use a <table> along with <tr>, <th>, and <td> elements to model it in plain HTML.

#

Then apply some styling

#

I swear who was in charge of adding descriptions to the last two cards

boreal iron
#

Written from mobile, can’t be more detailed however

#

tr = row
td = column

fossil acorn
#

-p liberta me de mim

boreal iron
# sudden geyser I swear who was in charge of adding descriptions to the last two cards

A web server programming language
That’s actually not true.
It’s a standalone server side scripting language.
Actually being used mostly to build static and dynamic websites.
But it’s capable of a lot more for example even handling backend and/or system tasks.
It doesn’t even need a web server to be productive code, at least just the CLI.

#

oops activated mentioning oldEyes

sudden geyser
#

and some details are just incorrect

boreal iron
#

Yeah absolutely but it’s not a web server scripting language

sudden geyser
#

for example, the trailing ' in the example

boreal iron
#

It doesn’t even have anything to do with a web server

rocky hearth
#

does css variables take up memory?

somber trout
#

heres a middle ground between the two: a scripting language used mainly for server side web development

somber trout
rocky hearth
#

and that's all it?

boreal iron
#

You can basically say anything you see or saw on you mr screen passed the RAM

sudden geyser
boreal iron
#

But I don’t think it’s worth to think about if CSS consumes RAM

#

Nothing to worry about

safe bay
#

have any of you ever actually developed a bot?

somber trout
sudden geyser
safe bay
#

Doesn't look like it. What language did you code in?

safe bay
sudden geyser
#

I used Rust for my last bot.

safe bay
sudden geyser
#

you serious or joking

safe bay
sudden geyser
wheat mesa
#

he’s gotta be trolling

safe bay
wheat mesa
#

cool

#

So then I’m going to assume you were joking about the rust thing ofc

sage bobcat
#

One message removed from a suspended account.

safe bay
boreal iron
wheat mesa
#

I don’t know much about python and I have no reason to ask a question since it is not a language I use

wheat mesa
#

I was merely commenting on your messages that I could not tell if you were serious or not on

safe bay
wheat mesa
#

Oh I see...

somber trout
#

what the hell is happening

wheat mesa
#

I have no idea

somber trout
#

@safe bay u sound really smart

safe bay
#

Just a real programmer laying down some biz to these amateurs.

somber trout
sudden geyser
#

they say a user's contributions tells a whole story

wheat mesa
boreal iron
#

I wonder what’s wrong in my sentence...

sudden geyser
#

kruger effect should've spiked down

safe bay
somber trout
safe bay
#

type faster

#

I imagine you are a slow programmer

boreal iron
#

Well that’s the consequence if schools being shut down and parents don’t care about their kids okeh

#

The most entertaining channel, still

sudden geyser
#

just install more fingers

wheat mesa
#

True!

boreal iron
#

Need to keep some on the steering wheel unfortunately

wheat mesa
#

Though programming does not really have anything to do with typing speed unless you’re doing a timed contest like Google Kickstart

boreal iron
#

Don’t start to feed the troll

wheat mesa
#

I suppose I shouldn’t

#

Slightly bored atm though

boreal iron
#

Won’t be here long enough to enjoy

safe bay
#

Jealous much?

wheat mesa
#

Indeed

safe bay
wheat mesa
#

I use Java++

safe bay
sudden knoll
wheat mesa
#

Oh sorry, I use C♭

sudden geyser
#

Javb

boreal iron
#

C flower lel

wheat mesa
#

C flat

boreal iron
#

Good one

sudden knoll
#

C major

safe bay
#

that's music you wingnut!

wheat mesa
#

No it’s a programming language!

safe bay
wheat mesa
#

You got a GitHub?

#

I like GitHub it’s pretty cool

safe bay
wheat mesa
#

Unfortunate.

somber trout
#

github Pog

safe bay
wheat mesa
#

Yeah I like to steal code from several open sourcers and use it as my own

sudden knoll
#

lmao

wheat mesa
#

It’s a good thing you keep those repos private cus I probably would’ve skimmed them for some nice code by now already

wheat mesa
#

“The open source pirate”

safe bay
wheat mesa
#

Hey, I don’t have to understand it as long as it compiles right!

somber trout
#

@wheat mesa whats ur github?

wheat mesa
#

Linked in my discord

#

Only have 1 public repo atm

#

Just something I did for fun

somber trout
#

i see

sudden knoll
#

wait but doesn't MEE6 have some repos on GitHub.....

safe bay
sudden knoll
#

nice reply there

#

clowning

safe bay
safe bay
sudden knoll
#

++Java

wheat mesa
#

Java++ is better 😡

sudden knoll
#

faster version of Java++

safe bay
boreal iron
#

Oh he’s still here... damn did I miss something?

sudden knoll
#

that's what you think Waffles

somber trout
sudden knoll
#

we beefin now @wheat mesa

wheat mesa
#

Oh no have I been brainwashed by the Java++ devs once again?!

safe bay
somber trout
sudden knoll
safe bay
boreal iron
#

snakish then

safe bay
somber trout
#

python

sudden knoll
#

legless lizard

safe bay
sudden knoll
#

please stop pinging me

safe bay
#

ok

safe bay
sudden knoll
#

much better

wheat mesa
#

Wonderful!

safe bay
somber trout
#

Wonderful!

wheat mesa
safe bay
safe bay
wheat mesa
#

You use the term “seasoned programmers” quite often. How does saying that make you feel?

sudden knoll
#

he's the gordon ramsay of programmers

boreal iron
#

What an honor to meet you then.

somber trout
#

i mean he created mee6 ig

safe bay
wheat mesa
#

May I receive an autograph?

safe bay
wheat mesa
#

A signature over discord.

safe bay
wheat mesa
#

Elaborate

safe bay
wheat mesa
#

Yes I would.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

safe bay
#

we?

sage bobcat
#

One message removed from a suspended account.

rustic nova
#

Could you both change channels? Read the channel topic

wheat mesa
#

Yup

sage bobcat
#

One message removed from a suspended account.

rustic nova
boreal iron
#

idk what the fuck is happening here but its not related to the channel
I wonder how that can bother you?
There’s a conversation you’re not a part of going on which you doesn’t like?

Tip: Leave the right room or close Discord.

There’s no spam going on and the topic relation can be found by scrolling up.

#

Oh and yeah... 1 < 2 = true
(to stay on topic just for you)

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

safe bay
#

@wheat mesa

wheat mesa
#

Yes?

safe bay
#

that girl is kind of a prick

#

thats all

wheat mesa
#

Ok

sage bobcat
#

One message removed from a suspended account.

safe bay
sage bobcat
#

One message removed from a suspended account.

fickle magnet
#

why does everytime I install a library in the console it says I installed it but I still get the yellow line under the import

wheat mesa
deep mantle
#

anyone know a good way to match up an answer to the correct one?
Im making a quiz bot.
Like if the answer is "The prince and the pauper" and someone entered prince and pauper.
I use discord.py

fickle magnet
#

it is just yellow in visual studio code

#

I tried installing and uninstalling it still nothing

wheat mesa
fickle magnet
#

still nothing

wheat mesa
#

What is VSCode saying

sudden knoll
#

does it know what env it's using?

clear marlin
calm raft
#

in discord.py if the user passes an @mention as an arg how do you get the ID of the user they mentioned?

sudden knoll
#

they're asking for the ID

calm raft
#

yeah

#

like mine for ex 519621712677961728

sudden knoll
#

when you mention someone it comes in the form <@ID>

calm raft
#

ah

sudden knoll
#

<@!ID>

#

if it's a nickname

#

so just replace all those characters with blanks

calm raft
#

thanks

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

calm raft
#

i see

fickle magnet
rocky hearth
#

Im trying to set the cursor to an svg image from an url in css. But its not showing, so I think the dimensions are too large . How can I limit the size of svg image to 32

worn sonnet
safe bay
#

i was thanks

rocky hearth
#

thanks, but my svg image coming from a url. I'm not using inline svg tags.
and I want to set it to the browser cursor, with a limit specified.

#

I doubt if it's even possible

sudden knoll
rocky hearth
#

idk, but even the svg example doesnt work in my browser

#

the png one works

earnest phoenix
#

hi

latent heron
#

holy shit @sage bobcat i think this is the only C# code I ever publicly wrote in Top.gg

#

and probably the only C# I ever will write

upper moss
#

hi

#

anyone here good at python i kinda need some help :(

latent heron
#

just ask the question, don't ask to ask

ornate hull
#

maybe i can ask here

#

why i cant add my bot?

latent heron
ornate hull
#

damn

earnest phoenix
#
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const { Color } = require("../../config.js");

module.exports = {
  name: "avatar",
  aliases: ["icon", "pfp"],
  description: "Show Member Avatar!",
  usage: "Avatar | <Mention Member>",
  run: async (client, message, args) => {
    //Start
    let Member =
      message.mentions.members.first() ||
      message.guild.members.cache.get(args[0]) ||
      message.member;
#

how remove

#

run in this

#

command

#

pls any one tell

#

how remove run in this embed

ornate hull
#

i mean how to add my bot it cant aded why?

near stratus
#

h u h ?

upper moss
#

i am trying to add a cooldown of 60 secs, like if a user says ~hi then they can't use that command for another 60 secs
if message.content.startswith('~hi'): messages = ["hii >w<", "hewoo >w<", "heyy >w<", "hii >o<", "hewoo >o<", "heyy >o<"] await message.reply(random.choice(messages), mention_author=False)

earnest phoenix
#

pls reply my

swift cloak
#

hey is there a way for npm to enter a dir when running a script

ornate hull
#

am i must created website url for my bot then i can add my bot?

swift cloak
#

for example, npm start

#

enters a folder, and runs npm start in that package.json folder

near stratus
# earnest phoenix run in this

Umm like this

const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const { Color } = require("../../config.js");

module.exports = {
  name: "avatar",
  aliases: ["icon", "pfp"],
  description: "Show Member Avatar!",
  usage: "Avatar | <Mention Member>"
}
ornate hull
#

my bot dosent approval yet

near stratus
swift cloak
#

you dont need a website

ornate hull
ornate hull
#

@near stratus @meager dagger

#

that my bot id

swift cloak
#

i tried "cd dashboard & npm start"

#

because i am using jsx and express, and i want one terminal to run it

ornate hull
#

@near stratus can my bot added?

near stratus
ornate hull
#

oke

#

done @near stratus

clear marlin
#

or you could use
cd dashboard ; npm start ; is equivalent to a newline.

swift cloak
#

ahh thanks

#

also, why when i kill my terminal, port 1234 is still alive?

#

does anyone know why?

near stratus
clear marlin
ornate hull
#

@near stratus how bout my bot? is it done? sorry for bother

earnest phoenix
#

cn any one know node

#

pls dm me

#

i need help

#

pls

#

😭

swift cloak
#

idk why

clear marlin
#

are you using react?

earnest phoenix
#

👀

near stratus
clear marlin
#

he says he has killed the process

swift cloak
#

i killed terminal

near stratus
swift cloak
#

i quit vsc

near stratus
#

P I D

ornate hull
#

@near stratus sorry once again bother how bout my bot?

clear marlin
#

one more thing, restart the process and then do ctrl + f5

#

it should load the new content

swift cloak
clear marlin
near stratus
ornate hull
near stratus
swift cloak
#

it reads text i hover over

#

lmfao

clear marlin
#

try this
netstat -anp tcp | grep 1234

clear marlin
#

now do
kill -9 PID

near stratus
#

@swift cloak simply do

kill -9 `lsof -i TCP:3000 | awk '/LISTEN/{print $2}'`

it'll kill whatever's running on port 3000

clear marlin
#

any of the following will work

near stratus
#

Also I got this from StackOverFlow (never used mac)

ornate hull
#

@near stratus done

#

try it

clear marlin
#

I'm on a mac too so

swift cloak
#

lol

ornate hull
#

already @near stratus ?

swift cloak
#

im on a 2014 mac tho so its laggy af when i code

clear marlin
#

im on 2017 big sur

ornate hull
#

me just watch

#

lol

ornate hull
#

@near stratus how is it?

#

sorry i doesnt pation

deep mantle
near stratus
deep mantle
#

Use like time.time

ornate hull
upper moss
near stratus
#

time.now()

deep mantle
# upper moss you mean time.sleep?

When the message is sent set a variable to time.time (seconds since the epoch) and when the command is run again check to see if the time the command is run is 60 after the other command time

deep mantle
#

Yw

slender thistle
#

Use a global dictionary preferably

green vale
#

Hi guys! Just a quick development question with ES6 JavaScript that I can't seem to solve on my own. As a background, I'm building a Discord bot in Node.js; however, I'm building it with Babel (first timer) as personally I prefer imports over RequireJS (don't judge me). Is there an alternative way to get class information from a JavaScript file using imports, or any other way other than require()? Like I said, I use Babel, so require() isn't exactly an option in my case.

clear marlin
green vale
#

WHAT THE FUCK

#

THAT EXISTS?

clear marlin
#

use this, see the documentation in the readme

clear marlin
green vale
#

Holy crap I'm so dumb lol

#

Thanks lmao, that makes things so much easier

clear marlin
#

np, I prefer import over require() too

eternal elbow
#

@earnest phoenix react is very difficult

earnest phoenix
eternal elbow
earnest phoenix
spare badger
#

@earnest phoenix You got any experience in React Native?

earnest phoenix
#

Not Native

#

Native sucks

eternal elbow
earnest phoenix
#

I use Create-React-App

spare badger
#

Oh haha I guess you are not interested in building cross platform mobile apps?

spare badger
#

Haha yea no reason for you to jump into React Native then.

eternal elbow
spare badger
#

I got really excited when I found out I was able to build real native and properly performing applications with my web development skills.

earnest phoenix
eternal elbow
earnest phoenix
#

Learn the basics of React in this comprehensive course. You will learn about fundamentals, hooks, context API, react router, custom hooks, and more.

React is one of the most popular ways to build user interfaces using JavaScript.

🎥 React projects video: https://www.youtube.com/watch?v=a_7Z7C_JCyo

✏️ Course from John Smilga of the Coding Addic...

▶ Play video
#

Free Code Camp

eternal elbow
#

Thankss

earnest phoenix
#

No prob

woeful pike
earnest phoenix
woeful pike
#

I hope you get the help you need

earnest phoenix
#

I wanna display how many servers

spare badger
#

ReactJS let me try to help you. Where are you stuck?

earnest phoenix
stiff lynx
spare badger
#

Do you have experience in using any API?

earnest phoenix
#

Nope

spare badger
#

Are you building your Discord bot in NodeJS?

earnest phoenix
#

Yup

#

I hate .py

spare badger
#

Alright so you have to choose a package so send HTTP requests with. I always like to use node-fetch for that. You can install the package from NPM.

spare badger
#

Node-fetch

earnest phoenix
#

ok

#

@spare badger How to setup api after that

stiff lynx
#

anyway, I have a command for give Money and the syntax Is
-give args[0] @user
I have a cooldown for this command, people sometimes failes the command and Exchange -give @user args[0] but in this case U have nothing inside this args.
in conclusion, there Is a way for not have the cooldown when you fail the command?

spare badger
#

Alright so when you have the package installed you can require the package by using

const fetch = require('node-fetch');

You can now send requests using the fetch() method. Information on how you can use that method can be found here: https://www.npmjs.com/package/node-fetch

earnest phoenix
#

Then we need authorization for top.gg?

woeful pike
#

good enough for free hosting but it won't take you too far

earnest phoenix
#

yup

spare badger
stiff lynx
earnest phoenix
woeful pike
#

if you want a decent server you're probably looking at min $5/month

earnest phoenix
#

Idk how to use that library

#

???

#

Its paid?

spare badger
#

It looks very easy. Look at the snippet they share on the page. You just have to install the package and then initialize the package by giving it your token and client object.

spare badger
#
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const AutoPoster = require('topgg-autoposter')

const ap = AutoPoster('Your Top.gg Token', client)

ap.on('posted', () => {
  console.log('Posted stats to Top.gg!')
})
earnest phoenix
#

yup

#

I saw it

stiff lynx
woeful pike
#

no idea it depends on your bot

stiff lynx
#

How Is coded

#

if It Is optimizated or not

woeful pike
#

I had a bot with 200 servers running on it at some point

spare badger
#

@earnest phoenix You know where to find the token you need to use that library?

woeful pike
#

idk memory usage and stuff like that, resources in general

spare badger
#

Alright so you now understand how to use the package?

analog tinsel
earnest phoenix
#

It will post stats with that code??

analog tinsel
#

how i can convert undefined to string?

earnest phoenix
#

@spare badger ?

#

It will post stats with that code??

spare badger
#

@earnest phoenix It will yes.

earnest phoenix
mellow cairn
spare badger
# analog tinsel how i can convert undefined to string?

What I always do to check if something is undefined:

if (typeof(myVariable) == 'undefined') {
  console.log('The variable is undefined')
}

So what you can do in your code; instead of writing item.mute inside the table, write the following:

(typeof(item.mute) == 'undefined' ? '-' : item.mute)
stiff lynx
earnest phoenix
#

the next day someone hacked the bot

stiff lynx
#

I have a command for give Money and the syntax Is
-give args[0] @user
I have a cooldown for this command, people sometimes failes the command and Exchange -give @user args[0] but in this case U have nothing inside this args.
in conclusion, there Is a way for not have the cooldown when you fail the command?

spare badger
#

@stiff lynx Would have to see the code for that.

#

There is always a way

stiff lynx
#

give me a sec

mellow cairn
earnest phoenix
#

@spare badger Btw after puting token shud i start the server??

earnest phoenix
#

I was using vscode

mellow cairn
#

Oh, I see

earnest phoenix
#

next day it was erased

spare badger
#

@earnest phoenix It will only post the stats when you run the script yes?

mellow cairn
#

Well, idk then. Maybe it didn't save ur work?

earnest phoenix
#

nope

#

My bot application was gone

mellow cairn
#

Fair enough then

spare badger
#

@stiff lynx The cooldown logic is somewhere else in your code base I think. You are returning a fixed cooldown in this file that is probably used to apply the cooldown somewhere else. You have to build a feature that ignores that cooldown whenever the command fails.

stiff lynx
stiff lynx
#

const cooldowns = new Map();
I'm using a map for it

#

@woeful pike sorry for pinging, but I'm curious, how is your bot named?

spare badger
#

What I would do is throw an Exception whenever the command fails inside the command function. Than catch that exception where you call the command function and if you catch it ignore the cooldown.

woeful pike
eternal elbow
earnest phoenix
#

sAME @woeful pike but i am still with my bot

spare badger
unkempt shoal
#

who got the script for tower defense simulator?

stiff lynx
#

What do you think?

unkempt shoal
#

bruh please answer me

earnest phoenix
#

@spare badger I put the topgg api code in my bot index.js file and when i run it it says it posted but i cant see it on the top.gg page

spare badger
eternal elbow
woeful pike
earnest phoenix
#

Do i need to put my top.gg token in the authorization field in the webhooks page

#

@spare badger ??

spare badger
stiff lynx
woeful pike
#

can you like read for once instead of bombarding this dude with questions

spare badger
earnest phoenix
#

Not showinng server count on top.gg page

eternal elbow
earnest phoenix
#

^-^

spare badger
stiff lynx
#

my cooldown is in abeg command

stiff lynx
#

how can I change this

spare badger
#

You mean change the number? I think I don't understand you hahaha

earnest phoenix
#

It WORKDED!

#

YES

#

IT WORKED

spare badger
#

@earnest phoenix 🎊

earnest phoenix
#

THANKS SO MUCH

#

❤️

spare badger
#

Happy to help.

stiff lynx
#

As I seed my english is a little bit trash, I mean, if I do the thing with the const how I reset the cooldwon?

spare badger
#

@earnest phoenix Did you change anything or did it just take a few minutes to update?

stiff lynx
spare badger
#

@stiff lynx So how your codebase is working is that every command has a fixed cooldown. Whenever the command runs, the cooldown is applied. You have to change the logic of applying that cooldown. You should only apply it when the command is actually valid.

#

You could also add an extra function for every command that validates the command before running the actual command handler function. If the validation fails, you then just don't add the cooldown.

stiff lynx
#

mind blowing

spare badger
#

Hahaha sorry man I'm not sure how to explain it any easier. It's just coding really.

earnest phoenix
#

I started the server

#

It not work

spare badger
#

Thanks. Good to know for next time.

earnest phoenix
#

then i restarted

#

it worked

earnest phoenix
#

-botinfo 834716873706569769

gilded plankBOT
#
Bot info
ID

834716873706569769

Username

Danker

Discriminator

9256

Short Description

Danker is a Dank memer Community Customizible Bot! It has Many Commands! For More information on the command categories, visit our website!

Library

undefined

Prefix
Total Upvotes

4

Monthly Upvotes

2

Server Count

16 Servers | 1 Shards

Owner(s)

@ripe wigeon

earnest phoenix
#

Nice

opal plank
#

@quartz kindle IT WORKS! YES

stiff lynx
spare badger
earnest phoenix
opal plank
#

who wouldnt use ts

earnest phoenix
#

me

#

I dont understand it

#

much

opal plank
#

not part of the cool kids then

spare badger
#

I really should start using Typescript on all my projects.

earnest phoenix
#

Lmao

opal plank
#

ts just makes js a lot safer

#

no more fixing bugs for the rest of your apps lifespan until someone accidently triggers it

#

you can rely on ts to screech at you for writing something wrong

uncut swallow
#

-botinfo

gilded plankBOT
#

tickNo Please include a bot mention or ID

stiff lynx
spare badger
#

Good luck!

stiff lynx
#

tysm, now I'm gotta go ❤️ love you all

woeful pike
#

here's an example of how typescript can make your life easier btw. If I spell the name of translation wrong the app will fail to build instead of me discovering the error in production @spare badger

spare badger
#

I use Typescript for some projects! But I'm always too lazy to setup the development environment for it. These kind of features really show me I should just ditch regular NodeJS 🤔