forked from cadence/out-of-your-element
start adding command handlers
This commit is contained in:
parent
40c3ef8e83
commit
c56e92ccfb
3 changed files with 89 additions and 1 deletions
|
@ -18,6 +18,8 @@ const createRoom = sync.require("./actions/create-room")
|
|||
const createSpace = sync.require("./actions/create-space")
|
||||
/** @type {import("../matrix/api")}) */
|
||||
const api = sync.require("../matrix/api")
|
||||
/** @type {import("./discord-command-handler")}) */
|
||||
const discordCommandHandler = sync.require("./discord-command-handler")
|
||||
|
||||
let lastReportedEvent = 0
|
||||
|
||||
|
@ -156,7 +158,11 @@ module.exports = {
|
|||
if (!channel.guild_id) return // Nothing we can do in direct messages.
|
||||
const guild = client.guilds.get(channel.guild_id)
|
||||
if (!isGuildAllowed(guild.id)) return
|
||||
await sendMessage.sendMessage(message, guild)
|
||||
|
||||
await Promise.all([
|
||||
sendMessage.sendMessage(message, guild),
|
||||
discordCommandHandler.execute(message, channel, guild)
|
||||
])
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue