mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-11 13:07:20 +00:00
Migrate LocateUser to new Plugin structure
This commit is contained in:
parent
ef1b993d58
commit
7b191093b3
16 changed files with 380 additions and 0 deletions
11
backend/src/plugins/LocateUser/utils/createOrReuseInvite.ts
Normal file
11
backend/src/plugins/LocateUser/utils/createOrReuseInvite.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { VoiceChannel } from "eris";
|
||||
|
||||
export async function createOrReuseInvite(vc: VoiceChannel) {
|
||||
const existingInvites = await vc.getInvites();
|
||||
|
||||
if (existingInvites.length !== 0) {
|
||||
return existingInvites[0];
|
||||
} else {
|
||||
return vc.createInvite(undefined);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue