Rehber DiSky #3 - Buton Oluşturma ve Etkileşime Girme

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Furkan Doğan

¯⁠\⁠_⁠ʘ⁠‿⁠ʘ⁠_⁠/⁠¯
Emektar
MinePass
Katılım
14 Nisan 2023
Mesajlar
922
Elmaslar
239
Puan
5.605
Minecraft
FurkanDogan

Discord:

furkandogan.

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}
1.png


Ş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!"
2.png


Ş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}
3.png


* 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!"
4.png




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..
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Hala Discord sunucumuza katılmadın mı?

Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!

Şimdi Katıl
Üst