Ця сторінка повністю або частково не перекладена. Прохання перекласти її відповідною мовою (українська).
DiscordBanner додає динамічний банер з API Discord, який зв'язує користувачів з сервером Discord. Він також відображає кількість користувачів в мережі.
Встановлення[]
Налаштування[]
ID вашого сервера зберігається в MediaWiki:Custom-DiscordBanner-id. Всі інші параметри конфігурації зберігаються в об'єкті window.DiscordBannerSettings
.
Змінна | Опис | Значення за замовчуванням | Допустимі значення | Необов'язково |
---|---|---|---|---|
bannerStyle
|
Стиль банеру | 3
|
1 , 2 , 3 , 4
|
X |
inviteLink
|
Посилання на сервер у Discord | Vgfu9qb (сервер Fandom Developers Wiki)
|
Будь-яке посилання з запрошенням до серверу у Discord (повинно бути постійним і вести на сервер, вказаний на сторінці Custom-DiscordBanner-id) | X |
prependToRail
|
Помістіть банер у верхню частину колії | true
|
true , false
|
|
noRail
|
Whether the rail module should be disabled | false
|
true , false
|
Нижче наведено приклад конфігурації:
window.DiscordBannerSettings = {
bannerStyle: '2',
inviteLink: 'Vgfu9qb', // Fandom Developers Wiki, EXAMPLE CONFIGURATION
prependToRail: false
};
Using configuration options with Fandom Developers Wiki scripts
The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS
is used to load the scripts, it will be executed last.
// 1. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 2. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
Template configuration[]
Option | Type | What it changes | Default |
---|---|---|---|
id
|
String | Your server's ID. For more information on how to get your server's ID, please see here. This parameter is required. | N/A |
invite
|
String | The second half of your server's invite link. (discord.gg/Vgfu9qb ) This parameter is required. The invite must be permanent.
|
N/A |
style
|
String | The banner style. | N/A |
For example, the following would produce a working template for the Fandom International server:
{{DiscordBanner | id = 160718156787220480 | invite = CWbREjG | style = 2 }}
You are either viewing on FandomMobile or you disabled your JavaScript via browser.
FAQ[]
- Як отримати ID свого сервера?
- Натисніть назву вашого сервера, перейдіть до «Налаштування сервера» > «Віджет» та скопіюйте ID сервера. Детальні інструкції можна знайти тут.
- Як виглядають стилі банерів?
- Нижче наведені різні банери:
Див. також[]
- DiscordIntegrator - додає віджет до колії/вмісту сторінки
- DiscordModule - додає модуль, що веде до сервера у Discord
- DiscordChat - adds a widget replacing the chat rail module