async executeForDiscord(message) {
    // Inherited function with various possible implementations, some args may be unused.
    /* eslint no-unused-vars: ["error", { "args": "none" }] */

    const params = {
      text: this.text ? this.text.replace(/^"(.*)"$/, '$1') : undefined,
      fontSize: this.fontSize,
      xShift: this.xShift,
      yShift: this.yShift
    };

    try {
      const imageResult = await this.context.imageGenerator.generateImage(this.imgUrl, params, this.parsedJsonConfig,
        this.source, this.orgId);
      const filePath = `images/${uuidv4()}.jpg`;
      imageResult.write(filePath);
      await message.originalMessage.channel.send(null, {
        files: [filePath]
      });

      await fs.unlink(filePath, (err) => {
        if (err) {
          this.context.log.e(`Failed to delete file ${filePath}. Error: ${err}`);
        }
      });

    } catch (e) {
      this.context.log.e(this.name + ': Cannot make image: ' + e.stack);
      return this.langManager.getString('command_makeimage_error_broken_template', this.templateName, e.message);
    }
  }
/**
   * Executes the command instance. The main function of a command, it's essence.
   * All arguments scanning, validation and permissions check is considered done before entering this function.
   * So if any exception happens inside the function, it's considered a Bot's internal problem.
   * @param  {BaseMessage}         message the Discord message as the source of the command
   * @return {Promise<string>}             the result text to be replied as the response of the execution
   */
Executes the command instance. The main function of a command, it's essence.
All arguments scanning, validation and permissions check is considered done before entering this function.
So if any exception happens inside the function, it's considered a Bot's internal problem.
@param  {BaseMessage}         message the Discord message as the source of the command
@return {Promise}             the result text to be replied as the response of the execution
Executes the command instance . The main function of a command it ' s essence . All arguments scanning validation and permissions check is considered done before entering this function . So if any exception happens inside the function it ' s considered a Bot ' s internal problem . @param { BaseMessage } message the Discord message as the source of the command @return { Promise } the result text to be replied as the response of the execution
async executeForDiscord(message) {
    const params = {
      text: this.text ? this.text.replace(/^"(.*)"$/, '$1') : undefined,
      fontSize: this.fontSize,
      xShift: this.xShift,
      yShift: this.yShift
    };
    try {
      const imageResult = await this.context.imageGenerator.generateImage(this.imgUrl, params, this.parsedJsonConfig,
        this.source, this.orgId);
      const filePath = `images/${uuidv4()}.jpg`;
      imageResult.write(filePath);
      await message.originalMessage.channel.send(null, {
        files: [filePath]
      });
      await fs.unlink(filePath, (err) => {
        if (err) {
          this.context.log.e(`Failed to delete file ${filePath}. Error: ${err}`);
        }
      });
    } catch (e) {
      this.context.log.e(this.name + ': Cannot make image: ' + e.stack);
      return this.langManager.getString('command_makeimage_error_broken_template', this.templateName, e.message);
    }
  }
async executeForDiscord ( message ) { const params = { text : this . text ? this . text . replace ( / ^"(.*)"$ / , '$1' ) : undefined , fontSize : this . fontSize , xShift : this . xShift , yShift : this . yShift } ; try { const imageResult = await this . context . imageGenerator . generateImage ( this . imgUrl , params , this . parsedJsonConfig , this . source , this . orgId ) ; const filePath = ` ${ uuidv4 ( ) } ` ; imageResult . write ( filePath ) ; await message . originalMessage . channel . send ( null , { files : [ filePath ] } ) ; await fs . unlink ( filePath , ( err ) => { if ( err ) { this . context . log . e ( ` ${ filePath } ${ err } ` ) ; } } ) ; } catch ( e ) { this . context . log . e ( this . name + ': Cannot make image: ' + e . stack ) ; return this . langManager . getString ( 'command_makeimage_error_broken_template' , this . templateName , e . message ) ; } }
Executes the command instance.
Executes the command instance .
// Inherited function with various possible implementations, some args may be unused. /* eslint no-unused-vars: ["error", { "args": "none" }] */