# getEncounterText | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Function getEncounterText

- getEncounterText(keyOrString?: string, primaryStyle?: TextStyle ): null | string

  Will inject all relevant dialogue tokens that exist in the BattlegScene.currentBattle.mysteryEncounter.dialogueTokens, into i18n text. Also adds BBCodeText fragments for colored text, if applicable

  #### Parameters

  - `Optional` keyOrString: string
  - `Optional` primaryStyle: TextStyle

    Can define a text style to be applied to the entire string. Must be defined for BBCodeText styles to be applied correctly

  #### Returns null | string

  - Defined in src/data/mystery-encounters/utils/encounter-dialogue-utils.ts:14