mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-20 04:53:06 -06:00
- Fixed some nodes not matching how their docs describe how they function (such as node configuration should always take precedence over inputs)
73 lines
2.4 KiB
HTML
73 lines
2.4 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('matrix-room-ban',{
|
|
category: 'matrix',
|
|
color: '#00b7ca',
|
|
icon: "matrix.png",
|
|
outputLabels: ["success", "error"],
|
|
inputs:1,
|
|
outputs:2,
|
|
defaults: {
|
|
name: { value: null },
|
|
server: { value: "", type: "matrix-server-config" },
|
|
roomId: { value: null }
|
|
},
|
|
label: function() {
|
|
return this.name || "Room Ban";
|
|
},
|
|
paletteLabel: 'Room Ban'
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="matrix-room-ban">
|
|
<div class="form-row">
|
|
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-server"><i class="fa fa-user"></i> Matrix Server Config</label>
|
|
<input type="text" id="node-input-server">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-roomId"><i class="fa fa-user"></i> Room ID</label>
|
|
<input type="text" id="node-input-roomId" placeholder="msg.topic">
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="matrix-room-ban">
|
|
<h3>Details</h3>
|
|
<p>This node will ban a user from a room as long as the bot has permission to do so.</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>msg.userId
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> The ID of the user to ban.</dd>
|
|
|
|
<dt class="optional">msg.topic
|
|
<span class="property-type">string | null</span>
|
|
</dt>
|
|
<dd> The room to ban the user from. Ignored if configured on the node, otherwise required.</dd>
|
|
|
|
<dt class="optional">msg.reason
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> Reason for banning the user.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Success
|
|
<dl class="message-properties">
|
|
<dt>msg.eventId <span class="property-type">string</span></dt>
|
|
<dd>the eventId from the ban event.</dd>
|
|
</dl>
|
|
</li>
|
|
<li>Error
|
|
<dl class="message-properties">
|
|
<dt>msg.error <span class="property-type">string</span></dt>
|
|
<dd>the error that occurred.</dd>
|
|
</dl>
|
|
</li>
|
|
</ol>
|
|
</script> |