Fix backfill script
This commit is contained in:
@@ -3,6 +3,7 @@ config.js
|
||||
registration.yaml
|
||||
ooye.db*
|
||||
events.db*
|
||||
backfill.db*
|
||||
|
||||
# Automatically generated
|
||||
node_modules
|
||||
|
||||
+4
-1
@@ -29,6 +29,9 @@ const DiscordClient = require("../src/d2m/discord-client")
|
||||
const discord = new DiscordClient(reg.ooye.discord_token, "half")
|
||||
passthrough.discord = discord
|
||||
|
||||
const {as} = require("../src/matrix/appservice")
|
||||
passthrough.as = as
|
||||
|
||||
const orm = sync.require("../src/db/orm")
|
||||
passthrough.from = orm.from
|
||||
passthrough.select = orm.select
|
||||
@@ -69,7 +72,7 @@ async function event(event) {
|
||||
backfill: true,
|
||||
...message
|
||||
}
|
||||
await eventDispatcher.onMessageCreate(discord, simulatedGatewayDispatchData)
|
||||
await eventDispatcher.MESSAGE_CREATE(discord, simulatedGatewayDispatchData)
|
||||
preparedInsert.run(channelID, message.id)
|
||||
}
|
||||
last = messages.at(-1)?.id
|
||||
|
||||
@@ -47,6 +47,7 @@ const utils = {
|
||||
|
||||
if (listen === "full") {
|
||||
try {
|
||||
interactions.registerInteractions()
|
||||
await eventDispatcher.checkMissedExpressions(message.d)
|
||||
await eventDispatcher.checkMissedPins(client, message.d)
|
||||
await eventDispatcher.checkMissedMessages(client, message.d)
|
||||
|
||||
@@ -15,6 +15,7 @@ const ping = sync.require("./interactions/ping.js")
|
||||
|
||||
// User must have EVERY permission in default_member_permissions to be able to use the command
|
||||
|
||||
function registerInteractions() {
|
||||
discord.snow.interaction.bulkOverwriteApplicationCommands(id, [{
|
||||
name: "Matrix info",
|
||||
contexts: [DiscordTypes.InteractionContextType.Guild],
|
||||
@@ -84,6 +85,7 @@ discord.snow.interaction.bulkOverwriteApplicationCommands(id, [{
|
||||
}]).catch(e => {
|
||||
console.error(e)
|
||||
})
|
||||
}
|
||||
|
||||
/** @param {DiscordTypes.APIInteraction} interaction */
|
||||
async function dispatchInteraction(interaction) {
|
||||
@@ -147,3 +149,4 @@ async function dispatchInteraction(interaction) {
|
||||
}
|
||||
|
||||
module.exports.dispatchInteraction = dispatchInteraction
|
||||
module.exports.registerInteractions = registerInteractions
|
||||
|
||||
Reference in New Issue
Block a user