generated from nhcarrigan/template
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import type { User, APIMessageTopLevelComponent } from "discord.js";
|
||||
|
||||
/**
|
||||
* Generates the components to forward a message to Naomi.
|
||||
* @param author -- The user object that created the message.
|
||||
* @param content -- The text content of the message.
|
||||
* @param url -- The link to the message.
|
||||
* @returns An array of message component objects.
|
||||
*/
|
||||
export const getComponentsForNaomi
|
||||
= (
|
||||
author: User,
|
||||
content: string,
|
||||
url: string,
|
||||
): Array<APIMessageTopLevelComponent> => {
|
||||
return [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
accessory: {
|
||||
description: null,
|
||||
media: {
|
||||
url: author.displayAvatarURL(),
|
||||
},
|
||||
spoiler: false,
|
||||
type: 11,
|
||||
},
|
||||
components: [
|
||||
{
|
||||
content: `# Message from ${author.displayName}!`,
|
||||
type: 10,
|
||||
},
|
||||
{
|
||||
content: content,
|
||||
type: 10,
|
||||
},
|
||||
],
|
||||
type: 9,
|
||||
},
|
||||
],
|
||||
spoiler: false,
|
||||
type: 17,
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
disabled: false,
|
||||
label: "View Message",
|
||||
style: 5,
|
||||
type: 2,
|
||||
url: url,
|
||||
},
|
||||
],
|
||||
type: 1,
|
||||
},
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { Logger } from "@nhcarrigan/logger";
|
||||
|
||||
export const logger = new Logger(
|
||||
"Amari",
|
||||
process.env.LOG_TOKEN ?? "",
|
||||
);
|
||||
Reference in New Issue
Block a user