#development

1 messages · Page 1200 of 1

eternal osprey
#

is just annoying

earnest phoenix
#

azerice bilen biri bana botum için yardım edebilirmi

eternal osprey
#

i agree with that bud

sinful belfry
#

-notr @earnest phoenix

gilded plankBOT
#

@earnest phoenix

İngilizceden başka dillerde sohbet etmek için #memes-and-media kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.

earnest phoenix
#

ok

lament rock
#

There will be many trials to get to be a competent developer and unfortunately, being a developer is a vicious cycle of self deprivation due to questioning your own knowledge but don't dwell on it too long.

Try again tomorrow or the day after depending on when you get inspiration. Things will most likely cool down by then.
@eternal osprey

opal plank
#

being a developer is jsut that, sitting infront of a problem and solving it

#

and then creating 5 other problems whilst solving 1 TogaSmile2

chrome robin
#

hi

misty sigil
#

Please Don't Say Just Hello In Chat

2010-07-19 12:32:12 you: Hi
2010-07-19 12:32:15 co-worker: Hello.
## CO-WORKER WAITS WHILE YOU PHRASE YOUR QUESTION
2010-07-19 12:34:01 you: I'm working on [something] and I'm trying to do [etc...]
2010-07-19 12:35:21 co-worker: Oh, that's [answer...]```
chrome robin
#

I have a problem with overwrites here are the errors

misty sigil
#

code?

chrome robin
eternal osprey
#

why is thi not possbile

#

i get this back:

#

Weather for Union Square Park, CA
Weather Type: Cloudy

misty sigil
#

try{}catch(){}?

eternal osprey
#

i have changed up my code a bit

#
onst Discord = require('discord.js');
const bot = new Discord.Client();
const weather = require('weather-js'); 


const prefix = '$PO '; 


bot.on('message', message => {

    
    let msg = message.content.toUpperCase(); 
    let sender = message.author; 
    let cont = message.content.slice(prefix.length).split(" "); 
    
    
    
    if (msg.startsWith(prefix + 'WEATHER')) { 
        
        if ( message.channel.type === 'dm') {
            return message.reply('I can\'t execute that command inside DMs!');
        }

        weather.find({search: 'California' + 'Union Square', degreeType: 'C'}, function(err, result) { 
            if (err) message.channel.send(err)

     


            
            if (result === undefined || result.length === 0)
            return message.channel.send("**Invalid** location");

           
            var current = result[0].current; 
            var location = result[0].location; 

            
            const embed = new Discord.MessageEmbed()
                .setDescription(`Weather Type: **${current.skytext}**`) 
                .setAuthor(`Weather for ${current.observationpoint}`) 
                .setThumbnail('https://media.giphy.com/media/CKsIi206Ntz4k/giphy.gif')
                .setColor('#FF0000') 
                

                 message.author.send({embed});```
lament rock
#

is Union Square Park a place in CA or NY?

eternal osprey
#

CA

lament rock
#

Oh ok. What kind of data are you expecting?

eternal osprey
#

i am expecting that the bot will give me the weather types of both selected places

#

but that seems to be now working

#

it just selects 1

lament rock
#

Well, Cali is a big state so weather varies

eternal osprey
#

i now changed it to germany and union square

#

once again

#

it only return info of germany

#

i mean

#

is the problem in my embed?

lament rock
#

for multiple places, you'd have to make multiple API calls or if you read the API supports multiple place selection then it would be your implementation

eternal osprey
#

how do i make multiple api calls?

lament rock
#

multiple instances of the weather.search function

#

1 for each place

eternal osprey
#

yeah i tried that

#

but it gave me lots of errors

#

remember?

lament rock
#

I do

#

I'm not sure if what you want to do the way you want to do it is possible.

eternal osprey
#

is there any other way to get the weather types of different countries?

#

cuz weather-js sucks

#

or i am just stupid

lament rock
#

Try and see if there's other weather api modules on npm

eternal osprey
#

openweathermap?

lament rock
#

What URL does it request data from? Does it have the features you want?

eternal osprey
#

can't i just scrape the data of a site

#

insstead of using apis?

lament rock
#

You could

#

but I feel like scraping HTML is more difficult than GETting data from an api

eternal osprey
#

but the problem is that i can't find any good api to use

lament rock
#

Then scraping is probably a good way to go about things then

eternal osprey
#

btw, thanks for sticking around with me.

lament rock
#

I have to scrape Spotify to do some things GWshikizPersianDerp

eternal osprey
#

really appreciate the help

#

okaym good luck!

lament rock
#

Not a problem

#

No. I was stating that my bot scrapes Spotify to do some things not I have to go do that rn

eternal osprey
#

owhhh

tired gate
#

how do bots make it so certain features are only able to be done after you vote for the bot?

lament rock
#

They implement the webhook feature top provides then stores the data from that webhook for however frequently you're able to vote

earnest phoenix
#

is postgresql sql?

#

cuz

#

but the problem is that i can't find any good api to use
@eternal osprey why not use @lament meteor's api

lament rock
#

yes. Reading the intro to PostgeSQL says that it uses and extends the SQL language

earnest phoenix
#

she's got an awesome api

#

yes. Reading the intro to PostgeSQL is that it uses and extends the SQL language
@lament rock SQL sucks tho

eternal osprey
#

where

lament rock
#

It depends what you're using it for and your data set sizes. I use SQL based solutions for certain things and Redis for other stuff

#

SQL is also what I learned initially so I'm biased to using it and trying to optimize queries

eternal osprey
#

@earnest phoenix where is that api?

lament meteor
eternal osprey
#

yeah there isn't a weather api

lament meteor
#

i c

#

i can add one

eternal osprey
#

please do that if you could!

#
const Discord = require('discord.js');
const bot = new Discord.Client();
const weather = require('weather-js'); 


const prefix = '$PO '; 


bot.on('message', message => {

    
    let msg = message.content.toUpperCase(); 
    let sender = message.author; 
    let cont = message.content.slice(prefix.length).split(" "); 
    
    
    
    if (msg.startsWith(prefix + 'WEATHER')) { 
        
        if ( message.channel.type === 'dm') {
            return message.reply('I can\'t execute that command inside DMs!');
        }

        weather.find({search: 'Germany', degreeType: 'C'}, function(err, result) { 
            if (err) message.channel.send(err)

            weather.find({search: 'California', degreeType: 'C'}, function(err, result) { 
                if (err) message.channel.send(err);


            
            if (result === undefined || result.length === 0)
            return message.channel.send("**Invalid** location");

           
            var current = result[0].current; 
            var location = result[0].location; 

            
            const embed = new Discord.MessageEmbed()
                .setDescription(`Weather Type: **${current.skytext}**`) 
                .setAuthor(`Weather for ${current.observationpoint}`) 
                .setThumbnail('https://media.giphy.com/media/CKsIi206Ntz4k/giphy.gif')
                .setColor('#FF0000') 
                

                 message.author.send({embed});```
#

i am literally losing my mind

#

right now

lament rock
#

did you make sure to balance your })

lament meteor
#

^

eternal osprey
#

i guess so

#

yes

#

everything is connected

lament meteor
#

i only get that error on one liners

lament rock
#

mmm. What helps is having a consistent tab style so you can easily identify mismatched brackets or parentheses

earnest phoenix
#

bruh

#

judt

#

RESET THE TOKEN AND SHOW THE CODE WITH THE OLD OBE

lament meteor
#

smh....

lament rock
#

Stop.

earnest phoenix
#

@eternal osprey

lament meteor
#

bruh

eternal osprey
#

no

#

it doesn't expose anything

lament meteor
#

if it is just a string why

earnest phoenix
#

???

#

just

#

show the line of code

eternal osprey
#

everyone knows the end of your discord bot

#

no

earnest phoenix
#

and reset the tokeb after sendibg

eternal osprey
#

it is not that exciting

earnest phoenix
#

if you don't trust us then

lament meteor
#

😩 it doesnt change anything thou

#

there is legit nothing more to see

earnest phoenix
#

^

eternal osprey
lament meteor
#

hmm i wonder if it is just vsc being stupid

earnest phoenix
#

the hell

#

WHAT THE FUCJ

lament rock
#

vsc is never stupid when it comes to syntax errors. Only using implicit project typescript checking

eternal osprey
#

@earnest phoenix what are you talking about?

earnest phoenix
#

the whole code is correct

eternal osprey
earnest phoenix
#

hover over the red line

lament meteor
#

@lament rock idk it once just fuck up everything i wrote

earnest phoenix
#

it's not vsc dying

eternal osprey
lament rock
#

Oh. That's probably the issue. What does that last ); balance with

earnest phoenix
#

it's typesceipt

#

@eternal osprey show the lines 19 and 10

#

or judt

#

throw all your code on hastebin

eternal osprey
#

okay sure

lament rock
#

I guess you don't have closing curly brackets for those lines. It doesn't match with anything

eternal osprey
torpid bloom
#

Pls bal

earnest phoenix
#

the hell

#

@torpid bloom you've been told in #support to goto testing channels

torpid bloom
#

Ahh

#

Lol

#

Testing btw

lament meteor
#

ur missing brackets @eternal osprey

eternal osprey
#

really?

#

where

lament meteor
#

below

eternal osprey
#

below?

lament meteor
lament rock
lament meteor
#

those are the only closed brackets

eternal osprey
#

owh i should add one bracked

lament meteor
#

close the if statment and the listener

earnest phoenix
#

Found the errors

#

embed????

eternal osprey
#

i have many if statements

earnest phoenix
#

message.channel.send({embed});

#

not a valid object

lament rock
#

Please stop trying to help if you don't know what you're talking about

eternal osprey
#

i just wanted to say

#

wtf are you talking about

earnest phoenix
#

should be message.channel.send({embed: theVariable});

lament rock
#

that is a valid MessageOptions Object

lament meteor
#

^

eternal osprey
#

what

earnest phoenix
#

no

lament rock
#

the property inherits the variable name so it's short hand for {embed: embed}

lament meteor
#

@eternal osprey why do u hv a weather find function in a weather find function?

lament rock
#

instead, it can just be {embed} and that would be valid @earnest phoenix

eternal osprey
#

i tried to search 2 different places/countries

lament meteor
eternal osprey
#

within 1 command

lament meteor
#

i mean u only hv the second and first weather func

eternal osprey
#

okay i get it!
and it works

#

however

#

it only calls the 2nd weather.find

#

instead of both

#

and i remembered

#

i had to assign it different variables?

lament rock
#

did you assign the result of both to separate variables and then use both of those variables in the embed

eternal osprey
#

i have assigned both to 1 variable

lament rock
#

you cannot do that

eternal osprey
#

okay

#
weather.find({search: 'Germany', degreeType: 'C'}, function(err, result1) { 
            if (err) message.channel.send(err)

            weather.find({search: 'California', degreeType: 'C'}, function(err, result2) { 
                if (err) message.channel.send(err);


            
            if (result === undefined || result.length === 0)
            return message.channel.send("**Invalid** location")
            
           
            var current = result1[0].current; 
            var location = result1[0].location; 
            var current = result2[0].current; 
            var location = result2[0].location; 
            ```
#

this would be good right?

#

or should i change the var current

#

to current 1

#

and current2

#

too

lament rock
#

you declare current and location twice so you should change those names, yes

eternal osprey
#

ReferenceError: result is not defined

lament rock
#

change your references to result to what you changed the names to

eternal osprey
#
weather.find({search: 'Germany', degreeType: 'C'}, function(err, result1) { 
            if (err) message.channel.send(err)

            weather.find({search: 'California', degreeType: 'C'}, function(err, result2) { 
                if (err) message.channel.send(err);


            
            if (result1 === undefined || result1.length === 0)
            return message.channel.send("**Invalid** location")
            
           
            var current1 = result1[0].current; 
            var location = result1[0].location; 
            var current2 = result2[0].current; 
            var location = result2[0].location; 
            
            const embed = new Discord.MessageEmbed()
                .setDescription(`Weather Type: **${current1.skytext}**`) 
                .setAuthor(`Weather for ${current1.observationpoint}`) 
                .setThumbnail('https://media.giphy.com/media/CKsIi206Ntz4k/giphy.gif')
                .setColor('#FF0000') 
                

                 message.author.send({embed});
                ```
#

i have already done that?

lament rock
#

in this case, result1 and result2

#

what line is the error coming from

eternal osprey
#

no i got it working

#

by changing the error

#

but now i gotta do the same with result2

lament rock
#

Oh lol

eternal osprey
#

can i type this as embed: .setDescription(Weather Type: **${current1.skytext} + ${current2.skytext}**)

lament meteor
#

i guess?

lament rock
#

You don't need to do the + unless that's literally what you want to appear in the text

earnest phoenix
#

big brain

#

🧠

#

of course im being sarcastic

eternal osprey
#

it works

lament rock
#

it'd be more informative to do it like Weather type for 1: (insert skytext for 1)\n
Weather type for 2: (insert skytext for 2)

eternal osprey
#

i want to hug you guys

#

damnnnnn

earnest phoenix
#

thanks

lament meteor
lament rock
#

How you have it is good though. Don't fix it if it isn't broken

earnest phoenix
#

even tho i literally helped with nothing

eternal osprey
#

code913, you are absolutely right'

earnest phoenix
#

XD

lament meteor
#

eh... microoptimizations sometimes add up

lament rock
earnest phoenix
#

wait is that sarcasm

eternal osprey
#

i was talking to @lament meteor and @lament rock

lament meteor
#

depends on what ur trying to achieve

earnest phoenix
#

your status...

#

people are horrible

#

don't code bots even if they are going to pay you

eternal osprey
#

how can i get it like : country :weather type

#

like California : Cloudy

#

@earnest phoenix who says i am offering money my man/

lament meteor
#

use the results and do it systematically

earnest phoenix
#

not that

eternal osprey
#

okay lovely

#

however, my head hurts

#

i ma head out!

lament meteor
#

ok

earnest phoenix
#

Coding discord bots, cheap!

eternal osprey
#

thanks for the help once again

lament rock
#

You'll have to make another embed field and do result1 weather on 1 field then result2 weather on another

eternal osprey
#

@earnest phoenix i just stsrted with javascipt

earnest phoenix
#

embeds are cool

lament rock
eternal osprey
#

who says that i don't know python/

earnest phoenix
#

well then

lament rock
#

quite the leap

eternal osprey
#

okay thanks!

earnest phoenix
#

make a bot in that

eternal osprey
#

bro what are you whining about?

#

i just want to learn javasscript

#

isn't that allowed?

#

if you don't help, do not wirte in the development channel.

earnest phoenix
#

who says that i don't know python/
@eternal osprey i meant that if someone actually asks you to make a bot for them then you'll probably go nuts cuz people are WEEEIRDDDD

eternal osprey
#

ffss

lament rock
#

alright. Let's not get too feisty

earnest phoenix
#

i just want to learn javasscript
@eternal osprey did i complain about anything

eternal osprey
#
make a bot in that```
earnest phoenix
#

you should make a bot in python because you're experienced in it

lament meteor
#

@lament rock did u get that art commisioned?

eternal osprey
#

but i want to learn a new language

lament rock
#

In the words of the tf2 spy, "Drop your weapons and walk away"

#

Yes, Telk

lament meteor
#

time to steal

eternal osprey
#

lovely, i am disarmed 🙂

lament rock
earnest phoenix
#

quoting @misty sigil:

The discordjs.guide website is a great place
BECAUSE IT TELLS YOU TO LEAR ACTUAL JAVASCRIPT BEFORE TRYING TO MAKE A BOT

misty sigil
#

ohly shit

#

it works

#

it fucking works

earnest phoenix
#

sorry for the ping

lament meteor
#

bruh

eternal osprey
#

once again

misty sigil
#

sorry for the ping
@earnest phoenix nah no problem

eternal osprey
#

i am doing javascript for a couple of weekss maybe a month

#

i know quite some things about it

#

i just had a problem with my weather bot

#

maybe easy solutionss

#

but things can happen

earnest phoenix
#

it's still a REALLY TERRIBLE idea to just start with js and try to make a bot in it
but it's your choice so do whatever you wanna do

eternal osprey
#

how do i have to learn then lmao

#

by reading all day?

earnest phoenix
#

yeah

eternal osprey
#

you can learn using different ways

#

i ike to learn while doing it

earnest phoenix
#

docs and courses

#
#

people go 4 years to college for this shit lol

#

lol

#

it took me like four moths to learn js

#

months

#

fuck

eternal osprey
#

i know but i am just trying to make some discord bots and learning by that

earnest phoenix
#

alrighty

#

we'll always be happy to help

eternal osprey
#

everyone has it's one way of learning

#

lovely, thanks for that

earnest phoenix
#

hi, I need help with developing and coding a moderation bot

lament meteor
#

eh tbf projects aint a bad way to learn

earnest phoenix
#

hello world is the most important

#

hi, I need help with developing and coding a moderation bot
@earnest phoenix got any burning questions?

#

like which website do I use to develop the bot etc

misty sigil
#

you use visual studio code

#

or sublime

#

something like that

earnest phoenix
#

you learn to code

misty sigil
#

to host it, you buy a vps

earnest phoenix
#

mk

misty sigil
#

you also have to learn to code

earnest phoenix
#

and ask for help with stuff here

#

thanks guys

#

welcome

#

my biggest pet peeve is when people underestimate programming

#

^

#

parents

#

they underestimate technology

#

so annoying, my parents thought that what i was doing was a waste of time and we were constantly quarrelling until i showed them that i earn money from it

#

me too

#

even tho all my projects are open source non profit fun stuff

golden condor
#

"non profit"

hazy sparrow
#

is there a way to generate a 10 charecter long "code" with both case letters and numbers from 1-9 and 0? eg: aG1as9GjJ0

golden condor
#

yes

hazy sparrow
#

how

golden condor
#

Make a function for it

hazy sparrow
#

that will be kind of long KEKW

golden condor
#

....not really

earnest phoenix
#

loop over an array characters n times where n is the length of your desired string and grab a random char

golden condor
#

^ or a string of chars

lament rock
#

Create an array of characters you wanna use then create a string then do a while an loopCount is < 10, get a random element from the Array and add it to the string and return the string

hazy sparrow
#

could i do like how i did my rock paper scissors code? (if anyone remembers)

golden condor
#

Just use a for loop

lament rock
#

or you can use a package like crypto but no guarantees it'll only contain the characters you want

earnest phoenix
#

uuid mmLol

waxen adder
#

hi i need help

#

const flags = {
DISCORD_NITRO: 'nitro',
DISCORD_EMPLOYEE: 'DiscordEmployee',
DISCORD_PARTNER: 'partner_badge',
BUGHUNTER_LEVEL_1: 'BugHunter',
BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)',
HYPESQUAD_EVENTS: 'HypeSquad Events',
HOUSE_BRAVERY: 'bravery',
HOUSE_BRILLIANCE: ' BrillianceLogo ',
HOUSE_BALANCE: 'BalanceLogo',
EARLY_SUPPORTER: 'early_supporter_badge',
TEAM_USER: 'Team User',
SYSTEM: 'System',
VERIFIED_BOT: '712723044140843111',
VERIFIED_DEVELOPER: 'verified_developer',
SERVER_BOOST: 'boost'
};

#

what is the flag for server boosting and discord nitro ?

#

i couldn't find that

lament rock
#

Those are not included in user public_flags

short cave
#

İ dont have nitro 😦

lament rock
#

you have to get that data from an oauth flow or a user bot to fetch that data but that last one is against Discord TOS

waxen adder
#

serverboost ?

short cave
#

const flags = {
DISCORD_NITRO: ':nitro:',
DISCORD_EMPLOYEE: ':DiscordEmployee:',
DISCORD_PARTNER: ':partner_badge:',
BUGHUNTER_LEVEL_1: ':BugHunter:',
BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)',
HYPESQUAD_EVENTS: 'HypeSquad Events',
HOUSE_BRAVERY: ':bravery:',
HOUSE_BRILLIANCE: ' :BrillianceLogo: ',
HOUSE_BALANCE: ':BalanceLogo:',
EARLY_SUPPORTER: ':early_supporter_badge:',
TEAM_USER: 'Team User',
SYSTEM: 'System',
VERIFIED_BOT: ':712723044140843111:',
VERIFIED_DEVELOPER: ':verified_developer:',
SERVER_BOOST: ':boost:'
};

#

😦

waxen adder
#

i want make userinfo

#

and i want it to show the badges

#

but it won't show server boosting and discord nitro badge

lament rock
#

nitro and server boosting. GuildMembers usually have a boosting since property so you can reverse engineer that date to determine their boosting tier and with that, you can also determine that they have nitro. Or you can check if they have a gif avatar but that's not consistent

waxen adder
earnest phoenix
#

there should straight up be a tier property

lament rock
#

just know that the nitro and boosting tier flags are not available to bots

waxen adder
#

oh

golden condor
#

@waxen adder it's private info you can only get through oauth which the user has to authenticate

lament rock
#

That's unnecessary data since you can determine the tier based on the date

earnest phoenix
#

I so I am kinda new to Developing and coding a Moderation bot can someone help me out?

#

welcome to djs

lament rock
#

Discord sends you the bare minimum

waxen adder
#

oh ok

earnest phoenix
#

djs does a lot of shit for the end user

#

because most of the djs userbase is, well, stupid

lament rock
#

Use micro-services :)

waxen adder
#

ok thx for information

earnest phoenix
#

?

waxen adder
#

like it shows info about tokens or something

summer torrent
#

discord bots cannot access token of another users

waxen adder
#

yea i know but i mean like it shows token info or something

earnest phoenix
#

What kind of bot is that? @waxen adder

waxen adder
#

idk i found it

earnest phoenix
#

oh

waxen adder
#

it can nuke token and ...

#

i didn't use it before

lament rock
#

displaying user email is a breach of privacy and most likely a violation of the TOS but grant tokens provided by oauth can't do that much

#

if that is a grant token

waxen adder
lament rock
#

Oh. You feed that bot the data. Uh. Idk what that would fall under

waxen adder
#

isn't this bot and the dev that made it breaking tos by doing this things

lament rock
#

I'm not sure since the user has to provide the token

waxen adder
#

idk

earnest phoenix
#

it's against the tos because it's api abuse

#

but nuking itself isn't per se

waxen adder
#

oh ok

fringe axle
#

How you can make the member.createdTimestamp clean?

earnest phoenix
#

huh?

fringe axle
#

With date, timezone and things like that?

#

Account creation

earnest phoenix
#

why would you use the timestamp

fringe axle
#

What I can use either?

hazy sparrow
#

how do i get the permissions of a member?

earnest phoenix
#

@fringe axle createdAt

fringe axle
#

Thanks!

earnest phoenix
#

how do i get the roles of a member

#

and remove all of them

#

i tried a lot of ways, but none work 😦

#

in which library

#

rewrite

sudden geyser
#

by rewrite do you mean latest or current stable

sudden geyser
#

If you want to remove every role you can use member.edit() and pass roles as an empty list

fringe axle
#

member.user.presence will return what the user is playing or doing, right?

earnest phoenix
#

check up with the docs

fringe axle
#

I did

#

I'll try it

earnest phoenix
#

from what i can see it returns a presence object

#

presence contains the status and activities

fringe axle
hazy sparrow
#

how do i get all the permissions of a member?

earnest phoenix
#

Wait @sudden geyser So I would do member.edit()

#

await member.edit()

fringe axle
#

I used member.user.presence.game before but it won't worked

sudden geyser
#

bob the function takes kwargs

earnest phoenix
#

ok so do i just leave it blank

sudden geyser
#

You need to pass one for roles. If you pass an empty list all their roles will be removed. you can also check out the links cry gave you

earnest phoenix
#

for example:

roles= []
await member.edit(roles)
fringe axle
#

this object is returned @fringe axle https://discord.js.org/#/docs/main/stable/class/Presence
@earnest phoenix I just want to see what are you doing. Like playing Visual Studio Code

sudden geyser
#

kwargs are like key=value

#

so like role=roles

earnest phoenix
#

ok so roles= None

#

*role=None?

fringe axle
#

Nice.

earnest phoenix
#

@sudden geyser

*role=None?
@earnest phoenix

sudden geyser
#

like I said

If you pass an empty list all their roles will be removed.

try it out and see

hazy sparrow
#

how do i get all the permissions of a member?

earnest phoenix
#

can you just tell me if this code will work?
pls

role=[]
await member.edit(role=role)
#

or is it roles= role

simple stump
#

Hello. How do I check if a target has a certain role? I am creating a "game" and when I check if a user has a certain role, it always thinks that it does. However I believe it's checking if the user who SENT the message has the role (in which case when I tested my code, it did, since people who didn't have the role had the command work), but I want to check if the target has the role. Basically, I have my target sent as this:

let target = message.mentions.users.first() || message.author;

But then I'm getting whether the user has the role using this:

            var role = message.guild.roles.cache.find(role => role.name === "Shielded");
            if (message.member.roles.cache.has(role.id)) {
                message.reply("User has a Shield! Please try again later.");
            }

How do I transfer message.guild.roles.cache.find into my target? If that makes any sense...

fringe axle
earnest phoenix
#

can you just tell me if this code will work?
pls

role=[]
await member.edit(role=role)

or is it roles= role

#

i don't know where to ask this, but, is there some kind of built-in way to store variables to servers? currently, in the script i've written for my bot, any variable that changes in one server (e.g. prefix) changes in every other server the bot is running in as well. i'm hosting the bot myself. is there a built-in way to make the bot store variables to each server or do i have to code in my own way?

#

can you just tell me if this code will work?
pls

role=[]
await member.edit(role=role)

or is it roles= role
@earnest phoenix @sudden geyser

hard kettle
#

i don't know where to ask this, but, is there some kind of built-in way to store variables to servers? currently, in the script i've written for my bot, any variable that changes in one server (e.g. prefix) changes in every other server the bot is running in as well. i'm hosting the bot myself. is there a built-in way to make the bot store variables to each server or do i have to code in my own way?
@earnest phoenix if u can afford then paid databases, if u cant then free databases or hosting the files on ur own pc

golden condor
#

@fringe axle try .join(", ")

earnest phoenix
#

@fringe axle try spacing it out? so instead of activity1,activity2,activity3 have it with spaces ^

fringe axle
#

Yes

#

Okay

sudden geyser
#

bob like I said, try it out and see. I'm just going off the documentation and it looks like it would remove all roles from the member. Please stop constantly pinging me. notLikeKomi

fringe axle
#

Nice! Any idea for a presence card?

hazy sparrow
#

How do I transfer message.guild.roles.cache.find into my target? If that makes any sense...
message.author.roles.cache.find() works for me @simple stump

earnest phoenix
#

ok i am sry

#

😦

golden condor
#

gonna make an actual card with canvas and stuff or just an embed? @fringe axle

simple stump
#

Alright. I'll try that

#

Thanks

fringe axle
golden condor
#

No it was made by that guy

fringe axle
#

okay, oof.

#

Canvas

golden condor
#

You need to use canvas to make that

#

I don't have much experience with canvas so I can't really help

fringe axle
#

Me and Canvas = No.

#

Me too. xD

hazy sparrow
#

is canvas hard to learn

golden condor
#

Well I've never needed to use it, so I haven't

hazy sparrow
#

and for the fourth time, how do i get all the permissions of a member?

golden condor
#

member.permissions

hazy sparrow
#

ty

#

member.permissions
@golden condor it just returns [object Object]

quartz kindle
#

you cant send objects

#

you need to serialize them

plush magnet
#

Hey Tim us your last name tam

#

Tim tam

#

Haha

#

British humour

quartz kindle
#

lmao

hazy sparrow
#

you need to serialize them
@quartz kindle for example?

quartz kindle
#

the most basic way of serializing an object is using JSON

#

JSON.stringify(object)

#

but in this case, the permissions object has a few built in methods

hazy sparrow
#

got it, thanks tim

opaque eagle
#

Do you guys know of a registrar that offers .sh domains

digital ibex
#

im confused with that... confusion, extending the text channel class but its never gonna be user, maybe text channel base?

misty sigil
#

how do i server deafen my bot

loud tangle
#

hey, how would you check your bot has permissions in an on_message? discord.py, or get your bots ID in the specific guild.

#

Do you guys know of a registrar that offers .sh domains
@opaque eagle

simple stump
#

I have multiple issues. I am trying to remove a role from an user after x amount of seconds. So in this case, I want to remove a role after 24 hours. I put the time stamp into a table (which works), then I want to check if that time is <= to the current time, but then add a time after that. So basically:

if (row && row.time + 120000 <= ts) {
  // Remove role
}

However, when I do that, the bot thinks that row.time + 120000 is the time stamp (lets say, 1234567) but then appends 120000 to the end. So then the time becomes 1234567120000. So this is a stupid question:
How do I add 120000 to row.time (the time stamp in the database)?
Second question (I already posted this, however message.author.roles.cache.find() doesn't seem to work):
How do I check if a target has a certain role? I am creating a "game" and when I check if a user has a certain role, it always thinks that it does. However I believe it's checking if the user who SENT the message has the role (in which case when I tested my code, it did, since people who didn't have the role had the command work), but I want to check if the target has the role. Basically, I have my target sent as this:

let target = message.mentions.users.first() || message.author;

But then I'm getting whether the user has the role using this:

            var role = message.guild.roles.cache.find(role => role.name === "Shielded");
            if (message.member.roles.cache.has(role.id)) {
                message.reply("User has a Shield! Please try again later.");
            }

How do I transfer message.guild.roles.cache.find into my target? If that makes any sense...

Code: https://hatebin.com/dkqhyzbjpe

quartz kindle
#

@digital ibex yes its supposed to be TextBasedChannel

#

i'll fix it soon

sudden geyser
#

How do I add 120000 to row.time (the time stamp in the database)?
@simple stump is row.time a string?

simple stump
#

Yes

sudden geyser
#

Then that's probably the issue. If you want to add X int to another int they need to be the same type, else JS will treat it like string concentration

simple stump
#

I have tried putting 120000 in quotes. Would that help?

#

Sorry these are stupid questions. I don't do JS dev lol

sudden geyser
#

You need to convert row.time to a number

#

You can use parseInt(theString, 10) for that for example

#

How do I check if a target has a certain role?
I think the issue is your if statement (message.member.roles.cache.has(role.id)). You're checking the member who sent the message (message.member). You can replace it with target instead so it uses either the mentioned user, or yourself if no one was mentioned.

The reason your first attempt didn't work (message.author.roles.cache.find(...)) is because message.author is a User instance. You can only check a user's roles on a GuildMember instance. message.member is a GuildMember instance.

So, in conclusion, replace message.mentions.users with message.mentions.members and message.author with message.member if you want to search for the guild member rather than the user in general.

simple stump
#

Ohh I see. Thanks so much 🙂

earnest phoenix
#

What is the discord nitro counterpart at user.flags.

#

ex: const flags = {
DISCORD_EMPLOYEE: 'Discord Employee',
DISCORD_PARTNER: 'Discord Partner',
BUGHUNTER_LEVEL_1: 'Bug Hunter (Level 1)',
BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)',
HYPESQUAD_EVENTS: 'HypeSquad Events',
HOUSE_BRAVERY: 'bravery01',
HOUSE_BRILLIANCE: 'brilliance01',
HOUSE_BALANCE: 'balance01',
EARLY_SUPPORTER: 'Early Supporter',
TEAM_USER: 'Team User',
SYSTEM: 'System',
VERIFIED_BOT: 'onaylibot01',
VERIFIED_DEVELOPER: 'onaylideveloper01'
};

#

how can i add nitro to discord. badges

sudden geyser
#

I don't think there is one for nitro.

pale vessel
#

no unless you selfbot

opal plank
#

selfbot

pale vessel
#

ah yes

opal plank
#

use selfbot to query and send it to main bot node process, 300iq no one will ever know

#

🧠

#

||if it wasnt obvious, im joking, dont selfbot||

#

though sometimes i do get the idea of doing shit like that

sudden geyser
#

You could use some hacky ways of checking if a member has nitro, such as if their avatar is a gif or if they're boosting the server but imo I'd rather leave it out than have some left out.

opal plank
#

accessing non bot endpoints like message indexes, accounts linked to x user, flags, that kind of shit

#

i wouldnt have to do any of my oauth crap if i could simply check the accounts linked to a user

earnest phoenix
#

userbotting would've been allowed if people hadn't used them to raid servers

jovial nexus
#
 Error: Could not find player config
at exports.getBasicInfo (/app/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:59:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Object.exports.<computed> [as getBasicInfo] (/app/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:296:18)
at async exports.getFullInfo (/app/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:187:14)
at async Object.exports.<computed> [as getFullInfo] (/app/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:296:18)```what does that mean?
earnest phoenix
#

I need help with coding and developing a moderation bot I am stuck on it

fringe axle
#

How can I get the clients volume?

earnest phoenix
#

@earnest phoenix libary, error.

#

@fringe axle libary?

#

Discord.js

#

@earnest phoenix

#

Error?

fringe axle
#

@fringe axle libary?
@earnest phoenix discord.js v12

earnest phoenix
#

@fringe axle brb gotta do some research

fringe axle
#

Okay

earnest phoenix
#

@fringe axle by volume, i assume volume in vc?

fringe axle
#

Yes

earnest phoenix
#

And by vc, i assume its dispatcher?

fringe axle
#

Yea

earnest phoenix
#

Its right there

fringe axle
#

Oh

#

Thanks

floral creek
#

need help

#

dosent work the part of

def imagefromURL(url, stream=False): 
    return Image.open(BytesIO(get(url, stream=stream).content))
#

@radiant kraken

earnest phoenix
#

@floral creek whats the website supposed to do?

floral creek
#

click it

earnest phoenix
#

mk

radiant kraken
#

what's the error @floral creek

floral creek
#

Theres no errors

#

xd

radiant kraken
#

oh ok

earnest phoenix
floral creek
#

thats my code

earnest phoenix
#

@faint prism this might interest you, it's .net core and node.js working together ^

faint prism
#

I'll check it out

restive willow
#

thats pretty cool

faint prism
#

Is that your own client?

earnest phoenix
#

the minecraft one? that's just forge, the bedwarsstats overlay is its own app

#

it has always on top enabled

restive willow
#

this dudes played 2000 games of bed wars

earnest phoenix
#

i used to tryhard that shit lool

faint prism
#

The black overlay window is what you're referring to?

earnest phoenix
#

correct

#

my main motive for the app is that there's a dude charging for this, a monthly subscription for an app like this with less customization

restive willow
#

hey, i mean, if theres demand for it might as well charge

earnest phoenix
#

i wanted to make a better and a free alternative

faint prism
#

I can get behind that lol

#

Is it open source?

earnest phoenix
#

closed source

#

i don't wanna deal with open source licensing

#

whatsup gamers

faint prism
#

Free but not FOSS?

earnest phoenix
#

yeah

faint prism
#

There is a website that's dedicated to help you picking a license that fits

#

It makes it really easy it's just check boxes

#

Like MIT for example

slender thistle
#

MIT ftw

faint prism
#

Jinx

slender thistle
restive willow
#

whats the site?

earnest phoenix
#

yeah i saw, github does it too however i'm mainly considered about people stealing some parts and then charging for something that should be free again

#

even with credit

faint prism
#

even with credit
@earnest phoenix The GNU GPLv3 also lets people do almost anything they want with your project, except distributing closed source versions.

earnest phoenix
#

interesting

#

might discuss it with the rest of my contribs

faint prism
#

Also, I'm interested in seeing the source :)

having it open source means that other people can contribute via pull requests as well, and you might end up with some useful community features you otherwise wouldn't have implemented

earnest phoenix
#

i wish there were more resources on makign scalable discord bots

faint prism
#

i wish there were more resources on makign scalable discord bots
@earnest phoenix I designed mine pretty scalable using SOLID design principles

earnest phoenix
#

like?

faint prism
#

If that's what you mean

earnest phoenix
#

wdym solid design principles

faint prism
earnest phoenix
#

right but how does that translate to code

faint prism
#

It's just design patterns that allow your project to be more maintainable

earnest phoenix
#

and infrastructure

#

like are you distributing with kubernetes, if so what do the configs look like etc. do you have a rest -> integration structure

faint prism
#

Well with dependency inversion, I can swap out entire bits of logic without refactoring where that bit was referenced in the code

earnest phoenix
#

stuff like that

faint prism
#

Using interfaces, and factory design pattern. Alternatively you could use inversion of control containers

earnest phoenix
#

i understand your programming principles

#

im talking infrastructure

faint prism
#

Ah

#

I have a CICD pipeline that deploys to a raspberry pi :P but that's about it as far as infrastructure goes

#

Gated merges with the main branch, build verification pipelines, unit tests, etc

earnest phoenix
#

ok, do you have one big monolithic app or microservice styled api etc

#

yea for cicd i use travis and docker etc

#

paired with github

#

good easy way to do things

faint prism
#

I wouldn't call it "monolithic" but it doesn't use an API for logic. It uses a class library for that

earnest phoenix
#

is it one process

faint prism
#

Spins off seperate threads to handle commands

#

But yeah

#

Written in C#

topaz saddle
#

hello, could someone explain to me what module.exports and module.exports.run does?

quartz kindle
#

lets say you have two files: a.js and b.js

#

in a.js you have this code ```js
let something = require("./b.js")

#

whatever you put in module.exports in your b.js file, is what a.js will get when it requires the file

#

if you do module.exports = 10 in b.js, then something in a.js will become 10

#

by default module.exports is an object, so instead of module.exports = 10 you can do module.exports.abc = 10
in this case, then something becomes {abc:10} when you require the file

topaz saddle
#

oh ok

simple stump
#

I'm confused why this bit of code:

con.query(`SELECT * FROM shielded WHERE id = '${message.author.id}'`, (err, rows) => {
    if (err) throw err;

    const [ row ] = rows;

    if (row.time == null) {
        return;
    }

    var parsed = parseInt(row.time);

    if (row && parsed + 1000 <= ts) {
        con.query(`DELETE FROM shielded WHERE id ='${message.author.id}'`, (err, rows) => {
            if (err) throw err;
            const role = message.guild.roles.cache.find(role => role.name === "Shielded");
            message.member.roles.remove(role);
        })
    }
});

Keeps saying that it can't read property time of undefined. I do have the column time, however nothing is in it at the moment.

sudden geyser
#

log the value of row to see what it is (right after you declare it)

simple stump
#

Alright

topaz saddle
#

one more thing, what would module.exports.help do? does it create a type?

simple stump
#

It says "undefined"

#

(the log)

sudden geyser
#

are any rows being returned?

simple stump
#

no

#

I don't have any however

#

But I want to make sure that that doesn't affect the bot

#

Cause there is a high chance that someone won't be "Shielded"

#

Basically user's can shield themselves, giving them the "Shielded" role. It is for a set time, however if the time runs out (which if row && parsed + 1000 <= ts) manages), then remove the shield and delete the row from the shielded table.

sudden geyser
#

Then you should probably check if any rows are returned before you go forward, as it looks like you rely on it being present.

simple stump
#

Alright

#

Isn't that what:

if (row.time == null) {
  return;
}

Is for?

sudden geyser
#

rows will be an array of elements

#

so if there's nothing in it

#

row will be undefined

#

if you try to access anything on undefined you get that typeerror

#

so you should check if (row) {...}

simple stump
#

Ah I see.

#

Ty

#

I'll try that\

drifting wedge
#

@commands.has_any_role('DJ, dj, dJ, Dj')

#

is this wrong

ancient falcon
#

dpy?

leaden shard
#

Who can help me with giveaway bot?

ancient falcon
#

Who can help me with giveaway bot?
@leaden shard Are you making a giveaway bot?

leaden shard
#

yea

ancient falcon
#

what exactly do you need help with

leaden shard
#

with change design

#

come to dm

drifting wedge
#

yes @ancient falcon

#

MusicPlayer
@commands.command.has_any_role('DJ, dj, dJ, Dj')
AttributeError: 'function' object has no attribute 'has_any_role'

#

thats an error

#

im getting

ancient falcon
#

@drifting wedge it's @commands.has_any_role

#

not commands.command

drifting wedge
#

im using cogs btw

#

thats ok right:

#

still not working

#

says syntax error

#

ah my bad 1 sec

still merlin
#

Does anyone know if you can require lodash without the underscore, '_' apparently is what you define lodash as, But I want to define it as ```js
const lodash = require('lodash')

slender thistle
#

Is there any detailed reason as to why you can't just do what you sent?

still merlin
#

No

#

I'm just wondering if lodash would still work

sudden geyser
#

You can name it whatever you want as it's just a variable

digital ibex
#

const x = require(y)
are you talking about x or y ?

still merlin
#

Thanks

sudden geyser
#

In practice they like to use _

earnest phoenix
#

does anyone here know how to develop a moderation bot? I can't figure out how to make one

digital ibex
#

what language and library u using?

earnest phoenix
#

discord.js

digital ibex
#

i can link u to some docs which helps

#

what r u trying to do? like, kick, ban or?

sudden geyser
#

If you can make a bot you can make a moderation bot. Are you looking for how to do some type of feature

earnest phoenix
#

yeah

#

@sudden geyser

sudden geyser
#

Then what feature are you looking to do? "How to develop a moderation bot" is very broad.

earnest phoenix
#

I am trying to figure out like how to do the Moderation logging @digital ibex

digital ibex
#

ok

#

what r u trying to log?

earnest phoenix
#

like if someone were to be banned or someone was making roles removing/making channels etc

earnest phoenix
#

ty

sudden geyser
#

Look at the Events column on the documentation: https://discord.js.org/#/docs/main/stable/class/Client

earnest phoenix
#

Thanks guys

#
const sp = require('spotify-web-api-js');
const spotify = new sp();

function x () {
    spotify.getArtistAlbums('43ZHCT0cAZBISjO8DG9PnE', function (err, data) {
        if (err) console.error(err);
        else console.log('Artist albums', data);
    });
};

ReferenceError: XMLHttpRequest is not defined

sudden geyser
#

You're probably using a library that's intended to be used on client side JS

earnest phoenix
#

wdym

sudden geyser
#

aka XMLHttpRequest can't be accessed because you're not in the right environment.

summer torrent
#

"spotify-web-api-js**

sudden geyser
earnest phoenix
#

im stupid thnks

simple stump
#

For some reason this snippet of code:
https://hatebin.com/godhorudew
Isn't adding the "Shielded" role to the user. It exists, and it worked once, but I don't know why it isn't working now.

quartz kindle
#

does the "inserting data ..." still get sent?

simple stump
#

Also this:
https://hatebin.com/qfkqsircfg
Isn't adding the Cooldown role AND seems to subtract experience from everyone; not just the author of the message.

#

HYes

#

*Yes

quartz kindle
#

console.log(role) before adding it

simple stump
#

👍

quartz kindle
#

if your event listener is async, use await when adding the role

simple stump
#

It isn't I believe

#

I'll try that.

quartz kindle
#

if you dont want to make it async, add a .catch() to roles.add()

simple stump
#

I get undefined 😮

#

(when printing role)

#

I'll double check that it's actually there

gritty bolt
#

how do people make bots that you can link accounts to using APIs?
@gritty bolt

sterile thicket
#

Can bot read custom status of a user?

pale vessel
#

yis

opal plank
#

funnily enough i never found the api docs on user presence format

#

pls link me if you find it

#

only found it under SKD which seems to be different than REST

still merlin
#

I'm getting constant 'invalid token was provided' after multiple token regenerates, The token in the application and the token in the token.json are the same

quartz kindle
opal plank
#

oh its called activity

#

yeah ty @quartz kindle

earnest phoenix
#

I'm getting constant 'invalid token was provided' after multiple token regenerates, The token in the application and the token in the token.json are the same
@still merlin the hell

#

show the token.json (hide the token obviously)

still merlin
#
{
    "token": "token"
}```

index.js
```js
const token = require('./token.json');

client.login(token)
faint prism
#

Is it that easy to deserialize in JS? Damn

#

Here I was trying to use JSON.parse on a file steam result

earnest phoenix
#

the hell

#

@still merlin that's not how JSON works

#

you have to parse the data

sterile thicket
#

yis
@pale vessel hints

earnest phoenix
#
JSON.parse("json string");
#

@still merlin are you even there

slate oyster
#

Sometimes my bot says it is online, and even has a status feed, but does not reply to commands until I reboot it
So basically, silent failure
And I've tried to fix error handling a million times
But Reactor has the world's hardest-to-use error handling

earnest phoenix
#

@slate oyster discord doesn't immediately update when a bot goes offline

#

it takes a few seconds

slate oyster
#

I know, but it's not been responding for a few minutes now

earnest phoenix
#

then

#

check your error logs

#

discord api errors don't terminate the process

#

unless it is a promise rejection

slate oyster
#

I get tons of 404 errors
But they are not what crashes the bot
As I've gotten plenty of 404 errors in the past, which do not crash the bot
So I dunno what crashed the bot this time

earnest phoenix
#

hmmmm

#

show code

slate oyster
#

But I can literally reproduce those errors without the bot crashing

earnest phoenix
#

lol

pale vessel
#

@sterile thicket user.presence

sterile thicket
earnest phoenix
#

But I can literally reproduce those errors without the bot crashing
@slate oyster errors don't crash unless they're <smth> level of stuff like promise rejections

sterile thicket
#

I'm getting this

earnest phoenix
#

Did you just steal my bot style

pale vessel
#

it's a.state for custom statuses

#

state

sterile thicket
#

oh

#

ok

pale vessel
#

filter(x => x.state).map(x => x.state)

#

or just use .find(), way easier

quartz kindle
#

you dont need to json parse a required json file

#

only if you read it with fs

faint prism
#

I'll remember that

slate oyster
earnest phoenix
#

you dont need to json parse a required json file
only if you read it with fs
@quartz kindle lmao did you even read that guys code

still merlin
#

Can someone please explain the invalid token error?-

quartz kindle
#

@still merlin token.token

earnest phoenix
#

@earnest phoenix So this is my error handling code
@slate oyster the hell is that spaghetti programming language

faint prism
#

Is that generics in JS :o

slate oyster
#

Java

still merlin
#

Thankyou @quartz kindle

earnest phoenix
#

no

#

still wrong

pale vessel
#

it's token.token @still merlin

quartz kindle
#

@earnest phoenix i was replying to amazriSF's issue

earnest phoenix
#

your fix was wrong

#

she hasn't parsed the json data

pale vessel
#

use {token} or change the variable name to avoid confusion

earnest phoenix
#

and she's using fs

#

just use env files bois

still merlin
#

I'm using fs for a command handler

thick gull
#

you have to parse the data
@earnest phoenix if you're requiring a json file you dont

quartz kindle
#

i was replying to this

earnest phoenix
#

she is using fs

pale vessel
#

no

earnest phoenix
#

yes

still merlin
#

I'm using fs for a command handler, Not the json files

earnest phoenix
#

the fuck

slate oyster
#

I wonder if I actually remembered to push my latest error handling fix...
Because, tbh, I feel that it really should work for error handling this time

earnest phoenix
#

why did you send fs code then

still merlin
#

I didn't-

#

I sent the contents of my token file and my index.js token related stuff

pale vessel
#

le brain damage has arrived

earnest phoenix
#

alright my bad i need to go see a doctor my eyes are not functioning properly

quartz kindle
#

confuuusion of the highest orda

thick gull
#

const { token, prefix } = require("./config.json")
would work, if it doesn't have {} iirc you have to do token.token as token is the json not the token key in the json

slate oyster
#

@earnest phoenix Anyways, the code isn't that bad to read
You just have to learn Reactor

formal agate
#

Can help me anyone arrange my command

earnest phoenix
#

just ask what you need help with

#

no need to ask for permission

thick gull
#

arrange?

formal agate
#

I don't know which is in which module

#

@thick gull hmm

#

It's a hard part for me

earnest phoenix
#

you mean

#

you store every command in individual files?

formal agate
#

No

#

In help command

earnest phoenix
#

just show the code

#

your explanation is not making sense

formal agate
#

Really

earnest phoenix
#

yeah

#

your english seems a little bad can you speak another language?

formal agate
thick gull
#

oh

opal plank
#

yeah embeds and mobile is a no-no

thick gull
#

he doesn't know how to edit it?

formal agate
#

@thick gull I know

opal plank
#

i think he means the fucked up mobile display

formal agate
#

Wait

opal plank
#

fields on mobile look like shit

#

try dumping everything under description instead

earnest phoenix
#

Just arrange these
@formal agate you mean arrange them on different places on the embed?

formal agate
#

It's night in my region

#

@earnest phoenix yes

thick gull
#

what language do you prefer

formal agate
#

@earnest phoenix brilliant intelligent

earnest phoenix
#

lmfao

#

use inline fields

thick gull
#

^doesn't work for mobile

opal plank
#

inline stills fucks up on mobile iirc

#

like i said

formal agate
#

R.I.P

opal plank
#

probably winning on the fact that mobile display is fucked with embeds

#

dump on description instead

formal agate
#

@opal plank stop using that f word

opal plank
#

and use newlines

#

no

formal agate
#

NSFW

#

Person

opal plank
#

how is cussing nsfw?

#

if you are 13- you shouldnt be here

#

also im trying to help

thick gull
#

fuck word is not safe for work

formal agate
#

LoL

opal plank
#

least you can do is overlook a cuss here and there when someone trying to help you

formal agate
#

You think I am -13

thick gull
#

I mean who else cares about fuck word

earnest phoenix
#

me

thick gull
formal agate
#

I'm from Asia

slate oyster
#

One of my bot's users found a super weird glitch in my bot
And the criteria to trigger the glitch are oddly specific
But the fact that the glitch exists in the first place suprises me

misty sigil
#

What was it

earnest phoenix
#

Now i know how is hard to make the bot prefix to mention

#

u can't use message.mentions.members.first() any more

slate oyster
#

@misty sigil
Basically, my bot is responding to the message -mmm
It deletes the message (if it has delete perms) and responds with a generic 404 response
My bot's prefix is not -, and mmm is not a valid command
Yet my bot is treating it exactly as if it were a command. Changing the command name causes it not to trigger, but adding arguments after a space works fine.
And maybe you could pass this off, but the exact criteria for this to happen, which I will explain in my next message, make this extremely weird though

misty sigil
#

what how do you even find that

thick gull
#

??????? what does it respond with

slate oyster
#

However, it's not just responding to the other person's bot

#

Because we tried it out in a channel that the other person's bot is muted in

#

And it still did it

#

However, it does only work in servers the other person's bot is in
But their bot is not sending messages (because it is muted on the channel), and I even checked with them to be sure it was muted

#

Also, the glitch only occurs in channels that my bot has configured as chatlink (within it's DB)

#

(I forgot to filter out my bot's name and logo in my screenshot, oof)

#

Anyways
I got confirmation that the other person's bot was muted

#

So it's not just responding to other bots

quartz kindle
#

check if you're only checking prefix length and not actual prefix
check if you dont have any extra instance of your bot or some test program with your bot's token running somewhere
reset the token just incase

#

if you use switch cases, check if you forgot a break somewhere causing it to fallthrough

#

similarly, check if you forgot to return somewhere

slate oyster
quartz kindle
#

add some logging to that, and check what it logs when you run -mmm

slate oyster
#

Ok,
I'm not able to develop rn, doing homework
But will try when I can

#

Thanks

#

If not, I'll reset token like you said

still merlin
quartz kindle
#

prefix.prefix.length

still merlin
#

Thankyou so much

thick gull
#

so how do i remove the reaction f rom a collection?

#

im awaiting a reaction

#

then doing collected.last().remove(message.author.id)

#

but it just removes the entire reaction

#

(ive checked docs, and searched it up.)

#

docs dont seem to say how to remove a specific one

#

and google says to put user id there

nimble kiln
#

You need to fetch the reactions for the message (if not already done), and then use reactions.users.remove(userID)

earnest phoenix
#

You want to just make the bot unreact with the reaction it added?

thick gull
#

yea

#

remove the users reaction*

nimble kiln
#

Example from my code:
msg.reactions.cache.forEach(r => r.users.remove(userID));

#

^this will remove a user from every reaction, you may want to slap some if checks into that if you dont want that to happen

thick gull
#

nah its just an option based menu

#

like option1, option2 etc

nimble kiln
#

Then my snippet should work if you adapt it to your context

thick gull
#

yea

#

thanks

#

first time using collectors

#

😛

sharp thicket
#

Hello,anyone know how to get the uptime of a discord bot?

misty sigil
#

client.uptime

sharp thicket
#

oh lol

earnest phoenix
#

Can someone give me link for VPS?

nimble kiln
#

client.uptime
@misty sigil Fuck that is a thing?

sharp thicket
#

i can't find anyrhing in docs why is it?

misty sigil
#

Yea

#

or is it

nimble kiln
#

I added a global variable Date.now()

#

Yes .uptime is a thing

sharp thicket
#

@earnest phoenix ill dm you one if thats ok

earnest phoenix
#

Ok

misty sigil
#

Yup it is

sharp thicket
#

ok

thick gull
#

what are some good modules/whatever to make graphs

sharp thicket
#

@misty sigil

Joined Servers: 97
Online Users: 23148
UpTime: 53582

misty sigil
#

aeeeaeae

sharp thicket
misty sigil
#

it returns in ms ffs

#

you should’ve guessed that

sharp thicket
#

how do i convert that?

nimble kiln
#

divide by 1000

misty sigil
#

Converts to second

sharp thicket
#

devide by 100 to minutE?

misty sigil
#

that’s a fundamental misunderstanding of division my man

sharp thicket
#

ik im dumb Think1

thick gull
#

divide ms to seconds and then math.floor

#

?

misty sigil
#

divide by 60000 if my math is correct

thick gull
#

/1000 is seconds

#

then .toFixed(1) will do seconds.onenumber

#

so have fun

#

bye

simple stump
#

For some reason this snippet of code:
https://hatebin.com/godhorudew
Isn't adding the "Shielded" role to the user. It exists, and it worked once, but I don't know why it isn't working now. Also this:
https://hatebin.com/qfkqsircfg
Isn't adding the Cooldown role AND seems to subtract experience from everyone; not just the author of the message.

quartz kindle
#

did you console.log(role)?

simple stump
#

Yes

#

I got undefined

#

However the role is there...

#

So I'm confused whether I'm getting the role correctly or not...?

wheat kraken
#

My bot Leaf Bot now has custom commands (a lot) And is now online 24/7. Its improved!

sinful belfry
#

@hushed crane i think you're missing a bracket

wheat kraken
#

Hope i get approved! i just have to wait about 4 weeks to find out! (i probably wont get approved because i saw lots of declined messages so im pretty sure the chances are low)

hushed crane
#

? @sinful belfry

sinful belfry
#

@wheat kraken only declines are recorded in #mod-logs

wheat kraken
#

Ok

sinful belfry
#

just follow the bot rules in #rules-and-info and you'll be fine, but this is the wrong channel

quartz kindle
#

@simple stump check if the role's name is also uppercase S

hushed crane
#

?

quartz kindle
sudden geyser
#

He's pointing out you're missing a bracket there.

#

the art of lines, circles and question marks

static trench
#

Does pycharm have a rich presence?

hushed crane
#

What is process.exit(1) doing

sudden geyser
#

Does pycharm have a rich presence?
@static trench not directly, but there is a plugin for it. Search for "Discord Integration" in the Plugins menu in settings.

hushed crane
#

Thx

static trench
#

@static trench not directly, but there is a plugin for it. Search for "Discord Integration" in the Plugins menu in settings.
@sudden geyser 🙂 thanks!

sudden geyser
#

@earnest phoenix are you using the npm node-sqlite3 package

#

Also how many rows are in the table

thick gull
#

what would a decent easy way to turn this: into something like this:
"1️⃣ | idk",
"2️⃣ | what",
"3️⃣ | other"

earnest phoenix
#

map

#

oh

#

nvm i thought you meant the other way around

thick gull
#

yea

earnest phoenix
#

wait im confused

#

what do you want to do

thick gull
#

I want to add the emoji based on what position its in

earnest phoenix
#

map provides the index as an optional param

#

@static trench Just using sqlite

#

Not node-sqlite3 or sqlite3

#

And has only 2 rows

static trench
#

@static trench Just using sqlite
@earnest phoenix ????? what>

earnest phoenix
#

Ah, my bad

static trench
#

ll good!

simple stump
#

How would I get an avatar (and put it in an embed) given an ID? I'm trying to hard code a command (on request), however I can't seem to add the avatar if I set the ID as a string. I know many people instead use message.member.users.first(), but I want to use it given an ID. Here is my code:

        if (message.content.startsWith(`${prefix}aki`)) {
            let aki = "@<727193643315757076>";
            const akiEmbed = new Discord.MessageEmbed()
            .setColor('#0099ff')
            .setTitle('Aki')
            .setDescription('All About Aki')
            .setThumbnail(aki.avatarURL)
            .addFields(
                { name: 'Famous Quote:', value: 'hewwwwo! gib snacc pls ,,uwu,, bewwy wubs too!!', inline: true },
                { name: 'Favorite Food:', value: 'snaccs', inline: true },
                { name: 'Favorite Thing:', value: 'bewwy wubs', inline: true},
                { name: 'Favorite Song:', value: 'Aki please tell me', inline: true},
                { name: 'Noteflight Equivalent:', value: 'Akimoto Hyena', inline: true},
            )
            .setTimestamp()
            .setFooter('Akimoto Hyena #4511');
            message.channel.send(akiEmbed);
        }
simple stump
#

oh yay i got the bot dev role 😄

low shard
#

Lol

faint prism
#

oh yay i got the bot dev role 😄
@simple stump when did you submit?

simple stump
#

Never 0-0

#

I just checked now and I had the tag

earnest phoenix
#

Lol

simple stump
#

I have one bot here in the Disc I think, but no others lol

#

And I haven't worked on that bot for months. Nearly 2 years?

thick gull
#

@simple stump fetch the user in your cache

#

with the ID

simple stump
#

Ah

thick gull
#

<Client>.users.cache.get('ID') iirc should work fine

simple stump
#

alright ty 🙂

thick gull
#

i can't remember if avatarURL is for guild or user though

#

so you might have to edit that for your needs

simple stump
#

i believe its for user

#

ill try that out tho

#

ty

pale vessel
#

avatarURL is for users

#

you should use user.displayAvatarURL() since it supports default avatars too

simple stump
#

alright ty

#

yeah just tried the cmd again

#

shouldnt what bo rb o s s (nice username btw lol) said be:

let si = message.guild.members.cache.get('545353297096343552');
pale vessel
#

yes

simple stump
#

and as he said the issue is that its guild.members, whereas avatarURL is user?

pale vessel
#

but then you will need to use si.user.displayAvatarURL()

simple stump
#

0-0

#

ah ok

#

ty that makes a lot more sesnse

#

yay it works tysm flaepe and borboss 🙂