import { Baileys } from "@frierendv/frieren";
const client = new Baileys.WASocket({
prefix: ["/", "!"],
})
// middleware
client.use(async (ctx, next) => {
if (ctx.country !== "ID") {
return;
} else {
await next();
}
});
// register command
client.command("start", async (ctx) => {
await ctx.reply("Hello World!");
});
client.command({
ignorePrefix: true,
command: "help",
}, async (ctx) => {
await ctx.reply("This is help command!");
});
// listen all message except command
client.on("message", async (ctx) => {
await ctx.sock.sendMessage(ctx.from, { text: "Hello World!" }, { quoted: ctx.message });
});
client.on("media", (media) => {
console.log(media);
});
client.launch();
-
Notifications
You must be signed in to change notification settings - Fork 0
Todo
License
frierendv/frieren
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Todo