#development

1 messages ¡ Page 1759 of 1

opal plank
#

u can probably do something like that

#

thats the closest you'll get without crating something from scratch

stable nimbus
#

That's what I am trying to do.

#

In a sense.

#

I'll figure it out.

cinder patio
#

There's a npm lib called discord-archive or something like that

boreal iron
#

Imagine being stalked by Germans... Germans! notlikenoot

earnest phoenix
#

1 gb ram good for my music bot

#

24/7 stay in vc

zinc wharf
earnest phoenix
#

i can add 2 gb if needed

zinc wharf
#

Again, depends on usage. Your bot may be in couple hundred servers, but it depends on how many of those servers are using the bot

#

And if it has a cuing system or not

quartz kindle
#

and most of all, it depends how many of them are actually listening to music, and how much audio is your library buffering

analog ember
#

hey there, do you know what it is with discord.py?
or does one have to wait an estimated 5 months for intent MegaThonk

cyan horizon
analog ember
silk wadi
#

For verified bots?

analog ember
#

yep

silk wadi
#

Big oof

analog ember
#

ah so no workaround

sudden geyser
#

or does one have to wait an estimated 5 months for intent MegaThonk
You can already use intents with discord.py

#

Are you referring to Discord's verification process?

silk wadi
#

Nah

analog ember
silk wadi
#

Yeah u need to reach out to Discord and it seems that the wait is very long 😂

marble juniper
analog ember
#

I shall come back in 5 months smirk

marble juniper
#

and yes i make the funniest jokes in the universe

silk wadi
#

Yeah no worries and good luck

boreal iron
sudden geyser
analog ember
sudden geyser
#

yeah

analog ember
#

which apparently is 5 months eta

sudden geyser
#

You sure it's that long or did something happened

analog ember
#

is what I heard since discord hasn't responded after 4-5 weeks even upon further enquiry

lament stump
#

I tried that now, 2 hours later ._., but didn't work

silk wadi
#

Oof

weary crypt
#

Not an expert in html, but have you tried <li> or using the nav-bar class and identifing them as nav-item?

lament stump
#

yeah <li> is the thing i use for this

#

I already have a navbar and idrk how it works, since null made it

weary crypt
#

I think there might be something else let me get it rq

#

<dl> and <dd> I believe it is?

#

Maybe that might work.

lament stump
#

I mean it's on repl, i could just simply send you an invite so you can take a look at the code

#

(<dl> and <dd> didn't work either)

maiden heath
#

Hey i want to start a project soon and need an bot dev who knows how to setup and code a bot im new and want to learn and need someone who can help me to create and make an stats bot 🙂

lament stump
#

What do you mean a "stats bot"?

maiden heath
#

you know like game stats or social media stats

lament stump
#

Ah, I sadly don't know how to code those :c

maiden heath
#

np

#

I wanna start with coding bots

#

and learn

#

mby making an nice bot cuz i got a nice idea wich could be get famous

#

If anybody can teach me how to code bots pls dm me and if needed i can pay for you

opal plank
# maiden heath mby making an nice bot cuz i got a nice idea wich could be get famous

2 things i should cut out right away, for your own good.

  • i would highly disencourage you to make bots with the intent of getting famous OR getting paid
  • while you shouldnt ask for coaches here, even if you were allowed to, this would be a very bad place to ask for hlep regarding that.

You should code a bot "just because". Wanna learn? amazing, go for it, we'll help you if u get stuck somewhere. Bored and wanna work on a project? sure, bots can be fun to make. But i would not recommend going with the mentality of fame or money for bots at all, that will only lead to dissapointment

#

i would recommend reading the guides we usually share here instead of hiring someone

wheat mesa
#

Well said

opal plank
#

being a dev requires you "to have your own 2 legs", meaning, you need to learn how to handle yourself, otherwise you're gonna be dependant for a long time on other devs to solve problems for you

earnest phoenix
#

H

opal plank
#

would recommend picking one of those.
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

maiden heath
#

Holly whit xd

#

but thanks dude ! @opal plank

opal plank
#

wrong person?

wheat mesa
#

Bots are not built as profitable endeavors

opal plank
#

thanks @crimson vapor

maiden heath
#

Ups

wheat mesa
#

So it’s not a great idea to build one with profit in mind

maiden heath
opal plank
#

nor fame, specially if you got for multi purpose or music bots

#

focus on an area that there arent many or any bots , and work on that area

#

be specific, target a specific audience

#

go for music and you'll be crushed, for example, rythm with 17 MILLION servers

#

same for moderation like mee6 with 15 million

#

TLDR: go in areas without competition if you have a hint of desire to have your bot grow

crimson vapor
opal plank
#

they pinged the 7sukoyomi guy

novel jetty
#

Can someone help me with this? The Bot works perfectly fine when i run it through VS Code but when i run it here it gives me this error

sudden geyser
#

Can you show us your directory

novel jetty
#

My bots main.js?

earnest phoenix
#

.glitch-assets lol

novel jetty
earnest phoenix
novel jetty
#

The error?

earnest phoenix
#

you need to share your code

novel jetty
#

Sure

earnest phoenix
#

Is the config file json?

novel jetty
#

Not

#

js

#

Its config.js

wheat mesa
#

Um. Why js and not json?

novel jetty
#

Why not js?

lament stump
#

because both work lol

wheat mesa
#

Ig

#

Just seems kinda odd

novel jetty
#

Hm

#

Is it because the config file is js?

#

I mean the error

spare badger
#

Show how you include the config file. It probably has something to do with that

novel jetty
spare badger
#

Show me where you import / require the file

novel jetty
spare badger
novel jetty
#

main.js

spare badger
#

I don’t see why this wouldn’t work without testing and I’m on my phone rn. Hopefully someone else knows.

novel jetty
#

Hmm

spare badger
#

I normally don’t use configs this way. You can take a look at the NPM package “dotenv”. I use that and a lot of other developers do aswell.

novel jetty
#

Hmm

humble rock
#

why it doesn't work

#

?

proven lantern
#

When are you saving it to mongodb?

vivid fulcrum
#

they aren't

humble rock
#

xd, i don't remember to save

#

Sorry for the inconvenience

earnest phoenix
#

Am I allowed to add something like this to the help menu? it will show only in the testing server pepehmmNoBG

vivid fulcrum
#

...sure?

#

you're not doing anything illegal lol

earnest phoenix
#

yea just making sure its allowed

#

lmao

prisma lion
#

hello ! guyz

#

im curious about this

#

?

sudden geyser
#

I think repl.it has a feature for storing databases (not directly in your project).

#

Of course, you can use external hosts to write to your database, but you probably wouldn't be on repl.it otherwise

regal jacinth
#

i can't install it

crimson vapor
#

to install pm2 you need to install nodejs

#

nodejs has a list of ways to install based on operating system

vivid fulcrum
#

i mean

#

screen is preinstalled on DO machines

#

why not just use that

#

and save your resources while you're at it

boreal iron
#

Didn’t we discuss that already?

crimson vapor
#

ig its better to use screen

#

you're right

boreal iron
#

Or just a service to make sure the app is still running after a crash or reboot

regal jacinth
#

hi, i am using digital ocean to host a discord.py bot
so i used tmux to run it after connecting to the droplit
it was working fine i assume
then i wanted to upload new changes to the files
so i deleted the session from tmux and made a new one
but now it only runs some files from the cogs
and completely ignore the others

earnest phoenix
#

I

zenith knoll
#

if someone knows abt db, is it possible to have multiple conitions? like SELECT * FROM <table> WHERE <value>=<value> AND WHERE <value>=<value>?
and if i can use data from same database
like if the column has the keys of id, maxmembers, membercount
then i can do WHERE id='99' AND WHERE membercount< maxmembers

placid iron
#

It's just AND

#

But yes you can

zenith knoll
#

just not add sing quotes

placid iron
#

Yeah I'm pretty sure you can, I'm on my phone rn so you will have to Google how to though

zenith knoll
#

thx

zenith knoll
lament stump
#

about my code, i managed to center all of that stuff, but now i need to make spaces pain

flat viper
#

dfsdf

#

sashibuna

#

mudebara

umbral zealot
#

English, please.

boreal iron
#

After sorting the rows you like to

zenith knoll
#

or like for example

#

the one that has the most membercount but the member count is less that the max

boreal iron
#

am i able to get the random of the to p3 most populated servers or something
Not with SQL only but yeah you're able to.
SELECT member_count FROM servers WHERE is_active = 1 ORDER BY member_count DESC LIMIT 3
Just as example...
Assuming a column is_active exists as well as member_count
You sort the table by the member_count in descending order and limit the result to 3 rows.

#

Just pick one element out of the result (array) for example. Math.random...

zenith knoll
boreal iron
#

The SQL syntax is right, yeah. If the column names and vars are accurate it should work.

#

Can't help you with JAVA, sorry. Will never touch that shit.

zenith knoll
#

kk

boreal iron
#

If the actual player count may reaches your max players var you should change the condition to AND playerCount <= maxPlayers

#

And make sure the column names are accurate (case sensitive) ORDER BY playercount should be playerCount in your provided example

#

You can also use the case insensitive mode if your gamemode var may contain different characters than the rows have.

#

WHERE gameType LIKE '" + gamemode + "'

sudden geyser
#

For Postgres, should you login as postgres or create a new user (e.g. my name)?

lament rock
#

always create a new user and limit it's permissions

boreal iron
#

I would limit the root access to a database always to the local system

zenith knoll
boreal iron
#

Sure, was just an example

earnest phoenix
#

how to know in which server my bot is ?

zenith knoll
#

like i think you cant do that

#

listing what server has ur bot

earnest phoenix
#

ok then if i want to leave bot from that dc server then ?

zenith knoll
#

why would you do that

earnest phoenix
#

not now when my bot will lag.

boreal iron
#

You can also use filters like IS NOT for example, WHERE gameType <> 'whatever'
The SQL syntax doesn't know !=
<> is the equivalent

earnest phoenix
#

how mmuch ram required for dc music bot 24/7 stay in vc

boreal iron
boreal iron
#

Additional to that all of them will be passed in the READY event.

wheat mesa
#

he's saying it depends how many servers your bot is being used in

boreal iron
pale sapphire
boreal iron
#

Nobody knows, right? You need to calculate it your own.

sudden geyser
boreal iron
earnest phoenix
#

1 gm ram is good for music discord bot 24/7 stay in vc

sudden geyser
#

who knows

wheat mesa
boreal iron
#

I would be more worried about the CPU and bandwidth usage

#

Just rent a scalable cloud server to adjust the system hardware at any time

odd stratus
earnest phoenix
#

also that command is considered api abuse, since according to that it dms everyone in the server

lament rock
robust crown
#

um so this always happens to me im just confused because big bots dosent get affected by this is this because they have clusters?
and is so what are clusters for and how to make one?

#

just need help ;-;

modest crane
#

read the error

robust crown
#

yah its to many requests

#

but still i want a way to stop this

#

from keep happening

modest crane
#

are you using repl?

robust crown
#

yes

modest crane
#

well thats the reason

robust crown
#

thats what can i use since heruko is bad

robust crown
modest crane
robust crown
#

oh

modest crane
#

use a vps

robust crown
#

but all free hosting shared ips

lament rock
# robust crown um so this always happens to me im just confused because big bots dosent get aff...

I think you misunderstand what a cluster is. Your issue is that you have logged in more than 1000 times within the past day. This can be resolved by improving your logic and handling errors which would otherwise crash your process. There are also techniques to maintain uptime such as dropping module caches and re-requiring and using the updated cached values. The methods for doing this may vary on the language.

As for what a cluster is, I'll pre-face by saying that even large bots have issues when it comes to logging in. They practice rolling releases to not log in too many times in a day when making changes that require a restart which is why some shards may have some changes before others. LARGE bots also have a higher limit on identify calls because of the fact that they need to login more shards.

A cluster is self explanatory based on the name. It's a cluster of shards. Shards can be clustered in different ways. Either in the same process or in separate processes on the same VM. having multiple shards in the same process and having computationally expensive tasks executed on different threads is my preferred method, but it's easier to just spawn a bunch of different processes with the same code

modest crane
#

if you have a credit card you can use google cloud and oracle cloud

#

otherwise you'll have to pay

robust crown
#

oh

robust crown
#

😐

modest crane
lament rock
#

yeah. One more thing. Don't shard unless you're in at minimum 1500 guilds. Don't even consider it because it offers no benefit

robust crown
#

oh ok

#

my bot is just in 33 servers

lament rock
#

You have a LONG way to go

crimson vapor
#

does sharding have any benefits at all?

#

sharding is only for discord, right?

#

it would be a form of clustering that benefits the bots, right?

sudden geyser
#

It's more of a matter up to the developer

#

Usually it's just "turn it on and don't think again"

modest crane
lament rock
#

Enforcing "multi-threading" practices which is easier than actually attempting to understand multi-threading. The issue comes down to when you have to process a bunch of socket messages, depending on the encoding, things can become computationally expensive and the thread that processing is done it won't leave much headroom for the client code base

#

efficient multi-threading is somewhat advanced but very important to know

#

sharding also doesn't only apply to Discord bots. Clustering/Sharding is also applied in other places such as Databases. The concept of master-slave database structures exist for a reason. The slaves act as workers to perform the ops the master requests of them while the master processes requests as a centralized hub for handling and also keeps track of which data is where or doesn't depending on if data redundancy is enforced

robust crown
#

i also have a db

#

mongodb

#

also free clustering

#

;-;

worn sonnet
#

Oke so react Devs help me and share the resources to learn react js

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

umbral zealot
dense spire
#

anyone know how to remove the reactions that the bot placed itself

#

ive tried a few different ways but they all seem to not work so

lusty quest
#

does the bot got the Manage Messages permission?

#

wait nvm its only for reactions from others

#
String code = emote.isEmote()
      ? emote.getName() + ":" + emote.getId()
      : MiscUtil.encodeUTF8(emote.getName());
Route.CompiledRoute route;
if (user.equals(getJDA().getSelfUser()))
``` this is for removing reactions.
dense spire
#

cant say that looks like python

#

:^)

lusty quest
#

well did you mentioned a language?

dense spire
#

i know

lusty quest
#

if no i pick a random language and paste the solution for it.

dense spire
#

thank you for the suggestion but I need python support

#

though im assuming im just using message.remove_reaction() incorrectly

lusty quest
#

you probably have to define what reaction to remove

dense spire
#

in the first parameter it requests an emoji object? im presuming

lusty quest
#

idk i dont use py

dense spire
#

How would i go about getting that with just the string

rocky hearth
#

message.reactions.remove("your-client-id")
@dense spire

dense spire
#

is there a simple remove all reactions?

rocky hearth
#

yes reaction.clear() I think

dense spire
#

would that auto go through the list?

rocky hearth
#

u want to remove all reactions from the message or, just a single reaction?

dense spire
#

all

#

but pretty sure the clear() was only part of a single reaction object right

#

and message.reactions gives a list

#

so im assuming that clear() would run through every element of that list

rocky hearth
#
for reaction in message.reactions:
  reaction.clear()
dense spire
#

that did not work : )

#

both message.reactions.clear() and the iteration way

rocky hearth
#

any errors

dense spire
#

i c

#

theres an actual clear_reactions() for message

rocky hearth
#

ooh yes. there u go

dense spire
#

ok thats works

earnest phoenix
#

await

vagrant sorrel
#

okay what to do if the command is decided by the user
what to name the file inside the command folder?

    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()```
in this case the command becomes the last endpoint of the api
spare badger
#

@vagrant sorrel I would recommend to think of a command starter en then use the first parameter for the currency. So instead of !btc do !price btc. This way your bot won’t interfere that fast with other bots.

#

Naming convention is totally up to you, there is no good or bad way I guess. The only good way is the way in which you and other programmers that work in the project can find their way through the codebase.

vagrant sorrel
#

that's a good thought

vagrant sorrel
spare badger
#

Ah no .s btc should be fine. I thought you were going to do something like .btc that way your bot will be listening to everything starting with .

lusty quest
#

@opal plank does detritus have a embed constructor? the docs doesnt give me any result if i search for embed.

vagrant sorrel
vagrant sorrel
spare badger
#

It would work! It would also be easier for you I think, but the command would be longer for the user.

vagrant sorrel
#

yes, i will try both methods then

spare badger
#

Good luck!

vagrant sorrel
#

thanks!!

worn sonnet
#
console.log(name)
{
let name = "ABC"
console.log(name)
}
console.log(name)
lusty quest
#

some context?

worn sonnet
#

i just did

near stratus
#

also

worn sonnet
#

I started learning JS

earnest phoenix
#

Who knows the regexp for a youtube link please?

spare badger
#

gosh no not regex

earnest phoenix
#

how so? @spare badger

spare badger
#

My worst nightmare

earnest phoenix
#

..

vagrant sorrel
#
const fetch = require('node-fetch');


class InfoCommand extends Command {
    constructor() {
        super('info', {
            aliases: ['info', 'i'],
            channel: 'guild',
            category: 'Utilities',
            description: {
                content: 'This provides the description/info of a coin'
            },
            args: [
                {
                    coin: 'code',
                }
            ]
        });
    }

    async exec(message, { coin }) {
        const getInfo = async () => {
            const result = await fetch(`https://api.coingecko.com/api/v3/coins/${coin}`)
            const json = await result.json()
            return json
        }
        
        const com = await getInfo()
        console.log(com)

        if ((com.description.en).length > 2000) {
            result = com.description.en;
            info = result.slice(0, result.length - 100);
            console.log(info)
            message.reply(`
      
           info: ${info}
      
          `)
        }
    }
}

module.exports = InfoCommand;

near stratus
earnest phoenix
#

all but i have found

#

/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/

vagrant sorrel
lusty quest
#

learn how to debug. add break points, and there are many other ways

near stratus
lusty quest
#

well its a quite important part of coding lol

vagrant sorrel
#

i just had to learn how to debug

#

bro I tried a loootttttt, and only after I fail I come here for help

lusty quest
#

does the API got a info endpoint?

vagrant sorrel
#

NO

lusty quest
#

then it cant return anything

vagrant sorrel
#

bitcoin is the endpoint

lusty quest
#

did you checked the path inside the json you get?

vagrant sorrel
#

then i do bitcoin.description.en to get the info

vagrant sorrel
lusty quest
#

well then the entire thing will fail

#

first make sure that you handle if the api returns proper data or undefined stuff

vagrant sorrel
#

yea lemme see brb

earnest phoenix
#

How can i delete embed ?

#

(please)

vivid fulcrum
#

put the url in <>

earnest phoenix
#

Ok thx ^*

errant flax
#

How do u get a guild member of a user that ran an interaction

lusty quest
#

then handle the errors properly

vagrant sorrel
near stratus
vagrant sorrel
#

okay wait

lusty quest
#

ive called it with a browser and worked just fine for me

vagrant sorrel
#

it works fine

lusty quest
#

you probably add some whitespace to it

golden rock
#

What does fetch do

lusty quest
#

its a lib for making web requests

golden rock
#

Fetch and get are very different, you want to be using get

#

Ah ok

near stratus
#

@vagrant sorrel

{
  "error": "Incorrect path. Please check https://www.coingecko.com/api/"
}
golden rock
#

I'm a python guy 🤷‍♂️

near stratus
golden rock
#

Yeah in Python we'd do requests.get

lusty quest
vagrant sorrel
#

soemthing is wrong with my function

vivid fulcrum
#

browser (running from console) is going to block the fetch request because of CORS

spare badger
golden rock
#

Is there like a fetch.get function or something? Or is fetch the actual correct function

near stratus
vagrant sorrel
spare badger
vagrant sorrel
lusty quest
#

works for me

vagrant sorrel
#

as i said 10 times before

#

the api works fine

#

something is wrong with my function or logic

lusty quest
#

i guess your coin value is badly configured

#

console.log coin and see how its formated

vagrant sorrel
vagrant sorrel
spare badger
#

Yea its not CORS.

vivid fulcrum
#

what's the error you get in the first place

spare badger
golden rock
#

Sure seems like something's wrong with fetch to me

vivid fulcrum
#

that's CORS because it's being ran in the browser console

spare badger
vivid fulcrum
#

what's the actual error in the node app

vagrant sorrel
vivid fulcrum
#

node-fetch is a node port of the browser fetch API, browsers have fetch natively

vagrant sorrel
#

i have 3 consolelogs

vivid fulcrum
#

why do you think it's the api request that's causing the problems

#

seems to me you have a misconfigured command handler

vagrant sorrel
#

but when i do .s info bitcoin it says:

Invalid Date
(node:6032) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'buy' of undefined
    at PriceCommand.exec (C:\Users\hp\Desktop\Stonks\commands\Public\price.js:40:29)```
lusty quest
#

console.log what it returns

spare badger
#

Console log the URL

lusty quest
#

but my guess is that you send the wrong stuff

vagrant sorrel
#

and that 'buy' thing is some other api command i have named price

#

i think 2 commands are interfering

#

oka forget that info.js, i deleted it

near stratus
#

@vagrant sorrel the code you gave actually works

vagrant sorrel
#

here is a command that used to work and now it doesnt

vagrant sorrel
#
const { Command } = require('discord-akairo');
const fetch = require('node-fetch');


class PriceCommand extends Command {
    constructor() {
        super('price', {
            aliases: ['price', 'p'],
            channel: 'guild',
            category: 'Utilities',
            description: {
                content: 'This provides the price and other details of a specific coin'
            },
            args: [
                {
                    coin: 'code',
                }
            ]
        });
    }

    async exec(message,{coin}) {

        const getPrice = async () => {
            const result = await fetch(`https://api.wazirx.com/api/v2/tickers/${coin}`)
            const json = await result.json()
            return json
          }
          let com = await getPrice()
          console.log(com)
          const stamp = new Date(com.at * 1000);
          const time = stamp.toLocaleString(undefined, { timeZone: 'Asia/Kolkata' });
          console.log(time)
      
          message.reply(`
          
          Buy: ${com.ticker.buy}
          Sell: ${com.ticker.sell}
          Low: ${com.ticker.low}
          High: ${com.ticker.high}
          Last: ${com.ticker.last}
          Vol: ${com.ticker.vol}
          at: ${time}
          
          `)
    }
}

module.exports = PriceCommand;
#

try this

near stratus
vagrant sorrel
vagrant sorrel
near stratus
#

if you're not happy then fine I added coin name support

vivid fulcrum
#

you probably aren't executing the command in the first place

#

your command handler is fucked

vagrant sorrel
#

simple commands work

fair axle
#

How can I get the all event handlers and their args on discord.js?

boreal iron
worn sonnet
#

Hey is there any thing like webhook service from reddit?

#

Where I can get notified everytime someone posts on a specific sub?

#

All I want to do is

#

Post that submission in a discord channel once it's uploaded on sub-reddit

lusty quest
#

IFTTT can do it

unique panther
#

So, I'm using Python to make a bot but it's showing Syntax error whenever it's at the Async line

sudden geyser
#

Show your source code

unique panther
#

@client.command()
async def hi(ctx):
Await ctx.send(bla bla bla)

sudden geyser
#

Async shouldn't be capital.

#

And you're missing the colon after the function parameter list (def hi(ctx):).

unique panther
#

Ik I'm using phone to write on discord so auto caps and stuff

slender thistle
#

Syntax error...

mental raven
#
  embedVar.set_author(f'{user.name}', url=f'https://discord.com/users/{user.id}', icon_url=user.avatar_url)

Why doesn't this work? Discord.py

slender thistle
#

What error are you getting?

mental raven
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_author() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given
sudden geyser
#

If your code is structured like this in your source code: ```py
@client.command()
async def hi(ctx):
await ctx.send(...)

There's a chance your Python version doesn't support the async/await keywords.
slender thistle
#

aka python 2

unique panther
#

But it used to work

sudden geyser
#

nah like before 3.3 I think

unique panther
#

I have python 3.8 or 3.7 I guess

slender thistle
#

Oh yaeh

slender thistle
mental raven
#

no

sudden geyser
#

Well you've either structured it incorrectly or your Python version doesn't support it—one of the two.

slender thistle
#

As the names suggest, a positional argument is defined by its position, and a keyword-only argument is specified by a keyword explicitly

mental raven
#

ok

slender thistle
#

Positional:

my_function(positional_argument)

Keyword-only:

my_function(keyword_parameters=keywoord_only_argument)
mental raven
#

cool

vivid fulcrum
#

translation: i dont understand a thing

mental raven
#

lmao

#

put it inside ``

patent geyser
#

there are too many peopole here

fringe coyote
#

Lmao

mental raven
fringe coyote
#

I don't know if discord.js has something specificly for pings

fringe coyote
patent geyser
#

no me neither

mental raven
#

Do you remember me?

fringe coyote
#

But i do know if you put <@ before and > after a user id it will form a ping

mental raven
#

yeah

fringe coyote
patent geyser
mental raven
fringe coyote
#

I don't know discord.js, sorry, i was just adding that in because i thought you wanted to ping someone

patent geyser
#

oh thats okay dont worry

#

time to consult the gods of stack overflow

slender thistle
#

@mental raven Going back to your case, set_author does not require any positional arguments, meaning all of the arguments you listed must be specified with keywords

#

In your case you have one positional argument set, which I assume is the name argument

opal plank
lusty quest
#

figured it out already

real helm
#

Hello

#

Someone helps me in awaitMessage filter?

#
 const filter = (m) => m.author.id === mentioned.id
                message.channel.awaitMessages(filter, { max: 1, time: 60000, errors: ['time'] })
                .then(async collected => {
    
                if(collected.first().content.toUpperCase() == "YES") {
                 //something
                 }
       });

   });
earnest phoenix
real helm
#

It doesn't work

#

I think, the filter is wrong maybe

lusty quest
earnest phoenix
real helm
#

message.mentions.users.first()

lusty quest
#

but the debugger. i wish i used it for ever. makes debugging so much better.

earnest phoenix
real helm
#

okay

eternal osprey
#

hey how do i push a sentence seperated by a comma to an object?

#

so test1, test2, hey i love coding, test3

#

all need to be pushed in the form of: ["test", "test2", "hey i love cats"]

earnest phoenix
#

"push"?

eternal osprey
#

yeah but wouldn't that ive me somethin like this:

#

["test1, test2, hey i love coding, test3"]

earnest phoenix
#
{
  x: [...]
}``` you mean like this?
eternal osprey
#

no

eternal osprey
earnest phoenix
#

So you just want to push a sentence seperated by commas to an array?

eternal osprey
#

yeah

lusty quest
#

@opal plank you use postgres right?

earnest phoenix
eternal osprey
#

alright so if i get it right, i should use test.push(...args(for example))

clear marlin
#

yes

eternal osprey
#

alright, thanks

earnest phoenix
#

x.push(...args) yes

round quiver
#

if anybody has used canvas here , can he recommend some nice font for profile card?

eternal osprey
#

i am having a few problems here

#
const description = args.toString().substring(m)
console.log(description)
const f = description.replace(/,/g , " ");
console.log(f)``` i've used split and eventually map
#

so i could read the contents better

#

but now it returns this: testing,this,out,,will,it,work?,,not,sure
after sepearting with comma;'s

lusty quest
eternal osprey
opal plank
eternal osprey
#

but that left me with: testing this out will it work? not sure

limber cove
#

I have contributed to the Luca repository, how do I get the role?

lusty quest
#

nice

slender thistle
#

How do you contribute to a meme repo

eternal osprey
clear marlin
#

why don't you use this

#

instead of .toString()

lusty quest
clear marlin
eternal osprey
#

to remove the double spaces and replace it with ,

clear marlin
#

why use regex when you can use that instead

eternal osprey
#

testing this out, will it work?, not sure i am left with this now.

eternal osprey
clear marlin
#

yeah, was just easing your business

eternal osprey
#

what

#

no no don't get me wrong

#

i really appreciate your help

vivid fulcrum
#

why not just

#

replace the commas with nothing

#

an empty string

eternal osprey
#

because i actually want to seperate the messages

olive roost
#

how do i make a vote count like in a channl it displays the user who voted vote count

eternal osprey
#

and push them to the array

vivid fulcrum
#

...split? lol

eternal osprey
#

["testing this out", "will it work?", "not sure"]

vivid fulcrum
#

yeah, so where's the problem

eternal osprey
#

it actually pushes like this: ["testing this out, will it work , not sure"]

vivid fulcrum
#

you went wrong somewhere

#

what's your code

lusty quest
#

@opal plank are there typings for node-postgres?

eternal osprey
#
const d = f.replace(/  /g , ", ");
console.log(d)
if(args[0][1] == 'Booster'){
    array1.push(...description);
    fs.writeFileSync("./array1.json", JSON.stringify(array1))
    message.channel.send("**Your collection entry has been saved to the ``Booster`` section!**")
     }


if(args[0][1] == 'Free'){
    array2.push(d);
    fs.writeFileSync("./array2.json", JSON.stringify(array2))
    message.channel.send("**Your collection entry has been saved to the ``Free`` section!**")
     }```
vivid fulcrum
#

json as db

#

🙄

eternal osprey
#

for personal use

vivid fulcrum
#

yeah i don't believe you but whatever floats your boat

eternal osprey
#

my main bot is already migrated to mongodb

#

i can show you lmao

vivid fulcrum
#

what does d output

#

in the console

#

that code is so messy

#

i can't tell what is what

lusty quest
#

wait you still use json dbs?

eternal osprey
#

testing this out, will it work?, not sure

eternal osprey
lusty quest
#

i would just use sqlite instead of json

cinder patio
#

Don't replace at all, just use split with the regular expression

eternal osprey
#

const final = d.split(', '); but this eventually adds it like this: [["testing", "hello"]]

#

so if i want to add anything esle

#

it returns:

#

[["testing", "hello"], ["anything else", "test2"]]

opal plank
lusty quest
#

this is node-postgres

opal plank
#

im aware, im telling you to use pg instead

opal plank
#

its literally called pg

sudden geyser
#

Although it's called node-postgres, it's dependency is pg

lusty quest
#

yea i know

opal plank
#

its much better to use pg right away

#

i remember some annoying af things with types before with that other one

sudden geyser
#

SQLite is nice too

eternal osprey
olive roost
lusty quest
#

one thing i not really get are queries, atleast for now

#

like creating a table with mutiple rows

opal plank
lusty quest
#

right could make the tables this way

#

then just insert the stuff

opal plank
#

tis what i do

#

i dislike creating tables and all that jazz with code

#

having a UI helps, then its just INSERT, UPDATE, DELETE queries

lusty quest
#

what are they called in pg? mongo got documents

opal plank
#

tables

#

?

lusty quest
#

nvm found the query tool

opal plank
#

in postgres its all under a schema => then you got tables, then each table has rows and columns

#

thats about it

lusty quest
#

yea havent used a sql based database for a while

opal plank
#

if u have pgAdmin, the only thing you'll need is

#

INSERT, UPDATE, SELECT, DELETE

#

thats about it

lusty quest
#

yea i know

#

havent forgotten everything about sql

opal plank
#

if u need help with the querries lmk

lusty quest
#

thx

opal plank
#

np

lusty quest
#

@opal plank would it be the smartest to Map the argumet from ParsedArgs first or just deconstruct the object? im dumb sry for the ping

lusty quest
#

@opal plank does Detritus have something like d.js awaitmessages?

opal plank
#

here

lusty quest
#

thx

opal plank
#

np

#

if its confusing let me know

#

but the idea is simple

#

theres even a paginator in it

lusty quest
#

well i just want to collect messages, dont need pagination.

#

well then i have to do the stuff in a more annoying way i guess

quartz kindle
#

fucking hell why is keydb so hard to setup

sudden geyser
#

you forgot your keys

quartz kindle
#

only took me like 4 hours to get it running

lusty quest
#

i would have been annoyed enough after 1 hour to just run it inside docker. did the same with MongoDB

quartz kindle
#

this isnt even docker

opal plank
quartz kindle
#

lmao

opal plank
#

or just provide an empty array

lusty quest
opal plank
lusty quest
opal plank
#

fair

quartz kindle
lusty quest
#

docker is best

#

easy way to run stuff on pretty much every OS natively

quartz kindle
#

ye with only another layer of virtualization on top of an already existing one

#

how deep are we gonna go?

lusty quest
#

docker is relatively lightweight tho

#

but yea run a container inside a container running on a VM running inside a Container

quartz kindle
#

can you run docker inside docker?

#

can you run docker inside kvm inside docker inside kvm?

lusty quest
#

no

#

docker is not really a KVM since it uses the Kernel of the host OS

quartz kindle
#

can kvm run inside kvm tho?

lusty quest
#

but running docker on a KVM running inside a KVM is possible i think

quartz kindle
#

can openvz run inside docker?

#

lmao

lusty quest
#

only the other way around

#

but docker is nice stuff if you have to run a ton of stuff inside VMs

#

way less overhead and more efficent resource usage since its dynamic

quartz kindle
#

ye

#

i dont really need it tho

#

im setting up this vps to run a single service

lusty quest
#

i usually use it if im to lazy to setup something, like Database server

#

its way easier to just run one command and you are done

quartz kindle
#

can docker expose a sock file to another docker?

lusty quest
#

you could use docker networks for communicating between containers

quartz kindle
#

but can they run on sockets or only tcp?

lusty quest
#

you can expose the socket, but its not recommended

quartz kindle
#

b-b-but

#

socket fast

#

tcp slow

lusty quest
#

you could probably expose a socket within docker, but not the docker socket itself since it would entirely defeat the purpose of virtualisation of the containers

quartz kindle
#

well im already running my vps on root

#

xd

lusty quest
#

nah just block all ports and allow ssh only from your IP

quartz kindle
#

i cant

#

dynamic ip plus im not always home

lusty quest
#

well, then use a VPN to get access

quartz kindle
#

lmao

#

arent ssh keys enough?

lusty quest
#

its no joke lol, when i where sysadmin for a small hoster we had locked the entire Backend behind a private network and to get ssh access you needed to run a VPN to a server inside the Private network

lusty quest
sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

icba setting up that much security

sage bobcat
#

One message removed from a suspended account.

lusty quest
#

or just run the basic stuff like, changing SSH port, installing fail2ban, using ssh keys

quartz kindle
#

changing ssh port is useless

#

i have fail2ban

#

on aggressive mode

lusty quest
#

the best counter to people who tried to get into servers where that they where locked in a infinite login

slender thistle
#

WHY DOES SPHINX NOT ALLOW DEFAULT VALUES

lusty quest
#

usually they have just a pc running that bruteforces into the connection, but the script never logs you in properly without ssh key so they are stuck in a infinite login loop

quartz kindle
#

but doesnt that cost resources?

#

keydb with tcp = 27k ops
keydb with sock = 40k ops

lusty quest
quartz kindle
#

im setting this up to be a prod machine

#

gotta go fast

scenic kelp
opal plank
woeful pike
#

unless there's a better alternative to it in another language that offers the same kinds of abstractions

sage bobcat
#

One message removed from a suspended account.

scenic kelp
#

dictionaries are for key-value storage

visual goblet
#

is there any resources for an sql database? i watched a couple videos but im not really sure how to continue from there

zinc wharf
#

I always believe the best way to learn, is to struggle and find the answers your own way

#

But, if you're not that type of person, then I'd recommend looking at simple things, for example, insert, delete, where, or and order by queries

#

This is bit more complex, but really useful, insert or update (on duplication) query

earnest phoenix
visual goblet
#

i have a db.py folder made and it has scriptexec and updates and everything just the issue is idk where to go from there

zinc wharf
earnest phoenix
#

not really

#

I've learned everything that way

visual goblet
earnest phoenix
#

only downside is you tend to lean more to use the ways youve seen throughout that code

#

which could sometimes not be the best

zinc wharf
#

I've learnt by struggling tbh

earnest phoenix
#

but you'll realize eventually

visual goblet
#

i have my entire db made and i have my sql file but thats all they taught us and now im like just trying to figure out a way how to make a table that works for me and how to import it to my main file and make commands out of it

#

but there is highly limited d.py support as i see nobody really doing it anymore

earnest phoenix
#

I'm afraid we might need some more context to it

visual goblet
#

i have everything setup my database is made

earnest phoenix
#

d.py has an entire community supporting it

#

there's a server for it

visual goblet
#

yeah and its garbage

opal plank
#

@zinc wharf@earnest phoenix@visual goblet or you could do the way sane developers learn. By reading the docs https://dev.mysql.com/doc/

earnest phoenix
#

not really, Dani himself helps people out there

#

maybe youre in the wrong server?

visual goblet
#

the people in the server arent helpful whatsoever and when i was starting out they made fun of me lmao

#

worst "support" server ive ever seen

slender thistle
#

Can back this up

zinc wharf
earnest phoenix
#

@opal plank Yeah docs... I'm afraid that's the kind of things they start by schools and univs only

opal plank
slender thistle
#

The official support server is just toxic and unwelcoming

earnest phoenix
#

sane devs don't start off by docs

visual goblet
#

d.js was garbage too they all ganged up on me

clear marlin
opal plank
#

everyone reads tyhe docs

#

wtf

earnest phoenix
#

yeah but not to start with

opal plank
#

any SANE dev will read the docs. only people who starded developing for less than 2 weeks wont do it

eternal osprey
#
if (args[0][1] == 'Booster') {
                console.log(name)
                if(!database1[name]) database1[name] = {
                    names: []
                   
                  };
                
                 
                database1[name].names.push(...final);
                fs.writeFileSync("./database1.json", JSON.stringify(database1))
                message.channel.send("**Your collection entry has been saved to the ``Booster`` generator!**")
            }```why is my json file not being overwritten?
#

It just sends no error, no outputs.

visual goblet
eternal osprey
long crow
opal plank
zinc wharf
opal plank
#

that i WILL give you

opal plank
#

dont

earnest phoenix
#

@visual goblet if you could show us some more context or code maybe we can help you a bit more

#

Json wtf?

visual goblet
#

thats the problem im afraid i dont know where to begin

opal plank
visual goblet
#

i have my database created but thats legit all

slender thistle
earnest phoenix
#

Begin by describing what you have, and then what you need and finally what you don't understand

clear marlin
#

huh

visual goblet
#

yeah like warnings

#

and timed mute

slender thistle
clear marlin
#

to store command data*

slender thistle
#

Oh, I see

visual goblet
#

store the data

#

ye

#

sorry

visual goblet
clear marlin
#

I mean still mate, the documentation has everything you'd ever need

visual goblet
#

we just fuck up and fix it

eternal osprey
slender thistle
#

I'd suggest getting a hang of SQL and working with it, especially the SQLite dialect

opal plank
#

you shouldnt, either way

clear marlin
eternal osprey
#

but i am not saving important data

slender thistle
#

Once that's done, you can go on to create your table. That's where it gets tricky. Make sure you analyze what you need to store and in what data type

clear marlin
#

json isn't reliable

eternal osprey
#

just some little things

opal plank
#

you shouldnt either way

clear marlin
#

keyv dbs are easy as cake

visual goblet
clear marlin
visual goblet
clear marlin
#
earnest phoenix
#

I think you're confusing importing with querying

visual goblet
#

its my first time with a database so im trying to get some good sources to see who can help me out with explaining it in a simple way

clear marlin
#

but please avoid using json as database

visual goblet
#

then i can mess around

opal plank
# eternal osprey ```js if (args[0][1] == 'Booster') { console.log(name) ...

problems with this. first, what are args[0][1]? normally this would be a single letter, also check with === not ==
second, what is that indentation?
third, await and catch your promises
fourth dont use json to store shit. period. It clearly shows you arent worrying about atomic operations whatosever.
please keep consistency in ur code. why'd you use ; and stopped mid way?

zinc wharf
#

Json as a database is a big no no

visual goblet
slender thistle
# visual goblet yeah of course i have a good idea on data types and all that im just confused on...

I suggest using this package https://github.com/omnilib/aiosqlite if you're more or less well-versed with the sqlite3 package itself. It's asynchronous (meaning running its methods won't block your main thread) and seems to be trusted, although I haven't used it personally.

GitHub

asyncio bridge to the standard sqlite3 module. Contribute to omnilib/aiosqlite development by creating an account on GitHub.

earnest phoenix
#

WHO'S USING JSON AS DB

#

anyway i used ini as db back in 2012

visual goblet
#

buddy of mine stored data with a json and he fucked up with some code and his entire json data just wiped and his bot became less popular to the point where he quit

zinc wharf
#

I personally use MySQL, mainly because I can access it from anywhere. Discord Bot, website, software, mobile apps, helpful to link everything together

slender thistle
#

JSON as a database is not necessarily bad. It just requires careful handling since there's a lot of stuff that can go wrong

clear marlin
#

ini as db

slender thistle
#

It's like they say, "It's not bad if you have any clue wtf you are doing"

earnest phoenix
#

I had like 12k ini files for 12k users

#

crazy right

digital swan
#

i used json as a db for a year 😳

visual goblet
#

i have my db all set just the issue is tables so i need to work on that but ive looked for sources and the only thing people seem to want a db for is a knock off mee6 tutorial

slender thistle
#

We all need a little guidance at some point, even the best of us 😛

earnest phoenix
#

yes Shiv stop putting all the code in one file

#

seek help

digital swan
visual goblet
#

ive only used a json file once for custom prefixes but it didnt even work lmao

slender thistle
#

I assume you want to make a public bot?

visual goblet
#

yeah its actually already public in 17 servers and counting

#

i shouldve waited but i didnt

#

nobody really uses it for moderation since theres way better bots but id like to just have mod stuff just to learn really

opal plank
ruby flame
#

😂

earnest phoenix
#

seek help

slender thistle
#

I'm not that much familiar with SQL so I can't exactly give much guidance here

opal plank
#

i will revoke your coding license if you dont fix that shit in the next 2 days

slender thistle
#

You might want to look into foreign keys, that could be helpful

clear marlin
#

what guidance needed though?

opal plank
#

you've been warned

visual goblet
#

yeah the issue with a database is theres so much i need to know and i cant really find what i need so i came here for sources and to see what i need to know

opal plank
#

and what exactly do you need to know?

visual goblet
#

its my first one ive been working on it for a week and im so fucking confused LMAO

opal plank
#

i use PostgreSQL so i can give some insight

ruby flame
#

Is there any free database providers with limited storage?

visual goblet
earnest phoenix
#

You don't necessarily need to start by learning about foreign keys

visual goblet
#

i am a python man

earnest phoenix
#

that can come later

earnest phoenix
slender thistle
#

True

visual goblet
#

i just need some recources to gain an understanding of making a simple database and how to put it into my main files and make it function

#

i dont really know much about tables

compact valve
#

what wrong with is header p {
color: black
}

clear marlin
#

did you know that there's something called sqlalchemy in python?

ruby flame
#

can anyone here easily explain the difference between: unique keys, primary keys and foreign keys in 6 sentence?

crimson vapor
earnest phoenix
#

I think you should be literally good to go if you read about INSERT UPDATE AND DELETE from w 3 school

visual goblet
#

i did not know that i only know about mongodb and sqlite3

#

but i do know theres a lot more db out there

clear marlin
#

its just meant for sql

compact valve
clear marlin
earnest phoenix
#

oh yeah hehe

visual goblet
#

i know theres a bunch of different ig you can say versions of sqlite3 but im just trying to see what would work for a beginner and how i should go about this

earnest phoenix
#

w3schools website is a great inspiration for me idk about y'all

clear marlin
#

like what sql dialect?

earnest phoenix
crimson vapor
#

yea but other than that sharding does nothing

earnest phoenix
#

you can just make the I'd column auto increment and forget abt it

sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

sharding is just for discord's sake

visual goblet
crimson vapor
#

split the shit between different websockets

digital swan
#

it’s probably something to do w sending out huge amounts of data to one process

crimson vapor
#

yes

clear marlin
crimson vapor
#

rethinkdb is not sql, is it?

clear marlin
#

meh

visual goblet
earnest phoenix
#

uh no

#

the ai must also be primary key

clear marlin
#

oh well that might be easy than, I mean I basically thought you were talking about mysql or some larger dialect of sql. In that case, sqlite has its own pypi package thus, you would have much of an issue

visual goblet
#

i have a db.py folder with all the needed information and then i have a build.sql folder for tables and other info but the problem is that is all i know so im needing to see if theres any recommended tutorial videos or even just reading websites to learn how to use tables

#

then ill have to figure out how to use that database to collect command data and store it then have it used when someone calls it through the command but thats later on i dont need to worry about that right now

visual goblet
#

ill take a look thanks

ruby flame
#

Hey need one help

#

I want to give a member a role on voting

#

And I'm giving it in the webhook receiving function

#

What is the best method of removing it after 12 hours?

#

I tried await asyncio.sleep(42300)

#

But it's not reliable

#

Any other method without storing it?

earnest phoenix
#

ew no

#

wht ping command show user ping or bot ping i know how make i just ask

visual goblet
#

oh man i feel kinda dumb right now

#

i thought discord.py would handle databases differently and ive only looked for discord.py database tutorials

#

when in reality i dont think thats how it works

earnest phoenix
#

me to i just how make it

slender thistle
#

It doesn't use databases, yeah

visual goblet
#

yeah i feel dumb thinking that way LMAO

slender thistle
slender thistle
#

Ehh...

ruby flame
#

check if expired

visual goblet
#

wouldnt you do it every hour?

slender thistle
#

Every hour is fine

visual goblet
#

if you want it removed every 12 hours check every hour

ruby flame
#

Okay fine

slender thistle
#

What I used to do personally is run a d.py task run every hour and get the votes from my bot object's cache

ruby flame
#

bot object's cache?

#

you store it in a bot variable?

slender thistle
#

Both in database and cache

ruby flame
#

btw how you store in bot variable

slender thistle
#

bot.x = {}

ruby flame
#

How long will it remain?

#

without getting deleted

#

caches not permanent right?

slender thistle
#

Cache isn't permanent, that's why I stored everything in a database and cache

ruby flame
#

Yeah how long do you think the cache will keep it without we doing anything to it

slender thistle
#

As long as you don't restart your bot

#

You pull the votes from database, store them in cache. When you edit vote data (aka delete it), you delete it from the cache and database

opal plank
#

i usually check every hour and update it that way

#

with a simple timeout and interval

#

the database entries are loaded on startup

#

whenver someone votes, it refreshed their last_voted

#

thats about it

#

any checks u need you'll just check if their last timestamp has more than 24h's worth of miliseconds

visual goblet
#

hey so a question for anyone familiar with the d.py docs

#

is there a documentation on databases as ive heard that is really good to read?

slender thistle
#

A what

sudden geyser
#

You'll need another package for database logic.

slender thistle
#

There's no general documentation on databases, especially on discord.py docs page

visual goblet
#

ah okay

sudden geyser
#

If you want to start somewhere, Python has a built-in module for SQLite

visual goblet
#

yeah im using sqlite3 and i have a documentation for it

#

just working on learning about tables

#

and how i can change data from a command

earnest phoenix
#

hello any verify bot dev help me to veify my bot

#

pls

#

my english is not good

sudden geyser
#

Sounds like you're looking for the Discord Developers server

digital swan
earnest phoenix
#

i need help in wright this

digital swan
#

can’t u just write it in your native language

#

i’m sure they’ll have a translator

earnest phoenix
#

i cnt wright in text

#

bro

digital swan
#

will google translate help?

earnest phoenix
visual goblet
#

this is a lot more simple than i made it out to be

earnest phoenix
#

wait i show my language

#

हैलो बॉट देव

#

this is my language

#

i cnt wright it

#

so tuff

#

bro

near stratus
earnest phoenix
near stratus
#

tumko o lekhna chahiyein

earnest phoenix
#

dms ayo bhia

near stratus
#

b r u h

earnest phoenix
#

pls akio bhia

#

ak help kar do apna indian bhie ki

#

only one

pale vessel
near stratus
#

main indian nehin hu

earnest phoenix
#

muja english nhi ata or hindi bhie

#

ma tamil sa hu

near stratus
long crow
earnest phoenix
#

ma mumbai ma rata is liya hinfi ati

#

thori

near stratus
#

dm

crimson vapor
#

hello @pale vessel

mental raven
#

How can I get all the values of 490 + 500

#

Like 490 + 500 + 500 + 500 + 500 + 500 + 500

visual goblet
#

i can define a table in a cog right?

#

i dont really need a build.sql folder for tables as that just seems annoying

pale vessel
cinder patio
#

that example doesn't help at all

mental raven
#

nvm

#

I figured it out

visual goblet
#

do i need a build path with sqlite3? i was wanting to put everything in just their cog

#

but im just making sure i dont need this before i delete it

zinc wharf
#

.catch(err => runErrorHandler(err, cmd)); //Put this on your command handler, for example, if(commandfile) commandfile.run(client, message, args, ops).catch(err => runErrorHandler(err, cmd));


           let date_ob = new Date();
           let hours = date_ob.getHours();
           let minutes = date_ob.getMinutes();
           let seconds = date_ob.getSeconds();
           let day = date_ob.getDate();
           let month = date_ob.getMonth();
           let year = date_ob.getFullYear();

           client.channels.cache.get("channel ID").send({
            "content": "Any tag",
            "embed": {
             "description": `Something went wrong with a command, here are the details.\n\n__**Error**__\n${err}`,
             "color": 16711680,
             "author": {
               "name": "Command Error"
             },
             "fields": [
               {
                 "name": "Random title",
                 "value": `Random field with random information`,
                 "inline": true
               }
             ]
           }
         })
}

^^ Javascript (Discord.JS V12)

sudden geyser
#

You'd need to catch the error (e.g. through a command error) and send it to the channel.

#

However, I recommend you don't use Discord as a logging service. It may be convenient, but it's not appropriate. I recommend you save your logs in files (recommended) or use an external service.

zinc wharf
#

If you want the more advanced route, then MySQL 😉

hearty palm
#

hey, just why -
client.on('guildMemberAdd', member => {
isn't working with me

sudden geyser
#

Do you have the required intent enabled?

lusty quest
#

requires member intend

hearty palm
#

yeb

sudden geyser
#

on the dashboard and in your source code?

hearty palm
hearty palm
#

?

lusty quest
hearty palm
sudden geyser
#

Those are not intents.

#

Click on the Bot tab and scroll down to privileged intents

lusty quest
earnest phoenix
hearty palm
lusty quest
#

enable the member intent

hearty palm
visual goblet
#

sqlite3 isnt a very long term solution as ive heard is that true? if so should i cancel using sqlite3 and try something better?

sudden geyser
#

It is not a long-term solution because it's better for smaller collections.

lusty quest
#

depends

sudden geyser
#

All of the data is stored in a single file.

#

But for most bots