-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 引用メッセージを展開するように #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0bcdcc1
Merge pull request #54 from traPtitech/staging
kaitoyama 1e173a2
chore: bump dependencies
cp-20 8f8daaf
fix: ci
cp-20 95da448
Merge pull request #56 from traPtitech/chore/update-dependencies
kaitoyama fa8d84e
feat: 引用メッセージを展開するように
cp-20 f57e448
fix: 引用の条件を修正
cp-20 2f03617
fix: regex
cp-20 0c872e6
fix: isUserAllowingQuotes
cp-20 72f2a24
fix: 省略ロジック
cp-20 601ef21
fix: lint
cp-20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,49 @@ | ||
| module github.com/traPtitech/BOT_GPT // replace with your own module name | ||
|
|
||
| go 1.22 | ||
|
|
||
| toolchain go1.22.0 | ||
| go 1.24.0 | ||
|
|
||
| require ( | ||
| github.com/go-sql-driver/mysql v1.8.1 | ||
| github.com/go-sql-driver/mysql v1.9.3 | ||
| github.com/jmoiron/sqlx v1.4.0 | ||
| github.com/joho/godotenv v1.5.1 | ||
| github.com/milvus-io/milvus-sdk-go/v2 v2.4.2 | ||
| github.com/openai/openai-go/v2 v2.7.1 | ||
| github.com/pressly/goose/v3 v3.20.0 | ||
| github.com/traPtitech/go-traq v0.0.0-20240509050113-9343acbeec35 | ||
| github.com/traPtitech/traq-ws-bot v1.1.3 | ||
| github.com/pressly/goose/v3 v3.26.0 | ||
| github.com/traPtitech/go-traq v0.0.0-20251201015624-285ca186fc5e | ||
| github.com/traPtitech/traq-ws-bot v1.2.1 | ||
| ) | ||
|
|
||
| require ( | ||
| filippo.io/edwards25519 v1.1.0 // indirect | ||
| github.com/cockroachdb/errors v1.9.1 // indirect | ||
| github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect | ||
| github.com/cockroachdb/redact v1.1.3 // indirect | ||
| github.com/getsentry/sentry-go v0.12.0 // indirect | ||
| github.com/gofrs/uuid v4.2.0+incompatible // indirect | ||
| github.com/cockroachdb/errors v1.12.0 // indirect | ||
| github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect | ||
| github.com/cockroachdb/redact v1.1.6 // indirect | ||
| github.com/getsentry/sentry-go v0.41.0 // indirect | ||
| github.com/gofrs/uuid/v5 v5.4.0 // indirect | ||
| github.com/gogo/protobuf v1.3.2 // indirect | ||
| github.com/golang/protobuf v1.5.3 // indirect | ||
| github.com/google/go-cmp v0.6.0 // indirect | ||
| github.com/gorilla/websocket v1.5.0 // indirect | ||
| github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect | ||
| github.com/kr/pretty v0.3.0 // indirect | ||
| github.com/golang/protobuf v1.5.4 // indirect | ||
| github.com/gorilla/websocket v1.5.3 // indirect | ||
| github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect | ||
| github.com/kr/pretty v0.3.1 // indirect | ||
| github.com/kr/text v0.2.0 // indirect | ||
| github.com/mfridman/interpolate v0.0.2 // indirect | ||
| github.com/milvus-io/milvus-proto/go-api/v2 v2.4.10-0.20240819025435-512e3b98866a // indirect | ||
| github.com/motoki317/sc v1.8.2 // indirect | ||
| github.com/pkg/errors v0.9.1 // indirect | ||
| github.com/rogpeppe/go-internal v1.8.1 // indirect | ||
| github.com/sethvargo/go-retry v0.2.4 // indirect | ||
| github.com/stretchr/testify v1.8.4 // indirect | ||
| github.com/tidwall/gjson v1.14.4 // indirect | ||
| github.com/tidwall/match v1.1.1 // indirect | ||
| github.com/rogpeppe/go-internal v1.14.1 // indirect | ||
| github.com/sethvargo/go-retry v0.3.0 // indirect | ||
| github.com/tidwall/gjson v1.18.0 // indirect | ||
| github.com/tidwall/match v1.2.0 // indirect | ||
| github.com/tidwall/pretty v1.2.1 // indirect | ||
| github.com/tidwall/sjson v1.2.5 // indirect | ||
| go.uber.org/multierr v1.11.0 // indirect | ||
| golang.org/x/net v0.34.0 // indirect | ||
| golang.org/x/oauth2 v0.20.0 // indirect | ||
| golang.org/x/sync v0.10.0 // indirect | ||
| golang.org/x/sys v0.29.0 // indirect | ||
| golang.org/x/text v0.21.0 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect | ||
| google.golang.org/grpc v1.59.0 // indirect | ||
| google.golang.org/protobuf v1.33.0 // indirect | ||
| golang.org/x/net v0.49.0 // indirect | ||
| golang.org/x/oauth2 v0.34.0 // indirect | ||
| golang.org/x/sync v0.19.0 // indirect | ||
| golang.org/x/sys v0.40.0 // indirect | ||
| golang.org/x/text v0.33.0 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20260126211449-d11affda4bed // indirect | ||
| google.golang.org/grpc v1.78.0 // indirect | ||
| google.golang.org/protobuf v1.36.11 // indirect | ||
| gopkg.in/validator.v2 v2.0.1 // indirect | ||
| ) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package bot | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "github.com/motoki317/sc" | ||
| ) | ||
|
|
||
| func getChannelPathInternal(ctx context.Context, channelID string) (string, error) { | ||
| bot := GetBot() | ||
|
|
||
| path, _, err := bot.API().ChannelAPI.GetChannelPath(ctx, channelID).Execute() | ||
| if err != nil { | ||
| return "", err | ||
| } | ||
|
|
||
| return path.Path, nil | ||
| } | ||
|
|
||
| var channelPathCache = sc.NewMust(getChannelPathInternal, time.Hour, time.Hour, nil) | ||
|
|
||
| func GetChannelPath(channelID string) (string, error) { | ||
| return channelPathCache.Get(context.Background(), channelID) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package bot | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "github.com/motoki317/sc" | ||
| "github.com/traPtitech/go-traq" | ||
| ) | ||
|
|
||
| func getUserInternal(ctx context.Context, userID string) (*traq.UserDetail, error) { | ||
| bot := GetBot() | ||
|
|
||
| user, _, err := bot.API().UserAPI.GetUser(ctx, userID).Execute() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| return user, nil | ||
cp-20 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| var userCache = sc.NewMust(getUserInternal, time.Hour, time.Hour, nil) | ||
|
|
||
| func GetUser(userID string) (*traq.UserDetail, error) { | ||
| return userCache.Get(context.Background(), userID) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.