#development

1 messages Β· Page 835 of 1

ember atlas
#

didnt work

#

nvm i got it ty

heavy marsh
#

No worries

earnest phoenix
#

does anyone know how not to have loads of arg checks?

sudden geyser
#

what do you mean? what language and library are you using?

obtuse jolt
#

Discord.js

#

Most likely

#

From seeing how he writes the code

earnest phoenix
#

ye

#

d.js

#

lol

#

I am lazy

copper cradle
#

@royal portal ```js
((activities_list.length - 1) + 1);

#

why are you doing that

#

what's the point of it

#

lmao

earnest phoenix
#

pogey mafs

copper cradle
#

bruh

stable nimbus
#

Question, in my new bot I have an issue I think? It is showing my "bundleDependancies": false, with yellow squiggles, should I be worried about such?

copper cradle
#

not really

#

it's just a warning

#

but however

#

hover over it and see what the warning says

stable nimbus
#

Says that it expected an array

#

incorrect type, expected array

copper cradle
#

then just add an empty array

#

to remove warnings

#

lul

stable nimbus
#

just to the end of it?

copper cradle
#

instead of false set it to []

stable nimbus
#

Fixed it, thank you.

copper cradle
#

lul

full summit
#

Can someone fix my eclipse/java issue? ill pay.
Should be easy for someone who knows wtf is going on

prime cliff
#

Maybe explain what is going on would you like to pay us for mind reading services too?

full summit
#

Yeah sure, i

earnest phoenix
#

explain your issue

full summit
#

I am using eclipse to run a virtual enviroment and launch an application that's already built, eclipse cannot find a path, or is running into constant issues

#

I literally need to just run this file in eclipse, i'm not familiar with eclipse and cannot configure it properly.

prime cliff
#

Have you checked the settings or are you setting the right path?

full summit
#

to my knowledge, yes, i've been wasting 90 minutes on this, and am on the verge of having a stroke, that's why if anyones familiar with these things i'll pay them to fix it.

prime cliff
#

What virtual environment are you trying to setup?

full summit
#

It's a osrs server

prime cliff
#

That main class is what java uses to first start the program

#

You have the main class inside another one

#

That's why it can't find it

full summit
#

want to get into a call and make 15$?

amber fractal
#

😩

prime cliff
#

Just move your main class outside the GameServer class

earnest phoenix
#

Its such an easy fix, people would do it for free

prime cliff
#

Yup

stone wadi
#

@gilded plank said they they were going wait for approval. How long will this take?

earnest phoenix
#

depends on how busy they are,

full summit
#

15 bucks to whoever dm's me, gets it working.

#

Share my screen, tell me what to do, get it running i'll pay you.

earnest phoenix
#

Again, its an easy fix

prime cliff
#

@full summit here

full summit
#

my friend is running a different system library, both of us are in eclipse his works

#

mine does not

stone wadi
#

@full summit i dmed u

prime cliff
#
 public static void main(String[] args) {
        GameServer.main(args);
}
public class GameServer {```
#

Just add that part above the GameServer class

full summit
#

main is using variables from the class though

prime cliff
#

Yes that will add the variables on startup too

full summit
#

Okay let me try, thank you.

#

Multiple markers at this line
- Syntax error on tokens, delete these tokens
- Syntax error on token "void", @ expected
- Syntax error on token "]", :: expected after

prime cliff
#

What does your code look like?

full summit
#

if you connect with me 1 on 1

#

and fix this

#

ill pay you for your time

earnest phoenix
#

wouldn't just renaming the class to "Main" do the job?

full summit
#

I added you.

prime cliff
#

Hop into testing 1 voice channel you can screenshare from there

#

And then select eclipse

finite bough
#

@prime cliff white names cant screen share

earnest phoenix
prime cliff
#

@finite bough the option for it was able to show though but it just auto closes on him with no error

#

So something weird is going on

stable nimbus
#

I need assistance with my code, all my bot does is return empty message error and I don't know what to do. Please help.

earnest phoenix
#

show us the code

stable nimbus
#

client.on('message', message => {
if(message.content.startsWith(${prefix}cuff)) {
let member = message.mentions.members.first();
var embed = new MessageEmbed()
.setTitle('Cuffed!')
.setColor(0xFF0000)
.setDescription('πŸ”’ ' + member.displayName + ' is now in handcuffs!')
message.channel.send(embed)
}
})

This is my handcuff command, but all it does is spam that it can't return an empty message.

#

Everything else works fine but the commands with that embed procedure.

prime cliff
#

@stable nimbus you need to add ; at the end of your event and functions

stable nimbus
#

Okay, where do I put it? Like at the end of everything?

prime cliff
#
client.on('message', message => {
    if(message.content.startsWith(${prefix}cuff)) {
        let member = message.mentions.members.first();
        var embed = new MessageEmbed()
        .setTitle('Cuffed!')
        .setColor(0xFF0000)
        .setDescription(':lock: ' + member.displayName + ' is now in handcuffs!');
        message.channel.send(embed);
    }
});```
stable nimbus
#

Ohhhh, okay. Thats why. Thank you very much.... Sorry about that by the way.

stable nimbus
#

It is still erroring out @prime cliff

prime cliff
#

What are you using to edit this? don't you get any build errors?

dusky marsh
#

What is your error exactly? And semicolons arent needed in js but is good practice.

stable nimbus
#

I use visual studio, its not giving me any errors.

#

client.on('message', message => {
if(message.content.startsWith(${prefix}cuff)) {
let member = message.mentions.members.first();
var embed = new MessageEmbed()
.setTitle('Cuffed!')
.setColor(0xFF0000)
.setDescription('πŸ”’ ' + member.displayName + ' is now in handcuffs!');
message.channel.send(embed);
}
});

prime cliff
#

visual studio especially should give you errors

stable nimbus
#

at Client.client.on.message (/app/index.js:120:25)
at Client.emit (events.js:194:15)
at MessageCreateAction.handle (/rbd/pnpm-volume/56deaec5-796f-42f3-a8e4-eafa671e1df8/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
(node:1815) 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(). (rejection id: 3)
(node:1815) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message

This is what it is telling me.

prime cliff
#

You are using djs v12 right?

stable nimbus
#

Yes, I don't like it....

prime cliff
#

Try message.channel.send('', embed);

#

The first argument is the actual text of a message and then you need to send the embed for the second one

stable nimbus
#

Okay. i'll see if that fixes it.

dusky marsh
#

You should be able to just send the embed as the first parameter. How are you importing MessageEmbed?

stable nimbus
#

const { MessageEmbed } = require('discord.js')

#

Is there any way at all to revert the discord.js to an earlier version so that way I can make this work?

dusky marsh
#

ye

#

npm i discord.js@11.6.2

stable nimbus
#

Thanks, I will just do that so that way I can do this and get it done the way I know how. I don't like this update but I will try to learn it.

prime cliff
stable nimbus
#

How will I uninstall the current version?

dusky marsh
#

tbh i dont see the problem still, that shouldnt be happening. but ye i dont blame you i havent moved to v12 either haha

prime cliff
#

@dusky marsh only works as first param or if you use embed: but yes it has to be the second parameter

stable nimbus
#

Will I just have to start over or is there an NPM uninstall that I can do?

dusky marsh
#

MessageEmbed just builds an embed object

#

you can just change the version in your package.json and npm i

#

that should change it

stable nimbus
#

Okay

#

Thanks.

#

@dusky marsh @prime cliff Thank you guys for the help, but I am just gonna stick to 11.6.2, I will eventually learn 12 but I don't think I am gonna like it, thank you.

dusky marsh
#

Np. im trying to see if they changed the code for building the embed object lol. i dont see why they wouldve changed it to be like that, having to have the embed class object as the second param

stable nimbus
#

It shouldn't be in the first place, like honestly the current one is very nice and it functions normally, so why try to fix something thats not broken?

dusky marsh
#

ye

#

According to the official tests in their github repo, you can use it how you had it

stable nimbus
#

It didn't wanna work so idfk....

stable nimbus
#

I got them to work and send, but my bot is hella slow. I don’t know what to do anymore.

dusky marsh
#

If your bot is going slow, that is most likely network or api related and not your code.

#

what are you doing that is slow

stable nimbus
#

When I do my /cuff, /ziptie command it takes a second, I have it hosted finally on glitch (not reliable but hey it works, especially when you don’t have a job).

#

My main bot I use in my RPServer has never had any issues.

dusky marsh
#

Could also be resource related, idk how glitch does their resource management, but maybe you got on a bad node or whatever. either way, glitch is definitely not the ideal solution.

stable nimbus
#

No, not really. But until I can shell out a few bucks a month it’s all I got....

#

I’ll try getting rid of other nodes that I have.

dusky marsh
#

Their are fairly cheap vps', i think some are pinned in this channel

#

like 3 dollars or less a month

earnest phoenix
#

I can tell from my experience that private hosting is good, like the cheapest high performance vps you can get is 92 cents

#

for 8gb space, 512mb ram and ddos protection

earnest phoenix
#

it was working before but now it's not working

earnest phoenix
#

i feel that

#

ffs

#

it's supposed to send a message before it opens a ticket telling you where the ticket is, but its not,

#

nor is it closing or sending the Close message.

earnest phoenix
#

atleast you tried formatting

#

it's ```

sweet spade
#

module.js:550 throw err; ^ Error: Cannot find module 'snekfetch' at Function.Module._resolveFilename (module.js:548:15) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (/rbd/pnpm-volume/8601f15e-c10c-40c8-9d5f-be2450b9a2bf/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/util/Util.js:1:81) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3)
welp ?

stiff sedge
#

cannot find module

sweet spade
#

yea I understand that -_-

#

but which one ???

#

.-.

stiff sedge
#

bruh

earnest phoenix
#
for role_id in data["pinged-roles"]:
            role = ctx.guild.get_role(role_id)

            pinged_msg_content += role.mention
            pinged_msg_content += " "

            if role.mentionable:```
stiff sedge
#

i suppose u just do: npm i snekfetch

earnest phoenix
#

this line "Was" working before but has now stopped when i added a new code and will not work now i have removed it,

stiff sedge
#

why is this happening, after updating djs i cant react with emojis from list anymore

#
        for (let n in emojis) {
            msg.react(n)
        }
#

DiscordAPIError: Unknown Emoji

tight plinth
#

@stiff sedge show the list

stiff sedge
tight plinth
#

Try with others

stiff sedge
#

but if i do msg.react(emoji[0])

#

it works

tight plinth
#

Well

earnest phoenix
#

YESSSS I GOT IT WORKINGGGGG

#

What was the reason?

#

a dumb one...

tight plinth
#

Do a for (const i=0; i<emojis.length;i++){msg.react(emojis[i])}

earnest phoenix
#

i deleted the following lines with the main command in @earnest phoenix

stiff sedge
#

@tight plinth it worked, thanks

tight plinth
#

pn

#

np

cinder patio
#

Yea that or for...of

#

for..in iterates over the keys of the array

#

so you get 0 and 1 instead of the emojis

earnest phoenix
#

soo, got a new vps, hoping that i could just change the subdomain to make my api work again.

stiff sedge
#

bruh they changed so much in djs

#

how am i supposed to get message by id now?

#

what

#

u wanna create arguments variable or

#

you need to split message into list

#

yes, split the message

#

or command

#
let args = msg.content.slice(prefix.length).trim().split(/ +/g);
pale vessel
wooden bear
finite bough
cunning glen
soft flare
#

who can give me a purge command for glitch?

#

cuz

#

idk

#

its free

#

glitch have discord.js

#

i know

#

yeah

#

but i dont know to host it

#

from glitch to heroku

#

my bot is fine on glitch

#

and its hosted 24/7

#

ye

cursive dagger
#

spoonfeeding isnt allowed dw

soft flare
#

@final creek

#

still muted lol

earnest phoenix
#
dbl.webhook.on("vote", async vote => {
  console.log("THE WEBHOOK RECEIVED SOMETHING!!!")
  let db = mongo.db("main");
  if(vote.type == "test") vote.user = "312559122144821248";
  manager.broadcastEval(`if(this.users.cache.get(${vote.user})){this.handleVote(${vote.user})}`);
});
#

Can someone tell me why it won't load the function?

#

the console didn't output anything

#

handleVote is a function and I put it in client.handleVote

#

ik that it's not loading because i put a console.log at the start of the handleVote function

#

this is not webhook related

#

its the manager part

#

manager is a ShardingManager btw

#

ok

#

im just gonna wait then

#

or try to figure it out myself

soft flare
#

@earnest phoenix can you give me the full code

#

returns outside of functions

modest maple
#

@soft flare no

#

We are not here to spoon feed you

soft flare
#

oh

#

great

modest maple
#

@earnest phoenix please do not spoonfeed

soft flare
#

ur such a weeb

modest maple
#

Ty

soft flare
#

wEeB

#

WeEb

#

WEEBY

earnest phoenix
#

nani

soft flare
#

pls snipe

#

great

modest maple
earnest phoenix
#

depends on your language you're coding it in

#

Java

#

equalsignorecasae

#

im not sure bout that

#

i code in Java

#

same here

modest maple
#

yes

#

there is a BIG diffrence

hoary elm
#

Lol yup huge

#

@earnest phoenix you also could use toLowerCase() afaik πŸ€·πŸ»β€β™‚οΈ

#

You want the command to be lowercase right?

#

Oh you want both

#

That one I'm not sure

#

. toLowerCase is case in-sensitive .toUpperCase is case sensitive

#

I'm not sure about both though πŸ€·πŸ»β€β™‚οΈ

#

That will be just ^Help

twilit rapids
#

The Message object is much more than just the string

hoary elm
#

This is true

twilit rapids
#

Example:

Message {
  channel: [TextChannel],
  deleted: false,
  id: '691948003065593896',
  type: 'DEFAULT',
  content: 'test',
  author: [User],
  pinned: false,
  tts: false,
  nonce: '691948002645901312',
  system: false,
  embeds: [],
  attachments: Collection [Map] {},
  createdTimestamp: 1585043659703,
  editedTimestamp: null,
  reactions: [ReactionManager],
  mentions: [MessageMentions],
  webhookID: null,
  application: null,
  activity: null,
  _edits: [],
  flags: [MessageFlags],
  reference: null
}
#

Did you copy that

#

From some guide

soft flare
#

fun fact i need kick command

#

with permission too

earnest phoenix
#

The first line in that message event scares me

twilit rapids
#

Yeah

#

Alright here we go

earnest phoenix
#

But that's literally going to emit on every message your bot recieves

#

In DBL this will be about 1000 messages/min

#

which would be 1000 presence updates

twilit rapids
#
  1. Don't change your bot's server size on message event
  2. message.content is the message string, calling .toLowerCase on there works
astral yoke
#

Someone who udnerstands this more properly help me please.

#
    at load (C:\Users\Cools\dog1bot\handlers\command.js:16:20)
    at C:\Users\Cools\dog1bot\handlers\command.js:30:27
    at Array.forEach (<anonymous>)
    at C:\Users\Cools\dog1bot\handlers\command.js:30:14
    at FSReqCallback.oncomplete (fs.js:152:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fyre@1.0.0 start: `node src/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fyre@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Cools\AppData\Roaming\npm-cache\_logs\2020-03-24T09_58_37_408Z-debug.log

C:\Users\Cools\dog1bot>```
modest maple
#

tias

twilit rapids
#
[Error]: TypeError: Cannot read property 'set' of undefined
  at load (C:\Users\Cools\dog1bot\handlers\command.js:16:20)
astral yoke
#

Yeah, but I'm adding new coding and it's making the previous code error.

#

Nevermind.

twilit rapids
#

Then go to that line and check

#

Or even show your code here so we can help

astral yoke
#

Changed my coding a little bit and fixed it.

#

I'm good.

twilit rapids
#

@astral yoke alright cool

#

@earnest phoenix what

modest maple
#

thats because its not a discord.js thing

#

a set is a datatype

#

loosely

soft flare
#

how i set a permision on a command?

twilit rapids
#

Check if the user running the command has X permission

#

d.js?

shadow shale
#

In what leanguage?

soft flare
#

ye

twilit rapids
#

Version?

soft flare
#

12.0.2

#

something like let has_kick = perms.has("KICK_MEMBERS");

twilit rapids
soft flare
#

thx

twilit rapids
shadow shale
#

Lol

modest maple
#

we litterally told you

#

to STOP spoonfeeding

soft flare
#

thx nobody isnt useful here

twilit rapids
#

You are allowed to help

#

But spoonfeeding isn't helping

modest maple
#

you are not helping by spoonfeeding

#

they learn nothing

shadow shale
#

Guys

soft flare
#

lier

modest maple
#

thats why they've come here expecting code 4 times today

soft flare
#

i learn

shadow shale
#

What is spoonfeding?

soft flare
#

how to close a command

#

lol

twilit rapids
#

@shadow shale giving them the code they're looking for instead of pointing them to the docs or telling them what to do

#

Sure they have the code

#

But they learn nothing

#

And come back again next time for the same issue

shadow shale
#

Oh ty for telling me

modest maple
twilit rapids
#

But the fact that you need spoonfeeding isn't good

modest maple
#

all they're gonna do is C+P

#

like what you did with your code

#

which is why you update presence every message event

#

which make no logical sense

shadow shale
#

We need debate channel bcs this is debating

#

Guys

#

Guys

#

Guys

#

Stop!

modest maple
#

spam stop ty

earnest phoenix
#

ok, can anyone help me with this, needing a code for Disabling and Reenabling a command on the Server if the Owner wishes they don't want it there,

modest maple
#

what lang

shadow shale
#

What leanguage?

#

@earnest phoenix

earnest phoenix
#

Python,

shadow shale
#

Do u use cogs?

modest maple
#

what is your current code?

#

it wont make us happy it'll just stop you getting banned by discord for API spam

earnest phoenix
#
async def on_member_join(member):
    await member.create_dm()
    em = discord.Embed(title="TICKET BOT", description=f"[Hello {member.name}, Please be understanding of the Rules, To join the The Official Support Server Please Click Here]()".format(), color=0x00a8ff)
    await member.send(embed=em)```
#

thats my current code,

modest maple
#

just have a db or if you already have on

#

make a system to store guild settings

shadow shale
#

@earnest phoenix if you using cogs simply reload them

modest maple
#

@shadow shale he ment to turn commands on and off for servers

#

e.g

#

if i have a nsfw command

shadow shale
#

Oh

modest maple
#

and im a owner who doesnt want it

#

i can turn it

#

off

earnest phoenix
#

^

shadow shale
#

Thats database needed

#

Misreaded

#

Sry

#

Just make a database

#

I suggest

modest maple
#

just store setting for guilds in a db like with custom prefixes

shadow shale
#

Sqllite

modest maple
#

if guildId has it enabled

#

do it

#

if not

#

dont

#

might aswell store prefix and other settings together

#

cuz why not

shadow shale
#

Yes

earnest phoenix
#

confusing af πŸ˜‚

shadow shale
#

Yes

heavy marsh
#
const _ = require('lodash');
    let totalSeconds = (bot.uptime / 1000);
    let days = Math.floor((totalSeconds % 31536000) / 86400);
    let hours = _.parseInt(totalSeconds / 3600) % 24;
    totalSeconds = process.uptime();
    let minutes = _.parseInt(totalSeconds / 60) % 60;
    let seconds = Math.floor(totalSeconds % 60);
   
      let uptime = `${days}d ${hours}h ${minutes}m ${seconds}s`;

Will this give the total bot uptime when when the bot is shraded?

#

Discord.js version 12.0.2

cunning glen
#

(node:25) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit fixed ?

#

help

modest maple
#

DONT HAVE A NEW EVENT FOR EVERY COMMAND

#

sorry caps

#

but yes

#

dont use a new event for each thing

shadow shale
heavy marsh
#

for me?

modest maple
#

thats basically what its saying @cunning glen

heavy marsh
#

???

#

@shadow shale My command works

cunning glen
#

@modest maple -_-

#

how fix?

shadow shale
#

We need more development channels

modest maple
heavy marsh
#

I want to know if it will the give the uptime even when its sharded

shadow shale
#

One is not enought

modest maple
#

just stores settings and allows each guild to turn stuff on and off

#

and the commands just have a simple check

#

if command disabled

#

dont do it

#

@cunning glen remove your many many event listeners

earnest phoenix
#

do you mind if i dm you ? @modest maple

modest maple
#

sure

#

might not respond quick cuz working

heavy marsh
#
const _ = require('lodash');
    let totalSeconds = (bot.uptime / 1000);
    let days = Math.floor((totalSeconds % 31536000) / 86400);
    let hours = _.parseInt(totalSeconds / 3600) % 24;
    totalSeconds = process.uptime();
    let minutes = _.parseInt(totalSeconds / 60) % 60;
    let seconds = Math.floor(totalSeconds % 60);
   
      let uptime = `${days}d ${hours}h ${minutes}m ${seconds}s`;

Will this give the total bot uptime even when the bot is shared?

earnest phoenix
#
dbl.webhook.on("vote", async vote => {
  console.log("THE WEBHOOK RECEIVED SOMETHING!!!")
  if(vote.type == "test") vote.user = "312559122144821248";
  manager.broadcastEval(`if(this.users.cache.get(${vote.user})){((require("./server.js")).handleVote)(${vote.user})}`);
});
``` Can someone tell me why doesn't this work? There's no error in the console and stuff and I know the handleVote() function is not running because i have a console.log on the function's first line
tight plinth
cunning glen
#

@modest maple well

earnest phoenix
#

but the problem is at the broadcastEval part @tight plinth

tight plinth
#

What doesn't work

earnest phoenix
#

the handleVote function

modest maple
#

@cunning glen both me and tonkku just told you

earnest phoenix
#

it wont load

modest maple
#

remove your extra listeners and just use one

tight plinth
#

Does it exists

earnest phoenix
#

yes

#

its on module.exports.handleVote

tight plinth
#

Show code if the function

earnest phoenix
#

oops

#
async function handleVote(user){
  const db = mongo.db("main");
  let stats = await db.collection("users").findOne({_id: user});
  let player = client.users.cache.get(user);
  console.log("hi");
  if(player && stats){
    let now = new Date();
    let cooldown = (24 * 60 * 60 * 1000);
    if(now - stats.lastVoted < cooldown) return;
    console.log("epic");
    let embed = new Discord.MessageEmbed()
    .setTitle(`Thanks for voting Beycord, ${player.username}!`)
    .setDescription("Beycord would not be here without people like you who vote for Beycord every day.\n\nYou received :valtz:250 and 800 EXPs as a voting reward!")
    .setAuthor(player.tag, player.displayAvatarURL())
    .setColor("#7f7fff")
    .setFooter("Make sure to turn on the voting reminder by doing ;reminder.")
    .setTimestamp();
    console.log("super");
    db.collection("users").updateOne({_id: user}, {$set: {coins: stats.coins + 250, xp: player.xp + 800, lastVoted: now}});
    player.send(embed);
    console.log("deja vu");
    if(stats.premium == true){
      db.collection("users").updateOne({_id: user}, {$set: {coins: stats.coins + 250, xp: player.xp + 800}});
      player.send("You received a doubled reward because you have a Premium membership. Yay!:tada:");
    }
    if(stats.reminder == true){
      setTimeout(() => {
        let remind = new Discord.MessageEmbed()
        .setTitle("24 hours had passed since your last vote which means... YOU CAN VOTE AGAIN NOW!")
        .setURL("https://top.gg/bot/570115430786531340/vote")
        .setColor("#7f7fff");
        player.send(remind);
      }, 86400000)
    }
  }
}

module.exports.handleVote = handleVote;
cunning glen
#

I could not @modest maple

modest maple
#

its not a choice thing

#

you have to remove the extra listeneres

#

otherwise you're gonna keep that issue

cunning glen
#

@modest maple :/ how do I not know about that topic ?

earnest phoenix
#

@heavy marsh maybe

heavy marsh
#

hmm ok

mortal stump
#

any ideas on how can I make a bot to send DM massages to all server members ? I'm new on this topic I want to try it out , I use descord.js

slender thistle
#

Don't

modest maple
#

no

#

dont

slender thistle
#

Just don't

tight plinth
#

@mortal stump doind this is an api abuse, bad idea

modest maple
#

that will get you banned for API abuse

slender thistle
#

It's useless and obnoxious and spammy

mortal stump
#

oh 😦

tight plinth
#

And if you add your bot here it'll get declined because of this

mortal stump
#

but any Ideas how to send notification my server has more than 1k members

slender thistle
#

An @everyone mention

#

That's all

tight plinth
#

^

slender thistle
#

Do your users a favor and let them read changelogs/announcements themselves

mortal stump
#

ok πŸ‘€

stiff sedge
#

how do i get message just before last msg

restive furnace
#

make custom cache?

stiff sedge
#

can you explain more pls

restive furnace
#

*custom message cache

#

like make a map of old messages

#

and then store message id, content and author.

stiff sedge
#

hmm ill try, tnx

zenith terrace
#

Cannot find module cherrio

regal saddle
#

what should we explain you? The error already tells you whats wrong

earnest phoenix
#

praise stacktraces

regal saddle
#

Because in mode_noduels it's in
Did you installed it global?

#

Did you select your Bot Folder path and installed it then?

#

Or did you just installed it?

earnest phoenix
#

angeryBOYE πŸ’’

slender thistle
#

That's Heroku though

regal saddle
#

That's Heroku though
is it?

slender thistle
#

Yes?

regal saddle
#

Oh i see

#

Biggest bruh moment

#

Yes
Is your β€žpluginβ€œ in the package.json?

slender thistle
earnest phoenix
regal saddle
#

Brother

#

....

pale vessel
#

do you have a package.json file?

#

add the dang module

regal saddle
#

then just add the plugin?

earnest phoenix
#

i'm glad that i'm using gradle

#

don't have to deal with this

regal saddle
#

brother

modest maple
#

calm down

pale vessel
#

package.json

#

not node_modules

#

heroku installs modules based on the package.json file

regal saddle
#

You dont even need to upload the node_modules file

pale vessel
#

....... ok

regal saddle
#

πŸ‘€

pale vessel
#

didn't someone sent a link for that

earnest phoenix
#

lukas and flazepe slowly losing their mind?

pale vessel
#

nah

regal saddle
#

yeah

slender thistle
pale vessel
#

already lost my god damn mind

slender thistle
#

Wait that's package.json

pale vessel
#

yeah

slender thistle
#

Why did I just think it was packages.json

regal saddle
#

Dont know

pale vessel
#

my brain is disintegrating

regal saddle
#

neehsi

pale vessel
#

read the link shivaco sent

regal saddle
#

click on the link and read whats in there

zenith terrace
#

Oof

soft flare
#

how can i add nsfw on my bot πŸ˜…

zenith terrace
#

<_<

pale vessel
#

did you understand a single thing from that article?

zenith terrace
#

d o c s

pale vessel
#

add the module then

slender thistle
#

Just add your needed module there and restart the dyno

soft flare
#

so you hosted your bot via heruko using github

slender thistle
#

Tone it down with the caps and bold font

modest maple
#

^^

pale vessel
#

32 bit?

soft flare
#

32 bit?

modest maple
#

tbf i run my bots on 32 bit

pale vessel
#

you don't need GitHub desktop

soft flare
#

so?

#

ye

modest maple
#

i use gitkraken

#

lol

pale vessel
#

use vps

earnest phoenix
#

^

modest maple
#

still gonna use 32 bit :P

regal saddle
#

why you guys dont use ICQ?

pale vessel
#

what's "i see queue"?

#

go back and do it all over again

#

that's what you get for using GitHub with heroku

regal saddle
#

what's "i see queue"?
thats what the mods always say weirdsip

modest maple
#

people should use github

#

because it teaches people version control

#

which is the gold standard if you want to work with others or just run a good system

earnest phoenix
#

then you probably have 2 instances running or so

celest viper
#

cause you run it with heroku and with your computer

earnest phoenix
#

angeryBOYE πŸ’’

pale vessel
#

because you are

#

not

celest viper
#

???

pale vessel
#

ad boooo

earnest phoenix
#

Can I get a user using client.users.cache.get() using a snowflake directly?

#

discord.js v12

quartz kindle
#

snowflake === id

#

they are the same thing, so yes

zenith terrace
#

my brain is disintegrating
@pale vessel hows your brain now

cunning glen
pale vessel
#

it's an ice cream now. pretty good tbf

restive furnace
quartz kindle
#

sendEmbed has been deprecated for a long time

restive furnace
#

just use send

#

cause v 11

#

now its 12

quartz kindle
#

deprecated doesnt mean removed

#

deprecated is a warning telling you it will be removed in the future

#

you ignored the warning, and now it was finally removed

restive furnace
#

yes, so use channel#Send, it works with embeds.

quartz kindle
#

.send(embed) or .send({embed:embedObject})

zenith terrace
#

ooooo

#

Yes

gritty frost
#

what is ksoftsi lyrics TypeError: Cannot read property 'length' of undefined

earnest phoenix
#

Cannot read property 'length' of undefined explains everything

gritty frost
#

uh

earnest phoenix
#

in what line does the error appear?

gritty frost
#

ksoft lyrics get

heavy marsh
#

I am lately getting this issue with mongooes ```js
[24/03/20 12:43:14] [ERROR] MongooseError [MongooseServerSelectionError]: connection timed out

Mongooes v - 5.9.6
Discord.js v - 12.0.2
#
const mongoose = require('mongoose');
bot.db = mongoose;

mongoose.connect('xxx', 
{ useNewUrlParser: true , useUnifiedTopology: true }, 
err => {
    if (err) return console.error(err);
    console.log(`Connected to MongoDB database on shard ${bot.shard.ids}!`);
});```
gritty frost
#
if (!data.data.length) throw new Error('No results');```
heavy marsh
#

is this for me πŸ‘€

gritty frost
#

no bro

heavy marsh
#

ahh ok

gritty frost
#

I don't know mongo

heavy marsh
#

...

earnest phoenix
#

geez i tried to switch hosts, instantly regretted that decision

#

never going that again

modest maple
#

its not that abd

#

bad*

earnest phoenix
#

no ad intended, but i use private-hosting normally, i tried to switch to geographically "my neighbours" in hops of saving a bit of money

#

i regretted that

#

bot doesnt respond at all

modest maple
#

oof

earnest phoenix
#

the funny thing is

#

the api ping is being checked through localhost GWjiangoOmegaLUL

modest maple
#

wut

earnest phoenix
#

i know

#

like thats the thing that really confuses me

modest maple
#

you sure its not DNS

#

if you're using localhost:port it can fuck DNS up and make latency insane

vestal star
#

How do you count all users?

#

Discord.js 12

heavy marsh
earnest phoenix
#

aaand my other vps is fucked too

#

welp

modest maple
#

do u use localhost:port for your directs or 127.0.0.1

earnest phoenix
#

localhost, its just a simple php request with localhost

vestal star
#

Could someone help πŸ™‚

modest maple
#

use 127.0.0.1:port and try it again

earnest phoenix
modest maple
#

it makes a big diffrence with latency

vestal star
#

How do you count all users on discord.js 12?

modest maple
#

if the DNS is doiing the weirds

#

get the size of cached users

vestal star
#

not corrent

earnest phoenix
#

i mean it's not just the status request, it's also the ssh session that dies

vestal star
#

it is accurate

#

it is not*

modest maple
#

then fetch

late hill
#

You likely won't be able to get an accurate result without having to waste resources

earnest phoenix
quartz hill
#

How can I tell if the emoji used in a message is a global emoji? The emojis of the global discord I mentioned here. (discordjs)
for example:
_emote sadasd
msg not global emote
and
_emote ❀️
msg this global emote

vestal star
#

ew firefox xd

pale vessel
#

it's good

vestal star
#

lol jk

#

how do I count all members accurately, not client.users.size

#

because, client.users.size slowly goes up, then resets when i restart the bot

late hill
#

You likely won't be able to get an accurate result without having to waste resources

vestal star
#

A for loop could work

late hill
#

Your current approach is just cached users

vestal star
#

and I need to only do it ever x seconds

summer torrent
#

@quartz hill regex

late hill
#

You could also add up member counts of each server but that will contain duplicates

#

therefor still not being accurate

vestal star
#

So what should I do?

summer torrent
late hill
#

The only real way would be to cache every user so you can make sure that there's no duplicates

#

which means wasting resources

#

Ask yourself if this number matters to begin with

quartz hill
#

ok thx

vestal star
#

Β―_(ツ)_/Β―

heavy marsh
late hill
#

It's a very meaningless statistic imo

#

Stop reposting the same question

earnest phoenix
#

we cannot answer your question, you shall wait for someone that can do so though.

finite bough
#

@modest maple which one do u prefer local host or that IP

modest maple
#

that ip

#

it negates the localhost dns

#

it mades a big diffrence to latency at times

#

e.g

#

the diffrence betweem 1200ms and 5ms

earnest phoenix
#

aight, i shall try it with the ip

finite bough
#

i just use

#

can be accessed form anywhere

#

lel

#

the remote db

late hill
#

Can you provide more information on what your connection string looks like @heavy marsh just censor/replace the sensitive information

heavy marsh
#
const mongoose = require('mongoose');
bot.db = mongoose;

mongoose.connect('mongodb+srv://xxx@cluster1-mmwsa.gcp.mongodb.net/test?retryWrites=true&w=majority', 
{ useNewUrlParser: true , useUnifiedTopology: true }, 
err => {
    if (err) return console.error(err);
    console.log(`Connected to MongoDB database on shard ${bot.shard.ids}!`);
});
#

I did sharde the bot yesterday. It gave me errors few hours ago

#

it was working fine

earnest phoenix
#

geez still a big delay, changing back

late hill
#

Note that if you specify useNewUrlParser: true, you must specify a port in your connection string, like mongodb://localhost:27017/dbname. The new url parser does not support connection strings that do not have a port, like mongodb://localhost/dbname.
quoted from https://mongoosejs.com/docs/connections.html, maybe this is causing the issue?

agile orchid
#

that should cause the issue

#

i had that once too

#

when i added the port it worked

#

so now i need help

#
client.on("ready", () => {
    console.log("online!");
    client.user.setActivity(`!!help | ${client.guilds.size} Servers`);
})```
#

For some reason it gives me an 'undefined' output

heavy marsh
#

client.guilds.cache.size

agile orchid
#

alright I'll try

finite bough
#

@heavy marsh make sure u are putting the proper username and password

agile orchid
#

Oh, now it worked, thank you

finite bough
#

and

heavy marsh
agile orchid
#

when u get your uri

#

there should be the port displayed

heavy marsh
#
mongoose.connect('mongodb+srv://xxx@cluster1-mmwsa.gcp.mongodb.net/Cluster1?retryWrites=true&w=majority',
#

So like this ?

agile orchid
#

as port

#

like this

heavy marsh
#
mongoose.connect('mongodb+srv://xxx@cluster1-mmwsa.gcp.mongodb.net:27017/Cluster1?retryWrites=true&w=majority',
agile orchid
#

yes

heavy marsh
#

like this?

#

Let me check if it works

wide wharf
#

How can I do that a bot send every day at 8am: "Goodmorning!" ?

agile orchid
#

setInterval function

wide wharf
#

ye

agile orchid
#

or check the day time

wide wharf
#

but how?

#

check the day time?

agile orchid
#

there's probably any package that makes it easier

wide wharf
#

lemme search...

heavy marsh
#

MongoParseError: Ports not accepted with 'mongodb+srv' URIs

#

got this now

agile orchid
#

well i think that's because no port is used in nodejs 3.0.0

#

or later

#

only below

finite bough
#

@agile orchid port is not required

wide wharf
#

Which one is better:

const Discord = require('discord.js');
const client = new Discord.Client();

client.login("token").then(() => {
    console.log("I am ready");
    var guild = client.guilds.get('guildid');
    if(guild && guild.channels.get('channelid')){
        guild.channels.get('channelid').send("Good Morning").then(() => client.destroy());
    } else {
        console.log("nope");
        //if the bot doesn't have guild with the id guildid
        // or if the guild doesn't have the channel with id channelid
    }
    client.destroy();
});

OR

const Discord = require('discord.js');
const client = new Discord.Client();

client.on('message', message => {
    //...
});

client.on('ready', () => {
    setTimeout(function(){ // in leftToEight() milliseconds run this:
        sendMessage(); // send the message once
        var dayMillseconds = 1000 * 60 * 60 * 24;
        setInterval(function(){ // repeat this every 24 hours
            sendMessage();
        }, dayMillseconds)
    }, leftToEight())
})

function leftToEight(){
    var d = new Date();
    return (-d + d.setHours(8,0,0,0));
}

function sendMessage(){
    var guild = client.guilds.get('guildid');
    if(guild && guild.channels.get('channelid')){
        guild.channels.get('channelid').send("Good Morning");
    }

}

client.login("token");
#

Which one is better?

quartz kindle
#

no

sudden geyser
#

the 2nd one

wide wharf
#

?

quartz kindle
#

the first one is wrong

agile orchid
#

you only have to do client.guilds.get('id').send('message');

sudden geyser
#

the .on("ready") event was created for that reason

wide wharf
#

On stack overflow, he says the first one

heavy marsh
#
MongooseError [MongooseServerSelectionError]: connection timed out
at new MongooseServerSelectionError (/home/container/node_modules/mongoose/lib/error/serverSelection.js:22:11)
at NativeConnection.Connection.openUri (/home/container/node_modules/mongoose/lib/connection.js:823:32)
at Mongoose.connect (/home/container/node_modules/mongoose/lib/index.js:333:15)
at Object.<anonymous> (/home/container/bot.js:54:10)```
#

same error

quartz kindle
#

login does not mean ready

#

they are two different things

agile orchid
#

Just use client.guilds.get('id').send('message');

#

It's much easier

wide wharf
#

you only have to do client.guilds.get('id').send('message');
@agile orchid Who, me?

agile orchid
#

ye

#

well i use an older version of d.js on my other bot

#

if it doesn't work then that's why

wide wharf
#

But then the bot doesn't will send the message at 8am?

quartz kindle
#

guilds dont have a send method lol

agile orchid
quartz kindle
#

you need to find a channel to send in

slender thistle
#

What if guild.send got the guild's system message channel and sent message there

quartz kindle
#

you already have guild.systemChannel.send lol

wide wharf
#

And how can I do that the bot will send the message in a channel: #chat and not in a channel: [id] ?

slender thistle
#

Simplicity!

wide wharf
#

A greeting bot

#

who says Goodmorning at 8am

agile orchid
#

client.guild.channels.find("name", "channel name")

#

i think

quartz kindle
#

that way of using find is deprecated

#

find takes a function

pale vessel
#

i'm pretty sure you need to pass a function instead

agile orchid
#

get would be much easier

sudden geyser
#

depends

quartz kindle
#

@wide wharf you need to use the ready event, not the login event. then you need to find a channel to send the message to

#

if you know the channel by id, use guild.channels.cache.get (if you're using v12) or guild.channels.get (if you're using v11)

#

if you dont know the channel id, and want to get it by name, use .find instead of .get, but with a function. ie: guild.channels.cache.find(channel => channel.name === "name")

#

you cant

heavy marsh
#

crashes = offline

quartz kindle
#

if you have a process manager or something to auto-restart it, you can make it dm you when it restarts

#

on the ready event, send a dm to yourself

pale vessel
#

yes

quartz kindle
#

yes, get your user by id

#

although catching errors and preventing crashes in the first place would be preferable lul

heavy marsh
#
MongoNetworkError: failed to connect to server [cluster1-shard-00-02-mmwsa.gcp.mongodb.net:27017] on first connect [MongoNetworkError: connection timed out
pale vessel
#

client#users

#

refer docs

earnest phoenix
#

there you go!

modest maple
#

look it up

#

its not hard

earnest phoenix
#

geez you're damn lazy

modest maple
#

stop being lazy and asking us todo it for you

earnest phoenix
#

god damn it.

modest maple
#

s m h

earnest phoenix
#

Or wasn't that the right one?

#

?..

pale vessel
#

it was

earnest phoenix
#

oh good

pale vessel
#

you said you wanted to send the error to you

#

not the user

eternal ermine
#

I'm sorry. It's my fault for managing the My bot. My bot(YBOT) was hacked just now, causing damage to test 1 room of testing. I am truly sorry. I'll do my best to make sure it doesn't happen in the future. <@&304313580025544704>

modern sable
#

-atmods

gilded plankBOT
#

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
pale vessel
#

don't ping mods smh

zenith terrace
#

Oof

earnest phoenix
#

Still wondering, how do you even manage to get hacked, just use your token as an argument for the program instead of implementing it straight in the code

#

@modest maple i think it was really just cloudflare being stupid, works perfectly now.

#

Hey there

hollow schooner
#

is in the Discord JDA an catchall event ? or something

earnest phoenix
#

how i get ID of mentioned channel? python

pale vessel
#

docs should be able to help you

earnest phoenix
#

ok

modest maple
#

@earnest phoenix the bot sees the mention as [#123423455646](/guild/264445053596991498/channel/123423455646/)

earnest phoenix
#

i kwno ||sorry my bad english xd||

pale vessel
#

haha

modest maple
#

split message content

#

depending on where youre expecting the mention

earnest phoenix
modest maple
#

then just use replace to strip the <#

#

split message at " "

#

replace "<#" and ">"

#

leaves you with id

earnest phoenix
#
@client.command()
async def getid(ctx, channel: discord.TextChannel):
    await ctx.send(f'ID: {channel.id}')
#

this work?

#

try it out

#

work

mossy vine
earnest phoenix
#

That was the link i was searching furiously GWomoDrakeYea

zenith terrace
#

Lol

crimson vapor
#

it has been here multiple times

ivory parcel
#

fortnite master bot is offline how to change that

earnest phoenix
#

DM the Bot owner, uno momento

crimson vapor
#

wrong server

earnest phoenix
#

or server

ivory parcel
#

OK, thanks

earnest phoenix
#

oop nevermind

#

just me being retarded lmao

hoary mortar
#

Hi, how can I get some support as the bot not working in our server?

uneven wyvern
crimson vapor
#

you guys do understand this is the wrong server

celest viper
#

wut

uneven wyvern
#

damn

earnest phoenix
#

hey

#
  File "bot.py", line 18
    return logs[str(message.guild.id)_(channel.id)]```
#

error in _

#
    return logs[str(message.guild.id)_(channel.id)]
                                     ^
SyntaxError: invalid syntax```
crimson vapor
#

@uneven wyvern I dont think .generateID() is a function

#

what language @earnest phoenix

earnest phoenix
#

python

crimson vapor
#

ok

modest maple
#

@earnest phoenix that is not how that works

earnest phoenix
#

@earnest phoenix that is not how that works
@modest maple how?

modest maple
#

because you cant just add a _ between two variables and have it go yay

earnest phoenix
#
    with open('logs.json'. 'r') as f:
                             ^
SyntaxError: invalid syntax```
#
@client.command()
async def setlogs(ctx, channel: discord.TextChannel):
    with open('logs.json'. 'r') as f:
        logs = json.load(f)
    logs[str(ctx.guild.id)(channel.id)] = channel.id
    with open('logs.json', 'w') as f:
        json.dump(logs, f, indent=4)```
crimson vapor
#

python seems so strange

earnest phoenix
#

oh

#

i put a .

#

That's why i never bothered using it, nor did with js

crimson vapor
#

so you dont use js or py

earnest phoenix
#
Ignoring exception in command setlogs:
Traceback (most recent call last):
  File "/app/.data/d3c27b63733278df68d1fa9f5eeb8d41-site-packages/discord/ext/commands/core.py", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot.py", line 222, in setlogs
    logs[str(ctx.guild.id)(channel.id)] = channel.id
TypeError: 'str' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/.data/d3c27b63733278df68d1fa9f5eeb8d41-site-packages/discord/ext/commands/bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "/app/.data/d3c27b63733278df68d1fa9f5eeb8d41-site-packages/discord/ext/commands/core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/app/.data/d3c27b63733278df68d1fa9f5eeb8d41-site-packages/discord/ext/commands/core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'str' object is not callable```
#

when i use p!setlogs <#mention>

modest maple
#

you have

#

how much python do you know

#

because this is

#

Basic basic python

earnest phoenix
#

:u

crimson vapor
#

Might want to learn more about python

slender thistle
modest maple
#

@slender thistle cough read cough cough write

slender thistle
#

But

#

Why

modest maple
#

why even use json files πŸ€·β€β™€οΈ

slender thistle
#

yes

wheat jolt
#

help

#

this error throws only when another user than the author is sending a message

#

d.js@v11.6.3

late hill
#

As the error shows m isn't defined

#

Can't help much because you don't show what m is

earnest phoenix
#

@earnest phoenix U want to send all or only a word? @earnest phoenix

sudden geyser
#

it's an array of strings split by a space

#

if you access [1], you're only going to get one of the strings

earnest phoenix
#

Yeah

#

Start with

#

0

sudden geyser
#

[0] would be the command name

earnest phoenix
#

No

#

@sudden geyser with the 0 i don't have the command name

#

I have the first arg...

#

(Ty the slice)

sudden geyser
#

you're only slicing the prefix from the string, not the actual command name. Try logging args and you'll see the command name as the 0 element.

#

Do you want to send the entire "hey there" string.

earnest phoenix
#

let args = message.content.split(' ').slice(1);
(Ty the slice)x2

sudden geyser
#

if you want to send the entire string, just use the .join() method. Look up the method online

earnest phoenix
#

Yeah

#

args.join("");

#

args[1] => args.join("");

#

Yeah

finite bough
#

@earnest phoenix [0] is command name

#

prefix.length means number of characters in the prefix

earnest phoenix
#

Ty

#

@earnest phoenix args.join("");

#

:/

finite bough
#

.join(" ")

#

space

#

mhm

earnest phoenix
#

Yes

#

Sorry :)

wheat jolt
#

As the error shows m isn't defined
@late hill the await m.delete() is on line 40

finite bough
#

what does m stand for

#

i mean what does it defines

wheat jolt
#

message

#

a message

finite bough
#

there is nothing that defines m as message in the screen shot

wheat jolt
#

I don't have a problem with m....

#

I have a problem with awaitMessages

finite bough
#

the error says u have a problem with m

wheat jolt
#

with r.first().delete()

#

no

#

await m.delete() is on line 40

#

and the error is on line 41

finite bough
#

didnt see the full error so oki

weary wolf
#

can someone help me and do a bot for me?

wheat jolt
#

it's the full error

finite bough
#

still can u show me where did u define m

#

@weary wolf no make ur own

wheat jolt
#

why do you need m if I have problems with r

weary wolf
#

@finite bough calm the fuck down jesus no need to be rude

earnest phoenix
#

let text = args.join(" ").slice(1); ?

finite bough
#

@earnest phoenix use args[2] to remove say

wheat jolt
finite bough
#

@weary wolf 1st of all read the channel topic, 2nd i am not being rude talking offtopic can lead to mute

earnest phoenix
#

If u want u can just use this:

let args = message.content.split(' ').slice(1);
args.join(" ");

#

:/

wheat jolt
#

@earnest phoenix use args[2] to remove say
args[0]

finite bough
#

Dany

#

no spoon feeding

weary wolf
#

@finite bough 1st it wasnt off topic 2nd u were rude 3rd idc about the mute 4th im a beginner 5th why u keep pinging? ffs

earnest phoenix
#

Okay okay

finite bough
#

beginner is something else

wheat jolt
#

Leave him alone Shiemi

earnest phoenix
#

Have a good say

#

day*

finite bough
#

alex is that the full error?

topaz fjord
#

He's not being rude

earnest phoenix
#

(Sorry)

topaz fjord
#

Rules say no spoon-feeding

#

No one's gonna do it for you

finite bough
#

@earnest phoenix args[number]

topaz fjord
#

we're here to help

finite bough
#

number of words u want it to skip

wheat jolt
#

Yes Shiemi

#

let me explain to you

#

i write the command

finite bough
#

if u do let text = args[1] yes

wheat jolt
#

then bot starts awaiting for a response

finite bough
#

.join(' ') is used to send all the words after the single word

wheat jolt
#

if someone other than the message author sends a message, bot doesn't ignore the message

#

even if I put a filter

#

and it throws that error

weary wolf
#

@topaz fjord ok buddy there's also something called paying someone but yeah.. never heard of that did you?

topaz fjord
#

You never offered in the message

wheat jolt
#

this is a development channel, not a searching for developers one

finite bough
topaz fjord
#

If you want someone to do a bot for you, you contact the owner to get it posted in #434058442764714002

finite bough
#

then add .join(' ')

wheat jolt
#

help pls

finite bough
#

holdon

#

@wheat jolt give me a sec

#

getting water

wheat jolt
#

k

finite bough
#

btw

#

try making it ===

wheat jolt
#

same shit

#

it doesn't matter if it's == or ===

finite bough
#

they have some differences

#

and its a good practice to use ===

#

can u show ur text code?

wheat jolt
#

it's args[0]

#

not args[1]

pale vessel
#

not args?

wheat jolt
#

maybe he doesn't have 2 arguments

#

you know

#

console.log(args)

#

give the output

finite bough
#

no difference in 12v

sudden geyser
#

you can't call .join on a string. pls learn js

finite bough
#
if(!text){
   return message.channel......
}
wheat jolt
#

ah facepalm

#

args.join(' ')

#

instead of args[0].join(' ')

#

of args[1].join(' ')

untold escarp
#

wwrewewasdasd

wheat jolt
#

stop pls

#
var text = args.join(' ')```
pale vessel
#

console log args

wheat jolt
#

args.slice(1).join(' ')

pale vessel
#

no

wheat jolt
#

yes

pale vessel
#

you slice after joining

wheat jolt
#

yes

#

if the command is args[0]

#

you have to slice it?

#

do a console.log(args)

#

and give the output then

#

console log args

#

and give the output

#

help ples

quartz kindle
#

if args is an array, like this [1,2,3,4,5] then args[0] will give you the first element 1, args[1] the seconds element 2 and so on. args.join() will join the array by whatever you define, lets say args.join("") gives you 12345 (join with nothing), or args.join(" ") to join with a space giving you 1 2 3 4 5. then there is the slice function which removes an item from the array, for example args.slice(1) will remove the first item, making it [2,3,4,5]. so to obtain a string from the array, minus the first element, you simply do array.slice(1).join(whatever)
@earnest phoenix

wheat jolt
#

i told you

#

var text = args.slice(1).join(' ')

#

.-.

#

np

#

?

#

actually yes

#

I spoon fed you

#

:)

#

tho

pale vessel
#

because there's no collected message to delete

zenith terrace
#

@quartz kindle You killed my brain there

quartz kindle
#

@wheat jolt does awaitMessages stop waiting if another user answers?

wheat jolt
#

yes

#

It should ignore the messages sent by other users than the command message author

#

because there's no collected message to delete
@pale vessel this info was clear to me since I got the error first time

quartz kindle
#

can you console.log both author ids?

#

try doing js let filter = message => { console.log(message.author.id,msg.author.id); return message.author.id === msg.author.id }

wheat jolt
#

sure, hold on

#
359812392504524811 399868039484538884
#

the ids are different

#

another user sent the message

quartz kindle
#

and the filter still passed?

wheat jolt
#

yes

#

but there's no message in the r collection

quartz kindle
#

your version is v11.4 right?

pale vessel
#

11.6.3

wheat jolt
quartz kindle
#

well, this explains the problem

wheat jolt
#

should i downgrade to v11.4?

quartz kindle
wheat jolt
#

hm?

#

i still don't understand

#

I ran out of ideeas

quartz kindle
wheat jolt
#

aah

quartz kindle
wheat jolt
#

maxMatches

#

thanks a lot

wide wharf
#

if you dont know the channel id, and want to get it by name, use .find instead of .get, but with a function.
ie: guild.channels.cache.find(channel => channel.name === "name")
@quartz kindle so it would be for me: guild.channels.cache.find(channel => channel.name === "chat")