#development

1 messages ยท Page 485 of 1

west raptor
#

It's bot.user.setStatus('idle')

#

@wide ruin

wide ruin
#

Ok

#

I'll try that

#

And Jonny, it made it say playing idle

queen sentinel
#

oh oof

wide ruin
#

And that didn't work @west raptor

west raptor
#

Wut

#

What do you have bot defined as

wide ruin
#

This is the code...

west raptor
#

ie. client, bot, <botname>

wide ruin
#

module.exports.run = async (bot, message, args) => {
  message.delete().catch()
  bot.user.setActivity('idle');
}```
west raptor
#

Hm

#

That should work

#

Wait

#

Bo

#

No

#

bot.user.setStatus

#

Not

#

bot.user.setActivity

wide ruin
#

bot.user.setStatus adding...

queen sentinel
west raptor
#

no

queen sentinel
#

mega oof

wide ruin
#

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

module.exports.run = async (bot, message, args) => {
message.delete().catch()
bot.user.setStatus('idle');
}

west raptor
#

That should work

#

Try it

wide ruin
#

Message deleted

#

Still online

west raptor
#

-bots @wide ruin

gilded plankBOT
#
Pineapplefan1234YT#9295
Bots

@dawn lagoon

west raptor
#

Die

wide ruin
#

Bot is new Discord.Client();

topaz fjord
#

you do know idle status is just the yellow circle

queen sentinel
topaz fjord
#

It doesn't make the bot go offline

wide ruin
#

Yes I know

#

I want it to be yellow

#

But I want different statuses if it is being coded, or if there is an error being fixed

west raptor
#

What

wide ruin
#

Like online - working well
Idle - programming
Dnd - bug fixing
Offline - broken

earnest phoenix
#

then set the status

wide ruin
#

But I can't as the code won't work

earnest phoenix
#

i mean

meager stirrup
#

okay so, I got an error now, dont know why it didnt give it to me last time, but here, I'll show you the error

earnest phoenix
#

set the status and the activity

quartz kindle
#

@meager stirrup that means your code is wrong

meager stirrup
#

oof

glossy echo
knotty steeple
#

what db should i use for my python bot

#

already tried postgres and sqlite

#

postgres was weird to me and sqlite kept on saying db is locked

meager stirrup
knotty steeple
#

i tried mongo but i didny like it

earnest linden
#

is there a error?

earnest phoenix
#

try mariadb then

meager stirrup
#

there is no error

earnest phoenix
#

do you get "Bot is Ready!" in console?

knotty steeple
#

i already have mysql installed on my laptop

meager stirrup
#

No i don't, but I dont get an error either

knotty steeple
#

can i still install it

earnest phoenix
#

I prefer mariadb over mysql comm

knotty steeple
#

my friend hates mysql

#

"friend"

earnest phoenix
#

its possible there is a connectivity issue @meager stirrup

#

probably if you let it run for a while it'll throw an error

#

well sure your "friend" can hate or love anything xD

meager stirrup
#

it never turns on though

earnest phoenix
#

it doesn't become ready so probably it just tries to login

#

let it run for a few minutes see if an error comes up

#

probably a timeout error

meager stirrup
#

kk

earnest phoenix
#

are you running it from your pc?

meager stirrup
#

yes

earnest phoenix
#

mariadb is a great relational database, with better performance out of the box compared to mysql comm. and some more stuff which is why I prefer it, but when picking a database system it all boils down to the use you want to make like relational vs non-relational etc

#

is it possible there's a firewall blocking the outgoing connection?

meager stirrup
#

no, I made sure there wasnt

#

I remember it turning on before, but it doesnt want to anymore

#

forgot to say that

earnest phoenix
#

add bot.on("error", console.error) after you've declared bot and run it again see if anything is logged

meager stirrup
#

hmm, it gives no message saying error... if there is no error, then whats making it not turn on?

earnest phoenix
#

the only thing I can imagine is that it tries to connect, maybe someone else have some better ideas xD leave it open for a while see if it throws a timeout error or something

meager stirrup
#

kk

#

thxs for the help anyways

earnest linden
#

Try restarting your device

meager stirrup
#

kk

#

brb

earnest linden
#

rip my spelling ;-;

meager stirrup
#

omg it worked

#

I worship you now

#

XD

earnest linden
#

congrats

#

and don't worship meh

meager stirrup
#

but your pfp is cute

#

lol

earnest linden
#

Really.

meager stirrup
#

๐Ÿ‘Œ

#

ye i'll shut up now

earnest linden
#

k.

earnest phoenix
#

What is this

earnest phoenix
#

that is a picture instead of a screenshot

slender thistle
#

Uh

#

The error is self-explanatory

slate kayak
#

anybody that could help me in voice channel regarding a vps please ?

earnest phoenix
#

Is there possibility to create some scheduled features (for example: updating channel name/messaging channel every 10mins) w/o need to use commands (like, some other thread running in background and sending updates, I have no clue) and keep normal bot features (I mean, just usual commands with prefix)? What is the correct approach to this problem while using discord.js?

prime cliff
#

Just use google for that Thonk and then edit the message in that function

cinder stratus
#
let r =  client.channels.get("channel id").send(`Message`)
      message.channel.send('message');
   const t = client.emojis.get("emoji id");
      r.react(t)
#

TypeError: r.react is not a function

#

pls help me

earnest phoenix
#

.send returns a promise

#

await it or react inside .then wrap

meager stirrup
#

Okay so, I'm trying to set the bot's prefix, but I honestly have no clue how to, any suggestions?

knotty steeple
#

like per server or the bot's actual prefix

topaz fjord
#

set a prefix and check if the message they send starts with the prefix

earnest phoenix
#

inb4 how

meager stirrup
#

the Bot's actual prefix

topaz fjord
#

just explained but k

knotty steeple
#

yes do what the turtle said

earnest phoenix
#

are u from china @meager stirrup

meager stirrup
#

no?

earnest phoenix
#

then u have google mmLol look up "learn <programming language>"

topaz fjord
#

lmao tf

meager stirrup
#

๐Ÿ‘Œ

knotty steeple
#

lul

cinder stratus
#

lol

molten pewter
#

HOL UP

#

WHY WAS MY BOT DELETED

#

MY BOT ISN'T EVEN AN NSFW BOT

solid cliff
molten pewter
#

I've seen that

#

The reason doesn't make sense

#

I don't see why it would post NSFW content in general

#

It isn't an NSFW bot

#

Could you guys at least tell me what the NSFW clntent was

neon schooner
#

It was of a girl posing nude with everything exposed

molten pewter
#

WHAT THE HECK

neon schooner
#

So yea, might wanna work on that.

molten pewter
#

I DIDN'T PUT THAT IN

#

I SWEAR

neon schooner
#

Again, you might wanna work on that.

#

Your bot posted it, so that's why it got deleted.

molten pewter
#

I think someone's abusing the tag system

neon schooner
#

Still something you'll need to fix ๐Ÿ˜›

molten pewter
#

Might need to reset it and add some guidelines

#

I can't fix people adding random stuff out of my control

neon schooner
#

Might be best to not offer that command if you can't control what content it can deliver.

#

That token is still yours and that makes the content it can post your responsibility.

molten pewter
#

Ok, fine, I'll try to remove it for now

sour perch
#

hey, so i want to make my bot send a message in every server it is in, anyone know how?

earnest phoenix
#

yeah i know how

sour perch
#

can you tell me please ๐Ÿ˜„

earnest phoenix
#

๐Ÿ˜„ maybe dont do that because its api abuse

sour perch
#

well its not going to be used like that, its suppsed to give updates on a game im making so it will be a toggelable feature :/

earnest phoenix
#

crazy idea

#

but hear me out

#

Create a support server

sour perch
#

yeah, ik

earnest phoenix
#

did u consider announcing in a support server?

cinder stratus
#
 if(!message.member.roles.has("STAFF")) return;
```is this correct
earnest phoenix
#

probably not because im guessing roles is a collecton mapped by ID

#

so that will always be true

sour perch
#

so you wont tell me?

cinder stratus
#

so what it should

#

be

sour perch
#

...

earnest phoenix
#

roles is a collection -> collection.has checks for an ID -> "STAFF" is not an id

cinder stratus
#

ok

earnest phoenix
#

cant be that hard

cinder stratus
#

got

earnest phoenix
#

@sour perch we told you

#

Create a support server

sour perch
#

yes, and its not the point

#

forget it ill find out eventually

earnest phoenix
#

Hab what library are you using?

#

We're not going to tell you something that shouldn't be done

#

You can figure that out for yourself and then you'll be the only one responsible for the consequences of your actions

#

sometimes i like to imagine what its like

#

not being able to figure out how to do somethign so basic on ur own

#

monkashake scary

#

Indeed

molten pewter
#

Wait

#

Who was the person that triggered the NSFW image

neon schooner
#

@pallid knoll

molten pewter
#

oof

#

Hol up, I'm gonna try to see who added the tag

#

And keep him from abusing it again

earnest phoenix
#

or maybe tags should be nsfw only zoomeyes

molten pewter
#

It's not an NSFW bot

#

I want it to stay that way

earnest phoenix
#

well people are just gonna add nsfw stuff to tags peepoShrugger

#

@molten pewter you should set who created the tag name so it can be seen who created it

molten pewter
#

I did

#

@earnest phoenix

earnest phoenix
#

Also be aware that ppl can use rags to advertise like they did it o my bot's tags, which i deleted, theh put discord gg links in tags ans type in public servers just toget members

molten pewter
#

And I know who created it now

#

Ok, but if tags have to be nsfw, why is @wind rose on the list? It has a tag feature and I'm sure that people abuse it every day

earnest phoenix
#

If soemone initiates the cmd nd see nsfw stuff or so the call for mods and they delet eit

#

Good reason y i blocked bot usage in bot lusting servers, one guy typed in other listing server "&tag hsuper" or so and it send an ad but tyfully mods muted the bot instead of deleted it or kicked it

molten pewter
#

Kekbot has tons of nsfw tags, I'm sure, and I bet someone has used one on this server

#

Kekbot doesn't require an nsfw channel for tags either

earnest phoenix
#

obv nobody has initiated the tag?

#

If it gets inititated and a mod sees it it gets deleted instead of muted and idk why

molten pewter
#

gonna try and ask Godson how he handles it

#

I'm in quite a few servers with him

sick cloud
#

anyone know how to get the cpu usage of a process in node.js?

earnest phoenix
#

use process.cpuUsage() to get the current cpu time used by process

#

then wait x number of seconds

#

then do process.cpuUsage(usageBefore) with whatever the usage was before

#

to get the difference between before and after

#

and calcaulte it as percentage of x number of seconds

#

and that is the cpu usage % FeelsGoodMan

#

roughly

const before = process.cpuUsage();
await new Promise(resolve => setTimeout(resolve, 5000));
const after = process.cpuUsage(before);
const cpu = (((after.user+after.system) / 1000 )) / 5000) * 100

@sick cloud

#

how do u mention a role using its ID

#

in richembeds

smoky spire
#

<@&id>

earnest phoenix
#

.

#

?

#

maybe ask in their support server

#

and not in the development channel

slate kayak
#

anybody that could help me on hasbin with a error please

earnest phoenix
#

send link

slate kayak
#

@earnest phoenix

earnest phoenix
#

listen for the error event in ur bot

sick cloud
#

it just throws 0%

earnest phoenix
#

๐Ÿค”

bitter sundial
#

maybe it is 0

sick cloud
#

it isnt

#

task manager says its using like 70%

earnest phoenix
#

console.log after

#

btw i didnt test that it was just the general idea

bitter sundial
#

what defines cpuUsage

earnest phoenix
#

process.cpuUsage()

bitter sundial
#

ok cool

sick cloud
#
global.cpuUsage = async function() {
    let before = process.cpuUsage();
    await new Promise(resolve => setTimeout(resolve, 5000));
    let after = process.cpuUsage(before);
    
    let cpu = (((after.user+after.system) / 1000 ) / 5000) * 100
    cpu = Math.round(cpu);
    
    if (cpu === 0) cpu = null;

    return cpu;
}
#

thats what i have rn

earnest phoenix
#

well ur are rounding

sick cloud
#

so now it gives me null, since i can handle that accordingly

#

yeah

#

so

#

i don't want like 70.78978391747813874214%

earnest phoenix
#

.trunc

bitter sundial
#

it's probably 0.70794708953

#

hmm or not

sick cloud
#

@earnest phoenix wdym .trunc

#

and idk

#

without rounding its still 0 @bitter sundial

earnest phoenix
#

print after

sick cloud
#

ok

#

@earnest phoenix it logs 0

earnest phoenix
#

it should be an object i thought

#

with like user, sys and idle

#
process.cpuUsage([previousValue])#
Added in: v6.1.0
previousValue <Object> A previous return value from calling process.cpuUsage()
Returns: <Object>

user <integer>
system <integer>
#

should be object idk how ur getting 0

sick cloud
#
global.cpuUsage = async function() {
    let before = process.cpuUsage();
    await new Promise(resolve => setTimeout(resolve, 5000));
    let after = process.cpuUsage(before);
    
    let cpu = (((after.user+after.system) / 1000 ) / 5000) * 100
    //cpu = Math.round(cpu);

    console.log(cpu)

    if (cpu === 0) cpu = null;

    return cpu;
}

well

#

its always logging 0

earnest phoenix
#

OH im stupid i wasnt clear

#

dont log cpu after

#

i mean log the variable after

sick cloud
#

oh

earnest phoenix
#

sry facepunch

bitter sundial
earnest phoenix
#

ya there u go mate ^

sick cloud
#

{ user: 0, system: 0 }

bitter sundial
#

why do you have to do the waiting tho

sick cloud
#

i got 0 0

earnest phoenix
#

because

#

to get a %

#

you calculate the amount of cpu time that passed/ the 5 seconds

sick cloud
earnest phoenix
#

how even Thonk

sick cloud
#

its borked

earnest phoenix
#

are u on windows?

sick cloud
#

yeah

earnest phoenix
#

thats why

sick cloud
#

locally running

#

oh

earnest phoenix
#

os.loadavg() also dont work

#

do on linux

#

im pre sure it will work

sick cloud
#

i can't "do on linux" since rn my vps is ded

#

i didnt pay

earnest phoenix
#

rippers

#

lemme try that on my windows real quick to confirm

#

but im pretty sure thats why, hang on 1 sec

sick cloud
#

mmk

#

but thx anyways

bitter sundial
#

win 10?

sick cloud
#

yeah

bitter sundial
sick cloud
#

i cant

bitter sundial
#

why

sick cloud
#

my school doesnt support linux

bitter sundial
sick cloud
#

do you mean like actually installing the os

bitter sundial
#

no I mean the subsystem on windows

sick cloud
#

o h

bitter sundial
#

๐Ÿค”

sick cloud
#

nice

earnest phoenix
#

actually it worked for me on windows @sick cloud

#

idk how u get 0 Thonk

#

try replace ur await timeout with while loop

#

see if u get 100%

molten pewter
#

What's the process for re-adding a bot once you've fixed the issue?

loud salmon
#

just do the same thing you did the first time

#

submit an application, and wait

molten pewter
#

ok

earnest phoenix
#

:3

sick cloud
#

ok

earnest phoenix
#

What hosting site do you guys recommend

frank dust
#

don't ask in multiple channels

wide ruin
#
const Discord = require("discord.js");

module.exports.run = async (bot, message, args, admins) => {
  if(message.author.id !== admins) {
      message.channel.send('sorry, you can\'t use this command!').then(msg => msg.delete(3000))
  } else {
  
  message.delete().catch()
    message.channel.send("done!").then(msg => msg.delete(3000))
  bot.user.setStatus('idle');
  }
}``` so for discord.js, what is wrong with this? it says "sorry, you can't..."
#
const admins = ['438733159748599813'/*pf*/, '335682119982514180'/*walrus*/, '286224826170081290' /*ff*/, '302263509289533451'/*ok lol ok*/]```
#

o/idle is the command

#

any help?

#

yeah?

#

ghostping

earnest phoenix
#

this code for what ?

#

ping ?

#

admins is an array and therefore you would need to use admins.includes(message.author.id)

vernal rivet
#

Yes

#

What your basically telling the bot is if message .author.id is not equal to admin then say this. Try and make it so that the bot will do if message.author.id is not equal to an id in the admin array, then say this @wide ruin

earnest phoenix
#

thank you for pinging them

vernal rivet
#

Np

#

Also instead of id, do by tag, look in the discord.js doc for that, instead asking people right away, you won't learn anything if you expect someone to hand you the answers

earnest phoenix
#

why do it by tag? because what if an admin changes their tag, it wouldnt work, but the id would stay the same

vernal rivet
#

Admin and mod is the common tags, and this bot seems to be only for a server, not for everyone to use. So do admin if that's the case

wide ruin
#

done

molten pewter
earnest phoenix
#

use a zero-width char

#

not hard

molten pewter
vernal rivet
#

Yes

molten pewter
#

i just typed space

earnest phoenix
#

or an italic space

#

_ _

molten pewter
earnest phoenix
#

@peak quartz what lib?

peak quartz
#

not sure what you mean

#

oh

earnest phoenix
peak quartz
#

i thought this was a dedicated legendary bot discord lol

earnest phoenix
#

not really

#

its just meant to hang out with other devs

#

ยฏ_(ใƒ„)_/ยฏ

peak quartz
#

well then, im an idiot lol

earnest phoenix
#

you can submit your bot

peak quartz
#

althought, do you knoiw of a bot thgat can assign a role based on if they have a specic role

earnest phoenix
peak quartz
#

like, give role x if they have role y

earnest phoenix
#

Ehm

#

That seems very explicit

#

??

#

Best bet is coding that yourself

#

ye

#

true

peak quartz
#

well dang, thanks yall

toxic oracle
inner jewel
#

why are you using webpack on a bot

toxic oracle
#

command i use to build: webpack --mode development

inner jewel
toxic oracle
#

because 1 file easy to manage over like 18481284

#

also wanna try out webpack anyway so like i might aswell try it here

earnest phoenix
#

Still doesn't make sense as to why you need it for a bot

toxic oracle
#

sorry for doing that then?

#

if you cant help there is no point responding surely

earnest phoenix
#

If you can help us understand why you're doing this, maybe some one can help

toxic oracle
#

i have sent everything u need to help, i dont see why you are acting difficult

earnest phoenix
#

I see a config file and a screenshot

#

But there's no background information listed

#

What exactly are you trying to do and what do you expect to work that isn't working

toxic oracle
#

in the screenshot it clearly shows it doesnt work when i use the webpack generated file

#

but does work via the normal node .

earnest phoenix
#

I'm not sure what arguments you're passing and why you're passing them

toxic oracle
#

ok ur being difficult lmao peace

#

already figured it out now anyway

earnest phoenix
#

lol

#

What you call difficult is me trying to get all of the facts

#

Because God forbid I say something incorrect BlurpleEyes

topaz fjord
#

calls you difficult

#

doesn't answer the question you ask him

twilit nymph
#

Hey I had a question, How I can add the number of serveur where my bot is in on dbl ?

earnest phoenix
vernal rivet
#

๐Ÿค”

shell blade
#

How do I fix the Converting circular structure to JSON error?

night imp
#

Do you have any relevant code to go with it / the language?

#

@shell blade

shell blade
#
- (node:31750) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
-     at JSON.stringify (<anonymous>)
- at save (/app/commands/music.js:52:39)
- at Object.execute (/app/commands/music.js:98:7)
- at Client.bot.on (/app/bot.js:103:13)
-     at Client.emit (events.js:180:13)
#

@night imp

tulip snow
#

What are some other programs (Besides Discord) you can make bots on?

shell blade
#

Slack, Twitter, YouTube and Twitch.

night imp
#

Have you tried reading this?

#

Something you are stringifying is a circular obj which throws errors

shell blade
#

I have, but I'm not sure how to utilize it.

night imp
#

What are you trying to stringify?

shell blade
#
function save() {
  fs.writeFile('./m-queue.json', JSON.stringify(queue, null, 4), (err) => {
    if (err) console.error(err);
  });
}
night imp
#

Can you send the contents of queue?

shell blade
#

There's too much code, so I'll send an invite to the project.

earnest phoenix
#

or make a hastebin

inner jewel
#
const x = {}
const y = {x}
x.y = y;
#

that's the cause of your error

#

x.y -> returns y
x.y.x -> returns x
x.y.x.y -> returns y

#

etc

vernal rivet
#

Am I needed?

sick cloud
#

dumbly enough, how do you format those embeds where the underline and text is white (and the underline is below the text), then when you hover on it it turns blue?

earnest phoenix
#

hi

#
 let user = message.mentions.users.first() || client.users.get(args[0])
        let users = message.mentions.users.last() ||client.users.get(args[0])
        if(!user) return message.channel.send(`Mention 2 users`)
#

this code doesnt work

#

why

#

What about it doesn't work?

#

i do /fight @earnest phoenix <@someonelse> and it pops up the opposite

#

in the text

west raptor
#

wdym

earnest phoenix
#

so

#

You have args[0] for both users

#

user is defined as first user

#

so @earnest phoenix

#

(me)

#

but when i mention the second user the opposite happens

#

it says i fight myself

#

;-;

west raptor
#
 let user = message.mentions.users.first() || client.users.get(args[0])
        let users = message.mentions.users.last() ||client.users.get(args[1])
        if(!user) return message.channel.send(`Mention 2 users`)```
#

like iTexlo said

#

you have args[0] set for both users

earnest phoenix
#

i was not planned

#

for using ids

#

it was for show

#

lol

#

I need to see more code than that

#

i forgot //

#

ye

#

one sec

#
message.channel.send(`Success,  ${user} **VS**  ${users}  `)```
#

it pops up

#

with

#

me

#

twice

#

so

#

Log message.mentions.users

#

Success, @earnest phoenix VS @earnest phoenix

topaz fjord
#

did you mention 2 people

west raptor
#

^

earnest phoenix
#

Yes

#

it pops up error

#

if i didnt

west raptor
#

who else

#

did you mention?

earnest phoenix
#

my bot

west raptor
#

hm

earnest phoenix
#

"Log message.mentions.users"

#

nvm now ,i gtg to bed

#

๐Ÿ˜ฆ

west raptor
#

ok

earnest phoenix
#

got to go grinds

#

later

#

thanks

west raptor
#

if you still have issues

#

tmrw

earnest phoenix
#

though โค

west raptor
#

just ask

earnest phoenix
#

yes will do :3

west raptor
#

alright

earnest phoenix
#

tysm

west raptor
#

np

iron prism
#

hello

fierce zodiac
#

hey there

bright spear
#

@earnest phoenix screenshot?

#

no

#

but the link system is the same

knotty steeple
#

yea im a python dev

#

well whats the problem

west raptor
#

wdym

knotty steeple
#

also is that async

#

just wondering mmLol

#

get rewrite

#

its more updated

#

boi

west raptor
#

use

#

rewrite

#

its

#

better

#

and more

#

up to date

knotty steeple
#

more stuff

#

idk

west raptor
#

ok

#

ill ask

#

uh

knotty steeple
#

let me ask my friend

#

@trim saddle

#

look i dont python much ok

#

does the embed send

west raptor
#

ok

#

screenshot?

knotty steeple
#

^

west raptor
#

just

#

do

#

it

knotty steeple
#

for what it looks like

#

not the code GWvictoriaNotLikeBlob

#

use the command and screenshot what it looks like

#

oh im sure that fields cant have markdown

#

put a description

west raptor
#

they can

#

i think

#

oh

#

thats the name of the field

knotty steeple
#

ye

#

thats what i meant

#

names of fields cant have markdown

sullen path
#

๐Ÿค”

knotty steeple
#

so just add description="thing"

#

right here discord.Embed(color=0x0cf0f0)

sullen path
night imp
#

The description is the text shown in the embed.

#

By setting that it sets the text for it

knotty steeple
#

its not really spoonfeed so idk what ur saying GWcmeisterPeepoShrug

rustic axle
#

This is a stupid js question but if I have this:


variable(2);

function myFunction(x) {
     console.log(2+x);
}```

Will it work?
night imp
#

Ok what don't you understand @earnest phoenix ?

knotty steeple
#

should work

rustic axle
#

Thanks Samurai

knotty steeple
#

wait

#

let me check

night imp
#

Oh markdown for it kek yeah if it supports markdown that is how you do it

#

I recommend going ahead and trying it can't hurt

knotty steeple
#

@rustic axle i evaled it

#

returned undefined

bright spear
#

fields definitely support markdown

knotty steeple
#

ok then he is doing it wrong

night imp
#

don't u gotta define the variable after the function has been defined?

bright spear
#

smh

#

u didnt put a ) at the end

#

thats why it didnt work

knotty steeple
rustic axle
#

because it seems to work on jsbin

west raptor
#

@bright spear not in field names

knotty steeple
#

and im supposed to have good eyes

trim saddle
#

@earnest phoenix you need context

bright spear
#

it wasnt in the name according to the code @west raptor

knotty steeple
#

first

#

get rewrite

#

second

bright spear
#

just use js not python problem solved

knotty steeple
#

rewrite code mmLol

#

pls

trim saddle
#

@bright spear shut

knotty steeple
#

i use both now

west raptor
topaz fjord
#

Is learning react hard?

bright spear
#

oh he changed it

#

smh

knotty steeple
#

idk

#

probably to a certain extent

night imp
#

@topaz fjord not too hard but it's cool af

rustic axle
#

Hmm

topaz fjord
#

owo

knotty steeple
#

vue ๐Ÿ˜ฉ

bright spear
#

@earnest phoenix it doesnt work in the field title

night imp
#

If you love Java it's just like it

bright spear
#

it works in the field value

topaz fjord
#

Fuck I use js

night imp
#

Well it is js x java

bright spear
#

not in your screeenshot\

#

smh

night imp
#

Hint jsx

rustic axle
#

variable(2);

function myFunction(x) {
     console.log(2+x);
}```
This seems to return both 4 and `undef` on jsbin
topaz fjord
#

yes

trim saddle
#
@client.command(Pass_context=True)
async def invite(ctx):
    embed = discord.Embed(color=0x0cf0f0)
    embed.add_field(name="Invite", value="[hi](https://discordapp.com/oauth2/authorize?client_id=489935383128309770&permissions=8&scope=bot)")
    await client.say(embed=embed)
night imp
#

So I would learn it, very cool what you can do

topaz fjord
#

yeah

knotty steeple
#

yes

topaz fjord
#

what should I build with it tho @night imp zoomeyes

knotty steeple
#

something

topaz fjord
#

Besides a dashboard for me bot

knotty steeple
#

like

#

a discord clone

night imp
#

@topaz fjord idk remake your websites and stuff

trim saddle
#

this is async pls use rewrite

night imp
#

Cuz it is a lot cleaner

knotty steeple
#

ikr

topaz fjord
#

yeah

#

making a discord clone would be cool but too much work

night imp
#

Twitter clone

bright spear
night imp
#

I did that as a react project

#

Not too hard just react and node

rustic axle
#

@knotty steeple what js runtime where you using because it seems to work for me on both JSFiddle and JSBin

bright spear
#

wyvern is supposed to eventually be a discord competitor lol

rustic axle
#

I get 4 returned

bright spear
#

wyvern was what discord was gonna be called

knotty steeple
#

im just using eval()

trim saddle
#

@bright spear pls just use py

rustic axle
#

hmmm

bright spear
#

the description code someone gave you didnt work?

#

without the field

knotty steeple
#

@trim saddle prove rewrite is better

#

pls

topaz fjord
#

@night imp probs would make a Reddit clone

knotty steeple
#

heroku

#

ew

trim saddle
#

in async
@commands.command(Pass_context=True) to use ctx args
in rewrite
@commands.command()

sullen path
#

read the exception

knotty steeple
#

also

#

i recommend you use cogs

#

cmon

#

its better than a 1 file bot

sullen path
#

wait until you have 2k+ lines of code

trim saddle
#

@earnest phoenix but you can't reload

sullen path
#

you'll see the truth

trim saddle
#

you have to restart the bot over and over.

knotty steeple
#

and thats

#

very annoying

#

you can only login 1k times with 1 token

#

imagine you restart your bot 1k times

#

for some reason

trim saddle
#

yes

sullen path
#

no

trim saddle
#

no

sullen path
#

that's spoonfeeding

trim saddle
#

ugh

#

i'll give you a tip for embeds

knotty steeple
#

it supports other languages

#

and libraries

trim saddle
#

am i not allowed to embed here

knotty steeple
#

nah discord is just

#

broke

#

again

trim saddle
#

fuckin

bright spear
#

you can make one

#

but we wont give you any code

knotty steeple
#

sigh

bright spear
#

well if you join a server which has rules, read them

#

and

#

read the docs

#

for your lib

#

did you search for unban??

#

and?

rustic axle
#

Error: Cannot find module 'discord.js'

#

hmm

#

not again...

earnest phoenix
#

try doing npm i discord.js

rustic axle
#

no I already have it installed

#

for some reason npm fallback was disabled but Ill figure it out

obtuse wind
#

Try doing npm install --save discord.js

#

~This way discord.js actually saves

rustic axle
#

its saved so I don't know why npm isnt picking it up

#

worker*

#

npm is the one picking it up

#

i am just using npm fallback because node primary is not working

languid dragon
#

best java wrapper for discord's api?

west raptor
#

@languid dragon so like basically a lib?

#

Or

languid dragon
#

yh

west raptor
#

What

#

JDA

#

Is best afaik

languid dragon
#

what's bad about D4J?

west raptor
#

Idk

languid dragon
#

then i'd rather an opinion from someone who knows both, sorry

west raptor
#

I'm just stating from what I've heard is the best

languid dragon
#

yeah, i appreciate that, i just want more personalized opinions

west raptor
#

Alright

sick cloud
#

i'm prettu sure its like the whole djs to eris thing

#

jda is like eris i guess, since its the most popular for bigger bots

austere sedge
#

how to make a nsfw command in python?

#

pls ping me

#

if you know how

earnest phoenix
#

you make it

#

what

hot sleet
#

I found this somewhere on internet
May ir help someone

if (message.attachments.size <= 0) { 
message.delete(); 
}```
#

It*

earnest phoenix
#

i believe that might be the least helpful thing i saw today

#

other than me

slender thistle
#

@austere sedge Depending on if you use an API or local storage for the pictures

#

It's all basically the same in all languages. Get an API -> make a request to it -> get a picture URL -> paste it in Discord channel whatever way you wish

earnest phoenix
#

guys is there a way to filter out if in a server there's 70% bots then make the bot leave?

#

cuz i don't want my bot being added to bot farms and so on

ruby dust
#

that's just a simple math, calc the % of bots and leave if above x% of your choice

earnest phoenix
#

@queen sentinel I Can't Do Music Commands, And I Want To Use A Ready Source Code. If I Write This In The Message: "These Commands Are Taken From The BlaBla Robot"

#

Is that okay with DBL?

queen sentinel
#

As long as you modify your bot so that it's not a clone of the one you're using it should be fine

earnest phoenix
#

Then I Can Use It. Thx

west raptor
#

@earnest phoenix iCrawl has a good music command tutorial(s)

#

You can check them out

earnest phoenix
#

but thx

west raptor
#

Alright

knotty steeple
#

dont use that

earnest phoenix
#

Do u mean OhGodMusicBot?

knotty steeple
#

yes

earnest phoenix
#

wy

#

why

floral zinc
#

somebody here?

west raptor
#

why

floral zinc
#

So I got this regex: \\W+

And I want to replace everything matching it in a text with "".
But i want to make one exception. It also replaces dots (.) which i do not want

#

How would i do that?

earnest phoenix
floral zinc
#

how would that help me?

earnest phoenix
#

You can test exactly what you want.

floral zinc
#

"text"

#

test

#

I dont even know the regex

#

?!

earnest phoenix
#

You can create the regex there depending on what you need

floral zinc
#

I cant create it because Idk how to do it

#

I have the \\W+ and I only want to make an exception for the "."

earnest phoenix
#

Then you should probably learn

floral zinc
#

what a great help you are.

earnest phoenix
#

Thanks?
If you need help with regex, Google is s good resource

floral zinc
#

ooof yea

earnest phoenix
#

her's the code

west raptor
#

i meant the command file he/she is receiving the error from, if not specified, show the code for the latest command made

earnest phoenix
#

that's what I said. Thonk

west raptor
#

wew

earnest phoenix
#

bad english and bad turkish

#

HMM

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

signal saffron
#

RangeError: RichEmbed field values may not exceed 1024 characters. help me

earnest phoenix
#

it means you can't put more than 1024 charcters in the embed field

#

...

signal saffron
#

954 charcters Buried

earnest phoenix
#

clearly not

#

show the code

limpid flume
#

@signal saffron Maybe some stuff is encoding, meaning a character takes up 2 or more bytes. Technically it may be that you can't use more than 1024 bytes. Check the size (not length) of what you are trying to send.

earnest phoenix
#

im pretty sure its characters not bytes

signal saffron
#

Okey 1 minutes.

#

@limpid flume okey thanks.

earnest phoenix
#

try logging the string in the console before sending and do a letter count

signal saffron
#

Code: ```.addField("Genel Komutlar", ${prefix}yardฤฑm ยป **Beinz Bot'un Genel komutlarฤฑnฤฑ gรถsterir!** ${prefix}sunucubilgi ยป **BulunduฤŸunuz sunucunun bilgilerini gรถsterir!** ${prefix}botbilgi ยป **Beinz Bot, bilgilerini gรถsterir!** ${prefix}yaz ยป **Bota istediฤŸinizi yazabilirsiniz!** ${prefix}ping ยป **Bot'un pingini gรถsterir!** ${prefix}davet ยป **Bot'u eklemek iรงin รถzele link atar!** ${prefix}gif (aranacak kelime) ยป **Bot, aradฤฑฤŸฤฑnฤฑz hareketli resmi size gรถnderir!** ${prefix}avatar ยป **Bot profil resminizi gรถnderir!**\n)

.addField("EฤŸlence Komutlarฤฑ", ${prefix}espri ยป **Bot size rastgele espri รถnerir!** ${prefix}mรผzikรถner ยป **Bot size rastgele mรผzik รถnerir!** dรถnenrenkler ${prefix}dรถnenrenkler ยป **Bot, size dรถnen renklerin hareketli resmini gรถnderir.** ${prefix}ip ยป **Bot, size hareketli ip resmi gรถnderir!** ${prefix}รถzlรผsรถz ยป **Bot size rastgele รถzlรผsรถz รถnerir!** ${prefix}catgif ยป **Bot size hareketli Kedi resmi gรถnderir!** ${prefix}doggif ยป **Bot size hareketli Kรถpek resmi gรถnderir!** ${prefix}froggif ยป **Bot size hareketli KurbaฤŸa resmi gรถnderir!** ${prefix}penguingif ยป **Bot size hareketli Penguen resmi gรถnderir!** ${prefix}monkeygif ยป **Bot size hareketli Maymun resmi gรถnderir!** ${prefix}parrotgif ยป **Bot size hareketli PapaฤŸan resmi gรถnderir!** ${prefix}paraateลŸle ยป **Bot sunuculardakine para resmi gรถnderir!** ${prefix}iyigeceler ยป **Bot size hareketli iyi geceler fotoฤŸrafฤฑ gรถnderir!** ${prefix}atatรผrk ยป **Bot size Atatรผrk'รผn rastgele fotoฤŸraflarฤฑnฤฑ gรถnderir!** ${prefix}รงayismarla ยป **Bot sunucudakilere รงay ฤฑsmarlar!** ${prefix}iskenderฤฑsmarla ยป **Bot sunucudakilere iskender ฤฑsmarlar!** ${prefix}pastaismarla ยป **Bot sunucudakilere pasta ฤฑsmarlar!** ${prefix}tuzla ยป **Bot sunucudakileri Nusret'in tuzu ile tuzlar!**\n)
return message.channel.sendEmbed(asdasd);
}
};```

limpid flume
#

@earnest phoenix I know that Steam has a limit of 30 bytes for steam nicknames, which in most cases is 30 characters, but there are plenty of cool symbols that people use which take up 2 bytes

earnest phoenix
#

@signal saffron if someone makes a really long prefix...

#

Don't let them do it, then

limpid flume
#

@signal saffron Yes, as I expected. Characters like รถ and รง likely take up 2 bytes, or 2 characters. You can easily just send 2 rich embed messages and you won't have to worry about this

earnest phoenix
#

also... i pasted in the text.. in letter count

signal saffron
#

Vooov

earnest phoenix
#

thats with a nine letter long prefix tho

signal saffron
#

thanks dude

earnest phoenix
#

np

limpid flume
#

@signal saffron I'm wrong, the limit is 1024 characters and รถ at least doesn't count as 2 characters. You could still send two rich embed messages instead, or you can also consider removing the prefix from the message completely as well as Bot. You could also just print the prefix in a section at the start of the message, and then drop it for the commands section

#

Just my 2 cents

#

Also this ```!espri ยป Bot size rastgele espri รถnerir!
!mรผzikรถner ยป Bot size rastgele mรผzik รถnerir!
dรถnenrenkler
!dรถnenrenkler ยป Bot, size dรถnen renklerin hareketli resmini gรถnderir.
!ip ยป Bot, size hareketli ip resmi gรถnderir!
!รถzlรผsรถz ยป Bot size rastgele รถzlรผsรถz รถnerir!
!catgif ยป Bot size hareketli Kedi resmi gรถnderir!
!doggif ยป Bot size hareketli Kรถpek resmi gรถnderir!
!froggif ยป Bot size hareketli KurbaฤŸa resmi gรถnderir!
!penguingif ยป Bot size hareketli Penguen resmi gรถnderir!
!monkeygif ยป Bot size hareketli Maymun resmi gรถnderir!
!parrotgif ยป Bot size hareketli PapaฤŸan resmi gรถnderir!
!paraateลŸle ยป Bot sunuculardakine para resmi gรถnderir!
!iyigeceler ยป Bot size hareketli iyi geceler fotoฤŸrafฤฑ gรถnderir!
!atatรผrk ยป Bot size Atatรผrk'รผn rastgele fotoฤŸraflarฤฑnฤฑ gรถnderir!
!รงayismarla ยป Bot sunucudakilere รงay ฤฑsmarlar!
!iskenderฤฑsmarla ยป Bot sunucudakilere iskender ฤฑsmarlar!
!pastaismarla ยป Bot sunucudakilere pasta ฤฑsmarlar!
!tuzla ยป Bot sunucudakileri Nusret'in tuzu ile tuzlar!

Is counted as 1049 characters, including the `**` and a 1 character prefix. Just clarifying
signal saffron
#

i prefix b!

serene plover
#

Do you guys think it's neccessary to queue data to be saved to a database?

signal saffron
#

Hey guys giphy send gif command, use channel nsfw but I want the message not to be used here when it is used outside the channel. How can I do it
GIPHY command: ``` exports.run = (client, message, params) => {
if (message.channel.name === 'NSFW') {
if (!message.guild) {
const ozelmesajuyari = new Discord.RichEmbed()
.setColor(0xFF0000)
.setTimestamp()
.setAuthor(message.author.username, message.author.avatarURL)
.addField('EฤŸlence Komutlarฤฑ ร–zel Mesajlarda Kullanฤฑlamaz!')
return message.author.sendEmbed(ozelmesajuyari); }
if (message.channel.type !== 'dm') {
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var deneme = getRandomInt(8);
let mesaj = params.slice(0).join(' ');
if (mesaj.length < 1) return message.reply('Aranacak kelimeyi girmediniz.');

var birinci = mesaj.replace("รผ","u");
var ss = birinci.replace("รœ","u");
var qwe = ss.replace("ร‡","c");
var asd = qwe.replace("รง","c");
var zxc = asd.replace("ฤž","g");
var yuu = zxc.replace("ฤฐ","ฤฑ");
var ooo = yuu.replace("ร–","o");
var jitem = ooo.replace("รถ","o");
var saaaa = jitem.replace("ลž","s");
var son = saaaa.replace("ลŸ","s");```
west raptor
#
//code
}```
signal saffron
#

@west raptor Yes, I wrote it, I want it out of the NSFW channel where you can't use it when it's used in channels outside

west raptor
#

speak in your native language if its easier for you

rustic axle
#

@signal saffron Do you want to use the command outside of a nsfw channel

signal saffron
#

@rustic axle No, warning when used

#

NSFW komutu kanal dฤฑลŸฤฑnda kullanฤฑldฤฑฤŸฤฑnda uyarฤฑ รงฤฑksฤฑn @west raptor

west raptor
#

Yapabilirsin if (!message.channel.nsfw) return message.channel.send('burada ne olursa olsun')

rustic axle
#

Oh okay

#

DoฤŸru deฤŸilse google translate kullanarak รถzรผr dilerim. Gรถmme mi yoksa normal mesaj mฤฑ istiyorsunuz?

west raptor
#

Bazฤฑ ifadeler yanlฤฑลŸ ise รงevirmen รงok รถzรผr dilerim

signal saffron
#

Hayฤฑr doฤŸru, teลŸekkรผrler

#

deniyorum ลŸimdi

rustic axle
#

tamam

west raptor
#

Hata mesajฤฑm yanlฤฑลŸ

rustic axle
#

Bu komuta burada izin verilmiyor! Lรผtfen bunun yerine bir NSFW kanalฤฑ kullanฤฑn.

#

Bunun yerine bir mesaj iรงin kullanmayฤฑ deneyin

earnest phoenix
#

Rule 6 people.

rustic axle
west raptor
#

wouldnt that apply to shitpost though

signal saffron
#

NSFW kanalฤฑnda hata veriyor

rustic axle
topaz fjord
signal saffron
#

sorry

#

The code you provide gives alert on nsfw and other channels @west raptor

west raptor
#

hm

#

is the channel marked as nsfw?

rustic axle
#

its not

earnest phoenix
#

no its not Omegaroll

signal saffron
#

Yes, worked, thank you!

rustic axle
#

Oh ye

signal saffron
#

thanks dude

rustic axle
west raptor
#

np

ruby dust
#

I'm gonna ask a third time, in case someone else is active now that knows the answer

junior leaf
#

Possible to help me to make logs (I do not arrive)

ruby dust
#

is there a way to get an id of discord.abc.GuildChannel?

junior bobcat
#

bot.fetchUser("316639200462241800").then(user => {user.send(embed)});

#

why ?

ruby dust
#

maybe a user with that id doesn't exist?

junior bobcat
#

its my own id

west raptor
#

the error is self explanatory

junior bobcat
#

its cause its a string ?

serene plover
#

@junior bobcat Your id is 316639200462241792

junior bobcat
#

wut

#

ok

west raptor
#

316639200462241792

#

yep

#

hes right

junior bobcat
#

maybe a missclick

#

thanks

ruby dust
#

yeah you prob got some random id or something

serene plover
#

You probs got the message id. ๐Ÿคท

junior bobcat
#

yes I think

ruby dust
#

a message id nowadays start with 48

knotty steeple
#

^

#

so maybe someone else's id

west raptor
#

no

ruby dust
#

no cause that id doesn't exist on discord

junior leaf
#

You have a tuto for logs code ?

knotty steeple
#

oh

ruby dust
#

so idk how they got that random id in the first place

#

anyway, this convo has flooded away my question (โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

frigid bone
#

You want to get id of a channel?

ruby dust
#

it's a GuildChannel

#

not a specific channel

#

discord.TextChannel is different than discord.abc.GuildChannel

knotty steeple
#

whats abc supposed to be

ruby dust
#

abstract base class

frigid bone
#

discord.js? They are just class definitions of the library, the IDs are the same

ruby dust
#

im python

knotty steeple
frigid bone
#

GuildChannel extends TextChannel, if I recall correctly

#

oh well, same logic in python, most likely

ruby dust
#

yeah but how do I get to it

frigid bone
#

let me check the docs

ruby dust
#

yeah I tried that first

#

and then realized that .id doesn't exist there

#

I need this specifically

#

not any other channel object thing

frigid bone
#

I'm not very well versed in the python library, specifically, but GuildChannel is just an abstract class

#

TextChannel, VoiceChannel and CategoryChannel inherit their properties and methods from it, it's not a special type channel like you might be thinking

ruby dust
#

I mean, all I need is to get an id of a channel that gets triggered with on_guild_channel_delete

frigid bone
#

Can I see your code?

ruby dust
#

idk what is there for you to see

#

it's empty

#

all i know is GuildChannel is being returned when on_guild_channel_delete is being fired, and all I need is to get it's id

frigid bone
#

Have you tried

@bot.event
def on_guild_channel_delete(channel):
    channel.id    # do something
#

or anything similar?

ruby dust
#

the thing is, the channel parameter is defined as GuildChannel

#

and as you can see by the docs

#

the .id doesn't exist

frigid bone
#

Abstract GuildChannel class may not have an ID object, or at least that's what I am seeing from the documentation, but the returned object will be a TextChannel or VoiceChannel, both of which have ID fields

ruby dust
#

channel.id doesn't return anything as far as I tried

frigid bone
#

May I see how you tried it?

ruby dust
#

I put channel.id Thonk

#

what is there to see

frigid bone
#

Code around wherever you tried accessing channel.id, any error, warning or unexpected behavior you got, etc

ruby dust
#

I would have already posted all that by now, it just fails silently

#

alright here's some context: my bot is dedicated to quoting messages, and I recently came up with "advanced quoting" where server owners allow all messages posted in chat to be stored in the db, but what I want is in order to not have a db flooded with so many messages I make it delete messages related to a deleted channel, basically

frigid bone
#

So you basically try to query an entry in database using a channel id?

ruby dust
#

in SQLite3 that'll be DELETE FROM Messages WHERE Channel = channel.id basically

#
c.execute("DELETE FROM Messages WHERE Channel = " + str(channel.id))
conn.commit()
```to be exact
frigid bone
#

is channel ID in the database an integer, or text type?

ruby dust
#

don't be surprised, but I mostly store everything as TEXT

frigid bone
#
c.execute("DELETE FROM Messages WHERE Channel = \"" + channel.id + "\"")
conn.commit()
#

try this

ruby dust
#

tried that too

frigid bone
#

text in SQLite statements need to be enclosed in double quotes

#

Oh

ruby dust
#

actually quotes aren't really needed in this case

#

it works anyway for me ยฏ_(ใƒ„)_/ยฏ

steel drum
#

mysql has an escape method

#

so if you use mysql as your database

#

you could just pass it like that

#

or do something like

#

DELETE FROM Messages WHERE Channel = '${channel.id}';

ruby dust
#

is this js?

steel drum
#

and put that statement in template strings

#

thats sql

#

thats literally sql

#

does python

#

not have

#

template strings

ruby dust
#

it doesn't have $

#

anyway, sql isn't my problem

#

I just need a way to get a channel id with on_guild_channel_delete

frigid bone
#

If you're unsure, try print(channel.id) or something and see what you get

knotty steeple
#

@steel drum no python doesnt have "template strings"

#

actually you can use {} in a normal string

ruby dust
#

I don't even know what those are mmLol

knotty steeple
#

which would be using ${} in a template literal in js

#

basically its f strings

ruby dust
#

mhm

knotty steeple
#

without the f

#

and you add $

#

and instead of using quotes you use backticks

west raptor
earnest phoenix
#

So if Iโ€™m a small bot maker, my bot has 28 commands and doesnโ€™t take up barely any storage which, Hosting site thatโ€™s the most cost effective should I use?

ruby dust
#

not yet

#

I don't really want to ask them

west raptor
#

Seems like you might have to

ruby dust
#

that's like a forbidden teritory for me

knotty steeple
#

Authentication plugin 'caching_sha2_password' is not supported if i try to connect to mariadb

#

help

#

wait no i found something

#

now i got 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

#
import mysql.connector as mariadb
import json
config = json.load(open("./config.json"))
conn = mariadb.connect(user="root", password="{}".format(config["db_password"]), database="bottadata", auth_plugin='mysql_native_password')```
toxic forum
#

password is wrong, did you set the correct password in your config?

knotty steeple
#

yes

#

its the password i put when i was installing mariadb

toxic forum
#

check if the password does not contain quotes when you read it from the config file

#

i had that happen to my connector

knotty steeple
#

"db_password": "password"

toxic forum
#

looks good to me

#

but you should not send passwords here btw

knotty steeple
#

well thats not my actual password

#

would be dumb

toxic forum
#

ok thats fine then

#

auth plugin a problem then?

#

could be that the password generated in the setup was created with 'caching_sha2_password'

#

but you using the 'mysql_native_password' now

knotty steeple
#

but if i use that one i get the error before

#

Authentication plugin 'caching_sha2_password' is not supported

toxic forum
#

are there any other plugins?

knotty steeple
#

i dont think so

toxic forum
#

then i dont know, stackoverflow is your best friend then

signal saffron
#

Hey guys help me Error: TypeError: Cannot read property 'send' of undefined at Client.module.exports.member (/app/events/guildMemberRemove:4:22) at emitOne (events.js:116:13) at Client.emit (events.js:211:7) ```module.exports = member => {
let username = member.user.username;
member.send('Welcome Server');
member.guild.defaultChannel.send('');
};

knotty steeple
#

defaultChannel isnt a thing anymore

signal saffron
#

More descriptive

knotty steeple
#

what

toxic forum
#

@signal saffron can you program in js?

knotty steeple
#

you cant use it anymore due to changes in discord api

signal saffron
#

I have to solve the mistake

knotty steeple
#

the best solution is to loop through channels

west raptor
knotty steeple
#

and find the first channel you can send messages to

west raptor
#

^

knotty steeple
#

as soon as my bot blacklists a guild it does that saying why it was blacklisted

#

in a try catch

signal saffron
#

๐Ÿค”

earnest phoenix
#

So if Iโ€™m a small bot maker, my bot has 28 commands and doesnโ€™t take up barely any storage which, Hosting site thatโ€™s the most cost effective should I use?

earnest phoenix
#

You can rent a server from Vultr for 2.50 a month

late hill
#

heroku ๐Ÿ‘

#

๐Ÿ˜‚

wide ruin
#

Discord.js, how do you check if a channel is marked nsfw?

earnest phoenix
#

uhh

#

^

west raptor
#

^

earnest phoenix
#

TL;DR
TextChannel.nsfw => Boolean

wide ruin
#

So, if(message.channel.nsfw = true) {

inner jewel
#

no

wide ruin
#

Oh

inner jewel
#

that's setting the property

#

get rid of the = true

earnest phoenix
#

You can just
if (msg.channel.nsfw) ...

#

or

wide ruin
#

So if(message.channel.nsfw) {

earnest phoenix
#

yes

wide ruin
#

Thanks

earnest phoenix
#

just do if(!message.channel.nsfw)

#

= is for assignment
=== is for quality

#

if its a boolean value

#

never do === true

#

just do if(bool)

#

and if(!bool)

wide ruin
#

if(message.channel.nsfw) {

#

Just add that then

#

No =

earnest phoenix
#

Better do if (!msg.channel.nsfw) return

wide ruin
#

Does that check if it is nsfw?

#

The !

inner jewel
#

that checks if it's not

#

and returns if not

earnest phoenix
#

It stops if it's not

wide ruin
#

Ok

inner jewel
#

so all code below that line can be sure the channel is nsfw

wide ruin
#

Can I still use { instead of return

inner jewel
#

you can also learn js properly

earnest phoenix
#

Just write code for the case if it IS nsfw below the code I wrote

#

^