@wppconnect/wa-js - v4.6.0
    Preparing search index...

    Function stripUsernamePrefix

    • Remove the leading @ from a username, if present

      WhatsApp accepts a prefixed username but logs a warning and reports it, so always strip it before handing the value to a native function.

      Parameters

      • username: string

      Returns string

      stripUsernamePrefix('@someusername'); // 'someusername'
      stripUsernamePrefix('someusername'); // 'someusername'