Skip to content

Commit

Permalink
Remove Archidekt support (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
papey authored Dec 27, 2024
1 parent be93757 commit 59959bc
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 659 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM node:lts-bullseye AS builder
RUN apt-get update -y \
&& apt-get upgrade -y

ENV YARN_VERSION=1.22.4
ENV YARN_VERSION=1.22.22

# Create src dir
RUN mkdir /opt/trostani
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ various [Magic: The Gathering Arena](https://magic.wizards.com/fr/mtgarena)
related features such as tournament management using Challonge and decklist
sync to a online builder.

Trostani builder list :

- [Archidekt](https://www.archidekt.com/)
- [ManaStack](https://manastack.com)
Trostani builder is [ManaStack](https://manastack.com)

## Getting Started

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trostani",
"version": "0.4.24",
"version": "0.5.0",
"description": "A Typescript Discord bot knowing stuff about MtG",
"repository": "[email protected]:papey/trostani.git",
"author": "papey",
Expand All @@ -17,24 +17,24 @@
"crypto-js": "^4.2.0",
"discord.js": "^14.1.2",
"log4js": "^6.4.0",
"scryfall-sdk": "^4.0.0",
"scryfall-sdk": "^5.0.2",
"yamljs": "^0.3.0",
"yargs": "^17.0.0"
},
"devDependencies": {
"@testdeck/mocha": "^0.3.0",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.7",
"@types/node": "^20.4.5",
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.1",
"@types/node": "^22.10.2",
"@types/request": "^2.48.3",
"@types/request-promise": "^4.1.44",
"@types/ws": "^8.0.0",
"@types/yamljs": "^0.2.30",
"@types/yargs": "^17.0",
"chai": "^4.2.0",
"chai": "^5.1.2",
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.3",
"mocha": "^10.7.0",
"mocha": "^11.0.1",
"source-map-support": "^0.5.13",
"ts-node": "^10.9.2",
"typescript": "^5.1.6"
Expand Down
10 changes: 7 additions & 3 deletions src/bot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// bot.ts file, containing all stuff needed to interact with Discord

// Imports
import { Partials, IntentsBitField, Client, Message } from "discord.js";
import Scry = require("scryfall-sdk");
import { Partials, IntentsBitField, Client, Message, TextChannel } from "discord.js";
import { Command, handleNotSupported } from "./commands/utils";
import { handleProfile } from "./commands/profile";
import { handleHelp } from "./commands/help";
Expand Down Expand Up @@ -108,11 +109,14 @@ export class Trostani {
// error goes in stdout as well as Discord channel
this.logger.error(error);
// send error to Discord channel
message.channel.send(`**${error.message}**`);
(message.channel as TextChannel).send(`**${error.message}**`);
}

// Setup client
private setup() {
// Set header for Scryfall
Scry.setAgent('trostani', '0.5.0')

// When client is ready
this.client.on("ready", () => {
// Set activity, name and basic stuff
Expand Down Expand Up @@ -154,7 +158,7 @@ export class Trostani {
}
// check translate config
if (this.config.settings.translate == undefined) {
if (this.config.settings.translate.typeof() != Boolean) {
if (this.config.settings?.translate.typeof() != Boolean) {
this.config.settings.translate = false;
console.warn(
"Translate function not found or not set to `True` or `False`, defaulted to `False`"
Expand Down
277 changes: 0 additions & 277 deletions src/builders/archidekt.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/builders/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// Imports
import { Deck, Metadata } from "../scry/mtg";
import { Archidekt } from "./archidekt";
import { MS } from "./ms";

// Builder base interface
Expand Down Expand Up @@ -40,9 +39,6 @@ export function newBuilder(
case "manastack":
return new MS(user, password);

case "archidekt":
return new Archidekt(user, password);

default:
throw new Error(`Builder ${kind} not supported`);
}
Expand Down
Loading

0 comments on commit 59959bc

Please sign in to comment.