TalkMessageType.php 1013 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Constant;
  4. /**
  5. * Class TalkMessageType
  6. *
  7. * @package App\Constants
  8. */
  9. class TalkMessageType
  10. {
  11. const SYSTEM_TEXT_MESSAGE = 0; //系统文本消息
  12. const TEXT_MESSAGE = 1; //文本消息
  13. const FILE_MESSAGE = 2; //文件消息
  14. const FORWARD_MESSAGE = 3; //会话消息
  15. const CODE_MESSAGE = 4; //代码消息
  16. const VOTE_MESSAGE = 5; //投票消息
  17. const GROUP_NOTICE_MESSAGE = 6; //群组公告
  18. const FRIEND_APPLY_MESSAGE = 7; //好友申请
  19. const USER_LOGIN_MESSAGE = 8; //登录通知
  20. const GROUP_INVITE_MESSAGE = 9; //入群退群消息
  21. const LOCATION_MESSAGE = 10; //位置消息(预留)
  22. /**
  23. * 获取可转发的消息类型列表
  24. *
  25. * @return array
  26. */
  27. public static function getForwardTypes(): array
  28. {
  29. return [
  30. self::TEXT_MESSAGE,
  31. self::FILE_MESSAGE,
  32. self::CODE_MESSAGE
  33. ];
  34. }
  35. }