#development

1 messages · Page 454 of 1

quartz kindle
#

i didnt post actual code

#

you have to you the correct timeout code

earnest phoenix
#

Oh...

#

Ok

quartz kindle
#

the one you are using is correct

earnest phoenix
#

Oh

#
    bot.setTimeout(() => { Message.edit("I am sorry..."); }, 1000);
    bot.setTimeout(() => { Message.edit("I never meant to hurt you..."); }, 6000);
#

so like that

#

so there is a 5 second delay?

quartz kindle
#

yes, this will create 2 timeouts, one after 1000ms, the next one after 6000ms, so there is a 5000ms delay between them

earnest phoenix
#

Okk

#

thanks

#

What you told me

#

made so much more sense

uncut slate
#

you'd be better off doing something like this though

  const sentences = [
    "I am sorry...",
    ...  
    "Always will :heart:"
  ];

  message.channel.send('Griffin....').then((msg) => {
    for (const sentence of sentence) {
      msg.edit(sentence);
      timeout N;
    }
  }
earnest phoenix
#

then what others was telling me

#

.....

#

Ughhh

#

please

quartz kindle
#

afaik, timeout doesnt pause loops

earnest phoenix
#

I just want something

uncut slate
#

unless you need the timeouts to differ specifically from sentence to sentence

earnest phoenix
#

that will work

tardy viper
#

How to create channel using command ?

uncut slate
#

@quartz kindle depends on the timeout function you write, it's certainly possible

earnest phoenix
#

I just want something that works

quartz kindle
#

yes but the way you showed it all the timeouts will still be executed at once

earnest phoenix
#

this is important to me

knotty steeple
#

@tardy viper you can read docs

uncut slate
#

there, happy

const sentences = [
  "I am sorry...",
  ...
  "Always will :heart:"
];

message.channel.send('Griffin....').then(async (msg) => {
  for (const sentence of sentence) {
    msg.edit(sentence);
    await timeout(n);
  }
}
earnest phoenix
#

....

#

I just want something that works

#

for the love of god

uncut slate
#

we don't spoon feed

earnest phoenix
#

I know

tardy viper
#

I didnt found the commands

earnest phoenix
#

im not asking to

quartz kindle
#

the way you're doing it is simple and works

#

so stick with that

earnest phoenix
#

i am talking about a solution

#

not for you to write the whole damn code

uncut slate
#

that's exactly the opposite of what we're doing though, the timeout function is the core of it

#

which is what you'd have to write

quartz kindle
#

you could also do a recursive function if its easier to understand

earnest phoenix
#

Dont care

#

@quartz kindle thx it worked ❤

quartz kindle
#

¯_(ツ)_/¯

knotty steeple
#

recursive function?

earnest phoenix
#

Did exactly what I wanted it to do

#

Yea

#

recursive fuction calls on it's self

#

or something like that

#

and it loops it i think

#

thats what i read it says that

quartz kindle
#
    //do something with var
    setTimeout(function(){ abc(var) },5000)
}```
earnest phoenix
#

I read from there

#

it told me what a recursive fuction is

#

function*

#

but anyways

#

Thx tim ❤

tardy viper
#

i didnt found

#

to create channel with command

earnest phoenix
#

@ruby dust

#

how do you keep your bot online 24/7 on skyslik

#

?

ruby dust
#

I assume it closes as soon as you close putty

earnest phoenix
#

yes

quartz kindle
#

tmux

earnest phoenix
#

the bot closes when i close putty

ruby dust
#

because putty is still a local terminal

#

you have to create a tmux session and let it run there

quartz kindle
#

tmux is a terminal multiplexer, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. It is useful for dealing with multiple programs from a command-line interface, and for separating programs from the Unix s...

sick cloud
#

how does one fix this issue

(node:23584) UnhandledPromiseRejectionWarning: TypeError: winners.map is not a function
    at giveaways.map (/home/tony/Givaway[canary]/handler.js:47:78)
    at <anonymous>
#
winners.map(w=>`${w}`).join(' ')
quartz kindle
#

what is the content of winners?

ruby dust
#

install tmux on your server, create a tmux session, detach from tmux session and then it fully runs in your server

earnest phoenix
#

how do i create a tmux session

sick cloud
#
                let winners;
                if (!users.size) {
                    winners = 'None, nobody entered?';
                }
                else if (users.size === 1) {
                    winners = users.random(1);
                }
                else {
                    winners = users.random(giveaway.winnerCount);
                }

its set there

earnest phoenix
#

?

ruby dust
#

first install it

#

apt get tmux iirc

earnest phoenix
#

in putty?

ruby dust
#

yes

quartz kindle
#

winner is a string, i dont think .map() works on strings

earnest phoenix
#

apt-get tmux?

sick cloud
#

it shouldn't be a string

ruby dust
#

I don't remember how specifically

sick cloud
#

there were 2 users that entered

ruby dust
#

its apt get or something

sick cloud
#

so it should be an array or whatever .random gives @quartz kindle

earnest phoenix
#

ok

quartz kindle
#

idk about .random, but in the first if, it becomes a string

#

so it will eventually throw that error

earnest phoenix
#

i have to do it in the vortex folder right?

ruby dust
#

no just in your home directory

earnest phoenix
#

ok

sick cloud
#

it can't

#

there were 2 entries so it can't be a string

quartz kindle
#

what is users?

earnest phoenix
#

ok @ruby dust installed it

ruby dust
#

now each time you create a tmux session it will create a terminal on vps end

sick cloud
#
const reactions = msg.reactions.filter(r => r.emoji.name === '🎉').first();
const users = reactions.users.filter(u => u.bot !== true) || null;

that

earnest phoenix
#

how do i create a tmux session?

ruby dust
#

tmux new -s any_name_here

earnest phoenix
#

ok

#

ty

quartz kindle
#

is .random() a lib?

ruby dust
#

there's more tho

sick cloud
#

no

#

its javascript

#

built in

quartz kindle
#

i cant find anything about it

#

besides math random

earnest phoenix
#

it should look like this right?

ruby dust
#

yes, this is where you attempt to run anything you want

earnest phoenix
#

ok

#

ty

#

i ran the bot now i can exit out of putty

sick cloud
#

thats what it is @quartz kindle math.random

ruby dust
#

not quite

sick cloud
#

also tbc this works on my public bot

quartz kindle
#

you cant use random without Math

#

never seen that before

ruby dust
#

you have to be able to detach from the tmux session

sick cloud
#

it works fine on @acoustic gull

#

without math

quartz kindle
#

thats weird af

ruby dust
#

ctrl + b then press d

wild tide
#

Giveaway needs an 'e'

earnest phoenix
#

ok

wild tide
#

spelling lmao

earnest phoenix
#

how do i enter back

ruby dust
#

if you want to attach back to the session you do tmux attach -t session_name_here

earnest phoenix
#

tmux -s vortex?

#

ahhh

ruby dust
#

and to kill a session tmux kill-session -t session_name_here

quartz kindle
#

tmux a attaches to the first session it finds

earnest phoenix
#

ok tysm @ruby dust

ruby dust
#

you can create multiple sessions and run multiple bots

#

¯_(ツ)_/¯

sick cloud
#

no @wild tide

#

its called Givaway on purpose

wild tide
#

🙌 ok

earnest phoenix
#

wow

quartz kindle
#

anyway Tony, console log all 3 instances of winnerto confirm that they work

sick cloud
#

will do

#

changed some code and it worked

#

no members

quartz kindle
#

then check the reactions and users code

#

maybe its not returning them correctly

sick cloud
#

i have no idea why tho

#

it works 100% fine on the public bot

quartz kindle
#

¯_(ツ)_/¯

#

when in doubt, console.log everything

sick cloud
#

ye

#

ok new issue

#

(node:24561) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message

knotty steeple
#

@ruby dust tmux 🤢

#

tbh

ruby dust
#

not my problem that you are using js

#

actual programs need to be run normally

quartz kindle
#

unknown message = message was deleted, was hidden by message history, or channel/server no longer accessible

sick cloud
#

its still there

#
const m = await channel.fetchMessage(giveawayId);

using that code if it makes sense

quartz kindle
#

does your bot have message history permission?

sick cloud
#

its got administrator

#

so yes

quartz kindle
#

then idk, was the bot restarted? did the message get removed from cache?

sick cloud
#

the bot was restarted yes

#

but fetchMessage is supposed to get it regardless of cache right?

quartz kindle
#

im not sure

#

yeah it should

quartz kindle
#

yeah i checked

#

but if its not working then maybe the problem is elsewhere

#

double check if the channel and id are correct

sick cloud
#

yeah i'll console.log them

earnest phoenix
#

help

#

me

#

what do you guys host on?

sick cloud
#

a dedicated server

earnest phoenix
#

yea

#

name

sick cloud
#

like host name?

earnest phoenix
#

yea

#

ofc

sick cloud
earnest phoenix
#

does it support windows?

sick cloud
#

idk

#

haven't tried

#

who would want to use windows tho

earnest phoenix
#

me

fluid basin
#

wew prices not bad tbh

earnest phoenix
#

^

fluid basin
#

Well if you want any cheap and decently good ones remember to check the pins of this channel

earnest phoenix
#

ok

uncut slate
#

galaxygate is where it's at rn blobweary

fluid basin
#

still not sure how galaxygate is fairing

#

Had been considering to switch for some time now

knotty steeple
#

skysilk is where its at rn 😩

earnest phoenix
#

bro i need 8 core

#

:(

uncut slate
#

my $10 droplet is hosting all 7 of my projects rn

earnest phoenix
#

for cheap

uncut slate
#

with room to spare

#

@earnest phoenix what do you need 8 cores for

knotty steeple
#

my free vps is hosting all 6 of my projects rn

earnest phoenix
#

Music

#

bot

knotty steeple
#

not mine but

fluid basin
#

LOL music bot usually don't need that much cores

uncut slate
#

inb4 discord.js music bot

earnest phoenix
#

@knotty steeple tell us

knotty steeple
#

wat

uncut slate
#

skysilk is a sham tbh

fluid basin
#

inb4 8 lavalink instances on same core

#

ikr

earnest phoenix
#

@fluid basin well consider this a music bot needs to encode in real time and transaudio in real time too

fluid basin
#

its bw is totally crap

knotty steeple
#

nah it good

earnest phoenix
#

and when its more populare

#

it needs more

knotty steeple
#

when it needs more just switch

fluid basin
#

Yeah 1 cpu shall suffice for 1-2 concurrent listeners

earnest phoenix
#

@knotty steeple you said your hosting 7 projects on your vps for FREE

#

TELL US

knotty steeple
#

6*

earnest phoenix
#

doesnt matter much tell us

fluid basin
#

There are many providers out there which allows you to upgrade your plan easily with just a reboot

earnest phoenix
#

free vps what kind of joke is this

knotty steeple
#

joke?

sick cloud
#

my dedi free

fluid basin
#

lmao wat

knotty steeple
#

@earnest phoenix skysilk is my joke

#

rn its in beta all plans free 😩

earnest phoenix
#

stolen credit card info is my joke

knotty steeple
#

with custom

#

smh

earnest phoenix
#

:(

knotty steeple
#

so anything free is a scam ok

earnest phoenix
#

yes

#

pretty much

fluid basin
#

Like I said, tried skysilk but has really bad internet

earnest phoenix
#

oh

knotty steeple
#

well thats you

earnest phoenix
#

i need fast internet

fluid basin
#

1Mbps tops for me

earnest phoenix
#

XD

#

hhh

knotty steeple
#

rip you

earnest phoenix
#

rip us

knotty steeple
#

skysilk doesnt have that bad internet

earnest phoenix
#

no u

#

i like to keep my credit card info safe

knotty steeple
#

also any npm package takes about ~7 seconds to install

#

for me

earnest phoenix
#

wow

#

o wait

#

no

knotty steeple
#

btw @earnest phoenix

earnest phoenix
#

yea

knotty steeple
#

i have 7 projects actually

earnest phoenix
#

tell us

knotty steeple
#

if you include discord bots

#

😂

#

so i own 4 discord bots

earnest phoenix
#

@earnest phoenix you want your data to be shared with other companies

#

dont you

knotty steeple
#

2 apis

earnest phoenix
#

no

#

sharing is not good idea

#

how do you think free stuff works

#

here have this free plan

#

i know how they work

knotty steeple
#

thats like saying

#

steam is a scam

earnest phoenix
#

it is

knotty steeple
#

anyways this seems offtopic

earnest phoenix
#

@knotty steeple offtopic then moves to general lol

quartz kindle
#

google's free tier works very well

uncut slate
#

GCP free tier and DO $50 coupon on the GH student pack are imo the only two proper "free" hosts

earnest phoenix
#

How can I make

#

it display a users

#

ID

#

that I mention

#

isn't it js message.user.id ?

#

and I have user defined

knotty steeple
#

replace user with author

earnest phoenix
#

Why...

#

I am trying to

#

mention someone

#

and get their ID

knotty steeple
#

you asked if its message.user.id

earnest phoenix
#

Ok

knotty steeple
#

i said replace user in that instance with author

earnest phoenix
#

but then it would give me my userID

knotty steeple
#

what do you want

earnest phoenix
#

I would use GCP but I don't have a visa/MasterCard to verify

#

I literally said

knotty steeple
#

the person who runs the command's user id?

earnest phoenix
#

did you not read at all what i said

#

Noooo

#

do you not read

#

I said

#

I want to be able to mention the user

#

and get theri ID

#

their*

knotty steeple
#

oh um

#

to get a mentioned user in a message you have to do message.member.mentions.first() iirc

earnest phoenix
#
let user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
#

already have user defined

#

but if I need to take anything away

#

i will

quartz kindle
knotty steeple
earnest phoenix
#

Got it

#

yea

#

i took out message

quartz kindle
#

why? doesnt user already point to the user member collection?

#

user = member

sick cloud
#

member is a guildMember

#

you need to add .user to get normal user properties

knotty steeple
#

^

quartz kindle
#

oh

sick cloud
#
msg.author = user, user.id etc
msg.member = guildMember, user.user.id etc
quartz kindle
#

i forgot user and member are different

quasi marsh
#

They extend from it

#

At least in Python it does

lethal grove
#

Does anyone know if there are any documentetion of Akinators websocket?

#

It has changed but I have no idea of how does it work :/

sharp delta
earnest phoenix
#

I am trying to make a command

#

where it searches a subreddit

#

for a story

#

like the subreddit

#

nosleep

#

it is full of horror stories

#

Can anyone assist me in this type of command

#

?

quartz kindle
#

use the reddit api

earnest phoenix
#

they have an API

quartz kindle
#

yes

earnest phoenix
#

Ok

#

Thx

#

I will try and figure it out

earnest phoenix
#
var data = await client.func.userSearch(msg, {user: [user], name: this.help.name});
#

how coma I am getting error from this

#

come*

#

it is saying

#

cannot read property userSearch of undefined

sick cloud
#

client.func doesn't exist

earnest phoenix
#

Oh...

#

I thought it did ><

#

what would I use instead?

sick cloud
#

Whatever you use?

#

userSearch is clearly a custom function, so we can't help there.

earnest phoenix
#

Oh

earnest phoenix
#
db.updateText(`logChannel_${message.guild.id}`, newChannel).then(i => {
        message.channel.send(`Successfully updated log channel to **${message.mentions.channels.first()}**`)
    })
#

can someone help me

#

it is saying

#

db.updateText is not a function

#

wait

#

I will ask the support server for that module

#

well nvm

#

support server is messed up

sick cloud
#

So guys, using discord.js, how can you find out how many voice connections your bot has?

heady zinc
#

client.voiceConnections is a collection so you can just use client.voiceConnections.size

#

@sick cloud

sick cloud
#

okie

#

ty

serene merlin
#
@client.command(pass_context=True)
async def leave(ctx):
    server = ctx.message.server
    voice_client = client.voice_client_in(server)
    await voice_client.disconnect()

i have this code to make my bot leave a voice channel when i say !leave, but it doesnt work. Anyone know why?

tardy viper
#

Can you help me diden't found how to create channel when commad can you help me ?

serene tide
#

Hey I need help I'm making a banned words thing it's working but if I ban blabla it doesn't works if I write BlABla

jagged plume
#

make both strings lowercase and then compare them

tardy viper
#

its french sory

jagged plume
#

that will remove your case sensitivity

tardy viper
#
const errors = require("../utils_musique/errors.js");

module.exports.run = async (bot, message, args) => {
    message.delete();
    if(!message.member.hasPermission("BAN_MEMBERS")) return errors.noPerms(message, "BAN_MEMBERS");
    if(args[0] == "help"){
      message.reply("Usage: !ban <user> <reason>");
      return;
    }
    let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    if(!bUser) return errors.cantfindUser(message.channel);
    if(bUser.id === bot.user.id) return errors.botuser(message); 
    let bReason = args.join(" ").slice(22);
    if(!bReason) return errors.noReason(message.channel);
    if(bUser.hasPermission("MANAGE_MESSAGES")) return errors.equalPerms(message, bUser, "MANAGE_MESSAGES");

    let banEmbed = new Discord.RichEmbed()
    .setDescription("~Ban~")
    .setColor("#bc0000")
    .addField("Utilisateur banni", `${bUser} avec identifiant ${bUser.id}`)
    .addField("Banni par", `<@${message.author.id}> avec identifiant ${message.author.id}`)
    .addField("Banni dans", message.channel)
    .addField("Temp", message.createdAt)
    .addField("Reson", bReason);

    let incidentchannel = message.guild.channels.find(`name`, "logs");
    if(!incidentchannel) return message.channel.send("Impossible le channel logs éxiste pas.");

    message.guild.member(bUser).ban(bReason);
    incidentchannel.send(banEmbed);
}

module.exports.help = {
  name:"ban"
}
jagged plume
#

@serene tide

serene tide
#

Banned words not ban command @jagged plume

jagged plume
#

what

#

scroll up

#

i didnt post that command x-x

tardy viper
#

😂

serene tide
#

pardon

tardy viper
#

fr

jagged plume
#

i said "make both strings lowercase and then compare them, that will remove your case sensitivity"

#

kek

#

making bla and BLA the same thing

serene tide
#

How?

jagged plume
#

because it gets converted to lower case

#

so when you check if it's a banned word, it will be the same no matter how it's written

#

i.e BLA -> bla, bLa -> bla

serene tide
#

Ok

#

@jagged plume not working Thonk

jagged plume
#

what's your code?

serene tide
#

Wait

#

``
const bannedWords = [
"fuck"
]

#

And

#

if(bannedWords.some(word => message.content.includes(word))){
message.delete()
message.reply("stop swearing");
}

jagged plume
#

convert message.content to lowercase and convert word to lowercase

#

.toLowerCase()

serene tide
#

Like message.content.includes.toLowerCase() ?

jagged plume
#

no, toLowerCase() is to be used on a string

#

message.content is the string you're trying to change

#

after that you can use includes()

#

you basically just need to swap the order of includes and toLowerCase

serene tide
#

message.content.includes().toLowerCase() or message.content.toLowerCase().includes()?

jagged plume
#
message.content.toLowerCase().includes(word.toLowerCase())
     ^ content          ^ lowercase version           ^ includes lowercase version of bad word
serene tide
#

Ok

#

Thx

jagged plume
#

np.

serene tide
#

Yeaa it is working great

earnest phoenix
#

Is there anything wrong with const canvas = Canvas.createCanvas(700, 250);

#

TypeError: Canvas.createCanvas is not a function

#

Need help

bitter sundial
#

what's the version of your canvas module

earnest phoenix
#

1.6.11

#

@bitter sundial

bitter sundial
#

you're trying to use 2.0.0 syntax

tardy viper
#

sudo npm i canvas@latest

bitter sundial
tardy viper
#

Tonkku

#

plz

bitter sundial
#

wat

tardy viper
#

If my bot and accept it will have to do g!cx_off plz

#

to desactivate the level up and coins annonce

devout flicker
warm prairie
#

O.o

cinder patio
#

Hmm so many bots have trivia now.. is there a trivia api that I can use?

warm prairie
cinder patio
#

o thanks

warm prairie
cinder patio
#

how can I see the multiple choices

devout flicker
#

jservice

warm prairie
#

lol

devout flicker
#

well

#

just used google

#

u know

#

u type something in u get answers

warm prairie
#

when-in-doubt-google-it

cinder patio
#

thank I actually searched for such a thing for a while

#

none of the ones I found were multiple choices

warm prairie
#

not sure

devout flicker
#
{
        "text": "What is the scientific name of the cheetah?",
        "answers": [
            {
                "correct": false,
                "text": "Lynx rufus"
            },
            {
                "correct": false,
                "text": "Panthera onca"
            },
            {
                "correct": false,
                "text": "Felis catus"
            },
            {
                "correct": true,
                "text": "Acinonyx jubatus"
            }
        ]
    },```
#

found an api

#

literally googled multiple choice trivia api

knotty steeple
#

so i keep getting socket hang up on my discord bot anyone a reason why?

gusty rune
#
    at IncomingMessage.res.on (C:\Users\Administrator\Desktop\user\node_modules\dblapi.js\src\index.js:115:25)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)```
#

🤔

#

any ideas

knotty steeple
#

because it looks like the cause its dblapi.js

warm prairie
#

@devout flicker which api was that

limpid cosmos
#

I'm looking how to add roles when members click on a reacton how can I do that ?

knotty steeple
#

you would need a reaction collector, and then check if the user clicks on a certain reaction give them the role

limpid cosmos
#

okay

#

thanks

earnest phoenix
#

hi im makeing a music bot for discord in javascript and i was thinking if someone can help

knotty steeple
#

how to resize text with canvas-constructor?

earnest phoenix
#

hi im makeing a music bot for discord in javascript and i was thinking if someone can help just dm me in you would like to help

quartz kindle
#

.setTextFont() ?

knotty steeple
#

doesnt that set the font

quartz kindle
#

its in their npm page

#

.setTextFont('28px Impact')

#

font-size and font-family are always in the same field with canvas

knotty steeple
#

hmm ok

earnest phoenix
knotty steeple
#

do you have a table?

#

table and database file is different

#

since the file size is 0 im assuming you dont

earnest phoenix
#

yes i have the table

knotty steeple
#

u sure

#

look in the file

earnest phoenix
#

i tried to created a new database but didnt work

#

let me show you the code

#
sql.open("userConfig.sqlite");

dbl.on('posted', () => {
    console.log('Server count posted!');
  })
  
  dbl.on('error', e => {
   console.log(`Oops! ${e}`);
  });

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}.`) // logs in the bot
  client.user.setActivity(`=>help | ${client.guilds.size} Servers`);
  client.user.setStatus('dnd')
});

client.on("guildMemberAdd", member => {
    sql.run("CREATE TABLE IF NOT EXISTS userConfig (userID INTEGER, premium TEXT)").then(() => {
        sql.run("INSERT INTO userConfig (userID, premium) VALUES (?, ?)", [member.id, "False"]);
    }).catch(console.error);
})// cuz it jsut added the file userConfig


client.on('guildMemberUpdate', (oldMember, newMember) => {
    if(!newMember.guild.id === "458414150889242635") return;
    if(!oldMember.guild.id === "458414150889242635") return;
    let supporterRole = newMember.guild.roles.get("472408106576379924")
    if(!supporterRole) return console.log("There is no Supporter Role! Please set one up for donators!");
    if(!oldMember.roles.has(supporterRole.id) && newMember.roles.has(supporterRole.id)) {
    sql.get(`SELECT * FROM userConfig WHERE userID ="${newMember.id}"`).then(row => {
    if(!row) {
    sql.run("CREATE TABLE IF NOT EXISTS userConfig (userID INTEGER, premium TEXT)").then(() => {
    sql.run("INSERT INTO userConfig (userID, premium) VALUES (?, ?)", [member.id, "True"]);
    })
    }
    sql.run(`UPDATE userConfig SET premium = "True" WHERE userID = ${newMember.id}`).catch(console.error);
    return client.channels.get("471487580517695508").send(`:tada: **Thank you to ${newMember} for supporting Vortex on Patreon!** :tada:`).catch(console.error); 
    })
    } 
})
torpid aspen
#

Fala aí amigos alguém fala português aí ?

Gostaria de deixar uma dica tipo

o próprio Discord ter seu Navegador igualmente o depósitivo móvel pra visualizar imagens

Com opção vídeos, YouTube, Market facebook Google etc.

hardy fiber
#

What Google translate translates this to:
Does anyone speak Portuguese there?

I would like to leave a tip type

Discord itself has its Browser also the mobile depot for viewing images

With option videos, YouTube, Market Facebook Google etc.

#

Eu não falo português, estou usando o Google translate. Mas isso é legal. Eu sabia que tinha um navegador no celular, mas é sobre isso.

#

Google translate is wonderful

#

Idk if that is even close

torpid aspen
#

it was good if the discord had its Browser to open tabs

#

Why many when I opened browser plus the discord more warframe the PC crashes all over

earnest phoenix
#

How do I find the channel my bot can send a message in?

dull breach
#
  if(guild.channels.has(guild.id))
    return guild.channels.get(guild.id)
  
  if(guild.channels.exists("name", "general"))
    return guild.channels.find("name", "general").id;
  
  return guild.channels
   .filter(c => c.type === "text" &&
     c.permissionsFor(guild.client.user).has("SEND_MESSAGES"))
   .sort((a, b) => a.position - b.position ||
     Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber())
   .first().id;
}```
#

guild.channels .filter(c => c.type === "text" && c.permissionsFor(guild.client.user).has("SEND_MESSAGES")) .sort((a, b) => a.position - b.position || Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber()) .first().id;

ruby dust
#

so I have server logging, one of which is when a user changes their username and/or discrim

#

regardless of how many mutual servers the user has with the bot that log will only trigger in one server

#

can anyone explain me why it's that?

#
async def on_member_update(self, before, after):
    if after.guild.id in logging_channels.keys():
        channel = self.bot.get_channel(logging_channels[after.guild.id])
        if channel != None:
            if before.name != after.name or before.discriminator != after.discriminator:
                embed = discord.Embed(title = 'Username Updated', color = 0x7D3C98, timestamp = datetime.datetime.utcnow())
                embed.add_field(name = 'Before', value = before.name + '#' + before.discriminator)
                embed.add_field(name = 'After', value = after.name + '#' + after.discriminator)
                await channel.send(embed = embed)
tardy viper
#

Can you help me plz to make a progress bar with canvas

earnest phoenix
#

this stills gives the user access to the command heres the code any fix?

} else if (command === 'volume') {
        sql.get(`SELECT * FROM userConfig WHERE userID ="${msg.author.id}"`).then(row => {
        if(!row) {
        sql.run("CREATE TABLE IF NOT EXISTS userConfig (userID INTEGER, premium TEXT)").then(() => {
        return sql.run("INSERT INTO userConfig (userID, premium) VALUES (?, ?)", [msg.author.id, "False"]);
        })
        }
        if(row.premium === "False") return msg.channel.send(`Sorry, you do not have the Supporter Role.`).catch(console.error);
        }).catch(console.error);
        if (!msg.member.voiceChannel) return msg.channel.send('You are not in a voice channel!');
        if (!serverQueue) return msg.channel.send('There is nothing playing.');
        if (!args[1]) return msg.channel.send(`The current volume is: **${serverQueue.volume}%**`);
        serverQueue.volume = args[1];
        serverQueue.connection.dispatcher.setVolumeLogarithmic(args[1] / 5);
        return msg.channel.send(`I set the volume to: **${args[1]}**`);
earnest phoenix
#

can anyone help?

earnest phoenix
#

i need some help with an avatar change detector. i keep getting a 404:

12|mini-me | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
12|mini-me | Error: 404 Not Found
12|mini-me |     at _response.transport.request.then (/home/node/mini-me-stable/node_modules/snekfetch/src/index.js:193:21)
12|mini-me |     at <anonymous>
12|mini-me |     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
earnest phoenix
#

how to make my bot check if the user has upvoted it on DBL (im using discord.py)

tardy viper
#

how to use bot accept friend request

#

.addFriend(user)

slender thistle
#

Bots can't accept friend requests

#

@earnest phoenix Are you using manual HTTP requests or the library?

earnest phoenix
#

library

slender thistle
#

Looks like there is no function

earnest phoenix
#

oh

slender thistle
#

Though you can do it manually

#

await <DBLClient>.get_upvote_info(days=1) returns a dict with users who voted for your bot today

tribal hazel
#

My delete message thing isnt working

#

.

#

hi

#

xdd

#

d

dull breach
#

@tribal hazel code pls

#

do you use .then()?

tribal hazel
#
client.on('messageDelete', async (message) => {
    const logs = message.guild.channels.find('name', 'bot-hell');
    if (message.guild.me.hasPermission("MANAGE_MESSAGES") && !logs) {
        await message.guild.createChannel('bot-hell', 'text');
    }
    if (!logs) {
        return console.log('The logs channel does not exist and cannot be created')
    }
    const entry = await message.guild.fetchAuditLogs({
        type: 'MESSAGE_DELETE'
    }).then(audit => audit.entries.first())
    let user;
    if (entry.extra.channel.id === message.channel.id && (entry.target.id === message.author.id) && (entry.createdTimestamp > (Date.now() - 5000)) && (entry.extra.count >= 1)) {
        user = entry.executor.username
    } else {
        user = message.author
    }
    const logembed = new Discord.RichEmbed()
        //.setTitle('Message Deleted')
        .setAuthor(user.tag, message.author.displayAvatarURL)
        .addField(`**Message sent by ${message.author.username}> deleted in ${message.channel.name}**\n\n`, message.content)
        .setColor(message.guild.member(client.user).displayHexColor)
        .setFooter(`<#${message.channel.id}>`)
        .setTimestamp()
    //console.log(entry)
    logs.send(logembed);

});```
#

@dull breach

dull breach
#

im reading xD

#

did you try console.log after every line

tribal hazel
#

K.

#

?

dull breach
#

just try console.log("1") and over after every line of code

#

then you ll find where code breaks

knotty steeple
#

that seems inefficient

tribal hazel
#

Okay...

knotty steeple
#

just log everything in one console.log()

#

simple

dull breach
#

lol

tribal hazel
#

@hollow abyss

dull breach
#

and that console.log never happen cuz error somewhere in the middle

tribal hazel
#

k

hollow abyss
#

?

#

why was I pinged?

#

@tribal hazel what do you need

tribal hazel
#

You know

#

Your bot.

#

Mewna?

hollow abyss
#

what of it

tribal hazel
#

The website.

hollow abyss
#

what of it

dull breach
hollow abyss
#

p much

tribal hazel
#

How do people make the login with Discord thing?

hollow abyss
#

Best get reading

tribal hazel
#

K.....

dull breach
#

but yeah amy ^ is better

topaz fjord
#

You should use passport.js

hollow abyss
#

I mean

#

You probably don't wanna roll your own OAuth impl

turbid tiger
#

I have a command to change a user's nickname: ?nickname [nickname] {@player}, but every time it is run I get the following error:
(node:8109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 18): DiscordAPIError: Missing Permissions
My bot has the 'bot' role, which is the highest in the hierarchy and has all permissions. It can't even change the nicknames of players who aren't the owner of the server!
Here is my code:

module.exports = {
    name: 'nickname',
    cooldown: 60,
    description: 'change nickname',
    execute(message, args) {
      const changeNickTo = args[0];
      const member = message.mentions.members.first();
      if(changeNickTo != null) {
        if(member != null) {
          message.channel.send('Changed ' + message.mentions.users.first() + "'s nickname to **" + changeNickTo + "**.");
          message.member.setNickname(changeNickTo);
        } else {
          message.channel.send('You just changed your nickname to **' + changeNickTo + '**.');
          message.member.setNickname(changeNickTo);
        }
      } else {
        message.channel.send("Please provide a nickname that you'd like to change to!");
      }
    },
};
topaz fjord
#

its pretty easy to setup

hollow abyss
#

I don't use node

#

¯_(ツ)_/¯

topaz fjord
#

and they have lots of packages for most major services oauth

turbid tiger
#

Ah well. If anyone uses Node lmk thx

blazing gorge
#

Idk

#

Any

#

Of
Thoses

#

Soz

turbid tiger
#

Though its more of a permission issue

topaz fjord
#

seems like the bot doesnt have permission

turbid tiger
#

Yeah

topaz fjord
#

so check if it does?

turbid tiger
knotty steeple
#

so it doesnt have perms

turbid tiger
earnest phoenix
#

what are you trying to do

#

bud

turbid tiger
#

lol
Trying to change a nickname

knotty steeple
#

wait

earnest phoenix
#

mhm

#

is the bot in the bot role?

turbid tiger
#

.?nick [nickname] {player}

#

Yes @earnest phoenix

earnest phoenix
#

well

#

is the player in or above bot role?

knotty steeple
#

looking at that screenshot bot role is above everyone else

turbid tiger
#

Yeah

topaz fjord
#

doesnt matter in this case since the bot role is top position

earnest phoenix
#

im not sure it will work if you're doing it to yourself

turbid tiger
#

It doesn't work for other players either.

earnest phoenix
#

hmm

#

you got some code?

turbid tiger
#

.?nick [nickname] {player}

#

Yeah one sec

topaz fjord
#

shouldnt this be

#

member.setNickname

turbid tiger
#

Let me try that

knotty steeple
#

it would be trying to change your nickname

turbid tiger
#

Yes, that works.

#

Thanks y'all

knotty steeple
#

that was the problem

topaz fjord
#

message.member would be trying to change ur nick

turbid tiger
#

Hey! Do you also know how to remove a nickname

knotty steeple
#

thats what i said smh

topaz fjord
#

@turbid tiger .setNickname with nothing in it

#

so

#

member.setNickname()

turbid tiger
#

OK

hushed berry
#

um

#

who tagged me rage

turbid tiger
#

Sorry

#

Accident 😆

#

@topaz fjord that didnt work

#

its actually member.setNickname('');

topaz fjord
#

same difference

spring ember
#

Yes

knotty steeple
#

how to fix problem with canvas-constructor rendering emojis as boxes

spring ember
#

You probably didn't have that variable and you tried

dull breach
#

@knotty steeple haha use canvas

#

mee6 have same error

#

with my name for ex.

knotty steeple
#

i dont have to use canvas if i dont want to

earnest phoenix
#

whats the canvas for

#

im not that indepth with bots

knotty steeple
#

and technically im already using canvas

dull breach
knotty steeple
#

as canvas-constructor requires it

earnest phoenix
#

is that canvas?

knotty steeple
#

no

earnest phoenix
#

im confused

knotty steeple
#

thats probably PIL

#

because mee6 is in python

dull breach
#

ok

knotty steeple
#

anyway can someone help me

earnest phoenix
#

idk how

#

so

quartz kindle
#

@knotty steeple you have to preload any fonts you're using

#

node-canvas 2.x.x has a font preload function

#

idk about canvas 1.6

earnest phoenix
#

does Luca show the uptime of other bots?

#

for music command how would you loop the song/playlist?

unborn crow
#

-bots

gilded plankBOT
#
Inkception#5396
Bots

@pulsar monolith
@restive wolf

unborn crow
#

-bots @marble tree

gilded plankBOT
#
ExecuteInk#0001
Bots

@hardy burrow
@pulsar monolith

unborn crow
quasi marsh
#

Don't use Luca in here

unborn crow
#

Okay, understood.

topaz fjord
#

@earnest phoenix no

#

@earnest phoenix after the song in the queue /playlist is done read it to the queue

earnest phoenix
#

I need help is anyone here

#

@earnest phoenix what you need helpwith?

#

Im using giveaway bot

#

For some reason

#

if you asking about another bot look on google

#

The giveaway didn’t end

#

alot of sources on google

#

The bot redirected me here

#

:/

#

send pic of it saying it redirected you here

#

Okay

#

Can i giv link here

#

send a pic

#

not a link XD

#

and links are not available here

#

lol

#

join discord mean this server

#

it didnt redirect you here

#

XD

#

Yesh it redirected me to this server?

#

Anyway even if its not your bot can you help me our

#

The page just has 4 commands but no command to end thr giveaway

#

ill give you the solution

#

😦

#

Tried

#

That’s the first thing people do

quasi marsh
#

This is not the support server for giveaway bot. You can usually find the support server on their bot page

earnest phoenix
#

^ @earnest phoenix

latent heron
#

^ @hearty storm

slim heart
#

Okay i've been just barely scraping by on mysql with my bot and even somehow it works and i use the same code and im honestly super confused connection.query("SELECT * FROM banned_users(ticket) WHERE user-id = " + message.author.id, async function (err, rows) { what is wrong with this, rows is undefined and i just have no clue how to pull data from it

shy rose
#

@slim heart

connection.query("SELECT * FROM banned_users(ticket) WHERE user-id = ?", message.author.id , async function (err, rows) {
slim heart
#

i just tried that aswell same error

shy rose
#

also are those rows and table names valid GWcfcThonk

#

have you print the value of error?

#

if it exists

slim heart
shy rose
#

is err defined at all?

#

aka is there an error

#

also by the looks thats workbench so if you manualy filled that info have you clicked apply?

slim heart
#

i feel like ultimate retart

#

i was using the wrong address

shy rose
#

?

slim heart
#

i feel

#

so

shy rose
#

3306 is mysql normal port

slim heart
#

dumb

#

its not local

#

i feel dumbo

shy rose
#

so guessing you only jsut now checked if err was defined 😛

slim heart
#

yes

#

okay now im getting this

shy rose
#

im faily certain that due to the - thingy

#

cause normally you dont use - in a row name

#
  • it is that
#

just noticed the row nam it was trying

#

make the row call user_id

slim heart
#

ayy

#

there ya go, thank you

shy rose
#

ok?

#

is this going some where?

earnest phoenix
#

the open bot is only in a test group for now

shy rose
#

btw your token is public

earnest phoenix
#

yes i know

shy rose
#

i suggest you change it

earnest phoenix
#

how

#

idk how

shy rose
#

was looking in mod logs for the link

earnest phoenix
#

done

#

but anyone can edit this bot and make it how thay want it

shy rose
#

just dont leave your token in there

earnest phoenix
#

i removed the token

slim heart
#

Okay so what do i do when stuff isnt defined in the mysql array it just completely stops

#

I want it so its like a banned user kinda thing

#

so i can add things and if rows[0].banned == 1 then it returns

#

but then it just says its not defined no matter what

#

how do i make it so if its not there it just continues

#

@shy rose

earnest phoenix
#

i have just put some stuff you can edit this a any time

sick cloud
#

@earnest phoenix can you not post the same link again and again

shy rose
#

also its an empty project maybe have a look around github and get some ideas dont copy/steal

sick cloud
#

that too

slim heart
#

Chewey what do i do?

shy rose
#

if (rows && rows[0] && rows[0].banned){

#

that should stop the fatal on no results

slim heart
#

alright perfect :D thank you

shy rose
#

and if you slap an else on then just means no results found

earnest phoenix
#

ok talk later

shy rose
#

jbp if you need any more help just ping just gonna minimise discord

earnest phoenix
#

My bot is broken! Someone help pls

gilded blaze
#

What is the issue?

earnest phoenix
#

When I do !gcreate and/or !gstart 3d 2 Top rank

#

It doesn't work

#

that helps 👍

gilded blaze
#

Well what is the error?

earnest phoenix
#

Idk I'm not good at this

#

All I know is it won't work and I tried kicking it

gilded blaze
#

Can't help you then.

sick cloud
#

@earnest phoenix, sounds like a GiveawayBot issue - best to ask in their support server or use my giveaway bot.

earnest phoenix
#

What's yours

sick cloud
#

@acoustic gull

#

@earnest phoenix mmLol

obtuse wind
#

I need help,

client.on('message', msg => {
  if (msg.includes('KYS');
  msg.delete()
  msg.author.send('Do not tell people to kill themselves, it\'s rude.')
});```
Trying to ban "KYS" but my bot doesn't block it, can someone help me? [ Ping me while replying, kthx. ]
earnest phoenix
#

@obtuse wind
Can you explain the second line?

obtuse wind
#

if the the message includes "KYS" then the bot should delete it and send the author a DM

earnest phoenix
#

ok, but msg is a message object, not a string so .includes will not work.

obtuse wind
#

hmm

#

I would need to change it to something then

earnest phoenix
#

you using discord.js?

obtuse wind
#

Node.js / Discord.js yah

earnest phoenix
#

OK, so go here https://discord.js.org/#/docs/main/stable/general/welcome
then click "message" on the side

obtuse wind
#

mkay

earnest phoenix
#

ok, now look at the "properties"

#

you need the one that contains the content of the message

#

so msg.content would be the string that you need to check with .includes

obtuse wind
#

so msg.content.includes or just msg.content?

earnest phoenix
obtuse wind
#

oh

#

mkay thanks

earnest phoenix
#

👍

#

Also, your syntax for the if statement is wrong, so you might wanna look up an example for that

obtuse wind
#

ok

devout raven
sick cloud
#

use CSS

devout raven
#

how do i get it

sick cloud
#

put <style> ... </style> in your bots long description

devout raven
#

Oke

earnest phoenix
#

@sick cloud are you able to remove bots from the site?
https://discordbots.org/bot/303710071387324416
An old instance of my bot is still there but it's been offline for a while, any chance you could remove it. I can provide more proof of ownership is feeded

sick cloud
#

You can remove it yourself by going to the bot page and clicking Delete @earnest phoenix.

earnest phoenix
#

it's under an old account

#

I lost access to it after losing my 2fa recovery code

#

@sick cloud

sick cloud
#

Ah, alright. Send me the proof of ownership you have in direct messages then.

earnest phoenix
#

sure

#

What's a good Discord Bot name with music functions and mod functions?

dull breach
#

tony

#

btw nice chance to advertise my bot xD

sick cloud
#

wha

dull breach
#

nope * xD Tony Bamanaboni

sick cloud
#

oh

#

bad

limpid cosmos
#

help please

heady zinc
#

what

#

explain that again

earnest phoenix
#

../../config.json

#

@limpid cosmos i hope that helps ^^

neat falcon
#

glitch notlikeboye

limpid cosmos
#

@earnest phoenix for what do I must change ... on glitch ?

earnest phoenix
#

const config = require (../../config.json)

knotty steeple
#

remember it has to be a string

hot sleet
knotty steeple
#

hyperlink

#

[Google](https://google.com)

hot sleet
#

so should i search for hyperlink ?

knotty steeple
#

if it doesnt work its the other way around

hot sleet
#

i will try it by myself first

sonic mirage
#

:triggered:

hot sleet
#

🤔 it worker

#

addFiled("Test field", "name")

golden sparrow
#

how does a daily command work, as in a command where people upvote your bot, and get a reward for it. how to make it so my bot knows when a player upvotes?

restive silo
#

webhook or use the check endpoint

quasi marsh
#

Well you need to learn if if you want to do it

#

You can use inspect element to get classes and ID's and you can then change the properties of them, like color

gleaming glen
#

🤔

ruby dust
#

I know in discord.py there is a way to check if a user follows permission hierarchy, but I can't seem to find it

#

like I don't want to manually build permission check like for example check role hierarchies if a user can ban that user or not

quasi marsh
#

I simply do

#
        if ctx.author.top_role < member.top_role:
            return await ctx.send(lang['ban_3'])
ruby dust
#

but relying on top roles is not the best option

#

I remember async has a built-in option that checks that properly

glad bolt
#

Isnt there something like has_ban_permission or something

ruby dust
#

a permission check decorator?

glad bolt
#

I know jda just has booleans if(user.permissions.BANPERMISSION) idk if there is something like that in python tbh

ruby dust
#

checking if a member has a permission is one thing, and checking if a user can use that permission on a target member is a different thing

glad bolt
#

In java that throws a exeption so idk what thats like in python sorry

#

Ik pretty new to python

hot sleet
#

i get (node:4) UnhandledPromiseRejectionWarning: Error: 403 Forbidden Error every two attempts to get random cat img

#

it work time

#

and log this error time

#

mention if you have help

neat falcon
#

what api?

hot sleet
#

discord.js

neat falcon
#

no i mean cat api

hot sleet
#

??

#

the code ?

#

wlla eh

#

agh

knotty steeple
#

discord.js isnt a api 👀

hot sleet
#

i see

neat falcon
#

where you have the request there is url

#

what is that url

hot sleet
#

ooooooooooooooooh

#

just a sec

#
let catImg = (await snekfetch.get("http://aws.random.cat/meow")).body.file;```
neat falcon
#

ah

#

i've been having problems with that api as well

hot sleet
#

did u fix it

neat falcon
#

i switched to nekos.life

hot sleet
#

so that will work ???

neat falcon
#

file needs to be changed to url

#

but yes

#

works for me

hot sleet
#

(node:2296) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'Agent' of undefined

#

(:

#

mr derpy ...

#

@neat falcon

neat falcon
#

?

#

agent?

hot sleet
#

yeah

neat falcon
#

where you have that

hot sleet
#

in the console 👀

neat falcon
#

no

#

i mean

#

in the code

hot sleet
#

theres no any agnet word in the code

neat falcon
#

can you send the full command code please?

hot sleet
#

here ?

neat falcon
#

yes

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

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

    let catImg = (await snekfetch.get("hhttps://nekos.life/api/v2/img/meow")).body.file;
    if (!catImg) return message.channel.send("Erorr: can't find any cat.\nDM the bot if this error continued");


    const embed = new Discord.RichEmbed()
        .setTitle("Meeeow")
        .setColor('RANDOM')
        .setImage(catImg)
    message.channel.send({embed});

}

module.exports.help = {
    name: "cat"
}
neat falcon
#

you got two h

#

in the url

hot sleet
#

aaaaaa

#

....

neat falcon
#

and a ( which isn't needed afaik

#

after let catImg

hot sleet
#

ik

neat falcon
hot sleet
#

but i didn't see the hh

#

🤔 where did it come from

limpid cosmos
#

```bot.on(guildMemberAdd, member => {
let listedusers = (432876205641826309, User2, User3, etc);
if (member.id = listedusers) {

    const lChannel = member.guild.channels.find(`name`, `anti-raid`)
    lChannel.send(`${member} a été banni car il figure sur la liste des raideurs connus.`)
  member.guild.ban;
}

})```help please it does'nt ban the user

earnest phoenix
#

@limpid cosmos Can you explain line 2 and 3?

limpid cosmos
#

if the id from the new member guild = 432876205641826309

#

then if the id from the user = id from the list -> ban this user

earnest phoenix
#

do you know what an array is?

limpid cosmos
#

yep

earnest phoenix
#

ok well your syntax on line 2 is not an array

limpid cosmos
#

how do i must change it ?

knotty steeple
#

[] instead of ()

limpid cosmos
#

witch line ?

earnest phoenix
limpid cosmos
#

okay

earnest phoenix
#

Ok, also on line 3 you are using 1 = instead of 2, so you are not comparing

knotty steeple
#

member.guild.channels.find('name', 'anti-raid')?

limpid cosmos
#

bot.on("guildMemberAdd", async member =>{

earnest phoenix
#

and you are also comparing an id to an array, so that will not return true

limpid cosmos
#

with array

#

oh

#

how can i ban a user witch have his id on my list then ?

knotty steeple
#

also do you always use ``

limpid cosmos
#

yep or sometimes ""

earnest phoenix
knotty steeple
#

its only really needed for template literals

#

but GWcmeisterPeepoShrug

#

i recommend you read up on javascript arrays also to see more

limpid cosmos
#

okay gonna try this

#

@earnest phoenix how did you the gif ?

earnest phoenix
#

i use sharex, screenshot/screen recording tool

limpid cosmos
#

okay

earnest phoenix
#

help

#

Error: Cannot find module 'canvas-prebuilt'

#

whatever could that mean 🤔

#

Maybe the module called "canvas-prebuilt" cannot be found. did I install it?

#

I did

#

install

knotty steeple
#

in right directory?

earnest phoenix
#

successfully?

#

yes

gleaming glen
#

How can I change the picture's shape in my bot's page?

knotty steeple
#

css

earnest phoenix
bright spear
#

it cant find the test.js file in your project

#

you probably have require('./test.js') in your code

earnest phoenix
#

Nope

#

No where

#

I have searched for it

#

can't find it

#

@bright spear

ruby dust
#

with discord.py, if I want to check if a role has ban permission, do I go with if ban_members in role.permissions or if role.permissions.ban_members?

earnest phoenix
#

My bot is answering to any prefix i use

#

but I only want it to answer to !

#

how can I fix this?

#
  let prefix = botconfig.prefix
  let messageArray = message.content.split(" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);

  let commandfile = bot.commands.get(cmd.slice(prefix.length));
  if(commandfile) commandfile.run(bot, message, args);
#

here is my code

knotty steeple
#

check if the message starts with the prefix or not

#

if not dont do anything

earnest phoenix
#

How would i do that though

#

cause up until now

#

the bot only answered to !

#

idk why it has changed

unique star
#

Because you never check if the message started with !

#

your code snipped up there would trigger on any character that has the same length as !

earnest phoenix
#

So I would have to go through every command file

unique star
#

so effectively !ping and aping are handled the same

earnest phoenix
#

and make it check if it started with the prefix

unique star
#

No you could check that before even running a command

bright spear
#

just do it on your basic message handler

#
  let prefix = botconfig.prefix
  let messageArray = message.content.split(" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);

  if(message.content.indexOf(prefix) !== 0) return

  let commandfile = bot.commands.get(cmd.slice(prefix.length));
  if(commandfile) commandfile.run(bot, message, args);```
#

... why

earnest phoenix
#

Sorry

#

I did not mean to do that ><

#

I meant to do a heart

#

the middel finger and heart

#

are next to each other on the most resent

#

Thx ❤

#

How do you make a help command with the next page option with adding a reaction?

#

Pagination

#

?

earnest phoenix
#

you listen to reactions and edit the message xD

#

you need to code it, it isn't as simple as calling a function

eager spoke
#

but it could be 👀

earnest phoenix
#

Error: listen EADDRINUSE :::5000

any reason i get this error after doing an npm upgrade?

slender thistle
#

Port being already used? GWfroggyBlobWokeThink

earnest phoenix
#

nope i fixed it with a system restart that was weird

#
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
    at Client.emit (events.js:171:17)
    at WebSocketConnection.onError (C:\Users\User\Desktop\LewdGoddess\node_modul
es\discord.js\src\client\websocket\WebSocketConnection.js:374:17)
    at WebSocket.onError (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib\
event-target.js:128:16)
    at WebSocket.emit (events.js:182:13)
    at _receiver.cleanup (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib\
websocket.js:211:14)
    at Receiver.cleanup (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib\r
eceiver.js:557:13)
    at WebSocket.finalize (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib
\websocket.js:206:20)
    at TLSSocket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
'bot.guild.size' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .```
#

can someone pleaswe help

topaz fjord
#

discord.js?

earnest phoenix
#

this is effecting my whole bot

#

ye

#

discord.js

#

every time my bot is shutting down

#

because of it

topaz fjord
#
<Client>.on("error", err => {
    console.log(err)
})
#

add that and wait for it to come back

earnest phoenix
#

in my index?

topaz fjord
#

yes

knotty steeple
#

but the error is literally [object Object]

topaz fjord
#

nah

knotty steeple
#

thats what i got when i had my error handler

topaz fjord
#

it says unhandled

#

handle it and it will show u what it is

#

at least thats what they tell me in the discord.js server

knotty steeple
#

idk it didnt

uncut slate
#

it's [object Object] if you stringify it

#

instead of doing something like

console.error(`Caught error: ${error}`);

do

console.error('Caught error', error);
#

the latter won't stringify the object

earnest phoenix
#

So wait

#
console.error('Caught error', error);
#

I out that in my index?

#

put*

knotty steeple
#

oh