blob: eed58db21dae2c4f91d9c7d0907ab6761b684ef0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import Maelink from "./main.ts";
import { username, password } from "./creds.json" with {type: "json"};
const ml = new Maelink()
console.log(
await ml.login(username, password)
)
interface Post {
_id: string,
p: string,
u: string,
e: string,
reply_to: null | string,
post_id: string
}
// ml.ws.onmessage = e => console.log(e)
ml.on('post', ({p: post, _id}: Post) => {
console.log(post)
if (!post.startsWith(`@wlod-bot`)) return;
ml.sendMessage({
message: 'hello',
replyTo: _id
})
})
|