【发布时间】:2021-05-17 04:38:21
【问题描述】:
我遇到了 TypeScript 编译器的问题,该编译器在 17、5 中需要 :,但我不明白为什么以及在哪里放置它,我的代码:
import { Client , TextChannel } from "discord.js";
module.exports = {
name: "ready",
run: async(client: Client) => {
client.user.setPresence({
activities: [{
name: "Aun en beta!"
}],
status: "idle"
})
let str = `-- censored --`
let channel: TextChannel;
channel = client.channels.cache.get('-- censored --')?
channel.send (str)
}
}
【问题讨论】:
-
channel = client.channels.cache.get('-- censored --')?为什么末尾有??你想要;代替吗?
标签: javascript typescript tsc