Initial upload of discord-contrib-advanced repo
This commit is contained in:
74
discord/discordPermissions.html
Normal file
74
discord/discordPermissions.html
Normal file
@@ -0,0 +1,74 @@
|
||||
a<script type="text/javascript">
|
||||
RED.nodes.registerType('discordPermissions', {
|
||||
category: 'discord',
|
||||
color: '#7289da',
|
||||
defaults: {
|
||||
name: {
|
||||
value: "",
|
||||
required: false
|
||||
},
|
||||
token: {
|
||||
value: "",
|
||||
required: true,
|
||||
type: "discord-token"
|
||||
}
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
icon: "discord.png",
|
||||
label: function () {
|
||||
return this.name || "discordPermissions";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/x-red" data-template-name="discordPermissions">
|
||||
<div class="form-row">
|
||||
<label for="node-input-token"><i class="icon-tag"></i> token</label>
|
||||
<input type="text" id="node-input-token" placeholder="token">
|
||||
</div>
|
||||
<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>
|
||||
</script>
|
||||
<script type="text/x-red" data-help-name="discordPermissions">
|
||||
<p>Node to check user permissions in Discord.</p>
|
||||
<p>More support can be found <a href="https://github.com/Markoudstaal/node-red-contrib-discord-advanced/wiki#support">here</a>.</p>
|
||||
|
||||
<h3>Inputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>action
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The action to do, can be: get, set, remove. If not set, node will default to get.</dd>
|
||||
<dt>user
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The user ID whose roles you want to check.</dd>
|
||||
<dt>role
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The role ID if you set <code>msg.action</code> to set or remove.</dd>
|
||||
<dt>guild
|
||||
<span class="property-type">string</span>
|
||||
<dd>The Guild ID the user is in and where you want to check the roles.</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Outputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>payload
|
||||
<span class="property-type">Array</span>
|
||||
</dt>
|
||||
<dd>The payload contains an array with all roles the user has in the specified guild.</dd>
|
||||
<dt>user
|
||||
<span class="property-type">Object</span>
|
||||
</dt>
|
||||
<dd>The full user Object of the user that was specified.</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Details</h3>
|
||||
<p>This node is able to output all roles a user has in a specific guild. Additionally it can add (set) and remove singular roles from a user in a specific guild.<p>
|
||||
<p>To get the roles a user has in a guild send <code>msg.user</code> and <code>msg.guild</code> and it will return the roles the user has.</p>
|
||||
<p>To remove a role send <code>msg.user</code>, <code>msg.guild</code>, <code>msg.action = "remove"</code> and <code>msg.role</code>. It will remove the role the user has.</p>
|
||||
<p>To add a role send <code>msg.user</code>, <code>msg.guild</code>, <code>msg.action = "set"</code> and <code>msg.role</code>. It add the role to the user.</p>
|
||||
</script>
|
||||
Reference in New Issue
Block a user