sona pona:Discord: Difference between revisions

From sona pona, the Toki Pona wiki
Content added Content deleted
No edit summary
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Wiki essay}}
{{Wiki essay}}
{{Shortcut|SO:DC}}
{{Shortcut|SP: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 managed from its own '''[//discord.gg/WFRs3dyKMP Discord server]'''. Please feel free to contact us there!

There are also threads in {{tp|[[ma pona pi toki pona]]}}, within in the <code>{{tok|sona.pona.la}}</code> thread in the <code>{{tok|#toki-suli}}</code> channel, and in the {{tp|kama sona}} Discord server, within in the <code>{{tok|sona.pona.la}}</code> thread in the <code>{{tok|#forum}}</code> channel.


==Using {{tp|sona pona}} on Discord==
==Using {{tp|sona pona}} on Discord==
{{Shortcut|SP: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>[[</nowiki>{{tok|mu}}<nowiki>]]</nowiki></code>, the bot will post a link to the page referenced.


* Invite the YAGPDB bot into your server
# Invite the YAGPDB bot into your server (or ask a server admin to do so).
# Go to [//yagpdb.xyz its website].
** Otherwise, ask an admin to do so
# Log in and authenticate with your Discord account.
* Go to [https://yagpdb.xyz/ its website]
# Dashboard &rarr; Custom commands &rarr; Commands
* Log in and authenticate with your Discord account
# Press "Create a new Custom Command".
* Dashboard > Custom commands > Commands
# Set the trigger type to "Regex" and trigger to <code>\[\[.+\]\]</code>
* Click "Create a new Custom Command"
# Under "Responses", paste the following piece of code by {{tok|waso Keli}}.
* Set the trigger type to "Regex" and trigger to <code>\[\[.+\]\]</code>
# [[File:OOjs UI icon check-constructive.svg|15x15px|link=]] Save and done.
* Under "Responses", paste the following piece of code by {{tok|waso Keli}}
* Save and done


<syntaxhighlight lang="golang">
<pre>
{{/* Trigger type: Regex */}}
{{/* Trigger type: Regex */}}
{{/* Trigger: \[\[.+\]\] */}}
{{/* Trigger: \[\[.+\]\] */}}
Line 35: Line 37:


{{/* tan waso */}}
{{/* tan waso */}}
</syntaxhighlight>
</pre>
{{Project}}

Latest revision as of 16:05, 2 April 2024

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

sona pona is managed from its own Discord server. Please feel free to contact us there!

There are also threads in ma pona pi toki pona, within in the sona.pona.la thread in the #toki-suli channel, and in the kama sona Discord server, within in the sona.pona.la thread in the #forum channel.

Using sona pona on Discord[edit source]

Shortcut: SP: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.

  1. Invite the YAGPDB bot into your server (or ask a server admin to do so).
  2. Go to its website.
  3. Log in and authenticate with your Discord account.
  4. Dashboard → Custom commands → Commands
  5. Press "Create a new Custom Command".
  6. Set the trigger type to "Regex" and trigger to \[\[.+\]\]
  7. Under "Responses", paste the following piece of code by waso Keli.
  8. 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 */}}