#development

1 messages · Page 1052 of 1

opal plank
#

@timber plume

solemn latch
#

gn

tulip ledge
#

Bye! 👋

opal plank
#

bye o/

timber plume
#

thankls

#

its too confusing for my pea brain

opal plank
#

its funny that i still use this

#

i have that on my bookmarks cuz i keep forgetting es6 syntax

timber plume
#

ok

#

so

#

is "lib.js" where function

opal plank
#

huh?

tulip ledge
#

I’vr never used export import before

opal plank
#

its a tad better

timber plume
#

im so confured

#

confused

opal plank
#

'lib.js' is your module

#

the file

tulip ledge
opal plank
#

this image sums it

#

ignore the v

timber plume
#

ok

opal plank
#

the good thing about import is that you can import them as

#

instead of using unecesssary vars

tulip ledge
#

Alright gn all! 👋

timber plume
#

IM SO CONFUSEDDDDDDDDDDDD

#

gn

opal plank
#
import {a as Something} from 'lib';```
as of
```js
const a = require('lib');
const Something = a
timber plume
#

the file i want to export the function is in a diff folder.

#

so

#

would it still be lib

#

or would it be commands/lib

opal plank
#

nto necessarily

timber plume
#

ok

opal plank
#

the function you want to import needs to be on a different file (thats the reason why you'd want to import)

#

being in the same folder or not doesnt matter

#

that thing i sent you is already for dummies

#

this is what you should be reading for an in-depth

timber plume
#

ok

#

thanks

opal plank
timber plume
#

do i define lib

#

lol

#

my file name isnt lib

#

do i change from lib

#

or is that like a server the data goes through?

opal plank
#

lib is just a foo name

timber plume
#

ok

opal plank
#

you can do default for individual or multiple exports

#

which the best part is that you dont need to specify each individually

timber plume
#

ok

opal plank
#

you can set their alias exports aswell

#

export {foo as Bar}

timber plume
#
export function mock(){
message.delete()
const mockword = message.content.slice(8)
message.channel.send(mockword)
}
#

import mock from 'lib';

#

so

#

that would mock?

opal plank
#

hmmm not sure that'd work cuz you arent passing anything

#

local scopes

timber plume
#

lemme try

opal plank
#

message doesnt exists inside that function

#

you need to pass message onto it

timber plume
#

this is so confusing

opal plank
#

you know scopes?

timber plume
#

no

#

im noob dev

opal plank
#

imagine this

#
let a = 1
function foo() {
let b = 2
}
console.log(a + b);
#

what would happen here?

timber plume
#

console would log 1

opal plank
#

it would error saying b is undefined

#

reason is, b is inside a function

timber plume
#

yes

#

i understand

#

oh no

misty sigil
#

nah, it'd say 1, undefined

opal plank
#

^^

misty sigil
#

wouldn't it?

opal plank
#

indeed

timber plume
#

see i was technically right

opal plank
#

but thats beyond the point

timber plume
#

i said 1

misty sigil
#

yea

opal plank
#

reason is, b is not defined in that scope

timber plume
#

okkkkkkkkkkkkk

opal plank
#

same goes for message

timber plume
#

i understand now

#

how long has jeremy been here

opal plank
#

because its an export im pretty sure it wouldnt load message unless you pass it onto the function

#

i could try rq, i always pass them out

misty sigil
#

here? uh

#

30/05/2020 about a month and a half

timber plume
#

no

#

in the channel

#

your account was created 3 years ago

misty sigil
#

yes it was

timber plume
#

i know that

misty sigil
#

now how about we head to #general, or get back on topic

timber plume
#

wait i get it nowwwwwwww

#

Unexpected token 'export'

slender thistle
#

Anyone knows Pascal here?

timber plume
#

spoon feed

#

plz

#

im so freaking confused

misty sigil
#

rule 7 has entered the chat

timber plume
#

ik

#

yolo

#

im just gonna put functions at the end of my code

#

insted of having them in dif files

#

my code is a mess

opal plank
#

the fact that my index is 240 lines long is concerning, it could be shrank down to 100 i'd say

timber plume
#

mine is 245

opal plank
#

not too bad

#

my index on this bot used to be over 870, i managed to shrink it to 300 then kept optimizing from there

#

and it was 870 even with my command n shit outside of it

#

1-67 dependencies and startup
68-210 - discord events
211-226 - IPC events
226 - 238- eval

misty sigil
#

which bot

opal plank
#

@earnest phoenix though on the beta branch

#

the stable branch has...

#

283

errant perch
#

how do i set text inside of .setFooter() to a link

opal plank
#

its only txt if i recall

misty sigil
#

hyperlink?

#

no

#

i dont think

opal plank
#

i think its only text mah dude

errant perch
#

i figured

errant perch
#
        var https = require('https');
        var url = `https://www.reddit.com/r/memes/hot/.json?limit=100`
                https.get(url, (result) => {
                    var body = ''
                  result.on('data', (chunk) => {body += chunk})
                  result.on('end', () => {
                        var index = JSON.parse(body).data.children[Math.floor(Math.random() * 100) + 1].data
                        var embed = new Discord.MessageEmbed()
                            .setTitle(index.subreddit_name_prefixed)
                            .setImage(index.preview.images[0].source.url.replace('&', '&'))
                            .setColor(color)
                            .setDescription(`[${index.title}](${'https://reddit.com' + index.permalink})`)
                            .setURL(`https://reddit.com/${index.subreddit_name_prefixed}`)
                        message.channel.send(embed)
                    })
                })
          break;```
#

my friends said this code was unsafe

#

uh

#

can someone explain to me whats unsafe about it

earnest phoenix
#

Y’all have your events in your index.js?

glossy elk
#

Can someone explain

#

what index is

#
data = await Promise.all(data.map(async (data, index) => {
    const user = await client.users.fetch(data.key.split("-")[2]).catch(() => null)
    if(user) {
        return {
            tag: user.tag,
            level: data.value.level,
            rank: index + 1
        }
    }
}))```
#

Y’all have your events in your index.js?
@earnest phoenix no i just use an event handler

strange trout
#

index of the current element

earnest phoenix
#

Ahh

#

Same

sick cloud
#

if i have a number like 2 how do i turn it to it's negative ie. -2

#

in js

earnest phoenix
#

*-1

sick cloud
#

and will that have any other effects or just negative it

opal plank
sonic lodge
#

no, no other effects

opal plank
#

¯_(ツ)_/¯

sick cloud
#

pretty cool

#

ty

#

had to make it negative so moving sideways wasn't opposite

opal plank
#

you using js for that? looks like unity project

sick cloud
#

it's using webgl and js

opal plank
#

ah i see

sick cloud
#

it'd be nice if it actually had a purpose, like making a 2d top down world. for now though that's it lol

sudden geyser
#

You don't need that *-1 btw, just prefix the number/variable with -

opal plank
#

i was thinking of rendering a map for a future project

#

but that'd be kinda advanced for what im currently working with

obtuse jolt
#

Not very big brain

stark abyss
#

const commandFiles = fs.readdirSync('./allCommands/classic/').filter(file => file.endsWith('.js'));
why isn't this working? allCommands and classic are both folders
it worked when i didn't have classic folder but i wanted to have folder for each category
please ping me
What I want to do is create folders for category instead of putting all files in one folder. That's easy alone, but it's hard to use the same method of module exports and fs.readdirSync

quick kindle
#

Need some help in regards to making an embed when the bot first starts.

stark abyss
#

well i am no programmer but i think i can answer basic questions

sonic lodge
#

don't ask to ask, just send your question

stark abyss
#

can someone answer my question doe

#

fr fr i been working on it for too long now

quick kindle
#

Every time my bot sends out message is not defined~

stark abyss
#

show code

quick kindle
#

2 secs

sonic lodge
#

is there some error @stark abyss

quick kindle
#
bot.on('ready', () => {
    console.log('bot is on!');
    const embed0 = new Discord.MessageEmbed()
            .setTitle ('TryBot')
            .setDescription(':TryGTick: The shard just respawned !')
            .setAuthor('TryBot Status')
            .setThumbnail('https://i.gyazo.com/da90040b7acd59427216c9f6a01471ff.jpg')
            .setColor('#9700FF')
            .setURL('https://i.gyazo.com/da90040b7acd59427216c9f6a01471ff.jpg')
            .addField('Shard 0', 'Shard Status \`Online\`', true)
            .setTimestamp()
            .setFooter('Thanks for using TryBot!')
            message.channel.send(embed0);
    bot.channels.cache.get('730940552333492375').send(embed0);
    bot.user.setActivity(">commands")```
stark abyss
#

yes

#

:TryGTick: isn't gonna work i don't think

sonic lodge
#

message.channel.send(embed0);

stark abyss
#

^

sonic lodge
#

this si causing the problem; message isnt defined

quick kindle
#

thats correct

sonic lodge
#

so

#

you need a textchannel object to send messages

quick kindle
#

and how do i do that?

stark abyss
#

well oopled do you have any idea in terms of how to use multiple folders to do this
const commandFiles = fs.readdirSync('.allCommands/classic/').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const command = require(.allCommands/classic/${file});
client.commands.set(command.name, command);
}

#

because i had one folder all files in it and it worked beautifully but i have too many files to add and i have more folder for each category

sonic lodge
#

first of all, why are you trying to send messages in the ready event

quick kindle
#

To show that the bot is online and ready

sonic lodge
#

you can just console.log('ready')

stark abyss
#

he is probably tryna make a channel to show status of the bot

quick kindle
#

^

stark abyss
#

it's dumb ngl

sonic lodge
#

oh, so you have a specific channel you want to log status to?

frosty knoll
#

hey

#

can so help me ?

stark abyss
#

yes

frosty knoll
#

so

stark abyss
#

don't ask to ask just ask

quick kindle
#

Yes its specified

frosty knoll
#

okay sorry

sonic lodge
#

i see

frosty knoll
#

so i m conding a discord bot

#

to music

stark abyss
#

music bot yes

frosty knoll
#

yes lol

sonic lodge
#

you need the ID of your status channel

quick kindle
#

I have that

frosty knoll
#

and i have a probleme with a specify command

#

query_string = urllib.parse.urlencode({"search_query" : input()})
html_content = urllib.request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall(r'href="/watch?v=(.{11})', html_content.read().decode())
print("http://www.youtube.com/watch?v=" + search_results[0])

sonic lodge
#

bot.channels.resolve('id here') will return a textchannel object representing your status channel

remote yacht
#

which port should i use for my webhook url?

quick kindle
#

And where will that need to go?

frosty knoll
#

bot.channels.resolve('id here') will return a textchannel object representing your status channel
@sonic lodge i didint understand

sonic lodge
#

you can use it like this

var embed = ... // you define your embed here
var statusChannel = bot.channels.resolve('channel id here');
statusChannel.send(embed);
quick kindle
#

Sure

frosty knoll
#

ah yes sorryt

#
html_content = urllib.request.urlopen("http://www.youtube.com/results?" + query_string)
search_results = re.findall(r'href=\"\/watch\?v=(.{11})', html_content.read().decode())
print("http://www.youtube.com/watch?v=" + search_results[0])```
slender thistle
#

What's that code snippet supposed to do

#

I'd suggest moving to aiohttp completely, urllib is blocking

frosty knoll
#

its similary

#

?

slender thistle
#

.... kind of

quick kindle
#

now its reading status is not defined

sonic lodge
#

that's somewhere else now

#

where is the error occurring?

quick kindle
#
bot.on('ready', () => {
    console.log('bot is on!');
    var embed4 = new Discord.MessageEmbed()
        .setTitle ('TryBot')
        .setDescription(':TryGTick: The shard just respawned !')
        .setAuthor('TryBot Status')
        .setThumbnail('https://i.gyazo.com/da90040b7acd59427216c9f6a01471ff.jpg')
        .setColor('#9700FF')
        .setURL('https://i.gyazo.com/da90040b7acd59427216c9f6a01471ff.jpg')
        .addField('Shard 0', 'Shard Status \`Online\`', true)
        .setTimestamp()
        .setFooter('Thanks for using TryBot!')
    var statusChannel = bot.channels.resolve('730940552333492375');
    status.channel.send(embed4);    
    bot.user.setActivity(">commands")
#

status.channel.send(embed4)

frosty knoll
#

in search_results i think

sonic lodge
#

oh

slender thistle
#

What's the error, RedArms

sonic lodge
#

statusChannel, not status.channel

frosty knoll
#

What's the error, RedArms
@slender thistle IndexError: list index out of range

slender thistle
#

Nice

#

search_results is an empty list

#

and you're doing search_results[0] trying to access the first element

frosty knoll
#

but theye arnt element

#

but why

quick kindle
#

Thanks got it working!

#

life savers

frosty knoll
#

@slender thistle i didint understand

slender thistle
#

print(search_results)
output: []

#

to access a first element of a list, there needs to be one

#
>>> my_list = ["first", "second", "third"]
>>> my_list[0]
'first'
frosty knoll
#

but the script search youtbe link from keyword

#

ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

okayyyyyyyyy

#

lol

slender thistle
#

re.findall return a list

#

And sometimes it can return an empty list

#

so basically what you get is

search_results = []
search_results[0]```
#

which is equivalent of ```py

my_list = []
my_list[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range

frosty knoll
#

yes i understant

#

the list is empty

#

so

#

there is not elements

slender thistle
#

mhm

#

One easy way to check that is if search_results:

frosty knoll
#

but why the list is empty ?

slender thistle
#

Because nothing was found for the query

frosty knoll
#

i tried with minecraft

#

and nothing found

stark abyss
#

for (const file of commandFiles) {
const command = require(./classic/${file}), require(./gambling/${file});
client.commands.set(command.name, command);
}
well ofc this is wrong, but how can i have it require 1+ folders in that const command?

#

bruh why is no one helping me

#

@slender thistle don't get mad at me for pinging if you wanna help, help else ignore

#

i am frustrated Catcry

slender thistle
#

(I don't JS, sorry)

stark abyss
#

ok thx

opal plank
#

why notreaddirSync?

frosty knoll
#

@slender thistle you have a solution ?

opal plank
#

@stark abyss

frosty knoll
#

@slender thistle i cheked the list is empty but how to resolve it

slender thistle
#

if search_results:
video found
else:
video not found

opal plank
#

yo shivaco, while you're here, which lib have you made?

frosty knoll
#

but why they are not video found

slender thistle
#

dblpy

opal plank
#

hmmm i see

#

you dont happen to know the awnser for my previous question, would you?

errant perch
#

top gg dead

slender thistle
#

The managed role?

opal plank
#

yeah, when a bot joins it autocreates a role for it, though im unsure if its discord doing that or the lib

slender thistle
#

Discord

opal plank
#

hmmm thats a shame

stark abyss
#

@opal plank mind explaining it in a simpler way

slender thistle
#

A managed role is a role created automatically by Discord

opal plank
#

@stark abyss read the dirs inside a folder

stark abyss
slender thistle
#

hence you can't delete it yourself

opal plank
#

hmmm i see

#

ty

#

@stark abyss folder/category/commands

#

if you read folder you can loop em

stark abyss
#

@opal plank that’s what I am doing...? I am tryna use two folders in one const or other easier way

#

Oh

#

Well what do I do use for loop

opal plank
#

for (category in folder) do require

stark abyss
#

Oh

#

Can I slid into your dm later if I need some quick help?

opal plank
#

keep help in here

#

dm's only for support

stark abyss
#

What’s the difference between support and help

opal plank
#

not support for HERE, support for MY stuff

stark abyss
#

Oh I get it

opal plank
#

also your question might be someone elses question too, might aswell keep it here

stark abyss
#

You’ll take help but won’t help basically lmao

#

Ok

#

Well I just got off laptop so I’ll try tomorrow can I ping u then for help?

opal plank
#

hmm

stark abyss
#

Ok I won’t

#

Well thx anyway

opal plank
#

usually the gist is: ask and wait until someone awsners, i usually stay here quite constantly, if im here i'll help, but someone might come first

stark abyss
#

Ok

steep ocean
#

anyone know's how to make a discord bot website dashboard?

lyric mountain
#

Gotta learn some react/html/python/java whatever

#

There are more options out there

#

But you'll need to learn some web programming that's for sure

#

I'd say react is the easiest to hop in, but that's my opinion

earnest phoenix
#

Heyo!
How do I have my bot create a channel on a command (Not !createchannel)

Example: z!logs I have created a channel named #logs

zealous vortex
#

Hi

earnest phoenix
#

Can someone help me with discord.py, my custom prefix command isn't working and I dont know why

#

What problem

slender thistle
#

What does your file look like

#

(prefixes file)

earnest phoenix
#

like the code?

slender thistle
#

The file that contains the prefixes

earnest phoenix
slender thistle
#

prefixes.json

earnest phoenix
#

nothing is in inside prefixes.json

slender thistle
#

There you go

earnest phoenix
#

well ik that's the error

#

but why

#

it's suppose to put info in there

slender thistle
#
>>> import json
>>> json.loads("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ezboo_000\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\ezboo_000\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\ezboo_000\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
earnest phoenix
#

ik it's empty..

#

but it's suppose to by default do the prefix

#

in the server

slender thistle
#

you are not handling the error

earnest phoenix
#

wdum

#

nothing is working not even my other cmds

#

and idk what I did wrong

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

in get_prefix errors out

#

aka an exception is thrown

#

You are not try-excepting it

earnest phoenix
#

?

#

It was working

#

when I didn't tho

amber fractal
#

thats because that wont always produce an error

#

when the file is correct json that wouldnt error

earnest phoenix
#
import discord 
import json
import random
from discord.ext import commands

def get_prefix(bot, message):
    if not message.guild:
        return commands.when_mentioned_or("!")(bot, message)

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

    if str(message.guild.id) not in prefixes:
        return commands.when_mentioned_or("!")(bot, message)

    prefix=prefixes[str(message.guild.id)]
    return commands.when_mentioned_or(prefix)(bot, message)

client = commands.Bot(command_prefix=[get_prefix, ‘n!’]) 
startup_extensions = ['cogs.prefix','cogs.corona'] 

@client.event
async def on_guild_join(guild):
    chane = [x for x in guild.text_channels if x.permissions_for(guild.me).send_messages][0]
    await chane.send('Thanks for adding me!')
    with open('prefixes.json', 'r') as f:
        prefixes=json.load(f)

    prefixes[str(guild.id)] = "!"

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)

@client.event
async def on_guild_remove(guild):
    with open('prefixes.json', 'r') as f:
        prefixes=json.load(f)

    prefixes.pop(str(guild.id))

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)

@client.event
async def on_ready():
  servers = "{:,}".format(len(client.guilds))
  print('Successfully logged into {0.user} with an ID of {0.user.id}'.format(client))
  await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{servers} servers | n!prefix"))
  
if __name__ == "__main__":  # When script is loaded, this will run
    client.remove_command("help")
    for extension in startup_extensions:
        try:
            client.load_extension(extension)  # Loads cogs successfully
        except Exception as e:
            exc = '{}: {}'.format(type(e).__name__, e)
            print('Failed to load extension {}\n{}'.format(extension, exc))  # Failed to load cog, with```
#

this was my old code and it worked

#

so it's not try/except.

slender thistle
#

Was that when your file actually had a proper JSON syntax

amber fractal
#

as I said, it wont always error

earnest phoenix
#

Shivaco what

slender thistle
#

You are trying to convert a file with NO CONTENT into a JSON

amber fractal
#

The point of a try/except is to catch the error if there is one, which is not guaranteed

earnest phoenix
#

It doesn't need proper json

#

it formats it on its own

#

thats the entire point

slender thistle
#

let's see

amber fractal
#

Then you wouldn't get a JSONDecode error would you?

slender thistle
#

on_message error

#

What does on_message do

earnest phoenix
#

Nothing is suppose to be in the json

#

beside {}

#

and I put {} in it

#

then it does the rest

slender thistle
#

get_prefix is called from on_message

#

and the error is happening on line 11

#

which happens to be prefixes=json.load(f)

delicate shore
#

How to add cooldown

#

To my commands

#

Per user

slender thistle
#

Could you please start using single messages for your questions

delicate shore
#

O

amber fractal
#

easiest way is to store a dictionary of user id's to timestamps of when the time they can use the command again

earnest phoenix
amber fractal
#

then when they use the command, check if it exists and the timestamp is less than what's stored if it is, tell them to wait. Otherwise run the command and update the entry or insert it

delicate shore
#

I know this issue ^

#

O

earnest phoenix
#

Wtf am i doing wrong

#

you guys are not understanding that the code

#

was 100% working

#

3 hours ago

amber fractal
#

and 3 hours ago you had proper json

earnest phoenix
#

so the error isn't in the code...

#

ALL I HAD IN THE JSON WAS {}

#

what more is there to it

amber fractal
#

you wouldnt get a JSONDecode error if your json was proper

earnest phoenix
#

So tell me

#

how do u format the json hm?

#

because all you need is {}

#

so..

amber fractal
#

And you're getting very mad, so just calm down real quick

earnest phoenix
#

I'm not mad

amber fractal
#

getting angry doesnt help you solve an issue

earnest phoenix
#

I'm annoyed that you saying im doing my json wrong

#

when im not

amber fractal
#

And I'm saying, unless there's a bug with python with json, which I doubt, your json is wrong

earnest phoenix
#

json file

slender thistle
#

Your bot probably wipes/wiped the entire file when you close/closed it

amber fractal
#

whether you can accept that fact or not

earnest phoenix
#

how do i fix it then

amber fractal
#

you could start with adding a try/except as advised

slender thistle
#

Write to the file in a background task, don't open it in w mode each time an event happens

#

you open the file per each message sent

earnest phoenix
#

a try/except isn't needed tho

#

that's not the error

#

I want the error

slender thistle
#

And the error is loading an empty string

prime trout
#

sorry if I ask, but what is the script (JavaScript) to join the bot in vocal?

earnest phoenix
#

shivaco I do NOt get what u mean

#

WDUM EMPTY

slender thistle
prime trout
#

sorry for the inconvenience

earnest phoenix
#

omfg

slender thistle
#
while True:
    with open(file, "w") as f:
        f.write(f"{i} = {i}")```
file is empty when I open it while that code snippet is running
earnest phoenix
#

shivaco

#

wtf is suppose to be in the file then..

tawny cape
#

Hello i need help I added a features a new features that require new permission so i changed the invite link but what should I do for the old servers ?

earnest phoenix
#

I understand

#

it's empty/no prefix

#

but why

slender thistle
#

There's nothing wrong with the file itself. Your overall system of opening and writing to the file is just... not exactly well written

earnest phoenix
#

shivaco

#

but that's not the issue it can't be

#

if it was working earlier

#

I just rolled my code back

#

hmm

cinder bough
#

Hello Admin, I need some advice relating to bot for my channel. Can you tell me please how can I get it? Thanks.

delicate shore
#

how to add a random command

#

so peron can choose

#

i mean bot can choose from 1 to 10 a random no

#

and send it

restive pebble
#

it has default export and should work

#

oh lul

#

i forgot to compile ts nvm

#

@delicate shore math random

rigid maple
#

How do I get the bot to ask questions in order

restive pebble
#

await

rigid maple
#

What is your sample bot name? it will ask

#

It will ask my last name after writing my name

restive pebble
#

oh wait

#

message collector

#

use

rigid maple
#

and will delete previous questions

#

yes i don't know how to use it

#

can you give an example ?

earnest phoenix
#

@slender thistle the discord.py API was having issues that's why It wasn't working

#

not discord.py but the DISCORD api.. idk actually but some API was the reason my bot wasn't working

#

because its working now

#

my friend was having same issues

#

so probs api

#

or vps idk

#

it was something 😂

restive pebble
#

@rigid maple discord guide has an example

#

u can use awaitMessages

rigid maple
#

thanks ❤️

slender thistle
#

oh well whatever

earnest phoenix
#

good news is it works

tribal rock
#

guys, on the edit bot page, in the webhook url input should I put the url generated by the webhook that I created on discord?

earnest phoenix
#

@slender thistle

#
@client.event
async def on_guild_remove(guild):
    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{servers} servers | n!prefix"))
    with open('prefixes.json', 'r') as f:
        prefixes=json.load(f)

    prefixes.pop(str(guild.id))

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)```
#

is this the right way to be popping it out of the json

slender thistle
#

Not exactly but... it should work

#

I'd suggest a caching system for prefixes though

eternal oriole
#

I restart my bot and now messages are doubling up, i only have 2 bots running no VS is open ive changed token no luck... can someone help me find the error cause i havent edited anything for it todo so..

lusty quest
#

so only 1 instance of the bot is running?

#

did you use d.js? if yes did you pass the token to the Client constructor and have client.login() defined?

#

if yes remove client.login()

eternal oriole
#

discord.js yes and yes i have client.login()
if i use my aliases it doesnt double up if i use the raw code it does

eg !wrk = 1 message
!work = double message

lusty quest
#

did you pass your token to the client constructor too? const client = New Client({TOKEN: YOURTOKEN})

earnest phoenix
eternal oriole
#

yeah

lusty quest
#

then remove client.login() other wise you get 2 Clients running

eternal oriole
#

ive got
const bot = new Discord.Client();
const config = require('./config.json');
bot.config = config;
Then the login at the bottom

lusty quest
#

ok then client.login is correct

eternal oriole
#

i have the token in my client sorry misunderstood

lusty quest
#

maybe there is something wrong with your command handler

delicate shore
#

@delicate shore math random
@restive pebble i did but

eternal oriole
#

yeh well i was stuck on the command handler for almost a month now that ive cleaned it up it worked for 1 day now double ups...

delicate shore
#

wtf
the entire life of a programmer in one word

eternal oriole
#

would u mind taking a look for me @lusty quest ?

lusty quest
#

post your handler here

delicate shore
#

guys

#

gg

#

to i

#

u

lusty quest
#

?

restive pebble
#

wot

eternal oriole
#

thanks mate...

restive pebble
#

@lusty quest what happens when i do npm unpublish

lusty quest
#

idk

restive pebble
#

does it remove the whole package?

lusty quest
#

@eternal oriole you load your command twice

restive pebble
#

or only last version

#

ah ok

lusty quest
#

@eternal oriole line 53 and 55

golden condor
#

I think it removes the latest version published, lemme check

lusty quest
#

i never puplished any NPM package. so i cant tell you im not Tim

golden condor
#

You can remove a certain version of a package

#

Or you can remove the whole package

restive pebble
#

oh nice

#

thx bro

golden condor
#

Np

restive pebble
#

k thx

#

ill look

eternal oriole
#
fs.readdir("./commands/", (_err, files) => {
    files.forEach((file) => {
        if (!file.endsWith(".js")) return;
        let props = require(`./commands/${file}`);
        let commandName = file.split(".")[0];      
        bot.commands.set(props.help.name, props);
        props.help.aliases.forEach(alias => {
            bot.aliases.set(alias, props.help.name);
        console.log(`👌 Command loaded: ${commandName}`);
        })
``` @lusty quest hense why i was stuck on this for a month. its still doubling..
lusty quest
#

hmm looks fine for me. are you sure your updated the code properly (uploaded to your server if the bot is running there)?

#
fs.readdir("./commands", (err, files) => {
        if (err) return console.log(err)
        let file = files.filter(f => f.split('.').pop() === "js")

        file.forEach(f => {
            let prop = require(`../commands/${f}`)
            bot.commands.set(prop.command.name, prop)
            if (prop.command.aliases) {
                prop.command.aliases.forEach(a => {
                    bot.aliases.set(a, prop.command.name)
                })
            }
        })
    })
``` i used this handler for a while and i had no duplicates.
lusty spade
#

i trying to make it to show the role name but i shows this instead <@&720997710819360913>
code:

    const newMemberRoles = newMember.roles.cache.map(role => role.toString());
    const oldMemberRoles = oldMember.roles.cache.map(role => role.toString());

    newMemberRoles.forEach(async (p) =>{
        if(!oldMemberRoles.includes(p)) {
            logchannel.send(
                `\`[${moment(newMember.createdTimestamp).format('HH:mm:ss')}]\` ✏️ **${oldMember.user.username}**#${oldMember.user.discriminator} (ID: ${oldMember.user.id})was given the \`${p}\` role.\n\`[Time]\` ${moment(newMember.createdTimestamp).format('dddd, MMMM Do YYYY, h:mm:ss a')}`,
            );
        }
        else{
            return;
        }
    });```
lusty quest
#

you only display the role object (p). This defaults to the mention in the chat, if you want the name you need to add .name i think

eternal oriole
#

bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();
//Read Commands Folders//
fs.readdir("./commands/", (err, files) => {
    if(err) console.log(err);

    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0){
    console.log("Couldnt find any commands");
    return;
}
    jsfile.forEach((f) => {
        let props = require(`./commands/${f}`);
        console.log(`${f} loaded!`);
        bot.commands.set(props.help.name, props);
        
        props.help.aliases.forEach(alias => {
            bot.aliases.set(alias, props.help.name);
        })
    })
})

i mean this works but doesnt use my aliases i use

module.exports.help = {
    name: 'ping',
    description: "status of bot!",
    aliases: ["p", "status"]
}
lusty spade
#

@lusty quest i have tried to add .name and .id, both of them comes out undefined

plucky harness
#

anyone who uses a postgresql database here?

#

my when i check for my postgresql ports using netstats its only open in tcp6 not in tcp

lusty quest
#

@lusty spade look in the docs what you can use

lusty spade
#

docs is currently down

clever vector
#

Hello guys

#

how can i make my bot custom prefix

earnest phoenix
#

How long does it usually take to get your bot officially verified by Discord? It says 5 business days — but I have been waiting 11 days and still no response.

golden condor
#

@clever vector database

clever vector
#

@golden condor Yo dude

#

its me

golden condor
#

@earnest phoenix they have no guaranteed turnaround time but you should expect somewhere between 1-3 weeks

clever vector
#

@golden condor

golden condor
#

Sorry I don't know who you are

clever vector
#

Virak

#

LoL

earnest phoenix
#

@earnest phoenix they have no guaranteed turnaround time but you should expect somewhere between 1-3 weeks
@golden condor thanks bro

golden condor
#

Np

clever vector
#

@golden condor You know the bot that we do in Glitch.com?

#

like rini

#

or maybe something

golden condor
#

No I don't

clever vector
#

......

#

how about corgis

#

you know?

earnest phoenix
#

because i am checking my email every hour to check if discord responded xd

golden condor
#

Please stop pinging me, I don't remember everyone who I helped

#

Or everything they did

clever vector
#

dude

#

in my project

golden condor
#

I don't use glitch

clever vector
#

LoL

#

cxllm

#

is you??

#

cxllm

golden condor
#

Not anymore

clever vector
#

Why

golden condor
#

Can you please keep this conversation outside of here

clever vector
#

This is my name

#

Virak
@Virak_01

golden condor
#

This is development

slender thistle
#

Keep this channel on topic

clever vector
#

😦

#

the guy who i remember

#

lost his

#

story when he did the bot with me

golden condor
#

I didn't do your bot with you

#

I helped you out with a small section of code

plucky harness
#

my when i check for my postgresql ports using netstats its only open in tcp6 not in tcp

#

any solution?

earnest phoenix
#

mk so i need help with bootstrap

hazy sparrow
valid frigate
#

and it looks flat generally, as it's supposed to be

#

but as soon as it sees a message zoom

#

and to be clear, i dont need any caching like at all so yeah

#

this was after a theory i had on what was causing memory to "leak" and ive singled it out on the library, so would anyone happen to know a solution to this

golden condor
#

Try using intents @valid frigate

indigo cloud
#

hello

valid frigate
#

ok so basically all i really need is listening for messages

indigo cloud
#

anyone free to help me with something?

valid frigate
#

so i set these two intents

jaunty junco
#
        if member:hasPermission(0x00000004) or member:hasPermission(0x00000008) then
            local mentioned = message.mentionedUsers
            if #mentioned == 1 then
                message:delete()
                message:reply("The ban hammer has come, and it has chose to land on <@!"..mentioned[1][1]..">!")
                member.guild:banUser(mentioned[1][1])                
            end
            if #mentioned > 1 then
                message:delete()
                message:reply("You can only ban 1 person at a time you bot!")
            end
            if #mentioned < 1 then
                message:reply("Try to mention someone next time so that i can ban them!")
            end
        else 
            message:reply("<@!"..memberid.."> you dont have the permissions required to ban people, you noob!")
        end
    end```
how do i make it actually delete the messages of the one that is getting banned?
valid frigate
golden condor
#

You could just use an array

valid frigate
#

what intents are necessary for just messages

#

i thought intents was a bitfield?

#

or message partials

golden condor
#

No you can do an array of them

valid frigate
#

that's besides the point

golden condor
#

I think it's just GUILD_MESSAGES

#

And if you want dms

#

DIRECT_MESSAGES

valid frigate
#

dont care about dms

golden condor
#

so do this

#

intents: ["GUILD_MESSAGES"]

valid frigate
#

actually ive been concerned about how djs caches members

#

cuz once the bot receives a message i inspected the process and saw that the members object on the heap didnt decrease in size at all

#

so it just constantly adds new members

golden condor
#

You could sweep the cache on routine?

valid frigate
#

ah ok

#

problem is how do i sweep the member cache

golden condor
#

I'm not sure about that

valid frigate
#

okay i'm gonna try clearing the cache on an interval via UserManager.cache.clear()

#

lmao moving client to global scope moment

delicate shore
#

Guys

#

I wanna make my bot do a command

#

Like if someone does

#

s!nuke

#

The bot deletes the channel and create a clone channel with same name and same perms

golden condor
#

<TextChannel>#clone

delicate shore
#

Wot

golden condor
#

It clones the channel

#

Exit the process

delicate shore
#
if(command === "nuke"){
If(!msg.author.hasPermission("ADMINISTRATOR")) return msg.reply("You don't have perms")

<TextChannel>#clome
}```
golden condor
#

Dude

delicate shore
#

Lol

#

Ok

golden condor
#

You don't literally put that

delicate shore
#

I have to get channel ID

golden condor
#

Smh

#

No you don't

delicate shore
#

Channel name

golden condor
#

Omfg

#

Do I really have to do this for you

delicate shore
#

No

golden condor
#
message.channel.clone()
message.channel.delete()```
delicate shore
#

Ok

#

Thanks

golden condor
#

How to stop a bot? HELP ME
@earnest phoenix CAN YOU GIVE US MORE INFO THAN THAT

delicate shore
#

What host you use

#

And etc

honest perch
#

Cntr c

#

In terminal

#

Or if using pm2 its pm2 stop name

golden condor
#

^

delicate shore
#

How to make bot listen

#

For reply

#

Like

#

If he does s!nuke

golden condor
#

Can you please look at the docs

delicate shore
#

And he will ask

#

Are you sure about that ?

#

O

honest perch
#

Docs pffff

#

Docs are for noobs

delicate shore
#

^

golden condor
#

@delicate shore if you agree I suggest you go look at them.

honest perch
#

Just straight up yeet the code

delicate shore
#

@delicate shore if you agree I suggest you go look at them.
@golden condor
What is the function called so I can see docs

golden condor
#

Smh

delicate shore
#

await

golden condor
#

It's so clearly documented you can just do it

plucky harness
#

my postgresql has auto disabled ipv4 and is only accepting ipv6 help

honest perch
#

Sql

#

Bad

delicate shore
#

Oo

golden condor
#

There I've done half the work for you

delicate shore
#

Thanks

golden condor
#

Now just click the link, and scroll down, that's pretty easy isn't it?

honest perch
#

No

golden condor
#

Or you can press the big button that says awaitMessages

jaunty junco
#

how do i make it delete the messages of the member that is being banned, i have searched far and wide in the wiki (discordia btw)

golden condor
#

And magically you get redirected to the docs for it

#

@jaunty junco it should do that automatically if you don't pass any options

jaunty junco
#

problem is it doesnt

golden condor
#

Lemme check the docs

jaunty junco
#

i tried a lot of times with everything related to deleting a message and it doesnt work

honest perch
#

How does one make a queue command

jaunty junco
#

by not making it

golden condor
#

@jaunty junco the banUser method works like this (it says on the docs)
guild:banUser(id, reason, days) days being the amount of days to delete the messages from, the max being 7

jaunty junco
#

ohhhhhh

#

ok thanks

golden condor
#

Np

jaunty junco
#

so what do i do with it?

#

member.guild:banUser(mentioned[1][1], nil, 7) ?

#

like that?

golden condor
#

You do id, the reason they were banned, how many days of messages to delete for

#

Yes

jaunty junco
#

oh kk

golden condor
#

That's correct

jaunty junco
#

thanks will try it

golden condor
#

Np

clever vector
#

@golden condor Can you i ask

#

How can we make many status on bot

golden condor
#

Please don't randomly ping me for no reason

#

I'm not the only person here

clever vector
#

I ping for a help

golden condor
#

<ClientUser>#setPresence

delicate shore
#

i stil

#

have confusion

jaunty junco
#

@golden condor thank you so so much it works! can you like link me the docs or smthn?

lusty quest
golden condor
#

@jaunty junco sure

lusty quest
#

wait this is not js?

golden condor
jaunty junco
#

ty

lusty quest
#

hmm lua. long time havent we met

golden condor
#

@lusty quest nah we talking about Lua. I've never used Discordia or Lua for that matter but I know how to read docs lol.

hazy sparrow
#
module.exports = {
    name: 'roll',
    description: "this is a dice command. it generates random numbers from 1-x or by default, 6. .",
    execute(message){
        const roll = args[0]
        
        if (roll){
        message.channel.send( ":game_die:" + "|" + message.author.username + " rolled a " + "**" + Math.floor(Math.random() * (roll- 1 + 1) + 1) + "**")
        }
     
        if (!roll){
            message.channel.send( ":game_die:" + "|" + message.author.username + " rolled a " + "**" + Math.floor(Math.random() * (6- 1 + 1) + 1) + "**")

        }
    
    
    }   
 }
``` am i doing it correctly?
tight plinth
pale vessel
surreal notch
#

can i host my website on visual studio code

slender thistle
#

VSC is just a text editor

surreal notch
#

¯_(ツ)_/¯

#

shit

restive furnace
#

but you can host it on your machine tho, if you prot forward it

rigid maple
#

Can you send a sample code for the message collector

#

pls ticket me

stark kiln
#

lol, first you learn basic javascript and node.js

golden condor
#

@earnest phoenix ctrl c or process.exit()

stark kiln
#

or that

indigo cloud
still merlin
#

db.updateText cant be called because its not a function.

indigo cloud
#

ik i fixed it tho got another error F

rigid maple
#

Can you send a sample code for the message collector
pls ticket me

stark kiln
#

@earnest phoenix adding on to what Callum said there is also <client>.destroy()

#

@rigid maple no

still merlin
#

@rigid maple write it yourself

stark kiln
#

spoonfeed

#

legit

rigid maple
#

ı can't

indigo cloud
still merlin
#

then go learn js and read the docs @rigid maple

indigo cloud
#

it spams null for some reason

#

but then says i reviewed it

#

and same in reviews command

#

tho it says no one has reviewed even tho i did

stark kiln
#

then learn the basic fundamentals of the language your using and make sure to actually learn js instead of trying to throw it together, with coding comes a responsibility cuz if it breaks ur gonna needa fix it @rigid maple

still merlin
#

^

stark kiln
#

learning the basics will help alot trust me

rigid maple
#

ok

#

thanks

stark kiln
#

np

indigo cloud
#

heres my code rn

stark kiln
#

why have you done msg but defined message

still merlin
#

dont use msg when message is defined

stark kiln
#

^

still merlin
#

o you beat me too it

stark kiln
#

lol

indigo cloud
#

Alright

stark kiln
#

either define msg or change em all to message

autumn aspen
#

Guys I feel that I have learned much on coding

indigo cloud
#

changed all to message

stark kiln
#

alright

indigo cloud
#

and when i did that i got message.includes is not a function

autumn aspen
#

Yeah if u want a permssion for a command its gonna be msg statement / event. @indigo cloud

#

Sorry cant spoonfeed tho

indigo cloud
#

never said i wanted to be spoon feeded lmao

slender thistle
#

What does message.includes signify

autumn aspen
#

I can check ur codes

indigo cloud
#

i am trying to get help to fix my errors

autumn aspen
#

I can fix ur errors

indigo cloud
#

thats my code from before

autumn aspen
#

What does message.includes signify
@slender thistle it means, its get an extra thing

#

Like OBS!

#

or smth

slender thistle
#

Did you mean message.content.includes

indigo cloud
#

when i changed all from msg to message i got message.includes is not a function

autumn aspen
#

Checking it now

#

Did you mean message.content.includes
@slender thistle yeah srry wrong, its not an function

#

when i changed all from msg to message i got message.includes is not a function
@indigo cloud aight so what err u get?

#

errors

indigo cloud
#

in console i dont get any errors tho i get this

still merlin
#

message.content.includes @indigo cloud

indigo cloud
autumn aspen
#

Ah sorry dude cant help u

indigo cloud
#

its all good

autumn aspen
#

Im not doing thos command

#

s

#

Hope u get helped anyway

indigo cloud
#

when i changed all u to messages now i get message.trim is not a function

autumn aspen
#

Im gonna realese my bot to top.gg soon!

indigo cloud
#

GG's

autumn aspen
#

when i changed all u to messages now i get message.trim is not a function
@indigo cloud wait u mean like u do the command and it work, but if u like type smth random its reapets?

#

repeats

indigo cloud
#
      message = message.trim()```
#

i changed it all to message bc u guys recommended me that

autumn aspen
#

Ah then I cant help but I hope u get helped Im very srry

indigo cloud
#

All good 🙂

autumn aspen
#

All good 🙂
@indigo cloud Anyways do u have a mute command for discord.js?

indigo cloud
#

yea

autumn aspen
#

Kinda stuck there

indigo cloud
#

i do have one

autumn aspen
#

Ohh can u help me

indigo cloud
#

sure

autumn aspen
#

Wait do u have a duration on it and reason?

indigo cloud
#

is it timed or no timed mute command?

autumn aspen
#

Timed

#

and reason

#

Like gear bit

indigo cloud
#

yes mines is timed to

autumn aspen
#

bot

#

yes mines is timed to
@indigo cloud OwO u have to help me lol

indigo cloud
#

sure

autumn aspen
#

I tryed like all commands but no work :/

indigo cloud
#

Dm?

autumn aspen
#

Sure

#

@indigo cloud check DM please.

sinful belfry
#

-checkdms

gilded plankBOT
hazy sparrow
#

can i use animated emojis in my bot even if i dont have nitro?

misty sigil
#

<a:emojiname:emojiid>

hazy sparrow
#

so i can?

sinful belfry
#

yup

misty sigil
#

yes

hazy sparrow
#

ok thats great

sinful belfry
#

bots have a weird kind of nitro

hazy sparrow
#

xD

misty sigil
#

bottro

sinful belfry
#

lmao yeah

hazy sparrow
#

imagine if bots could boost servers

#

how do i get the id of a animated emoji without nitro?

misty sigil
#

copy it’s id

#

you can’t use it if you aren’t in its server

earnest phoenix
#

if you don't have manage emojis perm you can use inspect element from the dev console (ctrl+shift+i)

misty sigil
#

try copying it’s id

hazy sparrow
#

how do i even see its id

devout wagon
#

If you have manage emoji permissions, go to the server settings and copy it from there, otherwise use inspect element

plucky harness
#

my postgressql is only listening on ipv6 i.r tcp6 not tcp/ipv4 help plz

clever vector
#

Hello guys

#

how can i make my link

#

like support server link

#

but it just show a blue word

#

like Support Server

slender thistle
clever vector
#

is it .setFooter?

#

but it wont work

slender thistle
#

in a string, will only work in description and field value

clever vector
#

can u make that one for me

#

??

#

.setDescription??

slender thistle
#

"[JOIN MY COOL SUPPORT SERVER](https://discord.gg/yEEeeEt)"

clever vector
#

.setDescription "text"

#

example ^^

#

@slender thistle like that??

slender thistle
#

aye

clever vector
#

But it pop at up

#

not down

#

@slender thistle

#

pls

#

help me

#

it on the top

#

not down

slender thistle
#

I'll pretend I understood what you meant

clever vector
#

._.

delicate shore
#

@clever vector yes

#

I can help

#

Ask me

#

You can just do .addField("Upper text", "Lower Text")

clever vector
#

Oo

delicate shore
#

In description you can't do lower and upper

clever vector
#

I want the link down

#

like this

delicate shore
#

You gotta set description something else

clever vector
#

Hey bro

#

i wanna do this

delicate shore
#

Ok

#

Show

clever vector
#

Example
Gay
Invite Me | Support Server

#

like that

#

the blue text thingy at down

delicate shore
#

Oo

#

that's not js

clever vector
#

Can help?

delicate shore
#

That's html

restive furnace
#

no its not

#

uts example

delicate shore
#

you have to do a href

restive furnace
#

no

delicate shore
#

A href

#

Yes

clever vector
#

i use Discord.js library

restive furnace
#
.addField("Gay", "[support server](https://google.com) | [some other link](https://top.gg)`");``
subtle osprey
#

hi, does anyone here know how to make a web dashboard for discord.js

clever vector
#

Thx SuperHero

restive furnace
#

hi, does anyone here know how to make a web dashboard for discord.js
@subtle osprey yes, use react

gilded ice
#

Sup x)

subtle osprey
#

ok

delicate shore
#

React ?

gilded ice
#

@subtle osprey are you a full stack developer

delicate shore
#

Hmm

gilded ice
#

@pure lion
Lol this is me I'm retarded^

delicate shore
#

@restive furnace we can use html for that as well

subtle osprey
#

well, i spend most time coding bots so you can call me that

gilded ice
#

Do you know frontend, backend and data shit?

restive furnace
#

react uses html

#

react is frontend

gilded ice
#

:o no way!

restive furnace
#

nodejs as backend

#

(just telling to PGamerX)

gilded ice
#

Okok fair

mental oracle
#

I've got a question

#

I made a bot that sends images as text

clever vector
#

@restive furnace it got an error

mental oracle
#

and its transparent on white background, how would I make it readable in light theme?

#

I don't use light theme

#

and i dont condone using it

#

but uh

#

yeah

restive furnace
#

change font color?

mental oracle
#

well it's supposed to be white

clever vector
#

@restive furnace it got an error

mental oracle
#

it's a sans bot lol

restive furnace
#

or then just do shadow

mental oracle
#

it talks in comic sans

#

good idea

restive furnace
#

@restive furnace it got an error
@clever vector what error...

clever vector
#

Can you come to my code place?

mental oracle
#

I wrote a custom search algorithm just for my bot lol

clever vector
#

it hard to explain

blazing portal
#

Screenshot could be a start 😉

clever vector
#

My pc error

#

have Explorer.exe

#

pls

blazing portal
#

what

lusty spade
#

How do i make it when the role do not have permissions it says 'none'
code:

.addField('Permissions', [
                `${role.permissions.toArray().map(x => x.split('_').map(y => y[0] + y.slice(1).toLowerCase()).join(' ')).join(', ')}`,
            ]);```
blazing portal
#

Check if the length of the permissions array is 0

earnest phoenix
#

how to filter channels bot have permissions in

#

in js

mental oracle
#

it looks so bad with a stroke @restive furnace

#

see

gilded ice
#

What

restive furnace
#

hmm

#

well, im not best to help with these thibgs

gilded ice
#

What are you trying to do?

mental oracle
#

I'm trying to make it so people can read the text on light theme

#

I dont condone using light theme because its eye cancer

gilded ice
#

Add drop Shadow?

pale vessel
#

box

mental oracle
#

I dont know any node.js text libraries that support a drop shadow

gilded ice
#

Canvas

#

x)

mental oracle
#

you can use canvas to render text with a drop shadow?

gilded ice
#

You should be able to

lusty spade
#

thx JonnyBnator didnt think of that

gilded ice
#

I've seen vx do it

#

Maybe ask him

blazing portal
#

channels.cache.filter(channel => channel.permissionsFor(guild.me).has('YOUR WANTED PERMISSIONS'));
This should work @earnest phoenix

gilded ice
earnest phoenix
#

ty

gilded ice
mental oracle
#

I made my sans bot way too complicated lol

gilded ice
#

Complicated is good

mental oracle
#

I made a .play command which will play any command in the undertale ost, and I wrote my own search algorithm for my specific use case

#

which searched through a json table I put together

#

with every undertale song track number, track title, and filename

#

you can just go ".play skfjgkfsgjfkgjskgjsfk"

gilded ice
#

Just use the undertale installation and get the oggs

mental oracle
#

and it will find the closest string lol

gilded ice
#

Omg

mental oracle
#

I did

gilded ice
#

Yes

mental oracle
#

I got all the oggs but

gilded ice
#

Perfect, best bot

mental oracle
#

it also tells bad puns

#

I wrote like

#

97 puns

#

and its entirely in comic sans

gilded ice
#

Even better bot

pale vessel
#

now make a deltarune music bot

mental oracle
#

lol

#

its not even been a week and sans is in 105 servers

#

I'm proud of him

gilded ice
#

Congrats on the verification

mental oracle
#

I gotta get ID first since I don't have ID on me atm

#

but yeah, I'll try to get him verified

gilded ice
#

Oh no

mental oracle
#

but yeah I wrote like 97 puns for the bot lol

gilded ice
#

3 more

mental oracle
#

I also make EXTREMELY SPECIFIC error handling

gilded ice
#

How specific?

#

Why not just try catch x)

mental oracle
#

like, if you give it only one letter for .play it'll say "give me more than one letter, lazy bones!"

#

or if you give it a unicode character

#

it'll say "give me more than one character, lazy bones!"

#

same for emojis

#

if its a number, that doesnt error because it could be a track number

gilded ice
#

That's completely normal

#

Maybe add an array of errors for each error?

#

You'll definitely get bonus points for the extra mile