#development

1 messages · Page 500 of 1

earnest phoenix
#
Debugger listening on ws://127.0.0.1:36505/2f565a59-e773-41d4-91de-8b0f59576cc1

Debugger attached.

module.js:549

    throw err;

    ^



Error: Cannot find module 'discord.js'

    at Function.Module._resolveFilename (module.js:547:15)

    at Function.Module._load (module.js:474:25)

    at Module.require (module.js:596:17)

    at require (internal/module.js:11:18)

    at Object.<anonymous> (c:\Users\darkr\Desktop\Fairy Bot\index.js:1:79)

    at Module._compile (module.js:649:14)

    at Object.Module._extensions..js (module.js:663:10)

    at Module.load (module.js:565:32)

    at tryModuleLoad (module.js:505:12)

    at Function.Module._load (module.js:497:3)

Waiting for the debugger to disconnect...

Error: Cannot find module 'discord.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (c:\Users\darkr\Desktop\Fairy Bot\index.js:1:79)
    at Module._compile (module.js:649:14)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
lament meteor
#

...

#

pls

earnest phoenix
#

?

lament meteor
#

it is clear the error

earnest phoenix
#

is?

#

ik what is the problem but can't suppr him

#

hello?

gritty granite
#

Do npm install discord.js

languid dragon
#

"but can't suppr him"?

slate kayak
#

morning all can somebody help me with the api please for d.js

languid dragon
#
slate kayak
#

i have that @languid dragon i just need to do the api so that it shows on my bots how manny servers are the bot on DBl

languid dragon
slate kayak
#

because im tired of always asking i also whent to discord and they say DBL is shit 😦 so yeah im starting to hate what i am doing at this stage @languid dragon

languid dragon
#

why would you go to Discord for something we created

slate kayak
#

oh and my bots were kicked from there also

languid dragon
#

from where?

slate kayak
#

discord

languid dragon
#

ok..

bright spear
#

You're not really making sense lol

slate kayak
#

but is there a way for somebody to help me with it im not sure if i must the whole code or just some part of it

bright spear
timber olive
#

Hello. I'm trying to make my first discord bot. I'm following this guide https://www.digitaltrends.com/gaming/how-to-make-a-discord-bot/
When i get to Step 9 and try to run the command "npm install discord.io winston –save." It gives me this error message.

Digital Trends

Discord bots can make life a lot easier for users of the gaming-centric online chat application. Here's what you need to know to get started making your own Discord bots, from coding them to adding them to your servers.

#

Can someone pleasehelp me with that?

earnest phoenix
astral quail
timber olive
#

i copied it from Step 6

#

the package.json#

heady zinc
earnest phoenix
#

^

heady zinc
#

you can't really make a working bot with it, you may want to check "An Idiots Guide" for up to date guides

earnest phoenix
#

Use Discord.js or Eris.

astral quail
#

Eris +1

heady zinc
#

You'll be better off using discord.js if you're a beginner

timber olive
#

Alright i'll look into it. Thanks for the help.

restive silo
#

why does Digtital Ocean recommend d.io

knotty steeple
#

Digital Trends mmLol

restive silo
#

oh

#

nvm

lament meteor
#

wait iirc d.io isnt outdated anymore

earnest phoenix
#

Guys?

#

Can someone send me a SRC of Rich Prescence via DM? (Java is preferred)

clear hornet
#

Howdyho!
Having tons of irc-nostalgia with creating my little bot. What I can't really seem to find is a place to find out all possible uses for.. say message.xxx (like message.includes, startsWith etc etc) is that just javascript or for discord.js in particular or am I missing a major point? Tried looking it up in the documentation for discord.js but either I'm not good at reading or it isn't there

quartz kindle
#

message is a collection, which is a form of javascript map()

#

you can look up methods for javascript maps in the mozilla docs

earnest phoenix
#

Guys I need a Src of a Rich Prescence Example (JDA pls)

quartz kindle
#

message.content gives you a string, which you can lookup methods for strings

#

includes works for strings and arrays

#

startswith works for strings

clear hornet
#

@quartz kindle thanks dude, already reading the mozilla docs 😃

earnest phoenix
#

Oof

quartz kindle
#

other than that, each discord collection also has its own methods

earnest phoenix
#

And whats with me?

quartz kindle
#

for example, message.content (the content part is discord`s own method)

clear hornet
#

but what I'm asking for is called methods I gather?

quartz kindle
#

yes

#

its like a function that is applied to something, usually data followed by a dot and a function

clear hornet
#

yeah grasping the usage but failing to find some kind of list with all possible methods

quartz kindle
#

you can see proprieties and methods for message

#

proprieties are things that give you a value, methods are functions that are executed on it

clear hornet
#

so ok, those are in addition to what is considered to be "standard" ?

#

as in, "includes" doesn't exist on that list, hence I discarded the list as not the thing I was looking for

quartz kindle
#

yes, everything that is on discordjs's documentation is their specific methods

#

the standard javascript methods are not listed there, but you can find them in the mozilla docs

clear hornet
#

awesome, just what I wanted!

earnest phoenix
#

Omg

quartz kindle
#

just pay attention to data types

earnest phoenix
#

Thanks for ignoring me

quartz kindle
#

methods for strings, arrays, objects, maps

#

@earnest phoenix you wont get anything by asking like that. i dont have what you need, and i dont think anyone's gonna spoonfeed you in dms

earnest phoenix
#

Wth is spoon-feed

#

Preach.

#

You didn't even ask actually

quartz kindle
#

spoonfeed = giving full code for someone to copy and paste

earnest phoenix
#

You just made a sarcastic comment
I wouldn't expect to get help that way...

clear hornet
#

People here seem to be nice and forthcoming, so if you don't get the response you expect, then perhaps you should consider altering your methods of acquiring what you seek @earnest phoenix

quartz kindle
#

well said :3

clear hornet
#

And thanks a bunch for the patience 😃

wheat marten
#

Should I use commando?

quartz kindle
#

whatever you want. i prefer not to

earnest phoenix
#

Same.

#

From my experience commando is very slow

#

Compared to other bot frameworks.

#

Ajnd especially compared to writing your own framework.

earnest phoenix
#

How do i make a bot

proven lance
#

you take some code, shove it in a box, catch it on fire

earnest phoenix
#

Lol

#

I know how code

#

I have my own bot

proven lance
#

asking how to add your bot?

earnest phoenix
#

Put ur bots client ID in id=CLIENTID

#

@proven lance

proven lance
#

why?

earnest phoenix
#

Then u get the option 2 add it 2 a server

#

For EX

proven lance
#

yes, but why am I doing that?

earnest phoenix
#

So u can add it 2 your server @proven lance

proven lance
#

oh, I wasn't asking how I can, I was asking if you were asking for that

earnest phoenix
#

Oh no

prisma sedge
#

Can someone unmute my bot

#

Pls

earnest phoenix
#

@prisma sedge what was the mute reason?

prisma sedge
#

Ping at joining

#

Is fixed

earnest phoenix
#

I would recommend pinging one moderator with the bot name/ID and its mute case.

#

If he/she doesn't respond just DM one.

prisma sedge
#

Ok

#

@earnest phoenix Could you please unmute my bot @carmine dome (479698613795160084)

#

Thanks!

earnest phoenix
#

why does this send 3 times in the response and why does it not say what the args where??

if(message.channel.type === "dm") {
    var args = message.content.split(" ").slice(0)
    var args = args.slice(0).join(" ")

    let embed = new Discord.RichEmbed()
    .setTimestamp()
    .setTitle("Direct Message To The Bot")
    .setDescription(`Message: `,args)
    .addField(`Sent By:`,`<@${message.author.id}>`)
    .setColor("RANDOM")
    .setThumbnail(message.author.displayAvatarURL)
    .setFooter(`DM Bot Messages | DM Logs`)
   
    client.users.get("274284493043531776").send(embed)
  }
lucid iris
#

Quick TypeScript question: why won't this work on my tsconfig:

  "node_modules",
  "**/*.model.ts",
  "**/*.models.ts"
]```
?
I've been reading on it and I see lots of people not managing to get exclude to work but few solutions and none work.
urban jay
#

What are you expecting excluding the files should do?

lucid iris
#

I expect those files not to be transpiled to JS files.

earnest phoenix
#

guys

#

i have installed

#

vsfpt

#

on my linux

#

now i am connected to the server using filezila

#

i get this message when i upload my files

#

do i need to zip the files?

#

because my website was in files

#

make sure the directory is correct, and that there is no typo

#

why wont this work for me?

//this bit send embed, but the output part in description says output but not the code part
 if (message.author.id !== ownerID) return message.channel.send("You are not authorized to use this command."); 
    if (message.content.toLowerCase() == "--eval bot.commands") {
        let codein = args.join(" ");
        let code = eval(codein)
           let commandsEmbed = new Discord.RichEmbed()
 
           .setAuthor("Evaluate")
           .setColor("Blue")
           .setDescription('📤 Output', `\`\`\`js\n${code}\n\`\`\``)
           .setFooter(footer)

        return message.channel.send(commandsEmbed);
    }
//this bit works
    try {
        let codein = args.join(" ");
        let code = eval(codein);

        if (typeof code !== 'string')
            code = require('util').inspect(code, { depth: 0 });
        let embed = new Discord.RichEmbed()
        .setAuthor('Evaluate')
        .setColor('GREEN')
        .addField('📥 Input', `\`\`\`js\n${codein}\`\`\``)
        .addField('📤 Output', `\`\`\`js\n${code}\n\`\`\``)
        message.channel.send(embed)
    } catch(e) {
        message.channel.send(`\`\`\`js\n${e}\n\`\`\``);
    }
}
#

ping me*****

earnest phoenix
#

How do we use the bot owner’s Id ?

ruby dust
#

wdym?

earnest phoenix
#

?

#

What is the variable ?

west raptor
#

wut

faint tiger
#

Does anyone know how to always keep your bot online?

west raptor
#

vps

#

or self host via RPi (or something of the sort)

faint tiger
#

Okay, thanks!

west raptor
#

np

earnest phoenix
#

ik how to do named links in an embed but i never knew you could make a link show different info when hovered over

bright spear
#
[text](link "hover")```
earnest phoenix
#

oh

#

thanks 👍

bronze wagon
#

can anyone help me to make bot change activity on every 10 seconds?
e.g. i want to change client.user.setActivity(text_1); to client.user.setActivity(text_2);

quartz kindle
#

10 seconds is kinda too fast, do you really need it to be 10 seconds?

#

its much better 1 minute or 5 minutes

bronze wagon
#

i mean i just want it to change

#

without reseting the bit

#

bot

west raptor
#

10 seconds is going to get you ratelimited anyways, right?

bronze wagon
#

not literally 10 seconds, just as an example

west raptor
#

ah

bronze wagon
#

i cant find anything on google

quartz kindle
#

are you using javascript?

bronze wagon
#

yes

quartz kindle
#

then just do setInterval

bronze wagon
#

setInterval(1000) ?

#

for 1 sec

#

;

quartz kindle
#

no, google setinterval

#

setInterval(function,timer)

bronze wagon
#

got it, tnx

junior hornet
#

hi im using discord.js and i messed up some of my code can anyone help point out wats wrong const token = process.env.TOKEN;
const fs = require('fs');
const commands = {};
fs.readdirSync('./commands/').forEach(file => {
commands[file.substring(0, file.length - 3)] = require('./commands/' + file);
})

#

if you have any help plaese @me

night imp
#

Error?

#

@junior hornet

junior hornet
#

yes

night imp
#

post please

junior hornet
#

post wat

night imp
#

The error

junior hornet
#

oh ok

#

const token = process.env.TOKEN;
const fs = require('fs');
const commands = {};
fs.readdirSync('./commands/').forEach(file => {
commands[file.substring(0, file.length - 3)] = require('./commands/' + file);
})

night imp
#

That's your code

junior hornet
#

its some were in that

night imp
#

What does it say in the console

junior hornet
#

not all

#

do you want me to send all the code

night imp
#

No

#

The error

#

Why it doesn't work

junior hornet
#

i dmed you the code its in sever

knotty steeple
#

the error not the code

kind nexus
#

Yo homies, I code in c#,
I'm trying to have the bot changed the user's nick in the server, and this is what I have so far,

await ((SocketGuildUser)Context.User).ModifyAsync(x => x.Nickname = $"[H]{Context.User.Username}");````
Right under it I have the bot send a message it's not even sending the message?!
Halp
prime cliff
#

@kind nexus bots cannot change nicknames of users who have the same or higher role and can never change the server owners nickname you need to if (BotHasPerms) or wrap it in a try catch

kind nexus
#

mmmm

sick cloud
#

👀

west raptor
#

uh

bright spear
#

probably discord borked

kind nexus
#

I didn't do the command @prime cliff

#

I went on an alt and did it

prime cliff
#

Wait what

kind nexus
#

oh wait

#

1 sec

#

so basically

#

I made a role that has the second highest perms

#

I forgot to give it to the bot tho 😆

#

I'm so dumb

earnest phoenix
#

So im trying to create a skip command that if a user has the role 'DJ' that it skips without votes, and if they dont then its voting to skip
But it doesnt do anything at all
(node:8711) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

On line 4
http://hatebin.com/baucjmvqnc

west raptor
earnest phoenix
#

bot.guild.roles.get ?

west raptor
#

yes

#

no

earnest phoenix
#

roles is a prop of guild

#

??

#

;-;

west raptor
#
<Guild>.roles.get('id')```
earnest phoenix
#

so define the guild separtely?

#

As Faso pro my bot go Pro Google and manages to leave it on 24h

west raptor
#

or just do js msg.guild.roles.get('id')

earnest phoenix
#

Ooooh ok

#

Thanks dream

#

or

#

jonny 2 i guess

west raptor
#

np

earnest phoenix
#

It cleared the error but it is still doing vote skipping

#

@west raptor

west raptor
#

hold on

earnest phoenix
#

k

faint tiger
#

@client.event async def on_message(message): if message.author == client.user: return if message.content == "!b": await client.send_message(message.channel, message.content[::-1])

#

How do I make it so that if a message cotains !b, the incomming msg will be backwards

#

instead of only !b being backwards

quartz kindle
#

== only does exact matches, you have to use a contains/includes function

earnest phoenix
#

Did you ever figure it out dream?

west raptor
#

it looks fine to me

#

but im just glancing at it

#

are you running the command out side a server with the role?

earnest phoenix
#

no

#

The bot is a single server bot

west raptor
#

🤔

#

weird

earnest phoenix
#

(and yes i do have the role)

#

but it just completely ignores the dj code thonkku

quartz kindle
#

try doing .has(ID) instead of has(role)

west raptor
#

oh yea

#

it only accepts an id

earnest phoenix
#

I will try it

#

😄

#

Thanks guys

timber olive
#

When i try to run my bot it tells me "An invalid token was provided". I regenerated the token a few times now but the error still persists.

sinful lotus
#

make sure you update and save everything

timber olive
#

i did

sinful lotus
#

did you?

timber olive
#

Oho, found something

#

I have my token in a config.json and giving it to my code with config.token. When i put the token directly into the code it works

#

I also have my prefix and a variable in the config but these work

sinful lotus
#

make sure you update and save everything this is the answer on your problem

earnest phoenix
#

Can someone switch this if message.content == "its": await client.send_message(message.channel, "it's*") from python to JavaScript??

#

Recommend reading up on the basics here

#

That doesn't say how to switch it

low rivet
earnest phoenix
#

@earnest phoenix

#
if message.content.startWith("Its") {
 message.channel.send("It's*")
}
#

next time, just learn to do it

#

Damn no reason to come off like that

west raptor
#

or just dont spoonfeed them

hushed berry
#

@earnest phoenix why would you do that though -- "its" is valid in some situations

earnest phoenix
#

@loud salmon so how to i implement it in nodeJS?

#

@hushed berry you look like you know a lot then can you tell me how to insert that?

loud salmon
#

I dont actually know nodejs

earnest phoenix
#

into my code

#

alright @loud salmon

hushed berry
#

I don't have any extensive JS experience, sorry

loud salmon
#

Its my halloween costume

earnest phoenix
#

😦

hushed berry
#

if you need groovy help, im your man though

earnest phoenix
#

how can i add the time someone joined the server to my userinfo commands

west raptor
#

docs are very nice

earnest phoenix
#

ye, i figured it out with testing

#

but how do i make this ignore @everyone role

#
        .addField("Roles:", member.roles.map(roles => `${roles.name}`).join(', '))

astral quail
#

You can also change this:
member.roles.map(roles => `${roles.name}`)
to this:
member.roles.map(roles => roles.name)
Looks a bit cleaner.

earnest phoenix
#

i dont understand that filter method

#

would this work

.addField("Roles:", member.roles.filter(r => r.name !== '@everyone').map(roles =>`\*\*\`${roles.name}\`\*\*`).join(', '))
west raptor
#

try it

earnest phoenix
#

yup, works like a charm

astral quail
#

You want to make the role names bold?

earnest phoenix
#

ye

astral quail
#

You can just do **${roles.name}**

earnest phoenix
#

i know

#

i just had the above saved somewhere in my files and i like it with the *\ anyways

astral quail
#

okay, good.

cursive dagger
#

Toast what language?

next tiger
#

python

cursive dagger
#

async or rewrite?

next tiger
#

async

cursive dagger
#

youtubeDL right?

next tiger
#

yeah

cursive dagger
#

can i take a look at ur audoi?

#

*code

next tiger
#

yeah, its not public or anything

#

theres two parts to the code

#

the bot part

#

and the the talking part

#

like when someome says hello it responds basically

cursive dagger
#

Eh just send me the music part xD dont need anything more than that xD

next tiger
#

im running python 3.6.6

#

ill dm it

earnest phoenix
#
  let mArgs = args.join(", ");
  let math = Math.max(parseInt(mArgs));
  
  let embed = new Discord.RichEmbed()
  .setDescription(`The maximum value out of **${mArgs}** is **${math}**`)

This outputs the minimum value instead of the max

west raptor
#

mArgs is a string

earnest phoenix
#

Look at your code and how you are parsing

west raptor
#

parsing the string

#

yea

earnest phoenix
#

...

#

,

#

, isnt a number is it

#

Why are you joining the array

west raptor
#

its going to grab the first number

earnest phoenix
#

You can give math.max aan array with the spread operator which is why I prefer

#

Yeah He is right

#

It will find the first available number

#

"You can give math.max an array with the spread operator which is why I prefer"

#

^^^^

#

??? just give it args Omegaroll

#

args 0 args 1 my man

#

math.max will work for string

earnest phoenix
#

embed.fields[0].value: This field is required

#

What does that error mean

#

Its annoying to read through the console with those

west raptor
#

means the value is empty

earnest phoenix
#

so...

#

Like what is causing it

astral quail
#

Fill it up lol

west raptor
#

whats your code

earnest phoenix
#

which file? o.O

astral quail
#

the embed...

west raptor
#

what does this mean?

#

i kinda understand it

#

but not completely

earnest phoenix
#

whats a .ts file

#

typescript?

west raptor
#

yes

earnest phoenix
#

oh lol

#

(node:16205) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

I fixed the embed error but...

west raptor
#

The bot doesn't have permissions

earnest phoenix
#

it should

#

🤔

west raptor
#

Whats the command doing?

earnest phoenix
#

Uhh

#

Its everytime someone sends a message lol

west raptor
#

oh

#

so

#

what is the event doing

earnest phoenix
#

Lemme check

#

Just sending an embed

#

Manage messages?

west raptor
#

It doesn't have embed perms then

#

lmao

earnest phoenix
#

lol

#

uhh

west raptor
#

oh

#

h

earnest phoenix
#

message.guild.owner.send

#

?

#

er

west raptor
#

@woven sundial guildCreate event

earnest phoenix
west raptor
#

uh iirc yes

earnest phoenix
#

It has perm int 8

#

???

#

it should have admin

west raptor
#

let me see

earnest phoenix
#

hmm my bot should have administrator in all servers 🤔

astral quail
#

Just try it out.

west raptor
#

yes

#

that should work

#

might be better to not dm the owner though

earnest phoenix
#

Is there a way i can filter out the errors in the console?

#

like specific ones

west raptor
#

loop through the channels and send to the first one it has perms in is my recommendation @woven sundial

#

np

#

oof doesnt look like anyone has a answer to my question

#

sad

steel heath
#

Mongo-DB, mongoose or postgres, which is better for a sharded bot? Speed, system usage etc. things

earnest phoenix
#

mongodb is the db, monoose is just ODM so you can have predefined scemas and stuff

#

but between postgres/mongo is not really a speed question, more of a design question --what do you need for your app? relations or documents. only you can answer that

molten slate
#

Hello.

earnest phoenix
#

dont believe me just why

topaz fjord
#

explain your problem

earnest phoenix
topaz fjord
#

Stop

earnest phoenix
#

pfttttttttttttttt

#

https://www.youtube.com/watch?v=PEGccV-NOm8

topaz fjord
#

Post in off topic

earnest phoenix
#

ok mum

topaz fjord
#

This channel is for bot development only

earnest phoenix
#

no

#

i can talk here

#

stfu

#

@earnest phoenix

topaz fjord
#

@earnest phoenix stop lurking smh

earnest phoenix
#

i cant help it

topaz fjord
#

what about that

#

I don't see any error

#

Or know what the expected behavior is

#

.type has nothing to do with size

#

.filter

#

message.guild.channels.filter(m => what ever you want to do with m)

#

yes

wet ferry
#

When will verification applications be open?

earnest phoenix
#

Whenever they do

#

I can guarantee that it won't be today

vital cradle
#

Can someone help me make a bot using discord.js?

earnest phoenix
earnest phoenix
#

if i add this to my message event will it ignore other bots, not work in dm, and react with an x to the message?

    if (message.channel.type === "dm") {
        message.react(":x:"); 
        message.author.send("Can/'t Use Commands In DM!")
 return;
        }
    if (message.channel.type === "dm") return;
    if (message.author.bot) return;
vital cradle
#

Can someone help me host a bot?

earnest phoenix
#

Heroku or Glitch

smoky spire
#

Or a decent host

earnest phoenix
#

if paid then idk but if ya want for free then one of the above

#
    .setDescription(":gear: " + `Succesfully cleared ${deleteCount} messages\nBy: ` + "`` "+ `${message.author.username}` + `` + " ``\nIn: ` + `` "+ `${wydy}` + `` + " ``")

how would i make it so in the part where it says wydy it would say what channel the messages where purged in?

west raptor
#

oh my

#

that code

#

is ugly

#

like being straight up honest

earnest phoenix
#

i dont care

#

im tryna make it so if someone types in dm to bot it does nothing

#

but if its a command then it will send error saying cant use commands in dm then return;

#

nvm, forgot to double / a line

#

Is this a good JSON file. Like easily being able to parse it and add users to it?

{
    "guilds": {
        "10020": {
            "users": {
                "000111": {
                    "username": "A Discord User",
                    "discrime": "4063",
                    "amount": 5,
                    "reasons": [
                        "this",
                        "is",
                        "a",
                        "warning",
                        "test"
                    ]
                }
            }
        }
    }
}
astral quail
#

Just use a different json file for each guild

earnest phoenix
#

oh

#

Hopefully there aren't like 2,000 JSON files

astral quail
#
  {"userid":"2897342397492", "amount": 1, "reasons":['test']},
  {"userid":"2897342397492", "amount": 1, "reasons":['test']}
]```
#

If you have 2000 guilds, I would switch to a database instead of json files.

earnest phoenix
#

I don't though

#

So if I needed to get an individual user, how would I search for the user id?

astral quail
#

you using discord.js right?

earnest phoenix
#

No

astral quail
#

not sure.

#

just check the docs, it's in there.

earnest phoenix
#

Do you think I should store all the info in one JSON?

night imp
#

@earnest phoenix use a real db

#

Faster and scalable

earnest phoenix
#

My bot is only in 16 guilds

heady anvil
#

what "info"

night imp
#

JSON is nice for small configs not databases

earnest phoenix
#

@unborn cairn

heady anvil
#

JSON is good for configurations that will generally not change

earnest phoenix
#

Yeah 16 guilds

west raptor
#

still

#

you should use a db

night imp
#

Even if it is 16 don't you expect it to grow?

heady anvil
#

Databases such as MongoDB or MySQL are very powerful and scalable, which you should use to store often changing data from the start

earnest phoenix
#

no not really

night imp
#

Even sqlite will be better

earnest phoenix
#

If I'm going to do a database then I'll use MySQL

night imp
#

Which doesn't require you to host it

#

MySQL is good too

heady anvil
#

hosting a database is no problem really

night imp
#

(just put that there incase he uses glitch)

earnest phoenix
#

Still isn't adding to my JSON file

def addwarning(guild: str, userid: str, reason: str):
    aw = warns["guilds"][guild]["users"][userid]["reasons"].append(reason);
    json.dumps(aw);
    print("Done!");

addwarning("10020", "000111", "this is a reason test plz work :)");
#

How do I add the new value to the JSON file?

#

Someone

#

please

#

help

eager kite
#

.addField("Total Member", `${bot.users.size} Members`, true)

#

this is mine rn

earnest phoenix
#

ok

steel heath
#

How do you get a data from a MongoDB collection with mongoose mention pls

timid pumice
#

..

wheat marten
#

How do I make a command that posts the avatar icon of somebody but with a filter?

earnest phoenix
#

@steel heath Have you tried looking on the mongoose docs?

steel heath
#

Yeah, found something like

var BlaSchema = new Schema({ name: String, age: Number });
var foo = mongoose.model("bar", BlaSchema)
foo.find({})```didn't work
earnest phoenix
#

Well, everything is there...

#

I wouldn't wait for someone to tell you something that you could find yourself in a few minutes

#

Never used mongoose, otherwise I would help

steel heath
#

hmh, docs r pretty complicated for me but thanks anyway

earnest phoenix
#

I personally use an ODM called mongorito.

#

I don't like how mongoose uses schemas

#

I switched to mongodb for the sole purpose of getting away from schemas

#

@steel heath

#

Mongorito documentation is fairly easy to understand

steel heath
#

oh thank you

mild quarry
#

I'm getting an error when I run this command: ```python
@client.command()
async def adduserinfo(message):

print(message.author.id)

f = open("userlist.txt","a")

if message.author.id in open('userlist.txt').read():
    await client.say("Your user ID is already in the file.")
else:
    f = open("userlist.txt","a")
    f.write(message.author.id)
    await client.say("Added your user ID to the file.")

f.close()```

Error: raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param)) discord.ext.commands.errors.MissingRequiredArgument: message is a required argument that is missing.

knotty steeple
#

well you are missing message when you run the command

vital cradle
#

Someone willing to help me make a bot?

kind nexus
#

So homies

#

I'm making a discord bot in C#

vital cradle
#

Can you help me make a bot?

mild quarry
#

wdym @knotty steeple

kind nexus
#

and I'm trying to edit the channel permissions of a channel

#

YEAH

#

😆

vital cradle
#

Can someone help me make a bot?

kind nexus
#

What about it?

knotty steeple
#

you are doing <prefix>adduserinfo instead of <prefix>adduserinfo somethinghere

#

@mild quarry

mild quarry
#

Ok

vital cradle
#

@knotty steeple Can you help make me a bot?

knotty steeple
#

no

kind nexus
#
await EventChannel.GetPermissionOverwrite.EveryoneRole(x => ChannelPermission.Speak = false);```

EventChannel and EveryoneRole are properly established
#

but It has an issue with "GetPermissionOverwrite"

knotty steeple
#

u can learn to code

kind nexus
#

@vital cradle What about making a bot?

#

do you need help with?

vital cradle
#

Ye

kind nexus
#

Which part?

vital cradle
#

Coding

knotty steeple
#

learn a programming language

kind nexus
#

Cause we're not just gonna make a bot for you

knotty steeple
#

first of all

kind nexus
#

Python is a good beginner coding language

vital cradle
#

It called teaching.

knotty steeple
#

javascript also

#

but i code in both mmLol

kind nexus
#

I prefer C# 😆

#

It's just MY personal preference

vital cradle
#

I wanna code in Discord.js

kind nexus
#

ew

#

I don't like .js

knotty steeple
#

no u

kind nexus
#

node

knotty steeple
#

do you know how to make a bot @vital cradle

kind nexus
#

😆

vital cradle
#

What do you suggest @knotty steeple

knotty steeple
#

for what

kind nexus
#

Why doesn't I have the bot developer role? 😆

vital cradle
#

Code

kind nexus
#

How do you get it?

grim elk
#

Submit a bot.

#

Get it approved.

knotty steeple
#

submit a bo- look up ^

kind nexus
#

😆

#

How exactly?

grim elk
#

Don't let the bot die for any reason afterwards.

vital cradle
#

And need help, the description requiring 300 characters, what should I put?

kind nexus
#

xD

grim elk
#

Describe your bot and then have a list of commands.

earnest phoenix
#

-bots @kind nexus

gilded plankBOT
#

This user has no bots

kind nexus
#

ooo

#

Ok

#

thanks 😄

grim elk
#

That's what a lot of people do for their description.

earnest phoenix
#

i mean

#

its bot devolpers

vital cradle
#

-bots @grim elk

gilded plankBOT
#
The Freaking iDroid#7457
Bots

@peak plinth

kind nexus
#

-bots @earnest phoenix

gilded plankBOT
#
Bakagain#1844
Bots

@primal viper
@onyx marten

earnest phoenix
#

it says bot devolpers

vital cradle
#

What ur bot @grim elk?

earnest phoenix
#

@peak plinth

kind nexus
#

anyways......

#

I need to get the permission overwrite 😆

#

oh wait..

grim elk
#

Have fun.

kind nexus
#

I remember someone telling me about "something#GetPermissionOverwrite" 😆

#

I forgot the other part...

#

Oops

#

hehe

grim elk
#

@vital cradle if you're using discord.js for your bot, all I can say is read the docs, look at the examples (if there are any), read a lot, and code.

knotty steeple
#

there are tons of examples

vital cradle
#

What do you use?

grim elk
#

#1 thing you absolutely have to do: Read so much, your head will spin.

late hill
#

Something like this @steel heath ?

const mongoose = require('mongoose');

const ExampleSchema = mongoose.Schema({
    a_var: String,
    another_var: Number
});
const Example = mongoose.model('Example', ExampleSchema);
//No name for collection specified so mongoose will add an 's' to the model name (collection will be 'examples')

Example.find({}, function (err, results) {
    //results -> array of all documents in collection 'examples'
});

Example.findOne({}, function (err, results) {
    //results -> first document in collection 'examples'
});

Example.find({a_var: "Match this"}, function (err, results) {
    //results -> array of all documents in collection 'examples' where 'a_var' equals 'Match this'
});

Example.findOne({another_var: 2}, function (err, results) {
    //results -> first document in collection 'examples' where 'another_var' equals 2
});
#

mongoose.connect(connectionstring) to connect to your db

#

In case you didn't know that yet 👀

kind nexus
#

Yo dudes

#

I'm coding in C#,
I'm trying to have the bot edit the permission of a channel so that a certain role can't speak

#

I have "EventChannel" set as the channel and "EveryoneRole" set as the role to be edited

earnest phoenix
#

ok

kind nexus
#

How would I exactly change the perm of the role in the channel perms

#

That sentence was confusign ^^

#

^^ Not as confusing as that one

earnest phoenix
#

so what lib

kind nexus
#

library?

#

😆

earnest phoenix
#

yes

kind nexus
#

umm

#

Like .NET

#

.NETCORE

#

?

#

😆

#

I'm so sorry

earnest phoenix
#

pls

#

idk

#

try this

idle mountain
#

I'm a C#/d.net dev if you still need help

#

ping me

kind nexus
#

yeah

#

I do 😆

#

@idle mountain Get over here babe

#

I need your help

#

no homo

idle mountain
#

okidoki

#

alright lemme remember how to do this brb

#

alright so where are you? like there are two steps, getting the role, and then changing the perms, have you figured out the first part?

#

wait

#

oh you're trying to edit a channel?

#

to stop a certain role from speaking?

kind nexus
#

yeah

#

I have the channel and the role

#

I have them set

idle mountain
#

do you know how to unbox?

kind nexus
#

?

#

I guess not then 😆

idle mountain
#

alright so you need to unbox the channel to type SocketGuildChannel, which is done with the as keyword

#

ie e.Channel as SocketGuildChannel

#

if you don't do this, it won't let you edit the guild info on the channel

kind nexus
#

I don't know how to unbox

idle mountain
#

(I use e as the context variable because that's was it was pre-0.9.6 but you probably use something else)

#

unboxing is what I just explained :P

#

e.Channel as SocketGuildChannel is unboxing

kind nexus
#

oh

#

So replace SocketGuildChannel with e.Channel?

#

Or

#

wait

idle mountain
#

do you have the current channel stored as a variable?

kind nexus
#

no

idle mountain
#

do you know how to do that?

kind nexus
#

wait

#

I have the role I want to edit stored as a variable

#

Yes

#

I'm pretty sure

idle mountain
#

can you show me the line of code you used to do that?

kind nexus
#
SocketGuildChannel EventChannel = Context.Guild.VoiceChannels.FirstOrDefault(x => x.Name == "Events");```
#

I mean

idle mountain
#

ohh so you already have that

#

oops

kind nexus
#

xD

#

Oops

queen sentinel
kind nexus
#

Hiii!!!!

queen sentinel
#

I'm not here

idle mountain
#

my setup for d.net is a bit different than the recommended

kind nexus
#

yeah

#

xD

idle mountain
#

so AddPermissionOverwriteAsync should be a function under EventChannel

kind nexus
#

yes

#

It is

idle mountain
#

first argument is the IRole, second variable can be initted with new OverwritePermissions() with the arguments to the latter being various enums

#

and you can set whatever you want

#

gimme 2 sec ill find the right one

austere sedge
#

How to make a nsfw command in python 3.6.5?

west raptor
#

if ctx.channel.nfsw:
thing

#

iirc

#

not sure lOl

idle mountain
#

ok figured it out im stupid lol

#

so it's like this: new OverwritePermissions(sendMessages:PermValue.deny)

odd scroll
#

👀

kind nexus
#

xD

#

sendmessages?

#

😆

west raptor
#

what

kind nexus
#

@idle mountain Would that be it?

#

oh

idle mountain
#

aren't you trying to deny the sending of messages?

#

if not, replace sendMessages with whatever

#

@odd scroll shut

kind nexus
#

Yeah

odd scroll
#

🤷

kind nexus
#

I did

idle mountain
#

so it all works fine?

kind nexus
#

well

#

IT's not tied to a channel

#

or a role

idle mountain
#

well you activate the AddPermissionOverwriteAsync on the channel object

#

that ties it to the channel

kind nexus
#

oh

#

on that?

#

on the cs new OverwritePermissions(speak: PermValue.Deny);

idle mountain
#

and then the first argument is the role, which is what ties it to the role

#

that's the second argument

#

so the full line should be something like cs EventChannel.AddPermissionOverwriteAsync(myRole, new OverwritePermissions(speak: PermValue.Deny));

#

or

#

im spoonfeeding a bit here but ya'll can fite me

#

you can do it externally as well

#

like set the OverwritePermissions to another value

#

like

#
OverwritePermissions p = new OverwritePermissions(speak: PermValue.Deny);```
kind nexus
#

oh

#

😆

idle mountain
#

and then use EventChannel.AddPermissionOverwriteAsync(myRole, p);

topaz fjord
#

what is this language

idle mountain
#

yeyeyeye

#

and you understand why that works, yeah?

#

@topaz fjord C#

kind nexus
#

Yes

topaz fjord
#

oh

idle mountain
#

alrighty, cool baens

kind nexus
#

I'm pretty postivie

#

It's not just the coding I like

#

I like when people EXPLAIN it to me

#

So I'm actually LEARNING something

idle mountain
#

yeyeye

#

it's always nice 👌

merry portal
topaz fjord
#

are you posting server count to the api

earnest phoenix
#

Can i do .../file to get a file that is 2 folders out?

topaz fjord
#

../../

merry portal
#

@topaz fjord yes

earnest phoenix
#

oh ok

#

../../file.ext

#

thanks

topaz fjord
#

if you are using the d.js lib it posts every 30 mins

earnest phoenix
#

What's the point of posting every 30 minutes? 👀
Just post whenever you get a new server

zenith moss
#

Smart xD

bright spear
#

@earnest phoenix thats more spammy

topaz fjord
#

but api is 60req/s isnt it?

earnest phoenix
#

I'm just going to assume that their bot isn't a huge bot

#

I know that for me, I've been doing that since day one and have had no issues

zenith moss
#

I wouldn’t need to worry, my bot is only in 4 guilds

earnest phoenix
#

If my bot is leaving/joining servers at a rate higher than 60 a second, I'll set a timer then

earnest phoenix
#
                        let arg1 = args.slice(1).join(' ');
                        if (!arg1) {
                            message.channel.send('Configuration Values:\n`logs:` sets the logs channel\n`mod:` sets the moderator role\n`prefix:` sets the prefix')
                        }
                        if (arg1 == logs) {
                            message.channel.send(`Set the logging channel to ${message.channel}`)
                        }
                        if (arg1 == mod) {
                            let arg2 = args.slice(2).join(' ')
                            if (!arg2) {
                                message.channel.send('You must supply a mod role.')
                            }
                            if (!arg2) {
                                let role = guild.roles.find(`name`, `${arg2}`);
                                if (!role) {
                                    message.channel.send(`Couldn't find the role \`${arg2}\``)
                                }
                                if (role) {
                                    message.channel.send(`Found the role \`${arg2}\``)
                                }
                            }
                        }
                    }
                    break;```
#

why does that always return config values

quartz kindle
#

JSON.stringify

#

or just dont parse body if you want to output text

rancid glade
#

thanks @quartz kindle

earnest phoenix
#

So I started using heroku for my bot
And I get this error in the logs:

Error: ENOENT: no such file or directory, scandir './commands/'

#

Whenever i run a command

#

dont use heroku

#

y

stone hatch
#

I am trying to make a new bot but this code won't work, I can't seem to find the error or understand it. Please help.

inner jewel
#

botconfig.json is malformed

earnest phoenix
#

@stone hatch client.on('error', console.error);

#

add that

#

it'll tell you the error

stone hatch
#

Hm?

#

I don't get it.

#

Do what?

#

@earnest phoenix

earnest phoenix
#

add

#
client.on('error', console.error);```
#

anywhere on the thing

stone hatch
#

ok

earnest phoenix
#

anywhere in the bot code

stone hatch
#

Done.

#

@earnest phoenix

earnest phoenix
#

?

stone hatch
#

I'm done.

#

Adding the code.

#

@earnest phoenix

smoky spire
#

@stone hatch botconfig.json is messed up

stone hatch
#

How?

smoky spire
#

Show it

stone hatch
#

No.....

#

It has my token in it...

smoky spire
#

Block out the token

stone hatch
#

K

#

I took out the token.

smoky spire
#

Remove the comma after the prefix line

stone hatch
#

ok

#

oh...

#

is it this ;

smoky spire
#

No

#

Just remove it

stone hatch
#

Done.

smoky spire
#

You need one after token

stone hatch
#

Done.

smoky spire
#

Try it

stone hatch
#

THANK YOU

smoky spire
#

👍

stone hatch
#

😉

mild tusk
#

sa

lost scarab
#

Does anyone know how to make fight command like dank memer bot

#

Like this

lost scarab
#

Anyone?

cursive dagger
#

@lost scarab yes xD

lost scarab
#

do u know how to do it? @cursive dagger

cursive dagger
#

yes

lost scarab
#

how?

#

Teach me

cursive dagger
#

just check if their next msg is x and store vars

lost scarab
#

ehm

#

thats kinda difficult for me

cursive dagger
#

?

lost scarab
#

im like new to this

#

xd

astral quail
#

That's why you have to learn JavaScript first.

lost scarab
#

so idk how to make those like more "hard" things

stone hatch
#

Anyone can help me with my error? This is for bot info code.

#

Code:

#

All solved now!

earnest phoenix
stone hatch
#

Oh.

#

So you are here too.

earnest phoenix
#

yes

stone hatch
#

Can you help me in DM thing I show you.

#

-waits patiently-

west raptor
#

Double check your if statement

stone hatch
#

if statment? ok

west raptor
#

You're missing a curly bracket

stone hatch
#

Where?

west raptor
#

It should be js if () { ... }

earnest phoenix
#

In the top layer

stone hatch
#

oh ok

#

It won't work still.

flat grove
#

i know

stone hatch
#

?

flat grove
#

just change message.channel.send(reportEmbed)

#

set reportEmbed

earnest phoenix
#

Problem with find

flat grove
#

not reportsEmbed

stone hatch
#

ok

earnest phoenix
#

It's before the send

flat grove
#

Nope @earnest phoenix

#

try @stone hatch

stone hatch
#

Ok.

earnest phoenix
#

Can't u see the output?

flat grove
#

it's working now ? @stone hatch

earnest phoenix
#

Of course not

flat grove
#

you lie

stone hatch
#

hold on

#

Thank you Volt.

#

It works fine now.

frail sierra
#

desmond to fix the pass a function instead use message.guild.channels.find(channel => channel.name == "reports");

stone hatch
#

Fixed already.

earnest phoenix
#

Oh, I'm stupid as fuck, sorry

stone hatch
#

It was the reportEmbed instead of reportsEmbed

earnest phoenix
#

It was only deprecation warning about find

stone hatch
#

Ok.

earnest phoenix
#

u better use .find(item => item === var) for example

stone hatch
#

Can someone tell me why my kick command won't work?

earnest phoenix
#

@stone hatch

stone hatch
#

Yes?

crisp pendant
#

message.channel.send

flat grove
#

yes

stone hatch
#

ok.

crisp pendant
#

Not message.send

stone hatch
#

but where is it

tough tinsel
#

message.channel.send("");

crisp pendant
#

Find it in the code

tough tinsel
#

this is will work

earnest phoenix
#

kick.channel.message.send''mod-log''

#

kick.channel.message.send''mod-log''

stone hatch
#

??

tough tinsel
#

lol

stone hatch
#

huh?

earnest phoenix
#

wait

#

1 min

flat grove
#

at the line 28 @stone hatch

stone hatch
#

ok

flat grove
#

at the line 28 of yout bot

stone hatch
#

Ok, but now..

#

It can't kick any members that have no perms.

#

And it says no can do pal.

flat grove
#

your bot have perms ?

crisp pendant
#

Show me your perms command

earnest phoenix
#

@stone hatch

stone hatch
#

K

earnest phoenix
#

return guild.channels.get(modlog.id).sendEmbed(embed);

stone hatch
flat grove
#

its' !

crisp pendant
#

Yeah if(!

#

You need the exclamation before @stone hatch

flat grove
#

if(!message.member.hasPerm

stone hatch
#

hUH?

#

Ok.

crisp pendant
#

And change kReason to your variable KReason

flat grove
#

yes

stone hatch
#

What do u guys mean?

#

The kReason's to KReason in the code

#

?

crisp pendant
#

You used the variable KReason as you put
‘’’ let KReason = ‘’’

stone hatch
#

ok

crisp pendant
#

Not

#

kReason

stone hatch
crisp pendant
#

Do they have perms in the role

stone hatch
#

?

#

They are members with no roles.

crisp pendant
#

Check if they have manage messages ticked on there user

stone hatch
#

ok

crisp pendant
#

Hmmm

#

Give me two seconds

stone hatch
#

OK

flat grove
#

line 28 : if(!message.member.hasPermission("MANAGES_MESSAGES")) return message.channel.send('You don't have permissions')

#

you have to write if(!

stone hatch
#

OK

#

Like this?

flat grove
#

yes

stone hatch
#

ok

crisp pendant
#

I don’t know if you have a command handler or not but this is my code for the kick

#

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

module.exports.run = async(bot, message, args) => {
let kickedUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!kickedUser) return message.reply("Couldn't find user.");
let reason = args.join(" ").slice(22);

if(!message.member.hasPermission("MANAGE_MESSAGES"))
  return message.reply("You don't have permission!");
if(kickedUser.hasPermission("MANAGE_MESSAGES"))
    return message.reply("This person cannot be kicked!");

let kickedChannel = message.guild.channels.find(`name`, "logs")
if(kickedChannel){
  let kickedEmbed = new Discord.RichEmbed().setTitle("Kicked").setColor("#00ffff").addField("Kicked User", kickedUser).addField("Kicked by", message.author).addField("Reason", reason);
  kickedChannel.send(kickedEmbed);
}

message.guild.member(kickedUser).kick(reason);

}

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

stone hatch
#

Look.

#

It wont work.

crisp pendant
#

Your line 29 states that if kUser does not have permission than ‘this person is not valid to be kicked’

stone hatch
#

So what do I have to do?

flat grove
#

yes

#

remove the !

#

at the line 29

crisp pendant
#

Yes

#

Remove the ! At line 29

stone hatch
#

Ok.

crisp pendant
#

Yes

flat grove
#

yes

stone hatch
#

K

crisp pendant
#

It work @stone hatch ?

stone hatch
#

Lemme try now.

#

No.

#

Broke the bot I guess.

flat grove
#

wait

#

line 40

stone hatch
#

?

flat grove
#

let kickChannel = message.guild.channels

#

with an 's'

stone hatch
#

?

#

So where is the s going?

flat grove
#

the guild channels

#

with s

#

not message.guild.channel

stone hatch
#

ok

flat grove
#

its' working ?

stone hatch
flat grove
#

yes try

earnest phoenix
#

Spoonfeeding zoomeyes

stone hatch
#

Nope.

#

Not working.

flat grove
#

error ?

stone hatch
flat grove
#
    message.mentions.users.first() || message.guild.members.get(args[0])
    );
    if (!kickedUser) {
    return message.channel.send("L'utilisateur n'existe pas !");
    }
    let kickReason = args.join(' ').slice(22);
    if(!message.member.hasPermission("MANAGE_MESSAGES")) {
        return message.channel.send("Vous n'avez pas les permissions pour faire cela !");
    }
    if(kickedUser.hasPermission('MANAGE_MESSAGES')) {
        return message.channel.send("Vous ne pouvez pas kick cette personne !");
    }
    let kickEmbed = new Discord.RichEmbed()
     .setDescription('Kicks')
     .setColor('#dc143c')
     .addField(
     'Utilisateur kické',
     `${kickedUser} (ID:  ${kickedUser.id})`
     )
     .addField(
     'Utilisateur ayant kické',
     `${message.author} (ID:  ${message.author.id})`
     )
     .addField('Canal', message.channel)
     .addField('Raison', kickReason);
     
    let kickChannel = message.guild.channels.find(`name`, 'reports');
    if (!kickChannel) {
        return message.channel.send(
        'Canal "Reports" introuvable. veuillez créer ce canal !'
        );
    }
    
    message.guild.member(kickedUser).kick(kickReason);
    kickChannel.send(kickEmbed);```
#

my code

#

i'm french ...

stone hatch
#

Ok.

earnest phoenix
#

Seriously, stop spoonfeeding before you get banned.

#

super spoonfeed

dense roost
#

Im super new to python and im trying to make a bot that autoassigns ranks based on activity

west raptor
#

learn python

dense roost
#

Yes.

#

That is what i trying to do

west raptor
#

learn

#

python

#

not

#

by making

#

a

#

bot

dense roost
#

ok

mild quarry
#

one last thing for a while
hhh is only storing the last line of the file to a variable

f = open('userlist.txt')

line = f.readline()

while line:
    st = line
    st = st[:-1]
    hhh = ('<@!' + st + '>')
    line = f.readline()
f.close()
print(hhh)

@client.event
async def on_message(message):
  if message.content.startswith(">embed"):
    embed=discord.Embed(title="hello", description= hhh, color=0x00ff40)
    await client.send_message(message.channel, embed=embed)```
How can I get it to store all of the lines?
Doing print('<@' + st + '>') works but storing it to a variable only gets the last line
quartz kindle
#

i dont know python, but im pretty sure you're replacing hhh with the next line on every loop

#

so you go through all the lines, but each gets replaced with the next, and leaves you with only the last one

#

print outputs to the console on every line, so it cant be replaced

mild quarry
#

True

sick cloud
#

anyone able to help me with this rethinkdbdash issue?

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at Function.Term.expr (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:2342:49)
    at /home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:2364:40
    at Object.loopKeys (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/helper.js:56:14)
    at Function.Term.expr (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:2362:12)
    at Function.Term.insert (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:543:39)
    at Object.execute (/home/tony/Bots/Benny/commands/mute.js:70:43)

affected code:

            await client.r.table('cases').insert({ // <------- apparently here, mute.js:70:43
                id: totalCases + 1,
                member: member.user,
                modeator: msg.author,
                reason: reason,
                mutedAt: mutedAt,
                unmuteAt: unmuteAt,
            });
quartz kindle
#

invalid time value. mutedAt and unmuteAt are probably expecting something that can be converted into a Date object

sick cloud
#

they are dates though afaik @quartz kindle

#
           const mutedAt = new Date();

            let date = new Date();
            date += durationTime;
            let unmuteAt = new Date(date);
#

thats before in the code

quartz kindle
#

how's the table schema?

sick cloud
#

uhhh

#

what? 👀

quartz kindle
#

idk how rethink works. do tables have defined data types? or you can store whatever?

sick cloud
#

im sure you can stick in whatever

quartz kindle
#

try storing timestamps instead of date objects

#

mutedAt.getTime()

#

also, pretty sure you cant do date += duration

#

you're producing an invalid string