回答編集履歴

3

修正

2021/01/22 02:47

投稿

macaron_xxx
macaron_xxx

スコア3191

test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  function send_line(Me){
6
6
 
7
- const messages = Me.match(/(.|\s|\S){1,1000}/g);
7
+ const messages = Me.match(/[.\s\S]{1,1000}/g);
8
8
 
9
9
  messages.forEach(message => {
10
10
 

2

正規表現を修正。

2021/01/22 02:47

投稿

macaron_xxx
macaron_xxx

スコア3191

test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  function send_line(Me){
6
6
 
7
- const messages = Me.match(/.{1,1000}/g);
7
+ const messages = Me.match(/(.|\s|\S){1,1000}/g);
8
8
 
9
9
  messages.forEach(message => {
10
10
 

1

修正

2021/01/22 02:46

投稿

macaron_xxx
macaron_xxx

スコア3191

test CHANGED
@@ -4,23 +4,21 @@
4
4
 
5
5
  function send_line(Me){
6
6
 
7
- var options ={
8
-
9
- "method" : "post",
10
-
11
- "payload" : payload,
12
-
13
- "headers" : {"Authorization" : "Bearer "+ lineToken}
14
-
15
- };
16
-
17
-
18
-
19
7
  const messages = Me.match(/.{1,1000}/g);
20
8
 
21
9
  messages.forEach(message => {
22
10
 
23
11
  var payload = {'message' : message};
12
+
13
+ var options ={
14
+
15
+ "method" : "post",
16
+
17
+ "payload" : payload,
18
+
19
+ "headers" : {"Authorization" : "Bearer "+ lineToken}
20
+
21
+ };
24
22
 
25
23
  UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options);
26
24