Skip to content

Commit 003d7be

Browse files
Cleanup
1 parent eb5036f commit 003d7be

95 files changed

Lines changed: 1234 additions & 1481 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
build
3+
dist
4+
coverage
5+
.next
6+
*.log
7+
package-lock.json
8+
.env
9+
.env.*
10+
database
11+

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"useTabs": true,
5+
"tabWidth": 4,
6+
"trailingComma": "es5",
7+
"printWidth": 120,
8+
"arrowParens": "avoid",
9+
"endOfLine": "lf"
10+
}
11+

README.md

Lines changed: 28 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,43 @@
1-
<p align="center">
2-
<img height="450" src="https://github.com/barthofu/tscord/assets/66025667/7cf87e0f-37e9-46ce-b244-dda6c45941c9"></img>
3-
</p>
1+
# lnreader-bot
42

5-
<div align="center">
3+
Discord bot for [LNReader](https://github.com/LNReader/lnreader) community support.
64

7-
[![Latest version](https://img.shields.io/github/v/release/barthofu/tscord?color=4b38ff&label=latest%20version&logo=github&logoColor=white&colorA=4b38ff&style=flat)](https://github.com/barthofu/tscord/releases/latest)
5+
## Features
86

9-
[![Build state](https://img.shields.io/github/actions/workflow/status/barthofu/tscord/build.yml?branch=main&colorB=4b38ff&colorA=4b38ff&style=flat)](https://github.com/barthofu/tscord/actions/workflows/build.yml)
10-
![Repo size](https://img.shields.io/github/repo-size/barthofu/tscord?colorB=4b38ff&colorA=4b38ff&style=flat)
11-
![Stars count](https://img.shields.io/github/stars/barthofu/tscord?colorB=4b38ff&colorA=4b38ff&style=flat)
7+
- `/plugins` - Browse and search available LNReader plugins
8+
- `/issue` - Report bugs or request features
9+
- `/migrate` - Get migration instructions for upgrading LNReader
10+
- `/help` - View all available commands
11+
- `/info` - Display bot information
12+
- `/ping` - Check bot latency
1213

13-
<table>
14-
<tr>
15-
<td align="center">
16-
17-
# What is TSCord
18-
19-
#### **TSCord** is a fully-featured **[discord bot](https://discord.com/developers/docs/intro#bots-and-apps)** *template* written in [Typescript](https://www.typescriptlang.org/), intended to provide a framework that's easy to use, extend and modify.
20-
21-
It uses [`discordx`](https://github.com/discordx-ts/discordx) and [`discord.js v14`](https://github.com/discordjs/discord.js) under the hood to simplify the development of discord bots.
22-
23-
This template was created to give developers a starting point for new Discord bots, so that much of the initial setup can be avoided and developers can instead focus on meaningful bot features. Developers can simply follow the [installation](https://tscord.discbot.app/docs/bot/get-started/installation) and the [configuration](https://tscord.discbot.app/docs/bot/get-started/configuration) instructions, and have a working bot with many boilerplate features already included!
24-
</td>
25-
</tr>
26-
</table>
27-
28-
<table>
29-
<tr>
30-
<td align="center">
31-
32-
Getting started is as easy as one command
14+
## Setup
3315

16+
1. Install dependencies:
3417
```bash
35-
npx tscord init bot my-bot
18+
npm install
3619
```
3720

38-
**[To know how to use TSCord and all its components, check the documentation here](https://tscord.discbot.app/)**
39-
40-
</td>
41-
</tr>
42-
</table>
43-
44-
*But TSCord is not only a Discord bot template...*
45-
46-
<table>
47-
<tr>
48-
<td align="center" width="50%">
49-
50-
### [Dashboard](https://github.com/barthofu/tscord-dashboard)
51-
52-
A ready-to-use fancy dashboard for your TSCord bot
53-
54-
<img src="https://user-images.githubusercontent.com/66025667/191989444-5fa096ec-c74e-423d-9735-615b94bc100f.png"></img>
55-
56-
</td>
57-
<td align="center">
58-
59-
### [Website](https://github.com/barthofu/tscord-website)
60-
61-
Customizable static homepage for your TSCord-based bot
62-
63-
https://user-images.githubusercontent.com/66025667/184621486-7340157f-b7fc-44ea-94a9-03d76a99384c.mp4
64-
65-
</td>
66-
</tr>
67-
<tr></tr>
68-
<tr>
69-
<td align="center">
70-
71-
### [CLI](https://github.com/barthofu/tscord-cli)
72-
73-
Really useful CLI meant to initialize a new TSCord project, generate files by type or even manage plugins
74-
75-
https://user-images.githubusercontent.com/66025667/196367258-94c77e23-779c-4d9b-8583-a29226435b07.mp4
76-
77-
</td>
78-
<td align="center">
79-
80-
### [Plugins](https://github.com/barthofu/tscord-plugins)
81-
82-
Fully extensible thanks to the plugin eco-system
83-
84-
<img width="50%" src="https://user-images.githubusercontent.com/66025667/196372599-022c6254-01a6-4f7c-bd52-06246527a8b9.png"></img>
85-
86-
</td>
87-
</tr>
88-
</table>
89-
</div>
90-
91-
<br>
92-
93-
<div align="center">
94-
<a href="https://discord.gg/GsYF4xceZZ" target="_blank">
95-
<img width="17.5%" src="https://user-images.githubusercontent.com/66025667/196373934-2fad8760-a58d-4b4d-ad64-b069baa71823.png"></img>
96-
</a>
97-
</div>
98-
99-
## 📜 Features
100-
101-
Talking about features, here are some of the core features of the template:
102-
103-
- Advanced **handlers** for:
104-
- Interactions (slash, context menu, button, modal, select menu, etc)
105-
- Simple message commands
106-
- Discord events listeners
107-
- **Guards** functions, acting like middlewares on handlers with some built-ins:
108-
- Rate limiter
109-
- Maintenance mode
110-
- Disabling command
111-
- Guild only command (no DMs)
112-
- NSFW only command
113-
- Message's content match using regex
114-
- Internal **API** to interact with the bot from external services, with built-in useful endpoints
115-
- Multiple **databases** support out-of-the-box using [Mikro-ORM](https://mikro-orm.io/)
116-
- **Migrations** system to keep a safe database
117-
- **Custom events** handlers
118-
- Advanced **error handler**
119-
- Fully-typed **localization** (i18n)
120-
- Local **store** to manage global state through the app
121-
- Advanced **logger** with log files and discord channels support
122-
- **Scheduler** for cron jobs
123-
- Built-in rich **statistics** system
124-
- Automatic **static assets upload** to [imgur](https://imgur.com/)
125-
126-
This template is also developer friendly and follow strict design patterns to ease its maintenance:
127-
- Written in **Typescript**
128-
- Built around the **Dependency Injection** and **Singleton** patterns
129-
- **HMR** on events and commands for a faster development
130-
- Use of battle-tested **libraries** under the hood (*discordx* and *discord.js*)
131-
- **Linting** and **formatting** thanks to a top-notch ESLint config
132-
- Typesafe and validated **environment variables**
133-
- Built-in **debugging** setup for VSCode
134-
- Support for running with the **[PM2](https://pm2.keymetrics.io/)** process manger
135-
- Support for running with **[Docker](https://www.docker.com/)**
136-
- CI/CD integration with **Github Actions**
137-
138-
*and many more!*
139-
140-
## 📚 Documentation
141-
142-
### Check the [**official documentation**](https://tscord.discbot.app/) to get started and understand how to use this template.
143-
144-
You can also find useful documentations at:
145-
- [discordx documentation](https://discordx.js.org/)
146-
- [Discord.js Guide](https://discordjs.guide/)
147-
- [Discord's developer portal](https://discord.com/developers/docs/intro)
21+
2. Configure environment variables:
22+
```bash
23+
cp .env.example .env
24+
```
14825

149-
## 📢 Support
26+
Edit `.env` with your bot token and settings.
15027

151-
If you need support on the template or just want to exchange with us, don't hesitate to join the **[official Discord support server](https://discord.gg/GsYF4xceZZ)**!
28+
3. Run in development:
29+
```bash
30+
npm run dev
31+
```
15232

153-
## Roadmap
33+
4. Build for production:
34+
```bash
35+
npm run build
36+
npm start
37+
```
15438

155-
We use Github milestones for
156-
#### [Click here](https://github.com/barthofu/tscord-template/milestones?direction=asc&sort=title&state=open) to access the milestone roadmap
39+
Built with [TSCord](https://github.com/barthofu/tscord) template.
15740

158-
## 📑 License
41+
## License
15942

16043
MIT License
161-
162-
Copyright (c) barthofu
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
'use strict';
2-
Object.defineProperty(exports, '__esModule', { value: true });
3-
const { Migration } = require('@mikro-orm/migrations');
1+
'use strict'
2+
Object.defineProperty(exports, '__esModule', { value: true })
3+
const { Migration } = require('@mikro-orm/migrations')
44

55
class Migration20240511141737 extends Migration {
66

7-
async up() {
8-
this.addSql('create table `data` (`key` text not null, `created_at` datetime not null, `updated_at` datetime not null, `value` text not null default \'\', primary key (`key`));');
7+
async up() {
8+
this.addSql('create table `data` (`key` text not null, `created_at` datetime not null, `updated_at` datetime not null, `value` text not null default \'\', primary key (`key`));')
99

10-
this.addSql('create table `guild` (`id` text not null, `created_at` datetime not null, `updated_at` datetime not null, `prefix` text null, `deleted` integer not null default false, `last_interact` datetime not null, primary key (`id`));');
10+
this.addSql('create table `guild` (`id` text not null, `created_at` datetime not null, `updated_at` datetime not null, `prefix` text null, `deleted` integer not null default false, `last_interact` datetime not null, primary key (`id`));')
1111

12-
this.addSql('create table `image` (`id` integer not null primary key autoincrement, `created_at` datetime not null, `updated_at` datetime not null, `file_name` text not null, `base_path` text not null default \'\', `url` text not null, `size` integer not null, `tags` text not null, `hash` text not null, `delete_hash` text not null);');
12+
this.addSql('create table `image` (`id` integer not null primary key autoincrement, `created_at` datetime not null, `updated_at` datetime not null, `file_name` text not null, `base_path` text not null default \'\', `url` text not null, `size` integer not null, `tags` text not null, `hash` text not null, `delete_hash` text not null);')
1313

14-
this.addSql('create table `pastebin` (`id` text not null, `edit_code` text not null, `lifetime` integer not null default -1, `created_at` datetime not null, primary key (`id`));');
14+
this.addSql('create table `pastebin` (`id` text not null, `edit_code` text not null, `lifetime` integer not null default -1, `created_at` datetime not null, primary key (`id`));')
1515

16-
this.addSql('create table `plugin` (`id` text not null, `name` text not null, `site` text not null, `lang` text not null, `version` text not null, `url` text not null, `icon_url` text not null, primary key (`id`));');
16+
this.addSql('create table `plugin` (`id` text not null, `name` text not null, `site` text not null, `lang` text not null, `version` text not null, `url` text not null, `icon_url` text not null, primary key (`id`));')
1717

18-
this.addSql('create table `stat` (`id` integer not null primary key autoincrement, `type` text not null, `value` text not null default \'\', `additional_data` json null, `created_at` datetime not null);');
18+
this.addSql('create table `stat` (`id` integer not null primary key autoincrement, `type` text not null, `value` text not null default \'\', `additional_data` json null, `created_at` datetime not null);')
1919

20-
this.addSql('create table `user` (`id` text not null, `created_at` datetime not null, `updated_at` datetime not null, `last_interact` datetime not null, primary key (`id`));');
21-
}
20+
this.addSql('create table `user` (`id` text not null, `created_at` datetime not null, `updated_at` datetime not null, `last_interact` datetime not null, primary key (`id`));')
21+
}
2222

2323
}
24-
exports.Migration20240511141737 = Migration20240511141737;
24+
exports.Migration20240511141737 = Migration20240511141737
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
'use strict';
2-
Object.defineProperty(exports, '__esModule', { value: true });
3-
const { Migration } = require('@mikro-orm/migrations');
1+
'use strict'
2+
Object.defineProperty(exports, '__esModule', { value: true })
3+
const { Migration } = require('@mikro-orm/migrations')
44

55
class Migration20250218075239 extends Migration {
66

7-
async up() {
8-
this.addSql('alter table `plugin` add column `custom_css` text null;');
9-
this.addSql('alter table `plugin` add column `custom_js` text null;');
10-
}
7+
async up() {
8+
this.addSql('alter table `plugin` add column `custom_css` text null;')
9+
this.addSql('alter table `plugin` add column `custom_js` text null;')
10+
}
1111

1212
}
13-
exports.Migration20250218075239 = Migration20250218075239;
13+
exports.Migration20250218075239 = Migration20250218075239

0 commit comments

Comments
 (0)