Discord聊天室 样版

例子

[[div_ class="discord"]]
[[div_ class="messages-panel"]]
[[div_ class="messages-group"]]
[[div_ class="messages"]]






[[div_ class="message one"]]
[[div_ class="body"]]
GOTO 20

今日 4:28 PM

[[div_ class="content"]]

哟,Corvus,在吗?smug.svg





[[/div]]
[[/div]]
[[/div]]


[[div_ class="message two"]]
[[div_ class="body"]]
Corvas

今日 4:28 PM

[[div_ class="content"]]


咋啦@GOTO 20
smug.svg





[[/div]]
[[/div]]
[[/div]]


新消息
[[div_ class="message one"]]
[[div_ class="body"]]
GOTO 20

今日 4:29 PM

[[div_ class="content"]]

这有张图
noodle.jpg





[[/div]]
[[/div]]
[[/div]]


[[div_ class="message one attch-one"]]
GOTO 20

今日 4:30 PM





[[a class="anchor" href="http://scp-wiki-cn.wikidot.com/scp-2105
" target="_blank"]]download-arrow.svg[[/a]]

[[/div]] [[div_ class="message two attch-two"]]
corvas

今日 5:20 PM





[[a class="anchor" href="http://scp-wiki-cn.wdfiles.com/scp-4205
" target="_blank"]]download-arrow.svg[[/a]]

[[/div]]


[[/div]]
[[/div]]
[[/div]]
[[/div]]





+ 点此查看以上实例的代码- 隐藏代码

[[include component:discord-chat-source |inc-source= --] ]]

[[include component:discord-chat-source |inc-user= --]
|user-id=one
|username=GOTO 20
{{|usericon=@@https://scp-wiki.wdfiles.com/local--files/component:discord-chat/GOTO20.png@@}}
|usercolor=#ff5e56
]]

[[include component:discord-chat-source |inc-user= --]
|user-id=two
|username=Corvas
{{|usericon=@@https://scp-wiki.wdfiles.com/local--files/component:discord-chat/corvas.png@@}}
|usercolor=#60b9dc
]]

[[include component:discord-chat-source |inc-start= --] ]]

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=one
|username=GOTO 20
|msg-time=今日 4:28 PM
]]
哟,Corvus,在吗?[[image https://scp-wiki.wdfiles.com/local--files/component:discord-chat/smug.svg class="emoji inline"]]
[[include component:discord-chat-source |inc-msg-end= --] ]]

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=two
|username=Corvas
|msg-time=今日 4:28 PM
]]
{{呀 }}
咋啦 [[span class="at_mention"]]@GOTO 20[[/span]]
[[image https://scp-wiki.wdfiles.com/local--files/component:discord-chat/smug.svg }}class="emoji alone"]]
[[include component:discord-chat-source |inc-msg-end= --] ]]

[[include component:discord-chat-source |inc-new-msgs= --] ]]

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=one
|username=GOTO 20
|msg-time=今日 4:29 PM
]]
这有张图
[[image https://scp-wiki.wdfiles.com/local--files/component:discord-chat/noodle.jpg link="http://scp-wiki-cn.wdfiles.com/scp-4378" class="msgimage"]]
[[include component:discord-chat-source |inc-msg-end= --] ]]

[[include component:discord-chat-source |inc-attch= --]
|attch-id=attch-one
|user-id=one
|username=GOTO 20
|msg-time=今日 4:30 PM
|attchname=mv_sk1r.tar.gz
|attchsize=2.71 KB
{{|attchlink=@@http://scp-wiki-cn.wdfiles.com/scp-2105@@}}
]]

[[include component:discord-chat-source |inc-attch= --]
|attch-id=attch-two
|user-id=two
|username=corvas
|msg-time=今日 5:20 PM
|attchname=butts.zip
|attchsize=512 MB
{{|attchlink=@@http://scp-wiki-cn.wdfiles.com/scp-4205@@}}
]]

[[include component:discord-chat-source |inc-end= --] ]]

使用方法

该样版是相当复杂的,所以请完整地阅读下面引导。

步骤 1:引用源代码

该步骤只需执行一次
加这个引用到你代码的顶部:

[[include component:discord-chat-source |inc-source= --]]]


步骤 2:添加用户

该步骤只需执行一次
你如果想要添加特定用户,到discord版块里,请添加以下引用块:

[[include component:discord-chat-source |inc-user= --]
|user-id=
|username=
|usericon=
|usercolor=
]]


每个特定用户都需要其专属的用户板

开始引用用户板 ↦

用户唯一指定ID  (请使用符号、数字、空格)

用户名 (可以重复)

用户头像地址 ↦

用户名的颜色 (支持 hex, rgb, rgba, hsl)

结束引用用户板 ↦


  [[include component:discord-chat-source |inc-user= --]

|user-id=one

|username=GOTO 20

|usericon=GOTO20.png

|usercolor=#ff5e56

]]
  


步骤 3:开始弄discord版块

添加下面的代码,到你想要开始模拟在discord盖楼的地方:

[[include component:discord-chat-source |inc-start= --] ]]


第四步:添加消息和/或附件

一旦所有用户被引用,那就可以添加消息和附件了。
消息和附件不能共存在同一版块,它们永远是分开的(ie.显示帖子的用户名和头像。)//

步骤 4.1:添加消息

添加以下引用块到每个用户的消息中:

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=
|username=
|msg-time=
]]
内容在此
[[include component:discord-chat-source |inc-msg-end= --] ]]


开始引用消息板 ↦

  专属用户唯一ID (和之前设置的一样)

  与专属ID相关联的用户名 ↦

发消息的时间 ↦
  
  结束对消息板起始的引用  ↦
  
  内容在此
  允许使用所有的维基语法 ↦
   
  结束消息板整个的引用 ↦


[[include :scp-wiki:component:discord-chat-source |inc-msg-start= --]

|user-id=one

|username=GOTO 20

|msg-time=今日 4:28 PM
  
]]


咋啦

[[include :scp-wiki:component:discord-chat-source |inc-msg-end= --] ]]

步骤 4.2: 添加附件

添加以下引用块到每个附件之中:

[[include component:discord-chat-source |inc-attch= --]
|attch-id=
|user-id=
|username=
|msg-time=
|attchname=
|attchsize=
|attchlink=
]]


开始引用附件板 ↦

  附件唯一指定ID  (请使用符号、数字、空格)

发送附件的特定用户的ID  (和先前设置的一样)

与特定用户ID相关的用户名 ↦

发送时间 ↦

显示附件名称 ↦

显示附件大小 ↦

点击时所链接的附件地址 (没有链接时则留空)

结束信息板的引用 ↦


[[include :scp-wiki:component:discord-chat-source |inc-attch= --]

|attch-id=attch-one

|user-id=one

|username=GOTO 20

|msg-time=05/14/2019

|attchname=mv_sk1r.tar.gz

|attchsize=2.71\a0KB

{{|attchlink=https://scp-wiki-cn.wdfiles.com/scp-2105}}

]]


步骤 5:结束discord版块

添加以下代码,到你想要结束模拟在Discord盖楼的地方:

[[include component:discord-chat-source |inc-end= --] ]]



可以重复步骤3-5,让同一用户聊天时盖多个Discord楼


可选项目

我会添加更多可选项目,如果有人请求和/或我想到的话

添加图片

这里是个在消息内,添加图片的示例“”

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=one
|username=GOTO 20
|msg-time=昨天 1:28 AM
]]
这里是图片
[[image noodle.jpg link="http://scp-wiki-cn.wdfiles.com" class="msgimage"]]
[[include component:discord-chat-source |inc-msg-end= --] ]]

  • class="msgimage" 必须被添加到图像中,才能使其正常工作。
  • link="url"也可以添加这个,使图片内含链接,以在点击时跳转到其他地方

添加表情符号

这里有两个消息内含有表情符号的例子:

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=one
|username=GOTO 20
|msg-time=上个月 9:15 PM
]]
哟,Corvus,在吗?[[image smug.svg class="emoji inline"]]
[[include component:discord-chat-source |inc-msg-end= --] ]]

[[include component:discord-chat-source |inc-msg-start= --]
|user-id=two
|username=Corvas
]]

咋啦
[[image smug.svg class="emoji alone"]]
[[include component:discord-chat-source |inc-msg-end= --] ]]


就如你看到的一样,这里有两种表情符号:
  • 并排的表情符号 — 由 class="emoji inline" 生成
  • 独列的表情符号 — 由 class="emoji alone" 生成
这些不是自动生成的,因此在你想要使用表情符号时,必须添加这些class类到图片代码中。

添加新消息分割线

将以下代码,添加到你希望新消息分割线出现的位置

[[include component:discord-chat-source |inc-new-msgs= --] ]]

添加 @提及 样式

为了作个 @提及 样式,只需要将 @(用户名) 包裹在下面代码之中:

[[span class="at_mention"]]@用户名[[/span]].


如果你有任何问题或想法,请自便,在维基上发信息给我 (WoedenazWoedenaz) ,或者在Discord上联系我 (Woedenaz#1111).

页面版本:⁨0⁩, 最后编辑于: ⁨2019/5/22 15:25:55⁩ (⁨⁨2674⁩ 日前⁩), 现时评分: 7