
Herkese Merhaba!
Bugünkü rehberimizde sizlere buton oluşturma, butona tıklayınca mesaj gönderme v.b göstereceğim.
Öncelikle butonlarımızı bir oluşturalım:
Kod:
discord command buton:
prefixes: !
trigger:
set {_buton} to new components row
add new secondary button with url "buton-1" named "Normal Buton" with reaction "smoking" to components of {_buton}
add new danger button with url "buton-2" named "Kırmızı Buton" with reaction "wrench" to components of {_buton}
add new success button with url "buton-3" named "Yeşil Buton" with reaction "hear_no_evil" to components of {_buton}
add new primary button with url "buton-4" named "Mavi Buton" with reaction "soccer" to components of {_buton}
add new link button with url "https://google.com" named "Link Butonu" with reaction "link" to components of {_buton}
reply with "Butonlara merhaba de!" with components {_buton}
Şimdi ise butonlara tıklayınca etkileşim haline girmeyi görelim:
Kod:
on button click:
if event-string is "buton-1":
reply with "Normal Buton'a tıkladın!"
if event-string is "buton-2":
reply with "Kırmızı Buton'a tıkladın!"
if event-string is "buton-3":
reply with "Yeşil Buton'a tıkladın!"
Şimdi ise butonlarla ilgili diğer bilgilere bir bakalım:
* Butonları devre dışı olarak oluşturabilirsiniz;
Kod:
discord command buton2:
prefixes: !
trigger:
set {_buton} to new components row
add new disabled secondary button with url "buton-1" named "Normal Buton" with reaction "smoking" to components of {_buton}
add new disabled danger button with url "buton-2" named "Kırmızı Buton" with reaction "wrench" to components of {_buton}
add new disabled success button with url "buton-3" named "Yeşil Buton" with reaction "hear_no_evil" to components of {_buton}
add new disabled primary button with url "buton-4" named "Mavi Buton" with reaction "soccer" to components of {_buton}
add new disabled link button with url "https://google.com" named "Link Butonu" with reaction "link" to components of {_buton}
reply with "Butonlara merhaba de!" with components {_buton}
* Etkileşimde iken gönderilen mesajı sadece sizin görmenizi sağlayabilirsiniz;
Kod:
on button click:
if event-string is "buton-1":
reply with hidden "Normal Buton'a tıkladın!"
if event-string is "buton-2":
reply with hidden "Kırmızı Buton'a tıkladın!"
if event-string is "buton-3":
reply with hidden "Yeşil Buton'a tıkladın!"
Bu günlük bu kadar :) rehberi sevdiyseniz tepki vererek ya da yorum yazarak belirtirseniz mutlu olurum, aksi takdirde rehbere devam etmeyeceğim :) iyi forumlar..