#development

1 messages ยท Page 1777 of 1

lament rock
#

Explain

pure saffron
# lament rock Explain

So every time an on_guild_join event is ran, I want to first add 1 to a global variable called added_servers and then to update a message in a channel with that number.

lament rock
#

Idk how python or whatever language you're using works, but if your code is all in one file, you can declare an integer in the root scope and then assign your client's guild count once your client reaches the ready state and then increment that value on guild create.

If you need that variable across multiple files for whatever reason, you can have a file which exports an Object and assign that number to a property of that Object and then require that mutual file across multiple files. If python caches required files, then assigning properties to the object should allow you to access those properties across other files

pure saffron
#

hmm

brittle axle
#
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-06-09T05_24_32_955Z-debug.log
exit status 1```
#

can anyone help mee to fix it...

round cove
#

You need to add a start script to package.json.

brittle axle
round cove
#

It says it's missing the script lol

#

Google package.json start script

#

Better, google the error.

brittle axle
#

> discordjs-moderation-bot@1.0.0 start /home/runner/discordjs-moderation-bot
> node index.js

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '/home/runner/discordjs-moderation-bot/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! discordjs-moderation-bot@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the discordjs-moderation-bot@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-06-09T05_37_44_088Z-debug.log
exit status 1```
round cove
#

You script tries to run node index.js most likely you index.js file is in a folder .

round cove
#

Learn basic NodeJS.

brittle axle
#

lol

#

ok

#

i wil..

#

tryyyy

lavish bramble
#
if(!message.guild.me.hasPermission("CONNECT")) return message.channel.send({embed: {
          title: "Invalid", 
          description: `**I dont have permission to connect**! ${message.member.voice.channel}`,
          color: "RANDOM"
        }})```
When I use this bot is not connecting to vc and sending me this message
#

How can I check the permission of channel on which member is connected

rocky hearth
#

remember voice can be null, if user is not connected to any vc

lavish bramble
rocky hearth
#

wdym, this is how u'll check the permission

lavish bramble
#

I mean if my bot has no permission to connect that vc so he send message

rocky hearth
#

u mean, no permission globally??

#
if(message.member.voice.channel.hasPermission("CONNECT")) {
  // has permission
} else {
  // No permission to connect to member's vc
}
lusty quest
#

hasPermission is deprecated

lavish bramble
#

On which he was connected

#
if(!message.member.voice.channel.permmission.has("CONNECT"). for(client.id)) return message.channel.send({embed: {
          title: "Invalid", 
          description: `**I dont have permission to connect**! ${message.member.voice.channel}`,
          color: "RANDOM"
        }})```
Like this?
rocky hearth
lavish bramble
#

Checking permissions for client

rocky hearth
#

na thats not valid js

wheat sun
#

For rate limit, in this case on_message, is it per server or overall (all servers added up)?

lavish bramble
#

Code

if(!message.member.voice.channel.permissionsFor(client.id).has("CONNECT")) return message.channel.send({embed: {
          title: "Invalid", 
          description: `**I dont have permission to connect**! ${message.member.voice.channel}`,
          color: "RANDOM"
        }})```
#

Thats not api

lusty quest
rocky hearth
#

but using only client.user will also work

lavish bramble
#

Working

#

Thnx

exotic lotus
rocky hearth
#

lol. how intelligent

humble rock
#

(Discord.js) im doing a custom embed for guilds, i have to convert for example {author.username} (the text requested to put in the description/title/author) in a placeholder like ${author.username}, how can i do?

vale garden
#

hi

#

im new to sql

#

does anyone know how to insert a dict into a table

#

basically i need something like this

humble rock
#

i'm not using sql, sorry but i can't help you

vale garden
#
{
    "bal": 0,
    "iron": 0,
    "minerals": {
        "diamond": 0,
        "ruby": 0,
        "sapphire": 0,
        "emerald": 0
    },
    "structures": ["mine", "barracks"]
}
vale garden
vale garden
humble rock
#

try to search a doc

prime mist
lusty quest
inner fulcrum
#

e

lusty quest
#

so ```js

const string = ${Value}

humble rock
lusty quest
#

then use something else than the author, you could get the guild owner as example

lusty quest
quartz kindle
#

you can also serialize the minerals object

flat elm
#

Anyone help me to approved my bot 4week+ I do not get a single reply that my bot approved or not

drowsy crag
#

wrong channel

vale garden
#

oh

vale garden
#

do i do that

vale garden
#

i might change it tho

#

replace might with most probably will

inner fulcrum
#

phew

near stratus
#

It'll turn the dict / object into a string and then you can save it in db

#

or just use Mongo nosql

quartz kindle
# vale garden how

SQL is based on tables, there are rows and columns and thats it, there is no depth or children, you cannot have objects/arrays inside objects/arrays

#

so you have to either make separate tables for them and link them

#

or you need to serialize the children into something like json strings

vale garden
inner fulcrum
#

guys since in a dum dum what things u guys use to keep ur bot online

#

;-;

inner fulcrum
#

mmm

#

monke

vale garden
#

right

quartz kindle
#

yes

vale garden
#

okay thanks

quartz kindle
#

although if you have variable columns then its not a good idea

#

for example

#

lets say you have a table for a user

#

and another table for minerals

inner fulcrum
quartz kindle
#

it would be like this

#
table users
| id | username | bal |
| 01 | "abc"    | 999 |
| 02 | "xyz"    | 241 |
etc...

table minerals
| id | diamond | ruby | sapphire | emerald |
| 01 |    0    |  0   |    0     |    0    |
| 02 |    0    |  0   |    0     |    0    |
etc...
#

note that you cannot easily add/remove columns, because its a big performance hit to do that

#

so you have to define all possible minerals you will ever have ahead of time

#

and just give everyone 0 of them at the beginning

inner fulcrum
#

mmm

quartz kindle
#

you could also just put all minerals in the users table as well

#

and have one big table with dozens of columns

#

the number of columns doesnt affect performance, you can easily have hundreds of columns if you need it, but they have to be fixed, you should avoid dynamically adding/removing them

#

now arrays are more complicated

#

there is no way to reliably represent an array in SQL without using addons

#

the easiest way to store "structures": ["mine", "barracks"] would be to serialize it to string

#

for example ```js
table users
| id | username | bal | structures |
| 01 | "abc" | 999 | "mine,barracks" |
| 02 | "xyz" | 241 | "mine" |
etc...

#

and convert them back and forth between array and string

#

["mine", "barracks"] -> "mine,barracks" when saving data
"mine,barracks" -> ["mine", "barracks"] when loading data

vale garden
#

hm yeah

quartz kindle
#

as columns

#
table users
| id | username | bal | structures | diamond | ruby | sapphire | emerald | iron | ...
#

you could also save it as a string yes

#

the difference is that if you save it as a string, you cannot access it individually

#

for example if you want to know how many diamonds a user has

#

with columns you can access it directly

#

with string you have to first access the entire string, including all minerals

#

then convert the string and extract the diamonds value from it

inner fulcrum
#

bro im so dumb help me what am i supposed to do? the name of my bot or "index.js"?

inner fulcrum
#

ah ok

vale garden
quartz kindle
#

if its index.js then its index.js

inner fulcrum
#

phew

vale garden
#

oh yea i can just do that

#

lol

inner fulcrum
#

ok thx lmao

vale garden
#

i feel kinda dumb now

inner fulcrum
#

im felling more

quartz kindle
#

no matter how dumb you are, there will always be people dumber than you :^)

inner fulcrum
#

i come in the dumber one lmao

#

what the hek is this now

pale vessel
#

use it on your VPS not on your PC

inner fulcrum
#

ahhhhh

copper cradle
#

inb4 they ask what a vps is

prime mist
#

Viral Pirated Software, duh.

boreal iron
merry sorrel
#

anyone here? ;-;

pale vessel
#

Yes?

merry sorrel
#

oh i used googletrans but its givign me an error

#

Exception has occurred: AttributeError
'NoneType' object has no attribute 'group'

pale vessel
#

I believe it's a bug with the library

merry sorrel
#
@bot.command(aliases=['tr'])
async def translate(ctx, lang, *, args):
    a = Translator()
    b = a.translate(args, dest=lang)
    await ctx.send(b.text)
#

oh :<

pale vessel
#

Iirc my friend had the same error

merry sorrel
#

so any other way?

jovial nexus
#

how can i have a different presence for each shard with internal sharding?

stuck dawn
#

how can i check if toBuy === {} and price === {}? I put this but it doesn't return

jovial nexus
#

!toBuy && !price ??

stuck dawn
#

i tryed that but it still logs {}

quartz kindle
#

you cant compare objects like that

#

an empty object is a reference, it exists

#

so its not false

stuck dawn
#

so i need to check length?

quartz kindle
#

and comparing to {} doesnt work because {} creates a new different object with a different reference

#

you can check key length yes

stuck dawn
#

ok

quartz kindle
#

setPresence({...}, shardID)

#

or whatever says in the docs

jovial nexus
#

i dont find it in the docs :((

quartz kindle
#

setPresence({..., shardID: number})

jovial nexus
#

ok thanks

tulip cradle
#
    message.channel.send('dm or bot not allowed')
   }```
```DiscordAPIError: Cannot execute action on a DM channel
quartz kindle
#

you're not ruling out dms completely

#

you're ruling them out only if a bot dms you

#

guild equals null AND bot

#

meaning if a user dms you, it will not pass that test

#

and continue normaly

tulip cradle
#
    message.channel.send('dosomethinghere')
   }```
quartz kindle
#

same thing

#

you're checking if the message is a dm AND if the user is a bot

#

the "dosomethinghere" will only run if BOTH are true

#

meaning these will not work: if is a DM but the user is not a bot, or if the user is a bot but its not a DM

stuck dawn
#

Tim have you ever used mongoose?

lusty quest
#

Mongoose is relatively easy to use

stuck dawn
#

i am new in mongoose i am trying to do a inventory system with an object and i want to store items and in the items i want to store the amount of that item

#

how can i do that

lusty quest
#

You can just do userid: String

#

Same for array

#

Did you know how to query the db?

stuck dawn
#

yes

#

i think

#

xD

lusty quest
#

For items you can use schema.push() if schema is already fetched

#

And inside push you pass your array variable

#

Sadly i cant help you with full efficency, i have to work soon and im on my phone rn

stuck dawn
#

ok thx

quartz kindle
#

nope never used mongoose

marble juniper
#

tim go back t- oh wait

quartz kindle
marble juniper
#

dev related question (obviously)

#

would ya say deno is worth using or not

#

this

#

I mean i used it before but

#

would u say its worth using it at all

#

lol

cinder patio
#

meh

quartz kindle
#

i heard good things about it

#

but i also heard bad things about it

earnest phoenix
marble juniper
#

deno needs you to add flags to the command to allow stuff like network or reading from the env

#

sounds useful for running in a sandbox

#

lol

earnest phoenix
#

and it uses URL imports instead of npm so there's no require

old cliff
earnest phoenix
#

but if you want to load node modules then there's websites like esm.sh that can compile js in the cloud and make it importable in deno

marble juniper
#

I heard though that deno is less stable for web servers

marble juniper
#

even made a deno package myself

#

and a small discord bot in deno

earnest phoenix
#

did you put it on deno.land/x?

marble juniper
#

also im trying postgres rn using deno too

marble juniper
quartz kindle
#

i heard somewhere that deno will never be faster than node because of how its designed

marble juniper
earnest phoenix
marble juniper
#

and node.js js and c++

#

so its not the same lol

#

I mean even then

earnest phoenix
#

but they're working on adding a native http api to deno

marble juniper
#

ye

#

I know that deno has a "node compatibility layer"

#

saw that in thier std module

earnest phoenix
#

their std repo is literally just node http apis made to work in deno

brittle axle
#
internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '/home/runner/Fun-Moderation-Bot/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
exit status 1
๎บง ```
earnest phoenix
#

here's a simple webserver made with std/http:

brittle axle
earnest phoenix
#
import { serve } from "https:/deno.land/std/http/server.ts";

const server = serve({ port: 8080 });

// we have top level await :)
for await (const req of server) {
  req.respond({
    body: "Hello World!"
  })
}
cedar citrus
#

How can i make one bot for activity, i mean if i write !On, bot begin to count time. and when i write !Off its finished. But i need bot counts and all time what i do since last 7 days and only the refresh.

earnest phoenix
#

Hello. I'm new and my bot just wont make embed text. Can someone help me pls ? I use discord.js

#

I cant write on my 1st acc where I also made my bot on bc I need phone number to Chat, but I already have my phone number conected with this acc

boreal iron
#

@quartz kindle Is there already a djs-light version available for djs 13?

old cliff
quartz kindle
#

its a bit behind on commits but it will be updated eventually

boreal iron
#

alright, great

lyric mountain
crimson vapor
#

O(n!)

quartz kindle
crimson vapor
#

shhh

quartz kindle
#

is there any real code thats actually o(n!)?

#

oh apparently there is

boreal iron
#

Does nodejs load the package.json automatically if found in the root path?

quartz kindle
#

node itself doesnt touch package.json

boreal iron
#

Need to get into npm and nodejs somehow since I'm gonna need to do more than 1 project with nodejs notlikenoot

#

Oh... so vscode does that for the people. That's what I saw on all these screenshots being shared in here probably

quartz kindle
#

does what?

boreal iron
#

creating node_modules in the project root path and downloading the dependencies

quartz kindle
#

npm does that

boreal iron
#

oh

#

errr... god damn I don't have time to get into that and deal with that shit, too

quartz kindle
#

lmao

#

just do npm init to create a package.json

lyric mountain
#

tim did u know this exists? https://www.geeksforgeeks.org/timsort/

quartz kindle
#

then npm install yourmodule all your shit

quartz kindle
#

lmao

boreal iron
#

yeah for now I just installed packages globally and used them in all projects, but now I need different version of the packages which requires to create separate modules for every project

#

more useless time and work to spend on

quartz kindle
#

projects should always use local versions of modules

#

otherwise you risk all sorts of issues

boreal iron
#

yeah NOW I know that, too

#

just had one project before only

#

Congratulations! You're my new "project-manager". I'm gonna send u bling-bling via PayPal and you gonna do the rest for me.

#

How do feel about your new responsibility?

green kestrel
#

looks like i might pass 100k servers the same time as 10 mil users ๐Ÿ˜„ that would be awesome ๐Ÿ˜„

boreal iron
#

๐Ÿ‘

boreal iron
#

Figured it out already, took me 2 minutes of my life time

#

You're fired!

quartz kindle
#

lmao

boreal iron
floral lichen
#

can someone help me

boreal iron
#

How does your master version include djs v13?

quartz kindle
#

wheres my settlement and employer benefit

boreal iron
floral lichen
#

i added my server on top.gg yesterday but when i searched it up today it didnt show up (it showed up in my profile but not in public search)

#

its not nsfw or 18+

quartz kindle
boreal iron
#
    "dependencies": {
        "discord.js": "12.5.3"
    }

Am I blind?

pale vessel
#

Are you on the master branch?

boreal iron
#

oh probably not I guess

#

@sinful belfry

sinful belfry
#

ty

boreal iron
#

๐Ÿ‘ still these annoying dudes

lyric mountain
#

hey @quartz kindle do you know db trigger stuff?

lavish bramble
#
const {MessageEmbed} = require("discord.js")

module.exports = {
  name: "ehelp",
  description: "reaction help",
  execute: async(client, message, args)=>{
    const emojis = [
      "โš”",
      "โš™",
      "๐Ÿƒ",
      "๐ŸŽƒ",
      "๐ŸŽŠ",
      "๐ŸŽญ",
      "๐ŸŽฎ",
      "๐ŸŽผ",
      "๐Ÿ‘‘",
      "๐Ÿ’ ",
      "๐Ÿ”",
      "๐Ÿ–ผ",
      "๐Ÿค–"
      ]
      
      const m = await message.channel.send({embed: {
        title: "Help Menu",
        description: "Which category you want to see!",
        color: "RANDOM"
      }})
for (const emoji of emojis) await m.react(emoji);
const reactionCollector = m.createReactionCollector(
		(reaction, user) => emojis.includes(reaction.emoji.name) && !user.bot,
		{ time: 120000 }
	)
	
reactionCollector.on('collect', reaction => {
reaction.users.remove(message.author);

if(reaction.emoji = "๐ŸŽƒ"){
  message.channel.send("Done!")
}
})
  }
}```
Error : if I react to any emoji its still sending done!
lyric mountain
#

like, I have a case where I need to update a row's ID column (which is referenced in other tables) so I created a before update trigger which inserts a new row with the new data and change references to that one

#

however, after all that is done I need to delete the original row and keep only the new one

#

is there anyway I can do that on after update?

lyric mountain
lavish bramble
lyric mountain
#

sending to any emoji?

lavish bramble
lyric mountain
#

reaction.emoji = "๐ŸŽƒ"

lavish bramble
#

Code is if I react to ๐ŸŽƒ then it sends done but I react to ๐Ÿค– and others emoji its still sending dine

lyric mountain
#

you're assigning not comparing

lavish bramble
#

How can I fix

lyric mountain
#

===

lavish bramble
#

Still

lyric mountain
#

assignment always return the new value, which in javascript will always be true except for null, undefined, [], '' or alike

#

you need to compare

pale vessel
#

[] is truthy

lyric mountain
#

empty stuff is always falsey

pale vessel
lyric mountain
#

you're comparing types also

boreal iron
#

can't npm just install github modules without git?

lyric mountain
#

don't think so since there's no way to get repo stuff without git

pale vessel
#

npm i https://github.com/username/repo/tarball/branch

lyric mountain
#

ah ye, tarball

boreal iron
#

yeah you copied the example from the site I tried as well, but no

#
npm install https://github.com/timotejroiko/discord.js-light/tree/master
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
pale vessel
#

https://github.com/timotejroiko/discord.js-light/tarball/master

boreal iron
#

Oh ๐Ÿคฆโ€โ™‚๏ธ I see... missed to convert it into tar

#

... well ty

lyric mountain
#

why tar tho?

#

like, tar?

lavish bramble
#

Fixed thnx to all

boreal iron
#
    "version": "4.0.0-dev",
    "dependencies": {
        "discord.js": "github:discordjs/discord.js#dec191aa1e4f22690285ca06c6eee7e6086b2930"
    }

yeah finally I'm on the correct version

#

Is there a FAQ about v12-v13 differences already?

lyric mountain
#

is there a v13 already?

round cove
#

No.

pale vessel
lyric mountain
#

hm, true

pale vessel
#

yeah

#

hold on

boreal iron
#

ah nvm got it

tulip knoll
#

When I try to run the code locally, it works, but after I deploy the bot to Heroku, it doesn't connect to VC.

But rest all commands work, except join and leave.

Please Help :')

@client.command()
async def join(ctx):
channel = ctx.author.voice.channel
embed=discord.Embed(title="Joined", color=0x000000)
embed.set_thumbnail(url="https://media.tenor.com/images/16972299a4e2fb332170398ef2fdd7c2/tenor.gif")
embed.add_field(name='Connected To -', value=f'{ctx.author.voice.channel}')
await channel.connect()
await ctx.send(embed=embed)

I have imported the following

import discord
from discord import colour
from discord.ext import commands, tasks
from discord.ext.commands import bot
from discord.ext.commands.core import has_permissions
from discord.gateway import DiscordClientWebSocketResponse
from discord.voice_client import VoiceClient
import youtube_dl
import asyncio
from random import choice, random

Requirements -

discord.py==1.7.2
youtube-dl==2021.6.6
asyncio==3.4.3

viscid merlin
#

first of all, dont use heroku

#

its a real pain in the ass to work with

tulip knoll
wary flame
#

There are no good free hosting services

viscid merlin
#

im trying to remember this one hosting server that gave me like 6 GB memory and 30ms ping

#

for free

wary flame
#

repl.it downs your process when there's no web activity right?

viscid merlin
tulip knoll
tulip knoll
slender thistle
#

That's why uptimerobot is used

slender thistle
tulip knoll
pale vessel
slender thistle
#

Since when what

#

Does it support opus

pale vessel
#

There's an ffmpeg buildpack for ages

slender thistle
#

Eh well

drifting wedge
#

how make subdomain with flask

#

and cloudflare and nginx?

crimson vapor
#

use cf to route it to your vps then use nginx to route the subdomain to the port

drifting wedge
#

ok

#

ty

lavish bramble
#

How can I get all commands of a directory

old cliff
lavish bramble
#

Like
Commands/mod/files

old cliff
#

My music boat runs on heroku

crimson vapor
#

flazepe explained that

old cliff
#

Didn't read

gritty bolt
#

im trying to make a simple bot to show the stats of my minecraft server every minute but I keep getting undefined errors when i try to reference anything in the returned JSON, anyone know a fix?

const response = await got('https://api.mcsrvstat.us/2/ip_redacted');
    console.log(response.body);
    const data = JSON.parse(response.body)
    if(data.online == "true") {
      let onlineEmbed = new discord.MessageEmbed()
      .setTitle("Online")
      .setColor("#BFFF00")
      .setPicture("./icon.png")
      .addField("IP Address:Port", data.ip)
      .addField("Port", data.port)
      .addField("MOTD", data.motd.clean)
      .addField("Player Count: " + data.players.online + "/" + data.players.max, data.players.list)
      .addField("Server Version", data.version);
      message.edit(onlineEmbed)
    }```
```TypeError: Cannot read property 'online' of undefined```
old cliff
#

Data is undefined

gritty bolt
#

how do I define it

old cliff
#

Try logging it

gritty bolt
#

i got the same thing when i'd do response.body

#

but response.body isn't empty

#

I logged data and I got this

  ip: 'redacted',
  port: redacted,
  debug: {
    ping: false,
    query: false,
    srv: false,
    querymismatch: false,
    ipinsrv: false,
    cnameinsrv: false,
    animatedmotd: false,
    cachetime: 1623252086,
    apiversion: 2
  },
  online: false
}```
old cliff
#

Response body or data?

gritty bolt
#

data

old cliff
#

Use semi colons at line endings

crimson vapor
#

semicolons are not needed in JS

pale vessel
#

ok berry

crimson vapor
#

oikhjawdhjo[iawdiohjawd

drifting wedge
#

subdomain flask no worky worky

#

i added the cname to cloudflare

#

added the subdomain="" thing

#

and also added nginz

#

nignx

#

HALLP

crimson vapor
#

are you getting 500 from cf?

drifting wedge
#

redirect too many times

crimson vapor
#

your nginx is probably setup wrong

drifting wedge
#

the base domain works

#

jsut the subdomains dont

crimson vapor
#

show the config

drifting wedge
#

wait

#

me have idea for fixy fixy

#

no worky

gritty bolt
#

why is this function not running even though data.online is false?

if(data.online === "false") {
      console.log("The server is offline.");
      let onlineEmbed = new discord.MessageEmbed()
      .setTitle("Offline")
      .setColor("#FF0000")
      .setPicture("./icon.png")
      .addField("IP Address", data.ip)
      .addField("Port", data.port);
      message.edit(offlineEmbed)
    }```
drifting wedge
#
  GNU nano 4.8                                                                         domain.xyz                                                                                    
server {
    listen 80;
    listen [::]:80;
    server_name domain.xyz www.domain.xyz status.domain.xyz profile.domain.xyz payments.domain.xyz gift.domain.xyz admin.domain.xyz api.domain.xyz dashboard.domain.xyz me.domain.xyz>
    return 302 https://$server_name$request_uri;
}



server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;

    server_name domain.xyz www.domain.xyz;
    add_header X-XSS-Protection "1; mode=block";

    location / {
        include proxy_params;
        proxy_pass http://localhost:6969;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;

    server_name domain.xyz dashboard.domain.xyz;
    add_header X-XSS-Protection "1; mode=block";

    return 302 https://dashboard.domain.xyz/;
}```
#

@crimson vapor

#

this is only a part of it

#

cuz its so long

crimson vapor
#

what are you trying to do?
archbot.xyz -> localhost:6969?

drifting wedge
#

yeah

#

that works

#

only subdomains, dont

#

and idfk how to make them worky worky

crimson vapor
#

doesn't look like you have any setup

drifting wedge
#

how so?

crimson vapor
#

did you mean to put real domains there?

drifting wedge
#

i edited it

#

cuz its supposed to be a secret lmfao

#

but whatever

#

it has the real domains

crimson vapor
#

oh

drifting wedge
#

so why isnt it working?

#

i added the cname to cloudflare

crimson vapor
#

www.domain.xyz seems like its working fine

#

dashboard is looping tho

drifting wedge
#

i dont have those in the bot yet

#

im using the payment one

crimson vapor
#
server {
    listen 80;
    listen [::]:80;
    server_name domain.xyz www.domain.xyz status.domain.xyz profile.domain.xyz payments.domain.xyz gift.domain.xyz admin.domain.xyz api.domain.xyz dashboard.domain.xyz me.domain.xyz>
    return 302 https://$server_name$request_uri;
}
``` its probably this block right here
drifting wedge
#

like i ddidnt add it yet

crimson vapor
#

its rediecting back to its self

#

which is gonna loop

drifting wedge
#

so i remove all the extra domains?

#

like the subdomains?

crimson vapor
#

why not just move them to this block

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;

    server_name domain.xyz www.domain.xyz;
    add_header X-XSS-Protection "1; mode=block";

    location / {
        include proxy_params;
        proxy_pass http://localhost:6969;
    }
}
drifting wedge
#

oh

#

i dont understand nginx well

#
    listen 80;
    listen [::]:80;
    server_name archbot.xyz www.archbot.xyz;
    return 302 https://$server_name$request_uri;
}



server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;

    server_name archbot.xyz www.archbot.xyz;
    add_header X-XSS-Protection "1; mode=block";

    location / {
        include proxy_params;
        proxy_pass http://localhost:6969;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;

    server_name archbot.xyz dashboard.archbot.xyz;
    add_header X-XSS-Protection "1; mode=block";

    return 302 https://dashboard.archbot.xyz/;
}```
#

now its this

crimson vapor
#

looks like dashboard is redirecing to its self

drifting wedge
#

what do i do there tho?

#

i see what u mean

crimson vapor
#

are you just trying to make it go to the webserver?

drifting wedge
#

yes

crimson vapor
#

all of them?

drifting wedge
#

all of the subdomains?

#

yes

crimson vapor
#

I think you should be able to do

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/cert.pem;
    ssl_certificate_key     /etc/ssl/key.pem;

    server_name archbot.xyz *.archbot.xyz;
    add_header X-XSS-Protection "1; mode=block";

    location / {
        include proxy_params;
        proxy_pass http://localhost:6969;
    }
}```
earnest phoenix
gritty bolt
#

yea i just figured that out

drifting wedge
#

BUT

#

its not using the subdomain

crimson vapor
#

but?

drifting wedge
#

like it just ignores the subdomain

#

so like if u go to like

#

dashboard.domain.xyz it treats it as domain.xyz

#

basically

#

i think i didnt explain enuf

crimson vapor
#

am not sure then

drifting wedge
#

hmm

lyric mountain
#

that means "everything that ends in domain.tld should be handled here"

boreal iron
#

If thereโ€™s no wildcard set or the actual hostname for the subdomain the route will fail

#

Since thereโ€™s no target

earnest phoenix
#

if i have a <div/> with contenteditable="true" how do i detect when the content changes?

drifting wedge
#

Wait ok I'm super confused

#

I have a specific set of subdomains

#

How do I like allow them to pass thru to flask

#

Ping me please

earnest phoenix
#

im using react

lyric mountain
drifting wedge
#

I'm using nginx and flask

#

In flask, theyres a subdomain="" thing

lyric mountain
#

like, you can just get the current url

#

or pass the original url as a custom header in nginx

drifting wedge
#

In what?

#

I don't understand nginx well

#

Can u like dumb it down?

boreal iron
#

That has nothing to do with NGINX

#

Itโ€™s about your DNS settings

drifting wedge
#

Ok how so?

#

I have the subdomains set with cname

solemn latch
#

๐Ÿ‘€ with cname?

drifting wedge
#

Cname records?

solemn latch
#

you want the subdomain to be a different endpoint entirely right? youd use A records for that.
cname is just an alias.

boreal iron
#

Check if you have actually setup a wildcard hostname

solemn latch
#

unless i dont understand my records.

drifting wedge
#

I think ur right

#

But then what do I do with nginx?

lyric mountain
#

nothing at all

drifting wedge
#

Ok lemme try

#

Thanks

olive remnant
#

Dammit, wrong channel, huh

boreal iron
drifting wedge
#

No

lyric mountain
#

nginx will just supply the proper content for the specified url

boreal iron
#

Well then extra records are not required

lyric mountain
#

kinda like a mailman

boreal iron
#

Just add a wildcard A(AAA) record with the same target as your domain

lyric mountain
#

use cname for subdomains

boreal iron
#

Bullshit

drifting wedge
#

A RECORDS OR CNAME

solemn latch
#

if you want them to be an alias, you use a cname

drifting wedge
#

I'm going crazy here

boreal iron
#

Whatโ€™s so complicated to create a wildcard record?

#

If you wanna route all possible domains to your webserver. You can then use and define any subdomains in NGINX you want

lyric mountain
#

this is mine for example

#

all 3 point to the A record

drifting wedge
#

It's not an alias tho

#

It's a different endpoint kinda

lyric mountain
#

nope, same address

boreal iron
lyric mountain
#

like

#

api.domain.tld
socket.domain.tld
www.domain.tld

#

this is the case here

boreal iron
#

You usually create 2 CNAME records for www and ftp

#

As well as pop, smtp etc. if you actually need it

#

CNAME record with the actual identical target are nonsense

#

Just takes more time to resolve than an A record (wildcard)

lyric mountain
#

except you can use the address on nginx to redirect to different endpoints

drifting wedge
#

I made the a records

lyric mountain
#

so even if all 4 in my example point to the same address, they're effectively 3 different endpoints (www doesnt count)

solemn latch
#

afaik, typically you want endpoints to be separate a records.

lyric mountain
#

that if you use different ips

solemn latch
#

well, it functions, it doesnt mean its right

valid island
#

is EasyApplications down right now? havent been able to use it in almost 3 days

lyric mountain
#

what?

#

ig you're in the wrong server

solemn latch
#

id wrongserver, but i have no idea if thats even a bot ๐Ÿ‘€

boreal iron
#

The CNAME record actually makes sense to redirect your FQDN to an external target

valid island
#

woops, my bad. my buddy sent me this discord and told me to ask here, thanks guys!

gritty bolt
#

how do I make the response of a slash command only visible to the user that ran it?

boreal iron
lyric mountain
#

ephemeral messages

gritty bolt
#

how do I do that

#

i have this right now

#
client.api.interactions(interaction.id, interaction.token).callback.post({
    data: {
      type: 4,
      data: {
        content: "text here"
      }
    }
  })
}
});
#

what would I need to change?

drifting wedge
#

how do i make one?

#

with cloudflare

#

*?

#

wildcard a record?

#

it shows the server ip tho

boreal iron
#

Yeah same target as your domain

#

Huh Iโ€™m not dealing with cloudfare, canโ€™t actually tell you

gritty bolt
#

does anyone know how to send an ephermeral message

#

like i cant find anything

drifting wedge
gritty bolt
drifting wedge
#

whats that

gritty bolt
#

a message only you can see

drifting wedge
#

oh

gritty bolt
#

that disappears

drifting wedge
#

so like clyde

gritty bolt
#

yea

drifting wedge
#

cool

gritty bolt
#

i cant find anything on them though

crimson vapor
#

#:~:text=

#

my favorite

lyric mountain
#

there

crimson vapor
#

why removed

#

smh

boreal iron
#

All this new trash features nobody needs oldEyes

crimson vapor
#

the text highlighting is pog tho

boreal iron
#

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

lyric mountain
#

like, client-side arg check and messages are really nice

crimson vapor
#

@solemn latch

lyric mountain
#

but idk, could've been done better

earnest phoenix
#

how to change this preview

gritty bolt
#

i have one that just sends a message, but how do I make that message that type

lyric mountain
#

look around slash cmd stuff

#

since they can only be sent as a slash cmd response

gritty bolt
#

thats a response to a / cmd

lyric mountain
#

ephemerals can only be sent that way

#

that from way I read

boreal iron
#

@gritty bolt

{
"response_type": "in_channel",
"text": "It's 80 degrees right now."
}

{
"response_type": "ephemeral",
"text": "It's 80 degrees right now."
}

#

Should be obvious what is what oldEyes

gritty bolt
#

how would that go into my code though

lyric mountain
boreal iron
#

Just add the response type to the data json string and test it okeh

#

0% creativity

#

poor cat

drifting shell
#

uploading files with ssh is scp filename.extension user@host:~ right? to upload to the users home directory

stable eagle
#

I installed pm2, but it says the cmd pm2 is not found?

boreal iron
#

There you go

#

Interaction responses can also be publicโ€”everyone can see itโ€”or "ephemeral"โ€”only the invoking user can see it. That is determined by setting flags to 64 on the

#
client.api.interactions(interaction.id, interaction.token).callback.post({
    data: {
      type: 4,
      data: {
        content: "text here",
        flags: 64
      }
    }
  })
}
});
#

Thatโ€™s enough?

#

@gritty bolt & @lyric mountain

#

Get your cat out there! okeh

gritty bolt
#

ohh thats all I needed?

boreal iron
#

Reading docs is all you need, yes

lyric mountain
boreal iron
#

Your system even suggests to install pm2 if you wanna use it

#

๐Ÿคฆโ€โ™‚๏ธ One more bot server in the verseโ€™ yay

sick agate
#

try npx pm2

opaque seal
drifting wedge
#

@lyric mountain ok so if I only want to add 1 subdomain

#

Right

#

And it not be a alias

#

Aka not redirect to the base domain

#

What do u do?

lyric mountain
#

I use an A record for master domain and CNAME for subdomains

#

but that's up to you ig

boreal iron
#

Oh no it begins again

lyric mountain
#

either way you get the same result

boreal iron
#

Resolving your CNAME record to an internal A record notlikenoot

solemn latch
#

๐Ÿ‘€

boreal iron
solemn latch
#

but dev and general are my two main channels angeryBOYE

boreal iron
#

Canโ€™t troll if youโ€™re around

solemn latch
boreal iron
#

Great! Letโ€™s begin smirk

solemn latch
#

trolling is ok, trolling people about site function can make users leave top.gg for no reason isnt.

pale vessel
#

Did you mean to put "isn't" at the end

solemn latch
#

ty

boreal iron
#

I'm a good buy! boy!

solemn latch
#

I may or may not be playing valorant.

boreal iron
#

oops

#

English are not very good today, please soory

boreal iron
drifting wedge
#

I mean I just want to understand how it works

#

Ok so in theory, if I wanted to make for instance a admin subdomain

#

How do I go about doing that @boreal iron

boreal iron
#

Is the target of domain.com the same as sub.domain.com? Target IP/FQDN (server)

#

For example:

ftp    Alias (CNAME)    www
@    Host (A)    255.255.255.255
*    Host (A)    255.255.255.255
mail    Host (A)    255.255.255.255
www    Host (A)    255.255.255.255
#

As long as the target of domain.com and sub.domain.com is (always) the same, just add a wildcard A(AAA) record.

drifting wedge
#

It's the same server

boreal iron
#

You can then configure your webserver to listen to any endpoint (FQDN) you want, for example woo-is-weird.domain.com

drifting wedge
#

Ok so like

#

Right

boreal iron
#

It's needed anymore to add records for the "endpoints" you wanna define.

drifting wedge
boreal iron
#

You can also use paths as endpoints, however you wan't

boreal iron
#

For example

ServerName domain.com
DocumentRoot "/var/www/domain.com"

ServerName endpoint1.domain.com
DocumentRoot "/var/www/endpoint1.domain.com"
or
DocumentRoot "/var/www/domain.com/enpoint1"```
#

Of course just in the right syntax for your webserver software.

earnest phoenix
#

Hello, What should I do for making voter only commands? djs btw

near stratus
earnest phoenix
#

How

near stratus
earnest phoenix
#

So it's like

let user = topggApi.hasVoted();
if(!user) return;```
#

?

earnest phoenix
#

then?

earnest phoenix
opal plank
earnest phoenix
#

Hmm Yeah. But a little bit confused about it.

opal plank
#

how is it confusing

#

its a function parameter

earnest phoenix
#

Ohk

opal plank
#

also

#

its a promise

#

handle it properly

earnest phoenix
#

Oh Ok

near stratus
#
let Has_The_User_Voted_The_Bottum_On_Top_G_G = await  api.hasVoted(user.id)
#

@earnest phoenix

earnest phoenix
#

I see ok

opal plank
#

i would disencourage doing that tho

#

and using a database + webhook instead

#

so you dont massivelly spam topgg's api

near stratus
#

^

earnest phoenix
#

I am planning to make that for my entire music commands. The bot is multi purpose tho

near stratus
#

save to db

#

then fetch it

earnest phoenix
#

Oh Ok

opal plank
# earnest phoenix Oh Ok

thats also another thing i would dis-encourage. Multi purpose bots dont do well anymore , been like that for a few years now. If u doing it for fun, keep going, but if u doing to in the hopes of getting a lot of servers, this is not the right approach

near stratus
#

and btw
discord.js is BAD
Switch to erwin.js aka DETRITUS.js

earnest phoenix
earnest phoenix
#

I need honest review on voting commands from my users

earnest phoenix
boreal iron
earnest phoenix
#

just use discord.js light lol

opal plank
sterile lantern
#

alright so i have a index.html page. how would i have https//website.com/home use the index.html page?

#

without making a home.html bc i constantly update index.html so itd be annoying to update bothj

lyric mountain
#

hmmm index.html is actually the first place you're sent to in web stuff

boreal iron
#

Depends on the webserver configuration or htaccess but yes - usually yes.

#

You can also use rewrite rules to create an imaginary folder system but it will automatically add .html behind for example

#

Or pass the path as parameter

#

The possibilities are โ€œendlessโ€

opal plank
#

doesnt express routers accept regex/fills?

#

i could've sworn it had

#

1 sec

#

oh yeah it does use path-to-regex

crimson vapor
#

expressjs moment

opal plank
#

koa better tho

quartz kindle
#

uwebsockets > nanoexpress > 0http > restana > fastify > koa > express

quartz kindle
#

yeas

opal plank
#

or YouWeebSockets

crimson vapor
#

weebsockets when?

deep linden
#

Hello people. I am having a problem in getting my Bot to clouds. I ran my code on the The amazon EC2 server. Some commands require an get request from a rest API outputting a json file. But the get requests arent going through. Any solutions?

#

Like every other commands without a get request is working fine. Just the commands involving a get request isnt outputting anything

old cliff
quartz kindle
# crimson vapor weebsockets when?
// package.json
{
  name: "uWeebSockets",
  description: "Same as uWebSockets but for weebs",
  main: "index.js",
  dependencies: {
    uWebSockets: "*"
  }
}

// index.js
module.exports = require("uwebsockets");
#

npm publish

earnest phoenix
old cliff
#

?

crimson vapor
#

@ripe prairie

quartz kindle
#

nice scam

deep linden
#

lmao i fucked up my steam ac one with this.

deep linden
quartz kindle
#

the command that doesnt work

deep linden
#

Dming ya wait a sec

quartz kindle
#

if it doesnt have any sensitive info its better to post here so other people can input their thoughts

deep linden
#

Okay

#

I am a noob programmer. So ignore the noob ness lol..

#

also EC2 works in the UTC time. I am GMT +5:30hrs if that might have created the issue.

#

Everything works perfectly fine when the code runs in my laptop. Idk whats the issue with EC2

slender thistle
#

Firstly use aiohttp with d.py

lament rock
#

time to make my own tcp socket layer and have the states and messages and methods be fucking cursed

#

weebsockets

slender thistle
#

Otherwise the command seems alright

deep linden
#

Command is right bud. As i told above, everything works fine in my laptop.

quartz kindle
#

try logging the request result to see if the website is accessible from EC2

#

its possible that the website is blocking EC2 for some reason

deep linden
#

Oh maybe!

#

how to do that.

quartz kindle
#

do you have access to a console/terminal?

deep linden
#

Yep

quartz kindle
#

you can print the request body

deep linden
#

Oh the request status you meant?

quartz kindle
#

ye

#

both status and body

deep linden
#

Oh lemme see.

quartz kindle
#

r.text should be the body

deep linden
#

r.status()

slender thistle
#

requests with d.py insert visible screeching noises

drifting shell
#

im getting illegal base64 character 3f but the thing is that a normal online base64 decoder decodes it just fine

#

its an image

#

ive tried it with and without the data:image/png;base64, at the start of it

deep linden
#

now it is giving my connection time out. Smh. This EC2

deep linden
#

Responce-403. ยฏ_(ใƒ„)_/ยฏ

sudden geyser
#

Forbidden!

deep linden
#

Yeah. Ikr.

#

So the site is not allowing any foreign server queries!

thick coral
#

I need help

#

With give away bot

tacit verge
#

anyone with any idea how to manage VNC please DM me

surreal scroll
#

Does anyone know how to dm a person by their user id?

#

Python btw

solemn latch
#

fetch the user, send to the user like normal

surreal scroll
#

User.send(text)?

#

I have the ids

pale vessel
#

Yes

#

Assuming User is the fetched user

surreal scroll
#

Yes it is fetched

slender thistle
#

imo use get_user if you cache users

#

if it's None (meaning there's no mutual guilds with the user) then don't send the message

surreal scroll
#

I canโ€™t cache user

slender thistle
#

Not poggers

surreal scroll
#

Replit doesnโ€™t have much memory

surreal scroll
slender thistle
#

Ah Inwee

#

A I see

surreal scroll
gritty bolt
#

would anyone know a reason why my bot would work in one channel, but after making a new one and replacing the old id with the new one, it wouldn't?

#

okay i've actually narrowed it down to heroku, would there be any reason that it just wouldn't be running on there?

lament rock
#

that returns a DM channel, in which you'd send the message to the returned channel

lament rock
gritty bolt
#

no but i figured out that vscode just didnt commit anything i did

#

and thats why

lament rock
#

love it

shy stream
#

is this channel restricted to development help pertaining to using discord's api itself (or using a wrapper), or can I ask questions about general development for my bot not necessarily related to discord api?

solemn latch
#

it can be for anything development related, however most people are best prepared to answer discord bot related questions, so you may not get an answer

radiant charm
#

@hexed zinc can you send me the wikihow command?

#

the random wikihow article

hexed zinc
crimson vapor
#

@scenic kelp

hasty mulch
#

Which VPS is actually like a virtual desktop? Digital Ocean is only a console

opal plank
#

and xfce4

#

boom, your linux is now a "virtual desktop"

hasty mulch
#

On Digital Ocean, correct?

opal plank
#

im pretty sure every major hosting vps allows u to boot whatever OS u want in it

#

its regardless of vps my dude

#

its like asking if your pc is AMD or NVIDIA, like it matters, if you want to watch youtube

hasty mulch
#

Ok

prime mist
opal plank
#

little?

#

its a massive waste

#

just ssh into it

prime mist
#

Way past SSH. Use docker and kubernetes lol.

opal plank
#

unless you using it for gaming(which you would've chosen a windows os instead, if that were the case)

#

fuck kubernetes

#

just VSC into it

#

vsc + ssh

hasty mulch
#

Does ssh'ing require me to open a port on my firewall?

opal plank
#

yes

rocky pulsar
#

Guys I just got muted the dumbest way possible-

opal plank
#

you need a port for incoming connections

latent heron
#

this is probably a bad way of coding an INI reader

#

but it'll do for now

prime mist
rocky pulsar
#

Someone posted a pic of their cat and I said I wanna eat it- and i got muted lol

opal plank
#

ssh WOULD be the best option, yeah

hasty mulch
#

Shit, can't do that because I don't own the router

opal plank
#

specially if your bots store stuff in there

#

imagine having a non secure environment for bots

#

rip all user data

hasty mulch
#

I'm looking to transfer all my bots to the VPS temporarily due to my internet timing my current box out randomly

hasty mulch
#

And host the bots on the VPS

opal plank
#

any decent provider show allow u to open ports

prime mist
hasty mulch
opal plank
opal plank
#

u using digital ocean

#

why would it matter about what ISP they use or not

prime mist
hasty mulch
#

I'm talking my HOME internet

opal plank
#

are you hosting your ssh server there?

hasty mulch
#

That's what you said

opal plank
#

you asked on digital ocean

#

not in ur home

#

you dont need any setup on ur personal pc

#

just install putty and ssh into your vps

#

i sure hope they have it setup for you, cuz otherwise you'll be in a world of pain

hasty mulch
#

Yeah

opal plank
#

you could use openssh too

#

but putty prob a bit better

prime mist
#

It's been a while since I have used DO, but don't they install your SSH key into the VM for you?

#

Don't even need to setup an SSH server.

lavish bramble
#
const Schema = require('../../models/custom-command');
const { MessageEmbed } = require('discord.js');
module.exports = {
	name: 'cc-list',
	description: 'list of custom commands',

	execute: async (client, message, args) => {
		const data = await Schema.findOne({ Guild: message.guild.id });

		if (!!data === false)
			return message.channel.send('**There is no custom commands**!');

		message.channel.send(
			new MessageEmbed()
				.setTitle('Custom Commands list')
				.setColor('RANDOM')
				.setFooter(message.author.username, message.author.displayAvatarURL())
				.setDescription(
					data.map((cmd, i) => `${i+ 1}: ${cmd.command}`).join('\n')
				)
		);
	}
};

Error : data.map is not a function

rocky hearth
#

what is github's new codespace is all about?

near stratus
rocky hearth
#

like github1s?

rocky hearth
lavish bramble
#

I got this when I just use data

#

data

#

So how can I get list of all cc-command

rocky hearth
#

depends, on how u hv structured ur db

#

do u hv a global, commands collection?

lavish bramble
#

Nope mongodb

#

String

quartz kindle
#

because you used findOne

#

so you get one

hoary crown
#

the links part

split cipher
#

Does anyone here know how to escape a variable in RegExp?

    let string = `dog "cat" fish`
    let mark = `"`
    let quoted = new RegExp(`${mark}[^${mark}]+${mark}`, `g`)
    let quotes = string.match(quoted)
    console.log(quotes) // result: ['"cat"']

Above is valid when the mark is ".
However, when I want to mark to be ^^, the result is null.

How do I make the result ["^^cat^^"] if the string is dog ^^cat^^ fish?

prime mist
split cipher
#

got it solved on the other server, thanks tho

latent heron
#

sometimes my genius

#

it's almost frightening @crimson vapor

stuck pagoda
#

suggest me a command asap

copper cradle
#

random dog images command

earnest phoenix
#

a command that generates 0.001px x 0.001px on a 1000 x 1000 canvas randomly

#

a command that runs itself

earnest phoenix
slender thistle
#

desk slam, visible screeching

latent heron
#

i do

#

an exception and also an enum relying for HTTP status codes in case i have to throw one outside of my main scripts

#

easy to infer upon

#

although it's 4 in the morning

#

i'm losing my shit slowly

#

i think i'm writing worse code by the minute now

earnest phoenix
#

is an embed generator worse than writing a file reading class?

#

because im making one

latent heron
#

well i have to make a feeder for sanity checking

#

which is what I feel like the computer needs to do it me more right now

#

and not to it

lavish bramble
#
if(message.content.includes(a)){
    const data = await schema.findOne({Guild: message.guild.id, Command: a})
    if(data) message.channel.send(data.Response)
  }```
Its not sending any message
#

I want to make it wildcard

lusty quest
#

how does your schema looks like?

#

also it should be parsed as a object on data, so if you dont have a Response property it should be undefined

earnest phoenix
#

Hi I want to make a music bot. I got him to join the vc but he doesnt play the Musik can you guys help me ?

near stratus
earnest phoenix
#

Ok xD

lusty quest
#

so you wasted 36 Hours in a plane

near stratus
earnest phoenix
lusty quest
#

it would help us to help you if we knew some stuff
like what language you use and lib
and if you get errors

near stratus
#

and the code

#

Which produces the error

earnest phoenix
#

Ah I just fixed it but thanks that u guys wanted to help me

marsh bluff
#

Let's say that I have an array of guilds. How can I divide it into 2 or more arrays, where each array has similar (or in an ideal world, equal) total sum of guilds' member counts? Pseudo code would be really appreciated

cinder patio
#

There are a few ways to do it

quartz kindle
cinder patio
#

๐’น๐’พ๐“ˆ๐‘”๐“Š๐“ˆ๐“‰๐’พ๐“ƒ๐‘”

earnest phoenix
latent heron
copper cradle
lusty quest
#

@drowsy crag

copper cradle
#

smh I was gonna ping nom

rustic nova
#

yeeted alr

tulip knoll
#

hey, i'm using repl.it to run my bot but it's showing some errors, i've installed all the modules required

#

it's working fine on VS Code ;-;

vivid fulcrum
#

are you sure you have the correct py version

sick agate
#

try python

near stratus
#

Yeah too much real

sick agate
#

py launcher works for windows

near stratus
#

@earnest phoenix bro you okay?
You've been typing for like 10 minutes

earnest phoenix
#

Hello. I need help with an reaction poll (I dont use it as a poll) and thats why I want the @ to get out of there, but I just cant do it. Like it says : @earnest phoenix won the poll (I change the answer later so it doesnt say "the poll") but I want it to be like "won the poll" (bc as I already said I wanna use it for something else

earnest phoenix
near stratus
#

...

earnest phoenix
#

Then I had to make it english again

#

XD

near stratus
earnest phoenix
#

Yes

lusty quest
#

we still dont know the language / lib you use

earnest phoenix
#

Bc I want to use it for something else

near stratus
#

Show code where you do it

earnest phoenix
#

Ok

#

Wait

near stratus
#

||Please don't bring assembly||

earnest phoenix
#

I just realised that it ist a poll more like a vote

lusty quest
#

Assembly: When you want to reinvent the Wheel for doing basic stuff.

earnest phoenix
#

message.react('๐Ÿ‘').then(() => message.react('๐Ÿ‘Ž'));

const filter = (reaction, user) => {
return ['๐Ÿ‘', '๐Ÿ‘Ž'].includes(reaction.emoji.name) && user.id === message.author.id;
};

message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();

	if (reaction.emoji.name === '๐Ÿ‘') {
		message.reply('won.');
	} else {
		message.reply('won.');
	}
})
.catch(collected => {
	message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
});
lusty quest
#

pls use a codeblock next time

earnest phoenix
#

I did i thaugth

lusty quest
#

bcs sometimes discord fucks with code

earnest phoenix
#

`message.react('๐Ÿ‘').then(() => message.react('๐Ÿ‘Ž'));

const filter = (reaction, user) => {
return ['๐Ÿ‘', '๐Ÿ‘Ž'].includes(reaction.emoji.name) && user.id === message.author.id;
};

message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();

    if (reaction.emoji.name === '๐Ÿ‘') {
        message.reply('won.');
    } else {
        message.reply('won.');
    }
})
.catch(collected => {
    message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
});`
#

Bruh

near stratus
#

with message.channel.send

lusty quest
#

you need 3 of them

#

for a codeblock

earnest phoenix
#

Oh

near stratus
#
message.react('๐Ÿ‘').then(() => message.react('๐Ÿ‘Ž'));

const filter = (reaction, user) => {
    return ['๐Ÿ‘', '๐Ÿ‘Ž'].includes(reaction.emoji.name) && user.id === message.author.id;
};

message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
    .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === '๐Ÿ‘') {
            message.channel.send('won.');
        } else {
            message.channel.send('won.');
        }
    })
    .catch(collected => {
        message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
    });
#

fixed

earnest phoenix
#

const filter = (reaction, user) => {
    return ['๐Ÿ‘', '๐Ÿ‘Ž'].includes(reaction.emoji.name) && user.id === message.author.id;
};

message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
    .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === '๐Ÿ‘') {
            message.reply('won.');
        } else {
            message.reply('won.');
        }
    })
    .catch(collected => {
        message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
    });```
#

Wtf it no work for me

lusty quest
#

it works

#

you just dont added syntax highlighting

near stratus
earnest phoenix
#

I did

#

But it still didnt work

near stratus
earnest phoenix
#

Ok thx

#

Let me try

#

hello how cn we update node in terminal

#

pls say

#

i use node 12 now i want use node 14 so

#

pls say

near stratus
quartz kindle
#

which terminal

#

what hosting