sona pona:Discord: Difference between revisions

From sona pona, the Toki Pona wiki
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
{{Wiki essay}}
{{Wiki essay}}
{{Shortcut|SO:DC}}
{{Shortcut|SO:DC}}

{{tp|sona pona}} is currently active in the {{tp|[[ma pona pi toki pona]]}} Discord server, within in the <code>{{tok|sona.pona.la}}</code> in the <code>{{tok|#toki-suli}}</code> thread, and in the {{tp|kama sona}} Discord server, within in the <code>{{tok|sona.pona.la}}</code> in the <code>{{tok|#forum}}</code> thread. Please feel free to contact us there!
{{tp|sona pona}} is currently active in the {{tp|[[ma pona pi toki pona]]}}, within in the <code>{{tok|sona.pona.la}}</code> in the <code>{{tok|#toki-suli}}</code> thread, and in the {{tp|kama sona}} Discord server, within in the <code>{{tok|sona.pona.la}}</code> in the <code>{{tok|#forum}}</code> thread. Please feel free to contact us there!


==Using {{tp|sona pona}} on Discord==
==Using {{tp|sona pona}} on Discord==
{{Shortcut|SO:YAGPDB}}

Users are able to easily send links to {{tp|sona pona}} on Discord, using a bot. When a user type a page title inbetween two square brackets, for example, <code><nowiki>[[mu]]</nowiki></code>, the bot will post a link to the page referenced.
Users are able to easily send links to {{tp|sona pona}} on Discord, using a bot. When a user type a page title inbetween two square brackets, for example, <code><nowiki>[[mu]]</nowiki></code>, the bot will post a link to the page referenced.



Revision as of 16:32, 25 February 2024

Essay: This is a wiki essay with advice from one or more contributors.
Shortcut: SO:DC

sona pona is currently active in the ma pona pi toki pona, within in the sona.pona.la in the #toki-suli thread, and in the kama sona Discord server, within in the sona.pona.la in the #forum thread. Please feel free to contact us there!

Using sona pona on Discord

Shortcut: SO:YAGPDB

Users are able to easily send links to sona pona on Discord, using a bot. When a user type a page title inbetween two square brackets, for example, [[mu]], the bot will post a link to the page referenced.

  • Invite the YAGPDB bot into your server
    • Otherwise, ask an admin to do so
  • Go to its website
  • Log in and authenticate with your Discord account
  • Dashboard > Custom commands > Commands
  • Click "Create a new Custom Command"
  • Set the trigger type to "Regex" and trigger to \[\[.+\]\]
  • Under "Responses", paste the following piece of code by waso Keli
  • Save and done
{{/*   Trigger type:   Regex        */}}
{{/*   Trigger:        \[\[.+\]\]   */}}

{{ $bracketed_phrases := reFindAll `\[\[([^\]]*)\]\]` .Cmd }}
{{ range $bracketed_phrases -}}
  {{/* trim leading "[[" and trailing "]]" */}}
  {{- $wiki_link := slice .
     2
     (sub (len .) 2)
  }}
  {{- $wiki_link = reReplace " " $wiki_link "_" }}
  {{- $wiki_link = urlescape $wiki_link }}
  {{- $wiki_link = joinStr "" "https://sona.pona.la/wiki/" $wiki_link "\n" }}
  {{- $wiki_link = reReplace "%23" $wiki_link "#" }}
  {{- $wiki_link }}
{{- end }}

{{/* tan waso */}}