#development

1 messages · Page 1313 of 1

pale vessel
#
  1. roles have a manager now so you have to use roles.cache to access the cached roles (msg.guild.roles.cache.find())
  2. member.addRole doesn't exist anymore, you have to use member.roles.add()
lucid prawn
#

Flaze I'm only having problem because I'm trying to add a skip to my bot and i didnt copy and paste

#

@pale vessel

sudden tulip
#

fuck it

#

i'm making it in c#

#

code 🧛

carmine summit
#

Uh

#

So she/he is running on d.js 11

#

And I made him/her update it to 12

lucid prawn
#

what is bil code

elder ledge
#

Do you know any code sharing server?

lucid prawn
#

yes

elder ledge
#

will you?

lucid prawn
#

will i what

elder ledge
#

You will send the invitation link

lucid prawn
#

it a small server but ok

sudden tulip
#

this convo gave me braincancer

drifting wedge
#
ValueError: time data '2020-10-11 01:50:22.734231' does not match format '2020-10-11 01:51:22.734231'``` intresting...
carmine summit
#
const MongoClient = require('mongodb').MongoClient;
const uri = "mongodb+srv://cwicks:NO@cluster0000.knta7.gcp.mongodb.net/Cluster0000?retryWrites=true&w=majority";
const clientDB = new MongoClient(uri, { useNewUrlParser: true });
clientDB.connect(err => {
  const collection = clientDB.db("test").collection("devices");
  // perform actions on the collection object
  clientDB.close();
})

const db = clientDB.db('db')
```This doesn't seem to work
#

MongoClient must be connected before....

blissful coral
#

Is there something wrong here?

#

It isn't collecting reactions

pearl trail
#

try use that

blissful coral
pearl trail
#

case

#

case"emoji":

blissful coral
#

do I have to use a case though

#

Can't I just change it and do a if statement for the reaction

pearl trail
#

hm

#

ah yes i see

#

;-;

tame kestrel
#

Try logging inside your filter and seeing what's up

carmine summit
#

wait

#

hmmm

blissful coral
#

It was working yesterday

carmine summit
#

db.get() is not a thing in mongodb???

blissful coral
#

I haven't changed anything

#

other then sharding

carmine summit
#

alr, goodbye mongodb

#

you're too advanced for me

fluid basin
#

the docs are pretty well documented for mongo fyi

#

plus .find() should pretty much get anything you need

blissful coral
#

Anyone see a problem?

carmine summit
#

What is collection?

fluid basin
#
  1. Db inserts are likely to be asynchronous and if you want to ensure insert success, you should callback/promise
  2. I think you need to await reacting the initial checkmark as well, to prevent the collector from counting your bots reaction
blissful coral
#

It doesn't count the bot

#

that is the filter

fluid basin
#

also is there any reason why you cant use awaitReactions?

tame kestrel
#

@blissful coral Step by step debugging, is the filter being called correctly, is the filter passing correctly, is the collect function being called at all, like, at all.

blissful coral
#

vote kick cmd will

fluid basin
#

yeah I know

#

await reactions will work just fine

#

set a limit of reactions needed

#

and a timeout

#

oh unless you want reaction feedback

blissful coral
#

I have reaction feedback

#

So

carmine summit
#

so I replace .get with .insertOne

fluid basin
#

aight

#

get is find

#

not insert

#

smh

carmine summit
#

hm

#

wait

#

.set

#

.set is replaced by .insertOne

#

ok....

#

getting somewhere

tulip lodge
#

mongoose is much easier to use for mongodb databases imo

carmine summit
#

ok

#

im transferring

#

i hate this

fluid basin
#

@blissful coral could I look at the complete code for your collector?

blissful coral
#

yeah let me pull up a bin

carmine summit
#
await mongoose.connect('mongodb://localhost/my_database', {
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useFindAndModify: false,
  useCreateIndex: true
});

Is the second para really req?

faint prism
carmine summit
#

How do I define db???

#

im so cunfused rn

faint prism
#

Note sure exactly what to test yet, but I'll be ready when I need to after I implement the fakes KEKW

carmine summit
#

idk wtf did i do

#

but its working

#

yep

#

its working

mild flower
#

does return not work like this

#

how do i make it run like this

faint prism
#

yeah that if(...)return {... is not correct

#

return ends a function

#

not an if statement

#

@mild flower

blissful coral
#

Update on my shit: All I am gonna say is FUCK INTENTS

sonic lodge
#

why

pale vessel
#

intents are good

#

you can choose what you need and what you don't and save resources

blissful coral
#

They are lol

#

Just not when you forget to enable one

pale vessel
#

o

carmine summit
#
const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');


var mongoose = require('mongoose');

var mongoDB = 'mongodb+srv://NO:NO@database.knta7.gcp.mongodb.net/TESTDB?retryWrites=true&w=majority';
mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true});

var db = mongoose.connection;

db.on('error', console.error.bind(console, 'MongoDB connection error:'));
```Where is data saved when I do this?
blissful coral
#

I honestly am so confused on how to use mongo

#

lol

carmine summit
#

There

#

It works perfectly fine with my setprefix command

solemn leaf
#

@blissful coral

#

want help?

#

with intents?

carmine summit
#

Alr

#

i guess its not working

blissful coral
#

?

carmine summit
#

when i restart the bot, it goes back to the default prefix

blissful coral
#

welp

carmine summit
#
var mongoose = require('mongoose');

var mongoDB = 'mongodb+srv://no:no@database.knta7.gcp.mongodb.net/Database?retryWrites=true&w=majority';
mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true});

var db = mongoose.connection;

db.on('error', console.error.bind(console, 'MongoDB connection error:'));
```hmmmm
flint yew
#

@carmine summit learn from him

#

He using mongo to set prefix

earnest phoenix
#
var mongoose = require('mongoose');

var mongoDB = 'mongodb+srv://no:no@database.knta7.gcp.mongodb.net/Database?retryWrites=true&w=majority';
mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true});

var db = mongoose.connection;

db.on('error', console.error.bind(console, 'MongoDB connection error:'));
```hmmmm

@carmine summit that code is 10000% wrong

marble juniper
#

the yt vid is sus

opaque seal
#

Do I need any special Intent to use this?

const game = member.presence.activities.find(activity => activity.type === 'PLAYING');
compact oriole
#

yes

#

you need the presence intent

opaque seal
#

Is it a priviliged intent?

#

Or just a normal one?

compact oriole
#

a privilaged

opaque seal
#

wait really?

#

just to check a presence of ONE user?

compact oriole
#

they don't know if you're checking one or one thousand

opaque seal
#

I don't need the PRESENCE_CHANE event

compact oriole
#

so of course

opaque seal
#

I just need to check it sometimes

#

is it the same thing?

compact oriole
#

you don't receive presence data if you do not have that intent

opaque seal
#

F

#

I need to go trough verification then

earnest phoenix
#

@opaque seal if Discord removes one of those dumb limits chaos will happen

tardy hornet
#
if(!channel.id === '764731044477665280') return message.channel.send('sorry but you can only do that command in my support server, in the channel: `"emojis-approval"`')
pale vessel
#

bruh use !==

tardy hornet
#

oh

#

ok

pale vessel
#

remove ! on the front

tardy hornet
#

ReferenceError: channel is not defined

pale vessel
#

well, define the channel

tardy hornet
#

how

#

is it the const =?

heady heron
#

man ui sucks

#

takes so long

#

still gotta get a cdn aswell for the auto updater... yikes

polar sigil
#

I need some help

#

so I wanna make a feature in a bot for random num genarator

#

function getRandomIntInclusive(min, max){
max = Math.ceil(90);
min = Math.floor(1);
if (message.content === '-roll')
message.channel.send(getRandomIntInclusive)

#

this is what i got so far

earnest phoenix
#

@polar sigil that is so wrong

faint prism
#

That's not even recursion

#

That's just... Gibberish

compact oriole
#

it is gibberish lul

faint prism
#

It's also passing in variables, then assigning to them for some reason....
Even if you fix the syntax errors, the logic is all wrong

flint yew
#

the yt vid is sus
@marble juniper lmao

marble juniper
#

we should vote it out

flint yew
#

oof

faint prism
#

You're rounding whole numbers waitWhat

#

Wtf lmao. This is one of those things where the more I look at it the worse it gets

marble juniper
#

Math.round(1)

compact oriole
#

is 1

flint yew
#

study math

marble juniper
#

Math.floor(Math.round(Math.pow(1)))

flint yew
#

read docs plez @polar sigil

earnest phoenix
#

Do you guys think this is a good way to make a tic tac toe game?

var data = {
    row1: {
         column1: null,
         column2: null,
         column3: null
}, 
row2: {
         column1: null,
         column2: null,
         column3: null
},
row3: {
         column1: null,
         column2: null,
         column3: null
}
}
canvas.addEventListener("click", (m) => {
// return if the place where the user clicked already has a counter placed or it is not a part of the board
// do stuff to 'data' if it is a legit click
});
function update() {
// redraw the canvas
}
faint prism
#

Or just learn the language.
At least he didn't copy and paste anything for sure lmao

flint yew
#

there many yt videos

compact oriole
#

you should make a boolean matrix

marble juniper
#

@earnest phoenix seems good to me

compact oriole
#

[][]

earnest phoenix
#

there many yt videos
@flint yew can you stop recommending YouTube tutorials they're outdated 99.99% of the time

real shale
earnest phoenix
#

you should make a boolean matrix
@compact oriole a what?

pearl trail
#

message.guild.verificationLevels turns undefined

faint prism
#

2D array would work just fine

compact oriole
#

[][] this thing

marble juniper
flint yew
#

@flint yew can you stop recommending YouTube tutorials they're outdated 99.99% of the time
@earnest phoenix lmao u sure

pearl trail
#

do i need add caches?

marble juniper
#

this

#

yt tutorials suck

compact oriole
#

then you can use it like x and y

so x = arr[2 (x)][1 (y)]

earnest phoenix
#

message.guild.verificationLevels turns undefined
@pearl trail it's level or is it levels?

pearl trail
#

idk ;-;

flint yew
#

yt tutorials suck
@marble juniper yes but not all some are good and even in language they speak

pale vessel
#

try it and see

pearl trail
#

i'm write it with s

earnest phoenix
#

lemme test with my eval

compact oriole
#

@tame kestrel

pearl trail
#

okay,

pale vessel
#

why would it be with an s

faint prism
#

Safe plz

flint yew
#

Russian :/

real shale
#

:/

earnest phoenix
flint yew
#

😐

earnest phoenix
#

Yup it's level not levels

vale garden
#

hi

earnest phoenix
#

hewwo

pearl trail
#

ah, without s

#

thanks

flint yew
real shale
earnest phoenix
#

isn't it obvious that there shouldn't be an s?
how would a server have multiple verification levels

vale garden
#

wait what

flint yew
#

damn

vale garden
#

lol where is the coloration

pearl trail
#

hm, rip grammar

earnest phoenix
vale garden
#

lmao

flint yew
#

hahahaha

pearl trail
#

i'm bad at grammar lol ;-;

real shale
#

const timer = Math.floor(Math.random() * 47 + 18);
const real = timer * 60000;

setInterval(() => {

let pkmns = ["https://i.pinimg.com/236x/80/6d/ea/806dea7c71b5c02affd2b051784a3647--haunter-pokemon-ghost-pokemon.jpg", "https://pokemon.gishan.cc/static/i/p/gengar.jpg", "https://qph.fs.quoracdn.net/main-qimg-d21cc854449a1b6142a1838e3cd78634.webp", "https://www.pngitem.com/pimgs/m/451-4516899_mega-ghost-type-pokemon-hd-png-download.png", "https://static.wixstatic.com/media/2e36a5_5617ecca59394c228c1eb33353d6816b~mv2.jpg/v1/fill/w_994,h_730,al_c,q_90/2e36a5_5617ecca59394c228c1eb33353d6816b~mv2.jpg", "https://static.fandomspot.com/images/02/4903/20-dusknoir-anime-pokemon.jpg", "https://www.ordinaryreviews.com/wp-content/uploads/2018/07/chandelure-e1531540398921-800x519.png", "https://www.ordinaryreviews.com/wp-content/uploads/2018/07/cofagrigus-e1531540503348-800x536.png"]

let pkmn = Math.floor(Math.random() * pkmns.length)

  bot.channels.cache.get('630791036431499264').send(pkmns[pkmn])

  const filter = m => m.content.includes(':pokeball:');

  const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 1})

  collector.on('collect', m => {

    db.add(`inv_${m.author.id}`, 1)
    message.channel.send("The Ghost Pokémon has been captured!")

    const filter2 = n => n.content.includes('points');

    const collector2 = message.channel.createMessageCollector(filter2, { time: 15000, max: 1})       

    collector2.on('collect', n => {

    let points = db.get(`inv_${m.author.id}`)

    message.channel.send(`You have ${points} points!`)

    })

  collector2.on('end', collected => {
    
    })

    })

  collector.on('end', collected => {
    
    })


}, 10000)
pearl trail
#

uh

compact oriole
#

ffs

flint yew
#

lamoooooooooooo

vale garden
#

lol

compact oriole
#

@coral trellis

faint prism
#

Great

earnest phoenix
#

@real shale fucking stop

pearl trail
#

lmfaoo

flint yew
#

spam xd

vale garden
#

ok but

#

here

compact oriole
#

@real shale is constantly sending memes/images here and flooding the chat

vale garden
#

wait no

#

aaaa

flint yew
#

xaxaxaxaxaxaa

vale garden
coral trellis
#

Keep this channel related to development

vale garden
#

lol

#

i need help

#

so how do i end the previous collector after the next message has been sent

#

like the bot sends 2 images

#

and if i type the collecting message

faint prism
#

Ty xig

vale garden
#

it registers it twice

#

how do i cancel the previous message

earnest phoenix
#

collector.end()?

vale garden
#

no i mean

#

wait

#

lol one sec my brain is ded

#

ok yea

#

see i meant

flint yew
#

bruh

vale garden
#

how do i end it if the next message in the

#

interval

#

is executed

#

lol

#

rip

earnest phoenix
#

the x and o variables are images

open zodiac
#

hey i need help with css

#

is there any way to set a background pic in the bot's long description using html ??

tame kestrel
#

@open zodiac Using some style tags you can override classes that already exist in the bot pages.

polar sigil
#

@polar sigil that is so wrong
@earnest phoenix lol it wqsnt meant to be perfect or even code i just asked for reference

#

You're rounding whole numbers waitWhat
@faint prism yes i need to round numbers this is mesnt for whole numbers

#

meant*

tardy hornet
#

${bot.guilds.cache.size} for guild, what for members?

tame kestrel
#

off the top of my head probably <Client>.users.cache.size

#

@tardy hornet

tardy hornet
#

ty

tame kestrel
#

anytime

delicate shore
#

I wanna see if a user has specific role in my server (Discord.js)

#

I checked if he is in my guild

#

But how can I check if he has the role

tame kestrel
delicate shore
#

Okie thanks

earnest phoenix
stoic girder
#

Could I get some ideas how could I find username in a command that looks like this:

!reject User with space in name#0001 Rejection reason

Some regex perhaps? Joining arguments into a single string and then splitting them by #0001, I'm not sure how would I do that as I don't know what the number is.

fickle sapphire
#

The mention?

stoic girder
#

In this case, user is not mentioned, their username which may or may not contain spaces is written.

vestal swallow
#

Use a separator and split() ? Like !reject user | reason instead ?

stoic girder
#

Just came up with this

#
let args = 'User with space in name#0001 Rejection reason';
let argsSplit = args.split('#');
let username = argsSplit[0];
let id = argsSplit[1].substring(0, 4); // Remove " Rejection reason"
let reason = argsSplit[1].substring(5); // Remove #0001 + space.
let user = username + '#' + id;

console.log(user); // "User with space in name#0001"
console.log(reason); // "Rejection reason"
#

Not the cleanest solution but works.

#

Any ideas on improving it tho?

#

Obviously I need to implement detection in case arguments are empty, etc.

tame kestrel
#

You can use regex to get the name, and if the name has spaces you can use quotes around the name or something

warm marsh
#

Yes, check if the user is trying to run the command

stoic girder
#

You can use regex to get the name, and if the name has spaces you can use quotes around the name or something
@tame kestrel Quotes as well as a separator as @vestal swallow mentioned would work just fine, but you gotta make it as easier as possible for users.

#

Well, I'll do some tests with various usernames and let you know, hope it will work fine. Thanks for help!

hasty mulch
#

Is there a way to reboot my bot with Python?

silver lintel
#

how do you get the last delted msg in a channel djs?

stoic girder
#

Is there a way to reboot my bot with Python?
@hasty mulch If you use a process manager like PM2 for Javascript, you could restart it with a shell command, which in Python could be executed with os.system('echo something'). Just be careful with those.
There's probably a better way tho.


#

how do you get the last delted msg in a channel djs?
@silver lintel The solution is just 1 Google search away, https://stackoverflow.com/questions/52504449/snipe-command-that-shows-last-deleted-message.

TLDR

bot.on('messageDelete', (message) => {
    console.log(message);
});
opal plank
#

@silver lintel @stoic girder How about we do stuff properly and NOT use json as dynamic databases?

#

just Map it and store it in memory with channel id

#

its legit 3 lines of code

gentle lynx
#

can somebody explain to me why this is showing even though i did this?

opal plank
#

none of that bs with json with reading and writing which will likely corrupt it at some point

gentle lynx
#

am i doing something wrong with the error handling?

stoic girder
#

Yeah agree. I don't use JSON my self for anything other than a config file, just showed an example.

#

How does the storing in "memory" work tho?

honest perch
#

Whats faster, mongo, or postgres

opal plank
#

snipes = new Map();

on.('delete') => sniper.set(channel, message)

thats it

#

@honest perch do you really need faster?

honest perch
#

Yes

opal plank
#

absolutely?

honest perch
#

I want speeeeeeed

opal plank
#

then use cassandra or something scalable like that

silver lintel
#

how do you delete if like no snipe cmd after an amount of time?

opal plank
#

im dealing with tops 80k per 15 seconds, postgres has been handling it

stoic girder
#

@opal plank That will be gone if bot is restarted I assume. Not a problem tho as it's only snipes.

opal plank
#

your bot shouldnt restart constantly either way

#

or use a database

honest perch
#

I'll try postgres then as I cba to set cassandra up

opal plank
#

for persistent data

stoic girder
#

True, just asking.

opal plank
#

actually, my bad, not OR, AND

stoic girder
#

I'm using SQlite myself, and now I'm sad I didn't choose Mongo from the beggining.

opal plank
#

keep store to quick access and just keep dumping it on database

stoic girder
#

Will migrate at some point...

opal plank
#

you'll be sad once you use mongo and see there are better dbs

stoic girder
#

Yikes

#

I'll sure do some research.

opal plank
#

cof cof postgresSQL and Cassnadra cof cof

misty sigil
#

I want speeeeeeed
@honest perch a_SPEED

#

what library

pale vessel
#

dude you just copied the source code

#

that's not-

misty sigil
#

did you even read the docs I gave you?

earnest phoenix
#

Google works fine on any browser on any device but browsers which I cleared data for accounts.google.com (Brave and Cryptotab)
Anyone know why? I googled it and found there is already a thread for this on support.google.com saying that google is working on a fix but IT'S BEEN THERE FOR 6 MONTHS

pale vessel
#

upgrade

#

your

#

windows

misty sigil
#

PLEASE

earnest phoenix
#

buy me a good computer

#

my pc can't even handle this shit

warm marsh
#

Use Linux?

earnest phoenix
#

how would it handle windows 10

#

Use Linux?
@warm marsh i'm not a dumbass

misty sigil
#

uh

warm marsh
#

😐

#

Linux > Windows

misty sigil
#

what?

earnest phoenix
#

Linux sucks for me

misty sigil
#

Linux isn’t bad tho

earnest phoenix
#

It won't even turn on properly

misty sigil
#

Linux is probably one of the better operating systems (well, group of them)

earnest phoenix
#

and why are we chatting about OS' that's not the problem here

misty sigil
#

it could be

earnest phoenix
#

i'm gonna see if my browser is outdated

#

and update it

#

or i can just spam email google from my phone

honest perch
#

Try popOS

earnest phoenix
pale vessel
#

most of the time it's under about browser

earnest phoenix
#

WAIT CAN FIREBASE CLI MANAGE ANYTHING FIREBASE RELATED
I'M ALREADY LOGGED IN

toxic jolt
#

hello guys im using a discord.js shard but my bot so restarting i how to fix this my problem?

#

please help me

carmine oasis
#

I'm having a problem with the mysql library for nodejs (https://github.com/mysqljs/mysql)

I have this code: (the loggers are there because i was debugging)

function query(query, func) {
    console.log('Query');
    pool.getConnection((err, connection) => {
        console.log('QueryGetConnection');
        if(err) throw err;
        connection.query(query, (err, data) => {
            console.log('QueryFunction');
            if(err) throw err;
            func(data);
        });
    });
}

For some reason, after a while the function that i pass to pool.getConnection() no longer gets executed. Nothing at all happens: no errors either. The function just no longer executes. Does anyone know what the problem might be?

#

I think my problem also only starts appearing whenever the shard has to reconnect

earnest phoenix
#

uwu

#

idling here

#

need help with javascript PINGO

heady heron
#

Please give me feedback hehe P[lease note the elgato pictures are just for display, ill put my physical products in soon!

earnest phoenix
#

@heady heron we're not a place to ask feedback for your bot

#

why not ask for feedback on your own bot's support server

heady heron
#

uh

#

dickhead it isnt a bot

#

did you even watch the video smh

earnest phoenix
#

@heady heron rude

#

and we're not a server to ask feedback for weird shit anyways

#

if you want you can ask help with programming

heady heron
#

uh multiple people ask actually kid

#

you seem new around here lol

open rune
#

yes, he's new, just like you

sharp thicket
#

Stop both of you before i call a mod

open rune
#

guess, they're stopping xdd

sharp thicket
#

Lol

heady heron
#

uwu

#

im not new

#

i just leave the server and join back

#

alot

sharp thicket
#

-bots @heady heron

gilded plankBOT
#

tickNo This user has no bots

sharp thicket
#

Ye nope

heady heron
#

i use to have bots

#

i closed them tho

#

lol

sharp thicket
#

Oh

#

Sad

heady heron
#

had a dashbaord

#

just got bored so i closed it down

#

and moved on

sharp thicket
#

Im working on one

heady heron
#

oh nice

sharp thicket
#

Well its done but not released yet

heady heron
#

what u think of my app tho

#

im making my own streamdeck

sharp thicket
#

Nice

heady heron
#

like elgato but itll be cheaper and easier

sharp thicket
#

Nice

#

Idk what else to say 😂

heady heron
#

hehe

sharp thicket
#

What language?

heady heron
#

c#, but writing an api in so i can use js py to handle all sql events and data management. only doing the ui/ux in c#

sharp thicket
#

Oh

#

Why py tho its not that great

#

Ima go to testing one test my bot

earnest phoenix
#

@heady heron you're rude tbh

#

are PNG images supported in HTML favicons?

#
<link rel="icon" href="/assets/favicon.png" type="image/png">
#

in modern web browsers yes

#

but that ain't working

#

@heady heron c# is the worst language to do ui in lol

#

try clearing cache, code

#

@heady heron c# is the worst language to do ui in lol
@earnest phoenix unity.....

#

unity is a game engine

#

that uses c#

#

and has UIs

#

well

#

big brain time for unity

#

the scripting is done in c#, there's more magic behind it with mono

#

they are most likely using winforms/wpf/uwp

#

which all are so bad

#

why did they remove unity script
i spent my whole week's internet to download unity only to realise they remove it

heady heron
#

lmao i find .net easy as shit

#

i hate electron

#

it can kneck

mild flower
#

can i make my bot join a guild through an invite link?

pearl trail
#

no

earnest phoenix
#

take a guess

heady heron
#

no

mild flower
#

is there any way to invite bots to group dms

earnest phoenix
mild flower
#

at least

earnest phoenix
#

bots cant be in group dms

pearl trail
#

yes

earnest phoenix
#

is there any way to invite bots to group dms
@mild flower make them accept a user's friend request then add them to the group DM

pearl trail
#

lol

heady heron
#

lol

earnest phoenix
#

lol

heady heron
#

thats abuwse right there

earnest phoenix
#

w h a t

#

@earnest phoenix just put the favicon where your index is

#
<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="/assets/favicon.png" type="image/png">
    </head>
    <body>
        
    </body>
</html>

how da hell is this not working

mild flower
#

@mild flower make them accept a user's friend request then add them to the group DM
GWnatesnowSmart

earnest phoenix
#

the browser is going to pull it automatically

#

it's a PNG browsers look for ICOs

mild flower
#

big braieun

earnest phoenix
#

browsers look for a file named favicon

#

ok

#

updating my browser brb

#

wow my fucked up more than fuck mouse just deleted the file for no fucking reason

#

I just added this and it works (the PNG transparency doesn't work tho)

<link rel="shortcut icon" href="https://cdn.discordapp.com/icons/721707451375943740/646a516f8fefc98b8628d0bf9fa99e64.png" type="image/x-icon">
#

wait

#

there is no transparent stuff in the image

#

lmao

heady heron
#

oml

#

why do you make everything so hard

#

bahahahaha

brittle lake
#

how do host on heroku

misty sigil
#

pins

brittle lake
#

k

earnest phoenix
#

why can't i serve js files from a folder in my public directory on firebase hosting?
this is my folder structure:

public
|_index.html
|_404.html
|_main.css
|_assets
  |_<images videos and stuff>
|_js
  |_top-nav.js

this is my HTML code that's referencing the js:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="/main.css">
        <link rel="shortcut icon" href="https://cdn.discordapp.com/icons/721707451375943740/646a516f8fefc98b8628d0bf9fa99e64.png" type="image/png-icon">
        <script src="https://d3js.org/d3.v6.min.js"></script>
        <script src="/js/top-nav.js"></script>
    </head>
    <body>
        <div id="top-nav"></div>
    </body>
</html>
#

||help me @misty sigil lol||

mild flower
#

bruh

#

why this happening

earnest phoenix
#

@mild flower you're missing the <>

mild flower
#

no im not

#

whenever i add the <>

#

iT just tursn into :urmom: so i just removed it for that message

#

the brackets are in the code

earnest phoenix
#

you don't have access to the server of the emoji?

mild flower
#

i do

#

id is correct

#

name is correct

#

its the first server the bot joined

#

everything should be correct

earnest phoenix
#

@mild flower show your code

mild flower
#
if (!message.guild.me.hasPermission("SEND_MESSAGES")) return  message.author.send('Please give me permissions to send messages.') 
const Erate = new Discord.MessageEmbed()
.setTitle('Rate')
.setDescription('**Usage** : ``;rate (user)``')
.setColor("RED")

let rateduser = message.guild.members.cache.get(args[0]) || message.mentions.members.first() || message.member
if(!rateduser) return rateduser = message.channel.send('Please provide a valid user from this server to rate');
if(rateduser.id == 411548232133640203) return message.channel.send('I would rate you  ``10/10`` :urmom:')
if(rateduser.id == 728176491514298478) return message.channel.send('Me? I don\'t know what to rate myself.')

let ratenumber = Math.floor(Math.random() * 11)
message.channel.send(`I would rate ${rateduser} a \`\`` +  ratenumber + `/10\`\``).catch(err => {
message.channel.send('That username is too cringe to rate.')
})```
woeful pike
#

id must be string

mild flower
#

ah damn it changed it

#

to :urmom:

#

its this in the code

#

discord just changes it whenever you type it

earnest phoenix
#

id must be string
@woeful pike even a blasted admin has to tell people to put snowflakes in strings

#

:urmom:

mild flower
#

yeah see?

earnest phoenix
#

i don't have nitro so i can't do that

mild flower
#

also ur not in thea guild that emoji is in

earnest phoenix
#

bots need to be in the server to do that but they don't need nitro

mild flower
#

the bot is in that guild

#

1000%

earnest phoenix
#

smh

deft grotto
#

Does anyone know how top.gg are pinging bots to find if they're online or not? Only way I could find to do it was by having another bot in the same server as the bot. Was wondering if it was possible to do via OAuth2

earnest phoenix
#

Does anyone know how top.gg are pinging bots to find if they're online or not? Only way I could find to do it was by having another bot in the same server as the bot. Was wondering if it was possible to do via OAuth2
@deft grotto They're implementing smth in the API libraries. I guess they'll regularly send pings to top.gg telling them "Hey this bot is still online!" and when the website doesn't get a ping it marks the bot as offline

#

@deft grotto <They invite the bots to check if they're online or not, or just fetch the bot user with ID and check presence>

deft grotto
#

@deft grotto <They invite the bots to check if they're online or not, or just fetch the bot user with ID and check presence>
@earnest phoenix fair, was hoping there'd be an OAuth2 solution but it'd appear not

willow yoke
#

//g = quick.db

swift idol
#

can anyone help me export my discord bot project in a single .exe file

#

i need it to work across computers

earnest phoenix
#

@willow yoke Log what role returns

willow yoke
#

['role id']

solemn jolt
#

Whats this

#

?

orchid pasture
#

@solemn jolt can u elaborate ur bot activity before?

ripe trellis
#

help me

#

pls

main hound
#

can someone tell me how can i leave the bot photo round. I know how to make css, border-radius. But I can't leave the round photo

#

what is the id or class of this photo ...

potent stirrup
#

Does anyone know how to log the the people who react in a message discord py?

earnest phoenix
#

Does anyone know how to log the the people who react in a message discord py?
@potent stirrup the the

#

@main hound try right clicking the photo and click inspect

#

(if you have a chromium based browser)

main hound
#

<style>
img {
border-radius: 50%;
background-color: transparent;
}
</style>

#

?

potent stirrup
#

@potent stirrup the the
@earnest phoenix the user who reacted

earnest phoenix
#

@main hound the parent div element has the class bot-img

main hound
#

ok

earnest phoenix
#

I can tell that from the screenshot

#

I love Chromium

past crypt
#

How to make the bot active 24/7

honest perch
#

with a vps

past crypt
#

Vps

#

Ok

cinder sandal
earnest phoenix
#

bruh

sudden geyser
#

if (...) {...}

balmy anchor
#

Does anyone knows how to create an image from a guild picture?

earnest phoenix
#

that is already an image, sir

balmy anchor
#

i mean

#

how to make a var from the image

#

so i can use it in embed or so

earnest phoenix
#

in which library

balmy anchor
#

d.js

earnest phoenix
balmy anchor
#

K thx

timber frost
#

Can someone send me a link or an example for something like a queue if a bot gets rate limited? Or something similar. I highly doubt that my bot will ever need this but I just want to add it early on so I don't need to later XD

earnest phoenix
#

chances are your library does it for you

#

if not, you'll have to modify your lib's source because ratelimit info is internal

timber frost
#

Oh fair point

#

Didn't think of that

#

I use discord.js so I imagine that it would

#

Thanks

drifting wedge
#

why is my stats command all fucked up?

#

the member count isnt working

livid lichen
#

Anyone know an alternative to Enmap?

#

Enmap isn't working for me.

digital ibex
#

@drifting wedge wdym

drifting wedge
#

1 sec

quartz kindle
#

@livid lichen there are dozens of alternatives

livid lichen
#

Really? I guess I should have researched before coming here. I expected there to be none.

quartz kindle
#

well considering the purpose of enmap is to store data, literally any database system out there (there are hundreds) could be considered an alternative

#

but if you're looking for something with a similar degree of ease of use and simplicity, check out quick.db maybe

livid lichen
#

Thanks.

#

Does it support JavaScript?

quartz kindle
#

its made for js

livid lichen
#

Perfect. Thanks!

quartz kindle
#

it does more or less the same thing as enmap does, its a wrapper around the sqlite database

livid lichen
#

Uh oh

#

I have quite the trouble downloading sprite.

quartz kindle
#

then your problem is not enmap

#

its sqlite

livid lichen
#

oh

quartz kindle
#

whats the error you're getting?

livid lichen
#

How many errors should I show?

quartz kindle
#

all of them

#

if the error happens during installation, show the entire install log

livid lichen
#

I have to edit it then because it has my name in a bunch

#

Oh okay

#

oh my god it has a lot of my name.

pearl trail
livid lichen
#

Just found out It's no longer supported and it's enmap not npm.

thick gull
livid lichen
#

It's giving an error that it can't find bin.js

#

and python

#

rror: Cannot find module 'C:\Users\prebuild-install\bin.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:747:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

#

that was the first error

drifting wedge
#

how can i slice off the first character of a var?

#

python

#

and how do i like check for the first character?

quartz kindle
#

@livid lichen open powershell as administrator, and run npm install -g windows-build-tools

drifting wedge
#

i know how splicing works

#

just dont know this, ive googled

#

and binged it

pearl trail
#

windows christmasthink

quartz kindle
#

and wait until it ways "All Done" (should take around 10-20 mins)

drifting wedge
#

and wait until it ways "All Done" (should take around 10-20 mins)
@quartz kindle remember the domain thing?

#

the amount of check marks are going down,,,

earnest phoenix
#

why opengraph sometimes make my image big and small

#

help me get the icon small

#

provide a smaller image in the og image meta tag

carmine summit
#

Uh

#

Here

livid lichen
#

@livid lichen open powershell as administrator, and run npm install -g windows-build-tools
@quartz kindle Still waiting for installer log file...

carmine summit
#
?eval 
const foo = async () => {
let lowest = 0
await client.guilds.cache.forEach(g => {
if(g.members.cache.size > lowest) lowest = g.members.cache.size
})
message.channel.send(lowest)
}
foo()
#

That finds the guild with most users

livid lichen
#

it's stuck on Still waiting for installer log file...

earnest phoenix
#

just use sort and index the sorted array lol

carmine summit
#

That took me way longer than expected

#

V12 is playing tricks on me

earnest phoenix
#

.sort((a, b) => b.memberCount - a.memberCount)[0]

#

4 loc compressed into 1

carmine summit
#

Im just gon

#

Study that tomorrow

#

Search about .sort

#

Seems interesting

livid lichen
#

@quartz kindle It's been stuck on Still waiting for installer log file... for 5 minuets now. Is it supposed to to that?

earnest phoenix
#

Help, i tried create small widget which show status, but when i paste code to website it becomes big widget

#

read the docs

#

thx

drifting wedge
#

if i do folder.file name

#

does it get the file from the folder?

#

py

earnest phoenix
#

i don't know, does it?

stable eagle
#

coinsData.money += args[0]
why does the number not get added but rather the value put in args[0], get added to the end of the number?

Example:
5000 (before)

5000400 (after)

earnest phoenix
#

because you're saving it as a string

#

don't use json

stable eagle
#

i use mongodb tho

#

money: {type: Number, default: 0}

earnest phoenix
#

oh

#

because args is an array of strings

#

you need to parse the arg as a number

stable eagle
#

ooh

#

im stupid

flint yew
#

Okay gg

earnest phoenix
#

chrome not showing the website icon

quartz kindle
#

website icons should be in the .ico format

earnest phoenix
#

website icons should be in the .ico format
@quartz kindle they can be in png format too i think

quartz kindle
#

for png you need to set it to type="image/png"

earnest phoenix
#

but ico is universally accepted

#

hm

#

or i should use ico maybe

quartz kindle
#

@earnest phoenix check the network tab

#

and reload the page

ivory seal
#

hi I am not able to figure out how to use the JOIN GUILD MEMBERS perm

#

can someone help?

quartz kindle
#

what are you trying to do?

ivory seal
#

i am trying to auto join members with a bot for giveaways

quartz kindle
#

you need to use oauth2 for that

ivory seal
#

ye but i tried searching anymore is the code message.members.guild.join("id)?

quartz kindle
#

there is no code for that

ivory seal
#

uh wdym?

quartz kindle
#

it requires oauth2, libraries do not provide oauth2 features

ivory seal
#

ok then what do i use?

quartz kindle
#

the user needs to "login with discord" in your website, and give you permission to make them join a guild, then your webserver needs to send discord a request

ivory seal
#

oh okay so its web

#

not like a bot exactly

quartz kindle
#

yes, oauth2 is everything that requires the user to login with discord

ivory seal
#

ah okay i saw a bot doing it, it probably is the webserver adding the users and the bot just sending a message

quartz kindle
#

yes, a bot can be connected to a webserver

ivory seal
#

ah okay

#

also is there any way i can get random usernames of members

quartz kindle
#

random usernames?

earnest phoenix
#

He mean

#

Get random member from guild, and get that member username

quartz kindle
#

if thats what he means, then yes, fetch all members, then chose a random one

ivory seal
#

ye thats what i mean

#

is it possible

#

and if yes any links or reference for that?

quartz kindle
#

in discord.js its guild.members.fetch()

#

discord.js also gives you collection.random() i believe

solemn leaf
#

hewlo guysss hovv can i make it owoify evewything?

earnest phoenix
#

@solemn leaf my bot already did that, but eh, you need to replace spefic text

#

@sand dune just uh

#

Get random member from guild, and send that member username

solemn leaf
#

@earnest phoenix ?

#

this should turn into 4 v

earnest phoenix
#

.replaceAll

solemn leaf
#

text = text.replace("w", "vv").replace("love", "luv").replace("lol", "lul").replace("l", "w").replace("r", "w").replace("!", "!!!");

earnest phoenix
#

Qait

#

@solemn leaf use regexp

solemn leaf
#

.raplaceAll() is a thing

#

is it npm

earnest phoenix
#

.replaceAll doesnt exist in javascript

#

@quartz kindle pog

solemn leaf
#

Haypetr/

earnest phoenix
#

oh

#

my

#

god

quartz kindle
#

.replaceAll() does exist, its a new thing

earnest phoenix
#

@quartz kindle since?

#

ES2020?

quartz kindle
cinder patio
#

Totomatee, you need to do .cache.random()

quartz kindle
#

ES2021

earnest phoenix
#

.random isn't a thing

#

bruh

quartz kindle
#

collections do have a random, no?

earnest phoenix
#

what

#

i am dumb

#

fuck

quartz kindle
earnest phoenix
#

i am

#

so fucking dumb, sorry

carmine summit
#

WTF replaceAll() is now a thing???

#

SINCE WHEN??

earnest phoenix
#

ES2021

carmine summit
#

Yep, its a lie

#

Just tried it with eval

quartz kindle
#

its not a lie

#

its just not released yet

#

it was added in v8 8.5

#

node.js 14.6+ is still on v8 8.4.3

#

should work on the broweser tho

cinder patio
#

You can use regex to replace all instances of a string anyways

quartz kindle
carmine summit
#

Holy cow, its really a thing

#

Im just gon wait forever for it to be released

cinder patio
thin turret
#

Does it replace all occurances of a string?

quartz kindle
#

yes

#

its the same as using regex with the g flag

#

but probably faster

carmine summit
#

That does g do?

#

Global

cinder patio
carmine summit
#

Ok

quartz kindle
#

actually no, according to jsben.ch the regex method is faster lmao

thin turret
#

I still need to learn regex

sudden geyser
#

also if you're replacing via user input .replaceAll would probably be better

#

Yes.

earnest phoenix
#

Is it possible to make Mobizen only record the phone sound and not the microphone. It records them both currently.

thin turret
#

It used to be an option

#

But recording internal audio on android is currently against TOS iirc

#

So it has to be both for now

earnest phoenix
#

dear google,

fuck you for not allowing us to record only internal sound

sincerely,
ME

#

I'm just gonna plug my dad's earphone in my phone and record
The microphone doesn't work anyways

faint prism
#

@faint prism yes i need to round numbers this is mesnt for whole numbers
@polar sigil ok, but you're telling your computer to round a whole number to a whole number.
You see why that doesn't make sense, right?

earnest phoenix
#

I still need to learn regex
@thin turret i don't because i don't manipulate strings 🙂

thin turret
#

I'm just gonna plug my dad's earphone in my phone and record
The microphone doesn't work anyways
@earnest phoenix if you have an aux cable and a pc you can use audacity

earnest phoenix
#

I have no money to buy Among Us on pc 😭

thin turret
#

L

earnest phoenix
#

get it cracked

#

L
@thin turret L?

#

fr though it's a unity game, super simple to crack

thin turret
#

L as in Loss, another way to say rip

earnest phoenix
#

get it cracked
@earnest phoenix I know how but I pirate nothing other than marvel movies and Minecraft

thin turret
#

"I took an L in basketball today"

earnest phoenix
#

"I took an L in basketball today"
@thin turret you sent the ball flying in one straight line then it suddenly took a ninety degree turn and started going in a straight line in that direction???

thin turret
carmine summit
#

var mongoDB = 'mongodb+srv://no:no@database.knta7.gcp.mongodb.net/Database?retryWrites=true&w=majority';
mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true});

var db = mongoose.connection;

db.on('error', console.error.bind(console, 'MongoDB connection error:'));```
hmmmm
shy steeple
#

==== JS stack trace =========================================

0: ExitFrame [pc: 0162A017]

Security context: 0x26740469 <JSObject>
1: new User(aka User) [3CA4B4AD] [C:\Users\dalia\Desktop\Adventure RPG\Adventure RPG\node_modules\discord.js\src\structures\User.js:~20] [pc=63B8296B](this=0x2d9002f5 <the_hole>,0x04e856ad <EventEmitter map = 169C5155>,0x22f12fc5 <Object map = 476B8C0D>)
2: ConstructFrame [pc: 015B8D22]
3: new GuildMember(aka GuildMember) [25300505] [C:\Users\dalia\Desktop...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0118BE3A v8::internal::Heap::PageFlagsAreConsistent+3050
2: 01182580 v8::internal::Heap::CollectGarbage+1200
PS C:\Users\dalia\Desktop\Adventure RPG\Adventure RPG>

carmine summit
#

Wtf

shy steeple
#

anyone know this

carmine summit
#

Go buy VPS

#

Ffs

shy steeple
#

i am on a vps

#

ffs

carmine summit
#

Not sure on that one

shy steeple
earnest phoenix
#

that seems like you're on your pc

shy steeple
#

waitt

carmine summit
#

Yep

earnest phoenix
#

dumb question

carmine summit
#

var mongoDB = 'mongodb+srv://no:no@database.knta7.gcp.mongodb.net/Database?retryWrites=true&w=majority';
mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true});

var db = mongoose.connection;

db.on('error', console.error.bind(console, 'MongoDB connection error:'));```
hmmmm

Works fine till i restart the bot and loose all data

slender thistle
#

PyQt5
How does one change positions of objects on the dialog form relatively to the window itself? The tricky thing here is, I want to adjust object positions when the window is resized.

faint prism
#

Oh shit. Microsoft bought npm? what?

earnest phoenix
#

js is even more of a meme now

faint prism
#

Has like 50 some vids

reef carbon
#

One I install the lavalink.jar file, what do I do next? Can I start coding or do I need to move the lavalink file?

quartz kindle
#

you plant a flower in the jar and water it everyday

stable eagle
#

How can I delete a document in mongodb?

earnest phoenix
#

How can I delete a document in mongodb?
@stable eagle <collection>.deleteOne("documentname"); iirc

slender thistle
#

Documents don't hve names

#

the param is a JSON to filter by

trim saddle
#

@stable eagle mongoInstance.db(yee).collection(haw).deleteOne({"key": "value"})

carmine summit
#

Is there a forEach each character in a string?

sonic lodge
#

since strings are iterable, you can turn the string into an array of characters with [...string] and use forEach on that

stable eagle
#

Typerror: custom.deleteOne is not a function

earnest phoenix
#

w h a t

carmine summit
#

I think the best way is to .split() it

trim saddle
carmine summit
#

WDYM

sudden geyser
#

You shouldn't use .split to iterate over a string imo.

#

You may end up iterating over some unexpected characters.

carmine summit
#

Yeah true

#

How do I do [...string]

sonic lodge
#

you get an array of characters, which you can use forEach on directly

carmine summit
#

Yeah, but how do I do it?

sonic lodge
#
const string = 'abc';
[...string] // ['a', 'b', 'c']```
carmine summit
#

["abc".string]

#

Ahhh

#

Ok

#

I get it now

#

[...str]

quartz kindle
#

or just use a for...of loop

earnest phoenix
#

@quartz kindle why would you need a for loop to split up a string into an array of it's characters

quartz kindle
#

he wanted to split in order to loop over them

restive furnace
#

why not just use <str>.split(/ +/g)?

#

i know it's slower, but if you're doing a discord bot

#

then you know the reason

earnest phoenix
#

we dunno

quartz kindle
#

the original question was

Is there a forEach each character in a string?

earnest phoenix
#

the original question was
Is there a forEach each character in a string?
@quartz kindle bruh
forEach each

character
it's a function

#

that guy doesn't know how js works iirc

quartz kindle
#

wat

earnest phoenix
#

lol

quartz kindle
#

he wanted a string.forEach, like "abc".forEach(character => console.log(character)) // a b c

#

there is no string.forEach, but there is for(character of string)

earnest phoenix
#

there is a string.forEach iirc

#

wat

quartz kindle
earnest phoenix
#

there is not

#

what would you guys recommend doing for getting the voted users for your bot on top.gg

#

hasVoted method might not be optimal to execute every x seconds

#

adding the ids to a set was my idea

#

buy getVotes()

#

but then I don't know when to remove them exactly

quartz kindle
#

webhooks

earnest phoenix
#

use the webhook feature

#

lol

quartz kindle
#

lol

elder ledge
earnest phoenix
#

you can't add buttons

restive furnace
#

Have heard of line breaks?

#

\n

elder ledge
#

I added 1 but

restive furnace
#

and why not use description if you're not gonna add title for the field?

opal plank
#

@elder ledge you cant add links in field name

earnest phoenix
#

webhooks
@quartz kindle can you explain to me how they work

solemn latch
earnest phoenix
#

yes

solemn latch
#

they are explained on the docs

earnest phoenix
#

but can i also see when a user's vote expired

restive furnace
#

after 12 hoirs

#

12 hours*

solemn latch
#

^

earnest phoenix
#

but what i a load my bot

#

when someone voted 6h ago

solemn latch
#

typically you use a database to store that info

earnest phoenix
#

then i cant set a timeout to delete their id from a set or something after 12h

solemn latch
#

and databases can self delete things that happened after 12 hours

#

or 6 hours, or 1 year or whatever

earnest phoenix
#

ok 1 last question

#

how do i automatically delete it after 12h from a databse

#

with mongoose

drifting wedge
#
TypeError: on_message() missing 1 required positional argument: 'message'```
#

python

#

error for on message

opal plank
#

@earnest phoenix im fairly certain you could just add a timeout on your code to delete it tbh

solemn latch
#

I would do it through the database

opal plank
#

unless you bot keeps going down, it wont be an issue

slender thistle
#

Alright what the fuck is going on with your code 0Exe

opal plank
#

otherwise you could run a query where timestamp + 12h < date.now every hour or so

slender thistle
#

What does your on_message event look like

quartz kindle
drifting wedge
#

What does your on_message event look like
@slender thistle 1 sec

#
    async def on_message(self, ctx, message):```
#

there

slender thistle
#

ctx

#

why

#

ctx

#

why

#

You don't get a context object in on_message

drifting wedge
#

i do a lot

slender thistle
#

commands get a context object, on_message events don't

drifting wedge
#

so... i give them xp, run a thing to give them coins

#

and i check for message content

#

lemme try

dim sandal
#

Hi

solemn latch
#

hello

empty hollow
#

I have my bot on heroku and it is literally 24/7 but my bot has just been rejected for the reason that it is offline for a long time, I do not understand why it happens I have other programming partners and they claim that the bot is 24/7 even I have seen my bot 24/7. I think it is an error and I ask for help, why does this happen? 3:

compact oriole
#

well it still was offline

#

so you have to add it to the queue again

#

time to wait 2+ months

solemn latch
#

🤔

#

doesnt heroku only provide service for 27 days out of a month or something

#

on the free plan

compact oriole
#

yea if no card

#

also heroku cringe

empty hollow
#

so... What cloud do you recommend for my discord.js bot?

solemn latch
#

i reccomend any decent vps

#

I use galaxygate, but Digital ocean is good too

empty hollow
#

ohhh

#

okok

compact oriole
#

yea vps ftw

earnest phoenix
#

Hiya im having a bit of a problem. It says all servers are full also I cant make my own host.

empty hollow
#

Thanks for the help, I am something new in this KEKW

compact oriole
#

ye gl

#

vps will be up basically 24/7

solemn latch
#

what servers are full 🤔

compact oriole
#

of course the server might crash, but it will reboot

blissful coral
#

Use galaxy gate

#

Really good one

empty hollow
#

okaa

earnest phoenix
#

fuck off

#

thank you

solemn latch
#

mods so fast

blissful coral
#

Fr fr

#

Posted everywhere

pastel temple
#

does on_message(message) only look at user messages and not bot messages?

sudden geyser
#

any message

#

so yes, both of those

blissful coral
#

Any message, if you want to remove bot messages just make sure it has a filter for bots

#

I don’t know what if statements are in python so

drifting wedge
#

guild_id = message.guild.id

#

how can i get the guild id without ctx?

blissful coral
#

Ctx?

drifting wedge
#

yea, its on message

#

so no ctx

solemn latch
#

isnt that what you just did

#

message.guild.id

blissful coral
#

^

#

That returns the id

#

Don’t see what’s wrong with that

drifting wedge
#

i dont thnik it works

#
AttributeError: 'img' object has no attribute 'guild'```
blissful coral
#

That’s not where the error is

solemn latch
#

the docs say message.guild exists

blissful coral
#

Because it does

#

His error is not right there

#

Unless he is sending a image

#

Which would make no sense either

#

Because it is still a message

solemn latch
#

yeah, i dont know py errors

#

but i thought it was saying img type

blissful coral
#

Nor do I but I can see this is correct code

#

Lol

solemn latch
drifting wedge
#

its the class name

#

@blissful coral @solemn latch

solemn latch
#

img is?

drifting wedge
#

yes

#

i just changed it so it makes more sernse

solemn latch
#

but its Message

#

you can change class names on libs in py?

drifting wedge
#

well ita a cog

blissful coral
#

Py is so weird

solemn latch
#

yeah 🤷‍♂️

blissful coral
solemn latch
#

seems like it makes things harder tbh

drifting wedge
#

guild_id = message.guild.id
AttributeError: 'img' object has no attribute 'guild' just ignore the img

solemn latch
#

can you show where you changed the class name?

blissful coral
#

^

solemn latch
#

just outa curiosity really

blissful coral
#

What class name did you change

drifting wedge
#
    def __init__(self,client):
        self.client = client```
#

i changed it from img to lvl

solemn latch
#

you changed img to level?

#

or message to img?

blissful coral
#

?

drifting wedge
#
    client.add_cog(lvl(client))```
blissful coral
#

I’m so confused lmfao

#

What is lvl

drifting wedge
#

so where it says lvl

#

it was image

solemn latch
#

okay, but where did you change message to img

drifting wedge
#

thats what the 'img' obje came from

#

i didnt

blissful coral
#

What is message then

#

??

solemn latch
#

then the error is something else?

blissful coral
#

I’m so confused at this point

#

The error is not that

drifting wedge
#
    async def on_message(self, message):```
blissful coral
#

Has to be something else

solemn latch
#

I think a py dev will have to answer this, because im lost christmasthink