#development

1 messages · Page 475 of 1

carmine veldt
#

found a 35 hr tutorial is that even nealy enough?

neon swift
#

tutorial on what?
There are some good programming tutorials on YouTube, but not really any discord bot making ones

#

you need to find some written ones for these

carmine veldt
#

yeah i found a website that teaches you how to use and understand code and java

neon swift
#

Java is not Javascript

#

two completely different things

carmine veldt
#

*javascript

#

sorry

west raptor
#

i recommend codecademy (that's where i started)

carmine veldt
#

thats what im using haha

west raptor
#

oh ok lol

ruby dust
#

python is best for building simple AI programs

neon swift
#

discord.py isn't bad also, but if you are learning a language just for making discord bots, then learn javascript

ruby dust
#

and discord.py actually has a lot of examples where beginners can learn from

carmine veldt
#

ah ok

earnest phoenix
#

can anyone help me fix this error while install discord.py

#
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/pip/__main__.py", line 19, in <module>
    sys.exit(pip.main())
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting```
night bridge
#

How to purge tagged message only?

sullen path
#

you're going to need to explain

night bridge
#

Here's the code sorry for trouble

module.exports.purge = async(msg,args)=>{
    msg.delete();
    const fetched = await msg.channel.fetchMessages({limit: args[0]});
    msg.channel.bulkDelete(fetched).catch(e => msg.channel.send(`Error : ${e}`));
}
#

it purge all message lol

grizzled isle
#
message.channel.fetchMessages({limit: 100}).then(msgs=> msgs.filter(m => m.mentions.channels.size >= 1 || m.mentions.roles.size >= 1 || message.mentions.members.size >= 1 ))```
sullen path
#

spoonfeed 👀

night bridge
#

@grizzled isle let me guess,
delete 100 messages
filter by user tagged? can more than one user
or filter by roles tagged

grizzled isle
#

Step 1: Get messages
Step 2: Filter Messages
Step 3: bulk delete messages

night bridge
#

i understand the step but i dont understand how to filter them 0-0?

grizzled isle
#

lowkey just did

night bridge
#

i cant do it

knotty steeple
night bridge
#

i'm worse one

high tinsel
#

Anyone else having issues with keeping their bot online today, it's probably some strange bug that only happens to those who have their bots hosted on glitch.com...

bitter sundial
#

i wonder if glitch fixed the uptime hack

ruby dust
#

Just saw an ad flashing

foggy oak
#

can anyone good at javascript? plz dm me

west raptor
#

@high tinsel Mines fine

night bridge
#

hello everyone i trying to send image from embed but it failed please tell me the reason
the reason that i found is it cant use local image, if the reason is this then i wont try embed anymore.
here 's the code.

module.exports.tarot = async (msg,args)=>{
    let tarot = Math.floor(Math.random() * 3);
    let embed = new Discord.RichEmbed()
        .setTitle(`Mayor Arcana`)
        .setDescription(`Description:`)
        .setColor(`#00AAFF`)
        .setImage(`./data/tarot/${tarot}.png`);
    msg.channel.send({embed}); // Embeded not work
    msg.channel.send(``,{files: [`./data/tarot/${tarot}.png`]});  // normal message work
}```
earnest phoenix
#

@night bridge Try loading it to an image hosting site.

night bridge
#

it works

earnest phoenix
#

reason1 === reason1.length <1 ? reason1: "No reason was provided"
can't get this to work

#

always says "No reason was provided"

night bridge
#

do your reason have data?

earnest phoenix
#

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

#

on reason1

#

it works if i remove the === and nothing like reason1 only

#

but this way it always returns "no reason was provided"

knotty steeple
#

how do you make a message collector in discord.js

latent heron
#

i coded my discord bot in Malbolge

lusty dew
#

I am making a create channel command and I only want the person that used the command, the staff of that server, and the owner to see the channel, but I don't know how to do that part

#

Can someone please help ;p

topaz fjord
earnest phoenix
#

how do i let the bot change the embed color from white to black every time?

knotty steeple
#

what

earnest phoenix
#

i wanna make an embed !help

west raptor
#

Randomize it

earnest phoenix
#

one time it is white

#

and the other time black

#

how do i randomize

ruby dust
#

what language?

earnest phoenix
#

discord.js

knotty steeple
#

is it supposed to do it only once

ruby dust
#

is there a module in js that can choose from a random sequence

earnest phoenix
#

idk

#

i use discord bot maker the most but i am gonna learn discord.js

lusty dew
#

You can do

#

.setColor("RANDOM")

#

It will randomize it everytime

earnest phoenix
#

yes but i wanna have it what and black

lusty dew
#

Oh

#

Ah I see

earnest phoenix
#

not purple pink blue green red cyan

knotty steeple
#

uh

earnest phoenix
#

? discord.js is new for me

lusty dew
#

I thought you meant like that lmfao

#

oof I don't think setTimeout will work will it?

#

Cause it will have to be every time the command is used

#

or am I just dumb ;p

earnest phoenix
#

can someone just give me the code

#

pls

ruby dust
#

no

earnest phoenix
#

i rlly need it

lusty dew
#

no

earnest phoenix
#

ow okay

#

them im gonna look on google

knotty steeple
#

no one is spoonfeeding you

#

code the thing yourself GWqlabsFacepalm

lusty dew
#

Google is good place to look

static matrix
ruby dust
#

if you want to be given code so easily then you shouldn't call yourself a bot developer sigh

lusty dew
#

?

earnest phoenix
lusty dew
#

They spoon feed

knotty steeple
#

no

earnest phoenix
#

i made the @steep hatch

#

with dbm

lusty dew
#

I am joking

#

XD

knotty steeple
#

why are you telling him that GWfroggyFacepalm

lusty dew
#

I was joking

#

and they don't anymore

knotty steeple
#

they do

lusty dew
#

They used to bad

#

Oh?

knotty steeple
#

the website

#

is filled

#

with code

#

for people to take

lusty dew
#

Last time I was in it, they was telling people to check google

#

that is plexidev

ruby dust
#

"made" is a hard word to use when you used an easy-to-use software to make that bot while actual bot developers "write" their codes manually

lusty dew
#

Oh wait

#

Plexidev has a website

#

were people can just deposit their code on it

earnest phoenix
#

?

#

lusty dew
#

I think it's kinda dumb to be honest, no one will learn to actually write code

knotty steeple
#

learn to code

night bridge
#

where i can put my image that discord can call?

knotty steeple
#

dont use dbm

earnest phoenix
#

ik

#

im learning discord.js

#

but

lusty dew
#

What is dbm?

#

o.O

earnest phoenix
#

Discord Bot Maker

knotty steeple
#

discord bot maker

lusty dew
#

Oh ah

earnest phoenix
#

a program with code BLOCKS

knotty steeple
#

its for people that cant code

lusty dew
#

Yes My friend got that

knotty steeple
#

and want to waste their money

lusty dew
#

She made a bot in lua or something

knotty steeple
#

inb4 he cracked it

ruby dust
#

it's something you pay $10 to make a completely useless shitty bot

lusty dew
#

Lmfao

#

My friend got it for free somehow

earnest phoenix
#

but i think it is not possible to make the help one time white and the other time black

lusty dew
#

I know how but I prefer not to say

earnest phoenix
#

lol i know how

#

i can get ark for free

knotty steeple
#

well why did you ask

#

if you know how

rotund nebula
#

okjzfdnhvolkhzjdbfkjvhbzfdvhbzfdjhvbkfzjhvbofzijkbv frhzrdshrhzrh

lusty dew
#

Sure you did bud

#

Anyway

knotty steeple
#

cracked it

lusty dew
#

What are we even doing?

earnest phoenix
#

couse i am bad in discord.js and you guys are pro you guys made bots with it

rotund nebula
#

okjzfdnhvolkhzjdbfkjvhbzfdvhbzfdjhvbkfzjhvbofzijkbv dhnrdhzrh

knotty steeple
#

@inner jewel

lusty dew
#

Im not pro what the fk you mean

#

xD

ruby dust
#

it is completely impossible to make something easy-to-use that doesn't have any limitations, so you should do it manually by knowing a programming language

rotund nebula
#

plug

earnest phoenix
#

how do i get the github

ruby dust
#

what

knotty steeple
#

what

ruby dust
#

that's how you "get" it

#

xd

knotty steeple
#

no

#

thats how you git it

earnest phoenix
#

how do i come there

ruby dust
#

you open the site?

lusty dew
#

Umm

knotty steeple
#

ur making no sense

lusty dew
#

🤦

ruby dust
#

tf are these questions

knotty steeple
#

idk

lusty dew
#

When you speak nearly perfect english

earnest phoenix
#

people like this

lusty dew
#

then you sound like you don't know it

earnest phoenix
#

their problem is not

#

programming

#

their problem is

#

like

#

how do they funciton

#

in day to day life

lusty dew
#

why

#

are

#

yout talking

#

like this

earnest phoenix
#

so people listen

#

worked awesmart

lusty dew
#

Well

#

No one can really listen to words you type sense they have no sound

earnest phoenix
#

nice, and I wasnt talking mmLol

lusty dew
#

I am making a create channel command and I only want the person that used the command, the staff of that server, and the owner to see the channel, but I don't know how to do that part.
Can someone please help ;p

steel drum
#

well first

#

how would you even define "staff"

quartz kindle
#

owners and admins will be able to see it by default, as for staff you could check if their roles have manage server or manage channel permissions

steel drum
#

ive been in servers

#

where the staff couldnt create channels

#

you'd probably have to have it be defined by the server

lusty dew
#

OOF

#

I forgot about that

#

damn

#

Ok

#

How can I make it so that the person that used the command can see it and no other members

steel drum
#

send it via pms

lusty dew
#

no..

steel drum
#

what do you mean then

lusty dew
#

It is a verification channel

#

not a PM

steel drum
#

oh

lusty dew
#

Yea

steel drum
#

you could make an unverified role

#

and when they use the command

#

well

#

used on them

#

they obtain a verified role

#

remove unverified role

#

and modify the server channel settings

#

accordingly

lusty dew
#

No...

#

That is not what I mean :/

#

It is for a NSFW server

#

So I need it so people can verify to get into nsfw section

#

instead of doing it in the DMs were only one person can do it

#

it will be in a channel were mods/admins/owner can do it if one or more person is busy someone else is there that can do it

earnest phoenix
#

How could I make this regex work with "+-=!@ and spaces"? const regex = "/\w+/gm"

knotty steeple
#

i dont think thats how regex works

#

its not a string

earnest phoenix
#

oof

#

boye

#

the regex works

#

I just need you to tell me how to use spaces and stuffs with it

drifting anchor
#

can someone send me changing bot activity ? (PM) discord.js

wide ruin
#

👍

lusty dew
#

I keep getting this error but I can't figure out how to fix it

bright spear
#

@lusty dew we cant help much without the code

#

but it looks like you're using commandfile.run() when you can't

lusty dew
#
bot.on("message", async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(`@brisk fern `)){
        var command = message.content.slice(`@brisk fern `.length).toLowerCase();
        var cmd = command.split(" ")[0];
        var args = command.replace(cmd+" ", "");
        var commandfile = commands.get(cmd);
        if(commandfile) commandfile.run(bot, message, args).catch((e)=>console.error(e));
    }
});
#

@bright spear

#

Lmfao

#

Ignore the convo

#

It was something I was talking about with one of my dev members XD

bright spear
#

well, looks like commandfile.run() isnt valid

knotty steeple
#

what is commands

bright spear
#

^

lusty dew
#

the name of the folder

#

with all my commands in it

quartz kindle
#

console log it to see if its getting the command properly

lusty dew
#

ok

quartz kindle
#

also, your commands wont work if your bot has a custom nickname in a server

lusty dew
#

Wait what?

#

Really

#

Well fuck me

idle mountain
#

^that’s because nicknames make the tag !@ID

#

Instead of <@ID>

quartz kindle
#

because custom nicknames change the mention from <@id> to <@!id>

lusty dew
#

well fuck

idle mountain
#

Oops I flipped them

quartz kindle
#

its not a big deal, just add a check for it

#

if <@id> || <@!id>

lusty dew
#

Ah ok

quartz kindle
#

same on the slice part

#

you can do some shenanigans to avoid repeated code

#

i'd do something like js array = ["<@id>","<@!id>"]; result = array.indexOf(msg.content); // 0 if no nickname, 1 if nickname, -1 if not found if(result > -1) { msg.content.slice(`${array[result]} `.length) }

#

of course to use that you need to split the entire string before, instead of using startswith

lusty dew
#

o>O

#

Ermmm

knotty steeple
#

shit you love indexOf @quartz kindle

quartz kindle
#

im used to it

#

lul

#

plus in this situation, it has 2 functions

inner jewel
#

finds which one, if any

quartz kindle
#

if you use includes, you wouldnt know if there is a nickname or not

inner jewel
#

the ! version isn't always used even with nicknames afaik

quartz kindle
#

yeah its a bit weird, even so its good to be prepared for it

inner jewel
#

mobile doesn't add it for example

quartz kindle
#

oh

inner jewel
quartz kindle
#

btw why did they add it in the first place?

inner jewel
#

afaik it's for notifications

bright spear
#

also it might be different on ios and android

tulip snow
#

Whats some good libs like discord.js?

west raptor
#

Eris if you want a js lib

bright spear
lusty dew
#

I tried

#

Console logging commandfile.run, commands, and commandfile

#

I just kept getting the same error

quartz kindle
#

console log is not to remove the error

#

is to see the contents of commandfile

#

to see if it contains the expected value

lusty dew
#

No

#

I mean

#

I console logged it

#

I just get the same error

#

and nothing more

#

So whatever I console log

#

is not showing up

quartz kindle
#

you have to console log before the command.run line

lusty dew
#

Oh?

#

I thought I had to do it before

#

I meant

#

After*

quartz kindle
#

because errors stop the code execution

#

so the code never reaches the console log

#

always console log before the line thats causing errors

lusty dew
#

Ah I see

#

Yea

#

That be smart

#

XD

#

{ names: [ 'feet', 'f' ] }

#

That is what pops up

knotty steeple
#

there is no run there

#

thats the problem

lusty dew
#

oh?

#

so I have to do

#
module.exprts = {
run,
names: ['feet', 'f']
#

exports*

#

Oh wait no

#

@knotty steeple What do you mean?

knotty steeple
#

run would be undefined since it isnt in here { names: [ 'feet', 'f' ] }

lusty dew
#

Yea

#

But how do I fix that

#

I don't understand

#

I kinda get what you mean

knotty steeple
#

oh

gilded blaze
#

Define the run function in module.exports

lusty dew
#
var Discord = require("discord.js");
const config = require("../config");
const superagent = require("superagent");
const send = require("quick.hook");
const talkedRecently = new Set();

module.exports.run = async (bot, message, args) => {
  if (talkedRecently.has(message.author.id)) {
        message.channel.send("Wait 5 seconds before getting typing this again. - " + message.author);
} else {
      let {body} = await superagent
      .get(`https://nekos.life/api/v2/img/feet`);
        if(!message.channel.nsfw) return message.channel.send("Comand can only be used in nsfw channels!")

      let hentaiEmbed = new Discord.RichEmbed()
      .setColor("#ff9900")
      .setDescription(`<@${message.author.id}> I heard you like feet? :heart:`)
      .setImage(body.url);

      message.channel.send(hentaiEmbed);
      message.delete().catch();

    talkedRecently.add(message.author.id);
    setTimeout(() => {
      talkedRecently.delete(message.author.id);
    }, 5000);
}
}

module.exports = {
    names: ["feet","f"]
}
#

this is my code

gilded blaze
#

module.exports.run

lusty dew
#

I did that

#

Lmfao

gilded blaze
#

Then it should work

lusty dew
#

It doesn't though

gilded blaze
#

Well maybe not

#

Nvm

#

I think you are overriding the exports at the end

lusty dew
#

Hm?

gilded blaze
#

By setting module.exports to equal an object

#

You remove the run function

lusty dew
#

Hmm

gilded blaze
#

maybe

lusty dew
#

My friend used a thing called

#

JSdoc

#

or whatever

#

in Vscode to utilize VsCodes thing

#

or whatever

#

and he did that

gilded blaze
#

🤔

topaz fjord
#

jsdoc is nice

lusty dew
#

here let me show you what I mean

gilded blaze
#

I know what JSdoc is

lusty dew
#

Okie ;p

#

I was just trying to be noice

#

:3

#

Anyway

#

He used the array thing

#

So you could use either feet

#

or f

gilded blaze
#

Try setting that object to a property of module.exports

#

Or something

lusty dew
#

Hm

#

That didn't work

#

It just brought up new errors

#

this is what me and my friend did

#

for another bot

#

using JSdoc

#

I tried using JSdoc

#

but I faild :/

#

Failed*

gilded blaze
#

JSDoc doesn’t change actual execution of code.

lusty dew
#

hmm

#

I don't know I just want to fix this

#

I didn't have this problem before

#

I am remaking one of my old bots

earnest phoenix
#

JSDoc is just comments

zealous crescent
#

When I login to my account it shows the latest changes, but if I logout It shows the previous description

tardy viper
#

plz help

#

let amount;
if(amount < 1 || amount > 100) return msg.channel.send(Donner moi un montant entre 1 et 100);
WHAT !!!!!!

#

GraphityBOTBOTAujourd'hui à 01:49
J'ai réglé le volume sur : 500

#
        let args = msg.content.split(/\s+/);
        if (!args[1]) return msg.channel.send(`Le volume actuel est : **${serverQueue.volume}**`);
       **
 let amount;
        if(amount < 1 || amount > 100) return msg.channel.send(`Donner moi un montant entre 1 et 100`);**
        if (isNaN(args[1])) return msg.channel.send("Entre une valeur correcte");
        if (!msg.member.voiceChannel) return msg.channel.send(`Vous n'êtes pas dans un channel vocal !`);
        if (!serverQueue) return msg.channel.send(`Il n'y a rien à jouer.`);
        if (args.length > 1) {
          amount = parseInt(args[1])
        };```
earnest phoenix
#

what is the problem

tardy viper
#

the sound can up to 10000000

lusty dew
#

0_0

earnest phoenix
#

ok

lusty dew
#

That looks like a lot

#

but is that even possible?

#

For it to get that loud

tardy viper
#

its repared

#

i have moved

#

the lock sound up 100

#
} else if (command === 'volume') {
        let args = msg.content.split(/\s+/);
        if (!args[1]) return msg.channel.send(`Le volume actuel est : **${serverQueue.volume}**`);
        if (isNaN(args[1])) return msg.channel.send("Entre une valeur correcte");
        if (!msg.member.voiceChannel) return msg.channel.send(`Vous n'êtes pas dans un channel vocal !`);
        if (!serverQueue) return msg.channel.send(`Il n'y a rien à jouer.`);
        if (args.length > 1) {
            let amount;
          amount = parseInt(args[1])
          if(amount < 1 || amount > 100) return msg.channel.send(`Donner moi un montant entre 1 et 100`);
        };```
earnest phoenix
#

ok

tardy viper
#

i have a second probleme

#

i cant modifie that to
const channel = member.guild.channels.find('name', 'join_leave');

#
let join_leave = await db.fetch(`jlch_${member.guild.id}`);
const channel = member.guild.channels.find('name', `${join_leave}`);```
#

that not work

earnest phoenix
#

ok

#

why

tardy viper
#

no error and not working

earnest phoenix
#

are you trying to make the bot find a channel named jlch_264445053596991498

tardy viper
#

no

#

no

earnest phoenix
#

yes

knotty steeple
#

yes you are

earnest phoenix
#

that is exactly what your doing

tardy viper
#

i trying to create a command to send e join at the name channel

#

And that no work

earnest phoenix
#

k

#

what

tardy viper
#

jlch = join leave channel

earnest phoenix
#

no

tardy viper
#

for me its that

earnest phoenix
#

you have it set for

tardy viper
#

i am coding a join leave

earnest phoenix
#

h

tardy viper
#
    let active = await db.fetch(`active_${member.guild.id}`);
    if(active == true) {
    const channel = member.guild.channels.find('name', 'join_leave');
    if (!channel) return;
    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage('/home/graphity/fondnoir.jpg');```
earnest phoenix
#

ok

tardy viper
#

and i cant place this code

let join_leave = await db.fetch(`jlch_${member.guild.id}`);
const channel = member.guild.channels.find('name', `${join_leave}`);```
earnest phoenix
#

do you know what the code you just sent do?

tardy viper
#

yes

#

yes

#

db

earnest phoenix
#

what do you think it does

tardy viper
#

facepalm

#

that FOR MY JOIN LEAVE

earnest phoenix
#

look

tardy viper
#

No FOR mal attention

earnest phoenix
#

you just sending code and saying

#

that it doesn't work

knotty steeple
#

you are trying to find a channel called jlch_264445053596991498 (saying the guild id was here)

tardy viper
#

I cant send all code

earnest phoenix
#

and when i said why i didn't work

tardy viper
#

no

#

facepalm

#

ITS DATABASE

#

is SEARCH IN THE DATABASE

knotty steeple
#

what

earnest phoenix
#

i use quick.db

knotty steeple
#

the fuck

tardy viper
#

and me

#

const db = require('quick.db')

earnest phoenix
#

he's searching in the database for an entry with that name and the result is what he's trying to operate on

knotty steeple
#

the problem is

earnest phoenix
#

but without knowing the result not much can be helped

tardy viper
#

Juste for join leave

earnest phoenix
#

"it won't work" is likely because join_leave isn't set to anything useful

tardy viper
#

and when i add the code that doesent work

let join_leave = await db.fetch(`jlch_${member.guild.id}`);
const channel = member.guild.channels.find('name', `${join_leave}`);```
knotty steeple
#

oh wait im being dumb

#

lmao

tardy viper
#

module.exports.run = async (bot, message) => {
if (message.author.bot) return undefined;
if(message.channel.type === "dm") return undefined;
let fetchedl13 = await db.fetch(jlch_${message.guild.id});
if(fetchedl13 === null);
const args = message.content.split(" ").slice(1);
var saytext = args.join(" ");
if (!message.member.hasPermission("ADMINISTRATOR")) return message.reply("Vous n'avez pas accès à cette commande.").then(msg => {msg.delete(4000)});;
message.channel.send(Le nouveaux channel de join/leave et : ${saytext})
message.delete(message.author);
db.set(jlch__${message.guild.id}, saytext).then(i => {
});
}

earnest phoenix
#

console.log() is your friend

#

figure out what's not working right

tardy viper
#

no

#

i have it

#

and

#

not work

#

beacause no eror

earnest phoenix
#

ok

knotty steeple
#

if(fetchedl13 === null);

#

what is this

#

thats not valid js

tardy viper
#

its copy code off all pas

#

i a CX

#

and

#

LOGS

earnest phoenix
#

ok

tardy viper
#

its egal

earnest phoenix
#
  1. copy code yes
#

it should be fine. if it's null it just won't do anything

#

basically a no-op

tardy viper
#

no

#

i set a channel

knotty steeple
#

pretty sure it should just have a return;

#

but GWcmeisterPeepoShrug

tardy viper
#
    let active = await db.fetch(`active_${member.guild.id}`);
    if(active == true) {
        const channel = member.guild.channels.find('name', 'join_leave');
    if (!channel) return;
    
    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');
earnest phoenix
#

are you uploading a picture when someone joins and leaves

tardy viper
#

yes

earnest phoenix
#

no wonder discord has multiple hundreds of TB of images stored

tardy viper
#

const background = await Canvas.loadImage('/home/graphity/fondnoir.jpg');

#

its = at koya

#

and its not finish just

earnest phoenix
#

ok

tardy viper
#

its repared

karmic blaze
#

In discord.js, does TextChannel#messages return all messages sent?

#

Like, can I do msg.channel.messages.size to see how many messages have been sent?

jagged plume
#

It's a collection of all cached messages, it doesnt contain every message ever sent

#

although in the case of discord.js it may aswell have every single message in it GWchadThink

karmic blaze
jagged plume
#

yeah it's only cached messages

#

was just poking fun at discord.js for their memory usage lmao

karmic blaze
#

lol

#

Alright, that stuffs up my plans, thanks though.

jagged plume
#

if you wanted to fetch a certain amount of messages you can do that, but certainly not every single message

#

especially for larger servers

hushed berry
#

any of yall proficient with regex

#

nvm

karmic blaze
#

I have this function:

const searchVideos = (API, terms, user) => {
    API.searchVideos(terms, 2)
    .then(async res => {
        API.getVideoByID(res[0].id)
        .then(async results => {
            let songObj = new Object({
                title: results.title,
                id: results.id,
                url: `https://www.youtube.com/watch?v=${results.id}`,
                addedBy: user,
                length: results.durationSeconds,
                thumbnail: results.thumbnails.high.url,
            });

            console.log(songObj);
            return songObj;
        }).catch(err => {
            console.error(err);
            return err;
        });
    }).catch(err => {
        console.error(err);
        return err;
    });
}

When I console.log the songObj there, i get the correct song. But if I try using it:

const song = await searchVideos(YouTube, args.join(' '), msg.author);

it always returns undefined. Why is this? 👀

earnest phoenix
#

because the result is returned inside the promise

karmic blaze
#

Which means..?

earnest phoenix
#

Which means a few things:

#
  • you dont understand async
  • you dont understand how to do promise chaining
  • you should probably use an async function and await to make the code readable
#

i mean you are awaiting searchVideos and its not even async. thats not necessarily bad but its pointless

#

searchVideos should be ```js
async(...) { /do something/ }

#

if you wanna be lazy you can just return a promise and resolve the songObj and reject on the errors

karmic blaze
#

Errrrm, alright.

earnest phoenix
#

API.searchVideos and API.getVideoByID both return a promise, you're doing a few things inside each .then callback which is called after each promise is successfully finished (async). you are awaiting your custom searchVideos function but the code inside it its not awaited, probably your way to go about it is to make the func itself async and await its contents

const res = await API.searchVideos(...) etc

#

here lemme 🥄 1 sec

#
const searchVideos = async(API, terms, user) => {
    return new Promise((resolve, reject) => {
    API.searchVideos(terms, 2)
    .then(async res => {
        API.getVideoByID(res[0].id)
        .then(async results => {
            let songObj = new Object({
                title: results.title,
                id: results.id,
                url: `https://www.youtube.com/watch?v=${results.id}`,
                addedBy: user,
                length: results.durationSeconds,
                thumbnail: results.thumbnails.high.url,
            });

            console.log(songObj);
            resolve(songObj);
        }).catch(err => {
            console.error(err);
            reject(err);
        });
    }).catch(err => {
        console.error(err);
        reject(err);
    });
    });
}

then inside an async function

const result = await searchVideos(...)
karmic blaze
#

Alright, thanks.

earnest phoenix
#

actually i dont think the first one needs to be async in this case

karmic blaze
#

Now I can code my bot while using it 🤔

wintry quest
#

Holy hell I'm finally stumped on something.

steel drum
#

whats p @wintry quest

wintry quest
#

I just fixed it 😂

#

all good.

#

Like I said, dumb at the moment

bitter sundial
#

why'd you make everything async but still use promises

#
const searchVideos = async (API, terms, user) => {
  const res = await API.searchVideos(terms, 2);
  const results = await API.getVideoByID(res[0].id);
  const songObj = {
    title: results.title,
    id: results.id,
    url: `https://www.youtube.com/watch?v=${results.id}`,
    addedBy: user,
    length: results.durationSeconds,
    thumbnail: results.thumbnails.high.url,
  }

  console.log(songObj);
  return songObj;
}
#

@karmic blaze You should take a look at that ^

lusty dew
#
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {
guild.createChannel(`${message.author} verification`, 'text')
  .then(console.log)
  .catch(console.error);
}

module.exports.help = {
  name: "verify"
}

I want to make it so that the person that used it can see the channel and a certain role can but I still can't figure it out

bitter sundial
#

the next argument is channel overwrites

lusty dew
#

Yes I know

#

But isn't that for like

#

ADMINISTRATOR, MANAGE_MESSAGES

#

and such

bitter sundial
#

what you want to set is READ_MESSAGES for the user and the role, right?

lusty dew
#

Well

bitter sundial
#

actually VIEW_CHANNEL

lusty dew
#

Wouldn't that make it so

#

everyone with READ_MESSAGES can see the channel then

#

I only want the person that used command and a certain role

#

to be able to see it

#

ofc the owner can automatically see it

#

owner of serevr*

#

server*

bitter sundial
#

you'd be disallowing view channel for @ everyone

lusty dew
#

Oh

#

So if I use

#

VIEW_CHANNEL only the person can see it and not regular members?

#

I am trying to make understanding of this

frigid bone
#

Deny READ_MESSAGES for @everyone and enable it for the person using the command

#

Only that person and people with ADMIN perms will be able to see the channel then

bitter sundial
#

so
you disable @ everyone the view channel permissions, now no one can see it
then you allow the user view channel permissions, now only that person can see it
and finally you allow view channel for the role and they can also see it

lusty dew
#

Hmm

bitter sundial
#

yeah and of course admin will always be able to see them

lusty dew
#

Yea

frigid bone
#

You basically disallow everyone to see the channel but add an exception to one person

lusty dew
#

Oh ok

#

I will try and do that

#

Never done it before so I may fail o.O

frigid bone
#

You should try this in a private server to better understand what's actually going on

lusty dew
#

Yea

#

It is in a private server

#

With a few people

#

helping me test

frigid bone
#

I meant tweaking with the permissions manually

bitter sundial
#

and a little tip: the id for the everyone role is the same as the guild id

lusty dew
#

oh?

#

I did not know that

frigid bone
#

hmm TIL

lusty dew
#

so wait

#

nvm

pale marsh
#

Thinking of moving from python to js

lusty dew
#

So Kinda like this

#

Got help in another server

#

But I didn't want to bug them too much

#

I got the @ everyone down

#

I hope

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

module.exports.run = async (bot, message, args) => {
guild.createChannel(`${message.author} verification`, 'text', [{
  id: guild.id,
  deny: "VIEW_CHANNELS"
}, {
  id: message.author.id,
  allow: "VIEW_CHANNELS"
}])
  .then(console.log)
  .catch(console.error);
}

module.exports.help = {
  name: "verify"
}
#

is this how I do it for both @ everyone and the user?

bitter sundial
#

looks good
allow and deny are deprecated tho, you should use allowed and denied and put the view channels in an array

lusty dew
#

Ah ok

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

module.exports.run = async (bot, message, args) => {
guild.createChannel(`${message.author} verification`, 'text', [{
  id: guild.id,
  denied: [VIEW_CHANNELS]
}, {
  id: message.author.id,
  allowed: [VIEW_CHANNELS]
}])
  .then(console.log)
  .catch(console.error);
}

module.exports.help = {
  name: "verify"
}
#

so like this?

bitter sundial
#

you still need the quotes

lusty dew
#

OOF I forgot the ""

#

yea

#

lol

#

Also

#

Tonkku

#

One other thing

#

I am trying to do

#

!male approve

#

or !approve male

#

and it gives them the role

#

but after 60% people have the male verified role

#

the command stops working

#

but if some people leave with the male verified role

#

it works again

bitter sundial
#

is that a bug or something you want to implement

lusty dew
#

A bug?

toxic forum
#

does what you just described happen to your bot or is this what you want your bot to do?

lusty dew
#

I want my bot to do that

#

OOF forgot to define guild in the verify command

bitter sundial
#

ok so just check <Role>.members.size against <Guild>.members.size

lusty dew
#

Ah ok

bitter sundial
#

you might have to fetch members first to have all of them to count

lusty dew
#

Yea

#

Erm

#

Tonkku

#

it is saying guild is not defined at guild.id

#

that

#

I thought I defined guild o.O

toxic forum
#

well, you need to find the guild you want to add channels to

bitter sundial
#

show code again

lusty dew
#
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {
  
message.guild.createChannel(`${message.author} verification`, 'text', [{
  id: guild.id,
  denied: ["VIEW_CHANNELS"]
}, {
  id: message.author.id,
  allowed: ["VIEW_CHANNELS"]
}])
  .then(console.log)
  .catch(console.error);
}

module.exports.help = {
  name: "verify"
}
#

It is a private bot.

toxic forum
#

use message.guild.id in your createchannel

bitter sundial
#

^

lusty dew
#

OOF

#

I did the same with

#

guild.createChannel xD

#

I really need to stop ccoding at 3am

toxic forum
#

I'd say go sleep yeah XD

lusty dew
#

HEH

#

Grind don't stop

#

work dont stop

#

until i pass out

#

;3

toxic forum
#

"sleep is for the weak"

lusty dew
#

Ikr

#

I haven't slept

#

in 3 days :3

#

It says

#

Invalid Permissions string or number

toxic forum
#

I don't know how discord.js passes around permissions so i can't help you with that, i don't use discord.js for my bot

#

ah found it

#

your createChannel call is wrong

wild tide
#

Eh, Invalid Access and Invalid Permissions I believe are a new thing in the API, because they never appeared before, but now they are all of a sudden

#

if you don't wanna see them just catch them and replace with null

daring ermine
#

[Discord.js]
Hi,
how can I edit a role to allow everyone to mention it

lusty dew
#

By doing it manually

#

?

wild tide
#

^^

heady zinc
#

they are in no way new at all

lusty dew
#

Ok

#

How can I fix it...I never got this when doing channel overwrites

wide ruin
#

pls help, is there a way to send a message in a specific server, in a specific channel, d.js

lusty dew
#

ofc i used .overwritePermissions

#

idk if that brings up same error

ruby dust
#

what lib?

wide ruin
#

discord.js

ruby dust
#

oh right

wide ruin
#

so how?

toxic forum
#

@lusty dew now that I look at your code agian that should be fine too

wild tide
#

pineapple fan, its says on your youtube that you are sacoma

ruby dust
#

there should be methods to get guild/channel objects in a client class

scarlet ocean
#

Hey guys, I've been trying to make a custom bot for my server, and I can't seem to find any good tutorials

#

I've been trying to find one for a day now

toxic forum
#

did you do any coding before making a bot?

scarlet ocean
#

I've dabbled

#

In python

ruby dust
#

you need a programming language, not tutorials

scarlet ocean
#

I'm planning to get into batch

wide ruin
#

@wild tide what?

#

ah

wild tide
#

gotcha

wide ruin
#

uugh

scarlet ocean
#

So what language should I learn before I actually make a bot?

toxic forum
#

choose one you are comfortable with

scarlet ocean
#

What are some of the most used?

wide ruin
#

so how do you send a message in a channel in a certain server?

#

drom a different server

#

from*

toxic forum
#

if you like python go with python, there are actually libraries for discord in lots of programming languages

scarlet ocean
#

ok

toxic forum
#

i dont know any stats unfortunately, nor do i know if they even have stats for that

scarlet ocean
#

I'll try python and see how I do with that

wide ruin
#

the mods are offline

wild tide
#

i am a mini mod

#

does that count

wide ruin
#

o

#

no

wild tide
#

D;

#

;-;

wide ruin
#

can i have help now pls

toxic forum
#

discord.js yes

scarlet ocean
toxic forum
#

there should be a client object you have, you can get a channel from the client provided you have an id of that channel

wide ruin
#

?

toxic forum
#

code?

wide ruin
#

i just dint get what you mean

#

dont*

#

how can i send a message to <#272764566411149314 >

#

message.logchannel.send()

#

const logchannel = ?

toxic forum
#

do you have a client?

#

you need one to be able to connect the bot

wide ruin
#

const client = new Discord.Client();

toxic forum
#

ok

#

you can find a channel with the client

wide ruin
#

how?

toxic forum
#
const logchannel = client.channels.find(272764566411149314);
#

assuming the id is correct

wide ruin
#

well, its actually 485745738517839872

toxic forum
#

just use that id then

wide ruin
#

i definitely do not want to lig here

#

log*

toxic forum
#

you wont even be able to

west raptor
#

^

#

Bots don't have perms to talk here

wide ruin
#

oh

#

and there is message.channel

#

but is there message.guild?

toxic forum
#

channel has a guild (unless its a dm)

#

its probably guild?

wide ruin
#

it says #bot-commands

#

but how can i get the server name?

#

Help used
By:
Pineapplefan1234YT#9295
At:
Sun Sep 02 2018 10:10:49 GMT+0000 (UTC)
In:
#bot-commands

#

thats the current help log

#

Help used By: Pineapplefan1234YT#9295 At: Sun Sep 02 2018 10:10:49 GMT+0000 (UTC) In: #bot-commands In: Discord Bot List

#

is the goal

toxic forum
#

log for every command that is executed?

wide ruin
#

yes

#

well not every command

#

but how do i get discord bot list to appear at the bottom?

#

@toxic forum

toxic forum
wide ruin
#

ok thanks

toxic forum
#

agian, guild can be null if the message was send from a DM for instance

wide ruin
#

it doesnt respond to dms

toxic forum
#

aight

wide ruin
#

this didnt work

#

@toxic forum

toxic forum
#

error?

wide ruin
#

no

#

it didnt actually log

#

idk why

toxic forum
#

well i don't know either 😅

wide ruin
#

wait

toxic forum
#

you need to be able to debug your own code at least

wide ruin
#

at Object.module.exports.run (/app/commands/purge.js:29:44)

#

that was the error

toxic forum
#

that's part of it

#

where's the rest

wide ruin
#

that was it

toxic forum
#

really!?

slender thistle
#

That doesn't even tell anything

toxic forum
#

are you sure

wide ruin
#

yes

#

wait

#

no

#

this is part of the same error

#

`at Object.module.exports.run (/app/commands/purge.js:29:44)

at Client.client.on (/app/server.js:22:31)

at emitOne (events.js:116:13)

at Client.emit (events.js:211:7)

at MessageCreateHandler.handle (/rbd/pnpm-volume/e833a0de-7dc5-4e4f-82a8-7de26ebb0fdd/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)

at WebSocketPacketManager.handle (/rbd/pnpm-volume/e833a0de-7dc5-4e4f-82a8-7de26ebb0fdd/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)

at WebSocketConnection.onPacket (/rbd/pnpm-volume/e833a0de-7dc5-4e4f-82a8-7de26ebb0fdd/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)

at WebSocketConnection.onMessage (/rbd/pnpm-volume/e833a0de-7dc5-4e4f-82a8-7de26ebb0fdd/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)

at WebSocket.onMessage (/rbd/pnpm-volume/e833a0de-7dc5-4e4f-82a8-7de26ebb0fdd/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/event-target.js:120:16)

(node:8370) 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: 1)

(node:8370) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`

lusty dew
#

How do I make it show up the

#

Neko Ali#2051

wide ruin
#

@toxic forum

lusty dew
#

it just shows

#

neko-ali2051 without the #

wide ruin
#

what lib?

#

@lusty dew

toxic forum
#

@wide ruin you are not catching errors in your code

lusty dew
#

Discord.js

#

isnt it

#

message.author.discrminator

wide ruin
#

no

lusty dew
#

or

wide ruin
#

you need...

lusty dew
#

message.author.tag

wide ruin
#

message.author.tag

#

yeah

lusty dew
#

That not working though

#

It still shows

#

neko-ali2051

#

as the channel name

wide ruin
#

show me your code

lusty dew
#
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {

message.guild.createChannel(`${message.author.tag} verification`, 'text', [{
  id: message.guild.id,
  denied: ["VIEW_CHANNEL"]
}, {
  id: message.author.id,
  allowed: ["VIEW_CHANNEL"]
},
{
  id: "485758387263504391",
  allowed: ["VIEW_CHANNEL"]
}])
  .then(console.log)
  .catch(console.error);
}

module.exports.help = {
  name: "verify"
}
wide ruin
#

oh

#

wow

#

you cant make a text channel with a # in it

lusty dew
#

Awwwww

#

I thought I seen some channels do it

#

xD

wide ruin
#

only for a vc

lusty dew
#

Oh well

#

RIp

#

thank you :3

wide ruin
#

np

#

well

lusty dew
#

Still going to keep message.author.tag though

#

without it just displasy the ID

#

displays*

wide ruin
#

if you invite me in a dm, i can help with it

lusty dew
#

The only thing I need to do now

#

is a male approval command

#

with a twist

wide ruin
#

the 60% thing

lusty dew
#

Yepo

#

I know how to do it kinda

#

Ah yes

#

With the create channel thing

#

I want to also send a message in that newly created channel

#

How would I make it do that?

#

woudl i do

#

oof wait

wicked latch
#

Hey guys ! I've a question, how do you get your bot demute ?

toxic forum
#

demuted where

#

in what channel

#

if there's a problem with it you should have a mention in #mod-logs

lusty dew
#

@toxic forum hey can I ask you something

toxic forum
#

sure

lusty dew
#

How do I make my bot send a message in the channel when it is created

#

Like after the verification channel is created

#

it will send a message

toxic forum
#

use the then to send it after it is created

#

the then is called after it's completed

lusty dew
#

Ah

#

So like

#
message.guild.createChannel(`${message.author.tag} verification`, 'text', [{
  id: message.guild.id,
  denied: ["VIEW_CHANNEL"]
}, {
  id: message.author.id,
  allowed: ["VIEW_CHANNEL"]
},
{
  id: "485758387263504391",
  allowed: ["VIEW_CHANNEL"]
}]).then(message.channel.send("messagehere"))
  .then(console.log)
  .catch(console.error);
#

like that

#

?

toxic forum
#

nope

wicked latch
#

@toxic forum Like from everywhere, it gets mute due to a bad command

lusty dew
#

OOF

#

I don't understand then

toxic forum
#

the general idea is correct though

lusty dew
#

Oh

toxic forum
#

you,re just using the wrong channel

lusty dew
#

oh?

toxic forum
#

lets see if my js knowledge is still on point

#

@wicked latch either write code that disables the command on this guild or remove the command

wicked latch
#

@toxic forum Ok I just changed the command, ty 😃

toxic forum
#
.then((channel) => {
    channel.send("message here");
});

the channel passed to then should now be the newly created one @lusty dew

lusty dew
#

AH

#

Ah*

#

So I don't need message?

toxic forum
#

nope

lusty dew
#

AH ok

#

Ah ok*

#

damn caps

#

xD

toxic forum
#

not in the then at least

#

you need it for the rest

wicked latch
#

messagecontains the info about the channel where the command where sent

#

So message.channeldoesn't contains the channel created

lusty dew
#

Ah

#

I see

#

Also

#

Could I do a like

#

setTimeout

#

so after a certain ammount of time

#

the channel deletes automatically

#

amount*

toxic forum
#

you could use that yes

lusty dew
#

Ok

#

I will try and implement that

#

It would be good to have it

#

instead of an admin having to delete it

#

if someone decided not to verify after all

#

Hmm

#

How would I get the channel to delete?

#

I know embed can be done by

#

embed: null

#

can channel be done the same way?

toxic forum
#

don't think so

lusty dew
#

OOF ok

#

I will have to figure out how to delete the channel then

#

after the timeout is done

toxic forum
#

channel.delete()

lusty dew
#

Ahhh

#

Yes

#

Forgot about that

toxic forum
#

think you really need sleep 🤣

lusty dew
#

NU

#

no sleep >:)

#

I am almost done

#

All I need after that

#

is Male approval command

#

which will be hard...

#

for one reason

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

module.exports.run = async (bot, message, args) => {

message.guild.createChannel(`${message.author.tag} verification`, 'text', [{
  id: message.guild.id,
  denied: ["VIEW_CHANNEL"]
}, {
  id: message.author.id,
  allowed: ["VIEW_CHANNEL"]
},
{
  id: "485758387263504391",
  allowed: ["VIEW_CHANNEL"]
}]).then((channel) => {
    channel.send("");
});
  .then(console.log)
  .catch(console.error);
  .setTimeout(() => {
    channel.delete()
  },300000);
#

would this work

#

mainly asking about

#

the timeout

#

or do I have to do

#

message.channel.delete

#

I know I had to do that in my !close command

toxic forum
#

settimeout woudnt work with the . in front

wide ruin
#
const { RichEmbed } = require('discord.js')
const replies1 = ['yes, ', 'no, ']
const replies2 = [' is, ', " isn't, "]
let outcome = ~~(replies1.length * Math.random())
module.exports.run = (client, message, args) => {
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    if(!rUser) return message.channel.send("No user selected");
    let q = args.join(" ").slice(22);



    let first = item {outcome} of replies 1
    let second = item {outcome} of replies 2 



   message.channel.send(first + rUser + second + q)
}

module.exports.help = {
  name: "is" 
}```
the section in the middle is what i need help with
lusty dew
#

Oh

#

so just

#

setTimeout?

#

Ah yes

#

damn

#

I do need sleep

#

o.O

toxic forum
wide ruin
#

@toxic forum can you help pls

lusty dew
#

I kinda understand it

#

just by looking at it

#

it is setting a delay

#

for the console log

#

Oh wait

#

It is delaying the promise

#

and console logging it

#

Right?

#

OOF when in a function

toxic forum
#

looks like you want to wait for messages after eachother that use those replies @wide ruin ?

lusty dew
#

Hmm

#

In the timeout

#

could I use

#

8.64e+7

wide ruin
#

wdym @toxic forum

lusty dew
#

as the time it waits

#

That is 1 day in milliseconds

toxic forum
#

@lusty dew its in milliseconds so 1sec = 1000

lusty dew
#

Yea

#

So can I do

#

8.64e+7 = 1 day in milliseconds

toxic forum
#

well

lusty dew
#

I want it to wait a day

#

before deleting channel

wide ruin
#

hmm

toxic forum
#

i don't think that fits inside a number in js

lusty dew
#

Well

#

You can use them in

#

cooldowns

#

like

#

let cooldown = 8.64e+7

#

I seen it done

#

it works

toxic forum
#

why ask then

lusty dew
#

Cause

#

I did not know if it would work with a setTimeout

#

ofc now that I think about it

#

nvm

#

just let me shut up XD

wide ruin
#

1 day is 86400000ms

lusty dew
#

.

#

In a simplified form though

#

itis

#

8.64e+7

toxic forum
#

in scientific notation yes

lusty dew
#

Yea

wide ruin
#

can i have help still tho pls

wild tide
#

what do you need help for

toxic forum
#

interactive commands

#

is what he want's

wide ruin
#
const { RichEmbed } = require('discord.js')
const replies1 = ['yes, ', 'no, ']
const replies2 = [' is, ', " isn't, "]
let outcome = ~~(replies1.length * Math.random())
module.exports.run = (client, message, args) => {
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    if(!rUser) return message.channel.send("No user selected");
    let q = args.join(" ").slice(22);



    let first = item {outcome} of replies 1
    let second = item {outcome} of replies 2 



   message.channel.send(first + rUser + second + q)
}

module.exports.help = {
  name: "is" 
}
toxic forum
#

don't know how to do that in js though

wide ruin
#

@wild tide the 2 lets in the middle

#

i need that in code

wild tide
#

hmm

#

can you elaborate on 'interactive commands'?

wide ruin
#

idk what they meant

#

it is basically like o/is @wide ruin dense

#

and it either says yes, @wide ruin is dense or no, @wide ruin isn't dense

toxic forum
#

basically

#

he want's a user to fire off a command, his bot asks a question and awaits the response, then asks another question

#

is what is understood at least

#

¯_(ツ)_/¯

wild tide
#

Hmm

lusty dew
#

So basically like CleverBot?

wild tide
#

You should have a look at the Cleverbot API

#

^^

lusty dew
#

Yea

wide ruin
#

its just going to be a random response

#

so not cleverbot

late hill
#

yes

#

and cleverbot costs money

#

If u want to use alot

#

very sad

wide ruin
#

i dont want cleverbot

#

just commadns like that

#

so how can i get item {outcome} of a list

late hill
#

👌

wild tide
#

thats basically 8ball

#

I don't know python, but you want to have an array of responses. When the bot detects user input, it will take a random one of those responses and send it

toxic forum
#

it's not 8ball

wild tide
#

For example,

let responses = ["first response", "second response", "etc."];```
toxic forum
#

he want's to await the next message of a user inside his command

wild tide
#

you need to await a user response

#

pretty self explanatory

knotty steeple
#

thats js

wide ruin
#

@wild tide i have the responses thing

#

and an outcome var, that picks a number from 1 to list length

#

but i need item outcome of responses

#

how do i do that?

quartz kindle
#

replies1[outcome]

#

if i understand correctly, you want to pick one from the list using outcome as the index.

#

call the list replies1 and specify which item of the list [number]

lusty dew
#

Gm Tim

shut python
#

Guys, is there any way to pass 1 MySQL connection to 3 shards?

quartz kindle
#

not afaik. each shard should have its own db connection, hence why you need a db that accepts multiple connections for sharding

shut python
#

Also I heard about pooling, maybe it could work, or no?

quartz kindle
#

no idea

shut python
#

ok thx

lusty dew
#
bot.on("ready", async () => {
                                            ^
  console.log(`${bot.user.username} is online`);
  bot.user.setActivity(`over ${bot.guilds.size} guilds || !help`, {type: "WATCHING"});
  console.log(`${bot.user.tag} is online with ${bot.guilds.size} guilds!`);

});

( Unexpected token

#

Meh

#

the ( after async is an unexpected token

#

Also

#

The bot was ran on a Linux idk if that has anything to do with it

topaz fjord
#

what node version

#

@lusty dew

lusty dew
#

Give me a sec

#

lol

topaz fjord
#

node -v