Comparing version 0.5.3 to 0.5.4
@@ -0,1 +1,6 @@ | ||
# v0.5.4 (2022-10-01) | ||
- The timestamp/archiver ID should now always be correct. | ||
- Fix build/typing issues. | ||
# v0.5.3 (2022-05-31) | ||
@@ -2,0 +7,0 @@ |
import { Message } from "revolt.js"; | ||
declare function archiveChannel(msg: Message, ignoredMsgs?: Message[]): Promise<{ | ||
export declare function archiveChannel(msg: Message, ignoredMsgs?: Message[]): Promise<{ | ||
server_id: string; | ||
@@ -11,2 +11,1 @@ server_name: string; | ||
} | "nothingToArchive">; | ||
export { archiveChannel }; |
@@ -1,2 +0,2 @@ | ||
async function archiveChannel(msg, ignoredMsgs) { | ||
export async function archiveChannel(msg, ignoredMsgs) { | ||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); | ||
@@ -13,2 +13,4 @@ const autumnURL = msg.client.configuration?.features.autumn.url; | ||
}; | ||
// check if the script is being run by rexbot | ||
const isRexBot = msg.client.user?._id === "01FEEXZT74QWW1HSQH8B8BH1S1"; | ||
// gather info | ||
@@ -20,4 +22,4 @@ const isServer = msg.channel?.server; | ||
archiveData.channel_name = msg.channel?.name; | ||
archiveData.archiver = msg.author_id; | ||
archiveData.archived_at = msg.createdAt; | ||
archiveData.archiver = isRexBot ? msg.author?._id : msg.client.user?._id; // if the script is being run by rexbot, use the id of the author of the message; else, use the client's id | ||
archiveData.archived_at = new Date().getTime(); | ||
// fetch/push messages | ||
@@ -75,2 +77,1 @@ function pushMsg(m) { | ||
} | ||
export { archiveChannel }; |
export { archiveChannel } from "./archiveChannel"; |
export { archiveChannel } from "./archiveChannel"; |
{ | ||
"name": "revchiver", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Archiving library for Revolt.", | ||
@@ -30,5 +30,2 @@ "main": "dist/src/index.js", | ||
"homepage": "https://github.com/rexovolt/revchiver#readme", | ||
"dependencies": { | ||
"revolt.js": "^6.0.0" | ||
}, | ||
"engines": { | ||
@@ -47,3 +44,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16" | ||
"rimraf": "^3.0.2" | ||
}, | ||
"dependencies": { | ||
"revolt.js": "6.0.0" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # Revchiver |
import { Member, Message } from "revolt.js"; | ||
async function archiveChannel(msg: Message, ignoredMsgs?: Message[]) { | ||
export async function archiveChannel(msg: Message, ignoredMsgs?: Message[]) { | ||
const sleep = (ms: number | undefined) => | ||
@@ -19,2 +19,5 @@ new Promise((r) => setTimeout(r, ms)); | ||
// check if the script is being run by rexbot | ||
const isRexBot = msg.client.user?._id! === "01FEEXZT74QWW1HSQH8B8BH1S1"; | ||
// gather info | ||
@@ -26,4 +29,4 @@ const isServer = msg.channel?.server; | ||
archiveData.channel_name = msg.channel?.name!; | ||
archiveData.archiver = msg.author_id; | ||
archiveData.archived_at = msg.createdAt; | ||
archiveData.archiver = isRexBot ? msg.author?._id! : msg.client.user?._id!; // if the script is being run by rexbot, use the id of the author of the message; else, use the client's id | ||
archiveData.archived_at = new Date().getTime(); | ||
@@ -89,3 +92,1 @@ // fetch/push messages | ||
} | ||
export { archiveChannel }; |
Sorry, the diff of this file is not supported yet
9916
164
+ Added@insertish/oapi@0.1.15(transitive)
+ Addedrevolt-api@0.5.3(transitive)
+ Addedrevolt.js@6.0.0(transitive)
- Removed@insertish/oapi@0.1.18(transitive)
- Removedrevolt-api@0.5.7(transitive)
- Removedrevolt.js@6.0.20(transitive)
Updatedrevolt.js@6.0.0