steamutils 1.2.37 → 1.2.39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/SteamClient.js +5 -1
  2. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -1104,6 +1104,9 @@ function SteamClient({
1104
1104
  })
1105
1105
 
1106
1106
  steamClient.chat.on('friendMessage', async (data) => {
1107
+ if (!data) return
1108
+ data.message_no_bbcode = data.message_no_bbcode?.replaceAll(`ː`,`:`)
1109
+ data.message = data.message?.replaceAll(`ː`,`:`)
1107
1110
  const example = {
1108
1111
  "steamid_friend": {
1109
1112
  "universe": 1,
@@ -1127,8 +1130,8 @@ function SteamClient({
1127
1130
  const steamId = data.steamid_friend.getSteamID64()
1128
1131
  const personas = await getPersonas([steamId])
1129
1132
  const player_name = personas.find(p => p.id == steamId)?.player_name || ''
1130
- log('friendMessage', data)
1131
1133
  const invite = [`Invited you to play a game!`, `Đã mời bạn chơi một trò chơi!`].includes(data.message_no_bbcode || data.message)
1134
+ const emotion = (data.message_no_bbcode || '').split(' ').find(m => m.startsWith(':') && m.endsWith(':'))
1132
1135
 
1133
1136
  callEvent(events.friendMessage, {
1134
1137
  player_name,
@@ -1137,6 +1140,7 @@ function SteamClient({
1137
1140
  steamId,
1138
1141
  timestamp,
1139
1142
  from_limited_account: data.from_limited_account,
1143
+ emotion,
1140
1144
  })
1141
1145
 
1142
1146
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.37",
3
+ "version": "1.2.39",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.4.0",