Skip to content

Commit

Permalink
Swap to ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon324 committed Aug 22, 2020
1 parent 8ec8339 commit 90e330b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tabbed-chatlog",
"title": "Tabbed Chatlog",
"description": "Splits the Chatlog into In Character (per scene), Rolls (per scene), and Out of Character (global).",
"version": "1.3.1",
"version": "1.3.2",
"minimumCoreVersion": "0.6.2",
"compatibleCoreVersion": "0.7.1",
"author": "Cody Swendrowski <[email protected]>",
Expand All @@ -24,5 +24,5 @@
],
"url": "https://github.com/cswendrowski/FoundryVTT-tabbed-chatlog",
"manifest": "https://github.com/cswendrowski/FoundryVTT-tabbed-chatlog/releases/download/latest/module.json",
"download": "https://github.com/cswendrowski/FoundryVTT-tabbed-chatlog/releases/download/1.3.0/module.zip"
"download": "https://github.com/cswendrowski/FoundryVTT-tabbed-chatlog/releases/download/1.3.2/module.zip"
}
39 changes: 23 additions & 16 deletions tabbed-chatlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,17 @@ Hooks.on("createChatMessage", (chatMessage, content) => {

img = game.data.addresses.remote + "/" + img;

fetch(webhook, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
content: chatMessage.data.content,
username: actor.name,
avatar_url: img
})
$.ajax({
type: 'POST',
url: webhook,
data: JSON.stringify({
content: chatMessage.data.content,
username: actor.name,
avatar_url: img
}),
success: function(data) {},
contentType: "application/json",
dataType: 'json'
});
}
catch {}
Expand All @@ -195,14 +198,18 @@ Hooks.on("createChatMessage", (chatMessage, content) => {
let img = chatMessage.user.avatar;
img = game.data.addresses.remote + "/" + img;

fetch(webhook, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
content: chatMessage.data.content,
username: chatMessage.user.name,
avatar_url: img
})

$.ajax({
type: 'POST',
url: webhook,
data: JSON.stringify({
content: chatMessage.data.content,
username: chatMessage.user.name,
avatar_url: img
}),
success: function(data) {},
contentType: "application/json",
dataType: 'json'
});
}
catch {}
Expand Down

0 comments on commit 90e330b

Please sign in to comment.