bot icon indicating copy to clipboard operation
bot copied to clipboard

stdin commands for The Hosts

Open TTtie opened this issue 7 years ago • 45 comments

Implements the stdin commands into GAB.

TTtie avatar Dec 12 '17 17:12 TTtie

ignore this pr for now; we still working on it

TTtie avatar Dec 12 '17 18:12 TTtie

will fix

TTtie avatar Dec 13 '17 05:12 TTtie

Multiple complaints:

  1. Client when this will run on the sharder?
  2. That is not how you do jsdocs comments.

vladfrangu avatar Dec 13 '17 11:12 vladfrangu

:thinking:

TTtie avatar Dec 13 '17 13:12 TTtie

I may have solutions on these:

  1. We may require() this off the sharder or just on the first shard
  2. My bad for {CLI]

TTtie avatar Dec 13 '17 13:12 TTtie

  1. I'd say allow us to choose the shard and then, and then run commands on it.
  2. No. You don't get it. Those are not jsdoc comments, those start with /**

vladfrangu avatar Dec 13 '17 13:12 vladfrangu

I disagree with point 1.

STDIN is only captured on the master process as the streams of the workers are only accessible by IPC. I recommend we use IPC in command functions when needed to contact shards, apart from that, this module should only run on the master process.

Gilbert142 avatar Dec 13 '17 14:12 Gilbert142

github can you show me some wuv
i've merged that already :( pic

TTtie avatar Dec 13 '17 15:12 TTtie

Please use rebase when merging branches.

vladfrangu avatar Dec 13 '17 15:12 vladfrangu

I'd like to repeat that the STDIN is not reachable from any shards. This means that you can only listen for incoming commands in the master process, so it's currently pointless to require a Discord Client object in the module.

Gilbert142 avatar Dec 13 '17 16:12 Gilbert142

:ok_hand: Got it
Will tamper with that later.

TTtie avatar Dec 13 '17 16:12 TTtie

@GilbertGobbels Should we at least, require the sharder object or no-no?

TTtie avatar Dec 13 '17 17:12 TTtie

note: the stdin thing is actually listening to your keyboard inputs.
I may make it listening to the input after all shards get ready

TTtie avatar Dec 14 '17 15:12 TTtie

let's force push it later, now will work on resetting my fuck ups

TTtie avatar Dec 14 '17 16:12 TTtie

Reverted the commits.

TTtie avatar Dec 14 '17 16:12 TTtie

Switched to CTRL+G.
Reasons:

  • CTRL + Z works on Windows, but not on Linux (process gets terminated)
  • G for GAB :eyes:

TTtie avatar Dec 16 '17 12:12 TTtie

rebasing is a pain

TTtie avatar Dec 22 '17 19:12 TTtie

🤔 if I'll sure finish it til 2018

TTtie avatar Dec 23 '17 08:12 TTtie

obrazek This is how quality my commit descriptions are (No, we don't reload config.json on BigMessage from CLI)

TTtie avatar Jan 02 '18 12:01 TTtie

ok will do

TTtie avatar Jan 03 '18 13:01 TTtie

Updated the title to use gitmoji.

TTtie avatar Jan 08 '18 13:01 TTtie

hope no one burns for writing such a message

TTtie avatar Jan 08 '18 13:01 TTtie

@KingDGrizzle @GilbertGobbels 🤔 Should I make more of the stdin commands or uh.. consider this PR done

TTtie avatar Jan 09 '18 12:01 TTtie

  1. ConfigJSON spaces should be 2
  2. I'd personally like some tests (and documentation?) for some commands
  3. I'd like to see all commands in action 😄

Otherwise, looks good enough for now. I'll let Gilbert say his opinion

vladfrangu avatar Jan 09 '18 12:01 vladfrangu

  1. refactor is coming!
  2. command help is enough?
$ git clone https://github.com/tttie/gawesomebot -b feature/indev-4.0.2/cli-commands
# fill the config.js and config.json like you normally would
$ node bot
# *gab gets ready*
# type your commands

TTtie avatar Jan 09 '18 13:01 TTtie

@KingDGrizzle didn't ping you in the response, so have the ping here

TTtie avatar Jan 09 '18 13:01 TTtie

why must documentation be such a pain :/

TTtie avatar Jan 09 '18 14:01 TTtie

Also, please go through all eslint warnings for your files, and fix them 😄

vladfrangu avatar Jan 09 '18 14:01 vladfrangu

my eslint found non3

TTtie avatar Jan 09 '18 14:01 TTtie

It's called Travis Builds ;)

vladfrangu avatar Jan 09 '18 14:01 vladfrangu