Skip to content
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

Standardize boolean values and update .env file pattern #1392

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
IAgentRuntime,
ModelClass,
stringToUuid,
parseBooleanFromText,

Check failure on line 9 in packages/client-twitter/src/post.ts

View workflow job for this annotation

GitHub Actions / check

'parseBooleanFromText' is defined but never used. Allowed unused vars must match /^_/u
} from "@elizaos/core";
import { elizaLogger } from "@elizaos/core";
import { ClientBase } from "./base.ts";
Expand Down Expand Up @@ -161,11 +161,11 @@

if (
this.runtime.getSetting("POST_IMMEDIATELY") != null &&
this.runtime.getSetting("POST_IMMEDIATELY") != ""
this.runtime.getSetting("POST_IMMEDIATELY") !== ""
) {
postImmediately = parseBooleanFromText(
this.runtime.getSetting("POST_IMMEDIATELY")
);
// Retrieve setting, default to false if not set or if the value is not "true"
postImmediately = this.runtime.getSetting("POST_IMMEDIATELY") === "true" || false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about if they use TRUE or yes or YES? parseBooleanFromText looks for yes/no.

falsish needs to be move into core/packages/parsers.ts

function isFalsish(input: any): boolean {

And that's probably what we should be using


}

if (postImmediately) {
Expand Down
Loading