#development

1 messages · Page 1150 of 1

pallid igloo
#

that's what the docs said.

torn ravine
paper cliff
#

LUNARCORD :')

pallid igloo
#

I like how funny nicknames we have in our testing servers...

weak rain
#

its fixe ggs

sonic lodge
#

only The Purple People™️ can change their nicknames

quasi arrow
#

how this send the normal text with the starcount and channel mention as a whole message with the embed

fluid basin
#

library?

quasi arrow
#

py

pallid igloo
#

@delicate shore I got the solution

let userid = message.mentions.users.map(u => u.id).toString();
let userarray = userid.split(',');
let seconduser = userarray[1];
message.channel.send(seconduser);

This will send the 2nd mention's id to the channel.

quasi arrow
#

library?
@fluid basin if you know how to do it using js tell me that itself

pallid igloo
#

I wasnt able to think anything other than this.

#

willi123yao#1345 if you know how to do it using js tell me that itself
@quasi arrow You can pass the unembedded content as a string and the embed in the options.

quasi arrow
#

u mean sending the text first then embed?

fluid basin
#
channel.send(content="Hi", embed=embed)
quasi arrow
#

ah

#

thanks

pallid igloo
#

.send('string', {
embed: {

}
})

#

Oh.

#

nvm

quasi arrow
#

bruh thank you too

delicate shore
#

ok @pallid igloo thnx a to and one thing
can we get a user property from a id?

pallid igloo
#

yes

#

client.users.cache.get(id)

fluid basin
#

or if its not cached, use UserManager#fetch

pallid igloo
#

Managers require caching iirc.

fluid basin
#

yes but its better if you just use fetch

pallid igloo
#

you gotta set cache as false then.

fluid basin
#

no as in, if the user is not yet cached (e.g. offline)

#

cache#get will return null

pallid igloo
#

uff.. I dont wanna think more about it...

paper cliff
#

uh yes why not but it can returns an error you're limited to 1 request / 5 secs not sure you want to do that

weak rain
#

can 2 libraries mix?

#

py and js

fluid basin
#

uh yes why not but it can returns an error you're limited to 1 request / 5 secs not sure you want to do that
it does say it will obtain it from the cache if its already inside

paper cliff
#

unless it's really important, just ignore or retry later idk

weak rain
#

languages*

pallid igloo
#

no

paper cliff
#

sure @fluid basin i know that, but it can throw errors

#

something that you don't want

fluid basin
#

well.. depends on the use case

#

again, if the user is not cached then it will return null if you use cache#get, which might not be the intention of the developer

#

though cache#get should suffice for most of the times

#

maybe I'm overthinking things

paper cliff
#

Oh wait may be .fetch just waits until it can fetch the user again instead of throwing errors? Idk, I only use it when it's really important, like a remind or what

#

But if it does wait, if you have multiple users to fetch, that's still not the best idea I guess may be it's even worse if it waits

#

The only time I used user.fetch is for banning people, they may be not in the cache

fluid basin
#

not really actually, it checks the cache first if there is the user, and only when its not there you will need to wait

#

async/await makes things rather simple

paper cliff
#

yes, simple, but uncontrolable? you probably don't want to wait I think i don't know

fluid basin
#

well again, I said I might be overthinking the use cases, generally a cache#get should suffice

paper cliff
#

yep

hollow gulch
restive pebble
#

no procfile

#

if procfile is their u made syntax error

#

worker: node main.js

#

exact

earnest phoenix
#

ohho

#

why

#

use

#

heroku

#

why the fuck do bot hosting on heroku tutorials exist

#

you're literally wasting your time because if heroku finds that you're using them for bot hosting then they'll just suspend youe account

#

trust me this has happened to me

#

will happen soon

#

keep a backup

#

of the code

#

and if they kill the app (which they'll do) switch to a real VPS

winter basalt
#

get a job

earnest phoenix
#

^

prime comet
#

Anyone good with canvas and canvas constructor? I've tried to load an external URL but I've had no luck making it work and the error I receive is

(node:18768) UnhandledPromiseRejectionWarning: TypeError: Image or Canvas expected

I've got the gist of using node-fetch and then turning it into a buffer but just doesn't work for me haha. (canvas does work)

golden condor
#

@prime comet try axios

prime comet
#

I don't think it's node-fetch TBH, I've console.loged the buffer and it is one, I'll try it though.

golden condor
#

o

#

It is a bigger

#

*buffer

#

Nvm then

prime comet
#

It seems to be on canvas' end but I'm unsure though.

leaden rover
#

How do I get my Raspberry Pi to run my DPY project?

#

I need it to be as online as possible

earnest phoenix
#

ik this sounds weird but is there any tool to convert a better-sqlite3 database to a mongoose database
my goals are beyond your understanding

golden condor
#

Do you use quick.db

earnest phoenix
#

Yup

thick gull
#

convert the sqlite in a reader to json and then do it by hand KEKW

earnest phoenix
#

frik

golden condor
thick gull
#

that was a joke

earnest phoenix
golden condor
#

Yes

#

Short npm link

earnest phoenix
#

ok I'll see it when i get on mah fucking pc

golden condor
#

It's my package but it just has a way to move from a quick-db

earnest phoenix
#

Cool

#

Get a better name too

golden condor
#

no

earnest phoenix
#

How do you make a public npm package

golden condor
#

Ez

earnest phoenix
#

but how

thick gull
#

Access the docs

golden condor
#

^

thick gull
earnest phoenix
#

thanks

#

docs are better than lgmtfy or google or bing

crisp pond
#

Hmmm

earnest phoenix
#

yo clapz you need help with smth

regal jacinth
ionic oasis
#

Mention?

regal jacinth
#

?

earnest phoenix
#

How i can delete a value from a array ?

quartz kindle
#

you need to know the index of the value

earnest phoenix
#

i fixed

#

i forgot about it :))

#

@earnest phoenix there are two ways you can

#

either do array.pop(thing-case-sensitive);

#

or maybe splice()

#

or do array.pop(array[index-of-element]);

#

k

#

not sure if the second one is correct

warm marsh
#

array[index] would require to be an embedded array in-order to use .pop afterwards iirc

earnest phoenix
#

f

warm marsh
#

either do array.pop(thing-case-sensitive);
also that won't work.

#

Pop doesn't take any args.

earnest phoenix
#

smh

warm marsh
#

Unless the language you're talking about isn't JS.

earnest phoenix
#

i tried and it does work in JS

warm marsh
worthy pond
#

@earnest phoenix hi for my request 😄

earnest phoenix
#

@warm marsh wait wut

warm marsh
#

pop doesn't take args.

#

You'd require to use .splice in-order to remove at a specific element.

earnest phoenix
#

splice

#

what's that

warm marsh
#

It removes element(s) between index1 and index2

brisk portal
earnest phoenix
#

Rejected

#

F

pale vessel
#

scroll up

#

chances are you didn't specify engines.node in your package.json but i don't think that's required

earnest phoenix
#

Also pleaaaaaase stop using heroku

pale vessel
#

since it might just resolve to latest version

#

Also pleaaaaaase stop using heroku
@earnest phoenix stop using repl

earnest phoenix
#

it's a temporary host cuz my pc is dead rn

split hazel
#

hosting a discord bot on a toaster is probably better than heroku

earnest phoenix
#

yup

sterile thicket
#

When I start the bot and use a particular command for the first time after the start, it gives me an error but when I use any other command and then use that particular command, it works.
The codes used for that particular command is:

var y = message.guild.members.cache.find(m=>m.displayName.toLowerCase() === x)
If(x === 'text' && !y) var z = message.guild.member(bot.user.id)

if(z.user.flags.has('DISCORD_EMPLOYEE')) {...}

The error I'm getting:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'has' of undefined

warm marsh
#

message.guild.members.cache.get?

sterile thicket
#

on var z?

warm marsh
#

Yeah

pallid igloo
#

For this, I suppose, you should change it to var z = message.guild.me

warm marsh
#

That also works.

pallid igloo
#

That gives the guildmember property of the bot.

sterile thicket
#

same error

pallid igloo
#

could you ask that in djs please? Djs server has much better environment for djs users.

warm marsh
#

Yeah you access z even if the statement doesn't happen.

pallid igloo
#

Like they can help you access docs with one command, so maybe yeah.

#

Yeah, that too,

#

assign some default value to z

warm marsh
#

Z shouldn't nor doesn't need to be defined at the if statement as it's literally only the bot your defining to a new variable.

sterile thicket
#

assign some default value to z
@pallid igloo still the same

pallid igloo
#

I gotta check what are user.flags

earnest phoenix
#

Is it a good idea to use objects for storing user info about individual users in a database instead of create 2 - 3 databases for each user.

#

my goals are beyond your understanding

warm marsh
#

works the exact same.

#

Just the getting is different.

earnest phoenix
#

works the exact same.
@warm marsh nope

warm marsh
#

Storing an object over spreading it out.

#

The end result is the same.

pallid igloo
#

Efficiency issues

warm marsh
#

You'll only have efficiency issues if the data is large.

quartz kindle
#

why would you create multiple databases

#

or you mean tables?

warm marsh
#

I think he means tables.

sterile thicket
#

I gotta check what are user.flags
@pallid igloo https://discord.js.org/#/docs/main/stable/class/UserFlags

pallid igloo
#

ikr

#

I'm reading the docs.

sterile thicket
#

When I start the bot and use a particular command for the first time after the start, it gives me an error but when I use any other command and then use that particular command, it works.

quartz kindle
#

@sterile thicket show the full error

earnest phoenix
#

objects:

//single database key with all the stuff
db.set(`userInfo.${message.author.id}`,{
  balance: 1000,
  inventory: {
    pizzas: 5,
    apples: 5
}
});

Separate database for each user (what i currently use):

db.set(`userBalance.${message.author.id}`,1000):
db.set(`userInventory_${message.author.id}.pizzas`,5);
db.set(`userInventory_${message.author.id}.apples`,5);
warm marsh
#

It's still stored as an object.

earnest phoenix
#

what's better

quartz kindle
#

thats literally the same thing

warm marsh
#

.pizzas is the property on your object even when concatenated with the string.

earnest phoenix
#

thats literally the same thing
@quartz kindle but for some reason the second one takes more storage space than the first

quartz kindle
#

its not a separate database, not even a separate table, thats just how that specific library arranges stuff

earnest phoenix
#

also i can just get the data first and store it as a variable in RAM and when smth updates i can reread it

quartz kindle
#

it abstracts the database as a key-value store, so it doesnt really matter

earnest phoenix
#

instead of getting the value every single time the user runs a command

#

which i currently do

#

i need serious help with not being a dumbass

quartz kindle
#

sure

#

if i were to use that (quick.db?), id use the first method and do what you just said yes

earnest phoenix
#

if i were to use that (quick.db?), id use the first method and do what you just said yes
@quartz kindle updating to mongoose very soon

#

also the object one is easier for me to use

sterile thicket
quartz kindle
#

show your info command

pallid igloo
#

I wish people stopped bluring out the consoles.

earnest phoenix
#

lol

pallid igloo
#

Like, Mine is litterally named Dell...

earnest phoenix
#

so

#

people are dumb and make their username their real name

sterile thicket
earnest phoenix
#

people are dumb and make their username their real name
@earnest phoenix excuse me ?

#

what i should name my username ?

#

fuckboy69 ?

#

yes

#

LoL

pallid igloo
#

xD

earnest phoenix
#

because it's a username

#

not an id

#

should i switch to a single userInfo named database for each seperate user which has all the data of the user in a single object instead of creating 2 - 3 databases for each user because I'm a bitch

#

lol

#

if you're censoring your shit and dont want people to find out your real name you shouldn't have made your username your real name in the first place

#

your username is used everywhere

pallid igloo
#

should i switch to a single userInfo named database for each seperate user which has all the data of the user in a single object instead of creating 2 - 3 databases for each user because I'm a bitch
@earnest phoenix It would be better to make one database if you can understand what you are doing. If you are not able to handle it, You should use multiple ones.

earnest phoenix
#

the problem is

pallid igloo
#

your username is used everywhere
cry 2020

#

the problem is
@earnest phoenix yes?

earnest phoenix
#

code913 is typing

quartz kindle
#

@sterile thicket users are not guaranteed to have flags, you have to fetch them

#
if(!Mentionname.user.flags) await Mentionname.user.fetchFlags()
earnest phoenix
#

Please go #general if u want to talk about usernames

pallid igloo
#

Please let him type his problem....

sterile thicket
#

ok,,,, thanks

#

Yep, working UwU

earnest phoenix
#
//I make a different "userInventory" database for each user with "apple" key which is an integer
db.set(`userInventory_${message.author.id}.apples`,5);
//smth i can't
db.set(`userInventory.${message.author.id}`,["apple","apple","apple","apple","apple"]);
//here there are 5 apple elements in the ${message.author.id} (of course replaced) key of the "userInventory" database but due to the way my bot economy system works i can't store "userInventory" keys as arrays because "apple" needs to be an integer
#

That's why I use objects

pallid igloo
#

So what do you want?

earnest phoenix
#

@pallid igloo @quartz kindle so is using objects still bad

#

because

#

@earnest phoenix how long it takes you to write thoose comment ??

pallid igloo
#

Efficiency issues still might occur, but it's gonna be alright.

#

code913#3472 how long it takes you to write thoose comment ??
@earnest phoenix Does that affect you in any way?

earnest phoenix
#

me on mobile

#

if i was on pc i would be a rocket speed typist

quartz kindle
#

there is nothing wrong with using objects

dreamy cedar
#

Which is better mongodb or quick.db?

quartz kindle
#

i dont know how that library does its thing internally, the only problem with an object store in SQL is that you lose indexing in them

earnest phoenix
#

@earnest phoenix Does that affect you in any way?
@pallid igloo just asking : /

quartz kindle
#

but that's only applicable if you actually know what the underlying database engine is doing

earnest phoenix
#

i dont know how that library does its thing internally, the only problem with an object store in SQL is that you lose indexing in them
@quartz kindle indexing???

#

What's that

slender thistle
#

^ I'm curious too ngl

quartz kindle
#

a relational database, such as most SQL databases, use tables and columns to store data

#

you have a column with an id, another column with something else, and in your case, a column with a json object for example

earnest phoenix
#

what ngl mean ?

#

Not gonna lie

#

:0

slender thistle
#

Oh, those

quartz kindle
#

something like this
id | name | data
768 abc {a:1,b:2,c:3}
738 afc {a:4,b:3,c:7}

slender thistle
#

But it's not hard to add indexing manually, is it?

earnest phoenix
#

ye but take a lots of time, right ?

quartz kindle
#

now when you want to get data from your database, for example, you want to search for user with id 738

#

your database has to scan all the entries until if finds the user. this can take a long time if your database is very big

slender thistle
#

I'll just override mongo's _id field lmao

earnest phoenix
#

something like this
id | name | data
768 abc {a:1,b:2,c:3}
738 afc {a:4,b:3,c:7}
@quartz kindle

db.set(`id.name`,"data");
//is the above korrekt
quartz kindle
#

thats where indexing comes in. if you create an index for the column ID, then the database will keep track of the positions of all IDS

#

so whenever you want to get data from a specifyc id, your database knows exactly where it is, it doesnt need to scan it

#

you can index any column, like ID, name, etc

#

but you cannot index the CONTENTS of a json object

#

you cannot create an index for lets say, all users that have a = 4 inside their data object

earnest phoenix
#

that's not a json object

#

it's a normal js object

quartz kindle
#

so if you want to search for all users that have a = 4 inside the object, your database needs to do a full scan

earnest phoenix
#

f

quartz kindle
#

because that specific property inside an object cannot be indexed

earnest phoenix
#

and i don't want indexing anyways but i might need it in the future

quartz kindle
#

this is where a document-oriented database such as mongodb works better than a relational database

#

mongodb can index the contents of json objects

#

sql cant (unless it has full support for json data types for example)

#

in sql, if you want to index something, you need to create a column for it

#

but none of this is relevant to you, if you use a library like quick.db or sequelize, or mongoose

#

because all of this will be locked behind the library, the library will do all of this for you automatically without your knowledge

earnest phoenix
#

postgres mmLol

quartz kindle
#

sometimes the library does a good job, other times it doesnt, because there is no way it can guess the most optimal way to handle your specific kind of data

pallid igloo
#
var status = target.user.presence.status;
        if(status = "dnd") statuse = "![dnd](https://cdn.discordapp.com/emojis/730392620798574633.webp?size=128 "dnd")";
        if(status = "online") statuse = "![online](https://cdn.discordapp.com/emojis/730392672212222024.webp?size=128 "online")";
        if(status = "offline") statuse = "![offline_invisible](https://cdn.discordapp.com/emojis/730393824878395423.webp?size=128 "offline_invisible")";
        if(status = "idle") statuse = "![idle](https://cdn.discordapp.com/emojis/730392698724548690.webp?size=128 "idle")";

target is a guildmember.
and statuse is basically the status emote. But it's always taking the statuse as idle, no matter which mode I'm on.
I tried being dnd but it was giving me idle.
some sort of caching issues maybe?

earnest phoenix
#

and i understood nothing from this because i was staring at shitpost KEKW

pale vessel
#

you're reassigning them

#

compare them (== or ===)

cinder patio
#

The problem with quick.db is that it takes all the power away from you

pallid igloo
#

Oh shit

#

I forgot it.

#

Tysm bro.

earnest phoenix
#

gonna switch to mongoose soon

quartz kindle
#

same thing with mongoose mostly

#

although mongoose is a completely different beast

#

first of all because it uses mongodb instead of sqlite

#

its a completely different database behind the library

regal jacinth
cinder patio
#

Sequelize is possibly the best ORM for node.js

earnest phoenix
#

bert?

#

ORM?

quartz kindle
#

orm = object relational mapping
basically hides the database behind a library, the same way quick.db does, but in a different style

regal jacinth
#

;-;

quartz kindle
#

it lets you work on it as if you were working on objects

earnest phoenix
#

;-;
@regal jacinth what happened why are you sad

regal jacinth
#

no one is helping me TwT

slender thistle
#

uhhhhhh

#

yeah about that

#

aiohttp doesn't support templates afaik

regal jacinth
#

oh

slender thistle
#

or do you not need them?

#

(a template meaning you needing {{ }} or {% %} stuff in the HTML file)

regal jacinth
#

well how then am i going to make the website?

earnest phoenix
#

no one is helping me TwT
@regal jacinth no one was ignoring you it's just that some people who were online didn't know the answer to your problem

regal jacinth
#

yeah i have that

pallid igloo
#

I just want an opinion, Can I ask if any command is "looking" good?

slender thistle
#

Oh, you have those?

#

Fuck

#

Sorry for the unnecessary bloat, I suggest using Sanic then

regal jacinth
#
<!--HEAD-->
{% block head %}
<title>TEST posts 1</title>

{% endblock %}
<!--HEAD end-->

<!--STYLE-->
{% block style %} {% endblock %}
<!--STYLE end-->

<!--BODY-->
{% block body %}
<div class="center">
    <h1>This is posts</h1>

     <div class="side">
         <a href="index">Click to go to index</a><br>
         <a href="home">click to go to home</a><br>
         <a href="new">Click to go to new</a><br>
           <a href="/result">click to go to result</a><br>
    <a href="/student">click to go to student</a><br>

          <a href="verified">click to go to verified</a>
     </div>
</div>
{% for s in stuff1%}
<h1>{{s.title}}</h1>
<p>{{s.content}}</p>
{% endfor %}
<form action="/verified" method="POST">
    <div class="side">
        <h3>Sign up</h3>

    Author:<input type="text" name="author">
        Email:<input type="email" name="email">
        Phone no.:<input type="number" name="phone no">
    Submit:<input type="submit" value="submit">
    </div>```
#

okay

pallid igloo
slender thistle
#

I'm actually curious how one would connect both Jinja2 and aiohttp 🤔

regal jacinth
#

mhm

#

Kindy use a bin service like hasteb.in or gist.github.com, Nobody likes overly flooded chat.
well i could do it but i don't want

earnest phoenix
#

How do you make your bot show up as "fuck is typing..." in discord.js?

slender thistle
#

search for triggerTyping in the docs 🤔

regal jacinth
#

@slender thistle can i use flask instead of sanic?

slender thistle
#

You risk getting a blocking code

#

aka your bot being unable to run while Flask is processing stuff

earnest phoenix
#

well i could do it but i don't want
if you don't want then we all will frown at super flooded chat

delicate shore
#

why are the setactivity so

#

buggy

regal jacinth
#

oh so sanic is the right choice?

cinder patio
#

change it's nickname in the server

delicate shore
#

they only work 80/100 time

cinder patio
#

and call .startTyping

slender thistle
#

I think of Sanic as async Flask with a few edited stuff

pallid igloo
#

How do you make your bot show up as "fuck is typing..." in discord.js?
@earnest phoenix startTyping iirc.

regal jacinth
#

oh

slender thistle
#

oh it's startTyping in d.js, rip

earnest phoenix
#

change it's nickname in the server
@cinder patio why

cinder patio
#

to make it show that "fuck" is typing, lol

slender thistle
#

There's not that much difference between them tbh, I could probably try cramming it into one of my bots at some point

delicate shore
#

what .startTyping is a thing ? wtf

#

i never knew it as real thiing

pallid igloo
#

How to get the profile badges with user/guildmember property in djs?

earnest phoenix
#

Flags

pallid igloo
#

Oh

#

user.flags?

earnest phoenix
#

flags is a property of the user class

#

user.flags?
@pallid igloo probably

#

don't spam PGamerX the rick roll link is not funi anymore

quartz kindle
#

startTyping is weird af tho

#

there is no way to stopTyping besides sending a message

slender thistle
#

triggerTyping would somewhat make sense imo

quartz kindle
#

and it doesnt work for editing messages

#

for example, if your bot start typing then it edits a message, it will continue typing

#

it will only stop if it send a new message

#

(or the typing times out, which is about 10 seconds i think)

slender thistle
#

yeah

quartz kindle
#

5/7

slender thistle
#

Last time I checked it was 10

drifting wedge
#
    return prefixes[str(message.guild.id)]
KeyError: '740636229527273602'```
#

its giving me an error for running any commands on new servers

#

like if the bot is added, it gives me prefix errors

manic osprey
#

return prefix

drifting wedge
#
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    return prefixes[str(message.guild.id)]

client = commands.Bot(command_prefix = get_prefix)```
slender thistle
#

There's no value for guild with ID 740636229527273602

drifting wedge
#

oh

#

hmmm

regal jacinth
#
        async def posts(request):
            return await response.file("/flask/cogs/posts.html") ```
 like this
slender thistle
#

That's possible?

regal jacinth
#

@slender thistle sorry

#

?

#

it gives an error tho

#

No such file or directory: '/flask/cogs/posts.html'
although they are in the same folder

slender thistle
#

What's your folder structure like?

regal jacinth
#

ok wait

slender thistle
#

and where are you trying to access the file from?

#

which file is that code snippet in?

regal jacinth
#

from app

slender thistle
#

.. then just posts.html

regal jacinth
#

i did and got the same error

slender thistle
#

Does PyCharm give any hints for the directory?

regal jacinth
#

i don't know
i don't use them much tbh

slender thistle
#

Ctrl+Space in the string

regal jacinth
#

ah yes it gives

#

@slender thistle sorry again

slender thistle
#

in the string itself

#

between the "

fading igloo
#

are u guys reql mods?

regal jacinth
#

oh

fading igloo
#

tell

slender thistle
#

What does reql happen to be? should answer your question

#

In other words, no, we are not

regal jacinth
#

it says "no suggestions"

slender thistle
#

well fuck

regal jacinth
#

XD

slender thistle
#

cogs/posts.html

regal jacinth
#

okay

slender thistle
#

🤔

regal jacinth
#

O_O

drifting wedge
#

when the bot adds the server

#

it doesnt make a prefix

#

and im confused

#

cuz it used to i think

solemn latch
#

You really dont need to add custom settings until a guild sets a custom setting anyway

drifting wedge
#

so how would i do that?

regal jacinth
#

by not doing it?

solemn latch
#

^ if you dont see the guild in your list of custom prefixes, just use the default

viral iris
#

is there a way to delete reactions ?
like when the bot react 🖐️ and user react it the bot remove it

pallid igloo
#

Or put the default prefix whenever the bot joins a guild (not full proof as the bot might be offline when added to the guild).

#

@viral iris djs?

viral iris
#

@viral iris djs?
@pallid igloo yes

pallid igloo
#

Idk.

#

Or rather, I'm looking up the docs

solemn latch
pallid igloo
#

Oh sorry...

viral iris
#
 message.react('◀').then( r => {
            message.react('▶')
.removeAll()
#

like tis ?

#

this*

#

@pallid igloo @solemn latch

solemn latch
#

Iirc message.react is a promise. You can't really do it that way.

viral iris
#

then how ?

solemn latch
#

promise.then()
Or await the promise

#

Also message.react ends up resolving with MessageReaction
Which doesn't have removeAll.
It does have remove
https://discord.js.org/#/docs/main/stable/class/MessageReaction?scrollTo=remove

golden condor
#

message.reactions.removeAll() works

#

also a promise

solemn latch
#

Yeah linked him that earlier

golden condor
#

reaction.message.reactions.removeAll()

viral iris
#

reaction.message.reactions.removeAll() ?

#

this gonna work ?

golden condor
#

yes

#

but await it

#

obviously replace reaction with ur var

viral iris
#
        message.react('◀').then( r => {
            message.react('▶')
         reaction.message.reactions.removeAll()
#

like this ?

golden condor
#

That would sort of defeat the purpose.

viral iris
#

how to do that ?

finite bough
#

the bot reacts the the emoji

#

then u need a reaction collector or await reaction to check for the reaction

#

and

#

if u want to delete the old msgs too

#

u have to use partials

earnest phoenix
#

what is the event for user disconnect from voice channel ?

#

hi

#

^

pale vessel
#

voiceStateUpdate

finite bough
#

nvm

pale vessel
finite bough
#

has been ages since I last saw js with my eyes

weak rain
#
  let statuses = [
    `${client.guilds.cache.size} Servers,`
    `${client.users.cache.size} Users`,
    `${client.channels.cache.size} Channels`,
    `tr!help | ${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`

]
setInterval(function(){
        let status = statuses[Math.floor(Math.random() * statuses.length)];
        client.user.setActivity(status, {
          type: "STREAMING",
          url: "https://www.twitch.tv/pokimane"})
              .then(presence => console.log(`Your Status has been set to  ${presence.game ? presence.game.none : 'none'}`))
              .catch(console.error);
          
    }, 3000) //Seconds to Random

})```
bot is setting statuses as ${client.guilds.cache.size} Servers not telling number of guilds
#

what to do ?

#

Anyone

solemn latch
#

Not sure about your fix. But 3 second status changes is api abuse

weak rain
#

but why

#

many bots can use that feature

lusty quest
#

they have a delay between the changes

solemn latch
#

3 second status changes is api abuse.
Most bots who have this feature set it to 1 minute or more

lusty quest
#

i use on my bot about 5 minutes delay

solemn latch
#

^ mine is 5 minutes for the first 25 hours from startup.
Then once an hour

#

Mainly because I still display uptime in my bot.

lusty quest
#

i show some usefull informations in my status (related to the game its designed for) and there it is fine to change it every 5 Mins

weak rain
#

how should i show it?

lusty quest
#

dont change it every 3 seconds

#

do it every few minutes

solemn latch
#

🤔

#

,`

golden condor
#

Also

lusty quest
#

keep in mind its cached. you need to fetch it again to update it

golden condor
#

That wouldn't dynamically change the status

#

To the new guilds

#

What

weak rain
#

But

#

i want it to update

#

as

#

their is interval setuped

lusty quest
#

make a global value where you store your guild count and update the stored number with the Guild Add / Guild Remove event

weak rain
#

hm

fringe goblet
#

@weak rain client.guilds.size and client.users.size should work

weak rain
#

it showing like

fringe goblet
#

as far as i know, .size isn't a part of cache

weak rain
#

wait lemme give u ss

drifting wedge
#
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    return prefixes[str(message.guild.id)]

client = commands.Bot(command_prefix = '.')```
#

i dont think its working

#

it doesnt log new roles

#

when join

#

and the '.'

#

i changed it but it was get_prefix

fringe goblet
#

@weak rain use backticks

weak rain
#

hm

fringe goblet
#

and channels.size isn't a thing as far as i know

weak rain
#

idk

#

i just removed

#

guilds

#

and added channels

#

their

lusty quest
#

i think guild.channels.cache.size is a thing

weak rain
#

as it is working

#

i my botinfo command too

#

Yes

earnest phoenix
#

that mostly happens if you copy the command

weak rain
#

but btw i m using backticks only @fringe goblet

fringe goblet
#

oh wait, it is cache, i was just dumb lol

#

ok hmm hold on

earnest phoenix
#

you will have to rewrite it and check if itll work after

fringe goblet
weak rain
#

but this is my code

earnest phoenix
#

yes just rewrite it

#

in the same code

#

then check if itll wokr

#

it happened for me once also

weak rain
#
  console.log("I am Ready to Go")
  let statuses = [
    `${client.guilds.cache.size} Servers,`
    `${client.users.cache.size} Users`,
    `${client.channels.cache.size} Channels`,
    `tr!help | ${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`

]
setInterval(function(){
        let status = statuses[Math.floor(Math.random() * statuses.length)];
        client.user.setActivity(status, {
          type: "STREAMING",
          url: "https://www.twitch.tv/pokimane"})
              .then(presence => console.log(`Your Status has been set to  ${presence.game ? presence.game.none : 'none'}`))
              .catch(console.error);
          
    }, 3000)

})```
#

see

earnest phoenix
#

okay

#

go to ur editor

#

and start from the top and write till the end

fringe goblet
earnest phoenix
#

dont copy and paste it again just write each letter out

signal sapphire
#

hello

weak rain
#

hm

#

so what should i do

fringe goblet
#

@weak rain try .setPresence() instead

weak rain
#

instead of activity ok

signal sapphire
#

How can I write NSFW code to my discord bot. Can anyone write sample code?

fringe goblet
#

like, i use this

        client.shard.fetchClientValues('guilds.cache.size').then(results => {
            client.user.setPresence({ activity: { name: `Fluffing ${results.reduce((prev, guildCount) => prev + guildCount, 0)} servers`}, ststus: "online"});
            setInterval(() => {
                client.user.setPresence({ activity: { name: `Fluffing ${results.reduce((prev, guildCount) => prev + guildCount, 0)} servers`}, ststus: "online"});
            }, 600000);
        });

and it works completely fine

weak rain
#

hn

solemn latch
#

@signal sapphire message.channel.send("nsfw")

signal sapphire
#

@solemn latch I want my discord bot to send +18 content. Can you send DM?

lusty quest
#

check if the channel is a NSFW channel if it does send the stuff

solemn latch
#

I keep my dms closed

lusty quest
#

how to get the nsfw stuff is up to you

signal sapphire
#

sample code pls

lusty quest
#

its basic stuff

#

also idk what language you want it in

signal sapphire
#

Discord JS

#

i have Notepad++

solemn latch
weak rain
#

presence also not working

lusty quest
#

did you want to set it or get it?

weak rain
#

hm wdym

earnest phoenix
#

are properties stuff about objects only?
like:

var object = {
yeet: "yeet"
};
object.yeet //returns "yeet"
tight plinth
#

yes

#

for short

earnest phoenix
#

long

tight plinth
#

I mean you can create a new property for strings using String.prototype, maps using Map.prototype...

#

technically X.prototype is an object

#

so yeah you can only apply properties to objects

#

am I clear

solemn latch
#

Arrays are also technically objects as far as their type is concerned

tight plinth
#

arrays can contain objects but they are not objects in themself

#

even if typeof array returns object for some reason

earnest phoenix
#

smh

cinder patio
#

everything is an object except primitive values

solemn latch
#

^

earnest phoenix
#

js is weird

#

There woo

#

Deleted my message so you point to the right one

solemn latch
#

Classes are functions

tight plinth
#

at least other languages are clear about what is an object and what is notr

solemn latch
#

🤔

tight plinth
#

object = {}
others thighs != objects

queen moss
#

soooo I'm generating a profile card right now and it looks like this but it gets cut off on mobile - is there a size limit on mobile images? It's currently a 2000x2000px image

tight plinth
#

soooo I'm generating a profile card right now and it looks like this but it gets cut off on mobile - is there a size limit on mobile images? It's currently a 2000x2000px image
@queen moss nah, it's just a discord bug

queen moss
#

love that

cinder patio
#

a function is a callable object

queen moss
#

thanks

tight plinth
#

put image in a embed

queen moss
#

aight

solemn latch
#

Probably will be kind of a large file size

#

Is 2kx2k really needed

queen moss
#

i want a crispy image and i have a dedi sitting around doing nothing

#

so

tight plinth
#

the higher the res is, the better I guess

queen moss
#

may as well

sudden geyser
#

for the user it may take longer to load

solemn latch
#

Many users have terrible internet

queen moss
#

true

#

would 1000x1000 be better

solemn latch
#

There are devs here with a few megs download

sudden geyser
#

you should try 1024x1024

queen moss
#

aight

delicate shore
#

no

stable eagle
#

TypeError: Cannot read property 'execute' of undefined tried doing a command handler, ??

delicate shore
#

Send code

stable eagle
#

full?

delicate shore
#

yes

earnest phoenix
#

Nope

sudden geyser
#

the code around the error

delicate shore
#

of the command file

earnest phoenix
#

The execute and stuff

stable eagle
#

ok wait

delicate shore
#

the starting stuff

earnest phoenix
#

Use hastebin

delicate shore
#

of commadn file

#

command*

sudden geyser
#

it does not need to be the command file

earnest phoenix
#

Where you defined execute

sudden geyser
#

there's a chance it's not coming from there

delicate shore
#

it does not need to be the command file
@sudden geyser it can be

#

one time it was for me

solemn latch
#

You need to check the command exists before doing
Command.execute

Every command also needs an execute function

sudden geyser
#

for example, the command was not found and they were trying to .execute(...) it

delicate shore
#

in command file i was using execute (msg ,args , client)
but i was exxecuting only msg,args

sudden geyser
#

the stacktrace tells where it's coming from

stable eagle
#

if(message.content.startsWith(botconfig.prefix)) { switch(args[0].toLowerCase()) { case 'prefix': bot.commands.get('test').execute(message, args); break; }

delicate shore
#

send command file

sudden geyser
#

does the test command exist

delicate shore
#

;-;

stable eagle
sudden geyser
#

does it exist or not

earnest phoenix
#

discord fucked my message markdown

#

hence i deleted it

stable eagle
#

@sudden geyser it does...

solemn latch
#

Does it have an execute function

delicate shore
#

send the command file code

#

pls

earnest phoenix
#

he did

delicate shore
#

there is the problme

earnest phoenix
sudden geyser
#

can you show us the test.js file then

delicate shore
#

i am fucking sure

#

can you show us the test.js file then
@sudden geyser this is what i am asking

#

the command file

stable eagle
#

ok

sudden geyser
#

pg it's one scenario, really the stacktrace is the most useful out of this

stable eagle
#
    name: "prefix",
    description: "test command",
    execute(message, args) {
        message.channel.send('test');
    }
}```
earnest phoenix
#

bruh

delicate shore
#

i knew it

solemn latch
#

Thats prefix not test

earnest phoenix
#

fail at markdown

delicate shore
#

i fucking predicted it

steel pelican
#

S

delicate shore
#

change "prefix" to test

earnest phoenix
#

? @steel pelican

delicate shore
#

@stable eagle change prefix to test

solemn latch
#

Your getting a command named test
But in your command file you named it prefix

steel pelican
#

Uh my bots doesnt show up in topgg do u know why?

delicate shore
#

it's not approved

#

;-;

steel pelican
#

Ah

earnest phoenix
steel pelican
#

Mkay

delicate shore
#

otherwise u must had role<@&265125253443878912>

golden condor
#

ping

earnest phoenix
#

Nope

solemn latch
#

Pong

sweet ravine
#

hey

solemn latch
#

Heya

sharp tendon
#

DiscordAPIError: Missing Access
at RequestHandler.execute (/home/runner/Oosterhout-V22/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
method: 'post',
path: '/channels/738024910441676852/messages',
code: 50001,
httpStatus: 403
}

#

If i say !play

#

Code:

sinful sorrel
#
internal/modules/cjs/loader.js:1068
  throw err;
  ^

Error: Cannot find module 'C:\Users\FREE\Desktop\DiscordBot\bot'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
solemn latch
#

Missing acess is like missing permission.
Your bot did something in a channel it didn't have acess to use

sinful sorrel
#

can anyone tlel me

#

what happen

sharp tendon
#

Ok

earnest phoenix
solemn latch
#

He gave the error

sinful sorrel
#

what erro?

#

error

earnest phoenix
#

the module doesn't exist

glacial knot
#

DeprecationWarning: Collection#find: pass a function instead

solemn latch
#

Pretty descriptive error

restive furnace
#

(b => b == "a")

delicate shore
#

umm

restive furnace
#

thats function for example

delicate shore
#

i was wondering

sinful sorrel
#

wdym

delicate shore
#

if my bot can habe mobile status

sinful sorrel
#

i dont understand

delicate shore
#

have*

#

just like @iron raft

sharp tendon
#

Bruh

#

I don't kicked him...

#

He leaved from his self...

restive furnace
#

if my bot can habe mobile status
it can, just change the platform and browser to Discord Android.

delicate shore
#

it can, just change the platform and browser to Discord Android.
how

restive furnace
#

have heard of constants?

sinful sorrel
#

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

Error: Cannot find module 'C:\Users\FREE\Desktop\DiscordBot\bot'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
at Function.Module._load (internal/modules/cjs/loader.js:911:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

delicate shore
#

yes

sinful sorrel
#

i still dont understand

earnest phoenix
#

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

Error: Cannot find module 'C:\Users\FREE\Desktop\DiscordBot\bot'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
at Function.Module._load (internal/modules/cjs/loader.js:911:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
@sinful sorrel the module doesn't exist

#

Did you make a typo

#

Yep

sinful sorrel
#

wait

#

ok

#

let me chek

earnest phoenix
#

i was wrong lul

restive furnace
#

its string, so ' is ok, like ".

solemn latch
#

The module it looks for is bot
Which doesnt make a lot of sense to me

earnest phoenix
#

the file is a folder

#

there is no extension

delicate shore
#

free u mean ``` Client.user.setActivity(!help for commands, { type: 3, browser: "DISCORD IOS" });

#

something like thus?

#

this*

solemn latch
#

Modules can be .js
Require auto adds .js if no extention is given iirc

earnest phoenix
#

no

#

it doesn't

delicate shore
#

do alt+f4

solemn latch
#

Lemme check my code, because I never add .js extensions for js

earnest phoenix
#

anyone on here that uses discord 11.5.1 know how to make the bot respond if you tag it as i've tried 2 different ways and still ain't able to get it to work

delicate shore
#
  bot.user.setActivity(`525+ servers | s!help`, { type: 3, browser: "DISCORD IOS"  });
earnest phoenix
delicate shore
#

is this code good enough

restive furnace
#

something like thus?
@delicate shore no and its needs to be in case sensetive

delicate shore
#

which one

#

it's case sensitive

#

DISCORD IOS

restive furnace
#

Discord Android

#

Discord iOS

delicate shore
#

o

#

what is difference

#

between ios an andr

earnest phoenix
#

nothing probably

delicate shore
#

ok

solemn latch
restive furnace
#

and you need to change the constant

#

not in set statys

solemn latch
#

yeah, it doesnt need .js

#

it auto adds .js if no extension is provided

earnest phoenix
#

smh

#

@earnest phoenix didnt really help

#

bro

#

i told you not to ask "hey any discord yada yada yada" because....just read the link

pure lion
delicate shore
#

not in set statys
@restive furnace wha-

pure lion
#

haha ts go brrrrrrrrrrrrrrrr

earnest phoenix
#

evin a wit?

restive furnace
#

@restive furnace wha-
@delicate shore js require(__dirname + "/node_modules/discord.js/smth/smth").browser = "Discord Android";

#

for example, and no, that wont work

earnest phoenix
#

@earnest phoenix didnt really help
@earnest phoenix just make a command withour the prefix that is literally your bot's name and tag

#

or

#

better

delicate shore
#

uh oh

earnest phoenix
#

just check if message.mentions.bots.first() is your bot

restive furnace
#

and i wont help anymore, since its undocumented feature, so you need to search from google or something.

delicate shore
#

and i wont help anymore, since its undocumented feature, so you need to search from google or something.
@restive furnace it's against TOS?

solemn latch
#

Undocumented stuff is generally against TOS

pure lion
#

well

#

well

delicate shore
#

oh

pure lion
#

well

solemn latch
#

Or atleast, isnt intended to be used

pure lion
#

i deleted it from my clipboard lmao

delicate shore
#

well @pale vessel is in trouble

#

then

pure lion
#

well @pale vessel is in trouble
@delicate shore as am i

#

@somber finch

restive furnace
#

almost every bot does it tho

delicate shore
#

bruh

pale vessel
#

lol idc

earnest phoenix
#
var talkedRecently = [];
client.on("message", msg => {
  if (!msg.content.startsWith(prefix) || msg.author.bot) return;
  if (talkedRecently.includes(msg.author.id)) {
    let embed = new Discord.RichEmbed()
      .setThumbnail(msg.author.avatarURL)
      .setTitle(msg.author.username)
      .addField(`Wait 5 seconds before using a command again.`, " || || ")
      .setFooter(`© 2020 Hydra+ | Requested By | ${msg.author.username}`)
      .setColor("RANDOM");
    msg.channel.send(embed);
    return;
  }
  var args = msg.content
    .slice(prefix.length)
    .trim()
    .split(" ")
    .filter(item => item !== "");
  var command = args.shift().toLowerCase();
  if (command === "") return;
  talkedRecently.push(msg.author.id);
  setTimeout(() => {
    talkedRecently = talkedRecently.filter(e => e !== msg.author.id);
  }, 500);
    if (msg.content.includes(client.user.id)) {
        let embed = new Discord.RichEmbed()
      .setColor("RANDOM")
      .setThumbnail(msg.guild.iconURL)
      .setTitle(`Support Server`)
      .addField("test","test")
      .setFooter(`© 2020 Hydra+ | Requested By | ${msg.author.username}`);
    msg.channel.send(embed);
  }
restive furnace
#

notsobot did it too

solemn latch
#

Your bots being reported to discord

#

Jk

restive furnace
#

notsobot got banned btw

pure lion
solemn latch
#

Oof did it

restive furnace
#

atleast it dissappeared

pale vessel
#

bruh dice doing ts

solemn latch
#

Lots of bots got banned recently

#

Kinda spooky

pure lion
#

bruh dice doing ts
is sexy asf

restive furnace
#

tts is more sexy

delicate shore
#

notsobot got banned btw
@restive furnace did it

#

what's ts?

restive furnace
#

typescript

#

aka sexy javascript

delicate shore
#

oh. i see

earnest phoenix
#
    if (msg.mentions.bots.first()) {
        let embed = new Discord.RichEmbed()
      .setColor("RANDOM")
      .setThumbnail(msg.guild.iconURL)
      .setTitle(`test`)
      .addField("test","test")
      .setFooter(`© 2020 Hydra+ | Requested By | ${msg.author.username}`);
    msg.channel.send(embed);
  }
solemn latch
#

Wait mentions.bots
?

#

That exists?

earnest phoenix
#

would that work for mentioning the bot first to trigger the command

delicate shore
#

bruh

#

just use msg.botsomething

restive furnace
#

@warm spruce or @wheat ibex (those rand numbers present yours bot id), would work.

delicate shore
#

^^

solemn latch
restive furnace
#

mention regex btw: /^\<(@|!@)(\d{17}|\d{18})\>/g

delicate shore
#

I-

#

<@&2>

#

<@&265156479726780416>

pure lion
#

but uh yeah how 2 mak ts compiler work with async

restive furnace
#

wdym

#

use ESNext

delicate shore
#

but uh yeah how 2 mak ts compiler work with async
@pure lion one day 🤞

pure lion
#

use ESNext
under what config setting

pale vessel
#

/<@!?\d{17,18}>/g mmLol

restive furnace
#

the es version thing

delicate shore
solemn latch
#

Probably should search for bot mention

pure lion
#

ah shit i closed vsc

delicate shore
#

f

solemn latch
#

Rather than any mention

delicate shore
#

🤞

#

i cannot change my nick to dickhead

earnest phoenix
#

still aint working

solemn latch
#

Oh oof v11

delicate shore
#

:rip:

solemn latch
#

V11 is depreciated

delicate shore
#

shit

solemn latch
#

Probably should look into changing to v12 before adding any new features

earnest phoenix
#

nah

solemn latch
#

It won't work in a few months

delicate shore
#

then rip u

earnest phoenix
#

ill be fine

delicate shore
#

it's getting deleted

#

kind of

solemn latch
#

Ok. Well I cant help you with deprecated libs.

delicate shore
#

^^ same ^^

#

And btw

restive furnace
#

V11 is depreciated
ppl live in their bubble, and can't update their things

sudden geyser
#

aka they can't be bothered

drifting wedge
#

do i need to install anything to use mongo db cloud?

solemn latch
#

Need to? No.
Want to? Probably

#

Iirc mongodb has a driver lib you probably want to install

drifting wedge
#

@client.command()
async def ping1(ctx):
mongo_url = "url"
cluster = MongoClient(mongo_url)
db = cluster['Prefixdatabase']
collection = db['new']

ping_cm = {'command':1}
collection.insert_one(ping_cm)

await ctx.channel.send('ping has been registered')
#

like is this correct?

solemn latch
#

🤷 id look over the docs for the lib

wheat hornet
#

sooo can anyone help me i am trying to create a web chatbot and i want the bot to play music when i tell him too so how can i do it is there any doc available i am using css javascript and html5

earnest phoenix
#

you cannot do it with pure frontend

solemn latch
#

I'm confused.
Your making a chat room music bot that also is a discord bot?

earnest phoenix
#

also there arent any docs

#

you need to have good knowledge of full stack development to accomplish this

wheat hornet
#

I'm confused.
Your making a chat room music bot that also is a discord bot?
@solemn latch nah just i web bot

solemn latch
#

So nothing to do with discord?

wheat hornet
#

like siri

solemn latch
#

So a voice controlled bot?

wheat hornet
#

yup

solemn latch
#

This is a huge project tbh

earnest phoenix
#

it isn't as easy as you think it is

#

like i said

wheat hornet
#

i know

amber fractal
#

That requires a lot of programming knowledge

wheat hornet
#

i have plenty time thas why i am in it

earnest phoenix
#

you need to be good with full stack development, this isn't possible with pure frontend languages

solemn latch
#

Youd have to know how to do it. Your not going to find some explanation somewhere

earnest phoenix
#

frontend is just styling, you still need to do ML in your backend and voice models

solemn latch
#

^

drifting wedge
#

If I were to pay for a good db what’s the easiest to use on heroku?

#

Or what is the best hosting?

#

For a small bot?

amber fractal
#

You shouldnt have to pay for a db

solemn latch
#

If your paying for a db, just get a vps

drifting wedge
#

And if using SQLite?

solemn latch
#

Heroku doesn't save data locally

#

You keep asking the same questions

drifting wedge
#

I mean if I were to use a good bot hosting

#

Like pay for one

solemn latch
#

Like a vps?

#

Then use any db you want

drifting wedge
#

Sure if

#

Ig

#

Is sqlite good then?

solemn latch
#

Sqlite is pretty limited iirc

earnest phoenix
#

keep in mind that you probably won't be able to record voice models yourself and instead will have to pay for existing voice models or pay people from various countries to record vowels and make a voice model from that, you probably cant do that solo. another way is to use existing voice recognition APIs which again cost money.

google, apple and microsoft can easily do this because they have millions to invest

drifting wedge
#

Which is good

solemn latch
#

Google it. Databases should be researched before choosing one

delicate shore
#
.addField("[**Invite Link (Required)**](FIRST LINK)" ,"[**Invite Link (ADMIN)**](SECOND LINK)")```
#

so what this does is create ADMIN hyperlink

#

but not the other one

#

and this is not my main bot in case u wondering

sinful belfry
#

you can't put embedded links into the field title

delicate shore
#

oh

#

then anyway to do that any other way

sinful belfry
#

depends why ur tryna do ¯_(ツ)_/¯

delicate shore
#

Like carl

sinful belfry
#

no clue, not seen it being used at all

delicate shore
sinful belfry
#

ah you can just put a description with linebreaks and embedded links

delicate shore
#

o

#

and can fields be added before descirption?

#

description*

sinful belfry
#

nope

#

fields come after

delicate shore
#

ok

#

thnx

#

and

#
    .setDescription("[**Invite Link (Required)**](link)" ,"[**Invite Link (ADMIN)**](link)")```
#

why is this not working

#

this is what happns

earnest phoenix
pale vessel
#

setDescription() only accepts one parameter

faint prism
#

I enjoy the .on('ready') event handler. Makes startup jobs EZ

pale vessel
#

you don't need that second hyperlink

delicate shore
#

whah

#

so

#

you don't need that second hyperlink
@pale vessel what should wor

quartz kindle
#

setDescription only has 1 parameter

#

anything else you put there will be ignored

fading jasper
pale vessel
#

did you actually put the URL

delicate shore
#

ok

#

yes

#

i did

pale vessel
#

@fading jasper go to their support server

delicate shore
#

@fading jasper -wrongserver

#

o

#

mod

faint prism
#

why it still offline i gave it permission
@fading jasper did you perform the bot login function?

fading jasper
#

ye

faint prism
#

Is the process running? or did it crash?

fading jasper
#

crash maybe

earnest phoenix
#

it isn't their bot

faint prism
#

oh

#

-wrongserver then
what @delicate shore said

#

Ask on their support

regal jacinth
#

@slender thistle hey sorry to ping again
i used aiohttp_jinja2 and it worked but i have another error or question
does {% %} and {{ }} not work
python file : https://hastebin.com/pevaleyoju.py

slender thistle
#

... how many of those are there

#

Am I the only one who uses Jinja and webserver frameworks separately lol

regal jacinth
#

lol idk
i pinged u cuz u told me about it
sorry anyway

#

i will wait for another one to respond

slender thistle
#

I just never worked with that library specifically

dire obsidian
#

Well anyone here use discord js-commando?

#

Or know how use

regal jacinth
#

google is ur best friend XD

slender thistle
#

@regal jacinth How exactly does it not work though?

regal jacinth
#

aiohttp_jinja2 ?

slender thistle
#

whatever that isn't working KEKW

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ConfigurationError: The "dnspython" module must be installed to use mongodb+srv:// URIs
Ignoring exception in command None:

#

im using mongo

regal jacinth
#

lmao XD

drifting wedge
#

do i donwload something?

regal jacinth
#

only posts works

slender thistle
#

The "dnspython" module must be installed

#

I think that says something

drifting wedge
#

is it like a download thing

#

or is it an import?

regal jacinth
#

hmmm yeah?

drifting wedge
#

or pip?

slender thistle
regal jacinth
#

dude all are the same

#

so only posts works and when i click "submit" errrrrrrrrrrrrrrrrrrrrrror

dire obsidian
#

How make a wait action?

faint prism
#

A wait action?

regal jacinth
#

grammar XD

dire obsidian
#

.-.

#

Like, wait this time

solemn latch
#

depends on the language

dire obsidian
#

Discord.js

solemn latch
#

thats a lib, not a language

faint prism
#

You could do a setInterval in JS

regal jacinth
#

XD

dire obsidian
#

Oh ok

#

Im new coding bro chill

solemn latch
#

setInterval, setTimeout. or a promise that resolves after x time

dire obsidian
#

Ok thanks bro

drifting wedge
#

is it easy to setup reaction roles with mongo on py?

solemn latch
#

yes?

drifting wedge
#

ok and is on_message not working?

#

im watching a vid and it says to do on message

slender thistle
#

@regal jacinth what's the error you are getting?

#

It's easier for both of us if you just post the errors straight away tbh

#

Because, well, I have absolutely zero fucking idea what the error is KEKW

regal jacinth
#

ok lmao

solemn latch
#

obligatory videos are not a good idea for development.
use the docs

slender thistle
#

I've generally tried to avoid YT videos for anything related to Discord bots so far, because they either contain outdated code, or just encourage bad practices

regal jacinth
#

tru

slender thistle
#

For some reason, it's easier for me to either think the logic through on my own or ask someone I know (or even here while I'm at it)

regal jacinth
#

nice

dreamy cedar
#
const mongoose =require("mongoose");
const {Guild} =require('../models/guild');

module.exports = async (bot, guild) => {
    guild = new Guild({
        _id: mongoose.Types.ObjectId(),
        guildID: guild.id,
        guildName: guild.name,
        
    });

    guild.save()
    .then(result => console.log(result))
    .catch(err => console.error(err));

    console.log('I have joined a new server!');
};

when the bot join a server
i didnt the server information in the database

#

anyone can help?

slender thistle
#

@regal jacinth I'm not too familiar with blocks in Jinja per se, but it seems that you are trying to do {% for key, value in result.items() %} where result is not defined

regal jacinth
#

i did tho?

slender thistle
#

Jinja is saying it's not, so

lusty quest
#

@dreamy cedar you dont associate the model with a schema

regal jacinth
#

@slender thistle here

dreamy cedar
#

@dreamy cedar you dont associate the model with a schema
@lusty quest here is the schema

const mongoose =require("mongoose");
const guildSchema = mongoose.Schema({
    _id: mongoose.Schema.Types.ObjectId,
    guildID: String,
    guildName: String  
});
module.exports = mongoose.model('Guild', guildSchema);
lusty quest
#
  const newGuild = await new Guild(merged);
        newGuild.save()
slender thistle
#

Is that the verified.html file?

regal jacinth
#

and the posts html file

slender thistle
#

Oh I see

lusty quest
#

merged is your model you define in your event

regal jacinth
#

mhm

lusty quest
#

usually you define a object that contains the stuff you want to save in your DB

#

then you associate this object with your Model

#

then save it

drifting wedge
#

does heroku work with json?

#

like can heroku modify json?

misty sigil
#

yes but it’s always reset

drifting wedge
#

ok

#

frick then