#development

1 messages · Page 615 of 1

zealous veldt
#

😰 😰 😰 wew this error has resurfaced again https://i.imgur.com/RXux4lT.png, anyone have any advice on fixing it? It's not triggered by anything specific that I can tell, eg. commands don't cause it to happen

amber fractal
#

Something happened

zealous veldt
#

you're not wrong

amber fractal
#

ClientManager.js doesnt even exist in master

zealous veldt
#

lmfao what

amber fractal
#

your error

#

const timeout = this.client.setTimeout(() => reject(new Error(Constants.Errors.TOOK_TOO_LONG)), 1000 * 300);

#

comes from that

zealous veldt
#

yeah

amber fractal
#

Ye

zealous veldt
#

I know

amber fractal
#

which isnt even in master

zealous veldt
#

It's annoying though because it doesn't tell what actually took too long

amber fractal
#

Update to master 👌

zealous veldt
#

yikes how much will that break?

empty owl
#

Yo which method to create a channel?

zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

empty owl
#

oh ok discord.js lol

#

trying to make a -new command thing like ticket bot

#

but it’s a private bot

opaque eagle
empty owl
#

Oh

#

I looked at textChannel and GuildChannel lol

#

Instead of guild

#

Thanks

zealous veldt
#

yikes @amber fractal

#

still getting it lmao

#

what's the command for updating to master again? im having a 0 iq moment

shy cedar
#

I think the update is unnecessary in prefix update

empty owl
#

hoihoi

#

How do u set perms for .createChannel? discord.js

amber fractal
#

@zealous veldt I think it's npm install discordjs/discord.js

#

I'm guessing that it's still there, just moved, but I havent had that issue on master

empty owl
#

im trying to make it so only one person and staff can see the channel

amber fractal
#

with a bot?

empty owl
#

yes

amber fractal
#

on what lib?

empty owl
#

discord.js

amber fractal
#

oh

empty owl
#

tarpergon

#
 let subject = args.join(" ") ? args.join(' ') : 'none';
  let ticketlist = client.ticket.get(message.author.id);
  
  if (!ticketlist) {
    let construct = {
    
      id: message.author.id,
      username: message.author.username,
      userdisc: message.author.discriminator,
      subject: subject
    
    
    
    };
  
  client.ticket.set(message.author.id, construct)
  return message.guild.createChannel(`${message.author.username}-${message.author.discriminator}`,'Tickets','text', [{
     type: 'user',
     id: message.author.id,
    }])
  return message.channel.send(`You have created a ticket in #${message.author.username}-${message.author.discriminator}`)
  } else {
  message.channel.send('You already have a ticket open!')
  
  
  
  }```
amber fractal
#

I didnt read

empty owl
#

thats what I have rn

#

coud u help me

amber fractal
#

Give me a sec

neat falcon
#

the inconsistency of the formatting and semicolon placement concerns me

empty owl
#

lmao

amber fractal
#

I usually create the channel first then overwrite, I just think it's easier

empty owl
#

o

#

ok

#

how would I do that

amber fractal
#

Make the channel, save it to a variable then use overwritePermissions

empty owl
#

so how woudl I save to variable

#

ive forgotten alot of js

amber fractal
#

that's basic js tho

empty owl
#

bro

amber fractal
#

createChannel returns a Promise channel

empty owl
#

do I make a empty var

amber fractal
#

you save it like any other variable

empty owl
#

then set it

#

k

amber fractal
#

if you want to

#

if you use the guild id and deny Discord.Permissions.ALL it will not be allowed to anyone but admins

#

then just give perms to the author with overwritePermissions

#

I gtg tho

empty owl
#

ok

#

bye

#

wait

#

anyone else

zealous veldt
#

@amber fractal Where is the rich embed class now?

#

oh

empty owl
#

hi

#

anyone here

late hill
#

no

earnest phoenix
#

]]vps

#

]] vps

mossy vine
#

mods only

empty owl
#

hi

#
    channel.overwritePermissions(@everyone, {
    VIEW_CHANNEL: false
    
    
    })
   channel.overwritePermissions(message.author,{
           VIEW_CHANNEL: false,
             SEND_MESSAGES: true
                                
                                })
    let staff = message.guild.roles.find(val => val.name === 'Staff');
    channel.overwritePermissions(staff, {
    
       VIEW_CHANNEL: true,
             SEND_MESSAGES: true
    
    })```
#

I cant figure out how to disable read for everyone

late hill
#

You probably can't just put @everyone

#

Try using the id of the everyone role?

#

Which would be the id of the guild

#

also huh

#

You're giving the author send but not view

mossy vine
#

okay so this might a really dumb question but its my first time dealing with sharing and im just referring to the docs

const Discord = require('discord.js')

const manager = new Discord.ShardingManager(`${__dirname}/src/main.js`)

manager.on('launch', shard => {
    console.log(`${shard.id} is online!`)
})```
#

running it just exits with no output

#

running src/main.js by itself works

amber fractal
#

You on stable or master?

mossy vine
#

should be stable

#

yeah, stable

#

oh, i should also add manager.spawn()

#

and now its complaining about tokens mmLol

#

and now im getting 401 mmLol

#

okay there we go

#

its working now

earnest phoenix
#

When will the bot be active

unique nimbus
#

what bot

#

we are not a specific bot server you should join their support server for that

earnest phoenix
#

sorry

#

I am Turkey

#

Dyno Offline

unique nimbus
#

@earnest phoenix

earnest phoenix
#

thank you

unique nimbus
#

np

opaque eagle
#
/Users/sinistrecyborg/Projects/Fourier/dist/events/ready.js:4
class default_1 extends __1.Event {
                            ^
TypeError: Class extends value undefined is not a constructor or null```
#

Idek what code to provide for that error

amber fractal
#

whatever is in ready.js at line 4

opaque eagle
#
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
class default_1 extends __1.Event {
    constructor(...args) {
        super(...args);
    }
    exec() {
        console.log(`Logged in, serving ${this.client.guilds.size} guild(s).`);
    }
}
exports.default = default_1;
//# sourceMappingURL=ready.js.map```
amber fractal
#

I have no idea

#

I would say is __1 actually there

opaque eagle
#

This is what it points to js "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const FourierClient_1 = __importDefault(require("./structures/FourierClient")); exports.FourierClient = FourierClient_1.default; new FourierClient_1.default().connect(); var Command_1 = require("./structures/Command"); exports.Command = Command_1.Command; var Event_1 = require("./structures/Event"); exports.Event = Event_1.Event; //# sourceMappingURL=index.js.map

amber fractal
#

Im not sure, but I have to go, if it isnt solved by the time I come back I'll try to help

#

sorry

opaque eagle
#

k

#

In the last place where I asked this they said my node version was breaking or smth

shy rose
#

@zealous veldt the popular vps thing pinned the 2.49 eur by host my servers is only 20GB disk not 50?

zealous veldt
shy rose
zealous veldt
#

hmm

shy rose
#

ohhh thats the openvz

#

openvz is trash

#

plz suggest the kvm one

#

spent way to much time battling providers to get decent open vz

#

the issue is they over sell it af

#

vs kvm they rarely do

zealous veldt
#

hmm

#

will update later

shy rose
#

kvm is also same system vlutr uses which never hear issues about

#

managed to crash a openvz provider last month they were down for the whole weekend cause i forked my vm but due to how it runs it brought down the entire service

#

was 11/10 support

#

the machine also randomly lost its ethonet adapter and your unable to make swap on openvz

#

had lot of pain if cant tell

earnest phoenix
#

Anyone know if theres a tutorial on a command that lets me save information on a word.. so lets say i do like *save sabres (blahbllah blah) then id do like *find sabres and the bot would reply (blablablabalab)

#

there isnt a tutorial for every single use case ever

#

do research on databases; its what youre supposed to use reading from your message

#

alright cool thanx

#

recommend any database?

earnest phoenix
#

I'm trying to connect to mongo-db

night imp
#

are you running a dedicated mongo server?

#

That happens due to the password / user being incorrect iirc

#

@earnest phoenix

earnest phoenix
#

its localhost

night imp
#

No password or username?

earnest phoenix
#

None

night imp
#

There may be something else sharing the same port then

earnest phoenix
#

It only works

#

if i type

#

a code

#

In mongodb file

#

But since its hosting

#

Theres no way to do tha

night imp
#

Wdym by 'a code'?

earnest phoenix
#

mongod.exe --dbpath c:\data\db

#

If i run this code

#

in the mongodb file

#

it works

#

But only works if i let the cmd window open

night imp
#

Oh

earnest phoenix
#

Thats when i was self hosting

#

But i hosted in heroku now

#

So i don't know how to resolve this

night imp
#

So since your running it using a Windows CMD it will close the actual server when you close it

amber fractal
#

Can heroku even run mongo?

night imp
#

^

amber fractal
#

I dont think it can

earnest phoenix
#

Heroku can

night imp
#

if you want a free mongo DB host I would recommend mlabs personally

earnest phoenix
#

hm

#

Is there any tutorial for setup ?

night imp
#

I'm not familiar with how Heroku works, is it simply a Linux VM?

#

ie Ubuntu, Fedora, Debian

#

If so, you can just search "Install mongodb linux". If you don't want to self host and don't need more than 200mb of data stored I recommend mlabs free

earnest phoenix
#

Gonna try mLabs

amber fractal
#

nah heroku doesnt really give you a console

#

its like a command line

#

it never worked for me

#

you have a logs and a command line*

earnest phoenix
#

Welp

#

A lot of people

#

Have projects with mongodb

#

Hosted on heroku

west spoke
#

Jesus

#

Here too

earnest phoenix
#

hey, I'm new to the Discord Bot scene and have recently made my first bot, however I'm having issues keeping it online. Im hosting the bot through Heroku, and set it up via the CLI, and it seems to go offline shortly after I turn off my laptop. If you could give me some assistance, solutions, etc., that would be heavily appreciated. If I don't respond soon I've probably gone to sleep

scarlet phoenix
#

Dont host on heroku is the sure fix to this problem

#

Paying for a vps (pretty cheap) is infinitely better than any free service.

robust acorn
#

umm

zealous veldt
#

]]vps @earnest phoenix

covert turtleBOT
#

A VPS or virtual private server is a virtualized server instance run in the cloud. It acts like a normal server, allowing you to remotely login and manage it just like a physical server or computer. If you're looking for a way to keep your bot online 24/7 a VPS is a great option. Having trouble choosing a VPS provider or don't know where to start? Click here for a list of common and affordable VPS providers.

wild quest
#

I have a problem it's not showing the pictures for my meme command it's just saying Generating... and it does not load the image

const Discord = require("discord.js")
const botconfig = require("../botconfig.json");
const colors = require("../colors.json");
const superagent = require("superagent")

module.exports.run = async (bot, message, args) => {
    let msg = await message.channel.send("Generating...")

    let {body} = await superagent
    .get(`https://api-to.get-a.life/meme`)
    //console.log(body.file)
    if(!{body}) return message.channel.send("Try again...")

        let mEmbed = new Discord.RichEmbed()
        .setColor(colors.white)
        .setAuthor(`Meme`, message.guild.iconURL)
        .setImage(body.url)
        .setTimestamp()
        .setFooter(`Requested by ${message.author.username}`, message.author.displayAvatarURL)

        message.channel.send({embed: mEmbed})

        msg.delete();
}


module.exports.config = {
    name: "meme",
    aliases: []
}
#

can anyone help

sinful lotus
#

confirm what is body contents

earnest phoenix
#

Cannot read property 'id' of undefined what does this mean i forgot

slender thistle
earnest phoenix
slender thistle
#

Apparently author is undefined /shrug

lament meteor
#

what are the chances of people using a url u made for fun rather than the og/real url

quartz kindle
#

people use fake urls all the time, so...

earnest phoenix
#
const quiz = [
  { q: "Quel est la couleur du ciel ?", a: ["pas de couleur", "invisible"] },
  { q: "Nommez une boisson pétillante.", a: ["pepsi", "coke", "rc", "7up", "sprite", "mountain dew"] },
  { q: "Nommez une langue de programmation .", a: ["actionscript", "coffeescript", "c", "c++", "basic", "python", "perl", "javascript", "dotnet", "lua", "crystal", "go", "d", "php", "ruby", "rust", "dart", "java", "javascript"] },
  { q: "Qui m’a créé?", a: ["VinxVinx"] },
  { q: "Sur quel langue de programmation suis-je codé ?",a: ["Javascript",] },
  { q: "Nommez la septième planète du systeme solaire.", a: ["Uranus"] },
  { q: "Nommez la plus grande île du monde.", a: ["Greenland",] },
  { q: "Quelle est la plus longue rivière du monde?", a: ["amazonie"] },
  { q: "Nommez le plus grand océan du monde.", a: ["pacifique"] },
  { q: "Nommez l’une des trois couleurs primaires.", a: ["bleu", "rouge", "jaune"] },
  { q: "Combien de couleurs y a-t-il dans un arc-en-ciel?", a: ["7"] },
  { q: "Combien de places y a-t-il sur un échiquier?", a: ["64"] },
  { q: "How many degrees are found in a circle?", a: ["360"] },
  { q: "Combien de points une boussole a-t-elle?", a: ["32"] },
  { q: "Combien de cordes un violoncelle a-t-il?", a: ["4"] },
  { q: "Combien de symphonies Beethoven à t-il composé ?", a: ["9"] },
  { q: "Quel est le langage le plus basique que Microsoft a fait?", a: ["Visual Basic"] },
  { q: "'Que signifie l'abréviation OS de l’ordinateur (an anglais) ? ", a: ["Operating System"] }
];
const options = {
  max: 1,
  time: 30050,
  errors: ["time"],
};
#

I coded this command quiz, but when the bot launches a question, for example, the first question, we have to answer by one question: either pas de couleur or invisible, but the bot, when one puts for example pas de couleur He says it is necessary and that the answer is pas de couleur, invisble both at the same time.. How do I fix the worries?

lament meteor
#

the a is an array

#
  1. we do not see any code to send the msg
pallid zinc
#

why this is coming

mossy vine
#

scroll up a bit to actually find the error

pallid zinc
#

its

#

command not defined

mossy vine
#

because command is not defined

pallid zinc
#

but i defined

mossy vine
#

then you wouldnt get the error

pallid zinc
#

```if (message.content.toUpperCase() === ${prefix}bigtext) {

        message.delete(100)

        if (!args.join(' ')) {
            message.channel.send('Specify a text please!')
            return;
        } else if (args.join(' ').length > "20") {
            message.channel.send('Sorry but the limit is 20 characters!')
            return;
        }

        figlet(args.join(' '), function (err, data) {
            if (err) {
                console.log(err)
                message.channel.send(`Sorry ${message.author} ! ERROR : ${err}`)
            }
            message.channel.send(`\`\`\`${data}\`\`\``)
        })

    }```
#

its my code

sinful lotus
#

js wont lie

mossy vine
#

there is nothing in there about command wtf

sinful lotus
#

if it says command is not defined it is not defined and theres no command there

pallid zinc
#

btw there is no command in my hole code

sinful lotus
#

then read stacktrace

mossy vine
#

holy fucking shit

sinful lotus
#

but it says command is not defined

#

read the stacktrace

pallid zinc
#

yup i know

earnest phoenix
#

code :

const quiz = [
  { q: "Quel est la couleur du ciel ?", a: ["pas de couleur", "invisible"] },
  { q: "Nommez une boisson pétillante.", a: ["pepsi", "coke", "rc", "7up", "sprite", "mountain dew"] },
  { q: "Nommez une langue de programmation .", a: ["actionscript", "coffeescript", "c", "c++", "basic", "python", "perl", "javascript", "dotnet", "lua", "crystal", "go", "d", "php", "ruby", "rust", "dart", "java", "javascript"] },
  { q: "Qui m’a créé?", a: ["VinxVinx"] },
  { q: "Sur quel langue de programmation suis-je codé ?",a: ["Javascript",] },
  { q: "Nommez la septième planète du systeme solaire.", a: ["Uranus"] },
  { q: "Nommez la plus grande île du monde.", a: ["Greenland",] },
  { q: "Quelle est la plus longue rivière du monde?", a: ["amazonie"] },
  { q: "Nommez le plus grand océan du monde.", a: ["pacifique"] },
  { q: "Nommez l’une des trois couleurs primaires.", a: ["bleu", "rouge", "jaune"] },
  { q: "Combien de couleurs y a-t-il dans un arc-en-ciel?", a: ["7"] },
  { q: "Combien de places y a-t-il sur un échiquier?", a: ["64"] },
  { q: "How many degrees are found in a circle?", a: ["360"] },
  { q: "Combien de points une boussole a-t-elle?", a: ["32"] },
  { q: "Combien de cordes un violoncelle a-t-il?", a: ["4"] },
  { q: "Combien de symphonies Beethoven à t-il composé ?", a: ["9"] },
  { q: "Quel est le langage le plus basique que Microsoft a fait?", a: ["Visual Basic"] },
  { q: "'Que signifie l'abréviation OS de l’ordinateur (an anglais) ? ", a: ["Operating System"] }
];
const options = {
  max: 1,
  time: 30050,
  errors: ["time"],
};
#
module.exports.run = async (bot, message, args) => {
  
  const item = quiz[Math.floor(Math.random() * quiz.length)];
  await message.channel.send(item.q);
  try {
    const collected = await message.channel.awaitMessages(answer => item.a.includes(answer.content.toLowerCase()), options);
    const winnerMessage = collected.first();
    return message.channel.send({embed: new Discord.RichEmbed()
                                 .setAuthor(`Gagnants : ${winnerMessage.author.tag}`, winnerMessage.author.displayAvatarURL)
                                 .setTitle(`Réponses correcte : \`${winnerMessage.content}\``)
                                 .setFooter(`Questions : ${item.q}`)
                                 .setColor(message.guild.me.displayHexColor)
                                })
  } catch (_) {
    return message.channel.send({embed: new Discord.RichEmbed()
                                 .setAuthor('Personne n’a eu la réponse à temps!')
                                 .setTitle(`Réponse(s) correcte(s): \`${item.a}\``)
                                 .setFooter(`Questions : ${item.q}`)
                                })
  }
}
module.exports.help = {
name: "quiz"
}```

 @lament meteor
lament meteor
#

item.a if in a string automaticly joins itself with a , as it was originally an array

queen bone
#

is there a way to avoid one line json while writing

#
    fs.writeFile("./config.json", JSON.stringify(configs),(err) => {
        if(err) console.log(err); return;
    });```
opaque eagle
#

@queen bone That third argument specifies the length of each tabjs JSON.stringify({}, null, 4);

queen bone
#

that worked flawlessly ... thank you

earnest phoenix
#

Hey! I need help with JavaScript!
How can you make your bot makes an picture with name who just joined the server?

opaque eagle
#

Like just the avatar, or do u want it to manipulate the avatar in some way? @earnest phoenix

sinful lotus
#

canvas probably

#

although be aware, those eat ram and cpu

opaque eagle
#

Yeah

opaque eagle
#

Yeah, that'd be node-canvas

earnest phoenix
#

Okey, thanks!

#

also i'd suggest not using images in cases where you don't have to

opaque eagle
#

And yes, that's ugly af

earnest phoenix
#

i personally use images only when discord's formatting is not cutting it

opaque eagle
#

Same

earnest phoenix
#

I just wanna make another thing

sinful lotus
#

just be mindful of how you use it and you will be fine

#

as I said, when that get spammed, good luck on your cpu & ram

opaque eagle
#

And, if for some reason you can't use node-canvas, there are APIs that can render the image on their backend for ya

sinful lotus
#

and make sure to pick an api that is not blocking node.js event loop if possible

opaque eagle
sinful lotus
#

or else you would be in a really bad time

opaque eagle
#

^

earnest phoenix
#
try {
        await message.author.send(`Commands: \n\n${client.commands.map(cmd => `\`${cmd.help.name}\``).join(", ")}`);
        message.channel.send("Check ur dms");
    } catch (e) {
        throw e;
    }
}```
#

commands is undefined tf y

solid pike
#

You can do the commande unban for me , me DM

quiet topaz
#

Do someone knows, where i could host my bot free( not glitch because the bot goes to fast offline)?

slender thistle
#

No free decent hosts

sinful lotus
#

all free hosts is bad
sponsorships is where you can get decent host but finding one would be hard
cheap hosting tho is a better option

quiet topaz
#

Do someone knows, where i could host my bot free/cheap?

slender thistle
#

Last pinned message here

quiet topaz
#

Thanks

short siren
#

@quiet topaz My bot uses glitch 24/7 lol

#

it hasnt gone down in over like a month lmfao

earnest phoenix
#

probably because it's lowguild lowuse

#

found out why my bot was offline

#

turns out I'm stupid and was using the web Dyno instead of the worker dyno

#

Hello I would like to know how it is done to install the module Colorama in Python please

slender thistle
#

this?

earnest phoenix
#

thx

delicate zephyr
ruby dust
#

luke, where's your bot? 👀

delicate zephyr
#

new bot app. Im waiting in line

modest monolith
#

How do i get the bot developer role?

ruby dust
#

so you killed your own bot

delicate zephyr
#

ye

ruby dust
#

nice

delicate zephyr
#

I killed my old bot

#

it was only in 20 servers

#

so ¯_(ツ)_/¯

ruby dust
#

bot murderer, can you even live with this feeling?

mossy vine
delicate zephyr
#

@ruby dust yes

modest monolith
#

ok i have to wait then thanks

delicate zephyr
daring nymph
#

hey

delicate zephyr
daring nymph
#

there is some information about player who tames the animals

#

the game shares the information through web-site

delicate zephyr
#

yea

daring nymph
#

but i want it from my discord

delicate zephyr
#

Are you willing to pay

ruby dust
#

doesn't look like an english game either

delicate zephyr
#

Its not

daring nymph
#

how much pay are we talking about ? i'm not familiar with the community

#

uhm also i dont think i can pay. because im From Turkey and paypal is forbid here

#

cant access it

delicate zephyr
#

ah

#

oof

daring nymph
#

@ruby dust its an English game but Turkish server

#

@delicate zephyr is there any chance to give me guide tip for the case?

delicate zephyr
#

Well, the likely hood of what you would need to do

#

is:

1. Make a basic bot in something like JS (JavaScript is pretty easy)
2. Make something to scrape the site to gather the stats
3. use that to post the stats
daring nymph
#

I see. thank you for the tip ❤ . and sorry if i steal ur time

sullen plume
#

Yo guys, my bot got declined bc my token is publicly available, which is not true.

delicate zephyr
#

@modern sable ^^

modern sable
#

bot id? @sullen plume

sullen plume
#

@modern sable Client Id: 570984614068486176

trail dagger
#

Why doesnt it send the message and give the $50

    if not user:
      user = ctx.author
    else:
      if user.bot:
        embed = discord.Embed(color=0xff8080)
        embed.add_field(name="Error", value="Bots cannot have any currency")
        await ctx.send(embed=embed)
        return
      if usercurr == 0:
        amountt = 50
        await Mongo2.addbalance(ctx.message.author.id, amountt)
        embed = discord.Embed(color=0x0080ff)
        embed.add_field(name='Bank', value='Looks like you used all your money, the bank decided to give you $50')
        await ctx.send(embed=embed)
        return False```
#

and if the if usercurr thing is under the if not user, it will just give me $50 and sends the message when i do -balance @ username

slender thistle
#

What is Mongo2

#

Is the command even recognized

wild quest
#

what do you do to put: number of commands example of what i mean

#

i am actually stupid lmao

#
.addField("Commands", "{Number}", true)
trail dagger
#

Mongo2 is just the what i named the file for mongodb @slender thistle

slender thistle
#

Is the command recognized by the bot?

trail dagger
#

yes

slender thistle
#

usercurr = await Mongo2.getbalance(ctx.message.author.id)

#

You are ALWAYS getting the message author's balance

trail dagger
#

yea

#

ik

#

This works almost

    if not user:
      user = ctx.author
    if usercurr == 0:
      amountt = 50
      await Mongo2.addbalance(ctx.message.author.id, amountt)
      embed = discord.Embed(color=0x0080ff)
      embed.add_field(name='Bank', value='Looks like you used all your money, the bank decided to give you $50')
      await ctx.send(embed=embed)
      return False
    else:
      if user.bot:
        embed = discord.Embed(color=0xff8080)
        embed.add_field(name="Error", value="Bots cannot have any currency")
        await ctx.send(embed=embed)
        return```
#

Yea that worked

slender thistle
#
    if not user:
      user = ctx.author
    else:

Well, if you don't specify a user, it's just the else branch being executed

trail dagger
#

It is always what i doesnt think the error is that is the error

jaunty stump
#

I need some help wish some code and an Error

Error>>> Invalid regular expression. (E016)jshint(E016)

 else if (musicbot.commands.has(command) || musicbot.aliases.has(command)) {
        if (msg.channel.permissionsFor(msg.guild.me)
          .has('EMBED_LINKS')) {
          const embed = new Discord.RichEmbed();
          command = musicbot.commands.get(command) || musicbot.aliases.get(command);
          if (command.exclude) return msg.channel.send(musicbot.note('fail', `${suffix} is not a valid command!`));
          embed.setAuthor(command.name, msg.client.user.avatarURL);
          embed.setDescription(command.help);
          if (command.alt.length > 0) embed.addField(`Aliases`, command.alt.join(", "), musicbot.inlineEmbeds);
          if (command.usage && typeof command.usage == "string") embed.addField(`Usage`, command.usage.replace(/{{prefix}})/g, musicbot.botPrefix), musicbot.inlineEmbeds);
          embed.setColor(musicbot.embedColor);
          msg.channel.send({
            embed
          });
        } else {
          command = musicbot.commands.get(command) || musicbot.aliases.get(command);
          if (command.exclude) return msg.channel.send(musicbot.note('fail', `${suffix} is not a valid command!`));
          var cmdhelp = `= ${command.name} =\n`;
          cmdhelp = cmdhelp + `\n${command.help}`;
          if (command.usage !== null) cmdhelp = cmdhelp + `\nUsage: ${command.usage.replace(/{{prefix}})/g, musicbot.botPrefix)}`;
          if (command.alt.length > 0) cmdhelp = cmdhelp + `\nAliases: ${command.alt.join(", ")}`;
          msg.channel.send(cmdhelp, {
            code: 'asciidoc'
          });
        };
      } else {
        msg.channel.send(musicbot.note('fail', `${suffix} is not a valid command!`));
      };
    };
buoyant wagon
#

/{{prefix}}/g

jaunty stump
#

Ok

daring nymph
#

is there anyone who can make me a bot that for web scrapping specific information

muted latch
#

You mean some paid API access that somebody else would purchase..?

daring nymph
#

@muted latch i changed the topic.

muted latch
#

ok...

opaque eagle
#

What language are you using? @daring nymph

daring nymph
#

i'm just dont know anything but if anyone can do the specific bot for me. i'm willing to pay

opaque eagle
#

Ohh I didn't notice that you wanted someone to make it for u lol

#

I thought u were making a bot and wondered how to web scrape

daring nymph
#

i tried to make a bot like 2 days long

#

but its really hard for a newbie

#

like impossible 😄

opaque eagle
#

What language?

mossy vine
#

SC, he doesnt want to make a bot

opaque eagle
#

oh

mossy vine
#

he just wants to pay

opaque eagle
#

oh

mossy vine
#

he said it like twice lmfao

opaque eagle
#

oh

ruby dust
#

oh

daring nymph
#

😄

modern sable
#

]]mutedbot

covert turtleBOT
#

Your bot was likely muted because it broke one of the "bot rules" listed in #rules-and-info.

To find out why your bot was muted and by who, use the search feature in #mod-logs:

modern sable
#

it should contain who did it

earnest phoenix
#

stop spamming mentions you are annoying

solid hull
#

Ist hier ein Deutscher Developer?

tough bluff
#

Can someone tell me if there is a good way to recreate the /nick command built in to discord? This is my current code:

  if (message.member.hasPermission("MANAGE_NICKNAMES")) {
    let newName = args[1];
    let tochange = args[0];
    message.guild.members.get(tochange.id).setNickname(newName);
  }
  else {
    message.reply(`You don't have permission to use that!`);
  }
}```
.setNickname has worked previously for me
And this is my error:
void mantle
#

@red mountain can you not spam mentions okay?

#

lets move this to dms because this doesn't belong in #development

tough bluff
#

Anyone wanna help me?

late hill
#

args[0] probably isn't a user object

zealous veldt
#

I've been looking for a solution to prevent my evals from returning js [object Object] messages, though I haven't been able to find anything that has actually worked. .toString thus far has not been successful. In case you couldn't tell, I'm using NodeJS. Please ping me with responses

earnest phoenix
#

not a js expert but i remember someone saying to run the eval in async context

late hill
#

@tough bluff how are you using the command

#

oh

#

You're mentioning them by looking at your logs

tough bluff
#

wym

#

yeah

#

nick @a_user test

late hill
#

Use message.mentions

tough bluff
#

uhh

late hill
#

To get the member from that

tough bluff
#

oh ok

late hill
#

message.mentions.members[0] should work

#

and you can just call .setNickname() on that

#

But like

#

You should add a check to make sure that someone was actually mentioned

dry oracle
#

Who can help me for my discord bot. I can't do an overwatch stats command.
Who can help me

zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

dry oracle
#

Hello, i would like to create an overwatch stats command on my discord bot (discord.js/javascript). I don't know how to do this.
Who can help me ?
Thank you for your help

amber fractal
abstract crow
#

@dry oracle Use that API ^ and then use a node module for HTTPS requests

#

Use variables from what the person using the command enters in to fill out the URL

dry oracle
#

How ? I don't understand 😅

earnest phoenix
#

research it

dry oracle
#

I search but i don't find

buoyant wagon
#

i need help with node-fetch
getting the json returns undefined

opaque eagle
#

Show code @buoyant wagon

zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

buoyant wagon
#
const { body } = await nfetch(`searchlink`).then(response => response = response.json());
opaque eagle
#

@buoyant wagon That's becuz that function in the then() doesn't return anything... Do this instead: js const body = await fetch().then(res => res.json());

buoyant wagon
#

thx it works

daring nymph
#

Can anyone help me about how can i auto update google spreadsheets??

high lava
#

This channel is for bot development

daring nymph
#

okay sorry 😦

opaque eagle
#

Imo, it doesn't have to be about solely bot development though...

#

Like would I get banned if I ask a question about tensorflow or smth? No (or at least I hope not)

pliant needle
#

Yo, to get ping, there a recommended module? It'd be for a simple ping/pong command

#

So far google isn't really showing me what I'm looking for

opaque eagle
#

What language, what lib?

pliant needle
#

Node

#

And discord.js

#

I suppose I should've lead with that xD

opaque eagle
#

So like the time it takes round-trip or the heartbeat ping?

pliant needle
#

Pretty much

opaque eagle
#

Which one...

pliant needle
#

From time command is sent to response given

opaque eagle
#

Oh

#

There's no reason to use a module for that

pliant needle
#

I thought that was the case, but google was like "install this api" and I'm like wtf dude

opaque eagle
#

Send a message and store it in a variable (await it)... after it's sent, subtract the timestamp of that message minus the timestamp of the trigger message that the user sent

pliant needle
#

Aight, simple enough

#

Thank you haha

opaque eagle
pliant needle
#

Yeah, that'll do xD

inner jewel
#

don't compare message timestamps

#
start = currentTime()
sendMessage("Pinging...").then(m => m.edit((currentTime() - start) + " ms")```
opaque eagle
#

Why not though... comparing timestamps only takes into account the latency between the client and the server, and ignores any delays that may happen during code execution for whatever reason

inner jewel
#

because clock drift is a thing

#

comparing timestamps could yield even negative ping

#

all you need is different servers with different times generating the snowflakes for the messages

opaque eagle
#

oh ye

#

But aren't all timestamps generally in UTC though?

inner jewel
#

also it doesn't matter what you use as a reference

#

if you have the wrong time

pliant needle
#

Natan's idea is truer to what I'm looking for

#

Thank you :)

fiery stream
#

ayy how can i get emoji id so i can use it for bot

buoyant wagon
#

right click emoji + copy link

#

the id is in the link

proven surge
#
        channel = ('577224910833844236')
        await bot.send_message(user, "Congrats! You have gone through verification sucessfully! Here is an invite to the server.")
        await bot.create_invite(destination = channel, xkcd = True, max_age = 1, max_uses = 1, reason = "Test")

But I get an error and it says discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'id' Can someone help

west spoke
#

message.channel

#
user = ctx.message.author
        channel = ('577224910833844236')
        await bot.send_message(user, "Congrats! You have gone through verification sucessfully! Here is an invite to the server.")
        await bot.create_invite(destination = message.channel, xkcd = True, max_age = 1, max_uses = 1, reason = "Test")
#

@proven surge

#

Try that

proven surge
#

ok

slender thistle
#

'id'.send()
Does that make sense to you

proven surge
#

now is says message is not defined

west spoke
#

Wait put ctx.

slender thistle
#

ctx.message

west spoke
#

In front of it

#

I dont use rewrite so I dont use that format

proven surge
#

ah i see

west spoke
#

I just use message.channel normally

slender thistle
#

More like you don't use commands extension, it seems

west spoke
#

yeah

#

I use the unholy async

slender thistle
#

Even async has ctx and commands extension

proven surge
#

thanks

west spoke
#

Np ig

proven surge
#

i knew it was somthing minor i just couldnt put my finger on it

west spoke
#

xd

#

I have that happen all the time

#

Anyways now. Lemme fix somethin

fiery stream
#

@buoyant wagon so the problem is i cant send the emoji because i dont ahve nitro

#

so yea

buoyant wagon
#

the bot can send the emoji though

#

@fiery stream

fiery stream
#

i need the emoji id to make the bot send it tho

#

btw just leave it my other good frined taught me to do it

#

btw how do u use new terminal that windows just added

buoyant wagon
#

no

fiery stream
#

no?

west spoke
#

No.

fiery stream
#

wdym

#

aren't i a great programmer if i don't have the problems that i usually do 😂

pliant needle
#

Tf does that mean? XD

west spoke
#

Number Invalid

buoyant wagon
#

Not a Number

west spoke
#

^

pliant needle
#

So no latency

west spoke
#

It would still show a number

pliant needle
#

Hrm...

#

I see what I've done wrong lmao

fiery stream
#

ayy

fiery stream
#

hi so i wanted to know my else works but my first thingy doesnt

#
      var kickChannel = message.guild.channels.find("name", settings.modLogChannel);
      
    } else {
      if (!kickChannel) return message.channel.send(kembed);
    }  
    kickChannel.send(kembed)
      .catch(error => message.reply(`Couldn't kick because of: ${error}`));```
buoyant wagon
#
message.guild.channels.find(ch => ch.name === settings.modLogChannel);
fiery stream
#

wait what

steel cloak
#

can anyone help me with what this error means

(node:3279) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at item.request.gen.end (/home/tyler/Desktop/cats-o-mighty/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:15)
    at then (/home/tyler/Desktop/cats-o-mighty/node_modules/snekfetch/src/index.js:215:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:3279) 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: 2)
(node:3279) [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.
inner jewel
#

DiscordAPIError: Missing Permissions

steel cloak
#

what would that exactly mean?

#

wait would that mean the bot is trying to do something but doesn't have that permission to do it?

fiery stream
#

yea

steel cloak
#

ahh okay thanks

fiery stream
#

np

#

umm how can i run two scripts from one start liek "start": "node index.js && app.js"?

hearty lake
#

time to code fdhasjkfhdsalkjfhdsakjhfub4eowuyifbedaub37289y4t873128dubaivubdsaoiuybfge7ahr9f83h8r32 = 1 298362817hbfydsabug8761g72g

#

I just made fortnite 😎

fiery stream
#

lmao that looks like combo of pubg and fornite

#

umm how can i run two scripts from one start liek
"start": "node index.js && app.js"
?

#

help

errant ocean
#

Just start one script that will initiate both of them individually

fiery stream
#

cant do that

zealous veldt
#

@hearty lake Stop shitposting, last warning

kind roost
#

halp pls

#

i wanna edit a msg with image, but it looks to ignore the image

#

😢

earnest phoenix
#

you cant edit the attachments the message has

kind roost
#

if the message doesn´t has any attachment, it wil nor be edited?

earnest phoenix
#

no

#

i said that you cant edit the attachments

kind roost
#

oh

#

F

#

how ever i found another way

#

send anther message and delete the previus one

#

😇

steel heath
#

or use embeds wesmart

kind roost
#

Is also an option

pliant needle
#

Okay, I give up: how tf do you get the bot's avatarURL?

steel heath
#

client.user.avatarURL?

pliant needle
#

I've tried that

#

Hrm

#

Unless I'm an idiot

#

Which is usually true

steel heath
#

What happens when u try that

pliant needle
#

Client isnt defined

#

And if I try discord.user.avatarURL I get "discord is not defined" despite the fact that it very clearly is since n++ is tryna fuccen autocomplete to discord

steel heath
#

how did you define client

#

maybe bot or you have to use this.client instead

pliant needle
#

hrm...

#

Whoops, that was the wrong area lmao

#

Anyway

#

Technically, I have self defined as the bot

#

But even that's saying it's undefined

umbral glacier
steel heath
#

Wait are you using a tutorial about creating a bot to create a Discord server?

mossy vine
#

@umbral glacier according to the API documentation, only bots with less than 10 guilds can access the server creation endpoint

slender thistle
#

Correct

mossy vine
umbral glacier
#

Thanks, now is solved.
Issue is I don't know the term of discord server. So I did find at the developer section. But it needed to create on chatting console

earnest phoenix
spring ember
#

You forgot to null check

earnest phoenix
#

@earnest phoenix error on line 917

#

Send the line 917 here

#

Line 1026 too

#

@earnest phoenix

torn compass
#

#

Hi

worldly rain
#

does anyone know if it's possible to run separate shards of the same bot on different computers

steel heath
#

i think it is but i didn't see anything about it also that was a reason that why i wanted to shut down my bot rip i didn't want multiple machines

earnest phoenix
#

hey eggsy

steel heath
#

hey you

earnest phoenix
#

do you know the solution to my problem

steel heath
#

no idea how to work with json data files

#

sorry

earnest phoenix
#

okey

#

thanks anyway

worldly rain
#

wait what hwy did you want to shut down your bot?

earnest phoenix
#

can you help me

worldly rain
#

what do u need

earnest phoenix
#

can you look up there

amber fractal
#

Wait Im behind

#

Mobile scrolling be like that

worldly rain
#

@earnest phoenix u gotta show your code

earnest phoenix
#

above already exists

#

throw them all

worldly rain
#

@amber fractal so like you just specify a shard to spawn when you run it on a different machine?

#

i'm gonna need to see more than that lol

earnest phoenix
#

okey

#

dm

#

Can you come

worldly rain
#

ya

sinful lotus
#

you can run separate shards

#

on sharding manager you can specify specific shards to spawn on that sharding manager

#

but the hard part of that is getting your data accross

#

either an rest api or websocket between the bot is needed

earnest phoenix
#

@worldly rain I threw

worldly rain
#

@sinful lotus what data would i need to pass between shards

#

i don't think anyhting in my bot needs to pass data between shards

sinful lotus
#

depends on what you need

#

idk what your bot does

#

but if it doesnt need to get data across between pc

#

then its fine

worldly rain
#

ok so the discord bot will handle the distribution of guilds to shards for me then, right?

inner jewel
#

yes

worldly rain
#

welp that's a lot less complicated that i thought it would be

sinful lotus
#

you just need to specify the shards to run on that sharding manager @worldly rain

#

pc 1 shard id 0 1 2 3 4
pc 2 shard id 5 6 7 8 9

worldly rain
#

wait, so i'd have to hard code it for each pc?

earnest phoenix
#

Hello 👋
I coding !javascript code but ı don't know addRole embed. How ı use?
Please answer me. 😃

sinful lotus
#

@worldly rain yes

#

but probably you need a better sharder

#

oh nvm

#

I was looking on stable docs

worldly rain
#

we're talking about the discord.js api here, right?

sinful lotus
#

yes ^

#

for example 10 shards
totalShards = 10 shards
shardList will be 0 to 4 on first pc
5 to 9 in second pc

#

totalShards would be the same on both pc

worldly rain
#

what happens if you do auto?

#

i mean auto for two pcs

sinful lotus
#

you can use auto but you wont know how many shards are spawned until the bot is online

#

and you need to know exactly how many shards you have so you can divide it on shardList

worldly rain
#

man that sucks, there's no way to spawn them automatically

sinful lotus
#

well because you are hosting it on 2 diff pc

#

if you want some sort of auto you can use some js to calculate it but totalShards must be hardcoded

opal stag
#

hi!

worldly rain
#

ok, well that also means that if you theoretically wanted to add another pc or more shards, you'd have to restart the bot completely and manually change all the shard params

#

that's if i'm understand you correctly

sinful lotus
#

as far as Im aware about it yes

#

so make sure you spawn more than you need

inner jewel
#

fyi that won't synchronize the identify ratelimit

#

so you might get OP9'd a lot on startup/reconnects

sinful lotus
#

probably you may need to modify it

inner jewel
#

also global rl isn't sychronized either

sinful lotus
#

or do a cluster system on your servers idk how that works

worldly rain
#

uhh what's an identify ratelimite

opal stag
#

i need help with developing my bot

sinful lotus
#

how much you can login

inner jewel
#

IDENTIFY is a command you send when connecting

opal stag
#

called Google Chrome

sinful lotus
#

its limited to 1000 per day

inner jewel
#

the bot can only send one of those every 5 seconds

#

globally

worldly rain
#

as in 1 for each shard?

sinful lotus
#

on all shards

worldly rain
#

and everytime you reconnect

inner jewel
#

if you send another before the 5s, the connection is closed

#

if you resume, then you dont need it

sinful lotus
#

basically if you have 45 shards, that 45 shards shares 1000 identifies

worldly rain
#

so you'd only be allowed to restart your bot 1000/45 times right?

sinful lotus
#

reconnect but resumed dont count but if it reconnects but it cant resume, that 1000 identifies is exhausted

inner jewel
#

first connection -> has identify
reconnected but resumed -> no identify
reconnected but resume failed -> needs identify

opal stag
#

hello

mossy vine
#

@opal stag okay youre making your bot. what do you need help with?

#

just post your question

sinful lotus
#

probably you can use this to host bots in separate containers but im not sure about it

#

since I never used that yet lmao

opal stag
#

i need helpwith some commands

worldly rain
#

wait can i resume fail while the process is still running or will it try again with no identify need

#

needed*

opal stag
#

like help

sinful lotus
#

d.js handles those

inner jewel
#

if you don't synchronize the identify ratelimit, you will eventually connect

grim aspen
#

what are the commands you would like help with?

sinful lotus
#

you dont need to deal with those

inner jewel
#

but it may take longer

sinful lotus
#

when d.js detects you had exceeded 1000 ident

grim aspen
#

oh

sinful lotus
#

it will wait untill it can connect you again

opal stag
#

i have restarted programming cuz my laptop broke now i have my gaming pc

#

oof

inner jewel
#

to have multiple processes i just had a central thing controlling who gets to connect when

opal stag
#

#ripmylaptop

inner jewel
#

could use a redis key as a lock

#

with auto expire

#

when it expires you set it again and connect

#

on connection success you delete it if you still own it (could just be value == yourshardid)

worldly rain
#

uhh im not following

sinful lotus
#

well basically you just need to have a system

#

that syncs the ident ratelimits on your diff shards

#

probably you need to fork d.js

worldly rain
#

and do what on the fork?

sinful lotus
#

fix it so the ratelimits are synced across your bot

#

no matter where the server is

#

so probably do what natan says and use redis as cache

worldly rain
#

wait u mean fork the library right?

sinful lotus
#

yes

#

fork and modify it to fit the needs

worldly rain
#

ok forgive me for being dumb, but why am i syncing the ratelimits again?

sinful lotus
#

because if you dont your bot wont know if it can still login

#

and go throw errors

#

imagine if ident # is diff on pc 1 and pc 2, and ident is already 0 but pc 2 thought ident is still not 0

worldly rain
#

ohhhh ok so i just need to cache how many i have left so i don't try to connect when i can't

sinful lotus
#

yes and for that you need to fork the library

#

and modify the internals

worldly rain
#

ok nother dumb q, what situation was natan talking about when he said i might op9 on my connections

#

he meant when i need to add pcs or shards right?

#

wait nvm i think i get it

#

nop nvm i don't get it lmao

sinful lotus
#

no

#

he said that because ident will not be synced on your shards on diff pc

worldly rain
#

oh so what are you supposed to do instead if you're at your ratelimit?

sinful lotus
#

let d.js handle it

worldly rain
#

tell me if this is right :: you sync the rate limit because if you don't and you try to connect your bot instance crashes

sinful lotus
#

if d.js knows you are in your limit then it should do the waiting for you

#

it will probably throw errors or something

#

d.js normal action for it is setTimeout until the timer ends

worldly rain
#

OHHHHHHHHHHHHHHHHHHH

#

so you sync the rate limit so that between both computers you don't try to connect when you're at your rate limit, so that you don't get errors by trying to connect because d.js can't see the rate limit of the other computer

sinful lotus
#

yes

worldly rain
#

where tf in the documentation is this written lmao

#

but anyways

#

@sinful lotus @inner jewel thank you for the explanation

inner jewel
#

discord docs

worldly rain
#

would it really take that much more time if you don't sync the rl

inner jewel
#

it depends

sinful lotus
#

d.js is not designed to be used like that tbh at first place

inner jewel
#

if you get lucky, it wont take more time

sinful lotus
#

or at least they plan to on what I saw on sharding manager but its very basic

inner jewel
#

but it will need to keep retrying until it succeeds

sinful lotus
#

also if you post bot stats

#

thats where your another problem will lie

inner jewel
#

just post with shard id

#

all shards need to know their id and total anyway

sinful lotus
#

but that would hit ratelimits

inner jewel
#

60/minute

sinful lotus
#

dbl?

worldly rain
#

for dbl?

inner jewel
#

post on an interval and you're fine

#

yes

sinful lotus
#

my current design is a central api that handle those

#

so only 1 process is sending to dbl

worldly rain
#

yknow what don't answer that question lol

#

lets pretend i didn't say that

#

ok welp, thank you guys again

fiery stream
steel cloak
#

@fiery stream can you explain what you mean a little better?

sullen wing
#

What would be the simplest way to make command cooldown across all the shards without using database? [discord.js]

scarlet phoenix
#

There is no way that will be less work than using a db. Especially if you have shards spread across multiple hosts. If they are all on the same host (and same process) you could try using a synchronized static class to keep track of last used command times for a given userID. I am not a js guy though so I would not know how to implement that in js syntax.

amber fractal
#

Like they said, the easiest way would be to have your shards connect to the db or there'd be no way to communicate between the shards without broadcastEval. OR, you can use internal sharding on discord.js master

inner jewel
#

broadcastEval doesnt even work across servers

#

(server as in vps/dedicated)

scarlet phoenix
#

Yeah, to go across servers you would need some sore of DB/datastore, I guess you could use something like a nats messaging queue as well but that would make zero sense since databases exist for this exact usecase

fiery stream
#

@steel cloak so u know if we search something it saves data in url something like ?user=data

#

So i want to hide that data

#

For normal user

whole condor
earnest phoenix
#

Oh shit run

#

@earnest phoenix authorize and then you can close

#

code :


module.exports.run = async (bot, message, args) => {
	if(message.author.bot) return;
	
	let qEmbed = new Discord.RichEmbed() 
	.setTitle("Panneau d'aide")
	.setDescription("Où voulez-vous que la page d'aide senvoie ?")
	.addField("
salon
","Envoie la page d'aide dans le salon") 
	.addField("
mp
", "Envoie la page d'aide en message privé")
	message.reply(qEmbed)
	
	let hEmbed = new Discord.RichEmbed()
  .setTitle("** 📌 Listes des commandes :**")
  .setColor('RANDOM')
  .addField("💻 • **__Modération :__ **", "`ban`, `unban`, `kick`, `mute`, `tempmute`, `warn`, `addrole`, `removerole`")
  .addField("🚨 • **__Configuration :__**", "`setprefix`")
  .addField("💼 • **__Utile aux staff__**", "`sondage`, `purge`, `annonce`, `createchan`")
  .addField("⏳ • **__Sécurité & plaintes__**", "`hverify`, `hreport`")
  .addField("🎉 • **__Fun :__**", "`say`, `avatar`, `ascii`, `meme`, `blague`, `kiss`, `frappe`, `calin`, `tapote`, `cat`, `coinflip`")
  .addField("💰 • **__Economie :__**","En cours de développement")
  .addField("👥 • **__Utiles :__**","`serverinfo`, `userinfo`, `botinfo`, `calc`, `password`, `roll`, `google`, `ping`, `partners`, `'about`")```
#
            if(response === 'salon') {
              message.channel.send(hEmbed)
            }
            if(response === 'mp') {
              message.author.send(hEmbed).catch((err) => {
                if(err) {
                    return message.channel.send(`Veuillez activer vos mp`);
                }
            })
            }
          }       
          
module.exports.help = {
	name:"help"
}```


Worries :
When I make the command help and then he asks me where I want it to be, I reply by salon, nothing happens, same for dm
and there is no error displayed in the console
#

librairy ?

#

Javascript

#

discord js/nodejs

#

@earnest phoenix no no, i'm trying make code after the use logs in it will close the window

#

@earnest phoenix make a loop that checks whether the url is my_redirect_uri.com/?code=..., once successful you can close it

#

then who can help me

#

so?

#

No one seems to be able to help you, but with perseverance you will succeed.

opaque eagle
#

Why doesn't a package that's installed as a peer dependency show up in your node_modules folder?

earnest phoenix
#

A week I persevered

opaque eagle
#

What's the problem? @earnest phoenix

earnest phoenix
#

code :


module.exports.run = async (bot, message, args) => {
	if(message.author.bot) return;
	
	let qEmbed = new Discord.RichEmbed() 
	.setTitle("Panneau d'aide")
	.setDescription("Où voulez-vous que la page d'aide senvoie ?")
	.addField("
salon
","Envoie la page d'aide dans le salon") 
	.addField("
mp
", "Envoie la page d'aide en message privé")
	message.reply(qEmbed)
	
	let hEmbed = new Discord.RichEmbed()
  .setTitle("** 📌 Listes des commandes :**")
  .setColor('RANDOM')
  .addField("💻 • **__Modération :__ **", "`ban`, `unban`, `kick`, `mute`, `tempmute`, `warn`, `addrole`, `removerole`")
  .addField("🚨 • **__Configuration :__**", "`setprefix`")
  .addField("💼 • **__Utile aux staff__**", "`sondage`, `purge`, `annonce`, `createchan`")
  .addField("⏳ • **__Sécurité & plaintes__**", "`hverify`, `hreport`")
  .addField("🎉 • **__Fun :__**", "`say`, `avatar`, `ascii`, `meme`, `blague`, `kiss`, `frappe`, `calin`, `tapote`, `cat`, `coinflip`")
  .addField("💰 • **__Economie :__**","En cours de développement")
  .addField("👥 • **__Utiles :__**","`serverinfo`, `userinfo`, `botinfo`, `calc`, `password`, `roll`, `google`, `ping`, `partners`, `'about`")
#
            if(response === 'salon') {
              message.channel.send(hEmbed)
            }
            if(response === 'mp') {
              message.author.send(hEmbed).catch((err) => {
                if(err) {
                    return message.channel.send(`Veuillez activer vos mp`);
                }
            })
            }
          }       
          
module.exports.help = {
	name:"help"
}```


Worries :
When I make the command help and then he asks me where I want it to be, I reply by salon, nothing happens, same for dm
and there is no error displayed in the console
opaque eagle
#

console.log response

earnest phoenix
#

But it's a help page !

#

I'm not going to put her in the console..

opaque eagle
#

Yeah... console.log(response) so we can see what it is....

#

Put it there and then try out the help command again... then we can see what's going onjs var response = args.join(" ").slice(22); console.log(response); if(response === 'salon') { // etc }

earnest phoenix
#

k

#

@opaque eagle its puts that answer is not defined, but I defined it

opaque eagle
#

Yeah, but you defined it as args.join(" ").slice(22);... that itself could be undefined

#

console.log(args) now

earnest phoenix
#

Oh yes, I had forgotten a letter

#

When I made the command help, in the console his just jumped a line but its not put anything
@opaque eagle

opaque eagle
#

What did u console.log? args or response

earnest phoenix
#

response

#

why ?

#

and this ?

var response = message.content.toLowerCase();
            if(response === 'salon') {
              message.channel.send(hEmbed);
            }
            if(response === 'mp') {
              message.author.send(hEmbed).catch((err) => {
                if(err) {
                    return message.channel.send(`Veuillez activer vos mp`);
                }
            })
            }
          }  

@opaque eagle

opaque eagle
#

console.log args

earnest phoenix
#

ok

#

But, what I want is that when I make the command t/help The bot asks where is it going to send the help page. Then we have to answer just by salon or mp @opaque eagle

opaque eagle
#
  1. Stop pinging me for each reply
  2. Console log args like I asked
earnest phoenix
#

but args. join is in the command, same line of the genre:

t/help mp
mp is args
AND
t/help
The bot responds
salon
The bot sends the help page in the channel

steel cloak
#

@fiery stream sorry for the late response I'm in school lol. but you can use base64 convert the data then send that in the url

fiery stream
#

Me school too

steel cloak
#

oh lol. but yeah you can use base64 for to 'hide' the data. expect for the string "password" you'll get "cGFzc3dvcmQ=" which then you can use base64 again to 'decrypt' the data. I'm not sure if you can use html to do this but you can use php

opaque eagle
#

Is it so hard to follow simple directions?

#

Will the world come to an end if you console.log(args)?

earnest phoenix
#

Ok !

wraith cipher
#

shivaco remember the issue about pymongo's update_one func not working ?

slender thistle
#

Indeed I do

wraith cipher
#

Mind if I DM you the code ?

slender thistle
#

Proceed

opaque eagle
buoyant wagon
#

maybe add !important

opaque eagle
#

ok

steel cloak
#

is there a way to test with the dblapi.js without actually posting the data to the site?

novel wolf
#

@west shard

#

hi!

grim aspen
#

ultimate hoister

earnest phoenix
#

Im trying to get a bot to create a invite for the server its in like a command like !serverlink and what ever server you sent the command it creates a invite.

unique nimbus
#

If its to a server you are not in they need to consent

#

if its in a server you are in then idfk

earnest phoenix
#

yes

ruby dust
#

what lib

opaque eagle
#

If I'm writing a package that needs to write and read files/folders from where the package is imported... should I use process.cwd() or __dirname to get the project's directory?

ruby dust
#

@earnest phoenix what library

earnest phoenix
#

discord.js

ruby dust
#

I don't use discord.js, or js, and it took me 5 seconds to find it

earnest phoenix
#

...

opaque eagle
#

lol

#

Even Intellisense could've told u that tbh

steel cloak
#

if you have a question read the documentation. and if you still can't find it then come here

earnest phoenix
#

hey so i'm trying to make a quote command (js) where it goes like this
addquote (username) foo
and the quote is stored like
"username": ["foo"," bar"]
and when doing
getquote (username)
it will randomly select either foo or bar as an output
now i was gonna do this in JSON but i have no idea how to write things to a JSON
the other stuff like randomizing i can do but can anyone help me with the writing of a command to the file?

#

if anyone can help out feel free to ping me with a response

#

thanks in advance

opaque eagle
#

Don't use JSON as a database.

steel cloak
#

I tried that....
let's just say I use a database now lmao

earnest phoenix
#

i did forget to mention i was lookin at mongoDB as well

#

i need something free since i refuse to spend a penny on this bot

#

Lol

#

but i can do that on my own

#

Free bots wont last long

#

mine has lasted a while so far

#

Unless you pay the bills to keep it running on ur pc xd

#

since like november

#

still chuggin

#

its on uhh

#

heroku

#

Ew

#

Heroku doesnt even support local databases

#

Where are you planning to host mongo at

#

Ur pc?

#

im probably gonna end up running everything off of my rasberry pi at some point

#

Mongo on a pi, i think its fine

#

Dont run a discord bot on it tho

#

its not gonna be a music bot or anything crazy

#

i think ill stick with heroku for the bot and have the db on the pi

#

No but still

#

Bots on a pi arent really a good thing

#

yea

#

I learned it after running my bot on my pi for a year and a half

#

i don't have a job and even if i did i'm not putting money into it lol

#

if i were making money off of the bot that would be a diff story lol

#

Ye but i mean 3$/month is good enough for a vps

#

I dont make money off my bot yet i spend 15$/month on discord nitro, my bot host and other stuff lol

ruby dust
#

have you considered sacrificing nitro for your bot? since that's exactly what I do

earnest phoenix
#

What

#

Hell no

#

Im getting games for 5$ nitro

#

Till 2020

ruby dust
#

and you said $15/month, that's more than their highest plan

earnest phoenix
#

Why sacrifice expenses if your income is around 120$/month as a 15 year old?

#

@ruby dust discord RELATED yes

#

Bots are discord related too

#

my income is 0 a month lol

#

granted, i could leech off of my parents even more for a vps but i really would rather find free alternatives

#

heroku has caused no problems for me thus far

ruby dust
#

heroku could be a good alternative if it's some sort of a private bot with basic functionality

earnest phoenix
#

Ye

#

that’s what it is right now

#

Else just spend 3$/month on a cheap vps lol

#

Run the db with it

ruby dust
#

if you have any sort of database to maintain then you can forget about heroku right now before you start regretting it

earnest phoenix
#

Run other stuff too

#

Boom done

#

that’s prob my best bet tbh

#

is mongodb fairly easy to get the hang of? i’ve had no time to look into it

ruby dust
#

I'd personally recommend sqlite, but idk

earnest phoenix
#

Sqlite is local tho

#

Mongo is a db that can be accessed over the internet with the right config

#

Protected ofc

#

i’m always going places so mongo sounds ideal

#

I use rethink tho

#

It also has a nice dashboard you can setup

steel cloak
#

@earnest phoenix like how to update the website api with how many servers the bot is in?

earnest phoenix
#

uhhh

#

i just want to see how many people invited the bot through the website

amber fractal
#

Hard to do without js

#

if you get cert you can use js

#

on dbl

opaque eagle
#

DBL is biased toward JS... why can't cert devs code their page in scratch or brainfuck

#

jkjk

bright spear
#

because js is pretty much the only programming language of the web

opaque eagle
#

What about Web Assembly lol

zealous veldt
#

pls

grizzled spruce
#

I need help

zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

grizzled spruce
#
let yen = require("../yen.json");
const fs = require("fs");
exports.run = async (client, message, args) => {
    if (!message.guild.member(client.user).hasPermission("SEND_MESSAGES")) return message.author.send('I don\'t have permission to Send Messages. Please enable send messages for my role!');
   
 let syen = yen[message.author.id].coins;
  
  if(syen < 100) return message.reply("Not enough yen!");
  
  yen[message.author.id] = {
    yen: yen - (100)
    
      };
    let slots = ["🍎", "🍌", "🍒", "🍓", "🍈", "🍆"];
    let result1 = Math.floor((Math.random() * slots.length));
    let result2 = Math.floor((Math.random() * slots.length));
    let result3 = Math.floor((Math.random() * slots.length));
    let name = message.author.displayName;
    let aicon = message.author.displayAvatarURL;

    if (slots[result1] === slots[result2] && slots[result3]) {
        let wEmbed = new Discord.RichEmbed()
            .setFooter("You Won!", aicon)
            .setTitle(':slot_machine:Slots:slot_machine:')
            .addField('• Result:', slots[result1] + slots[result2] + slots[result3], true)
            .setColor("#f4e842");
        message.channel.send(wEmbed);
      yen[message.author.id] = {
    yen: yen + (200)

      };
    } else {
        let embed = new Discord.RichEmbed()
            .setFooter('You Lost!', aicon)
            .setTitle(':slot_machine:Slots:slot_machine:')
            .addField('• Result:', slots[result1] + slots[result2] + slots[result3], true)
            .setColor("#f4e842");
        message.channel.send(embed);
    }

}

 fs.writeFile("./yen.json", JSON.stringify(yen), (err) => {
      if (err) console.log(err)
   });
  
exports.help = {
    name: 'slots'
}```
#

Whenever I use the above code for slots, my money values become undefined or NaN

fiery stream
#

ayyy

#

thats dialogflow btw

opaque eagle
#

what's dialogflow?

fiery stream
#

yay i got help

#

lol rip

#

its a chat service powered by google

opaque eagle
#

oh

fiery stream
earnest phoenix
#

@grizzled spruce what is the problem

grizzled spruce
#

Whenever I use the above code for slots, my money values become undefined or NaN

fiery stream
#

dayum people rude here no-one is trying help me

earnest phoenix
#

Its bc you put ()

#

For yen - (100)

grizzled spruce
#

Oh so it’ll work if I remove the ()?

earnest phoenix
#

No

#

you need to do yen[message.author.id].coins = syen - 100

grizzled spruce
#

Ok

earnest phoenix
#

Not yen[message.author.id] = { }

#

I hve edited ^ @grizzled spruce

grizzled spruce
#

Ok ty

earnest phoenix
#

Np

grizzled spruce
#

i neeed more helpp

#
const superagent = require("superagent");

module.exports.run = async (bot, message, args) => {
  const user = message.mentions.users.first() || message.author;
  
  let {body} = await superagent
  .get(`https://i.some-random-api.ml/LJ8oRDaf8Z.gif`);
  
  const avatarEmbed = new Discord.RichEmbed()
  .setColor(`#800080`)
  .setTitle(`${message.author} hugs ${user.username}!`)
  .setImage(body.link)
  .setTimestamp(new Date())
  .setFooter('© ₦anø#8550 | Kapow#4665 2019', bot.user.displayAvatarURL);
  message.channel.send(avatarEmbed);
}
  


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

when i use this, it doesnt send the gif

sinful lotus
#

tbh you can just use the link directly

west spoke
#

^

sinful lotus
#

instead of "requesting" it again

west spoke
#

Send it without a embed

grizzled spruce
#

when i use the link directly it sends the same gif every time

sinful lotus
#

because you are using the same link

west spoke
#

^

sinful lotus
#

why would it give you a different picture if you are using the same link for a gif?

#

Doing that is not only useless, but it will also give you the same gif

grizzled spruce
#

oh wait

#

lol my bad

#

ty

fiery stream
#

hi

pallid zinc
#

Eval don't work after hosting on vps?

grim aspen
#

well...

#

we might've crashed the bots

pallid zinc
#

Yup

grim aspen
pallid zinc
#

My eval not working after hosting

grizzled spruce
#

yen[message.author.id].coins - 100;

grim aspen
#

yeah, discord's taking a shit with api

grizzled spruce
#

In my code, I’m supposed to have to pay 100 for each slot played. But it’s only removing 12

pallid zinc
#

Mean

grizzled spruce
#

yen[message.author.id].coins - 100;
In my code, I’m supposed to have to pay 100 for each slot played. But it’s only removing 12
Anyone help?

pallid zinc
#

Use discord-money or discord-economy for this

fiery stream
#

dayum the money bot is hard huh

#

discord-eco**

pallid zinc
#

Yup

fiery stream
#

lol thank god i am not doing it

pallid zinc
#

Ok

#

I am done with it

fiery stream
#

ohhk

grizzled spruce
#

Anyone who can help me?

fiery stream
#

sure whats the prob

pallid zinc
#

We don't understand what you mean

grizzled spruce
#

yen[message.author.id].coins - 100;
In my code, I’m supposed to have to pay 100 for each slot played. But it’s only removing 12
Anyone help?

#

Note the code I sent has -100 after the data that has my coins stored

fiery stream
#

whas yen suppose to be?

grizzled spruce
#

yen is Japanese currency lol

sinful lotus
#

console.log the coins

fiery stream
#

ohh lol

pallid zinc
#

Yup

sinful lotus
#

I wanna see what is inside it

fiery stream
#

yea &^^^

grizzled spruce
#

Imma a dumb coder plz elaborate

pallid zinc
#

Nano you working with daily think

grizzled spruce
#

?

fiery stream
#

?

pallid zinc
#

You want daily command

grizzled spruce
#

Noooooo

pallid zinc
#

Sorry for rip english

#

Pay

grizzled spruce
#

Nonono

pallid zinc
#

Take

grizzled spruce
#

It’s a slot command

#

And it costs 100 each slot you do

sinful lotus
#

how can you not understand console.log

#

thats beyond being dumb lmfao

grizzled spruce
#

I mean ik what it is

sinful lotus
#

literally console.log then coins

grizzled spruce
#

OH

sinful lotus
#

I cant debug something if idk what coins is

grizzled spruce
#

I’m a fucking idiot

#

Lol

sinful lotus
#

Im not a magical developer

grizzled spruce
#

Ik what you mean

pallid zinc
#

Hmm

grizzled spruce
#

One second

pallid zinc
#

I don't understand

#

What you want

fiery stream
#

TypeError: Cannot set property 'os' of undefined 
sinful lotus
#

read stacktrace

pallid zinc
#

Change your operating system

grizzled spruce
#

@sinful lotus

sinful lotus
#

probably its because its like that thats why it isnt subtracting right

#

I exepected a whole number not a number with ; then a new number

#

probably 16.9 would work but I dont think 19 ; 9 would work

#

check how you save your c urrencies probably based on your logs

earnest phoenix
#

Hey

errant ocean
#

Or it might be because you use light theme

grizzled spruce
#

I don’t

errant ocean
#

I

earnest phoenix
#

@grizzled spruce
Can help me

grizzled spruce
#

?

west spoke
#

@earnest phoenix what do you need help with

earnest phoenix
#

Mmm iam speak arabic @west spoke

west spoke
#

...

#

....

#

.....

earnest phoenix
#

Iam not Speak english

west spoke
#

I can tell.

earnest phoenix
#

What?

#

لم افهم