Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Staging to production #795

Merged
merged 130 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
fbc1e0d
chore: sync upstream
0x4007 Jul 7, 2023
0f1b6c4
Merge remote-tracking branch 'upstream/development' into development
0x4007 Aug 9, 2023
fc0516e
Merge branch 'development' of https://github.com/ubiquity/ubiquibot i…
0x4007 Aug 20, 2023
25a928b
refactor: remove unused declaration
0x4007 Aug 20, 2023
a6edfb3
Merge branch 'fix/check-annotations' into pavlovcik/development
0x4007 Aug 20, 2023
4b973fc
feat: incentiveForPullRequest reviewers
wannacfuture Aug 23, 2023
aa84e7d
feat: minor fix
wannacfuture Aug 23, 2023
109758e
feat: slight change
wannacfuture Aug 23, 2023
12bccae
feat: fix function declaration
wannacfuture Aug 23, 2023
25c4da5
feat: renamed some variables
wannacfuture Aug 23, 2023
efb941d
feat: get comments as markdown
wannacfuture Aug 23, 2023
a676070
Merge branch 'ubiquibot/development' into pavlovcik/development
0x4007 Aug 23, 2023
06d688a
feat: revert changing function names
wannacfuture Aug 24, 2023
f59fd04
Merge remote-tracking branch 'origin' into feat/incentive-for-pr-revi…
wannacfuture Aug 24, 2023
07b2275
feat: minor fix
wannacfuture Aug 24, 2023
7104dd3
feat: minor fix
wannacfuture Aug 24, 2023
66b0b9b
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Aug 25, 2023
54f0273
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Aug 25, 2023
66d2d7b
feat: slight change
wannacfuture Aug 25, 2023
70ca321
fix: stale bounty
Keyrxng Aug 25, 2023
517a3e5
fix: requested changes made
Keyrxng Aug 26, 2023
5a38700
fix: pulls from default
Keyrxng Aug 26, 2023
5a41966
fix: remove console log
Keyrxng Aug 26, 2023
dda1cbb
fix: getBotConfig instead of loadConfig
whilefoo Aug 27, 2023
bdb6917
feat: log config errors
whilefoo Aug 27, 2023
01fb817
feat: validate config on push event
whilefoo Aug 28, 2023
7be4768
feat: find correct commit hash
whilefoo Aug 28, 2023
a6cf47e
feat: log invalid config
whilefoo Aug 28, 2023
5a61607
feat: list unnecessary properties
whilefoo Aug 28, 2023
b1250cd
fix: additional properties
whilefoo Aug 28, 2023
e4d5249
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Aug 28, 2023
5ec2d6a
feat: get correct linked pull request
wannacfuture Aug 28, 2023
d0f1b06
feat: check the organization and repo name
wannacfuture Aug 28, 2023
0109700
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Aug 29, 2023
5a0f18e
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Aug 29, 2023
743a477
chore: merged repo and org config
devpanther Aug 29, 2023
907b758
chore: merge default,repo and org
devpanther Aug 30, 2023
7d5a63b
Merge branch 'development' into config-nested-inheritance
devpanther Aug 30, 2023
7bbdada
chore: re-arrange order to use repo first
devpanther Aug 30, 2023
5415213
chore: re-arrange order to use repo first
devpanther Aug 30, 2023
39e2143
Update src/utils/private.ts
devpanther Aug 30, 2023
646d4b8
Update src/utils/private.ts
devpanther Aug 30, 2023
7f1dfc9
fix: run validate config if error loading config on push event
whilefoo Aug 30, 2023
b3b2dea
fix: filter then map
whilefoo Aug 31, 2023
3eaedcc
feat: apply price label
0xcodercrane Sep 1, 2023
eb1d942
feat: display permission level in /query
EtherealGlow Sep 2, 2023
f2a684b
feat: disable bot follow up for pending reviews
EtherealGlow Sep 2, 2023
034c960
Merge remote-tracking branch 'upstream/development' into config-valid…
whilefoo Sep 2, 2023
3dcda23
Merge branch 'development' into config-nested-inheritance
devpanther Sep 2, 2023
c86011c
feat: display access level in /query
EtherealGlow Sep 3, 2023
cf55a97
feat: display access level in /query
EtherealGlow Sep 3, 2023
9b8a28e
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Sep 4, 2023
8ce9053
feat: fix for nonse in incentive pr review
wannacfuture Sep 4, 2023
3f27933
Merge branch 'feat/incentive-for-pr-reviewer' of https://github.com/w…
wannacfuture Sep 4, 2023
2709407
feat: display access levels in /query
EtherealGlow Sep 4, 2023
7fd7d3b
fix: warning header
Keyrxng Sep 5, 2023
dc1d7ec
fix: ignore param order for allow
Nick-Legend Sep 5, 2023
4d98c13
fix: ignore param order for allow
Nick-Legend Sep 5, 2023
74d1b4a
fix: check both pr and issue to verify first comment
Nick-Legend Sep 5, 2023
2855d0b
fix: config extraction
Keyrxng Sep 5, 2023
03a78ac
Merge branch 'development' into start-disclaimer
Keyrxng Sep 5, 2023
5eb7709
feat: disable bot follow up for pending reviews
EtherealGlow Sep 6, 2023
9479e62
feat: display access levels in /query
EtherealGlow Sep 6, 2023
ab87dd4
feat: display access levels in /query
EtherealGlow Sep 6, 2023
467d7eb
fix: update method for params
Nick-Legend Sep 6, 2023
7078549
Merge pull request #722 from byteballet/allow_parameter_order
whilefoo Sep 6, 2023
2f0631c
Merge branch 'development' into config-nested-inheritance
whilefoo Sep 7, 2023
edbbe97
fix: conditional
Keyrxng Sep 7, 2023
87c01de
Merge pull request #691 from devpanther/config-nested-inheritance
whilefoo Sep 7, 2023
c682db7
Merge branch 'development' into start-disclaimer
whilefoo Sep 7, 2023
408a3d9
feat: display access level in /qurey
EtherealGlow Sep 7, 2023
f3e557d
fix: types
whilefoo Sep 7, 2023
5e67a76
fix: types and explicit <tr>
whilefoo Sep 7, 2023
e628f63
feat: display access level in /qurey
EtherealGlow Sep 7, 2023
747becc
chore: refactor
whilefoo Sep 7, 2023
08b7cc0
chore: refactor
whilefoo Sep 7, 2023
e108b49
Merge pull request #707 from EtherealGlow/development-2
whilefoo Sep 7, 2023
d959564
chore: reword ot comment on issues not closed as completed
BeanieMen Sep 7, 2023
807cf51
Merge pull request #724 from byteballet/multi_tutorial_msg
whilefoo Sep 7, 2023
c6ceb6c
Merge pull request #670 from Keyrxng/start-disclaimer
whilefoo Sep 7, 2023
c02596b
chore: update src/adapters/supabase/helpers/client.ts
0xcodercrane Sep 8, 2023
1f6e1be
chore: remove unused declaration (#642)
0xcodercrane Sep 8, 2023
4098d1b
Merge remote-tracking branch 'upstream/development' into config-valid…
whilefoo Sep 8, 2023
4196f30
fix: skip zero penalty
Keyrxng Sep 8, 2023
0cbf188
fix: error diff
Keyrxng Sep 8, 2023
bea4bf6
Merge branch 'development' into commentTweaks
Keyrxng Sep 8, 2023
e3529bb
fix: rendering
Keyrxng Sep 8, 2023
bfb2654
fix: rendering
Keyrxng Sep 8, 2023
b1e7232
feat: disable bot follow up if there are pending reviews
EtherealGlow Sep 8, 2023
54b1a8b
feat: disable bot reveiw on pending reviews
EtherealGlow Sep 8, 2023
79e5f58
feat: disable bot follow up on pending reviews
EtherealGlow Sep 8, 2023
683a681
feat: disable bot follow up on pending reviews
EtherealGlow Sep 8, 2023
1329f12
fix: table comment
Keyrxng Sep 9, 2023
bc2c4fd
fix: default
Keyrxng Sep 9, 2023
678551f
Update src/helpers/issue.ts
EtherealGlow Sep 9, 2023
542c429
feat: disable bot follow up on pending reviews
EtherealGlow Sep 9, 2023
d31ec44
feat: disable bot follow up for pending reviews
EtherealGlow Sep 9, 2023
c5a181d
Merge pull request #708 from EtherealGlow/development-3
whilefoo Sep 10, 2023
08a2dfb
Merge pull request #733 from me505/development
whilefoo Sep 10, 2023
9f398e6
Update ubiquibot-config.yml
0x4007 Sep 10, 2023
0970143
Merge branch 'development' into commentTweaks
Keyrxng Sep 10, 2023
5aa2908
fix: table and check
Keyrxng Sep 10, 2023
a60a017
Fix : skipped->disabled , since -> because
baibhavKumar1 Sep 10, 2023
fcf8f52
Merge pull request #744 from Wholesomebruh/skipped
0x4007 Sep 10, 2023
6c85879
Merge branch 'development' into commentTweaks
0x4007 Sep 10, 2023
75f880e
Merge branch 'development' into commentTweaks
0x4007 Sep 10, 2023
e9cfecc
Merge pull request #736 from Keyrxng/commentTweaks
0x4007 Sep 10, 2023
4e81584
Update pull_request_template.md
0x4007 Sep 11, 2023
7a42059
Update pull_request_template.md
0x4007 Sep 11, 2023
b455c96
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Sep 12, 2023
c6b6709
feat: include comments on pr
wannacfuture Sep 12, 2023
2aa36c0
Merge remote-tracking branch 'upstream/development' into config-valid…
whilefoo Sep 12, 2023
3914532
fix: add helpers back
whilefoo Sep 12, 2023
b3667b8
Merge pull request #684 from ubiquity-whilefoo/config-validation-error
whilefoo Sep 12, 2023
6ca50a4
feat: issue creator multiplier should be optional
whilefoo Sep 12, 2023
4c666eb
Merge pull request #757 from ubiquity-whilefoo/config-hotfix
whilefoo Sep 12, 2023
7393511
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Sep 13, 2023
0414bba
feat: extract time duration with ms (#756)
wannacfuture Sep 14, 2023
0dfa520
Update config.yml
0x4007 Sep 14, 2023
cf2c9be
Update bounty-template.yml
0x4007 Sep 14, 2023
51fe4df
Merge branch 'development' into feat/incentive-for-pr-reviewer
wannacfuture Sep 14, 2023
0154b7e
Merge pull request #657 from wannacfuture/feat/incentive-for-pr-reviewer
0x4007 Sep 15, 2023
53fc6ab
fix: use bot penalty (#749)
Keyrxng Sep 18, 2023
82564f0
fix: renamed default config file (#763)
baibhavKumar1 Sep 18, 2023
8166989
feat: parse Permit Url (#738)
Sadaf-A Sep 18, 2023
e734904
fix: close pr issues and stop running handlers twice (#728)
seprintour Sep 19, 2023
dba8308
feat: add repo specific wallet support (#747)
BeanieMen Sep 19, 2023
3966177
feat: bounty rewards consolidation (#714)
devpanther Sep 21, 2023
c40efc5
feat: ask Command (#663)
Keyrxng Sep 21, 2023
b417336
refactor: config Name Format (#761)
Sadaf-A Sep 22, 2023
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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SUPABASE_KEY=
AUTO_PAY_MODE=
ANALYTICS_MODE=


# Use `trace` to get verbose logging or `info` to show less
LOG_LEVEL=debug
LOGDNA_INGESTION_KEY=
Expand Down
15 changes: 12 additions & 3 deletions .github/ISSUE_TEMPLATE/bounty-template.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: "Bounty Proposal"
description: Have a suggestion for how to improve UbiquiBot? Let us know!
title: "Bounty Proposal:"
title: "Bounty Proposal: "

body:
- type: markdown
attributes:
value: |
## Feature Request Form
Thank you for taking the time to file a feature request! Please let us know what you're trying to do, and how UbiquiBot can help.
Thank you for taking the time to file a feature request.
If you register your wallet address, you will be eligible for compensation if this is accepted!
Please let us know how we can improve the bot.

- type: textarea
attributes:
label: Describe the background or context
description: Please let us know what inspired you to write this proposal. Backlinking to specific comments is usually sufficient context.
description: Please let us know what inspired you to write this proposal. Backlinking to specific comments on GitHub, and leaving a remark about how the bot should have interacted with it is usually sufficient context.
validations:
required: false

Expand All @@ -22,3 +24,10 @@ body:
description: A clear description of what you want to happen. Add any considered drawbacks.
validations:
required: true

- type: textarea
attributes:
label: Remarks
description: Any closing remarks?
validations:
required: false
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Telegram Group Chat
url: https://t.me/UbiquityDAO/29891
about: "Join us on Telegram!"
- name: UbiquiBot Development Group Chat
url: https://t.me/UbiquityDAO/31132
about: "Live chat with us on Telegram!"
14 changes: 9 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!-- RULES TO CONTRIBUTE TO UBIQUIBOT

1. You must link the issue number e.g. "Resolves #1234"
2. You must link proof that your code works from a test issue on your forked repo e.g. "Quality Assurance https://github.com/user/repo/issues/1#issuecomment-1"
3. Please do not replace the keyword "Resolves" https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

-->

Resolves #

<!--
- You must link the issue number e.g. "Resolves #1234"
- You must link the QA issue on your forked repo e.g. "QA for #1234"
- Please do not replace the keyword "Resolves" https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
Quality Assurance:
5 changes: 1 addition & 4 deletions .github/ubiquibot-config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
price-multiplier: 1.5
default-labels:
- "Time: <1 Hour"
- "Priority: 1 (Normal)"
priceMultiplier: 1.5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Bounty bot is built using the [probot](https://probot.github.io/) framework so i
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/utils">utils</a> A set of utility functions
</pre>

## Default Config Notes (`ubiquibot-config-default.json`)
## Default Config Notes (`ubiquibot-config-default.ts`)

We can't use a `jsonc` file due to limitations with Netlify. Here is a snippet of some values with notes next to them.
whilefoo marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,32 @@
"@netlify/functions": "^1.4.0",
"@probot/adapter-aws-lambda-serverless": "^3.0.2",
"@probot/adapter-github-actions": "^3.1.3",
"@sinclair/typebox": "^0.25.9",
"@sinclair/typebox": "^0.31.5",
"@supabase/supabase-js": "^2.4.0",
"@types/ms": "^0.7.31",
"@types/parse5": "^7.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"@uniswap/permit2-sdk": "^1.2.0",
"@vercel/ncc": "^0.34.0",
"ajv": "^8.11.2",
"ajv-formats": "^2.1.1",
"axios": "^1.3.2",
"decimal.js": "^10.4.3",
"copyfiles": "^2.4.1",
"decimal.js": "^10.4.3",
"ethers": "^5.7.2",
"exponential-backoff": "^3.1.1",
"husky": "^8.0.2",
"jimp": "^0.22.4",
"js-yaml": "^4.1.0",
"libsodium-wrappers": "^0.7.11",
"lint-staged": "^13.1.0",
"lodash": "^4.17.21",
"ms": "^2.1.3",
"node-html-parser": "^6.1.5",
"node-html-to-image": "^3.3.0",
"nodemon": "^2.0.19",
"openai": "^4.2.0",
"parse5": "^7.1.2",
"prettier": "^2.7.1",
"probot": "^12.2.4",
Expand All @@ -65,6 +68,7 @@
"@types/eslint": "^8.40.2",
"@types/jest": "^28.1.0",
"@types/libsodium-wrappers": "^0.7.10",
"@types/lodash": "^4.14.197",
"@types/node": "^14.18.37",
"@types/source-map-support": "^0.5.6",
"eslint": "^8.43.0",
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export * from "./telegram";

export const createAdapters = (config: BotConfig): Adapters => {
return {
supabase: supabase(config.supabase.url, config.supabase.key),
telegram: new Telegraf(config.telegram.token).telegram,
supabase: supabase(config?.supabase?.url ?? process.env.SUPABASE_URL, config?.supabase?.key ?? process.env.SUPABASE_KEY),
telegram: new Telegraf(config?.telegram?.token ?? process.env.TELEGRAM_BOT_TOKEN).telegram,
};
};
31 changes: 26 additions & 5 deletions src/adapters/supabase/helpers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import { Database } from "../types";
import { InsertPermit, Permit } from "../../../helpers";
import { BigNumber, BigNumberish } from "ethers";

interface AccessLevels {
multiplier: boolean;
price: boolean;
priority: boolean;
time: boolean;
}

/**
* @dev Creates a typescript client which will be used to interact with supabase platform
*
Expand Down Expand Up @@ -218,17 +225,17 @@ export const upsertWalletAddress = async (username: string, address: string): Pr
}
logger.info(`Upserting a wallet address done, { data: ${JSON.stringify(_data)} }`);
} else {
const { data: _data, error: _error } = await supabase.from("wallets").insert({
const { error } = await supabase.from("wallets").insert({
user_name: username,
wallet_address: address,
created_at: new Date().toUTCString(),
updated_at: new Date().toUTCString(),
});
if (_error) {
logger.error(`Creating a new wallet_table record failed, error: ${JSON.stringify(_error)}`);
throw new Error(`Creating a new wallet_table record failed, error: ${JSON.stringify(_error)}`);
if (error) {
logger.error(`Creating a new wallet_table record failed, error: ${JSON.stringify(error)}`);
throw new Error(`Creating a new wallet_table record failed, error: ${JSON.stringify(error)}`);
}
logger.info(`Creating a new wallet_table record done, { data: ${JSON.stringify(_data)} }`);
logger.info(`Creating a new wallet_table record done, { data: ${JSON.stringify(data)}, address: $address }`);
}
};

Expand Down Expand Up @@ -340,6 +347,20 @@ export const getAccessLevel = async (username: string, repository: string, label
return accessValues;
};

export const getAllAccessLevels = async (username: string, repository: string): Promise<null | AccessLevels> => {
const logger = getLogger();
const { supabase } = getAdapters();

const { data } = await supabase.from("access").select("*").eq("user_name", username).eq("repository", repository).single();

if (!data) {
logger.info(`Access not found on the database`);
// no access
return null;
}
return { multiplier: data.multiplier_access, time: data.time_access, priority: data.priority_access, price: data.price_access };
};

/**
* Queries the wallet address registered previously
*
Expand Down
47 changes: 29 additions & 18 deletions src/adapters/supabase/helpers/log.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
import { getAdapters, getBotContext, Logger } from "../../../bindings";
import { Payload } from "../../../types";
import { getNumericLevel } from "../../../utils/helpers";
import { Payload, LogLevel } from "../../../types";
import { getOrgAndRepoFromPath } from "../../../utils/private";

interface Log {
repo: string | null;
org: string | null;
commentId: number | undefined;
issueNumber: number | undefined;
logMessage: string;
level: Level;
level: LogLevel;
timestamp: string;
}

export enum Level {
ERROR = "error",
WARN = "warn",
INFO = "info",
HTTP = "http",
VERBOSE = "verbose",
DEBUG = "debug",
SILLY = "silly",
}
export const getNumericLevel = (level: LogLevel) => {
switch (level) {
case LogLevel.ERROR:
return 0;
case LogLevel.WARN:
return 1;
case LogLevel.INFO:
return 2;
case LogLevel.HTTP:
return 3;
case LogLevel.VERBOSE:
return 4;
case LogLevel.DEBUG:
return 5;
case LogLevel.SILLY:
return 6;
default:
return -1; // Invalid level
}
};

export class GitHubLogger implements Logger {
private supabase;
Expand All @@ -33,7 +44,7 @@ export class GitHubLogger implements Logger {
private throttleCount = 0;
private retryLimit = 0; // Retries disabled by default

constructor(app: string, logEnvironment: string, maxLevel: Level, retryLimit: number) {
constructor(app: string, logEnvironment: string, maxLevel: LogLevel, retryLimit: number) {
this.app = app;
this.logEnvironment = logEnvironment;
this.maxLevel = getNumericLevel(maxLevel);
Expand Down Expand Up @@ -118,7 +129,7 @@ export class GitHubLogger implements Logger {
}
}

private save(logMessage: string | object, level: Level, errorPayload?: string | object) {
private save(logMessage: string | object, level: LogLevel, errorPayload?: string | object) {
if (getNumericLevel(level) > this.maxLevel) return; // only return errors lower than max level

const context = getBotContext();
Expand Down Expand Up @@ -153,19 +164,19 @@ export class GitHubLogger implements Logger {
}

info(message: string | object, errorPayload?: string | object) {
this.save(message, Level.INFO, errorPayload);
this.save(message, LogLevel.INFO, errorPayload);
}

warn(message: string | object, errorPayload?: string | object) {
this.save(message, Level.WARN, errorPayload);
this.save(message, LogLevel.WARN, errorPayload);
}

debug(message: string | object, errorPayload?: string | object) {
this.save(message, Level.DEBUG, errorPayload);
this.save(message, LogLevel.DEBUG, errorPayload);
}

error(message: string | object, errorPayload?: string | object) {
this.save(message, Level.ERROR, errorPayload);
this.save(message, LogLevel.ERROR, errorPayload);
}

async get() {
Expand Down
13 changes: 10 additions & 3 deletions src/bindings/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ms from "ms";

import { BotConfig, BotConfigSchema } from "../types";
import { BotConfig, BotConfigSchema, LogLevel } from "../types";
import {
DEFAULT_BOT_DELAY,
DEFAULT_DISQUALIFY_TIME,
Expand All @@ -13,7 +13,6 @@ import { getPayoutConfigByNetworkId } from "../helpers";
import { ajv } from "../utils";
import { Context } from "probot";
import { getScalarKey, getWideConfig } from "../utils/private";
import { Level } from "../adapters/supabase";

export const loadConfig = async (context: Context): Promise<BotConfig> => {
const {
Expand All @@ -33,7 +32,10 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
commandSettings,
assistivePricing,
registerWalletWithVerification,
staleBountyTime,
enableAccessControl,
openAIKey,
openAITokenLimit,
} = await getWideConfig(context);

const publicKey = await getScalarKey(process.env.X25519_PRIVATE_KEY);
Expand All @@ -42,7 +44,7 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
const botConfig: BotConfig = {
log: {
logEnvironment: process.env.LOG_ENVIRONMENT || "production",
level: (process.env.LOG_LEVEL as Level) || Level.DEBUG,
level: (process.env.LOG_LEVEL as LogLevel) || LogLevel.DEBUG,
retryLimit: Number(process.env.LOG_RETRY) || 0,
},
price: {
Expand Down Expand Up @@ -90,6 +92,7 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
command: commandSettings,
assign: {
bountyHunterMax: bountyHunterMax,
staleBountyTime: ms(staleBountyTime),
},
sodium: {
privateKey: process.env.X25519_PRIVATE_KEY ?? "",
Expand All @@ -98,6 +101,10 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
wallet: {
registerWalletWithVerification: registerWalletWithVerification,
},
ask: {
apiKey: openAIKey,
tokenLimit: openAITokenLimit || 0,
},
accessControl: enableAccessControl,
};

Expand Down
Loading
Loading