This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9828d9
commit edae9b2
Showing
18 changed files
with
546 additions
and
142 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module.exports = { | ||
data: { | ||
name: "Delete Channel", | ||
channel: "", | ||
channelFrom: "Command channel", | ||
threadName: "", | ||
autoArchive: "", | ||
storeAs: "", | ||
}, | ||
UI: { | ||
compatibleWith: ["Text", "Slash"], | ||
text: "Delete Channel", | ||
sepbar:"", | ||
|
||
btext: "Get Channel Via", | ||
menuBar: {choices: ["Command Channel", "Variable*", "ID*"], storeAs: "channelFrom", extraField: "channel"}, | ||
|
||
variableSettings: { | ||
channel: { | ||
"Variable*": "direct" | ||
} | ||
} | ||
}, | ||
subtitle: "Get Channel Via: $[channelFrom]$", | ||
async run(values, message, client, bridge) { | ||
let transferVariables = require(`../Toolkit/variableTools.js`).transf; | ||
|
||
const transf = (value) => { | ||
return transferVariables(value, bridge.variables); | ||
}; | ||
|
||
let channel; | ||
|
||
if (values.channelFrom == 'Command Channel') { | ||
channel = message.channel; | ||
} | ||
if (values.channelFrom == 'Variable*') { | ||
let chan = bridge.variables[transf(values.channel)] | ||
channel = chan.channel || client.getChannel(chan.id) | ||
} | ||
if (values.channelFrom == 'ID*') { | ||
channel = client.getChannel(transf(values.channel)) | ||
} | ||
|
||
channel.delete() | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module.exports = { | ||
data: { | ||
name: "Delete Channel", | ||
channel: "", | ||
channelFrom: "Variable*", | ||
threadName: "", | ||
autoArchive: "", | ||
storeAs: "", | ||
}, | ||
UI: { | ||
compatibleWith: ["Text", "Slash"], | ||
text: "Delete Channel", | ||
sepbar:"", | ||
|
||
btext: "Get Channel Via", | ||
menuBar: {choices: ["Variable*", "ID*"], storeAs: "channelFrom", extraField: "channel"}, | ||
|
||
variableSettings: { | ||
channel: { | ||
"Variable*": "direct" | ||
} | ||
} | ||
}, | ||
subtitle: "Get Channel Via: $[channelFrom]$", | ||
async run(values, message, client, bridge) { | ||
let transferVariables = require(`../Toolkit/variableTools.js`).transf; | ||
|
||
const transf = (value) => { | ||
return transferVariables(value, bridge.variables); | ||
}; | ||
|
||
let channel; | ||
|
||
if (values.channelFrom == 'Variable*') { | ||
let chan = bridge.variables[transf(values.channel)] | ||
channel = chan.channel || client.getChannel(chan.id) | ||
} | ||
if (values.channelFrom == 'ID*') { | ||
channel = client.getChannel(transf(values.channel)) | ||
} | ||
|
||
channel.delete() | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
module.exports = { | ||
data: { | ||
name: "Start Thread", | ||
message: "", | ||
messageFrom: "Command Message", | ||
threadName: "", | ||
autoArchive: "", | ||
storeAs: "", | ||
}, | ||
UI: { | ||
compatibleWith: ["Text"], | ||
text: "Start Thread", | ||
sepbar:"", | ||
btext: "Get Thread Parent Message Via", | ||
menuBar: {choices: ["Command Message", "Variable*"], storeAs: "messageFrom", extraField: "message"}, | ||
|
||
sepbar0:"", | ||
|
||
btext0: "Thread Name", | ||
input: "threadName", | ||
|
||
sepbar1: "", | ||
|
||
btext1: "Thread Auto-Archive Duration", | ||
menuBar0: {choices: ["1 Hour", "24 Hours", "3 Days", "1 Week"], storeAs: "autoArchive"}, | ||
|
||
sepbar2:"", | ||
|
||
btext2: "Store Thread As", | ||
"input!":"storeAs", | ||
|
||
variableSettings: { | ||
message: { | ||
"Variable*": "direct" | ||
} | ||
} | ||
}, | ||
subtitle: "Message: $[messageFrom]$ - Archive After: $[autoArchive]$", | ||
async run(values, message, client, bridge) { | ||
let transferVariables = require(`../Toolkit/variableTools.js`).transf; | ||
|
||
const transf = (value) => { | ||
return transferVariables(value, bridge.variables); | ||
}; | ||
|
||
|
||
let threadName = transf(values.threadName) | ||
|
||
let autoArchive; | ||
|
||
switch(values.autoArchive) { | ||
case '1 Hour': | ||
autoArchive = 60; | ||
break | ||
case '24 Hours': | ||
autoArchive = 1440 | ||
break | ||
case '3 Days': | ||
autoArchive = 4320 | ||
break | ||
case '1 Week': | ||
autoArchive = 10080 | ||
break | ||
} | ||
|
||
let msg; | ||
|
||
if (values.messageFrom == 'Command Message') { | ||
msg = message | ||
} else { | ||
msg = bridge.variables[transf(values.message)] | ||
} | ||
let thread = await msg.startThread({ | ||
name: threadName, | ||
autoArchiveDuration: autoArchive | ||
}) | ||
bridge.variables[transf(values.storeAs)] = thread | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
module.exports = { | ||
data: { | ||
name: "Start Thread", | ||
message: "", | ||
threadName: "", | ||
autoArchive: "", | ||
storeAs: "", | ||
}, | ||
UI: { | ||
compatibleWith: ["Slash", "Event"], | ||
text: "Start Thread", | ||
sepbar:"", | ||
btext: "Parent Message Variable", | ||
"input_direct": "message", | ||
|
||
sepbar0:"", | ||
|
||
btext0: "Thread Name", | ||
input: "threadName", | ||
|
||
sepbar1: "", | ||
|
||
btext1: "Thread Auto-Archive Duration", | ||
menuBar0: {choices: ["1 Hour", "24 Hours", "3 Days", "1 Week"], storeAs: "autoArchive"}, | ||
|
||
sepbar2:"", | ||
|
||
btext2: "Store Thread As", | ||
"input!":"storeAs", | ||
|
||
variableSettings: { | ||
message: { | ||
"Variable*": "direct" | ||
} | ||
} | ||
}, | ||
subtitle: "Message: $[messageFrom]$ - Archive After: $[autoArchive]$", | ||
async run(values, message, client, bridge) { | ||
let transferVariables = require(`../Toolkit/variableTools.js`).transf; | ||
|
||
const transf = (value) => { | ||
return transferVariables(value, bridge.variables); | ||
}; | ||
|
||
|
||
let threadName = transf(values.threadName) | ||
|
||
let autoArchive; | ||
|
||
switch(values.autoArchive) { | ||
case '1 Hour': | ||
autoArchive = 60; | ||
break | ||
case '24 Hours': | ||
autoArchive = 1440 | ||
break | ||
case '3 Days': | ||
autoArchive = 4320 | ||
break | ||
case '1 Week': | ||
autoArchive = 10080 | ||
break | ||
} | ||
|
||
let msg = bridge.variables[transf(values.message)] | ||
|
||
let thread = await msg.startThread({ | ||
name: threadName, | ||
autoArchiveDuration: autoArchive | ||
}) | ||
bridge.variables[transf(values.storeAs)] = thread | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.