Change names and format codes

This commit is contained in:
Helloyunho 2020-11-08 16:58:24 +09:00
parent 0950279282
commit 5256f05f04
15 changed files with 303 additions and 232 deletions

View file

@ -1,41 +1,43 @@
import { Client, Message, Intents } from '../mod.ts'
const client = new Client();
const client = new Client()
client.on("ready", () => {
console.log(`Logged in as ${client.user?.tag}!`);
});
client.on('ready', () => {
console.log(`Logged in as ${client.user?.tag}!`)
})
client.on("messageCreate", (msg: Message) => {
if (msg.content === "!ping") {
console.log("Command Used: Ping");
msg.reply("pong!");
}
});
client.on('messageCreate', (msg: Message) => {
if (msg.content === '!ping') {
console.log('Command Used: Ping')
msg.reply('pong!')
}
})
console.log("discord.deno - ping example");
console.log('harmony - ping example')
const token = prompt("Input Bot Token:");
const token = prompt('Input Bot Token:')
if (token === null) {
console.log("No token provided");
Deno.exit();
console.log('No token provided')
Deno.exit()
}
const intents = prompt("Input Intents (0 = All, 1 = Presence, 2 = Server Members, 3 = None):");
if (intents === null || !["0", "1", "2", "3"].includes(intents)) {
console.log("No intents provided");
Deno.exit();
const intents = prompt(
'Input Intents (0 = All, 1 = Presence, 2 = Server Members, 3 = None):'
)
if (intents === null || !['0', '1', '2', '3'].includes(intents)) {
console.log('No intents provided')
Deno.exit()
}
let ints;
if (intents === "0") {
ints = Intents.All;
} else if (intents === "1") {
ints = Intents.Presence;
} else if (intents === "2") {
ints = Intents.GuildMembers;
let ints
if (intents === '0') {
ints = Intents.All
} else if (intents === '1') {
ints = Intents.Presence
} else if (intents === '2') {
ints = Intents.GuildMembers
} else {
ints = Intents.None;
ints = Intents.None
}
client.connect(token, ints);
client.connect(token, ints)