#development

1 messages ยท Page 1593 of 1

toxic jolt
#

how pls help

pale vessel
#

Just require("fs").writeFileSync("./backup.json", JSON.stringify(db.all()));

toxic jolt
#

i how to make

#

json to sqlite

pale vessel
#

Just db.set() everything back

toxic jolt
#

yeeeee

pale vessel
#

Loop through your data

toxic jolt
#

its not worked

quartz kindle
#

that doesnt mean it didnt work

toxic jolt
#

tiiiiim โค๏ธ

quartz kindle
#

check if there is a backup.json file

toxic jolt
#

thanks for helpp UwU

toxic jolt
#

i create backup.json

earnest phoenix
#
<style>
.entity-header__image {
	border-radius: 50% !important;
    border: 3px solid gold;
    animation: float 5s ease-in-out infinite;
}
  
@keyframes float {
  0% {
    box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
    -webkit-transform: translatey(0px);
            transform: translatey(0px);
  }
  50% {
    box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2);
    -webkit-transform: translatey(-30px);
            transform: translatey(-30px);
  }
  100% {
    box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
    -webkit-transform: translatey(0px);
            transform: translatey(0px);
  }
}

.entity-wrapper {
	width: 100%;
    height: 100vh;
    overflow: scroll;
    overflow-x: hidden;
    background: url('https://i.imgur.com/ZDLjyv1.jpg
');
    background-repeat: no-repeat;
    background-size: cover;
    scrollbar-width: none;
}

.entity-wrapper::-webkit-scrollbar {
	display: none;
}

body{
	scrollbar-width: none;
}

body::-webkit-scrollbar {
	display: none;
}

#menu {
	background: transparent;
}
.entity-content__description {
	background: transparent !important;
    border: none;
}

.entity-content__divider {
	display: none;
}

.entity-hint {
	display: none;
}

blockquote {
	background: linear-gradient(90deg, #363636 30%, #fff0 100%) !important;
}
</style>```
#

๐Ÿ‘€

toxic jolt
#

oh no its not worked

#

@quartz kindle please help

earnest phoenix
#

So?

toxic jolt
#

pls pls help me .c

earnest phoenix
#

Pls pls help me ;c

pale vessel
dawn yacht
#

How I can make a voting reward :D

#

Okay

pale vessel
quartz kindle
#

also, where is your bot hosted? heroku/glitch?

frozen rock
#

hello guys

#

has anyone got "slowmode" code?

earnest phoenix
#

what is "slowmode" code

frozen rock
#

you know, discord chats has a slowmode

slender thistle
#

what library, what programming language

pale vessel
#

Context.GetMessage().GetChannel().SetRateLimitPerUser(5000);

frozen rock
#

i want this code for my dc bot

slender thistle
#

have you tried searching the documentation for your library

slender thistle
#

have you tried searching google first

marble juniper
#

read
the
docs

frozen rock
#

yeah

#

i found but

earnest phoenix
frozen rock
#

when i write "a"

#

it says ok, slowmode is "a"

slender thistle
frozen rock
#

bad codes

#

will anyone help?

quartz kindle
#

its not bad codes lol

#

its just code that you didnt understand how to use

#

which library are you using?

slender wagon
#

solved

toxic jolt
#

its here @quartz kindle

summer torrent
#

is it quick db

toxic jolt
summer torrent
#

ew

#

english

#

what Thonk

quartz kindle
#

now you can copy that from the console

#

and paste it in a json file

toxic jolt
#

okay thanks

summer torrent
#

are you ok dude

toxic jolt
summer torrent
toxic jolt
#
const hastebin = require("hastebin-gen");
 
// You can change the extension by setting the extension option
hastebin(db.all(), { extension: "sqlite" }).then(haste => {
    // Logs the created hastebin url to the console
    message.reply(haste) // https://hastebin.com/someid.txt
}).catch(error => {
    // Handle error
    message.reply('upps. error : ' + error)
});```
#

or use this code

quartz kindle
toxic jolt
#

okay lets do it ๐Ÿ˜„

#

i dont use

#

anymore one drive.

pale vessel
#

Hopefully the string isn't purged by the console

toxic jolt
#

NONONO

pale vessel
#

YES YES YES

toxic jolt
#

oh ... its not eval

pale vessel
toxic jolt
#

howww

#

omg ...

pale vessel
#

Why hastebin?

toxic jolt
#

hmm

#
const fetch = require("node-fetch");

module.exports = async (input, options = {}) => {
    if (!input) throw new Error("Input is a required argument");

    if (typeof options === "string") options = { url: "https://hastebin.com", extension: options };

    const url = "url" in options ? options.url : "https://hastebin.com";
    const extension = "extension" in options ? options.extension : "js";

    const res = await fetch(`${url}/documents`, {
        method: "POST",
        body: input,
        headers: { "Content-Type": "text/plain" }
    });

    if (!res.ok) throw new Error(res.statusText);

    const { key } = await res.json();

    return `${url}/${key}.${extension}`;
};
#

hmmm

toxic jolt
pale vessel
#

You shouldn't be exporting user data to public bins

small tangle
#

I'm having trouble implementing a ReactionListener with the JDA API for Discord. I want to use reactions as confirmation to a question and then set a listener to this message, which then receives the confirmation via Reaction.

toxic jolt
#

how

pale vessel
#

Try evaling js require("fs/promises").writeFile("./backup.json", JSON.stringify(db.all())).then(() => console.log("Done"));

toxic jolt
#

thanks so much

#

okay

fluid basin
#

=?

toxic jolt
#

Should I create a file named backup.json?

#

@woeful pike nice music

pale vessel
toxic jolt
#

done

#

but i dont see

#

any backup.json

fluid basin
#

running bot on windows vps be like

thorny flume
pale vessel
#

Actually, your bot main folder

#

Look in both

toxic jolt
pale vessel
#

Try searching for "backup.json"

toxic jolt
pale vessel
#

thonk

toxic jolt
#

omg its so hard

pale vessel
#

I guess your only option is to bin it...

pale vessel
# toxic jolt omg its so hard

Eval js require("node-fetch")("https://paste.mod.gg/documents", { method: "POST", body: JSON.stringify(db.all()) }).then(x => x.json()).then(({ key }) => console.log(`https://paste.mod.gg/${key}`));

fast edge
#

No offence

pale vessel
#

lol

#

F

toxic jolt
#

no its here but

#

why

#
const Discord = require('discord.js');
const client = new Discord.Client();
const bot = new Discord.Client();
const {RichEmbed} = require('discord.js');
const { promisify } = require("util");
const readdir = promisify(require("fs").readdir);
const chalk = require('chalk');
const fs = require('fs');
const { stripIndents } = require('common-tags');
const moment = require('moment');
const { Client, Util } = require('discord.js');
const db = require('quick.db');
const Jimp = require('jimp')```
#

omg only this modules

#

its so hard

#

OMG I HOW TO SEND TXT

#

@pale vessel send txt

pale vessel
#

hmm

toxic jolt
#

yes ๐Ÿ˜„

#
const fs = require('fs');

case 'changelog':
  const path = "./Storage/fileName.txt";
  const content = fs.readFileSync(path, 'utf-8');
  message.channel.send(content);
  break;```
#

i find this code

pale vessel
#

What library are you using?

toxic jolt
#

discord.js v12

#

quick.db

quartz kindle
#

can you show this?

#

console.log(process.cwd())

earnest phoenix
#

@bot.command(pass_context = True)
async def missing(ctx, channel : str = None, useDiscordID : bool = False):
memberlist = []
for member in message.server.members:
toAppend = ''
if "barcode" in [y.name.lower() for y in member.roles]:
if member.nick is None:
toAppend = member.name
else:
toAppend = member.nick
if useDiscordID:
toAppend = f'{str(member)} : {toAppend}'
memberlist.append(toAppend)

#

is this the code

pale vessel
toxic jolt
earnest phoenix
#

for getting all the members in a guild?

#

is there are error?

#

please?

pale vessel
#

message.server?

#

Isn't it message.guild?

earnest phoenix
#

can u reqrite the code?

pale vessel
#

No

earnest phoenix
#

@pale vessel

#

u sure that it is message.guild?

pale vessel
quartz kindle
#

idk whats going on then

#

looks fine

toxic jolt
#

ECONNRESET IS COMING TIMMM

#

PLEASE HELP

#

WHAT!!!!

#

ITS HERE TIMMMM

#

TIMMMMMMMM

quartz kindle
#

lmao

toxic jolt
#

look this tim

#

look this omggg

#

one drive is virus maybe

pale vessel
#

kekw

toxic jolt
#

yes

#

done!!!!!!!1

#

@pale vessel and @quartz kindle thanks so much

#

i love you guys

#

thanks for helping me

#

UwU

pale vessel
#

All good UwU

toxic jolt
#

its me now

#

its worked

outer perch
#

Date is what type?

umbral zealot
#

depends, either Object or Number

outer perch
#

Type 'Date' is not assignable to type 'number'.

umbral zealot
#

needs more context

outer perch
#

it's object

outer perch
#

const currentdate : object = new Date()

pale vessel
#

date is date

outer perch
#

this gives no errors

umbral zealot
#

Right, because everything is an object technically

#

But TS is extremely anal

#

What's asking you for a number? You can probably just get the number (timestamp) from the date to satisfy it

#

just do currentdate.getTime() to get that sweet numeric timestamp

outer perch
#
const currentdate : object = new Date(),
    relationship : object = new Date(2019, 11, 28);
const mili = currentdate - relationship;
#

used to work without the type

#

now it says it has to be number xDD

#

or any

umbral zealot
#

Right, because TS. You wanna use TS, you're going to have to learn to suffer through this sort of absolutely anal retentive typing, that's literally what TypeScript is - it's in the name!

outer perch
#

yeah

#

no problems

#

I like this

umbral zealot
#

So actually currentDate can be Date.now() and then relationship.getTime(), both of those give you numbers.

#
const currentDate = Date.now();
const relationship = new Date(2019, 11, 28);
const mili - currentDate - relationship.getTime();
#

add your type thingies and you should be good

outer perch
#

hmm

quartz kindle
#

Date is a built in type in ts isnt it?

outer perch
#

getTime() doesn't work on objs

quartz kindle
#

currentdate: Date = new Date()

outer perch
#

TRUE

umbral zealot
#

But it works on Dates

outer perch
#

I did date, not Date

#

๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

quartz kindle
#

you are a date

outer perch
#
const currentdate : Date = new Date(),
    relationship : Date = new Date(2019, 11, 28);
const mili = currentdate.getTime() - relationship.getTime();
#

it's good this way

#

this always worked like this, but rewriting to TS, it now gives me a problem

#

maybe it's the name?

umbral zealot
#

requires should always be at the very top of the file

outer perch
#

hmm

#

wait, if I delete the line

#

it doesn't get any error

#

like eventsource was built in or something

#

in JS it's not

cinder patio
outer perch
#

so idk why I declared it

cinder patio
#

But not in node.js - you probably haven't configured ts properly

tribal siren
#

helo

#

anybody need help?

outer perch
#

hope you finish that Geometry Dash SDK

#

I'd really like people to know I'm playing Deadlocked or something

tribal siren
#

ty

eternal osprey
#

hey guys

#
 let msg = await message.channel.send(exampleEmbed);
                        const reactionEmoji1 = "x";
                        const reactionEmoji2 = "white_check_mark";
                      
                      await msg.react(reactionEmoji1);
                      await msg.react(reactionEmoji2);
``` why is this returning invalid discord emoji error?
crude light
#

So uh I just got the ability to get my bot verified on discord and it requires an id/passport and I'm under 18 so is that a problem?

cinder patio
#

\โœ…

#

\โŒ

outer perch
#
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "out",
    "sourceMap": true,
    "strict": true,
    "allowJs": true,
    "esModuleInterop": true,
    "importHelpers": true,
    "strictNullChecks": true,
    "experimentalDecorators": true,
    "noImplicitReturns": true,
    "noImplicitAny": true,
    "lib": ["ES2020", "DOM"],
    "declaration": true,
    "watch": true,
    "baseUrl": ".",
  },
  "include": ["src/**/*.ts", "commands", "globals"],
  "exclude": ["node_modules", ".vscode", ".env", ".eslintrc.json"]
}
#

I just changed include and exclude a bit

cinder patio
#

Try removing "DOM" from lib

outer perch
#

nothing changed

cinder patio
#

Remove the whole lib property

eternal osprey
#

i have this too: ```js
trainers[targetMember.id].mons = [given1]
trainers[targetMember.id].spawnId = [given1.spawnId]
trainers[firstmember].mons = [given]
trainers[firstmember].spawnId = [given.spawnId]
fs.writeFileSync("./trainers.json", JSON.stringify(trainers), "utf8");

outer perch
eternal osprey
#

anyone know why? And how to fixt aht?

cinder patio
outer perch
#

done ๐Ÿ˜„

cinder patio
outer perch
#

ok, appeared

#

but I removed the lib from the config

cinder patio
#

so the problem was from the lib property?

outer perch
#

it points me there, cuz it's declared there already

#

so I shouldn't declare in my file

brittle fable
#

How would I get the top.gg voting webhooks as I never did it before? ablobthinkingfast

south bay
#

hi i make my bot in glitch my bot dont do nothing it errors only but idk how to stop that

lyric mountain
shy turret
#
const Console = require("./console.js");
const fs = require("fs");

module.exports.load = async function(app, docker) {
  app.post("/execute/:id", async (req, res) => {

    // Set the id variable.

    let id = req.params.id;
    let command = req.body.command;

    if (!command) return res.send({
      error: "Missing command."
    });

    if (typeof command !== "string") return res.send({
      error: "The command must be a string."
    });

    if (command.length == 0) return res.send({
      error: "The command must be greater than 0 characters."
    });

    // Gets the container and executes a command.

    let container = docker.getContainer(id);

    Console.addContainerMessage(id, "> " + command);

    container.exec({
      AttachStdin: true,
      AttachStdout: true,
      AttachStderr: false,
      Cmd: ["-it", "echo", command]
    }).then(exec => {
      exec.start( { hijack: true, stdin: true } );
    });

    res.send({
      error: "none"
    });
  });
};
#

well

#

im trying to make a execute command using dockerode

#

but it isn't working

#

specific part not working:

    container.exec({
      AttachStdin: true,
      AttachStdout: true,
      AttachStderr: false,
      Cmd: ["-it", "echo", command]
    }).then(exec => {
      exec.start( { hijack: true, stdin: true } );
    });
eternal osprey
#

i am trying to put a hexcode-emoji in winscp

#

but it gives me fucking ? signs

#

i tried inputting \โŒ

dusky sundial
#

Try using the unicode, so something like \u274C

eternal osprey
dusky sundial
#

Just google "Unicode for (the emoji you want to use)"

eternal osprey
#

โœ…

dusky sundial
#

It will give you something like U+274C, so just replace the U+ part with \u

eternal osprey
#

ah so \u2705

dusky sundial
#

Yeah, not sure if it will work. But you can try :)

eternal osprey
#

Will try anyway

lyric mountain
#

it will

cinder patio
#

my question is why are you using winscp to write files to your vps

smoky herald
#

client.users.fetch("userID") throws this error, if I use JS encodeUri() it throws error "is not a snowflake," how do I solve the first error while still having the right path for the user object?

cinder patio
#

write them on your own PC and then just transfer em

pale vessel
#

or git lmao

cinder patio
#

even better

pale vessel
#

not usernames

#

if you want to search, use the chunk guild members ws operation

quartz kindle
#

a user id looks like this: 441691703821467669

smoky herald
# pale vessel use IDs

I'm inserting ID in the fetch request, but it throws error (when recieving back the username with weird characters I guess?)

cinder patio
#

show your code

pale vessel
#

Make sure it's a valid ID and catch your requests

quartz kindle
#

which is not an id

smoky herald
#

solved, thank you
I'm replacing the user ID I'm searching for with the username after it fetches, the problem was I was increasing a count variable before rewriting the user ID so it was fetching twice (the second one with username already)

quartz kindle
#

๐Ÿ‘

eternal osprey
#

hey

#

why am i not able to collect with this: js const filter3 = z => z.content.startsWith('+') && message.authour.id == targetMember.id

pale vessel
#

author

#

not authour

eternal osprey
#

no i know

#

that was just a typo

earnest phoenix
#

@client.command()
async def userinfo(ctx , member:discord.Member):

roles = [role for role in member.roles]

embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)

embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)

embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)

embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))

embed.add_field(name=f"Roles ({len(roles)})" , value=" ".join([role.mention for role in roles]))

embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)

await ctx.send(embed=embed)

#

is this correct for userinfo?

#

I don't get why you copy the role list

#

member.roles is already a list, no need to create a new list out of that doe

#

ohk

#

can u just copy the code and do the editings?

lyric mountain
#

Thelegendarymonster suddenly became thelegendaryspoonfeed

earnest phoenix
#

No, basically just remove the list comprehension, the roles = ... line, instead, access the member's roles attribute directly. What's the issue though?

#

ohk

#

@client.command()
async def userinfo(ctx , member:discord.Member):

embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)

embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)

embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)

embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))

embed.add_field(name=f"Roles ({len(roles)})" , value=" ".join([role.mention for role in roles]))

embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)

await ctx.send(embed=embed)

#

like this?

#

Great, now roles is not defined.

#

still there's a prob

#

!

#

What's the issue though?

lyric mountain
#

...he did think you meant "yes, that's correct"

earnest phoenix
#

it's not showing the userinfo when I type the command for it!

#

can u check if that's completely correct?

lyric mountain
#

roles not defined = error

earnest phoenix
cinder patio
earnest phoenix
#

Send the traceback if there's any

#

can u atleast check the time format?

lyric mountain
#

...what does timeformat has to do with this?

earnest phoenix
#

there's no error showing

lyric mountain
#

because u didn't define roles

earnest phoenix
#

but the command is not showing!

lyric mountain
#

you can't access a variable that doesn't exist

earnest phoenix
#

then should i paste the code that i removed from?

lyric mountain
#

no

earnest phoenix
#

can u write the code here?

lyric mountain
#

also no

#

u just need to change roles to member.roles

earnest phoenix
#

@client.command()
async def userinfo(ctx , member:discord.Member):

member.roles = [role for role in member.roles]

embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)

embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)

embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)

embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))

embed.add_field(name=f"Roles ({len(roles)})" , value=" ".join([role.mention for role in roles]))

embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)

await ctx.send(embed=embed)

#

is this correct?

lyric mountain
#

๐Ÿ˜ฉ

earnest phoenix
#

No

#

Why would you ask in the first place if you're not gonna listen to what people tell you?

lyric mountain
earnest phoenix
#

sorry!

#

ohh u mean that role

lyric mountain
#

roles does not exist without that first line

earnest phoenix
#

oh yes

lyric mountain
#

also, u sure you're not getting ANY error?

earnest phoenix
#

why I didn't thnk it

lyric mountain
#

...because u wanted a ready solution

earnest phoenix
#

You may suppress the error or something

slender thistle
#

[x for x in some_list] is possibly the most basic and redundant code you could've ever written

earnest phoenix
#

Not if you want to copy the list intentionally

#

Though copy method exists

slender thistle
#

Well, in this case*

slender thistle
#

kinda yes

earnest phoenix
#

still not working!

lyric mountain
#

no error?

earnest phoenix
#

no error

#

yep!

#

what to do then?

#

I hope the indentation is just because of discord mobile formatting

lyric mountain
#

put print("Hello World") in the first line inside command block

#

see if it prints to the console

earnest phoenix
#

yep! it printed

#

will i just copy all the code and paste it over again?

lyric mountain
#

no

earnest phoenix
#

then?

#

what is the error then?

lyric mountain
#

@earnest phoenix any idea?

earnest phoenix
#

is my code correct?

#

@lyric mountain can u please check if my code is completely right?

lyric mountain
#

I'll not be able to do much besides normal python stuff

#

i never used that lib

copper cradle
#

just send your goddamn code

earnest phoenix
copper cradle
#

somebody will check it eventually

earnest phoenix
lyric mountain
earnest phoenix
#

You want to actually instantiate an Embed object instead

#

Also fix the roles issue.

copper cradle
earnest phoenix
#

@client.command()
async def userinfo(ctx , member:discord.Member):

roles = [role for role in member.roles]

embed=discord.embed(colour=member.colour ,timestamp = ctx.message.created_at)

embed.set_author(name = f"User info - {member}")
embed.set_thumbnail(url = member.avatar_url)
embed.set_footer(text = f" requested by {ctx.author}", icon_url = ctx.author.avatar_url)

embed.add_field(name = "ID:" , value=member.id)
embed.add_field(name = "Guild name:", value=member.display_name)

embed.add_field(name = "Created at:" , value=member.created_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))
embed.add_field(name = "Joined at:" , value=member.joined_at.strftime("%a,%d %B %Y %I:%M %p:UTC"))

embed.add_field(name=f"Roles ({len(member.roles)})" , value=" ".join([role.mention for role in roles]))

embed.add_field(name="Top Role:",value=member.top_role.mention)
embed.add_field(name="Bot?",value=member.bot)

await ctx.send(embed=embed)

#

this is it!

slender thistle
#

discord.Embed

earnest phoenix
#

what to change?

slender thistle
#

discord.embed is file
discord.Embed is a class

#

you want the class

#

not the file

earnest phoenix
#

yep!

#

should i change the embed into Embed?

#

just?

#

Tias

#

What do you mean?

#

Try it and see.

#

ohk

copper cradle
#

if I tell you to change embed to Embed, what do you think you should do

#

should you:
a) start a new project
b) change embed to Embed

earnest phoenix
#

are u asking me?

#

They're asking me, dw

#

ohk!

copper cradle
#

you can't make up this crap

earnest phoenix
#

the command is shown in the help box but is not working!

#

Who to blame

copper cradle
#

wait, is that command in a class?

earnest phoenix
#

I don't think so

copper cradle
#

if that's the case then you forgot to pass in self but that's prolly not the case

earnest phoenix
#

then what to do?

copper cradle
#

first answer my question

#

is that command inside a class?

earnest phoenix
#

You've been told doe

copper cradle
#

norizon, who u talkin' to

earnest phoenix
#

the legend

#

how to check if that's in a class?

pale vessel
icy skiff
#

Bro do u even code?

earnest phoenix
#

I am a little new to it!

icy skiff
#

That makes sense

#

Advice tho

#

Try getting more experience at it before making a discord bot

copper cradle
#

^

copper cradle
#

show your entire file

earnest phoenix
#

that site is not available!

copper cradle
#

what

earnest phoenix
#

The issues are just it's supposed to be discord.Embed and roles is not defined.

copper cradle
#

oh wait, wrong url lmao

zenith terrace
pale vessel
zenith terrace
#

Sad

silk wadi
#

is PloxHost a good hosting website?

pale vessel
#

For a discord bot?

silk wadi
#

Yes

lyric mountain
pale vessel
#

If you need a hosting, make sure it's a VPS

#

Not some kind of panel

silk wadi
pale vessel
#

Yeah, don't get those

silk wadi
#

alr

#

Could you suggest me some VPS'?

pale vessel
#

They're usually bad and you have limited control

silk wadi
#

I tried DigitalOcean but I can't get my head around it

pale vessel
silk wadi
#

Alr thank you

lyric mountain
silk wadi
#

lmao

earnest phoenix
#

unlimited memory

lyric mountain
#

time to cache the internet

earnest phoenix
#

the whole internet lol

lyric mountain
#

imagine making a RAM nuke then getting "Out of memory" then asking for refund

silk wadi
#

for Contabo

#

They offer different setup fees based on how long

#

So if I go for 12 months with โ‚ฌ0 setup fee

#

will I still pay โ‚ฌ4.99 a month?

#

rather than paying a setup fee of โ‚ฌ4.99

#

for just one month

pale vessel
#

โ‚ฌ4.99 without setup free

#

โ‚ฌ4.99 without โ‚ฌ4.99

#

lulw

copper cradle
#

probably not, but who am I to judge yk

#

probably not, but who am I to judge yk

#

finally

pale vessel
#

No setup free

silk wadi
#

alr thank you

fair axle
#

How can I check is player kicked or left?

quartz kindle
#

why even charge a setup fee if most vps's are automated

fair axle
#

I used audit logs but I can't check the time

eternal iron
#

Gift me an VPS qt_smile

fair axle
#

It is triggering an old kick

eternal iron
#

So sad my Bot got declined so long ago maybe 1 month

icy skiff
pale vessel
#

DO is overpriced tbh

icy skiff
#

True

quartz kindle
#

DO HAST

icy skiff
#

GalaxyGate>>

silk wadi
#

what does bitvise do? @icy skiff

icy skiff
#

Its a way to manage ur VPSs

#

In a simpler way

pale vessel
#

Isn't that just an SSH client?

icy skiff
#

Yep

earnest phoenix
#

what are bivise pros over putty

pale vessel
earnest phoenix
#

do free hosting of ur bot

copper cradle
#

just use your builtin ssh client, unless you're on windows

icy skiff
earnest phoenix
#

Bot Developers channel is almost useless

pale vessel
#

Windows has one iirc

quartz kindle
#

or use terminus if you want to be fancy

pale vessel
#

But I think it was ass

icy skiff
#

bitvise has a fancy user interface tho

copper cradle
#

hmmm

earnest phoenix
#

I might stream me coding boring java in that bot dev voice channel LUL

pale vessel
#

Yes

icy skiff
#

U can mess with the files like you would in ur file Explorer

quartz kindle
icy skiff
#

Not that

#

Its not a terminal

#

Its literally a GUI

quartz kindle
earnest phoenix
icy skiff
#

This is what I'm talking about, but its an old version, the New one is prettier

quartz kindle
#

thats just ftp

icy skiff
#

I just got that image from Google lol

earnest phoenix
#

dude is that win95

#

lmao

icy skiff
earnest phoenix
#

ss quality is also like win95

icy skiff
earnest phoenix
#

Let's give a moment of silence for the people who have an API with 403 error code in json but not as HTTP header.

#

429 wigglepensive

quartz kindle
#

i mean, if you want ftp just use something like filezilla

#

i use ftp inside visual studio so i dont even need it

icy skiff
#

Fancy

#

Is It a plugin

quartz kindle
#

yeah, sftp

icy skiff
#

Ty ill look it up

quartz kindle
earnest phoenix
#

looking good

#

but the fact that it's VSC is hurting my eyes (for me) x)

icy skiff
#

How does it work, u change the file on ur Pc and it automatically updates the file in the vps?

earnest phoenix
#

well for js coding VSC is probably one of the best so yea 9_Shrug

crimson vapor
#

what is the best way to send a huge array in a get request?

#

I am thinking about stringifying the array then encoding it as a component

quartz kindle
quartz kindle
#

if you want performance/small size, zlib it

icy skiff
crimson vapor
#

either most efficient or standard

#

idk if small size is the issue as long as I can actually send this as a get request

quartz kindle
#

for get requests you have to put it in the url

#

like query params

crimson vapor
#

yea

quartz kindle
#

get with body is possible but not standard

crimson vapor
#

on express ima do /path/:data

quartz kindle
#

yes

crimson vapor
#

or /path?data=

quartz kindle
#

so just stringify it

crimson vapor
#

depending on which is better

quartz kindle
#

lmao

lament rock
#

gotta be careful of having too long of a uri

crimson vapor
#

yea ik

quartz kindle
#

you might get a smaller file size if you base64 it

crimson vapor
#

perhaps

lament rock
#

Honestly, I'd probably just make a post req since post has body

crimson vapor
#

maybe

#

but I want to respond with a canvas

quartz kindle
crimson vapor
#

and it seems like a shitty idea to make a post request return with canvas

quartz kindle
#

lmao

crimson vapor
#

yeah im testing

quartz kindle
#

dont send the full avatar urls

#

send only the avatar id

lament rock
#

It could return a Buffer, then you could construct a canvas from that buffer. No memory overhead depending on if canvas clones the buffer or not

crimson vapor
#

ah smart

#

I can't use canvas on the bot process if thats what you mean

quartz kindle
#

an image response can be downloaded as a buffer

#

so its fine if you respond with image/png

crimson vapor
#

im just sending the canvas buffer

lament rock
#

yea

crimson vapor
#

so a post request is a good idea?

quartz kindle
#

eitherway works

#

but try the get without the full urls

lament rock
#

at that point, I'd probably just implement a rest lib for the image worker to make the post to Discord itself

quartz kindle
#

only avatar ids

lament rock
#

You'd also need user IDs, no?

#

Bot makes req to image worker to create canvas > worker sends back buffer of canvas > bot sends image to discord

crimson vapor
#

I would need userID and avatar

#

yeah thats what im doing as of now

quartz kindle
#

instead of using JSON.stringify

#

build your own string

#

id:avatar,id:avatar,id:avatar

#

or similar

lament rock
#

bandwidth could be saved if the worker sent the image directly instead of sending it to the bot then the bot sending it. Rest is stateless

crimson vapor
#

yeah

#

I can't do that as I don't want to be forced into keeping this online always

willow mirage
#

How to convert this bitfield

['SEND_MESSAGES', 'SEND_TTS_MESSAGES', 'ADD_REACTIONS', 'EMBED_LINKS', 'ATTACH_FILES']
crimson vapor
#

not like online

#

if I shutdown the project everything would 404

quartz kindle
lament rock
#

Why would you make it in the first place if you didn't mean to keep it online

willow mirage
#

ok thx

crimson vapor
#

just the shutdown part

#

if I stop this project

#

I don't want 404s

lament rock
#

having a separate thread for image generation is a good idea tho

crimson vapor
#

its on the main process

#

but yeah

lament rock
#

oh

crimson vapor
#

like

#

the bots on a thread

#

the canvas process is the main one

lament rock
#

ohhhhhhh

#

I see

crimson vapor
#

I could make a worker thread but im not familar with that

#

problem is that I think you can only have 1 canvas thread at a time

lament rock
#

worker threads are pretty easy to get a grasp of

#

Nah. You could have inf

crimson vapor
#

I was getting an error

stark abyss
#
     const updateClanInfo = {
        text: "UPDATE  claninfo SET (clan, entryfee, fee, role, due)values($1, $2, $3, $4, $5);",         values: [clanID, entryFee, fee, role, due]    
     }

pool.query(updateClanInfo, (err) => { if(err) return console.log(err + " | setup clan exist query")})  

error: syntax error at or near "values" | setup clan exist query

lament rock
#

I think it'd be better to make 1 process which acts as a web server for a image worker

toxic jolt
#

he saying undefined

#

any time

crimson vapor
#

yeah ill end up doing something like that

pale vessel
#

php moment

crimson vapor
#

for now it should be fine tho

toxic jolt
lament rock
#

ye

toxic jolt
#

im making virtual pos

#

but api is not working

#

here my code

#
console.log('Paket: ' + paket)
console.log('userid: '+ userid)```
#

why not working

pale vessel
#

Is that PHP or Node.js?

toxic jolt
#

post get: node.js

#

post send: php

pale vessel
#

Oh

#

Why

toxic jolt
#

discord bot

pale vessel
#

You don't send it like that

crystal wigeon
#

hey

toxic jolt
#

its not working ๐Ÿ˜„

crimson vapor
#

@lament rock should I return a json or a buffer for the post request?

earnest phoenix
#

Buffer I would personally use

copper cradle
#

Pudochu please learn how php works ffs

crimson vapor
#

alr

#

I love when body is empty

#

thats my favorite

stark abyss
copper cradle
#

isn't it INSERT INTO (X, X, X) VALUES (X, X, X)

#

I don't really know

outer perch
#

@opal plank do you know a fix?

cinder patio
#

Shouldn't excluding node_modules fix that?

outer perch
cinder patio
#

Try /node_modules

#

or ./node_modules/

outer perch
#

nothing

#

is it because TS is enabled globally?

opal plank
#

import it instead of requiring it

outer perch
#

wait, I don't have ts@docs or whatever it is installed

opal plank
#

and do it at the top

outer perch
#

ah, k

opal plank
#

i had a small suspicion you were portuguese, not gonna lie

outer perch
#

๐Ÿ‡ต๐Ÿ‡น tho, not ๐Ÿ‡ง๐Ÿ‡ท

opal plank
#

nono

#

not that

#

import EventSource from 'eventSource'

#

es6 syntax

outer perch
#

LOL

#

๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

#

I thought that was a weird design

opal plank
#

import() works too but its async, so, use the normal es6 syntax

outer perch
#

done, and fixed

opal plank
#

now try running it

#

see if that helps

outer perch
#

I wasn't acquainted

#

now I am

opal plank
#

none of us start knowing everything

#

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

#

its a slow progression

lyric mountain
outer perch
opal plank
#

yeah install the types

#

with the command it suggests

#

npm i @types/eventSource

outer perch
#

aight

#

what about all types?

#

should be a problem

opal plank
#

wdym all types?

outer perch
#

wasn't there a way to get every type?

#

maybe I'm confused

opal plank
#

using the command it shows

#

that'll install the types if theres a types file for it

outer perch
#

npm install --save @types/npm

opal plank
#

throw that command into your terminal

#

not that one

outer perch
#

aight, just to know

opal plank
#

this one

#

how has ts been treating u so far?

outer perch
#

simple

#

says "there's a problem here", and I go there and change things

opal plank
#

what problem?

outer perch
#

talking in general

opal plank
#

oh, yeah, thats ts

outer perch
#

like implicit types

#

what I found weird is the arrow functions

opal plank
#

what about em?

outer perch
#

says the type is implicit

#

but when I explicit the type, gets worse

#

xD

opal plank
#

you can explicitly state it tho

#

(param:type):returns => {//code}

outer perch
#

let me check my functions again

opal plank
#

for example

outer perch
opal plank
#

thats not required

#

you didnt do allowJs

outer perch
#

I did

outer perch
opal plank
#

are you exporting them?

outer perch
#

from something that hasn't my vars

#

not that

opal plank
#

oh

steel arch
#

How do i do to make an code in HTML who says if my BOT is online or not?

opal plank
#

its helpers isnt it?

outer perch
opal plank
#

add those

#
    "esModuleInterop": true,
    "importHelpers": true,```
outer perch
#

config isn't in './config.json', so I don't import I guess

outer perch
#

I copied your config, remember?

opal plank
#

oh yeah

outer perch
#

๐Ÿค”

opal plank
#

so you got "module": "commonjs",
"moduleResolution": "node", those too?

outer perch
#

yeah

opal plank
#

hmmm theres no reason it should be bitching about it then

outer perch
#

the only thing I changed was removing DOM from "lib":

#

and swapping ES2019 with ES2020

opal plank
#

hmmmmm

mellow kelp
#

Try changing to import

#

Maybe that works?

outer perch
#

which line?

blissful coral
outer perch
mellow kelp
#

Yeah

blissful coral
#

Anyone know what I need to change in express for my CSS to work?

mellow kelp
#

Oh another thing

mellow kelp
#

To import json files you need resolveJsonModule

outer perch
#

does't it import all of the object?

outer perch
mellow kelp
#

Yeah it imports the json as an object or array

#

But you need that flag enabled

blissful coral
#

What part of it do you need

outer perch
#

it's in the root folder

opal plank
#

do

#

erm

blissful coral
#

This?

opal plank
#

eval process.cdw()

outer perch
#

wait, who

opal plank
#

process.cwd()

blissful coral
#

me?

opal plank
#

no

outer perch
#

me?

opal plank
#

yes

outer perch
#

let's all ask 'me'

opal plank
#

run ur bot and console.log(process.cwd())

outer perch
#

ah k

blissful coral
#

Yes

outer perch
#

after the login?

opal plank
#

most top one

blissful coral
mellow kelp
#

Why

#

Body parser

blissful coral
mellow kelp
#

express.json()

#

Poof

fluid basin
#

tbh if you're using express, since express 4.x the body parsing middlewares are part of express itself

mellow kelp
#

No extra requires

outer perch
#
const currentdate : Date = new Date(),
      ^^^^^^^^^^^

SyntaxError: Missing initializer in const declaration
โ†[90m    at wrapSafe (internal/modules/cjs/loader.js:1001:16)โ†[39m
โ†[90m    at Module._compile (internal/modules/cjs/loader.js:1049:27)โ†[39m
โ†[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)โ†[39m
โ†[90m    at Module.load (internal/modules/cjs/loader.js:950:32)โ†[39m
โ†[90m    at Function.Module._load (internal/modules/cjs/loader.js:791:14)โ†[39m
โ†[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)โ†[39m
โ†[90m    at internal/main/run_main_module.js:17:47โ†[39m
``` @opal plank
#

xD

opal plank
#

what did it log before that?

outer perch
#

nothing

opal plank
#

huh/

copper cradle
#

isn't that error wrong

mellow kelp
#

Why you typing a date tho

outer perch
#

C:\Users\ragsf\Desktop\Gumball-and-Penny\index.ts:57

#

this

opal plank
#

how did u run your command?

#

index

copper cradle
#

as far as I can see there's nothing wrong with that code

opal plank
#

or whatever

outer perch
opal plank
#

im assuming you did node

outer perch
opal plank
#

well yeah of course it'll error

#

node cant run .ts

#

only .js

outer perch
#

๐Ÿ˜ฎ

mellow kelp
opal plank
#

you need to transpile first

#

or use ts-node

outer perch
#

woah

opal plank
#

npm i ts-node

#

then node -r ts-node/register index.ts

mellow kelp
#

ts should infer types of most variables

#

including constructors

outer perch
copper cradle
blissful coral
opal plank
#

what

mellow kelp
opal plank
#

what did i just read from u snails

#

implicit types is still typed

mellow kelp
#

type inference is literally everything

outer perch
#
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'typescript'```
opal plank
#

that does not defeat the purpose of anything

outer perch
#

o_O

opal plank
#

theres ur issue

#

install typescript locally

outer perch
#

I have typescript globally

opal plank
#

without the -g flag

mellow kelp
#

npm i -D typescript

outer perch
#

ah shit

mellow kelp
#

also as a dev dependency

outer perch
copper cradle
#

why should it infer the type?

mellow kelp
#

why not?

opal plank
#

NOW try it

mellow kelp
#

const date: Date = new Date()

#

what's the point of this

outer perch
#

node -r ts-node/register index.ts

opal plank
#

why would it make you write ```ts
const aString: string = 'blah'

#

instead of ```ts
const aString = 'string'

#

it knows aString is a string

#

explicitly typing it is redudant and stupid

outer perch
#

hmm

opal plank
#

fuck gotta go get food

#

brb

copper cradle
outer perch
#

whoops

mellow kelp
#

whoops

outer perch
#

implicitly has everywhere

#

woah

mellow kelp
#

im going to steal this gif

outer perch
#

xD

#

just write woah in the gif search

mellow kelp
#

o

#

wait where's crash

outer perch
#

idk

#

I wanted that one

mellow kelp
#

sad

outer perch
#

well, let's fucking gooo

#

goin' on an adventure with TS

quartz kindle
#

ew

#

who wants to fuck goo

#

also ew ts

#

:^)

outer perch
mellow kelp
#

the TS council will decide your fate

outer perch
#

idk, I just wanna learn something new

quartz kindle
#

what is TS to a non-believer

outer perch
slender thistle
#

shit

quartz kindle
#

xD

outer perch
#

And then I saw TS
Now I'm a non-beliver

slender thistle
#

I saw TS and straight up converted to nihilism

outer perch
#

woah

mellow kelp
#

at first i was like

#

what the heck is ts

#

why do i have to transpile everything

#

why is this thing so weird

outer perch
#

and then u thought, EVERY IDE COMPILES

mellow kelp
#

now i can't not use ts for everything

outer perch
#

can't not

mellow kelp
#

yes

outer perch
#

ik ik, it's correct

#

but it's funny

#

should I get rid from .eslint.json?

cinder patio
#

no

mellow kelp
#

at least if you don't use eslint

#

wait wasn't it called .eslintrc.json

outer perch
#

yes, I typed from memory

blissful coral
#

so I don't want to put the first 3 params in a function, (dont pass them) but I need to pass the 4th param that it requires which is options... How can I not pass the first 3 and skip the fourth

mellow kelp
#

but are you using eslint?

outer perch
mellow kelp
#

aight

#

then don't delete it

#

it's a configuration file for eslint

outer perch
#

but I am now using TS

mellow kelp
#

@typescript-eslint packages

outer perch
#
index.ts:114:19 - error TS7006: Parameter 'doc' implicitly has an 'any' type.

114     refP.get().then(doc => {
```wtf
#

what do I do in these situations?

cinder patio
#

Provide a type

#

(doc: SomeType)

outer perch
#

isn't doc a promise?

cinder patio
#

Then Promise<SomeType>

mellow kelp
#

you're using .then

#

so there's no need for that

cinder patio
#

yeah it's not a promise

grizzled raven
quartz kindle
#

yeah you can use void 0

#

a(void 0, void 0, void 0, 10)

cinder patio
#

or just undefined

quartz kindle
#

void 0 is shorter

grizzled raven
outer perch
#

TSError: โจฏ Unable to compile TypeScript:

quartz kindle
#

also, eslint complains about using literal undefined

cinder patio
#

const _ = undefined;
a(_, _, _, 10);

If you want it to be short

grizzled raven
#

lmao why

quartz kindle
#

Loll

cinder patio
#

rip

quartz kindle
#

jfc

mellow kelp
#

what's your tsconfig again?

grizzled raven
#
let u
a(u,u,u,10)
#

better

quartz kindle
#

^

grizzled raven
quartz kindle
#

was about to type that

#

lmao

outer perch
#
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "CommonJS",
    "moduleResolution": "node",
    "outDir": "out",
    "sourceMap": true,
    "strict": true,
    "allowJs": true,
    "esModuleInterop": true,
    "importHelpers": true,
    "resolveJsonModule": true,
    "strictNullChecks": true,
    "experimentalDecorators": true,
    "noImplicitReturns": true,
    "noImplicitAny": true,
    "lib": ["ES2020"],
    "declaration": true,
    "watch": true,
    "baseUrl": ".",
  },
  "include": ["src/**/*.js", "commands", "globals"],
  "exclude": ["node_modules", ".vscode", ".env", ".eslintrc.json"]
}
grizzled raven
#

great minds thiNk alike

mellow kelp
#

a.apply([...[Array(3)].fill(undefined), 10])

#

yes

grizzled raven
#

kinda hate hearing that saying but whatever lmao

cinder patio
#

You're not giving us the actual error

outer perch
#

example

#
TSError: โจฏ Unable to compile TypeScript:
index.ts:114:19 - error TS7006: Parameter 'doc' implicitly has an 'any' type.

114     refP.get().then(doc => {
                        ~~~
index.ts:123:21 - error TS7006: Parameter 'docP' implicitly has an 'any' type.

123                     refP.get().then(docP => {
                                        ~~~~
cinder patio
#

You have to explicitly specify the type

mellow kelp
#

yeah you need to annotate the type

grizzled raven
cinder patio
#

like I said..

mellow kelp
#

i was saying that you don't need Promise

#

not that you don't need a type

outer perch
pale vessel
#

surround it by ()?

outer perch
#

it's then, why doesn't it say it can't find

mellow kelp
#

you need parenthesis

outer perch
#

reeee

#

done

#

well, TS is a sophisticated JS

mellow kelp
#

yea

#

ts is js but done right

earnest phoenix
#

not working

pale vessel
#

y not

outer perch
earnest phoenix
#

null

mellow kelp
#

what's it supposed to do

pale vessel
#

fetch owner :c

outer perch
pale vessel
#

await guild.members.fetch(guild.ownerID)

outer perch
#

cuz when I do message: object

cinder patio
#

Doing variable: object is not a good practice

outer perch
#

hmm, so it should be any

cinder patio
#

no, that's even worse

outer perch
#

o_O

pale vessel
#

message is message smart

fair axle
#

is there a way to send message as txt if text length is greater than 1024 character?

slender thistle
#

if message is message:
message = message

slender thistle
outer perch
#

๐Ÿ˜”

#

would be out of context

cinder patio
#

You can also use classes and interfaces as types, not only primitive values

outer perch
#

so message is what?

cinder patio
#

So you'd do (message: Message), where Message is the discord.js exported message class

outer perch
#

so I can stick with something

lyric mountain
mellow kelp
#

or you could just let ts infer that message is a Message

#

discord.js has typings for events

outer perch
#

import { Message } from 'discord.js';