mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 08:24:16 +02:00
feat(arabot): add check if in staff category
This commit is contained in:
parent
c42d612ed4
commit
d90b89d4ac
39
src/utils/checker.ts
Normal file
39
src/utils/checker.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
/*
|
||||||
|
Animal Rights Advocates Discord Bot
|
||||||
|
Copyright (C) 2022 Anthony Berg
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { TextChannel } from 'discord.js';
|
||||||
|
import IDs from './ids';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the channel is in the staff category.
|
||||||
|
* @param channel channel to check if parent is staff
|
||||||
|
* @returns {boolean} true if is in staff channel
|
||||||
|
*/
|
||||||
|
|
||||||
|
// eslint-disable-next-line import/prefer-default-export
|
||||||
|
export function checkStaff(channel: TextChannel) {
|
||||||
|
if (channel.parent === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channel.parent.id === IDs.categories.staff) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
@ -97,6 +97,7 @@ const devIDs = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
categories: {
|
categories: {
|
||||||
|
staff: '999431676058927253',
|
||||||
verification: '999431677006860409',
|
verification: '999431677006860409',
|
||||||
diversity: '999431679053660185',
|
diversity: '999431679053660185',
|
||||||
},
|
},
|
||||||
|
@ -100,6 +100,7 @@ let IDs = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
categories: {
|
categories: {
|
||||||
|
staff: '768685283583328257',
|
||||||
verification: '797505409073676299',
|
verification: '797505409073676299',
|
||||||
diversity: '933078380394459146',
|
diversity: '933078380394459146',
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user