#development

1 messages · Page 81 of 1

earnest phoenix
#

All free hosting platforms are trash, if you want a cheap paid one you can have a look at Linode or Hetzner

wheat mesa
#

oracle's free VPS tier is okay for small (non-music) bots

earnest phoenix
#

And then Oracle comes out and terminates your account for reasons they don't even mention

wheat mesa
#

been hosting my small bot on there for about a year now, had no issues

#

Just saying I haven't had any issues with those things

#

checks bank account to find $42,673 in charges from oracle

earnest phoenix
#

Better than forgetting to turn off an AWS EC2 instance

wheat mesa
#

I moved off of the amazon free tier VPS because I was afraid of going over somehow and getting charged ten million dollars

spark flint
#

lmao

lyric mountain
#

contabo

neon leaf
#

is it possible to publish a message when in a news channel directly in the <NewsChannel>.send() ?

lyric mountain
#

yes, if the bot has permission to talk there

neon leaf
#

how would I publish it?

digital swan
deft wolf
#

Yes, u can await message.send() and then crosspost this message

#

I mean

msg = await channel.send("Lmao")
await msg.crosspost()
#

This should work

neon leaf
#

sure

#

thanks!

deft wolf
#

If u don't use await then u can do this that way

channel.send("Lmao").then(msg => {
msg.crosspost()
})
wheat mesa
#

don't fall into the .then pyramid of doom please

#

spare yourself the pain ahead of time

deft wolf
#

True

lyric mountain
#

then is fine if u respect the structure

neon leaf
lyric mountain
#
channel.send("stuff")
    .then(m => smth)
    .then(m => other thing)
    .then(m => whatever)
#

instead of calling thens inside thens

wheat mesa
#

you're assuming people aren't going to just throw a giant function inside of each .then

lyric mountain
#

excessive use of await defeats the purpose of async

neon leaf
#

well in most cases await makes alot more sense

#

like

lyric mountain
#

it still defeats the purpose of async

quartz kindle
#

you defeat the purpose of async

slender wagon
#

Is there a way to obfuscate c# like just a small part of code

earnest phoenix
slender wagon
#

That takes an entire .dll

#

I only want a small part

earnest phoenix
#

You can just input the part of the code you want to obfuscate and it'll do so

slender wagon
#

How would i input it if it only works with drag and drop

earnest phoenix
#

It works with individual files

slender wagon
#

Oh right

#

Ty

wheat mesa
#

why do you want to do that anyways

slender wagon
#

Moding something

wheat mesa
#

I don't see how obfuscation is relevant to that

slender wagon
#

Its complicated

#

But i promise its not for bad

wheat mesa
#

if you're trying to secure something, obfuscation doesn't secure anything

slender wagon
#

Ik

#

It will make it harder

#

So im ok with it

wheat mesa
#

...ok

compact pier
#

what is obfuscation btw?

spark flint
#

Obfuscation means to make something difficult to understand. Programming code is often obfuscated to protect intellectual property or trade secrets, and to prevent an attacker from reverse engineering a proprietary software program. - some site on google

sudden geyser
#

basically, to keep your code private even when people "have" it

wheat mesa
#

Hint hint: it doesn’t actually stop any prying eyes. Just discourages lazy people who don’t really care to try to deobfuscate it

sharp saddle
#
SyntaxError: Named export 'cancelSync' not found.```

got this when using Chakra-ui
sudden geyser
#

did you try searching the error on google?

sharp saddle
#

yes

#

tried all methods but nothing helps

earnest phoenix
sharp saddle
#

Nextjs

#

I just installed

earnest phoenix
#

And your code is?

sharp saddle
#

there's no code, it's just the start page example

earnest phoenix
#

It mentions a few things you need to do first

sharp saddle
#

well

#

This never happened

#

i can try to send all the error

earnest phoenix
#

And also tell us the steps you've actually followed

sharp saddle
# sharp saddle i can try to send all the error

the error (again sending)

SyntaxError: Named export 'cancelSync' not found. The requested module 'framesync' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'framesync';
const { cancelSync, getFrameData } = pkg;```
earnest phoenix
sharp saddle
#

yes

earnest phoenix
#

Apparently the framesync library Chakra UI uses got a breaking change which no longer works with NextJS

late pine
vestal finch
#

anyone here to answer a noob question ?

#

does discord Interactions need message content intent to work ? , i do store USER ID from one of my commands

does the input the user put for the command considered a message content?

sudden geyser
#

You don't need the intent to get input from commands

#

The intent is for listening for messages sent in a server

#

So if someone runs /msg text:hi you can get hi from it without the intent

vestal finch
#

Great .

#

Thank you so much .

craggy pine
#

Probably more of a #general question but it is sorta related to development since I'm asking how I should code something I guess.
https://scs.twilightgamez.net/gr9ct.png
If you were a user of a music bot, and you had these buttons (Probably at some point it will be proper buttons) how should users be able to interact with them?
Should only the song queue-er, admins, djs, server owners be allowed to use them (Besides stop since that closes the whole queue) or should I even restrict the other buttons to be owner, admin, and djs and even not let the queue-er have control?

I do currently have it set up that if the DJ role is set in the database then restrict all buttons besides ⭐ to owners, admins, and djs but I feel like haven't it not set could lead to people trolling if letting all users have free reign over the buttons otherwise. Thoughts?

wheat mesa
#

just restrict it to the person who queued the song and people with admin perms is what I'd do

#

also have a DJ only mode

craggy pine
#

I do have a DJ only mode

#
if(needsDJ && !getUser.permissions.has("Administrator") && !role) return
#

but it does seem the queue-er is the safer way

lyric mountain
#

A cool feature would be something like a "skip vote" button

craggy pine
#

I've considered it.

#

Most of this code is me going from prefix'd to slash

#

So I'm working out my already coded stuff then adding new

lyric mountain
#

Ah ic

#

Btw, doesn't perms have constants?

craggy pine
#

It does

#

you mean like instead of typing 'Administrator'

#

use a number

lyric mountain
#

Like, the actual constant, smth like Permission.ADMINISTRATOR

#

Idk how it is for djs

craggy pine
#

oh no

#

I can .has()

#

it works

lyric mountain
#

But since it changes so much, it'd be worth to use some hardcoded constant like this

#

Ah, btw

#

Might be better to check for manage_channels perm instead of admin

#

Since admin is usually reserved to owner role in big servers

#

So it'd require an owner intervention to stop some troll

craggy pine
#

yeah that makes sense.

#

I'm sure there's a lot I'm doing probably in a bad way with my code. I'd like at some point have someone kinda gloss over it and potentially optimize it since It's not a lot. Maybe sometime in the future.

lyric mountain
#

That's the right way of doing things

craggy pine
#

ye

lyric mountain
#

Tho in my case it kinda forced me to rewrite my entire game framework KEKW

craggy pine
#

oof

lyric mountain
#

But that's cuz i allowed too much technical debt

#

At least mow it's much more optimized and stable, the boring part is just migrating all cards to the new interface

craggy pine
#

one by one

lyric mountain
#

Well, gonna sleep now, cya miyu

craggy pine
tidal pendant
#

do anyone have any idea what to fill in user_agent in praw reddit

lament rock
#

just base your user agents off of other browser's user agents

dusky idol
#

Can someone tell me how I may disallow / commands of every bot from a text channel & allow them to use / commands of my bot in the same text channel?

lament rock
#

There are integration settings in the server settings

tidal pendant
#
bot = commands.Bot(command_prefix=".")

# enable all intents
intents = discord.Intents.all()
bot.intents = intents

Traceback (most recent call last): File "main.py", line 44, in <module> bot = commands.Bot(command_prefix=".") TypeError: __init__() missing 1 required keyword-only argument: 'intents'

deft wolf
#

I don't think you can assign all intents anymore

tidal pendant
#

😦

#

so what ca n i do

deft wolf
#

Assign them separately

tidal pendant
#

ok

#

how

#

for example

deft wolf
#

I don't know, I don't write in python

#

I can give you an example in js but it won't be of much use to you

tight axle
#

meaby

#
client = discord.Client(intents=intents)```
#

something like that

deft wolf
#

Very likely

tidal pendant
#

nope

tight axle
#

Try find latest docs of plugin what you use and should be described

compact pier
severe hull
sudden geyser
#

honestly if you want obfuscation just run your program through something like google closure

lyric mountain
#

Obfuscation is, honestly, stupid

#

Trying to hide your website source code is a sisyphean job, no matter how much u try u cannot fool the browser

#

And for any other project, just compile it down to a binary, assembly is obfuscated enough as-is

compact pier
#

or just use golang (and some other language, that compile code to machine code)

#

01010101110101

craggy pine
#

Internet was shit so it takes like 30 seconds for my 2nd part to show

lament rock
# lyric mountain Obfuscation is, honestly, stupid

When I first decided to oss my bot, I thought about obfuscation, but decided it was too much of a hassle. The idea behind it was that since I was and still am a very small developer not utilizing get rich quicker techniques, people would be able to easily steal some of my bot's code and use it to grow quite well.

I think my bot's organization has quite a lot of good stuff that can just be utilized for a better ux

#

some of it is standalone though and is totally meant to be used by others

#

but for the first like 1k guilds, closed source

lyric mountain
#

if you're really concerned about "innovative" or highly complex code that could be stolen simply use a license that disallows using it

#

if anyone uses it to get rich, you can legally sue them

lament rock
#

thats what I did

sudden geyser
#

I agree, obfuscation, most of the time, is unnecessary, but don't get what the browser has to do with it

lyric mountain
#

no matter what you do, the browser will always show the true, decoded content

#

meaning you also have access to 100% of said content

#

for example, let's say you want to protect your site's source code by putting it inside an iframe and requiring the browser to download fragments of the site from many different off-site sources

#

at the end of the day, whoever is seeing the site also gets access to everything the browser used to render it

sudden geyser
#

obfuscation's purpose is to hide the meaning behind a program; not to hide its actions

#

if you have a bunch of munged names, you can try to reverse it, but it'll be very difficult to do so

lyric mountain
#

not really, browsers auto-beautify the source-code when u open developer tools

sudden geyser
#

yeah but that still won't reveal the actual meaning

lyric mountain
#

all u need to do after that is refactor variable names (editors will change all references to that variable across the entire project)

lyric mountain
sudden geyser
#

have you seen what a munged js file looks like?

lyric mountain
#

define "munged"

sudden geyser
#

as in manipulated, such as renaming, collapsing, rewriting, etc.

#

most of the time you need a source map to get the proper look

lyric mountain
#

nothing an auto-format + refactor doesn't solve

#

no matter how hard you try, the code is still 1:1 to the original source

sudden geyser
#

please open any munged js file in inspect and show me if you can reason about it

lyric mountain
#

give me an example

compact pier
lyric mountain
sudden geyser
#

open any js file and it looks like that on the web

compact pier
#

but it still has that \n thingy

sudden geyser
#

don't know where you guys have been

compact pier
#

it is not 1 line

sudden geyser
#

and that's not even the worse

lyric mountain
#

I'm not a pro in js, don't expect me to decode an enterprise-grade source code

sudden geyser
compact pier
#

I think webpack can do the same thing

sudden geyser
#

probably

compact pier
#

like this from my website

sudden geyser
#

boring

#

that's unmunged

compact pier
#

lmao

#

can you imagine they don't split js and css

#

just combine it in html

#

and then minimize it

earnest phoenix
#

So did I

sudden geyser
#

that's cheating

earnest phoenix
#

That's opening any js file

#

Not sure how that's cheating

compact pier
#

lemme experiment this

#

still loading

sudden geyser
#

general point was that js files when distributed are usually munged in some way

lyric mountain
#

which, atm, is no code at all

#

but really, browsers have built-in debuggers now, I just need to put a breakpoint and see where it takes me

#

after that it's just renaming variables and inlining functions

compact pier
#

https://www.npmjs.com/package/webpack-unpack
someone is actually trying to unpack code

lyric mountain
#

I don't need to see the original source code, I just need to find what I'm looking for (for example, a call to a private api)

#

that's how people usually crack into unsecured apis

compact pier
#

yeah, some people just go to source code and search for key key word

#

that is first thing u do, when u wanna explore a website

lyric mountain
#

if all else fails, "Network" tab

compact pier
#

but I think they all hide API calls with their backend server

#

like the backend server being a middleman for the api and client

lyric mountain
#

u can see who the middleman is and replicate the call

compact pier
#

well then u are using your own credentials (your own account)

#

it is not exploit anymore :<

lyric mountain
#

that's where "secured" comes in

compact pier
#

yeah

craggy pine
slender wagon
#

I am trying to make a automatic extractor, are u guys aware of any program that finds if a certain path exists and then extract files

#

like a setup

lament rock
#

just recursively look through an input directory and search for a specific string then pipe through something like gzip/gunzip

lost herald
#

what modal type is this, with the whole being able to select multiple things at once

earnest phoenix
#

Select Menu

#

You can set min_values and max_values

#

If you set them correctly, you can allow users to select multiple options at once

lost herald
#

im guessing max 5 options like everything else

earnest phoenix
#

Max 5 will let users select up to 5 options

lost herald
#

but like how many options can i put in

earnest phoenix
#

Min 2 and max 5 will force users to select 2, but they can select up to 5

lost herald
#

i don't see that in my library docs (the limit)

earnest phoenix
lost herald
#

ok imma double check

earnest phoenix
#

Minimum number of items that must be chosen (defaults to 1); min 0, max 25

Maximum number of items that can be chosen (defaults to 1); max 25

lost herald
#

ah 25 thats perfect

#

thank you for your help, this will serve as a fancy upgrade for my selecting programming languages role system

earnest phoenix
#

nicee CatJAM sunglasscat

limber siren
#

how do I stop my discord bot from being rate limited?

deft wolf
#

Just dont send too many requests to api

sudden geyser
#

You keep creating commands for some reason

#

You shouldn't hit the limit, so your code is likely doing something dubious

solemn latch
#

you should really only be creating commands manually(with a script), not all the time.

limber siren
#

Well I don't think its because of the commands its because of my level and global chat I think because looking every time someone sends a message

deft wolf
#

Do you want to write that every time someone writes a message, you create a command in the bot?

limber siren
#

Is there any way I could make cool down on the event if it's about to get rate limited

deft wolf
#

Because your bot got ratelimit on commands

limber siren
deft wolf
#

Okay, how many times have you reset your bot today?

limber siren
#

loads

deft wolf
#

Assuming that the bot creates commands on each reset

limber siren
#

like restarting

deft wolf
#

Yea

limber siren
#

that's fine than thank you for helping me 🙂

deft wolf
limber siren
deft wolf
#

You're welcome

#

And as for the rate limit on globalchat, you would have to look for similar bots on the internet and see how they did it

#

Personally, I can't imagine what it would look like if dozens of people suddenly started writing in a global chat

civic scroll
limber siren
#

yeah well, I will see I don't think that many people will be using the bot so I think I should be good.

deft wolf
#

If the bot will only be on a few servers, it should be able to handle it as you have written it

#

I thought it might be a bot for more servers

fallen holly
#

I'm trying to make a command that will keep track of a teams point and also have a leaderboard. How can i do that with quick.db

craggy pine
#

Can't remember but does discord not like when a join-log of a bot joining a server is viewable to the public? Only if the log shows the name and the usercount? Is that a breach of privacy even for the little it shows?

quartz kindle
#

should be very straight forward, anytime points change, save it to the db

#

and for a leaderboard list the top points from the db

fallen holly
#

ik that but how would i structure the code to where it saves the points to the correct team

quartz kindle
#

i dont know your code so no idea

#

what do the teams do? when do they have their points changed?

craggy pine
quartz kindle
#

what do you mean by log join bot?

craggy pine
#

Nono

#

Sorry so like

#

but in a public channel

#

does discord consider this a "Breach of privacy" and would it deem it not ok to do

quartz kindle
#

well it depends on the server rules

#

it could be seen as unwanted exposure by an incoming member

#

but you can add info about it in the server rules

craggy pine
#

Then with that answer alone it will be private. 😛

quartz kindle
#

stating that by accepting the server rules they agree to have their joining known by other guild members

craggy pine
#

Hm.

#

Kinda like a TOS agreement.

quartz kindle
#

yeah

craggy pine
#

Sure why not.

#

But in the case they don't accept obviously it would still "Log" them

#

so it's kinda wrong no?

fallen holly
craggy pine
# fallen holly have not started i have no idea how to thats why im asking

so I've never used quickDB because I personally use mariadb but I do also have a similar currency system in my bot.

If a user gets money, I grab the current value, add the amount given to it, and update it via database queries.
With leaderboards, I grab all users who are stored in the DB from the guild and simply sort it by highest to lowest.

#

Since you haven't started, assuming you've never used quickDB, I'd try to follow tutorials and kinda play around with it. I think telling you exactly how to create a DB and use it / query stuff could fall under spoonfeeding

fallen holly
#

u mean by using mongoDB

craggy pine
#

I mean, no I use mariadb. I thought your questions were inregards to quickdb. mexShrug

fallen holly
craggy pine
#

I didn't remember if it was quick.db or quickDB so I wrote it wrong. My bad 😛

fallen holly
#

u good

fallen holly
#

how do i mention multiple people in command

visual knoll
fallen holly
#

I got it to work

deft wolf
#

Then adjust it to your bot so that it does what you want

lament rock
#

I've been working on a thing people can make plugins for, but every time the thing updates, you have to reinstall the plugins and their dependencies manually since they get overwritten by new package versions for new deps and version numbers and such. This was annoying so I made a cli to install plugins and their deps and then load them during runtime and after a clean install/upgrade, if you have the manifest, you can reinstall all of the plugins. Might break if you try to install plugins that are already installed, but eh

https://media.discordapp.net/attachments/1044874980799815720/1058249089860501514/image.png

lament rock
#

Tried this shit out in production and it is op to deploy this to multiple nodes and only having to type 1 command to be back up and running

tidal pendant
#
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 33, in welcome
AttributeError: 'Member' object has no attribute 'avatar_url'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 1349, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member' object has no attribute 'avatar_url'
#
async def welcome(ctx, member: discord.Member):
  avatar_response = requests.get(member.avatar_url)
deft wolf
#

Well, cool errors

tidal pendant
deft wolf
#

I have no idea what this code means

#

PY is black magic to me

tidal pendant
feral aspen
#

Is this a coding mistake or is there actually something as ;(() =>?

earnest phoenix
#

js moment

earnest phoenix
#

This is valid in almost every programming language that supports semicolons, because they're there to terminate expressions, which empty expressions are also completely valid

late pine
rare granite
#

can i get suggestions for hosting services, i want to host a bot with only command for a single server so im not considering vps ( paid is fine too )

earnest phoenix
#
(() => {
    console.log("Hello from anonymous function")
})();
deft wolf
#

The second idea is repl.it but I've never used it although I've seen some people host projects there on github

#

The third idea and probably the best is to find something cheap in your country, such as vps with 512mb of ram, which should be enough for such a bot for one server

#

At the beginning, when I was programming the bot, I bought a 1gb of ram vps for ~$6 per month

#

Now I managed to find a 4gb ram vps for ~$8 but the new one has 2 cpu cores instead of 4

earnest phoenix
#

Ok

sharp geyser
earnest phoenix
sharp geyser
#

idk im so tired

#

I replied to the wrong one

sharp geyser
#

What does it actually do with those empty expressions? Skip over them?

earnest phoenix
#

Empty expressions are common semantic grammar, since semicolons are just terminators they shouldn't be invalidated on empty expressions, and thus skipped over, what do you think is going on in a classic for loop statement? It has 3 clauses, expr; expr; expr, and expressions can be empty, so clauses like let i = 0; ; i++ are allowed

quartz kindle
#

for(;;) is often used as a shorter while(true)

earnest phoenix
#

^

bright thorn
#
message.member.user.displayAvatarURL({
        format: "png"
      })

still it is coming in webp

#

is v14 change this?

deft wolf
#

Why message.member.user tho

#

Just use message.member

#

Your code doesn't even work for me

#

Ah, nvm

#

Typo

#

On v13 it works normally so I doubt they will change it in v14

craggy pine
#

I can test it on v14 since my bot is on it. Sec.

deft wolf
#

This is the only change I found

surreal sage
#

for (const x of {"a": "b"}), x would be "b" yes?

#

(Makin sure)

#

Nvm

dry imp
#

no

deft wolf
#

I haven't used it either so I didn't even know it existed okeh

dry imp
#

oracle is a scam

#

ig you can fk around with it, but not a good idea to use it in prod

#

they can just suspend ur service for no reason

deft wolf
#

I never believe in "free hosting". Like everyone has to get something out of it, no matter how big the company is

dry imp
#

good mindset

#

just like the jokers quote:
"if you are good at something, never do it for free"
so if it is free then its gonna be shit

limber siren
#
const client = require("../index.js");
const { Discord, MessageEmbed } = require("discord.js");


module.exports = {
  name: "ban",
  description:
    "Mit dem Ban Kommando kannst du Leute aus deinem Server verbannen",
  options: [
    {
      name: "member",
      description: "Das Mitglied, was du verbannen möchtest",
      required: true,
      type: "USER",
    },
    {
      name: "reason",
      description: "Der Grund, warum du das Mitglied verbannen möchtest",
      required: true,
      type: "STRING",
    },
    {
      name: "time",
      description:
        "Die Zeit, wie lange ein Mitglied verbannt werden soll (Beispiel: days)",
      required: false,
      type: "STRING",
    },
  ],
  run: async (client, interaction) => {
    const member = interaction.options.getUser("member");
    const reason = interaction.options.getString("reason");
    var time = interaction.options.getString("time");

function shortmessage() {
    var dmoff = new MessageEmbed()
    .setTitle("Ban")
    .setColor("black")
    .setFields(
      { name: "Moderator", value: `${interaction.member}` },
      { name: "Member", value: `${member}` },
      { name: "Reason", value: `${reason}` },
      { name: "Time", value: `${time}` }
    );
  interaction.reply({ embeds: [dmoff] });
    }

    staffRole = "todo";
    if (!interaction.member.roles.cache.has(staffRole) || !interaction.member.permissions.has("ADMINISTRATOR")) return interaction.reply({ content: "Du hast nicht die Berechtigung, um diesen Befehl zu nutzen!", ephemeral: true });
        if (time == null) {
            time = "Permanent";
            var guild = interaction.guild;
            try {
              member.ban({ reason: reason })
            .then(message())
            } catch (error) {
                try {
                  member.ban({ reason: reason })
                    .then(shortmessage())
                } catch (error) {
                    console.error(error);
                    interaction.reply({ content: "Ich konnte das Mitglied nicht verbannen", ephemeral: true })
                }
            }
          } else {
            try {
              member.ban({ days: time, reason: reason })
              .then(message())
              } catch (error) {
                  try {
                    member.ban({ days: time, reason: reason })
                      .then(shortmessage())
                  } catch (error) {
                      console.error(error);
                      interaction.reply({ content: "Ich konnte das Mitglied nicht verbannen", ephemeral: true })
              
          }
    function message () {
        var embed = new MessageEmbed()
        .setTitle("Ban")
        .setColor("black")
        .setFields(
          { name: "Moderator", value: `${interaction.member}` },
          { name: "Member", value: `${member}` },
          { name: "Reason", value: `${reason}` },
          { name: "Time", value: `${time}` }
        );
      interaction.reply({ embeds: [embed] });
      var embed = new MessageEmbed()
        .setTitle("Ban")
        .setColor("black")
        .setDescription(`You have been banned from ${interaction.guild.name}`)
        .setFields(
          { name: "Moderator", value: `${interaction.member}` },
          { name: "Reason", value: `${reason}` },
          { name: "Time", value: `${time}` }
        );
      member.send({ embeds: [embed] });
    }
    }
  }
}
#

can anyone help me with that ^
|

deft wolf
#

But with what exactly?

limber siren
#

I have no clue I cant find it but it says

#

so I am thinking I have missed out one of these "}"

#

but I hve looked and I cant find one

deft wolf
#

Yea, u missed one for module.exports

#

Try to add } at the end of code

limber siren
#

no that dident work

#

never mind it did KEKW

deft wolf
#

I'm glad it worked

limber siren
deft wolf
#

Depends on what version of discord.js you're using

limber siren
#

"discord.js": "^13.9.1",

deft wolf
#

The value of "days" takes a number, not a string

#

Most likely that's why it doesn't want to work

limber siren
#

no but thats number of days to deleate a message

#

I am talking about like days to bad

deft wolf
#

U can do this on discord.js without database i guess

limber siren
#

oh how do I do it

deft wolf
#

Most likely you would have to save the banned user's id in the database and the time they were banned for and after that time you would have to unban them. How you do it is up to you because there are dozens of databases that you can use as well as methods to count the time that has elapsed since a user was banned

limber siren
#

I already have a database but I wouldn't know how to count it and unban them

deft wolf
#

For unban I would probably use guild.bans.remove() because there you unban the user based on his id

#

Same as with guild.bans.create() you can ban users by their id without needing them to be on your server (I think it might come in handy sometimes)

#

As for how you can unban a user after some time, without a database you can do something like this. I found this on stackoverflow and I have no idea if it works so let it be more of an "idea" than a working code that you paste into the command and it will work

spark flint
#

that returns the user object

wheat mesa
#

if your bot restarts in between that time, that will never run

#

and the member will stay banned forever

#

you need a database to do this reliably

deft wolf
#

Thats true

rustic nova
#

would suggest keeping a unban-timestamp along that database entry

#

then having a reliable task that goes through that database and unbans the expired ones

warm surge
#

what version is your discord.js

minor olive
#

Does youtube have a safe-search feature?

#

Or is it just age-restriction

minor olive
sudden geyser
#

unfortunately no

minor olive
#

Okay. Thank you anyway. I'll have a look through the source code. I can't find anything in the documentation.

sudden geyser
#

Though I don't think youtube-dl (likely what ydl is based on) has any concept of safe searching

wheat mesa
#

If the video is marked as age restricted, ytdl is not able to do anything with it afaik

#

since it requires a logged in account to access age restricted videos

slender wagon
#
export default function Home() {
  type ModalList = "modal1" | "modal2" | false;
  const [activeModal, setActiveModal] = useState<ModalList>(false);
  const ref = useRef(null);

  useClickAway(ref, () => {
    setActiveModal(!open);
  });

hello so i am working on some modals
the issue stands with ref since i can't figure out a way to use a different ref for all the different modals

#

the modal shows the same content all the time now

#

doesn't matter if it is modal1 or modal2

#
<div className={styles.card}>
            <div className={styles.box}>
              <div className={styles.content}>
                <h2>01</h2>
                <h3>leofile_0001</h3>
                <>
                  <a onClick={(e) => setActiveModal("modal1")}>Demo Video</a>
                  <br />
                </>
                <a href="#">Download</a>
              </div>
            </div>
            {activeModal && (
              <div className={styles.modal_container}>
                <div ref={ref} className={styles.modal}>
                  <iframe
                    width="800"
                    height="400"
                    frameBorder="0"
                    allowFullScreen
                    src="//www.youtube.com/embed/ccW_OYApEE"
                  ></iframe>
                </div>
              </div>
            )}{" "}
          </div>

code of the modal

minor olive
wheat mesa
#

denied by discord or by top.gg?

#

keep in mind no filter is 100% accurate

wheat mesa
#

do I need a webserver to get OAuth2 tokens from user authentication?

#

(never done oauth before)

rustic nova
#

yes

#

since succeeded oauth authorizations redirect per standard back to a website that collects the access token

#

but tbf that can be done with 000webhost or something that could just send the access tokens to your bot (or even cloudflare workers)

wheat mesa
#

👍

#

I'm just going to use express for now for the sake of simplicity

#

I'll convert to something more efficient after I'm done with a local proof of concept

minor olive
#

And I contacted the person who denied it, and they didn't say anything about this being a mistake.

wheat mesa
#

That's odd, my bot didn't get denied for having a similar feature

#

Different review rules I suppose lol

fallen holly
#

how do i send this in embed

rustic nova
#

depending on what way you wanna show it:

embed description, just loop through the json array and append to a string
embed fields, just loop through the json array and add to the embed fields

fallen holly
#

im able to get the id but the value is returning object object

earnest phoenix
fallen holly
#

tryna to put the id and value e in embed description

#

for example

BatMan - 3
Becky - 3
Carl-Bot - 3
etc...

earnest phoenix
#

Then obj.value.score for the value

fallen holly
#

ok do i push it to the list?? for just do it all in the for loop

wheat mesa
#

should I even bother doing "proper" encapsulation in ts anymore

#

starting to fuck with me

#

lmao this is pretty bad

wheat mesa
#

this is kind of a dumb question but I can't remember how I did it last time. Let's say I have a response that looks like so: json { "data": "some string", "something_else": 15 } But I want my ts interface to look like this: ```ts
interface ResponseData {
data: string;
somethingElse: number;
}

earnest phoenix
#

You can't, the property names must match

wheat mesa
#

agh

#

Nothing like C# where you can make an annotation on the property and have whatever name you want?

#
interface Data {
  [JsonProperty("property_name")]
  public string Name { get; set; }
}
#

something similar to that?

earnest phoenix
#

Unfortunately TypeScript doesn't have such thing

wheat mesa
#

Damn

#

Was worth a shot ig

#

Seems like a relatively common thing to want

#

time to pull request nodejs for this muscleflip

earnest phoenix
#

Well the thing is, there is a way to do this but it's not great, because this is not really common

wheat mesa
#

Really not common?

#

Modeling responses whilst maintaining naming conventions seems like it would be pretty common to me

earnest phoenix
#

In most codebases we just use the names we're given, and our style policies don't apply to them

#

Here is a way you can achieve what you want in TypeScript:

function JsonProperty(name: string) {
  return function DoJsonProperty(_: any, _1: string, descriptor: PropertyDescriptor) {
    descriptor.get = function () {
      return this[name];
    };
    descriptor.set = function (value) {
      this[name] = value;
    };
  }
}

class Foo {
  @JsonProperty("foo_bar")
  get fooBar(): number { return 1; }
}
wheat mesa
#

Ouch

earnest phoenix
#
wheat mesa
#

I'll just suffer

earnest phoenix
#

Bro just map it to a string and join them

fallen holly
#

ok

earnest phoenix
#
foo
  .map((bar) => `${bar.id} - ${bar.value.score}`)
  .join('\n');

troll_skull

earnest phoenix
#

anyone know a good javascript api for vpn detection?

rustic nova
#

I must admit though from personal opinion, you shouldn't restrict users using vpns entirely

#

you could challenge them through a captcha if they're about to do actions that are crutial

#

same goes for blacklisting ips tbf, since IPs are often reassigned on ISPs, best is to have the blacklist expire at some point

#

it will worsen the user experience, but better than restricting users using VPNs entirely

wheat mesa
#

I would not recommend helping this guy, he's making malicious programs for stealing user data

rustic nova
#

sus

#

amongus

lyric mountain
wheat mesa
#

Yeah

#

Look at his user profile and click on the bottom link

#

that's what he's making

lyric mountain
#

Yep, it's him

lyric mountain
wheat mesa
#

Yeah

#

At some point I used to think this dude was doing some good by taking an interest in programming so early in life

#

But now I have lost any tiny ounce of respect I had

spark flint
#

He has a bookmark info stealer

#

Should I do a funny and get the domain deleted

wheat mesa
#

should be banned from any programming related server possible in my honest opinion. I do not like people who ask others for help with their illegal and unethical programs

#

Not to mention he clearly disguises the questions so you don't think about what he's doing

earnest phoenix
#

"It's for educational purposes only" trollStare

wheat mesa
#

Yeah he can't even pull that bs because he's directly advertising it for its malicious uses

earnest phoenix
#

💀💀💀

wheat mesa
#

Steal

earnest phoenix
#

hows that even possible

#

a vuln in chromium or what

#

Not really no

#

You can read cookies etc. freely in the system's files and folders

#

yeah

#

Passwords as well

#

Nothing really new, pretty script kiddie though

earnest phoenix
#

i see

sharp geyser
#

Bro is using it for malicious intents instead of figuring out how to prevent it

#

😔

deft wolf
#

You'll make more money hurting people

compact pier
#

how can I add those commands?

deft wolf
#

U need a command id

compact pier
#

like mention is <@ID>

deft wolf
#

Like this

compact pier
deft wolf
#

You should be able to do something like this

#

Right-click on the command description

#

Yea, its working

compact pier
deft wolf
#

Then I have no idea

#

I don't have any sub commands so I can't even check it

compact pier
#

I want to get the group command, like the group command of sub command id

#

but it don't allow me

deft wolf
compact pier
#

but still sad, that I can't get the whole command

#

like not /pingcord help

#

but only /pingcord

crystal wigeon
#

Is there invite link to this server ?

deft wolf
#

Yes, on the page

#

Here you have "discord"

#

I don't want to send the link itself because I have no idea how the automod for server links works here

#

But you can find link there

neon leaf
rigid maple
#

I want to convert audio to text and for that I use prism-media but I don't understand this error

deft wolf
#

This is most likely a problem with the package itself

#

I would advise you to look for something on their repository or somewhere closer to the package itself

spark flint
#

Also yeah i agree

earnest phoenix
earnest phoenix
earnest phoenix
deft wolf
#

Okay

#

Cool

craggy pine
deft wolf
#

Thank Tim onionpray

earnest phoenix
#

actual bytecode assembler for python

#

afaik this hasn't been done before

lyric mountain
#

Asm not bytecode

#

Bytecode is for jvm

earnest phoenix
whole knot
earnest phoenix
#

good job

whole knot
#

Means I made someone happy KEKW

earnest phoenix
#

im gonna be honest

lyric mountain
# earnest phoenix bytecode isn't a term specific to the jvm, its generally just a sequence of byte...

Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normally numeric addresses) that encode the result of compiler parsing and performing semantic analysis of thing...

earnest phoenix
#

the dude who got it is probably sleeping rn

lyric mountain
#

And wtf is that link

#

Aight, removed the mess from it

earnest phoenix
lyric mountain
#

Ah by assembler u mean as in builder, not the machine language

#

But then what's the use of it? Like, can't u already write directly?

deft wolf
whole knot
#

Did not think about Nitro snipers, my bad lul

lyric mountain
#

This server is infested with them

#

The second u send a gift they instantly grab it

whole knot
#

Yeah, send one in a different server as well and it got sniped, I guess

earnest phoenix
#

real chads write python bytecode directly 🦾

#

anyways: functions

lyric mountain
earnest phoenix
#

should've worded that a bit better, i dont think there's another way to easily do this

#

sure, you can python3 -m compileall, but that's boring

lyric mountain
#

U can write pyc files manually can't u?

earnest phoenix
#

you can, if you enjoy pain

#

this makes it a lot easier

earnest phoenix
# earnest phoenix anyways: functions

would you rather write ```py
b'\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\xf3"\x00\x00\x00\x97\x00d\x00\x84\x00Z\x00\x02\x00e\x00d\x01\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00d\x00S\x00)\x02\xe3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\xf3\x1a\x00\x00\x00\x97\x00\x02\x00e\x00|\x00\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00d\x00S\x00)\x01N)\x01\xda\x05print)\x01\xda\x06an_args\x01\x00\x00\x00 \xfa\x05<asm>\xda\x00r\x07\x00\x00\x00\x00\x00\x00\x00\xf3\x00\x00\x00\x00r\x08\x00\x00\x00\xe9{\x00\x00\x00)\x01\xda\x03fnc\xa9\x00r\x08\x00\x00\x00r\x06\x00\x00\x00r\x07\x00\x00\x00r\x07\x00\x00\x00\x00\x00\x00\x00r\x08\x00\x00\x00r\x08\x00\x00\x00'

#

because that is the actual content of the equivalent .pyc file

lyric mountain
#

Pyc is a big string?

earnest phoenix
#

pyc is binary

lyric mountain
#

Then u can use hex editor to write it

earnest phoenix
#

you can do everything manually, you can write java .class files with a hex editor

#

why not write an entire elf binary manually with a hex editor

lyric mountain
#

Java class isn't raw binary tho

earnest phoenix
#

?

lyric mountain
#

Like, it has an actual language behind it

#

Not java, I mean the bytecode-level language

#

Idk how to explain, but it's the equivalent of asm

#

Except much more readable

earnest phoenix
#

this is what a .class looks like under the radar

#

similarly: pyc

#

both are bit jargon

#

have fun

lyric mountain
#

Hm, nvm then

earnest phoenix
#

this is like the asm for python

#

same exact purpose for different backend “languages”

lyric mountain
#

Asm library for java?

#

Java doesn't compile to asm

earnest phoenix
#

what

lyric mountain
#

The asm-equivalent for jvm is kinda java-like, but much more...raw ig

lyric mountain
earnest phoenix
#

asm is a library to modify said language

#

do you know what i am talking about

lyric mountain
#

Asm is a language

#

Assembly

earnest phoenix
#

there is a library

#

called asm

#

for modifying java’s bytecode

earnest phoenix
quartz kindle
modern solstice
#
setInterval( async () => {
      message.channel.sendTyping()
      await d(1000)
      message.channel.send(`hello world`).then(() => {
        console.log(`message sent`)
      })
    }, 45 * 1000)
#

What's the use of 45 * 1000

#

In the end

deft wolf
#

Its like 45 seconds i guess

#

Because the time is in milliseconds

#

You have to multiply this time times 1000 to get seconds and 45 is the number of seconds

#

E.g

60 * 60 * 1000

Then you have one minute

lyric mountain
#

It's basically for readability

#

It'll be computed to a constant anyway, so it doesn't matter performance-wise

lyric mountain
#

That snippet will spam a channel with messages every 46 seconds

modern solstice
#

But I was just asking for general knowledge

lyric mountain
#

That's fine, just be careful

earnest phoenix
#

what you have there is one hour

deft wolf
#

Ah right, my mistake

wheat mesa
lyric mountain
#

I don't think that was as mild as a tos-breaking project KEKW

#

More like law breaking

wheat mesa
#

Yeah

lyric mountain
#

Specifically lgpd

wheat mesa
#

Pretty sure that’s close to a felony charge if they were to be prosecuted for it

spark flint
#

lmao

earnest phoenix
deft wolf
#

Thank God onionpray

earnest phoenix
#

I saw your reply to it when I was eating

neon leaf
earnest phoenix
#

i know, i didn't know it was considered illegal

wheat mesa
spark flint
#

lmao can't wait for someone to sue for data loss

lyric mountain
earnest phoenix
#

Ah alr

lyric mountain
#

And...I don't think that if u told ur player that the game might crash their entire pc they'd accept it

earnest phoenix
#

true

wheat mesa
#

That’s like robbing a store and then being like “oh I didn’t know that it was illegal”

spark flint
#

lmao

wheat mesa
#

Not gonna hold up in a criminal case

lyric mountain
#

If u want to guarantee file integrity just use a hash check

#

As I said before

#

That's what big studios do

spark flint
#

dw i didnt realise bookmark stealers that steal google tokens was illegal, my bad

lyric mountain
#

Well, they also use drm, but anyway

wheat mesa
#

Not to mention it’s very obviously unethical, not even considering legality

hard wraith
#

Having some real issues with this code.

#

Keep getting this response.

wheat mesa
#

@boreal iron php

hard wraith
#

its something with the embed, because I can get it to send plain text messages.

#

They seems to be offline bro

lyric mountain
#

Fake will love this

wheat mesa
#

Yeah

#

I can’t help with php but that guy definitely can

hard wraith
#

It was working, it is something with the damn embed.

lyric mountain
#

What does the error say?

neon leaf
lyric mountain
#

Ah, i have images disabled cuz mobile data

#

Didn't see it

#

Ok, that's an ugly error message

#

Invalid form body, I suppose u missed something like a bracket or quotation

hard wraith
#

you wouldn't believe what it was...

#

embeds is an object containing object...

#

so i should have put the embed in []

lyric mountain
#

Ah, that

hard wraith
#

php is just... ugh...

lyric mountain
#

Ain't php's fault, discord allows up to 10 embeds per message

hard wraith
#

Now I have to figure out how to make it not show the "blank" character.

lyric mountain
#

U mistyped it

hard wraith
#

i did?

lyric mountain
#

Probably, I imagine php has a different way of writing char literals

#

Since it looks like it didn't escape with \u

#

Check google to see how to write char literals in php

#

Mobile is almost running out, so gtg

hard wraith
#

got it all working, sorry they tagged you Fake. But its working. Thanks all

boreal iron
#

back from holidays

#

Well the issue is you will still need to add a whitespace to the unicode chars

#

\u200b not \u200b

#

" \u200b "

#

I noticed when I tried to add an empty field/value, too

boreal iron
#

ping

neon leaf
#

whats the best approach for this? I want to make a very minimal coding language so users can code logic for requests but not get full control over my system, etc. I need to be able to parse it with javascript

wheat mesa
#

uh yeah that's not as easy as you think

neon leaf
#

Im aware

wheat mesa
#

you're going to need a lexer, parser, and interpreter

#

look up "regular expression grammar programming languages"

#

Basically the lexers job is to turn characters into tokens with more information, the parser then generates something called an abstract syntax tree (usually these are called recursive descent parsers or pratt parsers, they are different but produce the same result), and then the interpreter's job is to run through the AST (or some other intermediate representation, recursing down the AST is the slowest of all of these) and execute the "code"

#

The complexity of the project will depend on 1. How fast you need the language to be, and 2. How complex your language's syntax will be

neon leaf
#

well in the end I think the fastest way (in my case) would be to "compile" it to javascript

wheat mesa
#

That's going to be even more difficult, and anything that can be transpiled to js can access things on your computer that you don't want it to access

#

Compilation is a different process (especially when you're compiling to an existing language)

#

But the lexer and parser steps are still the same

#

What do you think you want your language to look like?

#

If you don't need it to be very complex, then it wouldn't be too difficult to make this (unless you want it to be really fast)

neon leaf
#

or it could just be in javascript and deny saving when it doesnt use defined variables

wheat mesa
#

I don't have experience with bdfd but if it's a relatively simple grammar then it shouldn't be incredibly difficult

#

The first steps to designing a language is to do the following

  1. Define your needs and goals for it
  2. Start writing a regular expressions grammar for describing the syntax
lyric mountain
#

Making languages, even simple ones is indeed a fun yet complex task

#

Because they tend to rabbit hole the deeper you are into it

wheat mesa
#

Yeah

#

Always more to do

knotty quartz
#

How can I effectively make a small database for blacklisting users?

rustic nova
#

tbf, I personally used a document-based database (NoSQL) because I cant be bothered to setup a whole mysql or mongodb database just for storing user ids

#

but essentially, just storing the user ids should be fine

#

just note that down on your privacy policy too though

rustic nova
lyric mountain
#

Sql would be equally as fast

rustic nova
#

Yeah, unless you have a sql setup done already (such as with economy etc), is it worth even setting up a fully fledged database for it?

lyric mountain
#

I mean, sqlite would suffice

#

No setup and virtually no physical size

rustic nova
#

thats true too yeah, though am mainly referring to setting up a whole db schema for just storing ids

lyric mountain
#

To check you'd just run SELECT 'theid' FROM blacklist

#

Ah, sqlite doesn't have schemas

#

Tbh, it has almost nothing lul

#

Just the tables

rustic nova
#

doesnt sqlite have tables?

#

yeah

#

am referring to setting up a whole table for it

#

so such as a id, then the user id

#

unless you wanna store a blacklist timestamp along it

#

I do sound lazy saying that lmaoo

lyric mountain
#

That'd be CREATE TABLE blacklist (uid PRIMARY KEY TEXT)

rustic nova
#

ohhh

#

yeah that could easily work

lyric mountain
#

Ye, tho idk how much of a performance impact a text pk would be

#

But unless ur blacklisting hundreds of thousands of people it'd not matter much

#

To be very honest, I'd use a csv file for that if the numbers are small enough

#

Then make the bot load it on startup each time

rustic nova
#

eh, unless you're not adding ids during runtime

#

thought they were going towards the path of adding ids during runtime

#

but yeah if thats not the case, even a text file just having ids on each line loading on start should be good enough

sharp geyser
#

Anyone know how to setup a mail server on an ubuntu vps?

rustic nova
#

no

#

its pain

#

trust me

#

tried it several times

sharp geyser
#

but its needed for what I am doing

#

😔

rustic nova
#

to be brutally honest, you're better off using a mail service and using SMTP etc to send

#

I have tried it, its pain

rustic nova
#

its either failing the installation altogether, emails dont send because I screwed something up during config

rustic nova
neon leaf
#

yes

rustic nova
#

how the fuck

sharp geyser
neon leaf
#

by following docs 🗿

rustic nova
#

I did so too, never worked

sharp geyser
#

send me docs

rustic nova
#

glad I do programming and not system setup

neon leaf
rustic nova
#

no clue anymore, forgot while looking through multiple docs in frustration

#

might've stumbled upon different docs for different versions

neon leaf
#

because in my case I use mailcow which literally guides me every step to get everything working, dkim and shit it does for you like 80% of the work

neon leaf
rustic nova
#

this is the first time I'm hearing about mailcow

neon leaf
#

yeah,I think its quite new

rustic nova
#

yeah seems to also note that ufw will cause issues and to disable it entirely, allowing docker-user to anything

#

which is an issue for me since my whole server consists of dockers for my apps

#

welp

sharp geyser
neon leaf
#

you can Ignore the not supported warnings, you are fine with kvm
https://docs.mailcow.email/prerequisite/prerequisite-system/
and follow closely, especially if you never worked with docker
and personally I always setup mailcow on a seperate vps but in your case just expose it on other ports and disable ssl

neon leaf
rustic nova
#

yeah would need a night of setup

neon leaf
#

nop, you want 1 command?

rustic nova
#

could do that at some point, literally just using cloudflare emails to just redirect

sharp geyser
neon leaf
#

no, you can change the web port of mailcow

rustic nova
sharp geyser
neon leaf
rustic nova
#

yeah proxy wont work with non http stuff of course

#

am mainly referring to the dashboard

neon leaf
#

yeah, that worked

rustic nova
#

cools

#

noted for a later project for me

neon leaf
#

I personally use another vps for mailcow though because else setting up and refreshing ssl is a hell

rustic nova
#

Yeah will probably do that too purely for the mail

neon leaf
#

this is also a cool feature which isnt exclusive in mailcow but automatically set up

rustic nova
#

ooooo monitoring

#

pog

#

wouldn't become useful for me though unless I do have multiple users on the mail and get a considerate amount of traffic

#

does it have any limitations?

#

such as needing a license for more email accounts?

neon leaf
#

its open source

rustic nova
#

cool

#

coolio

sharp geyser
#

@neon leaf does this look correct?

neon leaf
#

yes but you cant proxy mail, autoconfig and autodiscover except if you have cloudflare business

rustic nova
#

remove the proxy on the 2nd from the last

#

oh wait nvm

#

didnt see the a record, mistook it for the mx

sharp geyser
#

ye I don't think this worked trollface @neon leaf

#

mail.horizon-rust.store leads to my page

neon leaf
#

what does your mailcow config look like?

sharp geyser
#

just in case here is my open ports and my conf

#

It seems like it isn't even using the IP I am trying to target it to either

#

its using my main ip, and not the additional IP I bought

neon leaf
sharp geyser
#

weird

#

So I have to supply the port I can't just mail.horizon-rust.store?

neon leaf
#

your setup requires you to include the port

lyric mountain
#

Making an email server is brutal

sharp geyser
#

I don't wanna include the port tho

#

😔

neon leaf
#

for mails it doesnt matter, only for the web ui

neon leaf
#

try if it works for you

sharp geyser
#
server {
        listen 8080 default_server;
        listen [::]:8080 default_server;
        server_name mail autodiscover.* autoconfig.*;
        return 301 https://$host$request_uri;
}
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name mail autodiscover.* autoconfig.*;

        ssl_certificate /opt/mailcow-dockerized/data/assets/ssl/cert.pem;
        ssl_certificate_key /opt/mailcow-dockerized/data/assets/ssl/key.pem;
        ssl_session_timeout 1d;
        ssl_session_cache shared:SLL:50m;
        ssl_session_tickets off;

        location /Microsoft-Server-ActiveSync {
                proxy_pass http://127.0.0.1:8080/Microsft-Server-ActiveSync;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Frowarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $schema;
                proxy_connect_timeout 75;
                proxy_send_timeout 3650;
                proxy_read_timeout 3650;
                proxy_buffers 64 512k;
                client_body_buffer_size 512k;
                client_max_body_size 0;
        }

        location / {
                proxy_pass http://127.0.0.1:8080/;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $schema;
                client_max_body_size 0;
                proxy_buffer_size 128k;
                proxy_buffers 64 512k;
                proxy_busy_buffers_size 512k;
        }
}
neon leaf
#

Replace "mail" in server_name with "mail.iforgor.store"

#

And your SSL path is probably wrong

sharp geyser
#

no it looks correct

#

if I am able to access /opt like that then its correct

neon leaf
#

well but mailcow doesnt have your valid ssl certs behind a proxy

#

you need to provide the path to your valid ones

sharp geyser
#

I don't have any myself, cloudflare handles that for me

neon leaf
#

use letsencrypt

#

basically move that nginx config away to somewhere so that nginx -t says ok

sharp geyser
#

I will do this later

#

I have work soon

neon leaf
#

then install letsencrypt (certbot) sudo apt install -y certbot python3-certbot-nginx

#

and execute certbot certonly --nginx -d mail.horizon-rust.store

#

and change ssl section to

ssl_certificate_key /etc/letsencrypt/live/mail.horizon-rust.store/privkey.pem;```
sharp geyser
#
Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] unknown "schema" variable
nginx: configuration file /etc/nginx/nginx.conf test failed
#

This is what happens when I run certbot certonly --nginx -d mail.horizon-rust.store

neon leaf
#

change all occurences of $schema in the mailcow config to https

sharp geyser
# neon leaf change all occurences of $schema in the mailcow config to https

That worked but is this anything to worry about?

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: mail.horizon-rust.store
   Type:   unauthorized
   Detail: 45.137.194.111: Invalid response from
   http://mail.horizon-rust.store/.well-known/acme-challenge/lI96E38WUnc-Hx1bcvnAANHIEht_AmCSZC5A2lgLPlI:
   "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta
   charset=\"utf-8\" />\n    <meta name=\"viewport\"
   content=\"width=device-width, in"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
#

Also, I am trying to make horizon-rust.store bind to the additional IP I have instead of my main ip so could this be causing issues?

neon leaf
sharp geyser
#

I didn't notice you said to do this

#

I only saw the letsencrypt stuff

sharp geyser
#

Yea, I didn't even see that at the time

#

So no I didn't move it

neon leaf
#

if it still doesnt work with it removed youll have to do a dns challenge, will 100% work

sharp geyser
#

😔

#

Also one thing I wanna ask

neon leaf
sharp geyser
#

no matches found?

#

this is all so confusing

neon leaf
rustic nova
#

also fyi @sharp geyser

#

make sure your host isnt blocking 25

#

I discovered mine does and apparently considers my account too new

#

ok then

sharp geyser
#

This shit is too confusing

#

I have no idea how to do networking stuff

rustic nova
#

nah worked pretty well for me

sharp geyser
#

😔

rustic nova
#

just use cloudflare for your webserver

sharp geyser
#

I can't even get the nginx shit to work

#

nginx is failing to start

rustic nova
#

pain

sharp geyser
#

and its very fucking vague with why

#

its pissing me off

#

Failed to start A high performance web server and a reverse proxy server.

#

that is all it gives me

neon leaf
#

you get a less vague message with
nginx -t

sharp geyser
#

it says everything is ok

#

I already tried that

#
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
#

Which is why this is so confusing

neon leaf
#

the only thing I could think of would be something blocking its port ig

rustic nova
#

check if port 25 is blocked by your host

sharp geyser
rustic nova
#

hetzner is a cunt and does that

sharp geyser
#

25 is open

#

so are all the ports it wants open

rustic nova
#

check with telnet gmail-smtp-in.l.google.com 25

neon leaf
#

what does systemctl status nginx give

rustic nova
#

its not the incoming one thats checked, its the outgoing one

#

but iirc thats on the firewall of the provider

sharp geyser
#

port 8080 already in use

#

wtf is using that port

#

sorry misread that

rustic nova
#

thats new

#

sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo ss -tulpn | grep LISTEN
sudo lsof -i:22 ## see a specific port such as 22 ##
sudo nmap -sTU -O IP-address-Here
neon leaf
sharp geyser
#

Yes

#

but

#

aren't I supposed to be doing it like this?

#

Following the docs this is what it told me to do

#

so why is it now giving me errors if I followed it exactly

neon leaf
#

what does your nginx config look like right now?

sharp geyser
#
server{
  listen 80;
  listen [::]:80;
  server_name aarondye.dev;

  root /home/misty/Portfolio/dist;
  index index.html;

  client_max_body_size 100m;
  client_body_timeout 120s;

  location / {
   try_files $uri /index.html;
  }
}
server {
        listen 8080 default_server;
        listen [::]:8080 default_server;
        server_name mail.horizon-rust.store autodiscover.* autoconfig.*;
        return 301 https://$host$request_uri;
}
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name mail.horizon-rust.store autodiscover.* autoconfig.*;

        ssl_certificate /opt/mailcow-dockerized/data/assets/ssl/cert.pem;
        ssl_certificate_key /opt/mailcow-dockerized/data/assets/ssl/key.pem;
        ssl_session_timeout 1d;
        ssl_session_cache shared:SLL:50m;
        ssl_session_tickets off;

        location /Microsoft-Server-ActiveSync {
                proxy_pass http://127.0.0.1:8080/Microsft-Server-ActiveSync;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Frowarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
                proxy_connect_timeout 75;
                proxy_send_timeout 3650;
                proxy_read_timeout 3650;
                proxy_buffers 64 512k;
                client_body_buffer_size 512k;
                client_max_body_size 0;
        }

        location / {
                proxy_pass http://127.0.0.1:8080/;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
                client_max_body_size 0;
                proxy_buffer_size 128k;
                proxy_buffers 64 512k;
                proxy_busy_buffers_size 512k;
        }
}
neon leaf
#

🗿

#

you made the same mistake that you did last time

sharp geyser
#

I now realize my mistake

wheat mesa
#

wanna vc while you suffer with your server misty

sharp geyser
#

I got work in 20m but sure

sharp geyser
# neon leaf 🗿

Also I just realized, I shouldn't be binding it to 127.0.0.1 right? (mailcow conf)

#

I should be binding it to the ip I have my dns targeting right?

neon leaf
#

you should according to docs (127.x.x.x)

sharp geyser
#

but that only allows it to work locally no?

#

I can't connect to the mailserver from my local machine with it like that can i?

neon leaf
#

well it should but its infact working

#

im on your mailserver

sharp geyser
#

But...I can't even do it

neon leaf
#

but your certificate is invalid

neon leaf
sharp geyser
#

I see

neon leaf
#

try removing the default_server part from listen 80 default_server

neon leaf
sharp geyser
#

that responds with this
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. You may need to use an authenticator plugin that can do challenges over DNS.

neon leaf
#

uhh, right

#

hold on

#

apt install python3-certbot-dns-standalone

sharp geyser
#

Unable to locate package python3-certbot-dns-standalone

neon leaf
#

did you forget the "e"?

sharp geyser
#

nah

#

I just forgot to paste the entire thign

#

it left the e out

#

I copied what you put to use

#

so ye it cant find it

neon leaf
#

very weird

#

what ubuntu version are you on?

sharp geyser
#

20.04.5

neon leaf
#

I suppose you should update to the next lts

sharp geyser
#

I don't even know if contabo will let me

lyric mountain
#

It will

#

Tho I'm also using that one

#

But they usually add the newer lts soon after they release

sharp geyser
#

Well I gotta be at work so I will try later

tropic estuary
#

ok

rustic nova
#

managed to set it up on my dockers

#

pog

#

just had issues with proxy reverse since I had my apache2 on a different container

#

@sharp geyser why not use cloudflare proxies?

tropic estuary
rustic nova
#

the mailserver itself cant get proxied

#

mfw my ip is blacklisted on some literally 1999 site and wants 412 euros to be removed

cobalt spruce
#

Working on replit, and I got this error and it's not from my code

wheat mesa
#

Well, it is from your code

#

You did not give the discord client any intents for it to use

cobalt spruce
#

But I did not activate intents

#

And the bot isn't on over 100 server

#

So it's disabled

wheat mesa
#

You still need to specify intents

#

Being under 100 servers just means you don't need to verify your bot to get access to those intents

cobalt spruce
#

Mind sending the docs to intents?

wheat mesa
#

https://discord.js.org/#/docs/discord.js/main/general/welcome scroll down a little bit on this page and you'll see an example

cobalt spruce
# wheat mesa https://discord.js.org/#/docs/discord.js/main/general/welcome scroll down a litt...
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

const request = require('request');




client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', message => {
  // Only respond to messages that start with "!chatgpt"
  if (message.content.startsWith('!chatgpt')) {
    // Get the message text without the command prefix
    const prompt = message.content.slice('!chatgpt'.length);

    // Send a request to the ChatGPT API
    const options = {
      method: 'POST',
      url: 'https://api.openai.com/v1/chatbot',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${process.env.CHATGPT_API_KEY}`
      },
      body: JSON.stringify({
        'prompt': prompt,
        'model': 'chatbot'
      })
    };

    request(options, function(error, response, body) {
      if (error) throw new Error(error);

      // Send the ChatGPT response back to the channel
      const chatbotResponse = JSON.parse(body).response;
      message.channel.send(chatbotResponse);
    });
  }
});
#

I tried this code to call openai api but it doesn't reply to the messages I send

#

Error logs are empty

wheat mesa
#

Probably because you don't have message intent enabled in both your code and the discord dev portal

cobalt spruce
#

There is no error

wheat mesa
#

Look at your code

#

You don't have the message intent enabled

cobalt spruce
wheat mesa
#

You need GatewayIntentBits.Messages or something like that

tropic estuary
#

one from my email to my mail server that i got running using postfix

cobalt spruce
#

And still nothing

#

Not even a err

wheat mesa
#

can you show me exactly what you're doing?

cobalt spruce
#

I enabled all the intents on the discord dev application