機能 #1140 » 0002-update_profile_spell.patch
core/plugin/twitter/twitter.rb | ||
---|---|---|
216 | 216 |
twitter.search(**options) |
217 | 217 |
end |
218 | 218 | |
219 |
defspell(:update_profile_name, :twitter) do |twitter, name:| |
|
220 |
(twitter/'account/update_profile').user(name: name) |
|
221 |
end |
|
222 | ||
223 |
defspell(:update_profile_location, :twitter) do |twitter, location:| |
|
224 |
(twitter/'account/update_profile').user(location: location) |
|
225 |
end |
|
226 | ||
227 |
defspell(:update_profile_url, :twitter) do |twitter, url:| |
|
228 |
(twitter/'account/update_profile').user(url: url) |
|
229 |
end |
|
230 | ||
231 |
defspell(:update_profile_biography, :twitter) do |twitter, biography:| |
|
232 |
(twitter/'account/update_profile').user(description: biography) |
|
233 |
end |
|
234 | ||
235 |
defspell(:update_profile_icon, :twitter, :photo) do |twitter, photo| |
|
236 |
photo.download.next{ |downloaded| |
|
237 |
(twitter/'account/update_profile_image').user(image: Base64.encode64(downloaded.blob)) |
|
238 |
} |
|
239 |
end |
|
240 | ||
219 | 241 |
# リツイートを削除した時、ちゃんとリツイートリストからそれを削除する |
220 | 242 |
on_destroyed do |messages| |
221 | 243 |
messages.each{ |message| |