#development

1 messages · Page 1204 of 1

earnest phoenix
#

please legit website

pale vessel
hazy sparrow
#

ok thanks

earnest phoenix
#

idk

#

both are bad

#

paid vps is better

hazy sparrow
#

@earnest phoenix dont trust free stuff

earnest phoenix
#

but atleast it's free, right right?

hazy sparrow
#

wait @earnest phoenix wdym "bad"?

#

low uptime?

earnest phoenix
#

@earnest phoenix oh okie

ancient nova
#

what are you guys thinking?

hazy sparrow
#

@pale vessel it works thank you so much

hasty mulch
#

In ctx I can still use await message.channel.send() for Python, right?

pale vessel
#

yes

hasty mulch
#

K

pale vessel
#

looks about right

hasty mulch
#

It is, have that burned to my memory

#

How do I restrict a command?

golden condor
#

I'm having issues with djs light where I am trying to check if the bot has a certain permission in a guild but the permission is returning 0 and I've tried caching channels, roles and overwrites and it still shows as 0 even though the bot has admin and I'm confused

pale vessel
#

ping the god coder

hasty mulch
#

@pale vessel How do I restrict a command to myself?

golden condor
#

I'm not sure why it's happening and it checks a user's permission fine but it doesn't like the bot's permission

pale vessel
#

compare author id

#

for you, make sure the author id is 222766150767869952

hasty mulch
#

Compare author id? How would I write that?

pale vessel
#

what do you code in?

hasty mulch
#

Python

pale vessel
#

use !=

#

something like if ctx.author.id != 222766150767869952

golden condor
#
command.config.permissions.bot && !msg.guild.me.permissions.has(command.config.permissions.bot)```This is the condition I check
hasty mulch
#

This is my first time using a restriction

#

Ok

pale vessel
#

you can return if that's True

hasty mulch
#

Me or him?

golden condor
#

ping the god coder
@pale vessel don't wanna disturb him

#

You

hasty mulch
#

So return True

golden condor
#

No

hasty mulch
#

Then the await?

golden condor
#

you can return a message

#

Like say

hasty mulch
#

Or the await first then the return

golden condor
#
return await #async func here
#

iirc

hasty mulch
#

That doesn’t look like

#

@pale vessel Yo, where do I put the return?

placid fulcrum
#

.

#

-bot @placid fulcrum

hasty mulch
pale vessel
#

@pale vessel don't wanna disturb him
@golden condor you have to lmao

#

he's the one that made it

golden condor
#

I know

pale vessel
#

he's not going to kill you

hasty mulch
#

Also, nvm about the return, the damn thing doesn’t even work!

golden condor
#

Eh eh eh

pale vessel
#

show code

hasty mulch
#

Wait, perms

golden condor
#

I sent him a DM

hasty mulch
#

Yeah, nope

#

One sec

robust furnace
#

Help me

pale vessel
#

be patient

hasty mulch
#

God damn it, gotta restart the box

indigo geyser
#

@hasty mulch are you coding in d.py without knowing python?

hasty mulch
#

No, I know Python

#

I just never used ctx before

indigo geyser
#

you didn't know how to use !=

hasty mulch
#

Cause I never used it before -_-

pale vessel
earnest phoenix
#

I just never used ctx before
@hasty mulchoh

hasty mulch
#
import discord

from discord.ext import commands

bot = commands.Bot(command_prefix='?')
client = discord.Client()

@client.event
async def on_ready():
    print('Successfully logged in as {0.user}, Running Verison 0.0.0.1'.format(client))

@bot.command()
async def test(ctx):
    print('Test')
    await message.channel.send("Success!")
    pass

client.run('[REDACTED]')
#

@pale vessel

pale vessel
#

and where did you compare the id?

#

in test?

hasty mulch
#

I'm not comparing it yet because it doesn't work without it

#

How can I compare it when it doesn't even work without it?

pale vessel
#

message is not defined

#

it's ctx.message

#

you can also just use ctx.send()

hasty mulch
#

So, await ctx.send()?

pale vessel
#

yeah

hasty mulch
#

K, pushing

#

Nothing

earnest phoenix
#

didnt define message in test

hasty mulch
#

REEEEEE, he just said how!

earnest phoenix
#

okai

hasty mulch
#

And still no work!

earnest phoenix
#

remove client

#

and try using bot

#

in place of client

hasty mulch
#

Can't I have to use client.run()

earnest phoenix
#

u can use bot.run

pale vessel
#

you don't need client when you already have bot

earnest phoenix
#

ye

pale vessel
#

since it's a subclass of Client

earnest phoenix
#

what does client do

#

oh

hasty mulch
#

Got it, finally

#

Thanks, guys

earnest phoenix
#

np

#

use this

hasty mulch
#

Next would be to have a user to require a permission

earnest phoenix
#

check the docs

hasty mulch
#

@earnest phoenix I have that, but it BARELY provides a good reference

earnest phoenix
#

it is good enough

hasty mulch
#

I just come back to help when I use it

pale vessel
hasty mulch
#

No, it provides NO Visiuals

earnest phoenix
#

u can type ur problem in google too

hasty mulch
#

All of that is outdated

#

Ie, ping command

pale vessel
#

that's why you refer docs lmao

hasty mulch
#

I can't for the life of me, make one

earnest phoenix
#

lol

pale vessel
#

it's the only updated and reliable source

hasty mulch
#

I need visuals

earnest phoenix
#

just search the key word

#

in docs

pale vessel
#

i don't even code in python and i helped you by reading docs

#

i'm sure you can do better

earnest phoenix
#

pro

#

xD

hasty mulch
#

Embeds, I can't get set_footer working. The docs say I can use, but the software says "no way in hell"

#

Good freaking example, right there

earnest phoenix
#

show what error u getting

slender thistle
#

What does the software say exactly?

hasty mulch
#

not defined

#

That's the error I get EVEN WHEN I REFERENCE IT

earnest phoenix
#

i will show u example of a simple embed

#
embed.set_footer(text="xyz")
await chnl.send(embed=embed)```
weak rain
#

i m trying automeme

#

but

#

it is giving error

#
      let data = await random.getMeme()
                 ^^^^^

SyntaxError: await is only valid in async function      
    at wrapSafe (internal/modules/cjs/loader.js:1053:16)
    at Module._compile (internal/modules/cjs/loader.js:1101:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at E:\Thunder\handlers\command.js:19:24
    at Array.forEach (<anonymous>)
    at module.exports (E:\Thunder\handlers\command.js:11:32)
pale vessel
#

make the function async

#

async function()

weak rain
#

kk

clever vector
#

Hey guys

#

my bot accidently dup the message itself

earnest phoenix
#

like?

clever vector
#

someone say use this

#

if (message.author.bot) return;

#

but idk where to put

#

@earnest phoenix Its suddenly duplicate message itself

#

and no error

earnest phoenix
#

ohh

clever vector
#

idk what file do i put this

#

if (message.author.bot) return;

earnest phoenix
#

ye insted

#

put

#

if (message.author==bot.user) return

#

is it responding to its own text?

pale vessel
#

but idk where to put
@clever vector on top of your message event

hasty mulch
#
embed.set_footer(text="xyz")
await chnl.send(embed=embed)```

@earnest phoenix That fucking worked. I quit Disord

earnest phoenix
hasty mulch
#

I could not for the life of me figure that out

slender thistle
#

Probably a kwarg error

hasty mulch
#

Yeah

#

This is why I don't like the docs

clever vector
#

@pale vessel wdym by Event

earnest phoenix
#

is it duplicating when u use a command or sum?

hasty mulch
#

Could also have more than 1 instance running

clever vector
#

@earnest phoenix when use cmd

earnest phoenix
#

put it in command code then

#

this should be the first line

clever vector
#

all???

hasty mulch
#

Not the token!!!

earnest phoenix
#

is it responding to all command

clever vector
#

yep

earnest phoenix
#

i mean duplication

clever vector
#

No

#

its like /say LOL

earnest phoenix
#

oh

clever vector
#

and it will sy

#

LoL 2x

#

LoL
LoL

#

like that

earnest phoenix
#

oh

hasty mulch
#

@clever vector I honestly think you have two instances running

earnest phoenix
#

show me code

clever vector
#

What code

#

all the codes?

#

i mean what cmd

earnest phoenix
#

no

#

only the lol one

clever vector
#

No

#

LoL

#

you still dont understand

#

I mean all the command send message twice

earnest phoenix
#

ohh

#

then maybe two instances are running

hasty mulch
#

It’s probably because you have two instances running!!!!!!!

earnest phoenix
#

like

#

maybe the code is running somewhere else

hasty mulch
#

@clever vector What do you use to code and launch your bot?

earnest phoenix
#

or when the code is put in on_message event

hasty mulch
#

I use Thonny to code, Terminal to launch

clever vector
#

@hasty mulch i use VS Code

earnest phoenix
#

good for u

#

@hasty mulch

hasty mulch
#

@earnest phoenix Shush, providing an example

earnest phoenix
#

@clever vector invite me to the server where ur bot is in

#

xD

hasty mulch
#

@clever vector Are you using Terminal or Command Prompt to run your bot?

#

And I’m getting ignored...

#

Welp

earnest phoenix
#

lol

#

Any free hosting site?

hasty mulch
earnest phoenix
hasty mulch
#

Heroku or however it's spelt

weak rain
#
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:14:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)```
#

what should i do

clever vector
#

@hasty mulch Run what code

hasty mulch
#

@clever vector Your bot code

weak rain
#

:/

hasty mulch
#

@weak rain Have you tried Google?

weak rain
#

No

#

xD

pale vessel
#

Hey... guess what? Ctx.author.id is invalid syntax. JUST MY LUCK!
@hasty mulch how is that invalid

#

don't you have a local machine to test?

#

test first before deploying

hasty mulch
#

Fixed it already

#

Derped

#

And I run it all on my local machine

#

All of my Discord bots

earnest phoenix
#

nice

hasty mulch
#

REEEEEEEE, author id is blocking the message

#

222766150767869952

earnest phoenix
#

how to ppl edit pictures

#

like

#

danks spank command replaces the faces with pfps

drifting wedge
#

whats the name of the thing for like 0Exe#6969 using python

earnest phoenix
#

wont come

drifting wedge
#

ah

#

so id have to add my own

earnest phoenix
#

just the number comes

drifting wedge
#

and do both?

earnest phoenix
#

ye

drifting wedge
#

ty

earnest phoenix
#

np

crystal stream
#

Hello :з

hazy storm
#

.

crystal stream
#

Can u plz help me, how can I check if my bot don't have permission to send message he do return

#

discord.js v11

still merlin
#

Don’t use v11, Soon it wont work

faint prism
#

^ this
Gotta upgrade to v12 asap

crystal stream
#

OwO

earnest phoenix
#

how do ppl edit pictures
like
danks spank command replaces the faces with pfps

drifting wedge
#

@earnest phoenix

#

wut libarty?

earnest phoenix
#

python

drifting wedge
#

yay

#

im still figuring it out too

earnest phoenix
#

hehe

drifting wedge
#

but i use pillow

earnest phoenix
#

oh

drifting wedge
#

its quite simple

earnest phoenix
#

i want to add that feature in my pokemon bot

drifting wedge
#

ah

#

so pip add pillow

#

and 1 sec

earnest phoenix
#

what does pillow do

#

hello how can I make the bot active?

#

is it a module

drifting wedge
#

is it a module
@earnest phoenix yep 1 sec

earnest phoenix
#

hello how can I make the bot active?
@earnest phoenix run the code

#

@earnest phoenix yep 1 sec
@drifting wedge okai

drifting wedge
#

this is the shittest thing ever

#

but this is an example

earnest phoenix
#

lol

drifting wedge
#
from PIL import Image, ImageDraw, ImageFont, ImageOps

img = Image.open('card.png')
font = ImageFont.truetype('Goodbees.otf', 150)
write = ImageDraw.Draw(img)
write.text(xy=(100,150), text="{user} just joined the server", fill=(199,255,0))
img.show()
earnest phoenix
#

how so

drifting wedge
#

so this gets card.png

earnest phoenix
#

oh

drifting wedge
#

writed with the font

#

and writes the message, with the color at xy

#

and it shows it 2 u

earnest phoenix
#

ohh

#

naisu

#

we can use numpy too ig

#

idk

drifting wedge
#

?

earnest phoenix
#

module

#

numpy module

weak rain
#
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:31)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
(node:14208) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14208) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
crystal stream
#

U'r code?

weak rain
drifting wedge
#

so i decided to do an oopside and like copy a tutorial without paying atention

#

I'm trying to make an economy system which isn't global. It's local on the guild.
@pine aspen dbs

#

where can i edit the value of the embed?

earnest phoenix
#

Can someone help me? my bot isn't responding to my command :<

faint prism
#

hello how can I make the bot active?
@berat_fb56#1050 do you need change your status back to active? Or make your bot come online?

#

Can someone help me? my bot isn't responding to my command :<
@earnest phoenix what's the code for your on message handler?

earnest phoenix
#

@earnest phoenix what's the code for you on message handler?
Huh ;-;
Its just lines of code, is that what u mean?

#

the part with the commands

#

i have the whole bit of it, i can send u it

faint prism
#

That's what I'm asking for, yes

earnest phoenix
#

client.on('message', message =>{
if(!message.content.startswith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const comamnd = args.shift().tolowercase()

if(command === 'help')
 message.channel.send('This Bot is currently Under construction')

})

faint prism
#

Alright what's your prefix

earnest phoenix
#

d!

faint prism
#

oh

#

typo

#

const comamnd

earnest phoenix
#

Huh ;-;

blazing ravine
#

how t ofix

faint prism
#

You misspelled command

blazing ravine
#

some1 help me

earnest phoenix
#

LMAOOO

#

HHHAHAHAHAA

faint prism
#

@earnest phoenix You define const comamnd but reference if(command....

pine aspen
#

Hey,

How could I make a per guild + user system with mongoose

earnest phoenix
#

Just state all of the problems and me will fix my brain

drifting wedge
#

emb.add_field(name=f"**{i['author'].author.name}**",value=i['title'],inline=False) how do i edit the value?

pine aspen
#

I'm trying to make an economy system which isn't global. It's local on the guild.

drifting wedge
#

I'm trying to make an economy system which isn't global. It's local on the guild.
@pine aspen dbs

pine aspen
#

Hey,

How could I make a per guild + user system with mongoose
@drifting wedge

#

I'm using a DB.

#

Any good idea's for schematics?

drifting wedge
#

well store guild ids and user ids and their mooneys

weak rain
#

ye auger

#

u there

#

?

pine aspen
#

Like:

{
  economy: {
    userID: {}
  }  
}
#

?

weak rain
#
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:31)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
(node:14208) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14208) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
earnest phoenix
#

Am I just dumb

weak rain
#

@faint prism

pine aspen
#

message is undefined.

weak rain
#

no it isnt

faint prism
#

function(message, guild)

pine aspen
#

yes

#

it is

faint prism
#

You have this param but aren't using it

drifting wedge
#

how do i get the channel name?

weak rain
#

so what should do?

drifting wedge
#

return await channel.connect(), msg.send(f":lp: Connected to: {channel}")

faint prism
#

Take it out. You're already passing in the message object lol

drifting wedge
#

@command()
async def join(self, msg, *, channel: discord.VoiceChannel=None):

earnest phoenix
#

Here is the new code:
Augur, whats wrong?!
client.on('message', message =>{
if(message.content.startswith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().tolowercase()


if(command === 'help')
 message.channel.send('This Bot is currently Under construction')

});

faint prism
#

Here is the new code:
Augur, whats wrong?!
What's the error?

earnest phoenix
#

Auger, augur, wtv

#

What's the error?
When i type a command, its not working

weak rain
#
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:31)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
(node:2388) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2388) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I m ready to Go | Thunder is OP
DanBotHosting - Auto Post Started
(node:2388) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guild' of undefined
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:31)
    at listOnTimeout (internal/timers.js:549:17)```
#

still

earnest phoenix
#

client.on('message', message =>{
if(message.content.startswith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().tolowercase()


if(command === 'help')
 message.channel.send('This Bot is currently Under construction')

});
This is the whole code to make the commands

weak rain
#

@faint prism what should i do

faint prism
#

@earnest phoenix Well I would focus on simplifying this then:

 const args = message.content.slice(prefix.length).split(/ +/);
 const command = args.shift().tolowercase()

There is a bunch modifications you're doing here that could cause and error.
Can you explain what this part does?

pale vessel
#

seems like a normal args and command system

weak rain
#

its still saying that its not defined

earnest phoenix
#

psh, wtf do i know

#

idfk ;-;

faint prism
#

What do you mean you don't know? You wrote it didn't you?

pale vessel
#

mmLol maybe

earnest phoenix
#

No, i got it from my friends bot

faint prism
#

||Ik he didn't||

pale vessel
#

did you define prefix? of course he did

hearty hull
#

b!badge

weak rain
#

how should i define server

#

as i have already defined h

#

:/

pale vessel
#

it's toLowerCase()

faint prism
#

did you define prefix? of course he did
@pale vessel You're gonna have to take over. I'm not a JS dev lol

earnest phoenix
#

Capitals

hearty hull
pale vessel
#

cities

#

@hearty hull shush

weak rain
#

@pale vessel hey flazepe

pale vessel
#

hello

weak rain
#
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:31)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
(node:2388) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2388) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I m ready to Go | Thunder is OP
DanBotHosting - Auto Post Started
(node:2388) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guild' of undefined
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:31)
    at listOnTimeout (internal/timers.js:549:17)```
pale vessel
#

something before guild is undefined

weak rain
#
const random = new Random();
const Discord = require('discord.js');


    setInterval(async function(message, guild)    {
      const channel = message.guild.channels.cache.find(channel => channel.topic === "memes");
      if(!channel) return;      let data = await random.getMeme()
      channel.send(data)

  }, 3000) 
  

pine aspen
#

Hey, how can I make a local guild economy system? Changes on each guild? I've got an idea how but don't know how to do it. I use mongoose.

pale vessel
#

message doesn't exist

#

is that inside your message event?

weak rain
#

no

pale vessel
#

what event?

weak rain
#

its just a command

pale vessel
#

also, setInterval can't give parameters, so message and guild won't be defined

weak rain
#

so what should i do @pale vessel

pale vessel
#

so that's equivalent as async function() {}

faint prism
#

invert it, encapsulate the setInterval with a proper function

pale vessel
#

make it function() {}

earnest phoenix
#

WHY WONT MY DUMB BOT RESPOND TO MY COMMANDD.... 😢

pale vessel
#

did you try what i suggested?

earnest phoenix
#

I fixed all of the problems

faint prism
#

lol

pale vessel
#

show code

weak rain
#

@pale vessel i tried function() {} earlier but it was saying

#

this can be used in a async function only

pale vessel
#

add async before function

earnest phoenix
#

client.on('message', message =>{
if(message.content.startswith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase()


if(command === 'help')
 message.channel.send('This Bot is currently Under construction')

});

pale vessel
#

i think it wasn't defined because you redefined message in your function and message became undefined

#

the function should have no parameter

weak rain
faint prism
#

this can be used in a async function only
@weak rain async function() {

weak rain
#

pk

#

ok

pale vessel
#

@earnest phoenix did you restart your bot?

#

just in case

faint prism
#

(did you save the file)

earnest phoenix
#

How do i restart?

faint prism
#

oof

earnest phoenix
#

wait

pale vessel
#

close the terminal

#

ctrl c i guess

earnest phoenix
#

aight

#

I closed the terminal, and stopped running the bot

pale vessel
#

start it again

earnest phoenix
#

I can give u the whole error message in the debug console, if you'd like

weak rain
#

node:16684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5) (node:16684) UnhandledPromiseRejectionWarning: ReferenceError: message is not defined at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:23) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

pale vessel
#

that error looks purged

#

can you scroll up?

weak rain
#

i closed the terminal due to spam

faint prism
#

?

weak rain
#
    at Timeout._onTimeout (E:\Thunder\commands\fun\meme.js:7:23)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
(node:11788) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I m ready to Go | Thunder is OP
DanBotHosting - Auto Post Started```
#

@pale vessel

pale vessel
#

what did you define message as?

weak rain
pale vessel
#

can you show me the code?

weak rain
#
const random = new Random();
const Discord = require('discord.js');


    setInterval(async function() {
      const channel = message.guild.channels.cache.find(channel => channel.topic === "memes");
      if(!channel) return;      let data = await random.getMeme()
      channel.send(data)

  }, 3000) ```
pale vessel
#

is that really the command?

weak rain
#

no

#

its just a feature

pale vessel
#

you must have defined message

#

for example as msg

weak rain
#

if the bot finds any channel with memes topic

#

it will start sending memes

pale vessel
#

yes and that needs the message's guild

earnest phoenix
#

BRUVV

pure lion
#

Are topics discord collections or arrays

pale vessel
#

it's a string lol

pure lion
#

I mean the content

faint prism
#

which is technically a char array mmLol

pure lion
#

Unless you can't access

weak rain
#

@pale vessel i should add this in message event?

feral aspen
#

Whats the difference between Application ID and oAuth ID, and what do I put in one of them?

pure lion
#

Then that's shit

#

which is technically a char array mmLol
KEKWscritp

pale vessel
#

@weak rain yes, how else did you detect that as a command?

weak rain
#

i just used this

#

and it started uploading

pale vessel
#

if it detects that as a command then it is using the message event

weak rain
#

yeah

#

so its a command i guess

pale vessel
#

are you using a command handler?

weak rain
#

Yes

pale vessel
#

if so then it should at least provide the message as context

earnest phoenix
#

I dont know whats wrong with my bot, but my bot just doesnt want to be a slave that responds to all of the commands we give it

pale vessel
#

show code

#

how did you even manage to get no error

weak rain
#

i made another code but

#

it was like

earnest phoenix
#

E ;-;

weak rain
#

if i restart the bot i will have to setup it again

#

and thats a big thing @pale vessel

pine aspen
#

Is there a way of having something stored as the example below in mongoose.

2380455353: {
  cash: 10,
  bank: 0
}
pale vessel
#

@weak rain use a database

#

nope

earnest phoenix
#

@pale vessel Whats wrong with it?
(this is the whole commands handler)
client.on('message', message =>{
if(message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase()


if(command === 'help')
 message.channel.send('This Bot is currently Under construction')

});

pine aspen
#

An error?

#

@earnest phoenix ^^

earnest phoenix
#

huh

pine aspen
#

Are you getting an error?

earnest phoenix
#

wait arrays are basically objects with an ordered list

#

Are you getting an error?
@pine aspen I only get errors when i do a command

#

Found the error

pine aspen
#

Yeah, can you send me that error plz.

earnest phoenix
#

d!help

(Debug console - FK U)

pine aspen
#

prefix is not defined

earnest phoenix
#

eh

#

?

tight plinth
#

I'm trying to "create" shards with discord.js-light v2 internal sharding, but every time i put a number higher than 0 as the "shards" property, discord.js throw me a "Invalid shard settings were provided" error for no reason. Any idea why?

earnest phoenix
#

if(message.content.startsWith(prefix) || message.author.bot) return;
@earnest phoenix This will return if the message starts with the prefix

pine aspen
#

Oop

faint prism
#

!

earnest phoenix
#

I'm trying to "create" shards with discord.js-light v2 internal sharding, but every time i put a number higher than 0 as the "shards" property, discord.js throw me a "Invalid shard settings were provided" error for no reason. Any idea why?
@tight plinth imagine confusing us between two libraries

#

shards with discord.js-light

discord.js throws me a

#

if(message.content.startsWith(prefix) || message.author.bot) return;
@earnest phoenix This will return if the message starts with the prefix
@earnest phoenix huh ;-;

#

I aint getting Error messages anymore

#

make it reverse for the first test

#

and the bot aint working

#

!

pine aspen
#

Add a !

faint prism
#

!

earnest phoenix
#

to what ;-;

#

For ONLY the first test

tight plinth
#

@earnest phoenix yes, the error comes from the discord.js node_modules sharding manager file

faint prism
#

oml

earnest phoenix
#

yes ;-;

faint prism
#

the logical not

#

add it

earnest phoenix
#

!message.content.startsWith(prefix)

pine aspen
#

Is there a way of having something stored as the example below in mongoose.

2380455353: {
  cash: 10,
  bank: 0
}

If anyone knows what this is called lmk so I can search it up.

tight plinth
earnest phoenix
#

you can

#

I've made smth like that

#

me big brain, but my big brain is full of stupidity

pine aspen
#

Code, do you have an example?

earnest phoenix
#

yeah

#

but it might make your head go brhhhhh

pine aspen
#

lol

#

I'm rly confused on how to make the schematic because of it ;p

weak rain
#
const random = new Random();
const Discord = require("discord.js")
const discord = require('discord.js')
const db = require("quick.db")

module.exports = {
  name: "setmemes",
  category: "moderation",
  usage: "welcome <#channel>",
  description: "Set the welcome channel",
  run: (client, message, args) => {
    
    let channel = message.mentions.channels.first()
    
    if(!channel) {
      return message.channel.send("Please Mention the channel first")
    }

    
    db.set(`memechannel_${message.guild.id}`, channel.id)
    if (!message.member.hasPermission("MANAGE_SERVER")) {
      return message.channel.send(
        "**I m sorry but you need manage server permission to use this command**"
      );
    } 
     let wembed = new discord.MessageEmbed()
    .setColor("RANDOM")
    .setDescription(`**Meme Messages are Successfully Redirected to ${channel} Now Welcome Messages will appear in ${channel} **`);
    message.channel.send(wembed)
  


setInterval(async function(message, guild)    {
  let channel = db.get(`memechannel_${member.guild.id}`);
  if(!channel) return;      let data = await random.getMeme()
  channel.send(data)

}, 3000) 
  }
}
tight plinth
weak rain
#

hows this

tight plinth
#

@weak rain no big code block plz, use pastebin

faint prism
#

Is this valid syntax? setInterval(async function(message, guild)

weak rain
#

owo

pine aspen
#

hmm

tight plinth
#

Is this valid syntax? setInterval(async function(message, guild)
@faint prism yes

earnest phoenix
#
let thisGuysData = JSON.parse(`{
  ${message.author.id}:{
    balance: 1000
}
}`); client.db("userData").collection(message.author.id).insertOne(thisGuysData);
#

a really terrible example

#

need to turn on repl.it to copy my biggasss block of code

#

@pine aspen

pine aspen
#

HMM

earnest phoenix
#

can someone. just. help me. pls.

#

totally ignores the fact this ain't mongoose but mongodb

#

read the whole thing

#

can someone. just. help me. pls.
@earnest phoenix I'll send photos of my feet OwO

pine aspen
#

It's quite similar to mongoose.

earnest phoenix
#

it is what mongoose is based on lol

pine aspen
#

Code, if I have an array I can just use .push correct?

earnest phoenix
#

yeah but

#

if you want property names to be user ids you just JSON parse a template string where the ids are there in the proper places

pine aspen
#

Ok.

earnest phoenix
#

Ngl, i think im better off not trying to code bots anymore

#

lol

faint prism
#

Ngl, i think im better off not trying to code bots anymore
@earnest phoenix I mean. It's an intermediate level coding project

#

So you at least need to understand the programming language
And understand how to use other libraries and APIs

earnest phoenix
#

@earnest phoenix I mean. It's an intermediate level coding project
@faint prism No, i know that, its just the fact that my code is correct (should be) nobody is saying its wrong, and im currently learning JavaScript, and im gonna learn some more Langs in the near future

pine aspen
#

@earnest phoenix don't worry. I was just like you at some point 😉

earnest phoenix
#

Ahh, well

simple stump
#

How do I disconnect my bot from the VC? Or stop my bot from playing anything? I get an error when I use this code:

        if (message.content.startsWith(`${prefix}stop`)) {
            var server = servers[message.guild.id];
            console.log(server);
            if (message.guild.voice.channel) {
                for (var i = server.queue.length - 1; i >= 0; i--) {
                    server.queue.splice(i, 1);
                }

                server.dispatcher.end();

                message.channel.send("Ending the queue. Leaving the voice channel...");

                console.log('Stopped the queue!');
            }

            if (message.guild.connection) message.guild.voice.channel.disconnect();
        }

Error:
https://hatebin.com/osjosjqseu

Printing out server:

{ queue: [ 'https://www.youtube.com/watch?v=9Va88Kt0NN0' ] }

Server is this:

var server = servers[message.guild.id];

Code: https://hatebin.com/purgqhgwsn

wicked pivot
#
message.guild.roles.cache.filter(c => RolesSelected.includes(c.id)).forEach(async (roles, id) => {
                    await roles.edit({
                        deny: ["CONNECT"]
                    })
                });``` the syntax is correct?
restive furnace
#

try it and see

knotty obsidian
#

How can i make an "Muted" role?
I did ```java
event.getGuild().createRole().setName("Muted").setPermissions(Permission.EMPTY_PERMISSIONS).queue();

But the people who have the role can still talk.
earnest phoenix
#

Go to discord, go to the roles, create role, name it Muted, take away all commands, or just the speech/typing command, and boom

knotty obsidian
#

thats

#

what i did

#

event.getGuild().createRole().setName("Muted").setPermissions(Permission.EMPTY_PERMISSIONS).queue();

#

and also

#

permissions, not commands

earnest phoenix
#

LMAOO, i revealed my bots token in pastebin

#

it got me scared as shiz when i realized

faint prism
#

Rip

earnest phoenix
#

i regenerated bot token, and deleted the pastebin

#

welp

wicked pivot
#
message.guild.channels.cache.filter(c => !ignoreChannel.includes(c.id)).forEach(async (channel, id) => {
                    if(channel.type === "voice"){
                        console.log(channel.name)
                        await channel.overwritePermissions(garçon, [{
                            CONNECT: false
                        }]);
                        await channel.overwritePermissions(fille, [{
                            CONNECT: false
                        }]);
                        await channel.overwritePermissions(nonbinaire, [{
                            CONNECT: false
                        }]);
                    }
                });```in v11 it works but not in v12
tight plinth
#

wdym

#
 await channel.overwritePermissions(garçon, [{
                            CONNECT: false
                        }]);
                        await channel.overwritePermissions(fille, [{
                            CONNECT: false
                        }]);
                        await channel.overwritePermissions(nonbinaire, [{
                            CONNECT: false
                        }]);```define garçon, fille and nonbinaire k thx
faint prism
#

@earnest phoenix I do something like:

let commandQuery = msg.content.split(prefix)[1];
switch (commandQuery) {
  case 'help': helpCmd(msg); break;
}
earnest phoenix
#

@earnest phoenix I do something like:

let commandQuery = msg.content.split(prefix)[1];
switch (commandQuery)

@faint prism
So, what u saying? steal ur code and walk away like a hobo on the streets

faint prism
#

What

#

No

earnest phoenix
#

Then watchu mean, mate

faint prism
#

There are different ways of approaching what your doing

#

Since you said you don't understand what your code means. This example is a bit simplier to comprehend

earnest phoenix
#

Like there is different positions in se- cancel!

wicked pivot
#

@tight plinth js let garçon = message.guild.roles.cache.get('535579900955066392') let fille = message.guild.roles.cache.get('535579820088754178') let nonbinaire = message.guild.roles.cache.get('662724365095403577')

tight plinth
#

hm

earnest phoenix
#

hi

#

Yeah, i dont look at what the code means, i just learn the code, and preifixes, and just implimant, i dont bother learning the actual meaning of the code, and that, right there is my down fall

knotty obsidian
#

How can i make an "Muted" role?
I did ```java
event.getGuild().createRole().setName("Muted").setPermissions(Permission.EMPTY_PERMISSIONS).queue();

But the people who have the role can still talk.
sudden geyser
knotty obsidian
#

oh

sudden geyser
#

You need to deny their permission in the channels as well.

knotty obsidian
#

ik

#

but

#

how do i do it?

faint prism
#

Yeah, i dont look at what the code means, i just learn the code, and preifixes, and just implimant, i dont bother learning the actual meaning of the code, and that, right there is my down fall
@earnest phoenix your saying you memorize someone else's code and use that instead of understanding what it does? :|

sudden geyser
#

One way would be to iterate over every channel in the guild and deny the role permission to send messages, add reactions, speak (voice) etc. which requires sending a lot of API actions. but it's how it's been implemented in a lot of moderation bots

earnest phoenix
#

@earnest phoenix your saying you memorize someone else's code and use that instead of understanding what it does?
@faint prism basically, but not really, but yes, basically, im a lil kid, what can i say, mate

sudden geyser
#

I've never tried it in JDA (I've used it, but not made a moderation bot) but I know the general idea around it.

faint prism
#

@earnest phoenix
Tell me what variable a equals:

let a = 0;
a++;
a += 2;```
knotty obsidian
#

well wouldnt it kinda do it on its own when you deny it?

earnest phoenix
#

im on page 3 of learning JS, i dont know this shiz ;-;

faint prism
#

It's 3

earnest phoenix
#

cool, im not a smartass, im just a lil kid on a app that is not allowed for him

sudden geyser
#

No, think of hierarchy:

Role
|_ channel category
|__ channel

earnest phoenix
#

;-;

sudden geyser
#

Whatever the channel or channel category has overrides it

#

The channel has top priority.

#

And you have to factor in other roles as well

knotty obsidian
#

so i need to loop trough every channel category and deny the perms right?

sudden geyser
#

Yeah I think so. When I think of it, it sounds like API spam, but I don't know any better way of doing it due to the number of faults there are with it being complicated for users (some people, for example, do the green-tick red-tick pattern on every role).

knotty obsidian
#

the thing is on other bots it takes around 2-6 seconds to setup the role

#

it might be looping trough the categories

#

so

#

i guess

earnest phoenix
#
Mon Aug 31 2020 15:52:52 GMT+0200 (Central European Summer Time)

to 

2020-08-31T13:56:29.366Z

How i can convert it ?

knotty obsidian
#

haha idk how to loop trough every category changing the perms oliypls

#

this will be... fun

#

any ideas on how to start with making a loop?

wheat jolt
#
Mon Aug 31 2020 15:52:52 GMT+0200 (Central European Summer Time)

to 

2020-08-31T13:56:29.366Z

How i can convert it ?
@earnest phoenix Date.parse('Mon Aug 31 2020 15:52:52 GMT+0200 (Central European Summer Time)').toISOString()

sudden geyser
#
  1. This returns a list of all channels in the guild (text, voice, category) https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/entities/Guild.html#getChannels()
  2. Iterate over it (for (type variable : theList) {...})
  3. Use upsertPermissionOverride to create or update the role permissions in the channel. Keep in mind, text, voice, and categories are all channels (https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/entities/GuildChannel.html#upsertPermissionOverride(net.dv8tion.jda.api.entities.IPermissionHolder)).
  4. Use one of the .deny methods on the action it returns

@knotty obsidian

earnest phoenix
#

@earnest phoenix Date.parse('Mon Aug 31 2020 15:52:52 GMT+0200 (Central European Summer Time)').toISOString()
@wheat jolt btw u can use new Date('Mon Aug 31 2020 15:52:52 GMT+0200 (Central European Summer Time)')

faint prism
#

As a ctor, yeah

#

Does the parse function allow you to add error handling?

#

Otherwise, I'd imagine they are the same (without the object instead of a string being returned ofc)

drifting wedge
#

return await channel.connect(), msg.send(f":lp: Connected to: {channel}")

#

how do i get the channel name?

#

it just says connected to none

faint prism
#

the lib docs should say what properties the channel class has

#

I've got a d.js question. I set my game status on ready event, but after a day it seems that the status goes away

#

I don't get that issue with D.NET.

drifting wedge
#
    async def _queue(self,msg):
        """
        Show the current songs in queue
        `Ex:` s.queue
        `Command:` queue()
        """
        if msg.voice_client is not None:
            if msg.guild.id in self.player:
                if self.player[msg.guild.id]['queue']:
                    emb=discord.Embed(colour=self.random_color, title=':playlist:   |   Queue')
                    emb.set_footer(text=f'Requested by {msg.author.name}',icon_url=msg.author.avatar_url)
                    for i in self.player[msg.guild.id]['queue']:
                        emb.add_field(name=f"**{i['author'].author.name}**",value=i['title'],inline=False)
                        #embed.add_field(name=f"", value=f"****")
                        # __Up Next:__\n [title](download.title,url=download.url) | `Requested by: {i["author"].author.name} ({i["author"].author.name}#{i["author"].author.discriminator})`
                    return await msg.send(embed=emb)``` this is python, and on the ```emb.add_field(name=f"**{i['author'].author.name}**",value=i['title'],inline=False)``` row im confused on how to change the value
feral aspen
#

hello

sudden geyser
#

@drifting wedge what are you looking to do exactly

drifting wedge
#

basicly its for the queue command

#

i want it to send this

#

```Up Next:\n title | `Requested by: {i["author"].author.name} ({i["author"].author.name}#{i["author"].author.discriminator})````

#

as the value for the embed field

#

emb.add_field(name=f"{i['author'].author.name}",value=i['title'],inline=False)

#

replace this with that

#

but i dont know how

#

like the value

#

@sudden geyser

feral aspen
#

How can I make my bot get removed from specific server IDs?

sudden geyser
#

What library

feral aspen
#

ping me if u know

#

Discord.JS node v12

sudden geyser
#

Use <Guild>.leave()

#

You'll need to get the guild ID either by fetching it (<Client>.guilds.fetch I think) or looking in your cache first (<Client>.guilds.cache is a collection)

feral aspen
#

My index is only

const { token } = require("./botconfig.json")
const bot = new Client();

["commands", "aliases"].forEach(x => bot[x] = new Collection());
["console", "command", "event"].forEach(x => require(`./handlers/${x}`)(bot));

bot.login(token)```
#

Nothing else.

#

So

#

?

sudden geyser
#

@drifting wedge sorry, I can't really follow along with your source code as it's hard to interpret.

#

Hamoo what does that have to do with leaving a specific guild though.

#

When do you want your bot to leave said guild. When the user runs a command? When an event is emitted (such as guildCreate)?

tidal marlin
#

How does JSON.parse(fs.readFileSync("./storage/userData.json", "UTF8")); work?

#

I tried using it, and even put location and all, but it never saves

misty sigil
#

userdata.json?

sudden geyser
#

readFileSync reads the file synchronously. The first arg is the location of the file from the relative start of your Node.js project, not the relative path of where you're currently in

feral aspen
#

When do you want your bot to leave said guild. When the user runs a command? When an event is emitted (such as guildCreate)?
@sudden geyser When a command is executed

tidal marlin
#

The location seems correct, cause if I try to put any other than this one, there's an error

#

But the fact is that it doesn't save

feral aspen
#

its readFileSync

#

Its supposed to be write or something, not sure.

tidal marlin
#

But writing to the variable works fine

sudden geyser
#

Then do the logic I sent you in a command.

#

Wherever you're creating the command is where you should:

  1. Find the guild by ID in the cache (or fetching it if needed)
  2. Leave the guild if found
#

Marek readFileSync only reads the file to my knowledge.

#

It doesn't write to it.

#

What are you doing to save it?

tidal marlin
#

That's all there is to command

#

just thought it was weirdly working cause inside the editor, it operated good as variable but obviously didn't remember old values so it reseted

drifting wedge
#

@sudden geyser

#

embed.add_field(name=f"**{i['author'].author.name}**",value=i['title'],inline=False)

#

this is python

#

then basicly i just want to change the value of the embed

sudden geyser
#

Yeah I'm confused about this:

then basicly i just want to change the value of the embed

Like, I'd assume this would be value:

value=i['title']

Now, you want to change that, but to what do you want to change it to? What do you want to do? You govern your own source code. Up you said it was for the queue command and that you wanted it to send this for the vaalue of the embed field: ```py
Up Next:\n title | `Requested by: {i["author"].author.name} ({i["author"].author.name}#{i["author"].author.discriminator})

And you want to use that instead of `value=i["title"]`. Is the difficulty you're having because it's not being formatted propertly, or because you don't have access to certain variables? Like, take this for example: `[title](download.title,url=download.url)`

Where did you define `download`? Did you mean to use string interpolation? I sort of understand now going through your source code manually that each iteration (`for i in self.player[msg.guild.id]['queue']:`) is supposed to include the song playing and who requested it, but you need those variables/properties first. Where are you getting `download` from?
drifting wedge
#

true

#

1 sec

#
    def __init__(self,source,*,data,volume=0.5):
        super().__init__(source,volume)
        self.data=data
        self.title=data.get('title')
        self.url=data.get("url")
        self.thumbnail=data.get('thumbnail')
        self.duration=data.get('duration')
        self.views=data.get('view_count')
        self.playlist={}```
#

ytdl=youtube_dl.YoutubeDL(new_opts)
download1=await Downloader.video_url(song,ytdl=ytdl,loop=self.bot.loop)

    download=download1[0]
    data=download1[1]
sudden geyser
#

So i is an instance of Downloader?

drifting wedge
#

i think so, yes

#

i got this from a yt vid

#

which explains why i dont understand it too much

#

i mean

#

1 sec

#

i can try to edit it a bit to make it simpler

#

ok

#

so i removed the thing that says the download

#
__Up Next:__\n title | `Requested by: {i["author"].author.name} ({i["author"].author.name}#{i["author"].author.discriminator})````
sudden geyser
#

Well you sort of still need the downloader to get the title of the video, but if i was an instance you're either not showing the part where you define author on it, but it doesn't make as you're also trying to use the bracket syntax to access a property when it wouldn't apply to classes.

I think this is more complicated than it needs to be. You say you got it from a video so you should either validate what info you got from the video or look into how to properly do it.

wanton iron
#

hey my bot just got tested but he was declined for this reason

restive furnace
#

why do you need permissions for your commands?

wanton iron
#

to delete the message just after

slender thistle
#

Which command was it

restive furnace
#

you should always catch those and then just do nothing

#

^ apart logging to console

wanton iron
#

y right i think they tried to test it without the permissions and i didn't prevent it

restive furnace
#

yeah, they will be tested with permissions 0

wanton iron
#

i don't know which command it was cause i have to delete the message after every command

#

ok ok i'll change it

slender thistle
#

p.s. help command must work without any special permissions

wanton iron
#

right but i got this to every command

#

and it's stupid code

#

just realize

restive furnace
#

dont throw the error

summer acorn
#

is spamming the api for ex 1 second to change roles for thousands of members, so the staff don't have to do it manually, api abuse

slender thistle
#

Dear lord that's just a bleh idea

wanton iron
#

y

restive furnace
#

is spamming the api for ex 1 second to change roles for thousands of members, so the staff don't have to do it manually, api abuse
@summer acorn dyno can do it,so i guess its not

slender thistle
#

eh it'd probably go unnoticed. I do the same thing sometimes and just let my library handle ratelimits @summer acorn

summer acorn
#

thank you

dusky mason
#

hola shiv

slender thistle
#

I'd recommend an interval though

#

1-1.5s sounds appropriate enough

wanton iron
#

how do i put my bot back on verification ?

dusky mason
#

shiv go support, there is something "serious"

weak rain
#

10000

#

is this

#

okay for interval

earnest phoenix
#

that's like asking is it okay to drink every 10 minutes

#

...well drink what

weak rain
earnest phoenix
#

ie interval for what

weak rain
#

auto memes

earnest phoenix
#

yeah that didn't help at all

drifting wedge
#

if i have a title embed

#

title as in author

#

how do i add value

#

i have title, but whats the value

earnest phoenix
#

huh?

#

??

drifting wedge
#

1 sec

#

emb=discord.Embed(colour=self.random_color, title=':playlist: | Queue', value="Up Next")

#

the value doesnt work

earnest phoenix
#

well

#

there's no property on an embed called value

#

lol

drifting wedge
#

ah

#

how would i add a description?

#

would it be description lol

earnest phoenix
#

yes

drifting wedge
#

me is retart

#

sry lol

#

my stupidity is immense

gray prism
#

Hi. Lately I've been using @raven torrent's python bot template (which itself is based on discord.py). Everything's been going great for the most part, except I'm having trouble understanding asyncio. Is there a way to run the bot itself concurrently with a loop that gets (and exec()s) input from the commandline? I'm pretty sure I'm just misunderstanding how coroutines work, but in any event (no pun intended!), I haven't been able to get something to work myself.
Initially, I naïvely just stuck a while True loop directly in the on_ready event definition. That went as well as you can expect.
Then I tried putting a while True loop in a coroutine

    while True:
        exec(input(client.user.name+": >>> "))

and scheduling that as a task in the on_ready event

    print('Logged in as ' + client.user.name)
    print("Discord.py API version:", discord.__version__)
    print("Python version:", platform.python_version())
    print("Running on:", platform.system(), platform.release(), "(" + os.name + ")")
    print('-------------------')
    #FIXME: Trying to figure out how to run this coroutine concurrently with the rest of the process...
    ***client.loop.create_task(console_loop())***

but it still blocks the rest of the program.
Can anyone give me a hand here? This is pretty much my first time trying to do anything with concurrent execution in any language, so... I'm a bit lost, even after reading the documentation

raven torrent
#

Go in my dms

earnest phoenix
#

My command Handler isnt working 😦

sudden geyser
#

Okay but what about it isn't working

earnest phoenix
#

When i do a command, it ain't working

sudden geyser
#

Do you get an error? Do you know what's causing it to not work? Are you able to trace where it's failing?

#

You need to inform us what isn't working about it. "It isn't working" is not specific.

earnest phoenix
#

Hold on, mate

weak rain
#
    at Client.<anonymous> (E:\Thunder\server.js:64:32)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (E:\Thunder\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (E:\Thunder\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)        
    at WebSocketManager.handlePacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (E:\Thunder\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (E:\Thunder\node_modules\ws\lib\websocket.js:797:20)
(node:3080) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3080) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
faint prism
#

client.guild is that valid?

weak rain
#

Yes

faint prism
#

Don't you need to get a specific guild

weak rain
#

no

faint prism
#

How does the client know which guild?

earnest phoenix
#

yes you do

#

auger is correct

#

lol

weak rain
#

it will fetch

#

all channels

#

will

#

memes

#

topic

#

and send

#

memes there

earnest phoenix
#

the docs have no mention of that behaviour

earnest phoenix
#

are you on v12

steady wharf
#

me?

earnest phoenix
#

yes

steady wharf
#

idk i write npm i discord.js only

earnest phoenix
#

aaand you copypasted someone else's code

#

nice

#

anyways

steady wharf
#

no

#

i setup my bot

#

on vds

#

but dont work on vds

earnest phoenix
#

all collections that were in cache moved to cache managers, to access the actual collection you need to use the .cache property, on what were previously the collections but now cache managers

steady wharf
#

what can i do fix it

earnest phoenix
#

read my message

steady wharf
#

i dont know english well

faint prism
#

all channels
@weak rain
irrc, you need to get a specific guild, then get a specific channel.
Alternatively, if you want every guild and every channel inside those guilds, you can use two nested for each loops
guilds.forEach(channel.forEach( {} )) I don't know JS really. So it's up to you to make that work

steady wharf
#

@earnest phoenix

#

i will give my vds and you can fix it?

weak rain
#

not sending memes

faint prism
restive furnace
#
for (let guild of client.guilds.cache)
{ for (let channel of guild.channels.cache) {} }```iirc
faint prism
#

hm

weak rain
#

its another

steady wharf
#

@earnest phoenix

#

can you helpme

restive furnace
#

its pseudocode mhm

earnest phoenix
#

i will not fix your code for you

faint prism
#

I was going to let them do that

earnest phoenix
#

i told you what to do

steady wharf
#

bro i dont understand you

#

i dont know english well

#

😦

earnest phoenix
#

to access the actual collection you need to use the .cache property, on what were previously the collections but now cache managers

#

i'll link you some docs, maybe it'll help you understand

steady wharf
#

okey

earnest phoenix
misty sigil
#

.cache is a collection iirc

floral creek
#

hm..

#

https://top.gg/api/widget/730124969132163093.png?

#

how can I make my bot be here?

steady wharf
#

oh fk it

#

i cant fix it

weak rain
#

sending a meme every 30 seconds for a bot is okay?
or it will be called spamming

floral creek
#

yes

weak rain
#

yes what?

floral creek
#

its aspam

steady wharf
#

thanks anyway @earnest phoenix

floral creek
#

spam

restive furnace
#

@steady wharf learn js is the only possibility, w3schools is a cool place to learn js :)

steady wharf
#

thanks

#

:/

earnest phoenix
#

members.sort statement fails.

summer torrent
#

what is your djs version

earnest phoenix
#

12.3.1

sudden geyser
#

You're probably looking to use .sort on the collection instead of the manager

summer torrent
#

members.cache

faint prism
#

@steady wharf Programming a bot is the same as programming regular software. You need to understand the instructions you are telling your program to execute.

weak rain
#

how should i setup db for a command

summer torrent
#

Also there is a typo @earnest phoenix

#

embed..addField

faint prism
#

how should i setup db for a command
@weak rain To make a db, you should make a class that follows the CRUD database context pattern

earnest phoenix
#

thx

weak rain
#

hm

#

i want to setup db for my automeme command

faint prism
leaden rover
#

So, I am making a premium only cog, but how do I make it so if a user (as in the ctx.author) has been apart of my Patreon? This is discord.py btw

faint prism
#

Patreon has an API

leaden rover
#

Ok

karmic compass
#

using js ```javascript
switch(variable) {
case "sfljkl":
//code
break
case "asdkjfsldfkj":
//code
break
default:
break

#

wondering if that means if it isnt the two options it just doesn't do anything

#

am i right/correct?

faint prism
#

Yeah

#

It will hit default if no cases match the variable in the switch

#

which contains nothing but a break

#

@karmic compass

karmic compass
#

ah

#

verty cool

wanton iron
#

hey I just saw that my bot was tested without the permissions so it crashed I fixed the problem but if it is retested I have to put an error message when there are no permissions or the people testing the bot will put them instinctively?

quartz kindle
#

@tight plinth the "shards" property is an array of shard IDs to spawn, not the total shard count

#

for example shards:[0,1,2,3]

tight plinth
#

ah

#

but it says in the readme that it works with a number too

faint prism
#

hey I just saw that my bot was tested without the permissions so it crashed I fixed the problem but if it is retested I have to put an error message when there are no permissions or the people testing the bot will put them instinctively?
@wanton iron The invite link can include permissions

opal plank
#

^^

#

Use the permission calculator

quartz kindle
#

yeah it should i guess

#

but try with an array

wanton iron
#

y i know but when they test the bot they do it without it

tight plinth
#

k

#

@quartz kindle works now, ty ^^

faint prism
#

y i know but when they test the bot they do it without it
@wanton iron Correct

wanton iron
#

hmmm so what should i do, put 0 error message or put a warning message like "you need permission to do that"

opal plank
#

Correct

#

Do a permission check before running commands

faint prism
#

hmmm so what should i do, put 0 error message or put a warning message like "you need permission to do that"
@wanton iron if you don't have a very common prefix, do the latter

wanton iron
#

bcs the reason why my bot got declined was because in my catch block i throwed the error (y ik stupid) but i'm scared if they test it again they will just think it's not working

opal plank
#

Output something at least

#

The user has no way of knowing

faint prism
#
try {
}
catch (e) {
  throw e // uno reverse card
}```
wanton iron
#

y right thanks

#

y xD

stoic hull
#

would anyone be able to help me setup ssl on apache2?

still merlin
#

I'm trying to make a command handler purge command, but I have a await issue,

C:\Users\Jon\Desktop\SpiderBot Command Handler\commands\purge.js:18
        await message.channel.messages.fetch({ limit: amount }).then(messages => {
        ^^^^^

SyntaxError: await is only valid in async function``` I thought I made a valid thing, But apparently not, Would I need to add a 'async' to my modules.export and my client.on event?
stoic hull
#

make the function ASYNC

still merlin
#

okay thanks

weak rain
#

i need developement servers

#

link?

tight plinth
#

@quartz kindle a problem appeared: if i eval "console.log(insert something here)", nothing is sent to the console

weak rain
#
const random = new Random();
const Discord = require('discord.js');

    setInterval(async function(guild, message) {
      const channel = message.guild.channels.cache.find(channel => channel.topic === "memes");
      if(!channel) return;      let data = await random.getMeme()
      channel.send(data)

  }, 3000)  ```
#

how should i define guild and message

wanton iron
#

what is the number of the permission error so I can recognize it

quartz kindle
#

@tight plinth using the sharding manager?

tight plinth
#

yes

quartz kindle
#

there was something on the discord.js repo about shards not passing console data to the parent

tight plinth
#

and idk about console.log

quartz kindle
#

whats your discord.js version?

still merlin
#

I've never used aysnc functions before and I was wondering if someone could help me make a aysnc function that works with a command handler? please (d.js)/explain how they work

quartz kindle
#

btw if you're still on djslight v2, i'd suggest you upgrade to v3

tight plinth
#

12.2

wheat hornet
#

Wait v3 is out

tight plinth
#

hm

#

the only reason i stay on v2 rn is msg.reply and the message event

#

but i'll consider upgrade

wheat hornet
#

Can anyone give me a link for v3 docs

misty sigil
#

what

tight plinth
faint prism
wheat hornet
#

Thx

misty sigil
wanton iron
#

hmm how do I check the permissions granted to my bot? To be able to send a message if it doesn't have them?

misty sigil
#

message.channel.permissionsFor(message.guild.me) returns all perms for a channel in discord.js

wanton iron
#

ok thanks !

quartz kindle
leaden rover
#

So, I am making a premium only cog, but how do I make it so if a user (as in the ctx.author) has been apart of my Patreon? This is discord.py btw

misty sigil
#

why need edit command stuff?

earnest phoenix
#

Is there a way to make a richembed with 2 fields in each inline?

misty sigil
#

yes

earnest phoenix
#

line1 line2
line3 line4

#

how so?

leaden rover
#

example

misty sigil
#

.addFields(
{name: "1", value: "line 1", inline:true},
{name: "2", value: "line 2", inline:true},
{name: "3", value: "line 3", inline:false},
{name: "4", value: "line 4", inline:true},
) iirc

opal plank
#

Array

#

Im pretty sure its array of objects

earnest phoenix
#

hmm i thought it would show

line1 line2
line3
line4 line5

hazy sparrow
#

how do i edit the bot's message after a certain amount of time?

opal plank
#

Inline true or false

warm marsh
#

It doesn't need to be an Array.

opal plank
#

That makes the field be on the same line if its inline

slender thistle
#

@leaden rover either use the Patreon API if there's one or rely on Discord role rewards if you use them

leaden rover
#

Ok

earnest phoenix
#

@hazy sparrow use a settimeout

violet nest
#

hi
My server doesnt show in my profile
can anyone help?

tight plinth
#

@quartz kindle ok
BTW i reinstalled djs and eval/console.log now works

hazy sparrow
#

ok thanks

leaden rover
#

Well, I am trying to find a way to use the Patreon API

#

I got this right now:

    async def setpremium(self, ctx):
        if ctx.author = ```
limber flume
#

how to change color of the buttons :a

#

same with these

earnest phoenix
#

find the classes in inspect element and override them

limber flume
#

huh

#

whats inspect

#

element

restive furnace
#

ctrl + shift + i

limber flume
#

oh

#

i found this

#

idk if its it

earnest phoenix
#

yes

limber flume
#

whats override

lusty lintel
#

helli

earnest phoenix
lusty lintel
#

how to make code in phone

limber flume
#
<span class="votebutton btn btn-orange btn-2x" style="cursor: pointer!important;">
                                        Vote
                                    </span>
earnest phoenix
#

Kinda shows up as this

opal plank
#

what the actualy heck is that?

limber flume
#

woah

earnest phoenix
#

things eyes_shaking

opal plank
#

WHY SO MANY CALLS?

#

apollo wtf

limber flume
#

oh so how- do i override top.GG

#

oliy ples no ban me

earnest phoenix
#

are you like

opal plank
#

set a variable to getBar() dude

#

you calling the same thing 7 times

earnest phoenix
#

wdym? its a function?

#

to handle the bar string

#

literally override the css in a style tag in your big description

opal plank
#

await i assume its a call

limber flume
#

literally override the css in a style tag in your big description
@earnest phoenix erm i will experement

earnest phoenix
#

oh well, I could unasync it.

#

I dont have an await inside it anymore

opal plank
#

if its not async its fine

#

usually await means its a call

#

but you stillc alling the same thing 7 times

#

set it to a variable

#

and reference it

earnest phoenix
#

would it still be 7 variables?

opal plank
#

no

#

you calling literally the same thing

earnest phoenix
#

with different inputs and outputs?

opal plank
#
var bar = await call(foo);

bar, bar, bar, bar, bar

#

what is that thing?

#

show the whole code

#

you cut half way thru it

#

it looks like an embed inline

earnest phoenix
#

its an .addField

#

each line

opal plank
#

i figured as such

leaden rover
#

Is there a good module on PyPi that can be good for Patreon stuff?

opal plank
#

first: addFields() plural

earnest phoenix
#

my problem is me trying to have it as 2 lines instead of 3 lines per inline

opal plank
#

second: reference stuff that you call often

#

reduces stress

earnest phoenix
#

mkay.

opal plank
#

this ony calls that function once

#

once the code is run in sequence that variable value is already set

#

once you call, it calls the value, not the function

earnest phoenix
#

The input has different min and max, not everything is the name

opal plank
#

hence why i said to post the whole thing

#

cuz i could be telling you something wrong