Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
add sendTelegramMessage function
  • Loading branch information
TimurRin committed Jul 23, 2024
0 parents commit 5f652ab
Show file tree
Hide file tree
Showing 19 changed files with 5,302 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM docker.io/node:22.4.1

USER node
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"build": {
"context": ".",
"dockerfile": "./Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker"
]
}
},
"name": "Node.js 22"
}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-latest
env:
ANCA_CI: true
name: "Publish package to npm registry"
steps:
- uses: actions/checkout@v4
name: "Checkout repo"
- uses: actions/setup-node@v4
with:
node-version: 22.4.1
registry-url: https://registry.npmjs.org/
name: "Install Node.js"
- run: npm ci
name: "Install dependencies"
- run: npm test
name: "Run tests"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
name: "Build distribution bundle and publish to registry"
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches: ["**"]

jobs:
test-commit:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18.20.4, 20.15.1, 22.4.1]
name: Test repo on Node.js ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
name: "Checkout repo"
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/
name: "Install Node.js"
- run: npm ci
name: "Install dependencies"
- run: npm test
name: "Run tests"
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.vscode

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed
*.pid.lock
*.lock

# Temp folder
tmp

# Built sources
/dist
/build
*.spec

# Dependency directories
node_modules/
jspm_packages/
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.yarn-integrity

# Local settings
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# Node.js logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Output of 'npm pack'
*.tgz
27 changes: 27 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# General
**/.git
**/.svn
**/.hg

# Binaries
/bin

# Devcontainer
.devcontainer

# Node.js
**/node_modules
package-lock.json

# Distributions
/build
/dist

# Cinnabar Meta
**/cinnabar.js
**/cinnabar.ts
cinnabar.json
CHANGELOG.md

# Anca
anca.json
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.

## Installation

We support [Devcontainers](https://containers.dev/). You can use the provided development container to work on this project. The development container includes all the necessary tools and dependencies to work on this project.

Otherwise, download, install and configure [Node.js](https://nodejs.org/en/download/).

Then, run the following commands to install the dependencies and run the tests:

```bash
npm ci
npm test
```

## Authors

### Maintainers

- Timur Moziev ([@TimurRin](https://github.com/TimurRin))
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2024 Timur Moziev

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Cinnagram

> **DISCLAIMER**: This project is not production ready. All versions below 1.0.0 should be considered unstable
Simple Telegram API handler

## Installation

### npm

```bash
npm install cinnagram
```

## Usage

### Send message

```javascript
sendTelegramMessage(
"TELEGRAM_BOT_TOKEN",
1234,
"Hello, my *dear* friends!",
"markdown",
);
```

## Contributing

Visit [`CONTRIBUTING.md`](CONTRIBUTING.md).

Current maintainers:

- Timur Moziev ([@TimurRin](https://github.com/TimurRin))

## License

Visit [`LICENSE`](LICENSE).

## Anca

This repository is a part of [Anca](https://github.com/cinnabar-forge/anca) standardization project. Parts of the files and code are generated by Anca.
38 changes: 38 additions & 0 deletions anca.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"authors": [
{
"name": "Timur Moziev",
"github": "TimurRin",
"email": "timur.moziev@gmail.com",
"type": "maintainer",
"url": "https://timurrin.github.io/"
}
],
"cinnabarMeta": {
"dataVersion": 0,
"version": {
"latest": "0.0.0",
"timestamp": 0
},
"files": [
{
"path": "./package.json",
"type": "nodejs-package-json"
},
{
"path": "./package-lock.json",
"type": "nodejs-package-lock-json"
}
],
"repo": {
"type": "github",
"value": "cinnabar-forge/cinnagram"
},
"updateChangelog": true
},
"development": {
"readme": {}
},
"type": "library",
"stack": "nodejs"
}
25 changes: 25 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import cinnabarPlugin from "@cinnabar-forge/eslint-plugin";

const files = ["src/**/*.ts"];
const ignores = ["bin/**/*", "build/**/*", "dist/**/*"];

export default [
...cinnabarPlugin.default.map((config) => ({
...config,
files,
})),
{
files,
rules: {
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-returns-type": "off",
"security/detect-non-literal-fs-filename": "off",
"security/detect-object-injection": "off",
},
},
{
ignores,
},
];
Loading

0 comments on commit 5f652ab

Please sign in to comment.