Skip to content

Commit c15d255

Browse files
committed
added discordgo-fork-dev to ./pkg
1 parent 15d6336 commit c15d255

89 files changed

Lines changed: 22748 additions & 3 deletions

Some content is hidden

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ require (
3838
golang.org/x/net v0.53.0
3939
)
4040

41-
replace github.com/bwmarrin/discordgo => github.com/yeongaori/discordgo-fork v0.0.0-20260315104245-037b0e48bb49
41+
replace github.com/bwmarrin/discordgo => ./pkg/discordgo-fork-dev

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
4444
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
4545
github.com/tetratelabs/wazero v1.11.0 h1:+gKemEuKCTevU4d7ZTzlsvgd1uaToIDtlQlmNbwqYhA=
4646
github.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU=
47-
github.com/yeongaori/discordgo-fork v0.0.0-20260315104245-037b0e48bb49 h1:2rTkwRDRzztW0wV0bWvfQxLY2JiU+w6AyssNIMnWGmw=
48-
github.com/yeongaori/discordgo-fork v0.0.0-20260315104245-037b0e48bb49/go.mod h1:A0FcMFJKJ9fRjgSuZ2o+pIQ6mPS81SVuiLN2vYTa7Ao=
4947
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
5048
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
5149
golang.org/x/net v0.0.0-20211104170005-ce137452f963/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
changelog:
2+
categories:
3+
- title: "Breaking changes"
4+
labels:
5+
- breaking changes
6+
7+
- title: "New features"
8+
labels:
9+
- feature
10+
11+
- title: "Other changes"
12+
labels:
13+
- "*"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
on:
2+
push:
3+
pull_request:
4+
5+
name: CI
6+
7+
jobs:
8+
format:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v3
13+
with:
14+
go-version: 1.18
15+
- name: Code
16+
uses: actions/checkout@v3
17+
- name: Check diff between gofmt and code
18+
run: diff <(gofmt -d .) <(echo -n)
19+
20+
test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
go-version: [1.13, 1.14, 1.15, 1.16, 1.17, 1.18]
25+
steps:
26+
- name: Install Go
27+
uses: actions/setup-go@v3
28+
with:
29+
go-version: ${{ matrix.go-version }}
30+
- name: Code
31+
uses: actions/checkout@v3
32+
- run: go test -v -race ./...
33+
34+
lint:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Install Go
38+
uses: actions/setup-go@v3
39+
with:
40+
go-version: 1.18
41+
- name: Code
42+
uses: actions/checkout@v3
43+
- name: Go vet
44+
run: go vet -x ./...
45+
46+
- name: GolangCI-Lint
47+
uses: golangci/golangci-lint-action@v3
48+
if: github.event.name == 'pull_request'
49+
with:
50+
only-new-issues: true
51+
skip-pkg-cache: true
52+
skip-build-cache: true
53+
54+
- name: GolangCI-Lint
55+
if: github.event.name != 'pull_request' # See https://github.com/golangci/golangci-lint-action/issues/362
56+
run: |
57+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
58+
59+
$(go env GOPATH)/bin/golangci-lint run
60+

pkg/discordgo-fork-dev/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# IDE-specific metadata
2+
.idea/
3+
4+
# Environment variables. Useful for examples.
5+
.env
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
# - staticcheck
5+
# - unused
6+
- golint
7+
8+
linters-settings:
9+
staticcheck:
10+
go: "1.13"
11+
12+
checks: ["all"]
13+
14+
unused:
15+
go: "1.13"
16+
17+
issues:
18+
include:
19+
- EXC0002

pkg/discordgo-fork-dev/.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: go
2+
go:
3+
- 1.13.x
4+
- 1.14.x
5+
- 1.15.x
6+
- 1.16.x
7+
- 1.17.x
8+
- 1.18.x
9+
env:
10+
- GO111MODULE=on
11+
install:
12+
- go get github.com/bwmarrin/discordgo
13+
- go get -v .
14+
- go get -v golang.org/x/lint/golint
15+
script:
16+
- diff <(gofmt -d .) <(echo -n)
17+
- go vet -x ./...
18+
- golint -set_exit_status ./...
19+
- go test -v -race ./...
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Getting started
2+
3+
To start off you can check out existing Pull Requests and Issues to get a gasp of what problems we’re currently solving and what features you can implement.
4+
5+
## Issues
6+
7+
Our issues are mostly used for bugs, however we welcome refactoring and conceptual issues.
8+
9+
Any other conversation would belong and would be moved into “Discussions”.
10+
11+
## Discussions
12+
13+
We use discussions for ideas, polls, announcements and help questions.
14+
15+
Don’t hesitate to ask, we always would try to help.
16+
17+
## Pull Requests
18+
19+
If you want to help us by improving existing or adding new features, you create what’s called a Pull Request (aka PR). It allows us to review your code, suggest changes and merge it.
20+
21+
Here are some tips on how to make a good first PR:
22+
23+
- When creating a PR, please consider a distinctive name and description for it, so the maintainers can understand what your PR changes / adds / removes.
24+
- It’s always a good idea to link documentation when implementing a new feature / endpoint
25+
- If you’re resolving an issue, don’t forget to [link it](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) in the description.
26+
- Enable the checkbox to allow maintainers to edit your PR and make commits in the PR branch when necessary.
27+
- We may ask for changes, usually through suggestions or pull request comments. You can apply suggestions right in the UI. Any other change needs to be done manually.
28+
- Don’t forget to mark PR comments resolved when you’re done applying the changes.
29+
- Be patient and don’t close and reopen your PR when no one responds, sometimes it might be held for a while. There might be a lot of reasons: release preparation, the feature is not significant, maintainers are busy, etc.
30+
31+
32+
When your changes are still incomplete (i.e. in Work In Progress state), you can still create a PR, but consider making it a draft.
33+
To make a draft PR, you can change the type of PR by clicking to a triangle next to the “Create Pull Request” button.
34+
35+
Once you’re done, you can mark it as “Ready for review”, and we’ll get right on it.
36+
37+
38+
# Code style
39+
40+
To standardize and make things less messy we have a certain code style, that is persistent throughout the codebase.
41+
42+
## Naming
43+
44+
### REST methods
45+
46+
When naming a REST method, while it might seem counterintuitive, we specify the entity before the action verb (for GET endpoints we don’t specify one however). Here’s an example:
47+
48+
> Endpoint name: Get Channel Message
49+
>
50+
> Method name: `ChannelMessage`
51+
52+
> Endpoint name: Edit Channel Message
53+
>
54+
> Method name: `ChannelMessageEdit`
55+
56+
### Parameter structures
57+
58+
When making a complex REST endpoint, sometimes you might need to implement a `Param` structure. This structure contains parameters for certain endpoint/set of endpoints.
59+
60+
- If an endpoint/set of endpoints have mostly same parameters, it’s a good idea to use a single `Param` structure for them. Here’s an example:
61+
62+
> Endpoint: `GuildMemberEdit`
63+
>
64+
> `Param` structure: `GuildMemberParams`
65+
- If an endpoint/set of endpoints have differentiating parameters, `Param` structure can be named after the endpoint’s verb. Here’s an example:
66+
67+
> Endpoint: `ChannelMessageSendComplex`
68+
>
69+
> `Param` structure: `MessageSend`
70+
71+
> Endpoint: `ChannelMessageEditComplex`
72+
>
73+
> `Param` structure: `MessageEdit`
74+
75+
### Events
76+
77+
When naming an event, we follow gateway’s internal naming (which often matches with the official event name in the docs). Here’s an example:
78+
79+
> Event name: Interaction Create (`INTERACTION_CREATE`)
80+
>
81+
> Structure name: `InteractionCreate`
82+
83+
## Returns
84+
85+
In our REST functions we usually favor named returns instead of regular anonymous returns. This helps readability.
86+
87+
Additionally we try to avoid naked return statements for functions with a long body. Since it’s easier to loose track of the return result.

pkg/discordgo-fork-dev/LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c) 2015, Bruce Marriner
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of discordgo nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+

pkg/discordgo-fork-dev/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# DiscordGo yeongaori fork
2+
3+
This is fork of [ozraru/discordgo](https://github.com/ozraru/discordgo).
4+
5+
Original repo of this project: [bwmarrin/discordgo](https://github.com/bwmarrin/discordgo).
6+
7+
8+
This fork focuses on stability and simply “working well.”

0 commit comments

Comments
 (0)