#development

1 messages · Page 800 of 1

dull terrace
#

I will see, I hope it will work

#

Otherwise I think I will not write in this room anymore

earnest phoenix
#

well, people here will help you, provided you've made an effort at it first

slender thistle
#

Throwback to help vampires

dull terrace
#

I noticed it from my first message

earnest phoenix
#

@slender thistle what

slender thistle
#

Nothing in particular, just remembering people who would straight up say "gice code for X" in here GWahreeVampySmug

earnest phoenix
#

yea..

wide ridge
#

anyone here using contabo?

#

I changed the password for my VPS using my control panel, and it says it would take at most 10 minutes. I've been waiting for like an hour, should I contact their customer support? Sshing into it doesn't work

#

@me if anyone has gone through this process before please!

warm marsh
#

Why would you use the control panel to change your password?

earnest phoenix
#

just ... use... passwd

warm marsh
#

Exactly.

earnest phoenix
#

or ssh keys?

warm marsh
#

No, ssh keys are pretty bad.

earnest phoenix
#

more secure than a password

warm marsh
#

Not really.

earnest phoenix
#

yes really.

#

unless your password hapepens to be A&^I^&BYTya6u47i8w73 uyb4 t5874w8o esir 3243e7uruod

warm marsh
#

Considering it took less than 30 seconds for my friend to get in without one.

#

My passwords are always like that just longer.

earnest phoenix
#

-.-

warm marsh
#

Okay, I'm sticking to a password as this far I've not had any account hacks.

#

SSH I have.

earnest phoenix
#

if someone got your ssh key in '30 seconds' they had the private key.

warm marsh
#

Nope.

earnest phoenix
#

then something else happened.

warm marsh
#

Literally nothing else happened. I gave them the IP they signed in using "ssh", without private key.

earnest phoenix
#

then something wasnt set up properly.

#

thats like me walking into your house cuz you left the door unlocked and you claiming i picked the lock

dull terrace
#

The OOPs just concern the channels?

earnest phoenix
#

wha?

#

no

#

oop is a type of programming

#

so

#

for instance

#

you have classes and instances

#

a class would be something like People

#

you and me are People

#

People is the class

#

and you and me would be instances of that class

#

discord.Guild is also a class

#

its a type of thing

#
@client.command()
async def p_channel(ctx):
    channel = await discord.Guild.create_text_channel('test')
    await ctx.message.delete()
hoary elm
#

That's actually a pretty decent explanation ^^

earnest phoenix
#

your error here is that you used discord.Guild

#

ty ^.^

dull terrace
#

Ok, but what I don't understand what I can do everything except create channels

earnest phoenix
#

discord.Guild is a class, and you need an instance of that class

#

aka ctx.guild

#

on another note, i didnt realize the client architecture was still a thing

#

hey um

#

@hoary elm

hoary elm
#

What's up?

earnest phoenix
#

your status is broken

#

** if (fucks.given == 0) etc ;p

dull terrace
#

good status

hoary elm
#

Lol I know 🤦🏻‍♂️

earnest phoenix
#

;p

hoary elm
#

@dull terrace thanks

#

Lol

#

@earnest phoenix I realized I forgot a = after I set it was just to lazy to fix it 😂

earnest phoenix
#

xD

dull terrace
#

I had not seen my error, thank you.
It seems more coherent to me

earnest phoenix
#

np

#

also

#

not sure how far you are into your bot

dull terrace
#

Anyway, I don't understand how adding attributes will help me create a channel x)

earnest phoenix
#

but it may be worth looking into how cogs work

#

basically change your discord.Guild. to ctx.guild.

dull terrace
#

yes

#

It work

#

No need to tell me "will learn the oop ..." for just a ctx error

#

Anyway thank you, I learn from my most basic mistakes

#

@hoary elm I'm inspired by you, look at my status

hoary elm
#

😂😂👌

slender thistle
#

I could go on with my OOP and how not learning it while using an OOP language could cause you more shit than good deeds but eh

hoary elm
#

Some people just prefer trial and error over the old fashioned read and learn method

dull terrace
#

I just want a bot that works and is effective, I don't ask to code with oop, just a SIMPLE thing

hoary elm
#

I mean I agree with you you should learn before you go trying to do it as you should with any coding language, API ect. But some people like learning the hard way

dull terrace
#

You are agree with me ?

hoary elm
#

No Shivaco

slender thistle
#

¯_(ツ)_/¯

dull terrace
#

Ah ok x)

slender thistle
#

Not that I honestly care by now

hoary elm
#

Lol fair enough

dull terrace
#

Anyway, 3/4 of the people I talked to about my concerns, my just said "go learn the oop"

hoary elm
#

Because the best way to learn what you need to do is via their docs

dull terrace
#

what doc?

hoary elm
#

Docs, Guides, Tutorials. Whatever they offer

earnest phoenix
#

@grizzled raven didn't notice that, thx

dull terrace
#

Anyway, I don't plan to use oop to code bots for now x)

hoary elm
#

Lol

dull terrace
#

So next time I hope that when I ask a question they will attack me with the phrase "go learn oop ..."

#

And I thank the people who will do it, the others looked at my status

earnest phoenix
#

what the heck did i just read

stable horizon
#

Repeat that in English

#

The grammar Nazi in me just had a heart attack

slender thistle
#

I'm not sure this conversation has any more purpose

earnest phoenix
#

you cant use an object oriented programming language without knowing how object oriented programming works.

dull terrace
#

Je préfère en Français perso

earnest phoenix
#

thats like me hopping into a semi truck

#

i'd probs crash and burn xD

stable horizon
#

Yeah you need to know OOP, which is why you've been told to go learn it

dull terrace
#

Donc je disais, "Et je remercie tout ceux qui le feront, les autres regarder mon status"

earnest phoenix
#

sighs

#

So I said, "And I thank everyone who will, others look at my status"

dull terrace
#

Tes français toi

earnest phoenix
#

your status still makes no sense

slender thistle
#

Why are we still at it tbh

earnest phoenix
#

idk xD

slender thistle
#

It's their problem from here on

earnest phoenix
#

until they ask for help again

dull terrace
#

Ouais, ça se passe souvent comme sa quand je demande de l'aide

earnest phoenix
#

Yeah, it often happens like its when i come

#

i feel like your english was better than google translate's ngl

dull terrace
#

thx

#

Je suis français à la base, je sais que l'anglais est une langue international mais c'est plus simple quand on né dans un pays anglophone
Bref, la discussion devient hors sujet

earnest phoenix
#

well

#

i mean

#

i know it's easier

vapid swallow
#

?

dull terrace
#
@client.event
async def on_message(message):
    log = client.get_channel(682224555552538639)

    if "n!".casefold() in message.content:
        await client.process_commands(message)

    if "https://tenor.com/view/".casefold() in message.content or "https://media.tenor.com/images/".casefold() in message.content or "https://www.gstatic.com/allo/stickers/".casefold() in message.content:
        pass

    general = client.get_channel(618053458972377098)
    bot_command = client.get_channel(682251992260804608)
    if message.channel == general or message.channel == bot_command:
        if "https://".casefold() in message.content:    
            embed = discord.Embed(
            colour = discord.Colour.red()
            )
            embed.set_author(name="Lien bloqué")
            embed.add_field(name="Membre", value=f"{message.author.mention}", inline=True)
            embed.add_field(name="Action", value="a envoyé un lien dans", inline=True)
            embed.add_field(name="Salon", value=f"{message.channel.mention}", inline=True)
            embed.add_field(name="Message", value=f"{message.content}", inline=True)
            await message.delete()
            await log.send(embed=embed)
#

For me is this x)

earnest phoenix
#

o.k.

#

im just waiting till you see all the object oriented programming in that code

dull terrace
#

your eyes hurt ?

earnest phoenix
#

yes but not cuz "oop" but cuz the client architecture

#

cogs are so much easier to maintain IMO

dull terrace
#

And not only that

#

But it suits me perfectly

earnest phoenix
dull terrace
#

what is it ?

earnest phoenix
#

my bot. it uses cogs which are basically modules

#

each cog can be enabled/disabled individually

gray blade
#

So I have to wait when I upload my bot?

earnest phoenix
#

ye

#

for it to get reviewed

#

queue seems to be a 1-1.5 weeks

gray blade
#

Whaaaa

slate oyster
#

@dull terrace That python? I never liked it so I never was serious about learning it
I can read python though

earnest phoenix
#

it is ;p

#

but ye cogs > client architecture

dull terrace
#

Yes, but python that hurts the eyes

earnest phoenix
#

how does it hurt the eyes?
because it's easy to maintain?
because it makes use of the lilbrary's full feature set?

#

o

dull terrace
#

you speak of my code ?

earnest phoenix
#

you were replying to everyos

#

nvm

#

no i thoght you were replying to me saying cogs were better

#

i see now that you were replying to everyos

#

sorrrryy

dull terrace
#

I answered EveryOS ^^

earnest phoenix
#

ye

#

i saw that

slate oyster
#

@earnest phoenix Tbh most languages I think are easy to maintain

The primary exception is assembly
Though JS can quite easily become spaghetti when not organized well

earnest phoenix
#

well

#

yea

#

but

#

i was comparing the client architecture

#

to cogs

pine bear
#

How would you add arguments because the guide wasn't very specific with that.

dull terrace
#

in the await ctx.guild.create_voice_channel() , where I place the user_limit ? x)

earnest phoenix
#

oops

dull terrace
#

await ctx.guild.create_voice_channel(**user_limit()) ?

dull terrace
#

I am already there

earnest phoenix
#

** in python means keyword args

dull terrace
#

yes

earnest phoenix
#

so iirc, it should be await ctx.guild.create_voice_channel("channel_name", user_limit=89327438952787348)

pine bear
#

I use windows 10 btw, so I just add !mycommand arg1 arg2 arg3 into the bot's js file and add the arguments?

hoary elm
#

@pine bear args for what?

earnest phoenix
#

i have no clue catra

pine bear
#

commands with arguments

dull terrace
#

why you use an id for user_limit ?

earnest phoenix
#

i dont?

#

i just spammed numbers

dull terrace
#

Ah ok

hoary elm
#

For commands with arguments the command itself is args[0] everything after that is 1 2 3 ect

#

So example s!help help would be args[0]

#

@pine bear what are you trying to set up?

pine bear
#

Oh I see, I add the args and add the command in the args,
The bot itself or the commands?

hoary elm
#

Args usually go in the commands so for example say I wanted to make a Kick command it would go something like

if (message.content.startsWith("$kick")) { 

var member = message.mentions.members.first(); 

var reason = args[1]

member.kick()

message.channel.send(`<@${user}> has been kicked for ${reason}`)
#

That is also a example of how to use args and I'm not guaranteeing that it's gonna work if you copy paste that

pine bear
#

Oh I see, I not going to copy that

earnest phoenix
#

i n d e n t

#

that hurts my eyes

hoary elm
pine bear
#

Oh thx

sudden geyser
#

python: give me indents or give me errors

hoary elm
#

Lol

earnest phoenix
#

yea

#

but

#

code like this

sudden geyser
#

hopefully someone knows the reference

it's probably for the sake of time, as in using that small snippet as an example.

earnest phoenix
#
   if (g) {
dothis();
               also_do_this();
      } 
else {
   if (a==4)
h();
}
#

the fact that is valid

#

makes me wanna commit alt+f4

hoary elm
#

Lol

sudden geyser
#

that makes me want to commit sudo rm -rf / --no-preserve-root (don't run it)

hoary elm
#

😂😂😂☠️☠️☠️

pine bear
#

This may be an off-topic thing but how do you make text colored like that?

earnest phoenix
#

coward

#

and catra

#
asdfsdgdefdgbfgn
hoary elm
#

JS python CSS

#

It takes pretty much anything

earnest phoenix
#

b a s h

#

c s h a r p

#

j a v a

#

h t m l

#

x m l

#

e t c

hoary elm
#

Lol

dull terrace
#

The best is asyncio.sleep() and not time.sleep() ?

earnest phoenix
#

yup

#

time.sleep() blocks

dull terrace
#

Ok thx

pine bear
#
client.on("message", (message) => {
    if (!message.content.startsWith(prefix.config.prefix) || message.author.bot) return;
    
    const args = message.content.slice(prefix.lenth).split(' ');
    const command = args.shift().toLowerCase();

    else if (command === 'args-info') {
        if (!args.length) {
            return message.channel.send(`You didn't provide any arguments, ${message.author}!`);
        }
    
        message.channel.send(`Command name: ${command}\nArguments: ${args}`);
    }
});

This is what I can find with the guide you gave me, I don't think it's right.

earnest phoenix
#

from my very limited knowledge of js, that looks right

#

yea

#

!prefix arg-info a a aa a
will print
Command name: arg-info
Args: a a aa a

pine bear
#

But it ain't, the else command doesn't have a statement.

earnest phoenix
#

what else

#

dude

pine bear
#

???

earnest phoenix
#

cause you added ; after the other statement

pine bear
#

Oh rofl I forgot about that!

earnest phoenix
#

do if

#

instead

pine bear
#

Thank you for your help.

#

And my bot went off-line

#

Lmao

earnest phoenix
#

so restart it xD

pine bear
#

How do I keep it online?

earnest phoenix
#

keep it running

pine bear
#

keep it running unsure what you mean by that.

earnest phoenix
#

like

#

wha

#

when you click run or start it

#

dont stop it?

pine bear
#

so like I use node index.js into the terminal.

#

Like keep doing that?

earnest phoenix
#

and just dont close the terminal

pine bear
#

The terminal didn't close, strange.

earnest phoenix
#

did it stop cuz of an error?

pine bear
#

Now there is an error.

earnest phoenix
#

im not sure how js works with blocking, but ik in python if you do something blocking, the bot can stop responding to the point where it goes offlien

pine bear
#

mhm

#

I fixed the error.

earnest phoenix
#

oki

#

also if you wrap your bot in a script to restart it on error it'll help

pine bear
#

Ok, understood.

earnest phoenix
#

but adapted for your use case

pine bear
#

That might not help, I use Visual Studio Code.

#

And I was pinged

earnest phoenix
#

i mean when the bot grows you cant run it in vs code all the time

#

mine runs in a terminal, using a utility called tmux to send it to the background

pine bear
#

Ok,

earnest phoenix
#

i only restart it on major updates, my tesing is done with a bot with a separate token in a separate server

#

sorta like how rythm and rythm canary work

pine bear
#

Oh. My bot will be limited to only my server so I don't have to worry about that too much.

earnest phoenix
#

ohh

pine bear
#

I don't plan on that because this PC just sucks and doesn't have enough RAM for a bot that is in many servers.

earnest phoenix
#

if you're ever interested

pine bear
#

You have to pay?

earnest phoenix
#

if you dont host it yourself, ye

#

but if you run the code on your own machine, no

pine bear
#

So it's free, if you host the code on your machine?

earnest phoenix
#

yea

#

making a discord bot is completely free

pine bear
#

Np then!

earnest phoenix
#

i only sent that link cuz you said about how your pc wasnt the greatest

#

and using a vps is a cheap way to keep it online all the time and scale as it grows

pine bear
#

Which link?

earnest phoenix
#

the one i just sent

#

to the thing

pine bear
#

What those links says you have to pay.

earnest phoenix
#

those are for machines you can run your bot on

#

when/if your bot grows to the point you cant run it on your own

#

but i just run mine on a pc

#

that constantly on

pine bear
#

So, uhh. How do I get the software to keep my bot online?

earnest phoenix
#

well you can run it straight in a terminal

#

install node, and just run the command in.. command prompt should work

pine bear
#

Np then.

earnest phoenix
#

if you give me the exact command you use to start your bot, i can write you little batch file that'll keep it running

#

wait

#

no

#

cuz

#

UGH

#

i forgot

#

batch files dont hold execution until a program is done

dusky marsh
#

just use pm2

#

or some other process manager

pine bear
#

I guess I just downloaded pm2

#

Mhm

#

Thx Command prompt

#

is this the correct one @dusky marsh
It says this

  • pm2@4.2.3
    added 207 packages from 202 contributors in 72.967s
#

Well, I guess because it says pm2.

dusky marsh
#

yep, also make sure you install it globally

pine bear
#

Yes it did

#

npm install pm2 -g right?

dusky marsh
#

ye

pine bear
#

Yes!

#

Now imma go actually try to use it

#

So I got it down but what file am I suppose to use?

#

The main js file?

#

Because I tried that but it just said error when I ran it on command prompt.

#

[PM2][ERROR] Script not found: C:\Users\name\index.js

zenith orchid
#

Here index.js on C:\Users\name?

pine bear
#

I don't want my real name out there so I replaced it it 'name'

zenith orchid
#

Are you sure, index.js on C:\Users\somename?

pine bear
#

here is what I used

#

pm2 start index.js

#

And yes

dusky marsh
#

try pm2 start ./index.js

lucid plinth
#

make sure u cd into the folder

#

its easier instead of typing down the path

thorn nexus
#

discord.js
sometimes gives an error. How can I fix it? I can’t find anything on the Internet.
/app/node_modules/opusscript/build/opusscript_native_wasm.js:8

earnest phoenix
#

ok can someone help me with this error:

AttributeError: 'Bot' object has no attribute 'send_message'
#

i have 3 variables

#

anyone?

hardy cave
#

Hi

earnest phoenix
#

can i get some help on the error above

#

:/

stable horizon
#

?tag yoa

#

Wait this isn't dpy

earnest phoenix
#

yes it is

stable horizon
#

The dpy server*

#

You're using the old, 0.16.x (async branch) version of discord.py, or appear to be trying to use methods from the async branch.
The rewrite branch (1.x.x) of discord.py was pushed to PyPi and made the master branch of discord.py on april 8th.
It is a massive breaking change
Methods such as client.send_message now have an entirely different syntax and style.
If you want support here, it is required that you migrate to the new version of discord.py.
See the migrating guide for instructions on how to do so.
https://discordpy.readthedocs.io/en/latest/migrating.html

The async branch, 0.16.x, is no longer supported here.

earnest phoenix
#

right i know that

#

i use both the on_message and @client.commands()

stable horizon
#

Doesn't matter

#

ok can someone help me with this error:

AttributeError: 'Bot' object has no attribute 'send_message'

This error means that you're trying to use async methods

earnest phoenix
#

well i tried message.send() but it can only hold 1-2 variables

#

i also use on_ready() i forgot to mention that

#

@stable horizon ^

#

😧

#

plz tell me what to do so i can sleep

cursive dagger
#

@earnest phoenix code?

earnest phoenix
#

Tbh idek how to use @client

#

ok

#

I just use @bot and cogs

#

Make sure you actually have rewrite installed tho

cursive dagger
#

Same shit just different variable names

earnest phoenix
#
await client.send_message(channel, '{} has leveled up to level {}'.format(user.mention, lvl_end))
#

Nope.

cursive dagger
#

Change that to await channel.send(message)

earnest phoenix
#

well i tried message.send() but it can only hold 1-2 variables
@earnest phoenix

cursive dagger
#

Remove the channel argument

earnest phoenix
#

That's not channel.send.

#

oh

cursive dagger
#

Ah yeah

#

Use message.channel.send instead

earnest phoenix
#

ok ima try it

#

error:

AttributeError: module 'discord.message' has no attribute 'channel'
cursive dagger
#

Show me your code

earnest phoenix
#
await client.send_message(channel, '{} has leveled up to level {}'.format(user.mention, lvl_end))

@earnest phoenix

cursive dagger
#

Sigh

#

No the new one

earnest phoenix
#

Send the whole function?

#
await message.channel.send(channel, '{} has leveled up to level {}'.format(user.mention, lvl_end))
cursive dagger
#

Full code is needed

earnest phoenix
#

why?

#

It has no context.

#
@client.event
async def on_member_join(member, guild):

    with open('users.json', 'r') as f:
        users = json.load(f)

    await update_data(users, member)

    with open('users.json', 'w') as f:
        users = json.dump(users, f)

@client.event
async def on_message(message):


with open('users.json', 'r') as f:
        users = json.load(f)

    await update_data(users, message.author)
    await add_experience(users, message.author, 5)
    await level_up(users, message.author, message.channel)

    with open('users.json', 'w') as f:
        users = json.dump(users, f)

    
async def update_data(users, user):
    if not user.id in users:
        users[user.id] = {}
        users[user.id]['experience'] = 0
        users[user.id]['level'] = 0

async def add_experience(users, user, exp):
    users[user.id]['experience'] += exp

async def level_up(users, user, channel):
    experience = users[user.id]['experience']
    lvl_start = users[user.id]['level']
    lvl_end = int(experience ** (1/4))

    if lvl_start < lvl_end:
        await message.channel.send(channel, '{} has leveled up to level {}'.format(user.mention, lvl_end))
        users[user.id]['level'] = lvl_end


    await client.process_commands(message)
#

Ok

#

I see the issue

#

You don't b pass a message to levelup
Just change it to
channel.send(jdjdjdjdhdhfhr)

#

?

#

That line. Change it to
await channel.send("message")

#

umm 1 sec

#

error:

#

Also send new code

#

After error

#
TypeError: send() takes from 1 to 2 positional arguments but 3 more given
#

Send the new code too

#
@client.event
async def on_member_join(member, guild):

    with open('users.json', 'r') as f:
        users = json.load(f)

    await update_data(users, member)

    with open('users.json', 'w') as f:
        users = json.dump(users, f)

@client.event
async def on_message(message):


with open('users.json', 'r') as f:
        users = json.load(f)

    await update_data(users, message.author)
    await add_experience(users, message.author, 5)
    await level_up(users, message.author, message.channel)

    with open('users.json', 'w') as f:
        users = json.dump(users, f)

    
async def update_data(users, user):
    if not user.id in users:
        users[user.id] = {}
        users[user.id]['experience'] = 0
        users[user.id]['level'] = 0

async def add_experience(users, user, exp):
    users[user.id]['experience'] += exp

async def level_up(users, user, channel):
    experience = users[user.id]['experience']
    lvl_start = users[user.id]['level']
    lvl_end = int(experience ** (1/4))

    if lvl_start < lvl_end:
        await channel.send(channel, '{} has leveled up to level {}'.format(user.mention, lvl_end))
        users[user.id]['level'] = lvl_end


    await client.process_commands(message)
#

Ok.

#

Change that line to EXACTLY what I said

#

i just copied edited and pasted

#

await channel.send("message")

#

why?

#

NOT await channel.send(channel, message)

#

Because that's how the new model works.

#

so channel.send? no await?

#

Omg.

#

await channel.send("message")
@earnest phoenix

#

That

#

NOT await channel.send(channel, message)
@earnest phoenix
Not this

#

so it would be like await channel.send('{} has leveled up to level {}'.format(user.mention, lvl_end)))?

#

Yes.

#

ooooh

#

Mhm.

#

that just spams @WhitePhantom#6367 level up forever

#

That's cuz your bot is responding to itself.

#

and there is an error about 'author'

#

Make the first line of your onmessage be:
if message.author.bot: return

#

but i have logging

#

wont that affect the logging?

#

No. It makes the onmessage function not apply to bots.

#

ooo

#

new problem

#

.. Hm?

#

now everytime someone sends a message it responds thier level

#

That's a logic issue.

#

Probs cuz you call level up on every message.

#

hmm

#

i dont know how to fix that

#

It's not the most elegant thing

#

It was my first discord bot, hard-coded for a server

#

But the gainxp function might be worth looking at

#

It's called on every message

#

Anyway it's 1:30am. Gn :p

#

ok gn

wide ridge
#

My bot keeps periodically giving the message " (node:4) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
2020-02-28T07:43:28.726715+00:00 app[web.1]: at /app/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
2020-02-28T07:43:28.726716+00:00 app[web.1]: at /app/node_modules/snekfetch/src/index.js:215:21
2020-02-28T07:43:28.726717+00:00 app[web.1]: at runMicrotasks (<anonymous>)
2020-02-28T07:43:28.726717+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-02-28T07:43:28.726718+00:00 app[web.1]: at emitUnhandledRejectionWarning (internal/process/promises.js:149:15)
2020-02-28T07:43:28.726718+00:00 app[web.1]: at processPromiseRejections (internal/process/promises.js:211:11)
2020-02-28T07:43:28.726719+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:98:32)"

#

Discord API error

#

Any ideas how to trace this error or what permissions are missing?

#

I used process to determine the method, which was POST

#

and the url was /api/v7/channels/681783138531278858/messages

#

if anyone has any ideas, please let me know!

#

initially I thought it could be my bot not having permissions to DM someone (after people vote, they get a DM). But I'm not quite sure

delicate zephyr
#

@wide ridge that means your bot is missing the send messages permission

#

just check if your bot has send message person when someone runs a command

plucky echo
#

Jas anyone got a script for making a bot link to YouTube pls dm me

earnest phoenix
#

wat

hoary elm
#

lol "Script"

lethal stratus
#

aight

charred jetty
#

Hm

#

Can you help me?

lethal stratus
#

im looking into it.

charred jetty
#

To make snipe command?

summer torrent
charred jetty
#

Ok

lethal stratus
#

alright so,

charred jetty
#

@summer torrent i tried a lot

summer torrent
#

and store some of the properties

#

author etc.

lethal stratus
#

what you want to be doing is is logging deleted messages

charred jetty
#

I used fs and Map()

lethal stratus
#

then returning the last one

charred jetty
#

Both failed

lethal stratus
#

what context is this in

charred jetty
#

I think my code was wrong

lethal stratus
#

fs and map to do what?

charred jetty
#

To store messages

lethal stratus
#

ah

#

try JSON

charred jetty
#

I tried

lethal stratus
#

may i see the code?

summer torrent
#

do you get any error

lethal stratus
#

^

charred jetty
#

I have copied only one code

#

Showing you

#
client.snipes = new Discord.Collection();```
#

module.exports = (client, message) => {

client.snipes.set(message.channel.id, {
                 content: message.content,
                 sender: message.author
  });
  
  
};```
lethal stratus
#

i see.

charred jetty
#

Here .set is not working

#

First one is in server.js

lethal stratus
#

i would be saying you should use FS to save changes to a JSON file

charred jetty
#

And the second one is in messageDelete event

lethal stratus
#

you can use a library like selfreloadjson when you need to read it in real time

summer torrent
#

use another db

#

saving to Discord.Collection() is a bad idea

lethal stratus
#
client.on("messageDelete", (messageDelete) => {
  //put the code in here
});```
#

seeing as you are using nodejs

charred jetty
#

I replaced it to Discord.Collection() from Map()

lethal stratus
#

you can use the inbuild FS commadns

charred jetty
#

But both not worked

summer torrent
#

use json

#

or sql

charred jetty
#

@lethal stratus tried

lethal stratus
#

i will show you a snippet of some of my old code that interacted with filesystem

charred jetty
#

Ok

lethal stratus
#

to illistrate how you do it.

#
const fs = require('fs');
var pre = require('./prefix.json');

fs.writeFile('./prefix.json', JSON.stringify(pre), function (err) {
   if (err) return console.log(err);
   console.log('writing to ./prefix.json');
});```
#

so what you do here

#

is you are defining a file

#

then you are writing to the file any changes

charred jetty
#

Here i got a problem.. can't find "./snipe.json" module

lethal stratus
#

are oyu trying my code

charred jetty
#

No

#

My previous code problem

lethal stratus
#

modify it to fit yours

charred jetty
#

Ok

lethal stratus
#

so in your case

#
const fs = require('fs');
var snipe = require('./snipe.json');


//here, you can do something like snipe.lastMessage = "whatever you want", then you can use the below code to save the changes.
fs.writeFile('./snipe.json', JSON.stringify(snipe), function (err) {
   if (err) return console.log(err);
   console.log('writing to ./snipe.json');
});```
charred jetty
#

I tried this..

#

It looks same as yours

#

Is there something wrong?

#

(node:25835) UnhandledPromiseRejectionWarning: Error: Cannot find module './snipe.json'

#

Got this err

#

@lethal stratus

summer torrent
#

../snipe.json

lethal stratus
#

back

charred jetty
#

Oh

lethal stratus
#

you need to put where the file is actually

#

because i dont know where your snipe file is

#

and ./ targets the folder its being executed from

charred jetty
#

@summer torrent trying it

lethal stratus
#

so you need to change ./snipe.js to wherever it is actually stored

#

@charred jetty

earnest phoenix
#

If I add a command that detect the word kms with no prefix will my bot get mute or someone?

charred jetty
#

@lethal stratus ik

lethal stratus
#

@shadow copper you would have to ask the admins that

#

@charred jetty k

earnest phoenix
#

Ok I am gonna dm a admin now

lethal stratus
#

ok

earnest phoenix
#

Do I Dm a mod or admin?

blissful scaffold
#

Ask a moderator

earnest phoenix
#

Ok

lethal stratus
#

dont dm

#

just

#

ask one right here

#

mention one

earnest phoenix
#

Yes he can get a mute @earnest phoenix

blissful scaffold
#

You can ping one mod

earnest phoenix
#

If he answer to a Word without prefix

lethal stratus
#

eyah

#

i remember now

charred jetty
#

Now

lethal stratus
#

so there is the answer @earnest phoenix

charred jetty
#

Jump Toat Client.module.exports.message (/app/events/message.js:21:9)4:25 PM

at Client.emit (events.js:194:15)4:25 PM

(node:26088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)4:25 PM

(node:26088) [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.```
blissful scaffold
#

Yeah, don't have public commands without prefix

charred jetty
#

This err

earnest phoenix
#

ok

summer torrent
#

show actual error

lethal stratus
#

ye

#

we need the full

charred jetty
#

Actual err?

#

Ok

#

I am sending total code

earnest phoenix
#

Yes but you can block the command for only be usable by ur id @earnest phoenix

lethal stratus
#

thats not what i meant but ok

#

@charred jetty

charred jetty
#

(node:26088) DeprecationWarning: Collection#find: pass a function instead4:25 PM

Jump To(node:26088) UnhandledPromiseRejectionWarning: SyntaxError: /app/snipe.json: Unexpected end of JSON input4:25 PM

at JSON.parse (<anonymous>)4:25 PM

at Object.Module._extensions..json (internal/modules/cjs/loader.js:720:27)4:25 PM

at Module.load (internal/modules/cjs/loader.js:600:32)4:25 PM

at tryModuleLoad (internal/modules/cjs/loader.js:539:12)4:25 PM

at Function.Module._load (internal/modules/cjs/loader.js:531:3)4:25 PM

at Module.require (internal/modules/cjs/loader.js:637:17)4:25 PM

at require (internal/modules/cjs/helpers.js:22:18)```
#

U mean this?

#

The upper err

earnest phoenix
#

Code not errlr

#

Error*

summer torrent
#

@charred jetty show snipe.json

lethal stratus
#

ye

charred jetty
#

It's blank

summer torrent
#

add {}

lethal stratus
#

thats the issue

charred jetty
#

Ok

lethal stratus
#

yes

#

Jump To(node:26088) UnhandledPromiseRejectionWarning: SyntaxError: /app/snipe.json: Unexpected end of JSON input4:25 PM

#

this is the issue

earnest phoenix
#

Can I make the command so you need to ping the bot first and say the word kms?

lethal stratus
#

its because its blank

charred jetty
#

Oh

#

Lol

lethal stratus
#

Can I make the command so you need to ping the bot first and say the word kms?
that makes it a command

#

so sure

summer torrent
#

just type {} to json

earnest phoenix
#

@earnest phoenix yes you can

charred jetty
#

Lemme check that Command

lethal stratus
#

just type {} to json
^

charred jetty
#

Now
...

#

(node:26394) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined

lethal stratus
#

thats because

#

you have something trying to read

#

from a blank file

charred jetty
#

Hm

#

So what can i do

lethal stratus
#

you need to write to said file first

#

with a value for that

charred jetty
#
client.on("messageDelete", (message) => {
  if (message.author.bot) return;

  var snipes = require("../snipe.json");
  snipes[`${message.channel.id}`] = [`${message}`, `${message.author.tag}`];

  var fs = require('fs');
  var fileName = '../snipe.json';

  fs.writeFile(fileName, JSON.stringify(snipes, null, 2), function(error) {
    if (error) {
      return console.log('oops')
    }
  });
});```
#

I think it should write there something

lethal stratus
#

i see the issue

#

you need to store something in the file, not over the top

#
  var snipes = require("../snipe.json");
  snipes[`${message.channel.id}`] = [`${message}`, `${message.author.tag}`];
  var snipes = require("../snipe.json");
  snipes.snipy[`${message.channel.id}`] = [`${message}`, `${message.author.tag}`];
#

more like this

#

but dont forget to define snipy

charred jetty
#

Ok

earnest phoenix
#

wow

lethal stratus
#
  var snipes = require("../snipe.json");
  var snipy;
  snipes.snipy[`${message.channel.id}`] = [`${message}`, `${message.author.tag}`];
#

know what

charred jetty
#

Then in the write file?

lethal stratus
#

yes

#

but i dont know if i can do this, to help you make this work

#

it may work in the end

#

but it will be the most crappy slow garbage

#

because i suck at coding

earnest phoenix
#

@pliant gorge

lethal stratus
#

i feel like someone else would be better at heklping

charred jetty
#
fs.writeFile(fileName, JSON.stringify(snipes, null, 2), function(error) {
    if (error) {
      return console.log('oops')
    }
  });

I am talking about the snipes

summer torrent
#

@modern sable selfbot ^

lethal stratus
#

who is a selfbot

#

???

summer torrent
#

@earnest phoenix

#

live on twitch

lethal stratus
#

oh

summer torrent
#

¯_(ツ)_/¯

lethal stratus
#

that against TOS

#

oof

summer torrent
#

banned

lethal stratus
#

wwell, not the twitch part

#

lol

charred jetty
#

lol

lethal stratus
#

anyways

charred jetty
#

@lethal stratus what will be done to the snipes then?

lethal stratus
#

you may have to get help from someone else because im super tired and as i said, i dont want to teach you my bad coding practices

charred jetty
#

Lol

lethal stratus
#

;-;

#

im sorry

#

i need to sleep

#

cya later

earnest phoenix
#

Can I make the command so you need to ping the bot first and say the word kms?
I am doing the command now but I can’t figure out who to do it with message.content.includes and it works like @ bot kms but not working if there’s if there’s a word between the ping and the word kms

summer torrent
#

use isMentioned()

lethal stratus
#

try indexOf

summer torrent
charred jetty
#

I am customising the code into db

quartz kindle
#

do you need the snipe thing to work through bot restarts/crashes?

#

do you need it to save ALL messages, or only X latest messages ?

#

what are your requirments?

earnest phoenix
#

It's hard to save multiple deleted messages per users for snipe command ?

#

Per users or per Channel *

quartz kindle
#

not hard, just takes resources

#

also you need to consider if you want to save only text, or also embeds and files

#

and if you want to save them in a database, or if you're ok with losing them if the bot crashes

#

and also the limit of how many messages per channel do you want to save

earnest phoenix
#

Oof embed and files i think we have To download this automaticly and this is really hard for memory if he have multiple files deleted

#

What do you want @earnest phoenix i have screenshot logique_hein_50Nuances

#

ugh

#

ok..

#

Why you want To ping hop?

#

Him*

#

testing

#

.....

#

lol

charred jetty
#
const snipy = JSON.parse(fs.readFileSync("./snipe.json", "utf8"));

client.on("messageDelete", (message) => {
  if(!snipy[message.channel.id]) snipy[message.channel.id] = {content: `${message.content}`,sender: `${message.author.tag}`};
  
  var fs = require('fs');
  var fileName = './snipe.json';
  

  fs.writeFile(fileName, JSON.stringify(snipy), (error) => {
    if (error) {
      return console.log('oops')
    }
  });```
#

@summer torrent

copper cradle
#

why are you doing that

#

are u using node or deno

charred jetty
#

Me?

copper cradle
#

are there any deno discord libraries yet?

summer torrent
#

I haven't experience for fs

charred jetty
#

@summer torrent oh

#
  fs.readFile(fileName, 'utf8', function (err,data) {
  if (err) {
    return console.log(err);
  }
  var result = data.replace(/string to be replaced/g, 'replacement');

  fs.writeFile(fileName, result, 'utf8', function (err) {
     if (err) return console.log(err);
  });
    
});```
I searched on google and this comes
#

But i don't understand how to use it in my code

copper cradle
#

so, you're trying yo write json into that file

#

like a cheap db

charred jetty
#

@copper cradle snipe command

quartz kindle
#

@charred jetty did you see my messages?

#

do you need the snipe thing to work through bot restarts/crashes?
do you need it to save ALL messages, or only X latest messages ?
what are your requirments?

#

also, do you need to save embeds and files or only text?

charred jetty
#

I saved it in file

#

But it's not replacing new deleted messages

#

@quartz kindle and im sorry.. i didn't saw the messages

#

@quartz kindle i want to save the only X latest deleted message

quartz kindle
#

only the last message on each channel?

#

or the last message from each user on each channel?

charred jetty
#

Last deleted message

#

1st one

quartz kindle
#

you want to save the deleted message?

charred jetty
#

Yes

#

But it should be deleted when new deleted message comes

quartz kindle
#

because in order to get the deleted message in the first place, the message has to be saved before its deleted

#

thats the problem with sniping, you need to save the messages before they are deleted

charred jetty
#

It's saving but it's not replacing new deleted messages

quartz kindle
#

ok, but your method will only work on cached messages

charred jetty
#

Yes

quartz kindle
#

meaning, if you restart the bot, and someone deletes message, your bot will not see it

#

it will only see messages sent after the bot starts

charred jetty
#

Yes

quartz kindle
#

ok, show your current code

earnest phoenix
#

He just can use

#

messageDelete event

charred jetty
#
const snipy = JSON.parse(fs.readFileSync("./snipe.json", "utf8"));

client.on("messageDelete", (message) => {
  if(!snipy[message.channel.id]) snipy[message.channel.id] = {content: `${message.content}`,sender: `${message.author.tag}`};
  
  var fs = require('fs');
  var fileName = './snipe.json';
  

  fs.writeFile(fileName, JSON.stringify(snipy), (error) => {
    if (error) {
      return console.log('oops')
    }
  });```
earnest phoenix
#

Yeah

quartz kindle
#

remove the if

charred jetty
#

Ok

earnest phoenix
#

The if broke all lol

#

You need the if only in the command

#

Personnaly just message is okay

quartz kindle
#

just js snipy[message.channel.id] = {content: `${message.content}`,sender: `${message.author.tag}`};
if it doesnt exist, it will be created, it it exists it will be replaced

earnest phoenix
#

For the snipe

charred jetty
#

Ok

#

@earnest phoenix ok

#

Still not replacing the delted message

quartz kindle
#

show snipe command

earnest phoenix
#

NO

#

This isn't the problem

#

The problem is in the event

charred jetty
#
const fs = require("fs");
let snipy = JSON.parse(fs.readFileSync("./snipe.json", "utf8"));

 exports.run = async(client, message, args) => {
  
let chn = `${message.channel.id}`;
var snipechannel = snipy[chn]; // to call an specific deleted message I guess

if (!snipechannel) {
  message.channel.send("What? There are no deleted messages atm");
} else {
  const embed = {
    "color": 5608903,
    "footer": {
      "text": `Sniped by: ${message.author.tag}`
    },
    "fields": [{
      "name": `${snipechannel.sender}`,
      "value": `${snipechannel.content}`
    }]
  };
  await message.channel.send({
    embed
  });

  fs.writeFile('./snipe.json', JSON.stringify(snipy), (error) => {
    if (error) {
      return console.log('oops');
    }
  });
}
   
    }```
quartz kindle
#

this is the problem

#

the file gets read only once, and then all snipe commands will use the same loaded file, never the updated one

charred jetty
#

Oh

quartz kindle
#

you should use the same snipy variable you create in your messageDelete event

#

so you dont need to re-load files

charred jetty
#

Ok

quartz kindle
#

in your main file, you can do something like client.snipy = JSON.parse(fs.readFileSync())

#

and then in the snipe command, you use client.snipy to check it

#

and in the messageDelete event, you use client.snipy[message.channel.id] = {...} and save the JSON.strinfigy(client.snipy)

#

the readFileSync should only be used once, in the top of your main file, right after you create client

charred jetty
#

Ok

charred jetty
#

Total channel information

quartz kindle
#

delete client.snipy[message.channel.id]

charred jetty
#

@quartz kindle lol.. it automatically fixed

#

XD

earnest phoenix
#
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'iconURL' of null```
#

what is this

#

it shows error then also the commands sends the guid icon

summer torrent
#

show full code

earnest phoenix
#

k

#
 var embed = new Discord.RichEmbed()
  .setColor("RANDOM")
  .setThumbnail(message.guild.iconURL)
  .addField(`Server name:`,`** ${message.guild.name}**`, true )
  .addField(`Server Id: `,`**${message.guild.id}**`, true )
  .addField(`Server Created at:`, `**${message.guild.createdAt}**`)
  .addField('You Joined On:',`${message.guild.joinedAt}`)
.addField(`Server owner:`,`**${message.guild.owner.user.username}**`)
  .setTimestamp();
  if (message.content === `${config.prefix}serverinfo`) {
  message.channel.send(embed);
}```
#

@summer torrent

summer torrent
#

message.guild is null

earnest phoenix
#

@summer torrent wdym it is null?

summer torrent
#

Are you running this command in DM

earnest phoenix
#

no

hoary elm
#

🤦🏻‍♂️ why would he use a server info command in DM

earnest phoenix
#

fact

#

even though error shows i am getting output but sometimes the error stops the whole bot

#

why

hoary elm
#

@earnest phoenix that's odd actually I have a few private bots with server info commands that use message.guild.iconURL and it works errorless 🤔

#

Does the server have a picture set?

earnest phoenix
#

it works but on terminal it says that error sometime

#

please help me

#

why

summer torrent
#

@earnest phoenix install the package

#

and dont spam

earnest phoenix
#

give me pls

#

ytdl- core

summer torrent
#

what?

earnest phoenix
#

@summer torrent

#

please give me package

summer torrent
#

install it

#

i cant give you a package

earnest phoenix
#

name

#

at package

summer torrent
#

read the error

#

it says

#

download "statuses" package

hoary elm
#

That is of course assuming you're reffuring to d.js

#

🤷🏻‍♂️ to lazy to make the picture bigger and look

earnest phoenix
#

done

#

i have this error

restive furnace
#

bruh..

sudden geyser
#

did you install it

sick cloud
#

if i have Hello {1:poo} shouldn't /1:poo/g work to find it regex wise

earnest phoenix
#

i have

sudden geyser
earnest phoenix
#

please give me status code

#

my code is bugged

#

Which permission corresponds to EMBED_LINKS in the role settings?

#

Embed Links

sudden geyser
#

what do you mean? is it not the same?

earnest phoenix
#

Actually I am not sure my Discord is in another language

#
    bot.user.setStatus("dnd");
    console.log(`${bot.user.username} is online`);

    let statuses = [
      `$help | ${bot.guilds.size} guilds`,
      `$help | rasdas`,
      `$help | ${bot.users.size} users`
    ];

    setInterval(function() {
      let status = statuses[Math.floor(Math.random() * statuses.length)];
      bot.user.setActivity(status);
    }, 3000);

});  ```
#

no work

#

give me error

#

They just translated it badly

#

So I am unsure

#

I guess it's my equivalent of send file waitWhat

valid holly
#

tried to get a role by id, returned undefined with Error: Request to use token, but token was unavailable to the client.

#

I'll look into the lib for the error throw

#

but it acts weird

earnest phoenix
#

learn how variable scoping works in JavaScript @earnest phoenix

#

i have module

#

sigh

hoary elm
#

🤦🏻‍♂️

summer torrent
#

changing activity in every 3 seconds is API abuse

earnest phoenix
#

@hoary elm ?

tight plinth
#

if I use ksoft.si API using my valid token to request some images, it gives me this (https://prnt.sc/r939ij) error. How can I fix that? Are glitch servers affected by this APi?

Lightshot

Captured with Lightshot

sudden geyser
#

Looks like an issue with the website, not you.

earnest phoenix
#

tell me what doesn't work

charred jetty
#

A lot of errors

#

But it's working

earnest phoenix
#

what is up with the low iqsm today

cursive dagger
#

@tight plinth known issue - people are working it out with glitch/cloudflare/whatever

tight plinth
#

oh ok

#

I didnt know

cursive dagger
#

Yeah all g

bitter lark
#

how do you show what servers the bot is in

#

i code in discord.js

#

dm me if u know how

summer torrent
#

client#guilds

bitter lark
#

so it will show all servers the bot is in

slate oyster
#

Why does everyone use glitch?
I has virtually 0 disk space

summer torrent
#

yes @bitter lark

#

Why does everyone use glitch?
I has virtually 0 disk space
@slate oyster because it is free

slate oyster
#

K

#

I mean
there are alternatives
I'm hosting my bot off of my phone

cursive dagger
#

Thats even worse

slate oyster
#

My phone actually has disk space

cursive dagger
#

But uptime...

slate oyster
#

I tried glitch via it's cmd

earnest phoenix
#

spare laptop ftw

slate oyster
#

It didn't even get past downloading the gradle files

scenic kelp
#

I mean if you have a reliable data connection it's not too bad an idea if you're tight on money

slate oyster
#

My uptime is quite decent

cursive dagger
#

Replit tab open on my pc ftw

earnest phoenix
#

O.o

cursive dagger
#

Just kidding im using my vps

summer torrent
#

google cloud gives you free subscription for 1 year

slate oyster
#

Isn't it like they give you $300 credit
But that requires use of a credit card to sign up

earnest phoenix
#

yea

#

ppl need to stop saying free for a year

cursive dagger
#

Yeah not everyone has a cc

slate oyster
#

True that

#

30 minutes a good amount of time to reset automod configs in your opinions?

finite bough
#

1hr

slate oyster
#

Ok

finite bough
#

1 hr minimum

#

max can be

#

24hrs

slate oyster
#

By 24 hr an actual mod should have intervened

#

feels long

finite bough
#

are u using a json database?

slate oyster
#

The current version stores all data in one json file
The rewrite, which will be what I submit, will store across multiple files/folders in json.
Why?

finite bough
#

and

#

I suppose you r using glitch?

slate oyster
#

No
I said that earlier
Glitch ran out of disk space when downloading gradle files

lyric mountain
#

gradle? on glitch?

slate oyster
#

Yea
through terminal

lyric mountain
#

didnt knew glitch compiled java

finite bough
#

.

slate oyster
#

lemme show you

finite bough
#

sure

#

tho

#

I deployed a bit

#

bot

#

and it handled more than 1k json files easily

lyric mountain
#

why don't you guys use sqlite tho?

slate oyster
#

I would use firebase

finite bough
#

personal preference ig

slate oyster
#

If I did use an actual db

finite bough
#

I use glitch as

#

I can work on my bots

#

on my phone

#

u can also do it on phone

lyric mountain
#

although firebase isn't completely free

finite bough
#

but kinda hard

lyric mountain
#

and sqlite is fast af

finite bough
#

imagine using google drive

lyric mountain
#

geez

slate oyster
#

Yea
@finite bough
that's another good point

finite bough
#

imagine using multiple lines

lyric mountain
#

what kind of library are you getting with gradle lol

slate oyster
#

Discord4J

lyric mountain
#

ah

#

never used it

finite bough
#

same

lyric mountain
#

I use jda

finite bough
#

I like to stick to the basics

earnest phoenix
mystic violet
#

Which version of java does he use? ^^^^

earnest phoenix
#

1.8.0_241

#
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) Client VM (build 25.241-b07, mixed mode)```
mystic violet
#

Im talking about you use to make it work

#

lmao

earnest phoenix
#

wh

#

@mystic violet wym

mystic violet
#

It says it was compiled in a different version

earnest phoenix
#

a newer version

mystic violet
#

which version

earnest phoenix
#

so yea

#

is 1.8u241 the latest?

mystic violet
#

I couldn't find the download link

#

and im pretty sure

earnest phoenix
#

then it may have been compiled in java 9+

mystic violet
#

lets see

#

cause I can run it on my machine

earnest phoenix
#

hold on

mystic violet
#
java version "13.0.2" 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)```
earnest phoenix
#

you have java 13

mystic violet
#

@earnest phoenix you need java 13.0.2

earnest phoenix
#

ew

mystic violet
#

then it will work

toxic seal
#

Can i seek ms excel related help here ?

earnest phoenix
#

no

crimson vapor
#

no

earnest phoenix
#

this is a discord bot dev server

#

how can i download java 13.0.2

pure gust
#

hey guys can i get help, just went to work on my bot and its coming up with this error when i try to run it ?

internal/modules/cjs/loader.js:800        
    throw err;
    ^

Error: Cannot find module 'C:\Users\Jason'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}```
crimson vapor
#

thats Java SE

earnest phoenix
#

that being said, i am certified in excel @toxic seal so you're welcome to dm me

toxic seal
#

Please direct me to appropriate server if possible. I'm lost

crimson vapor
#

@pure gust can you show the code main code of your bot that causes the error?

mystic violet
toxic seal
#

@earnest phoenix thats so kind of you

mystic violet
#

for excel stuff

#

probably

#

lmao

earnest phoenix
#

@mystic violet how can i download java 13.0.2

#

excel != coding

crimson vapor
#

not even the same type? wow

mystic violet
#

@earnest phoenix

pure gust
#

@crimson vapor idk where it would be, ill remove the stuff i added to see if that will change but i doubt it

crimson vapor
#

ok

pure gust
#

Yup same issue

#

dont know why because its been working for 3 weeks straight now

crimson vapor
#

yes @earnest phoenix

pure gust
#
internal/modules/cjs/loader.js:800        
    throw err;
    ^

Error: Cannot find module 'C:\Users\Jason'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}```
earnest phoenix
#

no lke

pure gust
#

Maybe i need to update something idk?

earnest phoenix
#

the code

#

not the error ;p

#

and it looks like its not finding the code. are you running the node . command in the directory with the code?

crimson vapor
#

That would cause it

#
  throw err;
  ^

Error: Cannot find module '/mnt/c/Users/<user name>'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}``` is what I got
pure gust
#

ive always used node . in the terminal to run it?

#

i can send code if u want

#

but gimme am min so i can take out private info

crimson vapor
#

no, just make sure you are in the right directory @pure gust

mystic violet
#

How to download Java SE 13.0.2 on 32 bit

#

lmao

crimson vapor
#

terminal

mystic violet
#

oof

#

million

crimson vapor
#

wait its not linux lmao

mystic violet
#

you finish this off

#

pls

crimson vapor
#

I dot use java

#

for anything

pure gust
#

wdym the right directory? like the code has always been in the same place lmfao since day 1

crimson vapor
#

but are you using the node . command in the right folder

pure gust
#

yeh

#

like

#

Im opening the .js file via vsc and opening terminal in there

#

unless the terminal thats opened

#

is wrong place

crimson vapor
#

do ls

pure gust
#
'ls' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jason>````
slender thistle
#

dir

crimson vapor
#

you said you were in the terminal in vsc

pure gust
#

yeh

#

affirm

crimson vapor
#

ls should have worked but try dir like he said

pure gust
#
 Volume in drive C is OS
 Volume Serial Number is B4B0-5282    

 Directory of C:\Users\Jason

27/02/2020  16:44    <DIR>          . 
27/02/2020  16:44    <DIR>          ..
07/01/2020  21:42               197 .bash_history
20/12/2019  23:30    <DIR>          .cache
11/03/2018  17:33    <DIR>          .config
07/01/2020  21:30               304 .gitconfig
04/09/2018  20:49    <DIR>          .InstallAnywhere
17/01/2020  12:03                42 .node_repl_history
04/01/2019  19:12    <DIR>          .oracle_jre_usage
15/07/2018  15:33    <DIR>          .Origin
15/07/2018  15:33    <DIR>          .QtWebEngineProcess
17/06/2019  12:27    <DIR>          .ssh
06/01/2020  17:10    <DIR>          .vscode
03/02/2020  21:45    <DIR>          3D Objects
26/05/2018  11:04    <DIR>          ansel
13/06/2019  20:59    <DIR>          AppKiwiDownloads
03/02/2020  21:45    <DIR>          Contacts
27/02/2020  14:47    <DIR>          Desktop
27/02/2020  16:02    <DIR>          Documents
27/02/2020  16:02    <DIR>          Downloads
03/02/2020  21:45    <DIR>          Favorites
28/02/2020  16:22    <DIR>          Google Drive
28/02/2020  16:22    <DIR>          iCloudDrive
03/02/2020  21:45    <DIR>          Links
03/02/2020  21:45    <DIR>          Music
28/02/2020  16:25    <DIR>          OneDrive
03/02/2020  21:45    <DIR>          Pictures
17/02/2020  20:10    <DIR>          Saved Games
03/02/2020  21:45    <DIR>          Searches
12/02/2018  13:05    <DIR>          Tracing
17/06/2019  10:28    <DIR>          Twitch
21/02/2020  15:54    <DIR>          Videos
07/01/2020  21:24               214 _netrc
               4 File(s)            757 bytes
              29 Dir(s)  11,817,660,416 bytes free

C:\Users\Jason>````
crimson vapor
#

you are in the incorrect folder I think

pure gust
#

holy

crimson vapor
#

try reopening the terminal the same way you do it normally

pure gust
#

fucking

#

shit

crimson vapor
#

you good?

pure gust
#

when i open the index.js file via literally double click

crimson vapor
#

yes

#

oh

#

I see

pure gust
#

it loaded it as C:\Users\Jason>

#

i just manually opened folder via vsc and now its fine

#

omfg i feel dumb

crimson vapor
#

ctrl O in vsc

#

yeah

pure gust
#

bruhhh

#

F in the chat

pine bear
#

I was about to set up args in the comand block until I saw this. do I leave it alone? Is a good question.

tight plinth
#

yes

#

shouldnt be a problem

#

(or delete both and do npm i)

pine bear
#

Both?

tight plinth
#

Yea, both

earnest phoenix
#

judging by the error, you messed up an argument

#

imma assume its serverinfoembed.addField(`Guild Name:`, message.guild.name , (message.guild.nameAcronym) , true)

#

which should be

serverinfoembed.addField(`Guild Name:, ${message.guild.name}, (${message.guild.nameAcronym})` , true)
#

np

#

o

#

oop

#

which should be

serverinfoembed.addField(`Guild Name:`, `${message.guild.name}, (${message.guild.nameAcronym})` , true)
#

there

#

im used to python so not having keyword args trips me up

#

ye i know it as

serverinfoembed.add_field(name="Guild Name:", value=f'${message.guild.name}, (${message.guild.nameAcronym})' , inline=True)
#

and np

#

the 2nd one yes

#

you tell me