#development

1 messages · Page 1758 of 1

opal plank
#

either way, good luck

crimson vapor
placid iron
pale vessel
crimson vapor
#

@quartz kindle you were the one that mentioned a chrome extension that hides old tabs and puts them in a separate area to conserve cpu and memory?

green kestrel
#

hmm

#

seems tons of people think cancelling a subscription to a subscription service will cancel it at the end of the month, even when it says on the screen that it will be cancelled immediately.

#

is it really that normal that cancelling your subscription gives you a grace period? I mean iirc Apple TV and Amazon etc don't do this?

vivid fulcrum
#

is it really that normal that cancelling your subscription gives you a grace period
i mean, yeah

#

you pay for the whole month, you get the whole month

#

spotify and netflix do this

#

it might have something to do with the billing cycle

green kestrel
#

I purposefully set mine like this

#

as in without that grace period

#

and it clearly says so before they cancel

#

but it happens over and over that they just don't read

#

I mean it's a financial transaction do people really not read that

vivid fulcrum
#

end users are genuinely dumb

#

try bringing more attention to the text?

green kestrel
#

it's not in my control

vivid fulcrum
#

oh

green kestrel
#

that's on the payment gateway side

#

oddly enough very few ask for a refund or anything

rocky hearth
#

in react, Can/Should I give a key to both single same element which is rendered on a condition
Like,

isTrue ? <Button key={1} x={100} /> : <Button key={1} y={200} />
#

will this effect/improve anything?

vivid fulcrum
#

you can, but it doesn't matter iirc

#

however

#

if you have a use case like the code snippet you provided

#

instead of conditional rendering, do conditional props

rocky hearth
#

actually I hv more attributes to paas, which are completly different

vivid fulcrum
#

ah

crimson vapor
#

ah ty

rocky hearth
#

Like this?

 <Button { ...(isTrue ? {x: 100} : {y: 200}) } />
sudden geyser
#

[PostgreSQL] I'm using deferrable foreign keys to try resolving a circular reference issue where I can't insert or remove data since two keys depend on each other.

I have a media, media_titles, and media_titles_translations table. Each of them have an id, created_at, and modified_at column. There are a few other columns—the most significant with media_id being a native_title_id referencing media_titles_translations, which later references media_titles, which later references media (see hence circular reference).

I'm unsure how to write a query to insert a new row into the media column and hold on to the id column returned and use it in another query (2 in this case since I need to use it for media_titles and media_titles_translations). How could I accomplish this?

earnest phoenix
#

@solemn latch

solemn latch
#

@earnest phoenix thats against discord tos.

earnest phoenix
#

Se me olvido mencionar los roles

#

Me pueden ayudar?

floral rune
floral rune
#

Por ejemplo para un role con ID 1234 se manda <@&1234>

stiff lynx
#

I want to do a cooldown with the db, there is a type for date or I have to put it as a String?

digital ibex
#

im a bit confused

#

i have this: document.getElementById('role id here')

#

but it returns null for some reason, any idea why?

digital ibex
floral rune
digital ibex
#

u wot

#

wrong ping my man

floral rune
#

that is usually the pattern I use in a relational db to track cooldowns

digital ibex
#

i've never heard of someone using a db for cooldowns, bc who has a downtime of just 2 seconds

#

and its 2 seconds, thats about the same time anyways

floral rune
#

for just 2 seconds that wouldn't make a lot of sense but for longer intervals it does

digital ibex
#

i mean sure but dafuq r u doin if u have a half hour cooldown

#

lmfao

floral rune
#

if you have a high performance keyval store like Redis you can make keys that autoexpire then just check if they exist on invocation

digital ibex
#

yeah sure my guy

floral rune
#
SET <uid>:<cmd>:cooldown y
EXPIRE <uid>:<cmd>:cooldown 2

GET <uid>:<cmd>:cooldown --> y or null
sudden geyser
floral rune
# sudden geyser In my context, it needs to be executed as one transaction. Relying on the previo...

since you're using postgres you can chain inserts in a single transaction ```sql
WITH media_insert AS (
INSERT INTO media(...)
VALUES(...)
RETURNING id
),
media_titles_insert AS (
INSERT INTO media_titles(...)
VALUES((SELECT id FROM media_insert),...)
RETURNING id, media_id
)
INSERT INTO media_titles_translation(...)
VALUES((SELECT id FROM media_insert),(SELECT media_id FROM media_titles_insert),...)

broken matrix
#

quick question
You know how some websites have a login via discord
Is there a tutorial or a link to the documentation on that

lyric mountain
#

you mean oauth2

broken matrix
#

yes

lyric mountain
#

search for how to handle oauth2

#

not discord login

broken matrix
#

Ight thank you

quaint wasp
#
module.exports = {
  name: 'ban',
  execute: async (client, message, args) => {
        let toBan = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(x => x.user.username.toLowerCase() === args.slice(0).join(" ") || x.user.username === args[0]);

  if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("You need permissions!") 
  if (!message.guild.me.hasPermission("BAN_MEMBERS")) return message.channel.send("Bot need permissions!") 

  const reason = args[1] || "There was no reason!";

  toBan.ban({
      reason: reason
  })
  message.channel.send(`${toBan} has been banned from the server!\nReason: ${reason}`)
}
};```
This command is like... realy simple.. and Idk how I get an error: Cannot read property 'ban' of undefined...
I defined toBan tho..
floral rune
#

if all of your chained expressions return undefined then toBan will be set to undefined. You need to add an error handler for that

#

you also forgot to lowercase the username provided in the args in the find lambda

quaint wasp
#

o

#

ok..

weary crypt
#

you alright man?

#

I am here to help lol, if you need anything just @ me

thin echo
#

How do I implement this into my bots code?

int serverCount = ...; // the total amount of servers across all shards

api.setStats(serverCount);

lament rock
#

You can have a socket server that issues a get all stats command from all shards and then combine all values in the server and send back to the command issuer

lyric mountain
#

Don't use var, also, ain't that already black?

errant perch
#

is there a way i can unfollow an announcement channel with discord.js?

median path
#

hiii

prime glacier
#
client.on('message', message => {
    if(message.content.startsWith(prefix + "dm")){

        var args = message.content.slice(prefix.length).trim().split(/ +/g)
        var args = args.slice(1).join(" ")

        client.guilds.cache.get("716718729186246757").members.cache.each(m =>{
            m.send(args)
            console.log('message sent to' + m.user.tag) 
        }
        )
        
    }
})```
error
```js
message sent toDyno Premium#3743
message sent toAl Handroo#5536
(node:7828) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send messages to this user
    at RequestHandler.execute (C:\Users\gamin\OneDrive\Desktop\dm bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)```
and bot crashes
quaint wasp
#

why tf is that there?

tacit sequoia
#

Use catch

quaint wasp
#

damn it that pic was tehre

#

isnt var to make vertible?

#

also I got a bug..

#

Idk why it happens

#

my button stuff for that is this:

#
    <nav>
<a href="./aboutus.html">About Us</a>
<a href="./discord.html">Home</a>
<a href="./serverStats.html">Support Server</a>]
<a href="./botstats.html">Bot Sats</a>

</nav>```
#

wait

#

nvm

#

I jsut saw that ]

#

I am really dumb after drinking lots of cold juice dude lol

#

also

prime glacier
#

how can we bypass it like it just says in logs that cant dm and continue to dm rest of the persona
bot dont crash

#

dont know how to use it in this situation please explain

lyric inlet
#

pls help me i also want to make cool bots so many ppl suggest me to learn programming language 1st so pls tell me which programming language i need to learn 1st
i want to learn javascript but some ppl are saying u need to learn html and css before javascript pls tell me something what should i do

brisk island
#

Hi

weary crypt
drifting shell
#

what did I do onesieKEKW

weary crypt
#

Breaking Tos Speed run

drifting shell
#

wanted to find out how many total members i had....uhh....guess that wasn't the way to do it onesieKEKW

drifting shell
#

there's nothing in that which breaks tos Hmmm

weary crypt
#

nevermind I am stupid

#

i retract my statement

drifting shell
#

what did you think I did onesieKEKW

weary crypt
#

please re read message 1

drifting shell
#

what Hmmm

weary crypt
#

I personally thought, spamming their API was against TOS

drifting shell
#

it is if you spam it and dont respect rate limits

#

as in you hit the rate limit, and keep submitting requests despite being rate limited

vale garden
#

hi

#

i have this weird problem

#

my bot randomly goes offline and online on its own

#

i used a flask backend server to host it 24/7 on uptimerobot

#

and all other bots on there are doing fine

#

however this bot goes offline and comes back online on its own, and idk why

#

it also sends the bot on_ready message multiple times

#

does anyone know why

#

p.s the bot is on a super active server of 20k members i think

#

idk if that might be a reason

clear marlin
#

This isn't your bots problem. Its basically your host.

#

I suggest going for a cheap hosting supply

#

btw, uptime robot pings your website 5 minutes apart

earnest phoenix
#

Please dont say you use glitch

clear marlin
#

so basically it would go online and offline in sudden instances

rapid forge
#

you might need to tweak that in uptime robot or something

worn sonnet
#

how can i C# bot on AWS?

pale vessel
#

of course

slender thistle
#

See if it's your bot disconnecting or your host annoying you

rocky hearth
#

for react, if we pass a new object as a prop, with the same values. Does it trigger for a rerender? (for being a new reference?)

cinder patio
#

It causes a rerender but if the object is used in the state then the state won't update (assuming you're using funcional components)

rocky hearth
#

ok

cinder patio
#

I don't think that'll matter, keys should be used only when you're creating elements in a loop

rocky hearth
#

so there would be 2 different buttons created depending on isTrue?

vagrant sorrel
#

hey guys a small help?
this is my command taking code:

bot.on('message', async (msg) => {
  if (msg.content[0]+ msg.content[1] !== prefix) {
    console.log('no prefix')
    return
  }
  const args = msg.content.slice(prefix.length).trim().split(' ')
  console.log(args)
  const command = args.shift().toLowerCase()
  console.log(command)```

but in this case i have to give commands like this ``.shelp``
i wanna give command like this ``.s help``

what is the change i should make in my code?
earnest phoenix
#

To check if the content starts with the prefix, use <String>.startsWith() instead of that condition in your first if statement and use .split(/ +/) for that instead of .split(' '), that should work

vagrant sorrel
earnest phoenix
#

!message.content.startsWith(prefix)

vagrant sorrel
rapid wharf
#

Why NOT to choose Heroku as a hosting for bot???

earnest phoenix
#

your bot got ratelimited when another non ratelimit respecter comes

round vault
#

yep

#

I did that but didn't work

earnest phoenix
#

Moin, ist hier auch deutsch?

frigid mountain
lusty quest
gaunt stag
#

Any idea of other music packages which do not use ytdl core? Because ytdl-core cant play live stuff and i am using js

quartz kindle
#

lavalink

gaunt stag
#

Will try to use that. Thanks

crystal wigeon
#

hey is there a way to DM the user with oauth?

willow mirage
#

does io.sockets.emit() will emit event to all client?

#

or only to the render client?

#

I have problem cause I want to pass io.on('connection', socket => socket variable to the routers

#
module.exports = (app, io) => {
    io.on('connection', (socket) => {
        require('./socket_events')(socket).then(() => {
            console.log('New user has been connected to the server');
            socket.emit('client_request_location');
            socket_io = socket;
        })
    })
    
    app.use('/', require('../routes/-.js')(io));
    app.use('/api', require('../routes/-api.js')(io));
}
#

I can only pass the io but not the socket

#

:<

quartz kindle
#

nice ghost ping

willow mirage
#

but I think im gonna bother u so i deleted

#

but can u help me

#

:<

quartz kindle
#

because its async

#

either put app.use inside the socket callback, or put everything inside a promise

willow mirage
#

because / must be render and then dom socket can connect to server

#

that mean / must be render, then socket DOM can be connect

#

im stuck at that

quartz kindle
#

because its async

#

whatever you are doing in your other files, needs to wait until the socket connection happens

willow mirage
#

ahhh

#

bruh

#
module.exports = async(app, io) => {
    const socket = await io.on('connection')
    require('./socket_events')(socket).then(() => {
        console.log('New user has been connected to the server');
    })
    app.use('/', require('../routes/-.js')(socket));
    app.use('/api', require('../routes/-api.js')(socket));
}

like this @quartz kindle ?

quartz kindle
#

events do not return promises, you cannot await them like that

willow mirage
#

hmm, so how i can do it?

quartz kindle
#

what are you doing outside of that code?

willow mirage
quartz kindle
#

this file is exported

#

what is the code that requires it?

willow mirage
#

I call it in /bin/www file

#

await require*

quartz kindle
#

what exactly do you want to do with the socket and the server?

willow mirage
#

passing variables

quartz kindle
#

you cant

willow mirage
#

hmm, then how I can pass variables between client and server?

quartz kindle
#

not like that

#

you have an http server, this http server generates html pages that you can access by visiting your website, right?

willow mirage
#

yes

#

well actually it is a express server

quartz kindle
#

then you connect to the socket, you can send variables between client and server, and you want these variables to change the html page?

willow mirage
#

yes

quartz kindle
#

you want that the next time you reload the page, the page is different?

willow mirage
#

yes

quartz kindle
#

then you need to use some sort of global variables

#

the render needs to get the variable from somewhere, then the socket can update this variable

#

the socket cannot pass the variable directly to the render, otherwise the render will not exist until you connect the socket

#

the render must be created before the socket

willow mirage
quartz kindle
#

and btw why do you need a socket for this?

willow mirage
#

because I dunno any other way to pass variable between client and server

quartz kindle
#

ajax? rest?

willow mirage
#

and Im trying to do like a real time update

quartz kindle
#

but you want the page to be reloaded

#

socket will lose the connection on reload

#

socket is meant for real time communication without reloading the page

#

like chat apps

willow mirage
#

well without reload would be better

#

yes

quartz kindle
#

in this case it has nothing to do with the render

#

the render has to create a blank/default page

#

and the socket messages have to add stuff to the page on the client, with browser js

#

not on the server

willow mirage
#

hmmmm, maybe I should remove the socket and make a api

quartz kindle
#

also an option

willow mirage
#

hmm

crystal wigeon
#

umm

sharp jolt
#

Anyone knows Golang here who would help me in unslowmode command.... unslowmode dosent work if i put value as 0 and works with 5

#

func (cmd *Commands) UnSlowMode(s *discordgo.Session, m *discordgo.Message, ctx *Context) {
channel, err := s.ChannelEditComplex(m.ChannelID, &discordgo.ChannelEdit{
RateLimitPerUser: 5 ,
})

if err != nil {
    s.ChannelMessageSend(m.ChannelID, "Couldn't turn off slowmode on this channel. Maybe check perms?")
    return
}
s.ChannelMessageSendEmbed(m.ChannelID, &discordgo.MessageEmbed{
    Description: fmt.Sprintf("Successfully disabled slowmode for <#%s> To 5 Seconds.", channel.ID),
    Footer:      &discordgo.MessageEmbedFooter{Text: fmt.Sprintf("Slowmode turned off by: %s", m.Author.Username)},
    Color:       0x36393F,
})

}

novel snow
#
const { Client, Collection } = require('discord.js');
const { config } = require('dotenv');
const fs = require('fs');
const command = require('./handlers/command');
const discord = require('discord.js');
const Discord = require('discord.js');

const client = new Discord.Client();

const cacheMessageOne = client.guilds.cache
  .get('843061318700367872')
  .channels.cache.get('845367058463588452')
  .message.get('845367708484108288').content;
console.log(cacheMessageOne);

So yeah, The code is supposed to just list the content of the message specified, But it doesn't work, Instead I get this;

C:\Users\user\Documents\tests\index.js:17
  .channels.cache.get('845367058463588452')
  ^

TypeError: Cannot read property 'channels' of undefined
    at Object.<anonymous> (C:\Users\user\Documents\tests\index.js:17:3)
vale garden
opal plank
quartz kindle
#

lol

#

it doesnt work because you didnt login

novel snow
#

It does log in

#

Just

#

okay here;

#
const { Client, Collection } = require('discord.js');
const { config } = require('dotenv');
const fs = require('fs');
const command = require('./handlers/command');
const discord = require('discord.js');
const Discord = require('discord.js');

const client = new Discord.Client();

const cacheMessageOne = client.guilds.cache
  .get('843061318700367872')
  .channels.cache.get('845367058463588452')
  .message.get('845367708484108288').content;
console.log(cacheMessageOne);

client.login('wack');
#

I have no clue why it doesn't work

near stratus
#

you know using require("discord.js") 3 times dosen't make the code better

woeful pike
#

you're trying to get messages before your bot is even connected to discord

near stratus
#

^

#

Do it on ready

novel snow
#

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH

#

I am so fucking stupid

novel snow
quartz kindle
#

thats why you dont copy-paste code

#

lel

novel snow
#

Yeh

#

I mean I wrote it myself just never changed the shit

rapid wharf
#

All the other Imports are woking but these two are not, any fixes (Both are in official PyPI website, with a ss of code, i did the same, but these are not importing into my files) pyrandmeme and Fivem Packages.

near stratus
#

are they installed ?

rapid wharf
#

yes

opal plank
#

@quartz kindle yo wtf

#

how does this break my welcomer messages?

#

isnt it GUILD_MEMBERS that output updates for guild_join and guild_leave?

vivid fulcrum
#

it's GUILDS

#

unless you mean members joining and leaving guilds

opal plank
#

yes, that

vivid fulcrum
#

which lib are you using, some require a full member object (including the presence) to emit the event

opal plank
#

detritus

#

shouldnt need it at all

earnest phoenix
#

is there an event for when window.hash changes

lusty quest
#

i sort of want to make a discord bot. but i dont have a good idea.

earnest phoenix
#

i'm making an SPA with window.history.pushState stuff and i want the react component to rerender when the hash changes

lusty quest
#

also i might want to learn a new lang for it

vagrant sorrel
#

Hey i had another question,
so basically i know what i am doing is wrong and is lazy but,

    let getPrice = async () => {
      let result = await fetch(`https://api.wazirx.com/api/v2/tickers/${command}`)
      let json = await result.json()
      return json
    }
    let com = await getPrice()```
and i have another function for description, i,e ==>

if (command === command && 'info') {
let getInfo = async () => {
let result = await fetch(https://api.coingecko.com/api/v3/coins/${command})
let json = await result.json()
return json
}
let com = await getInfo()```
to use getPrice command it .s btcinr
to use getInfo command is .s bitcoin info
but when I call for the latter, the former if condition gets called and it doesnt work.

#

prefix: .s

rapid wharf
slender thistle
#

??????????????????????????????????/

#

sec

rapid wharf
lusty quest
rapid wharf
#

do u know why to import star 🤔 @slender thistle

slender thistle
#

What is this shit even suggested

#

I'm so sceptic of this package and I literally just found out about it

vagrant sorrel
earnest phoenix
#

i love how you are using wazirx api for price and coingecko api for info

lusty quest
#

maybe look into switch cases or use a different way to check if the 2nd argument exist

rapid wharf
earnest phoenix
#

use coingecko's api for both

vagrant sorrel
earnest phoenix
#

it shows the average price of a heckload of exchanges
with wazirx's api you're gonna get the price on only that exchange

rapid wharf
#

yes yes or better is use Coinbase or Binance if avaliable @vagrant sorrel

terse sphinx
#

Hi I'm looking to make a vote reward command , ie vote to use command , how can I do so , any example , I'm having issues understanding the docs

vagrant sorrel
terse sphinx
#

Ok

vagrant sorrel
#

So yea any way on how i can make both the if statements work simultaneously?

earnest phoenix
#

put the info one first

#

and make the ticker one an else if statement

#
if (info stuff) {
  do shit
} else {
  do shit
}
#

actually you dont need the second if part

vagrant sorrel
slender thistle
#

Like

#

I just opened its init and found this

#
>>> loop.run_until_complete(pyrandmeme())
<discord.embeds.Embed object at 0x000002B689499160>
>>> loop.run_until_complete(pyrandmeme()).to_dict()
{'image': {'url': 'https://i.redd.it/ol7aaw9xpn071.png'}, 'color': 15277667, 'type': 'rich', 'description': 'Meme Request', 'title': 'Meme'}
#

Something you can do yourself

vagrant sorrel
slender thistle
#

Now on to FiveM

#

Okay this package didn't even success at being a proper module

#

Just where the hell did you grab this from

#

Why can't you just use aiohttp for this sad

rapid wharf
#

learning day by day

#

also i started a python course

#

to learn python

slender thistle
#

Yeah well pyrandmeme is kind of acceptable, although a redundant package

rapid wharf
#

ohh

slender thistle
#

As for FiveM, you can ditch it

#

If FiveM has an official API, look into it. But first, I'd really advise getting hang of basics of Python before getting into more advanced projects

rapid wharf
slender thistle
#

Let me see their node.js package

rapid wharf
#

ohk

slender thistle
#

Python wrapper loosely based on node wrapper which is based on the C# wrapper

#

Ya well I give up here kekw

rapid wharf
gritty lintel
#

Hey

umbral zealot
#

No one can help until you actually ask your question ^_^

trail finch
#

My bot named yoink will be offline for one month.. So please don't decline it

quartz kindle
#

they dont care lol

sudden geyser
#

some bots are offline for months and they don't do anything

#

maybe even years

quartz kindle
#

i think he means the verification

#

just apply again if it gets denied

sudden geyser
#

if so then yeah

earnest phoenix
#

In the strf.time the %M for the month right?

slender thistle
#

First of all, what library and what language

earnest phoenix
slender thistle
#

%m is the month

#

%M is minute

earnest phoenix
#

rtfd moment

slender thistle
#
>>> dt
datetime.datetime(2017, 4, 26, 18, 8, 17, 125000)
>>> dt.strftime("%Y-%m-%d %H:%M:%S.%f")
'2017-04-26 18:08:17.125000'
>>> str(dt)
'2017-04-26 18:08:17.125000'
tulip knoll
#

Traceback (most recent call last):
File "d:\Taufeeq Riyaz\Projects\Discord Bots\astro-bot.py", line 25, in <module>
async def hello(ctx):
File "C:\Users\Taufeeq Riyaz\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 1263, in decorator
self.add_command(result)
File "C:\Users\Taufeeq Riyaz\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 1155, in add_command
raise CommandRegistrationError(alias, alias_conflict=True)
discord.ext.commands.errors.CommandRegistrationError: The alias hello is already an existing command or alias.

#

i'm getting this error 🥲 please help

slender thistle
#

The alias hello is already an existing command or alias.

tulip knoll
earnest phoenix
#

Why would you have your name as an alias

slender thistle
#

Is that the issue kekw

tulip knoll
#

@client.command(aliases=['hello', 'hey', 'hi'])
async def h(ctx):
responses = ['Hello, how are you?', 'Hi', 'Wasssuup!']
await ctx.send(choice(responses))

tulip knoll
earnest phoenix
#

I mean, you could've removed the hello from the aliases, but that's fully up to you tbh

tulip knoll
# earnest phoenix I mean, you could've removed the hello from the aliases, but that's fully up to ...

i removed it and now it shows

Traceback (most recent call last):
File "d:\Taufeeq Riyaz\Projects\Discord Bots\astro-bot.py", line 25, in <module>
async def hello(ctx):
File "C:\Users\Taufeeq Riyaz\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 1262, in decorator
result = command(*args, **kwargs)(func)
File "C:\Users\Taufeeq Riyaz\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 1433, in decorator
return cls(func, name=name, **attrs)
File "C:\Users\Taufeeq Riyaz\AppData\Roaming\Python\Python39\site-packages\discord\ext\commands\core.py", line 221, in init
raise TypeError('Name of a command must be a string.')
TypeError: Name of a command must be a string.

earnest phoenix
#

I-

#

You removed the hello from the aliases as well as passed a list on to the name parameter, name can only be str

slender thistle
cinder patio
#

you could make a rectange with the same width and height as the canvas before you draw the image

pale vessel
#

Use fillRect() first?

cinder patio
#

yes, use fillRect before you draw the image

earnest phoenix
#

Wh-why would you add it back?

tulip knoll
slender thistle
#

I can't

tulip knoll
slender thistle
#

I legitimately can't

earnest phoenix
# tulip knoll

FYI though, in case you don't know, if nothing was passed on to the name parameter, it'll take the function name as the command name

pale vessel
#

What's not working?

lusty quest
#

why did you post a image with a dead dude?

weary crypt
#

bruh

lusty quest
#

@rustic nova

pale vessel
#

What?

cinder patio
#

oop

pale vessel
#

Huh

lusty quest
#

and hes gone

pale vessel
#

Was it actually bad?

#

I didn't see

lusty quest
#

there where a dead due that got shot

cinder patio
#

I don't think that was a real dead guy tho

weary crypt
#

It was a dead guy leaking blood from his stomach

lusty quest
#

lying infront of his car

rustic nova
#

yeah nah

proper bolt
#

lmao it looked like it mightve been an album cover or something ?

modest maple
#

CoffeeSip Nice to see nothing has changed much

lusty quest
#

also if you post this stuff, some context would probably help

rustic nova
#

gimme a sec

pale vessel
#

It's an album cover?

lusty quest
#

even then i wont post it here lol

#

@opal plank i use TS and detritus now for about an hour and managed to break it entirely, nice.

modest maple
#

sounds like TS

storm knot
#

how do I get the bot to wait for audio to finish before playing the next

lusty quest
#

like it cant find node-fetch even tho its installed

cinder patio
#

you need to install it's typings as well

#

npm i @types/node-fetch

lusty quest
#

yea figured this out, but even when they are installed they dont get picked up

#

and i now know why it started to yell, somehow it doesnt want to pickup dontenv properly

opal plank
#

dotenv doesnt have something to be picked up

#

its just process.env

lusty quest
#

yea it got a bit weird and doesnt want to pickup installed modules, requires me to restart vsc

opal plank
#

did u install ts globally?

lusty quest
#

ye

opal plank
eternal elbow
#

I have a little question, I made an application in react, it works fine, the proxy is set to 3001 and the api is already working 3001, everything is fine until here, but when I connect it to the domain "example.com/api/get" does not respond to me here and react directly redirects to the website? Should I do it as "http: //ip:3001/api/get" or is there any other solution?

opal plank
#

the dotenv lib has typings too

#

oh

#

i have an idea what might be doing that

lusty quest
#

ive had import 'dotenv/config' working, but now it doesnt want to

#

the typings are deprecated

opal plank
#

which types are deprecated?

lusty quest
#

dotenv

#

@types/dotenv

opal plank
#

if u used my config it should exclude node_modules

#

so when you compile with ts-node it wont scream about it

#

thats precisely why i told you to use it instead

pale vessel
#

You don't need @types/dotenv

#

It comes with its own type declarations

opal plank
#

^^

#

was about to comment on that

#

theres no need for dotenv

#

also, i assume you got the 3 libs in the bottom installed on ur project too

#

tslib, typescript and ts-node

#

though its stupid to mark is as dependency

#

i mean just straight up installed as dev-dep

#

you dont wanna ship it with this unless you use scripts with it required(which i do, specially debuggers)

#

@lusty quest if u get stuck, dont sweat about asking

#

the configs i sent you should make it rather painless to run it

lusty quest
#

dotenv is usually my go to stuff for having stuff like API keys inside

#

@opal plank looks like ts ignores all files for some reason

cinder patio
#

what's your file structure

lusty quest
#

wont read config.json

cinder patio
#

wdym won't read config.json

#

what errors are you getting

lusty quest
#

got it solved. added "resolveJsonModule": true,to the tsconfig

opal plank
#

@lusty quest in bathroom

#

1 sec

lusty quest
#

?

opal plank
#

oh, it was feud who asked the structure

#

cuz the stuff i sent you is path-bound

lusty quest
#

yea i know

opal plank
#

i just removed mine when i sent you

#

i thought it was excluding the folder cuz of that path

lusty quest
#

no it just ignored the json file, probably the .env file too

opal plank
#

thats cuz its including only *.ts files

#

notice how my configs are outside /src

lusty quest
#

ohh wait yea makes sense

#

yea my config is also outside of /src

#

but still wont read it

#

unless ive added the line mentioned above to the tsconfig

opal plank
#

hmmm thats a bit odd, that should only happen when you run the code

cinder patio
#

that's just how ts handles json

opal plank
#

ide shouldnt be bitching about it

lusty quest
#

errorlens just cried about it, when ive added the line it just worked fine

opal plank
#

ooooh

#

you're importing json right?

#

not requiring()

#

if so, that makes sense

lusty quest
#

yes

opal plank
#

yeah, then it makes sense

cinder patio
#

es6 imports cannot import json that's why there's a specific option

errant perch
#

hypothetically if i were to hire a developer to do something where would i go pittys

opal plank
#

fiverr

#

if u want something cheap

#

doesnt coders-den have a channel for advertising that?

errant perch
#

idk maybe

zinc wharf
errant perch
#

sorry, but my friends are idiots

opal plank
#

not gonna find any better here

opal plank
polar cove
#

i mean depends on what you want to buy

errant perch
#

idk honestly seems like too much trouble

royal herald
polar cove
opal plank
#

assuming you want a bot

polar cove
#

have had a few people ask me the same thing before

vagrant sorrel
#

i get treated with this error when i try to shift all my commands to another js file and then export them
referenceError: client is not defined at bot.module.exports

errant perch
#

just need some code for a time sensitive feature, not a bot

royal herald
#

Hey erwin do yo know java? @opal plank

opal plank
#

in all honesty, most devs that wouldt be competent for a decent job at all

polar cove
#

whats the feature and the lang woogie?

opal plank
errant perch
lusty quest
#

@opal plank is there a smart way to get a dynamic command handler? the example bot you sended modifies the vanilla detritus client for it.

polar cove
opal plank
lusty quest
#

so i could just export the commandClient and call it in other files and it will pick them up?

opal plank
lusty quest
#

yea sorry that i ask so much, but the docs are not the best

opal plank
#

this is loading the commands

#

and this is reloading them in a command

#

that simple

lusty quest
#

thats nice compared to d.js

opal plank
#

anything inside the folder u point to, will import anything you export default

#

look

#

this is an example command

#

anything exported default will be picked up to be imported by the commandClient

lusty quest
#

nice

opal plank
#

the extension is just so i dont have to repeat the same thing over and over on every command

#

which is basically this

#

just i dont have to add those on EVERY SINGLE file

#

which is just plain annoying and repeating

opal plank
#

but you dont need this at all

#

the only thing that you need to know is that commandClient will import anything in the folder you have in ur files, always the default export

#

it will NOT import anything else

lusty quest
#

ok

vagrant sorrel
#
    at Client.module.exports (/home/runner/Stonks/commands.js:27:3)
    at Client.emit (events.js:314:20)
    at Client.EventEmitter.emit (domain.js:483:12)
    at MessageCreateAction.handle (/home/runner/Stonks/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/home/runner/Stonks/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/runner/Stonks/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/runner/Stonks/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/runner/Stonks/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/runner/Stonks/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:314:20)
(node:525) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:525) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
opal plank
#

realistically, this is all u need to worry about has far as "dynamic" hot-reloading goes

lusty quest
#

i need to get the stuff in my head first, but thanks a lot.

vagrant sorrel
# opal plank read the error

first of all i need to work with that bot thing i used in my main js file which the commands js file cant acess, second the api functions are unable to do anything cuz there is no catch statement?

opal plank
vagrant sorrel
opal plank
lusty quest
#

i will get it eventually, but i can process informations the best if i hammer my head with them and then take a break to let it sit a few hours. rinse and repeat until you dream from it.

marble juniper
#

learn how to debug
it will make ur life easier and ours even more

opal plank
vagrant sorrel
opal plank
#

thats basically what your file structure can/should have

opal plank
#

you clearly copying stuff that you dont know what it does

vagrant sorrel
#

i know js. but its fine

#

thanks tho

opal plank
#

np

lusty quest
marble juniper
#

look at this

#

lol

opal plank
#

i already told cake that same thing

lusty quest
#

there is so much stuff that just say what type it expect

#

no explanation what it does

opal plank
#

thats why the best way to get to know it is intellisense and checking his bot's repo as a base

opal plank
#

it is a more sofisticated library, as is rn, it expects you to know ts already

#

intellisense and the discord docs should guide you, but for new users? yeah, its a mood killer

#

i cant google "How to add a reaction in detritus?" and have 58 stackoverflow answers

vagrant sorrel
marble juniper
#

you said you know js

opal plank
marble juniper
#

now I believe thats a lie

#

u lied

opal plank
vagrant sorrel
#

arre i got rid of that problem

#

i defines it

#

now there are 10 more errors to go

opal plank
#

welp, good luck

vagrant sorrel
#

cool

marble juniper
#

learn js

#

it has some guides listed there

sudden geyser
#

how many people actually check read and listen to that page

marble juniper
#

probably not many
but better if you did if you don't wanna stand there completely dumb

#

also only that section

#

many people probably use that site

#

lol

#

its a great guide

prime glacier
#
client.on('message', message => {
    if(message.content.startsWith(prefix + "dm")){

        var args = message.content.slice(prefix.length).trim().split(/ +/g)
        var args = args.slice(1).join(" ")

        client.guilds.cache.get("716718729186246757").members.cache.each(m =>{
            m.send(args).catch(err => { return });
            if(!m.send(args)){console.log('Cant Dm This Person')}
            console.log('message sent to ' + m.user.tag) 
        }
        )
    }
})```can i add 10sec cooldown?
sudden geyser
#

yes

marble juniper
#

use setTimeout

sudden geyser
#

you'll need to store previous invocations

#

and set a timeout to remove it

marble juniper
#

oh that

sudden geyser
#

and check if the timeout has expired

marble juniper
#

I was gonna send

#

that

#

smh

sudden geyser
#

speedy

marble juniper
#

whatever

#

not fair im on mobile

earnest phoenix
#

Whats the solution for this?

prime glacier
sudden geyser
#

read the guide

sudden geyser
earnest phoenix
#

Then?

#

How to solve the issue?

sudden geyser
earnest phoenix
#

ok

round quiver
#

/

#

ehmm

marble juniper
#
  1. learn js
  2. you are not using classes properly
  3. learn js
round quiver
#

shh alr -

marble juniper
#

if you have a constuctor

#

you use a new statement first

#

new Discord.MessageEmbed()

#

like this

round quiver
#

oo

#

thenks will try

marble juniper
#

also use codeblocks

#

you can make codeblocks using 3 `

#

at beginning and end

round quiver
#

ahh yeah ty

earnest phoenix
marble juniper
#

no Idk how to fix that

earnest phoenix
#

ok

latent heron
#

@slender thistle my favorite error

marble juniper
#

naisu

tribal quest
#
const { MessageEmbed } = require('discord.js');



module.exports = async (client, member) => {
    if (member.guild.id !== '814044423473070103' || member.bot) return;

    const channelWelcomeEmbed = new MessageEmbed()
        .setColor('#ffd6d6')
        .setTitle('Welcome!')
        .setDescription(`${member} just joined the discord! Make sure to read #rules!`)
        .setTimestamp();

    member.guild.channels.cache.get('814044423473070103').send(channelWelcomeEmbed);

    const dmWelcomeEmbed = new Discord.MessageEmbed()
        .setColor('#ffd6d6')
        .setTitle('Welcome!')
        .setDescription("For Help Using DavBot, Send The Command `<help` In Server")
        .setTimestamp();

    member.send(dmWelcomeEmbed);

};

Somebody knows why my bot doesnt send the embed?

wheat mesa
#

You need to specify that it’s an embed in the .send parameters

#

member.send({ embed: dmWelcomeEmbed })

tribal quest
#

but it also doesnt send the mesage in the channel

boreal iron
#

🤦‍♂️

wheat mesa
#

Yes, you need to do the same thing for that as well

tribal quest
#

oh im not that good in english sorry

wheat mesa
#

That’s okay!

boreal iron
#

Not only your English is lacking...

tribal quest
#

good motivation XD

#

im new in coding so sorry

#

general ik its a big step but im reading books about java script and so on

#

what would you recommend for starting

wheat mesa
#

I mean... js is perfectly fine for starting...

slender thistle
#

Python and JS are fine for starters

wheat mesa
#

js and python are good choices

slender thistle
#

They are simple and straightforward

crimson vapor
#

imho JS is easier to learn

tribal quest
#

yes i also think its very simple

slender thistle
#

Turbo Pascal, fuck you

wheat mesa
#

They simplify a lot of the more complicated aspects of OOP languages like C++ and so on

opal plank
#

just learn assembly first

#

wont ever struggle with other langs

#

and haskell for you to get into the insanity level a senior dev has

wheat mesa
#

Enjoy using 10000 lines for your first program

tribal quest
#

@wheat mesa can i dm you for a small question

wheat mesa
#

I’m not sure if I could answer it, you should probably just post it here

tribal quest
#

okay because i dont want to get hate becasue of my begining skills but yea i ask it here:
the bot still doesnt send the message heres again the code:

const { MessageEmbed } = require('discord.js');



module.exports = async (client, member) => {
    if (member.guild.id !== '814044423473070103' || member.bot) return;


    const channelWelcomeEmbed = new MessageEmbed()
        .setColor('#ffd6d6')
        .setTitle('Welcome!')
        .setDescription(`${member} just joined the discord! Make sure to read #rules!`)
        .setTimestamp();

    member.guild.channels.cache.get('814044423473070103').send({ embed: channelWelcomeEmbed });

    const dmWelcomeEmbed = new Discord.MessageEmbed()
        .setColor('#ffd6d6')
        .setTitle('Welcome!')
        .setDescription("For Help Using DavBot, Send The Command `<help` In Server")
        .setTimestamp();

        member.send({ embed: dmWelcomeEmbed })


};

#

ah thats good

#

i try it once without dm and then i look if there error is in the dm

wheat mesa
#

^^

tribal quest
#

the funny thing is there is no error

wheat mesa
#

How are you executing this code in your main file

tribal quest
#

the bot starts everthing is fine than i join with my second account on my testing server and nothing happens

tribal quest
#

what do you mean

lusty quest
#

@opal plank any idea why it cries about this?

tribal quest
#

if im seriuos i dont know what you mean

#

ah okay i send it

#
const fs = require('fs');
const discord = require('discord.js');

const client = new discord.Client({ disableMentions: 'everyone' });

const { Player } = require('discord-player');

client.player = new Player(client, {leaveOnEnd: false, leaveOnEmpty: false});
client.config = require('./config/bot');
client.emotes = client.config.emojis;
client.filters = client.config.filters;
client.commands = new discord.Collection();

fs.readdirSync('./commands').forEach(dirs => {
    const commands = fs.readdirSync(`./commands/${dirs}`).filter(files => files.endsWith('.js'));

    for (const file of commands) {
        const command = require(`./commands/${dirs}/${file}`);
        console.log(`Loading command ${file}`);
        client.commands.set(command.name.toLowerCase(), command);
    };
});

const events = fs.readdirSync('./events').filter(file => file.endsWith('.js'));
const player = fs.readdirSync('./player').filter(file => file.endsWith('.js'));

for (const file of events) {
    console.log(`Loading discord.js event ${file}`);
    const event = require(`./events/${file}`);
    client.on(file.split(".")[0], event.bind(null, client));
};

for (const file of player) {
    console.log(`Loading discord-player event ${file}`);
    const event = require(`./player/${file}`);
    client.player.on(file.split(".")[0], event.bind(null, client));
};

client.login(client.config.discord.token);
#

there is a open source discord bot and im trying to intergrate some special things in the bot

#

im learing

#

yes

wheat mesa
#

I would follow the discord.js tutorial docs to get started on a bot first.

wheat mesa
#

You should learn js before attempting to build a bot as well

opal plank
#

use this ```ts
import { Context, ParsedArgs } from 'detritus-client/lib/command';
async run(payload: Context, __args: ParsedArgs): Promise<any> {

#

@lusty quest ^^

lusty quest
#

ok

tribal quest
#

yea okay you´re right

#

but for the future the error is in my index.js

wheat mesa
lusty quest
tribal quest
#

i have it already open

wheat mesa
#

You should follow the tutorial on creating your first bot there rather than copy pasting some open source code and modifying it. It's much easier.

opal plank
#

use context.commandClient

#

or

#

do this

crimson vapor
#

hello

lusty quest
#

yea i get what you mean

opal plank
#
  async run(payload: Context, __args: ParsedArgs): Promise<any> {
    const message = payload.message;
    const cc = message?.client.commandClient;
    if (!message || !cc || !message.channel) return;```
lusty quest
#

added optional chaining, but if client is null it would be quite annoying

opal plank
#

i add that ontop

lusty quest
#

can ts-node hot reload like nodemon?

opal plank
#

i wouldnt recommend tbh

#

why do you need reload like that?

#

if you want to re-import the files, just cc.clear() and cc.addMultipleIn() onto another reload.ts command

lusty quest
#

so i dont have to ctrl x the process and restart it

#

if i change a file

crimson vapor
#

you could use tsc -w which watches the changes and nodemon .

#

which would run the code

opal plank
crimson vapor
#

what do you do then?

opal plank
#

i click here like a civilized person

#

debugger always attached, since its development workspace

lusty quest
#

right, you run it inside the debugger

#

yea it instantly yells at me

tribal quest
#

okay so bye thanks for the motivation have a great day and bye

opal plank
lusty quest
#

some file called loader.js

opal plank
#

huh?

#

did u run with the script i sent?

lusty quest
#

it doesnt want to take the script

opal plank
#

make sure u use the one i sent

#

explorer enabled

sage bobcat
#

One message removed from a suspended account.

opal plank
#

and that launch.json i sent before

lusty quest
#

yea got it running

#

even tho in the time ive made discord bots i never used the debugger

opal plank
#

its, the, best, thing, ever

#

trust me

#

wont go back

lusty quest
#

i give it a shot

cinder patio
#

who needs a debugger

lusty quest
#

ayy got now a working command with base command constructor

earnest phoenix
#

Hi

eternal elbow
#

How can I pass React.js api calls (localhost:3000/api/get) to express (example localhost:3001/api/get) ?

cinder patio
#

react.js api calls? React is a frontend ui framework

#

vscode is a text editor

eternal elbow
cinder patio
#

forward it backwards shocked I'm not sure what you mean

eternal elbow
#

localhost:3001/api/get/user/123456789 this works but my domain is connected to port 3000

#

No, it doesn't exist, for example when a request is received to localhost:3000/api/get/user /123456789, it should redirect to backend, but it doesn't work. @cinder patio sorry my bad english

cinder patio
#

You can't use uptimerobot for your bot if you are hosting it on your PC - also, it's pointless as you can make your bot run 24 7 yourself by just not stopping the process

rapid wharf
#

In d.py
After fetching diff things from Api, how to send them in this format using embeds [player id]: player name
Code i wrote, but its just sending an embed with only one person:

    for player in players:
        em = discord.Embed()
        em.add_field(name='Players', value=f'Player Id:{player.id} , Player Name:{player.name}')
    await ctx.send(embed=em)```
cinder patio
#

I mean I guess you can use it but with tons of setup

lusty quest
#

@opal plank does isClientOwner reference to the Account who created the Bot application or the Guild owner?

slender thistle
#

Don't recreate a new Embed object in the loop

cinder patio
#

I mean I guess... if repl is the way you host your bot

near stratus
cinder patio
cinder patio
#

also, for a discord bot you don't have to use uptimerobot, you can keep track of the uptime yourself

near stratus
#

Even if i use a db it'd be harder

opal plank
cinder patio
#

setting up an entire http server just to keep uptime is overkill

near stratus
#

Also I don't host on my pc (I use a VPS)

opal plank
#

aka ur userId

cinder patio
#

the person I was replying to were

lusty quest
#

thx

near stratus
#
  • I'm lazy
#

and I encourage everyone to be lazy

cinder patio
#

overkill for a discord bot

tardy lion
#
if (!member.hasPermission(`ADMINISTRATOR`)) return `Missing 'Administrator' permission`;

[returns member not defined]
cinder patio
#

hmmm... weird... as if member isn't defined

#

just a guess tho

tardy lion
#

link sus

cinder patio
#

@rustic nova

tardy lion
#

steam shouldnt have a ru tld

cinder patio
#

suspicious link

tardy lion
#

or spelling steam and community wrong

cinder patio
#

sterm community lmao

rustic nova
#

-b @earnest phoenix steam scam

gilded plankBOT
#

dblMod Banned Jⱥภภiร | ŦE丹M 420Hคze#4553 (@supple rose)

tardy lion
#

lol

cinder patio
#

yeah anyways member is not defined

tardy lion
#

ok

tardy lion
#

so

#

!member.permissions.has?

near stratus
#

hasPermission() is deprecated

#

maybe removed

near stratus
cinder patio
#

not the source of the error tho

#

show more of your code

tardy lion
#

all it is.. is some shop.json stuff

near stratus
#

maybe he was trying guild.me or something I guess

tardy lion
#

which isn't the problem

near stratus
#

where did you define member ?

tardy lion
#

in the index.js file

cinder patio
#

😩 man

near stratus
#

b r u h

tardy lion
#

what

#

i required it

near stratus
#

show the code where you defined member

cinder patio
#

how are we supposed to help you when you are giving us basically no information

tardy lion
#

ok

near stratus
boreal iron
regal jacinth
#

guys, i managed to set up the environment and the scripts for my bot in digital ocean, how do i host it 24/7 ?

near stratus
regal jacinth
#

it's in python

tardy lion
#

ok

near stratus
tardy lion
#

i can't find member in the js file

regal jacinth
cinder patio
#

send your entire js file then

near stratus
tardy lion
#

ok

near stratus
rapid wharf
regal jacinth
#

no

tardy lion
#

the token is in token.json

rapid wharf
regal jacinth
#

why wherever i ask for help regarding digital ocean some dude DM me with server links lol

opal plank
#

well, lets test it

tardy lion
opal plank
#

Digital ocean

cinder patio
#

they want you to use their shitty vps service

regal jacinth
#

i already know a bunch of them but i want something better

crimson vapor
regal jacinth
#

python3 filename.py

near stratus
#

Digital Ocean is the hosting company I use for my own Discord bots. In this video tutorial I go over how to how your bot for as low as $5 a month. Using my referral link you'll also get $100 credit to get started for free. Keep in mind that this credit expires after 2 months.

🐳 Get $100 of Digital Ocean credit:
https://wornoffkeys.com/digital-o...

▶ Play video
regal jacinth
#

that starts it

#

that's js

#

mine is py

crimson vapor
#

you would need to use a process manager or something idk

rapid wharf
crimson vapor
#

I use pm2 for nodejs

tardy lion
#

ads are unrespondive

#

unrespobndive

regal jacinth
tardy lion
#

unresponsive

#

lmao xe

#

xkj

#

xd

pale vessel
#

2 Geometry Dash, gamer

tardy lion
crimson vapor
#

I don't see a member in this paste file

rapid wharf
regal jacinth
#

paid

tardy lion
#

e x a c t l y

cinder patio
crimson vapor
#

its in a command

tardy lion
#

yes

crimson vapor
#

use message.member not member ig

tardy lion
#

ok

regal jacinth
#

@near stratus the video is in js, i code in py lol

near stratus
tardy lion
#

why the heck do i have 3 bot.js notepads open

#

lmao

regal jacinth
near stratus
#

FTP

crimson vapor
#

why does FTP matter

#

they just need to host their bot

near stratus
#

I'm guessing the bot isn't starting

near stratus
regal jacinth
#

hmm?
i just did ssh root@IPaddress then set it up

#

i installed the requirements and uploaded the files

cinder patio
#

ok so what's the problem

tardy lion
#

it cannot read perms of null

regal jacinth
#

it's just not online

cinder patio
#

you have to manually start it

near stratus
crimson vapor
cinder patio
#

install a process manager and run your main py file

regal jacinth
tardy lion
#

i leave my pc on 24/7

#

to host my bots

cinder patio
#

hm.... it shouldn't stop when you close your pc or editor

regal jacinth
#

hmm

cinder patio
#

maybe you're actually running it locally?

regal jacinth
#

no?

#

i believe it's connected

#

i did ssh root@IPaddress

crimson vapor
#

well

#

if you close the ssh, does it stop?

near stratus
#

no

crimson vapor
#

it should

#

LOL

near stratus
#

We use pm2 in node

#

to keep the bot alive

regal jacinth
#

i tried to close the terminal and it stopped

cinder patio
#

why would it stop when you close the ssh

tardy lion
cinder patio
#

the vps is still running

near stratus
#

on DigitalOcean

cinder patio
#

you're just no longer connected to it

near stratus
crimson vapor
#

because they are only doing python filename.py

tardy lion
#

i use cmd prompt

regal jacinth
#

hmm then how should i run it?

near stratus
#

That's why we use pm2 but IDK Python has PM2

crimson vapor
#

it stops everything when the ssh ends

regal jacinth
#

^

crimson vapor
#

there are a few ways to do it

#

you could use screen/tmux
services
you could also use pm2, I think (im not sure lemme check)

#

yes you can

crimson vapor
#

comes with npm but can be used for much more

regal jacinth
#

oh

near stratus
#

wait a second lemme try

regal jacinth
#

why is it so hard to use digital ocean whyyy

crimson vapor
#

its not

sudden geyser
#

Python Manager 2

near stratus
#

Yea, you can do pm2 python3 main.py

crimson vapor
#

this is all vps things

marble juniper
#

qts

regal jacinth
#

alr

near stratus
crimson vapor
near stratus
regal jacinth
#

yeah figured it out the hard way

boreal iron
#

Why even bothering with external packages? Just create a service and that’s it.

crimson vapor
#

simpler

vivid fulcrum
#

this

near stratus
vivid fulcrum
#

pm2 is overkill

near stratus
vivid fulcrum
#

at the cost of more resources

near stratus
#

Just do npm i -g pm2

rocky hearth
#

what is web v9?

earnest phoenix
#

my bot is 24/7 music 🙂

boreal iron
#

Googling how to setup a simple service will show you how easy it is

sudden geyser
#

external tooling is always trying to get in your way

vivid fulcrum
rocky hearth
#

no, I'm seeing firebase documentation. There is web v9 code snippets

vivid fulcrum
#

oh

boreal iron
#

You just need to create a file, enable the service and start it - 3 easy steps

errant perch
#

how do i get a list of all members in a guild

boreal iron
#

The guild object contains a property members

pale vessel
#

Not all of them

errant perch
#

any way i can view all of them?

#

a bunch of scam bots just joined my server and im trying to get rid of them fast

pale vessel
#

You need the guild members intent

errant perch
#

ok i have that enabled

pale vessel
#

What library are you using?

errant perch
#

discord.js

pale vessel
#

guild.members.fetch()

#

Await the promise

errant perch
#

k

#

thank you so much

crimson vapor
slender thistle
#

Resolve your promises or get rejected.

sudden geyser
#

literally

rapid wharf
#

i made an embed where i retrive the information from an api and the value is big enough that it could not fit in one embed, then how to send the rest of information as next embed

rapid wharf
opal plank
#

you could just slice the string into 2k parts

dense spire
#

can i do (channel obj).send(embed) or do i have to do (TextChannel obj).send(embed)

sudden geyser
#

You usually need the instance.

opal plank
#

for slice in array_of_slices:
send(slice)

perhaps

#

not a py expert

rapid wharf
#

many bots do this

dense spire
#

i have a counter that resets at 10

opal plank
#

just send an embed for each slice of the string u have

slender thistle
#

this package works

sudden geyser
#

@rapid wharf you'd need to break the embed into chunks.

#

If you want to send multiple embeds.

rapid wharf
sudden geyser
#

if you want to paginate instead, see what shivaco sent.

opal plank
#

you havea 6k limit on embeds either way

#

i guess you could add fields on it instead

#

to bulk 2 a ta time

#

per message

rapid wharf
stable nimbus
#

How would I archive a channel into an image before deleting it?

opal plank
#

a what

#

u cant archive channels

#

u will be able to do some stuff of the sort with threads tho

#

but not channels

stable nimbus
#

You can before they are deleted, most support bot features this type of thing.

opal plank
#

they dont

#

you cannot archive a channel

stable nimbus
#

I'm meaning the contents inside, messages, images, etc.

#

Legit you can I watched a bot do it.

opal plank
#

you are not saying things that correlate

#

you cant archive a channel. period

#

what you are explaning is a delete-logs

#

where it'll copy a message's content into another channel

#

thats not archiving at all

#

archiving is a thing that'll be present in threads, and its not public yet

#

or you mean a lockdown command

#

where it'll prevent people from saying anything else in that channel

crimson vapor
#

just rename the channel and remove people's perms to see it

#

ezpz

lament stump
#

Does someone know how to align these two things horizontally in HTML / CSS?

#

I think something with a container, but I am not 100% sure how they work

stable nimbus
#

Its a channel archive of a ticket I closed a while ago.

slender thistle
#

Those things differ per each bot

stable nimbus
#

I'm looking to try something like it, I understand it differs but I still want to try.

opal plank
stable nimbus
opal plank
#

also what is up with that english

#

what archive?

#

theres no archive in a ticket system

#

just dump the conversations in a database

stable nimbus
#

I give up.

opal plank
#

you are not explaining what you want

stable nimbus
#

I have.

#

Several times.

opal plank
#

u havent

#

"i want to archive a channel"

#

thats how u started it

stable nimbus
#

I wanna take a picture of inside the channel, all the messages, all the attachments, and shove it into an image or a .txt file.

#

Canvas is what I am looking for.

silk wadi
opal plank
lament stump
#

I'll try that, thanks c:

stable nimbus