#development

1 messages ยท Page 1176 of 1

vale garden
#

why

#
const api = require('novelcovid')
const Discord = require('discord.js')

module.exports = {
  name: 'today19',
  description: "corona today info",
  execute: async (message, args) => {

    api.settings({
    baseUrl: 'https://disease.sh'
})

const data = await api.all()

const COVID = new Discord.MessageEmbed()
.setTitle("COVID-19 Today's Stats")
.setAuthor(`Requested by ${message.author.username}`, `${message.author.displayAvatarURL()}`)
.setThumbnail('https://cdn.pixabay.com/photo/2020/04/29/08/24/coronavirus-5107804_1280.png')
.setColor("#ffa343")
.addFields(
  {name: '**`Today\'s Cases:`**', value: data.todayCases},
  {name: '**`Today\'s Deaths:`**', value: data.todayDeaths},
  {name: '**`Today\'s Recoveries:`**', value: data.recovered},
)
.setFooter("Info provided by: https://disease.sh")
.setTimestamp()

message.channel.send(COVID)

  }
}
#

my code

#

here

torn ravine
#

what command are you executing

#

like

#

.help

#

@vale garden ?

#

try executing (your prefix)today19

zealous vortex
#

@golden pewter

delicate shore
#

is there any way i can store messages temporarily and then send the transcript to person

#

this is how i currently use

earnest phoenix
#

Hey,
I want to make if someone vote my bot on Top.gg Then he will get reward!
How can i do this?

delicate shore
lusty quest
#

you can use webhooks

delicate shore
lusty quest
#

DBL offer one that returns the userid

delicate shore
#

ok

#
client.on("messageReactionAdd", async (reaction, user, message) => {
  if (user.partial) await user.fetch();
  if (reaction.partial) await reaction.fetch();
  if (reaction.message.partial) await reaction.message.fetch();
  if (user.bot) return;

  let ticketid = await settings.get(`${reaction.message.guild.id}-ticket`);

  if (!ticketid) return;

  if (reaction.message.id == ticketid && reaction.emoji.name == "๐ŸŽซ") {
    reaction.users.remove(user);

    reaction.message.guild.channels
      .create(`ticket-${user.username}`, {
        permissionOverwrites: [
          {
            id: user.id,
            allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
          },
          {
            id: reaction.message.guild.roles.everyone,
            deny: ["VIEW_CHANNEL"]
          },
          {
            id: reaction.message.guild.roles.cache.find(
              role => role.name === "Patrol"
            ),
            allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
          }
        ],
        type: "text"
      })
      .then(async channel => {
        channel.send(
          `<@${user.id}>`,
          new Discord.MessageEmbed()
            .setTitle("Welcome to your ticket!")
            .setDescription("Support Team will be with you shortly")
            .setColor("RANDOM")
            .addField(
              "**Links**",
              "**[Invite Me](https://discord.com/oauth2/authorize?client_id=745926398212046878&scope=bot&permissions=8) | " +
                "[Support Server](https://invite.gg/blacksheep)** | "
            )
        );
      });
  }
});```

**What I wanna do?**
=> I want my bot to send a transcript to a channel called transcripts
#

i can do channel thingy

#

but how can i store messages

#

maybe i need to fetch messags if yes then how can i send it

restive furnace
#

fetch messages, iterate through them, add the content to some variable, then send the content of the variable to the channel

delicate shore
#

fetch messages, iterate through them, add the content to some variable, then send the content of the variable to the channel
@restive furnace how to add content to some variable do u have a link to docs

#

where some info on this thing is there

#

i tried finding

#

but wasn't able to

warm marsh
#

x = fetched.content

restive furnace
#

actually x += "\n" + content

#

if u want smth like that

delicate shore
#

do i need to get an object from fetch

warm marsh
#

It returns the message object

#

When you fetch a message.

delicate shore
#

ok'

warm marsh
#

V12 <channel>.messages.fetch(id)

delicate shore
#

no id

#

every message

earnest phoenix
#

the fuc

#

every message

#

why

restive furnace
#

100 is max

warm marsh
#

Trying to get banned?

delicate shore
#

my bot is a ticket bot

restive furnace
#

probablt he is working in ticket bot tbh

earnest phoenix
#

so

restive furnace
#

it isnt probhidden

delicate shore
#

i wanna send transcript

warm marsh
#

Then fetch messages in a channel

delicate shore
#

and yes i will set limit at 80

#

messages

earnest phoenix
#

Save every single message when it is sent

warm marsh
#

Nah

earnest phoenix
#

Don't save it AFTER the ticket is closed

#

That way you can pass the limiy

warm marsh
#

Bad idea that could get big depending on the issue.

#

There's a method for fetching x messages from a channel

delicate shore
#

something like this

warm marsh
#

Mhhh

#

Kinda

restive furnace
#

there is

#

how purge command would work

#

??

delicate shore
#

message.channel.fetchMessages({ limit: 80 }).then(messages, fetched => {
let x = fetched.content

earnest phoenix
#

smh

warm marsh
#

It returns one argument messages

delicate shore
#

actually x += "\n" + content
@restive furnace by conyent u mean fetched.content?

restive furnace
#

yes

#

its pseudo code

delicate shore
#

ok

warm marsh
#

You need to define x prior

#

And I recommend the \n after the content

delicate shore
#

message.channel.fetchMessages({ limit: 80 }).then(messages, fetched => {
let x += "\n" + fetched.content})

#

something like this

warm marsh
#

No

delicate shore
#

no ?

warm marsh
#

It returns messages

buoyant sigil
#

?

warm marsh
#

Which is a collection of all the messages

delicate shore
#

that's what i want

buoyant sigil
#

oh i m in the wrong server

warm marsh
#

Iterate over them and append to the string.

carmine summit
#

Bruh

delicate shore
#

Iterate over them and append to the string.
@warm marsh i am not getting mwaning of lterate

pale vessel
#

why did you star that

warm marsh
#

loop over

delicate shore
#

forEach

warm marsh
#

You could

pale vessel
#

no

crystal socket
#

@carmine summit it happened for a reason, if you were doing it for the badge, stop

delicate shore
#

yes

#

who tf wants badge anyways

carmine summit
#

Fking badge... So hard to get... now they are now unobtainable

restive furnace
#

what? no

#

and dont do it for badge

delicate shore
#

yes

carmine summit
#

The "EARLY"

delicate shore
#

quit coding

restive furnace
#

if u care so much abt badges, dont make a bot

carmine summit
#

EARLY bot developer badge

#

Damn

earnest phoenix
#

welp if you want your bot to be blocked by discord then don't give an f about verification

delicate shore
#

anyways @warm marsh can you explain a bit more to me?

warm marsh
#

You fetch the messages.

#

Which returns a collection of messages

delicate shore
#

yes

#

yes

warm marsh
#

iterate over those messages and append to the string then send.

delicate shore
#

That's what i don't get

#

what do i need to loop?

warm marsh
#

Over the messages

#

fetchMessages

#

returns a Promise<Collection<Message>>

delicate shore
#
forEach((message)=>{
let x += "\n" + fetched.content
})```
#

something like

pale vessel
#

hmmm maybe let content = ""; fetchMessages().then(x => x.map(x => content += x.content + "\n"));

#

yeah

warm marsh
#

Would work.

delicate shore
#

ok thanks :)

#

but one thing

#

what do i get in end as messages

#

and how can i send it as a text file

warm marsh
#

Store as text file then send file

delicate shore
#

store which variable

#

x?

warm marsh
#
.then(function(messages) {
    let listOfMsgs = [];
    for (const m of messages) m.content && listOfMsgs.push(m.content);
    message.channel.send(listOfMsgs.join("\n"));
});```
#

store the string of messages

delicate shore
#
let content = ""; fetchMessages().then(x => x.map(x => content += x.content + "\n")).then(function(messages) {
    let listOfMsgs = [];
    for (const m of messages) m.content && listOfMsgs.push(m.content);
    message.channel.send(listOfMsgs.join("\n"));
});```
pale vessel
#

nono

warm marsh
#

yikes.

delicate shore
#

sorry :(

warm marsh
#

Use one or the other.

delicate shore
#

oh

#

ok but i need to fetch as well

warm marsh
#
<channel>.fetchMessages({
    limit: 80
})
.then(function(messages) {
    let listOfMsgs = [];
    for (const m of messages) m.content && listOfMsgs.push(m.content);
    message.channel.send(listOfMsgs.join("\n"));
});```
delicate shore
#

Thank you

warm marsh
#

Change the send to storing that into a txt file then send the file.

#

But please, learn what it does.

delicate shore
#

ok

fierce stag
#

could someone help me? my code isn't fetching from subreddits properly

delicate shore
#

AFAIU You took list of messages as null
Then for every M of messages you sent it to a channel

warm marsh
#

We require to see code.

pale vessel
#

this worked for me channel.send({ files: [{ name: "test.txt", attachment: Buffer.from("text") }] });

delicate shore
#

AFAIU = as far as i undestood

fierce stag
#

do you want the code in this channel or?

warm marsh
#

as null?

#

Hastebin pref

delicate shore
#

i mean[]

warm marsh
#

the messages are fetched from the <channel>

#

<channel> being the fetched channel

fierce stag
warm marsh
#

message.guild.channels.fetch(id).fetchMessages() ...

pale vessel
#

my pseudocode:

let content = "";
const messages = await fetchMessages();
messages.map(x => content += x.content + "\n"));
channel.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```
delicate shore
#

what does buffer.from does

warm marsh
#

Exactly that.

#

Creates a buffer from x

delicate shore
#

oh ok thanks

warm marsh
#

flazepe

pale vessel
#

yeah

warm marsh
#

you could save appending to that variable by changing content = messages.map....

pale vessel
#

and join

#

you're right

warm marsh
#

then Buffer.from(content.join("\n")

#

would make it more uniform also as it wouldn't be added to the end of the last entry

pale vessel
#

i just saw someone used += so why not

warm marsh
#

Yeah

delicate shore
pale vessel
#
const content = (await fetchMessages()).map(x => x.content).join("\n");
channel.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```
warm marsh
#

Yes, it's part of the Guild object.

delicate shore
#

ok

warm marsh
#

@fierce stag why are you using Object.keys(response).length for it?

delicate shore
#
const content = await fetchMessages().then(x => x.map(y => y.content).join("\n"));
channel.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```

@pale vessel
How u define fetch messages

#

fetchMessages then

fierce stag
#

i've tried so many things on that line itself, nothing is working :/

pale vessel
#

x is messages

warm marsh
#

It's a method of channel

#

<channel>.fetchMessages(....)

delicate shore
#

it says me fetchMessages is not a func

pale vessel
#

it's messages#fetch()

warm marsh
#

Nah that's for fetching a single message

#

It's pseudocode PGamerX

delicate shore
#

e\

#

ok

warm marsh
#

means that's not the actual code but something you can read from

pale vessel
#

channel.messages.fetch({ limit: 2 }) works

warm marsh
#

Oh it was changed?

pale vessel
#

yeah

warm marsh
#

fetchMessages doesn't exist

delicate shore
#
if (command == "close") {
    if (!message.channel.name.includes("ticket-"))
      return message.channel.send("You cannot use that here!");
    let channel = message.channel
const content = channel.fetch({limit: 80}).then(x => x.map(y => y.content).join("\n"));
    message.author.send(`Transcript for your ticket in ${message.guild.name} Server`)
    message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });

    message.channel.delete();
  }```
warm marsh
#

@fierce stag

       let image = response.data.children[Math.floor(Math.random() * (response.data.children).length].data;
#

Try that.

pale vessel
delicate shore
#

i got an error saying (node:4964) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object

warm marsh
#

You were trying to use Object.keys(response) which is apparently only 2 long

delicate shore
#
    message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
#

at this line

earnest phoenix
#

What's this?

#

Should i put my webhook url here?

delicate shore
#

๐Ÿšซ

radiant patio
#

how to fix the second line?



        if(mentionedMember.roles.find(r => r.name === "Blaues_Auge")) return message.channel.send(`${mentionedMember}```
delicate shore
#

it is http://ip:port/dblwebhook @earnest phoenix

earnest phoenix
#

@delicate shore so what?

delicate shore
#

it helps in telling you who voted for your bot

radiant patio
#

TypeError: Cannot read property 'roles' of undefined

fierce stag
#

@warm marsh im getting an error on let image = response.data.children[Math.floor(Math.random() * (response.data.children).length].data;
SyntaxError: missing ) after argument list

warm marsh
#

That's probably something you're missing.

delicate shore
#
    message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```

My code

My error - `(node:4964) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object`
warm marsh
#

But I'll check in-case

pale vessel
#

response.data.children[Math.floor(Math.random() * response.data.children.length)].data;

delicate shore
#

that's not for me right ?

pale vessel
#

nope

delicate shore
#

any idea why i get error

warm marsh
#
 fetch(`https://api.reddit.com/r/dankmemes/top.json?sort=top&t=day&limit=800`)
    .then(response => response.json())
    .then(response => {
        let image = response.data.children[
            Math.floor(Math.random() * (response.data.children).length)
        ].data;

        console.log(image);
    });```
#

it works for me so idk if you're doing something else wrong?

pale vessel
warm marsh
#

Ah I must have deleted it before on accident.

delicate shore
#
if (command == "close") {
    if (!message.channel.name.includes("ticket-"))
      return message.channel.send("You cannot use that here!");
    let channel = message.channel
const content = channel.fetch({limit: 80}).then(x => x.map(y => y.content).join("\n"));
    message.author.send(`Transcript for your ticket in ${message.guild.name} Server`)
    message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });

    message.channel.delete();
  }```
warm marsh
#

Sublime pretty shit

delicate shore
#

this is m fullcode

#

full code*

pale vessel
#

npp gang

fierce stag
#

hm its sending memes now, but how do I check if its truly random?

pale vessel
#

@delicate shore await the messages

fluid basin
#

no

warm marsh
#

When I logged it before it said 100 length so it should be fine

delicate shore
#

where tho

molten wave
#

Ihr dummen arschgesichter mit Narben im Kopf.

delicate shore
#

in content?

molten wave
#

๐Ÿ˜‚

warm marsh
#

lmao

pale vessel
warm marsh
#

That's not the only problem.

#

.then(x => x.map())

#

lol

earnest phoenix
#

it is http://ip:port/dblwebhook @earnest phoenix
@delicate shore

#

Like this?

delicate shore
#
if (command == "close") {
    if (!message.channel.name.includes("ticket-"))
      return message.channel.send("You cannot use that here!");
    let channel = message.channel
const content = await channel.messages.fetch({limit: 80}).then(x => x.map(y => y.content)).join("\n"));
    message.author.send(`Transcript for your ticket in ${message.guild.name} Server`)
    message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });

    message.channel.delete();
  }```
warm marsh
#
let content = message.channel.messages.fetch({limit:80})
    .then(function(messages) {
        return messages.map(message => message.content && message.content);
    }).join("\n");```
#

Wait your code for that should be fine.

pale vessel
#

join it inside .then

warm marsh
#

oh wait

dense haven
pale vessel
#

await channel.messages.fetch({limit: 80}).then(x => x.map(y => y.content).join("\n"));

delicate shore
#

ok i quit gg

pale vessel
#

oh god

warm marsh
#

Could you stop sending the same block over and over?

delicate shore
warm marsh
#
message.channel.messages.fetch({limit:80})
    .then(function(messages) {
        let content = messages.map(message => message.content && message.content).join("\n");
        message.author.send(`Transcript for your ticket in ${message.guild.name} Server`);
        message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
        message.channel.delete();
      });```
fluid basin
#

waw

pale vessel
#

new code

fluid basin
#

spoonfeed alert

pale vessel
#

it's not

warm marsh
#

๐Ÿ‘€

delicate shore
#

๐Ÿ‘๏ธ

warm marsh
#

It's just refactored

pale vessel
#

@delicate shore

delicate shore
#

ok

warm marsh
#

await .then

#

Async and sync on the same line. ๐Ÿ˜ก

pale vessel
#

it's fine

warm marsh
#

no?

#

.then does the same as await

delicate shore
#

ok thanks @warm marsh it worked

warm marsh
#

pretty much

#

so await an already awaited promise

pale vessel
#

it also awaits the then

delicate shore
#

i get no problem but it logs this

warm marsh
#

the .then doesn't return a promise

golden condor
#

Read the error

#

It says

fluid basin
#

flazepe getting rekted

delicate shore
#

yes but i have not defined channel

golden condor
#

Unknown Channel

delicate shore
#

anywhere

golden condor
#

Dude

delicate shore
#

and i am sending it to author

golden condor
#

It's a discord error

#

That the channel

#

Doesn't exist

delicate shore
#

Because I

#

deleted

#

the channel

#

;-;

golden condor
#

There you go.

#

You deleted the channel, that's why there is that error.

warm marsh
#

Maybe

pale vessel
warm marsh
#

but the command needs to be ran in a channel

#

flazepe it just says undefined

pale vessel
#

no, it sent it lul

golden condor
#

That output does

pale vessel
#

that's because the function returns void

golden condor
#

Because the function returns nothing

#

As you can see it works

delicate shore
#

20000 ms = 20 seconds?

pale vessel
#

yes

golden condor
#

Yes

delicate shore
#

ok nice

golden condor
#

Just times it by 1000

slim heart
#
golden condor
#

ez

#

20 * 1000

delicate shore
#

and @golden condor i was doing message.channel.delete() 2 times

#

that is why it was saying it

slim heart
earnest phoenix
#

channel.delete why

warm marsh
#

to delete the channel when the ticket is done

delicate shore
#

becaause wht not

earnest phoenix
#

20 seconds is far too long

warm marsh
#

20e+3

golden condor
#

Just use like 5 seconds

#

5 seconds is enough

viral iris
#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{
    const bot = client
    if (args[0] === 'null') {
        return message.reply('I set your AFK to: \`AFK\`.')};
        
      if (message.author.bot) return;
      if (message.guild.id != "721292328475557928") return;
      if (message.member.roles.cache.has('746608450179563638')) {
        guildMember.roles.remove('746608450179563638');
        message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
      } else {
      if (message.member.roles.cache.has('746608450179563638')) {
          guildMember.roles.add('746608450179563638');
          message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
      }}
  }
};
delicate shore
#

ok

viral iris
#

what's wrong ?

fierce stag
#

@warm marsh can't believe it was such a simple fix, thankyou ๐Ÿคฆโ€โ™‚๏ธ

golden condor
#

We aren't gonna debug your code for you

viral iris
#

what's wrong ?
also no console errors

#

We aren't gonna debug your code for you
@golden condor idk what's wrong

golden condor
#

They don't have either of those roles maybe?

warm marsh
#

np unbound

fluid basin
#

what's wrong ?
Typo in line 13: Did you mean Welcome?

sterile thicket
#

How do I count reactions on collector 'end'?

warm marsh
#

@pale vessel lmao, it's too early my bad

viral iris
#

Typo in line 13: Did you mean Welcome?
@fluid basin then what next ? ๐Ÿ˜‚

fluid basin
#

TypeError: Cannot read property 'roles' of undefined

viral iris
#

u have error ?

#

wait

fluid basin
pale vessel
#

change guildMember to message.member

viral iris
#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{
    const bot = client
    if (args[0] === 'null') {
        return message.reply('I set your AFK to: \`AFK\`.')};
        
      if (message.author.bot) return;
      if (message.guild.id != "721292328475557928") return;
      if (message.member.roles.cache.has('746608450179563638')) {
        guildMember.roles.remove('746608450179563638');
        message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
      } else {
      if (!message.member.roles.cache.has('746608450179563638')) {
          guildMember.roles.add('746608450179563638');
          message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
      }}
  }
};
#

change guildMember to message.member
k

pale vessel
#

or define it unnecessary

viral iris
#

i'll try

sterile thicket
#

How do I count reactions on collector 'end'?

viral iris
#

guildMember is not defined

#

now i got error

#

lol

wanton anvil
#

Hello

fluid basin
#

Uncaught ReferenceError: guildMember is not defined
at module.run (module.js:12:8)
at main (bot.js)

sterile thicket
#

Uncaught ReferenceError: guildMember is not defined
at module.run (module.js:12:8)
at main (bot.js)
@fluid basin guildMember is not a thing unless you put it to define a guild member

fluid basin
#

Beep boop I'm a code compiler

sterile thicket
#

How do I count reactions on collector 'end'?

#

help me

#

!!!!

fluid basin
#

Collection#size

sterile thicket
#

on a specific emoji

viral iris
#

why bot giving the role ?

#

i did \@role to get the id

fluid basin
pale vessel
viral iris
#

oh

#

wait

#

how to make if they don't have it give it?

fluid basin
#

flaze you're confusing him

viral iris
#

line 9 ?

sleek apex
#

i need help ๐Ÿ˜ซ

#

@fluid basin ๐Ÿ‘†

fluid basin
pale vessel
#

hol up i don't see anything wrong with the code other than that

sterile thicket
#

flaze is confusing, so am I

pale vessel
#

@viral iris show your current code

sterile thicket
#

John Cena

viral iris
#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{
    const bot = client
    if (args[0] === 'null') {
        return message.reply('I set your AFK to: \`AFK\`.')};
        
      if (message.author.bot) return;
      if (message.guild.id != "721292328475557928") return;
      if (message.member.roles.cache.has('746608450179563638')) {
        message.member.roles.remove('746608450179563638');
        message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
      } else {
      if (message.member.roles.cache.has('746608450179563638')) {
          message.member.roles.add('746608450179563638');
          message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
      }}
  }
};
#

@viral iris show your current code
@pale vessel if the member don't have role not working

sleek apex
#

@viral iris you are developer

warm marsh
#

What is your problem?

pale vessel
sterile thicket
#

add if

viral iris
#

it was before

sterile thicket
#

@viral iris

warm marsh
#

no

sleek apex
#

@viral iris please i need help

warm marsh
#

...

pale vessel
#

or remove the whole if statement and just use else

viral iris
#

add !
@pale vessel u told me to remove that ๐Ÿ˜‚

pale vessel
#
if (message.member.roles.cache.has('746608450179563638')) {
    message.member.roles.remove('746608450179563638');
    message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`);
} else {
    message.member.roles.add('746608450179563638');
    message.reply(`**I set your AFK to: \`${args[0]}\`\**`);
}```
warm marsh
#

@sleek apex what is your problem instead of mentioning people

pale vessel
#

ah sorry, i confused you

#

i meant something else

sleek apex
#

@warm marsh I have a music code with a YouTube link that doesn't work I want someone to help me fix it

#

@viral iris I have a music code with a YouTube link that doesn't work I want someone to help me fix it

warm marsh
#

Did you copy and paste this code from somewhere?

sleek apex
#

@warm marsh dbd

sterile thicket
#

@sleek apex just post it here and someone will help you

warm marsh
#

?

viral iris
#
if (args[0] === 'null') {
        return message.reply('I set your AFK to: \`AFK\`.')};

why it's undefined ?

warm marsh
#

what is dbd?

sterile thicket
#

database dedication?

#

lol

warm marsh
#

lol

viral iris
#

stop mention me

sleek apex
#

@warm marsh djs sorry

sterile thicket
#

why it's undefined ?
you can use if (!args[0])

#

as it doesn't give you string @viral iris

warm marsh
#

You require a few things to make it play a youtube link.

sterile thicket
#

if (args[0] === 'null')
@viral iris null is not a string

fluid basin
sleek apex
#

I'm not a professional coder so I can add that to the code you can add if invite you to code

sterile thicket
#

I'm also not a professional

sleek apex
#

@warm marsh ๐Ÿ‘†

earnest phoenix
#

@random

sterile thicket
#

@sleek apex stop force pinging, and try youtube to find a solution

warm marsh
#

๐Ÿ˜

sleek apex
#

accept add

warm marsh
#

I'm not going to do it for you.

sleek apex
#

@sterile thicket I'm just learning JS I don't know if you can help me send me your code fix it for me

vale garden
#

try executing (your prefix)today19
@torn ravine im suuper late but wdym

#

like do you mean use the command in chat

#

or wat

sterile thicket
torn ravine
#

whatโ€™s your bots prefix

sterile thicket
#

I've been there, trust me

viral iris
#

you can use if (!args[0])
@sterile thicket i did still undefined

sterile thicket
#

post your current code, and explain me what you want to do with it?

viral iris
#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{
    const bot = client
    if (!args[0] === 'null') {
        return message.reply('I set your AFK to: \`AFK\`.')};
      if (message.author.bot) return;
      if (message.guild.id != "721292328475557928") return;
      if (message.member.roles.cache.has('746608450179563638')) {
        message.member.roles.remove('746608450179563638');
        message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
      } else {
          message.member.roles.add('746608450179563638');
          message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
      }
      }};
warm marsh
#

...

#

Remove the === "null"

#

args[0] will return a value or undefined

#

never null

#

unless it's "null" as a string

viral iris
#
if (!args[0]) {
        return message.reply('I set your AFK to: \`AFK\`.')};
#

like this ?

pale vessel
#

yes

sterile thicket
#

@viral iris I told you to remove string null

zealous vortex
#

@golden pewter

sterile thicket
#

Yes

torn ravine
#

if(!args[0])

#

dunno why it sent twice

viral iris
#

the bot can't change owner nickname ?

torn ravine
#

no

warm marsh
#

Nope.

torn ravine
#

needs highest permission in the server

warm marsh
#

Only <Member>s that are lower than current bot perm

viral iris
#

have.

torn ravine
#

It needs higher than owner

#

and thatโ€™s impossible

viral iris
#

yea

#

i hope it's gonna be possible soon ):

misty sigil
#

it will never be

sleek apex
#

No one here is helping anyone

viral iris
#
  if (!message.member.roles.cache.has('746608450179563638')) {
    if (!args[0]) {
        return message.reply('I set your AFK to: \`AFK\`.')
        message.member.roles.add('746608450179563638')}
      };
#

what's wrong?

fringe axle
#

async run(client, message, args) I have this. If client is the first thing, message is not defined but if message is first client is not defined... can someone help? (@ me if you know)

viral iris
#

line 4 got dark color in vsc

torn ravine
#

how is it setup in your main file @fringe axle

fringe axle
#

What you mean?

torn ravine
#

lemme see your code

fringe axle
#

The giveaway?

torn ravine
#

main file

#

actually the message event

viral iris
#

what's wrong?

#
  if (!message.member.roles.cache.has('746608450179563638')) {
    if (!args[0]) {
        return message.reply('I set your AFK to: \`AFK\`.')
        message.member.roles.add('746608450179563638')}
      };
fringe axle
torn ravine
#

check console @viral iris

misty sigil
#

return means it stops the code

#

so remove return before message.reply

fringe axle
#

I removed the client.login of course

viral iris
#

here's the quick fix

#

but why?

torn ravine
#

and itโ€™ll probably say something like โ€œillegal return statementโ€ because you have it in curly brackets ({})

misty sigil
#

because of the return

restive pebble
#

this code will never get triggered

misty sigil
#

dude

#

return means it stops the code

#

so remove return before message.reply

viral iris
#

fixed

#

thx

restive pebble
#

@fringe axle how are u running the code

fickle dune
#

i made a

#

website

fringe axle
#

The giveaway code?

fickle dune
fringe axle
#

Wrong channel for that.

fickle dune
#

ok

delicate shore
#

it's just sad to see

#

when people make bot with discord bot maker
And their bot comes on top of you in top.gg

twin osprey
#

please level up @fossil oxide

#

please level up @fossil oxide

#

please level up @fossil oxide

#

please level up @fossil oxide

#

please level up @fossil oxide

#

please level up @fossil oxide

slender thistle
#

Let's do this

#

there we go

fringe axle
#

xD

slender thistle
#

Hi Oliy, hope you will have a good day!

pale vessel
#

oliy, i hope you level up

flat pelican
#

Poor Oliy

tight plinth
#

ooof

crystal socket
#

poor oliy

thick gull
#

the mans just wanted a level up man pensiveflushed

viral iris
#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{
  const bot = client
  if (!message.member.roles.cache.has('746608450179563638')) {
    if (!args[0]) {
        message.reply('I set your AFK to: \`AFK\`.')
        message.member.roles.add('746608450179563638')}};
      if (message.author.bot) return;
      if (message.guild.id != "721292328475557928") return;
      if (message.member.roles.cache.has('746608450179563638')) {
        message.member.roles.remove('746608450179563638');
        message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
      } else {
          message.member.roles.add('746608450179563638');
          message.reply(`**I set your AFK to: \`${args[0]}\`\**.`)
      }
      }};
opal plank
#

could probably merge those if's btw

viral iris
#

now when it's
-afk
send line 8 and 17

opal plank
#

so, whats the issue here...?

viral iris
#

add if(args[0]) { ??

opal plank
#

i mean merging the if's you currently got

viral iris
#

so, whats the issue here...?
@opal plank i need it if args0 is nothing like -afk send line 7

#

and when it -afk anything send line 18

#

add if(args[0]) { ??
@viral iris ??

opal plank
#

no need for
if(a) return
if(b) return
if(c) return

do if(a || b || c) return

#

use operator OR

viral iris
#

it's 2

opal plank
#

well yeah, just recommending you to merge it

earnest phoenix
#

@opal plank if (a or b or c)
Did i do it right?

viral iris
#

i guess no need

opal plank
#

@earnest phoenix bonkcat

earnest phoenix
viral iris
#

so how to fix it ?

#

add if(args[0]) { at line 17 ?

opal plank
#

if args 0 is undefined its going to send undefined

#

you can add an inline if , if you want

viral iris
#
if (!args[0]) {
        message.reply('I set your AFK to: \`AFK\`.')
opal plank
#

the code looks fine, not sure whats the issue with it

viral iris
#

i did that

#

let me show u

#

1sec

opal plank
#

that works or you could use inline if

#

could also use this

viral iris
opal plank
#

thats precisely what i've been trying to tell you this whole time

viral iris
#

that works or you could use inline if
@opal plank please read the code, i have that line already

#

thats precisely what i've been trying to tell you this whole time
@opal plank what is it ๐Ÿ˜‚

opal plank
#

still sending undefined cuz you arent checking, also nice client mods

viral iris
#

i did it

#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{
  const bot = client
  if (!message.member.roles.cache.has('746608450179563638')) {
    if (!args[0]) {
        message.reply('I set your AFK to: \`AFK\`.')
viral iris
#

line 8

#

look

opal plank
#

that should work fine, but then again

viral iris
#

i was working

opal plank
#

you can always use && or || operators

#

rather than chaningin 30 if's

cosmic robin
#
ssh: connect to host vpsip port 22: Connection timed out```
im trying to connect to my vps, i connected a week ago so idk whats happening
twilit rapids
#

If you're sure the VPS is running, your IP is right and you have internet I would try it a few more times

#

Also not sure if you want your IP to be leaked here

cosmic robin
#

removed on line 1 didnt see thx

#

ill check if my vps is online

viral iris
#
const Discord = require("discord.js");
module.exports = {
  name: "afk",
run:(client, message, args, prefix) =>{    
    const bot = client
    if (!args[0]) {
        return message.reply('I set your AFK to: \`AFK\`.')};    
      if (message.author.bot) return;     
      if (message.guild.id != "721292328475557928") return;     
      if (message.member.roles.cache.has('746608450179563638')) {     
        message.member.roles.remove('746608450179563638');
        message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
      } else {
          message.member.roles.add('746608450179563638');    
          message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
      }
    }
  };
#

now if member have the role args0 not working

thick gull
#

itโ€™s returning because thereโ€™s no args

#

so I donโ€™t think it gets that far

#

I think

opal plank
#

ya'll should start using step debugging tbh

#

dont assume, follow the code as its executed

viral iris
#

what about this ?

thick gull
#

why are you requiring discord twice

viral iris
#

nvm

thick gull
#

kek

opal plank
#

you shoud likely learn js too while at it

#

if you arent familiar with if, i got bad news for you brother

viral iris
#

it's almost worked

golden condor
#

that code needs formatting

twilit rapids
#

Alright let's sum this up

  1. Please format your code correctly so it's easy to read:
const Discord = require("discord.js");
module.exports = {
    name: "afk",
    run: (client, message, args, prefix) => {
        const bot = client
        if (!args[0]) {
            return message.reply('I set your AFK to: \`AFK\`.')
        };
        if (message.author.bot) return;
        if (message.guild.id != "721292328475557928") return;
        if (message.member.roles.cache.has('746608450179563638')) {
            message.member.roles.remove('746608450179563638');
            message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
        } else {
            message.member.roles.add('746608450179563638');
            message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
        }
    }
};
  1. You're defining Discord but not using it
  2. != accept 1 as equals of true, null as equals of false and some others (because the values are automatically casted when being compared). For Exact comparisons I would recommend to use !==

I would recommend you to learn at least the basics of JS before you continue coding

floral creek
#

hi

#
  • invite
#

-invite

twilit rapids
#

@floral creek this channel is for chatting about or help with (bot) development, please stay on topic

earnest phoenix
#

hlw

floral creek
#

k but wheres the bot invite?

#

for discord lilst server

twilit rapids
earnest phoenix
#

this is the function:

module.exports = {
    secureTrans: function (secureNum) {
        switch(secureNum){
            case 0:
                return "NONE";
            case 1:
                return "LOW";
            case 2: 
                return "MEDIUM";
            case 4:
                return "HIGH";
            case 5: 
                return "VERRY HIGH"
        }
    }
};

This is the code

const {secureTrans} = require("../../lib/secureTrans");
return secureTrans(message.guild.verificationLevel) //it return UNDEFIENED

But it return underfiened

#

help meeee

#

Oh in v12 i dont have to transfer it

#

:000000

#

didnt know

eternal osprey
#

hey guys i have a questrion

#

i jues uploaded all my bot files to my vps

#

but how do i actually host them there 24/7?

#

i juse start them like, node .

#

and after that i just close putty?

cinder patio
#

yeah, that's one way to do it

#

you can also use a process manager like pm2

#

Using a process manager is better because if your program crashes / vpn restarts, it will be automatically started again

earnest phoenix
#

:0

#

why didn't anyone tell me that process managers exist

winter basalt
#

because no one knows you asked for it?

opal plank
#

hmmm this is an issue

#

any Ts users here?

earnest phoenix
opal plank
#

i need someone thats Ts user code

#

most people here are js

earnest phoenix
#

???

#

english.exe has crashed

opal plank
earnest phoenix
#

typescript is freaking awesome

#

is it an AI or what

opal plank
#

its js but typed

cinder patio
#

what exactly returns the array?

opal plank
#

number

#

its not an array btw

#

you cant declare 0 = something

#

so '0' = something

#

constants['0']

earnest phoenix
#

min_cooldown is so fucking long

opal plank
#

anyway

earnest phoenix
#

86,400 seconds

opal plank
#

read that carefully and you'll understand why its so long

eternal osprey
#

is this now hosted 24/7?

cinder patio
#

It should be

misty sigil
#

If the server is, yes

eternal osprey
#

so i can close my putty now?

manic ruin
#

Yโ€™all know how to make bots

eternal osprey
#

or should i save something

cinder patio
#

you can close it

misty sigil
#

putty doesnโ€™t matter

#

itโ€™s just a ssh client

manic ruin
#

Yโ€™all tryna make me one

eternal osprey
#

okay lovely guys

opal plank
misty sigil
#

@slender thistle needdev?

slender thistle
#

-needdev @manic ruin

gilded plankBOT
#

@manic ruin

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

unreal hemlock
#

I wrote the discord bot list api in the pom.xml there are no errors but I can't find them if I want to implement them

manic ruin
#

They made a website for freelance

ionic dawn
#

Why use PuTTy when you have Terminus

lofty musk
#

someone help me setup a V.P.S pls with Discord bot studio

forest whale
#

did someone have experience with java spring security

floral creek
#

I am trying to make like a banner for my bot by I dont know why but it makes the embed smaller

earnest phoenix
#

hih

floral creek
#

last onie uis with out the banner

sudden geyser
#

That's Discord rendering it to the client.

#

That's something you probably don't have control over.

floral creek
#

So wich one is better?

sudden geyser
#

Pick the one you like.

floral creek
#

with banner or with out

earnest phoenix
#

With banner

sudden geyser
#

For preference I'd go with the second one (without banner) but keep in mind the look is not going to be the same on everyone's screens. Take mobile users for example.

earnest phoenix
#

Yep

floral creek
#

gonna check it out

#

ok with out

eternal osprey
#

hey so 2 of my hosted bot are working

#

but only 1 isn't

#

why?

#

i have done pm2 list

#

and they were all working

#

but only the commands aren't of bot 3

#

could anyone help me out?

sudden geyser
#

So it's online but not responding

eternal osprey
#

yeah

earnest phoenix
#

you gave no info

#

about your botums

sudden geyser
#

Possibly check your command handler

misty sigil
#

PM2 doesnโ€™t log errors

earnest phoenix
#

show the code

misty sigil
#

try stopping it

floral creek
misty sigil
#

then running it using node <bot file>.js

eternal osprey
#

but inside the project folder

earnest phoenix
#

But I could add theme to embeds that are usualy small
@floral creek go with what you prefer

sudden geyser
#

Yeah the embed looks nice especially with the banner there but I'd only use it in a case where the user wants info about the bot (such as an about command) or some form of advertisement.

earnest phoenix
#

disable embeds for mobile users please

#

it is eezi to check if the user is on mobile

#

tipcc does that

#

and on $deposit it send the currency address in a normal messagr

opal plank
#

i thought you could only get mobile if mobile status was on

earnest phoenix
#

tf

unreal hemlock
#

I added DiscordBotList's API in my pom.xml, but I can't use it in my class. What should i do now?

opal plank
#

which doesnt always happen

#

specially when you not 'online'

earnest phoenix
#

I added DiscordBotList's API in my pom.xml, but I can't use it in my class. What should i do now?
@unreal hemlock give more info

#

show code

#

show errors

#

show yourself peeing

unreal hemlock
earnest phoenix
#

show code

eternal osprey
fervent river
#

show errors

#

show yourself peeing

eternal osprey
#

so 1 folder that contains all these folders

earnest phoenix
#

JUST SHOW WHAT YOU TYPED IN THE FREAKING FILE

eternal osprey
#

me?

earnest phoenix
#

this is how my porjectory looks like
@eternal osprey porjectory wtf

eternal osprey
#

projectory**

unreal hemlock
earnest phoenix
#

lmfao

#

huh

#

isn't it dbl

eternal osprey
#

bro my fucking project is not working

earnest phoenix
#

your project is fucking

eternal osprey
#

wanna see my index.js?

#

that i am running

earnest phoenix
#

show

#

the

#

code

delicate shore
earnest phoenix
#

huh

#

pretty terrible tbh

delicate shore
#

why is his clarity better

earnest phoenix
#

??

delicate shore
#

bruh i cannot type

placid iron
#

Maybe he is downloading the avatar at a higher resolution

sudden geyser
#

Red is not found
@unreal hemlock over over the red part, what does it say?

delicate shore
#

o

#

how can one choose

#

the resolution

placid iron
#

Js?

earnest phoenix
#

@unreal hemlock please show both the code and errors

placid iron
#

I only know how to in python unfortunately

earnest phoenix
#

PGamerX use the options object

#

I'll help

delicate shore
#

ok

earnest phoenix
#
let avatar = (smth).avatarURL({options});
#

options is an object

#

resolution can be selected in options

#

@delicate shore how did u made that

#

the jail command

#

by coding

earnest phoenix
#

wut

#

the heck

placid iron
earnest phoenix
#

canvas ?

eternal osprey
#

this is my code

#

of index.js

#

they how a online

#

but do not ruin

#

run*

earnest phoenix
#

@unreal hemlock please show the code where you defined DiscordBotListAPI

eternal osprey
#

the command

sudden geyser
#

Opticha did you download the DBL Java library?

earnest phoenix
#

u have only one file ?

eternal osprey
unreal hemlock
#

@unreal hemlock please show the code where you defined DiscordBotListAPI
@earnest phoenix This is a error

earnest phoenix
#

wait java

#

@eternal osprey wait any error ?

#

I'm out bye

#

i use javascript so...

unreal hemlock
#

wait java
@earnest phoenix Maven

eternal osprey
earnest phoenix
#

@earnest phoenix it is xml

#

the fuck is maven

#

@earnest phoenix it is xml
@earnest phoenix big brain

#

lol

#

xml is not a programming language

#

it is a file

eternal osprey
#

running this using vsc would work

earnest phoenix
#

format

#

it is used to transfer data to other languagrs

eternal osprey
#

but not using vps

earnest phoenix
#

idk

#

then stfu

unreal hemlock
#

What should I do

earnest phoenix
#

then stfu
@earnest phoenix u dont help him either : /

#

bruh

#

idk java i only know js

#

and json

#

and batch

eternal osprey
#

uhhm could anyobdy help me?

earnest phoenix
#

with wut

sudden geyser
#

@unreal hemlock I haven't used Java in a while so I may not be of big help, but did you make sure to also include the jitpack repository? Have you built it so you're sure it's been downloaded? I mainly use Gradle.

delicate shore
#

canvas ?
@earnest phoenix yes

earnest phoenix
#

:0

#

need more help marshmallow? @delicate shore

#

you're my marshmallow lol

unreal hemlock
earnest phoenix
#

Lol

delicate shore
#

need more help marshmallow? @delicate shore
@earnest phoenix no thank

earnest phoenix
#

hmm

#

you can't define a custom resolution

#

you can only choose from the provided ones

jovial nexus
#
TypeError: Cannot convert "null" to int
    at Object.toWireType (/home/holasoyender/KiroBot/node_modules/opusscript/build/opusscript_native_wasm.js:8:47113)```
#

does someone know why that?

earnest phoenix
#

soes someone

#

tf

placid iron
#

You care trying to convert a null variable to an int

dense vessel
#

is that even possible

sudden geyser
#

@unreal hemlock like I said, have you built it so you're sure the library has been downloaded?

@jovial nexus the error is quite self-explanatory, but it's coming from a dependency for some reason. Is there any more to the stacktrace?

#

can you explain the issue you're having

tight plinth
#

learn js

sudden geyser
#

You should be able to tell us the actual issue you're having. In this case, it's a syntax error because you don't close your braces/scopes near the bottom

golden condor
#

You have forgotten a few }s and )s

unreal hemlock
#

@unreal hemlock like I said, have you built it so you're sure the library has been downloaded?

@jovial nexus the error is quite self-explanatory, but it's coming from a dependency for some reason. Is there any more to the stacktrace?
@sudden geyser yes i have build a pom

jovial nexus
#

?ยฟ

half elm
#

after args[0] you completed the bracket

#

wait why do you even have the one at the end

#

its a switch statement

#

lmao sure

ionic dawn
#

"Problem"

half elm
#

๐Ÿ˜‚

ionic dawn
#

You leak your token btw

half elm
#

damn he did

ionic dawn
#

At the second img

half elm
#

bruh

dense vessel
#

regen the token

half elm
#

yeah

#

and use config.json

ionic dawn
half elm
#

next time

slender wagon
#

hi is it possible to make a bot run commands by voice?

delicate shore
#

how to do foreach

#

for number of u

#

users

#

total in all guilds

earnest phoenix
#

@slender wagon sadly not

#

I dont think so Thonk

pale vessel
#

i think bots can have voice_receive but i don't think it's documented and it might be against tos

#

so no

slender wagon
#

i think bots can have voice_receive but i don't think it's documented and it might be against tos
@pale vessel wait is it?

pale vessel
#

not sure

#

i mean mee6 can record vcs

delicate shore
#

How to get number of users

pale vessel
#

i guess not?

delicate shore
#

totall with my bot

#

did u ?

#
bot.guilds.forEach((guild) => {
    guild.fetchMembers().then(g => {
        let count = 0;
        g.members.forEach((member) => {
            count++;
        });
        console.log(count);
    });

});```
#

it gives an error

ionic dawn
#

They can track voice

delicate shore
ionic dawn
#

And they can register it so

#

Voice commands are a thing 1094_woozy_sunglasses

delicate shore
#

to get membercount

#

total

coral stirrup
delicate shore
#

did

coral stirrup
#

thats why you read the docs

delicate shore
#
aaeval bot.guilds.forEach((guild) => {
    guild.memberCount().then(g => {
        let count = 0;
        g.memberCount.forEach((guild) => {
            count++;
        });
        console.log(count);
    });

});```
violet haven
#

can u help me?

still merlin
#

ID is undefined

violet haven
#

yes ik

half elm
#

^

#

author, not id

violet haven
#

but what do i need to understand? is m undefined too?

#

isn't it the way to define m properly?

half elm
#

could you provide more code?
^

#

need more info

violet haven
#

ok

#

The first parameter for the filter of a reaction collector is the reaction โ€” which doesnโ€™t have an author property.
@earnest phoenix omg

#

i didn't know thx

half elm
#

oh nice

#

i didnt know that either lmao

violet haven
earnest phoenix
#

big box thrown at users is it still illegal/shady to put cryptocurrency mining scripts on the website.

violet haven
#
const filter = (reaction, user) => ..

@earnest phoenix yes but how do i do that?

#

i just want the author's reaction

still merlin
#

Does anyone know how you'd return a error message if there wasn't a number between 5 - 90 in args[1] (d.js) or there just generally wasnt a number in args1

half elm
#

Does anyone know how you'd return a error message if there wasn't a number between 5 - 90 in args[1] (d.js) or there just generally wasnt a number in args1
@still merlin just use an if statement to check if 5 < n < 90

violet haven
#

<reaction>.emoji.name
@earnest phoenix do u have an exemple ?

earnest phoenix
#

Donโ€™t do that.
@earnest phoenix that's the ONLY way i can monetize my stuff

still merlin
#

Thanks

violet haven
#

@earnest phoenix i want multiple reactions so it won't help right?

#

no just one

#

i want the author to choose with reactions

#

ok

#

i understood but now i have problems with emojis

#

emojis used returned undefined

pale vessel
violet haven
#

what's za problem

#

?

golden condor
#

Yes

violet haven
#

ok i'll try

cloud pebble
#

heya so i've got some code:

@bot.command()
async def test(ctx):
    def predicate(message):
        if message.channel.id != ctx.channel.id:
            return False
        return message.author.id == ctx.message.author.id
    
    try:
        msg = await bot.wait_for('message', check=predicate, timeout=30)
    except asyncio.TimeoutError:
        print('Timeout')
        return

It just waits for a message from the author but sometimes it doesn't register it. My bot is in ~700 servers so it's reading messages really quickly and sometimes misses it i've found, any suggestions to make it find the message every time?

violet haven
golden condor
#

smh

violet haven
slender thistle
#

@cloud pebble do you think py return message.author.id == ctx.message.author.id and message.channel.id == ctx.channel.id will be more appropriate?

cloud pebble
#

i've tried that but i've found it actually misses it more often like that

#

might just be placebo, worth giving it another shot i suppose

slender thistle
#

Huh

#

that's weird

placid iron
#

Yeah and only checks things after if the first one is false I think so it shouldn't make much of a difference

cloud pebble
#

yeah i tried adding print statements and found it just prints everything the bot can read, but since messages are coming in so fast it just doesn't read the ones it needs to

slender thistle
#

That generally shouldn't be a problem

#

A blind guess from me: try moving the predicate function out of the command

placid iron
#

Oooohhh this is why sharding exists

slender thistle
#

and instead create it in the file scope

cloud pebble
#

Hmm alright, will try that out

#

can i just pass ctx as an argument for the predicate function in the file scope too?

violet haven
slender thistle
#

Oh

#

God, right

#

Scrap my idea, a workaround will just be pointless hassle

cloud pebble
#

Ahah alright

#

hmm my other idea was getting the channel history and then filtering to get the last message that matches the predicate since using wait_for is missing it too often

#

but i feel like that'd be much more inefficient

unreal hemlock
#

Can you also send the guilds from the bot to DiscordBotList with url?

slender thistle
#

What's the specific feature you are trying to implement, @cloud pebble?

cloud pebble
#

Once the command is invoked, it reads the message sent after it and does something based on the message content

opal plank
#

thats...

#

a message collector...

violet haven
#

What youโ€™re doing now is checking for reactions on the message that triggered your event. What you want to do, is checking for reactions on the embed message youโ€™re sending โ€” by using const ... = await message.channel.send({ embed: embed }).
@earnest phoenix embed: embed?

opal plank
#

@cloud pebble which language do you code in?

cloud pebble
#

Python

#

I haven't heard of a message collector in the docs

opal plank
#

i was assuming it was d.js

#

py not my area

cloud pebble
#

d.js seems to be much better for this ๐Ÿ˜”

still merlin
#

Does anyone know how you give a footer a icon in d.js, The docs let me down.

opal plank
#

i might be switching to another lib soon

#

just set the payload

restive furnace
#

i might be switching to another lib soon
to what lib @opal plank

violet haven
still merlin
#

thankyou so much

placid iron
#

@cloud pebble I would say a easy way to fix this is to shard the bot. I belive that creates more instances and so they would share the load

violet haven
#

like that?

placid iron
#

But I'm not too sure

violet haven
#

ah yes sorry

#

dumb me

cloud pebble
#

Hmm that's something I've been thinking about, do you perhaps have a link or something where I could find out more @placid iron ?

placid iron
#

Not really just the documentation. I think there is a autoShardedBot class which does it for you but I'm not too sure how good that is because you may want to make more or less shards

cloud pebble
#

Hmm I see, thanks for the help, will take a look at it

placid iron
#

No problem, I hope you find a fix

violet haven
#

omg @earnest phoenix ur a god thx

#

now i'm trying to play music

unreal hemlock
#

Can you also send the guilds from the bot to DiscordBotList with url?

lusty spade
#

Hi, I'm trying to make a lyrics command but i ran into a problem. The lyrics is too long to fit in one embed so i substring it and now it sends 2 embeds but the problem is when the lyrics is substringed it splits the words in half so how can i solve this problem

#

like:
dan
ce

violet haven
#

@earnest phoenix how is defined the emoji name in the collection?

#

so to return results

#

"emoji" isn't ok now so

opal plank
#

emoji is an object, no?

#

oh, nvm i see

violet haven
#

far

#

a switch case

delicate shore
#

can i host a website

#

on a vps

#

how?

#

i am new to vps things

#

i started hosting my bot

#

but can i host my website

#

i tried

violet haven
#

code continue running before the collection ends

#

that's bad i guess

#

maybe "await" is good to use but i don't know how @earnest phoenix

delicate shore
#

can i host a website
on a vps

pale vessel
#

yes

#

why can't you lmao

delicate shore
#

but how

pale vessel
#

install a web server

#

like apache or nginx

#

or install node

paper phoenix
#

@violet haven - You cannot await an event emitter.

I'm assuming you're using Message.createReactionCollector? Look into Message.awaitReactions - it is the Promise form.

pale vessel
#

whatever you want as your backend

delicate shore
#

install a web server
@pale vessel next?

pale vessel
#

configure your web server

delicate shore
#

how ๐Ÿค”

paper phoenix
#

Use nginx to direct traffic from port 80/443 to whatever port your app is listening to. Or, direct it to a dir to serve a static site. @delicate shore

violet haven
#

so?

carmine summit
#

How can I make a variable that has a value, but its value changes everytime a loop completes?

opal plank
#

@carmine summit let/var something;

#

let should work if you declare it before the loop

#

otherwise use var

carmine summit
#

Am confused

opal plank
#

i answered both questions

#

let a;

#

var foo

carmine summit
#

Whats foo?

opal plank
#

there, i declared 2 variables without value

#

foo is a var

carmine summit
#

Nono

#

Ima change its value

#

To 212other value

#

Everytime a loop completes

#

So when 212loops complete, all values must be read

opal plank
#
let a = 0;
const array = ['a', 'b'];
for (let i of array) {
a++
}
log(a) //returns 2