diff --git a/middlewares/index.js b/middlewares/index.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/middlewares/permission.js b/middlewares/isAdmin.js similarity index 88% rename from middlewares/permission.js rename to middlewares/isAdmin.js index 36f1d4b52d2..fefa5acbba8 100644 --- a/middlewares/permission.js +++ b/middlewares/isAdmin.js @@ -1,6 +1,4 @@ -const pm = {}; - -pm.isAdmin = async (ctx, next) => { +module.exports = async (ctx, next) => { ctx.state.chat = await ctx.getChat(); const chat = ctx.state.chat; if (chat.type !== 'private') { @@ -19,4 +17,3 @@ pm.isAdmin = async (ctx, next) => { await next(); }; -module.exports = pm;