mirror of
https://github.com/TheodoreKrypton/tgfs
synced 2024-11-21 14:41:40 +00:00
add a logo
This commit is contained in:
parent
497597bf2a
commit
cd4002435d
@ -1,3 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/TheodoreKrypton/tgfs/master/tgfs.png" alt="logo" width="100"/>
|
||||
</p>
|
||||
|
||||
# tgfs
|
||||
|
||||
Use telegram as file storage, with a command line tool and WebDAV server. Refer to the [wiki page](https://github.com/TheodoreKrypton/tgfs/wiki/TGFS-Wiki) for more detail.
|
||||
|
@ -27,7 +27,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
||||
"@types/cli-progress": "^3.11.0",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/ip": "^1.1.0",
|
||||
"@types/jest": "^29.5.2",
|
||||
|
@ -14,6 +14,7 @@ import { Executor } from './commands/executor';
|
||||
import { parser } from './commands/parser';
|
||||
import { config, createConfig, loadConfig } from './config';
|
||||
import { BusinessError } from './errors/base';
|
||||
import { startBot } from './server/monitor';
|
||||
import { webdavServer } from './server/webdav';
|
||||
import { Logger } from './utils/logger';
|
||||
import { sleep } from './utils/sleep';
|
||||
@ -92,4 +93,6 @@ const { argv }: any = yargs(hideBin(process.argv))
|
||||
Logger.info(
|
||||
`WebDAV server is running on ${host}:${port}${config.webdav.path}`,
|
||||
);
|
||||
|
||||
startBot();
|
||||
})();
|
||||
|
@ -3,13 +3,26 @@ import { message } from 'telegraf/filters';
|
||||
|
||||
import { config } from 'src/config';
|
||||
|
||||
const bot = new Telegraf(config.monitor.bot_token);
|
||||
bot.start((ctx) => ctx.reply('Welcome'));
|
||||
bot.help((ctx) => ctx.reply('Send me a sticker'));
|
||||
bot.on(message('sticker'), (ctx) => ctx.reply('👍'));
|
||||
bot.hears('hi', (ctx) => ctx.reply('Hey there'));
|
||||
bot.launch();
|
||||
export const createBot = () => {
|
||||
const bot = new Telegraf(config.monitor.bot_token);
|
||||
|
||||
// Enable graceful stop
|
||||
process.once('SIGINT', () => bot.stop('SIGINT'));
|
||||
process.once('SIGTERM', () => bot.stop('SIGTERM'));
|
||||
bot.use(async (ctx, next) => {
|
||||
if (ctx.chat.id !== config.monitor.chat_id) {
|
||||
return;
|
||||
}
|
||||
await next();
|
||||
});
|
||||
|
||||
bot.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
bot.on(message('sticker'), (ctx) => ctx.reply('👍'));
|
||||
bot.hears('hi', (ctx) => ctx.reply(ctx.chat.id.toString()));
|
||||
return bot;
|
||||
};
|
||||
|
||||
export const startBot = () => {
|
||||
const bot = createBot();
|
||||
bot.launch();
|
||||
};
|
||||
|
@ -766,13 +766,6 @@
|
||||
"@types/connect" "*"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/cli-progress@^3.11.0":
|
||||
version "3.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/cli-progress/-/cli-progress-3.11.0.tgz#ec79df99b26757c3d1c7170af8422e0fc95eef7e"
|
||||
integrity sha512-XhXhBv1R/q2ahF3BM7qT5HLzJNlIL0wbcGyZVjqOTqAybAnsLisd7gy1UCyIqpL+5Iv6XhlSyzjLCnI2sIdbCg==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/connect@*":
|
||||
version "3.4.35"
|
||||
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1"
|
||||
|
Loading…
Reference in New Issue
Block a user