#development

1 messages · Page 1682 of 1

drifting wedge
#

ah okay

#

why though>

thin echo
#

i will try

drifting wedge
#

why is it blocking?

slender thistle
#

See, the catch here is that you delete the guild data in background

#

Because yes

drifting wedge
#

wdym?

#

i run another process?

#

another thread even

#

but what difference will it make?

#

it makes sense its blocking

#

but i dont get why

slender thistle
#

Don't ask me about synchronous shit, I just know it's blocking but not the 'how' 🤣

drifting wedge
#

lmfao

#

any ideas though?

#

or just like you know it is?

#
    @tasks.loop(hours=1)
    async def delete_guild_data(self):
        guild = self.gcollection.find({"in_guild":False})```
#

so like this?

#
    @tasks.loop(hours=1)
    async def delete_guild_data(self):
        gcollection.insert_one(self.gcollection.find({"in_guild":False}))```
#

i am pro coderman

#

also i want to use find right?

#

not find one?

#

cuz i want it to replace ALL

slender thistle
#

Why the insert_one KEKW

drifting wedge
#

look shivaco you cant expect me to write good code okay

#

thats not cool

#

its like wanting a fish to climb a tree

#

after the fish had 3 years of tree climbing practice

thin echo
#

didn't work

dusky sundial
thin echo
#

It didn't send the gif, or link

slender thistle
#

Hmm. That looks good. So the general idea is:

@tasks.loop(hours=1)
async def delete_guild_data(self):
    guilds = self.gcollection.find({"in_guild":False})
    for guild in guilds:
        if guild['expires_at'] >= datetime.datetime.utcnow():  # under the circumstances that the `expires_at` is the datetime object of when the data will actually be deleted
            self.gcollection.delete_one(guild)
thin echo
#

Okay so I did it

#

but the gif just loads

thin echo
slender thistle
#

wdym just loads

#

Are you sure your URLs are correct

thin echo
#

Yeah

#

See it just loads

#

is there a way to fix this or no

slender thistle
#

What are the URLs you use?

dusky sundial
#

Are they local files, or webpages?

thin echo
#

by webpages do you mean websites?

dusky sundial
#

Mhm

thin echo
#

yeah webpages

dusky sundial
#

Give us an example of a url you use

thin echo
dusky sundial
#

Try rightclicking the gif and "copy image address" instead

thin echo
#

ok

earnest phoenix
#

hi

thin echo
#

ok

#

Testing it

#

IT WORKED

#

tysm

compact lotus
#

how do i get sub bots ?

slender thistle
#

You don't

balmy root
#

hi

placid meadow
#

u guys ever seen a bot chart stats like this before?

balmy root
#

no

#

nioce

balmy root
placid meadow
#

oh trust me, this aint fake 😉

#

hard work and lots of coding

balmy root
#

😛

verbal fable
#

you can do it with canvas

slender thistle
#

If it's called fake, it must be either too good or too bad for its own kind that people think it's impossible

placid meadow
#

i use GDI+ (dotnet core)

#

@verbal fable

balmy root
placid meadow
#

the bot runs of Unix, so i had to come up with self made modules

balmy root
#

wats unix

placid meadow
#

Linux OS

verbal fable
#

but ithink pepole didnt like hard work
pepole like bad bots 😆 and love it

placid meadow
#

lol

#

ppl love fancy colorful stats 😛

#

i rekon

slender thistle
#

xd If it looks fancy

balmy root
#
[epic color]
+status
-are cool
placid meadow
#

what language u guys code in?

late rover
#

fortran

slender thistle
#

Python, sometimes love to play around in Pascal.NET

placid meadow
#

fortran?

#

damn...thats an oldy

misty sigil
#

js

late rover
#

im just kidding lol

slender thistle
#

😂

placid meadow
#

lol

misty sigil
#

fortran lmao

late rover
#

python and js for me

placid meadow
#

@late rover why not cobolt while ur at it 😛

#

hehe

late rover
#

lol

placid meadow
#

😛

slender thistle
#

Damn

balmy root
placid meadow
#

i dont think my bot review will come back as "clone of ..."

balmy root
#

OOOOOOOOOOOOF

late rover
#

nice

slender thistle
drifting wedge
#

how do i delete a document in mongo?

placid meadow
#

monogdb ?

drifting wedge
#

yes

#

pymongo

slender thistle
#

collection.delete_one

placid meadow
#

shiva in the rescue

drifting wedge
#

k ty

balmy root
placid meadow
#

i wend with a different db, google's prot-buff

drifting wedge
#

bro shiv made like 99% of my bot kek

placid meadow
#

awesome

slender thistle
#

🤣

placid meadow
#

what langs did u do shiva?

slender thistle
#

I usually use Python, but we went recently over 8086 Assembly in college and I remember Pascal.NET from school. On top of that I can write basic C# stuff

placid meadow
#

pascal , now theres something u dont see every day

slender thistle
#

The superior programming language is HTML.

#

😛

placid meadow
#

i do dotnet core (vb)

#

little c# on the side

slender thistle
#

Yoo, neat. Don't see VB around here often enough to assume people even use it

placid meadow
#

i do

slender thistle
#

VBA gang myself

drifting wedge
#
    @tasks.loop(hours=1)
    async def delete_guild_data(self):
        guild = self.gcollection.find({"in_guild":False})
        for i in guild:
            if float(i["delete_timer"]) >= time():
                self.gcollection.delete_one(i)```
#

thisis wat i have

verbal fable
#

hmm guys i have aproblem with graphQl weirdsip

drifting wedge
#

it doesnt make sense

placid meadow
#

i get a alot of flak for it , but as u can see. u can do alot with it

drifting wedge
#

and i dont understand it

#

but theyres like a 50% chance of it workinh

#

any aparent errors?

slender thistle
#

What does the delete_timer key contain?

slender thistle
#

How much time did all that take you?

drifting wedge
#

its a epoch time

placid meadow
#

if u work with async, deleting resource (assuming its a db) u gotta watch for deadlocks @drifting wedge

drifting wedge
#

time bot leaves the guild

#
  • 72 hours
#

so if bot isnt re added within 72 hours, data gets deleted

#

@placid meadow i dont need to care abt that stuff

#

i use cloud db

#

also wtf is a deadlock?

placid meadow
#

u dont know?

#

interesting ^^

slender thistle
#

In concurrent computing, a deadlock is a state in which each member of a group waits for another member, including itself, to take action, such as sending a message or more commonly releasing a lock. Deadlocks are a common problem in multiprocessing systems, parallel computing, and distributed systems, where software and hardware locks are used ...

placid meadow
#

it happens if multiple threads (async) read/write resource at the same time, it creates a run which can result that one of the threads locks up (freezes)

drifting wedge
#

how would a deadlock occur?

slender thistle
#

I'm not familiar with cases like that in Python, especially simple scripts like Exe's

placid meadow
#

if u dont take it into account, undocumented behavior might occour

verbal fable
placid meadow
#

is there such a thing as sync lock or mutex mechanics in ur language ?

drifting wedge
#

how tf am i supposed to know

slender thistle
drifting wedge
#

bro shiv is my brain

#

im just the typer

placid meadow
#

@drifting wedge no need to get nasty 😛

verbal fable
#
ReferenceError: getMutualGuilds is not defined
    at resolve (D:\courses\dashboard\dashboard-backend\graphql\index.js:81:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 1)
    at async graphqlMiddleware (D:\courses\dashboard\dashboard-backend\node_modules\express-graphql\index.js:166:18)
drifting wedge
#

wdym nasty?

verbal fable
#

why giving me this error?

placid meadow
#

im sure @slender thistle knows this 😛

verbal fable
#

can some one help?

drifting wedge
#

oh of course

#

shiv is python expert

verbal fable
#

👀

placid meadow
#

@verbal fable seems ur instance object is not made

#

declared

slender thistle
#

Nah, I never worked with threading directly. I skipped that part in my learning process 🤣

drifting wedge
#

so it should work?

#

same

verbal fable
#

but its

placid meadow
#

@slender thistle i hope ur joking 😛

drifting wedge
#

i skipped the entire learning process

#

im one of those people who made a discord bot to learn python

#

before knowing what python even is

#

and to tell you what, it worked!

slender thistle
#

I wish I was. I learned Python by getting into discord.py directly and never had to deal with deadlocks or mutex mechanisms yet?

drifting wedge
#

so i dont know wtf yall on about "learn python"

#

learning python is for nerds

slender thistle
#

🤣

drifting wedge
#

i learnt what was "await ctx.send("")" before knowing print()

#

im a pro

slender thistle
#

I should dedicate a week for myself to work with threading in Python, tbh

placid meadow
#

@slender thistle well if u ever wanna touch on it, let me know 😉

#

multithreading is useful 😛

#

i know my bot uses it

slender thistle
#

😁 I can be an annoying ass, so you better hope I decide to figure it out on my own instead

placid meadow
#

arent we all 😛

drifting wedge
#

uhh since yall have actual brains

#

is there a way to setup a webserver

#

in a cog?

slim umbra
#

imagine using a language where threading isnt as trivial as tokio::task::spawn()

placid meadow
#

whats cog?

slender thistle
#

Sure

drifting wedge
#

still running the bot?

sage bobcat
#

One message removed from a suspended account.

slim umbra
#

non rust nerds

drifting wedge
#

i tried using flask/quart ipc, aiohttp, flask, quart

slender thistle
drifting wedge
#

ive done everything i could think of

placid meadow
#

i see

slender thistle
#

Those classes are cogs

sage bobcat
drifting wedge
#

so what can i do?

slender thistle
drifting wedge
#

which time?

#

because what happens i think is that the webserver never stops

#

its like the bot

#

you cant put code under bot.run

#

if you want it to run while the bot is running

#

its like one or the other

#

ive tried making a normal webserver with aiohttp

#

and it had same issue

#

ipc works but is annoying

#

bc if u restart bot or dashboard

#

you have to restart both

#

AND only 1 process

#

so clustering wouldnt work

#

flask / quart same aiohtttp issue

placid meadow
#

😉

slender thistle
drifting wedge
#

when i try to not plarize

#

i get told to

#

noice

slender thistle
#

Eh I mean

drifting wedge
#

im joking lmfao

slender thistle
#

The general practice I follow is initialize the webserver in cog init, then call run_until_complete on a method that sets up the webserver and runs it

drifting wedge
slender thistle
#

Nah not that

#

run method

drifting wedge
#

i do not understand this witchcraft

slender thistle
#

Give me a second, I'll try to put up a small script

drifting wedge
#

ty

placid meadow
#

i was trying to make a activity monitor , that charts whos active during what hours, days, months

#

but the db/io setup is such a pain in the ass

#

had some tests, works but..pff maintenance wise a nightmare

slender thistle
#

🤣

placid meadow
#

the google's serializer , protof-buf proofs to be useful, it has almost 200 users in less then 175kb

#

i use it as db method

#

self contained

slender thistle
#

Damn

placid meadow
#

it generates graphs under the 300~ms thats acceptable

#

i wish i could test it in a mega discord server, see how it perfoms

slender thistle
#

You'll have plenty of time to get famous, don't worry BC_wink

placid meadow
#

hope so 😉

drifting wedge
#

@slender thistle u already doing the script?

placid meadow
#

gimme credits tho 😛

drifting wedge
#

im tierd and gonna sleep

placid meadow
#

thats fair

drifting wedge
#

so have a good night

placid meadow
#

gn

slender thistle
drifting wedge
#

gn barret

#

nah no worries

slender thistle
#

I'll DM you the general idea tomorrow, goodnight

placid meadow
#

no u where going?

#

im confused

drifting wedge
#

sure thanks

#

gn

placid meadow
#

lol

slender thistle
#

That's quite a unique feature out of hundreds/thousands of bots

placid meadow
#

i dunnow, is it ?

#

O_o

slender thistle
#

Unique enough, at the very least

#

Haven't seen many bots do stuff like you did though

#

well, "many"

#

Can't recall a single one, more like

placid meadow
#

well if you drop in my hang out, who knows what i might share 😉

slender thistle
#

I have quite plenty of things to worry about already so I'll leave you to it with the surprises 😛

placid meadow
#

no doubt

#

was an open invitation

earnest phoenix
#

Help

placid meadow
#

ask away

earnest phoenix
#

How to add image

placid meadow
#

in embed ?

#

or what ?

earnest phoenix
placid meadow
#

oh i dunnow

earnest phoenix
#

:|

#

Ok

placid meadow
earnest phoenix
#

someone plays league of legends

#

does api.getVotes() show users who voted for that api? did not quite understand

placid meadow
#

there is no docs on it?

earnest phoenix
placid meadow
#

im sure the API has some sort of documented usage

earnest phoenix
#

I understand now

#

sorry about that

placid meadow
#

dont sweat it:P

earnest phoenix
placid meadow
#

u too

earnest phoenix
#
.addField("Server owner" , `${guild.owner.user.username}`)
                                                ^
TypeError: Cannot read property 'user' of null
hushed plank
old cliff
hushed plank
#

805788996579885097
report this bot please -_-

slender bear
#

What bot

hushed plank
#

DM advertising

slender bear
#

Oh

#

I get those a lot

hushed plank
#

Yup, it's still verified -_-

slender bear
#

I’m waiting for mine to get verified

#

That gives me hope

hushed plank
#

Hope 😄

#

it'll be verified

slender bear
#

I mean if that bot can get verified my bot that just says quotes definitely will

hushed plank
#

sorry didn't get it

earnest phoenix
#

Value

restive lily
#

discord.py rewrite Question: Is it possible for a command to send feedback of every server the bot is in with the server name, how many members, and who owns it? (I want this for my personal bot that has no public access, I just have no clue which servers I have put it in)
Please ping or ping reply if you could answer this.

slender thistle
#

Make sure you set the intents for guilds in your client though

hushed plank
#

use pastbin

slender bear
#

Hmm

hushed plank
#

what's the command 🤯

earnest phoenix
#

@hushed plank same

#

Using but returning null

hushed plank
#

:hmm:

#

pastebin!

sacred aurora
#

u have to fetch it since the owner is not in the cache

placid meadow
#

@slender thistle found the culprit 😛 of that exception

slender thistle
#

Are you sure you are setting the guilds intent for your client @earnest phoenix

slender thistle
placid meadow
#

its a out of bound error, the gdi lib doesnt like when you draw something out of the bitmap region , in windows it just silently draws it anyway, but on the unix lib, that wont fly

keen thicket
placid meadow
#
[Processor][4/2/2021 7:54:28 AM] -> Task Command from 'Barret', Queue 1
--------------[OUT OF BOUNDS]---------------------
BOX REF      : 0 0 400 300
COORDS REF   : X1 319.94922 Y1 146.5098 X2 331.94415 Y2 146.16077
BOX REF      : Right 65 Left 335
--------------------------------------------------
[Command][4/2/2021 7:54:28 AM] <- Task Command finished in 00:00:00.1392074
frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'grole',
    run: async (message, args)  => { 
if (!message.member.permissions.has("MANAGE_ROLES")) return message.reply("You don't have the manage_roles perms")
    const role = message.mentions.roles.first() 
    const member = message.mentions.members.first()
    member.roles.add(role).catch(error)
    
    const embed1 = new Discord.MessageEmbed()
    .setTitle("Give role+")
    .setDescription("The role" + message.mentions.roles.first() + "has been given to" `${user.username}`)
    .addField("Moderator Command", "please if you not a moderator pls don't try to use this command♡", true)
    .setColor("#FF005B")
    .setTimestamp()
    .setFooter("role has been given")
    
      message.channel.send(embed1)
    }
}

Can some help me in the embed .addField section cause it seems that is does not work!

placid meadow
#

u dont use await?

slender thistle
placid meadow
#

anyway, ive add a Try block on that part, the code will not draw that portion (almost not see it anyway) but will always show the stats

#

its a hack but works

frigid mountain
placid meadow
#

those methods are async 😛

#

Nathi

#

does js have await @slender thistle ?

#

i dunnow actually

frigid mountain
#

Should I change it to run: async (message, args) => {

slender thistle
#

Don't ask me, I have zero clue about how JS works

placid meadow
#

well the whole discord API is pretty much await's

#

but thats not ur issue

#

lol

slender thistle
#

I'd rather leave this to someone who is proficient in JS

frigid mountain
dusk nebula
#

You didn't define user

slender thistle
#

user is not defined

vivid fulcrum
#

stop gluing together copypasted code

dusk nebula
#

That's why

frigid mountain
#

Yes how do I fix that?

vivid fulcrum
#

wrong

#

ol

#

lol

#

don't spoonfeed

#

and especially don't spoonfeed wrong code

dusk nebula
#

Oofies

#

I am on phone

#

I'll just del it ._.

dusk nebula
#

const user = //define user

keen thicket
vivid fulcrum
#

js isn't the only language in the world

keen thicket
dusk nebula
vivid fulcrum
#

yes it was

dusk nebula
#

I mean, he didn't define user

vivid fulcrum
#

member objects have no username property

#

🙄

dusk nebula
#

that's why

#

${}

#

member.user.username

vivid fulcrum
#

dude

dusk nebula
#

user has a username property

vivid fulcrum
#

you were calling username on a member

#

not on a user

#

do you have dementia

slender thistle
keen thicket
dusk nebula
restive furnace
#

promises

placid meadow
#

i see

#

multi threading, awaiters , always a bit confusing

restive furnace
#

almost every language today haves async/await syntax (known as corountines also)

dusk nebula
opal plank
#

why is this returning a 403 even though im in the server?

placid meadow
#

403 is usually a forbidden error , is it not ?

#

or was that 401 ?

opal plank
#

missing access, but im 100% there

opal plank
placid meadow
#

id say that boils down to permission prolly, Erwin

opal plank
#

it shouldnt need perms to fetch channels

#

nor the guild

frigid mountain
# dusk nebula Just define user
const user = message.guild.users.cache.find(user => user.username === args[0]); // Keep in mind, 'user' is just a variable I've defined. It could also be 'monke => monke.username' if you wish.
placid meadow
#

is it case sensitive ?

#

also most discords api's have a limited cache

#

might want to increase the backlog

cinder patio
#

That comments tells me that you copied this code

placid meadow
#

thats not relative ...is it ?

restive furnace
placid meadow
#

😛

cinder patio
#

He's the one with the question

frigid mountain
#

Idk anything?

dusk nebula
#

why do you have professional coder in js in ur status if you dk how to define a variable

frigid mountain
#

Lol cause I was boreddddde

placid meadow
#

comn guys, dont flame on ppl who ask for help

#

its pointless

dusk nebula
dusk nebula
dusk nebula
#

for ur user variable

frigid mountain
dusk nebula
#

variable/constant

#

however you declare it

placid meadow
#

funny that js allows for dynamic constants...kinda defeats its purpose 😛

cinder patio
#

Flaming actually helps the person more than just spoonfeeding them, because they obviously don't know the language they're working with, it's better to go learn the basics

dusky sundial
#

There's a difference between asking a question and refusing to learn :)

cinder patio
#

in this case at least

placid meadow
#

well whatever he knows the language or not, if u help him he might learn something from you, share experience and knowledge is a virtue

dusk nebula
dusky sundial
#

A lot of people will expect you to know the basics of programming before getting into making a bot, but some people learn by doing, so it's really up to them in the end

dusk nebula
#

I don't necessarily roast anyone but when I give them code I try to explain how it works so they can understand it better

placid meadow
#

not everyone knows the best route for coding, some are not that fast or whatever the case might be.

dusk nebula
#

Anyways

placid meadow
#

they see something they really want, might be steep jump most cases, but thats how it is, sometimes u just gotta jump into it. but i agree knowing ur basics does help90% of the time

cinder patio
#

The difference is that they come here with an error that can be resolved with the base knowledge of the language... x is not defined

placid meadow
#

comes down to understand what their reading

#

i guess

#

and one only see's what he knows

#

so if he doesnt, he cant

frigid mountain
dusk nebula
#

ie. if you use ID instead of pinging

frigid mountain
#

Thx for the help

placid meadow
#

nathi

frigid mountain
#

Yes?

placid meadow
#

the message 'please if you not a...' is sort of over saturated

#

is it not ?

#

the command on itself wont fire unless they are?

#

or is that just cosmetic nicefy 😛

coral stirrup
#

otherwise there would be a "small" security issue :D

placid meadow
#

lol

frigid mountain
#

Lol

placid meadow
#

i see often beginners try to use the js Eval() in their bots, i always tell them, its a bad idea

#

now that is a sizable security risk

opal plank
#

evals are the perfect way to teach them they should be using vm's to host their bots

#

or to secure their shit properly

dusky sundial
#

Bots with open eval commands won't be approved anyways

opal plank
#

watch me

placid meadow
#

u could inject some malicious code there, escalate the account, oof... the trouble that generates

dusky sundial
placid meadow
#

good rule

#

all they want is some sort of calulcator of sorts

#

and its rly easy to write ur own lexical analyzer

#

tokenize the expression, built ur abstract tree, evaluate in full control

opal plank
#

imma put it inside 2 vm and a sandbox

#

good luck escaping that

placid meadow
#

vm's can be broken 😛

opal plank
#

2 vms and a sandbox

placid meadow
#

altho hard, it is possible

opal plank
#

good luck

placid meadow
#

u cant have 2 vms like that 😛 physically not possible

opal plank
#

watch me

placid meadow
#

ur cpu would need VM flags in depth ? that be a first

#

virtualization*

cinder patio
#

Or you can just analyze the javascript for potential security issues... detecting whether require, eval, .prototype is used, while loops, etc.

opal plank
#

imagine not knowing what nested virtualization is

placid meadow
#

nested virt? rly?

#

i have yet to see that

opal plank
#

look up nested virtualization

placid meadow
#

@cinder patio i wrote my own expression evaluator its rly not that hard

opal plank
#

its handy sometimes when you need to emulate different hardware specs

#

say, i like linux

#

im using a vm there

cinder patio
#

I know

placid meadow
#

❤️ erwin , debian all the way

opal plank
#

now, i want to bypass some tool that uses free trial and hardware locks it

#

so i have to each month make another hardware vm

placid meadow
#

my bot runs on linux too, best platform

opal plank
#

thats a good example of why you'd have 2 vms inside one another

#

one vm simulating a hardware so you can bypass check

#

and the second is your main os that you use

#

in my case, linux

#

and the main os is windows, cuz compatibility

#

actual main, not vm

placid meadow
#

stable af 😉

opal plank
#

windows(main work) => linux vm (vm for work/study) => hardware vm(a vm simply with random hardware specs so i can bypass trials)

neat heron
#

Looks good 🙂

opal plank
placid meadow
#

oh snap, that is sexy dude

opal plank
#

htop pog

placid meadow
#

i run mine on a HPE server, its own backup PSU and ddos/syn firewall with Coreo Smartwall,

#

had to leas an ipv4 but thats fine

#

not that expensive

wind hill
#

Need
Create Tipbot on Discord
Who can help me
I can the fee with TRX

neat heron
#

what are they trying to do on my vps 😄

placid meadow
#

@opal plank those load avg are not so ideal tho 😛

#

0.50 would a threshold for me

opal plank
#

well this is a full on prod server

placid meadow
#

ah ok

opal plank
#

its not only running my bot

placid meadow
#

how much clients does that box run?

opal plank
#

there are a couple hundread process there running

wind hill
#

Need
Create Tipbot on Discord
Who can help me
I can the fee with TRX

opal plank
#

its only for us

#

@wind hill not the place

placid meadow
#

alright

opal plank
#

go somewhere else

#

one sec

cinder patio
placid meadow
#

dear god 😮

#

i want that

opal plank
#

so

#

funfact

neat heron
#

@opal plank how is your bot called?

opal plank
#

oh shit

placid meadow
#

@opal plank

opal plank
#

it went down

#

ffs

placid meadow
#

my lil server ^^

opal plank
#

1 sec

earnest phoenix
#

h

#

h

#

h

#

h

#

h

opal plank
#

oho

#

selfbots?

earnest phoenix
#

h

#

h

#

h

opal plank
#

a

placid meadow
#

andy ??

opal plank
#

sounds like selbots

earnest phoenix
#

h

#

h

opal plank
#

the more we talk

#

the more it replies

earnest phoenix
#

h

opal plank
#

keke

earnest phoenix
#

h

opal plank
#

amazing

wind hill
placid meadow
#

thats annoying ...

#

-.-

opal plank
#

@ripe prairie free ban ^^

slender thistle
#

@ripe prairie stinky

cinder patio
#

first link

opal plank
#

ah

#

right

earnest phoenix
#

h

opal plank
#

as i was saying barret

earnest phoenix
#

h

#

h

opal plank
#

@placid meadow did it live too

#

zorotic and some people here saw me completely wreck twitch on a global scale

neat heron
#

Fast response

placid meadow
#

damn

ripe prairie
#

-m @earnest phoenix

gilded plankBOT
#

🤐 Muted !ANDY!#0001 (@ebon zenith)

opal plank
#

i was re-routing 95%+ of their global traffic

placid meadow
#

i had an attack month ago on my server

ripe prairie
#

sorry im playing league right now

#

xD

placid meadow
#

was brutal -.-

opal plank
ripe prairie
#

imagine telling me what to do?

opal plank
#

twas an ez ban too

#

wew

ripe prairie
#

i dont say that to be a dick

#

i say that because we have procedure

opal plank
#

im aware

#

but i was just playing around

frigid mountain
#

How do I make a user-info command like these cause I want to check which roles do people have

neat heron
#

What is better usage PreSql or MySql

opal plank
#

postgres

placid meadow
#

mongo ?

neat heron
#

using mongodb rn

fathom meteor
#
{

      // Check for attachment image
      

      let image = '';
      const attachment = (message.attachments).array()[0];
      if (attachment && attachment.url) {
        const extension = attachment.url.split('.').pop();
        if (/(jpg|jpeg|png|gif)/gi.test(extension)) image = attachment.url;
      }```


err; 
`` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'attachments' of undefined``
help?
placid meadow
#

i believe u need to pass the file stream to it

#

dunnow if it helps ya,

#

this is how i load up an image into an embed

#
      Public Shared Async Sub Show(processor As Processor, sm As SocketMessage, args() As String)
            Dim attachment As FileInfo
            Dim eb As New EmbedBuilder With {.Title = "Clock"}
            eb.WithFooter(TimeZoneInfo.Local.StandardName)
            attachment = New FileInfo(Clock.Draw(200, 200))
            eb.ImageUrl = String.Format("attachment://{0}", attachment.Name)
            Using fs As FileStream = File.Open(attachment.FullName, FileMode.Open)
                Await sm.Channel.SendFileAsync(fs, attachment.Name, "", False, eb.Build)
            End Using
        End Sub
cinder patio
#

Is that VB?

placid meadow
#

yeah

cinder patio
#

why are you torturing yourself

earnest phoenix
#

How can we make bot to Play in stage channels 🙄

placid meadow
#

i love vb, its my choice of lang

#

i can do wonderful things with it

neat heron
#

quite didnt figured that out

placid meadow
#

well u tell the embed attachment the filename, right

#

and then u pass the stream in the sendFileasync

#

anyway im off for a bit

#

take care peeps 😉

neat heron
#

Have a good day 🙂

vagrant tundra
#

Hi

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'userinfo',
    run: async (message, args) => { 
    const embed = new Discord.MessageEmbed()
    
    .setTitle("User-info command")
    .setDescription(`Information about ${member}`)
    .setColor("#FF005B")
    .addField("Roles", user.roles.cache.map(role => role.toString()).join(" ,"), true)
    .setTimestamp()
    .setFooter("user info")
    
        message.channel.send(embed)
    }
}
#

How do I define member do I

const member = `${member}`

Or what?

cinder patio
#

You should really read up on core programming concepts

#

Does

const member = `${member}`

make any sense to you?

#

Okay but still

frigid mountain
#

Been waiting for help for over 30 minutes lol

ancient gulch
#

Hello, so, im trying to do a backup system on Discord, with NodeJS, and my problem is, when i save the collection with all roles, when i modify a role on the server it also change the collection, that's weird. There is my code.


// My index

const { Collection, Client } = require('discord.js');
const client = new Client();

client.backup = new Collection();




// My command to set the collection

client.backup.set(message.guild.id, Array.from(message.guild.roles.cache.values()));




// My command to get the collection

const backup = client.backup.get(message.guild.id)

console.log(backup)

Okay so everything work fine, my command return the collection, but.. When i modify a role and i'm making again the command "to get" the collection and not to "set" it update the collection, and i don't know why.

Everytime i make

client.backup.get(message.guild.id)

The collection update if i have modified something on the server, and i don't want that.

rocky dagger
#

i heard that you could use message.author.dmChannel.awaitMessages to await messages in dms but i get an error saying TypeError: Cannot read property 'awaitMessages' of null

#

is there another way to do it?

ancient gulch
#
#

You can use the message event to do it, why do you want to await messages in dm? @rocky dagger

rocky dagger
#

i am continuing a command in dms so it doesnt fill the public chat

ancient gulch
#

You can use that to get dm's message, there is no way to await messages in dm

if(!message.guild) {
console.log(message.content)
}
rocky dagger
#

ohh ok, ill try that

ancient gulch
cinder patio
#

I'm pretty sure you can await messages in DM

#

you have to fetch the DM channel beforehand though

rocky dagger
#

do you know how to do that?

lunar patio
#

how do i make code like 'if cmd send then bot replies after 1 min'

naive sequoia
lunar patio
#

.js

cinder patio
naive sequoia
#

oh oof

#

Then idk.

lunar patio
#

@naive sequoia about .py

#

?

naive sequoia
rocky dagger
naive sequoia
#
await asyncio.sleep()```
#

This will stop command execution for time you type.

#

If you use time.sleep() it will stop your bot at all for some time.

#

Idk how discord.js works so...

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'userinfo',
    run: async (message, args) => { 
    const user = message.mentions.members.first()
    const embed = new Discord.MessageEmbed()
    
    .setTitle("User-info command")
    .setDescription("Information about ${member}`")
    .setColor("#FF005B")
    .addField("Username", `${user.username}`, true)
    .addField("Roles", user.roles.cache.map(role => role.toString()).join(" ,"), true)
    .setTimestamp()
    .setFooter("user info")
    
        message.channel.send(embed)
    }
}

Does not show the Username

marble juniper
#

even sending a normal api request to create a stage channel gives an error

#

so not yet

lusty quest
#
`my string ${value}`
cinder patio
#

Also you haven't defined member

lusty quest
silver lintel
#

how do i fix this?

cinder patio
#

It's in the error mesxsage

summer torrent
#

just read the error

earnest phoenix
#

he did how to fix it

#

not what is it

silver lintel
#

I've tried both npm rebus and npm install tho

cinder patio
opal plank
marble juniper
#

lol

opal plank
marble juniper
#

I thought you couldn't

#

smh

opal plank
#

while you can do it, its not recommened to play with stage channels yet, things are going to change a LOT

#

its still WIP

#

but to create a channel, its pretty simple

#

so simple, in fact, that you just need to set the type of channel to 13

#

thats literally it

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'userinfo',
    run: async (message, args) => { 
    const user = message.mentions.members.first()
    const embed = new Discord.MessageEmbed()
    
    .setTitle("User-info command")
    .setDescription("Information ")
    .setColor("#FF005B")
    .addField("Username", user.username, true)
    .addField("Roles", user.roles.cache.map(role => role.toString()).join(" ,"), true)
    .setTimestamp()
    .setFooter("user info")
    
        message.channel.send(embed)
    }
}

Why does it not show the username

cinder patio
#

members don't have usernames

#

users do

marble juniper
#

there is a difference between member and user objects

#

smh

#

member objects have data related to the server

#

and user objects have data related to the account itself

#

and not the server

frigid mountain
#

So what should I do?

marble juniper
#

do user.user.username

#

lol

frigid mountain
#

Thx

grave kestrel
opal plank
grave kestrel
#

ty

earnest phoenix
#

client is not defined

tulip ledge
#

Then define client lol

marble juniper
solemn quartz
#

Hello, i'm creating the help command, i'm trying to make it so that if the user allows DMs from the server, it sends the DM, if it doesn't, send it in the channel

if (message.content.toLowerCase() == prefix + "help") {
let help = new Discord.MessageEmbed()
.setColor(colore)
.setTitle('Help')
.setDescription('For a list of basic moderation commands, \n use the `?help moderation` command. \n \n For a list of automod releated commands, \n use the `?help automod` command. \n \n To view more information about a single command,\n  use the `?help <command name>` command.')
try {
  message.author.send(help)
} catch (err) {
  help.setFooter('I could not DM you this message, so i sent it here.')
  message.channel.send(help)
}
}

This is the error
UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send messages to this user

frigid mountain
#

How do I make it so that in the account created section it also shows the time the account was created

user.user.createdAt.toLocaleDateString("en-us")
umbral zealot
solemn quartz
#

Oh thank you

#

i just needed to add await in there

#

ty

umbral zealot
#

You can use a date formatting module like dayjs or date-fns to format dates however you want

solemn quartz
#

ah yes, professional javascript coder, my favourite

frigid mountain
#

Lol

#

This person has problems with me just because I did not let him become a developer for my bot

solemn quartz
#

nope

#

just saying that you cant call yourself a professional javascript coder

frigid mountain
#

Yes I have all the messages screen shorted

solemn quartz
#

before of that you had "professional grapichs designer"

#

like wtf

frigid mountain
#

Just like changing my status once in a while

#

Just because I rejected your request doesn't mean you have to fight with me so for the sake of God keep quiet

earnest phoenix
#

hii

umbral zealot
pale vessel
#

Fri Apr 02 2021 11:15:32 GMT+0000 (Coordinated Universal Time)

#

OR toISOString()
2021-04-02T11:16:34.135Z

frigid mountain
#

I want it to show the time Like this

umbral zealot
#

Ah then you definitely need to use dayjs or date-fns

#

Especially for the "x time ago" feature

pale vessel
#

or use toISOString()

pale vessel
frigid mountain
pale vessel
#

remove "en-us"

frigid mountain
#

Like that

pale vessel
#

Yeah

earnest phoenix
#

can u help me

pale vessel
earnest phoenix
#

someone pl

earnest phoenix
frigid mountain
opal plank
#

you need 2 requests

#

1 topic

#

2 request to speak

earnest phoenix
#

Any guide

#

For DJ's

#

please tell me which 1 i need to host 24/7

#

#

i wanna run my bot 24/7

umbral zealot
#

I don't think any of those options are correct

#

you need a nodejs vps

earnest phoenix
#

can u send a link

#

?

umbral zealot
#

IBM cloud computing is more enterprise level things

#

there are resources in the pins, information and examples

winged linden
#

Just buy a linux vps u can host it on it

umbral zealot
frigid mountain
#

If I want to send a message to the mentioned channel do I use

const channel = message.mentions.channels.first() 
umbral zealot
#

yes.

frigid mountain
#

I finally figured something out on my first try yeay

umbral zealot
#

Yes you did! sharkyay

frigid mountain
# umbral zealot Yes you did! <:sharkyay:717603745768144977>

Help it does not want to work

const Discord = require('discord.js')

module.exports = {
    name: 'mod updates'
    run: async (message, args) => {
    const sayMessage = args.join(" ")
    const channel = message.mentions.channels.first() 
    const embed = new Discord.Message.Embed()
  
    .setTitle("Mod updates")
    .setDescription("These are very important messages for moderators")
    .setColor("#FF005B")
    .addField("Mod updates", `${sayMessage}`, true)
        
          message.channel.send(embed)  
     }
}
vivid fulcrum
#

what does not want to work

umbral zealot
#

yeah I Got the same question

#

and why are you trying to send to messsage.channel

#

instead of channel

earnest phoenix
#

Maybe its because of the name since if they're splitting their args by spaces, it would usually be "mod"

umbral zealot
#

Discord.Message.Embed MarioFP

opal plank
#

anyone good with css?

#

need a bit of help

umbral zealot
#

You know how this works, Erwin. ask the question first 😛

opal plank
#

kek its quite an annoying one

#

but here we go

#

using ONLY css, trying to modify a subreddit widget

#

but apparently i cant modify its html

#

however

frigid mountain
#

M

opal plank
#

a[href=""] i did see you can do stuff like this

#

with css

#

i was wondering if you can actually modify html elements with css or add atributes/elements

pale vessel
#

but isn't it an iframe

opal plank
frigid mountain
opal plank
#

check that for example

#

its making this picture clickable

#

in html its quite simple

umbral zealot
opal plank
#

<img> and <href>

#

2 lines

#

but apparently we cant figure out a way to get it to work

umbral zealot
#

I don't even know if you can make an image clickable as a link just in CSS

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'updates'
    run: async (message, args) => {
    const sayMessage = args.join(" ")
    const channel = message.mentions.channels.first() 
    const embed = new Discord.Message.Embed()
  
    .setTitle("Mod updates")
    .setDescription("These are very important messages for moderators")
    .setColor("#FF005B")
    .addField("Mod updates", `${sayMessage}`, true)
        
          channel.send(embed)  
     }
}
umbral zealot
#

new Discord.Message.Embed()

#

where did you get the idea this was valid

opal plank
#

or we doing something wrong

#

but its quite hard to fuck up something that bad following 3 different guides xD

umbral zealot
#

I'm... like pretty confident what you want to do isn't possible

opal plank
#

well

#

they did it

#

how, thats the question

umbral zealot
#

You can't insert HTML using pure CSS without JavaScript

frigid mountain
umbral zealot
#

Ok great! Now what? Doies it work?

opal plank
#

yeah thats what i assume too, thats why im in a bind

frigid mountain
#

Code still now working

opal plank
umbral zealot
#

still not working you mean?

#

if so, describe the problem

umbral zealot
opal plank
#

clickable images

frigid mountain
umbral zealot
#

does it error out?

pale vessel
#

they use a tags

umbral zealot
#

ironically that image is not clickable for me

opal plank
#

well yeah, but how the heck do i add that

#

its clickable

pale vessel
#

it's not

frigid mountain
umbral zealot
umbral zealot
opal plank
#

well, the bottom one is

umbral zealot
#

right that's a different image

frigid mountain
umbral zealot
#

I do'nt see that image

opal plank
#

its ads

#

my bad

#

let me get an actual example

#

1 sec

umbral zealot
#

The only image I see that's clickable is this one

opal plank
#

what we are trying to accomplish is get a discord badge with a href

#

we know its possible

umbral zealot
#

doesn't sidebar things support markdown?

opal plank
#

i think so

#

monster might be able to do it

umbral zealot
#

so... use a markdown link? lol

opal plank
#

but i dont think you can do it with images

pale vessel
#

you can

opal plank
#

literally every single reddit post you see about this we tried

umbral zealot
#

of course you can add a link to images in markdown

opal plank
#

its 3 yo+

#

doesnt seem to work anymore

umbral zealot
#

It would be super useful if reddit actually had any fucking docs tbh

opal plank
#

this ^^

umbral zealot
#

Because tbh this is a reddit question not a CSS one

opal plank
#

already did, taking a while to reply

umbral zealot
#

they're the best people to help though, really

opal plank
#

the thread owner that im helpijng is quite big, they already asked around

earnest phoenix
#

where can i see my top.gg token

umbral zealot
#

in your bot's edit page

earnest phoenix
#

i dont see it

umbral zealot
#

"Webhooks" section

earnest phoenix
#

there's no webhooks

#

oh wait

#

do i use the old design?

#

nvm

umbral zealot
#

if you do'nt see that... uhm....

#

well that's a bug.

earnest phoenix
#

i have no webhooks

umbral zealot
#

try to manually replace /edit with /webhooks ?

earnest phoenix
#

works

#

ok ty

#

also, i tapped on "Test" and there's nothing sending

#

on the webhook

#

oh nvm

#

not approved

#

when i try to save it, i get this

#

ill do it after i get approved .-.

#

thanks Hindsight for help

umbral zealot
earnest phoenix
#

Why do i get this when i try to use the Api constructor

umbral zealot
#

because you can`t use the top.gg api without an approved bot.

earnest phoenix
#

oh

#

everything is based on approved

#

ok

umbral zealot
#

yep

earnest phoenix
#

ill wait a month or so

umbral zealot
#

1-2 weeks.

earnest phoenix
#

it's the same

umbral zealot
#

It's less than half, so no, not the same.

earnest phoenix
#

ok so

stark abyss
#

str.replace(/ abcd..z/g, "_");
how do I replace any letters with something in js

misty sigil
#

/a-z/g should work

pale vessel
#

/[a-zA-Z]/g

#

or a-z and gi

misty sigil
#

thanks flaz

stark abyss
#

ah okay

opal plank
#

i figured it out

#

im smort

#

i did with css

earnest phoenix
#

Hello, in Linux, was it’s the command for view internet speed please?

vivid fulcrum
#

there's no built in shell command for this

#

find some script or something on google

summer torrent
sacred juniper
#

How can ı use rich presence

lament rock
#

If you're talking about in a bot, you can't. For users, look into RPC

thin echo
#

How do I mention the user that used the command, right now it works, but it mentions the users id

#

Python

solemn latch
#

Put the id in <@id>

vivid fulcrum
lament rock
vivid fulcrum
#

since 2019-ish

lunar patio
#

need help guys

lament rock
#

bruh

#

I've been way out of the loop

frigid mountain
#
const Discord = require('discord.js')

module.exports = {
    name: 'userinfo',
    run: async (message, args) => { 
    const user = message.mentions.members.first()
    const embed = new Discord.MessageEmbed()
    
    .setTitle("User-info command")
    .setDescription("Information ")
    .setAuthor(`${user.username} $user.displayAvatarURL({dynamic: true})`)
    .setColor("#FF005B")
    .addField("Username:", user.user.username, true)
    .addField("Discriminator:", user.user.discriminator, true)
    .addField("Status:", user.user.presence.status, true)
    .addField("Roles:", user.roles.cache.map(role => role.toString()).join(" ,"), true)
    .addField("Account Created On:", user.user.createdAt.toLocaleDateString("en-us"), true)
    .addField("Joined On:", user.joinedAt.toLocaleDateString("en-us"), true)
    .setTimestamp()
    .setFooter("user info")
    
        message.channel.send(embed)
    }
}

In the .setAuthor section it was suppose to show the users avatar in the top left corner of the embed

placid vault
#

Could someone please explain why, according to this channel's pins, the free trials for GCP and AWS are considered bad?

lament rock
#

Low specifications

placid meadow
#

sup ppls 😉

umbral zealot
#

sup, can we help you?

earnest phoenix
#

anyone know a good way to make a leveling system without ids?

umbral zealot
#

What do you mean by "without IDs"

placid meadow
#

nah no help 😉 im just hanging out

umbral zealot
#

ok well you can go hang out in #general if you just want to chat bruh

earnest phoenix
#

in many tutorials and examples online they use specific user and server ids im trying to find a good way to code a leveling system for all users and servers

umbral zealot
#

don't use the server ID then

#

use only the user ID

#

ezpz

earnest phoenix
#

but than it would still be user specific and others can't use it

umbral zealot
#

well how the hell else are you going to attribute points?

#

who would get points if they're not going towards a user?

lunar patio
#

any one helping me

#

😩

umbral zealot
earnest phoenix
#

im just trying to find some code like mee6 or amariBot

pale vessel
#

no

#

code it yourself

#

4head

umbral zealot
#

ok but your question makes no sense

#

Points have to go towards something

#

usually, a user

#

in order to attribute points to a user, you need to ahve some structure that saves points

#

For each user

#

and how do you identify them? Through their ID!

lunar patio
umbral zealot
#

so you add a point to the user, by ID

earnest phoenix
#

nvm

umbral zealot
#

Aight give up instead of seeing the problem through if that's easier for you then thumbs

umbral zealot
lunar patio
#

.js

umbral zealot
#

use setTimeout

tardy hornet
#

i forgot about the guild count thing, its guild. something, anyone have the Documentation for that?

marble juniper
#

setTimeout(() => {
// Code executed after delay
}, delay in milliseconds)

#

lol

earnest phoenix
#

how do i do backend stuff in next without a custom server

marble juniper
#

at least for discord.js

#

lol

earnest phoenix
#

lol

earnest phoenix
tardy hornet
earnest phoenix
#

yw

lunar patio
umbral zealot
#

yes it will work

#

if you code it

#

¯_(ツ)_/¯

marble juniper
#

just put the settimeout after the first message

#

lol

earnest phoenix
#

lol

marble juniper
#

lol

earnest phoenix
#

🤣 lolololol

marble juniper
#

it says

#

missing permissions

#

means

earnest phoenix
#

try reading the error again, but slowly

marble juniper
#

it has missing permissions

earnest phoenix
#

It have all perms 🙄

#

Read already

marble juniper
#

maybe not in other servers

umbral zealot
#

Then you're trying to affect a member with a higher or equal role

earnest phoenix
#

what are you doing anyways

marble juniper
#

lol

earnest phoenix
#

lol

marble juniper
#

the error says missing permissions

#

so it has missing permissions

earnest phoenix
#

Uhmm

marble juniper
#

cuz the error says missing permissions

umbral zealot
#

"missing permission" can also happen if you're trying to add a nickname to someone with a higher role I think

marble juniper
#

yeah

earnest phoenix
#

yep

#

lol

marble juniper
#

can also happen with role hierachy

#

lol