Skip to content

Commit

Permalink
fix: help buttons now work for Pins, Purges, Reports, Rules, Warns
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Aug 4, 2024
1 parent e26fbdb commit f2745b4
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 25 deletions.
11 changes: 6 additions & 5 deletions alita/modules/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ func (moduleStruct) helpButtonHandler(b *gotgbot.Bot, ctx *ext.Context) error {
module := args[1]

var (
_parsemode, helpText string
replyKb gotgbot.InlineKeyboardMarkup
parsemode, helpText string
replyKb gotgbot.InlineKeyboardMarkup
)

// Sort the module names
if string_handling.FindInStringSlice([]string{"BackStart", "Help"}, module) {
_parsemode = helpers.HTML
parsemode = helpers.HTML
switch module {
case "Help":
// This shows the main start menu
Expand All @@ -263,15 +263,16 @@ func (moduleStruct) helpButtonHandler(b *gotgbot.Bot, ctx *ext.Context) error {
}
} else {
// For all remainging modules
helpText, replyKb, _parsemode = getHelpTextAndMarkup(ctx, strings.ToLower(module))
// FIXME: error for pins, purges, reports, rules, warns
helpText, replyKb, parsemode = getHelpTextAndMarkup(ctx, strings.ToLower(module))
}

// Edit the main message, the main querymessage
_, _, err := query.Message.EditText(
b,
helpText,
&gotgbot.EditMessageTextOpts{
ParseMode: _parsemode,
ParseMode: parsemode,
ReplyMarkup: replyKb,
LinkPreviewOptions: &gotgbot.LinkPreviewOptions{
IsDisabled: true,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion locales/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ alt_names:
Misc: [extra, extras]
Mutes: [mute, unmute, tmute, smute, dmute]
Notes: [note, notes]
Pin: [antichannelpin, cleanlinked, pins]
Pins: [antichannelpin, cleanlinked, pins]
Purges: [purge, del]
Reports: [report, reporting]
Rules: [rule]
Expand Down
2 changes: 1 addition & 1 deletion locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ strings:
-/uloženo: Stejné jako /notes.
-/clearall: Odstranit VŠECHNY poznámky v konverzaci. Tuto operaci nelze vrátit zpět.
-/privatenotes: Určuje, zda mají být odeslány poznámky v PÚ. Odešle zprávu s tlačítkem, které uživatelé mohou klepnutím získat záznam v PÚ.
Pin:
Pins:
help_msg: |-
Všechny příkazy související s kolíkem zde naleznete; udržujte konverzaci aktuální na nejnovější zprávy s jednoduchou zafixovanou zprávou!
Expand Down
2 changes: 1 addition & 1 deletion locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ strings:
- /saved: Same as /notes.
- /clearall: Delete ALL notes in a chat. This cannot be undone.
- /privatenotes: Whether or not to send notes in PM. Will send a message with a button which users can click to get the note in PM.
Pin:
Pins:
help_msg: |-
Alle de relaterede kommandoer kan findes her. Du kan holde chatten opdateret til de seneste nyheder med en enkel meddelelse! *
Expand Down
2 changes: 1 addition & 1 deletion locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ strings:
-/gespeichert: Das Gleiche wie /Notes.
-/clearall: Löschen Sie ALLE Notizen in einem Chat. Das kann nicht rückgängig gemacht werden.
-/privatenotes: Ob Sie Notizen in PM senden möchten oder nicht. Wird eine Nachricht mit einer Schaltfläche senden, die Benutzer anklicken können, um den Hinweis in PM zu erhalten.
Pin:
Pins:
help_msg: |-
Alle Pin-bezogenen Befehle können hier gefunden werden; halten Sie Ihren Chat auf dem Laufenden über die neuesten Nachrichten mit einer einfachen gepinnten Nachricht!
Expand Down
2 changes: 1 addition & 1 deletion locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
- /αποθήκευση: Το ίδιο με το /σημειώσεις.
-/clearall: Διαγραφή όλων των σημειώσεων σε μια συνομιλία. Δεν μπορεί να αναιρείται.
- /privatenotes: Αν θα στείλετε ή όχι σημειώσεις στο PM. Θα στείλει ένα μήνυμα με ένα κουμπί που οι χρήστες μπορούν να πατήσουν για να λάβουν το σημείωμα στο PM.
Pin:
Pins:
help_msg: |-
Όλες οι σχετικές εντολές μπορούν να βρεθούν εδώ. Κρατήστε τη συνομιλία μέχρι σήμερα στις τελευταίες ειδήσεις με ένα απλό καρφιτσωμένο μήνυμα!
Expand Down
2 changes: 1 addition & 1 deletion locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ strings:
- /clearall: Delete ALL notes in a chat. This cannot be undone.
- /privatenotes: Whether or not to send notes in PM. Will send a message with a button which users can click to get the note in PM.
Pin:
Pins:
help_msg: |-
All the pin-related commands can be found here; keep your chat up to date on the latest news with a simple pinned message!
Expand Down
2 changes: 1 addition & 1 deletion locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/guardado: Igual que /notes.
-/clearall: Suprimir todas las notas en una conversación. Esto no se puede deshacer.
-/privatenetes: Ya sea o no enviar notas en PM. Enviará un mensaje con un botón que los usuarios pueden hacer clic para obtener la nota en PM.
Pin:
Pins:
help_msg: |-
Todos los comandos relacionados con el pin se pueden encontrar aquí; mantén tu chat al día en las últimas noticias con un simple mensaje marcado!
Expand Down
2 changes: 1 addition & 1 deletion locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ strings:
- /saved: Same as /notes.
- /clearall: Delete ALL notes in a chat. This cannot be undone.
- /privatenotes: Whether or not to send notes in PM. Will send a message with a button which users can click to get the note in PM.
Pin:
Pins:
help_msg: |-
Kaikki tähän liittyvät komennot voidaan löytää täältä; pidä rupattelun ajan tasalla viimeisimmistä uutisista, joissa on yksinkertainen kiinnitetty viesti.
Expand Down
2 changes: 1 addition & 1 deletion locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/sauvegardé: Identique à /notes.
-/clearall: Supprimer TOUTES les notes dans une discussion. Cela ne peut pas être fait.
-/privatenotes: Indique s'il faut envoyer ou non des notes dans la fiche MP. Enverra un message avec un bouton que les utilisateurs peuvent cliquer pour obtenir la note dans PM.
Pin:
Pins:
help_msg: |-
Toutes les commandes liées à la broche peuvent être trouvées ici ; gardez votre discussion à jour sur les dernières nouvelles avec un message épinglette simple !
Expand Down
2 changes: 1 addition & 1 deletion locales/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
- /saved: Same as /notes.
- /clearall: Delete ALL notes in a chat. This cannot be undone.
- /privatenotes: Whether or not to send notes in PM. Will send a message with a button which users can click to get the note in PM.
Pin:
Pins:
help_msg: |-
All the pin related commands can be found here; keep your chat up to date on the latest news with a simple pinned message!
Expand Down
2 changes: 1 addition & 1 deletion locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
- /salvato: Stessa /note.
- /clearall: Elimina tutte le note ALL in una conversazione. Questo non può essere incompiuto.
- /privatenotes: Che inviare o meno le note in PM. Invierà un messaggio con un pulsante che gli utenti possono clicca per ottenere la nota in PM.
Pin:
Pins:
help_msg: |-
Tutti i comandi correlati al pin possono essere trovati qui; tieni la tua chat aggiornata sulle ultime novità con un semplice messaggio pinned!
Expand Down
2 changes: 1 addition & 1 deletion locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
- / 保存: /notesと同じ。
- /clearall: チャット中のすべてのメモを削除します。 これは元にはできません。
- /privatenotes: 予防保全にメモを送信するかどうか。 ユーザーがクリックすると予防保全のメモを取得するためのボタンが付いたメッセージが送信されます。
Pin:
Pins:
help_msg: |-
ピンに関連するすべてのコマンドは、ここで見つけることができます。最新のニュースで、単純なピン留めされたメッセージでチャットを最新の状態に保つことができます。
Expand Down
2 changes: 1 addition & 1 deletion locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/opgeslagen: Zelfde als /notes.
-/clearall: Verwijder alle noten in een chat. Dit kan niet ongedaan worden gemaakt.
-/privatenotes: Al dan niet notities verzenden in PM. Zal een bericht verzenden met een knop waarmee gebruikers kunnen klikken om de noot in PM te krijgen.
Pin:
Pins:
help_msg: |-
Alle pin-gerelateerde commando's zijn hier te vinden; houd uw chat up-to-date op het laatste nieuws met een eenvoudig vastgezette bericht!
Expand Down
2 changes: 1 addition & 1 deletion locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/zapisane: tak samo jak /notes.
-/clearall: Usuń WSZYSTKIE uwagi w rozmowie sieciowej. Tego nie można cofnąć.
-/privatenotes: Określa, czy mają być wysyłane notatki w KZ. Zostanie wysłana wiadomość z przyciskiem, który użytkownicy mogą kliknąć, aby uzyskać notatkę w KZ.
Pin:
Pins:
help_msg: |-
Wszystkie komendy związane z pinami można znaleźć tutaj; na bieżąco informować o najnowszych nowościach za pomocą prostego zaczepionego komunikatu!
Expand Down
2 changes: 1 addition & 1 deletion locales/ro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/salvat: La fel ca şi /notiţele.
-/clearall: Şterge TOATE notele într-un chat. Aceasta nu poate fi anulată.
-/privatenotes: Fie ca se trimit sau nu note in PM. Va trimite un mesaj cu un buton pe care utilizatorii il pot face clic pentru a obtine nota in PM.
Pin:
Pins:
help_msg: |-
Toate comenzile legate de pin pot fi găsite aici; păstraţi chat-ul până la data la ultimele ştiri cu un mesaj simplu ţintuit!
Expand Down
2 changes: 1 addition & 1 deletion locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/сохранено: То же, что и /notes.
-/clearall: Удалить все примечания в чате. Это невозможно отменить.
-/privatenotes: Нужно ли отправлять заметки в ПТОиР. Отправит сообщение с кнопкой, которую пользователи могут нажать, чтобы получить заметку в ПТОиР.
Pin:
Pins:
help_msg: |-
Все команды, связанные с булавами, можно найти здесь; оставить свой разговор до сегодняшнего дня на последних новостях с простым закрепленным сообщением!
Expand Down
2 changes: 1 addition & 1 deletion locales/sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/sparad: Samma som / anteckningar.
-/clearall: Ta bort alla anteckningar i en chatt. Det här kan inte ångras.
-/privatenotes: Om du vill skicka anteckningar i FU-mallen eller inte. Skickar ett meddelande med en knapp som användare kan klicka på för att hämta anteckningen i PM.
Pin:
Pins:
help_msg: |-
Alla knappnålsbesläktade kommandon finns här. Håll chatten aktuell på de senaste nyheterna med ett enkelt favoritmeddelande.
Expand Down
2 changes: 1 addition & 1 deletion locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ strings:
-/kayıtlı: /notes ile aynı.
-/clearall: Bir sohbetteki TÜM notları silin. Bu işlem geri alınamaz.
-/privateentes: PM ' de not gönderilip gönderilmeyeceğini belirler. Kullanıcıların Koruyucu Bakımda notu almak için tıklatabilecekleri bir düğme içeren bir ileti gönderilir.
Pin:
Pins:
help_msg: |-
Tüm iğne ile ilgili komutlar burada bulunabilir; sohbetinizi en son haberler üzerinde basit sabitlenmiş bir iletiyle güncel tutun!
Expand Down
2 changes: 1 addition & 1 deletion locales/uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ strings:
- /saved: Same as /notes.
- /clearall: Delete ALL notes in a chat. This cannot be undone.
- /privatenotes: Whether or not to send notes in PM. Will send a message with a button which users can click to get the note in PM.
Pin:
Pins:
help_msg: |-
All the pin related commands can be found here; keep your chat up to date on the latest news with a simple pinned message!
Expand Down
2 changes: 1 addition & 1 deletion locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ strings:
- / 已保存: 与 /notes 相同。
- /clearall: 在交谈中删除所有注释。 这是无法撤销的。
- /privatenotes: 是否在 PM中发送注释。 将发送一条带按钮的消息,用户可以单击该按钮以获取 PM中的注释。
Pin:
Pins:
help_msg: |-
可以在此处找到所有与引脚相关的命令 ; 以简单的固定消息!
Expand Down

0 comments on commit f2745b4

Please sign in to comment.