-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtrello-init.server.lua
84 lines (65 loc) · 2.46 KB
/
trello-init.server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--[[
Name: trello-init.server.lua
From roblox-trello v2
Description: Performs some testing on the Trello v2 features.
Copyright (c) 2019 Luis, David Duque
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
--]]
local Trello = require(game.ServerScriptService.Trello)
local TrelloClass = require(game.ServerScriptService.Trello.TrelloClass)
wait(2)
-----------------------------------------------------
-- MAKE SURE TO CHANGE THESE WITH YOUR OWN VALUES! --
-----------------------------------------------------
local id = Trello.new("API KEY", "API TOKEN")
local board1 = TrelloClass.Board.new(id, "My Awesome Private Board")
print(board1.RemoteId)
local board2 = TrelloClass.Board.new(id, "My Awesome Explicit Private Board", false)
print(board2.RemoteId)
local board3 = TrelloClass.Board.new(id, "My Awesome Public Board", true)
print(board3.RemoteId)
local myAwesomeBoard = TrelloClass.Board.fromRemote(id, board1.RemoteId)
for i, v in pairs(myAwesomeBoard) do
print(i .. ": ".. tostring(v))
end
board1:Delete()
board2:Delete()
board3:Delete()
boardIWillEdit = TrelloClass.Board.new(id, "This")
print("Waiting 3 seconds until starting to edit...")
wait(3)
print("Editing.")
print(boardIWillEdit.RemoteId)
boardIWillEdit.Name = "Maybe this name is cooler!"
boardIWillEdit.Description = "Hey, what about we oof?"
boardIWillEdit.Public = true
print("Changing name and description, making it public.")
boardIWillEdit:Commit()
wait(10)
boardIWillEdit.Public = false
print("Making it private again.")
boardIWillEdit:Commit()
wait(3)
boardIWillEdit.Closed = true
print("Closing the board.")
boardIWillEdit:Commit()
wait(3)
boardIWillEdit.Closed = false
print("Reopening the board.")
boardIWillEdit:Commit()
boardIWillEdit:Commit()
print("Force committing this time.")
boardIWillEdit:Commit(true)
wait(3)
print("Deleting the board.")
boardIWillEdit:Delete()
-- Was also board1, should return a 404.
myAwesomeBoard:Delete()
warn("TEST END.")