#development

1 messages · Page 1270 of 1

autumn aspen
#

@autumn aspen FOUR different people have given you the answer
@umbral zealot thx

leaden rover
#

Is there a good github repo code thingy for a disable command?

misty sigil
#

whitenames make me

umbral zealot
#

Goddamn tylers, man.

knotty sigil
#

man how stupid is he

#

we told you the answer

misty sigil
#

me

#

that’s me rn

knotty sigil
#

just copy it

autumn aspen
#

@autumn aspen FOUR different people have given you the answer
@umbral zealot but doesnt it fuck my command handler ?

knotty sigil
#

no

misty sigil
#

NO

umbral zealot
#

Not stupid. Just lacking in experience, and a damn Tyler

knotty sigil
#

omfg

autumn aspen
#

aight

feral aspen
#

Bruh we jokin. Just type const Discord = require('discord.js'); in the beginning

misty sigil
#

put it in the top

#

Of the command file

autumn aspen
#

aight and then I can put my codes

#

aigth?

knotty sigil
#

my man has a new lvl of stupidity

#

yes

umbral zealot
#

then people wonder why we don't like entitled little kids that refuse to learn the language.

autumn aspen
#

my man has a new lvl of stupidity
@knotty sigil stfu

knotty sigil
#

haha

misty sigil
#

lol

wet dove
#

Please be nice.

knotty sigil
#

sorry

autumn aspen
#

then people wonder why we don't like entitled little kids that refuse to learn the language.
@umbral zealot bro u 2 stfu

#

lmao

feral aspen
#

Bruh.

wet dove
#

And what happened in here?

tidal marlin
#

What's going on here

feral aspen
#

Be respectful

umbral zealot
#

Yeah well, if you can't handle the truth,we can't do much.

knotty sigil
#

just look up the chat @wet dove

autumn aspen
#

And what happened in here?
@wet dove little braincells droped thats it

umbral zealot
#

Learn the language you want to use first.

feral aspen
#

He just asked a question though, and we answered. Job done. 🆗

autumn aspen
#

Learn the language you want to use first.
@umbral zealot man chill out Im doin it all the time ot trying

misty sigil
#

and then they asked it again

wet dove
#

If you are not willing to help, don't help. Ignore this channel.

knotty sigil
#

but we did help him

feral aspen
#

@autumn aspen Please just add const Discord = require('discord.js'); at the beginning of the code to define Discord

misty sigil
#

we were helping

#

until they asked again

autumn aspen
#

If you are not willing to help, don't help. Ignore this channel.
@wet dove they helped

umbral zealot
#

Yeah, we've all been there. What we're telling you is that you should know the language first, otherwise, making bots is extremely difficult.

misty sigil
#

after getting 4 answers

autumn aspen
#

after getting 4 answers
@misty sigil chill I was slow

feral aspen
#

It's alright.

knotty sigil
#

@misty sigil

misty sigil
#

aye

knotty sigil
#

do you know how i put the guild Thumbnail

#

in the channelCreate event?

#

ah nvm

misty sigil
#
knotty sigil
#

i remembers it

misty sigil
#

channel.guild

feral aspen
#

.setThumbnail(message.guild.iconURL())

knotty sigil
#

icon

#

yes thank you

violet mesa
feral aspen
#

You're welcome

#

Bois

#

Question

#

presence intent are like bot events like GuildMemberAdd and those right?

buoyant aspen
#

I need some help with await: I want these four functions to execute one after the other and await a response. How can I do that?

const tokenRes = oauth.tokenRequest({
    clientId: config.clientId,
    clientSecret: config.clientSecret,
    code: req.query.code,
    scope: 'identify guilds.join',
    grantType: 'authorization_code',
    redirectUri: 'https://ai**.cam*******.repl.co/web/addserver',
});

const userRes = oauth.getUser(tokenRes.access_token).then(console.log);

oauth.addMember({
    accessToken: tokenRes.access_token,
    botToken: config.token,
    guildId: '757991475941343352',
    userId: userRes.id,
});
autumn aspen
#

It's alright.
@feral aspen thx man it worked actually thx guys u the best!

umbral zealot
#

well, literally const thing = await blah()

feral aspen
#

😄

umbral zealot
#

It needs to be in an async function, too

feral aspen
#

Hey Evie.

violet mesa
buoyant aspen
#

Ah that's the issue

autumn aspen
#

It needs to be in an async function, too
@umbral zealot me? sorry for asking

umbral zealot
#

No, not you, geeze, you were already answered 10 times.

buoyant aspen
#

It's an async function

autumn aspen
#

No, not you, geeze, you were already answered 10 times.
@umbral zealot I was just alert

umbral zealot
#

Can you... not hide the part where we can see if it's async or not? lol

violet mesa
#

can anyone help please

feral aspen
buoyant aspen
#

@umbral zealot NVM wrong function was async

feral aspen
#

nvm

autumn aspen
#

lmao

gilded plankBOT
#

@violet mesa

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

feral aspen
#

lol

umbral zealot
#

I mean they've already asked twice, to be perfectly fair.

violet mesa
#

lol

#

i asked twice

#

no one answered

wet dove
#

just ask ur question

violet mesa
wet dove
#

you should wait for a py dev to help u on that

violet mesa
#

ok

slender thistle
#

commands extension or on_message

#

which do you use

violet mesa
#

commands extension

slender thistle
#

arg: int

#

in the function parameters

drifting wedge
#

its not working

#

how can i make my bot leave server/

#

servers

#

shivaco, its not working

stark abyss
#
      let filter = m => m.author.id === "673362753489993749";
      let collector = message.channel.createMessageCollector(filter, { max: 1, time: 25000, errors: ['time'] })

      collector.on('collect', claimed => {
          console.log("collected... \n" + claimed.first().content)
          if(claimed.embeds[0].description == "got the card!"){
            msg.delete();
            return message.channel.send("delete!");
          }```
#

how do I fix the error

#

TypeError: claimed.first is not a function

autumn aspen
#

guys what was the mention command

#

if u mention avatar @mention

sudden geyser
#

@stark abyss collect is a Message instance.

#

There's no need to try getting the first item as you already have it.

stark abyss
#

ahh okay

white vapor
#

how do i get the id of an animated emoji without nitro

sudden geyser
#

@autumn aspen I've no idea what you mean, but we don't just dispense code for you to throw into your command. That's not how it works (if that's what you meant)

#

Jeremy if you want to jump through some hoops you could inspect element and navigate to the emoji, but I don't know if there's a better way of doing it.

white vapor
#

ok thanks

earnest phoenix
#

inspect element / use a bot ^^

#

How do i host my bot to be online 24/7 without paying if there is a way

#

you need to pay

#

:/

#

you're spending somebody else's resources

#

welcome to capitalism

#

well

misty sigil
#

welcome to the world, mate.

earnest phoenix
#

lol

autumn aspen
#

@autumn aspen I've no idea what you mean, but we don't just dispense code for you to throw into your command. That's not how it works (if that's what you meant)
@sudden geyser forget abt lol

faint prism
#

How do i host my bot to be online 24/7 without paying if there is a way
@earnest phoenix Do you have an android phone or a PC sitting around?

earnest phoenix
#

yes i have 3 android phones 1 iphone and 1 windows 10 pc

#

idk i just have them

faint prism
#

yes i have 3 android phones 1 iphone and 1 windows 10 pc
@earnest phoenix Will you bot being doing some pretty complex stuff or will the specs of a phone suffice?

stark abyss
#
   message.channel.send(editTimer).then(msg => {

      let filter = m => m.author.id === "673362753489993749";
      let collector = message.channel.createMessageCollector(filter, { max: 1, time: 25000, errors: ['time'] })

      collector.on('collect', claimed => {
          console.log("collected... \n" + claimed.embeds[0])
          //if (!claimed.embeds[0]) return;
          if(claimed.embeds[0].description == "got the card!"){
            msg.delete();
            return message.channel.send("delete!");
          }
      })```
#

it doesn't console.log

#

lmao

earnest phoenix
#

no i am just asking, for now my bot is not done so i am just asking to know for later

#

yes i am in school

stark abyss
earnest phoenix
#

ty

faint prism
stark abyss
#

lmao

#

bremea got no chill 1_smug

#

so like i was saying, console.log("collected... \n" + claimed.embeds[0])
prints object object

balmy mortar
#
@Bloody.command()
async def tweet(ctx, *, message: str):
    await ctx.message.delete()
    async with aiohttp.ClientSession() as cs:
        async with cs.get(f"https://nekobot.xyz/api/imagegen?type=tweet&username={Bloody.user.name}&text={message}") as r:
            res = await r.json()
            await ctx.send(res["message"])```
#

how do i send this as an image?

earnest phoenix
#

why would you spend processing power on it

stark abyss
#

why is there a f

earnest phoenix
#

just chuck the url in an embed

violet mesa
#
@bot.command()
async def deploy(ctx, arg: int):
    await open_account(ctx.author)



    
    users = await get_bank_data()
    
    user = ctx.message.author
    
    if users[str(user.id)]["wallet"] >= arg:
        
       users[str(user.id)]["wallet"] -= arg
       users[str(user.id)]["bank"] += arg
       await ctx.send("succesfully transfered the cash")
    elif users[str(user.id)]["wallet"] < arg:
        await ctx.send("you dont have enough for that")
```why does this not work?
#

doesnt show errors

#

just doesnt work

#

(python)

faint prism
#

why is there a f
@stark abyss It's interpolation iirc

stark abyss
#

ic

white vapor
#

what bot could get an emoji ID

earnest phoenix
#

any, as long as the bot is in the guild where the emoji is in

dire obsidian
#

can i ask something who have no relation with bots?

earnest phoenix
#

just ask

dire obsidian
#

okok, im making a external file for functions (python)

#

but in 1 function i need a object, and that object is declared in the main file

#

is there any form to import objects from another file?

dire obsidian
#

nonono, im not talking abaut variables

#

ive allready try that

#

from main import x1, x2 that

earnest phoenix
#

oh?

dire obsidian
#

like this
Main.pyw

from tkinter import *
from functions import click
w = Tk()
lbl = Label(text="Hello").pack()
btn = Button(text="click me", command=click).pack()
w.mainloop()

functions.py

from main import *
def click():
  lbl.configure(text="click!")
#

but this doenst work (is an example)

karmic compass
#

if i have: folder 1 file 1 - folder 2 file 2 and i want to get file 1 from folder 1 while in file 2 in folder 2, how would that be done?
similar to ./folder 2/file 2

#

(this is in a html file btw)

pale vessel
#

../file1 ?

karmic compass
#

../?

pale vessel
#

yes

#

the parent folder

karmic compass
#

ah let me try that out

pale vessel
#

wait

#

../folder1/file1 i guess?

karmic compass
#

oo

#

thank you so much!

#

that appears to not have worked

#

wait

#

yeah that doesn't work @pale vessel
(sorry for ping)

pale vessel
#

you need to show the directory structure for clarity

dire obsidian
#

like

const file1 = require("../folder1/file1");

if youre using js btw

karmic compass
#

its loading

#

wait

autumn aspen
#

Code:

var Discord = require('discord.js');

module.exports.config = {
    name: "mute", 
    aliases: ["m"]
}
    
module.exports.run = async (client, message, args) => {
    if(!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You can\'t use that!');

    var user = msg.mentions.users.first();
    if(!user) return msg.reply('You didn\'t mention anyone!');

    var member;

    try {
        member = await msg.guild.members.fetch(user);
    } catch(err) {
        member = null;
    }

    if(!member) return msg.reply('They aren\'t in the server!');
    if(member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You cannot mute that person!');

    var rawTime = args[1];
    var time = ms(rawTime);
    if(!time) return msg.reply('You didn\'t specify a time!');

    var reason = args.splice(2).join(' ');
    if(!reason) return msg.reply('You need to give a reason!');

    var channel = msg.guild.channels.cache.find(c => c.name === 'potato');

    var log = new Discord.MessageEmbed()
    .setTitle('User Muted')
    .addField('User:', user, true)
    .addField('By:', msg.author, true)
    .addField('Expires:', rawTime)
    .addField('Reason:', reason)
    channel.send(log);

    var embed = new Discord.MessageEmbed()
    .setTitle('You were muted!')
    .addField('Expires:', rawTime, true)
    .addField('Reason:', reason, true);

    try {
        user.send(embed);
    } catch(err) {
        console.warn(err);
    }

    var role = msg.guild.roles.cache.find(r => r.name === 'Muted');

    member.roles.add(role);

    setTimeout(async() => {
        member.roles.remove(role);
    }, time);

    msg.channel.send(`**${user}** has been muted by **${msg.author}** for **${rawTime}**!`);
}

Anyone help?

#

Error:

PS C:\Users\admin\apemodicus> node .
(node:7340) UnhandledPromiseRejectionWarning: ReferenceError: msg is not defined
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\mute.js:9:5)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:7340) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7340) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
karmic compass
autumn aspen
#

help anyone?

pale vessel
#

which file from what file?

karmic compass
#

logo from files

dire obsidian
#

msg not defined

karmic compass
#

i can get it to most of the other ones by ./ but getting it from index.html in sbn

dire obsidian
#

wat

#

gnome.png

karmic compass
#

uh

#

ignore it

autumn aspen
#

msg not defined
@dire obsidian can u help me ?

#

messa above hes

#

his

drifting wedge
#

how do i leave guilds

#

?

pale vessel
#

you want to access logo.png from what file?

dire obsidian
#

@drifting wedge [msg].guild.leave()

drifting wedge
#

msg?

pale vessel
dire obsidian
#

msg or message

drifting wedge
dire obsidian
#

ohhhh

pale vessel
#

ctx.guild.leave() i guess

#

not sure

karmic compass
#

want to access logo.png from the sbn/index.html directory which is part of the files folder along with logo.png

#

want to access logo.png from the sbn/index.html directory which is part of the files folder along with logo.png

#

bruh okay discord

pale vessel
#

so ../logo.png

autumn aspen
#

Code:

var Discord = require('discord.js');

module.exports.config = {
    name: "mute", 
    aliases: ["m"]
}
    
module.exports.run = async (client, message, args) => {
    if(!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You can\'t use that!');

    var user = msg.mentions.users.first();
    if(!user) return msg.reply('You didn\'t mention anyone!');

    var member;

    try {
        member = await msg.guild.members.fetch(user);
    } catch(err) {
        member = null;
    }

    if(!member) return msg.reply('They aren\'t in the server!');
    if(member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You cannot mute that person!');

    var rawTime = args[1];
    var time = ms(rawTime);
    if(!time) return msg.reply('You didn\'t specify a time!');

    var reason = args.splice(2).join(' ');
    if(!reason) return msg.reply('You need to give a reason!');

    var channel = msg.guild.channels.cache.find(c => c.name === 'potato');

    var log = new Discord.MessageEmbed()
    .setTitle('User Muted')
    .addField('User:', user, true)
    .addField('By:', msg.author, true)
    .addField('Expires:', rawTime)
    .addField('Reason:', reason)
    channel.send(log);

    var embed = new Discord.MessageEmbed()
    .setTitle('You were muted!')
    .addField('Expires:', rawTime, true)
    .addField('Reason:', reason, true);

    try {
        user.send(embed);
    } catch(err) {
        console.warn(err);
    }

    var role = msg.guild.roles.cache.find(r => r.name === 'Muted');

    member.roles.add(role);

    setTimeout(async() => {
        member.roles.remove(role);
    }, time);

    msg.channel.send(`**${user}** has been muted by **${msg.author}** for **${rawTime}**!`);
}
karmic compass
#

wait

#

did i seriously jsut

pale vessel
#

nice code, what about it?

dire obsidian
#

seriusly

autumn aspen
#

Error:

PS C:\Users\admin\apemodicus> node .
(node:7340) UnhandledPromiseRejectionWarning: ReferenceError: msg is not defined
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\mute.js:9:5)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:7340) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7340) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
dire obsidian
#

come to dm

autumn aspen
#

help anyone?

dire obsidian
#

youre spaming here

pale vessel
#

you defined msg as message

dire obsidian
#

come dm

pale vessel
#

did you copy pasted the code?

drifting wedge
#

did you copy pasted the code?
@pale vessel wut!?

pale vessel
#

not you

#

srry

karmic compass
#

lmaoooo

#

bro

#

i put that in the meta not the icon lmao

#

smort

autumn aspen
#

not you
@pale vessel no I didnt but my friend said u will fix any error that happens

dire obsidian
#

@autumn aspen what you are using msg or messages as message variable?

karmic compass
#

well thank you anyways mr.flazepe

autumn aspen
#

@autumn aspen what you are using msg or messages as message variable?
@dire obsidian message

#

@autumn aspen what you are using msg or messages as message variable?
@dire obsidian DM

dire obsidian
#

so thats why

#

change the msg to message

autumn aspen
#

oh thx

dire obsidian
#

@drifting wedge you use python right?

drifting wedge
#

yea

#

await leave(759099040431341638)

#

i tried this

#

didnt work

dire obsidian
#
toleave = client.get_server("id")
await client.leave_server(toleave)
#

^^^^

slender thistle
#

grr

#

guild not server

dire obsidian
#

ikd i dont make py bots

slender thistle
#

Didn't I tell you how

#

Are you not familiar with objects

#

literally

#

guild = get_guild(id)
guild.leave

dire obsidian
#

ikd i dont make py bots
@dire obsidian i just make py apps

#

shivy you still there?

slender thistle
#

kind of

#

mainly wondering why people can't learn the concept of OOP before making Discord bots

uncut swallow
#

xd

pure lion
#

is there a way to copy a mongodb document to another collection?

#

without having to map each of the values one by one

sinful thistle
slender thistle
#

doc = findOne()
if (doc) somedb.somecol.update/insertOne(doc)

pure lion
#

thank you shiv

sinful belfry
stark abyss
#
    message.channel.send(editTimer).then(msg => {

      let filter = m => m.author.id === "673362753489993749";
      let collector = message.channel.createMessageCollector(filter, { max: 1, time: 25000, errors: ['time'] })
      
      collector.on('collect', claimed => {
          if (!claimed.embeds[0]) return console.log("not embed");

          if(claimed.embeds[0].description.includes(" got the card! ")){
            try{
              msg.delete();
              isClaimed = true
            }catch{
              return
            }
            return message.channel.send("delete!");
          }

          return;
      })
#

don't worry about what's closed and what's not but it gives me UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message

pure lion
#

it cant find the message

#

can you send the stack?

sinful thistle
#

@sinful belfry thanks

stark abyss
#

how would you do that? @pure lion

pure lion
#

send me the full error stack

stark abyss
#

oh

#

(node:458) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at RequestHandler.execute (/home/runner/kanekis-TEST-bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:458) UnhandledPromiseRejectionWarning: Unhandled promise rejection.

#

there is like hella more

#

@pure lion

pure lion
#

send the all

#

@stark abyss

stark abyss
#

jeez i need the waste paste bin

pale vessel
#

requesthandler errors usually don't point to where the error happens

stark abyss
#

what is it called

pure lion
stark abyss
pure lion
#

no

stark abyss
#

they just occured many times

pure lion
#

save it and send the url at the top

stark abyss
#

didn't realize it

#

idek

pure lion
#

send the whole thing at once

pale vessel
#

that should be the whole thing

stark abyss
#

they are the same error

#

occuring more then once

#

so anyone can help me

#

@pure lion

#

okay well thx anyway

pale vessel
#

debug

#

did console print "not embed"?

#

log if it errors in the try catch block

#

if the error doesn't give information, find where it came from by debugging

stark abyss
#

well the thing is that the code is working fine

#

everything is doing like its supposed to be

#

including the part msg.delete()

#

but it still gives an error

pale vessel
#

then it means that it's running twice for whatever reason

stark abyss
#

if i change msg to message it works

#

yeah it is

pale vessel
#

you can't delete an unknown message

#

so something is causing it to run twice

stark abyss
#

how do I delete it if it's not already

pale vessel
#

try if (!msg.deleted) msg.delete();

#

you should probably try to find what caused it though

stark abyss
#

okay

#

nah same thing

#

oh

#

the problem is that I am setting an timeout to it

#

but if a condition happens i want it to delete it

#

@pale vessel

pale vessel
#

where is the timeout

stark abyss
#

@pale vessel

wispy crane
#

Hi, is there a way I can get the total number of default emojis in Discord ?

#

or the Twemoji version Discord uses

proven lantern
#

Object.keys(client.emojis).length

wispy crane
#

default emojis, not guild emojis

#

😕

proven lantern
#

client.emojis should be different than guild.emojis

#

but i dont know

stark abyss
#

help

proven lantern
#

maybe make a bot that's in no guilds and then get the number

wispy crane
#

client.emojis is the list of (guild) emojis a bot has access to

#

the default ones are not in that list :/

stark abyss
#

why do you even want to get total number of default emojis in discord?

#

do u want the number or u want to use it

proven lantern
#

maybe a pagination list

wispy crane
#

and I'd like the png files

#

and be sure I have all of them

stark abyss
#

that is sick

wispy crane
#

thanks

#

the thing is, i'm not sure if I miss some

#

and I just got an update on Discord PTB that added new emojis 🥲 🪧 🤌 ... etc.

stark abyss
#

is your bot public?

wispy crane
#

yeah

stark abyss
#

ok

proven lantern
#

dont paste an invite link

wispy crane
#

idk if it's allowed to .. alright

#

i won't

proven lantern
#

it gets you in trouble

stark abyss
#

dm me

#

i wanna use it 1_smug

wispy crane
#

works with images too

#

attachments

#

😅

stable nimbus
#

@wispy crane That is a cool bot.

#

Lots of props to you, it had to be difficult to make.

wispy crane
#

I'll just check Twemoji and try to check manually if I miss emojis

#

It's not that difficult honestly, but thanks ^^ it finds the emojis with the closest color to each pixel in an image

earnest phoenix
stable nimbus
#

Still, wonderful job.

wispy crane
#

Thank you @earnest phoenix

stable nimbus
#

@earnest phoenix Can I ask a question?

earnest phoenix
#

yeah of course

stable nimbus
#

Is there a way to create a reload command that searches through all directories? Or is it meant for only one directory?

earnest phoenix
#

all as in all

#

or?

stable nimbus
#

./commands/folder/command.js

shy turret
#

how do i store sessions?

stark abyss
#

https://hasteb.in/efulesuy.js
I am stuck on why I am getting (node:682) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message error
msg.delete() is causing it. If I change msg to message it works.

#

error or no error the stuff still works

earnest phoenix
#

node i'm assuming, yeah very possible

shy turret
#

@stable nimbus delete require[require.resolve()]; or something for reloading cmds

earnest phoenix
#

Dirent objects allow you this behaviour of looping through directories

#

give me a sec

stable nimbus
#

I know how to create a basic reloader, I have one, but I need to loop through the rest to search for the one I call for.

shy turret
#
delete require[require.resolve("./commands/thisfile.js")];
require("./commands/thisfile.js");

reloading

stable nimbus
#

sigh I use more than one directory

#

I am organized.

shy turret
#

well then

stable nimbus
#

Read what I am typing

shy turret
#

loop all folders

stable nimbus
#

Yeah I don't know how to do that. Its why I am asking for help.

shy turret
#

using fs um wait

violet mesa
#

how can i make my page look better (it isnt that small i just made it small so u can see the all this) im not so good with html and all that

stable nimbus
#

fs is file sorter, if anything I am sure its meant for the handler that causes cooldowns.

shy turret
#
fs.readdir("./folder/", (err, files) => {
  if (err) console.info(err, "error");
});

something like this

#

and use files.forEach()

stable nimbus
#

Stop mate, you're not helping.

shy turret
#

thats how you loop all folders

stable nimbus
#

how can i make my page look better (it isnt that small i just made it small so u can see the all this) im not so good with html and all that
@violet mesa You can't control that on top.gg

shy turret
#

^ use css

#
<style>
</style>

on the page

violet mesa
#

ok

shy turret
#

you need to make your own css though

earnest phoenix
violet mesa
#

how do i make dark mode with css if anyone can help

stable nimbus
#

Body's background color.

eternal osprey
#

how do i check if a messaeg is from a webhook in python?

zinc condor
#

So i kinda made my own javascript environment built in v8, designed to be used for embeddable scripting over the network
its extremely fast and safe for people to use, made in C++, vid below

earnest phoenix
#

how do i check if a messaeg is from a webhook in python?
@eternal osprey what have you tried

eternal osprey
misty sigil
#

webhooks dont have id's?

earnest phoenix
#

they do

eternal osprey
#

they do

misty sigil
#

oH they do

eternal osprey
#

would this work tho?

earnest phoenix
#

every single entity is a snowflake

#

sure, if you want to check for a specific webhook

misty sigil
#

oh yea now that i think of it

eternal osprey
#

owh yeah, thanks!

earnest phoenix
#

throw an error if args[1] is not equal to a value in the json file. how can I do it?

#

what

#
{
"name":"Hello"
}

/test hello = return yes.
/test hi = return false.

#

If the value I entered is not equal to any value in the json file, it will give an error.

#
{
    "aatrox": "266",
    "ahri": "103",
    "akali": "84"
}

If I write yasuo it will give an error. If I write akali it will return true.

violet mesa
#

sorry for so much questions and interapting everyones stuff but how do i do css in the top.gg thing

stable nimbus
#

if(args[1] !== config.thing.type){

}

#

You'll need to call for the json file as a config or whaterver, the thing is what its listed under in your json file, and type is the specific thing in that list.

earnest phoenix
#

but the json file is in my folder

#
const donusturme = require("../../JSON/sampiyon_adi_id_donusturme.json")

args[1] !== donusturme.type
#

if i think i did something wrong

stable nimbus
#

You called it right, so now you need to call for a specific thing.

#

if(args[1] !== donusturme.aatrox) {

}

#

You have to name every single one of them.

earnest phoenix
#

what you gave as an example and what you gave what you have right now are two different things

#

wow

stable nimbus
#

Or is there a way to check all of the data in a json folder?

earnest phoenix
#

luckily for you js is retarded and objects are just fancy dictionaries and you can access object keys at runtime with no issue at all

#

using Object.keys

stable nimbus
#

Okay nevermind.

earnest phoenix
stable nimbus
#

I am just stupid

pale vessel
#

can relate

stable nimbus
#

Haha

autumn aspen
#
const Discord = require("discord.js");

module.exports.config = {
    name: "help", 
    aliases: ["h"]
}
    
module.exports.run = async (client, message, args) => {

How can I create a kick command bc I got stuck here again?
@misty sigil

misty sigil
#

do you know basic js?

autumn aspen
#

do you know basic js?
@misty sigil yes why?

#

I have a command handler

misty sigil
#

then you'd know the code just goes in the async function

autumn aspen
#

so how am I supposed to find the right one?

misty sigil
#

what?

autumn aspen
#

what?
@misty sigil but how am I supposed to slap the kick code in there

misty sigil
#

in the function

#

just put your previous code

#

you said you had it right?

autumn aspen
#

I did and I got an err

misty sigil
#

cuz discord wasnt defined

autumn aspen
#

wdym

misty sigil
#

just put const Discord = require("discord.js") at the top of the fucking file

#

we went over this

#

like 4 hours ago

autumn aspen
#

like 4 hours ago
@misty sigil I did that

umbral zealot
#

Whoa there, clearly they have that line though

misty sigil
#

wait

autumn aspen
#

but the moderation commands doesnt worj

umbral zealot
#

they just want to be spoonfed how to create a kick command.

misty sigil
#

oop

#

@autumn aspen what error

autumn aspen
#

brb

#

they just want to be spoonfed how to create a kick command.
@umbral zealot stfu I wanna know what function / async

#

is

umbral zealot
#

what

#

what do you mean

autumn aspen
#

what do you mean
@umbral zealot nothing

misty sigil
#

what

umbral zealot
#

I'm very confused as to what your actual question is

misty sigil
#

the function is the module.exports.run bit

#

yEa same

eternal sandal
#

@autumn aspen do you mean the function of the async keyword?

#

Because async just tells the interpreter that the command should run asynchronously (in the background) while other tasks get finished

autumn aspen
#

@autumn aspen do you mean the function of the async keyword?
@eternal sandal idk ask stan lol

eternal sandal
#

It's you asking the damn question

umbral zealot
#

we're all thoroughly confused at this point. Let's give him a minute to formulate his request.

autumn aspen
#

yes but he told me to look up for the right function

eternal sandal
#

Have you tried fetching the user object and running user.kick() or whatever the actual name of the function is

autumn aspen
#

Ok now take a look

#

wair

#

t

pale vessel
#

users can't be kicked

misty sigil
#

@eternal sandal its member.kick() actually

pale vessel
#

members can

misty sigil
#

users are user objects (e.g. tag, avatar)

#

members are guild specific

#

with roles and the punishment methods

eternal sandal
#

yes but he told me to look up for the right function
@autumn aspen he told you to "look up the function", which means "search for it in the documentation of discord.js"

autumn aspen
#

Code:

const Discord = require("discord.js");

module.exports.config = {
    name: "kick", 
    aliases: []
}
    
module.exports.run = async (client, message, args) => {
    if(!msg.member.hasPermission('KICK_MEMBERS')) return msg.channel.send(":x: **You don't have permission to kick members!** :x:");
        if (message.mentions.users.first() === message.author) return msg.channel.send(":x: **You can't kick yourself!** :x:");
        if (message.mentions.users.first().id === '731927983274721301') return msg.channel.send(":x: **You can't kick me!** :x:");
        let toKick = msg.mentions.members.first();
        let reason = args.slice(1).join(" ");
        if(!args[0]) return msg.channel.send('Please mention someone to kick.');
        if(!toKick) return msg.channel.send(`${args[0]} is not a member!`);
        if(!reason) return msg.channel.send('Specify a reason.');
 
        if(!toKick.kickable){
            return msg.channel.send(':x: **I cannot kick someone that is mod/admin or is/have higher role then me/you!** :x:');
        }
 
        if(toKick.kickable){
            let x = new Discord.MessageEmbed()
            .setTitle('Kick')
            .addField('Member Kicked', toKick)
            .addField('Kicked by', msg.author)
            .addField('Reason', reason)
            .addField('Date', msg.createdAt)
            .setColor(0xa54bff);
 
            msg.channel.send(x);
            toKick.kick();
        }
    }
#

Error:

(node:3780) UnhandledPromiseRejectionWarning: ReferenceError: msg is not defined
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\kick.js:9:5)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:3780) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3780) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Help

#

boom

shy turret
#

i want to check if a variable is a object but i also want to check if it is in this format {}

eternal sandal
#

with roles and the punishment methods
@misty sigil I much prefer manually swinging the banhammer. Physically

autumn aspen
#

there is the pb

misty sigil
#

same

shy turret
#

@autumn aspen "msg" is not defined

eternal sandal
shy turret
#

change msg to message

misty sigil
#

its message

pale vessel
#

read the error

eternal sandal
#

Liking you more and more

pale vessel
#

please

misty sigil
#

whitenames

autumn aspen
#

lol

shy turret
#

i want to check if a variable is a object but i also want to check if it is in this format {}. how is this possible?

shy turret
#

not a place for (dead) memes but ok

autumn aspen
#

lol

misty sigil
#

its dead because he died

shy turret
#

ikr

pale vessel
#

maybe if (JSON.stringify(obj)) == "{}")

shy turret
#

that wont work

eternal sandal
#

i want to check if a variable is a object but i also want to check if it is in this format {}. how is this possible?
@shy turret in JavaScript, every object is in the format of {}

autumn aspen
#

its dead because he died
@misty sigil no..just.no

misty sigil
#

can you explain it further

shy turret
#

@eternal sandal no, objects can also be in this format []

umbral zealot
#

that's not an object that's an array.

shy turret
#

aka arrays

eternal sandal
#

That's an array

pale vessel
#

arrays are objects

shy turret
#

yes but if i use typeof varname == "object" and the varname is an array...

umbral zealot
#

that's irrelevant. In javascript, everything is an object. It's an object-oriented language.

pale vessel
#

oh you mean that?

umbral zealot
#

But {} is an object object. [] is an array

earnest phoenix
#

and every object is a dictionary

eternal sandal
#

Oh, you mean you want to know if something is an array or an object of key-value pairs?

shy turret
#

[] using typeof is also an object

pale vessel
#

use if (typeof obj == "object" && !Array.isArray(obj))

shy turret
#

i need {}

#

hm smart

pale vessel
#

I thought you meant check an empty object

shy turret
#

lol

pale vessel
#

clarity please

violet mesa
shy turret
#

by..

#

changing it

pale vessel
#

feel like an idiot now

violet mesa
#

lol

shy turret
#

background-color:

eternal sandal
#

You could also check for the return value of Object.keys(obj)

autumn aspen
#

Finnaly thx guys!

#

needed to reaplace all msg to message

#

lol

pale vessel
#

that would show the elements inside the array

#

again, arrays are objects

#

sorry, not elements, indexes

#

elements would be Object.values(array)

violet mesa
#

background-color:
@shy turret i need to choose the box thingy tho

shy turret
#

I am also making a bot dashboard but if I do something like this, it won't give an error in the console:

xhr.send(JSON.stringify({}));

but this will:

xhr.send("not a {} or []");
#

SyntaxError: Unexpected token FIRSTCHARACTEROFTHEBODY in JSON at position 0

#

in some expressjs file

pale vessel
#

looks like it only accepts json, not sure

shy turret
#

ikr it should only accept json i think

#

but

pale vessel
#

by the way, check for null for your other thing, null is also an object

shy turret
#

there is an error

#

if it isnt a json

pale vessel
#

make it support non json or just send {"error":"error here"}

#

not familiar with xhr so i can't help

shy turret
#

xhr.send(what becomes req.body)

pale vessel
#

then something is trying to parse it as json

violet mesa
pale vessel
#

probably something in your dashboard template, dunno

shy turret
#

i cant tell if it is my code or expressjs now because ive done some debugging xD

#

oh frick

#

wait nvm

#

def expressjs

#

wtf is body-parser, idk if it will fix the prob

#

i dont use body-parser

snow crescent
#

bilgili türk varmı

shy turret
#

then how do i prevent the error

snow crescent
#

@shy turret bro where are you from

livid otter
#

@snow crescent buyur kanka

snow crescent
#

@livid otter kanka transfermarkt diye bi site var bildin mi

livid otter
#

duymadım ne işe yarıyo

grizzled raven
#

learn html and css

violet mesa
#

;-;

snow crescent
#

duymadım ne işe yarıyo
@livid otter futbol ile ilgili transfer olan oyuncuları söylüyor

grizzled raven
#

oh nvm that's a different question

#

but my answer is still correct

shy turret
#

@snow crescent i dont need to tell you 🙂

livid otter
#

api ile veri çekmek mi istiyosun

violet mesa
#

i just need one thing and im leaving html and css

grizzled raven
#

set background-color to whatever

violet mesa
#

XD

snow crescent
#

api ile veri çekmek mi istiyosun
@livid otter denilebilir transfer olan oyuncuyu bot ile bize anlık olarak atmasını istiyorum

livid otter
#

api dökümanları varsa okuyarak yapabilirsin büyük ihtimal tarifi de vardır orda

#

ama api desteklemiyolarsa başka site denemen lazım

violet mesa
#

the background is this tho
so if i change that it will change that

snow crescent
#

api dökümanları varsa okuyarak yapabilirsin büyük ihtimal tarifi de vardır orda
@livid otter dökümanlar nerede yazar

#

çok bilgim yok denilebilir

livid otter
#

siteyi bilmediğim için yorum yapamiyorum ama genelde footerda api ya da developers linkleri olur

snow crescent
#

anladım

#

teşekkür ederim

livid otter
#

rica ederim

violet mesa
#

@grizzled raven

sonic lodge
#

english only here

livid otter
#

why

violet mesa
#

@sonic lodge can u help me

sonic lodge
#

it's the rules

#

what are you trying to do @violet mesa

sonic lodge
#

change background-color

drifting wedge
#

guys

violet mesa
#

(sorry im new to this)

drifting wedge
#

aside from json, whats the best db?

violet mesa
#

im using python

#

its preaty good

drifting wedge
#

database

sonic lodge
#

then only apply it to the box

violet mesa
#

how do i do that

#

im to stoopid

sonic lodge
#

css selectors

#
.example-class {
  background-color: red;
}

#example-id {
  color: red;
}

/* change divs with class "example-class" */
div.example-class {
  background-color: red;
}```
violet mesa
#

ok

sonic lodge
#

find the class that contains the box and style it

drifting wedge
#
        for pre in prf:
            prefix = pre["prefix"]

        if prefix == None:
            prefix == '.'
        else:```py
#

saying prefix referenced b4 assingment

sonic lodge
#

the program reaches prefix == None without finding a prefix in the guild

drifting wedge
#

?

sonic lodge
#
prf = collection.find(guild_id2)
for pre in prf:
  prefix = pre["prefix"] # <-- this line is NOT reached, causing "prefix" to not exist```
#

just add prefix = None above all of that or something

violet mesa
#
.example-class {
  background-color: red;
}

#example-id {
  color: red;
}

/* change divs with class "example-class" */
div.example-class {
  background-color: red;
}```

@sonic lodge where do i put that?

sonic lodge
#

those are examples

#

you don't paste that anywhere

violet mesa
#
div.longdescription {
  background-color: red;
}
sonic lodge
#

in the <style> tags?

violet mesa
#

is this good

#

ok

#
<style>
div.longdescription {
  background-color: red;
}
  </style>
```this  doesnt work
#

oh

#

never mine

#

ty

#

works!!! ❤️

faint prism
#

Siruse
Serious*

violet mesa
#

this look cool

#

?

misty sigil
#

No

violet mesa
#

;-;

#

offensive but understandable

misty sigil
#

I cant read the description

violet mesa
#

how can i change all text color or do i needa do 1 by 1 types

#

by like p and h3

misty sigil
#

just color works on the div iirc

violet mesa
#

?

#

is there like dark gray i can use

#

?

#

for background

earnest phoenix
#

Hi im on discord making a bot currently it uses node v12 i need v14 i host my bot on heroku through github and i need to update node to v14 which im having trouble with yes I tried npm i n -g and all that so if anyone can help please do

quartz kindle
earnest phoenix
#

😭

quartz kindle
livid otter
#
if (message.content === `<@${client.user.id}>`) {
 message.reply('Prefix: - ')
}```
#

im used this command ind bot.js but tagged in phone not working

#

or sometime pc

quartz kindle
#

sometimes mentions come as <@!XXXXX>

#

with an extra !

#

because discord is weird like that

sonic lodge
#

it means the user has a nickname in the server iirc

quartz kindle
#

so you have to check if content equals <@XXX> and also if content equals <@!XXX>

#

@sonic lodge it used to be like that, but then apparently they changed it, and idk how it is now lol

sonic lodge
#

wat

opal plank
#

hold up

#

theres a limit to how big a thing can be in js?

livid otter
#

@quartz kindle Is set to if contains instead of equals?

opal plank
quartz kindle
#

how big can what be

opal plank
#

legit just watched my cache go boom

#

after 3Gb

quartz kindle
#

did the process crash?

opal plank
#

nah

#

its operational

quartz kindle
#

the cache just disappeared?

opal plank
#

yeah lmao

quartz kindle
#

that makes no sense lol

opal plank
#

ikr!

quartz kindle
#

how are you measuring that cache?

opal plank
#

erm, lemme pull it rq

#

the problem is, even the ram went down

#

ram is process.memoryUsage

#

it also went down to 281

quartz kindle
#

rss or heapused?

violet mesa
#
@bot.command()
async def dep(ctx, arg: int):
    await open_account(ctx.author)



    
    users = await get_bank_data()
    
    user = ctx.message.author
    
    if users[str(user.id)]["wallet"] >= arg:
        
       users[str(user.id)]["wallet"] -= arg
       users[str(user.id)]["bank"] += arg
       await ctx.send("succesfully transfered the cash")
    elif users[str(user.id)]["wallet"] < arg:
        await ctx.send("you dont have enough for that")

why dis no work

opal plank
#

rss

#

looping each channel, and adding its users size

violet mesa
#

?

#

lang

quartz kindle
#

rss can disappear if its memory is swapped by the system, but the data shouldnt be gone like that

#

can you access client.channel_cache?

opal plank
#

lemme try

drifting wedge
#

hoe does grafanae worke?

opal plank
#

Hmmm

#

im not getting any response in console

#

i think the system crashed

faint prism
#

It works with numbers and a bit of magic math

opal plank
#

what the heck?

#

how am i still getting metrics?

#

im so confused

#

not even evaling 1+1 to console is showing up

#

but im still getting metrics

#

and events recieved

#

wot??

#

OOOOH

#

im stupid

#

ignore me

violet mesa
#
@bot.command()
async def dep(ctx, arg: int):
    await open_account(ctx.author)



    
    users = await get_bank_data()
    
    user = ctx.message.author
    
    if users[str(user.id)]["wallet"] >= arg:
        
       users[str(user.id)]["wallet"] -= arg
       users[str(user.id)]["bank"] += arg
       await ctx.send("succesfully transfered the cash")
    elif users[str(user.id)]["wallet"] < arg:
        await ctx.send("you dont have enough for that")
```why no work??????
#

@opal plank idk howw to help sorry

opal plank
#

poof, gone, reduced to dust

quartz kindle
#

F

opal plank
#

well client exists

#

but channels_cache got reduced to dust

quartz kindle
#

something somewhere did client.channel_cache = undefined?

opal plank
#

nvm

#

its here

#

i did typo

quartz kindle
#

lmao

opal plank
#

did channelS

#

rather than channel

quartz kindle
#

noob

opal plank
#

ram slowly building up again

#

what the heck

quartz kindle
#

your bot dying

opal plank
#

i agree with you

#

i think i put a huge load on it to stress test it

violet mesa
#

can anyone help please

opal plank
#

hmmm its actually posting it as 0

#

so its internal error

sonic phoenix
#

donut you didnt ask a question

opal plank
#

im unsure how this can just stop working after a couple hours

drifting wedge
#

whats the on command error?

opal plank
violet mesa
#

donut you didnt ask a question
@sonic phoenix i did

#

i asked why it doesnt work

opal plank
#

maybe one was NaN or null?

#

or undefined?

sonic phoenix
#

no you didnt

#

you said "why doesnt it work" thats not really a valid question

violet mesa
#

k

sonic phoenix
#

if oyu drop your car off at the shop and say "its broken" they arent gonna konw what to do

violet mesa
#

no errors

#

just doesnt work

#

can you help me fix?

sonic phoenix
#

no cuz you havent asked a question

#

if you want someone to help you need to provide the problem, the expected output, the current output, what youve tried and any relevant code

violet mesa
#

but im asking for help cause idk whats wrong

sonic phoenix
#

well no one else knows either

snow crescent
#

türk varmııı

violet mesa
#

english only here

drifting wedge
#

how can i turn secs into mins?

#

or like if its less than a min

#

it says it in secs?

sudden geyser
#

divide by 60?

quartz kindle
#

if its bigger than 60, divide by 60 and say minutes

#

if its smaller than 60, say seconds

split hazel
#

isn't really coding 😛 you should've been taught this in math/physics

earnest phoenix
#

Hello! I just started an open source project!

#

its a trading card based rpg

#

I'm using discord.js

#

Is it necessary to use a foreach loop to get the user's listening activity and the name listening activity?

#

no?

errant hornet
#

How would I make the bot's status be how many users they are watching?
I've tried client.users.size but it doesn't work

This is discord.js

earnest phoenix
#
user.presence.activities.forEach((activity) => {
if (activity.type === 'LISTENING' && activity.name === 'Spotify') {
message.channel.send(activity.details)
}
})

How can I send a message if there is no spotify listening activity?

#

How would I make the bot's status be how many users they are watching?
I've tried client.users.size but it doesn't work

This is discord.js
@errant hornet What is your version of discord.js

errant hornet
#

let me check real quicjk

#

12.2.0

earnest phoenix
#

client.users.cache.size

errant hornet
#

Ok lets see if that worked

#

Yep it did. Thanks

earnest phoenix
#

np

errant hornet
#

Now how would you make it change status after few seconds?

earnest phoenix
#
var activities = [ `hello world!`, `hello dbl!` ], i = 0;
setInterval(() => bot.user.setActivity(`${activities[i++ % activities.length]}`, { type: "PLAYING" }),5000)
errant hornet
#

Thanks again

quartz kindle
#

note that the above method has a hard limit in the amount of status changes you can have

#

the limit is 9007199254740991

#

:^)

sudden geyser
#

teach me your power in calculating that

quartz kindle
#

Number.MAX_SAFE_INTEGER

silver lintel
#

[ null, { thing2: { stuff: 'asfdhasasd' } } ]

#

how do i remove the null with js?

stark abyss
#

just get the stuff you need instead

earnest phoenix
#

Idk if it will work with array

#

But .filter

earnest phoenix
#

hey

#

TypeError: this.client.player.searchTracks is not a function
at Play.run (C:\Users\matte\Downloads\VirtualBot2.01-master\commands\Music\play.js:44:43)
at module.exports.run (C:\Users\matte\Downloads\VirtualBot2.01-master\events\message.js:236:8)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

#

this is happening

#

if anybody wants to help dm me

#

pls dm me i really need help

shy turret
#

@earnest phoenix are you sharding?

earnest phoenix
#

no

#

heroku

fast trench
#

ok so I have a small website for my bot and it's help command. But when I click on a button to go to another page of the site the search bar adds the file type extension...is there a way around this? It's in html and css

#

nvm got it

earnest phoenix
#

can somebody please help me

#

Nice fork ig

#

🤦

#

i just waant help

opal plank
#

@earnest phoenix be patient angeryBOYE

earnest phoenix
#

Sorry

#

I kinda have had this error for like a week

opal plank
#

just like me i assume a bunch of people saw the issue, we just dont know what it may be

earnest phoenix
#

and im getting kinda fustrated

#

because the music has never worked for me

#

im sorry

opal plank
#

did u look at the file to see whats on it?

earnest phoenix
#

what the play.js?

opal plank
earnest phoenix
#

brb

#

Did you make it byyourself lmafo

opal plank
#

/Downloads, i doubt it lmao

unique patio
#

@earnest phoenix That's not a function

earnest phoenix
#

._.

#

thing

#

called

#

github

#

🤦

#

Theres high chance that the package deprecated some stuff

#

remember like 3 days ago

unique patio
#

Player does not contain the function searchtracks

opal plank
#

thats what you get for copying repos on github

unique patio
#

You defined it wrong.

earnest phoenix
#

i said my flashdrive broke

#

i had it on there and had to get it back

opal plank
#

did you init it?

#

i mean, you prob did

#

otherwise the thing would've error'd on declaration

#

though....

#

Javascript

earnest phoenix
#

there look at that

opal plank
#

high chance it might be undefined cuz you forgot to install dependencies

earnest phoenix
#

sorry didnt know that was a thing

#

oh

opal plank
#

its hastebin

earnest phoenix
#

hastebin

#

my bad

unique patio
#

const tracks = await this.client.player.searchTracks(args.join(" "), true).catch(() => {});

#

is only reference of such

#

Are you using it incorrectly?

earnest phoenix
#

lemme look

opal plank
#

Why?

#

why you using classes for this?

earnest phoenix
#

const tracks = await this.client.player.searchTracks(args.join(" "), true).catch(() => {});
if(!tracks || !tracks[0]){
return message.error("music/play:NO_RESULT");
} else if(tracks[0].fromPlaylist){
trackToPlay = args.join(" ");
isPlaylist = true;
} else if(args.join(" ").match(/(?:youtube.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu.be/)([^"&?/\s]{11})/)){
trackToPlay = tracks[0];
} else {
try {
if(tracks.length > 10) tracks.splice(10);
let i = 0;
const embed = new Discord.MessageEmbed()
.setDescription(tracks.map((t) => **${++i} -** ${t.name}).join("\n"))
.setFooter(message.translate("music/play:RESULTS_FOOTER"))
.setColor(data.config.embed.color);
message.channel.send(embed);
await message.channel.awaitMessages((m) => m.content > 0 && m.content <= 10, { max: 1, time: 20000, errors: ["time"] }).then(async (answers) => {
const index = parseInt(answers.first().content, 10);
trackToPlay = tracks[index-1];
}).catch((e) => {
console.log(e);
return message.error("music/play:TIMES_UP");
});
} catch(e){
console.log(e);
return message.error("music/play:NO_RESULT");
}
}

opal plank
#

with a constructor

faint prism
#

and a super

#

Haven't really seen that outside Java tbh

unique patio
#

Yeah this has improper linking

#

It's definitely undefined.

earnest phoenix
#

;-;

unique patio
#

Super is fine in JS

faint prism
#

I'm sure, just haven't seen it yet

unique patio
#

It's to pass values main scope

#

But the design of this is wrong? 😐

#

No imports/etc

earnest phoenix
faint prism
#

guess git clone doesn't "just werk" rip

unique patio
#

it's just discord

#

Class does extend to commands

#

but that's it

opal plank
#

i dont see why even bother extending it

unique patio
#

You got a bit of this backwards. 😐

opal plank
#

and not map it

unique patio
#

There may be reasons, and maping is inefficient unless it's a must.

opal plank
earnest phoenix
#

it has a package that does some of it

unique patio
#

To search through a list, you be best with a for iteration unless of course mapping is must.

earnest phoenix
#

its discord-player

unique patio
#

effecacy

opal plank
#

its already exporting the whole thing and using it with async run()

#

might as well call the whole thing with a export

earnest phoenix
#

Did you make the bot?

faint prism
#

"discord-player": "^2.3.1",

earnest phoenix
#

heh

#

no

unique patio
#

😛

faint prism
#

Might be that

opal plank
#

yeah figured as such

earnest phoenix
#

omg

#

how

#

brb

faint prism
#

I'm a Google Wizard 🪄

earnest phoenix
#

ok im scared

unique patio
#

?

opal plank
#

would you look at that

faint prism
opal plank
#

its the same

faint prism
#

lol

earnest phoenix
#

oh

opal plank
#

i said my flashdrive broke
i had it on there and had to get it back

earnest phoenix
#

stop

#

im sorry

opal plank
#

yeah good luck with that mate

earnest phoenix
#

i just want a cool bot

opal plank
#

not interested in that bs

faint prism
#

Make one

earnest phoenix
#

i did

#

i wanted a cooler one

opal plank
#

you copied it

faint prism
#

git clone != making a bot

opal plank
#

you didnt make anything

unique patio
#

I sued someone recently for copyright theft.

earnest phoenix
#

yeah i did

unique patio
#

lol

faint prism
#

I sued someone recently for copyright theft.
@unique patio but did you win?

unique patio
#

Yeah

earnest phoenix
#

no this is open and everyone copys it

unique patio
#

100%

faint prism
#

wow fr?

unique patio
#

DCMA rights take-down

opal plank
#

open repo doesnt mean you can use it

earnest phoenix
#

yeah

unique patio
#

Check this

opal plank
#

check the DCMA

faint prism
#

Noice

earnest phoenix
#

no everyone uses it

fading eagle
earnest phoenix
#

its called atlanta bot

unique patio
#

I pinched this kid

#

🙂

faint prism
#

oh shiiiit

#

sick

unique patio
#

TY Github btw lol

#

Hard-work should be respected

#

Love helping people but scrubs no ty

opal plank
#

niiice

unique patio
#

😄

opal plank
#

i should've done the same tbh back when one of my repos got taken

#

i just private'd it afterwards

unique patio
#

Yeah depending on how you set up licensing

#

Git protects you

#

and will remove content, I have many places my originals resume holdings

#

So in case of such I can have on date/file all my works

faint prism
#

I use GNU license

unique patio
#

and its attached license

#

You're better off using none.

#

🙂

#

Just put Copyright @ Auger

quartz kindle
#

i use MIT lul

unique patio
#

Not understanding licenses will get your stuff stolen

#

with loop-holes and defaulting to no copyright

#

atleast in USA

#

puts you as the holder

faint prism
#

Well it's open but GNU states you have to credit me

unique patio
#

So you do have copyright and it's your rules

#

Yeah if you like that terms use it

quartz kindle
#

the stuff i actually care about is all in private repos anyway

unique patio
#

If you want 100% ownership

#

don't use any of those

faint prism
opal plank
#

in single owned repos i guess its fine

#

for repos with shared collabs

unique patio
#

Good to read through the different licenses

opal plank
#

if a leak happens, well

unique patio
#

many exist

#

Big leaks happen all the time, even worse when someone sells your code to other companies to sell off

quartz kindle
#

thank god the lib i need the most is gpl v2 and not agpl

unique patio
#

Who's to be pinched?

quartz kindle
#

this way i can make an api with it without licencing