generated from Demon/demoncord-plugin-template
add code.
parent
22d0bc6d34
commit
72981d7156
@ -0,0 +1,20 @@
|
||||
{
|
||||
"0 debug pnpm:scope": {
|
||||
"selected": 1
|
||||
},
|
||||
"1 error pnpm": {
|
||||
"errno": 1,
|
||||
"code": "ELIFECYCLE",
|
||||
"pkgid": "demoncord-plugin-template@1.0.0",
|
||||
"stage": "build",
|
||||
"script": "rollup --config rollup.config.js",
|
||||
"pkgname": "demoncord-plugin-template",
|
||||
"err": {
|
||||
"name": "pnpm",
|
||||
"message": "demoncord-plugin-template@1.0.0 build: `rollup --config rollup.config.js`\nExit status 1",
|
||||
"code": "ELIFECYCLE",
|
||||
"stack": "pnpm: demoncord-plugin-template@1.0.0 build: `rollup --config rollup.config.js`\nExit status 1\n at EventEmitter.<anonymous> (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:103873:20)\n at EventEmitter.emit (node:events:527:28)\n at ChildProcess.<anonymous> (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:91802:18)\n at ChildProcess.emit (node:events:527:28)\n at maybeClose (node:internal/child_process:1090:16)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)"
|
||||
}
|
||||
},
|
||||
"2 warn pnpm:global": " Local package.json exists, but node_modules missing, did you mean to install?"
|
||||
}
|
@ -1 +1 @@
|
||||
(function(){"use strict";function l(o){o.hello="Hello, world!",o.command=demon.commands.add({name:"plugin",callback:n=>"Hello, world!"})}function e(o){console.log(o.hello.replace("Hello","Goodbye")),o.command()}var a={onStart:l,onStop:e,metadata:{name:"Example plugin",desc:"Example description",author:"Example author",cumcord:!1}};return a})();
|
||||
(function(){"use strict";function n(e){const o=demon.webpack.findByProps("createPendingReply");e.unpatch=demon.patcher.before("createPendingReply",o,r=>{r[0].shouldMention=!1})}function t(e){e.unpatch()}var a={onStart:n,onStop:t,metadata:{name:"noReplyMention",desc:"Disable reply pings by default. (Cumcord port)",author:"Drake",cumcord:!1}};return a})();
|
||||
|
@ -1,18 +1,19 @@
|
||||
function onStart(ctx) {
|
||||
ctx["hello"] = "Hello, world!" //ctx is an empty object used for passing data between onStart and onStop
|
||||
ctx["command"] = demon.commands.add({name: "plugin", callback: (args)=>"Hello, world!"})
|
||||
const createPendingReply = demon.webpack.findByProps("createPendingReply")
|
||||
ctx["unpatch"] = demon.patcher.before("createPendingReply", createPendingReply, (args) => {
|
||||
args[0].shouldMention = false
|
||||
})
|
||||
}
|
||||
function onStop(ctx) {
|
||||
console.log(ctx["hello"].replace("Hello", "Goodbye"))
|
||||
ctx["command"]()
|
||||
ctx["unpatch"]()
|
||||
}
|
||||
export default {
|
||||
onStart,
|
||||
onStop,
|
||||
metadata: {
|
||||
name: "Example plugin",
|
||||
desc: "Example description",
|
||||
author: "Example author",
|
||||
name: "noReplyMention",
|
||||
desc: "Disable reply pings by default. (Cumcord port)",
|
||||
author: "Drake",
|
||||
cumcord: false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue