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

Finish converting to TypeScript #611

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d25c37f
bot/modules/community: convert to TS
webwarrior-ws Aug 6, 2024
8e1db87
bot/modules/dispute: convert to TS
webwarrior-ws Aug 7, 2024
a7052b0
bot/modules/events: convert to TS
webwarrior-ws Aug 7, 2024
2fea4c8
bot/modules/language: convert to TS
webwarrior-ws Aug 7, 2024
4aa80f2
bot/modules/nostr: convert to TS
webwarrior-ws Aug 7, 2024
529a917
bot/modules/user: convert to TS
webwarrior-ws Aug 7, 2024
ad220ab
bot/middleware: convert to TS
webwarrior-ws Aug 7, 2024
fc03b90
bot,models: convert bot to TS
webwarrior-ws Aug 8, 2024
dfae3be
bot: introduced HasTelegram type
webwarrior-ws Aug 8, 2024
d9556d1
bot/modules/orders: convert to TS
webwarrior-ws Aug 8, 2024
f6d2311
bot, jobs: convert requires to imports
webwarrior-ws Aug 12, 2024
78e87c4
tests/bot: convert requires to imports
webwarrior-ws Dec 5, 2024
51d8447
ln,bot: convert ln to TS
webwarrior-ws Aug 12, 2024
7e63be4
package.json: install type packages
webwarrior-ws Oct 23, 2024
28d388f
use eslint on TS files
webwarrior-ws Oct 23, 2024
4431e14
fix eslint import ordering errors
webwarrior-ws Oct 23, 2024
ea2a3c6
bot: change signature of notAuthorized function
webwarrior-ws Dec 5, 2024
3f09acf
fix more eslint errors
webwarrior-ws Oct 23, 2024
c00f3ae
eslint: silenced remaining errors
webwarrior-ws Oct 23, 2024
e443616
tsconfig.json: set "strict" to true
webwarrior-ws Dec 5, 2024
4db1119
bot: fix errors introduced by TS strict mode
webwarrior-ws Dec 5, 2024
79204c2
tsconfig.json: remove "allowJs" property
webwarrior-ws Dec 5, 2024
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 .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"node": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"extends": ["standard", "eslint-config-prettier"],
"parserOptions": {
"ecmaVersion": "latest"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ jobs:
sleep 10

mongosh --eval 'db.getSiblingDB("lnp2pbot").createCollection("mycollection")'

- run: npm install @types/node @types/i18n @types/mocha
- run: npm install @types/node
- run: npx tsc
- run: npm ci
- name: Run tests
Expand Down
9 changes: 5 additions & 4 deletions app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import "dotenv/config";
import { SocksProxyAgent } from "socks-proxy-agent";
import { MainContext, start } from "./bot/start";
import { start } from "./bot/start";
import { connect as mongoConnect } from './db_connect'
const { resubscribeInvoices } = require('./ln');
import { resubscribeInvoices } from './ln';
import { logger } from "./logger";
import { Telegraf } from "telegraf";
const { delay } = require('./util');
import { delay } from './util';
import { CommunityContext } from "./bot/modules/community/communityContext";

(async () => {
process.on('unhandledRejection', e => {
Expand All @@ -24,7 +25,7 @@ const { delay } = require('./util');
mongoose.connection
.once('open', async () => {
logger.info('Connected to Mongo instance.');
let options: Partial<Telegraf.Options<MainContext>> = { handlerTimeout: 60000 };
let options: Partial<Telegraf.Options<CommunityContext>> = { handlerTimeout: 60000 };
if (process.env.SOCKS_PROXY_HOST) {
const agent = new SocksProxyAgent(process.env.SOCKS_PROXY_HOST);
options = {
Expand Down
Loading
Loading