Compare commits

..

No commits in common. "53656ba0da53a8b4e694be85ea2d0768ed700e9c" and "976445fa0d34bb4adc108385d8425c65bb9f70ed" have entirely different histories.

5 changed files with 4 additions and 22 deletions

View file

@ -7,7 +7,7 @@
# any secret values.
BOT_TOKEN=
BOT_VER=0.6.4
BOT_VER=0.6.3
BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=682942374040961060

View file

@ -1,6 +1,6 @@
{
"name": "card-drop",
"version": "0.6.4",
"version": "0.6.3",
"main": "./dist/bot.js",
"typings": "./dist",
"scripts": {

View file

@ -31,6 +31,8 @@ export default class Claim extends ButtonEvent {
return;
}
await user.Save(User, user);
const claimed = await eClaim.FetchOneByClaimId(claimId);
if (claimed) {
@ -43,8 +45,6 @@ export default class Claim extends ButtonEvent {
return;
}
await user.Save(User, user);
let inventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber);
if (!inventory) {

View file

@ -2,14 +2,11 @@ import { Interaction } from "discord.js";
import ChatInputCommand from "./interactionCreate/ChatInputCommand";
import Button from "./interactionCreate/Button";
import AppLogger from "./appLogger";
import NewUserDiscovery from "./interactionCreate/middleware/NewUserDiscovery";
export class Events {
public async onInteractionCreate(interaction: Interaction) {
if (!interaction.guildId) return;
await NewUserDiscovery(interaction);
if (interaction.isChatInputCommand()) {
AppLogger.LogVerbose("Client", `ChatInputCommand: ${interaction.commandName}`);
ChatInputCommand.onChatInput(interaction);

View file

@ -1,15 +0,0 @@
import { Interaction } from "discord.js";
import User from "../../../database/entities/app/User";
import CardConstants from "../../../constants/CardConstants";
import AppLogger from "../../appLogger";
export default async function NewUserDiscovery(interaction: Interaction) {
const existingUser = await User.FetchOneById(User, interaction.user.id);
if (existingUser) return;
const newUser = new User(interaction.user.id, CardConstants.StartingCurrency);
await newUser.Save(User, newUser);
AppLogger.LogInfo("NewUserDiscovery", `Discovered new user ${interaction.user.id}`);
}