-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.ts
48 lines (41 loc) · 1.28 KB
/
test.ts
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { NonThreadGuildBasedChannel, TextChannel } from "discord.js";
import { client } from "./commands/client";
import config from "./config/config.json";
console.log(config.token);
// Finally, WriterBot Begins
client.on("ready", async () => {
// Every 5 seconds
console.log("ready");
//startWebUi();
console.log(
`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`
);
client.user?.setPresence({ activities: [{ name: "Drawing/Writing" }] });
const status = "1011284410345205820";
const guild = "989166996153323591";
client.guilds.fetch(guild).then((g) =>
g.channels.fetch(status).then(
async (c: NonThreadGuildBasedChannel | null) =>
c &&
c.isText() &&
!!(await c.send({
content: "test login",
}))
)
);
console.log("starting servers");
console.log("fin started servers");
});
client.on("shardError", (error) => {
console.error("A websocket connection encountered an error:", error);
});
console.log("attempting logon");
const login = async () => {
console.log("logging in");
await client
.login(config.token)
.catch(console.log)
.then(() => console.log("logged in"));
};
login();
console.log("wtf is happening");