Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1017988 // telegram_sendVoiceMessageWithLogging

JavaX fragment (include)

svoid telegram_sendVoiceMessageWithLogging(TelegramLongPollingBot bot, long chatID, S text, S voice, S globalID) ctex {
  Map map = litorderedmap(
    type := 'sending,
    voice := 'voice,
    date := localDateWithMilliseconds(),
    toChatID := chatID,
    +globalID,
    +text);
    
  File audioFile;
  if (endsWith(voice, " raw")) {
    voice = assertCereprocVoice(dropSuffixTrim("raw", voice));
    audioFile = cereproc_raw_silent(voice, text);
  } else {
    assertCereprocVoice(voice);
    audioFile = cereproc_silent(voice, text);
  }

  new SendVoice sending;
  sending.setNewVoice(audioFile);
  sending.setChatId(chatID);
  bot.sendVoice(sending);
  
  map.put(type := 'sent);
  map.put(date := localDateWithMilliseconds());
  logStructure(telegramLogFile(), printStruct(map));
}

Author comment

Began life as a copy of #1017516

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017988
Snippet name: telegram_sendVoiceMessageWithLogging
Eternal ID of this version: #1017988/3
Text MD5: cf87a3fd7eeacec880f8436f193be5ef
Author: stefan
Category: javax / networking
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-25 20:58:00
Source code size: 816 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 299 / 316
Version history: 2 change(s)
Referenced in: [show references]