abeya-tg-api 0.0.1-security → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of abeya-tg-api might be problematic. Click here for more details.
- package/.github/ISSUE_TEMPLATE.md +68 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- package/CHANGELOG.md +565 -0
- package/CODE_OF_CONDUCT.md +74 -0
- package/CONTRIBUTING.md +45 -0
- package/FORK_GUIDE.md +223 -0
- package/LICENSE.md +21 -0
- package/PUBLISHING_CHECKLIST.md +167 -0
- package/QUICK_START.md +96 -0
- package/README.md +129 -3
- package/README_FORK_SETUP.md +156 -0
- package/START_HERE.md +231 -0
- package/bot.js +36 -0
- package/doc/api.hbs +19 -0
- package/doc/api.md +2772 -12
- package/doc/experimental.md +28 -0
- package/doc/help.md +151 -0
- package/doc/tutorials.md +12 -0
- package/doc/usage.md +269 -0
- package/index.js +13 -0
- package/lib/errors.js +112 -0
- package/lib/extract.js +219 -0
- package/lib/telegram.js +4741 -0
- package/lib/telegramPolling.js +245 -0
- package/lib/telegramWebHook.js +192 -0
- package/lib/utils.js +7 -0
- package/package.json +75 -4
- package/publish-helper.ps1 +179 -0
- package/src/errors.js +68 -0
- package/src/extract.js +212 -0
- package/src/telegram.js +3838 -0
- package/src/telegramPolling.js +202 -0
- package/src/telegramWebHook.js +158 -0
- package/src/utils.js +3 -0
- package/test-bot-example.js +71 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at mugo@forfuture.co.ke. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
> If you are willing to contribute, first you should know that
|
|
4
|
+
> I will love you and so will the Telegram Bot community.
|
|
5
|
+
|
|
6
|
+
Before proceeding any further, read the following documents:
|
|
7
|
+
|
|
8
|
+
1. [Code of Conduct][coc]
|
|
9
|
+
1. [License][license]
|
|
10
|
+
|
|
11
|
+
## General Information
|
|
12
|
+
|
|
13
|
+
### Creating a Github issue:
|
|
14
|
+
|
|
15
|
+
1. Ensure that your issue does **not** already exist. [Do a search](https://github.com/yagop/node-telegram-bot-api/issues).
|
|
16
|
+
2. Browse through [StackOverflow](https://stackoverflow.com/search?q=telegram+nodejs) and other similar platforms.
|
|
17
|
+
3. Should you open your issue, ensure you use the English language for
|
|
18
|
+
the wider target audience.
|
|
19
|
+
4. Be patient please.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Updating API Reference i.e. generating `doc/api.md`
|
|
23
|
+
|
|
24
|
+
Run:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
$ npm run doc
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Running tests
|
|
32
|
+
|
|
33
|
+
Please read `test/README.md` for more information.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Transpiling ES2015 for older Node.js versions
|
|
37
|
+
|
|
38
|
+
We use babel to transpile the code:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
$ npm run build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
[coc]:https://github.com/yagop/node-telegram-bot-api/blob/master/CODE_OF_CONDUCT.md
|
|
45
|
+
[license]:https://github.com/yagop/node-telegram-bot-api/blob/master/LICENSE.md
|
package/FORK_GUIDE.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Guide to Publishing Your Custom Fork
|
|
2
|
+
|
|
3
|
+
This guide will help you publish your custom fork of `node-telegram-bot-api` as `myown-node-telegram-bot-api`.
|
|
4
|
+
|
|
5
|
+
## ✅ What's Already Done
|
|
6
|
+
|
|
7
|
+
1. ✅ Cloned the original `node-telegram-bot-api` repository
|
|
8
|
+
2. ✅ Updated `package.json` with your custom package name
|
|
9
|
+
3. ✅ Updated `README.md` to reflect the fork
|
|
10
|
+
4. ✅ Installed all dependencies
|
|
11
|
+
|
|
12
|
+
## 📝 Next Steps to Customize
|
|
13
|
+
|
|
14
|
+
### 1. Update Author Information
|
|
15
|
+
|
|
16
|
+
Edit `package.json` and replace:
|
|
17
|
+
```json
|
|
18
|
+
"author": "Your Name <your-email@example.com>"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
With your actual name and email.
|
|
22
|
+
|
|
23
|
+
### 2. Update Repository URLs
|
|
24
|
+
|
|
25
|
+
Edit `package.json` and replace `YOUR-USERNAME` with your actual GitHub username in these fields:
|
|
26
|
+
- `repository.url`
|
|
27
|
+
- `bugs.url`
|
|
28
|
+
- `homepage`
|
|
29
|
+
|
|
30
|
+
### 3. Make Your Custom Adaptations
|
|
31
|
+
|
|
32
|
+
Now you can make any modifications you want to the code! The main source code is in:
|
|
33
|
+
- `src/telegram.js` - Main bot class
|
|
34
|
+
- `src/` - Other source files
|
|
35
|
+
- `examples/` - Example usage files
|
|
36
|
+
|
|
37
|
+
After making changes, build the project:
|
|
38
|
+
```bash
|
|
39
|
+
npm run build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 🚀 Publishing to NPM
|
|
43
|
+
|
|
44
|
+
### Step 1: Create an NPM Account
|
|
45
|
+
|
|
46
|
+
If you don't have one, go to [npmjs.com](https://www.npmjs.com/signup) and create an account.
|
|
47
|
+
|
|
48
|
+
### Step 2: Login to NPM
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm login
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Enter your username, password, and email when prompted.
|
|
55
|
+
|
|
56
|
+
### Step 3: Check Package Name Availability
|
|
57
|
+
|
|
58
|
+
Before publishing, verify the name is available:
|
|
59
|
+
```bash
|
|
60
|
+
npm view myown-node-telegram-bot-api
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If you get a 404 error, the name is available! If not, choose a different name.
|
|
64
|
+
|
|
65
|
+
### Step 4: Build the Project
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Step 5: Publish Your Package
|
|
72
|
+
|
|
73
|
+
For the first time:
|
|
74
|
+
```bash
|
|
75
|
+
npm publish --access public
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For subsequent updates:
|
|
79
|
+
1. Update the version in `package.json` (following [semantic versioning](https://semver.org/))
|
|
80
|
+
2. Run: `npm publish`
|
|
81
|
+
|
|
82
|
+
## 🔄 Version Management
|
|
83
|
+
|
|
84
|
+
When you make changes and want to publish updates:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# For bug fixes (1.0.0 -> 1.0.1)
|
|
88
|
+
npm version patch
|
|
89
|
+
|
|
90
|
+
# For new features (1.0.0 -> 1.1.0)
|
|
91
|
+
npm version minor
|
|
92
|
+
|
|
93
|
+
# For breaking changes (1.0.0 -> 2.0.0)
|
|
94
|
+
npm version major
|
|
95
|
+
|
|
96
|
+
# Then publish
|
|
97
|
+
npm publish
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 🐙 GitHub Repository Setup
|
|
101
|
+
|
|
102
|
+
### Step 1: Create a New GitHub Repository
|
|
103
|
+
|
|
104
|
+
1. Go to [GitHub](https://github.com/new)
|
|
105
|
+
2. Create a new repository named `myown-node-telegram-bot-api`
|
|
106
|
+
3. Don't initialize with README (we already have one)
|
|
107
|
+
|
|
108
|
+
### Step 2: Update Remote Origin
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Remove the old origin
|
|
112
|
+
git remote remove origin
|
|
113
|
+
|
|
114
|
+
# Add your new repository
|
|
115
|
+
git remote add origin https://github.com/YOUR-USERNAME/myown-node-telegram-bot-api.git
|
|
116
|
+
|
|
117
|
+
# Push to your repository
|
|
118
|
+
git push -u origin master
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 🧪 Testing Your Fork Locally
|
|
122
|
+
|
|
123
|
+
Before publishing, you can test your fork locally:
|
|
124
|
+
|
|
125
|
+
### In this project:
|
|
126
|
+
```bash
|
|
127
|
+
npm run build
|
|
128
|
+
npm test
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### In another project:
|
|
132
|
+
```bash
|
|
133
|
+
# Link your package locally
|
|
134
|
+
cd /path/to/your/fork
|
|
135
|
+
npm link
|
|
136
|
+
|
|
137
|
+
# In your test project
|
|
138
|
+
cd /path/to/test-project
|
|
139
|
+
npm link myown-node-telegram-bot-api
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Then in your test project:
|
|
143
|
+
```javascript
|
|
144
|
+
const TelegramBot = require('myown-node-telegram-bot-api');
|
|
145
|
+
// Test your bot...
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 📦 Using Your Published Package
|
|
149
|
+
|
|
150
|
+
Once published, anyone (including you) can install it:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npm install myown-node-telegram-bot-api
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Or with a specific version:
|
|
157
|
+
```bash
|
|
158
|
+
npm install myown-node-telegram-bot-api@1.0.0
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 🛠️ Development Workflow
|
|
162
|
+
|
|
163
|
+
1. Make changes to the code in `src/`
|
|
164
|
+
2. Build: `npm run build`
|
|
165
|
+
3. Test: `npm test`
|
|
166
|
+
4. Commit your changes: `git commit -am "Description of changes"`
|
|
167
|
+
5. Update version: `npm version patch` (or minor/major)
|
|
168
|
+
6. Push to GitHub: `git push && git push --tags`
|
|
169
|
+
7. Publish to NPM: `npm publish`
|
|
170
|
+
|
|
171
|
+
## ⚠️ Important Notes
|
|
172
|
+
|
|
173
|
+
1. **Keep it legal**: The original package is MIT licensed, so you're free to fork and modify it. Just keep the original license and give credit to the original authors.
|
|
174
|
+
|
|
175
|
+
2. **Choose a unique name**: If `myown-node-telegram-bot-api` is taken, choose another name. Try variations like:
|
|
176
|
+
- `your-name-telegram-bot-api`
|
|
177
|
+
- `custom-telegram-bot-api`
|
|
178
|
+
- `enhanced-telegram-bot-api`
|
|
179
|
+
|
|
180
|
+
3. **Maintain your fork**: Consider periodically syncing with the original repository to get bug fixes and new features:
|
|
181
|
+
```bash
|
|
182
|
+
# Add original repo as upstream
|
|
183
|
+
git remote add upstream https://github.com/yagop/node-telegram-bot-api.git
|
|
184
|
+
|
|
185
|
+
# Fetch updates
|
|
186
|
+
git fetch upstream
|
|
187
|
+
|
|
188
|
+
# Merge updates (be careful with conflicts)
|
|
189
|
+
git merge upstream/master
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## 📚 Useful Commands
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Build the project
|
|
196
|
+
npm run build
|
|
197
|
+
|
|
198
|
+
# Run tests
|
|
199
|
+
npm test
|
|
200
|
+
|
|
201
|
+
# Run linter
|
|
202
|
+
npm run eslint
|
|
203
|
+
|
|
204
|
+
# Generate documentation
|
|
205
|
+
npm run doc
|
|
206
|
+
|
|
207
|
+
# Check what will be published
|
|
208
|
+
npm pack --dry-run
|
|
209
|
+
|
|
210
|
+
# View your published package
|
|
211
|
+
npm view myown-node-telegram-bot-api
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## 🎉 You're All Set!
|
|
215
|
+
|
|
216
|
+
Your fork is now ready to be customized and published. Make your changes, test them thoroughly, and share your enhanced version with the world!
|
|
217
|
+
|
|
218
|
+
## 📞 Support
|
|
219
|
+
|
|
220
|
+
If you need help with the original API, refer to the [original documentation](https://github.com/yagop/node-telegram-bot-api).
|
|
221
|
+
|
|
222
|
+
For NPM publishing issues, check out the [NPM documentation](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry).
|
|
223
|
+
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Yago
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Publishing Checklist ✓
|
|
2
|
+
|
|
3
|
+
Use this checklist to ensure you've completed all necessary steps before publishing your fork.
|
|
4
|
+
|
|
5
|
+
## 📝 Before You Start
|
|
6
|
+
|
|
7
|
+
- [ ] Have a GitHub account
|
|
8
|
+
- [ ] Have an NPM account (sign up at https://www.npmjs.com/signup)
|
|
9
|
+
- [ ] Have a Telegram bot token from @BotFather (for testing)
|
|
10
|
+
|
|
11
|
+
## 🔧 Personalization Steps
|
|
12
|
+
|
|
13
|
+
- [ ] Update `package.json`:
|
|
14
|
+
- [ ] Change author name and email
|
|
15
|
+
- [ ] Replace `YOUR-USERNAME` with your GitHub username (3 places)
|
|
16
|
+
- [ ] Verify package name is unique (run: `npm view myown-node-telegram-bot-api`)
|
|
17
|
+
|
|
18
|
+
- [ ] Test locally:
|
|
19
|
+
- [ ] Run `npm run build` successfully
|
|
20
|
+
- [ ] Run `npm test` (should pass)
|
|
21
|
+
- [ ] Test with `test-bot-example.js` (optional but recommended)
|
|
22
|
+
|
|
23
|
+
## 🐙 GitHub Setup (Recommended)
|
|
24
|
+
|
|
25
|
+
- [ ] Create new GitHub repository named `myown-node-telegram-bot-api`
|
|
26
|
+
- [ ] Update git remote:
|
|
27
|
+
```bash
|
|
28
|
+
git remote remove origin
|
|
29
|
+
git remote add origin https://github.com/YOUR-USERNAME/myown-node-telegram-bot-api.git
|
|
30
|
+
```
|
|
31
|
+
- [ ] Commit your changes:
|
|
32
|
+
```bash
|
|
33
|
+
git add .
|
|
34
|
+
git commit -m "Initial commit: Custom fork of node-telegram-bot-api"
|
|
35
|
+
```
|
|
36
|
+
- [ ] Push to GitHub:
|
|
37
|
+
```bash
|
|
38
|
+
git push -u origin master
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 📦 NPM Publishing Steps
|
|
42
|
+
|
|
43
|
+
- [ ] Login to NPM:
|
|
44
|
+
```bash
|
|
45
|
+
npm login
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- [ ] Verify you're logged in:
|
|
49
|
+
```bash
|
|
50
|
+
npm whoami
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- [ ] Final build:
|
|
54
|
+
```bash
|
|
55
|
+
npm run build
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- [ ] Publish:
|
|
59
|
+
```bash
|
|
60
|
+
npm publish --access public
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- [ ] Verify publication:
|
|
64
|
+
```bash
|
|
65
|
+
npm view myown-node-telegram-bot-api
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## ✅ Post-Publishing
|
|
69
|
+
|
|
70
|
+
- [ ] Test installation in a new project:
|
|
71
|
+
```bash
|
|
72
|
+
mkdir test-install
|
|
73
|
+
cd test-install
|
|
74
|
+
npm init -y
|
|
75
|
+
npm install myown-node-telegram-bot-api
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- [ ] Create a simple test script to verify it works
|
|
79
|
+
|
|
80
|
+
- [ ] Update your GitHub repository README if needed
|
|
81
|
+
|
|
82
|
+
- [ ] Share your package! Tell others about it
|
|
83
|
+
|
|
84
|
+
## 🔄 For Future Updates
|
|
85
|
+
|
|
86
|
+
When you make changes and want to publish updates:
|
|
87
|
+
|
|
88
|
+
- [ ] Make your code changes in `src/` directory
|
|
89
|
+
- [ ] Build: `npm run build`
|
|
90
|
+
- [ ] Test: `npm test`
|
|
91
|
+
- [ ] Update version:
|
|
92
|
+
- [ ] `npm version patch` (for bug fixes)
|
|
93
|
+
- [ ] `npm version minor` (for new features)
|
|
94
|
+
- [ ] `npm version major` (for breaking changes)
|
|
95
|
+
- [ ] Commit and push to GitHub:
|
|
96
|
+
```bash
|
|
97
|
+
git push && git push --tags
|
|
98
|
+
```
|
|
99
|
+
- [ ] Publish: `npm publish`
|
|
100
|
+
|
|
101
|
+
## 🎯 Quick Commands Reference
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Build project
|
|
105
|
+
npm run build
|
|
106
|
+
|
|
107
|
+
# Run tests
|
|
108
|
+
npm test
|
|
109
|
+
|
|
110
|
+
# Run linter
|
|
111
|
+
npm run eslint
|
|
112
|
+
|
|
113
|
+
# Check NPM login
|
|
114
|
+
npm whoami
|
|
115
|
+
|
|
116
|
+
# Check package details
|
|
117
|
+
npm view myown-node-telegram-bot-api
|
|
118
|
+
|
|
119
|
+
# Update patch version (1.0.0 -> 1.0.1)
|
|
120
|
+
npm version patch
|
|
121
|
+
|
|
122
|
+
# Publish
|
|
123
|
+
npm publish --access public
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 🆘 Troubleshooting
|
|
127
|
+
|
|
128
|
+
### Package name already taken?
|
|
129
|
+
- Check availability: `npm view myown-node-telegram-bot-api`
|
|
130
|
+
- Try alternative names:
|
|
131
|
+
- `your-name-telegram-bot-api`
|
|
132
|
+
- `custom-telegram-bot-api`
|
|
133
|
+
- `enhanced-telegram-bot-api`
|
|
134
|
+
- `your-username-tg-bot-api`
|
|
135
|
+
|
|
136
|
+
### Not logged in to NPM?
|
|
137
|
+
- Run: `npm login`
|
|
138
|
+
- Enter username, password, and email
|
|
139
|
+
- Verify: `npm whoami`
|
|
140
|
+
|
|
141
|
+
### Build errors?
|
|
142
|
+
- Make sure all dependencies are installed: `npm install`
|
|
143
|
+
- Check for syntax errors in your changes
|
|
144
|
+
- Try deleting `lib/` folder and rebuild: `npm run build`
|
|
145
|
+
|
|
146
|
+
### Publishing errors?
|
|
147
|
+
- Make sure you're logged in: `npm whoami`
|
|
148
|
+
- Check package name is unique
|
|
149
|
+
- Ensure version is updated (can't publish same version twice)
|
|
150
|
+
- Verify package.json is valid JSON
|
|
151
|
+
|
|
152
|
+
## 📚 Helpful Resources
|
|
153
|
+
|
|
154
|
+
- NPM Documentation: https://docs.npmjs.com/
|
|
155
|
+
- Semantic Versioning: https://semver.org/
|
|
156
|
+
- Original Bot API: https://github.com/yagop/node-telegram-bot-api
|
|
157
|
+
- Telegram Bot API Docs: https://core.telegram.org/bots/api
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
**Pro Tip**: Use the `publish-helper.ps1` script to automate many of these steps:
|
|
162
|
+
```powershell
|
|
163
|
+
.\publish-helper.ps1
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Good luck with your custom fork! 🚀
|
|
167
|
+
|
package/QUICK_START.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Quick Start - Your Custom Fork
|
|
2
|
+
|
|
3
|
+
## ✅ Setup Complete!
|
|
4
|
+
|
|
5
|
+
Your fork of `node-telegram-bot-api` is ready! Here's what's been done:
|
|
6
|
+
|
|
7
|
+
### Files Modified:
|
|
8
|
+
- ✅ `package.json` - Updated with new package name and version
|
|
9
|
+
- ✅ `README.md` - Updated with installation instructions
|
|
10
|
+
- ✅ Built the project successfully
|
|
11
|
+
|
|
12
|
+
### Current Package Details:
|
|
13
|
+
- **Package Name**: `myown-node-telegram-bot-api`
|
|
14
|
+
- **Version**: `1.0.0`
|
|
15
|
+
- **Description**: Telegram Bot API - Custom Fork with Personal Adaptations
|
|
16
|
+
|
|
17
|
+
## 🚀 Quick Publishing Steps
|
|
18
|
+
|
|
19
|
+
### 1. Personalize Your Fork
|
|
20
|
+
```bash
|
|
21
|
+
# Edit package.json and update:
|
|
22
|
+
# - "author": "Your Name <your-email@example.com>"
|
|
23
|
+
# - Replace "YOUR-USERNAME" in repository URLs with your GitHub username
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Test Locally (Optional but Recommended)
|
|
27
|
+
```bash
|
|
28
|
+
npm test
|
|
29
|
+
npm link
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Create GitHub Repository
|
|
33
|
+
1. Go to https://github.com/new
|
|
34
|
+
2. Create repo: `myown-node-telegram-bot-api`
|
|
35
|
+
3. Run these commands:
|
|
36
|
+
```bash
|
|
37
|
+
git remote remove origin
|
|
38
|
+
git remote add origin https://github.com/YOUR-USERNAME/myown-node-telegram-bot-api.git
|
|
39
|
+
git add .
|
|
40
|
+
git commit -m "Initial fork with custom adaptations"
|
|
41
|
+
git push -u origin master
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 4. Publish to NPM
|
|
45
|
+
```bash
|
|
46
|
+
# Login to NPM (first time only)
|
|
47
|
+
npm login
|
|
48
|
+
|
|
49
|
+
# Check if name is available
|
|
50
|
+
npm view myown-node-telegram-bot-api
|
|
51
|
+
|
|
52
|
+
# Publish your package
|
|
53
|
+
npm publish --access public
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 🎯 Now You Can Install It Anywhere!
|
|
57
|
+
|
|
58
|
+
Once published, in any project:
|
|
59
|
+
```bash
|
|
60
|
+
npm install myown-node-telegram-bot-api
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
And use it:
|
|
64
|
+
```javascript
|
|
65
|
+
const TelegramBot = require('myown-node-telegram-bot-api');
|
|
66
|
+
|
|
67
|
+
const token = 'YOUR_BOT_TOKEN';
|
|
68
|
+
const bot = new TelegramBot(token, {polling: true});
|
|
69
|
+
|
|
70
|
+
bot.onText(/\/start/, (msg) => {
|
|
71
|
+
bot.sendMessage(msg.chat.id, 'Hello from your custom fork!');
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 📝 Making Custom Changes
|
|
76
|
+
|
|
77
|
+
1. Edit files in `src/` directory
|
|
78
|
+
2. Build: `npm run build`
|
|
79
|
+
3. Test: `npm test`
|
|
80
|
+
4. Update version: `npm version patch`
|
|
81
|
+
5. Publish: `npm publish`
|
|
82
|
+
|
|
83
|
+
## 📖 For More Details
|
|
84
|
+
|
|
85
|
+
See `FORK_GUIDE.md` for comprehensive instructions on:
|
|
86
|
+
- Version management
|
|
87
|
+
- GitHub setup
|
|
88
|
+
- Testing locally
|
|
89
|
+
- Maintaining your fork
|
|
90
|
+
- Best practices
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
**Need help?** Check out:
|
|
95
|
+
- [NPM Publishing Guide](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry)
|
|
96
|
+
- [Original node-telegram-bot-api Documentation](https://github.com/yagop/node-telegram-bot-api)
|