SHARE
TWEET

Untitled

HemulGM Feb 26th, 2020 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure TFormMain.FormCreate(Sender: TObject);
  2. begin
  3.   FCensorWords.LoadFromFile('censor.txt', TEncoding.UTF8);
  4.   VK.Login;
  5.   VkGroupEvents.Start;
  6. end;
  7.  
  8. procedure TFormMain.VKAuth(Sender: TObject; var Token: string);
  9. begin
  10.   {$INCLUDE token.inc}
  11. end;
  12.  
  13. function TFormMain.CheckForCensor(Value: string): Boolean;
  14. begin
  15.   for var i := 0 to FCensorWords.Count - 1 do
  16.     if Value.Contains(FCensorWords[i]) then Exit(True);
  17. end;
  18.  
  19. procedure TFormMain.VkGroupEventsMessageNew(Sender: TObject; GroupId: Integer; Message: TVkMessage);
  20. begin
  21.   if (not Message.Text.IsEmpty) and CheckForCensor(Message.Text) then
  22.     VK.Messages.Send(Message.PeerId, 'Давай без мата, ок?');
  23. end;
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