mirror of
https://github.com/diamondburned/cchat.git
synced 2024-10-31 20:04:33 +00:00
Added Avatar() into Author
This commit adds the Avatar method into the Author interface. It returns the URL if one, or it can return an empty string if either the service does not support avatars or the user doesn't have avatars.
This commit is contained in:
parent
aaa29f35b0
commit
555931f974
3
cchat.go
3
cchat.go
|
@ -211,6 +211,9 @@ type Authenticator interface {
|
|||
type Author interface {
|
||||
Identifier
|
||||
|
||||
// Avatar returns the URL to the user's avatar or an empty string if they have
|
||||
// no avatar or the service does not have any avatars.
|
||||
Avatar() (url string)
|
||||
Name() text.Rich
|
||||
}
|
||||
|
||||
|
|
|
@ -597,6 +597,17 @@ var Main = Packages{
|
|||
Type: MakeQual("text", "Rich"),
|
||||
}},
|
||||
},
|
||||
GetterMethod{
|
||||
method: method{
|
||||
Comment: Comment{`
|
||||
Avatar returns the URL to the user's avatar or an
|
||||
empty string if they have no avatar or the service
|
||||
does not have any avatars.
|
||||
`},
|
||||
Name: "Avatar",
|
||||
},
|
||||
Returns: []NamedType{{Name: "url", Type: "string"}},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
Comment: Comment{`
|
||||
|
|
Loading…
Reference in a new issue