idk
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
### Building and running your application
|
|
||||||
|
|
||||||
When you're ready, start your application by running:
|
|
||||||
`docker compose up --build`.
|
|
||||||
|
|
||||||
Your application will be available at http://localhost:8080.
|
|
||||||
|
|
||||||
### Deploying your application to the cloud
|
|
||||||
|
|
||||||
First, build your image, e.g.: `docker build -t myapp .`.
|
|
||||||
If your cloud uses a different CPU architecture than your development
|
|
||||||
machine (e.g., you are on a Mac M1 and your cloud provider is amd64),
|
|
||||||
you'll want to build the image for that platform, e.g.:
|
|
||||||
`docker build --platform=linux/amd64 -t myapp .`.
|
|
||||||
|
|
||||||
Then, push it to your registry, e.g. `docker push myregistry.com/myapp`.
|
|
||||||
|
|
||||||
Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/)
|
|
||||||
docs for more detail on building and pushing.
|
|
||||||
|
|
||||||
### References
|
|
||||||
* [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"startup_messages": ["I'm online!"]
|
"startup_messages": ["I'm online!", "Hello world!", "Hi there!"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "./events/preload"
|
||||||
import dotenv from "dotenv"
|
import dotenv from "dotenv"
|
||||||
|
|
||||||
dotenv.config({ quiet: true })
|
dotenv.config({ quiet: true })
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js"
|
|||||||
export const data = new SlashCommandBuilder().setName("ping").setDescription("Replies with Pong!")
|
export const data = new SlashCommandBuilder().setName("ping").setDescription("Replies with Pong!")
|
||||||
|
|
||||||
export const exec = async (interaction: ChatInputCommandInteraction) => {
|
export const exec = async (interaction: ChatInputCommandInteraction) => {
|
||||||
await interaction.reply("Pong!")
|
await interaction.reply(["Pong!", "# Client "].join("\n"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { ActivityType } from "discord.js"
|
import { ActivityType } from "discord.js"
|
||||||
import { client } from "../components/client"
|
import { client } from "../components/client"
|
||||||
import config from "../components/config"
|
import config from "../components/config"
|
||||||
|
import { execCmds } from "../cmd"
|
||||||
|
|
||||||
client.on("clientReady", async client => {
|
client.on("clientReady", async client => {
|
||||||
try {
|
try {
|
||||||
console.log(`Logged in as ${client.user?.tag}`)
|
console.info(`Logged in as ${client.user?.tag}`)
|
||||||
|
console.info(`${execCmds.size} commands loaded.`)
|
||||||
|
|
||||||
client.user.setActivity({
|
client.user.setActivity({
|
||||||
name: "Docker",
|
name: "Docker",
|
||||||
|
|||||||
12
src/events/preload.ts
Normal file
12
src/events/preload.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
const time = Date.now()
|
||||||
|
|
||||||
|
const log = new Map<string, (...args: any[]) => void>()
|
||||||
|
const keys = Object.keys(console).filter(key => !key.includes("time"))
|
||||||
|
|
||||||
|
keys.forEach(key => {
|
||||||
|
const func: (...args: any[]) => void = (console as any)[key]
|
||||||
|
log.set(key, func)
|
||||||
|
;(console as any)[key] = (...args: any[]) => {
|
||||||
|
log.get(key)?.(`[${Date.now() - time}ms] [${key.toUpperCase()}]`, ...args)
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user