Skip to content

Commit

Permalink
change minimum request time and import env on register commands
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Sep 23, 2023
1 parent 78d22c3 commit 8e769ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion discord-bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const finishInteraction = () => {
export const handler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {
const CURRENT_TIME = new Date()
// Keeping only the date and minutes to avoid spamming the faucet (reduce the number of digit to reduce time between requests)
const REQUEST_DATE = CURRENT_TIME.toISOString().slice(0, 16) // Minutes precision
const REQUEST_DATE = CURRENT_TIME.toISOString().slice(0, 10) // Daily precision
const STATS_DATE = CURRENT_TIME.toISOString().slice(0, 10) // Daily precision

const ed25519 = event.headers['x-signature-ed25519']
Expand Down
5 changes: 4 additions & 1 deletion discord-bot/src/register-commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import * as dotenv from 'dotenv'
dotenv.config()

import { REST, Routes } from 'discord.js'
import { config, commands } from './utils'
import { commands, config } from './utils'

//interact with API
const rest = new REST({ version: '10' }).setToken(config.TOKEN)
Expand Down

0 comments on commit 8e769ce

Please sign in to comment.