-
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.
Added BMD project files + ping command
- Loading branch information
Showing
259 changed files
with
19,480 additions
and
0 deletions.
There are no files selected for viewing
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,32 @@ | ||
module.exports = { | ||
category: "Actions", | ||
data: { | ||
name: "Action Container", | ||
}, | ||
UI: [ | ||
{ | ||
element: "actions", | ||
name: "Actions", | ||
storeAs: "actions", | ||
large: true | ||
}, | ||
"-", | ||
{ | ||
element: "input", | ||
storeAs: "name", | ||
name: "Name" | ||
}, | ||
], | ||
subtitle: (data, constants) => { | ||
return `${data.name || ""}` | ||
}, | ||
compatibility: ["Any"], | ||
async run(values, message, client, bridge) { | ||
let promise = new Promise(async res => { | ||
await bridge.runner(values.actions); | ||
res() | ||
}); | ||
promise.catch(err => err) | ||
await promise | ||
}, | ||
}; |
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,32 @@ | ||
module.exports = { | ||
category: "Threads", | ||
data: { | ||
name: "Add Member To Thread", | ||
}, | ||
UI: [ | ||
{ | ||
element: "memberInput", | ||
storeAs: "member", | ||
name: "Member" | ||
}, | ||
"-", | ||
{ | ||
element: "channel", | ||
excludeUsers: true, | ||
storeAs: "thread", | ||
name: "Thread" | ||
} | ||
], | ||
|
||
compatibility: ["Any"], | ||
subtitle: (values, constants) => { | ||
return `Add ${constants.user(values.member)} to ${constants.channel(values.thread)}` | ||
}, | ||
|
||
async run(values, message, client, bridge) { | ||
let thread = await bridge.get(values.thread); | ||
let user = await bridge.getUser(values.member) | ||
|
||
thread.addMember(user.id) | ||
}, | ||
}; |
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,42 @@ | ||
module.exports = { | ||
category: "Reactions", | ||
data: { name: "Add Reaction" }, | ||
UI: [ | ||
{ | ||
element: "message", | ||
storeAs: "message", | ||
name: "Message" | ||
}, | ||
"-", | ||
{ | ||
element: "inputGroup", | ||
nameSchemes: ["Emoji Name", "Emoji ID"], | ||
storeAs: ["emojiName", "emojiID"], | ||
placeholder: ["Can Also Be An Emoji", "Optional"] | ||
} | ||
], | ||
|
||
|
||
compatibility: ["Any"], | ||
|
||
subtitle: (data, constants) => { | ||
let message = 'Command Message' | ||
if (data.message.type != 'commandMessage') { | ||
message = constants.variable(data.message) | ||
} | ||
return `Add To: ${message} - Emoji: ${data.emojiName}` | ||
}, | ||
|
||
async run(values, msg, client, bridge) { | ||
let message = await bridge.getMessage(values.message); | ||
|
||
let emojiID = ':' + bridge.transf(values.emojiID).trim(); | ||
let emojiName = bridge.transf(values.emojiName).trim(); | ||
|
||
if (emojiID == ':') { | ||
emojiID = '' | ||
} | ||
|
||
await message.createReaction(`${emojiName}${emojiID}`); | ||
}, | ||
}; |
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,40 @@ | ||
module.exports = { | ||
category: "Roles", | ||
data: { | ||
name: "Add Role", | ||
}, | ||
UI: [ | ||
{ | ||
element: "memberInput", | ||
storeAs: "member", | ||
name: "Add To Member" | ||
}, | ||
"-", | ||
{ | ||
element: "role", | ||
storeAs: "role", | ||
name: "Role", | ||
}, | ||
"-", | ||
{ | ||
element: "input", | ||
max: "256", | ||
placeholder: "Optional", | ||
name: "Reason", | ||
storeAs: "reason" | ||
} | ||
], | ||
|
||
compatibility: ["Any"], | ||
subtitle: (values, constants) => { | ||
return `Add ${constants.role(values.role)} to ${constants.user(values.member)}` | ||
}, | ||
|
||
async run(values, message, client, bridge) { | ||
let role = await bridge.getRole(values.role); | ||
|
||
let user = await bridge.getUser(values.member); | ||
user = await user.member; | ||
user.addRole(role.id, bridge.transf(values.reason)); | ||
}, | ||
}; |
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,114 @@ | ||
module.exports = { | ||
category: "Messages", | ||
data: { | ||
name: "Await Message", | ||
stopAwaitingAfter: 60 | ||
}, | ||
|
||
UI: [ | ||
{ | ||
element: "input", | ||
storeAs: "stopAwaitingAfter", | ||
name: "Stop Awaiting After (Seconds)", | ||
placeholder: "Min: 1", | ||
}, | ||
"_", | ||
{ | ||
element: "toggle", | ||
storeAs: "oneTime", | ||
name: "One-Time Only" | ||
}, | ||
"-", | ||
{ | ||
element: "channelInput", | ||
storeAs: "channel", | ||
name: "Await In Channel" | ||
}, | ||
"_", | ||
{ | ||
element: "userInput", | ||
storeAs: "user", | ||
name: "From User", | ||
also: { | ||
any: "Any" | ||
}, | ||
and: { | ||
any: false | ||
} | ||
}, | ||
"-", | ||
{ | ||
element: "storageInput", | ||
storeAs: "messageStorage", | ||
name: "Store Message As" | ||
}, | ||
"_", | ||
{ | ||
element: "storageInput", | ||
storeAs: "authorStorage", | ||
name: "Store Message Author As" | ||
}, | ||
"-", | ||
{ | ||
name: "Once Sent, Run", | ||
element: "actions", | ||
storeAs: "actions" | ||
} | ||
], | ||
|
||
compatibility: ["Any"], | ||
|
||
subtitle: (values, constants) => { | ||
return `In Channel: ${constants.channel(values.channel)} - Stop Awaiting After: ${values.stopAwaitingAfter}s` | ||
}, | ||
|
||
|
||
async run(values, message, client, bridge) { | ||
let wasEverRan = false; | ||
let actionRunner = bridge.runner; | ||
|
||
let channel = await bridge.getChannel(values.channel) | ||
|
||
const handleMessage = async (msg) => { | ||
let matchesTarget = false; | ||
let matchesChannel = channel.id == msg.channel.id; | ||
|
||
if (values.user.type == 'any') { | ||
matchesTarget = true | ||
} else { | ||
let user = await bridge.getUser(values.user); | ||
matchesTarget = user.id == msg.author.id | ||
} | ||
|
||
if (matchesTarget && matchesChannel && !wasEverRan) { | ||
if (values.oneTime) { | ||
wasEverRan = true; | ||
} | ||
msg.author.member = msg.member | ||
bridge.store(values.authorStorage, msg.author) | ||
bridge.store(values.messageStorage, msg) | ||
|
||
actionRunner( | ||
values.actions, | ||
message, | ||
client, | ||
bridge.variables | ||
); | ||
} | ||
}; | ||
|
||
client.on( | ||
"messageCreate", | ||
handleMessage, | ||
); | ||
|
||
if (values.stopAwaitingAfter != "") { | ||
setTimeout( | ||
() => { | ||
client.off("messageCreate", handleMessage); | ||
}, | ||
parseFloat(values.stopAwaitingAfter) * 1000, | ||
); | ||
} | ||
}, | ||
}; |
Oops, something went wrong.