daily pastebin goal
82%
SHARE
TWEET

Untitled

a guest Dec 19th, 2018 198 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private ChatWithBot[long] chats;
  2.  
  3. ChatWithBot createChat(Update u)
  4. {
  5.     const chatId = u.chatId;
  6.     ChatWithBot ret;
  7.  
  8.     ChatWithBot* found = (chatId in chats);
  9.  
  10.     if(found is null)
  11.     {
  12.         ret = new ChatWithBot(u);
  13.         chats[chatId] = ret;
  14.     }
  15.     else
  16.     {
  17.         ret = *found;
  18.         import std.stdio; writeln(ret);
  19.         ret.incUpdate(u);
  20.     }
  21.  
  22.     return ret;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top