mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
utility: add --bot/-bot to !search to search for bot members
This commit is contained in:
parent
17f34ffeb7
commit
53e7c2f17d
1 changed files with 16 additions and 2 deletions
|
@ -92,6 +92,7 @@ type MemberSearchParams = {
|
||||||
query?: string;
|
query?: string;
|
||||||
role?: string;
|
role?: string;
|
||||||
voice?: boolean;
|
voice?: boolean;
|
||||||
|
bot?: boolean;
|
||||||
sort?: string;
|
sort?: string;
|
||||||
"case-sensitive"?: boolean;
|
"case-sensitive"?: boolean;
|
||||||
};
|
};
|
||||||
|
@ -326,6 +327,10 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
matchingMembers = matchingMembers.filter(m => m.voiceState.channelID != null);
|
matchingMembers = matchingMembers.filter(m => m.voiceState.channelID != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.bot) {
|
||||||
|
matchingMembers = matchingMembers.filter(m => m.bot);
|
||||||
|
}
|
||||||
|
|
||||||
if (args.query) {
|
if (args.query) {
|
||||||
const query = args["case-sensitive"] ? args.query.trimStart() : args.query.toLowerCase().trimStart();
|
const query = args["case-sensitive"] ? args.query.trimStart() : args.query.toLowerCase().trimStart();
|
||||||
|
|
||||||
|
@ -380,15 +385,23 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "page",
|
name: "page",
|
||||||
|
shortcut: "p",
|
||||||
type: "number",
|
type: "number",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "role",
|
name: "role",
|
||||||
|
shortcut: "r",
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "voice",
|
name: "voice",
|
||||||
type: "bool",
|
shortcut: "v",
|
||||||
|
isSwitch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "bot",
|
||||||
|
shortcut: "b",
|
||||||
|
isSwitch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "sort",
|
name: "sort",
|
||||||
|
@ -426,9 +439,10 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
msg: Message,
|
msg: Message,
|
||||||
args: {
|
args: {
|
||||||
query?: string;
|
query?: string;
|
||||||
role?: string;
|
|
||||||
page?: number;
|
page?: number;
|
||||||
|
role?: string;
|
||||||
voice?: boolean;
|
voice?: boolean;
|
||||||
|
bot?: boolean;
|
||||||
sort?: string;
|
sort?: string;
|
||||||
"case-sensitive"?: boolean;
|
"case-sensitive"?: boolean;
|
||||||
export?: boolean;
|
export?: boolean;
|
||||||
|
|
Loading…
Add table
Reference in a new issue