-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keybase-bot monkeypatch #63
base: master
Are you sure you want to change the base?
Conversation
@@ -573,13 +577,14 @@ class Snipe { | |||
name: subteamName, | |||
}; | |||
|
|||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typescript is unable to find methods that have been patched in. If it sees a method like createSubteam
that doesn't come with the keybase-bot npm package, it will error and not run.
self.bot1.team.createSubteam(subteamName).then((res) => { | ||
console.log("Subteam creation complete!", res); | ||
console.log("Attempting to add people to the team", usernamesToAdd); | ||
self.bot1.team | ||
.addMembers({ | ||
team: subteamName, | ||
usernames: usernamesToAdd, | ||
usernames: usernamesToAdd as AddMemberUsernameItem[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
team.addMembers()
is looking for a usernames
object with type AddMemberUsernameItem[]
. Because usernamesToAdd is defaulting to an object[]
, it's erroring. So we cast object[]
to AddMemberUsernameItem[]
.
- MongoDB (if you're running the bot locally) | ||
- Unix/Linux Server - Croupier relies on non-Windows commands (namely `which`) | ||
- `expect` command (`apt-get install expect`) | ||
- Some Lumens to fund the bot accounts (Main bot needs at least 1XLM to function) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main bot needs at least 2.01XLM
### Requirements | ||
|
||
- MongoDB (if you're running the bot locally) | ||
- Unix/Linux Server - Croupier relies on non-Windows commands (namely `which`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS, Linux, or Windows Subsystem for Linux – Croupier relies on non-Windows commands such as which
@@ -4,25 +4,29 @@ import * as moment from "moment"; | |||
import * as mongodb from "mongodb"; | |||
import * as os from "os"; | |||
import * as throttledQueue from "throttled-queue"; | |||
import * as Bot from "./keybase-bot"; | |||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of these @ts-ignore comments. They seem to be cluttering the code now – is there a deeper fix?
process.env.DEV_CROUPIER_PAPERKEY1, | ||
process.env.DEV_CROUPIER_PAPERKEY2, | ||
process.env.MONGODB_USERNAME, | ||
process.env.MONGODB_PASSWORD, | ||
process.env.MONGODB_HOST, | ||
true, | ||
JSON.parse(process.env.IS_CLUSTER), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're now coding this as an envvar, we should remove the isCluster param from the class Croupier
constructor()
, and just have the constructor
method check JSON.parse(process.env.IS_CLUSTER)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Left some comments that I'd like you to address. Finally, and at some point this should be automated, once the comments are addressed, could you please confirm that you ran the end to end test suite as described in the README?
#35 Finished