refactor: change all Robot to Bot (#1767)

* Change all `Robot` to `Bot`

* Change all `r` of `Bot` to `b`

* Change `Robot` to `bot` in comments

* Fix typo

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
This commit is contained in:
Athurg Gooth
2023-05-29 19:49:05 +08:00
committed by GitHub
parent ddf4cae537
commit 845297ec03
16 changed files with 80 additions and 80 deletions

View File

@@ -9,12 +9,12 @@ import (
)
// downloadFileId download file with fileID, return the filepath and blob.
func (r *Robot) downloadFileID(ctx context.Context, fileID string) (string, []byte, error) {
file, err := r.GetFile(ctx, fileID)
func (b *Bot) downloadFileID(ctx context.Context, fileID string) (string, []byte, error) {
file, err := b.GetFile(ctx, fileID)
if err != nil {
return "", nil, err
}
blob, err := r.downloadFilepath(ctx, file.FilePath)
blob, err := b.downloadFilepath(ctx, file.FilePath)
if err != nil {
return "", nil, err
}
@@ -23,8 +23,8 @@ func (r *Robot) downloadFileID(ctx context.Context, fileID string) (string, []by
}
// downloadFilepath download file with filepath, you can get filepath by calling GetFile.
func (r *Robot) downloadFilepath(ctx context.Context, filePath string) ([]byte, error) {
apiURL, err := r.apiURL(ctx)
func (b *Bot) downloadFilepath(ctx context.Context, filePath string) ([]byte, error) {
apiURL, err := b.apiURL(ctx)
if err != nil {
return nil, err
}