-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.mjs
More file actions
32 lines (22 loc) · 999 Bytes
/
Copy pathindex.mjs
File metadata and controls
32 lines (22 loc) · 999 Bytes
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
import { Client as RevoltClient } from "revolt.js";
import { Client as DiscordClient, Intents } from "discord.js";
import dotenv from "dotenv"
dotenv.config()
let revoltClient = new RevoltClient();
let discordClient = new DiscordClient({intents: [Intents.FLAGS.DIRECT_MESSAGES]});
let user
async function getUser() {
user = await discordClient.user.fetch(process.env.DISCORD_USER)
}
revoltClient.on("ready", async () => {
console.log("Hello, world!")
})
revoltClient.on("message", async (message) => {
if (message.channel.channel_type == "DirectMessage" && message.author_id != revoltClient.user._id) {
console.log(message.content)
user.createDM().then((dmChannel) => {dmChannel.send(`From: ${message.author.username} \n ${message.content}`)})
}
})
revoltClient.loginBot(process.env.REVOLT_TOKEN)
discordClient.login(process.env.DISCORD_TOKEN)
discordClient.users.fetch(process.env.DISCORD_USER).then((result) => {user = result; console.log(user)})