Coder Social home page Coder Social logo

sayakie / hakase Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 19.85 MB

Discord bot to let y'all explore Pixelmon Pokémon information built around Discord Interactions.

License: MIT License

JavaScript 5.62% TypeScript 92.90% Dockerfile 1.48%
pixelmon pokemon pokedex pixelmon-reforged bot discord discord-bots discord-js-bot hacktoberfest pokedex-application

hakase's Issues

Hakase Refactoring Roadmap

Roadmap Preview

디스코드 Basixlounge 서버에서 받은 코드 리뷰를 토대로 리팩토링 로드맵을 작성했습니다.
아래의 코드를 전부 리팩토링하는 것이 이 로드맵의 최종 목표입니다.

  • 누락된 return 추가하기
    [File]: PokemonUtil.ts#L151

  • PokemonUtil.ts에서 반복되는 importing 작업을 초기화 페이즈만을 담당하는 다른 파일로 옮기기
    [Files]: PokemonUtil.ts#L12-#L58

  • 인스턴스화를 방지하기 위해 클래스에 null을 확장하는 것을 걷어내기
    [Benefits]: UB에 준하는 동작을 미리 걷어냄으로써 미래에 야기될 수 있는 문제를 방지합니다.
    [Drawbacks]: 타입스크립트를 컴파일한 뒤 런타임에서 클래스를 인스턴스화 할 수 있습니다.
    [Files]: ArrayUtil.ts#L5 / Util.ts#L871 / PokemonUtil.ts#L101
    [Reference]: tc39/ecma262#1321

  • 조사(은는이가)를 구하는 함수를 문자열 헬퍼 함수를 제공하는 StringUtil.ts 파일에 따로 분리시키기
    [File]: PokemonUtil.ts#L73-#L99

  • 타입 단언한 코드들을 타입 추론으로 옮기기
    [Benefits]: 타입을 명시하는 의미가 더 명확해집니다.

=== Example)
- const dropItemLengthOrder = {} as { [P in Extract<keyof PokeDrop, `${string}data`>]: number }
+ const dropItemLengthOrder: { [P in Extract<keyof PokeDrop, `${string}data`>]: number } = {}

Provide variant, or alter forms (gigantamax) description

⭐ Suggestion

Each Pokémons have its unique variance forms like mega, alolan, galarian, hisuian, or gigantamax. The Pokedex has a detailed description, but at the same time, Hakase does not have a description.

So I suggest that it would be good to provide more detailed information to users.

Examples

Input  > /Pokemon Charizard
Output > It spits fire that is hot enough to melt boulders. It may cause forest fires by blowing flames.
Input  > /Pokemon Charizard (Mega-X)
Output > The overwhelming power that fills its entire body causes it to turn black and creates intense blue flames.
Input  > /Pokemon Charizard (Gigantamax)
Output > This colossal, flame-winged figure of a Charizard was brought about by Gigantamax energy.

Additional Informative

  • Proposer: 윤동현 on the Discord

Relevant Issues

No context

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset is invalid JSON (github>dareharu/renovate-config)

pokedex on every species is broken

Why..

public static readonly MissingNo = this.#impl.of(0, `MissingNo`)
public static readonly Bulbasaur = this.#impl.of(1, `Bulbasaur`)
public static readonly Ivysaur = this.#impl.of(2, `Ivysaur`)
public static readonly Venusaur = this.#impl.of(3, `Venusaur`)
public static readonly Charmander = this.#impl.of(4, `Charmander`)
public static readonly Charmeleon = this.#impl.of(5, `Charmeleon`)
public static readonly Charizard = this.#impl.of(6, `Charizard`)
public static readonly Squirtle = this.#impl.of(7, `Squirtle`)
public static readonly Wartortle = this.#impl.of(8, `Wartortle`)
public static readonly Blastoise = this.#impl.of(9, `Blastoise`)
public static readonly Caterpie = this.#impl.of(0, `Caterpie`)
public static readonly Metapod = this.#impl.of(1, `Metapod`)
public static readonly Butterfree = this.#impl.of(2, `Butterfree`)
public static readonly Weedle = this.#impl.of(3, `Weedle`)
public static readonly Kakuna = this.#impl.of(4, `Kakuna`)
public static readonly Beedrill = this.#impl.of(5, `Beedrill`)
public static readonly Pidgey = this.#impl.of(6, `Pidgey`)
public static readonly Pidgeotto = this.#impl.of(7, `Pidgeotto`)
public static readonly Pidgeot = this.#impl.of(8, `Pidgeot`)
public static readonly Rattata = this.#impl.of(9, `Rattata`)
public static readonly Raticate = this.#impl.of(0, `Raticate`)
public static readonly Spearow = this.#impl.of(1, `Spearow`)
public static readonly Fearow = this.#impl.of(2, `Fearow`)
public static readonly Ekans = this.#impl.of(3, `Ekans`)
public static readonly Arbok = this.#impl.of(4, `Arbok`)
public static readonly Pikachu = this.#impl.of(5, `Pikachu`)
public static readonly Raichu = this.#impl.of(6, `Raichu`)
public static readonly Sandshrew = this.#impl.of(7, `Sandshrew`)
public static readonly Sandslash = this.#impl.of(8, `Sandslash`)

`Species.legendaries` and `Species.ultrabeasts` always return an empty array

Reading Species#legendaries and Species#ultrabests will always return an empty array that its length is 0.

protected static readonly legendaries: Species[] = []
protected static readonly ultrabeasts: Species[] = []

This is caused by SpeciesImpl static initialization step just concats an array, and not set again.

static {
Species.legendaries.concat([
Species.MissingNo,
/** Generation 1 */
Species.Articuno,
Species.Zapdos,
Species.Moltres,
Species.Mewtwo,
Species.Mew,
/** Generation 2 */
Species.Raikou,
Species.Entei,
Species.Suicune,
Species.Lugia,
Species.Hooh,
Species.Celebi,
/** Generation 3 */
Species.Regirock,
Species.Regice,
Species.Registeel,
Species.Latias,
Species.Latios,
Species.Kyogre,
Species.Groudon,
Species.Rayquaza,
Species.Jirachi,
/** Generation 4 */
Species.Uxie,
Species.Mesprit,
Species.Azelf,
Species.Dialga,
Species.Palkia,
Species.Heatran,
Species.Regigigas,
Species.Giratina,
/** Generation 5 */
Species.Cobalion,
Species.Terrakion,
Species.Virizion,
Species.Tornadus,
Species.Thundurus,
Species.Landorus,
/** Generation 6 */
Species.Xerneas,
Species.Yveltal,
Species.Zygarde,
Species.Diancie,
Species.Hoopa,
Species.Volcanion,
/** Generation 7 */
Species.TypeNull,
Species.Silvally,
Species.TapuKoko,
Species.TapuLele,
Species.TapuBulu,
Species.TapuFini,
Species.Cosmog,
Species.Cosmoem,
Species.Solgaleo,
Species.Lunala,
Species.Necrozma,
Species.Marshadow,
Species.Magearna,
Species.Zeraora,
Species.Meltan,
Species.Melmetal,
/** Generation 8 */
Species.Zacian,
Species.Zamazenta,
Species.Eternatus,
Species.Kubfu,
Species.Urshifu,
Species.Zarude,
Species.Regieleki,
Species.Regidrago,
Species.Glastrier,
Species.Spectrier,
Species.Calyrex
])
Species.ultrabeasts.concat([
Species.Blacephalon,
Species.Buzzwole,
Species.Celesteela,
Species.Guzzlord,
Species.Poipole,
Species.Naganadel,
Species.Nihilego,
Species.Pheromosa,
Species.Kartana,
Species.Stakataka,
Species.Xurkitree
])
}

Circular dependency error

All variant forms(EnumAegislash, EnumAlcremie, etc...) throw a reference error like the following output:

ReferenceError: Cannot access 'FormBelongToSpecies' before initialization

Note: We use Node.js but do not follow the CommonJS module system (instead ECMAScript module system)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.