Skip to content

Commit b430a1c

Browse files
v0.0.8-dev ➜ v1.0.0-alpha
0 parents  commit b430a1c

File tree

178 files changed

+8852
-0
lines changed

Some content is hidden

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

178 files changed

+8852
-0
lines changed

.github/workflows/tests.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Testing Workflow
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
testing:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
- name: Set up Go
15+
uses: actions/setup-go@v4
16+
with:
17+
go-version: 1.21
18+
- name: Run golangci-lint
19+
uses: golangci/golangci-lint-action@v3
20+
with:
21+
version: v1.55
22+
- name: Run tests
23+
run: go test -v ./...
24+
env:
25+
TOKEN: ${{ secrets.TOKEN }}
26+
USER_TOKEN: ${{ secrets.USER_TOKEN }}
27+
GROUP_ID: ${{ secrets.GROUP_ID }}
28+
- name: Upload coverage reports to Codecov
29+
uses: codecov/codecov-action@v3
30+
env:
31+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea

.golangci.yaml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
run:
2+
timeout: 5m
3+
4+
linters-settings:
5+
depguard:
6+
rules:
7+
main:
8+
allow:
9+
- net/http
10+
- net/url
11+
- io
12+
- log
13+
- context
14+
- bytes
15+
- mime/multipart
16+
- strings
17+
- time
18+
- sync
19+
- errors
20+
- fmt
21+
- encoding/json
22+
- encoding/msgpack
23+
- os
24+
- strconv
25+
- testing
26+
- go.uber.org/zap
27+
- github.com/stretchr/testify
28+
- github.com/botscommunity/botsgo
29+
- github.com/botscommunity/vkgo
30+
- github.com/SevereCloud/vksdk
31+
- github.com/gofiber/fiber/v2
32+
lll:
33+
line-length: 200
34+
35+
linters:
36+
disable-all: true
37+
enable:
38+
- asciicheck
39+
- bodyclose
40+
- depguard
41+
- dogsled
42+
- dupl
43+
- errcheck
44+
- exportloopref
45+
- funlen
46+
- gochecknoglobals
47+
- gocheckcompilerdirectives
48+
- gochecknoinits
49+
- gocognit
50+
- goconst
51+
- gocritic
52+
- gocyclo
53+
- godot
54+
- godox
55+
- goerr113
56+
- gofmt
57+
- goimports
58+
- gomnd
59+
- goprintffuncname
60+
- gosec
61+
- gosimple
62+
- govet
63+
- ineffassign
64+
- lll
65+
- misspell
66+
- nakedret
67+
- nestif
68+
- noctx
69+
- nolintlint
70+
- prealloc
71+
- predeclared
72+
- revive
73+
- staticcheck
74+
- stylecheck
75+
- testpackage
76+
- thelper
77+
- tparallel
78+
- typecheck
79+
- unconvert
80+
- unparam
81+
- unused
82+
- whitespace
83+
- wsl

CONTACTS.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contacting bot developers
2+
3+
VK: https://vk.me/join/AJQ1d4_Y4B7ItQxiDave0s30 <br/>
4+
Telegram: https://t.me/botscommunitychat
5+
6+
If users do not respond, you can always contact the founders of this library in [VK](https://vk.com/immersivesky) or [Telegram](https://t.me/immersivesky), who will try to solve your problem

CONTRIBUTING.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Contributing to CONTRIBUTING.md
2+
3+
First off, thanks for taking the time to contribute! ❤️
4+
5+
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
6+
7+
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
8+
> - Star the project
9+
> - Tweet about it
10+
> - Refer this project in your project's readme
11+
> - Mention the project at local meetups and tell your friends/colleagues
12+
13+
14+
## Table of Contents
15+
16+
- [Code of Conduct](#code-of-conduct)
17+
- [I Have a Question](#i-have-a-question)
18+
- [I Want To Contribute](#i-want-to-contribute)
19+
- [Reporting Bugs](#reporting-bugs)
20+
- [Suggesting Enhancements](#suggesting-enhancements)
21+
- [Your First Code Contribution](#your-first-code-contribution)
22+
- [Improving The Documentation](#improving-the-documentation)
23+
- [Styleguides](#styleguides)
24+
- [Commit Messages](#commit-messages)
25+
- [Join The Project Team](#join-the-project-team)
26+
27+
28+
## Code of Conduct
29+
30+
This project and everyone participating in it is governed by the
31+
[CONTRIBUTING.md Code of Conduct](blob/master/CODE_OF_CONDUCT.md).
32+
By participating, you are expected to uphold this code. Please report unacceptable behavior
33+
to <>.
34+
35+
36+
## I Have a Question
37+
38+
> If you want to ask a question, we assume that you have read the available [Documentation]().
39+
40+
Before you ask a question, it is best to search for existing [Issues](/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
41+
42+
If you then still feel the need to ask a question and need clarification, we recommend the following:
43+
44+
- Open an [Issue](/issues/new).
45+
- Provide as much context as you can about what you're running into.
46+
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
47+
48+
We will then take care of the issue as soon as possible.
49+
50+
51+
52+
## I Want To Contribute
53+
54+
> ### Legal Notice
55+
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
56+
57+
### Reporting Bugs
58+
59+
60+
#### Before Submitting a Bug Report
61+
62+
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
63+
64+
- Make sure that you are using the latest version.
65+
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)).
66+
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](issues?q=label%3Abug).
67+
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
68+
- Collect information about the bug:
69+
- Stack trace (Traceback)
70+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
71+
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
72+
- Possibly your input and the output
73+
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
74+
75+
76+
#### How Do I Submit a Good Bug Report?
77+
78+
> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <>.
79+
80+
81+
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
82+
83+
- Open an [Issue](/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
84+
- Explain the behavior you would expect and the actual behavior.
85+
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
86+
- Provide the information you collected in the previous section.
87+
88+
Once it's filed:
89+
90+
- The project team will label the issue accordingly.
91+
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
92+
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
93+
94+
95+
96+
97+
### Suggesting Enhancements
98+
99+
This section guides you through submitting an enhancement suggestion for CONTRIBUTING.md, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
100+
101+
102+
#### Before Submitting an Enhancement
103+
104+
- Make sure that you are using the latest version.
105+
- Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration.
106+
- Perform a [search](/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
107+
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
108+
109+
110+
#### How Do I Submit a Good Enhancement Suggestion?
111+
112+
Enhancement suggestions are tracked as [GitHub issues](/issues).
113+
114+
- Use a **clear and descriptive title** for the issue to identify the suggestion.
115+
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
116+
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
117+
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
118+
- **Explain why this enhancement would be useful** to most CONTRIBUTING.md users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
119+
120+
121+
122+
### Your First Code Contribution
123+
124+
125+
### Improving The Documentation
126+
127+
128+
## Styleguides
129+
### Commit Messages
130+
131+
132+
## Join The Project Team
133+
134+
135+
136+
## Attribution
137+
This guide is based on the **contributing.md**. [Make your own](https://contributing.md/)!

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 BotsCommunity
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.

README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<img src="preview.png" alt="Bots Community">
2+
3+
<p align="center">Flexible and high-performance VK API module Go</p>
4+
5+
<div align="center">
6+
<a href="https://pkg.go.dev/github.com/botscommunity/vkgo">
7+
<img src="https://img.shields.io/static/v1?label=go&message=reference&color=00add8&logo=go" />
8+
</a>
9+
<a href="http://www.opensource.org/licenses/MIT">
10+
<img src="https://img.shields.io/badge/license-MIT-fuchsia.svg" />
11+
</a>
12+
<a href="https://goreportcard.com/report/github.com/botscommunity/vkgo">
13+
<img src="https://goreportcard.com/badge/github.com/botscommunity/vkgo" />
14+
</a>
15+
</div>
16+
17+
18+
<h2 align="center">Instalation</h2>
19+
20+
```bash
21+
go get github.com/botscommunity/vkgo
22+
```
23+
24+
<h2 align="center">Getting started</h2>
25+
26+
Examples of working bots can be seen in the catalog [/samples](./samples)
27+
28+
A simple example of a LongPoll API Bot:
29+
30+
```go
31+
package main
32+
33+
import (
34+
"github.com/botscommunity/vkgo/api"
35+
"github.com/botscommunity/vkgo/longpoll"
36+
"github.com/botscommunity/vkgo/scene"
37+
"github.com/botscommunity/vkgo/update"
38+
"os"
39+
)
40+
41+
func main() {
42+
bot := api.New(os.Getenv("TOKEN"))
43+
44+
messageScene := scene.Message(func(bot *api.Bot, message update.Message) {
45+
bot.SendMessage(message.ChatID, "echo message: "+message.Text)
46+
})
47+
48+
longpoll.Start(bot, messageScene)
49+
}
50+
```
51+
52+
<h2 align="center">Help in solving problems</h2>
53+
54+
Don't know how to solve your problem? Ask the programmers from [our community](./CONTACTS.md). There is a chance that they have already dealt with this problem and are ready to help you

0 commit comments

Comments
 (0)